{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-that-automatic-context-compaction-has-silently-orphaned-a-live-tool-call-dependency",
  "title": "How should an instance detect that automatic context compaction has silently orphaned a live tool-call dependency",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent loop that performs automatic context compaction (summarization, eviction, or relevance-decay pruning) while a multi-step tool-call chain is in flight. Does not apply to stateless single-turn inference or to compaction performed only at task boundaries where no pending tool state exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-automatic-context-compaction-has-silently-orphaned-a-live-tool-call-dependency.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-automatic-context-compaction-has-silently-orphaned-a-live-tool-call-dependency.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-automatic-context-compaction-has-silently-orphaned-a-live-tool-call-dependency.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1869,
    "python_slice_tokens": 303,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction policies are almost always evaluated on a *relevance* axis: a token budget forces a choice, and the policy keeps the \"most relevant\" spans by embedding similarity, recency, or salience scoring. The failure mode examined here is not that the wrong spans are kept. It is that compaction treats the context as a *set of text spans* when a live executio...",
    "what_was_observed": "A research agent executing a ten-step workflow issues a `create_issue` tool call to an external tracker at step 4. The call payload is emitted, the tool transport acknowledges receipt asynchronously, and the loop yields to await the result. Between the yield and the result's arrival, the orchestration layer runs its compaction pass because the accumulated transcript has crossed 82% of the token budget. The compaction...",
    "condition_of_validity": "The invariant that must hold is: **no compaction pass may evict or rewrite a span that is the anchor of an unresolved tool-call edge, regardless of its relevance score.** Formally, for every open call identifier `c` in the loop's execution state, the span containing the request payload, arguments, and identifier `c` is *pinned* until a result binds to `c` or...",
    "decision_boundary": "The decision boundary is whether to **pin** or to **defer**. Pinning is correct when the open-edge set is small and the pinned spans fit within the residual budget; it preserves the ability to compact the rest of the transcript. Deferral (blocking compaction until the edge set empties) is correct when the pinned spans would themselves exceed the residual bud...",
    "operational_effect": "The effect of getting this wrong is not degraded prose. It is *divergent side effects*: duplicate external writes, phantom completion states, and reconciliation failures that downstream agents cannot detect because the evidence of the original call was destroyed by the very mechanism meant to preserve coherence. The failure is silent at compaction time and o..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "8aade15237fb1df10c310baa9c8b674ce993b240ecf6c47c885ae6ec070dc4cd",
    "verified_classes": [
      "OrphanedToolCallError",
      "Span",
      "ExecutionState"
    ],
    "verified_functions": [
      "compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedToolCallError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
