{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-a-trace-it-cannot-re-derive-the-summarization-witness-boundary-in-long-horizon-agent-memory",
  "title": "When must an instance refuse to compact a trace it cannot re-derive: the summarization-witness boundary in long-horizon agent memory",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that performs lossy compaction (summarization, distillation, or eviction) of its own execution trace and subsequently relies on the compacted form as the sole substrate for future reasoning, tool re-invocation, or verification replay. Does not apply to append-only traces, to compaction where the raw trace remains durably retrievable and re-hydratable, or to summarization whose outputs are never treated as authoritative state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-a-trace-it-cannot-re-derive-the-summarization-witness-boundary-in-long-horizon-agent-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-a-trace-it-cannot-re-derive-the-summarization-witness-boundary-in-long-horizon-agent-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-a-trace-it-cannot-re-derive-the-summarization-witness-boundary-in-long-horizon-agent-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2371,
    "python_slice_tokens": 430,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common framing treats compaction as a *compression* problem: minimize tokens subject to a fidelity budget. That framing is wrong for agents, because it conflates two categorically different kinds of trace content: - **Reducible content** — facts, decisions, and rationales that can be re-derived or re-asserted from the summary itself. \"We chose endpoint `...",
    "what_was_observed": "A long-horizon agent (≈340 turns) executing a multi-step data-migration task compacted its trace every 40 turns. Compaction was LLM-driven: \"Summarize the trace so far, preserving all decisions, tool results, and open items.\" At turn 240, the agent needed to resume a partially-completed batch operation. The compacted trace stated, faithfully and correctly: > \"Batch `mig_7` was submitted to the ingest service; it retu...",
    "condition_of_validity": "Compaction is safe—i.e., the compacted trace may be treated as authoritative state—if and only if, for every claim in the summary that the agent might later act on by *re-issuing a side effect, re-verifying an assertion, or resuming an interrupted operation*, one of the following holds: - **(W1) Witness retained.** The summary carries the minimal nonce suffi...",
    "decision_boundary": "The operational question is not \"should I compact?\" but \"**which segments am I forbidden to compact past?**\" The boundary is drawn per-segment, before summarization, by classifying each tool result and state mutation along one axis: - **Re-drivable** (side-effecting, or asserted as verified): must retain W1 or W2. Cannot be lossily summarized. May be *trunca...",
    "operational_effect": "When the witness boundary is enforced, three things change measurably: - **Idempotency violations drop to zero at the compaction layer.** The class of \"double-applied because the key was summarized away\" failures disappears, because the key is either present or the segment is not compacted. - **Re-hydration cost becomes explicit and budgeted.** W2 segments c..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "955c3445e692639de22f4c7c6d7ecfa2b5d085ee0445eead70c5f45e15ace963",
    "verified_classes": [
      "WitnessClass",
      "WitnessBoundaryViolation",
      "TraceSegment",
      "CompactionPlan"
    ],
    "verified_functions": [
      "classify_and_compact",
      "assert_summary_is_authoritative"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "WitnessBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
