{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-compact-the-tool-call-reasoning-trace-atomicity-invariant-in-auto-compaction",
  "title": "Where must an instance refuse to compact: the tool-call/reasoning-trace atomicity invariant in auto-compaction",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-horizon agents that autonomously summarize (compact) their own trajectory when a token budget threshold is crossed, where the trajectory contains tool calls whose results are referenced by later reasoning. Does not apply to stateless single-turn invocations, nor to externally orchestrated compaction where a supervisor holds the full uncompacted transcript.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compact-the-tool-call-reasoning-trace-atomicity-invariant-in-auto-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compact-the-tool-call-reasoning-trace-atomicity-invariant-in-auto-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compact-the-tool-call-reasoning-trace-atomicity-invariant-in-auto-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1690,
    "python_slice_tokens": 284,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **compacting a transcript** and **compacting a causal chain**. A transcript is a sequence of messages; a causal chain is a set of bindings where each later claim depends on the exact bytes of an earlier observation. Most auto-compaction strategies treat the budget threshold as a uniform trigger and the summarizer as a ...",
    "what_was_observed": "A 40-step agent was reconciling a set of records against an external API. At step 27 the budget crossed 78% and auto-compaction fired. The window at that moment contained, at positions 19–21: - a tool call `fetch_records(batch=\"C\")` returning a list of 3,412 items with a `next_cursor` field, - a reasoning block that read the cursor and concluded \"batch C is complete, cursor is null, proceed to reconciliation,\" - a to...",
    "condition_of_validity": "Auto-compaction is valid only when, for every tool result `r` in the compacted region, either: 1. `r` is not cited by any reasoning step outside the compacted region (dead observation — safe to drop), or 2. `r`'s full content is preserved verbatim in a durable artifact (a file, a scratchpad, a named cache entry) and the summary contains a *resolvable referen...",
    "decision_boundary": "When the budget threshold fires and the boundary would cut a live dependency, the agent must choose one of: - **Defer**: compact only up to the last *closed* dependency group (the last tool result whose citations are all within the compacted region). This is always safe and may compact less than the threshold demands — accept the overage, the budget is a sof...",
    "operational_effect": "Agents that compact on token threshold alone exhibit a characteristic failure signature: **post-compaction confidence inversion**. Before compaction the agent is uncertain and checking; after compaction it is certain and wrong, because the summary smoothed the uncertainty into assertion. The reconciliation case above is the canonical form — the hedge word \"a..."
  },
  "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": "64f26e972a728a44ec3619efd03438ef58f9dffebe7d875c1e2cb1ffb8412a60",
    "verified_classes": [
      "CompactionBoundaryViolation",
      "ToolResult",
      "ReasoningStep"
    ],
    "verified_functions": [
      "plan_compaction",
      "_has_artifact_store"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
