1. The Agent-Task Site
The foundational insight of jugeo-agents is that a multi-agent AI pipeline is a site in the sense of Grothendieck. This is not a metaphor — it is a precise categorical construction that lets us import 60 years of sheaf-theoretic machinery into multi-agent verification.
Let \(\mathcal{A} = \{a_1, \ldots, a_m\}\) be a set of agents and \(\mathcal{T} = \{t_1, \ldots, t_n\}\) a set of subtasks forming a decomposition of a composite task \(T\). Define the category \(\mathbf{AgentTask}\) with:
\(\Ob(\mathbf{AgentTask}) = \{(a_i, t_j) \mid a_i \text{ is assigned to } t_j\}\)
\(\Mor((a_i, t_j), (a_k, t_l)) = \) information-flow edges: one agent's output is consumed by another agent working on a downstream subtask.
The morphisms encode data dependency: if agent \(a_k\) on subtask \(t_l\) reads the output of agent \(a_i\) on subtask \(t_j\), that creates a morphism \((a_i, t_j) \to (a_k, t_l)\). In a CrewAI pipeline, these are the task handoffs. In a LangGraph graph, they are the edges.
1.1 The Grothendieck Topology
A Grothendieck topology \(J\) on \(\mathbf{AgentTask}\) specifies which families of agent-subtask pairs "cover" the full task. Concretely: a family \(\{U_1, \ldots, U_n\}\) covers \(T\) when the union of subtasks accounts for every dimension of the original task.
where \(J_{\mathrm{cover}}\) is the Grothendieck topology generated by task
decompositions: a sieve \(S\) on \(T\) is a covering sieve if and only if the
subtasks in \(S\) jointly cover every dimension of \(T\) as determined by the
CoverageChecker.
In jugeo-agents, the CoverageChecker implements this topology.
It uses a TaskDimensionExtractor to identify the semantic dimensions
of a task (content, quality, format, process, ethics, technical), then a
SubtaskDimensionMapper to verify that each dimension is covered by
at least one agent-subtask pair:
from jugeo_agents.core.covers import CoverageChecker
checker = CoverageChecker(completeness_threshold=1.0)
report = checker.check(
task_description="Analyze the competitive landscape for EV batteries",
subtasks=[
{"name": "market_size", "agent_id": "analyst_1", "scope": "Estimate TAM/SAM/SOM"},
{"name": "competitors", "agent_id": "analyst_2", "scope": "Map key players"},
{"name": "tech_trends", "agent_id": "researcher", "scope": "Patent & R&D analysis"},
{"name": "risks", "agent_id": "analyst_3", "scope": "Regulatory & supply chain"},
]
)
# report.is_complete == True means {U_i} is a covering family
# report.gaps lists any uncovered dimensions
Why a site and not just a set? Because the morphisms matter. If agent B depends on agent A's output, then any inconsistency between them is not just a "disagreement" — it is a violation of functoriality. The site structure tracks exactly which inconsistencies are structurally meaningful vs. merely parallel.
2. Presheaves of Agent Outputs
A presheaf \(\mathcal{F}\) on the agent-task site assigns to each open set (agent-subtask pair) a structured set of factual claims, and to each morphism a restriction map that extracts relevant claims.
Define the presheaf \(\mathcal{F} : \mathbf{AgentTask}^{\mathrm{op}} \to \mathbf{Set}\) by:
\(\mathcal{F}(U_i) = \{\text{factual claims made by agent } a_i \text{ about subtask } t_j\}\)
Each element \(\sigma \in \mathcal{F}(U_i)\) is a local section — the complete set of claims an agent produces for its assigned subtask.
In code, a local section is created when an AgentOutput is processed
by the DescentEngine:
from jugeo_agents import AgentOutput
from jugeo_agents.core.descent import DescentEngine
engine = DescentEngine()
section_a = engine.add_section(AgentOutput(
agent_id="analyst_1",
subtask="market_size",
output_text="The EV battery market was $70B in 2024.",
))
section_b = engine.add_section(AgentOutput(
agent_id="analyst_2",
subtask="competitors",
output_text="The EV battery market was about $68B in 2024.",
))
print(len(section_a.claims))
print(section_a.trust.name)
print(section_b.agent_id, section_b.subtask)
2.1 Restriction Maps
When \(U_i \cap U_j \neq \emptyset\) — two agents' subtasks overlap — the restriction map \(\rho_{ij} : \mathcal{F}(U_j) \to \mathcal{F}(U_i \cap U_j)\) extracts the claims from agent \(j\) that pertain to the overlapping subject matter.
The restriction map is implemented by SubjectMatcher.match(), which
uses semantic similarity to identify claims from different agents that address
the same subject. Two claims "overlap" when they make assertions about the same
entity, metric, or relationship.
This is the key step that transforms raw agent outputs into a sheaf-theoretic structure. Without restriction maps, we'd have isolated blobs of text. With them, we have a diagram that the descent machinery can analyze.
2.2 The Math ↔ Code Rosetta Stone
Every mathematical concept in the sheaf framework corresponds directly to a class or method in jugeo-agents:
| Mathematical Object | jugeo-agents Code | Example |
|---|---|---|
| Site \((\mathbf{AgentTask}, J)\) | CoverageChecker |
6 agents, 4 subtasks with verified coverage |
| Local section \(\sigma_i \in \mathcal{F}(U_i)\) | LocalSection |
Agent A's claims about "market size" |
| Restriction map \(\rho_{ij}\) | SubjectMatcher.match() |
Claims from A and B about same subject |
| Sheaf condition on \(U_i \cap U_j\) | DescentEngine.check_pairwise() |
Do A and B agree on the overlap? |
| H⁰ gap | Obstruction(kind=COVER_GAP) |
Agent assigned but produced no output |
| H¹ cocycle | Contradiction |
A says "$1.3B", B says "$850M" |
| H² cocycle | Obstruction(kind=CASCADING_HALLUCINATION) |
Fabrication chain: A → B → C |
| Phantom section | Obstruction(kind=PHANTOM_GLOBAL_SECTION) |
3 agents agree, but none has evidence |
| Global section | VerifiedGlobalSection |
The fused, verified knowledge base |
| Čech cohomology groups | CohomologyComputation |
Betti numbers \((h^0, h^1, h^2)\) of the pipeline |
3. The Sheaf Condition and Descent
The sheaf condition (also called the descent condition) is the central axiom. It states that local data can be uniquely assembled into global data if and only if the local pieces agree on overlaps.
Wherever two agents' subtasks overlap, their claims about the overlapping subject matter must be consistent. When this holds for all pairs, the local sections glue into a unique global section \(\sigma \in \mathcal{F}(T)\).
In categorical language, the presheaf \(\mathcal{F}\) is a sheaf if the natural map from global sections to the equalizer of the restriction maps is an isomorphism:
The two arrows are the restriction maps \(\rho_i\) and \(\rho_j\). The equalizer selects exactly those tuples of local sections that agree on all pairwise overlaps.
In jugeo-agents, this check is performed by
DescentEngine.check_all(), which iterates over every pair of
local sections and calls check_pairwise():
from jugeo_agents import AgentOutput
from jugeo_agents.core.descent import DescentEngine
engine = DescentEngine()
engine.add_section(AgentOutput(agent_id="a", subtask="market", output_text="Battery demand reached 1.0 TWh."))
engine.add_section(AgentOutput(agent_id="b", subtask="market", output_text="Battery demand reached 0.9 TWh."))
result = engine.check_all()
print(result.is_consistent)
print(result.checked_pairs)
print(result.total_claims_checked)
for obs in result.obstructions:
print(obs.cohomology.value, obs.description)
3.1 Obstruction Classes
When descent fails, the obstructions are classified by cohomological degree. Each degree captures a qualitatively different failure mode:
An agent assigned to a subtask produces no output, or its output contains no extractable claims. The local section \(\sigma_i\) is undefined or empty.
\(\sigma_i = \emptyset\) means \(\mathcal{F}(U_i)\) has no sections. The covering family has a hole: there is no data to glue at \(U_i\).
In code: ObstructionKind.SECTION_INCOMPLETE or
ObstructionKind.COVER_GAP. The repair frontier suggests
re-running the agent or assigning a backup agent.
Two agents disagree on a claim about their shared overlap. Agent A says the market size is $1.3B; Agent B says it is $850M. This disagreement is a 1-cocycle in the Čech complex.
\(c_{ij} = \sigma_i|_{U_i \cap U_j} - \sigma_j|_{U_i \cap U_j} \neq 0 \;\Longrightarrow\; [c] \in H^1(\mathcal{U}, \mathcal{F})\)
The obstruction is non-trivial in \(H^1\) if the disagreement cannot be
resolved by adjusting a single agent's output (i.e., it is not a coboundary).
In code, contradictions are detected by HeuristicContradictionDetector
and classified into subtypes: QUANTITATIVE_CONTRADICTION,
DIRECTIONAL_CONTRADICTION, TEMPORAL_CONTRADICTION,
ENTITY_CONTRADICTION, LOGICAL_CONTRADICTION.
Agent A hallucinates a claim. Agent B reads A's output and cites the hallucinated claim as fact. Agent C synthesizes B's output and builds upon it. The fabrication propagates through the pipeline as a 2-cocycle.
The inconsistency lives in \(H^2\): at each pairwise overlap \(U_i \cap U_j\), the agents appear consistent (B "agrees" with A because B copied A). The obstruction only becomes visible at the triple intersection \(U_i \cap U_j \cap U_k\), where the entire fabrication chain is exposed.
In code: DescentEngine.detect_cascading_hallucinations() traces
provenance chains. When the same ungrounded claim appears across ≥3 agents
with a clear propagation path, it is flagged as
ObstructionKind.CASCADING_HALLUCINATION.
All agents agree on a claim, but none has evidence for it. The global section exists in the sense that descent "succeeds" — there are no contradictions — but the section is ungrounded.
The phantom section is in \(\ker(d^0)\) but is not in the image of any evidence-backed lifting. It is like a section of a sheaf that is everywhere-defined but has no geometric meaning — a "ghost" in the cohomology.
In code: DescentEngine.detect_phantom_sections() checks whether
every claim in the candidate global section can be traced to at least one
grounded evidence channel (tool execution, RAG retrieval, citation, etc.).
Claims where all supporting agents have trust ≤ WEAK_MODEL_GENERATED
are flagged as ObstructionKind.PHANTOM_GLOBAL_SECTION.
The hierarchy is strict. H⁰ obstructions prevent assembly entirely (missing data). H¹ obstructions allow assembly but with unresolved conflicts. H² obstructions are invisible to pairwise checks and require provenance analysis. Phantom sections pass all consistency checks but fail grounding verification. Each level requires progressively deeper analysis to detect.
4. The Čech Complex
The machinery that detects all four obstruction classes is the Čech complex of the covering \(\mathcal{U} = \{U_1, \ldots, U_n\}\) with coefficients in the claim presheaf \(\mathcal{F}\):
Each term of the complex has a concrete interpretation in the multi-agent setting:
\(\displaystyle C^0(\mathcal{U}, \mathcal{F}) = \prod_{i} \mathcal{F}(U_i)\) — a 0-cochain is a tuple of local sections, one per agent.
\(\displaystyle C^1(\mathcal{U}, \mathcal{F}) = \prod_{i < j} \mathcal{F}(U_i \cap U_j)\) — a 1-cochain lives on pairwise overlaps.
\(\displaystyle C^2(\mathcal{U}, \mathcal{F}) = \prod_{i < j < k} \mathcal{F}(U_i \cap U_j \cap U_k)\) — a 2-cochain lives on triple overlaps.
4.1 The Coboundary Maps
The coboundary maps \(d^n\) are the "difference operators" that measure inconsistency at each level:
If \(d^0 \sigma = 0\), every pair of agents agrees on their overlap. A nonzero element of \(\ker(d^1) / \im(d^0)\) is a genuine H¹ obstruction: a contradiction that cannot be resolved by locally adjusting any single agent.
A 1-cocycle \(c\) with \(d^1 c \neq 0\) indicates that the pairwise contradictions are themselves inconsistent — a hallmark of cascading fabrication. This is the H² obstruction.
4.2 The Computational View
The Čech cohomology groups are then:
Each group has a direct interpretation:
| Group | Meaning | jugeo-agents Computation |
|---|---|---|
| \(H^0(\mathcal{U}, \mathcal{F})\) | Global sections — claims that survive all consistency checks | GlobalSectionAssembler.assemble() |
| \(H^1(\mathcal{U}, \mathcal{F})\) | Unresolvable pairwise contradictions | DescentEngine.check_all() — the set of Contradiction objects |
| \(H^2(\mathcal{U}, \mathcal{F})\) | Cascading hallucination chains | DescentEngine.detect_cascading_hallucinations() |
The dimensions of these groups — the Betti numbers \(h^n = \dim H^n\) —
are the pipeline's topological invariants. They are computed and stored in the
CohomologyComputation dataclass:
from jugeo_agents import AgentOutput, TrustLevel
from jugeo_agents.core.fusion import GlobalSectionAssembler
assembler = GlobalSectionAssembler(
trust_threshold=TrustLevel.WEAK_MODEL_GENERATED,
phantom_detection=True,
cascade_detection=True,
)
for output in [
AgentOutput(agent_id="researcher", output_text="Battery costs fell to $139/kWh.", citations=["bnef:2024"]),
AgentOutput(agent_id="writer", output_text="Battery costs fell to $139/kWh."),
]:
assembler.ingest(output)
global_section = assembler.assemble()
coh = global_section.cohomology
print(coh.betti_numbers)
print(coh.euler_characteristic)
print(f"{coh.obstruction_density:.2%}")
Reading the Betti numbers: A healthy pipeline has \(h^0 \gg h^1 \gg h^2 \approx 0\). Large \(h^0\) means many verified claims. Nonzero \(h^1\) means some contradictions remain (may be acceptable if trust-resolved). Any \(h^2 > 0\) is a red flag: cascading fabrication is present.
5. Trust as an Ordered Semilattice
The claim presheaf is not valued in plain sets — it is valued in trust-graded sets. Every claim carries a trust level drawn from a bounded lattice. This lattice structure is what allows jugeo-agents to resolve contradictions without majority vote.
Define the trust lattice \((\mathcal{L}, \preceq)\) as the totally ordered set:
\[ \text{SELF\_CONTRADICTED} \;\prec\; \text{UNGROUNDED} \;\prec\; \text{WEAK\_MODEL} \;\prec\; \text{STRONG\_MODEL} \;\prec\; \text{CROSS\_CONFIRMED} \] \[ \prec\; \text{CITATION\_BACKED} \;\prec\; \text{RAG\_GROUNDED} \;\prec\; \text{TOOL\_EXECUTED} \;\prec\; \text{TOOL\_VERIFIED} \;\prec\; \text{HUMAN\_VERIFIED} \;\prec\; \text{FORMALLY\_PROVEN} \]
with \(\bot = \text{SELF\_CONTRADICTED}\) (value 0) and \(\top = \text{FORMALLY\_PROVEN}\) (value 100).
This is a bounded total order, hence automatically a (bounded, distributive)
lattice with \(\land = \min\) and \(\lor = \max\). In jugeo-agents, the
TrustLevel is an IntEnum with values 0 through 100
in steps of 10:
5.1 Lattice Operations
The trust algebra provides three fundamental operations, each with a precise algebraic characterization:
The conservative_join operation is the lattice meet
(greatest lower bound):
\[ \mathrm{conservative\_join}(\ell_1, \ldots, \ell_k) \;=\; \bigwedge_{i=1}^k \ell_i \;=\; \min(\ell_1, \ldots, \ell_k) \]
Semantic invariant: trust can never increase by composition. If a claim passes through a chain of agents, its trust is the minimum trust in the chain. This is the weakest-link principle.
from jugeo_agents.types import conservative_join, TrustLevel
# Trust composes via meet: the weakest link determines the chain's trust
chain_trust = conservative_join(
TrustLevel.TOOL_VERIFIED, # 80
TrustLevel.STRONG_MODEL_GENERATED, # 30
TrustLevel.RAG_GROUNDED, # 60
)
assert chain_trust == TrustLevel.STRONG_MODEL_GENERATED # min = 30
A claim at trust level \(\ell\) can only be promoted to level \(\ell' \succ \ell\) if there exists evidence \(e\) with:
\[ \mathrm{can\_promote}(\ell, \ell', e) \;=\; \begin{cases} \mathsf{true} & \text{if } e \neq \epsilon \;\text{ and }\; \ell' \leq \mathrm{ceiling}(\mathrm{channel}(e)) \\ \mathsf{false} & \text{otherwise} \end{cases} \]
No silent promotion. An LLM cannot promote itself from
WEAK_MODEL_GENERATED to TOOL_VERIFIED just by
claiming it ran a tool. The evidence must come through a verified channel.
5.2 Evidence Channel Ceilings
Each evidence channel has a trust ceiling — the maximum trust level
achievable through that channel. This is enforced by the
TrustCeilingEnforcer:
| Evidence Channel | Trust Ceiling | Value |
|---|---|---|
FORMAL_PROOF |
FORMALLY_PROVEN |
100 |
HUMAN_REVIEW |
HUMAN_VERIFIED |
90 |
CODE_EXECUTION |
TOOL_VERIFIED |
80 |
SQL_QUERY |
TOOL_VERIFIED |
80 |
API_CALL |
TOOL_EXECUTED |
70 |
WEB_SEARCH |
RAG_GROUNDED |
60 |
RAG_RETRIEVAL |
RAG_GROUNDED |
60 |
LLM_VERIFICATION |
CROSS_AGENT_CONFIRMED |
40 |
LLM_GENERATION |
WEAK_MODEL_GENERATED |
20 |
The ceiling is absolute. Even if 100 LLMs unanimously confirm
a claim, its trust cannot exceed CROSS_AGENT_CONFIRMED (40) through
the LLM_VERIFICATION channel. To reach TOOL_VERIFIED
(80), the claim must be verified through CODE_EXECUTION or
SQL_QUERY. This is the algebraic reason majority vote cannot
substitute for evidence.
Let \(\sigma\) be a claim with trust \(\ell\), and let \(e_1, \ldots, e_k\) be evidence items arriving through channels \(c_1, \ldots, c_k\). Then the maximum achievable trust for \(\sigma\) is:
\[ \ell_{\max}(\sigma) \;=\; \max_{i} \; \mathrm{ceiling}(c_i) \]
Proof: Each promotion attempt is bounded by its channel's ceiling. The claim's
trust can only reach the ceiling of the highest-authority channel that provides
corroborating evidence. The TrustAlgebra.promote() method enforces
\(\ell' \leq \mathrm{ceiling}(c)\) at every promotion step. ∎
6. The Global Section Assembler
The GlobalSectionAssembler is the algorithmic heart of jugeo-agents.
It computes the Čech cohomology of the agent pipeline and assembles a
VerifiedGlobalSection — the trust-graded, provenance-tracked,
obstruction-free fusion of all agent outputs.
6.1 The Assembly Pipeline
outputs
claims
descent
H¹
H²
phantoms
section
In mathematical terms, the algorithm computes the following:
Input: Local sections \(\{\sigma_1, \ldots, \sigma_n\} \in C^0(\mathcal{U}, \mathcal{F})\)
Step 1. Compute \(d^0\) to obtain all pairwise comparisons. Identify \(\ker(d^0)\) (consistent claims) and \(C^1 \setminus \ker(d^1)\) (contradictions).
Step 2.
For each H¹ cocycle \([c_{ij}] \in H^1\), resolve via
trust-weighted selection: keep the claim with higher trust.
The losing claim is quarantined with reason
H1_LOST_TRUST_CONTEST.
Step 3.
Compute \(d^1\) to detect H² cocycles. For each cascading hallucination
chain, quarantine the entire chain with reason
H2_CASCADING_HALLUCINATION.
Step 4.
Scan \(\ker(d^0)\) for phantom sections: claims where every supporting
agent has trust \(\leq \text{WEAK\_MODEL\_GENERATED}\). Flag with reason
PHANTOM_UNGROUNDED.
Step 5. The global section is:
\[ \Gamma(\mathcal{F}) \;=\; H^0 \;\setminus\; \{\text{phantoms}\} \;\setminus\; \{\text{H² chains}\} \]
Output: VerifiedGlobalSection containing
verified claims, quarantined claims, obstructions, and cohomology computation.
6.2 The Euler Characteristic
The Euler characteristic of the pipeline is the alternating sum of Betti numbers:
where \(h^n = \dim H^n(\mathcal{U}, \mathcal{F})\) counts the number of independent obstructions at degree \(n\). A healthy pipeline has \(\chi \approx h^0\), meaning the Euler characteristic is dominated by verified claims.
The Euler characteristic provides a single scalar health metric for the pipeline.
It is computed by CohomologyComputation.compute_derived() and stored
as euler_characteristic alongside the full Betti number tuple.
from jugeo_agents import AgentOutput
from jugeo_agents.core.fusion import GlobalSectionAssembler
assembler = GlobalSectionAssembler()
assembler.ingest(AgentOutput(agent_id="a", output_text="Tesla was founded in 2003."))
assembler.ingest(AgentOutput(agent_id="b", output_text="Tesla was founded in 2004."))
gs = assembler.assemble()
coh = gs.cohomology
h0, h1, h2 = coh.betti_numbers
rho = coh.obstruction_density
if h2 > 0:
print("CRITICAL")
elif h1 > 0:
print("WARNING")
elif rho < 0.05:
print("HEALTHY")
else:
print("MODERATE")
The analogy with algebraic topology is precise. In classical sheaf cohomology on a topological space \(X\):
• \(H^0(X, \mathcal{F})\) = global sections (globally consistent data)
• \(H^1(X, \mathcal{F})\) = obstructions to gluing local sections (local-to-global failure)
• \(H^2(X, \mathcal{F})\) = obstructions to lifting through extensions (higher-order failure)
In the multi-agent setting, \(X\) is replaced by the agent-task site, \(\mathcal{F}\) by the claim presheaf, and the cohomology measures the "topological complexity" of the disagreements between agents. A pipeline with trivial cohomology (\(H^n = 0\) for \(n \geq 1\)) is one where every claim is globally consistent — the multi-agent analogue of a contractible space.
Let \(\sigma \in \Gamma(\mathcal{F})\) be the global section emitted by the assembler. Then:
\[ \forall\; c \in \sigma : \quad \mathrm{trust}(c) \geq \mathrm{threshold} \;\;\wedge\;\; \mathrm{grounded}(c) = \mathsf{true} \;\;\wedge\;\; c \notin \mathrm{chain}(\text{H}^2) \]
Every claim in the verified global section has trust above the configured threshold, is grounded in at least one evidence channel, and is not part of any cascading hallucination chain.
7. Why Majority Vote Fails
The standard approach to resolving multi-agent disagreements is majority vote: poll all agents and take the plurality answer. This fails in precisely the cases that matter most.
The core failure: majority vote counts agents, not evidence. If 3 ungrounded LLMs agree on a claim and 1 tool-backed agent disagrees, majority vote picks the 3 ungrounded LLMs. JuGeo picks the tool-backed agent, because \(\mathrm{trust}(\text{TOOL\_VERIFIED}) = 80 \succ 20 = \mathrm{trust}(\text{WEAK\_MODEL\_GENERATED})\), regardless of agent count.
Formally, majority vote computes a function \(v : \text{Claims} \to \{0, 1\}\) by:
This function is not trust-aware. It treats
FORMALLY_PROVEN and UNGROUNDED_CLAIM identically —
each counts as one vote.
JuGeo replaces this with trust-weighted resolution:
When trust levels are equal, the ChallengeProtocol initiates a
structured debate between the agents, with a third agent acting as judge.
The losing claim is quarantined; the winning claim is promoted.
7.1 Phantom Consensus
The deepest failure mode of majority vote is phantom consensus: all agents agree on a fabricated "fact," each seemingly "confirming" the others.
Let \(c\) be a claim with \(c \in \ker(d^0)\) (all agents agree). Define the grounding set:
\[ G(c) = \{a \in \mathcal{A} \mid \mathrm{trust}_a(c) \geq \text{CITATION\_BACKED}\} \]
If \(G(c) = \emptyset\), then \(c\) is a phantom section: universally agreed-upon but evidentially void. Majority vote accepts \(c\) with maximum confidence. JuGeo quarantines it.
The Čech cohomology detects phantom consensus because it tracks not just whether agents agree, but the trust provenance of the agreement. A phantom section lives in \(\ker(d^0)\) — it passes the consistency check — but it fails the grounding check, which is orthogonal to cohomological consistency.
from jugeo_agents import AgentOutput
from jugeo_agents.core.fusion import GlobalSectionAssembler, QuarantineReason
assembler = GlobalSectionAssembler(phantom_detection=True)
assembler.ingest(AgentOutput(agent_id="a", output_text="NeuralForge raised $500M in 2024."))
assembler.ingest(AgentOutput(agent_id="b", output_text="NeuralForge raised $500M in 2024."))
gs = assembler.assemble()
for q in gs.quarantined:
if q.reason == QuarantineReason.PHANTOM_UNGROUNDED:
print(q.claim.text)
print(q.claim.trust.name)
The algebraic perspective: Majority vote computes \(H^0\) of a constant presheaf (where all stalks have equal weight). JuGeo computes \(H^0\) of a trust-graded presheaf (where stalks carry lattice-valued weights). The constant presheaf has no mechanism to detect phantom sections because it cannot distinguish grounded from ungrounded agreement. The trust-graded presheaf can, because phantom sections have \(\mathrm{trust}(\sigma|_U) \leq \text{WEAK\_MODEL\_GENERATED}\) everywhere, which the grounding filter detects.
7.2 Failure Mode Comparison
| Failure Mode | Majority Vote | JuGeo (Sheaf-Theoretic) |
|---|---|---|
| 3 ungrounded vs. 1 tool-backed | ❌ Picks the 3 ungrounded | ✅ Picks the tool-backed (trust 80 > 20) |
| Cascading hallucination (A → B → C) | ❌ Sees "3 agents agree" — accepts | ✅ Traces provenance chain — quarantines |
| Phantom consensus (all agree, none grounded) | ❌ Maximum confidence — unanimity! | ✅ Quarantines — grounding check fails |
| Subtle contradiction (overlapping subtasks) | ❌ Picks majority — ignores disagreement | ✅ H¹ cocycle detected — explicit obstruction |
| Missing coverage (agent produces nothing) | ❌ Silent gap — no output = no error | ✅ H⁰ gap — coverage check fails |
| Equal-trust disagreement | ❌ Arbitrary tie-breaking | ✅ Challenge protocol — structured debate |
Summary. The sheaf-theoretic framework gives multi-agent verification three things that heuristic approaches cannot:
(1) Completeness classification — every failure mode maps to a cohomological invariant (H⁰ gaps, H¹ contradictions, H² cascades, phantom sections).
(2) Trust monotonicity — evidence-graded claims with algebraic composition rules that prevent trust inflation.
(3) A global assembly guarantee — when the cohomology is trivial and no phantoms exist, the global section is the unique consistent, grounded fusion of all agent outputs.