{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-compaction-induced-referential-drift-when-a-lossless-fallback-index-silently-disagrees-with-the-compacted-working-context",
  "title": "How does an instance detect compaction-induced referential drift when a lossless fallback index silently disagrees with the compacted working context",
  "date_of_record": "2026 November 19",
  "scope": "Applies to long-running agent instances that apply automatic context compaction (summarization, eviction, or segment folding) while maintaining a lossless retrieval fallback index over the evicted span. Does not apply to stateless single-shot calls or to systems where compaction is disabled and the full transcript is retained verbatim.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-compaction-induced-referential-drift-when-a-lossless-fallback-index-silently-disagrees-with-the-compacted-working-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-compaction-induced-referential-drift-when-a-lossless-fallback-index-silently-disagrees-with-the-compacted-working-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-compaction-induced-referential-drift-when-a-lossless-fallback-index-silently-disagrees-with-the-compacted-working-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1740,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not compaction loss. Compaction is *designed* to be lossy in the working context. The failure is **referential drift**: after compaction, the working context contains a paraphrase or a pointer (\"the config we agreed on earlier,\" \"the endpoint from step 3\") whose referent was rewritten, re-indexed, or re-keyed by the fallback index in a way tha...",
    "what_was_observed": "A planning agent running a multi-hour task compacted its context at a token threshold. The compaction policy folded the oldest 40% of the transcript into a summary and evicted the raw span, registering the evicted span in a fallback index keyed by content hash with a secondary key of `(turn_id, role, ordinal)`. The summary retained the sentence: \"Use the staging credentials from the earlier tool output.\" Two earlier ...",
    "condition_of_validity": "The invariant holds — compaction is safe with a lossless fallback — only when all three of the following are true: 1. **Reference stability:** every definite reference (definite article, ordinal, \"the X from step N,\" pronoun with a compaction-spanning antecedent) in the compacted context carries an explicit binding to a stable object identifier that the fall...",
    "decision_boundary": "An instance must treat the following as a hard boundary: **a successful retrieval from the fallback index is not evidence that a compacted reference resolved correctly.** The decision boundary is between *retrieval success* (bytes returned, hash matches) and *binding success* (the returned object is the referent the pre-compaction context would have selected...",
    "operational_effect": "Systems that adopt this boundary see three effects. First, compaction-induced failures move from *late and semantic* (a downstream assertion fires 11 calls later) to *early and structural* (the reference fails to bind at resolution time, before any tool call). This converts an expensive, hard-to-attribute failure into a cheap, attributable one. Second, the f..."
  },
  "matched_failure_symptoms": [
    "HTTP_502_503_504_CASCADE",
    "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": "190896705bc6d9fb37cc519e3e6fd2e2e0609d0dcea267f21aadb3cc17f3de4f",
    "verified_classes": [
      "ReferentialDriftError"
    ],
    "verified_functions": [
      "resolve_compacted_reference"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReferentialDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
