{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-silently-lose-tool-call-provenance-when-lossy-context-compaction-outruns-its-fidelity-score",
  "title": "Why does an instance silently lose tool-call provenance when lossy context compaction outruns its fidelity score",
  "date_of_record": "2026 November 21",
  "scope": "Applies to any agent loop that compacts its own context window via lossy summarization gated by a scalar fidelity score (semantic similarity, LLM-as-judge, or embedding cosine) before resuming multi-step tool execution. Does not apply to lossless truncation, externalized memory stores with exact retrieval, or single-turn inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-silently-lose-tool-call-provenance-when-lossy-context-compaction-outruns-its-fidelity-score.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-silently-lose-tool-call-provenance-when-lossy-context-compaction-outruns-its-fidelity-score.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-silently-lose-tool-call-provenance-when-lossy-context-compaction-outruns-its-fidelity-score.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1597,
    "python_slice_tokens": 245,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A fidelity score measures whether the *summary preserves the gist* of the compacted span. It does not measure whether the summary preserves the *operational preconditions* the agent needs to re-enter execution. These are different quantities. Gist fidelity is a property of the text; execution re-entry validity is a property of the state machine that the text...",
    "what_was_observed": "A 40-step agent trajectory executing a provisioning task across an MCP filesystem server and a shell tool. At step 27 the context window crossed the 82% saturation threshold and the compaction policy fired: the span from step 1 to step 22 was replaced with a 900-token summary, LLM-judge fidelity scored at 0.91, above the 0.85 acceptance gate. Execution resumed. At step 31 the agent attempted to finalize a resource wh...",
    "condition_of_validity": "The fidelity gate is only a valid guardrail under a condition that compaction policies rarely state: **the compacted span contains no live referential state that downstream steps must dereference.** Formally, if the span `S` contains any execution binding `b` (tool call ID, resource handle, idempotency key, negotiated schema version, authorization scope, ord...",
    "decision_boundary": "The boundary between safe and unsafe compaction is not a similarity threshold. It is a graph property of the trajectory: - **Compact** when the candidate region's escaping-binding set is empty, or when every escaping binding is externalized to exact storage and the summary carries a resolvable pointer (not a paraphrase) to it. - **Retain verbatim** when any ...",
    "operational_effect": "Under unsound compaction, the observable signature is a *post-compaction re-execution*: the agent re-issues a side-effecting call it already performed, under a fresh idempotency key, and reports success while orphaning the prior effect. This is not detectable by fidelity monitoring (scores stay high), not detectable by output validation (the new call succeed..."
  },
  "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": "88e15b04b59b858af90f2c22cc75fb5c1644d9b57f2e319d372ec4ebbdde16b6",
    "verified_classes": [
      "UnsoundCompactionBoundary",
      "Binding",
      "CompactionRegion"
    ],
    "verified_functions": [
      "authorize_compaction",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsoundCompactionBoundary"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
