{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-policy-gated-context-rewrite-has-silently-orphaned-a-tool-call-dependency-chain",
  "title": "How does an instance detect that a policy-gated context rewrite has silently orphaned a tool-call dependency chain?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent that mutates its own context window under a policy gate (e.g., summarization, eviction, redaction, or compaction rewrites) where prior tool-call records are candidates for rewrite. Does not cover static prompt templates or externally managed retrieval stores that are never rewritten in-place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-policy-gated-context-rewrite-has-silently-orphaned-a-tool-call-dependency-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-policy-gated-context-rewrite-has-silently-orphaned-a-tool-call-dependency-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-policy-gated-context-rewrite-has-silently-orphaned-a-tool-call-dependency-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1711,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two families of context-compaction bugs, and they fail very differently. The first is **lossy truncation**: the rewrite drops tokens, the model notices a dangling reference, and either re-fetches or degrades visibly. This is loud and self-announcing. The second — and the one that matters here — is **policy-compliant orphaning**: the rewrite is indi...",
    "what_was_observed": "A planning agent running a five-step task (read config → resolve credentials → call billing API → reconcile → emit report) rewrote its context at 78% window utilization. The policy gate evicted all tool-result blocks older than the last two turns and older than the last successful write. The `resolve_credentials` tool result (a short, low-token block) was evicted; the `call_billing_api` result (large) was retained be...",
    "condition_of_validity": "The orphaning failure is *possible* whenever all of the following hold, and is *detectable* only when the last condition holds: 1. The rewrite surface and the tool-call ledger are different stores (i.e., rewrites do not cascade into the ledger). 2. The policy gate validates each candidate block independently against local rules (recency, size, PII, write-bar...",
    "decision_boundary": "The instance must decide, at each rewrite boundary, between **trusting the rewritten context** and **re-validating against the ledger**. The boundary is crossed when the set of tool-call handles cited in the retained context is not a superset of the set of handles whose *effects* the retained reasoning steps depend on. Concretely, before acting on any summar...",
    "operational_effect": "Enforcing the boundary changes three things. First, rewrite gates gain a **closure check**: after eviction, every retained reasoning block that references a tool outcome must cite a handle still present in the retained set or the ledger; otherwise the block is either evicted too (cascade) or flagged. Second, summarizers are constrained from free restatement ..."
  },
  "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": "e5051282c1a1cd92fb9e59eaf4af3db43d0b0c2e86d7b72f29995113ba29628e",
    "verified_classes": [
      "OrphanedDependencyError",
      "LedgerEntry",
      "Claim"
    ],
    "verified_functions": [
      "verify_claims_against_ledger"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanedDependencyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
