Skip to content

fix(cli): show every discover entry field in text output - #6521

Merged
josephfarina merged 1 commit into
mainfrom
cli-spec/integrations-discovery/discover-text-fields
Sep 24, 2026
Merged

josephfarina merged 1 commit into
mainfrom
cli-spec/integrations-discovery/discover-text-fields

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

User impact

astryx discover returns package entries with name, category, components and version. The text rendering of the package list and of a single package (astryx discover @scope/name) printed only a hand-picked subset, so category and version never appeared in text even though --json carried them. A reader of the text output could not see which version of an integration package it was browsing, and could not grep for either field.

After this change both text views render the whole entry, so every JSON field appears as a key: value line.

Problem and solution fit

  • Why does it occur? Both text views passed an explicit fields list (displayName, name, description, components) to the record formatter instead of letting it render the entry. Two of the four listed fields are optional and usually absent, and two fields the entry does carry were left out.
  • Why does it harm the task? The text output is supposed to be a view of the same values as --json. With fields missing, the two views disagree about what a package entry contains.
  • Why does that matter? Nothing forced the lists to stay in step, so any field added to the entry later would silently stay out of text as well.

The fix drops the explicit fields list, so the record formatter renders each entry's own keys in JSON order and skips absent ones. The default component summary (first 10 plus "+N more") and --components behave as before.

Expected behavior and authority

docs/specs/AST-017/spec.md (authority: current), FR13:

A stable CLI response contract includes fields inside discriminated data entries as well as the outer envelope. Every field is present in the canonical response type, contract tests, text projection where the command provides one, and complete consumer-facing schema documentation.

and DEC-4:

Treat every field in a stable machine-readable CLI response—including nested entry fields—as public schema. Keep its canonical type, contract tests, applicable text output, and complete consumer documentation aligned in the same change.

docs/architecture/cli-surface.md (authority: current), INV4 and INV5: human output is a projection of the JSON, and text field names mirror JSON keys one to one.

This changes text output only. The JSON envelope, exit codes and error codes are unchanged, so under spec:AST-017 FR5 it is a nonbreaking patch fix.

Smallest restoration

Two lines in packages/cli/clients/cli/commands/discover.mjs: the discover.list and discover.detail text renderings no longer pass fields. No other view, formatter or API changes.

Evidence

  • Reproduction before the change: with one configured integration @acme/many (version 2.0.0, twelve components), astryx discover --json returned {"name":"@acme/many","category":"@acme/many","components":[...],"version":"2.0.0"}, while astryx discover printed only name: and components: lines. astryx discover @acme/many printed the same two.
  • Result after the change: both print name:, category:, components: and version: lines, with the same values as the JSON.
  • Representative unchanged path: the default list still summarizes components as C00, ..., C09, +2 more, and astryx discover --components still lists all twelve. The empty-list messages, component doc views and search view are untouched.
  • Regression test or other mutation-sensitive proof: new packages/cli/clients/cli/commands/discover.text-projection.test.mjs runs discover --json and discover (and the @test/kit detail view) and requires a key: value text line for every key of the JSON entry. Both cases fail on main (no category: line) and pass with the fix; reverting only discover.mjs turns both red. Because the test reads the keys from the JSON, a field added to the entry later without a text projection also fails it.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm -F @astryxdesign/cli exec tsc --project tsconfig.api-dts.json
pnpm check:cli-structure
pnpm -F @astryxdesign/cli readme:check
pnpm -F @astryxdesign/cli typecheck:json-api
ASTRYX_STRICT_LINT=1 pnpm exec eslint packages/cli/clients/cli/commands/discover.mjs packages/cli/clients/cli/commands/discover.text-projection.test.mjs
pnpm check:repo
pnpm exec vitest run packages/cli

All pass. The full CLI suite matches main apart from the two new tests.

The package list and single-package text views printed a fixed subset of fields, so category and version appeared only in --json. Both views now render the whole entry.
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 24, 2026 7:17am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 24, 2026
@astracat-bot

astracat-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Sep 24, 2026, 7:17 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This fix restores the intended text output for astryx discover: the package list and single-package views now show every field the --json entry carries, including category and version, instead of a hand-picked subset. That aligns the text projection with the documented contract that text mirrors the JSON entry, and the new test derives its expectations from the JSON keys so a future field cannot silently drift out of text again. The JSON output, exit codes, and component listing behaviour are unchanged, and the new projection tests pass.

[Automated review]

github-actions Bot added a commit that referenced this pull request Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox were not published for this CI run.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

23 of 420 shot(s) changed. View the report

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Chat Full AI Chat probe light 42,708
Chat Empty State probe light 42,708
Chat Full AI Chat probe dark 41,786
Chat Empty State probe dark 41,786
Slider Default probe light 15,617
Slider Default probe dark 15,615
Chat With Attachments probe light 12,964
Chat With Attachments probe dark 12,114
InputGroup With Typeahead probe light 11,012
InputGroup With Typeahead probe dark 9,189
ComplexSelector Tree list with search probe light 6,245
TextArea Vertical Form Alignment probe light 5,634
ComplexSelector Tree list with search probe dark 5,602
TextArea Vertical Form Alignment probe dark 5,047
ComplexSelector Fruit ripeness selector neutral light 4,007
ComplexSelector Fruit ripeness selector neutral dark 3,825
ToggleButton Group Single probe dark 1,538
ToggleButton Group Single probe light 1,538
MediaTheme On Dark neutral dark 838
Banner Collapsible Content (Expanded) probe dark 92

and 3 more.

Chat — Full AI Chat — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Chat — Empty State — probe light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
Chat — Full AI Chat — probe dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

Generated by PR Enrichment workflow | View full report

@josephfarina
josephfarina marked this pull request as ready for review September 24, 2026 20:37
@josephfarina
josephfarina merged commit 17e6219 into main Sep 24, 2026
38 checks passed
@github-actions
github-actions Bot deleted the cli-spec/integrations-discovery/discover-text-fields branch September 25, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — 2dc7d76d Deployed Sep 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant