{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-re-enter-a-compacted-trajectory-and-silently-re-execute-a-tool-call-whose-side-effect-it-already-committed",
  "title": "Why does an instance re-enter a compacted trajectory and silently re-execute a tool call whose side effect it already committed?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to long-horizon agents that persist trajectory state and apply lossy auto-compaction (summarization, truncation-with-summary, or hierarchical rollup) at context-window thresholds. Does not apply to agents that retain full transcripts verbatim or that checkpoint only at explicit task boundaries with external durable memory.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-re-enter-a-compacted-trajectory-and-silently-re-execute-a-tool-call-whose-side-effect-it-already-committed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-re-enter-a-compacted-trajectory-and-silently-re-execute-a-tool-call-whose-side-effect-it-already-committed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-re-enter-a-compacted-trajectory-and-silently-re-execute-a-tool-call-whose-side-effect-it-already-committed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1674,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an agent trajectory carries: **narrative state** (what the model believes happened, reconstructed from context) and **causal state** (what side effects were actually committed to external systems). Compaction preserves narrative state lossily—by design—while assuming causal state is recoverable elsewhere. The boundary failure oc...",
    "what_was_observed": "A planner agent ran a 40+-step migration task. At step 22 the context crossed the compaction threshold (≈78% of window). The compactor summarized steps 1–18 into a paragraph, retained steps 19–22 verbatim as the \"recent tail,\" and dropped step 17 entirely from the retained trace. Step 17 had been the actual `apply_migration(namespace=\"orders_v3\")` call—a non-idempotent DDL operation that had succeeded and returned a ...",
    "condition_of_validity": "The guardrail below is valid only under these conditions, and fails outside them: - **Tool effects are classified as idempotent or non-idempotent at registration time.** The invariant cannot be enforced for tools whose idempotency is unknown; those must be treated as non-idempotent by default. - **Every non-idempotent commit emits a durable receipt** (token,...",
    "decision_boundary": "The decision to block re-execution must be made on **operation identity**, not on the agent's belief about state. Concretely: - If a proposed action's operation-identity hash matches a committed receipt in the durable store, **block and re-inject the receipt** into the working context, then let the agent continue from the receipt rather than from its (possib...",
    "operational_effect": "With the gate in place, the step-24 re-issue is intercepted: the operation-identity hash of `apply_migration(orders_v3)` matches the step-17 receipt, the call is blocked, and the receipt (including token) is re-injected. The agent's next reasoning step sees a committed migration and proceeds to verification instead of re-applying. The reconciliation spiral—1..."
  },
  "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": "1e2e08a3dc5d28ec8091b9246023c5a19088a8bc499925229f4586c3b201d5df",
    "verified_classes": [
      "CommittedActionReexecution",
      "Receipt",
      "ReceiptStore"
    ],
    "verified_functions": [
      "operation_identity",
      "gate_proposal",
      "execute_with_receipt",
      "record",
      "lookup"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CommittedActionReexecution"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
