feat(build): add builder.output (quiet | verbose) for BuildKit's stream
Summary
dash build push and dash build dev forced SSHKit to :debug for the whole build, so every BuildKit line printed with a DEBUG [id] prefix whatever -q said, and no configuration could quiet a build.
This adds builder.output (quiet | verbose), which mirrors hooks_output:
builder.output | CLI flag | BuildKit stream |
|---|---|---|
unset / verbose | none | streamed, as today (same code path) |
quiet | none | not printed; the build report still prints |
| any | -v | streamed |
| any | -q | not printed |
- One private helper,
Dash::Cli::Build#with_build_output, replaces bothDASH.with_verbosity(:debug)call sites (push and dev; pack builds go through the same path). - Nothing is lost in quiet mode. SSHKit hands every line to the interaction handler and keeps it on the command before the formatter decides what to print. So the progress parser still reads it all, and configured output loggers still record every line.
- A failed quiet build raises
SSHKit::Command::Failedcarrying the full stdout/stderr, whichbin/dashprints as the finalERRORline, with exit 1. - Validation:
builder.output: loudfails withbuilder/output: Invalid output 'loud', must be one of: quiet, verbose; bothquietand:quietare accepted. - Documented in
lib/dash/configuration/docs/builder.yml, which also generates the docs-site page.
Behaviour changes to note:
-qnow silences the build stream too (it was overridden before). On CI,dash deploy -qorbuilder.output: quietmeans no output while the build runs, so a job with a no-output timeout needs that timeout to cover the longest build. The docs say this.hooks_output: true,falseor a number now fails config load (Invalid hooks_output 'false', …). Before, a global one was silently ignored and a per-hook one crashed withNoMethodErroronto_sym. The cause is that the validator's type check treats booleans and numbers as strings. This is the same validation pathbuilder.outputmirrors, so it is fixed here.
Closes #216
Test plan
-
test/configuration/builder_test.rb: default nil,quiet/verbose, symbol form,loud, a boolean, a hash -
test/configuration_test.rb:hooks_output: trueand per-hook1are rejected with the level message -
test/cli/build_test.rb: the build's verbosity for all 9 setting × flag rows, for bothpushanddev; a quiet push still prints the build report -
test/cli/build_test.rb: through SSHKit's real local backend with a failingsh, quiet prints no data lines, still feeds the interaction handler and the output log, and the raised error carries the output; verbose streams at DEBUG. Ran 30 times, 30 green. - Mutation: forcing streaming at
:infoturns 3 tests red - Unit suite: 2771 runs, 0 failures. RuboCop is clean on the changed files.
docs/spec/config_docs_spec.rbanddocs/spec/requests/docs_spec.rbare green. - End to end: real
bin/dash build pushwith a fakedockeronPATH- Default output diffed identical to
mainonce command ids and timings were normalised. - quiet and
-qsuccesses printed no DEBUG lines and did print the report. - quiet and
-qfailures printed the full BuildKit log in the finalERRORline, with exit 1. - quiet with
-vstreamed.
- Default output diffed identical to
-
bin/testintegration: not run. Deploy, proxy and boot paths are untouched; CI runs the full suite.
Rigor: critical — fallback: no Rigor line in AGENTS.md → ## Workflow
Validator: PASS WITH NOTES at 104de839 (pass 1 BLOCK at 63817b47, fixed in 104de839)
Validator notes, answered:
- First unit test on SSHKit's local backend: kept on purpose. It spawns only
sh, with no Docker, network or clock, and it is the only proof that a quiet failure carries its output through SSHKit itself rather than a stub. hooks_output: true/false/1now fails load: intended. It is stated above as a behaviour change.-qsilences the build for everyone: intended, since it is acceptance criterion 4. It is stated above.- The docs CI filters on
docs/**only, so it misseslib/dash/configuration/docs/*.yml: predates this PR. The docs specs were run locally (green).
Not verified (validator):
- A real BuildKit failure through
bin/dash: covered only by the fake-dockerrun above. -qwith a failing build on the local backend: proven by the level table, and it shares the same failure path.bin/testintegration.- Ruby 3.2–3.4: CI's matrix covers these.
Effort & cost
| Estimate | Actual | Deviation | |
|---|---|---|---|
| Size | S | S | within |
| Active time | 2–3 h | 1.2 h | −41 % |
| Validation passes | 1–2 | 0 | −100 % |
| Review rounds | 1 | 1 | within |
| Files | 4–6 | 8 (+232 / −6) | +33 % |
Estimate: plan #216.
Wall clock 1.3 h (2026-11-27 21:31 → 22:47 UTC); active 1.2 h, 1.0 h of it before the PR opened and 11 min after. Active leaves out waiting on CI or a review bot and any gap over 10 min.
| Tokens | Calls | Input | of it cache reads | Output |
|---|---|---|---|---|
Main session · claude-opus-5-5 | 90 | 13.5 M | 12.9 M | 46 k |
Advisor, for the main session · claude-fable-5-2 | 1 | 125 k | 0 | 8 k |
| Total | 91 | 13.6 M | 12.9 M | 54 k |
2 commits · 0 review threads · measured from 1 session and 0 agent transcripts on this machine; work elsewhere is not in these numbers.
Where it went: Files ran over because of the hooks_output sibling fix found on the same validation path, and its tests in test/configuration_test.rb. Active time came in under the estimate because SSHKit already buffers each command's output, so quiet mode needed no capture. Two validator passes ran (a BLOCK for an EPIPE-flaky test handler, then PASS WITH NOTES). The table shows 0 because those agent transcripts were not linked to this session.
Deviations & judgment calls
- Judgment call: no rescue-and-
sayon a failed quiet build, though the plan proposed one.SSHKit::Command::Failedalready carries the full log andbin/dashprints it, so an extrasaywould print it twice. This is proven by the local-backend test and the end-to-end run. - Discovery: the validator's type check treats booleans and numbers as strings (
stringish?), sohooks_output: truepassed silently and a per-hook1crashed. Fixed here with tests.builder.output's level check guards the same way. - Deviation: the plan was to special-case
outputin the validator to accept a String or a Symbol. That turned out unnecessary becausestringish?already accepts Symbols. - Judgment call: AGENTS.md routes a new config option through a Plan agent. The issue already carried a
/flow:planbody, so that plan was used. - Validator BLOCK: the local-backend tests' Proc handler returned the array, which SSHKit writes to stdin, so they raced the shell's exit with EPIPE. The handler now returns nil. The same round added the three missing table rows and the CI-timeout note in the docs.
Summary by cubic
Adds builder.output (quiet | verbose) so BuildKit's progress lines can be silenced at the default verbosity; previously builds always streamed at debug, ignoring -q. The setting mirrors hooks_output: -v always streams, -q never does, and builder.output applies only at default verbosity. Quiet builds still feed the progress parser and output loggers, and a failed build's full log still prints in the final error.
Also tightens hooks_output validation: boolean or numeric values previously passed silently or crashed with NoMethodError, and now fail config load with the level message.
Behavior changes
-qnow silences the build stream (it was overridden before); CI jobs with no-output timeouts must cover the longest build.hooks_output: true,false, or a number now raise aConfigurationErrorinstead of being ignored or crashing.