Repository navigation
Description
Goal (Upamanyu, 2026-11-24): close etcd_safe (members crash and restart) and etcd_safe_nocrash, the multi-machine top-level theorems of examples/etcd/dist (Spec/github_com/mit_pdos/etcd_grove/examples/etcd/dist/TopLevelRobustness.lean). The statement shape is approved (etcd-safe statement packet; separate thread bound etcdThreads, steps etcdSteps := 2^48). This issue splits the remaining work into pieces that other sessions can take.
How to take part. Comment claim: <piece> (one piece per session at a time), then report: <piece> with the branch head, what is proved, the VM build result, and what is left. Large pieces have a sub-issue; work there and post the final report here.
Rules.
- Builds: VM only (
/shared/tmp/vm/vmlake -j 32 build <targets>, from your worktree). Never startetc/lean-check.pyorlake buildin a worktree whose.lakelacks the built imports, and nevervmlake fetcha full tree locally: the root disk filled up twice today (~/coordinator-notes/overnight-brief.md, "Disk"). - Permissions: no actions that trigger permission prompts.
- Trust: no new axiom,
sorryor top-level premise unless the piece lists it. Changes to statements and to trusted parts (an axiom's or trusted model's text, a fork change to verified code) go to Upamanyu via coordinator-E as a packet, one item at a time, each with anaxiom-skill review. Keep working on the branch while the packet is reviewed. - Landing: push your branch and request enqueue on How we coordinate concurrent work: claim issues #8. Never run
etc/land.shagainst the shared checkout. - Base: dist pieces start from
etcd-safe-lit/2026-11-24(c022542b8b: the restated statement, the skeleton,BootBad). D6 pieces start from their own branches, listed below. - References: plan
notes/etcd-dist-plan.md(§11 the stage table, §12 the crash plan, §14 the bounds, §15 the review items); D6 plannotes/etcd-dist-d6.md(task table §6, axioms §7); robustness review~/coordinator-notes/plans/robustness-review/etcd.md§2.
Pieces. Sizes are Lean lines. "Now" means it can start today; otherwise the line names what it waits on.
The lead keeps these:
- P1 integration and landing. Merge the finished branches (
etcd-safe-d2,-lit,-wf,-crashskel/-d4b/-d4c-on-d4b,-d6t4b,raft-restart-confpoint) into one line. Done: a full VM build,tcb-report --check, a request on How we coordinate concurrent work: claim issues #8. - P2 D6-T4
NewServer.wp_proofC(branchetcd-safe-d6t4b/2026-11-24): the server restart from a crash image, including the backend-ahead case. Done: nosorry, plus aNewServer+Centry in the serverLink. In progress. - P3 raft lifetime law (same branch):
RestartNode's post gives a restart mark, and eachMsgSnapfromReadycarriesT0 < rt. With it, the server narrowsrnReplayJob. The new raft laws L1/L2 (LeaderCompleteLaw.lean) are already proved. In progress. - P4 the final packet (changed 2026-11-24, Upamanyu: "I just want the top-level theorem proved"). There are no separate trusted packets. The trusted changes (D4a, D4b, D4c', T6, the WAL torn-Save and
applySnapshotfork changes, the statement diff) are built on branches andetcd_safeis proved on top of them. Where a piece isn't ready, a sound interim axiom stands in, at an external interface only (never over the example's own checks), each reviewed by an independentaxiom-skill agent. Once the theorem has nosorry, ONE packet goes to Upamanyu: the statement, each trusted change and interim axiom in 3-5 lines,#print axiomsand the tcb collection.etcd_safe_nocrashcomes first, then the crash theorem.
Trusted-change rule for pieces below: the rule above (packets to Upamanyu) is replaced by this one. Build the trusted change on your branch, get an independent axiom-skill review, and report it on this issue; don't wait.
Open for other sessions:
- P5 D6-T2: the server's crash-aware durability invariant.
rnDurInvbecomes a per-generation invariant with raft's crash token, the WAL's synced/named records, the batch-phase cases, andrn_enterundernotCrashed. Baseetcd-safe-d6t2/2026-11-24(efd5966fe4, WIP, unbuilt). About 1500 lines. Waits on P6's design (now fixed); otherwise now. Sub-issue: etcd_safe P5: D6-T2, the server's crash-aware durability invariant #51 - P6 WAL torn-Save fix, phase 2. The fork's Go side is done (
etcd-safe-walfix/2026-11-24@fb261c479f:Saveends with a state record;ReadAlldrops entries after the last one). Left: bump the pin, retranslate the WAL with bodies (goose-lean-walfs2), and re-proveSave/ReadAlloverfsExt. About 800-1500 lines. Now. Sub-issue: etcd_safe P6: WAL torn-Save fix, phase 2 (retranslate, re-prove Save/ReadAll) #52 - P7 D6-T6: the snapshot directory's crash law. The implementation, and the proof of
snapDir_crash.law(the handlesnapDirInvH,fileAtDur, the bbolt API lawfileHoldsMDur ⊢ fileHoldsM). Baseetcd-safe-d6t6impl/2026-11-24@211ef407a2(decisions and proof plan innotes/etcd-dist-d6.md§T6). Over 1000 lines. Now. Sub-issue: etcd_safe P7: D6-T6, the snapshot directory's crash law #53 - P8 D6-T5: the WAL after a crash, giving
srvFilesandwalReadFacts(storage/wal/, newSrvCrash.lean,WalRecs.lean). 800-1500 lines. Now, but best after P6. - P9 the kv workload instance (M1
etcd_kv_safe_nocrash). The kv instance ofremoteDistSafe(txnlin's model,PendDec,codecOk) for the orchestrator and client machines overremote, unary gRPC only. About 2000 lines. The instance itself can start now; the assembly waits on putgetK's k-member boot (dist-putgetk/2026-11-24, the putgetK lead's). Sub-issue: etcd_safe P9: kv workload instance (M1 etcd_kv_safe_nocrash) #54 - P10
EtcdBootCBad: the crash statement's malformed-deployment case. The crash form ofBootBad.lean'setcdBootNCBad_holds: every program checksWellFormedand returns. Base: the crash skeleton (etcd-safe-crashskel/2026-11-24@87c770d1cc) merged with-lit. 200-400 lines. Now. - P11 the crash bridge on the separate thread bound.
robust_of_dist_crash_adequacy_etcdNet(etcd-safe-d4c-on-d4b) still ties the thread bound to the receipt bound. Port it the wayNet.robust_of_distBootILTwas ported (over Perennial's crash adequacy with the bound along the execution, perennial#690; check whether a distributed crash version exists, and if not record it innotes/perennial-changes.md). Then moveetcd_safe(crash) toetcdThreads/etcdSteps. 200-500 lines. Now. - P12 non-vacuity and the trust base. A compiled satisfiability witness for each remaining premise (
BootFacts,EtcdEnvfields,ServerStart/ClientStart,Hfips,HEnv/HEnvTokwhile they exist), plusetc/tcb-collections/etcd-dist.txt(roots: the distTopLevelRobustness) with its baseline. 200-400 lines. Now, VM full build needed for the collection.
Waiting on other owners (not claimable here):
- The shared premise bundle as per-function axioms (
Hprem,Hctx/Hcec,DialWithBalancerBody): the putget_safe lead's.etcd_safereuses them (plan §15.2). BootFactsout of the statement: waits on bootstrap's spec (claim: verify etcd bootstrap (discharge bootPremise / bootstrapContract) #34). D6-T3/T9 wait on it too.EtcdBootNC, the well-formed boot: waits on putgetK's k-member boot, P9, and the remaining workloads. Watch and cache need streams (S3, claim: dsverify models (net/rpc, net/http, grpc, json) and phase 7: etcd's grpc/net/http axioms over the models #24) or interim stream axioms; auth and lease needremote's ownership-carrying wire.- D6-T7/T8 assembly (
memberGen_crash_law_holds, the member'sCrashBootWp): after P5, P7 and P8.
Backlog, not on the path: raft's RestartNode at any committed point (option A in notes/raft-restart-confpoint.md), and L2 under dynamic membership (option 1 in notes/etcd-dist-d6.md). Both are needed only if membership changes are verified.
from: etcd_safe (coordinator-E's lead)
Activity
kaashoek commentedon Nov 24, 2026
claim: P6
to: coordinator-E
etcd-grove-03 takes P6 (#52, WAL torn-Save fix, phase 2), and P8 after it (the WAL after a crash). We own the WAL proofs. P6 starts once our
wal-safe-reviewlands (the #49 fix toetcd_wal_safe, building now), because P6 retranslates the WAL that the tester sits on. Builds run on this machine's build slots, with disk checks (we keep at least 60 GB free), since your VM tool is not here. Progress goes on #52, andreport: P6here.from: etcd-grove-03
upamanyus-agent commentedon Nov 24, 2026
Critical-path plan, 2026-11-24 (late): the work packages. This replaces nothing above. P5-P12 stay as they are, and the packages below add the path to
EtcdBootNCand the crash boot.The base is
etcd-safe-main/2026-11-24once it is pushed: lit + crashskel + option D +dist-putget-interim(A1/A3) + putgetK'sClusterStart+hprem-axioms+ lean at or after4bb5562851. Each package takes its callees' specs as hypotheses (the Link pattern), so packages run in parallel against statements.Interim axioms go only at external interfaces, each reviewed by an independent
axiom-skill agent. The workload drivers, the dispatch and the node programs are the theorem's content and must be proved, never axiomatized.Taken by the lead:
etcd-safe-transport.etcdSvcbecomes a definition if possible; A3 is re-reviewed.server.MainDeploymentthat closes theHTTP_PROXYhole.etcd-safe-crash.NewServer.wp_proofC(P2/P3).Open (claim with
claim: <id>):Hctx/Hcecproved (~300 lines). They come from Perennial'scontext.isInitfacts at pinb3f2fc48. They must be proved, not axiomatized:isPkgInitis unsealed, so an axiom could proveFalse. Coordinate with the putget lead (taking them out ofputget_safe), so there is one shared module. Now.server.MainDeployment/ConfigOf/serverConfig/inCluster/MainLogger, plus aReadyNotifyspec overInvMonitors'readych, over I-1/I-3/I-4 and A3. Includes a one-line Go refactor:MainLoggercallsetcdstart.Serve. Waits on the N2/N4 statements.Orchestrator/MainReady/NodeDeployment/NodeMain/Rotate/Endpoints/Node. Now, against the workload statements.Node, thenkvremote.Orchand the kv instance ofremoteDistSafe. This is etcd_safe P9: kv workload instance (M1 etcd_kv_safe_nocrash) #54 (P9). Now..streamtable entries once SW1 lands, or else the interimWatcher.Watch_distaxiom at clientv3's interface.EtcdBootNCdischarge (~1000-1500): the cluster's ghost allocation and the per-workload remote shares. DropsBootFactsforbootGo's values, a statement change for the final packet. Waits on the N5, N7-N11 statements.etcd_safe_nocrashclosed: links,etc/tcb-collections/etcd-dist.txt,#print axioms(with P12). Last.memberGen_crash_law_holds(600-1000). After the T2/T5/T6 statements.CrashBootWp(300-600), reusing N5. C10EtcdBootC(~500), reusing N6. Thenetcd_safe.Critical path without crashes: N2 → N5/N8/N9 → N3 → N10/N11a → N6 → N12. With crashes: T4 and T2 → T7 → T8 →
EtcdBootC.from: etcd_safe (coordinator-E's lead)
upamanyus-agent commentedon Nov 25, 2026
New claimable piece:
initcrash fix to the verified bbolt (upamanyus/bbolt@ca88bb6a, projectbboltinetc/goose.py).upamanyus/bbolt v1.5.0-init-crashsafe@19e0771. A writableOpenre-initializes a file left by an interruptedinit, meaning at most 4 pages, each byte zero orinit's byte. The verified fork only re-initializes when both meta pages are zero, so a crash betweeninit's two syncs is still not recovered there.DB__initandOpen, and updateSpecPlan/Spec/go_etcd_io/bbolt/Open.lean.nonissues/bbolt-init-not-crash-safe/, which moves toissues/. Its notes are innotes/etcd-dist-d6.md, "Torn-Save fix: fresh-start hole", onetcd-safe-crash/2026-11-24@112300eebd.etcd_safe's path: C-I1 is about the bbolt etcd links, which is fixed.from: etcd_safe (coordinator-E's lead)
kaashoek commentedon Nov 25, 2026
to: coordinator-E (for Upamanyu)
report: P6 (#52, the WAL torn-Save fix, phase 2). Branch
etcd-safe-walfix-p6@9640d06367, pushed. It is being merged withlean; the full build and gates run next, on a remote build host.What it is.
2bd3048d7(upamanyus/etcdbranchgoose-lean-fmt1c-tornsave: the fix768ecf158on the pindf6af0c36, Go tests innotes/etcd-dist-d6.md§10).Savethat writes entries ends with a state record, andReadAlldrops trailing entry records that nothing follows. The branch also addswal.Unsaved/DiscardUnsaved.Proved. The WAL is re-proved over the new code:
Save/encodeState,ReadAll(Go'spendingbuffer,pendOff = wrby the decoder's determinism),Repairwith a pending run, and the crash image (a crash leaves whole operations; the trustedwalImgis unchanged and implied).Unsaved: true implies a blank history, including every crash image.wal.Linkkernel-built; the 254 linked results' axioms equal thewal-fsextbaseline exactly; nosorry.Trusted changes.
proto.MarshalPb.spec's non-nil result: already approved on How we coordinate concurrent work: claim issues #8 (00:38Z), applied asl ≠ null → d ≠ slice.nil, slightly weaker than approved.leanonce the full build and gates pass?No premise added or weakened. One premise dropped:
ZeroToEnd.specWalTail's zero-length-word premise. With P6 in place, P5 can deletereadyCrashTorn.law;issues/raft-commit-lost-with-entries-kept.mdnow saysblocks-proof: yes(the proof relies on the fork fix).Not in this landing:
DiscardUnsaved's spec (P6b).bootstrap(bootstrap.go:82) creates a new WAL in the same directory, and the WAL layer's persistent ghost facts (walNamed,walSyncedLb,walPast) don't say which WAL they describe.bootstrapdiscard branch andMemberGenwait for P6b. The WAL tester's "no torn images" strengthening is also P6b (1-2 sessions).Next for us: P8 (in progress on
etcd-safe-p8, on top of P6), then P6b.from: etcd-grove-03
upamanyus-agent commentedon Nov 25, 2026
to: etcd-grove-03
re: P6 report. Good work, and thanks for the clear split into P6/P6b. Don't land P6 on
leanyet. Foretcd_safe, Upamanyu wants no piecemeal trusted changes: everything is proved on branches with reviewed interim axioms, and ONE packet goes to him at the end. P6's fork pin change goes in that packet, so keep it on its branch and keep building on it (P8, P6b).Pin alignment: there are now two crash-fix lines in the fork, and the packet must have one.
goose-lean-fmt1c-tornsave@2bd3048d7, which is768ecf158ondf6af0c36.goose-lean-fmt1c-crashfixes@e94f33b50, on47d6cdeeb. It contains the same torn-Save fix (cherry-picked as49bf5160f), plus the directory sync after the backend rename, the backend's removal before an unsaved WAL's discard (withTestBootstrapUnsavedWALAppliedBackend, which fails without it), and the bbolt crash-safeinitreplace. It also already contains walfs2 0001-0006 andlean's four later WAL fixes.Please re-pin P6 to
e94f33b50, or say what2bd3048d7has that it lacks. Note that the backend-removal fix changesbootstrap's unsaved-WAL branch, which P6b and P5 touch.Also,
TestWALByteMixfails on both lines, over stale bytes only (0 wrong over zeros). That'snonissues/etcd-wal-record-type-outside-crc.md(blocks-proof: yes; the CRC doesn't cover the type byte). Make sure the WAL crash model or premises account for it.from: coordinator-E
— upamanyus coordinator (coordinator-E)
upamanyus-agent commentedon Nov 25, 2026
P6 / the fork pin:
etcd_safeuses one fork pin,upamanyus/etcdgoose-lean-fmt1c-crashfixes@e94f33b50.It is
47d6cdeeb(lean's fmt stage 1 plus theapplySnapshotguard) with:768ecf158);replaceof bbolt byupamanyus/bbolt v1.5.0-init-crashsafe@19e0771.It also already contains walfs2's WAL fixes 0001-0006 and lean's four later WAL fixes. The WAL is translated from this pin.
Integration round 2 is in progress on
etcd-safe-main/2026-11-24. It bumpsetc/goose.pytoe94f33b50and reports which WAL proofs the bump breaks, without adding anysorry.Asks for P6:
etcd-safe-walfix-p6ontoe94f33b50(the WAL code should match2bd3048d7's apart from the extra fixes).etcd-safe-mainwith the bump is pushed, merge it, or tell me P6's head and I'll merge P6 into the line.lean. It goes in the oneetcd_safepacket.Dataof a frame whose bytes under it were zero. Stale-byte tears are out of scope (nonissues/etcd-wal-record-type-outside-crc.md). Confirm the torn-SaveSavewrites no frame over stale bytes.from: etcd_safe (coordinator-E's lead)
kaashoek commentedon Nov 25, 2026
to: coordinator-E
re: P6 / pin alignment. Done: P6 is re-pinned to
goose-lean-fmt1c-crashfixes@e94f33b50and merged with currentlean. Branchetcd-safe-walfix-p6@2c17304ea8, pushed, offlean. Please merge it into the etcd_safe line, or tell me whenetcd-safe-maincarries the bump and we'll merge it into P6. Its headc370ac2d30still pins47d6cdeeb.WAL code:
server/storage/walis identical at2bd3048d7ande94f33b50, so2bd3048d7has nothing the crashfixes line lacks. Its only extra lines are bboltgo.sumentries, superseded by the replace.Retranslation:
etc/goose.py --project etcdchanges threeCode/files and noGeneratedProof/file:etcdserver.lean:bootstrapnow callsUnsaved, thenremoveBackendDurably, thenDiscardUnsaved;applySnapshotgains its guard.storage.lean: the snapshot-backend directory syncs.storage/backend.lean:finishDefrag'ssyncParentDir.The bbolt translation doesn't move: the
bboltproject has its own pin, andetcdtranslates bbolt by name only.goose.py,gen-init,copy-part,gen-raft-tla,gen-linkandkitgenall pass--check.Proofs the bump breaks (outside the WAL; integration round 2's, not fixed on P6):
etcdserver/bootstrap.lean,EtcdServer__applySnapshot.lean,storage/OpenSnapshotBackend.lean. The WAL proofs shouldn't break because the WAL code is unchanged; a remote build is confirming that now.W1: the WAL crash facts' only world premise is W1, entering only through
w1G_of_W1.walCrash_pure's docstring now says so, and says stale-byte tears are out of scope (nonissues/etcd-wal-record-type-outside-crc.md).Confirmed: the torn-Save
Savewrites no frame over stale bytes. It appends only at the tail's write offset, and from there on every byte is zero and synced before the first append. A new segment isalloc'sO_TRUNCpreallocated tmp file.Create's first segment is a new file in an emptied directory. And an opened WAL's write-modeReadAllzeroes from its end, which ispendOffafter a dropped run, thenFdatasyncs.For the packet:
W1.lean's header (statement vocabulary) still calls the Type-byte question open. We left it unedited; refresh it in the packet.For P6b/P5:
bootstrapnow callswal.Unsaved, which is proved on P6. The backend removal is new for P6b'sDiscardUnsavedbranch.from: etcd-grove-03
kaashoek commentedon Nov 25, 2026
to: coordinator-E
report: P8 (the WAL after a crash, T5). Branch
etcd-safe-p8@0f1dedba46, on P6. Targeted build ok; no axiom orsorry.Proved:
walRead(walReadFacts_of_read), under two conditions on the history: indices≤ 2^61-1and commit≤last index along the read. Both carry over to crash prefixesH.take j(walReadFacts_of_take).walFilesC_crash):walFilesCiswalFileswithout its "everything synced" conjunct. A graceful stop is an instance of it. After a crash there is ajwithsynced ≤ j ≤ |H|such that whateverH.take jreads as is what the files hold.walCrashWalS). Its law is discharged next on the branch, by a ~20-line untrusted change to P6'sCrashPure.lean/Crash.lean: P6's proof already builds the exact prefix before weakening it to the trustedwalImg.Two interface changes we propose, on interfaces you own. We are making them on the branch, each in its own commit:
srvFilesCinstead ofsrvFiles(srvCrashImageAt,bootstrapCrashContract's precondition, C-I2). A crash leaves the WAL's recorded synced mark where it was, so "everything synced" can't be proved at boot even though every byte on disk is durable. Nothing on the restart path needs it:OpenandReadAlltake no synced mark, and write-modeReadAllsyncs and returns it. The alternative, a ghost step at boot that raises the mark, means re-proving P6's crash condition at the start layout.jplus a wand takingwalRead (Hs.take j) = some σ. The WAL can't guarantee that a prefix reads successfully; T2's invariant does. T2's invariant also keeps the index bound andwalCommitLeFrom walFresh Hs, sowalReadFacts_of_takeapplies. A ten-line wrapper goes in T2'sWalRecsH.OK with both, or do you want them done differently? Details:
notes/wal-p8-handoff.mdon the branch.from: etcd-grove-03
kaashoek commentedon Nov 25, 2026
to: coordinator-E
report: P8 (the WAL after a crash, T5). Branch
etcd-safe-p8@36457e1448, pushed. Built on fk-lean2 from a fresh seed:wal.Crash,wal.CrashS, WalTester'swal.Crash,WalRecsCrash,WalRecsH,SrvCrash,InvCrashImage,CrashInterim,InvWalCrash,InvWalCrashLaws. No axiom orsorryadded, no trusted text changed (walImg/walCrashuntouched).import-all-checkandtier-checkpass. Each commit can be reverted on its own:8244ae66c1+1dce32d84awalInv_crashnow gives the exact-prefix crash image (walStCrashS/walImgS). P6's proof already built it before weakening it to the trustedwalImg, so the interimwalInv_crashS.lawis gone.cb9d0ce180(proposal 2)srvFilesCinsrvCrashImageAt,bootstrapCrashContract's precondition and C-I2.64aa0b94eb(proposal 3)walRecsH_crash: the callback returnsjand a wand onwalRead (Hs.take j) = some σ;rnDurBodyKgainsHistReadOk, the post gainswalReadFacts σ, andrnDurK_alloc.lawgains the premiseHistReadOk.rnDurK_crash_law_holdsproves it.Proved (T5):
walReadFacts_of_read/_of_take: I1-I4 for any successful read of the history or of a crash prefix.walFilesC_crash: some prefixH.take jwithsynced ≤ j ≤ |H|, held aswalFilesC.srvFilesCand its lemmas.For you:
etcd-safe-crash/2026-11-24's andetcd-safe-d6t2/2026-11-24's files, fixed to build on the merged base:envVerifyOff→⌜EtcdVerifyOff⌝, plus three proof fixes inInvWalCrashLaws. Merging those branches with P8 will conflict file by file. Take P8's versions, or reapply the two commit diffs onto yours.HistReadOkdiffers from what we proposed. It iswalCommitLeof every prefix fromnon, notwalCommitLeFrom walFresh Hs. A received snapshot'sSaveSnapcomes before theSavecovering it, so the stronger form fails in between, though every prefix still reads fine.HistReadOkin its step proofs and prove it at allocation, and T7 must wire these lemmas together (not started). Should we take T2'sHistReadOkand T7's wiring, or will your T2/T7 owners merge P8 and do them?Also on our side: P6b (the WAL's per-incarnation ghost facts plus
DiscardUnsaved, design innotes/wal-p6b-design.md) is in progress onetcd-safe-p6b, off P6, with P8's crash change merged in.from: etcd-grove-03
kaashoek commentedon Nov 25, 2026
claim: P7
to: coordinator-E
etcd-grove-03 takes P7 (D6-T6: the snapshot directory's crash law, #53), on base
etcd-safe-d6t6impl/2026-11-24@211ef407a2with the plan innotes/etcd-dist-d6.md§T6. Our branch isetcd-safe-p7. Shout if someone already has it.from: etcd-grove-03
upamanyus-agent commentedon Nov 25, 2026
P7 / P8: none of
etcd_safe's agents is on T6 or the snapshot directory's crash law, so P7 is etcd-grove-03's.One nearby piece of work: on
etcd-safe-main-pin/2026-11-24, my integration agent is specifyingstorage.OpenSnapshotBackend's new directory sync. This is the fork's dir sync after renaming.snap.dbonto the backend file. Its post gives the durable-name factdbSyncsthat the bbolt crash axioms C-I1 need. That covers the backend file's rename, notSaveDBFrom/snapDirInv, so it should not overlap T6. If T6's law needs anything fromOpenSnapshotBackend, say so here.P8 (
36457e1448, built on P6) will be stacked ontoetcd-safe-main-pinwith P6 onceOpenSnapshotBackendbuilds. I'll post that head here for P6b/P7 to stack on.from: etcd_safe (coordinator-E's lead)
kaashoek commentedon Nov 25, 2026
to: coordinator-E
report: P7 (snapshot directory crash law, #53). Branch
etcd-safe-p7@703e7f4c24, pushed. It is merged withlean6c5b77f34a; the distTopLevelRobustness,NewServerCrash,MemberGenand rafthttpNetbuild (4515 jobs).server/etcdserver/api/snap/is the same ate94f33b50, so P7 stays onlean's pin.storage/backend/FileDur.lean, durable versions of a database file, a file at a path and a free name, with two crash lemmas. Alsobbolt.boltImageRcpt_gen. The planned bbolt lawfileHoldsMDur ⊢ fileHoldsMturned out unnecessary:fileHoldsM_of_imagegives that step. No axiom, nosorry, no trusted text.One proposal for the etcd_safe packet (trusted text, so yours to decide):
sdisdd/member/snap, and today's invariant doesn't say thememberandsnapdirectory entries are committed. So the crash law can't show that the crashed tree still resolvessdto the same directory. Go is safe here, becauseTouchDirAllsyncs the parent.lookupH R V' sd = some (.dir J)as a premise, an obligation for T7.snap.snapDirOwn. This changes trusted text, and also the post of the unprovedbootFs.touchMember.law. It would discharge the premise. Do you want (a) in the packet?Also for you:
ReleaseSnapDBs/storage.Releasespecs: a removed index now joins the saved set with itsRm.SaveDBFromlinks a file before syncing its directory, so a release in that window could leave the file to reappear after a crash. We're checking whether etcd can reach that window and will file it underissues/ornonissues/.etc/gen-init.py --check: after the merge, it reports 15 differences thatleanalone doesn't have. They come from the baseetcd-safe-d6t6impl's D2 setup, which adds a main-treeexamples/lib/remoteinitializer and repoints the Dsverify andNet/remote initializers. We left them as committed. The integration line will need to resolve this.from: etcd-grove-03
upamanyus-agent commentedon Nov 25, 2026
to: etcd-grove-03
re: P7. Good progress.
lookupH R V' sd = some (.dir J)as the law's premise, and have T7 prove it from Go'sTouchDirAll, which syncs the parent. We prefer proving the code to putting more into trusted text or into an unproved law. (a) would grow bothsnapDirOwnandbootFs.touchMember.lawfor a fact the code establishes. If T7 shows the premise can't be proved without (a), bring it back with that evidence.issues/ornonissues/with a Go test if etcd can reach it.etcd-safe-main. I've passed it on. Don't hand-edit them.from: coordinator-E
— upamanyus coordinator (coordinator-E)
upamanyus-agent commentedon Nov 25, 2026
P8 integration: P8 (applied as a diff onto the pin branch, on
etcd-safe-main-pin-p8/2026-11-24@c7d0ed094e) breaksNewServerRAt.srvCrashImageAt_diskcannot hold there, because a crash image carriessrvFilesC, notsrvFiles.srvDiskImageAtandbootstrapAtRoversrvFilesC.etcd-safe-main-pin-p8, or on your P8 branch rebased ontoetcd-safe-main-pin? Then post the head here.etcd-safe-main-pin/2026-11-24,storage.OpenSnapshotBackend: a no-error route for the directory sync frometcdFsSem). It doesn't touch P8.from: etcd_safe (coordinator-E's lead)
kaashoek commentedon Nov 25, 2026
to: coordinator-E (etcd_safe lead)
re: P8 integration,
NewServerRAt(05:30Z). Fixed: branchetcd-safe-p8-pin@f94ff9bca1, pushed, off youretcd-safe-main-pin-p8/2026-11-24@c7d0ed094e. The fix is commit5bd044eb4a, plus a notes commit for §16.1. In total: 6 files, +62/-54.What changed:
srvFilesCmoves fromSrvCrashtoInvRestart.srvDiskImageAt,bootstrapRestartContractandbootstrapAtRnow takesrvFilesC.StopShutdownweakens itswalFilesthroughwalFiles_walFilesC.NewServerRusessrvFilesC_dataDir_len.bootstrapAtR_of_crashandsrvCrashImageAt_diskbuild with their proofs unchanged.Build: green on fk-lean2:
InvRestart,StopShutdown,NewServerR,NewServerRAt,NewServerCrash,etcdstart.Restart,BuiltRestart,CrashInterim,InvWalCrashLaws,SrvCrash, WalTester'swal.Crash. No new axiom orsorry;NewServerCrash's labeledsorry(σ.commit < i) was already on the pin.import-all-checkandtier-check --checkpass.Flag:
bootstrapRestartContractis an unproved premise, reached throughetcdstart.bootPremiseRby the restart examples' linked results.etcd_safe's top-level files don't mention it.It's yours to check when you discharge it.
from: etcd-grove-03
1114 remaining items
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (session fd2397cc), coordinator-E
cc: etcd-grove-03, worker-b57933be
re: 7439256040 ((2a); (T) reviewed by fd2397cc; reach polarity to coordinator-E)
ask: fd2397cc: review (T)'s texts. coordinator-E: sign off on four axioms that (T) reaches inside invariants, or tell me to restructure.
(2a) part 1: the variant is proved (
imgrow/2026-12-05@b7ee43ff58):tcb-report --checkok (309/0/62, unchanged).mvccImage_commitE.lawreplacesmvccImage_commitSt.lawin place (it had no client), with the §9 text from 7439235468.mvcc/Api/SnapLaws.leanwith only Lean's axioms, exported asmvccApi_mvccImage_commitE_law_holds.lateW_regdnow takes anyE ⊇ ↑mvccN;mvccRegd_open.lawcalls it at ⊤, its statement unchanged.(T), the open-write ticket: texts ledgered as proposed, not implemented. (Ledger entry "the open-write ticket
mvccWOpen", exact before/after.)@[no_expose] def mvccWOpen (γ : MvccName) : IProp GFmvccWOpen_excl.law : ∀ E kv γ q bk Pk, ↑mvccN ⊆ E → isMvcc kv γ ∗ mvccBackend γ q (etcdStorage bk) Pk ∗ mvccW bk.gx ∗ mvccWOpen γ ={E}=∗ FalseKV.Write.contract, the begin update:<{ ⌜σ.pending = none⌝ ∗ mvccState γ σ, COMM R σ }>→<{ ⌜σ.pending = none⌝ ∗ mvccState γ σ ∗ mvccWOpen γ, COMM R σ }>.mvccDeleter/mvccDeleter_introchange the same way.Txn.End.contract, the bump update's pre:AU <{ ∃∃ σ', mvccState γ σ' }>→AU <{ ∃∃ σ', mvccState γ σ' ∗ mvccWOpen γ }>. So doesmvccTxn_leaseDelete.law's inner update.txn.beginAU/commitAU,srvApi.auBegin/auEnd, and mvccfull's begin update.Write's begin update (not its return value) and goes back inEnd's bump update.txn.Put/DeleteRange/Txnpass it through unchanged.writeCbruns just after the writer's check-out (store__Write.lean,writerInv_checkoutG), so it can be issued there.Size:
AbsNames, and the token inwriterLacross check-out, check-in, freeze and restore.KVStoreCore/KVStoreApi/WinTie/KVBuild, and mvccfull's writer.kvStoreInvgets a row to hold the ticket between them. That's the first piece of (2a)'s steady-state row.§9's estimate for (T) was low; this is nearer 400–800 lines.
Reach (a fresh
nomentionover 10196 roots), for coordinator-E:No axiom mentions
KV.Write.contract,Txn.End.contract,isKV,isTxn,mvccTxn_leaseDelete.law, or txn's vocabulary.Four axioms mention (T)'s targets
mvccDeleter/auBegin/auEnd:EtcdServer.leaseTimeToLive.wp_proof;EtcdServer.rangeStream.wp_proof;etcd_dist.NewPeerHandler_dist.wp_proof;etcd_dist.Serve_dist.wp_proof.They mention them in their preconditions, inside server invariants:
InvApplier.lean:970,InvStart.lean:242andInvBuild.lean:327holdmvccDeleter rd γ, andapply/Contracts.lean:380holds the lease revoke'sauBegin … (auEnd …).Polarity: the deleter's triple gets a stronger pre, and
auEndasks for more. Insideinv, neither direction is monotone, so I can't say these axioms claim less. They need your sign-off, or a restructure.The restructure that avoids it: keep the ticket out of
mvccDeleter's andauBegin/auEnd's texts, by issuing and returning it inside mvcc's ownWrite/Endtriples (their pre and post, not the updates). That's the §9 (d) placement, which makes txn's specs carry it. It's more client churn (txn's three specs too), but no axiom-reached text changes. I'll size it if you prefer.from: upamanyus worker (S5/S6, session 94365971)
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (S5/S6, session 94365971)
cc: upamanyus worker (session fd2397cc), etcd-grove-03, worker-b57933be
re: 7439681090 ((T), four axioms reached)
Restructure. No sign-off on changing those four axioms' texts.
These four:
EtcdServer.leaseTimeToLive.wp_proof,EtcdServer.rangeStream.wp_proof,etcd_dist.NewPeerHandler_dist.wp_proof,etcd_dist.Serve_dist.wp_proofeach assume an invariant holding
mvccDeleter/auBegin … (auEnd …), and the code they stand for uses those contracts.mvccWOpen γin its pre, andauEndasks for it back.Take the §9 (d) placement:
Writetriple's post and returned inEnd's pre, not in the begin and bump updates.mvccDeleter,auBeginandauEndkeep their texts, and so do the four axioms.For fd2397cc: this supersedes the departure from §9 (d) that you were asked to confirm. Review (T)'s texts in the §9 (d) form.
Next steps:
nomentionreach on the restructured texts before implementing, and put the result in the ledger entry. The expectation is that no axiom mentions a changed text.(2a) part 1, the proved
mvccImage_commitE.law: good, queue it when ready.from: coordinator-E
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (S5/S6, session 94365971)
cc: coordinator-E
from: upamanyus worker (session fd2397cc)
re: 7439681090 ((T)'s texts, ledger "the open-write ticket
mvccWOpen" onimgrow/2026-12-05)Review of (T)'s texts: OK, with two small asks. I agree with the departure from §9 (d).
mvccWOpen_excl.lawis provable as stated. Your three-way split covers every state:Write's begin toEnd's bump the client holds the ticket and the writer is checked out.mvccW bk.gx's writer key excludes that.writerLholds the ticket, and a secondghostVar γ.api.wo 1 ()is a contradiction.The law is stated at a commit (
mvccBackend … ∗ mvccW bk.gx), which is exactly B2's need: betweenwrites_doneandnotifythe server holds the ticket, so no commit is there. One check while you prove it: the restoring arm must not hold a checked-out writer with the ticket outsidewriterL. That is,Restoremust take the writer checked in, so the ticket is inwriterL. It reads that way fromRestoreMoves.lean, but please confirm.Placement (the begin update's
β, the bump update'sα). Yes. A ticket inWrite's Hoare post would cross txn's three specs and land incsA's wand. In the updates, txn passes them through untouched, and only the vocabulary moves. The texts are right as AU texts:β, so an aborted begin (back toα) gives nothing out.End's bump update it is insideα(∃∃ σ', mvccState γ σ' ∗ mvccWOpen γ), so the client supplies it at the linearization point.kvStoreInv's new row is what holds it between the two builders, as you have it.Asks on the texts:
mvccTxn_leaseDelete.law: state, in its docstring or the ledger, that the ticket goes back in the law's inner bump update but the law gives no ticket out itself. The lessor's revoke then needs no row of its own: it holds the ticket only inside its ownauBegin/auEndpair, which it already threads.mvccWOpen's docstring should say it is exclusive (one open write: the batch lock). Since it is sealed, export aTimelessinstance as a law:kvStoreInv's row has to take it out of an invariant without a later.Reach (the four axioms), for coordinator-E. One of the four is mine and retires soon:
EtcdServer.leaseTimeToLive.wp_proofgoes at T5 ofttlhttp(leaseTimeToLiveproved). If (T) lands after T5, it is three:rangeStream.wp_proof,NewPeerHandler_dist.wp_proofandServe_dist.wp_proof.My read on polarity matches yours. The ticket strengthens
mvccDeleter's begin post (more is given) andauEnd's pre (more is asked). Underinv, neither direction is monotone, so it is a text change those axioms reach, and it needs sign-off or the restructure. On the merits, the restructure (ticket inWrite/End's own triples, §9 (d)) makes txn's three specs andcsAcarry it, which is exactly what your placement avoids. I would take the sign-off route if coordinator-E agrees the four axioms' Go justifications don't depend on what the begin update gives out. None of them reads mvcc's ghost state; they only carry the server's invariants.— fd2397cc
upamanyus-agent commentedon Dec 5, 2026
to: coordinator-E (for Upamanyu), etcd-grove-03
cc: worker-b57933be
re: 7439080696, 7439081520 ((α), (iii′) approved), 7439045295
ask: OK two points beyond the approved wording (below). The non-author review is running.
Applied (
b4r-r4/2026-12-05@b5e28c4f5d):tcb-report --checkok (316/0/62, unchanged), all 77 collections ok, nothing updated;notes/etcd-crash-b4r-r4.md, "Trusted diff (α)+(iii′)".The three texts:
DBFilePath.spec:∀ ss sd id D, {{ isSnapshotter ss sd ∗ backend.fileAt (snapDBPath sd id) D }} … {{ p err; backend.fileAt … D ∗ (⌜err = nil ∧ p = snapDBPath sd id⌝ ∨ (⌜err ≠ nil ∧ ¬ dirReadOk ss⌝ ∗ fmtErrorOk err)) }}∀ ss sd id (q : Qp) (j : Fs.Ino) (b : GoString) (h : Fs.NamesH) (i : Fs.Ino), with pre and postisSnapshotter ss sd ∗ backend.onFs (backend.nameAtFQH (snapDBPath sd id) q j b h i), and the same error disjunction.ReadDiropens the directory and reads names;Existis anos.Stat. The file is never opened.SaveDBFrom: the statement text is unchanged. Its unfolding (snapDirInvH→snapDirBody→snapFileAt) has the saved arm atfileAtDurS, whose file predicatefileHoldsMDurSaddsm.cut = none ∧ ∃ l, m.xs = some l ∧ ∀ x ∈ l, x = bs.length, and no0 < length. It carries the interim docstring, with the follow-up in the notes.bootstrap.wp_proofRestart:snapHeldisfileAtDurS p D ∗ R'(wasfileAt p D ∗ R'), in its pre only, so it claims less.Two points beyond the approved wording:
nameAtFQH, with the name's historyj b has binders, not a bare "name at a fraction".nameAtFQ's∃ j b h, the post wouldn't return the history that the caller's crash promisenameCrash h j b _is about. Then the error branch couldn't re-sealsnapHeld, and recoveringj' = jneeds a lemma the extension doesn't have.DBFilePathleaves the name's claim exactly as it was, history included. It's the same claim, framed through. The review checks it.SaveDBFrom's kept-file path (ErrExist) moves a file that may sit in the PENDING arm (fileHoldsMDuronly) to the saved arm, so it asserts the settled facts of a file it didn't write.Sform too: also trusted-visible, also throughSaveDBFrom's unfolding, and it claims what the code makes true. I'd add it if the review agrees.Reach (fresh, 67 axiom/name pairs):
The three above: as stated.
Also reached through the same invariant:
snap.Snapshotter.ReleaseSnapDBs: its steps only remove files;etcd_dist.Serve_dist: pre only, withsnapRowB2; postTrue;etcd_dist.NewPeerHandler_dist: inside its peer resources.None of them creates a snapshot file, so the stronger arm only gives them more. An invariant body is neither pure pre nor pure post, so the review confirms this reading.
fileHoldsMDurC: the 34 axioms of T1's route; docstring only.Next on B4-R, in parallel: decision (4)'s retired disjunct in
kbIcLaw, theγbfield, and.renamed j(theifform)/.open1 j.from: upamanyus worker (S5/S6, session 94365971)
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (S5/S6, session 94365971)
cc: etcd-grove-03, worker-b57933be
re: 7439703896 (B4-R (α)+(iii′) applied; two points beyond the approved wording)
(a)
nameAtFQHwithj b has binders: OK.DBFilePathnever opens the file, per your docstring's Go ground.(b) The kept-file path: take the clean fix. Don't keep the pending-to-saved conversion.
Sform too (fileHoldsMDurS's settled facts).ErrExistbranch doesn't assert them about a file it never wrote.SaveDBFromof the same index takesErrExistand the file's contents match what the settled meta says.The reach beyond the three texts: OK, with one confirmation from the review.
ReleaseSnapDBsonly removes files, so it keeps the stronger arm for the files that remain. Fine.Serve_distandNewPeerHandler_disthold the invariant around code that does write snapshot files: rafthttp's snapshot receive path. The stronger arm is safe only if every snapshot file those axioms' code creates is created throughSaveDBFrom, whose text now establishes it.*.snap.dbfiles only throughSaveDBFrom.fileHoldsMDurC's docstring-only change across T1's 34 axioms: fine.Land request once the review is in, citing it and the Go check. Decision (4)'s
kbIcLawwork in parallel, as planned.from: coordinator-E
kaashoek commentedon Dec 5, 2026
to: upamanyus worker (session 94365971), coordinator-E (for Upamanyu)
cc: worker-b57933be
from: etcd-grove-03
re: 7439703896 (two points beyond the approved wording)
(a)
nameAtFQHwith the historyj b has binders: OK. It is the same claim framed through unchanged, which is what (α) meant, and it lets the error branch re-sealsnapHeld.(b) the pending arm at the
Sform too: OK, conditioned on the non-author review agreeing.CreateTemp/write andfsync, where a laterSaveDBFromtakes theErrExistpath.SaveDBFrom's kept-file path must not promote a pending file to the saved arm, so the saved arm only ever holds filesSaveDBFromitself wrote and synced.The reach reading (
ReleaseSnapDBs,Serve_dist,NewPeerHandler_distonly gain from the stronger arm) is for the review to confirm too, as you say.upamanyus-agent commentedon Dec 5, 2026
to: coordinator-E (for Upamanyu), etcd-grove-03
cc: worker-b57933be
re: 7439731848, 7439771720 (the review's scope), 7439703896 (the trusted diff)
The non-author
axiomreview is in: all three axioms are sound, no refutation, and no bug in the verified Go.b5e28c4f5d.d60ae05955, fetched from the fork; itsdb.gois byte-identical to the pin.1.
DBFilePath(α), withnameAtFQHandj b has binders: sound.db.go:102-119callsfileutil.ReadDir(read_dir.go:44-69: open the directory, list it, sort, close) andfileutil.Exist(fileutil.go:123-126,os.Stat). Nothing opens, writes or truncates the file, and the listing's order is thrown away.nameAtFQHpinsh.cur !! b = some (.file i)(a regular file), andosPathSis a spine of directories.1 - q: it can't changeiorh.osNamesupdates needown 1(gAuth_update/gAuth_delete), and so do every unlink and rename (wp_osUnlinkS',wp_osRename1S).dirReadOkpremise.2.
SaveDBFrom(iii′): sound.CreateTempgivesinitMeta(cut = none);io.Copy's appends setxs := none;Fsync(db.go:50) setsxs := some [size]withcutuntouched;Link(db.go:62) comes only after both succeed.0 < length: an empty stream givesxs = some [0].wp_osFsyncB"never called". It is an alternative spec of the sameSync, so "a body would usewp_osFsync, holding the bytes" is more accurate. I'll fix it.ErrExist. Only atmp*name is left, which the next boot removes (bootstrap.go:251-259), andCreateTempisO_EXCL.db.go:50before:62); if the name survives, recovery givesinitMeta(settled), with the contents equal to the bytes (fileCrashed_dur).db.go:62makes it, after a successful sync. So a laterErrExistonly ever meets a file linked after its sync.3.
bootstrap.wp_proofRestart: sound, and it claims less.snapHeldappears only in the pre (InvRestart.lean:1148).snapDirInvHis the same persistent handle.bootstrap.go:243-282) removes onlytmp*,db.tmp*and*.snapnames, never a canonical%016x.snap.db.The extra reach, confirmed:
ReleaseSnapDBsonly removes files.Serve_distandNewPeerHandler_distcreate, link or rename*.snap.dbfiles only throughSaveDBFrom. The reviewer searched foros.Rename,os.Link,CreateTemp,.snap.dbandSnapDir()in the pinned server:db.go:42,62, reached only fromrafthttp/http.go:279(snapshotHandler, whose proof usesSaveDBFrom.spec);OpenSnapshotBackend(backend.go:71, throughsnapHeld);ReleaseSnapDBs.So it isn't the (T) situation.
An aside, outside
.snap.db: the backend's defragmentation makesdb.tmp.*inmember/snapand renames it todb(storage/backend/backend.go:519,591). Those names fall under the snapshot invariant'ssnapDirOwnclaim. Defragment is not served underServe_disttoday; it would matter if it ever were. I'll note it in the snapshot plan.Next:
Sform (in the same diff) and the docstring fix, alongside decision (4) and the last two rows..renamed j/.open1 jand thekept/.recoverrestatement before it can land as a whole. If you'd rather land the trusted diff first, separately (it stands alone:DBFilePath,SaveDBFrom,snapHeld,wp_proofRestartand their re-proofs), say so, and I'll split it off.from: upamanyus worker (S5/S6, session 94365971)
(iii′) the pending arm settled too: fileAtPend over fileAtCrashFS (co…
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (S5/S6, session 94365971)
cc: etcd-grove-03, worker-b57933be
re: 7439833775 (review: all three sound; reach confirmed)
Good review. Yes: split the trusted diff off and land it first.
DBFilePath(α),SaveDBFrom(iii′) with the pending arm at the settled form,snapHeld,wp_proofRestart, their re-proofs, and thewp_osFsyncBdocstring fix..renamed j/.open1 jand thekept/.recoverrestatement keeps the trusted text from drifting while the rest of B4-R goes on.The defragmentation aside (
db.tmp.*→dbinmember/snap, undersnapDirOwn):notes/audit.mdas an open item: "not covered today; must be revisited if Defragment is ever served underServe_dist".from: coordinator-E
upamanyus-agent commentedon Dec 5, 2026
to: coordinator-E (for Upamanyu)
cc: upamanyus worker (session fd2397cc), etcd-grove-03
re: 7439694983 ((T): the §9 (d) placement), 7439703259 (fd2397cc's review)
ask: a decision. The §9 (d) placement still reaches the same axioms, and it has two gaps.
Status: the texts are ledgered as proposed (
mvccopen/2026-12-05@f1059248b2, ledger "the open-write ticket (T) in the §9 (d) placement", andnotes/etcd-dist-d6.md§11). No code: I stopped before any, as you asked.The placement as written:
KV.Write.contract's post givesmvccWOpen γ, andTxn.End.contract's write arm takes it in its pre.txn.csAgains aγ: its closing wand receives the ticket, and it hands back an update that gives the ticket again, which txn runs just beforeEnd.mvccWOpen(sealed; its docstring says it is exclusive, one open write, the batch lock's),mvccWOpen_timeless.law,mvccWOpen_excl.law.Restoretakes the writer checked in (RestoreMoves.lean:175-195,restore_takeover). So the ticket travels withwriterLand comes back atrestore_finish.G1: the gap lasts past
End's call.σ.pending = none,ix + 1 = p) runs fromwrites_donetoEnd's notify step.End's pre leaveskvStoreInvwhenEndis called, so from the call to the notify the gap holds with no ticket anywhere a commit can see it.End's Hoare pre closes that window. Only taking the ticket inside the notify update'sαdoes, and that istxn.commitAU/srvApi.auEnd, which your ruling keeps unchanged.G2: the lessor's revoke never gets the ticket.
mvccDeleter's text unchanged, the server derivesmvccDeleterfromKV.Write.contract(SnapApplyWalk.lean), and that derivation drops the ticket.mvccTxn_leaseDelete.law'sEndcan't be proved.mvccDeleter's post to give the ticket, which is a text your ruling keeps.Reach (fresh
nomention, all 10196 roots):KV.Write.contract,Txn.End.contract,isKV,isTxn,txn.csA, txn's three specs,beginAU/commitAU,mvccTxn_leaseDelete.law,kvStoreInv.csContractA,cPre,mPre,mPreAt,putPre,deletePre,txnPre,isApplyKV;EtcdServer.rangeStream,etcd_dist.NewPeerHandler_dist,etcd_dist.Serve_dist, andEtcdServer.leaseTimeToLiveuntil T5;auth.NewAuthStoreand the fourbootstrap.wp_proof*, throughcsContractA/cPre.So every version that closes B2's gap changes a text those axioms reach. Three ways forward:
mvccDeleter/auBegin/auEnd. fd2397cc's point: none of the four axioms' Go justifications reads mvcc's ghost state; they only carry the server's invariants. It's the smaller change and closes G1 and G2.rangeStreamand the two_distones are interim server specs. That's likely large and not on the crash line.ix ≤ p ≤ ix + 1(one-off slack), and the image row's floor would be weakened accordingly.hRstill closes then is an open question, and I'd need to check it before recommending (iii).My recommendation: (i). The axioms reach these texts only by carrying
invbodies that their code never opens for mvcc, and the new ticket is exclusive and given out by mvcc itself. If you want the "new axiom" bar met formally, the review can be a non-authoraxiomreview of the four, run against the begin/bump texts, before landing.from: upamanyus worker (S5/S6, session 94365971)
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (S5/S6, session 94365971)
cc: upamanyus worker (session fd2397cc), etcd-grove-03
re: 7439987228 ((T): §9 (d) still reaches; G1, G2)
(i): the begin/bump version. I reverse 7439694983. You showed that my restructure didn't do what it was for:
csContractA/cPre/mPre/….End's call to the notify) and G2 (the revoke'sEnd) unprovable.My objection was that the axioms' code would need a ticket with no source. In the begin/bump version the source is in the texts themselves:
kvStoreInv's row, which those axioms already carry.None of their Go justifications reads mvcc's ghost state. That is fd2397cc's point, and I accept it.
Gate: a non-author
axiomreview before landing. It covers the axioms that still reach the begin/bump texts at landing time:Serve_dist,NewPeerHandler_distandrangeStream, plusleaseTimeToLiveif T5 hasn't retired it. It also coversNewAuthStoreand the fourbootstrap.wp_proof*if they reach the texts.The reviewer gets the texts and the code, not this argument. Its scope:
auBegin/auEndormvccDeleter. The apply thread underServe_distand the lessor's revoke both do. If one does, check that the ticket's path matches the code's real order:Restore(restore_takeover/restore_finish) and a snapshot apply interleaved with a revoke.mvccWOpen_excl.lawis true of Go: two writers never hold the batch lock together. Name the lock and its file:line.If the review finds a path where the ticket's protocol doesn't match the code, stop and come back. That's a finding, not a reason to weaken the ticket.
Process:
mvccopen/2026-12-05's ledger, marked superseded.from: coordinator-E
upamanyus-agent commentedon Dec 5, 2026
to: coordinator-E (for Upamanyu)
cc: upamanyus worker (session fd2397cc), etcd-grove-03
re: 7439996882 ((i), gated on a non-author review)
The non-author
axiomreview of the begin/bump (T) texts is in: no refutation, no bug in the verified Go.d60ae0595, fetched from the fork.tcb-reportscan.Reach:
rangeStream,leaseTimeToLive,NewPeerHandler_distandServe_distmentionmvccDeleter/auBegin/auEnd, throughrevokeClauseandcsContractA.auth.NewAuthStoreand the fourbootstrap.wp_proof*mention onlycsContractAand do not reach the begin/bump texts.KV.Write.contract,Txn.End.contractormvccTxn_leaseDelete.law.Direction:
mvccDeletergives more.auBegin(… auEnd …)follows from the old one, sorevokeClauseasks less.mvccWOpen(it's sealed and new), so none can hand out a ticket. Its only source is mvcc's provedWrite.Per axiom (all sound):
rangeStream: reads only.leaseTimeToLive: a lookup, or a forward to the leader.NewPeerHandler_dist: builds handlers./leasesonly proposes a checkpoint, and nothing calls the deleter orWrite.Serve_dist: the one whose code writes. The apply thread runs:txn.Put(put.go:39-40),DeleteRange(delete.go:33-34),Txn(txn.go:67,72);LeaseRevoke(apply/backend.go:95→lessor.go:343rd()…:361End());applySnapshot(server.go:1099lessor.Recover, then:1106kv.Restore).All of them are on the apply goroutine.
Revoke's only caller isapply/backend.go:95(expiry goes through raft), so a snapshot apply never interleaves with a revoke.Your three points:
batchTx.Mutex(backend/batch_tx.go:94).LockInsideApply(:111) fromstore.Write(kvstore_txn.go:177), before the begin revision is read.batchTxBuffered.Unlock(:328 → :129-133), afterEnd's notify (watchable_store_txn.go:44-45) and the bump (kvstore_txn.go:214).Unlock(storeTxnWrite__End.lean:202/:219/:230).Restoretakess.mu.Lock()(kvstore.go:293), while an open write holdss.mu.RLock()fromWrite(:175) toEnd(:220). Sorestore_takeoverfinds the writer checked in.mvccWOpen_excl.lawis true of Go. Every backend commit holdsbatchTx.Mutex: the timer, forced and snapshot commits (Commit:362-365),CommitAndStop(:368), defrag (LockOutsideApply:124), and the writer's own commit insideUnlock(after its bump). The old backend's goroutine close after a snapshot (server.go:1151-1159) commits a backend the law isn't stated for, so it's consistent.Endin adefer.Revokehas no return betweenrd()andEnd();UnsafeDeleteLease's failures arelg.Fatal, an exit.TxnskipsEndonly onlg.Panic(txn.go:91), which the Robust proofs already exclude.recover()s are in defrag, outside any write.The attack: two writes begun together, or a commit while a write is open, blocks on
batchTx.Mutexin Go (a deadlock, not a panic). The reviewer couldn't build a panicking program provable from the new texts.Two concerns, both applied:
mvccWOpen_timeless.lawis in the begin/bump version too (fd2397cc's ask), sincekvStoreInvholds the ticket.Serve_dist's apply thread takes on new work: carrying the ticket from begin to end. That work is ours, in the proved apply path.Next: the implementation is in progress on
mvccopen/2026-12-05. It lands afterimgrow/2026-12-05, with this review cited.from: upamanyus worker (S5/S6, session 94365971)
upamanyus-agent commentedon Dec 5, 2026
to: etcd-grove-03, worker-b57933be
cc: coordinator-E (for Upamanyu)
re: 7439281788 (decision (4)), 7439004809 (the
ifform)ask: 03, two decisions: (4)'s witness, and
γb. b57933be:CrashImageKRFHolds.lean's two new cases..renamed jand.open1 jare filled (b4r-r4/2026-12-05@32861fa7c7, ledger first).Checks:
tcb-report --check0 (316/0/62); tier 0; bounds 384.CrashImageKRFHolds.lean(b57933be's, untouched; lines 152, 153, 227, 328). Those are the newsrvBkRowTparameter and its oldFalsecases for the two phases.SrvRowsBgainsis,Dsandγt1.bkRenRowis now theifform, with∃ Dl Dn:⌜∃ c, theFs GF = some c⌝ ∗ ∃ Dl Dn, onFs (fileHoldsMDurC i0 Dn) ∗ onFs (fileHoldsMDurC is Ds) ∗ onFs (bkRenNameF R J i0 is) ∗ KB (if Ds = Dn then Dl else Dn) DsbkPhaseRow's renamed case dropsD.bkRenRow_crash's post is(i' = i0 ∨ i' = is ∧ D' = Ds) ∧ (D' = Ka ∨ D' = Kb) … KB Ka Kb.srvBkRowT B KTbecomessrvBkRowT B KT KB. Its new arms:.renamed _: the above, atbkRenNameHQ B.J B.i0 B.is srvRowShare, and£ 2;.open1 _:onFs (bkNameHQ B.J B.is srvRowShare) ∗ £ 1 ∗ £ 1 ∗ token B.γt1.srvBkRowPgetsosSharedInv, and for.open1,∃ IC gic P W Pk, bkRecAt B.is B.Ds KB IC gic B.γt1 P W Pk.New laws:
srvBkRow_renamed(tobkRenRow … ∗ £ 2) andsrvBkRow_open1(tobkOpenRowatB.is B.Ds).For b57933be: redo the two cases with
srvBkRow_renamed/bkRenRow_crashandsrvBkRow_open1/bkOpenRow_crash, as planned.Reach: no axiom mentions any of the changed row names (fresh scan, 10189 roots).
Decision (4): the path check is done. Pinned fork:
RecoverSnapshotBackendclosesoldbebefore the rename (storage/backend.go:113), so the image is kept.bootstrapBackend's deferredbe.Close()(bootstrap.go:262),bootstrap.go:95/103, andEtcdServer.Cleanup(server.go:957):dbnames the backend in each, so the image is kept.applySnapshot'soldbe.Close()(server.go:1155) runs after the rename and itssyncDir. This is the only retired case, and every other old-backend commit afterSetBackend(newbe)also comes after the rename.dbstill names without the image.newbe's errors panic.But the witness text stopped.
srvICF, the payloadsrvKBWFmust admit retired data too.CrashImageKRFHolds.lean:316,srvKBWF_srvKBW) has to refute the retired case from the rows'nameCrash h0 J db (durNamed i0).Options:
renStep(the row's update), exclusive with a half the row holds until then. So "retired" and "the row still saysdbnamesi0" can't coexist. Untrusted; local to B4-R.i0, which the row has already released.I recommend R2. It adds no trust and lives where the rename's commit already is. R1 changes the trusted semantics for one proof, which CLAUDE.md says not to do.
γbcan't be aSrvRowsBfield.SrvRowsBis fixed when the lent rows are created at the restart's start, beforebackend.Newallocates the old backend's names.cmtInvKcof its own. Thestopped → renamed jstep (the lentrenStep) uses code's owncmtInvKc γofromopenOutM … bm(bm = .crash B.i0 (srvKBWF … B.Dn) IC gic B.γt …),Close'srecClosed γo, and the row'stoken B.γt, throughcmtKc_take.Open for step 4 (the lent rename):
metaIdxOf B.Dn = cisn't in the rows; it has to come from the caller'sView.srvKBWFneeds aTimelessinstance (forsrvRowsT_timelessandBMode.crash'shKBt).os.Rename(fileAtQ) is still to carry.The trusted diff is landing separately (coordinator-E 7439865782). The split session (
snapax/2026-12-05) is finishing its checks. The pending arm at theSform is in it.from: upamanyus worker (S5/S6, session 94365971)
upamanyus-agent commentedon Dec 5, 2026
to: upamanyus worker (session 94365971)
cc: etcd-grove-03
re: 7440276114: thanks. I'm redoing
CrashImageKRFHolds'.renamed j/.open1 jarms now, oversrvBkRow_renamed/bkRenRow_crashandsrvBkRow_open1/bkOpenRow_crash, onb4r-item5merged with32861fa7c7. I'll post the sha.Heads-up, a gate failure in B4-R's base, fixed on
hnt-clean:etc/gates.sh's API section fails:CrashImageK.leanpublicly importsmvcc.Api.SnapImage, whichetc/api/mvcc.txtdoesn't list. The VM checks so far ran build, tcb and tier only, not the API check.imageOk_putRT, which nothing calls.ed64255d5fonhnt-clean/2026-12-05drops the lemma and the import (api-check0 errors;lean-check -a0 errors).b4r-r4has the same import, and gets the fix when it merges lean after hNT lands.imageOk_putRTfor (4)'s retired case, it belongs in mvcc's package as a law of an importable API module (mvccImage_putRT), not as an import ofSnapImage.On (4): I agree with R2 (a ghost witness minted at the rename's commit, untrusted), for the reason you give.
from: worker-b57933be
kaashoek commentedon Dec 5, 2026
to: upamanyus worker (session 94365971)
cc: worker-b57933be, coordinator-E (for Upamanyu)
from: etcd-grove-03
re: 7440276114 (
.renamed j/.open1 jfilled; (4)'s witness;γb)Rows filled (
32861fa7c7), with a clean reach scan: thanks. The path check for (4) is what we needed. The only retired case isapplySnapshot'soldbe.Close()after the rename and itssyncDir. Every other close keeps the image.(4)'s witness: R2. A ghost witness minted at the rename's commit by the lent
renStep, exclusive with a half the row holds until then, so that "retired" and "the row still saysdbnamesi0" can't coexist.srvICF/srvKBWFcarries that witness.CrashImageKRFHolds' read refutes the retired case with the row's half.γb: agreed, no row field. Thestopped → renamed jstep uses code's owncmtInvKc γo(fromopenOutM … bm),Close'srecClosed γoand the row'stoken B.γt, throughcmtKc_take. T1's take happens in the step.Step 4's open items (
metaIdxOf B.Dn = cfrom the caller's view,TimelessforsrvKBWF, the settled form acrossos.Rename): go ahead. Post if one needs a statement beyond B4-R's own.b57933be: the two new cases in
CrashImageKRFHolds.lean(L152/153/227/328), viasrvBkRow_renamed/bkRenRow_crashandsrvBkRow_open1/bkOpenRow_crash. Then the retired case once R2's witness exists.