Files
seaweedfs/seaweed-block/docs/spec/cuttime/README.md
T
Ping QiuandClaude Opus 5.5 a5686e7fa7 Sync seaweed-block v1.1.1 into seaweed-block/ (#13411)
Brings seaweed-block main (v1.1.1 plus the docs and a test fix after it)
into seaweed-block/ as one commit. Only files under seaweed-block/ change,
and the subtree equals seaweed-block main exactly. The module's full
history stays in the seaweed-block repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 19:04:53 -08:00

82 lines
7.1 KiB
Markdown

# CutTime r8c
The supplied r8c refinement makes foreign-HEAD settlement terminal (NoRetryAfterFence)
and separates inherited recovery from the current invocation's result (OwnResult).
Its exhaustive BFS verdicts are summarized in `verdicts.txt`: 46/46,
four safe configurations, all expected mutant violations and witnesses, no bound.
No new local model run is claimed. Raw model-checker outputs are not kept; earlier
rounds' verdicts are superseded by these.
Projection: `captureManualCut` settles an inherited proposal before calling
`captureInvocationLocked` for its own barrier. Each proposal records its creating
invocation's process-local tag; only that tag's landed proposal can answer this
call. A completed inherited settlement is one sequence/window step, never this
call's result. Failed inherited reads do not renew either. Own-proposal settlement
reads renew and rise only while publication authority is retained. A foreign HEAD
is terminal without renewal: a proved landed proposal returns its result;
otherwise the answer is definite `fenced`, without another publish attempt.
Unanswered settlement ends `outcome_unknown`, never `cut_stalled`.
`TestManualCutForeignHeadFenceTerminatesSettlement` proves authoritative fencing
ends the worker and releases capture without foreign-read sequence renewal.
`TestManualCutInheritedPublicationCannotReplaceItsOwnBarrier` proves the completed
inherited step precedes the new barrier and cannot replace its result.
`TestManualCutPendingProposalsHaveDistinctInvocationTags` distinguishes inherited
and newly uncertain proposals. Landed/unapplied lost-answer, silence and CLI
terminal-unknown controls remain in place. The registered worker follows control
and layer cancellation and joins before close. Native/race qualification is owed.
## Earlier r6 handle projection
The model covers completed own-object steps, per-call deadlines, inactivity
windows, immediate capture-busy refusal, and one admission POST followed by
read-only polling. The running cut belongs to the control lifetime. A holder
restart loses its in-memory identity without claiming that publication failed.
A manual handle survives from admission until its terminal answer has aged
its own Wc. Sending the answer never removes it; a later cut never overwrites
it. Four manual handles per volume bound the implementation. Capacity refusal
is immediate `cut_busy` with reason `handles_full`, with no eviction. Scheduled
cuts have no polling handles. The capacity number is a projection bound;
retention and lost-answer behavior are modeled by Retire and ReplyLost.
The supplied r6 results were 30/30 exhaustive, no bound verdict (superseded by r8c).
Safe configurations explored 18,019, 43,899 and 30,139 states. All 18 mutants
violated their intended invariants; all nine witnesses were reached. These are
supplied results, not a new implementation-side model run. Only provenance
comments and host labels were edited for publication.
Projection: `manual_cut.go` implements Admit, InProgress, Poll, Retire and
terminal observation; the control root cancels and joins admitted workers.
`chunk_manual_cut.go` provides immediate capture admission and Busy identity.
`cut_progress_window.go` counts completed own-object steps without renewing
on reads. `TestManualCutHandlesKeepLostTerminalRepliesUntilTheirOwnWindow`,
`TestManualCutHTTPReturnsHandleAndCloseJoinsWorker`,
`TestManualCutBusyNamesTheRunningCaptureWithoutQueueing` and
`TestManualCutObserverCancellationDoesNotCancelAdmittedWork` cover retention,
restart, cancellation and admission. Native/race and real CLI qualification
remain owed; the PR remains Draft.
Every manual POST enters the handle path; the observe opt-in and synchronous compatibility branch are removed. The CLI only polls after 202 and accepts a v1.0 holder's terminal answer directly. Upload and successful own-object verification completions share the same sequence/window update; `timeoutMs` supplies the observed cut's own window.
Server boundary witnesses: `TestManualCutBusyNamesTheRunningCaptureWithoutQueueing` uses the real provider; `TestManualCutHTTPRetentionUsesUncappedClientWindow` keeps an HTTP handle through a ten-minute window plus slack (a five-minute-retention mutant fails); `TestManualCutServerCloseCancelsCaptureBeforeJoiningSnapshot` closes the actual server while a real snapshot waits behind the observed cut. Both workers join after the shared operation root is canceled.
`TestManualCutRealAdmissionCloseRaceJoinsBothSidesOfReservation` gates the real provider before and after capture reservation, closes the server while admission is registered, and proves the reservation can be acquired again after joining. `TestManualCutRealPostGetReportsPromptOwnProgress` exercises production POST/GET with real uploads, same-id nondecreasing sequence, a prompt initial progress answer, and the terminal result.
Default-route controls: `TestManualCutDefaultPostUsesHandleAndPromptProgress` proves a field-free POST allocates a handle and returns progress. `TestManualCutExplicitDeadlineCancelsTheHandleWorker` proves only the selected absolute deadline ends its owned work. `TestCutCLILegacyTerminalAnswerNeedsNoPolling` proves a terminal answer completes without polling or an opt-in field.
Every cut response carries integer `apiVersion: 1`, including POST progress/terminal/refusal and GET status/unknown-ID answers. Requests accept no version field: there is no negotiation handshake. Compatibility is one direction: a newer CLI supports holders at its own response version N and N-1 (today 1 and 0); an older CLI refuses a newer holder. A valid unversioned synchronous 200 from an initial POST remains the v1.0 fallback; all other missing, malformed or unsupported versions return `unsupported_api_version`, naming the server and CLI versions, without another POST. This is a local protocol refusal and does not establish the cut outcome. An unsupported response always exits 3 (unknown), still typed `unsupported_api_version`: HTTP status cannot prove non-admission. Only a supported, explicit admission refusal can establish failure; no protocol-error path posts again. `TestManualCutAPIVersionCoversEveryCutAnswer`, `TestCutCLINewerClientAcceptsOwnAndOneOlderHolder`, `TestCutCLIOlderClientRefusesNewerHolder`, `TestCutCLIUnsupportedVersionNeverStartsAnotherCut` and the legacy-terminal control cover the boundary. CutTime remains r8c; no persisted format or lifecycle change.
`TestManualCutInheritedSettlementRenewsBeforeOwnWorkExceedsTheWindow` covers
both initial inherited recovery and its retry path: recovery and the own upload
each take 600 ms with W=1 s, while their sum exceeds W. The own barrier sees
sequence 1, then the upload completes with a live window. Removing inherited
progress credit fails both cases; the production worker is restored afterward.
CLI output controls use valid terminal answers (volume, cut position and HEAD
generation). A body at the response limit is relayed whole; an over-limit or
unreceived admission answer remains unknown, since publication may have occurred.
Typed terminal refusals and stdout write failures also report their causes on
stderr. The five `TestOpsChunk_*` output/request controls retain these proofs
under the polling protocol; no transport failure starts another cut.