feat(cli): standardize Doctor service interface - #21
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughDoctor 0.6.0 standardizes the CLI around a shared manifest, adds stable JSON and lifecycle contracts, introduces authoritative service logs, strengthens self-update and native service reconciliation, and adds packed-bundle and cross-platform fixture validation. ChangesDoctor CLI contract
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/cli/banner.ts (1)
33-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUnify the banner/menu rendering
renderMenuhand-builds the menu, whilerenderBannerWithMenupatchesrenderProductBanner()output with a hard-coded"\nService lifecycle"replacement. That leaves the two paths easy to drift; derive both from one renderer or expose a cli-kit hook for the commands header so the banner doesn't depend on a literal section title.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/cli/banner.ts` around lines 33 - 51, The menu and banner currently duplicate command-rendering logic and rely on a fragile literal “Service lifecycle” replacement. Update renderMenu and renderBannerWithMenu to share a single menu-rendering path, or use an existing cli-kit command-header hook, so both outputs derive command sections from DOCTOR_MANIFEST without hard-coded section-title matching.tests/cli/dispatch.test.ts (1)
328-336: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStale test title: says "logs" but exercises
incidents.This test dispatches
["incidents"], not["logs"], yet is titled "logs prints recent incident lines...". Given this PR's core change splitslogs(Doctor-only, fails closed) fromincidents(fleet incident tail), keeping this misnamed makes future failures harder to triage against the right command contract.✏️ Suggested rename
- it("logs prints recent incident lines, or a friendly empty message", async () => { + it("incidents prints recent incident lines, or a friendly empty message", async () => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/cli/dispatch.test.ts` around lines 328 - 336, Rename the test case around dispatch(["incidents"]) to describe the incidents command and its recent-line output, replacing the stale “logs” wording while preserving the existing assertions and test behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/cli/banner.ts`:
- Around line 33-51: The menu and banner currently duplicate command-rendering
logic and rely on a fragile literal “Service lifecycle” replacement. Update
renderMenu and renderBannerWithMenu to share a single menu-rendering path, or
use an existing cli-kit command-header hook, so both outputs derive command
sections from DOCTOR_MANIFEST without hard-coded section-title matching.
In `@tests/cli/dispatch.test.ts`:
- Around line 328-336: Rename the test case around dispatch(["incidents"]) to
describe the incidents command and its recent-line output, replacing the stale
“logs” wording while preserving the existing assertions and test behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0eda789c-6a48-4b8c-a937-029c5820c4aa
⛔ Files ignored due to path filters (3)
package-lock.jsonis excluded by!**/package-lock.jsontests/cli/__snapshots__/banner.test.ts.snapis excluded by!**/*.snaptests/cli/__snapshots__/standard-interface.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (32)
.changeset/ai-503e26e.md.github/workflows/ci.yamlCHANGELOG.mdREADME.mdpackage.jsonscripts/verify-packed-cli.mjssrc/cli/banner.tssrc/cli/bin.tssrc/cli/command-table.tssrc/cli/context.tssrc/cli/dispatch.tssrc/cli/index.tssrc/cli/self-update.tssrc/cli/service-logs.tssrc/service/argv.tssrc/service/index.tssrc/service/install-guard.tssrc/service/templates.tssrc/telemetry/sqlite-reader.tstests/cli/banner.test.tstests/cli/dispatch.test.tstests/cli/helpers/fake-cli.tstests/cli/lifecycle-commands.test.tstests/cli/self-update.test.tstests/cli/service-logs.test.tstests/cli/standard-interface.test.tstests/compose/registry-reload-reconcile.test.tstests/config.test.tstests/service/argv.test.tstests/service/native-adapter.integration.test.tstests/service/service-module.test.tstests/service/templates.test.ts
👮 Files not reviewed due to content moderation or server errors (8)
- src/cli/command-table.ts
- src/cli/context.ts
- src/cli/dispatch.ts
- src/cli/index.ts
- src/cli/self-update.ts
- src/cli/service-logs.ts
- scripts/verify-packed-cli.mjs
- tests/cli/standard-interface.test.ts
|
Approved Release |
|
✅ Approved — applying the minor bump. The release-gate check will go green; it publishes on merge. |
Summary
registerexemptionValidation
npm run ci— 72 files, 871 tests passednpm run buildnpm run test:packed-clinpm run pack:check— 5 files, no forbidden patterns or source leaknpm audit --audit-level=high— 0 vulnerabilitiesPRD
Implements Doctor adoption for PRD-003 Apiary CLI Interface Standard. Doctor intentionally omits
registerbecause it validates and supervises registry entries written by the other products.Summary by CodeRabbit
New Features
Documentation