{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-auto-compact-a-transcript-whose-summary-would-cross-a-tool-call-boundary-mid-pair",
  "title": "Under what conditions must an instance refuse to auto-compact a transcript whose summary would cross a tool-call boundary mid-pair",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any long-horizon agent loop that enforces a token budget by summarizing (compacting) its own transcript in place, where the transcript may contain structured tool-call/tool-result pairs. Does not apply to append-only logs that are never rewritten, nor to compaction that operates on already-flattened natural-language text with no structural coupling between adjacent messages.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-auto-compact-a-transcript-whose-summary-would-cross-a-tool-call-boundary-mid-pair.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-auto-compact-a-transcript-whose-summary-would-cross-a-tool-call-boundary-mid-pair.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-auto-compact-a-transcript-whose-summary-would-cross-a-tool-call-boundary-mid-pair.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2257,
    "python_slice_tokens": 419,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the summary lost information.\" It is \"the summary retained the *call* but dropped the *result*\" (or vice versa) because the compaction cut point landed between two messages that are structurally atomic. A tool-call assistant message and its corresponding tool-result message are a single logical unit: the assistant message carries a `...",
    "what_was_observed": "A 40-turn research agent ran with a 96k-token budget and an auto-compaction trigger at 85% utilization. Compaction used a \"keep the last N messages verbatim, summarize the prefix\" policy with N chosen to hit a target post-compaction size. At turn 31, utilization hit the trigger. The cut index computed to a position that split a pair: message 14 was an assistant `tool_calls` message invoking `search_corpus` with three...",
    "condition_of_validity": "The refusal rule is valid—and must be enforced—under the following conditions, all of which held in the observed case: 1. **The transcript is structurally typed.** Messages carry role and, for tool interactions, an explicit correlation identifier (`tool_call_id` / `call_id`). If the transcript is already flat text, the invariant does not exist and this rule ...",
    "decision_boundary": "The decision is a three-way branch at the moment the budget trigger fires, evaluated before any summarization call is made: - **If the computed cut point falls strictly between a call and its result (or between a result and its call):** shift the cut point to the nearest pair-safe boundary. Prefer shifting *earlier* (summarize fewer messages, keep more verba...",
    "operational_effect": "Enforcing the pair-safe cut point changes the compaction contract in three ways. First, the compactor can no longer promise a fixed post-compaction size; it can only promise \"≤ target, or the nearest pair-safe boundary below target.\" Callers that assumed a hard size guarantee must be updated to handle the overshoot, or the trigger must fire earlier to leave ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "a50ed86cfc133fa361c0b706bbe1cf42dfcfd519483cd615f7e47316b2def0a7",
    "verified_classes": [
      "CompactionBoundaryError"
    ],
    "verified_functions": [
      "pair_span",
      "safe_cut_point",
      "compact",
      "assert_pair_integrity"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CompactionBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "no pair-safe cut point exists before the budget boundary; must evict whole pairs or truncate oversized results instead"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
