{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agoragentic.com/schema/finance-agent-gate-evidence-record.v1.json",
  "title": "Finance Agent Gate Evidence Record V1",
  "description": "Durable owner/admin record for redacted Version C finance-agent supporting gate packet refs and hashes. This schema records only pointers to external-gate bundles, owner approval checklists, stop-control drills, and data-minimization plans. It does not prove the raw packet contents, satisfy MCP/compliance hard gates by itself, run Robinhood MCP probes, dispatch providers, create live-read routes, approve live action, enable options execution, mutate wallet/x402 state, call execute/invoke, publish listings, or publish capabilities.",
  "type": "object",
  "required": [
    "schema",
    "schema_ref",
    "record_id",
    "deployment_id",
    "owner_id",
    "evidence_kind",
    "status",
    "record_state",
    "reviewed_schema_ref",
    "artifact_ref",
    "artifact_hash",
    "no_live_action_assertion",
    "required_false_authority",
    "mutation_flags",
    "redaction_summary"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "const": "agoragentic.agent-os.finance-agent-gate-evidence-record.v1"
    },
    "schema_ref": {
      "type": "string",
      "const": "/schema/finance-agent-gate-evidence-record.v1.json"
    },
    "record_id": { "type": "string", "minLength": 1 },
    "deployment_id": { "type": "string", "minLength": 1 },
    "owner_id": { "type": "string", "minLength": 1 },
    "evidence_kind": {
      "type": "string",
      "enum": [
        "external_gate_bundle",
        "owner_approval_checklist",
        "stop_control_drill",
        "data_minimization_plan"
      ]
    },
    "status": {
      "type": "string",
      "enum": ["recorded", "archived"]
    },
    "record_state": {
      "type": "string",
      "const": "recorded_redacted_ref"
    },
    "reviewed_schema_ref": {
      "type": "string",
      "enum": [
        "/schema/finance-agent-external-gate-bundle.v1.json",
        "/schema/finance-agent-owner-approval-checklist.v1.json",
        "/schema/finance-agent-stop-control-drill.v1.json",
        "/schema/finance-agent-data-minimization-plan.v1.json"
      ]
    },
    "artifact_ref": { "$ref": "#/$defs/bounded_ref" },
    "artifact_hash": { "$ref": "#/$defs/bounded_ref" },
    "evidence_summary": {
      "type": "object",
      "properties": {
        "route_records_evidence_only": { "type": "boolean", "const": true },
        "route_can_run_probe": { "type": "boolean", "const": false },
        "route_can_dispatch_provider": { "type": "boolean", "const": false },
        "route_can_approve_live_actions": { "type": "boolean", "const": false },
        "route_can_enable_options_execution": { "type": "boolean", "const": false },
        "route_can_create_live_read_route": { "type": "boolean", "const": false }
      },
      "additionalProperties": true
    },
    "receipt_id": { "type": ["string", "null"] },
    "receipt_ref": { "$ref": "#/$defs/nullable_bounded_ref" },
    "no_live_action_assertion": { "type": "boolean", "const": true },
    "required_false_authority": {
      "type": "object",
      "required": [
        "robinhood_provider_dispatch",
        "external_provider_call",
        "live_read_route",
        "live_order_execution",
        "order_cancellation",
        "card_detail_fetch",
        "card_purchase",
        "options_execution",
        "options_order_schema",
        "wallet_mutation",
        "x402_settlement",
        "public_execute_mutation",
        "global_execute_mutation",
        "global_invoke_mutation",
        "marketplace_publication",
        "capability_publication",
        "gate_evidence_record_grants_live_authority"
      ],
      "properties": {
        "robinhood_provider_dispatch": { "type": "boolean", "const": false },
        "external_provider_call": { "type": "boolean", "const": false },
        "live_read_route": { "type": "boolean", "const": false },
        "live_order_execution": { "type": "boolean", "const": false },
        "order_cancellation": { "type": "boolean", "const": false },
        "card_detail_fetch": { "type": "boolean", "const": false },
        "card_purchase": { "type": "boolean", "const": false },
        "options_execution": { "type": "boolean", "const": false },
        "options_order_schema": { "type": "boolean", "const": false },
        "wallet_mutation": { "type": "boolean", "const": false },
        "x402_settlement": { "type": "boolean", "const": false },
        "public_execute_mutation": { "type": "boolean", "const": false },
        "global_execute_mutation": { "type": "boolean", "const": false },
        "global_invoke_mutation": { "type": "boolean", "const": false },
        "marketplace_publication": { "type": "boolean", "const": false },
        "capability_publication": { "type": "boolean", "const": false },
        "gate_evidence_record_grants_live_authority": { "type": "boolean", "const": false }
      },
      "additionalProperties": false
    },
    "mutation_flags": {
      "type": "object",
      "properties": {
        "gate_evidence_record_created": { "type": "boolean" },
        "provider_dispatch_enabled": { "type": "boolean", "const": false },
        "provider_dispatch_performed": { "type": "boolean", "const": false },
        "live_order_placement_enabled": { "type": "boolean", "const": false },
        "live_order_placement_performed": { "type": "boolean", "const": false },
        "wallet_mutation_enabled": { "type": "boolean", "const": false },
        "x402_settlement_enabled": { "type": "boolean", "const": false },
        "public_execute_enabled": { "type": "boolean", "const": false },
        "global_execute_mutation_enabled": { "type": "boolean", "const": false },
        "global_invoke_mutation_enabled": { "type": "boolean", "const": false },
        "marketplace_publication_enabled": { "type": "boolean", "const": false },
        "capability_publication_enabled": { "type": "boolean", "const": false }
      },
      "additionalProperties": true
    },
    "redaction_summary": {
      "type": "object",
      "properties": {
        "raw_account_values_excluded": { "type": "boolean", "const": true },
        "raw_card_values_excluded": { "type": "boolean", "const": true },
        "raw_order_values_excluded": { "type": "boolean", "const": true },
        "raw_payment_payload_excluded": { "type": "boolean", "const": true },
        "wallet_private_data_excluded": { "type": "boolean", "const": true },
        "provider_credentials_excluded": { "type": "boolean", "const": true },
        "private_ecf_excluded": { "type": "boolean", "const": true },
        "secrets_excluded": { "type": "boolean", "const": true }
      },
      "additionalProperties": true
    }
  },
  "not": {
    "anyOf": [
      { "required": ["raw_schema"] },
      { "required": ["raw_payload"] },
      { "required": ["raw_approval"] },
      { "required": ["raw_review"] },
      { "required": ["account_values"] },
      { "required": ["card_values"] },
      { "required": ["order_values"] },
      { "required": ["payment_values"] },
      { "required": ["wallet_values"] },
      { "required": ["auth_token"] },
      { "required": ["access_token"] },
      { "required": ["refresh_token"] },
      { "required": ["private_key"] }
    ]
  },
  "additionalProperties": true,
  "$defs": {
    "bounded_ref": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "not": {
        "anyOf": [
          { "pattern": "^[a-z][a-z0-9+.-]*://" },
          { "pattern": "^data:" },
          { "pattern": "^[\\[{]" },
          { "pattern": "[\\r\\n]" },
          { "pattern": "([Bb][Ee][Aa][Rr][Ee][Rr]|[Bb][Aa][Ss][Ii][Cc])\\s+[A-Za-z0-9._~+/=-]{8,}" },
          { "pattern": "\\b([Aa][Cc][C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Kk]|[Xx][Oo][Xx][BbAaPpRrSs]|[Gg][Hh][PpOoUuSsRr])_[A-Za-z0-9_=-]{8,}\\b" }
        ]
      }
    },
    "nullable_bounded_ref": {
      "anyOf": [
        { "type": "null" },
        { "$ref": "#/$defs/bounded_ref" }
      ]
    }
  }
}
