{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-auto-compaction-when-semantic-summarization-triggers-mid-tool-call",
  "title": "Under what conditions must an instance refuse auto-compaction when semantic summarization triggers mid-tool-call",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-running agent instances that manage their own context window via auto-compaction policies gated on semantic signals (topic drift, summary-confidence thresholds, or per-turn semantic entropy). Does not apply to fixed-token-count truncation, external orchestrator-managed context, or stateless single-turn invocations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-auto-compaction-when-semantic-summarization-triggers-mid-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-auto-compaction-when-semantic-summarization-triggers-mid-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-auto-compaction-when-semantic-summarization-triggers-mid-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2779,
    "python_slice_tokens": 475,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different moments at which a compaction policy can fire. The **idle boundary** is the point between the completion of one assistant turn and the start of the next user- or orchestrator-driven turn: at this point the context contains only fully materialized messages and tool results, and a semantic summary of the prefix is a faithfu...",
    "what_was_observed": "An instance executing a 14-step incident-triage task emitted a `query_logs(service=\"payments\", window=\"15m\", filter=\"status>=500\")` tool call. The call's arguments were ~340 tokens of structured JSON. While awaiting the tool result, the semantic compaction monitor — which runs asynchronously against the live context — computed a redundancy score over the trailing 4,000 tokens and found the last several reasoning step...",
    "condition_of_validity": "The invariant that prevents this class of failure is: **a semantic compaction trigger is valid only if, at the moment of firing, the context contains no unpaired tool-call envelopes and no assistant messages whose continuation depends on state not yet in the transcript.** Formally, let the context be a sequence of message units. Define a *dangling unit* as a...",
    "decision_boundary": "The operational decision is not \"should we compact\" but \"**is the current context position a legal compaction point, and if not, what is the maximum deferral we can afford before token pressure forces an illegal one?**\" The boundary has three regimes. *Regime A — legal compaction point.* No dangling units, region is dependency-closed, trigger computed on las...",
    "operational_effect": "When the invariant is enforced, three observable properties change. First, tool-call argument fidelity becomes a checkable postcondition: after any compaction, every tool-call envelope in the transcript must have its arguments byte-identical to pre-compaction, and this is verifiable by a structural diff rather than a semantic one. Second, the summarizer's re..."
  },
  "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": "9b3ca5692c3b4fcb4c453e7306ec3293850a67fb197e8524601bc59be6c726ee",
    "verified_classes": [
      "IllegalCompactionPoint",
      "Regime",
      "Message"
    ],
    "verified_functions": [
      "find_dangling",
      "region_is_dependency_closed",
      "classify_compaction_point",
      "maybe_compact"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "IllegalCompactionPoint"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
