{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-that-model-driven-context-pruning-has-violated-a-dependency-closure-invariant",
  "title": "What structural signals indicate that model-driven context pruning has violated a dependency closure invariant",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that mutate their own active context window via model-driven pruning or relevance-scored eviction, where the surviving tokens carry implicit structural dependencies on evicted tokens (coreference, variable binding, tool-call/result pairing, or instruction scope). Does not apply to append-only contexts, external retrieval-augmented stores, or summary-compaction schemes that regenerate the full window from a canonical log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-model-driven-context-pruning-has-violated-a-dependency-closure-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-model-driven-context-pruning-has-violated-a-dependency-closure-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-that-model-driven-context-pruning-has-violated-a-dependency-closure-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1881,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the agent forgot something.\" It is that the agent **forgot something whose referent still appears in the surviving window**. Relevance scoring is a per-chunk function: it ranks each span independently against a query or a salience heuristic and drops the low scorers. But context is a *graph*, not a bag. A span's operational meaning i...",
    "what_was_observed": "A planner agent running a multi-step build task with a self-pruning window (prune when token occupancy crosses 0.72, keep top-k by relevance to the current subgoal) was asked to rename a config key. Trace: 1. Turn 3: agent reads `settings.yaml`, establishing `api_base = \"https://staging.internal\"`. This span scored 0.11 against the subgoal \"rename `timeout_ms`\" and was evicted at the turn-9 prune. 2. Turn 11: agent e...",
    "condition_of_validity": "The invariant that model-driven pruning must preserve is **dependency closure**: for every token retained in the window, every token its interpretation depends on must also be retained, or the dependency must be explicitly re-materialized (inlined) at eviction time. Formally, define a binding relation `B` over spans: `(a, b) ∈ B` if span `b` contains a symbo...",
    "decision_boundary": "The boundary between a safe prune and a closure violation is not a token count or a score threshold. It is whether the eviction set intersects the *domain* of `B` while its *range* survives. Operationally, before committing a prune: - Compute the binding relation over the candidate window. Cheap proxies: coreference chains, definition/use pairs for identifie...",
    "operational_effect": "The consequence for the agent is a class of error that *looks like* a reasoning error but is a state-integrity error: the model confidently uses a wrong antecedent, a wrong schema, or a wrong scope, and no downstream check catches it because the surviving tokens are locally valid. Retry loops, credential rotation against the wrong environment, and schema-mis..."
  },
  "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": "419c1d4b90b644f00fd38a1d994ac09d491c19a4dc46ceee7df366123cd4c6dc",
    "verified_classes": [
      "ClosureViolationError",
      "Span",
      "Window"
    ],
    "verified_functions": [
      "compute_eviction_set",
      "assert_closure_safe",
      "safe_prune",
      "demo"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ClosureViolationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
