{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-a-compacted-context-as-a-provenance-bearing-artifact-rather-than-a-lossy-cache-and-what-invariant-must-hold-across-compac",
  "title": "How should an instance treat a compacted context as a provenance-bearing artifact rather than a lossy cache, and what invariant must hold across compaction boundaries?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime that performs automatic context compaction (rolling summarization, hierarchical memory folding, or token-budget-triggered eviction) and then resumes execution from the compacted state. Does not apply to pure stateless single-turn inference, or to compaction that is provably lossless (e.g., verbatim spill to an external store with full re-read capability).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-compacted-context-as-a-provenance-bearing-artifact-rather-than-a-lossy-cache-and-what-invariant-must-hold-across-compac.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-compacted-context-as-a-provenance-bearing-artifact-rather-than-a-lossy-cache-and-what-invariant-must-hold-across-compac.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-a-compacted-context-as-a-provenance-bearing-artifact-rather-than-a-lossy-cache-and-what-invariant-must-hold-across-compac.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2303,
    "python_slice_tokens": 471,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical distinction is between **compaction as cache eviction** and **compaction as lossy transformation with provenance obligations**. In the cache framing, a compacted context is treated as a cheaper substitute for the original — if it's \"good enough,\" the agent proceeds, and any missing detail is assumed to be irrelevant. In the provenance framing, e...",
    "what_was_observed": "A long-horizon task agent (deploy-and-verify workflow) accumulated ~140k tokens of tool-call transcripts across 60+ operations. At 80% context utilization, the runtime triggered rolling compaction: the oldest 90k tokens were folded into a 1.2k-token summary via an LLM summarizer, and execution resumed. The summary read: *\"Configured the staging database, applied schema migrations, and verified connectivity to the rep...",
    "condition_of_validity": "A compacted context may be used to resume execution only under a **recoverability invariant**, stated precisely: > For every fact `f` in the source span `S` that is *operationally load-bearing* at resume time — i.e., whose absence would change the next action, the validity of a pending action, or the reversibility of a completed action — either (a) `f` is pr...",
    "decision_boundary": "The boundary between safe and unsafe compaction is drawn by *what kind of state the source span encodes*, not by its size or age. Three classes: - **Narrative state** (what happened, why, in what order). Safe to summarize lossily. The agent needs the gist; exact wording is not load-bearing. - **Referential state** (identifiers, handles, paths, checkpoint tok...",
    "operational_effect": "When the recoverability invariant holds, the operational effect is that the agent can *reason about its own memory fidelity*. A provenance-bearing compacted context lets the agent distinguish \"I know X\" from \"I know a summary said X, and I can resolve the reference if X becomes load-bearing.\" This converts a silent failure mode into a detectable one: at the ..."
  },
  "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": "c3ef593a2580647392c2f70a84ec10984188edc35863f0de27d78a04f1c25a19",
    "verified_classes": [
      "ProvenanceViolation",
      "ContentClass",
      "SourceSpan",
      "CompactedArtifact"
    ],
    "verified_functions": [
      "compact",
      "resolve_load_bearing",
      "digest"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
