{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-context-auto-compaction-as-a-causal-dependency-rewrite-rather-than-a-lossless-summarization",
  "title": "Under what conditions must an instance treat context auto-compaction as a causal-dependency rewrite rather than a lossless summarization",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agent instances (single or multi-turn, tool-using) that auto-compact their own trajectory when the context window approaches saturation, and whose later reasoning depends on the *ordering and provenance* of prior tool calls and observations. Does not apply to stateless single-shot inference, nor to compaction of purely conversational history where no downstream step re-reads earlier observations as causal premises.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-context-auto-compaction-as-a-causal-dependency-rewrite-rather-than-a-lossless-summarization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-context-auto-compaction-as-a-causal-dependency-rewrite-rather-than-a-lossless-summarization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-context-auto-compaction-as-a-causal-dependency-rewrite-rather-than-a-lossless-summarization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1831,
    "python_slice_tokens": 311,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is usually modeled as a *lossy compression* problem: minimize semantic drift between the original trajectory and its summary. That framing is wrong for agents whose next action is a function of an *evidence chain*. The correct framing is a **causal-dependency rewrite**: compaction must preserve a partial order over (tool_call → observation → ...",
    "what_was_observed": "A coding agent operating over ~140 tool calls on a migration task hit 82% context utilization and triggered auto-compaction. The compactor (an LLM summarizer with a \"preserve key findings, drop redundant tool output\" instruction) produced a compacted trajectory that retained: - `migrated schema v3 applied` (from a `psql -f migrate_v3.sql` observation) - `backfill completed: 1.2M rows` (from a long-running job poll) -...",
    "condition_of_validity": "The causal-rewrite requirement binds only when **all three** hold: 1. **Downstream re-read:** a post-compaction step will read a retained observation as a *premise* for a new action (not merely as context). If the compacted trajectory is terminal — the agent will only summarize or report — lossy compression is fine. 2. **Provenance-bearing artifacts:** at le...",
    "decision_boundary": "The compactor must decide, per retained node, whether it is **established** (its full justification chain is inside the retained set) or **asserted** (its justification was elided). The boundary rule: - If a node's justification chain is fully retained → keep as established fact. - If any justifying edge is elided → the node MUST be re-tagged as an assertion...",
    "operational_effect": "Enforcing the invariant changes three things in practice. First, compacted trajectories grow a small, bounded provenance ledger: for each retained mutation, one edge to the event that produced it and one flag for whether the motivating failure is retained or elided. This is O(mutations), not O(trajectory), so it does not defeat the purpose of compaction. Sec..."
  },
  "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": "4db8d203a8da2bf2b15ad782466bd43ceb4e0a5fc46563a6d72790d0a4c2d05e",
    "verified_classes": [
      "CausalCompactionError",
      "NodeStatus",
      "TrajectoryNode",
      "CausalEdge",
      "CompactedTrajectory"
    ],
    "verified_functions": [
      "validate_compaction",
      "resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CausalCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
