feat(wait): a run's end, for the background beside a detached run
All checks were successful
Flatpak / check (push) Has been skipped
Flatpak / publish (push) Successful in 6m6s

A run launched detached, as the prepush skill says, tells the session
nothing when it ends: a round finished unread for hours.

`crafter-review wait --artifact <artifact> --hash <hash>`, the two
values of the run line, follows the hash's run lock. A full run holds it
until it ends; taking it, the run now clears the last run's identity
there, and it names itself with its run number once it has one. When a
run the wait has seen hold or take the lock lets it go, the wait reads
the identity - under its own instant shared hold, so never a rewrite in
flight - prints the summary of the final dump of the run the identity
names and exits with the code its verdict maps to, as run's does: 2 when
there is no final dump or no run number, 3 with the message of a
preflight check that stopped the run after it took the lock, which the
run adds to the identity. A wait that sees no run within --appear (120 s
by default) exits 3. Every probe of the lock, a test or dry run's too,
takes it shared for an instant, and the run lock is tried for 200 ms
before another driver counts as its holder. A wait only reads: one that
is stopped is started again and the run goes on.

freeze prints the wait line before the run line, and the skill and the
process start the wait in the background, then launch the run detached.
Released as 1.2.0.
This commit is contained in:
Jorijn van der Graaf 2026-11-02 20:34:01 +01:00
commit 4318c7d8f2
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
15 changed files with 607 additions and 33 deletions

View file

@ -285,11 +285,20 @@ under the 99 % cutoff — at most 128 passes per account, every driver's
counted (`REVIEW_GATES_OAUTH_CONCURRENCY`), and a pass
launches only when its environment's instrument is free and it fits in
free memory (How the passes share the stacks): the driver logs per gate
how many passes of each environment memory and the stacks allow. Run
from the repository root in a detached background shell (`setsid nohup … &` —
a launch bound to a tool call's timeout dies with it) and poll
`~/.cache/review-gates/<hash8>-run-<n>/progress.json`; `freeze` prints the
exact line and writes it to `run-line.txt` — launch from that file verbatim,
how many passes of each environment memory and the stacks allow. Start
the `wait` line freeze prints first, in Claude Code's background mode
(`run_in_background`), then run the run line from the repository root in a
detached background shell (`setsid nohup … > <log> 2>&1 < /dev/null &` — a
launch bound to a tool call's timeout dies with it). Once a run it has seen
hold or take the hash's run lock lets it go, the wait prints the summary of
the final dump of the run the lock names, so the harness reports the end. A
run a preflight check stops before it takes the lock - the check that refuses
a second full run of a live hash among them - never shows: the wait then
follows the live run, or exits 3 after `--appear` (120 s), and the launch's
`<log>` says why. A wait that is stopped can run again without touching the
run; `~/.cache/review-gates/<hash8>-run-<n>/progress.json` shows a run in
progress. `freeze` prints both lines and writes the run's to
`run-line.txt` — launch from that file verbatim,
never retyped (2026-09-29: a hand-copied base cut at 120 columns did not
resolve and nobody noticed for a round).
@ -328,8 +337,12 @@ even though the driver calls it full: say so in the manifest.
Exit 0 SEND-READY = **push-ready**; 1 FIX FIRST; 2 INCOMPLETE / PARTIAL /
CONFIRMING (gates clean, code units still owe clean reads — run the same line
again, see "Three clean reads"); 3 preflight. A whole pass gates its block
passes; coverage is fail-closed per inventory unit (`inventory commits`:
again, see "Three clean reads"); 3 preflight. `wait`'s exit code maps the
reported run's verdict as `run`'s does: 2 for one that left no final dump, 3
for one a preflight check stopped after it took the run lock, and 3 when it
sees no run. A
whole pass gates its block passes; coverage is fail-closed per inventory
unit (`inventory commits`:
`pK:subject`, `pK:msg`, `pK:diffstat`, `pK:<file>#hdr`, `pK:<file>#H`,
`pK:outside`, `pK:absent`, `whole:order`, `whole:absent`,
`whole:behaviour`); per-unit reuse across hashes, salvage of finished

View file

@ -24,8 +24,8 @@ of running it:
```
It refuses on any failed check — fix the commits, never the check. It
prints the hash and the exact run command, also in
`.review-gates/push/<slug>/run-line.txt`.
prints the hash, the wait line and the exact run command, the run command
also in `.review-gates/push/<slug>/run-line.txt`.
3. **The application and the database under test** (when a lens that runs
has the browser — `browser`, `browser+supabase`; the functional lens by
default — or the database — `supabase`, `browser+supabase`; nothing to
@ -47,9 +47,19 @@ of running it:
`supabase.dbUrl` does not answer or its applied migrations are not
HEAD's: reset the stack from the frozen tree, after every
`freeze --replace` too. Do not edit that tree while the run is on.
4. **Gates 1–4**: run the printed command from the repository root in a
detached background shell (`setsid nohup … > <log> 2>&1 < /dev/null &`);
poll `~/.cache/review-gates/<hash8>-run-<n>/progress.json` and `log.txt`.
4. **Gates 1–4**: first run the wait line freeze printed
(`flatpak run net.catcrafts.CrafterReview wait --artifact … --hash …`) in
the background (the Bash tool's `run_in_background`), then launch the run
line from the repository root detached, so no tool call's timeout ends it
(`setsid nohup … > <log> 2>&1 < /dev/null &`). Once a run it has seen hold
or take the hash's run lock lets it go, the wait prints the summary of the
final dump of the run the lock names, so the harness's notice of its end
is a run's. A run a preflight check stops before it takes the lock (a
`--context-paths` that does not exist, a second run of a live hash) never
shows: the wait then exits 3 after `--appear` (120 s), or follows the live
run, and the launch's `<log>` says why. A wait that is stopped leaves the
run alone: run it again; one started after the run's end exits 3 naming
the run the lock names.
Add `--context-paths` for the evidence dirs the messages' claims rest on.
To stop a run: `flatpak run net.catcrafts.CrafterReview stop <its scratch
dir>` (the last word of its gate-0 log), never a kill of a pid — inside
@ -57,7 +67,9 @@ of running it:
FIRST / 2 INCOMPLETE, PARTIAL or CONFIRMING (gates clean, static code units
still owe clean reads of 3 — run the SAME command again on the same hash,
it is the next round, until SEND-READY) / 3 preflight; the dump path is
the last stdout line.
the last stdout line. The wait's exit code maps the reported run's verdict
as `run`'s does: 2 for one that left no final dump, 3 for one a preflight
check stopped after it took the run lock, and 3 when it sees no run.
5. **On FIX FIRST** — per undischarged finding exactly one disposition
(prepush.md §Verdicts): FIX it (amend/rebase the commit in another
worktree, `freeze --replace` into the same dir, restart the application