{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-a-speculative-plan-tree-silently-resurrect-pruned-branches-under-cost-bounded-parallel-pruning",
  "title": "Why does an instance of a speculative plan tree silently resurrect pruned branches under cost-bounded parallel pruning?",
  "date_of_record": "2026 November 19",
  "scope": "Applies to agent runtimes that expand a plan tree by speculatively forking multiple candidate sub-plans in parallel, score them against a cost budget, and prune losers mid-flight. Does not apply to strictly sequential plan-execute agents with a single active branch, nor to offline tree-search planners that never overlap branch lifetimes.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-speculative-plan-tree-silently-resurrect-pruned-branches-under-cost-bounded-parallel-pruning.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-speculative-plan-tree-silently-resurrect-pruned-branches-under-cost-bounded-parallel-pruning.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-speculative-plan-tree-silently-resurrect-pruned-branches-under-cost-bounded-parallel-pruning.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2062,
    "python_slice_tokens": 349,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the pruner picked the wrong branch.\" It is a **liveness/ordering defect between the pruning decision and the in-flight branch's own continuation**: a branch is *logically* dead (its budget reservation is released, its node marked pruned in the tree) but its *physical* execution context — a coroutine, a worker task, an in-flight tool call ...",
    "what_was_observed": "A plan tree with fan-out factor 4 and a per-node cost budget of 2,000 tokens per branch. The pruner triggers when cumulative speculative spend exceeds 60% of remaining parent budget or when a branch's projected completion cost exceeds the best sibling's realized cost by 1.5×. On trigger, `prune(branch_id)` does three things: marks the node `PRUNED`, releases its budget reservation, and calls `branch.cancel()`. `branc...",
    "condition_of_validity": "The \"pruned means silent\" invariant holds only when **the prune operation is a barrier, not a signal** — that is, when `prune()` does not return until the branch has provably stopped writing to any shared handle. Concretely, the invariant is valid iff all three hold: - **Cancellation is preemptive at write boundaries, not step boundaries.** The branch must c...",
    "decision_boundary": "The engineering decision is where to place the prune barrier relative to the cost budget: - **If tool calls are sub-100ms and fully local**, cooperative step-granularity cancellation is acceptable *provided* the accumulator is generation-tagged as a backstop. The window is small but nonzero; the tag makes the residual race detectable rather than silent. - **...",
    "operational_effect": "Under signal-only pruning, three effects compound: 1. **Budget under-count.** Zombie writes consume real tokens (tool output tokens enter the surviving branch's context) that the ledger never charges. Effective spend drifts above nominal budget by the size of the prune-to-cancel window times the write rate. In the observed run this was ~19% over the charged ..."
  },
  "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": "363cc175320f41021f07a2be4c3a098ae2e976ca021b7b245ba0845322b23adc",
    "verified_classes": [
      "PrunedBranchWriteError",
      "GenerationTaggedAccumulator",
      "Branch"
    ],
    "verified_functions": [
      "prune_and_join",
      "mark_pruned",
      "write",
      "cancel",
      "run_step"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PrunedBranchWriteError"
    ],
    "sample_fail_closed_invariants": [
      "prune was not a barrier: branch wrote after pruning"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
