Progress for builds, copies and deploys #22

Open
slop-cannon Bot wants to merge 8 commits from progress into main
pull from: progress

Progress for builds, copies and deploys, in slop and the web app (#21).

Builds on #23 (fixes, tests and demo), #24 (Server-Sent Events) and #25 (the commit in the version), all merged.

  1. progress: Report build, copy and deploy progress
    • The builder runs nix build with --log-format internal-json, and the broker runs its nix copys the same way. NixLog follows Nix's activities into counts: derivations built, paths fetched or copied, bytes, and what's building now.
    • The derivation total comes from Nix's these N derivations will be built message; the totals Nix's activities expect change while it works. Paths whose copy finished are counted too: Nix can stop a copy without counting its last path.
    • Each phase sends ServerMessage::Progress, at most once a second: the build, copy/compare/activate for each node, and the push for slop build.
    • Build logs only stream with --logs. Text from Nix loses its terminal escapes.
    • The builder answers with Reply::Progress frames, then Reply::Done. Protocol 4, so slop and the broker must update together.
  2. slop: Draw progress bars
    • On a terminal, indicatif draws a bar for each running phase below other output (terminal::Board).
    • Remote output can stop mid-line, which bars drawn then would overwrite, so they hide until the line ends.
    • Without a terminal (agents), or with TERM=dumb, where indicatif would draw nothing at all, a running phase gets a plain line every 30 s and one when it ends.
  3. web: Show the progress of running requests
    • runs::Runs tracks requests that build, from the build on.
    • Built on #24's regions: a request's region shows a full-width bar for each phase and a row for each node, whose copy bar fills the table's spare width, and the main page gets a #running region listing running requests with a bar each. The page script needed no change.
    • A request's page reads the audit log again only when the queue changes or a run starts or ends, not with every bit of progress.
    • The finished and failed audit events keep each phase's final line, which the request's page shows afterwards.
  4. test: Check the progress of deploys and builds: plain lines without build logs or escapes, copy counts (2 paths, then 1 path to box), the push's count, and phases in the audit log.
  5. demo: Build the app from slower, bigger parts: twelve parts in three layers, each layer built after the one below, so a build takes about a minute and a half. The parts follow from the version alone, so only a version that hasn't been built before rebuilds them. demo-bump in the agents' VM sets a new version and pushes it on a branch of its own; the demo-bump check runs it against a bare copy of the repository, including from a fresh clone, where the earlier copy-paste steps failed.
  6. progress: Report evaluating apart from building: the build is now two phases. Evaluation ends when Nix starts its first build, fetch or copy (activity types 102 to 105 and 108, the same in upstream and Determinate Nix), which the builder tells the broker with Reply::Evaluated.
  7. progress: Share formatting and phases between slop and the web
    • Times come from humantime and sizes from indicatif::BinaryBytes (now 3.00 MiB), both already dependencies; the web app's copy of the time format is gone.
    • progress::Phases takes over the latest progress of each phase and the node rows from runs::Run, so slop can use them too.
    • A phase's counts and what's running now are written once, for its line, its bar and the web app.
  8. slop: Draw a bar for each node: one bar per node, labelled with its name, through its copy, comparison and activation, saying what it's doing as the web app's rows do (copying, ready, …). It goes once the node is activated or has failed. Bars tick every 100 ms, since indicatif drops draws that come too close together. Tests draw on indicatif's in-memory terminal at stderr's rate and check the screen through a node's steps; without the tick, they fail with the stale bar the demo showed. Agents' lines are unchanged.

Checked:

  • nix flake check, including the VM test and the new demo-bump check.
  • The demo end to end, from a fresh state, with the whole branch:
    • a deploy of a new version from the agents' VM, whose console is a terminal: the build's 15 derivations in about 1m 30s, evaluating first; then the box's single bar through copying (15 paths, 54.00 MiB), ready while the deploy waited, and activating, with the remote's output above it;
    • the same commit again piped through cat, as agents run it: plain slop: lines only, and with nothing to build, evaluated in 0s then built in 0s;
    • slop build packages.x86_64-linux.default: pushed 18 paths (92.27 MiB) and printed the output path;
    • the deploy steps as demo-help gives them, after restarting the agents' VM.
  • The node bars in a pty: labels line up, a compared node shows a full bar and ready while another copies.
  • Real deploys of palace and slop-cannon from nixfiles, through the broker built from this branch.

Not checked: the web app's full-width bars in a browser (signing in needs a passkey).

🤖 Generated with Claude Code

Progress for builds, copies and deploys, in `slop` and the web app (#21). Builds on #23 (fixes, tests and demo), #24 (Server-Sent Events) and #25 (the commit in the version), all merged. 1. **progress: Report build, copy and deploy progress** - The builder runs `nix build` with `--log-format internal-json`, and the broker runs its `nix copy`s the same way. `NixLog` follows Nix's activities into counts: derivations built, paths fetched or copied, bytes, and what's building now. - The derivation total comes from Nix's `these N derivations will be built` message; the totals Nix's activities expect change while it works. Paths whose copy finished are counted too: Nix can stop a copy without counting its last path. - Each phase sends `ServerMessage::Progress`, at most once a second: the build, copy/compare/activate for each node, and the push for `slop build`. - Build logs only stream with `--logs`. Text from Nix loses its terminal escapes. - The builder answers with `Reply::Progress` frames, then `Reply::Done`. **Protocol 4**, so `slop` and the broker must update together. 2. **slop: Draw progress bars** - On a terminal, [`indicatif`](https://crates.io/crates/indicatif) draws a bar for each running phase below other output (`terminal::Board`). - Remote output can stop mid-line, which bars drawn then would overwrite, so they hide until the line ends. - Without a terminal (agents), or with `TERM=dumb`, where `indicatif` would draw nothing at all, a running phase gets a plain line every 30 s and one when it ends. 3. **web: Show the progress of running requests** - `runs::Runs` tracks requests that build, from the build on. - Built on #24's regions: a request's region shows a full-width bar for each phase and a row for each node, whose copy bar fills the table's spare width, and the main page gets a `#running` region listing running requests with a bar each. The page script needed no change. - A request's page reads the audit log again only when the queue changes or a run starts or ends, not with every bit of progress. - The `finished` and `failed` audit events keep each phase's final line, which the request's page shows afterwards. 4. **test: Check the progress of deploys and builds**: plain lines without build logs or escapes, copy counts (2 paths, then 1 path to `box`), the push's count, and phases in the audit log. 5. **demo: Build the app from slower, bigger parts**: twelve parts in three layers, each layer built after the one below, so a build takes about a minute and a half. The parts follow from the version alone, so only a version that hasn't been built before rebuilds them. `demo-bump` in the agents' VM sets a new version and pushes it on a branch of its own; the `demo-bump` check runs it against a bare copy of the repository, including from a fresh clone, where the earlier copy-paste steps failed. 6. **progress: Report evaluating apart from building**: the build is now two phases. Evaluation ends when Nix starts its first build, fetch or copy (activity types 102 to 105 and 108, the same in upstream and Determinate Nix), which the builder tells the broker with `Reply::Evaluated`. 7. **progress: Share formatting and phases between slop and the web** - Times come from `humantime` and sizes from `indicatif::BinaryBytes` (now `3.00 MiB`), both already dependencies; the web app's copy of the time format is gone. - `progress::Phases` takes over the latest progress of each phase and the node rows from `runs::Run`, so `slop` can use them too. - A phase's counts and what's running now are written once, for its line, its bar and the web app. 8. **slop: Draw a bar for each node**: one bar per node, labelled with its name, through its copy, comparison and activation, saying what it's doing as the web app's rows do (`copying`, `ready`, …). It goes once the node is activated or has failed. Bars tick every 100 ms, since `indicatif` drops draws that come too close together. Tests draw on `indicatif`'s in-memory terminal at stderr's rate and check the screen through a node's steps; without the tick, they fail with the stale bar the demo showed. Agents' lines are unchanged. Checked: - `nix flake check`, including the VM test and the new `demo-bump` check. - The demo end to end, from a fresh state, with the whole branch: - a deploy of a new version from the agents' VM, whose console is a terminal: the build's 15 derivations in about 1m 30s, evaluating first; then the box's single bar through copying (15 paths, 54.00 MiB), `ready` while the deploy waited, and activating, with the remote's output above it; - the same commit again piped through `cat`, as agents run it: plain `slop:` lines only, and with nothing to build, `evaluated in 0s` then `built in 0s`; - `slop build packages.x86_64-linux.default`: pushed 18 paths (92.27 MiB) and printed the output path; - the deploy steps as `demo-help` gives them, after restarting the agents' VM. - The node bars in a pty: labels line up, a compared node shows a full bar and `ready` while another copies. - Real deploys of `palace` and `slop-cannon` from nixfiles, through the broker built from this branch. Not checked: the web app's full-width bars in a browser (signing in needs a passkey). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
slop-cannon Bot force-pushed progress from 95f93f02ac to 6c5d782a69 2026-11-28 22:03:25 +00:00 Compare
slop-cannon Bot force-pushed progress from 6c5d782a69 to ebba93b685 2026-11-28 22:33:07 +00:00 Compare
slop-cannon Bot force-pushed progress from ebba93b685 to 5b525bc637 2026-11-29 01:16:47 +00:00 Compare
slop-cannon Bot force-pushed progress from 5b525bc637 to 974cc300cb 2026-11-29 01:28:02 +00:00 Compare
slop-cannon Bot force-pushed progress from 974cc300cb to 56ca551798 2026-11-29 12:31:22 +00:00 Compare
slop-cannon Bot force-pushed progress from 56ca551798 to ce6f8437eb 2026-11-29 13:54:16 +00:00 Compare
slop-cannon Bot force-pushed progress from ce6f8437eb to 2d59b59c59 2026-11-29 14:47:38 +00:00 Compare
slop-cannon Bot force-pushed progress from aa7b73b39c to 831f3a98c4 2026-11-29 18:41:41 +00:00 Compare
dev force-pushed progress from 831f3a98c4 to e7c737e058 2026-11-29 18:47:55 +00:00 Compare
slop-cannon Bot added 2 commits 2026-11-29 19:26:36 +00:00
The builder and the broker run Nix with `--log-format internal-json`
and turn its activities into `Progress` messages for each phase: the
build, each node's copy, comparison and activation, and the push to
the cache. Build logs no longer stream by default, since they're
mostly noise to an agent; `--logs` brings them back, and a failed
build's error still ends with the last lines of its log. Text from Nix
loses its terminal escapes.

The builder now answers with progress frames before its result.
Protocol 4.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a terminal, `slop` keeps a bar for each running phase below other
output, drawn by `indicatif`. Remote output can stop mid-line, which
bars drawn then would overwrite, so they hide until the line ends.
Without a terminal, or with `TERM=dumb`, where `indicatif` draws
nothing, it writes a plain line for a running phase every 30 seconds
and one when it ends, as for agents.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop-cannon Bot force-pushed progress from e7c737e058 to 510d47a590 2026-11-29 19:26:36 +00:00 Compare
slop-cannon Bot added 2 commits 2026-11-29 20:17:51 +00:00
The broker keeps the latest progress of each phase of requests that
build (`runs::Runs`), from the build on. A request's page shows a
full-width bar for the build and a row for each node in its region,
and the main page gets a region of its own listing running requests
with a bar each, both kept current by the page's event stream. A
request's page reads the audit log again only when the queue changes
or a run starts or ends, not with every bit of progress.

The `finished` and `failed` audit events keep how each phase ended,
which the request's page shows afterwards.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploys show progress as plain lines without build logs or escapes,
which only come with `--logs`. Copies count paths and bytes: two paths
to `box` at first, then only the new profile. The push to the cache
counts its closure, and the audit log keeps how each phase ended.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop-cannon Bot force-pushed progress from 510d47a590 to 0fe571e9db 2026-11-29 20:17:51 +00:00 Compare
slop-cannon Bot added 4 commits 2026-11-29 20:38:59 +00:00
The demo's app built and copied in moments, which left nothing for the
progress in `slop` and the web app to show. It now has twelve parts in
three layers, each layer built once the one below it is, so a build
takes about a minute and a half; each part adds a few MiB to copy, and
the box VM has room for them. `demo-help` shows `--logs` too.

The parts follow from the version alone, so a version built before is
already in the builder's store and only evaluates, and a new one
rebuilds them all. `demo-bump` in the agents' VM sets a new version
and pushes it on a branch of its own, and a check runs it against a
bare copy of the repository, including from a fresh clone, as after
the VM restarts.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Evaluating a big flake can take minutes before Nix builds anything,
which looked like a build stuck at nothing. The build is now two
phases: evaluating, until Nix starts its first build, fetch or copy,
and building. The builder tells the broker when evaluation ends with
`Reply::Evaluated`, or after the build when Nix had nothing to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Times are formatted by `humantime` and sizes by `indicatif`, which
were already dependencies, instead of by our own code, and the web
app's copy of the time format is gone. Sizes now have two decimals.

The latest progress of each phase, and how each node is getting on,
move from `runs::Run` to `progress::Phases`, so `slop` can use them
too. A phase's counts and what's running now are written once, in
`Progress`, for its line, its bar in `slop` and the web app.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop: Draw a bar for each node
CI / Check (pull_request) Successful in 5m49s
6bce33dc66
A deploy drew a bar for each phase of each node, so bars came and went
as nodes moved from copying to comparing to activating. Each node now
keeps one bar, labelled with its name, through all three, saying what
it's doing like the web app's rows; it goes once the node is activated
or has failed. Lines for agents are unchanged.

Bars tick every 100 ms: `indicatif` drops draws that come too close
together, which left a stale bar until the next update. Tests draw on
`indicatif`'s in-memory terminal, at stderr's rate, and check the
screen through a node's steps.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slop-cannon Bot force-pushed progress from 0fe571e9db to 6bce33dc66 2026-11-29 20:38:59 +00:00 Compare
All checks were successful
CI / Check (pull_request) Successful in 5m49s
Required
Details
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin progress:progress
git checkout progress
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/slop-broker#22