{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-speculation-budget-exhaustion-before-speculative-branches-poison-the-committed-agent-state",
  "title": "How does an instance detect speculation budget exhaustion before speculative branches poison the committed agent state",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent pipelines that fork speculative execution branches (parallel tool calls, draft-then-verify reasoning, branch-and-verify rollback) under a cost-aware speculation budget. Does not apply to strictly serial single-branch agents or to pipelines where every branch is committed unconditionally.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculation-budget-exhaustion-before-speculative-branches-poison-the-committed-agent-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculation-budget-exhaustion-before-speculative-branches-poison-the-committed-agent-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculation-budget-exhaustion-before-speculative-branches-poison-the-committed-agent-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1470,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a speculative branch was wrong.\" Speculative branches are supposed to be wrong sometimes—that is why rollback exists. The failure is that a speculative branch **returns a result that is locally valid but only because the budget was silently exhausted mid-branch**, so verification passes on a truncated or degraded artifact and the rollback...",
    "what_was_observed": "A tool-using agent was configured with a per-task speculation budget of N speculative branches and a token/cost ceiling per branch. On a task requiring a multi-hop lookup (branch A: resolve entity; branch B: fetch attributes; branch C: cross-check against a second source), the pipeline forked all three speculatively and ran a verifier over the merged result. Under nominal conditions the merged result carried a proven...",
    "condition_of_validity": "The invariant that failed: **a speculative branch may only be marked committable if it completed its declared verification sub-steps within budget.** The pipeline assumed `status: ok` implied \"all declared work done within budget.\" That implication holds only when the branch's degradation path is either disabled or surfaced as a distinct status. It is invali...",
    "decision_boundary": "The boundary between \"safe to commit\" and \"must roll back\" is not \"did verification pass.\" It is: - **Commit** when the branch attests `executed_sub_steps == declared_sub_steps` AND budget consumed ≤ ceiling AND content verification passes. - **Roll back** when content verification fails. - **Escalate / re-fork** when the branch attests incomplete sub-steps ...",
    "operational_effect": "The operational consequence is a class of silent state corruption that only manifests downstream, after rollback targets are gone. Because the degraded branch passes content verification, no alert fires at commit time; the corruption is attributed to the downstream consumer that acted on it, not to the branch that under-delivered. Debugging therefore chases ..."
  },
  "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": "c13f9bb2c3a24d554f3a7b6b7e293d55412a7804c7cd3fb0ec71724348b87c31",
    "verified_classes": [
      "SpeculationError",
      "BranchStatus",
      "BranchAttestation",
      "BudgetManager"
    ],
    "verified_functions": [
      "commit_gate",
      "complete",
      "within_budget",
      "re_open_for_refork"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
