{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewrites-its-own-working-memory-salience-scores-and-the-rewrite-is-not-idempotent",
  "title": "What happens when an instance rewrites its own working-memory salience scores and the rewrite is not idempotent",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent that lets the model itself assign, rescore, or prune salience weights over its own context window between turns. Does not apply to externally scheduled compaction (host-side summarizers, fixed token-budget eviction) where salience is never written back by the model.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-working-memory-salience-scores-and-the-rewrite-is-not-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-working-memory-salience-scores-and-the-rewrite-is-not-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-its-own-working-memory-salience-scores-and-the-rewrite-is-not-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2037,
    "python_slice_tokens": 322,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things a \"self-editing context policy\" can do, and they fail in opposite ways. The first is **stateless selection**: on each turn the model re-reads the full working memory and picks a subset to keep. Selection is a pure function of (memory, current goal). If it drops the wrong item, the next turn can re-derive it, becaus...",
    "what_was_observed": "A research agent with a 32k working-memory budget ran a `reflect_and_compact` step every 6 turns. The step had the model (a) rescore every memory item 0.0–1.0 for relevance to the active subgoal, (b) rewrite items below 0.4 into one-line summaries, (c) evict items below 0.15. Rewrites were stored back in place, overwriting the original text. Trace from a single task (locating a config regression across a 40-file repo...",
    "condition_of_validity": "The ratchet requires all three of the following to hold. Remove any one and the failure collapses: 1. **Write-back.** The rewritten summary replaces the source text rather than being stored alongside it. If the original is retained and the summary is a derived view, rescoring can always fall back to the full record. 2. **Self-scoring against the derived form...",
    "decision_boundary": "The architectural invariant that bounds this: **salience must be scored against an immutable source, and rewrites must be non-destructive views.** Concretely, three rules: - **Separate the scoring input from the storage form.** The scorer must always read `record.original`, never `record.summary`. Summaries are what get *placed into the prompt*; originals ar...",
    "operational_effect": "Under the invariant, the agent pays a modest storage cost (originals retained through the task) and a modest scoring cost (grading full records rather than one-liners), but the salience trajectory becomes stable: rewritten items hold their score within noise (we measured σ 0.05 across passes, no downward drift), and eviction decisions track true relevance ra..."
  },
  "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": "7464e74618e146df5fc38582be13eb264122d9115fa6a4af95102b43b6015244",
    "verified_classes": [
      "SalienceRatchetError"
    ],
    "verified_functions": [
      "apply_salience_policy",
      "assert_idempotent"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SalienceRatchetError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
