Skip to content

feat(cli): add --verbose/--quiet log-level control; reconcile improve-code-quality#327

Merged
drn merged 1 commit into
masterfrom
reconcile-improve-code-quality
Jun 26, 2026
Merged

feat(cli): add --verbose/--quiet log-level control; reconcile improve-code-quality#327
drn merged 1 commit into
masterfrom
reconcile-improve-code-quality

Conversation

@drn

@drn drn commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

Reconciles the in-flight OpenSpec change improve-code-quality against current master + the backfilled base specs, then ships the one genuinely-remaining item and archives the change.

Finding: the proposal was ~90% already shipped. Verified against current code:

Proposal item Reality
Replace reflection dispatch → explicit registry ✅ Already an explicit []Component slice, no reflect (base spec "Component Registry and Dispatch")
Stop discarding file-I/O errors ✅ Done (Capture warns, linkDirEntries warns, cache handles)
ioutilos/io; remove strings.Title ✅ Zero references remain
Unit tests for pkg/cache, pkg/path, cli/is, cli/link ✅ All four _test.go files exist
go.mod → Go 1.21; go vet + staticcheck in CI ✅ Done
Atomic cache writes; Spotify device IDs via env ✅ Done
--verbose/--quiet flags Implemented here

What this PR ships

  • Log-level control in pkg/log: a Level type, SetLevel/GetLevel, per-function gating, and a new Debug logger emitted only at verbose level (quiet = warnings/errors only).
  • Persistent --verbose/-v and --quiet/-q flags on the root command (--quiet wins on conflict), applied via PersistentPreRun.
  • Unit tests for the gating behavior.

OpenSpec reconciliation

  • Rewrote proposal.md Why/What to stop claiming reflection/ioutil/no-tests and list what already shipped.
  • Reduced the cli-framework delta to the one new requirement (Log Level Control); dropped requirements already present in the base spec.
  • Intentionally dropped "return errors instead of os.Exit" and "Capture returns an error" — these contradict the shipped, now-spec'd "Process-Exit Error Model" and "Command Execution Helpers" base requirements. They're a redesign, not unfinished work; revisit via a separate proposal if desired.
  • Archived the change into specs/cli-framework within this PR (per repo policy).

Verification

go install ./..., go vet ./..., go test ./..., revive, staticcheck, bash .github/skill-tests/run_all.sh (26/26), bash .github/lint-skills.sh, npx agnix@0.13.0 . (0 errors), qlty smells — all green. openspec validate --specs --strict passes. (qlty check's radarlint-go plugin hit an environmental internal LSP error; CI runs qlty with --no-fail.)

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…-code-quality

The in-flight `improve-code-quality` change was largely stale: the installer
registry is already an explicit `[]Component` slice (no reflection), `ioutil`
and `strings.Title` are gone, `go.mod` targets Go 1.21, the four target
packages have unit tests, file-I/O errors are logged, and CI runs go vet +
staticcheck + go test. The only spec-worthy item never implemented was runtime
log-level control.

- Add a `Level` type + `SetLevel`/`GetLevel` and per-function gating to `pkg/log`
  (quiet = warnings/errors only; verbose adds a new `Debug` logger)
- Add persistent `--verbose`/`-v` and `--quiet`/`-q` flags to the root command
- Reconcile proposal/delta/tasks to reality; drop the error-model items that
  conflict with the backfilled "Process-Exit Error Model" base spec
- Archive the change into `specs/cli-framework` (ADDED: Log Level Control)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@drn
drn merged commit d22a36f into master Jun 26, 2026
1 check passed
@drn
drn deleted the reconcile-improve-code-quality branch June 26, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant