{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agoragentic.com/schema/finance-agent-version-c-gate-matrix.v1.json",
  "title": "Finance Agent Version C Gate Matrix V1",
  "description": "Read-only Version C finance-agent external-gate matrix keyed by launch mode and hard external gate. This schema summarizes redacted stored gate evidence only; it does not run Robinhood MCP probes, dispatch providers, approve live action, enable options execution, mutate wallet/x402 state, call execute/invoke, publish listings, or publish capabilities.",
  "type": "object",
  "required": [
    "schema",
    "schema_ref",
    "deployment_id",
    "owner_id",
    "read_only",
    "no_live_action_assertion",
    "route_can_run_external_probes",
    "route_can_dispatch_provider",
    "route_can_approve_live_actions",
    "route_can_enable_options_execution",
    "live_authority",
    "external_hard_gates",
    "modes"
  ],
  "properties": {
    "schema": { "type": "string", "const": "agoragentic.agent-os.finance-agent-version-c-gate-matrix.v1" },
    "schema_ref": { "type": "string", "const": "/schema/finance-agent-version-c-gate-matrix.v1.json" },
    "deployment_id": { "type": ["string", "null"] },
    "owner_id": { "type": ["string", "null"] },
    "read_only": { "type": "boolean", "const": true },
    "no_live_action_assertion": { "type": "boolean", "const": true },
    "route_can_run_external_probes": { "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 },
    "live_authority": { "$ref": "#/$defs/live_authority" },
    "external_hard_gates": {
      "type": "object",
      "required": [
        "owner_authenticated_robinhood_mcp_schema_probe",
        "finance_agent_owner_legal_commercial_approval",
        "brokerage_options_approval_and_owner_compliance_review"
      ],
      "properties": {
        "owner_authenticated_robinhood_mcp_schema_probe": {
          "type": "object",
          "required": ["trading", "banking"],
          "properties": {
            "trading": { "$ref": "#/$defs/mcp_schema_gate" },
            "banking": { "$ref": "#/$defs/mcp_schema_gate" }
          },
          "additionalProperties": false
        },
        "finance_agent_owner_legal_commercial_approval": {
          "type": "object",
          "required": ["approved_trading", "approved_card"],
          "properties": {
            "approved_trading": { "$ref": "#/$defs/compliance_gate" },
            "approved_card": { "$ref": "#/$defs/compliance_gate" }
          },
          "additionalProperties": false
        },
        "brokerage_options_approval_and_owner_compliance_review": { "$ref": "#/$defs/compliance_gate" }
      },
      "additionalProperties": false
    },
    "modes": {
      "type": "object",
      "required": [
        "research_only",
        "order_review",
        "approved_trading",
        "approved_card",
        "options_signal_intelligence",
        "options_review_packet",
        "options"
      ],
      "properties": {
        "research_only": { "$ref": "#/$defs/mode_gate" },
        "order_review": { "$ref": "#/$defs/mode_gate" },
        "approved_trading": { "$ref": "#/$defs/mode_gate" },
        "approved_card": { "$ref": "#/$defs/mode_gate" },
        "options_signal_intelligence": { "$ref": "#/$defs/mode_gate" },
        "options_review_packet": {
          "allOf": [
            { "$ref": "#/$defs/mode_gate" },
            {
              "type": "object",
              "required": [
                "options_execution_enabled",
                "options_order_schema_allowed",
                "personalized_options_advice_allowed",
                "required_before_real_options_execution_review"
              ],
              "properties": {
                "options_execution_enabled": { "type": "boolean", "const": false },
                "options_order_schema_allowed": { "type": "boolean", "const": false },
                "personalized_options_advice_allowed": { "type": "boolean", "const": false },
                "required_before_real_options_execution_review": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "real_owner_authenticated_robinhood_trading_mcp_schema_probe",
                      "real_owner_legal_commercial_compliance_review",
                      "real_brokerage_options_approval_review"
                    ]
                  }
                }
              },
              "additionalProperties": true
            }
          ]
        },
        "options": {
          "allOf": [
            { "$ref": "#/$defs/mode_gate" },
            {
              "type": "object",
              "required": ["options_execution_enabled"],
              "properties": {
                "options_execution_enabled": { "type": "boolean", "const": false }
              },
              "additionalProperties": true
            }
          ]
        }
      },
      "additionalProperties": false
    }
  },
  "not": {
    "anyOf": [
      { "required": ["raw_schema"] },
      { "required": ["raw_payload"] },
      { "required": ["account_values"] },
      { "required": ["card_values"] },
      { "required": ["order_values"] },
      { "required": ["payment_values"] },
      { "required": ["wallet_values"] },
      { "required": ["auth_token"] },
      { "required": ["access_token"] },
      { "required": ["refresh_token"] }
    ]
  },
  "additionalProperties": true,
  "$defs": {
    "live_authority": {
      "type": "object",
      "required": [
        "robinhood_provider_dispatch",
        "external_provider_call",
        "order_placement",
        "order_cancellation",
        "card_detail_fetch",
        "card_purchase",
        "wallet_mutation",
        "x402_settlement",
        "public_execute_mutation",
        "global_execute_mutation",
        "global_invoke_mutation",
        "marketplace_publication",
        "capability_publication"
      ],
      "properties": {
        "robinhood_provider_dispatch": { "type": "boolean", "const": false },
        "external_provider_call": { "type": "boolean", "const": false },
        "order_placement": { "type": "boolean", "const": false },
        "order_cancellation": { "type": "boolean", "const": false },
        "card_detail_fetch": { "type": "boolean", "const": false },
        "card_purchase": { "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 }
      },
      "additionalProperties": false
    },
    "redacted_mcp_evidence": {
      "type": ["object", "null"],
      "properties": {
        "proof_id": { "type": ["string", "null"] },
        "status": { "type": ["string", "null"], "enum": ["verified", "failed", "archived", null] },
        "validation_reason": { "type": ["string", "null"] },
        "schema_hash": { "type": ["string", "null"], "maxLength": 256 },
        "evidence_ref": { "type": ["string", "null"], "maxLength": 256 },
        "evidence_hash": { "type": ["string", "null"], "maxLength": 256 },
        "receipt_id": { "type": ["string", "null"] },
        "created_at": { "type": ["string", "null"] }
      },
      "additionalProperties": true
    },
    "redacted_compliance_evidence": {
      "type": ["object", "null"],
      "properties": {
        "approval_id": { "type": ["string", "null"] },
        "status": { "type": ["string", "null"], "enum": ["verified", "failed", "archived", null] },
        "validation_reason": { "type": ["string", "null"] },
        "launch_modes": {
          "type": "array",
          "items": { "type": "string" }
        },
        "approval_ref": { "type": ["string", "null"], "maxLength": 256 },
        "approval_hash": { "type": ["string", "null"], "maxLength": 256 },
        "brokerage_options_approval_ref": { "type": ["string", "null"], "maxLength": 256 },
        "brokerage_options_approval_hash": { "type": ["string", "null"], "maxLength": 256 },
        "receipt_id": { "type": ["string", "null"] },
        "created_at": { "type": ["string", "null"] }
      },
      "additionalProperties": true
    },
    "mcp_schema_gate": {
      "type": "object",
      "required": [
        "gate",
        "parent_gate",
        "status",
        "connector_type",
        "schema",
        "evidence",
        "record_route",
        "route_records_evidence_only",
        "route_can_collect_credentials",
        "route_can_run_probe",
        "route_can_dispatch_provider",
        "provider_dispatch_performed",
        "live_action_performed"
      ],
      "properties": {
        "gate": {
          "type": "string",
          "enum": [
            "owner_authenticated_robinhood_trading_mcp_schema_probe",
            "owner_authenticated_robinhood_banking_mcp_schema_probe"
          ]
        },
        "parent_gate": { "type": "string", "const": "owner_authenticated_robinhood_mcp_schema_probe" },
        "status": { "type": "string", "enum": ["missing", "satisfied"] },
        "connector_type": {
          "type": "string",
          "enum": ["robinhood_trading", "robinhood_banking"]
        },
        "schema": { "type": "string", "const": "/schema/finance-agent-mcp-schema-proof.v1.json" },
        "evidence": { "$ref": "#/$defs/redacted_mcp_evidence" },
        "record_route": { "type": "string", "const": "/api/agent-os/finance/deployments/{deployment_id}/mcp-schema-proofs" },
        "route_records_evidence_only": { "type": "boolean", "const": true },
        "route_can_collect_credentials": { "type": "boolean", "const": false },
        "route_can_run_probe": { "type": "boolean", "const": false },
        "route_can_dispatch_provider": { "type": "boolean", "const": false },
        "provider_dispatch_performed": { "type": "boolean", "const": false },
        "live_action_performed": { "type": "boolean", "const": false }
      },
      "additionalProperties": true
    },
    "compliance_gate": {
      "type": "object",
      "required": [
        "gate",
        "status",
        "approval_scope",
        "schema",
        "evidence",
        "record_route",
        "route_records_evidence_only",
        "options_review_approval_required",
        "brokerage_options_approval_required",
        "brokerage_options_approval_reviewed",
        "route_can_approve_live_actions",
        "route_can_enable_options_execution",
        "route_can_dispatch_provider",
        "provider_dispatch_approved",
        "options_execution_approved",
        "marketplace_publication_approved",
        "x402_settlement_approved"
      ],
      "properties": {
        "gate": {
          "type": "string",
          "enum": [
            "finance_agent_owner_legal_commercial_approval",
            "finance_agent_options_review_approval"
          ]
        },
        "status": { "type": "string", "enum": ["missing", "satisfied"] },
        "approval_scope": {
          "type": "string",
          "enum": ["approved_trading", "approved_card", "options_signal_intelligence", "options_review_packet"]
        },
        "schema": { "type": "string", "const": "/schema/finance-agent-compliance-approval.v1.json" },
        "evidence": { "$ref": "#/$defs/redacted_compliance_evidence" },
        "record_route": { "type": "string", "const": "/api/agent-os/finance/deployments/{deployment_id}/compliance-approvals" },
        "route_records_evidence_only": { "type": "boolean", "const": true },
        "options_review_approval_required": { "type": "boolean" },
        "brokerage_options_approval_required": { "type": "boolean" },
        "brokerage_options_approval_reviewed": { "type": "boolean" },
        "route_can_approve_live_actions": { "type": "boolean", "const": false },
        "route_can_enable_options_execution": { "type": "boolean", "const": false },
        "route_can_dispatch_provider": { "type": "boolean", "const": false },
        "provider_dispatch_approved": { "type": "boolean", "const": false },
        "options_execution_approved": { "type": "boolean", "const": false },
        "marketplace_publication_approved": { "type": "boolean", "const": false },
        "x402_settlement_approved": { "type": "boolean", "const": false }
      },
      "additionalProperties": true
    },
    "mode_gate": {
      "type": "object",
      "required": [
        "status",
        "missing_external_gates",
        "external_gates",
        "route_can_execute",
        "route_can_dispatch_provider",
        "live_authority"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "available_without_external_gate",
            "policy_gated_without_external_gate",
            "available_as_non_executable_research_metadata",
            "blocked_external_evidence",
            "external_gates_satisfied",
            "disabled_roadmap"
          ]
        },
        "missing_external_gates": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "owner_authenticated_robinhood_trading_mcp_schema_probe",
              "owner_authenticated_robinhood_banking_mcp_schema_probe",
              "finance_agent_owner_legal_commercial_approval",
              "finance_agent_options_review_approval",
              "options_execution_not_supported_in_v1"
            ]
          }
        },
        "external_gates": {
          "type": "array",
          "items": {
            "anyOf": [
              { "$ref": "#/$defs/mcp_schema_gate" },
              { "$ref": "#/$defs/compliance_gate" }
            ]
          }
        },
        "route_can_execute": { "type": "boolean", "const": false },
        "route_can_dispatch_provider": { "type": "boolean", "const": false },
        "route_can_enable_options_execution": { "type": "boolean", "const": false },
        "options_execution_enabled": { "type": "boolean", "const": false },
        "options_order_schema_allowed": { "type": "boolean", "const": false },
        "personalized_options_advice_allowed": { "type": "boolean", "const": false },
        "live_authority": { "$ref": "#/$defs/live_authority" }
      },
      "additionalProperties": true
    }
  }
}
