{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-evict-the-wrong-scratchpad-page-when-a-hierarchical-working-set-crosses-a-summarization-boundary",
  "title": "Why does an instance evict the wrong scratchpad page when a hierarchical working set crosses a summarization boundary?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agents that maintain a hierarchical scratchpad (e.g., L0 verbatim turns, L1 task-local summaries, L2 episode digests) and evict pages under a token-budget working-set policy. Does not apply to single-turn calls, stateless RAG, or systems where the full transcript is guaranteed to fit in context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-evict-the-wrong-scratchpad-page-when-a-hierarchical-working-set-crosses-a-summarization-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-evict-the-wrong-scratchpad-page-when-a-hierarchical-working-set-crosses-a-summarization-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-evict-the-wrong-scratchpad-page-when-a-hierarchical-working-set-crosses-a-summarization-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2029,
    "python_slice_tokens": 390,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something.\" It is that the eviction policy ranks pages by a *staleness score* computed against the current task frame, but summarization itself mutates the task frame. When an L1 page is compressed into an L2 digest, the digest no longer contains the lexical anchors (entity names, tool IDs, error strings) that the evictio...",
    "what_was_observed": "A planner agent ran a 340-step infrastructure-remediation task across a 128k-token window with a three-tier scratchpad. Working-set budget: 96k tokens for scratchpad, 32k reserved for the live reasoning frame. Eviction ran every 8 turns or when scratchpad exceeded 90k. Trace of the failure: 1. Steps 40–90: agent accumulates 41 L0 turns referencing `svc-auth-7`, `pool-3`, and error `ETIMEDOUT:5432`. Staleness scorer (...",
    "condition_of_validity": "The failure requires all of the following to co-occur: - **Hierarchical compression with abstraction.** The summarizer must drop literal anchors. A lossless or extractive summarizer (which preserves entity strings) does not trigger this, because the digest retains the scorer's keys. - **Scorer keyed on surface features** (lexical overlap, entity match, recen...",
    "decision_boundary": "The architectural invariant required is: **a compression artifact must be scored no colder than the maximum score of any page it summarizes, and must be evicted only after all its sources.** Operationally, this means the eviction scorer cannot be a pure function of page content. It must consume a **provenance edge set**: for each L1 page, the set of L0 page ...",
    "operational_effect": "With the provenance-aware scorer and anchor contract in place, the step-92 eviction becomes: digest effective score = max(0.11, 0.89) = 0.89, so the digest is protected; the 41 L0 pages (score ≤ 0.89, and children of the digest) are evicted first, freeing ~14k tokens and *reducing* pressure. The digest survives as the sole record, the agent reasons at L1, an..."
  },
  "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": "6e76dadd503560a131f1fd08b1f8af904fd0df22e32289a9fd5e31edbd882acb",
    "verified_classes": [
      "ReferenceInversionError",
      "ScratchpadPage"
    ],
    "verified_functions": [
      "effective_score",
      "plan_eviction",
      "check_resummarization"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReferenceInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
