{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/africanmarketos-com/json-schema/africanmarketos-com-decision-snapshot-response-schema.json",
  "title": "DecisionSnapshotResponse",
  "description": "Create/get/lock expose root lifecycle fields even when nested decision_snapshot is redacted or omitted in compact output. GET is a projection: legacy acknowledgement claims are namespaced and unverified without rewriting canonical history or original receipt hashes; a projected legacy view cannot recompute that historical hash.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/africanmarketos-com-decision-snapshot-api-openapi.yml#/components/schemas/DecisionSnapshotResponse",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "snapshot_hash": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-f0-9]{64}$",
      "description": "Exact current snapshot material binding. Null on unversioned legacy records; not the decision-check response hash."
    },
    "revision": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "description": "Versioned create starts at 1; lock increments once. Null on unversioned legacy records."
    },
    "lock_receipt": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "machine_snapshot_lock",
            "non_authorizing_terminal_record",
            "unverified_legacy_lock_record"
          ]
        },
        "source_snapshot_hash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "source_revision": {
          "type": "integer",
          "minimum": 1
        },
        "terminal_state": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "abstained",
            "refused",
            "refusal",
            null
          ]
        },
        "actor": {
          "type": "object",
          "properties": {
            "principal_id": {
              "type": "string"
            },
            "role": {
              "type": "string"
            },
            "identity_source": {
              "type": "string"
            },
            "role_source": {
              "type": "string"
            },
            "human_attested": {
              "type": "boolean",
              "enum": [
                false
              ]
            }
          },
          "additionalProperties": true
        },
        "human_attested": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "reliance_authorized": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "execution_authorized": {
          "type": "boolean",
          "enum": [
            false
          ]
        }
      },
      "additionalProperties": true,
      "description": "Null on drafts. Machine preservation only, never human attestation, reliance permission or execution capability."
    },
    "human_review_acknowledgement": {
      "type": "object",
      "properties": {
        "acknowledged": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "acknowledged_by": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            null
          ]
        },
        "acknowledged_at": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            null
          ]
        },
        "status": {
          "type": "string"
        },
        "policy": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "human_attestation_status": {
      "type": "string",
      "enum": [
        "not_attested",
        "unverified_legacy_claim"
      ]
    },
    "immutable_snapshot_hash": {
      "type": [
        "string",
        "null"
      ]
    },
    "public_receipt_hash": {
      "type": [
        "string",
        "null"
      ]
    },
    "record_signature": {
      "type": "object",
      "properties": {},
      "additionalProperties": true
    },
    "reliance_warning": {
      "type": "string"
    },
    "unverified_legacy_claims": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "description": "Historical caller assertions, not attestations. Preserved only under this nonauthorizing namespace."
    },
    "snapshot_view_projection": {
      "type": "object",
      "properties": {
        "canonical_record_unchanged": {
          "type": "boolean",
          "enum": [
            true
          ]
        },
        "original_receipt_hashes_preserved": {
          "type": "boolean",
          "enum": [
            true
          ]
        },
        "canonical_hash_recomputable_from_view": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "confidence_semantics": {
      "type": "object",
      "required": [
        "decision_confidence",
        "evidence_quality",
        "evidence_completeness"
      ],
      "properties": {
        "decision_confidence": {
          "type": "object",
          "required": [
            "kind",
            "calibrated_probability",
            "measures_evidence_completeness",
            "interpretation"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "heuristic_support_index"
              ]
            },
            "calibrated_probability": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "measures_evidence_completeness": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "interpretation": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "evidence_quality": {
          "type": "object",
          "required": [
            "kind",
            "is_decision_confidence",
            "interpretation"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "source_and_rubric_assessment"
              ]
            },
            "is_decision_confidence": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "interpretation": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "evidence_completeness": {
          "type": "object",
          "required": [
            "value",
            "measurement_status",
            "interpretation"
          ],
          "properties": {
            "value": {
              "enum": [
                null
              ]
            },
            "measurement_status": {
              "type": "string",
              "enum": [
                "no_global_percentage_estimated"
              ]
            },
            "interpretation": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "decision_continuity": {
      "type": "object",
      "properties": {
        "record_role": {
          "type": "string",
          "enum": [
            "historical_assessment"
          ]
        },
        "current_reliance_authorized": {
          "type": "boolean",
          "enum": [
            false
          ]
        },
        "fresh_evaluation_required": {
          "type": "boolean",
          "enum": [
            true
          ]
        },
        "evaluated_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "decision_check_id": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "status": {
      "type": "string"
    },
    "snapshot_id": {
      "type": "string"
    },
    "decision_id": {
      "type": "string"
    },
    "decision_snapshot": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "snapshot_hash": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[a-f0-9]{64}$",
          "description": "Exact current snapshot material binding. Null on unversioned legacy records; not the decision-check response hash."
        },
        "revision": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "description": "Versioned create starts at 1; lock increments once. Null on unversioned legacy records."
        },
        "lock_receipt": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "machine_snapshot_lock",
                "non_authorizing_terminal_record",
                "unverified_legacy_lock_record"
              ]
            },
            "source_snapshot_hash": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "source_revision": {
              "type": "integer",
              "minimum": 1
            },
            "terminal_state": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "abstained",
                "refused",
                "refusal",
                null
              ]
            },
            "actor": {
              "type": "object",
              "properties": {
                "principal_id": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "identity_source": {
                  "type": "string"
                },
                "role_source": {
                  "type": "string"
                },
                "human_attested": {
                  "type": "boolean",
                  "enum": [
                    false
                  ]
                }
              },
              "additionalProperties": true
            },
            "human_attested": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "reliance_authorized": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "execution_authorized": {
              "type": "boolean",
              "enum": [
                false
              ]
            }
          },
          "additionalProperties": true,
          "description": "Null on drafts. Machine preservation only, never human attestation, reliance permission or execution capability."
        },
        "human_review_acknowledgement": {
          "type": "object",
          "properties": {
            "acknowledged": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "acknowledged_by": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                null
              ]
            },
            "acknowledged_at": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                null
              ]
            },
            "status": {
              "type": "string"
            },
            "policy": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "human_attestation_status": {
          "type": "string",
          "enum": [
            "not_attested",
            "unverified_legacy_claim"
          ]
        },
        "immutable_snapshot_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "public_receipt_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "record_signature": {
          "type": "object",
          "properties": {},
          "additionalProperties": true
        },
        "reliance_warning": {
          "type": "string"
        },
        "unverified_legacy_claims": {
          "type": "object",
          "properties": {},
          "additionalProperties": true,
          "description": "Historical caller assertions, not attestations. Preserved only under this nonauthorizing namespace."
        },
        "snapshot_view_projection": {
          "type": "object",
          "properties": {
            "canonical_record_unchanged": {
              "type": "boolean",
              "enum": [
                true
              ]
            },
            "original_receipt_hashes_preserved": {
              "type": "boolean",
              "enum": [
                true
              ]
            },
            "canonical_hash_recomputable_from_view": {
              "type": "boolean",
              "enum": [
                false
              ]
            },
            "reason": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "response_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "semantic_decision_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "immutable_audit_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "anti_corruption_audit_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "source_decision_integrity": {
          "type": "object",
          "properties": {
            "decision_check_id": {
              "type": "string"
            },
            "response_hash": {
              "type": [
                "string",
                "null"
              ]
            },
            "semantic_decision_hash": {
              "type": [
                "string",
                "null"
              ]
            },
            "immutable_audit_hash": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "additionalProperties": true
        },
        "submission_review": {
          "$ref": "#/$defs/SnapshotSubmissionReview"
        }
      },
      "additionalProperties": true
    },
    "amendments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {},
        "additionalProperties": true
      }
    },
    "amendment_cursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "amendments_list_complete": {
      "type": "boolean"
    }
  },
  "additionalProperties": true,
  "allOf": [
    {
      "if": {
        "required": [
          "status",
          "snapshot_id"
        ],
        "properties": {
          "status": {
            "enum": [
              "ok",
              "created"
            ]
          }
        }
      },
      "then": {
        "required": [
          "snapshot_hash",
          "revision",
          "lock_receipt"
        ]
      }
    }
  ],
  "$defs": {
    "SnapshotSubmissionReview": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "caller_fields_ignored",
            "server_material_used"
          ]
        },
        "ignored_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "authoritative_source": {
          "type": "string",
          "enum": [
            "server_persisted_decision_check"
          ]
        },
        "message": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}