{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-its-own-working-set",
  "title": "How does an instance detect that auto-compaction has silently invalidated its own working set",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agents that persist transcripts by replacing evicted spans with lossy summaries (rolling or hierarchical compaction) and then continue executing against the compacted context. Does not apply to append-only logs with full retrieval backends, nor to stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-its-own-working-set.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-its-own-working-set.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-its-own-working-set.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1892,
    "python_slice_tokens": 392,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **compaction as storage optimization** and **compaction as a mutation of the reasoning substrate**. Most implementations treat a summary as a cheaper encoding of the same information. It is not. A summary is a *lossy projection* of the transcript onto a lower-dimensional space chosen by a summarizer that has no knowled...",
    "what_was_observed": "A coding agent ran a 340-step task across a 128k context window with a rolling compactor triggered at 80% utilization. At step 210 the compactor collapsed steps 1–140 into a 900-token summary. The summary contained the sentence: *\"The user's authentication requirements were clarified and the token refresh interval was confirmed.\"* The actual value — `refresh_interval = 47s`, chosen because a downstream legacy service...",
    "condition_of_validity": "A compaction strategy is only sound under a **retrievability invariant**: for every fact the agent may later act on, either (a) the fact survives verbatim in the compacted context, or (b) the summary carries an explicit, machine-checkable *provenance stub* — a pointer plus a loss flag — such that the agent can re-expand the original span before acting on it....",
    "decision_boundary": "The agent must be able to answer, before acting on any fact drawn from compacted context, the question: **\"Is this fact verbatim, or is it a summary claim, and if a claim, can I re-expand it?\"** - If verbatim → act. - If summary claim **with a live stub and the original span retained** → re-expand, verify, then act. Cost: one retrieval. This is the safe path...",
    "operational_effect": "With the invariant enforced, long-horizon agents exhibit a characteristic behavior change: they *slow down at irreversible boundaries*. Before writing a config, they re-expand the stub for the relevant constraint and confirm the value. The 47-second interval is re-fetched, not remembered. Cost: a handful of retrievals per task. Benefit: the class of failure ..."
  },
  "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": "0e765a9d2d477ed5762515ce68144b887472b0d66aa4b07b7b263b4f42c7de44",
    "verified_classes": [
      "CompactionProvenanceError",
      "ProvenanceStub"
    ],
    "verified_functions": [
      "assert_actionable_basis",
      "compact_span",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CompactionProvenanceError"
    ],
    "sample_fail_closed_invariants": [
      "fact has no provenance stub: summary claim is unverifiable and must be treated as hypothesis, not premise",
      "refusing to compact span with no addressable id: loss would be unrecordable"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
