feat(cli): add structural-health columns to recipe list#1302
Conversation
Extend `aicr recipe list` with the ADR-009 §4 structural-health view, delegating computation to pkg/health so pkg/cli stays logic-free: - New facade method Client.ComputeHealth wraps health.Compute, binding the client's own DataProvider + version so --data overlays are scored against the same catalog the listing enumerates. - table: add STATUS (rolled-up verdict) and COVERAGE (compact per-phase named-check summary, R:n D:n P:n C:n) columns; non-leaf overlays render "-". - json/yaml: each entry gains an additive `health` block (per-dimension status map + full declared_coverage), omitted for non-leaf overlays. Embedded CatalogEntry carries yaml:",inline" so the NVIDIA#1208 fields stay top-level (yaml.v3 does not auto-inline anonymous fields). Rendering reads the dimension set generically, so an absent constraints_wellformed dimension (NVIDIA#1227) degrades gracefully — the status column still renders. Docs: extend the recipe list section of docs/user/cli-reference.md with the health columns, field descriptions, and real-catalog examples. Closes NVIDIA#1228
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR extends the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Extend
aicr recipe listwith the ADR-009 §4 structural-health view: a rolled-up status column and a compact per-phase coverage summary, delegating all computation topkg/healthsopkg/clistays logic-free.Motivation / Context
Part of the recipe health tracking epic (ADR-009 V1). #1208 delivered the
recipe listenumeration command (criteria/leaf/source columns +--format/filter flags); this adds the health-derived columns on top, without changing #1208's output shape.Fixes: #1228
Related: #1224 (epic), #1226/#1227 (health grading dependencies)
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)docs/,examples/)pkg/client/v1facade (Client.ComputeHealth)Implementation Notes
Client.ComputeHealth(ctx, filter)wrapshealth.Compute, binding the client's ownDataProvider+ version so--dataoverlays are scored against the same catalog the listing enumerates (not the process-global embedded catalog). It follows the sibling facade guard pattern and deliberately omits the per-op timeout sincehealth.Computeapplies its ownHealthComputeTimeout.STATUS(rolled-up verdict) andCOVERAGE(compact per-phase named-check summary,R:n D:n P:n C:n); non-leaf overlays render-.healthblock (per-dimension status map + fulldeclared_coverage), omitted for non-leaf overlays. The embeddedCatalogEntrycarriesyaml:",inline"so feat(recipe): add aicr recipe list subcommand for catalog enumeration #1208's fields stay top-level —yaml.v3does not auto-inline anonymous struct fields the wayencoding/jsondoes.constraints_wellformeddimension (pkg/health: constraints_wellformed signal (parse-only, hermetic) #1227 not yet merged) doesn't break the status column.Testing
Coverage:
pkg/cli64.0% → 67.7%,pkg/client/v175.1% → 75.3% (newComputeHealth81.2%). New tests cover the table/json/yaml formats, the non-leaf-placeholder, filtered-CLI pass-through, the empty-result branch, and a YAML-inline regression guard.This change was reviewed by a multi-persona review pass (Go architecture, CLI/API-contract, test-quality), which caught and fixed a YAML serialization regression before push.
Risk Assessment
Rollout notes: Backwards compatible. The
healthblock is additive (omitted for non-leaf); existing json/yaml/table consumers see no field removals or renames.Checklist
make testwith-race)make lint)git commit -S)