{
 "deployed_versions": {
  "cain-mr-01": {
   "container": "cain-mr-node-1",
   "files": {
    "cain_pbft_engine_33.py": {
     "is_head": false,
     "matches_commit": "81bdf841",
     "sha256": "c8d4936b3caddf35"
    },
    "cain_pbft_qc.py": {
     "is_head": false,
     "matches_commit": "93129e8c",
     "sha256": "00648fc52779b132"
    },
    "cluster_api.py": {
     "is_head": false,
     "matches_commit": "156e87b8",
     "sha256": "97c76b2e981127d8"
    }
   }
  },
  "cain-mr-02": {
   "container": "cain-mr2-node-1",
   "files": {
    "cain_pbft_engine_33.py": {
     "is_head": false,
     "matches_commit": "948b1895",
     "sha256": "a23fde84bfd10b5d"
    },
    "cain_pbft_qc.py": {
     "is_head": false,
     "matches_commit": "93129e8c",
     "sha256": "00648fc52779b132"
    },
    "cluster_api.py": {
     "is_head": false,
     "matches_commit": "156e87b8",
     "sha256": "97c76b2e981127d8"
    }
   }
  },
  "sandbox (cain-sbx)": {
   "container": "cain-sbx-node-1",
   "files": {
    "cain_pbft_engine_33.py": {
     "is_head": false,
     "matches_commit": "15d12dab",
     "sha256": "0519bcb4de82f95d"
    },
    "cain_pbft_qc.py": {
     "is_head": null,
     "matches_commit": null,
     "sha256": null
    },
    "cluster_api.py": {
     "is_head": false,
     "matches_commit": "15d12dab",
     "sha256": "8c542542b24f6648"
    }
   }
  }
 },
 "differs_from_prompt_diagram": [
  "replicas do not evaluate governance or authorization; they order a commitment",
  "authorization is the gateway's QC verification, not a replica decision",
  "revocation never goes through BFT (local durable epoch)",
  "with the fast path, most permits use a snapshot committed earlier"
 ],
 "head": "922fb7bb7df371b000c99d2d7b3ebdd8b0b7024a",
 "path": [
  {
   "behaviour": "POST /fabric/try or proxied MCP/REST call",
   "step": "agent / request",
   "where": "platform-gateway/main.py"
  },
  {
   "behaviour": "identity, policy (OPA), risk, trust, kill switch, ... -> stages[]",
   "step": "governance stages",
   "where": "fabric_control_plane.py decide()"
  },
  {
   "behaviour": "sha256(canonical{decision_id, tenant, principal, agent, service, path, stages, pre_verdict})",
   "step": "commitment",
   "where": "_consensus_stage"
  },
  {
   "behaviour": "ALLOWED + covering quorum-committed snapshot -> no round; leaf queued for Merkle anchor",
   "step": "fast path (CAIN_AUTH_SNAPSHOT=1)",
   "where": "governance_runtime.consensus_fast_path"
  },
  {
   "behaviour": "BLOCKED/REQUIRE_APPROVAL -> ordered after the reply",
   "step": "deferral",
   "where": "_enqueue_deferred_consensus"
  },
  {
   "behaviour": "op {action: fabric_decision | fabric_decision_batch, commitment}",
   "step": "BFT proposal",
   "where": "cain_mr_client.order_grouped/order_op"
  },
  {
   "behaviour": "HTTP to replicas on the WireGuard overlay; forwarded to primary",
   "step": "primary / PRE_PREPARE / PREPARE / COMMIT",
   "where": "cluster_api /pbft/request -> HardenedPBFTEngine"
  },
  {
   "behaviour": "2f+1 COMMITs; replica executes in order: fabric_decision -> READ_OR_POLICY_EVALUATED (no governance check)",
   "step": "finality",
   "where": "DeterministicStateMachine.apply_operation"
  },
  {
   "behaviour": "gateway fetches /pbft/qc/{seq}, verifies 2f+1 signatures vs PINNED membership + exact digest",
   "step": "authorization",
   "where": "cain_mr_client.verify_commit"
  },
  {
   "behaviour": "egress, tool args, artifacts: restriction-only",
   "step": "post-consensus stages",
   "where": "decide()"
  },
  {
   "behaviour": "proxied call executes only if outcome is not blocked",
   "step": "MCPGate / execution",
   "where": "main.py proxy paths"
  }
 ]
}
