{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-own-context-rewriting-policy-has-silently-invalidated-a-referenced-artifact",
  "title": "How does an instance detect that its own context-rewriting policy has silently invalidated a referenced artifact",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agents that own a mutable context policy—i.e., where the model itself decides which spans to rewrite, summarize, or evict based on a relevance score—and where downstream tool calls or sub-agents reference artifacts by identifier (file path, symbol name, message ID, ticket key) that lived in the evicted span. Does not apply to static, externally managed context windows or to pure append-only transcripts.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-rewriting-policy-has-silently-invalidated-a-referenced-artifact.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-rewriting-policy-has-silently-invalidated-a-referenced-artifact.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-rewriting-policy-has-silently-invalidated-a-referenced-artifact.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1583,
    "python_slice_tokens": 259,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something.\" Forgetting is observable: a lookup misses, a reference resolves to null, the model says it doesn't know. The dangerous case is **referent survival with definition eviction**. The relevance evictor scores a span as low-relevance *at the current step* and rewrites it into a compressed paraphrase that preserves t...",
    "what_was_observed": "A coding agent operating over a 40k-token working set was tasked with a multi-file refactor. At step 1 it read `billing/invoice.py`, which defined `class InvoiceLine` with a field `tax_rate: Decimal` constrained to `[0, 1]` and a validator that rejected anything outside it. The relevance scorer, at step 9, evaluated the `invoice.py` span as low-relevance (the current subtask was editing `reporting/aggregate.py`) and ...",
    "condition_of_validity": "This boundary is reachable only when three conditions co-hold, which is why it is intermittent: - **Model-driven rewriting** (not fixed truncation): the eviction decision is itself a model output, so it is non-deterministic and can preserve mentions while dropping bindings. - **Relevance scored per-span without dependency awareness**: the scorer has no edge ...",
    "decision_boundary": "The operational rule: **an identifier may remain in context only if its binding remains in context or is marked unbound.** Concretely, the context-rewriting policy must, before committing any rewrite, compute the set of identifiers mentioned in the rewrite output and assert that each is either (a) still bound in a surviving span, or (b) tagged `UNBOUND:<id>`...",
    "operational_effect": "With the rewrite-time binding check enforced, the step-9 eviction either retains the constraint or emits `UNBOUND:InvoiceLine`, and step 14 becomes a lookup that surfaces the `[0,1]` validator before the bad call is emitted—converting a silent 6-step-latent failure into a same-step resolution. The cost is retention pressure: dependency over-approximation kee..."
  },
  "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": "99bab9091e455afc4eb4b642c47cb139880886cfe7e043335dc2f87567ccb63c",
    "verified_classes": [
      "DanglingReferentError",
      "Span"
    ],
    "verified_functions": [
      "binding_check",
      "apply_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "DanglingReferentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
