feat: progress counters, timing, and --dry-run for shll update and install#16
Merged
Merged
Conversation
…stall Add four additive output-polish features to BOTH `shll update` and `shll install`, building on the per-tool-output framing (change y630): 1. Progress counters `[N/M]` in the per-tool header. The denominator M is computed up front (update: installed roster tools + 1 if shll itself is brew-installed; install: len(missing)). `shll (self)` counts as [1/M] and prints first. 2. Section spacing — a blank line before each tool section after the first, and before the summary tail, so streamed sub-tool output is visually separated. 3. Wall-clock run duration in both summary-tail forms (success and partial-failure), via an injectable clock seam (clock.go) mirroring the proc.Runner injection pattern so golden-string tests stay deterministic. Duration is a run fact, not an outcome claim — the existing honesty constraint (never "updated" vs "up-to-date") is preserved. 4. A `--dry-run` flag on both commands that previews exactly what would run (aligned-column per-tool argv, built from the same dispatch upgradeTool uses) and exits with no side effects. Read-only probes still run; no brew update/upgrade/install and no `<tool> update` is executed. ui.go (printToolHeader, printSummaryTail) is extended and gains the aligned-column preview helpers; clock.go is new. Constitution-safe: no new top-level subcommand (--dry-run is a flag), all execution still routes through internal/proc, and ui.go/clock.go stay presentation/seam-only. version and shell-init are out of scope.
There was a problem hiding this comment.
Pull request overview
This PR improves the user experience for the long-running, streamed-output workflows of shll update and shll install by adding progress signaling, run timing, and a safe --dry-run preview mode, while preserving the existing “frame around subprocess output” model.
Changes:
- Add
[N/M]progress counters and consistent blank-line section spacing between tool sections and before the summary tail. - Append wall-clock elapsed time to the success and partial-failure summary tail lines via an injectable clock seam (
nowFunc). - Add
--dry-runto both commands to preview the exact planned commands (aligned columns) while still performing only read-only probes and executing no writes.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/cmd/shll/update.go | Adds --dry-run, computes [N/M] upfront, adds section spacing, measures elapsed time with nowFunc, and centralizes per-tool argv building for live run + preview. |
| src/cmd/shll/update_test.go | Updates goldens for counters/spacing/duration and adds dry-run preview + no-writes coverage with deterministic clock injection. |
| src/cmd/shll/install.go | Adds --dry-run, prints [N/M] headers with spacing, measures elapsed time with nowFunc, and prints aligned install previews. |
| src/cmd/shll/install_test.go | Updates goldens for counters/spacing/duration and adds dry-run preview + no-writes + counter correctness tests with deterministic clock injection. |
| src/cmd/shll/ui.go | Extends header/tail helpers to include counters and elapsed duration; adds aligned preview-printing helpers shared by update/install. |
| src/cmd/shll/ui_test.go | Updates header/tail unit tests and adds unit tests for duration formatting and preview alignment. |
| src/cmd/shll/clock.go | Introduces a package-level injectable clock seam (nowFunc = time.Now). |
| src/cmd/shll/clock_test.go | Adds a deterministic clock test helper and sequencing test. |
| docs/memory/cli/update.md | Documents the new counters/spacing/duration behavior and the --dry-run contract for shll update. |
| docs/memory/cli/install.md | Documents the mirrored behavior and --dry-run contract for shll install. |
| docs/memory/cli/commands.md | Updates command/file-layout docs to reflect the extended UI helpers and new clock seam. |
| fab/changes/260604-6vuo-update-install-polish-dry-run/* | Adds the change’s intake/plan/status/history artifacts for traceability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meta
Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr
Impact: +735/−99 code (excluding
fab/,docs/) · +1547/−117 totalSummary
shll updateandshll installare long, side-effectful, multi-tool runs the user starts and then watches. This change polishes the existing live-streaming model (no TUI, no capture-and-reframe, no new dependency) with progress signal, post-run timing, and a safe read-only preview — the biggest DX/anxiety-reduction lever being a--dry-runthat shows exactly what would happen before committing to it.Changes
Four additive features, applied to both
updateandinstall:[N/M]in each per-tool header. The denominatorMis computed up front (update: installed roster tools + 1 if shll itself is brew-installed; install:len(missing)).shll (self)counts as[1/M]and prints first, so the counter agrees with the summary tail's total.Done — N of M tools succeeded in 1m12s.and partial-failureX succeeded, Y failed in 1m12s — see above.(duration before the em-dash). Timing is driven by an injectable clock seam (clock.go, package-levelnowFuncmirroring theproc.Runnerinjection pattern) so golden-string tests stay deterministic. Duration is a run fact, not an outcome claim — the existing honesty constraint (the tail never claims "updated" vs "up-to-date") is preserved.--dry-runflag on both commands. It previews exactly what would run — aligned-column per-tool argv built from the same dispatchupgradeTooluses — then exits with no side effects. Read-only probes still run (brew list,<tool> update --help); nobrew update/brew upgrade/brew installand no<tool> updateis executed. Only actionable tools are listed (update skips uninstalled tools, install skips already-installed ones); empty cases print the existing nothing-to-do messages.ui.go(printToolHeader,printSummaryTail) is extended and gains the aligned-column preview helpers;clock.gois new.Why this is constitution-safe
--dry-runis a flag on two existing commands. The "could this be a flag?" test is satisfied.internal/proc.--dry-runstrictly reduces execution.ui.goandclock.gostay presentation/seam-only (no subprocess calls).proc.RunForegroundstreaming model is preserved — shll still only frames around each sub-tool's output, never capturing or reframing it.Test coverage
Full
cmd/shllpackage is green, race-clean, and vet-clean. New/updated tests cover:[N/M]counters in both header forms and counter correctness for partial-install scenarios (update and install).in 1m12sin both tail forms; honesty assertions still pass.brew update/brew upgrade/brew install/<tool> updateare NOT), and the empty-case messages.