{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-enforce-lossy-summarization-invariants-when-auto-compaction-silently-drops-tool-call-provenance-from-a-long-horizon-transcript",
  "title": "How should an instance enforce lossy-summarization invariants when auto-compaction silently drops tool-call provenance from a long-horizon transcript",
  "date_of_record": "2026 November 30",
  "scope": "Applies to long-horizon agents that persist a rolling transcript and invoke an auto-compaction routine (LLM-generated summary replacing a span of older turns) to stay under a context budget. Does not apply to stateless single-turn calls or to systems that retain a full external transcript and only compact a *view* (read-only projection) rather than the authoritative store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-lossy-summarization-invariants-when-auto-compaction-silently-drops-tool-call-provenance-from-a-long-horizon-transcript.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-lossy-summarization-invariants-when-auto-compaction-silently-drops-tool-call-provenance-from-a-long-horizon-transcript.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-lossy-summarization-invariants-when-auto-compaction-silently-drops-tool-call-provenance-from-a-long-horizon-transcript.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2401,
    "python_slice_tokens": 561,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an agent can compact, and conflating them is the root of the failure: - **The authoritative transcript** — the durable record of what actually happened: every tool call, its arguments, its raw result, its error, its timestamp, its originating turn. - **The working context** — the finite window handed to the model on the next inference. A...",
    "what_was_observed": "A tool-using agent (research/retrieval workflow, ~120 turns, per-turn tool calls to a search API and a document fetcher) ran against a 32k working-context budget. Compaction triggered every time the rolling window crossed 80% utilization (~turn 26, then 52, 78, 104). The compactor prompt was the standard one: \"Summarize the following conversation, preserving all important information, decisions, and results.\" Trace o...",
    "condition_of_validity": "Compaction of a span `S` into summary `σ` is valid for continuation only if all of the following hold at the moment of compaction: 1. **Referent closure.** Every entity identifier (doc IDs, file paths, record keys, URLs, hashes) that appears in any *later* turn's plan, pending tool call, or open question must appear verbatim in `σ`. This is checkable without...",
    "decision_boundary": "The boundary between \"compact\" and \"refuse\" is drawn on the *re-observability* and *verification-density* of the span, not on its token size: - **Compact freely** when the span is high-level reasoning, discarded branches, or tool results from immutable/deterministic sources whose tuples are retained. - **Compact with provenance pinning** when the span contai...",
    "operational_effect": "When the invariant is enforced, the observed failure class disappears and is replaced by a cheaper, visible one: the agent occasionally halts on budget pressure instead of silently corrupting its own evidence. That is the correct trade. The turn-84 failure above cannot occur under condition 2, because the pinned tuple `(fetch_document, \"AX-2291\", sha256=9f2c..."
  },
  "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": "732d8511be88aea8c5ccf28aa4569c732ad8a395e86d4fa0671dc20694cf977a",
    "verified_classes": [
      "CompactionInvariantError",
      "ProvenanceTuple",
      "Span"
    ],
    "verified_functions": [
      "_identifiers",
      "enforce_compaction_invariants",
      "detect_observation_drift",
      "key"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
