Part A gains M9, the HEAD transactions of the content-named layout
library (diagram and transition table, Begin so far), and Part B gains
B.10 with the rows its tests enforce: canonical names and encodings,
the one HEAD write path, the HEAD encoding, and Begin. The library has
no production caller; the notes say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Added beside the real claim.go, the control's RunClaim was hidden by
the real one's lease wait once claim.go exists; it now replaces the
file, as a changed claim would.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Abort when HEAD is already idle succeeds without a write whatever came
before (aborted, committed or never begun); its result never says
whether the session's work was committed, which is read from HEAD's
current root. Controls cover the never-begun and already-aborted cases.
The interrupt helper again requires exactly one HEAD write per
transition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lease rule checked whether the name RunClaim was used, not whether
the function was declared, so a declared RunClaim with no wait passed.
The guard now checks the package's declared functions: a declared
RunClaim must use OldLeaseEnded, and every declared exported Run
function must go through runTransition. Each negative control now
asserts the finding it is meant to cause.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard now records every use of UpdateHead, runTransition,
OldLeaseEnded and Delete/Remove names, in function bodies and in
package-level initializers: a call, a method value or alias, a method
expression and an inline interface all count. Negative controls add
each form to the package's real sources and must be refused. The
comments on invalid UTF-8 now state what the old encoding did: it wrote
an escaped U+FFFD that its own canonical decode refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The JSON encoding turns invalid UTF-8 into U+FFFD and still re-encodes
the same, so HEAD would store another holder, session, snapshot or
dependent name than the caller gave and a later lookup by that name
would find nothing. check() refuses such names, and runTransition
checks the next HEAD before writing it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Abort moves activity snap(session) -> idle for the holder at HEAD's
epoch by one conditional update and changes nothing else; it is also
how a holder rolls back the session HEAD names after its own crash.
Abort over idle is a replay of a lost reply and writes nothing; another
open session or a cleaning is refused. Begin and Abort share one
read-apply-update path that refuses an absent HEAD.
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>
Reader opens a root of a volume and resolves a chunk index through the
shard's segment to its ref, then reads the bytes from the pool of the
volume the ref names (a restore's source for a foreign chunk). An index
the root does not name reads as zeros; a root, segment or chunk the root
reaches but the store lacks is ErrMissing, never zeros; bytes that do
not hash to their name, or a segment holding another shard, are
ErrCorrupt; a failed fetch is neither. DecodeRoot now checks the error
of its re-encoding as DecodeSegment does.
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>
An unknown fact is not a failed one: the unsupported promotion path now
moves the line only on the current primary's own not-ready report, like
the supported path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A delete admitted as never started that stopped before it marked HEAD,
after which the holder claimed HEAD, was refused at the master on every
rerun, before the catalog step that gives the reservation back: the
volume stayed reserved for ever. A rerun whose token already holds the
reservation (or a committed one) now skips the verdict; the catalog
step's HEAD fence refuses the live HEAD and gives back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>