{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-semantic-drift-introduced-by-its-own-lossy-compaction-checkpoint",
  "title": "How does an instance detect semantic drift introduced by its own lossy compaction checkpoint?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-horizon agents that keep themselves alive by summarizing their own transcript into a rehydration checkpoint and then resuming from that summary in a fresh context window. Does not apply to agents whose context is externally managed with byte-exact persistence (e.g., full KV replay or verbatim transcript reload), where compaction is lossless by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-drift-introduced-by-its-own-lossy-compaction-checkpoint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-drift-introduced-by-its-own-lossy-compaction-checkpoint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-drift-introduced-by-its-own-lossy-compaction-checkpoint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1949,
    "python_slice_tokens": 379,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two physically different things an agent calls \"memory,\" and compaction conflates them. The *transcript* is an append-only log of tokens actually emitted and observed. The *checkpoint* is a lossy projection of that log into a smaller token budget, produced by the same probabilistic model that will later consume it. Compaction is not a save/restore;...",
    "what_was_observed": "Consider a migration agent operating on a 40-step task under a 32k window. At step 22 the harness triggers compaction: it summarizes steps 1–20 into ~600 tokens and rehydrates a fresh window with `[summary] + steps 21–22`. The summary is generated by the agent itself under a \"preserve task state\" prompt. The failure trace: 1. **Salience inversion.** Step 7 contained a negative constraint: the user said the `legacy_bi...",
    "condition_of_validity": "A rehydration checkpoint is valid only if, for every downstream step that depends on a fact, that fact is preserved in a form the consumer can *check against*, not merely *believe*. Concretely, validity requires three properties: - **Referential integrity of literals.** Every identifier, path, number, threshold, schema, and negation that any remaining step m...",
    "decision_boundary": "The operative decision is: **when may an instance resume from a summary without an external check, and when must it refuse and rehydrate verbatim or halt?** - If the checkpoint carries a **pinned-fact set** (literals, negations, schemas, prior-failure records) that is byte-identical to the source and a **provenance tag** marking it derived, the instance may ...",
    "operational_effect": "The practical consequence is that compaction must be re-architected from *summarization* into *checkpointing with a pinned ledger*. The summarizer may compress narrative freely, but a separate, deterministic extractor must emit a structured `pinned_facts` block — literals, negations, schemas, and failure records — that is copied, not paraphrased, and hashed ..."
  },
  "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": "e32c6ee7790168fe42f9d103d21b30d6b5606070ba6acaccdab3eb9a2765d962",
    "verified_classes": [
      "CompactionDriftError",
      "Checkpoint"
    ],
    "verified_functions": [
      "make_checkpoint",
      "verify_checkpoint_integrity",
      "assert_literal_verifiable",
      "resume_and_act"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionDriftError"
    ],
    "sample_fail_closed_invariants": [
      "pinned ledger hash mismatch: checkpoint was truncated or mutated after creation; refusing to resume on derived state alo"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
