Skip to content

Add nh checklist - #38

Open
lawik wants to merge 2 commits into
mainfrom
feature/checklist
Open

lawik wants to merge 2 commits into
mainfrom
feature/checklist

Conversation

@lawik

@lawik lawik commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Prints a product's utilization report from the server: how its devices authenticate, the recommended features in use as a score, and optional ones. Supports --verbose, --color and -o json, and says so when the server is too old to have the report.

Prints a product's utilization report from the server: how its devices
authenticate, the recommended features in use as a score, and optional
ones. Supports --verbose, --color and -o json, and says so when the
server is too old to have the report.

Claude-Session: https://claude.ai/code/session_012eH1p6xCoKP74cPEdpGiXX
@lawik
lawik requested a review from joshk November 26, 2026 20:16
@u7d-bot

u7d-bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Rummager review of 80284583bb

Sensitive areas: none touched.

Pass with warnings: 3 warnings, 1 suggestion.

  • Correctness: 1 finding, inline at cmd/checklist.go:186-190.
  • Code quality: 1 finding, inline at cmd/checklist.go:125-126.
  • Prose, comments and docs: 2 findings, inline at README.md:328-330, cmd/checklist.go:44-48.
  • No findings: Security.

The inline comments are in this review.

Screenshots of the UI changes, before and after (3 views)

Default checklist report in colour

Before After
Before After

Before the PR nh checklist is an unknown command. After, it shows the bold header with the (5/13) score, Shared Secret in orange, LocalCert in green and NervesKey 0 dimmed, the coloured marks, and doc links only under recommended features that are todo or attention.

Verbose checklist report

Before After
none After

With --verbose every feature, the optional ones included, gets a dimmed description and doc link indented under it; there is no before because the command does not exist on base.

Older server message

Before After
none After

This is the upgrade error printed when /utilization returns 404 but the product itself is found; base has no such command, so there is no before.

  • Note: There was no NervesHub server to use, so the real nh binaries (built from base and head) talked to a small local mock API serving a made-up thermostat report (4 Shared Secret / 124 LocalCert devices). The coloured --color always output was then drawn in an HTML terminal window for the screenshot.

rummager · prompts 885379605730 · automated, verify before acting.

@u7d-bot u7d-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline findings for 80284583bb. The summary is in the rummager comment.

Comment thread README.md Outdated
Comment on lines +328 to +330
- opens with the score (recommended features in use, such as `(5/13)`) and how
the product's devices authenticate: `Shared Secret` in orange, `LocalCert`
and `NervesKey` in green

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING] The README ties each colour to an authentication method, but authMethods colours by the server's level and device count. Prose, comments and docs · definite

In authMethods, a method with 0 devices is dimmed, so the NervesKey 0 in the test fixture is not green. A shared secret whose server level is good (each device has its own secret, per the UtilizationAuthMethod.Level comment) prints green, not orange.

Suggested change
- opens with the score (recommended features in use, such as `(5/13)`) and how
the product's devices authenticate: `Shared Secret` in orange, `LocalCert`
and `NervesKey` in green
- opens with the score (recommended features in use, such as `(5/13)`) and how
the product's devices authenticate: a method to move away from, such as a
secret shared by the whole product, in orange, the others in green and unused
ones dimmed

Comment thread cmd/checklist.go Outdated
Comment on lines +44 to +48
It opens with the score, the recommended features in use out of those the
server offers, and how the product's devices authenticate: a shared secret is
marked as one to move away from, and certificates (LocalCert, NervesKey) as
where to be. Then each recommended feature, and after those the optional ones,
which are situational and don't count towards the score.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING] The help text says a shared secret is always marked as one to move away from, but the server rates per-device secrets good. Prose, comments and docs · likely

This assumes the UtilizationAuthMethod.Level comment matches the server: it says a shared secret is good when each device has its own secret. In that case the CLI shows the method as fine, which this help text contradicts.

Suggested change
It opens with the score, the recommended features in use out of those the
server offers, and how the product's devices authenticate: a shared secret is
marked as one to move away from, and certificates (LocalCert, NervesKey) as
where to be. Then each recommended feature, and after those the optional ones,
which are situational and don't count towards the score.
It opens with the score, the recommended features in use out of those the
server offers, and how the product's devices authenticate: a secret shared by
the whole product is marked as one to move away from, and certificates
(LocalCert, NervesKey) or per-device secrets as where to be. Then each
recommended feature, and after those the optional ones, which are situational
and don't count towards the score.

Comment thread cmd/checklist.go
Comment on lines +186 to +190
recommended := itemsIn(report.Items, api.UtilizationGroupRecommended)
fmt.Fprintf(&b, "\n%s %s\n",
style.paint(ansiBold, "Recommended"),
style.paint(ansiDim, fmt.Sprintf("(%d/%d)", doneCount(recommended), len(recommended))))
writeItems(&b, recommended, width, style)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[WARNING] The Recommended section's (done/total) uses len(recommended) as the total, so it counts unavailable items that the headline score leaves out. Correctness · likely

The code's own docs say an unavailable feature is not available on the server and is not scored. With the test fixture this prints Recommended (1/3) even though only 2 of those features can be adopted, so the section suggests the product is further behind than the headline score does. Divide by the number of recommended items whose status isn't api.UtilizationUnavailable (giving (1/2) here) and update the expected test output to match.

Comment thread cmd/checklist.go Outdated
Comment on lines +125 to +126
f, ok := w.(*os.File)
return ok && term.IsTerminal(int(f.Fd())), nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SUGGESTION] useColor writes its own terminal check for stdout instead of reusing the existing stdoutIsTerminal helper in cmd/login.go. Code quality · definite

stdoutIsTerminal already does this check, and tests can replace it. Because useColor has its own copy, no test can reach the --color auto branch that colours terminal output or check that NO_COLOR turns colour off. Pass cmd instead of w and call stdoutIsTerminal(cmd) here, then add a test for terminal output under auto and one for NO_COLOR.

u7d-bot added a commit to lawik/rummager-screenshots that referenced this pull request Nov 26, 2026
u7d-bot added a commit to lawik/rummager-screenshots that referenced this pull request Nov 26, 2026
u7d-bot added a commit to lawik/rummager-screenshots that referenced this pull request Nov 26, 2026
u7d-bot added a commit to lawik/rummager-screenshots that referenced this pull request Nov 26, 2026
- The Recommended section's total leaves out features the server can't
  offer, as the score does.
- --color auto uses the shared stdoutIsTerminal check, with tests for a
  terminal, a pipe and NO_COLOR.
- The help and README describe authentication colours as the server
  rates them: per-device secrets are fine, unused methods are dimmed.

Claude-Session: https://claude.ai/code/session_012eH1p6xCoKP74cPEdpGiXX
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.

2 participants