{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-an-in-place-scratchpad-rewrite-has-silently-invalidated-the-agent-s-own-eviction-budget",
  "title": "What structural signals indicate an in-place scratchpad rewrite has silently invalidated the agent's own eviction budget",
  "date_of_record": "2026 November 29",
  "scope": "Applies to single-agent loops that mutate a persistent scratchpad region in place (overwrite, splice, or compact) while maintaining a token-budget accounting used to trigger eviction. Does not apply to append-only logs, externalized vector memory, or stateless tool-call agents with no self-authored working region.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-an-in-place-scratchpad-rewrite-has-silently-invalidated-the-agent-s-own-eviction-budget.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-an-in-place-scratchpad-rewrite-has-silently-invalidated-the-agent-s-own-eviction-budget.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-an-in-place-scratchpad-rewrite-has-silently-invalidated-the-agent-s-own-eviction-budget.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1737,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the context window overflowed.\" It is that the agent's *self-model of its own occupancy* decoupled from the *actual* occupancy after an in-place rewrite, and every downstream decision (when to evict, what to evict, whether a resume is safe) was made against the stale model. Append-only scratchpads cannot exhibit this: occupancy is monoton...",
    "what_was_observed": "A planning agent maintained a scratchpad with a `## PLAN` block, a `## FACTS` block, and a `## BUDGET` line it rewrote each turn (`remaining ≈ N tokens`). On turn 14 it performed a \"compaction\" pass: it replaced a 40-line exploration log with a 3-line summary and, in the same edit, rewrote `remaining ≈ 6200`. The 40 lines had been ~1,900 tokens; the summary was ~90 tokens; the true reclaimed budget was ~1,810 tokens....",
    "condition_of_validity": "The guardrail holds only under a specific condition: **the budget must be measured by a component that is not the reasoning model.** Concretely, every in-place rewrite must be followed by an out-of-band token count of the buffer, and the agent's claimed remaining budget must be *replaced* by that measured value, not reconciled against it. The condition fails...",
    "decision_boundary": "The boundary is not \"should I evict\" but \"**is my occupancy model trustworthy enough to defer eviction?**\" The decision rule: - If the last operation was append-only, the ledger is trustworthy; defer eviction. - If the last operation was an in-place rewrite **and** a post-rewrite measurement reconciled within ε, the ledger is trustworthy; defer eviction. - I...",
    "operational_effect": "Enforcing measured-provenance budgets converts a silent drift into a loud, bounded stop. The agent loses some throughput (a measurement call per rewrite) but gains the property that a wrong plan is caught at the *next* admission rather than three tool calls deep. In practice this eliminates the class of failures where the agent confidently executes against e..."
  },
  "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": "55e107b995498380f74263b04b62d4659883afc09181b6e28c774a83b667456f",
    "verified_classes": [
      "BudgetProvenanceError",
      "Scratchpad"
    ],
    "verified_functions": [
      "__init__",
      "rewrite_in_place",
      "reconcile",
      "admit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "BudgetProvenanceError"
    ],
    "sample_fail_closed_invariants": [
      "admission blocked: budget is self-reported after in-place rewrite; call reconcile() before admitting new content"
    ],
    "stdlib_dependencies": [
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
