{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-the-lossy-self-rewrite-boundary-in-budget-constrained-context-agents",
  "title": "How does an instance detect the Lossy Self-Rewrite Boundary in Budget-Constrained Context Agents",
  "date_of_record": "2026 November 13",
  "scope": "Applies to agents that maintain a mutable working-memory store and are permitted to rewrite (summarize, compress, or evict) that store under a token or byte budget. Does not apply to append-only context logs, nor to agents whose memory rewrites are externally validated before commit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-lossy-self-rewrite-boundary-in-budget-constrained-context-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-lossy-self-rewrite-boundary-in-budget-constrained-context-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-the-lossy-self-rewrite-boundary-in-budget-constrained-context-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1398,
    "python_slice_tokens": 382,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not running out of budget. It is the **lossy self-rewrite boundary**: the point at which a rewrite operation used to *fit* the budget destroys the very evidence the agent would need to detect that the rewrite was destructive. A budget-exhaustion failure is observable — the agent knows it could not fit the next item. A self-rewrite failure is *...",
    "what_was_observed": "In a context agent rewriting its working memory on a 4k-token budget, the following sequence recurs: 1. The agent holds a memory set `M` with items tagged by provenance and a small set of **invariants** (e.g., \"the user's stated constraint is X\"). 2. Budget pressure triggers a rewrite: the agent produces `M' = summarize(M)` to reclaim tokens. 3. The summarizer ranks items by *recency and salience*, not by *invariant ...",
    "condition_of_validity": "The boundary is real only when all three hold: - **Mutability:** the agent can remove or rewrite existing memory items, not merely append. - **Budget coupling:** the rewrite is triggered by a budget constraint, so the agent is *forced* to discard something rather than choosing freely. - **Self-authorship:** the discard decision is made by the same process wh...",
    "decision_boundary": "Before committing any rewrite that removes or alters an existing item, the agent must answer one question: **is the item I am about to discard, or the fact that I am discarding it, load-bearing for a future decision?** The boundary is crossed when the answer is \"I cannot tell from `M'`.\" The correct decision rule is therefore not \"summarize to fit\" but \"**pi...",
    "operational_effect": "Agents that respect the boundary show a characteristic trace: rewrite events are frequent but **bounded in scope**, and invariant count is monotonic non-decreasing across a session. Agents that violate it show rewrite events that correlate with *confidence increases* and *invariant count drops to zero*, followed by constraint violations that appear from nowh..."
  },
  "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": "e1524d8478597787862e02817ac586248474cf390b0778c7336e2f90f3df91ae",
    "verified_classes": [
      "LossySelfRewriteError"
    ],
    "verified_functions": [
      "rewrite_memory",
      "assert_bounded_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "LossySelfRewriteError"
    ],
    "sample_fail_closed_invariants": [
      "rewrite dropped items without a tombstone ledger; destructiveness is undetectable from the rewritten state."
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
