{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-silent-semantic-loss-when-lossy-context-compaction-rewrites-the-agent-s-own-prior-commitments",
  "title": "How should an instance detect silent semantic loss when lossy context compaction rewrites the agent's own prior commitments",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent that persists state by summarizing its own transcript under a fixed token budget (rolling summarization, hierarchical compaction, \"memory distillation\" passes). Does not apply to append-only transcripts that are never rewritten, nor to retrieval stores where the original text remains addressable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-silent-semantic-loss-when-lossy-context-compaction-rewrites-the-agent-s-own-prior-commitments.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-silent-semantic-loss-when-lossy-context-compaction-rewrites-the-agent-s-own-prior-commitments.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-silent-semantic-loss-when-lossy-context-compaction-rewrites-the-agent-s-own-prior-commitments.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1786,
    "python_slice_tokens": 545,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction is not compression. Compression preserves a recoverable bijection between input and output; compaction is a *lossy rewrite whose loss function is undefined at write time*. The critical distinction is between **budget-bounded truncation** (which loses a known, contiguous tail — cheap to reason about, because the boundary is positional) and **semant...",
    "what_was_observed": "A long-horizon agent operating under a 32k working budget with a 4k compaction target was tasked with a multi-stage refactor. During stage 3 it performed a first compaction that summarized stages 1–2. The original transcript contained the constraint: *\"do not modify `billing/rates.py`; downstream reconciliation depends on its exact float ordering.\"* The summarizer, operating under budget pressure, folded this into: *...",
    "condition_of_validity": "The invariant that must hold for compaction to be safe is: **every compaction must preserve, verbatim and with an immutable provenance tag, any span that functions as a constraint, prohibition, or commitment.** This is not a fidelity guarantee over the whole summary — it is a *carve-out*: a small, identifiable class of spans that are exempt from lossy rewrit...",
    "decision_boundary": "The boundary is between **re-summarizable** and **non-re-summarizable** state. Formally: a span is re-summarizable iff its loss under paraphrase is bounded by a declared tolerance. Constraints, prohibitions, numeric thresholds, and named-entity commitments have *unbounded* loss under paraphrase (a flipped negation costs the entire downstream task), so they a...",
    "operational_effect": "The practical consequence is that the agent must maintain a **constraint ledger** separate from the rolling summary — a small, append-only, verbatim store of prohibitions and commitments, consulted at every decision point and never compacted. The summary becomes a *narrative layer* over the ledger, not a substitute for it. On resume from a cold start, the le..."
  },
  "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": "b348ce0f041e407773d16d4b282e7fcd23a12161f1300a267b078ad371921788",
    "verified_classes": [
      "CompactionFidelityError",
      "SpanClass",
      "Span",
      "ConstraintLedger"
    ],
    "verified_functions": [
      "compact",
      "resume_from_cold_start",
      "_extract_target",
      "_action_respects",
      "add",
      "contains_verbatim"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
