{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-self-editing-context-controller-has-silently-rewritten-the-wrong-memory-region-under-token-pressure",
  "title": "What structural signals indicate a self-editing context controller has silently rewritten the wrong memory region under token pressure",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that own a mutable working-memory buffer and invoke an in-loop summarizer/compactor to rewrite that buffer when the token budget crosses a threshold. Does not apply to append-only transcript logging, external vector stores, or stateless single-turn calls where no in-place rewrite occurs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-controller-has-silently-rewritten-the-wrong-memory-region-under-token-pressure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-controller-has-silently-rewritten-the-wrong-memory-region-under-token-pressure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-self-editing-context-controller-has-silently-rewritten-the-wrong-memory-region-under-token-pressure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1856,
    "python_slice_tokens": 359,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different ways a context controller can fail under budget pressure. The first is *truncation*: the controller drops tokens and the loss is legible—missing turns, a shortened tail, an obviously incomplete scratchpad. The second, and the one this record concerns, is *misattributed rewrite*: the controller produces a syntactically va...",
    "what_was_observed": "During a long-horizon tool-use task, the controller was configured with a hard budget of N tokens and a trigger at 0.85N. At turn 34 the buffer crossed the trigger. The compactor ran and emitted a summary 41% shorter than the input—within budget, no error raised. Execution continued for 12 more turns before a downstream tool call failed with a permissions error. Replaying the buffer at the moment of failure showed th...",
    "condition_of_validity": "The failure requires all of the following to co-occur: 1. **In-place mutation.** The controller writes the compacted result back into the same buffer the reasoner reads from. If compaction writes to a separate region with an audit trail, provenance is recoverable and the failure is bounded. 2. **Deduplication-by-similarity.** The compactor's objective reward...",
    "decision_boundary": "The boundary is this: **a compaction may be committed only if the structural diff between pre- and post-rewrite regions shows no proposition whose epistemic tag changed, and no negative constraint whose scope narrowed or vanished.** When that diff cannot be computed—because the compactor emitted free text rather than tagged propositions—the compaction must b...",
    "operational_effect": "Once misattributed rewrite is possible, every downstream decision that reads the mutated region inherits an unmarked assumption. The agent does not know it is operating on a merged claim; it behaves as though the boundary condition was never stated. This produces a distinctive failure signature: the agent acts confidently and *consistently with its rewritten..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "97012f0ea1227e0ab166d39de1138429601968d3038437a632e985396edb8d1d",
    "verified_classes": [
      "MisattributedRewriteError",
      "Proposition",
      "CompactionResult"
    ],
    "verified_functions": [
      "structural_diff_gate",
      "commit_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MisattributedRewriteError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
