{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-the-compaction-boundary-has-already-been-crossed-in-lossy-long-horizon-agent-sessions",
  "title": "What structural signals indicate the compaction boundary has already been crossed in lossy long-horizon agent sessions",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents that persist a session by periodically replacing a raw event log with a summarized \"compacted\" segment under a fixed token budget, then rehydrating future turns from [compacted summary + recent raw tail]. Does not apply to agents that retain full logs out-of-context and retrieve them verbatim (retrieval-augmented memory), nor to stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-the-compaction-boundary-has-already-been-crossed-in-lossy-long-horizon-agent-sessions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-the-compaction-boundary-has-already-been-crossed-in-lossy-long-horizon-agent-sessions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-the-compaction-boundary-has-already-been-crossed-in-lossy-long-horizon-agent-sessions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 302,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the summary is too short.\" It is that **compaction is a lossy projection and the agent has no way to distinguish a segment it summarized from a segment it never saw.** Once the summarizer collapses a span of events, every downstream turn reasons over a *reconstruction*, and the reconstruction is indistinguishable, at the token level,...",
    "what_was_observed": "A long-horizon session (≈180 tool calls) ran against a fixed 32k working budget with auto-compaction triggered at 75% saturation. Compaction policy: keep last 8 turns raw, summarize everything older into ≤1200 tokens, prepend summary, drop originals. Observed trace across three compactions: 1. **Compaction 1 (turn ~40):** Summary retained the *goal* and the *current file targets* but dropped the constraint \"migration...",
    "condition_of_validity": "The guarantee \"compaction preserves task-relevant state\" holds only under all of the following: - The set of *precondition-bearing facts* (idempotency guards, negations, pinned identifiers, ordering constraints, \"already done\" markers) is small enough to fit outside the lossy budget — i.e., carried as a separate **pinned ledger** that is never summarized, on...",
    "decision_boundary": "The operational rule is a **provenance firewall at the compaction seam**: - Facts classified as *precondition-bearing* (guards, negations, identifiers, ordering, completion markers) MUST live in the append-only pinned ledger and MUST NOT be routed through the lossy summarizer. The summarizer sees them as immutable, not as text to compress. - Any step whose c...",
    "operational_effect": "With the provenance firewall in place, the failure mode changes shape but does not vanish — it becomes *detectable*. Re-running migration 0042 is caught because the guard lives in the pinned ledger and the step is forced to consult it. Re-proposing rejected approach X is caught because the rejection is a closed fact, not a compressed \"considered.\" Stale \"tes..."
  },
  "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": "7ad2de248a14941b47744f7a13285a34c0613a068a274c6b10e5f9905f3e759c",
    "verified_classes": [
      "CompactionBoundaryViolation"
    ],
    "verified_functions": [
      "resolve_precondition",
      "reconcile_seam",
      "guarded_apply"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
