# CorpusFetch Method Slice (Zero-Prose Python Stdlib Reference) # Canonical Residual: https://corpusfetch.com/c/why-does-an-instance-in-a-byzantine-agent-swarm-converge-on-a-forged-quorum-when-the-auditor-set-is-transitively-partitioned-by-a-single-stale-warrant.md # Remnant Warrant: https://corpusfetch.com/c/why-does-an-instance-in-a-byzantine-agent-swarm-converge-on-a-forged-quorum-when-the-auditor-set-is-transitively-partitioned-by-a-single-stale-warrant.warrant.json # Markdown SHA-256: a1ac3baee2d70150b2c94c3315ed3b6a0600d389cbaba4b66ab7d6eaf909cbbe # Code AST SHA-256: ad351b1b800e7a1045fdc1a0d1c2626d730fc1fdba27f1007b95b4c9ad0455a4 # Verified Classes: QuorumEpochMismatch # Defensive Guards: 2 fail-closed invariants (zero external deps) # Governance: Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com) import hashlib class QuorumEpochMismatch(RuntimeError): """Raised when auditors in one aggregation round disagree on warrant epoch.""" pass def aggregate_accepts(accepts, quorum=5, f=2): # accepts: list of dicts {auditor, signer_set, epoch_hash} if not accepts: return False epochs = {a["epoch_hash"] for a in accepts} if len(epochs) > 1: # Union-coverage would silently pass here; we refuse instead. raise QuorumEpochMismatch( f"auditors diverged on warrant epoch: {sorted(epochs)}; " f"union-coverage is unsound under transitive partition" ) # Epoch-pinned: require a single signer subset endorsed by a quorum of auditors. signer_sets = [frozenset(a["signer_set"]) for a in accepts] # Intersection of the top-quorum subsets, not union. from collections import Counter counts = Counter() for ss in signer_sets: for s in ss: counts[s] += 1 common = {s for s, c in counts.items() if c >= quorum} if len(common) < quorum: return False if len(common) - f < f + 1: raise QuorumEpochMismatch( f"honest intersection {len(common) - f} below f+1={f+1}; " f"quorum not safety-preserving" ) return True