{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "dd-flow/stage-finish-input@1",
  "title": "Semantic stage finish input",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_id", "status", "result", "acceptance", "checks", "evidence", "next_action"],
  "properties": {
    "schema_id": {"const": "dd-flow/stage-finish-input@1"},
    "status": {"enum": ["done", "waiting_for_user", "blocked", "failed"]},
    "result": {"type": "string", "minLength": 1},
    "acceptance": {"type": "array", "items": {"type": "string", "minLength": 1}},
    "changed_files": {"type": "array", "items": {"type": "string", "minLength": 1}},
    "checks": {"type": "array", "items": {"type": "string", "minLength": 1}},
    "evidence": {"type": "array", "items": {"type": "string", "minLength": 1}},
    "reviewer_findings": {"type": "array", "items": {"type": "string"}},
    "def_outcomes": {"type": "array", "items": {"type": "string"}},
    "questions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "question", "impact"],
        "properties": {
          "id": {"type": "string", "minLength": 1},
          "question": {"type": "string", "minLength": 1},
          "impact": {"type": "string", "minLength": 1},
          "recommendation": {"type": "string", "minLength": 1}
        }
      }
    },
    "next_action": {"type": "string", "minLength": 1}
  }
}
