Commit Graph
152 Commits
Author SHA1 Message Date
pingqiuandClaude Opus 5.5 ab747bfa47 change: cut over to the content-named store and delete the legacy store
The runtime stores each volume in one content-named layout on the filer:
immutable chunks, segments and roots are ordinary filer files, and one
HEAD entry per volume carries every conditional commit. A holder claims
HEAD under its granted epoch and claim id, cuts in its own session,
commits by HEAD generation and position, and is fenced when its identity
moves. Catalog, restore, snapshot, retention, cleaning, verify and volume
delete run through the layout kernel; the master mints the layout
identity, reads HEAD proofs and holds the delete reservation and lease
barrier. The legacy store, its intents and its compatibility paths are
removed; existing stores are recreated, not converted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 14:59:23 -08:00
pingqiuandClaude Opus 5.5 e79996437f wip: P2 primary fence below the floor refused; P3 test; basis census; test stand-ins state a basis
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:54:29 -08:00
pingqiuandClaude Opus 5.5 b2cb5d4879 wip: one decision function on every failover path; a promotion states its basis; no fence in boot grace
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:44:23 -08:00
pingqiuandClaude Opus 5.5 520fd27de0 wip red: an unfenced promotion and the unsupported path's failover
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 05:43:01 -08:00
pingqiuandClaude Opus 5.5 fdee737e2f wip: fencing round tests (gate, heal, round ask, mint)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:00:09 -08:00
pingqiuandClaude Opus 5.5 939fe74a8b wip: master side of the fencing round, and the heal after a failed one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:51:58 -08:00
pingqiuandClaude Opus 5.5 d92cfe3748 authority, master: a rebalance passes the planned-move guard
A rebalance moves the primary while it is alive, so it is a planned move,
yet it needed only the gate's promotion evidence. Under RF3 sync_quorum
the old primary can be acknowledged by the other replica alone while the
target adopts. The gate now marks a slot PlannedMoveAllowed from the same
plannedMoveAllowed(profile, replicas) a failback uses, and the controller
publishes a rebalance only to such a slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:37:48 -08:00
pingqiuandClaude Opus 5.5 5fb4fccd85 authority, volume: the line carries its primary kind and evidence; the target checks its own store before it adopts
A line names how it made its primary the primary: BOOTSTRAP (the volume's
first primary), PROMOTION (with the gate's evidence: the target's durable
LSN and its epoch-table row there) or FORCED. The one mint refuses a
reassign without a kind, the kind and evidence are kept on the durable
authority record so a replayed line carries them, and AssignmentFact
carries them to the target.

The target adopts the primary role of a replicated volume only if its own
store still shows what was probed: a replay of an epoch it adopted needs a
valid epoch table; BOOTSTRAP needs no data; PROMOTION needs a valid table,
a durable end at or above the probed LSN and the probed row at that LSN
(a tail beyond it is its own log); FORCED adopts. A line without a kind to
a node holding data is refused, except a store from before the epoch
table replaying the line of its own durable floor (the upgrade). A
refusal latches the role admission failure (the slot becomes ineligible),
and the next round shows the store's real end and row. A single-replica
workspace move keeps its own start check.

Red: the promotion adoption trace (a store replaced between the line and
its adoption, an acknowledged block lost) fails on main and passes; one
row per guard of the adoption check; the mint refuses a kind-less reassign.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:23:18 -08:00
pingqiuandClaude Opus 5.5 c9fe8a7123 authority, master: one decider: a primary change is published only through the promotion gate
The promotion gate (one function: the probe round's answers -> the allowed
replica and its evidence) now covers every replicated volume, RF2
included: on main RF2 and every observation-fed failover promoted on
heartbeat readiness with no evidence of the candidate's data. The gate
puts its evidence on the slot it allows; the controller's failover and
rebalance carry it and publish nothing without it. The legacy PolicyOwner
(no production caller) is deleted. Failback is the operator's planned move
through the gate: the target is probed by the round, and the move is
allowed only when the target is in every acknowledgement set (sync_all at
any replica count, sync_quorum with RF2); RF3 sync_quorum (needs a seal)
and best_effort (forced only) are refused with typed errors.

About forty tests encoded the evidence-free decision. Their subjects are
unchanged; each now gets the candidate's evidence the way the gate gives
it (the controller's candidate helper, the convergence snapshots, a
stand-in gate sink for the observation-fed routes, a static round answer
for the RF2 and failback tests). None is skipped or loosened. New: ready
replicas without the gate's evidence promote nothing; RF2 promotes on a
ready answer and not without one; the planned-move guard, one row per ack
profile and replica count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:23:18 -08:00
pingqiu bfeab6ca94 fix: terminate a restarted moved source with typed MOVED and exit 78 2026-11-24 19:35:30 -08:00
pingqiuandClaude Opus 5.5 2aebd987ef test: reload after the fail-stop must return exactly the written record
The reload used Load, which hides skipped corrupt records, and accepted
no record. The child stops after the rename without a power loss, so the
record is on disk: reloadExactly requires LoadWithSkips to return it
(deep-equal) with no skip, and its own controls refuse a corrupt, a
missing and a different record. The latch note and comments no longer
name a directory sync failure as a latch cause (that case fail-stops).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:51:22 -08:00
pingqiuandClaude Opus 5.5 6c0e1ad9e0 fix: fail-stop when the directory fsync after a rename fails
The rename is done, so a failed directory open or fsync leaves the
record's durability unknown. Reporting "failed" let a restart reload a
write its caller had acted on as failed. blockmaster now exits
(ExitDurabilityUnknown = 74, typed line) for every record type; the
restart reloads whatever survived. A close error after a good fsync is
reported written. Windows keeps its previous behaviour. The fault seam
names the step (open, fsync, close). INV-AUTH-PERSIST-BEFORE-PUBLISH-001
rewritten to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:34:59 -08:00
pingqiuandClaude Opus 5.5 7c7d1223de test: a directory fsync failure after the rename must fail-stop (red)
The child process does one Put with an injected directory fsync failure;
it must exit ExitDurabilityUnknown with the typed line and never return
to its caller. The parent reloads the store: the record or none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:31:49 -08:00
pingqiu d67b35050a Merge remote-tracking branch 'origin/main' into fix/authority-dir-fsync 2026-11-24 15:20:35 -08:00
pingqiu aad7a19906 docs: describe public rules in comments 2026-11-24 12:32:05 -08:00
pingqiu 0aa6dcd24e Merge remote-tracking branch 'origin/main' into fix/1.0.1-live-holder
# Conflicts:
#	docs/design/invariants.md
2026-11-24 12:02:48 -08:00
pingqiuandClaude Opus 5.5 2733834554 test: admission-level verdicts; the M2 row names Revoking and the rerun
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:26:09 -08:00
pingqiuandClaude Opus 5.5 04a70968fe fix: a delete that stopped midway can be run again
The HEAD reader refused a deleting, purging or deleted HEAD as invalid,
so a never-started delete whose commit timed out (or whose mark's outcome
was unknown) was refused on every re-run: the volume stayed unusable and
undeletable. Such a HEAD can no longer be claimed, so it is past the
fence: the reader returns it with ErrWorkspaceHeadDeleting and the
verdict admits it (HolderDeleting).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:09:38 -08:00
pingqiuandClaude Opus 5.5 6537dde732 fix: a failed directory fsync fails every authority store write
The directory fsync after the rename was best-effort for every record but
a workspace lease: its error was ignored, so a write a crash could undo
was reported as written. It now fails closed for every record. Windows,
which cannot fsync a directory, skips it as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:01:37 -08:00
pingqiuandClaude Opus 5.5 665f1f7563 test: a failed directory fsync must fail every authority store write (red)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:56:39 -08:00
pingqiuandClaude Opus 5.5 0273c9d8aa fix: the delete reads a never-claimed initial HEAD as epoch 0
The master's HEAD reader refused the initial HEAD (epoch 0, no holder) as
invalid, so the delete saw every never-started line as unreadable. It now
returns that HEAD with ErrWorkspaceHeadUnclaimed: every caller that needs
an identity still gets an error; the delete evidence reads it as epoch 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:12:27 -08:00
pingqiuandClaude Opus 5.5 5bf22f98e1 fix: a volume whose holder never claimed HEAD is deletable
One pure verdict for 'live holder of V' (TERM-LIVE-HOLDER-001):
WorkspaceHolderState(line, ACK, HEAD) -> no line, drained, sealed,
never started (HEAD below the line's epoch), live, or unknown. The chunk
volume delete's admission (MarkVolumeDeleting) reads HEAD before its
locks, bounded at 5 s, and admits no line, drained and never started; a
sealed HEAD without an ACK, a live one, or an unreadable HEAD is refused
as before. The delete's HEAD compare-and-swap to deleting stays the only
fence against a claim that lands after the read. The lifecycle
DeleteVolume reads no HEAD and keeps refusing a line without an ACK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:54:24 -08:00
pingqiuandClaude Opus 5.5 6754c1daf1 test: measure W, the store write a lease grant makes (env-gated)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 23:53:34 -08:00
pingqiuandClaude Opus 5.5 9a303f6ec9 fix: one barrier time, woken past it with jitter; retry from admission's clocks
The guard reads the host's barrier time (one copy) and wakes 100 ms past
it plus up to 500 ms of jitter, capped at 2 min; its 1 s pre-grant poll is
jittered by 20 %. The master's retry_after uses the same two predicates
as admission: lease expiry plus skew (wall) and the grant deadline plus
skew (its monotonic clock), each measured from now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:41:57 -08:00
pingqiuandClaude Opus 5.5 4d9f242640 feat: typed kind on lease renewal refusals
RenewWorkspaceLease refusals carry a WorkspaceLeaseRefusal status detail
(code and text unchanged): BARRIER with the time left until the
forced-move barrier passes, MOVED only when the published line names
another replica or a newer epoch owned by another known server, DELETED
only for a committed deletion. Everything else carries none (OTHER).
The barrier comes from a typed error, never from the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:59:55 -08:00
pingqiu 3729222ab8 Merge branch 'pr448' into HEAD 2026-11-22 20:47:21 -08:00
pingqiu d59c640128 docs: trace heartbeat slot ordering to its invariant 2026-11-22 17:26:07 -08:00
pingqiu 7e0648a1a6 test: check readable per-slot superseded totals 2026-11-22 17:22:11 -08:00
pingqiu 6d7435313e feat: report superseded heartbeat counts per slot after unlock 2026-11-22 17:21:41 -08:00
pingqiu 41e70e6a6a test: require unlocked per-slot superseded heartbeat diagnostics 2026-11-22 17:21:17 -08:00
pingqiu d06879b76c test: pin mixed-slot supersession and independent expiry 2026-11-22 17:18:19 -08:00
pingqiu f305ecd6cf fix: order heartbeat reports within each replica slot 2026-11-22 17:17:25 -08:00
pingqiu b03e43d26f test: interleave independent heartbeat slots on one server 2026-11-22 17:16:53 -08:00
pingqiu 9bd8cb5bc6 fix: keep delete refusal guidance to verified revocation steps 2026-11-22 16:31:24 -08:00
pingqiu 8fe4231095 fix: explain clean-revocation recovery before workspace delete 2026-11-22 15:36:59 -08:00
pingqiu 115ae3651a test(workspace): document ACK validity edge and horizon controls 2026-11-22 09:02:36 -08:00
pingqiu b528a0c9ec fix(workspace): share detached proof and lease validity decisions 2026-11-22 09:02:35 -08:00
pingqiu be1337aeaa test(workspace): expose divergent lease validity decisions 2026-11-22 09:02:24 -08:00
pingqiuandClaude Opus 5.5 f557cdfbc8 test: positive per-recipient evidence in the gate; the unknown owner's exact placeholder
Test review of #429 79d5d9f7:
- wrongOwnerEndpoints fails a recipient whose log cannot be read or shows no forced-epoch
  delivery, so each recipient must positively receive the owner's line.
- The unknown-owner unit check requires the volume unsupported or exactly the
  no-observation placeholder (no server, the line's endpoints), so neither s1's nor s2's
  report may supply it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:10:15 -08:00
pingqiuandClaude Opus 5.5 79d5d9f798 fix: one owner decision (PublishedLine.Owner); a moved line with an unknown owner takes facts from no server
Design review of #429 (V1-SPEC r2.40, INV-AUTH-HOLDER-IDENTITY-001, TERM-HOLDER-001):
- PublishedLine.Owner is the single owner decision (move-named server; move-named but
  unknown; not from a move), called by Host.workspaceLineOwner and expectOwnerForLine.
- A move-minted line whose owner is unknown binds its replica to no server: no health,
  endpoints or refresh from anyone (control: the placement server's fresh report changes
  nothing). Only a line no move minted keeps the accepted topology.
- var _ lineOwnerReader = (*Publisher)(nil): dropping the method is a build error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:55:01 -08:00
pingqiuandClaude Opus 5.5 77873e8d54 test: the moved line's replica candidate comes from its owner (#425 unit red + control)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:09:05 -08:00
pingqiuandClaude Opus 5.5 290b43c58b fix: a moved line's replica is expected on its owner, so no other server refreshes its endpoints
#425 (V1-SPEC r2.40, INV-AUTH-HOLDER-IDENTITY-001): the topology controller took the line
replica's facts from the server the accepted topology names (the old host after a forced
move); the returning old host's report raised an endpoint refresh that republished the
line (EV+1, owner s2) with s1's endpoints. BuildSnapshot now binds the expected slot of the
line's replica to the move-named owner (PublishedLine.IssuedHost), so that replica's
health, endpoints and refreshes come only from the owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:09:05 -08:00
pingqiu d65ac54ffb fix(master): capture line owner and bind its model trace 2026-11-22 05:22:16 -08:00
pingqiu a86f07d71a docs: trace holder checks and nonblocking lookup to their invariants 2026-11-22 01:22:26 -08:00
pingqiu 58839e5c2d fix: read committed holder identity without waiting for authority writes 2026-11-22 00:58:47 -08:00
pingqiu 53b41f808f Merge commit '626fd811' into fix/oss-holder-resume
# Conflicts:
#	docs/design/agent-workspace-design.md
#	docs/design/invariants.md
#	docs/workspace-lease.md
2026-11-21 21:29:27 -08:00
pingqiu 0d7808c9ad test: bound regrant durability handshakes and clarify renewal scope 2026-11-21 21:23:47 -08:00
pingqiu 742d248a78 test: preserve persisted regrant skew across a smaller restart setting 2026-11-21 21:12:08 -08:00
pingqiu 5af76730c7 test: require sealed regrant return to preserve proof and refuse guest IO 2026-11-21 21:05:38 -08:00
pingqiu 7e8084c7a4 fix: keep expired renewal nonblocking behind held authority writes 2026-11-21 21:02:35 -08:00