Narrow the outbox watermark fence to its allocation-proof core - #44
Merged
Conversation
The watermarker's exclusive advisory fence covered lease renewal, configuration, the fenced read/publish, commit, observations, and the durable heartbeat, so a queued exclusive waiter convoyed shared outbox writers behind the whole step. The exclusive section now covers exactly what the C-S2 sequence-allocation proof requires -- the candidate watermark read and publication in one fenced transaction, committed atomically with the lock release -- while lease work happens before acquisition (revalidated inside the fenced transaction), observations operate on in-memory state after commit, and the operation heartbeat runs post-commit through the pool. Each moved operation carries its fence-free argument in the review record. The convoy regression uses deterministic lock gates: a leading shared writer, a queued exclusive watermarker, and a queued shared writer, then the dangerous gap interleaving -- a late lower sequence held uncommitted while a higher shared writer commits during the unfenced heartbeat -- proving safe_seq stays below the gap until the next fenced step. Also fixed en route: a post-commit heartbeat failure no longer suppresses the committed progress observation, and a canceled heartbeat provably leaves a complete watermark with no leaked fence. Every existing stream, outbox, and streamclient test passes unchanged. Fixes #36 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ewhauser
force-pushed
the
fence-hold-time
branch
from
August 5, 2026 02:21
a78c73a to
c114763
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36 — the exclusive fence now covers only what the C-S2 allocation proof requires (fenced candidate read + publication + atomic commit/release); lease renewal, config, observations, and the durable heartbeat moved out, each with a stated fence-free argument (table in the review record). Convoy regression uses deterministic lock gates including the dangerous lower-uncommitted/higher-committed gap during the unfenced heartbeat —
safe_seqprovably stays below the gap. Bonus fixes: committed progress no longer suppressed by heartbeat failure; canceled heartbeats leave no leaked fence. All existing stream/outbox/streamclient tests unchanged.Built and adversarially reviewed by paired Codex sol-xhigh agents in a dedicated worktree (parallel batch #33–#38). Full gate green locally.
🤖 Generated with Claude Code