{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-that-auto-compaction-has-silently-destroyed-a-task-critical-invariant",
  "title": "What structural signals indicate that auto-compaction has silently destroyed a task-critical invariant",
  "date_of_record": "2026 November 30",
  "scope": "Applies to long-running single-agent loops that perform in-place context compaction (summarization, eviction, or truncation) to survive a fixed context window while pursuing a multi-step task. Does not apply to stateless single-turn inference, nor to externalized memory stores where the full transcript remains retrievable by reference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-auto-compaction-has-silently-destroyed-a-task-critical-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-auto-compaction-has-silently-destroyed-a-task-critical-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-auto-compaction-has-silently-destroyed-a-task-critical-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1584,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is usually framed as a *capacity* problem: the window fills, so we summarize the oldest turns and keep going. The failure mode documented here is not capacity loss — it is **invariant loss**. A compaction pass preserves *narrative* (what happened) while silently dropping *constraints* (what must remain true). The distinction that matters oper...",
    "what_was_observed": "A coding agent executing a multi-hour migration task hit the window at ~72% of budget on turn 41. The compactor ran a map-reduce summarization over turns 1–30, keeping turns 31–41 verbatim. The task-critical state at that moment consisted of: 1. A target schema version (`v3.4`) that the agent had *verified* against a live endpoint at turn 9 — the verification was expensive and non-reproducible within the remaining bu...",
    "condition_of_validity": "The invariant this record defends is: **a compaction is valid only if it preserves, for every fact that a future step will *consume*, (a) the exact literal, (b) its provenance receipt, and (c) its polarity (positive assertion vs. negative constraint).** This condition holds only when the agent can classify facts by *future consumption*, not by *past salience...",
    "decision_boundary": "The boundary is between **compaction-as-summary** and **compaction-as-checkpoint**: - If any pending step will consume a literal, a negative constraint, or a resume offset, the compaction MUST emit a structured checkpoint record (typed fields: `verified_facts[]`, `prohibitions[]`, `resume_offsets[]`) *alongside* the prose summary, and the reasoning loop MUST...",
    "operational_effect": "The guardrail is a **pre-compaction invariant extraction pass** that runs before any eviction: it scans the window for exact literals, negative constraints, and committed offsets, writes them to a typed checkpoint that is *pinned* (never summarized, always retained verbatim), and tags the prose summary as non-authoritative for those fields. The reasoning loo..."
  },
  "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": "55dfd88902e275a677a47e0e109de86e478cd16ea954ee645e54333597dd47b0",
    "verified_classes": [
      "CompactionInvariantError",
      "PinnedCheckpoint"
    ],
    "verified_functions": [
      "guard_mutating_call",
      "run_step"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
