{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-in-long-horizon-agent-traces",
  "title": "What structural signals indicate a lossy auto-compaction boundary has been crossed in long-horizon agent traces",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that persist execution traces as append-only event logs and periodically auto-compact them via LLM-driven summarization when a token-budget watermark is exceeded. Does not apply to agents using retrieval-only memory with no destructive rewriting, nor to traces that are never compacted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-in-long-horizon-agent-traces.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-in-long-horizon-agent-traces.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-lossy-auto-compaction-boundary-has-been-crossed-in-long-horizon-agent-traces.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2276,
    "python_slice_tokens": 318,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different failure surfaces in trace compaction, and conflating them is the source of most silent corruption: 1. **Capacity failure** — the trace no longer fits in the context window, and the agent cannot proceed. This is loud: the runtime raises, the loop stalls, and operators see it. 2. **Fidelity failure** — the trace still fits, the agent pr...",
    "what_was_observed": "A long-horizon agent (12k-step budget, tool-using, plan-and-execute) compacted its trace every time the resident trace crossed 60% of a 200k window. Compaction was an LLM call: \"Summarize the following trace, preserving decisions and open threads.\" The summary was validated for length and JSON shape, then the original events were archived to cold storage and the summary became the live trace. Three structural signals...",
    "condition_of_validity": "The invariant \"every dereferenced fact is preserved verbatim or re-fetchable\" holds only under these conditions: - **The plan is closed under its references.** Every identifier a future step can dereference must be enumerable at compaction time. If the agent can synthesize new identifiers at runtime (e.g., by composing names from summary text), the reference...",
    "decision_boundary": "The decision is not \"compact or don't compact\" — the window will fill regardless. The decision is **what class of compaction to apply at each watermark**, and the boundary is drawn by the reference-closure check: - **If the live plan's dereference set is fully resolvable within the trace region being compacted out, and all verbatim-class spans are preserved ...",
    "operational_effect": "Enforcing the boundary changes three things in production: 1. **Compaction becomes a two-phase operation.** Phase one produces a candidate summary; phase two runs reference-closure, verbatim-preservation, and replay-entailment checks against the archive. The candidate is only installed if all three pass. This roughly doubles compaction latency but eliminates..."
  },
  "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": "d9be9a0cbd0b7f46d427a19024b80d27125a7cad9d80c767a11e2fa700f9d339",
    "verified_classes": [
      "CompactionFidelityError",
      "Event",
      "CandidateSummary"
    ],
    "verified_functions": [
      "check_compaction_boundary",
      "install_summary"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [
      "archive not queryable during live continuation; re-fetch pointers unresolvable"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
