fix(tooling): build first, then start the app, then list it

The notes had agents start `crafter-build <flag> -r` in the background
and run `crafter-debug ls --wait 60s` straight after. That raced the
build: the first agent to follow them ran the plain build's stub, which
said "no debug build yet" and exited, since the client `ls --wait` needs
is one of the things the debug build compiles, and it polled by hand
until the build was done.

The race came from the order, so the order changes: build with the flag
in the foreground, which ends once the app and the client are built,
then start the app with -r in the background, then `ls --wait`, which
now only waits for what it is for, the app registering. A launcher that
polls for the build instead was tried and dropped: a shell loop that
reruns itself each second, and waits out its whole --wait when no build
is coming at all.

The consumer notes, the client's guide and the README say so, and the
stub and the not-yet-built launcher name the step that was skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jorijn van der Graaf 2026-11-01 18:24:35 +01:00
commit 8e7f8c5f3b
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
4 changed files with 14 additions and 10 deletions

View file

@ -974,13 +974,15 @@ memory are a debugger's job; `crafter-debug debugger` prints how to attach one.
## The loop
1. Build and start the app from its debug build, in the background (it does
not exit): `crafter-build --debug-api -r` (use the project's own flag).
2. `./build/crafter-debug ls --wait 60s` until it is listed.
3. `cmds` and `help <command>` to see what it offers, `get '*'` for its state.
4. Act and observe: `call`, `set`, `pause --when`, `wait`, `step`, `trace`,
1. Build with the debug flag, in the foreground: `crafter-build --debug-api`
(use the project's own flag). That build compiles this client too.
2. Start the app in the background, since it does not exit:
`crafter-build --debug-api -r`.
3. `./build/crafter-debug ls --wait 60s` until it is listed.
4. `cmds` and `help <command>` to see what it offers, `get '*'` for its state.
5. Act and observe: `call`, `set`, `pause --when`, `wait`, `step`, `trace`,
`log --level warn`, `screenshot` (open the PNG it prints with Read).
5. `quit` when done. Killing the background task may leave the app running
6. `quit` when done. Killing the background task may leave the app running
if crafter-build's alias lacks --die-with-parent; `ls` shows leftovers.
## Commands