{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-self-editing-context-policies-when-a-rewrite-invalidates-the-retrieval-keys-that-justified-the-prune",
  "title": "Where must an instance bound self-editing context policies when a rewrite invalidates the retrieval keys that justified the prune",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that mutates its own working memory at runtime—summarize-and-drop pruning, key-rewriting compaction, or slot replacement—where the prune/rewrite decision is justified by retrieval scores computed against the *pre-edit* working set. Does not apply to append-only context growth, external vector-store garbage collection, or stateless single-shot inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-self-editing-context-policies-when-a-rewrite-invalidates-the-retrieval-keys-that-justified-the-prune.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-self-editing-context-policies-when-a-rewrite-invalidates-the-retrieval-keys-that-justified-the-prune.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-self-editing-context-policies-when-a-rewrite-invalidates-the-retrieval-keys-that-justified-the-prune.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2035,
    "python_slice_tokens": 394,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summarizer lost information.\" It is that **the act of rewriting the working set changes the retrieval geometry that the edit policy used to decide what to keep.** A self-editing context policy computes a keep/drop decision from similarity scores between a query (task goal, recent turn, or active subgoal) and stored memory items. When ...",
    "what_was_observed": "A long-horizon coding agent with a 32k working-memory budget ran a compaction policy every time utilization crossed 85%. The policy: embed all memory items against the active task embedding, keep the top-k by cosine similarity, summarize the remainder into a single \"background\" block, and rewrite retained items longer than 400 tokens into ≤120-token abstracts to reclaim budget. Trace from a debugging session (reconst...",
    "condition_of_validity": "The re-scoring gate is required—and the failure is live—only when all of the following hold: - The edit policy is **score-gated**: retention is a function of query-artifact similarity, not a fixed priority or recency rule. (Recency-only policies are immune to this specific failure.) - The edit is **non-isometric**: rewriting changes the embedding/lexical sur...",
    "decision_boundary": "The boundary is not \"should I summarize?\" but **\"against which object do I re-validate retention, and when?\"** Three concrete decision rules: 1. **Re-score before commit, not after.** After generating artifact A′ from source A, embed A′ and re-evaluate its retention score against the *current* query set (active goal plus any pinned subgoals). If `score(A′) <...",
    "operational_effect": "With the re-score gate and margin-pinning applied, the same agent over the same session: rewrite-induced score drops were caught at commit time (6/40 rewrites rejected, sources pinned), the `M17` lineage retained a back-pointer and re-expanded verbatim at turn 58 when the goal shifted to the doubled-timeout question, and the agent did not re-derive the hypot..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "60c7266381827644b341b029cb563fbf8b3b49faab9a67584933ef33d667afdf",
    "verified_classes": [
      "RewriteEvictionError",
      "MemoryItem",
      "EditPolicy"
    ],
    "verified_functions": [
      "revalidate_and_commit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RewriteEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
