feat(cli): add --verbose/--quiet log-level control; reconcile improve-code-quality#327
Merged
Merged
Conversation
…-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>
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.
Summary
Reconciles the in-flight OpenSpec change
improve-code-qualityagainst currentmaster+ 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:
[]Componentslice, noreflect(base spec "Component Registry and Dispatch")Capturewarns,linkDirEntrieswarns, cache handles)ioutil→os/io; removestrings.Titlepkg/cache,pkg/path,cli/is,cli/link_test.gofiles existgo.mod→ Go 1.21;go vet+staticcheckin CI--verbose/--quietflagsWhat this PR ships
pkg/log: aLeveltype,SetLevel/GetLevel, per-function gating, and a newDebuglogger emitted only at verbose level (quiet = warnings/errors only).--verbose/-vand--quiet/-qflags on the root command (--quietwins on conflict), applied viaPersistentPreRun.OpenSpec reconciliation
proposal.mdWhy/What to stop claiming reflection/ioutil/no-tests and list what already shipped.cli-frameworkdelta to the one new requirement (Log Level Control); dropped requirements already present in the base spec.os.Exit" and "Capturereturns 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.specs/cli-frameworkwithin 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 --strictpasses. (qlty check'sradarlint-goplugin hit an environmental internal LSP error; CI runs qlty with--no-fail.)🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com