Show build, copy and deploy progress instead of streaming every build log line, in slop and in the web app.
Why
The builder runs nix build --print-build-logs, and every line streams to the requester. Copies print one line per path.
The 0.3.0 rollout deploy of palace, slop-cannon and castle printed 6,938 lines, nearly all compiler and man-cache output. For an agent that's context spent on noise. For a person it's hard to see how far along a deploy is.
Approvers who approve a deploy in the web app can't see how it's going at all.
Proposal
Events from Nix
The builder runs nix build, and the broker runs nix copy, with --log-format internal-json.
Nix then reports activities: builds and substitutions starting and finishing, with expected totals, and bytes for downloads and copies.
The builder and broker turn these into progress for each phase:
derivations built out of the total
paths fetched or copied out of the total, and bytes where known
the derivation building now
Phases: builder (evaluate and build), copy to <node> (one per node), activate <node>.
Protocol
ServerMessage::Progress { phase, done, total, bytes, current }, sent at most about once a second for each phase. That's protocol 4, so a minor bump.
Activation output still streams in full: when a switch fails, that's what the requester needs.
Build logs stop streaming by default. When a derivation fails, the broker sends the last 100 lines or so of its log.
slop deploy / slop build--logs asks for the full stream, as today.
slop
On a terminal: a one-line bar on stderr for each phase, redrawn in place, for example building 37/120 ▕████▌ ▏ firefox-unwrapped-147.0.
Without a terminal (agents): a summary line every 30 s or so, for example slop: building 37/120 derivations (firefox-unwrapped-147.0), plus a final count for each phase. No control characters.
Web app
A request's page gets a live progress panel while it's building, copying or activating, for the requester's own requests and for approvers.
A bar for each phase, showing done out of total, the derivation building now, and bytes copied.
A row for each node when copying and activating, with its state: waiting, copying, comparing, approved, activating, done, failed.
The phases' elapsed times.
Updates are pushed to open pages over Server-Sent Events or a WebSocket, so the page doesn't poll. It works without JavaScript: the page renders the current state on load.
The pending list shows a compact bar for running requests.
Once a request finishes, its page and the audit history keep the final summary, for example built 12/12 in 4m10s; copied 1.2 GiB to 3 nodes; activated in 40s.
Build in the existing style (templates/, the detail macros), on phones and desktops.
Audit log
Phase timings and totals go in the existing events, not one event per progress message.
To check
How reliable internal-json's expected totals are. "N of M" for derivations and paths is solid. Byte totals only exist for downloads and copies.
Whether nix copy over ssh:// and ssh-ng:// reports progress the same way.
How the builder (a separate process, reached over SSH) passes progress to the broker. Probably progress frames alongside the build log frames it sends now.
Tests
Unit tests for parsing internal-json (recorded samples) and for the summary lines.
The VM test builds something small and checks that progress messages arrive and that logs only stream with --logs.
Show build, copy and deploy progress instead of streaming every build log line, in `slop` and in the web app.
## Why
- The builder runs `nix build --print-build-logs`, and every line streams to the requester. Copies print one line per path.
- The 0.3.0 rollout deploy of `palace`, `slop-cannon` and `castle` printed 6,938 lines, nearly all compiler and `man-cache` output. For an agent that's context spent on noise. For a person it's hard to see how far along a deploy is.
- Approvers who approve a deploy in the web app can't see how it's going at all.
## Proposal
### Events from Nix
- The builder runs `nix build`, and the broker runs `nix copy`, with `--log-format internal-json`.
- Nix then reports activities: builds and substitutions starting and finishing, with expected totals, and bytes for downloads and copies.
- The builder and broker turn these into progress for each phase:
- derivations built out of the total
- paths fetched or copied out of the total, and bytes where known
- the derivation building now
- Phases: `builder` (evaluate and build), `copy to <node>` (one per node), `activate <node>`.
### Protocol
- `ServerMessage::Progress { phase, done, total, bytes, current }`, sent at most about once a second for each phase. That's protocol 4, so a minor bump.
- Activation output still streams in full: when a switch fails, that's what the requester needs.
- Build logs stop streaming by default. When a derivation fails, the broker sends the last 100 lines or so of its log.
- `slop deploy` / `slop build` `--logs` asks for the full stream, as today.
### `slop`
- **On a terminal:** a one-line bar on stderr for each phase, redrawn in place, for example `building 37/120 ▕████▌ ▏ firefox-unwrapped-147.0`.
- **Without a terminal** (agents): a summary line every 30 s or so, for example `slop: building 37/120 derivations (firefox-unwrapped-147.0)`, plus a final count for each phase. No control characters.
### Web app
- A request's page gets a live progress panel while it's building, copying or activating, for the requester's own requests and for approvers.
- A bar for each phase, showing done out of total, the derivation building now, and bytes copied.
- A row for each node when copying and activating, with its state: waiting, copying, comparing, approved, activating, done, failed.
- The phases' elapsed times.
- Updates are pushed to open pages over Server-Sent Events or a WebSocket, so the page doesn't poll. It works without JavaScript: the page renders the current state on load.
- The pending list shows a compact bar for running requests.
- Once a request finishes, its page and the audit history keep the final summary, for example `built 12/12 in 4m10s; copied 1.2 GiB to 3 nodes; activated in 40s`.
- Build in the existing style (`templates/`, the detail macros), on phones and desktops.
### Audit log
- Phase timings and totals go in the existing events, not one event per progress message.
## To check
- How reliable `internal-json`'s expected totals are. "N of M" for derivations and paths is solid. Byte totals only exist for downloads and copies.
- Whether `nix copy` over `ssh://` and `ssh-ng://` reports progress the same way.
- How the builder (a separate process, reached over SSH) passes progress to the broker. Probably progress frames alongside the build log frames it sends now.
## Tests
- Unit tests for parsing `internal-json` (recorded samples) and for the summary lines.
- The VM test builds something small and checks that progress messages arrive and that logs only stream with `--logs`.
Started in #22: progress from Nix's internal-json (protocol 4), bars in slop, and the web app's live panel and running list, with final phases in the audit log. Findings: Nix's activity totals for builds wobble (2 builds showed expected 1–4), so the derivation total comes from the 'these N derivations will be built' message; copy paths and bytes are reliable. Nix already ends a failed build's error with its log tail, so log-lines=100 covers that. Still open: the VM test has no builder, so there's no end-to-end progress test; check on a real deploy after merging.
Started in #22: progress from Nix's internal-json (protocol 4), bars in slop, and the web app's live panel and running list, with final phases in the audit log. Findings: Nix's activity totals for builds wobble (2 builds showed expected 1–4), so the derivation total comes from the 'these N derivations will be built' message; copy paths and bytes are reliable. Nix already ends a failed build's error with its log tail, so log-lines=100 covers that. Still open: the VM test has no builder, so there's no end-to-end progress test; check on a real deploy after merging.
Split the work into three PRs: #23 (builder fixes, deploy and binary cache VM tests, demo fixes and tidying; no protocol change), #24 (pages kept current with Server-Sent Events: HTML regions morphed in with idiomorph, replacing polling), and #22 (progress itself, protocol 4, now stacked on both: indicatif bars in slop, web progress as more SSE regions). Merge order: #23 and #24 in either order, then #22, which I'll rebase as they land.
Split the work into three PRs: #23 (builder fixes, deploy and binary cache VM tests, demo fixes and tidying; no protocol change), #24 (pages kept current with Server-Sent Events: HTML regions morphed in with idiomorph, replacing polling), and #22 (progress itself, protocol 4, now stacked on both: `indicatif` bars in `slop`, web progress as more SSE regions). Merge order: #23 and #24 in either order, then #22, which I'll rebase as they land.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Show build, copy and deploy progress instead of streaming every build log line, in
slopand in the web app.Why
nix build --print-build-logs, and every line streams to the requester. Copies print one line per path.palace,slop-cannonandcastleprinted 6,938 lines, nearly all compiler andman-cacheoutput. For an agent that's context spent on noise. For a person it's hard to see how far along a deploy is.Proposal
Events from Nix
nix build, and the broker runsnix copy, with--log-format internal-json.builder(evaluate and build),copy to <node>(one per node),activate <node>.Protocol
ServerMessage::Progress { phase, done, total, bytes, current }, sent at most about once a second for each phase. That's protocol 4, so a minor bump.slop deploy/slop build--logsasks for the full stream, as today.slopbuilding 37/120 ▕████▌ ▏ firefox-unwrapped-147.0.slop: building 37/120 derivations (firefox-unwrapped-147.0), plus a final count for each phase. No control characters.Web app
built 12/12 in 4m10s; copied 1.2 GiB to 3 nodes; activated in 40s.templates/, the detail macros), on phones and desktops.Audit log
To check
internal-json's expected totals are. "N of M" for derivations and paths is solid. Byte totals only exist for downloads and copies.nix copyoverssh://andssh-ng://reports progress the same way.Tests
internal-json(recorded samples) and for the summary lines.--logs.Started in #22: progress from Nix's internal-json (protocol 4), bars in slop, and the web app's live panel and running list, with final phases in the audit log. Findings: Nix's activity totals for builds wobble (2 builds showed expected 1–4), so the derivation total comes from the 'these N derivations will be built' message; copy paths and bytes are reliable. Nix already ends a failed build's error with its log tail, so log-lines=100 covers that. Still open: the VM test has no builder, so there's no end-to-end progress test; check on a real deploy after merging.
Split the work into three PRs: #23 (builder fixes, deploy and binary cache VM tests, demo fixes and tidying; no protocol change), #24 (pages kept current with Server-Sent Events: HTML regions morphed in with idiomorph, replacing polling), and #22 (progress itself, protocol 4, now stacked on both:
indicatifbars inslop, web progress as more SSE regions). Merge order: #23 and #24 in either order, then #22, which I'll rebase as they land.