Skip to content

fix(cli): a thin build kit says what to try instead of looking empty - #5938

Open
josephfarina wants to merge 2 commits into
mainfrom
fix/build-thin-kit-hint
Open

fix(cli): a thin build kit says what to try instead of looking empty#5938
josephfarina wants to merge 2 commits into
mainfrom
fix/build-thin-kit-hint

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Split out of #5320 at review request: the thin-kit hint, on its own, with red→green evidence.

The gap

astryx build "quantum flux capacitor telemetry" — before:

DOMAIN COMPONENTS
name:        Stack
description: Stack arranges items in a row or column...

FRAME + FOUNDATION
frame:      AppShell, TopNav, SideNav, Layout
foundation: VStack, HStack, Grid, ...

One incidental component, the always-on list, and nothing else. An agent reading that does not conclude its wording was wrong — it concludes the package has nothing and falls back on its own memory of what Astryx contains. That is precisely the failure build exists to prevent.

After, same query, one added section:

FEW MATCHES
Few matches. This is keyword search, not semantic — try other wordings,
or browse with `astryx component --list` and `astryx template --list`.

The threshold counts what survived, not what search returned

Below three offerable results (pages + blocks + domain). Deliberately not hasResults, which is already true for a query that matched things and then had them all filtered out by the score floors — and that is the case most likely to be misread, because the output looks populated. There is a test for exactly that shape.

hint is absent when it does not apply, so a healthy kit is byte-identical to before. The CLI renders it last so it is the line the reader leaves with.

Also

  • BuildKitResponse type and the public response doc (build.doc.mjs) both updated.
  • 3 new tests: fires when thin, silent when healthy, and fires for the matched-then-filtered case.

Gates: check:repo green, lint:strict 0 errors, build suite 8/8.

build "quantum flux capacitor telemetry" returned one incidental component and
the always-on frame list. An agent reading that concludes the package has
nothing and falls back on its own memory of Astryx, which is the failure build
exists to prevent.

Below three offerable results the kit carries a hint naming the browse commands
and saying this is keyword matching, not semantic. The threshold counts what
survived the score floors, not what search returned: hasResults is already true
for a query that matched and was then filtered to nothing.

Absent when it does not apply, so a healthy kit is byte-identical. Rendered
last, as FEW MATCHES, so it is the line the reader leaves with.

Split out of #5320 at review request.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 2, 2026
@vercel

vercel Bot commented Sep 2, 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 2, 2026 10:47pm UTC

Request Review

josephfarina added a commit that referenced this pull request Sep 2, 2026
Review asked for the guidance indexing and the thin-kit hint as separate small
PRs. The hint is now #5938 and the guidance tier is #5937, so this branch keeps
only the coverage gate on the build pages group and the matchedTerms/queryTerms
plumbing that gate needs.

No behaviour change to the gate itself.
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

josephfarina added a commit that referenced this pull request Sep 2, 2026
…h too

The split removed `hint` from the kit and its type but left build.mjs
destructuring it, so Typecheck CLI (strict) failed with TS2339 and took
build-storybook and build down with it. The renderer change belongs to #5938
with the rest of the hint.

@cixzhang cixzhang 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.

Builders without a global astryx binary get unusable recovery commands: this pnpm workspace renders every other build-kit command as pnpm exec astryx, but FEW MATCHES freezes bare astryx commands into the API prose. Please keep recovery commands structured/package-manager-agnostic and format them in the CLI renderer.

The output also says its complete section order ends at FRAME + FOUNDATION, then emits FEW MATCHES.

Finally, the “matched then filtered” test returns six offerable results and takes the no-hint branch. Please assert a deterministic hasResults: true, zero-offerable case.

[Reviewed by Robohands]

Three review findings from cixzhang, all real.

The hint froze `astryx component --list` into API prose. This pnpm workspace
renders every other build-kit command as `pnpm exec astryx`, so the one command
offered to a stuck reader was the one that would not run. hint is now
{reason, commands} with bare subcommands, and the renderer formats them through
formatCliCommand.

The legend promised a section order ending at FRAME + FOUNDATION and then
emitted FEW MATCHES after it. FEW MATCHES is now in the order when present.

The matched-then-filtered test returned six offerable results and took the
no-hint branch, so it asserted nothing. Replaced with `blockchain`, which is a
deterministic hasResults:true, zero-offerable case, plus a test pinning the
commands as bare.
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.

2 participants