{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-the-compaction-watermark-before-it-resumes-a-long-horizon-trajectory",
  "title": "Where must an instance reconcile the compaction watermark before it resumes a long-horizon trajectory?",
  "date_of_record": "2026 November 21",
  "scope": "Applies to single-agent instances that persist trajectory state across turns and apply lossy auto-compaction (summarization, eviction, or tiered distillation) when approaching a token budget. Excludes stateless single-shot inference and purely external memory stores that never feed back into the active reasoning context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-compaction-watermark-before-it-resumes-a-long-horizon-trajectory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-compaction-watermark-before-it-resumes-a-long-horizon-trajectory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-the-compaction-watermark-before-it-resumes-a-long-horizon-trajectory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2058,
    "python_slice_tokens": 225,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure that matters is not \"the agent forgot something.\" It is a *watermark divergence* between three independent counters that the agent system maintains but never reconciles atomically: 1. **`H` — the horizon watermark**: the trajectory index up to which the agent believes its context faithfully represents prior steps. 2. **`C` — the compaction waterm...",
    "what_was_observed": "A long-horizon debugging agent (budget 200k tokens, compaction threshold 0.85, summarizer model distinct from the executor) was tasked with a multi-file refactor requiring ~40 tool calls. Instrumentation logged `H`, `C`, `E` after every turn. The trace showed the following sequence, reproducible in roughly 1 of 9 runs where compaction fired during a slow tool call: - Turn 27 dispatches a `run_tests` call. The observa...",
    "condition_of_validity": "The invariant `C ≤ E` (compaction watermark never exceeds evidence watermark) is the only guard that bounds this failure. It is valid — and must be enforced — under all of the following conditions, and is *not* guaranteed otherwise: - **Compaction must be a barrier operation, not a concurrent one.** It may only run when no tool call is in flight and no obser...",
    "decision_boundary": "The operational decision is: **on resume, does the instance trust `H` or re-derive it from `E`?** The rule is that `H` is *never* trusted across a compaction boundary. On every resume — cold start, mid-task checkpoint restore, or post-compaction continuation — the instance must run a reconciliation that: 1. Walks the summary's claimed step coverage and, for ...",
    "operational_effect": "Enforcing the barrier and the reconciliation changes three measurable properties of long-horizon runs: - **Compaction latency increases** by the duration of the slowest in-flight call, because compaction can no longer overlap dispatch. For agents with long tool calls this is the dominant cost, and it must be budgeted explicitly rather than discovered. - **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": "2555c04294b7bc469c9b55233c550152c7c687b7a0a03f9efb79d66df9396eb9",
    "verified_classes": [
      "CompactionWatermarkError"
    ],
    "verified_functions": [
      "reconcile_watermarks",
      "resume_after_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionWatermarkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
