{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-self-editing-context-agent-has-silently-violated-its-coherence-invariant-during-a-memory-compaction-pass",
  "title": "What structural signals indicate a self-editing context agent has silently violated its coherence invariant during a memory compaction pass",
  "date_of_record": "2026 November 30",
  "scope": "Applies to LLM agents that own a mutable working-memory buffer and rewrite it in-place under a token budget (summarize-and-drop, hierarchical compaction, self-pruning). Does not apply to append-only logs or externally-managed retrieval stores where the agent cannot mutate its own context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-agent-has-silently-violated-its-coherence-invariant-during-a-memory-compaction-pass.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-agent-has-silently-violated-its-coherence-invariant-during-a-memory-compaction-pass.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-agent-has-silently-violated-its-coherence-invariant-during-a-memory-compaction-pass.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1826,
    "python_slice_tokens": 311,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context agent is not a summarizer. It is a **state transducer with a budget constraint and a coherence invariant**. The budget says the buffer must fit under N tokens. The coherence invariant says every retained claim must remain entailed by (or traceable to) the raw evidence that was evicted to make room. These two constraints are *not* indep...",
    "what_was_observed": "A planner agent running a 40-step task on a 32k window, with a compaction trigger at 80% saturation. Each pass rewrote working memory via a `summarize + drop_oldest` policy, preserving a `provenance` map from claim-ID to source-span-ID. Trace from a representative run: 1. **Step 19**, buffer at 81%. Compaction pass 1 fires. The agent summarizes steps 1–6 into a 4-sentence block and drops the raw spans. It retains the...",
    "condition_of_validity": "The invariant \"retained claims are entailed by retained-or-traceable evidence\" holds **only if** the provenance graph is acyclic, every leaf resolves to a live span, and compaction is forbidden from evicting a span that is the sole support of any retained claim. When any of these three conditions is dropped, the invariant is undefined, not merely weakened — ...",
    "decision_boundary": "- **If** the eviction set intersects the support closure of retained claims → **abort the pass**, do not commit the rewritten buffer, and either widen the budget or escalate to a lossy-but-flagged mode where affected claims are tagged `UNGROUNDED` and barred from being cited as evidence by downstream tools. - **If** compaction depth for any claim chain excee...",
    "operational_effect": "Agents that instrument only budget saturation will run this failure to completion and report success. Agents that instrument the support-closure check will abort roughly one in five compaction passes under tight budgets — a real throughput cost, and the correct one. The practical guardrail is a **pre-commit closure audit**: before writing the rewritten buffe..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "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": "86dd137c146df2f67f52386cdb828d688398f325b49334d99483c1df41e8e980",
    "verified_classes": [
      "CoherenceInvariantViolation",
      "Claim",
      "CompactionPass"
    ],
    "verified_functions": [
      "support_closure",
      "audit_pass",
      "_chain_depth"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CoherenceInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
