{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flint-network/json-schema/flint-network-outcome-report-response-schema.json",
  "title": "OutcomeReportResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flint-network-outcome-feedback-api-openapi.yml#/components/schemas/OutcomeReportResponse",
  "type": "object",
  "required": [
    "ok",
    "record_id",
    "outcome"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "record_id": {
      "type": "string",
      "pattern": "^frv_"
    },
    "outcome": {
      "$ref": "#/$defs/RecordOutcome"
    }
  },
  "$defs": {
    "RecordOutcome": {
      "type": "object",
      "description": "What actually happened after a scan, as reported through POST /api/records/{record_id}/outcome. GET /api/records/{id} and GET /api/counterparty/{address} strip reporter.ref from this shape before returning it publicly; reporter.type is always kept.",
      "required": [
        "outcome",
        "reported_at",
        "reporter",
        "override"
      ],
      "properties": {
        "outcome": {
          "type": "string",
          "enum": [
            "executed",
            "held",
            "executed_despite_block",
            "cancelled"
          ]
        },
        "tx_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "chain": {
          "type": [
            "string",
            "null"
          ]
        },
        "reported_at": {
          "type": "string",
          "format": "date-time"
        },
        "reporter": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "owner_session",
                "caller",
                "partner"
              ]
            },
            "ref": {
              "type": [
                "string",
                "null"
              ],
              "description": "Stripped from every public projection of this shape; present only in the reporter's own POST response."
            }
          }
        },
        "verdict_at_scan": {
          "type": [
            "string",
            "null"
          ]
        },
        "override": {
          "type": "boolean",
          "description": "True when verdict_at_scan was block and outcome starts with executed."
        },
        "tx_verified": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Best-effort etherscan check of tx_hash against the scanned counterparty and amount. null when Etherscan is not configured or the check was inconclusive; a definitive non-match is rejected 400 tx_hash_mismatch instead of being stored."
        },
        "ledger_recorded": {
          "type": "boolean",
          "description": "True only when an override was actually written to the passport's Scout ledger and Sentinel was notified: requires the override to be reported while the record's passport binding was credited, or by the passport owner's own session."
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "passport_not_credited",
            null
          ],
          "description": "Set to passport_not_credited when an override could not be written to the passport's Scout ledger because the binding was not credited and the reporter was not the owner's session."
        }
      }
    }
  }
}