Begin now writes through runTransition, the one read-apply-update path
every transition will use. A source-scan guard holds for the whole
series without edits: only runTransition calls UpdateHead and the store
cannot create a HEAD; every Run transition must have its closure and
interrupt tests; only a claim waits for the old lease; and no function
removes a store object until removal brings its own lease re-check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HEAD is the volume's one mutable entry: epoch and holder, the open
transaction (activity idle, snap(session) or clean(session)), the current
root and position, and the named snapshots with their dependents (at
most 100). Its encoding is canonical JSON; decoding refuses unknown
fields and any bytes Encode would not write.
Begin moves activity idle -> snap(session) for the holder at HEAD's
epoch, by one conditional update on HEAD's generation. Begin of the
session already open is a replay and writes nothing; another open
session, a cleaning, another epoch or another holder is refused; an
absent HEAD is refused and never created.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pure package for the content-named store layout: a chunk is named by
its index and the SHA-256 of its bytes and lives under
pool/<index/10000>/; a manifest is split into one segment per shard
(seg/<shard>-<sha256>) and a root naming them (root/<sha256>). Encodings
are canonical: decoding refuses any bytes Encode would not write, so an
object has one encoding and one name. Present and MissingOwn look names
up only: an entry that exists is complete, and a failed lookup is an
error, never absent. Nothing uses the package yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A source scan lists every non-test function in core/ and cmd/ that reads
a volume's HEAD (ReadHead, GetHead, GetHeadRoot, getHeadRoot, headExists,
or a LookupEntry of HEAD) and fails when a reader is added or removed
without classifying it. Each reader names what it does when HEAD is
absent and the probe that pins it; readers that take an absent HEAD for
an empty one are marked GAP, so a change to that behaviour flips their
probes on purpose.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A trace-driven matrix: each command is run once through a recording
filer to enumerate its filer writes (its step boundaries); then for every
write it is killed before the write reaches the filer and after it
applied with its reply lost, the catalog restarted, and the command
re-run (twice) with the same request id. The end state and the data are
checked: the volume deleted and refused, or the fork's or restore's
image reading back byte for byte. A killed fork's copy intent may outlive
the replay; the test checks it is that request's and that the copy sweep
past the deadline settles it with the image intact. A step added to a
command is covered without editing the test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It measures the store write p99 beside the master's store before and
after the restart and asserts the bar only below 20 ms; otherwise it
reports the numbers without failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host owns the startup wait's one bound: it keeps the wait's start and
opens the window at the first reply at or after it; the run of replies
(and the window) ends on a transport, credentials or identity refusal;
/status shows the same bound. The provider asks the host for the bound
given its own start, and checks it on the attach retry path too: a
granted attach that keeps failing no longer holds the lease for ever
without serving. An identity refusal ends on an accepted identity-checked
call (the run of replies restarts there) or after 30 s of replies with no
new identity refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The master refuses an unregistered server id or a wrong host with a
typed IDENTITY detail (kind unregistered or wrong_host) on the lease
renewal and the assignment stream, text unchanged. The volume treats it
like refused credentials: no bound, /status reason "identity refused:
<kind>" with its age, never serves; it ends when an identity-checked
call (renewal, delivered assignment) is accepted, not on a heartbeat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 30 s window opens at the first reply from blockmaster received after
the store is opened and recovered (or at a later streak's start), and runs
from the master's barrier time when that is later; local open and
recovery count toward nothing. The host hands the provider its contact
facts (streak start, latest reply, barrier time, final refusal).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host's bound counts from the first answer, but the lease guard (the
only source of the barrier time) starts after the local open and
recovery: a slow open found the bound already spent and exited 75 on
every start. The wait now ends no earlier than its limit from its own
start, and a grant on the same tick attaches before the bound is checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>