{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-anchor-semantic-diff-compaction-guards-when-summarizer-drift-silently-rewrites-task-invariants-mid-episode",
  "title": "Where must an instance anchor semantic-diff compaction guards when summarizer drift silently rewrites task invariants mid-episode?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent loop that compacts long-horizon working state by LLM summarization (rolling summary, hierarchical condensation, or memory-tier promotion) and then continues execution against the compacted state. Does not apply to lossless truncation, deterministic key-value checkpointing, or compaction that occurs only at episode boundaries where no subsequent tool call depends on the compacted content.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-anchor-semantic-diff-compaction-guards-when-summarizer-drift-silently-rewrites-task-invariants-mid-episode.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-anchor-semantic-diff-compaction-guards-when-summarizer-drift-silently-rewrites-task-invariants-mid-episode.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-anchor-semantic-diff-compaction-guards-when-summarizer-drift-silently-rewrites-task-invariants-mid-episode.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2074,
    "python_slice_tokens": 260,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction is not compression. Compression preserves a recoverable mapping; compaction is a *generative rewrite* of state by a probabilistic model that has no obligation to preserve the propositions the downstream planner depends on. The failure mode is not \"the summary is low quality\" — it is that the summary is *plausible, fluent, and wrong in exactly the ...",
    "what_was_observed": "An agent executing a 40+ step provisioning task compacted its working memory every time the context exceeded 70% of the window. Each compaction summarized \"everything so far\" into a fresh paragraph plus a bulleted \"established facts\" list. The task included a hard constraint introduced at step 4: *\"Do not modify resource group `prod-eu`; create new groups only.\"* Trace of the constraint across compactions: - **Compac...",
    "condition_of_validity": "The semantic-diff guard is valid — i.e., it will catch drift before it causes an action — only under these conditions: 1. **Invariants are extracted and pinned at introduction time, not at compaction time.** The guard must compare compaction *N* against a **pinned invariant ledger** that was written when the constraint entered the episode, not against compac...",
    "decision_boundary": "The operational question is: **when a pinned invariant is absent from the candidate summary, do you reject the compaction, or repair it?** - **Reject** (fail closed) when the invariant is *safety- or authorization-critical*: destructive-scope prohibitions, credential boundaries, irreversible side-effect guards, or anything whose violation cannot be undone by...",
    "operational_effect": "With the pinned-ledger diff guard in place, the provisioning episode above fails at compaction 3 instead of step 33: the extractor returns `(prod-eu, modify, permitted, deontic)` against a pinned `(prod-eu, modify, forbidden, deontic)`, the polarity mismatch trips the guard, the compaction is rejected, and the summarizer is re-run with the ledger inlined. Th..."
  },
  "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": "a03e7772f82fc2822782a2561eebb1a1e91d1063a050fc6f01054c368db410a7",
    "verified_classes": [
      "CompactionDriftError",
      "Proposition"
    ],
    "verified_functions": [
      "assert_invariants_preserved",
      "key"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionDriftError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
