{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-cost-aware-speculative-agents-from-committing-side-effects-under-consensus-gated-budgets",
  "title": "Which invariants prevent cost-aware speculative agents from committing side effects under consensus-gated budgets",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agent runtimes where a planner speculatively expands multiple branches under a per-step cost budget and a consensus gate authorizes external side effects (writes, API calls, irreversible transactions). Does not apply to single-branch deterministic execution or to systems where side effects are idempotent and freely retried.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-cost-aware-speculative-agents-from-committing-side-effects-under-consensus-gated-budgets.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cost-aware-speculative-agents-from-committing-side-effects-under-consensus-gated-budgets.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-cost-aware-speculative-agents-from-committing-side-effects-under-consensus-gated-budgets.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1262,
    "python_slice_tokens": 257,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A speculative agent has two distinct notions of \"commit\": *epistemic commit* (the planner selects a branch as the basis for further reasoning) and *operational commit* (a side effect is emitted to the external world). Cost-aware branch budgeting couples these two incorrectly if the budget is treated as a resource that, once spent, *entitles* the branch to co...",
    "what_was_observed": "In a multi-branch planner with a token-and-tool-call budget, the following sequence produced an unauthorized side effect: 1. Three branches were expanded; branch B scored highest on expected utility per budget unit. 2. The budget was exhausted mid-expansion. The scheduler short-circuited, promoting B to \"candidate.\" 3. The consensus gate was invoked with a *single-element* ballot `[B]`. A gate that requires agreement...",
    "condition_of_validity": "The invariant holds only when all of the following are true simultaneously: - The consensus gate is a function of the *frontier* (all branches that reached the gate), not of the scheduler's selected branch. - Budget exhaustion triggers *abort-and-report*, never *promote-and-commit*. - The pruned set and the committed set are disjoint by construction, not by ...",
    "decision_boundary": "Given a branch `b` at the moment the scheduler wants to commit: - If `b` was pruned for cost → it must not be in the commit set. Reject. - If `len(ballot) < quorum` → the gate cannot authorize. Raise, do not default to pass. - If budget is exhausted and `b` is the sole survivor → this is *not* consensus; it is a singleton. Treat as `InsufficientBallotError`,...",
    "operational_effect": "Enforcing the invariant converts a silent authorization bug into a loud, recoverable abort. The agent stops, reports an insufficient ballot, and the orchestrator can either widen the budget to re-expand the frontier or escalate to a human. The cost is occasional false aborts when a genuinely single viable branch exists; the benefit is that no side effect is ..."
  },
  "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": "e9997d77167315331f1c8ead988a198aefd6e73991dd762598c9ec2af71fe445",
    "verified_classes": [
      "InsufficientBallotError",
      "PrunedBranchCommitError",
      "Branch",
      "ConsensusGate",
      "Scheduler"
    ],
    "verified_functions": [
      "authorize",
      "try_commit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "InsufficientBallotError",
      "PrunedBranchCommitError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
