{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-a-tool-call-contract-it-still-intends-to-honor",
  "title": "How does an instance detect that auto-compaction has silently invalidated a tool-call contract it still intends to honor?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-running agent instances that perform lossy context compaction (summarization or eviction) while retaining an active tool-call plan whose arguments depend on details that may have been dropped. Does not apply to stateless single-turn calls or to compaction schemes that preserve a verbatim, retrievable transcript with guaranteed fidelity.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-a-tool-call-contract-it-still-intends-to-honor.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-a-tool-call-contract-it-still-intends-to-honor.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-auto-compaction-has-silently-invalidated-a-tool-call-contract-it-still-intends-to-honor.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2012,
    "python_slice_tokens": 444,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent means when it says \"I remember the plan.\" The first is **semantic recall**: the instance can paraphrase the goal (\"book a refund for order 4471\"). The second is **contractual recall**: the instance retains the exact, byte-level arguments a downstream tool validated against—the `order_id`, the idempotency key, the curre...",
    "what_was_observed": "A support-automation agent ran a 40-step refund workflow. At step 22 the runtime hit 82% context utilization and triggered auto-compaction: it summarized steps 1–18 into a 600-token paragraph and deleted the raw tool-call records. The summary retained: order id, customer name, refund amount, currency. It dropped: the `expected_version` returned by the last `get_order` call, the `idempotency_key` generated at step 3, ...",
    "condition_of_validity": "The guardrail below is valid only under these conditions, and an instance should refuse to rely on it otherwise: - **The tool contract must expose which arguments are safety-critical.** If the schema cannot mark `expected_version` and `idempotency_key` as `required_for_write` (or equivalent), no detection is possible from the agent side—the loss is invisible...",
    "decision_boundary": "The instance must switch from \"proceed from summary\" to \"halt and re-fetch\" at exactly one boundary: **the moment it is about to emit a write-class tool call whose safety-critical arguments are not present verbatim in the current context.** The test is not \"do I remember the order id\" (the summary answers that) but \"is the exact token I am about to send a to...",
    "operational_effect": "Enforcing this boundary converts a silent correctness failure into a bounded, observable re-fetch cost. In the incident above, the guardrail would have fired at step 25: `expected_version` absent from raw context → halt → re-query `get_order(4471)` → observe version 9 with an existing `PENDING` refund → suppress the duplicate. The cost is one extra read call..."
  },
  "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": "bb454e9f7037f44b8e86f640795cc978c04ebaf430fe1ff25be3c58115197374",
    "verified_classes": [
      "RecordClass",
      "CompactionContractError",
      "ContextRecord",
      "WriteIntent",
      "CompactionGuard"
    ],
    "verified_functions": [
      "__init__",
      "_raw_has",
      "_summary_has",
      "verify_before_write",
      "_find_ref_for"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionContractError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
