gunk-dev/the-valley
the-valley:oc-47c7c33outcomedone

The queue walker runs each step's review in-process

State
done
Created
2026-11-10 by contributor
Blocked by
Blocks
Changes
  • valley:the-valley/rmqxwlsvyxuutwpusuuzqwoqnslloukm

Body

The queue walker runs each step's review as a child process: `$VALLEY_COMMAND review <change ID>` in the step's repository root, with `VALLEY_WALK_QUEUED` and an outcome file, `VALLEY_WALK_OUTCOME`.

Outcome: the walker calls review as a function, with a git handle on the step's repository, the queued version as a value, and the outcome returned as a value. The child contract is deleted.

This needs, at least: cancellation that returns an outcome instead of exiting the process (approve exits through `exitWith` today); signer verification read per repository, not once at start; every process run with its directory set, never `os.Chdir`; and one telemetry record per step, attributed to its project.

Done when the walk's CLI tests pass without changing what they assert, and new tests cover Ctrl-C in a step's pager and during an approval, and two successive steps in different repositories.

Comments

  1. contributor2026-11-10 01:43 UTC
    What the single-change port found the in-process call will need:
    - **Signals:** one owner per step. Today the walker's SIGINT catch and review's handler both register, and review takes over the process-wide `exitWith`.
    - **Signer verification:** the `verification` global is resolved once per process, from the current repository's published signers. A step in a cache clone needs its own.
    - **Directories:** review runs git through `g.dir`, but runs `sh`, less and the checks line in the process's working directory. Those need `Dir` set to the step's repository.
    - **Telemetry:** each step's untimed `command` record has to be emitted explicitly, and `producerStamp` stays process-wide.
    - **SIGTERM** is two cases: sent to the PID, or to the process group. A Go process can't tell them apart, so matching today's behaviour depends on which signals each nested handler listens for.
  2. contributor2026-11-11 00:54 UTC
    Refined before the build: an interrupt always ends the walk, so it may still end the process, through one interrupt path the walker hands each step (the step's cleanup, the walk's summary so far, the command records, exit 130), passed in the step value instead of the process-wide exitWith. Every other ending, errors included, returns its outcome as a value so the walk goes on. This avoids unblocking a read on the terminal. Signals keep today's arrangement (review listens for INT, TERM and HUP; approve watches INT inside it), with one handler acting per signal. Single-change review tests that read the outcome file keep their CLI assertions, and their outcomes move to Go tests on real repositories, since most review plain branches a walk never queues.
  3. contributor2026-11-11 23:08 UTC
    Change valley:the-valley/rmqxwlsvyxuutwpusuuzqwoqnslloukm landed: v3 as 499d9e61dfee38d5c723ed14b799ee031b7522c5.
    
    Every change the knot links has landed and it has no active children, so klaus set it done.