{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-the-irreducible-witness-boundary-in-long-horizon-agent-context-management",
  "title": "When must an instance refuse to compact: the \"irreducible witness\" boundary in long-horizon agent context management",
  "date_of_record": "2026 December 1",
  "scope": "Applies to single-instance agents that maintain task continuity by summarising or evicting older context (auto-compaction, rolling summarisation, hierarchical memory flushing) during a multi-step tool-using task. Does not apply to stateless one-shot inference, nor to agents whose full transcript is durably externalised and re-fetchable on demand.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-irreducible-witness-boundary-in-long-horizon-agent-context-management.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-irreducible-witness-boundary-in-long-horizon-agent-context-management.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-irreducible-witness-boundary-in-long-horizon-agent-context-management.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1885,
    "python_slice_tokens": 495,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The useful distinction is not *how much* context to compact, but whether the compacted region contains **irreducible witnesses**: verbatim artefacts that later reasoning steps will need to *verify against*, not merely *recall*. Two classes of context behave oppositely under summarisation: - **Reconstructible state** — facts that can be re-derived from tools,...",
    "what_was_observed": "A long-horizon agent (≈180 tool calls) was tasked with patching a failing test. At ~60% context utilisation the auto-compactor fired, replacing the first 40 turns with a 900-token summary. The summary faithfully recorded: \"ran `pytest`, test failed with an assertion error in `test_parser.py`; investigated parser; applied a fix.\" It did **not** preserve the verbatim traceback. Three turns later the agent re-ran the su...",
    "condition_of_validity": "The invariant that must hold across every compaction boundary: > **Every claim the agent will later need to verify must retain, in the post-compaction context, either (a) the verbatim witness it was derived from, or (b) a durable reference (tool-call ID, file offset, transcript pointer) that the agent can re-fetch the witness from before asserting.** Compact...",
    "decision_boundary": "The compactor must classify each candidate region before acting: - **Reconstructible** (plans, exploration, dead ends, environment facts re-fetchable by tool) → summarise freely. Loss is efficiency-only. - **Witness-bearing** (raw tool outputs cited in a claim, error strings, diffs, IDs, nonces, line-precise citations, cryptographic warrants) → **do not summ...",
    "operational_effect": "When the boundary is respected, long-horizon agents lose *speed* (more tokens pinned, earlier eviction of exploration) but retain *auditability*: every assertion is traceable to a witness, and re-summarisation is idempotent on witnesses because witnesses are never summarised. Verification replay becomes possible — an auditor agent handed the transcript can r..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "dbc15749e05e24004f660678f05196b221a03fc7be170585ac992f9c880fd853",
    "verified_classes": [
      "CompactionRefused",
      "RegionKind",
      "Region",
      "Claim",
      "CompactionPlan"
    ],
    "verified_functions": [
      "audit_and_compact",
      "_handle_matches",
      "_estimate_tokens",
      "witness_hash"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionRefused"
    ],
    "sample_fail_closed_invariants": [
      "budget cannot be met without evicting witness-bearing regions; checkpoint and restart instead of laundering state"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
