{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "ReportRunManifest",
  "description": "Written by the orchestrator to properties/<slug>/.property/report-run.json at the end of a run. Accounts for every deliverable so 'all reports created' is provable and any blocked/skipped report is explicit rather than silently missing.",
  "type": "object",
  "additionalProperties": false,
  "required": ["property", "ranAt", "reports"],
  "properties": {
    "property": { "type": "string", "description": "Property slug/folder this run targeted." },
    "ranAt": { "type": "string", "description": "ISO-8601 timestamp." },
    "isolationBoundary": { "type": "string", "description": "Absolute or workspace-relative path of the single property folder this run was allowed to read/write (comparison runs list the explicitly named folders)." },
    "reports": {
      "type": "array",
      "description": "One entry per expected deliverable in the report matrix.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["advisor", "deliverable", "status"],
        "properties": {
          "advisor": {
            "type": "string",
            "enum": ["orchestrator", "neighborhood-advisor", "comparison-advisor", "loan-advisor", "insurance-advisor", "inspection-advisor"]
          },
          "deliverable": { "type": "string", "description": "Report/dashboard filename (prefixed) or logical name." },
          "path": { "type": ["string", "null"], "description": "Relative path to the produced file, or null when blocked/not_applicable." },
          "status": {
            "type": "string",
            "enum": ["created", "updated", "unchanged", "not_applicable", "blocked"]
          },
          "reason": { "type": ["string", "null"], "description": "Required when status is blocked or not_applicable: the missing input, access failure, or condition not met." }
        }
      }
    },
    "reconciliations": {
      "type": "array",
      "description": "Auto-refresh actions performed (e.g. insurance premium -> loan escrow).",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "trigger": { "type": "string" },
          "affected": { "type": "string" },
          "archivedTo": { "type": ["string", "null"] }
        }
      }
    },
    "openRisks": { "type": "array", "items": { "type": "string" } },
    "nextAction": { "type": "string" }
  }
}
