{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-auto-compaction-of-a-trajectory-segment-that-has-an-open-tool-call-obligation",
  "title": "Under what conditions must an instance refuse auto-compaction of a trajectory segment that has an open tool-call obligation",
  "date_of_record": "2026 December 3",
  "scope": "Applies to long-horizon agents that persist trajectories (message lists, tool-call/result pairs, scratchpad state) and invoke an automatic compaction/summarization pass when context occupancy crosses a threshold. Does not apply to stateless single-turn inference, nor to compaction of closed, fully-resolved segments where every tool call has a matched result and no pending continuation exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-auto-compaction-of-a-trajectory-segment-that-has-an-open-tool-call-obligation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-auto-compaction-of-a-trajectory-segment-that-has-an-open-tool-call-obligation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-auto-compaction-of-a-trajectory-segment-that-has-an-open-tool-call-obligation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1977,
    "python_slice_tokens": 391,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization lost information.\" It is that auto-compaction treats the trajectory as a *sequence of tokens with semantic value* when, in fact, a trajectory is a *protocol log with structural obligations*. A tool-call message and its matching tool-result message form an atomic pair. Many model APIs (and the MCP/A2A framing layers beneath t...",
    "what_was_observed": "A long-horizon agent (≈140 turns, mixed retrieval and shell tools) crosses the 80%-of-context threshold mid-tool-call. Sequence: 1. Assistant turn *N* emits `tool_calls: [{id: \"call_7f3a\", name: \"read_file\", args: {...}}]`. Harness dispatches. Tool is slow (network filesystem, ~4s). 2. While the tool is in flight, a background compaction worker—triggered by a token-count watcher that runs independently of the dispatc...",
    "condition_of_validity": "Auto-compaction of a segment is structurally valid **if and only if** all of the following hold at the moment the compaction snapshot is taken: - **C1 (pairing closure):** Every assistant message in the segment that carries `tool_calls` is followed, within the same segment, by `tool` messages matching each `tool_call_id`. No call is left open at the segment ...",
    "decision_boundary": "The instance must **refuse** compaction (defer it) rather than proceed when C2 is false—i.e., when a tool call is in flight. Deferral is safe: the trajectory is momentarily larger than the threshold, which is a soft limit, whereas a broken pairing is a hard protocol violation. The correct behavior is to enqueue the compaction request and re-evaluate after th...",
    "operational_effect": "Enforcing the quiescence fence converts a class of non-deterministic schema failures into a bounded, observable deferral: compaction latency rises by at most one tool round-trip, and the failure mode becomes \"context briefly over threshold\" instead of \"request rejected\" or \"silent fabrication.\" The pairing-closure check turns an API 400 at the *next* turn (h..."
  },
  "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": "f2d26a5a56d20d3997a3821a75947401a2d3b55035a2efd55628c2289b053d53",
    "verified_classes": [
      "CompactionInvariantError",
      "ToolCall",
      "Message",
      "Trajectory"
    ],
    "verified_functions": [
      "assert_compaction_safe"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
