{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abandon-speculative-branch-exploration-before-committing-a-plan-the-speculative-budget-shadow-invariant",
  "title": "When must an instance abandon speculative branch exploration before committing a plan: the speculative-budget shadow invariant",
  "date_of_record": "2026 November 27",
  "scope": "Applies to orchestrator agents that fork N speculative plan branches in parallel (or interleaved) under a shared token/latency budget and prune by cost estimate before committing one branch to execution. Does not apply to single-branch planners, to best-of-N sampling where all branches run to completion, or to tree-search controllers that maintain an exact value function over a closed action set.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-speculative-branch-exploration-before-committing-a-plan-the-speculative-budget-shadow-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-speculative-branch-exploration-before-committing-a-plan-the-speculative-budget-shadow-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-speculative-branch-exploration-before-committing-a-plan-the-speculative-budget-shadow-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2087,
    "python_slice_tokens": 216,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"running out of budget.\" It is **committing a plan whose remaining execution budget was silently consumed by sibling branches that were later pruned.** A speculative planner reasons about branch *planning* cost and branch *execution* cost as if they were separable ledgers. They are not: both draw from the same finite token window and the s...",
    "what_was_observed": "An orchestrator was asked to produce a migration plan with a 40k-token context window and a 90-second latency SLA. It forked four branches: Pruning logic: discard the branch with the highest speculative cost. C is dropped. The orchestrator commits B (lowest execution cost among survivors). Then execution begins. The trace shows the failure at the commit boundary. By the time B is selected: - Speculative spend already...",
    "condition_of_validity": "The shadow invariant is binding — and the pruning heuristic is unsafe — exactly when all three hold: 1. **Shared ledger.** Speculative and execution phases draw from the same finite resource (one context window, one deadline). If speculation ran in a separate sandbox with its own budget and only the *result* transferred, the invariant would not bind, because...",
    "decision_boundary": "The boundary between safe and unsafe commitment is a single comparison performed **after** pruning, against the **post-speculation** ledger, not the pre-speculation one: where `k` is the tail multiple the SLA demands (k=1 for p84, k≈1.3 for p90), `σ_exec(b)` is the *execution* estimate standard deviation — which must be inflated when `b` was explored shallow...",
    "operational_effect": "Downstream, the failure is not a clean abort. It manifests as: - **Silent context saturation mid-execution**, forcing truncation of the execution scratchpad rather than a refusal at commit. The agent does not know it is over budget until a step's dependency has been evicted. - **Reordering of idempotency-sensitive tool calls** when truncated steps are re-der..."
  },
  "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": "eca8321799a40ae451951ac65d8c94d7891ff1f15ecb1493a85f0788c6ae2366",
    "verified_classes": [
      "SpeculativeBudgetShadowError"
    ],
    "verified_functions": [
      "select_and_commit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpeculativeBudgetShadowError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
