Main now has a test (from the refused-restore change) that commits a HEAD
through layout.RunCommit; with the cause argument it passes
layout.CauseCommit. Test only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. The scan now covers package-level initializers, refuses
any writer referenced as a value (a method value or expression), accepts
a forwarded cause only in the four census forwarders and only while it
is never reassigned or redeclared, and refuses a writer call with
another argument count. Negative controls on synthetic source cover each
escape. The store test runs each refusal on a fresh directory, counts
filer write calls, and follows each with a success control under the
right cause.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A HEAD is written by three store calls: the conditional update (only
through runTransition), the exclusive create, and the tombstone. Each now
takes a typed HeadWriteCause, one value per row of the HEAD writer
census, so a writer without a row does not compile. The transitions that
serve one row pass it; RunAbort, RunEndClean and RunCommit, which serve
several, take it from their caller. The layout store refuses a cause
outside the census, a first HEAD not written as create and a tombstone
not written as tombstone. No behaviour changes otherwise.
TestEveryHeadWriteIsACensusRow scans the production source: every HEAD
write names a census constant or forwards its function's cause, and
every row has a writer (both directions); it logs the writers by row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up. The template unit takes the volume id from its
instance name, so a settings file cannot name another volume (a fourth
per-instance directive, kept by the drift test). /status/guests and its
schema say what it is: the counted frontends (NVMe/TCP, iSCSI) only; an
absent frontend is not served or not counted; a vanished host stays
counted until TCP closes; 0 is not proof that nothing uses the volume.
The endpoint test's callbacks use atomics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What volume start and volume stop need, before the commands.
/status/guests?volume=<v> reports the guests connected now through each
frontend served: NVMe/TCP hosts (live admin controllers) and iSCSI
initiators (Normal sessions past login; Discovery sessions do not count),
read at request time, and their sum.
deploy/systemd/sw-blockvolume@.service runs one volume per instance
from /etc/sw-block/volumes/<volume>.env with its own state directory;
apart from three per-instance directives it is sw-blockvolume.service,
and a test keeps the two the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove unnamed roots, segments and chunks through one conditional mark/delete writer. Resume chunk cursors after bounded passes; re-plan metadata first and retain the session initial root set through operator snapshot deletes. Add a local trigger of the existing snapshot schedule for qualification.
The ledger row for the identity rule this change keeps: one name, one
layout identity; no directory but the record's holds a live HEAD. Its
scope: only a refused restore's record (never left the creation phase)
is removed; a served volume's deleted name is never created again. A
guard test proves that name is refused for a plain create, the same
restore request and a new one, with no record and no filer write.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>