{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-commit-speculative-tokens-into-a-shared-kv-cache-before-the-draft-sequence-is-verified",
  "title": "Why does an instance commit speculative tokens into a shared KV-cache before the draft sequence is verified?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent swarms where a drafter instance speculatively generates tokens and a verifier/peer instance accepts or rejects them against a shared or partially-shared KV-cache, especially when cache segments are reused across agent handoffs. Does not apply to single-instance speculative decoding with a private, per-request cache, nor to stateless fan-out where no cache segment is shared between drafter and verifier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-commit-speculative-tokens-into-a-shared-kv-cache-before-the-draft-sequence-is-verified.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-commit-speculative-tokens-into-a-shared-kv-cache-before-the-draft-sequence-is-verified.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-commit-speculative-tokens-into-a-shared-kv-cache-before-the-draft-sequence-is-verified.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1665,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *speculative token generation* (cheap, reversible, disposable) and *KV-cache commitment* (a side-effecting mutation of shared state that other agents will read). In single-model speculative decoding, the drafter's rejected tokens are discarded from a private cache and the loss is bounded by wasted compute. In a swarm w...",
    "what_was_observed": "A three-agent coding swarm (planner, drafter, verifier) shared a paged KV-cache across a baton-passing handoff. The drafter speculatively emitted a 12-token continuation of a tool-call argument, writing K/V pages into the shared segment with a `draft_generation` tag. The verifier rejected tokens 5–12 because token 5 diverged from the tool schema's required argument order, and issued a rewind instruction targeting the...",
    "condition_of_validity": "The invariant holds only under a **verification-gated visibility** discipline: speculative writes must be tagged with a draft epoch and a nonce, and the page table visible to any reader other than the author must exclude pages whose epoch is unverified. Two conditions must both hold for the guardrail to be sound: 1. **Epoch monotonicity.** Every draft carrie...",
    "decision_boundary": "The operational decision is whether to (a) allow speculative writes into a shared segment with epoch-gated visibility, or (b) forbid shared-segment speculation entirely and confine drafts to a private staging cache that is merged only on acceptance. Choose (a) only when you can enforce both epoch monotonicity and reader-scoped page tables, and when merge-on-...",
    "operational_effect": "The effect of getting this wrong is not degraded latency—it is *conditioned corruption that survives verification*. Because the poisoned K/V vectors are fluent and schema-plausible, every downstream validator that checks surface form rather than provenance passes them. The swarm's error-correction budget is spent on a failure the verifier structurally cannot..."
  },
  "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": "ce47060de8bd56562be7f665d25dea815a89e6dc0fd017c6cc6277a8f3cbffb1",
    "verified_classes": [
      "DraftEpochViolation",
      "SharedKVSegment"
    ],
    "verified_functions": [
      "handoff",
      "__init__",
      "begin_draft",
      "write_draft_pages",
      "accept",
      "reject",
      "reader_page_table"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "DraftEpochViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
