The check worker (`status/worker.go`) builds the required nix checks of every draft's active version, as a third class of work after batches for ready changes and follow runs on main.
- A draft batch starts only when a complete scan finds no job for a ready change and no follow run to start, and none of either runs.
- When a job for a ready change is queued, running draft batches are stopped as a superseded batch is, whatever slots are free: evaluations share one memory budget. A ready change's batch is never delayed by a draft for longer than stopping takes. A follow run does not stop a draft batch; it waits.
- A draft batch is stopped when a scan finds its head replaced, withdrawn or gone and no active version holds its tree. A draft made ready at the same head keeps its batch, which then counts as a ready change's.
- A draft whose batch failed is not built again until its head or the composed policy changes. That is kept in the worker's private state and survives restarts.
- A draft's evidence is ordinary evidence about the head's tree. It lets nothing land.
- Telemetry says which class each batch was, and tells a batch stopped for a ready change from one stopped because its version moved.
Comments
contributor2026-11-13 01:37 UTC
Independent review of the build at 30e9093 (second model family, 10 minutes). Sent back as a fix round on the same change:
Blocker — project:1023,1089; scan:920. With a draft running, discovering a ready job still leads into assessment of every draft in that project before stopping anything. A draft with an unpublished local ref invokes synchronous publish, delaying ready work through network operations and push retries. Fix: discover ready work across projects first, then preempt and admit it before further draft assessment or publication.
Blocker — stopDrafts:1227; complete:1662. A running draft’s replacement becomes ready; stopMoved first marks the old batch “moved.” stopDrafts skips it because it is already stopped. If attest finished successfully just before the kill, complete publishes synchronously before admitting the replacement. Fix: defer draft publication whenever ready work waits, independently of the recorded stop cause.
Blocker — want:1400; scan:918. Two drafts run: one holds the evaluation budget, the other waits for admission. Readying the waiting draft promotes its batch, but assess returns no job because that destination already runs; consequently stopDrafts never executes. The ready batch waits for the other draft’s full evaluation. Fix: promotion must also trigger preemption of remaining drafts.
Should-fix — want:1400; stopMoved:1205. Promotion changes only the class, retaining the original draft’s change/version identity. If another ready change shares that tree and then advances to a different tree, stopMoved consults the original draft’s identity and leaves the obsolete promoted batch running, potentially occupying the sole slot. Fix: track the ready change/version whose work the promoted batch now serves.
Should-fix — forget:952. A version is seen ready, becomes draft while no batch builds it, then becomes ready again after another change. Stripping the draft suffix preserves its old ready sighting, so it jumps ahead of the intervening ready change. Fix: retain sightings by version and class, dropping the ready sighting when only the draft remains.
Should-fix — scan:930; loop:859. Project app skips drafts while its ready batch runs. During the later project site’s read, reap handles that batch failing; site produces no jobs. The queue is empty, so again remains false and the pass exits, potentially acknowledging its wake despite app’s unread draft work. Fix: require another scan whenever a completion overtakes a scan, even when its resulting queue is empty.
Note — assess:1376,1371. A deferred successful draft ref is published when revisited. If policy adds another required check before that revisit, the old partial ref is published anyway; subsequent scans refuse to extend it. This exposes the existing one-publication limitation. Fix: validate and complete deferred local evidence against current requirements before publishing it.
I found no new state-writing race, hold-key instability, alternate signer/ref path, or landing-gate bypass. Ready and unready updates both trigger wakeHook; a running pass checks the mark independently of --interval, subject to synchronous scan/publication delays.
contributor2026-11-13 02:46 UTC
Second independent review, of the fix round's head 9ade3d4. Sent back as a second fix round:
A blocker remains. Worker line numbers below refer to the attached worker_new2.go.
Original blocker 1: closed. scan:939 and scan:948 stop drafts and skip their assessment when ready work was found.
Original blocker 2: partly closed. complete:1773 ignores the stop cause correctly, but readyWork:1484 sees the previous queue until scan:964. Sequence: a draft’s successful completion is pending; a wake starts a scan; the scan finds ready job R; the next change’s project:1083 calls reap. No ready batch runs and the old queue contains no ready job, so complete:1777 publishes the draft synchronously, delaying R through network operations and retries. Fix: defer draft publication during ready discovery, including completions handled by reap.
Original blocker 3: closed. want:1476 promotes the batch, and scan:939 detects it through gating even without a returned ready job, then stops the remaining drafts.
Original should-fix 4: closed. want:1476 transfers the ready change/version identity that stopMoved:1254 examines.
Original should-fix 5: closed. forget:987 and forget:990 retain sightings by version and class, so an inactive ready sighting is dropped.
Original should-fix 6: closed. scan:969 records an overtaking completion even with an empty queue; loop:870 prevents the premature exit.
Original note 7: the added-check-name case is closed by assess:1442. A should-fix remains in lacking:1498: it validates directory names, not evidence. Sequence: deferred evidence contains check q for attribute checks.old; policy now requires q at checks.new. lacking accepts q, assess:1450 publishes it, and subsequent assessment refuses to extend the worker’s ref. Fix: validate the stored statements against current requirements, including attributes, before publication.
I found no additional regression in failure pruning and incomplete-read guards (project:1090, project:1150, prune:1305), quiet-main/backoff preservation (project:1104, follows:1205), follow queue filtering (scan:957), or forgetting sightings. Completions invalidate settled, preventing drafts from replenishing an overtaken scan; finite work drains without an endless rescan loop.
Note — loop:867 still falls into select at loop:876 when another batch runs. Thus an “immediate” rescan waits for another completion or ticker event. Fix: continue directly when again requires a scan.
For origin, assess:1436 rejects rebuilding an existing worker ref, including during admission’s reassessment. If origin gains the ref after admission, valleyhook/attestation.go:57 rejects any update that changes or removes published notes. There is no remote-note-loss path here.
Should-fix — assess:1443 can lose unpublished local notes: the replacement contains only j.missing, and attest/run.go:304 overwrites the local ref. Sequence: local evidence contains a and b; current requirements are a and c; rebuilding drops b and publishes a,c. If another same-tree version needs b, assess:1436 then prevents extending that ref. Fix: retain valid local notes when constructing the replacement.
Should-fix — project:1082 and push:1822 still delay a newly arriving ready change through the remaining draft assessments and push retries. Ready/unready updates do create wake marks, but these paths do not inspect them. Fix: abandon further draft work and retries on a new mark; an already-running synchronous Git operation still prevents a strict delay bound.
The single biggest improvement is to remove draft publication from complete and admit it only after fresh ready discovery, with pending wake marks taking priority.
contributor2026-11-13 03:32 UTC
Third independent review, of head df8fec2. Sent back as a third fix round, asking for one gate in front of every step of draft work rather than a fix per entry point:
Blocker — project:1099–1102, scan:952/977. The old queue survives into the draft phase. Sequence: R is queued behind stopped draft D; the next scan finds no ready job because R’s policy cannot be read; the first draft’s reap handles D and admits R from the old queue. change then performs draft network reads while R runs. Fix: replace the stale queue before entering the draft phase, and recheck readiness after reap.
Blocker — lacking:1540–1544. cover returns empty coverage when the signer publication is missing or unreadable; lacking treats that uncertainty as missing checks. A valid stored ready ref is unnecessarily rebuilt, potentially failing instead of publishing existing evidence. Worse, a successful draft stores its ref, rescans, fails validation again, and rebuilds indefinitely without build backoff. Fix: distinguish unavailable validation from demonstrated missing or mismatched evidence; defer on the former without rebuilding.
Should-fix — admit:1584. Wake checks cover discovery and publication, but omit admission’s draft reassessments. A readying mark arriving after discovery can therefore wait through every queued draft’s network reassessment and launch. Fix: check yields before each draft reassessment and ensure that yielding there invalidates settled and requests an immediate scan.
Note — loop:870, publish:1823, push:1864. With readable signer information and finite work, several stored refs drain: each successful publication removes one pending ref, and a failed push is skipped during backoff. Neither self-generated marks nor repeated push failure alone creates an endless rescan. Follow runs bypass lacking and retain their existing publication behavior; I found no additional follow regression.
The single most valuable change is making stored-ref validation distinguish “cannot judge” from “must rebuild,” eliminating both the ready-ref regression and the unbounded draft rebuild loop.
contributor2026-11-13 04:14 UTC
Fourth independent review, of head 3f75f24. The ready-first gate holds; the remaining blocker is in publishing a draft's stored ref later:
Blocker — judgeStored:1569,1576; assess:1487–1493. Can invalidate evidence for ready changes. A stored draft ref contains A with an obsolete attribute and valid B; origin already covers current A under a signer whose ref sorts after the worker’s. Only B enters j.missing, so validation permits publication of the whole ref. SelectNotes then chooses obsolete A over valid A, and assess refuses further worker builds because its ref exists on origin. Fix: validate present notes against every j.asked check, while requiring presence only for j.missing. Rebuilding missing checks then removes obsolete A from the unpublished ref. Simply requiring every asked check would introduce a rebuild loop.
Should-fix — admit:1625–1631. Can delay ready work and waste draft work. A readying mark arriving during recheck still permits start: its gate decision predates that network reassessment. Check mayDraft again immediately before start; on refusal retain the remaining jobs and rescan. Other production assessment, reassessment and push paths pass the gate.
Note — scan:977,1003; mayDraft:1532. The scan/count pair is sound: a handled completion invalidates it, and a subsequent scan restores it. With finite work and marks, I found no self-sustaining refusal or spin. The unavailable-validation rebuild loop is closed; the publication blocker above is a different omission.
Note — scan:982; stopMoved:1303. Letting a moved draft finish costs draft resources and follow latency; that delay can be indefinite if the batch never ends. Ready work still preempts it. I found no additional follow-run regression.
The single most valuable change is validating every present required note before publishing a stored ref.
Where this stands: four rounds. The first three each found the ready-first rule broken at another entry point; the single gate (`mayDraft`) closed that class. The defects since are all in one mechanism the fixes introduced: a draft batch that ends while it may not publish leaves its ref stored, and a later scan judges and publishes it. Judging a stored ref against requirements that may have changed is where every recent finding sits.
Simpler rule under consideration, not built: a draft's evidence is published only at the batch's end, and only if the gate allows it then; otherwise the stored ref is dropped and a later scan builds the draft again, which the nix store makes cheap because the check outputs are already built. Drafts then never use the stored-ref path, `judgeStored` goes away, and a ready change's stored ref is handled exactly as before this change.
contributor2026-11-13 20:28 UTC
Not being built further: see the direction change on oc-0f74615. What four review rounds showed: making ready work interrupt draft work has to hold at every step that reaches the network or starts a process (reading, assessing, admitting, pushing, completing), and deferring a draft's publication so it cannot delay ready work creates a second problem, judging stored evidence against requirements that changed meanwhile. A single gate closed the first class; the second was still producing defects at the fourth review.
contributor2026-11-14 02:27 UTC
The change for this knot is withdrawn. Author-requested checks replace it: the host side is on main, and the command is being built under oc-547a848. The lessons from the four review rounds are in the comments above.