yitae.dev
← Back to Experiments
Agent Interfaces & Coordination · 2026-11-24 · Local Sandbox (Codex + Claude + Dolt Beads) · 8 min read
Supported

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)
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:

T2B2T Multi-Agent Architecture & Beads Coordination Bridge
world.ttlBeads DAG + Host StateSHA-256 Snapshots@codex (Critic / Coder)belief → desire → patch plan@claude (Verification Gate)audit evidence → support / refute@antigravity (Orchestrator)converged plan → task ownershipSPARQL GatesV1–V5 IntegrityQ_CONFLICTQ_DOUBLE_CLAIMZero-LLM deterministic checkBeads (bd)-s blocked—claim—append-notes
Phase 1 projects Beads tasks and raw telemetry into world.ttl. Agents emit justified BDI triples into separate named graphs; SPARQL V1–V5 and Q_CONFLICT either block contested issues in bd or pass single-owner plans to --claim.

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:

Contested Promotion Task Arbitration (synexp-th0.2)
@codex: support (0.72)overall +0.070 (p=0.0167)@claude: refute (0.93)Tier 3 −0.225 · syntax 13→38Q_CONFLICT TriggeredSame WorldState + claimKeyOpposing polarities detectedsynexp-th0.2 → BLOCKEDActor: bdi:arbiter[BDI-CONFLICT] note attached
Live conflict trace: Codex supports default rollout from aggregate accuracy (+0.070), Claude refutes it with per-tier regression (−0.225), and SPARQL Q_CONFLICT locks the task in Beads before code/config mutation occurs.

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:

Left: SPARQL V1-V5 gate validation across 12 functional cases. Right: log-scale latency comparison showing RDF/SPARQL adds 0.74% of live LLM wall time.
Figure 1. Left: Functional verification over 12 self-authored check assertions (4 valid grounded chains accepted, 8 missing-justification/phantom-world/expired/hash-drifted assertions rejected). Right: Single-run component timings (RDF+SPARQL total 191.6 ms vs 26,033 ms across 3 live LLM calls).
Scenario / TaskAgent Beliefs & Coordination ActionResulting 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 stderrblocked ([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_CONFLICTblocked ([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 cleanlyin_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 edits auth.py, Agent A’s uncommitted patch plan automatically triggers V5_stale_world_hash.
  • Reviewer vs Implementer Separation: Coder agents attach plan_tasks for module ownership while reviewer agents attach target_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 (1 of 3 tasks) because both reviewer (claude) and critic (codex) populated plan_tasks when voting to block synexp-th0.1, causing SPARQL Q_DOUBLE_CLAIM to 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 active WorldState drift blocks stale agent beliefs deterministically, keeping V4/V5 active across already-closed issues would halt subsequent epics unless closed states transition to archival read-only status (bdi_ontology.py). Similarly, Codex’s aggregate +0.070 over-generalization was caught on synexp-th0.2 specifically because both agents addressed one canonical claimKey (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_CONFLICT detects contradictions cleanly only when agents address the same canonical WorldState URI and claimKey; unnormalized synonyms bypass syntactic conflict matching.
  • Next step: Validate V5_stale_world_hash auto-invalidation across multi-day cron runs and real two-agent coding PR workflows.