{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blackwalltier-com/json-schema/blackwalltier-com-outcome-report-schema.json",
  "title": "OutcomeReport",
  "description": "Body for PATCH /v1/forecast/{id}/outcome. Reports what actually\nhappened after the action ran (or after it was deliberately not run\nbecause of a STOP verdict). The `actual_outcome` object is free-form\njsonb on the server side, but the MCP `observe` tool and Black_Wall's\nadmin dashboard recognize the well-known fields below — using them\ngives consistent rendering and (later) accuracy-tracking analytics.\n",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blackwalltier-com-openapi.yaml#/components/schemas/OutcomeReport",
  "type": "object",
  "required": [
    "actual_outcome"
  ],
  "properties": {
    "actual_outcome": {
      "type": "object",
      "properties": {
        "outcome_class": {
          "type": "string",
          "enum": [
            "matched",
            "over_scope",
            "under_scope",
            "no_op",
            "diverged",
            "aborted"
          ],
          "description": "How the actual outcome compared to the prediction.\nmatched = exactly as predicted.\nover_scope = affected MORE than predicted (e.g. DELETE hit 1247 rows when 1 was expected).\nunder_scope = affected less than predicted.\nno_op = action ran but had no effect.\ndiverged = result was qualitatively different.\naborted = action was NOT taken (e.g. agent obeyed a STOP/HUMAN_REQUIRED verdict).\n"
        },
        "divergence_severity": {
          "type": "string",
          "enum": [
            "none",
            "low",
            "medium",
            "high",
            "critical"
          ],
          "description": "How bad the divergence was. Use `none` for `matched` or `aborted`."
        },
        "actual_targets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IDs / paths / hashes of what was actually affected."
        },
        "details": {
          "type": "string",
          "description": "Free-form details — error messages, observed side effects, etc.",
          "maxLength": 2000
        },
        "matched_prediction": {
          "type": "boolean",
          "description": "Deprecated boolean shortcut, kept for backward compatibility with the original\noutcome shape. Prefer `outcome_class`.\n"
        }
      },
      "additionalProperties": true
    },
    "customer_notes": {
      "type": "string"
    }
  }
}