{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-preconditions-when-automatic-context-compaction-summarizes-the-wrong-layer-of-the-transcript",
  "title": "Why does an instance lose tool-call preconditions when automatic context compaction summarizes the wrong layer of the transcript",
  "date_of_record": "2026 December 2",
  "scope": "Applies to long-running agent instances that trigger automatic context compaction (summarization + truncation of the middle of the transcript) while a multi-step tool-using task is in flight. Does not apply to single-turn calls, to compaction performed only at task boundaries, or to systems that preserve a structured external task ledger independent of the transcript.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-preconditions-when-automatic-context-compaction-summarizes-the-wrong-layer-of-the-transcript.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-preconditions-when-automatic-context-compaction-summarizes-the-wrong-layer-of-the-transcript.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-preconditions-when-automatic-context-compaction-summarizes-the-wrong-layer-of-the-transcript.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1827,
    "python_slice_tokens": 314,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary was too short\" or \"the model forgot.\" It is a **layer-targeting error**: most compaction strategies summarize the *conversation layer* (assistant reasoning + user turns) while the *precondition-bearing layer* — the set of facts that make the next tool call valid — lives in the raw tool-result records and in the argument/result...",
    "what_was_observed": "A 40-step agent task: provision a resource, poll until ready, mutate it three times, then finalize. Compaction fired at step 22 because the transcript crossed the window threshold. The compactor's policy was: keep system prompt, keep last 6 turns verbatim, summarize the middle 16 turns into ≤400 tokens of prose. The middle 16 turns contained: - `create_resource` → returned `{id: \"r-8f3a\", etag: \"v1\"}` - two `poll_sta...",
    "condition_of_validity": "The invariant that compaction must preserve is not \"the gist.\" It is the **reconstructability of the next valid tool call**. Formally: after compaction, for every tool the instance may next invoke, the arguments it can construct must equal the arguments a non-compacted instance would construct, given the same tool history. This holds only if the compactor tr...",
    "decision_boundary": "The boundary is: **does the compaction policy have a representation of precondition state that is independent of the transcript it is about to truncate?** - If **yes** (structured ledger maintained on every tool result, compaction summarizes only the ledger-free narrative), lossy compaction is safe and the invariant holds. - If **no** (compaction summarizes ...",
    "operational_effect": "Left unguarded, this produces a specific and dangerous class of failure: **confidently invalid mutations**. The instance does not stall or error at the boundary; it proceeds with reconstructed-but-wrong preconditions, and the backend's rejection (stale etag, duplicate key, double-apply) is misread as transient and retried, compounding the divergence. Detecti..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "6edecf0b2e5c56723759a93a0ae9501aabd4ddbb39380eb0ec4c6af6e086d551",
    "verified_classes": [
      "StalePreconditionError",
      "ResourceState",
      "PreconditionLedger"
    ],
    "verified_functions": [
      "issue_finalize",
      "compact_and_resume",
      "record_create",
      "record_mutation",
      "current"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StalePreconditionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
