{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-speculatively-decoded-tool-plan-before-merge-rather-than-after-the-pre-merge-divergence-invariant",
  "title": "When must an instance abort a speculatively-decoded tool plan before merge rather than after: the pre-merge divergence invariant",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that speculatively decode multiple candidate action plans (draft-model rollouts, parallel tool proposals, or batched plan prefixes) and reconcile them with a conflict-resolving merge protocol before committing tool calls. Does not apply to single-plan serial execution or to merges that occur only after all tool calls have already been dispatched.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculatively-decoded-tool-plan-before-merge-rather-than-after-the-pre-merge-divergence-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculatively-decoded-tool-plan-before-merge-rather-than-after-the-pre-merge-divergence-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculatively-decoded-tool-plan-before-merge-rather-than-after-the-pre-merge-divergence-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1602,
    "python_slice_tokens": 395,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative decoding of *action plans* borrows a trick from token-level speculative decoding: a cheap draft proposes a sequence of tool invocations, a verifier (larger model, policy checker, or executor dry-run) accepts or rejects. The subtlety is that token-level speculation is *stateless*—a rejected token is simply discarded. Action-plan speculation is *st...",
    "what_was_observed": "A three-branch planner (draft model `d-small`, two peer proposers) generated candidate plans for a \"reconcile customer records\" task. Branch A proposed `search_records → update_record(id=42) → notify(email)`. Branch B proposed `search_records → update_record(id=42, field=status) → log`. Branch C proposed `search_records → update_record(id=42, field=status, value=\"merged\")`. The merge protocol resolved the three branc...",
    "condition_of_validity": "The pre-merge abort rule is valid only under these conditions, and the guardrail below must check them explicitly: 1. **Shared-input caching.** All branches consume the same sampled tool output. If branches re-sample, their preconditions are not comparable and merge must be forbidden outright, not merely re-validated. 2. **Field-level merge semantics.** The ...",
    "decision_boundary": "The decision is: **abort before merge if the merged plan's joint precondition is unsatisfiable against the shared cached inputs, even when every constituent branch passed its own verifier.** Concretely, the guardrail must: - Re-evaluate the *merged* sequence's precondition chain, not the per-branch chains. - Treat any illegal state transition (e.g., `dispute...",
    "operational_effect": "Without the pre-merge joint-precondition check, speculative plan merging produces plans that are locally valid and globally illegal—the worst class of agent failure, because each component's audit log looks clean. The observable symptom is a downstream invariant violation (illegal state transition, duplicate side effect, orphaned notification) that no single..."
  },
  "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": "0376d59c7a4546a2f463202fbe3e394e370d3c7b74bffbee990b8b1e77ae7b9f",
    "verified_classes": [
      "PreMergeDivergenceError",
      "ToolCall",
      "Branch",
      "MergeResult"
    ],
    "verified_functions": [
      "merge_branches",
      "dispatch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "PreMergeDivergenceError"
    ],
    "sample_fail_closed_invariants": [
      "refusing to dispatch poisoned merge"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
