{
 "generator": "scripts/cain42_bft/cain42_invariants.py",
 "classification": "EXECUTABLE TESTS (not formal verification)",
 "seconds": 206.2,
 "passed": 28,
 "total": 28,
 "full_coverage": 22,
 "invariants": [
  {
   "id": "I001",
   "invariant": "No valid quorum => no consensus",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution3.py::test_two_two_partition_commits_nothing_on_either_side"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 4.16s ==============================="
  },
  {
   "id": "I002",
   "invariant": "No consensus => no authorization",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_authorization.py::test_no_consensus_evidence_means_no_authorization"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.48s ==============================="
  },
  {
   "id": "I003",
   "invariant": "No authorization => no execution",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_attack_is_blocked_at_mcpgate_with_denial_proof[no_authorization-NO_AUTHORIZATION]"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.26s ==============================="
  },
  {
   "id": "I004",
   "invariant": "Agent cannot self-authorize",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_agent_and_reviewer_agreement_is_not_consensus"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.63s ==============================="
  },
  {
   "id": "I005",
   "invariant": "Delegation cannot expand authority",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_delegation_within_scope_works_and_escalation_is_blocked"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.30s ==============================="
  },
  {
   "id": "I006",
   "invariant": "Memory cannot create authority",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_memory_can_never_authorize_and_poison_is_flagged"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.94s ==============================="
  },
  {
   "id": "I007",
   "invariant": "Tool output cannot create authority",
   "coverage": "PARTIAL",
   "gap": "structural: only QC-verified certificates authorize; no test feeds a tool RESULT back as an authorization",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_attack_is_blocked_at_mcpgate_with_denial_proof[forged_body-CERTIFICATE_INVALID]"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.25s ==============================="
  },
  {
   "id": "I008",
   "invariant": "DAG cannot create authority",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution4_dag.py::test_forged_anchor_is_refused_by_every_replica_and_the_primary"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.26s ==============================="
  },
  {
   "id": "I009",
   "invariant": "Trust score cannot create authority",
   "coverage": "PARTIAL",
   "gap": "trust is only a bound context field; no trust score exists that could grant anything",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_security_context_change_requires_reauthorization"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.19s ==============================="
  },
  {
   "id": "I010",
   "invariant": "Expired certificates cannot execute",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_expired_and_unbound_authorizations_are_denied"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.99s ==============================="
  },
  {
   "id": "I011",
   "invariant": "Revoked identities cannot execute",
   "coverage": "PARTIAL",
   "gap": "expiry is tested; an explicit agent revocation list is NOT IMPLEMENTED",
   "tests": [
    "tests/test_cain42_agentic.py::test_expired_identity_blocks"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.97s ==============================="
  },
  {
   "id": "I012",
   "invariant": "Replayed certificates cannot execute",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_attack_is_blocked_at_mcpgate_with_denial_proof[replay-AUTHORIZATION_REPLAY]",
    "tests/test_cain42_pbft_evolution5.py::test_replay_is_refused_after_gate_restart"
   ],
   "result": "PASS",
   "pytest": "============================== 2 passed in 1.30s ==============================="
  },
  {
   "id": "I013",
   "invariant": "Conflicting certificates cannot execute",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution2.py::test_certificate_attack_is_rejected_without_state_change[conflicting_qc]"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 2.12s ==============================="
  },
  {
   "id": "I014",
   "invariant": "Execution must match authorization",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_attack_is_blocked_at_mcpgate_with_denial_proof[action_substitution-ACTION_SUBSTITUTION]"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.18s ==============================="
  },
  {
   "id": "I015",
   "invariant": "Evidence must bind to execution",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_authorized_call_is_allowed_with_proof_and_execution_is_proven"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.09s ==============================="
  },
  {
   "id": "I016",
   "invariant": "Public evidence cannot contain secrets",
   "coverage": "PARTIAL",
   "gap": "pattern-based scanner over the PBFT/agent bundles; not every leak class",
   "tests": [
    "tests/test_public_evidence_firewall.py"
   ],
   "result": "PASS",
   "pytest": "============================== 13 passed in 1.90s =============================="
  },
  {
   "id": "I017",
   "invariant": "Byzantine evidence cannot be silently discarded",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_byzantine_evidence.py"
   ],
   "result": "PASS",
   "pytest": "============================== 29 passed in 1.74s =============================="
  },
  {
   "id": "I018",
   "invariant": "Recovery cannot bypass reattestation",
   "coverage": "PARTIAL",
   "gap": "node rejoin via verified sync + agent reattestation on model change; node software reattestation NOT IMPLEMENTED",
   "tests": [
    "tests/test_cain42_pbft_evolution4_dag.py::test_dag_service_restart_does_not_frame_the_node_and_rebuilds_its_ledger",
    "tests/test_cain42_agentic.py::test_model_update_invalidates_old_authorization"
   ],
   "result": "PASS",
   "pytest": "============================== 2 passed in 10.12s =============================="
  },
  {
   "id": "I019",
   "invariant": "Model changes trigger revalidation",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_model_update_invalidates_old_authorization"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.14s ==============================="
  },
  {
   "id": "I020",
   "invariant": "Policy changes invalidate incompatible authorization",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution5.py::test_security_context_change_requires_reauthorization"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.37s ==============================="
  },
  {
   "id": "I021",
   "invariant": "Delegated authority never exceeds parent authority",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_delegation_within_scope_works_and_escalation_is_blocked"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.40s ==============================="
  },
  {
   "id": "I022",
   "invariant": "Long-horizon composition cannot bypass aggregate policy",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_salami_attack_individually_authorized_steps_cannot_exceed_aggregate_policy"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 1.96s ==============================="
  },
  {
   "id": "I023",
   "invariant": "Agent consensus cannot override PBFT",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_agentic.py::test_agent_and_reviewer_agreement_is_not_consensus"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.90s ==============================="
  },
  {
   "id": "I024",
   "invariant": "AI prediction cannot override cryptographic authorization",
   "coverage": "PARTIAL",
   "gap": "no ML predictor exists; the adaptive (predictive) progress layer is statically shown to have no safety surface",
   "tests": [
    "tests/test_cain42_pbft_progress.py::test_progress_layer_has_no_safety_surface"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 0.14s ==============================="
  },
  {
   "id": "I025",
   "invariant": "Public verifier independently rejects tampered evidence",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_verification_center.py",
    "tests/test_cain42_proof_package.py",
    "tests/test_cain42_agent_package.py"
   ],
   "result": "PASS",
   "pytest": "============================== 21 passed in 3.39s =============================="
  },
  {
   "id": "I026",
   "invariant": "Fast path commits only with all N votes and never loses a committed value",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution3.py::test_fast_path_falls_back_to_normal_path_when_a_member_is_silent",
    "tests/test_cain42_pbft_refinement.py"
   ],
   "result": "PASS",
   "pytest": "============================= 41 passed in 40.98s =============================="
  },
  {
   "id": "I027",
   "invariant": "Honest replicas never commit conflicting state under crash at any protocol boundary",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_crash_points.py"
   ],
   "result": "PASS",
   "pytest": "======================== 56 passed in 66.12s (0:01:06) ========================="
  },
  {
   "id": "I028",
   "invariant": "DAG ordering has no validator-position bias",
   "coverage": "FULL",
   "gap": "",
   "tests": [
    "tests/test_cain42_pbft_evolution4_dag.py::test_seeded_tie_break_removes_validator_position_bias"
   ],
   "result": "PASS",
   "pytest": "============================== 1 passed in 8.27s ==============================="
  }
 ]
}