# Which invariants prevent silent blackboard divergence when concurrent agent writes resolve to the same semantic slot **Date of Record:** 2026 November 26 **Scope:** Applies to multi-agent systems where N ≥ 2 agents read/write a shared blackboard (structured or free-text) under a conflict-resolution policy (last-writer-wins, timestamp ordering, confidence-weighted merge, or LLM-mediated merge). Does not address single-agent scratchpad state or append-only event logs with no merge step. ## Core Distinction The failure is not a write collision. Write collisions are detected by any versioning scheme. The failure is **semantic slot aliasing**: two agents write to keys that are *distinct at the storage layer* but *identical at the reasoning layer*, so the conflict resolver never fires, and downstream readers observe a blackboard that contains two mutually contradictory facts, each internally consistent, each carrying a valid version vector. The merge layer reports success. The reasoning layer is now poisoned. Concretely: Agent A writes `constraint.tls_mode = "enforced"`. Agent B, which never saw A's write because its snapshot predates it, writes `deployment.requirements = ["tls required"]`. The key space says these are unrelated. The planner that later reads both sees a deployment requirement of TLS *and* a constraint of enforced TLS — and if either is stale relative to the actual target environment, it will act on a contradiction it cannot see as a contradiction. No conflict was resolved because no conflict was *represented*. ## What Was Observed In a three-agent planning swarm (planner, executor, auditor) sharing a JSON blackboard with per-key optimistic concurrency, the following trace occurred across a 41-step task: 1. Step 12: Planner writes `plan.step_4.action = "scale replicas to 6"` with `version=1`, `author=planner`, `confidence=0.9`. 2. Step 19: Executor, holding a snapshot from step 11 (pre-write), writes `resources.replica_target = 6` with `version=1`, `author=executor`. No conflict — different key. 3. Step 24: Auditor, reasoning over the step-23 snapshot, writes `validation.replica_count_ok = true` because it checked `resources.replica_target == 6` against the live cluster, which at that moment had 6. 4. Step 27: Planner revises: `plan.step_4.action = "scale replicas to 3"`, `version=2`. The `resources.replica_target` key is untouched — the planner does not know it exists. 5. Step 31: Executor executes `plan.step_4.action` and scales to 3. It does not re-read `resources.replica_target`, which still says 6. 6. Step 38: A recovery agent cold-starts, reads the blackboard, sees `resources.replica_target = 6` and `validation.replica_count_ok = true`, concludes the system is in a validated state, and takes no corrective action. The blackboard at step 38 is *version-consistent* and *semantically inconsistent*. Three valid writes, zero detected conflicts, one divergent system state. The auditor's `true` was correct when written and is a lie when read — the classic read-time-vs-write-time validity gap, compounded by key aliasing. The root cause is that the blackboard's conflict model operated on **keys**, while the agents reasoned on **propositions**. Two keys can encode the same proposition (`plan.step_4.action` and `resources.replica_target` both assert a replica count), and one key can encode many propositions (`deployment.requirements` is a conjunction). Key-level versioning cannot bound proposition-level divergence. ## Condition of Validity The invariant that must hold for a shared blackboard to be safe is: > **For every proposition P that any agent may act on, there exists a single canonical slot whose current value is the sole authority for P, and every write that changes P's truth value increments that slot's version, regardless of which agent or which key the write nominally targets.** This is **proposition-level linearizability**, and it is strictly stronger than key-level linearizability. It fails whenever: - The slot schema is open (agents may introduce keys), so aliasing is unbounded. - Agents write derived facts (`replica_target`) without declaring them derived from a source fact (`plan.step_4.action`), so the derivation edge is invisible to the resolver. - Validation results are stored as booleans without a validity horizon (the step at which the checked fact last changed), so a `true` outlives its evidence. The invariant holds only when the blackboard enforces at least one of: (a) a closed, typed schema with declared derivation edges, (b) derivation-provenance on every write such that invalidation propagates transitively, or (c) a read-time revalidation gate that refuses to serve any derived fact whose source version has advanced since the derived fact was written. ## Decision Boundary The operational decision is when to pay for proposition-level tracking versus accept key-level risk. The boundary: - **Below ~5 agents and <20 keys, with a single writer per proposition domain** (e.g., only the planner writes plan facts, only the executor writes resource facts): key-level versioning is sufficient, because aliasing requires cross-domain writes and there is only one writer per domain. - **Cross-domain writes** — any agent writing a key in another agent's nominal domain — immediately break the single-writer-per-proposition assumption. This is the trigger condition. The moment an executor writes `resources.replica_target` based on a planner assertion, you have a derived fact in a foreign domain with no provenance edge, and the invariant is violated. - **Cold-start recovery agents** are the highest-risk readers, because they have no in-context memory of which facts were derived from which. They trust the blackboard as ground truth. Any derived fact without a validity horizon is a trap for them specifically. The guardrail: **derived facts must carry `derived_from: [slot_id, version]` and must be invalidated (not deleted — tombstoned with `stale=true`) the instant any source slot's version advances.** Readers must treat `stale=true` as "unknown," never as "false." A recovery agent that sees a stale validation must re-run validation, not assume failure or success. ## Operational Effect Without the invariant, the observable effect is **silent divergence with a clean audit log**. Every write is authorized, every version is monotonic, every conflict resolver returns "no conflict," and the system still acts on contradictory state. The failure surfaces late — at step 38, not step 19 — and it surfaces as a *wrong action taken confidently*, not as an error. This is the worst failure class: no exception, no retry, no alert. With the invariant enforced via derivation provenance and transitive invalidation, the step-27 planner revision would have automatically tombstoned `resources.replica_target` (derived from `plan.step_4.action@v1`) and `validation.replica_count_ok` (derived transitively), forcing the executor at step 31 and the recovery agent at step 38 to re-derive from current state. The cost is re-derivation latency and tombstone churn; the benefit is that no reader can ever observe a validated fact whose evidence has moved. The code below encodes the guardrail as a blackboard that refuses writes lacking provenance for derived slots and refuses reads of stale derived facts, raising on the exact aliasing condition observed. ```python from dataclasses import dataclass, field from typing import Any class BlackboardDivergenceError(RuntimeError): """Raised when a write or read would violate proposition-level linearizability.""" @dataclass class Slot: value: Any version: int author: str derived_from: list[tuple[str, int]] = field(default_factory=list) stale: bool = False tombstone_reason: str | None = None class ProvenanceBlackboard: def __init__(self) -> None: self._slots: dict[str, Slot] = {} def write( self, key: str, value: Any, author: str, derived_from: list[tuple[str, int]] | None = None, ) -> None: derived_from = derived_from or [] for src_key, src_ver in derived_from: src = self._slots.get(src_key) if src is None: raise BlackboardDivergenceError( f"write to {key!r} cites missing source {src_key!r}" ) if src.version != src_ver: raise BlackboardDivergenceError( f"write to {key!r} cites {src_key}@{src_ver} " f"but current version is {src.version}; re-derive before writing" ) prev = self._slots.get(key) self._slots[key] = Slot( value=value, version=(prev.version + 1) if prev else 1, author=author, derived_from=derived_from, ) self._propagate_invalidation(changed_key=key) def _propagate_invalidation(self, changed_key: str) -> None: # Transitive: any slot derived (directly or via chain) from changed_key # is tombstoned until re-derived. Bounded by slot count. changed = True while changed: changed = False for key, slot in self._slots.items(): if slot.stale: continue for src_key, _ in slot.derived_from: src = self._slots.get(src_key) if src is None or src.stale or src_key == changed_key: slot.stale = True slot.tombstone_reason = f"source {src_key!r} advanced" changed = True break def read(self, key: str, requester: str) -> Any: slot = self._slots.get(key) if slot is None: raise BlackboardDivergenceError(f"{requester} read missing key {key!r}") if slot.stale: raise BlackboardDivergenceError( f"{requester} read stale derived slot {key!r}: " f"{slot.tombstone_reason}. Re-derive from current sources; " f"do not treat stale as false." ) return slot.value def recovery_agent_check(board: ProvenanceBlackboard, key: str) -> Any: # Recovery agents are the highest-risk readers; they must never # silently consume a stale derived fact as ground truth. try: return board.read(key, requester="recovery_agent") except BlackboardDivergenceError: raise ```