Go native fuzz targets (seed corpus runs as unit tests):
- FuzzDecodeWALEntry: arbitrary bytes never panic; an error returns the
zero entry; an accepted record is self-consistent and re-encodes to
exactly its bytes.
- FuzzDecodeWALEntryFields: records with a valid CRC and EntrySize but
arbitrary fields, so the fuzzer reaches the decoder's acceptance rules.
- FuzzWALEntryRoundTrip: every entry the encoder accepts decodes back.
Shapes the decoder accepts but the encoder never writes (empty write,
batch shape, barrier with a Length, unknown type) and entries the encoder
accepts that do not decode back (unknown type, inconsistent padding) are
pinned as known gaps (knownWALDecodeGap, knownWALEncodeGap); any other
shape fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A workspace that moved A -> B -> A reattached A's surviving local root as
an existing volume without claiming HEAD: it served A's stale image and its
next (hash-mode) cut overwrote B's acknowledged, synced and published
writes. A non-fresh attach now reads HEAD first; if another holder
published it (Gen != 0, Holder != this holder), the attach fails closed
with ErrChunkStaleLocalRoot wrapping storage.ErrChunkLayerFenced: the
volume is not served and the attach is not retried. One log line and the
status evidence name the volume, the local root, HEAD's holder, generation
and epoch, and say to remove or quarantine the root; the next attach then
starts fresh from HEAD. The deferred (authority-wait) attach records the
same evidence. Recreating the root automatically is a follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move-back tests for the chunk provider. The existing local root of a
workspace that moved A -> B -> A must not attach: no reads or writes, no
cut, HEAD unchanged, a typed ErrChunkStaleLocalRoot (fenced) and status
evidence that says to remove or quarantine the root, also when the attach
is deferred until the assignment arrives. After the root is removed the
fresh path serves B's image. Controls that pass today: a same-holder
reattach at a newer epoch, an existing root with no HEAD, and a holder whose
HEAD a newer epoch took over never cuts over it.
ErrChunkStaleLocalRoot is declared so the tests build; nothing returns it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A workspace moves A -> B -> A and A's old durable root is still on disk.
A attaches it as an existing (non-fresh) volume, so it never claims HEAD:
it serves its own stale image instead of B's published writes, and its
next cut (hash mode) overwrites B's acknowledged, synced and published
data in HEAD.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match blockvolume's auto default (new volumes are walstore, an existing
volume opens with its on-disk format): §1.3 lists smartwal's open issues
and says it is not a default; the open-items entry no longer says the
standalone default is smartwal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/spec/ holds 12 TLA+ models of the block protocols with their TLC
configurations (cfg/, 199 files: designs, RED configs that remove one guard
and must produce a counterexample, and reachability witnesses), run.sh to
check one configuration, and a README: how to run TLC, one row per spec
(invariants, results, the code it maps to), limits, the findings that led
to #152, #156, #158 and #159, and the open model-level items.
Docs only; nothing runs in CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .github/workflows/test.yml, job 'go test (linux)': on pull_request and on
push to main; Go from go.mod; go build ./..., go vet ./..., and
go test -short -count=1 -timeout 10m ./... with CGO_ENABLED=0. Actions are
pinned by commit SHA, permissions are contents: read, and a new push to a
PR cancels the older run.
- core/ops/surface_test.go: fix the two go vet warnings (resp used before
the error check), so vet covers the whole module.
- cmd/blockvolume: a withdrawn port no longer has to answer ECONNREFUSED.
A successful connect still fails; any other dial error passes only if the
address can be bound again.
- core/host/volume: probe tests dial a listener they opened and closed,
not the fixed 127.0.0.1:1.
- core/replication/component: on failure, the G5-5C and G9A catch-up tests
log frontiers, peer status and the engine trace. Assertions and timeouts
are unchanged.
Test files and the workflow only; no product code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/design/block-design.md describes the current design of the block
service: the data path and WAL, replication and recovery, the chunk
snapshot/fork/GC control plane, and the frontends. Each claim names the
source file and the test that pins it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments in source and tests named individual reviewers and carried the
time a decision was taken (for example "(name's ruling, 06:47Z)"). Those
are review bookkeeping, not design rationale. Remove the names and the
dates/timestamps; keep the rationale, issue and PR references (#51, #82,
#83, #142, #159) and spec section references as plain text.
Comment-only: no code, test logic or string literal changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The snapshot, fork and parallel-upload cut numbers come from a host-side
proxy (chunks as local files, a deterministic filer metadata model; no
network, guest fsync or block frontend), not from the Firecracker runs. Say
so in the section intro, the table caption, the cut sentence and the image
footer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds an 'Agent workspace disks' section: a local-speed disk per agent microVM,
incremental chunk snapshots to SeaweedFS, cheap snapshot/fork, host moves with
fenced HEAD takeover, measured workspace workloads and snapshot/fork cost, the
sw-block ops chunk lifecycle commands, correctness work and what is not claimed
yet. Adds the overview image docs/assets/seaweed-block-agent-workspace.svg.
The Kubernetes alpha content is unchanged apart from heading levels and the
status table title.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codex01's #159 P2-S2 and P2-S3 (tests only):
- TestWALWriterBatchReuseIsBoundedByTheDurableTail: the batch planner,
with a padding wrap, is refused while a release is in memory only or the
recovered bounds are pending (no head move, no padding written), and
accepted once the tail is persisted.
- TestWALStoreRecoverBoundsPersistFailureRefusesAppendsUntilRetry: a
failing superblock write or fsync fails Recover and admits no Write; a
same-instance Recover retry persists the bounds; a later Write, Sync and
reopen keep the exact bytes.
Mutation controls (WSL): reverting only the batch planner's durable-tail
check fails the batch test alone; publishing the tail before Recover's
persist, or dropping the pending flag, fails its own control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codex01's AMEND on 980de2b9 (tests-only P2): the helper opened a full
WALStore and only stopped its committer and closed its fd, leaving the
flusher and ticker alive. Read the superblock with a scoped file read
(readSuperblock), and register the original store's cleanup right after
open so a Fatal before the crash step still closes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's condition (1) for any prefix-cut recovery rule (2026-11-16
07:33Z). A rebuild installs BASE by WriteExtentDirect (no LSN) and applies
WAL-lane entries with their real LSNs by ApplyEntry; AdvanceFrontier runs
only at MarkBaseComplete and is in memory until a Sync. So a store can hold
synced LSN 101-102 with a persisted checkpoint of 0 and no LSN 1..100.
Recovery keeps them; a rule replaying only the contiguous LSN prefix above
the checkpoint would keep none. This pins that, so no such rule lands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full checkpoint persists head == tail (88fbb345 persists the released
tail). Sync does not persist the head, so appends after it continue
contiguously from that position; recovery now scans [pos, end) then
[0, pos) from it. The footer high-run search stays only for the legacy
(0, 0) superblock. Scanning from offset 0 let a torn unsynced record
wrapped there hide every synced record after it.
Model check (claude05's WALRecovery.tla, rule rootLww = this writer and
scan plus #156's replay by LSN, K=4, 4 LSNs): crash-only I1 and I2 hold
(247,395 distinct states).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the released tail persisted (88fbb345), a full flush persists
head == tail. Sync does not persist the head, so synced appends follow it;
recovery's head==tail path ignores the persisted position and scans from
offset 0 when no high run is found, so a torn unsynced record wrapped to 0
hides every synced record after it (claude05's S3 trace shape).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's ruling on the S3 torn-wrap finding (2026-11-16 07:33Z), root
fix: the WAL writer may only overwrite bytes released by the PERSISTED
superblock tail, so a torn new record can never land inside the persisted
[tail, head) and hide a synced record behind it (crash only, no
corruption).
- walWriter.durableTail: the tail of the last fsynced superblock. The
space checks (append, appendBatch planning, admission pressure) count
from it; a release made only in memory frees nothing. Bounds rebuilt by
recovery are not reusable until persisted.
- The flusher's checkpoint persists the tail it releases (the old code
persisted the pre-advance tail and advanced after), with head and tail
taken from one writer snapshot. A flush whose checkpoint is already
covered (direct frontier) still persists its tail release.
- Recover persists the rebuilt head/tail before any append when they
differ from the on-disk superblock.
The replay-side defense (resync past a bad entry, replay by LSN up to
the first gap) is #156.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude05's ruling on the S3 torn-wrap finding (2026-11-16 07:33Z): the
writer may only overwrite bytes that the PERSISTED superblock tail has
released. On main the flusher persists the pre-advance tail and the
in-memory tail moves after it, and Recover moves the writer's bounds
without persisting them, so a torn new record can land inside the
persisted [tail, head) and hide a synced record behind it.
- flusher.afterSnapshotForTest: a test-only hook in the window after the
dirty-map snapshot (an append there is covered by the persisted head
but not by the checkpoint).
- TestWALStoreAppendDuringFlushThenTornWrapKeepsSyncedRecords: the S3
trace, deterministic; crash only; synced LSN 2 is lost on main.
- TestWALStoreFlushPersistsTheReleasedTail, TestWALStoreRecoverPersists-
TheRecoveredBounds: the on-disk tail lags the writer's.
- TestWALWriterReuseIsBoundedByTheDurableTail: an in-memory release
makes its bytes reusable at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>