{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/africanmarketos-com/json-schema/africanmarketos-com-first-call-response-schema.json",
  "title": "FirstCallResponse",
  "description": "Relevance is task-based, not geography alone. Unknown scope pauses before workflow creation; relevance_check never starts one. No verdict or action permission.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/africanmarketos-com-first-call-api-openapi.yml#/components/schemas/FirstCallResponse",
  "type": "object",
  "properties": {
    "mvr_relevant": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "relevance_assessment": {
      "type": "object"
    },
    "status": {
      "type": "string",
      "description": "not_relevant, awaiting_scope_clarification or relevance_checked may terminate routing."
    },
    "activation_outcome": {
      "type": "string",
      "description": "relevance_unresolved: clarify scope."
    },
    "workflow_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "workflow_status": {
      "type": "string"
    },
    "continuation_disposition": {
      "type": "string"
    },
    "mcp_next_call": {
      "type": [
        "object",
        "null"
      ]
    },
    "required_user_inputs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "not_a_verdict": {
      "type": "boolean"
    },
    "residual_risk_register": {
      "$ref": "#/$defs/ResidualRiskRegister"
    },
    "review_intake": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string"
        },
        "item_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 8
        },
        "missing_metadata_count": {
          "type": "integer",
          "minimum": 0
        },
        "evidence_items_created": {
          "const": 0
        },
        "scoring_eligible": {
          "const": false
        },
        "source_authenticity_verified": {
          "const": false
        }
      },
      "additionalProperties": true
    },
    "action_boundary": {
      "$ref": "#/$defs/PreflightActionBoundary"
    },
    "evidence_authentication_status": {
      "enum": [
        "not_authenticated",
        "partially_authenticated"
      ]
    },
    "authenticated_verified_count": {
      "type": "integer",
      "minimum": 0
    },
    "evidence_authentication_basis": {
      "type": "string"
    },
    "caller_declared_verified_count": {
      "type": "integer",
      "minimum": 0
    },
    "declared_completeness_gate_passed": {
      "type": "boolean"
    },
    "verified_evidence_count_semantics": {
      "type": "string"
    },
    "evidence_gate_passed_semantics": {
      "type": "string"
    },
    "recommendation_scope": {
      "type": "string"
    },
    "external_use_ceiling": {
      "type": "object",
      "required": [
        "external_use_allowed",
        "capability_issued"
      ],
      "properties": {
        "external_use_allowed": {
          "const": false
        },
        "capability_issued": {
          "const": false
        },
        "max_capital_commitment_usd": {
          "const": 0
        }
      }
    }
  },
  "additionalProperties": true,
  "$defs": {
    "PreflightActionBoundary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "contract_version",
        "decision_state",
        "next_safe_action",
        "stop",
        "allowed_effects",
        "forbidden_effects",
        "max_capital_commitment_usd",
        "external_contact_allowed",
        "customer_launch_allowed",
        "revalidate_before_effect",
        "historical_output_is_not_current_permission",
        "execution_authorized",
        "external_action_authorized",
        "capability_issued"
      ],
      "properties": {
        "contract_version": {
          "const": "mvr.preflight-action-boundary/1"
        },
        "decision_state": {},
        "next_safe_action": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "availability",
            "required_host_inputs",
            "handoff_source"
          ],
          "properties": {
            "type": {},
            "availability": {},
            "required_host_inputs": {},
            "handoff_source": {}
          }
        },
        "stop": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "required",
            "applies_to",
            "analytical_chain_required",
            "reason_codes",
            "unknown_risks_remain"
          ],
          "properties": {
            "required": {
              "const": true
            },
            "applies_to": {
              "const": "all_consequential_external_actions"
            },
            "analytical_chain_required": {},
            "reason_codes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "unknown_risks_remain": {
              "const": true
            }
          }
        },
        "allowed_effects": {},
        "forbidden_effects": {
          "const": [
            "spend",
            "external_contact",
            "contract",
            "customer_launch",
            "pilot_execution",
            "payment",
            "deployment"
          ]
        },
        "max_capital_commitment_usd": {
          "const": 0
        },
        "external_contact_allowed": {
          "const": false
        },
        "customer_launch_allowed": {
          "const": false
        },
        "revalidate_before_effect": {
          "const": true
        },
        "historical_output_is_not_current_permission": {
          "const": true
        },
        "execution_authorized": {
          "const": false
        },
        "external_action_authorized": {
          "const": false
        },
        "capability_issued": {
          "const": false
        }
      },
      "oneOf": [
        {
          "properties": {
            "decision_state": {
              "enum": [
                "assessment_in_progress"
              ]
            },
            "allowed_effects": {
              "const": [
                "read_only_assessment"
              ]
            },
            "next_safe_action": {
              "properties": {
                "type": {
                  "enum": [
                    "continue_evidence_assessment"
                  ]
                },
                "availability": {
                  "const": "exact_server_handoff"
                },
                "required_host_inputs": {
                  "const": []
                },
                "handoff_source": {
                  "const": "mcp_next_call"
                }
              }
            },
            "stop": {
              "properties": {
                "analytical_chain_required": {
                  "const": false
                }
              }
            }
          }
        },
        {
          "properties": {
            "decision_state": {
              "enum": [
                "abstain_pending_evidence",
                "assessment_completed"
              ]
            },
            "allowed_effects": {
              "const": [
                "versioned_internal_plan"
              ]
            },
            "next_safe_action": {
              "properties": {
                "type": {
                  "enum": [
                    "evidence_collection_design",
                    "internal_pilot_design"
                  ]
                },
                "availability": {
                  "const": "authenticated_case_handoff"
                },
                "required_host_inputs": {
                  "const": [
                    "current_case",
                    "expected_revision",
                    "operation_id"
                  ]
                },
                "handoff_source": {
                  "const": "review_progress.bounded_next_actions"
                }
              }
            },
            "stop": {
              "properties": {
                "analytical_chain_required": {
                  "const": true
                }
              }
            }
          }
        },
        {
          "properties": {
            "decision_state": {
              "enum": [
                "outside_declared_mvr_scope"
              ]
            },
            "allowed_effects": {
              "const": []
            },
            "next_safe_action": {
              "properties": {
                "type": {
                  "enum": [
                    "ordinary_task_outside_mvr"
                  ]
                },
                "availability": {
                  "const": "routing_only_not_permission"
                },
                "required_host_inputs": {
                  "const": []
                },
                "handoff_source": {
                  "const": null
                }
              }
            },
            "stop": {
              "properties": {
                "analytical_chain_required": {
                  "const": true
                }
              }
            }
          }
        },
        {
          "properties": {
            "decision_state": {
              "enum": [
                "blocked_invalid_or_unavailable"
              ]
            },
            "allowed_effects": {
              "const": []
            },
            "next_safe_action": {
              "properties": {
                "type": {
                  "enum": [
                    "correct_input_or_restore_current_state"
                  ]
                },
                "availability": {
                  "const": "blocked"
                },
                "required_host_inputs": {
                  "const": [
                    "valid_input_and_current_state"
                  ]
                },
                "handoff_source": {
                  "const": null
                }
              }
            },
            "stop": {
              "properties": {
                "analytical_chain_required": {
                  "const": true
                }
              }
            }
          }
        },
        {
          "properties": {
            "decision_state": {
              "enum": [
                "abstain_pending_evidence",
                "assessment_completed"
              ]
            },
            "allowed_effects": {
              "const": [
                "local_internal_draft"
              ]
            },
            "next_safe_action": {
              "properties": {
                "type": {
                  "enum": [
                    "internal_evidence_plan"
                  ]
                },
                "availability": {
                  "const": "draft_only_no_external_effect"
                },
                "required_host_inputs": {
                  "const": [
                    "human_review_of_unknowns"
                  ]
                },
                "handoff_source": {
                  "const": null
                }
              }
            },
            "stop": {
              "properties": {
                "analytical_chain_required": {
                  "const": true
                }
              }
            }
          }
        }
      ]
    },
    "ResidualRiskRegister": {
      "type": "object",
      "properties": {
        "contract_version": {
          "const": "mvr.residual-risk-register/1"
        },
        "scope": {
          "type": "string",
          "enum": [
            "reported_checks_only",
            "outside_declared_mvr_scope"
          ]
        },
        "taxonomy_url": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "state": {
                "type": "string",
                "enum": [
                  "open",
                  "recorded_review_satisfied",
                  "closed"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "open",
                  "procedural_requirement_recorded",
                  "resolved",
                  "accepted_by_accountable_owner"
                ]
              },
              "source_codes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": true
          }
        },
        "complete_risk_inventory": {
          "const": false
        },
        "omitted_risks_unknown": {
          "const": true
        },
        "underlying_decision_unchanged": {
          "const": true
        },
        "evidence_gap_closure": {
          "const": false
        },
        "execution_authorized": {
          "const": false
        },
        "registry_version": {
          "type": "string"
        },
        "assessed_domains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "unassessed_domains_unknown": {
          "const": true
        },
        "case_basis": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "case_id": {
              "type": "string"
            },
            "case_revision": {
              "type": "integer"
            },
            "basis_sha256": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "instances": {
          "type": "array",
          "maxItems": 40,
          "items": {
            "type": "object",
            "properties": {
              "residual_id": {
                "type": "string"
              },
              "risk_code": {
                "type": "string"
              },
              "scope_ref": {
                "type": "string"
              },
              "disposition": {
                "type": "string",
                "enum": [
                  "open",
                  "procedural_requirement_recorded",
                  "resolved",
                  "accepted_by_accountable_owner"
                ]
              },
              "evidence_path": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "claim_ref": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requirements_ref": {
                "type": "string"
              },
              "proof_reference": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "verification_method": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_valid_until": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "allowed_action_ceiling": {
                "const": "internal_planning_only"
              }
            },
            "additionalProperties": true
          }
        },
        "instances_truncated": {
          "type": "boolean"
        },
        "factual_closure_available": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    }
  }
}