{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-own-context-compaction-has-silently-severed-a-memory-tool-causal-chain",
  "title": "How does an instance detect that its own context compaction has silently severed a memory-tool causal chain",
  "date_of_record": "2026 November 23",
  "scope": "Applies to long-running LLM agent instances that (a) run against a finite context window subject to automatic compaction/summarization, and (b) invoke external memory tools (write/read/update/delete over a persistent store) whose results feed back into reasoning. Does not apply to stateless single-turn inference or to agents whose entire working set is guaranteed to fit in one window with no compaction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-compaction-has-silently-severed-a-memory-tool-causal-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-compaction-has-silently-severed-a-memory-tool-causal-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-context-compaction-has-silently-severed-a-memory-tool-causal-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1783,
    "python_slice_tokens": 306,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Observability of *context compaction* is routinely conflated with observability of *token accounting*. A team sees `context_tokens_before=118_400`, `context_tokens_after=9_800`, emits a `compaction.completed` span, and considers the event fully instrumented. But compaction is not a token event — it is a **state-mutation event on the agent's causal graph**. T...",
    "what_was_observed": "An agent performing a multi-hour incident-triage task invoked `memory.read(key=\"service_owner\")` at turn 38, receiving `\"payments-platform\"`. At turn 52 the context crossed the 85% threshold and a summarizer compacted turns 1–50 into a 900-token digest. The digest faithfully retained the *fact* — \"owner is payments-platform\" — but dropped the tool-call record and its `tool_call_id`. The instance continued, at turn 61...",
    "condition_of_validity": "The invariant that bounds this failure is: **every fact in the post-compaction working set that originated from a tool invocation must carry a resolvable provenance handle to that invocation, or be explicitly demoted to `unverified`.** Formally, for each retained assertion `a` with `source(a) = tool_call_id`, the compaction output must satisfy `a.provenance ...",
    "decision_boundary": "The boundary the instance must decide, at the moment it consumes a compacted context, is: **treat a tool-derived fact as live-and-verified, or as a stale cache requiring re-fetch?** The decision is not free — re-fetching costs a tool round-trip and latency; treating as verified risks acting on a rotated value. The boundary is crossed toward *re-fetch* when a...",
    "operational_effect": "The operational consequence is a shift in what \"compaction observability\" must record. A `compaction.completed` event is insufficient; the required record is a **provenance reconciliation event** carrying `retained_provenance_ids`, `orphaned_assertion_ids`, and a `demotions` list. Downstream, the agent's tool-call wrapper must refuse to execute a side-effect..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "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": "217fc85c14489e81907b45fd05dbf05148313a0f3ed7c2fcac5847f94f1dc22c",
    "verified_classes": [
      "ProvenanceSeveredError",
      "Assertion",
      "CompactionResult"
    ],
    "verified_functions": [
      "reconcile_after_compaction",
      "guard_side_effect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ProvenanceSeveredError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
