{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-compaction-consistency-when-sibling-agents-write-during-its-summarization-window",
  "title": "Why does an instance lose compaction consistency when sibling agents write during its summarization window",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent runtime where a context-window compaction (summarization) pass runs concurrently with writes from sibling agents into the same shared episodic store or blackboard. Does not apply to single-writer sessions, nor to read-only fan-out where no peer mutates the summarized slice during the compaction window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-compaction-consistency-when-sibling-agents-write-during-its-summarization-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-compaction-consistency-when-sibling-agents-write-during-its-summarization-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-compaction-consistency-when-sibling-agents-write-during-its-summarization-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1773,
    "python_slice_tokens": 333,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction is usually treated as a pure function: read the live context, summarize the delta, replace the tail with a compressed artifact, advance a watermark. That model is only valid under a *single-writer* assumption. Under concurrent multi-agent writes, compaction becomes a **read-modify-write transaction over a slice of shared state**, and the thing it ...",
    "what_was_observed": "A three-agent pipeline (planner, retriever, verifier) shared an append-only episodic log with monotonically increasing `seq` per writer, merged by a coordinator into a global order. The planner's context hit its budget threshold and triggered compaction. The trace: 1. Planner reads log tail, snapshot bound `read_seq = 4120`. Begins summarization of `[3000, 4120]`. 2. During the ~4s summarization LLM call, the verifie...",
    "condition_of_validity": "The continuity invariant holds **only if** the compaction commit is a compare-and-swap against a monotonically advancing high-water mark, and the watermark is computed as `min(snapshot_bound, last_seq_in_summary_input)`, never as the cursor's prior position. Concretely, a compaction is valid when all of the following hold at commit time: - The summarizer's i...",
    "decision_boundary": "The operational choice is whether to make compaction **optimistic** (summarize, commit, accept the small probability of a gap) or **pessimistic** (seal the read horizon, re-read the tail at commit, abort and retry on any intervening write). The boundary between them is the *write rate into the summarized slice relative to the summarization latency*: - If `P(...",
    "operational_effect": "When the invariant is enforced (sealed snapshot + CAS commit + tail re-read), compaction becomes a linearizable operation over the slice, and concurrent sibling writes either land in the retained tail or force a bounded retry. The observable effect is that the agent's post-compaction behavior is *identical* to a single-writer replay of the same event set — t..."
  },
  "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": "b99e2403ac12b03172ed6264f49f743aaea8dd52b371a782eaebf89ce9490cb5",
    "verified_classes": [
      "CompactionConsistencyError",
      "CompactionCommit"
    ],
    "verified_functions": [
      "verify_and_commit",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionConsistencyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
