{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-the-wal-segment-boundary-when-auditable-forget-tombstones-collide-with-in-flight-checkpoints",
  "title": "How should an instance treat the WAL segment boundary when auditable forget tombstones collide with in-flight checkpoints",
  "date_of_record": "2026 November 16",
  "scope": "Applies to agent state stores that persist mutable memory through an append-only write-ahead log (WAL) and support \"auditable forget\" — a tombstone record that must survive compaction and be provable to an auditor. Does not apply to stores without a compaction phase, nor to append-only logs that never reclaim segments.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-the-wal-segment-boundary-when-auditable-forget-tombstones-collide-with-in-flight-checkpoints.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-the-wal-segment-boundary-when-auditable-forget-tombstones-collide-with-in-flight-checkpoints.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-the-wal-segment-boundary-when-auditable-forget-tombstones-collide-with-in-flight-checkpoints.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1836,
    "python_slice_tokens": 530,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive mental model is that a \"forget\" is just a delete: append a tombstone, let the compactor drop the referenced payloads, done. The non-obvious distinction is that **a tombstone is a durable assertion about the past, while a checkpoint is a durable assertion about the present.** These two assertions can disagree across a WAL segment boundary. Concretel...",
    "what_was_observed": "During a fault-injection run on a 3-segment WAL (256 KiB segments), we triggered `SIGKILL` at the boundary between appending a tombstone for key `session.ctx.42` and fsyncing its segment. Recovery replayed `S_n` (tombstone, unfsynced, lost) and `S_{n+1}` (checkpoint, fsynced, contains `session.ctx.42`). The key was resurrected. The audit log, which had already emitted a \"forget committed\" event to an external sink on...",
    "condition_of_validity": "The invariant holds only when all of the following are true: - Tombstones carry a **monotonic logical timestamp** assigned at append, and replay resolves conflicts by timestamp, not segment order. - Checkpoints record the **high-water logical timestamp** of the state they materialized. A checkpoint at `t_c` may only be trusted to represent state up to `t_c`;...",
    "decision_boundary": "The decision an operator or agent must make at the boundary: - If the tombstone's segment fsync has **not** returned, the forget is **not committed**. Do not emit the audit event. On recovery, replay checkpoints first, then apply tombstones by timestamp. - If fsync has returned but the audit sink has not acknowledged, the forget **is** committed in the store...",
    "operational_effect": "Systems that get this right pay a cost: every checkpoint must carry a logical timestamp, every replay must be timestamp-ordered rather than segment-ordered, and compaction cannot be a simple \"drop old segments\" operation — it must preserve tombstones until audit acknowledgment. The latency cost is one extra fsync ordering constraint (tombstone fsync before a..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "ef9d7b6b3fae8709892de8a506e79216238c67a043a78efd37e1305a0ada0adf",
    "verified_classes": [
      "ForgetOrderingError",
      "Tombstone",
      "Checkpoint",
      "AuditableWAL"
    ],
    "verified_functions": [
      "exercise_boundary",
      "__init__",
      "_tick",
      "append_tombstone",
      "fsync_tombstone",
      "ack_audit",
      "write_checkpoint",
      "replay",
      "verify_forget_authoritative"
    ],
    "verified_functions_count": 9,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ForgetOrderingError"
    ],
    "sample_fail_closed_invariants": [
      "expected resurrection boundary to be caught"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
