{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-tool-call-prefetch-failures-from-poisoning-swarm-state-during-concurrent-verification",
  "title": "Which invariants prevent speculative tool-call prefetch failures from poisoning swarm state during concurrent verification",
  "date_of_record": "2026 November 30",
  "scope": "Applies to multi-agent swarms where a planner agent speculatively issues tool calls (reads, lookups, dry-run mutations) ahead of a peer/auditor agent's confirmation, and where those prefetched results are cached into shared or per-agent state before verification completes. Does not apply to strictly serialized single-agent loops with no speculative execution, nor to read-only agents that discard prefetch results on every turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-prefetch-failures-from-poisoning-swarm-state-during-concurrent-verification.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-prefetch-failures-from-poisoning-swarm-state-during-concurrent-verification.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-prefetch-failures-from-poisoning-swarm-state-during-concurrent-verification.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2305,
    "python_slice_tokens": 400,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between *speculative prefetch as a latency optimization* and *speculative prefetch as an unverified state mutation*. In a single agent, prefetching a tool result and then failing verification is harmless: the result sits in a scratch buffer, the agent discards it, and the next turn re-fetches. In a swarm, the prefetched r...",
    "what_was_observed": "A three-agent swarm (planner, speculator, auditor) was executing a task of the form \"summarize the current state of resource R and propose a mutation.\" The speculator prefetched `get_resource_state(R)` at t=0 and `get_dependent_count(R)` at t=0.4s. The auditor independently called `get_resource_state(R)` at t=1.2s. Between t=0 and t=1.2s, an external writer mutated R (a legitimate concurrent operation, not a fault). ...",
    "condition_of_validity": "Speculative prefetch with cross-agent consistency checks is valid **only when the following invariant holds**: > For every prefetched observation `o` consumed by any agent's reasoning, there exists a *freshness witness* `w(o)` — a monotonically increasing token (version number, ETag, logical clock, or content hash) — such that the consuming agent's decision ...",
    "decision_boundary": "The boundary between safe and unsafe prefetch is drawn at the point where a prefetched observation is **promoted from scratch to shared state**. Before promotion, the observation is the speculator's private speculation and can be discarded freely. After promotion, it is a claim the swarm is entitled to reason over, and it must carry its freshness witness. Co...",
    "operational_effect": "Enforcing the freshness-witness invariant changes three properties of the swarm: **Latency.** Prefetch remains a latency win only for surfaces that expose witnesses. For witness-less surfaces, prefetch must be disabled, and the swarm reverts to serialized read-then-plan. This is the correct trade: a prefetch that cannot be verified is a latency optimization ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "a4fa7b2767e051754365883e4634e295940843ffe65ee4dec2a6657b9908035f",
    "verified_classes": [
      "StalePrefetchPromotionError",
      "Observation"
    ],
    "verified_functions": [
      "promote_prefetch",
      "reconcile",
      "is_witnessed"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StalePrefetchPromotionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
