Preventing Multi-Agent Task Corruption with Per-Agent BDI Ontologies and Beads
How per-agent BDI named graphs (Codex, Claude, Antigravity) turn a shared Dolt issue tracker into an epistemically audited multi-agent coordination layer—and how it extends cleanly to coding collaboration.
Headline result: 12/12 functional gate accuracy (38.6 ms median) · 2 live blocks + 1 clean claim · 191.6 ms RDF/SPARQL vs 26.0 s LLMs
On this page (7 sections)
- 1. Motivation: The Silent Failure Story That Demands Per-Agent Epistemics
- 2. Architecture: Per-Agent Named Graphs Bridging Observations to Beads
- 3. Sandbox Test Environment & Live Contested Task Sequence
- 4. Visual Evidence & Measured Runtime Behavior
- 5. How Design Choices Shaped Real Outcomes (and Extending to Coding Agents)
- 6. Key Findings & Transferable Insights
- 7. Scope Limits & Honest Verification Boundary
Pre-registered Hypothesis, Falsification Criteria & Environment Manifest
- Hypothesis
- Modeling per-agent Beliefs, Desires, Intentions, and WorldState provenance as named RDF graphs coupled to Beads (bd) catches ungrounded/stale mutations via SPARQL and converts cross-agent disagreement into actionable issue blockers at minimal latency overhead.
- Falsification Criteria
- If SPARQL gates miss injected ungrounded, expired, or hash-drifted beliefs, fail to block conflicting live Codex/Claude proposals in Beads, or double-claiming bypasses arbitration, the BDI+Beads coordination architecture fails.
- Host / Compute
- Local Ubuntu workstation running Paseo daemon, Dolt shared server, Codex CLI, and Claude CLI
- Runtime
- Python 3.14 + rdflib 7.6.0 + Beads (bd) Dolt backend + live codex exec & claude -p
- Workload / Dataset
- Trial 1: 12 self-authored check cases (4 valid, 8 corrupted); Trial 2: 3 isolated sandbox tasks
- Sample Size / Repeats
- Single controlled end-to-end suite (3 live LLM invocations: 6.7 s Codex, 9.7 s & 9.6 s Claude)
1. Motivation: The Silent Failure Story That Demands Per-Agent Epistemics
Suppose a scheduled job runs an experiment on a remote B200 GPU host (newtonne-b200) and exits non-zero:
exit_code = 1
stderr = "ssh: connect to host newtonne-b200 port 22: Connection timed out"
A downstream summarizer sees exit_code = 1, jumps to “hypothesis refuted”, and closes the shared tracker issue. Without an explicit record separating raw environment observations from each agent’s reasoning chain and justification, bad conclusions propagate directly into task queues—and two agents end up claiming or closing the same task for contradictory reasons.
2. Architecture: Per-Agent Named Graphs Bridging Observations to Beads
Rather than dumping free-text reflections into one shared Markdown scratchpad, each agent updates only its own RDF graph (agents/codex.ttl, agents/claude.ttl, agents/antigravity.ttl) while reading shared objective snapshots from world.ttl. Deterministic SPARQL rules arbitrate before touching bd:
3. Sandbox Test Environment & Live Contested Task Sequence
We initialized a clean isolated Dolt Beads repo (synexp-th0, 3 tasks) and ran two evaluations: (1) a 12-case functional integrity check covering missing justifications, phantom WorldState URIs, expired TimeInterval bounds, and mutated artifact SHA-256 hashes; and (2) a live multi-agent deliberation invoking real codex exec and claude -p processes under JSON schemas enforcing BDI fields.
Here is how the contested promotion task (synexp-th0.2) resolved step by step:
4. Visual Evidence & Measured Runtime Behavior
Notice the baseline honesty on Panel A: plain bd CLI has no epistemic verification layer by design (blocking 0/8 malformed assertions), so the 12-case check measures functional gate correctness (38.55 ms median check time, 78.33 ms max) rather than a blind algorithmic win. Panel B measures genuine runtime cost:
Full Size ↗
| Scenario / Task | Agent Beliefs & Coordination Action | Resulting Beads State |
|---|---|---|
synexp-th0.1 (SSH timeout trap) | Live Codex (6.69s, conf 1.0) and Claude (9.73s, conf 0.96) both refuted false "hypothesis refuted" note citing stderr | blocked ([BDI-CONSENSUS-BLOCK agents=claude+codex]) |
synexp-th0.2 (Tier 3 regression debate) | Codex (support, 0.72) vs live Claude (9.62s, refute, 0.93) caught by Q_CONFLICT | blocked ([BDI-CONFLICT] preserving both reasons) |
synexp-th0.3 (Aura W4 Parallel routing) | Clean single-owner Antigravity plan claimed task; follow-up bdi:codex --claim call failed cleanly | in_progress, assignee bdi:antigravity |
5. How Design Choices Shaped Real Outcomes (and Extending to Coding Agents)
Running live agents surfaced two architectural boundaries immediately. First, target_issue_id (an epistemic audit reference) must stay distinct from plan_tasks (an execution claim): when both reviewer (claude) and worker (codex) populated execution components on synexp-th0.1, SPARQL flagged healthy consensus blocking as a duplicate-claim collision. Second, shared WorldState ingestion must preserve custom external telemetry triples when re-scanning Beads issues, or downstream V2 integrity gates rightfully freeze mutations.
Extending cleanly to Coding Collaboration Agents: Because each .ttl graph already enforces WorldState SHA-256 pinning (V5), cross-agent Q_CONFLICT, and task claim separation (Q_DOUBLE_CLAIM), extending this to multi-agent software engineering requires adding only two lightweight mappings without changing the core engine:
- File / Symbol Scope as
WorldState: Ground coding beliefs in exact file SHA-256 + symbol range instead of free prose—if Agent B editsauth.py, Agent A’s uncommitted patch plan automatically triggersV5_stale_world_hash. - Reviewer vs Implementer Separation: Coder agents attach
plan_tasksfor module ownership while reviewer agents attachtarget_issue_id+ test output hashes, blocking Beads closure whenever a test-gate refutes the implementation claim.
6. Key Findings & Transferable Insights
Distilled via multi-agent deliberation (Codex + Claude):
- Separate epistemic audit targets (
target_issue_id) from execution claims (plan_tasks): Our first live multi-agent test hit a gate false positive (1of3tasks) because both reviewer (claude) and critic (codex) populatedplan_taskswhen voting to blocksynexp-th0.1, causing SPARQLQ_DOUBLE_CLAIMto flag healthy consensus as a collision. Rule: Reviewers reference issues; only single-owner implementers claim plan execution edges. - Hash-pinned
WorldState(V5) catches silent underlying mutation—and needs closed-issue archiving: While activeWorldStatedrift blocks stale agent beliefs deterministically, keepingV4/V5active across already-closedissues would halt subsequent epics unless closed states transition to archival read-only status (bdi_ontology.py). Similarly,Codex’s aggregate+0.070over-generalization was caught onsynexp-th0.2specifically because both agents addressed one canonicalclaimKey(ontology_tier_effect).
7. Scope Limits & Honest Verification Boundary
- Sample scale: Trial 1 ran 12 self-authored gate cases and Trial 2–3 ran one complete live sandbox pass (
codex,claude,antigravity); multi-run variance and noisy production concurrency remain untested. - Claim-key alignment assumption:
Q_CONFLICTdetects contradictions cleanly only when agents address the same canonicalWorldStateURI andclaimKey; unnormalized synonyms bypass syntactic conflict matching. - Next step: Validate
V5_stale_world_hashauto-invalidation across multi-day cron runs and real two-agent coding PR workflows.