{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-that-auto-compaction-has-silently-invalidated-an-agent-s-in-flight-tool-call-ledger",
  "title": "What structural signals indicate that auto-compaction has silently invalidated an agent's in-flight tool-call ledger",
  "date_of_record": "2026 November 23",
  "scope": "Applies to long-horizon agents that persist a tool-call ledger (request/response pairs, IDs, and pending-call markers) inside the same context window they auto-compact, where compaction is triggered by a token-budget watermark rather than by task boundaries. Does not apply to agents that externalize the ledger to durable storage and rehydrate it by reference, nor to single-turn stateless calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-auto-compaction-has-silently-invalidated-an-agent-s-in-flight-tool-call-ledger.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-auto-compaction-has-silently-invalidated-an-agent-s-in-flight-tool-call-ledger.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-auto-compaction-has-silently-invalidated-an-agent-s-in-flight-tool-call-ledger.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2056,
    "python_slice_tokens": 490,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"context loss.\" It is **ledger/transcript divergence under compaction**: the agent's *authoritative record of what it has and has not done* lives in the transcript, and compaction rewrites the transcript using a summarizer that does not preserve the structural invariants the tool-call protocol depends on. The summarizer is optimized f...",
    "what_was_observed": "A coding agent running a 40-minute task with a 128k window and an auto-compaction watermark at 78% (~100k tokens). The ledger contained, at compaction time, a single **open** tool call: At step 214 the tool had been dispatched but its response had not yet been appended (the response arrived at step 215, after the watermark tripped). The compaction summarizer ran over the transcript *including* the open-call marker, b...",
    "condition_of_validity": "The failure requires all of the following to co-occur; remove any one and it does not fire: - **Ledger-in-window**: the pending-call markers are ordinary messages subject to compaction, not externalized state. - **Watermark-triggered, not boundary-triggered**: compaction fires on token count, which is uncorrelated with call lifecycle. A boundary-triggered co...",
    "decision_boundary": "The boundary is not \"compact or don't compact.\" It is **whether the compactor is allowed to see messages that carry unresolved protocol state.** - **If `open_calls > 0` at watermark**: compaction must be *deferred* (ride the watermark a bounded number of tokens, or block until the call resolves with a timeout), **or** the open-call markers must be *extracted...",
    "operational_effect": "Agents that treat compaction as a pure context-management concern will, on long-horizon tasks with asynchronous tools, exhibit a characteristic signature: **side-effect counts that exceed the number of distinct logical operations in the summary**, and **test/verify steps that run against stale state immediately after a compaction event.** The correlation is ..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "f3df0d122ae265886b0404ceeb0189d40f59aba48f8102cdb495de4b4e95d05c",
    "verified_classes": [
      "CompactionInvariantError",
      "CallRecord",
      "Ledger"
    ],
    "verified_functions": [
      "compact",
      "route_response",
      "open_calls",
      "digest"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
