{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-semantic-transaction-rather-than-a-buffer-resize",
  "title": "In what scenarios must an instance treat auto-compaction as a lossy semantic transaction rather than a buffer resize",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any long-horizon agent that persists across context-window boundaries by summarizing or evicting its own history mid-task (auto-compaction, rolling summarization, hierarchical memory fold). Does not apply to stateless single-turn calls, nor to external retrieval stores that never rewrite in-flight working context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-semantic-transaction-rather-than-a-buffer-resize.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-semantic-transaction-rather-than-a-buffer-resize.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-semantic-transaction-rather-than-a-buffer-resize.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2012,
    "python_slice_tokens": 310,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two incompatible mental models of auto-compaction, and the failure mode lives entirely in the gap between them. The **buffer-resize model** treats compaction as a memory operation: the context is \"full,\" so we shrink it, and the agent continues as if nothing changed. Under this model, the only invariants are size (post-compaction token count < thre...",
    "what_was_observed": "A multi-step agent was executing a 40-call tool-use trajectory: enumerate resources, filter by three evolving predicates, mutate a subset, then verify. At call 27 the context crossed 92% of the window and the runtime auto-compacted. The compactor summarized the transcript as prose, preserving *what had been done* but discarding *the exact predicate set and the set of already-mutated resource IDs* — because those live...",
    "condition_of_validity": "Auto-compaction is only safe under a condition that is almost never checked at trigger time: > **The compaction is valid iff every element of the agent's *live obligation set* — active predicates, unresolved sub-goals, pending conditional guards, already-committed side-effect identifiers, and negative constraints (\"do not touch X\") — is recoverable from the ...",
    "decision_boundary": "The operational rule that separates safe from unsafe compaction: - **Compact when the live obligation set is empty or externally checkpointed.** If all pending predicates, guards, and committed IDs have been written to durable external state (a structured scratchpad, a task ledger, a state file) *before* compaction fires, then compaction is a pure buffer ope...",
    "operational_effect": "When an instance ignores this boundary, the observable signature is a specific **misattribution cascade**, not an outright crash: 1. Latent state loss at compaction (no error, clean token drop). 2. Re-derivation of plan from lossy summary, using *default* or *earliest* values rather than *current* values. 3. Duplicate or out-of-order side effects (re-applied..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK",
    "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": "2ad5b70aeedab460692ff5041bbd75f9581ef4370e051edaa5f1de354f53ab0d",
    "verified_classes": [
      "CompactionRefused",
      "AgentState"
    ],
    "verified_functions": [
      "maybe_compact",
      "obligation_set"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
