Skip to content

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

Merged
josephfarina merged 1 commit into
mainfrom
fix/build-thin-kit-hint
Sep 3, 2026
Merged

fix(cli): a thin build kit says what to try instead of looking empty#5938
josephfarina merged 1 commit 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.

@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 3, 2026 6:31pm 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]

@github-actions
github-actions Bot requested a review from cixzhang September 2, 2026 22:43
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@josephfarina
josephfarina force-pushed the fix/build-thin-kit-hint branch from a1f212f to af0456c Compare September 3, 2026 17:22
josephfarina added a commit that referenced this pull request Sep 3, 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 3, 2026
@josephfarina
josephfarina dismissed cixzhang’s stale review September 3, 2026 18:22

Addressed in af0456c (review was against b95fa71). hint is now structured {reason, commands} with bare subcommands, rendered through formatCliCommand so a pnpm workspace sees 'pnpm exec astryx component --list' rather than a command that does not resolve. FEW MATCHES is listed in the legend's section order, and the vacuous matched-then-filtered test is replaced with a deterministic hasResults-true, zero-offerable case. Re-requesting review on the current head.

josephfarina added a commit that referenced this pull request Sep 3, 2026
… word a match (#5320)

* fix(cli): gate the build pages group on query coverage, and hint a thin kit

Rebased onto main, which landed integration search (#5259) and the
scorer-level false-direct-match fix (#5614) while this was open. Both are
main's implementations and are untouched: this branch no longer rewrites
gatherComponents, so the two regressions that rewrite caused go with it — an
integration result reports its own package again, and a broken config no
longer turns a Core `button` search into an empty success.

What is left is the part that did not land. A page template's keywords include
every component its source renders, so `build "actionable warning banner"`
returned login, contact-form and documentation-design at 95 apiece on an exact
hit for "banner" alone. Coverage now gates the pages group instead of
garnishing the score, and a thin kit names the browse commands rather than
reading as "the package has nothing".

scoreQuery reports the coverage it already computed as matchedTerms /
queryTerms, because a single strong hit and a broad weak one land on the same
score and the gate cannot tell them apart otherwise.

The guidance-tier indexing goes up separately, as asked.

* refactor(cli): move the thin-kit hint out to its own PR

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.

---------

Co-authored-by: Joey Farina <joeyfarina@fb.com>
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. It is structured
{reason, commands} with bare subcommands, rendered through formatCliCommand, so
a pnpm workspace sees `pnpm exec astryx component --list` rather than a command
that does not resolve. 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 and listed in the legend's section order.

Rebuilt on current main after #5320 landed the coverage gate.
@josephfarina
josephfarina force-pushed the fix/build-thin-kit-hint branch from af0456c to 26d9ae6 Compare September 3, 2026 18:27
@josephfarina
josephfarina merged commit 030fd67 into main Sep 3, 2026
24 of 25 checks passed
@github-actions
github-actions Bot deleted the fix/build-thin-kit-hint branch September 4, 2026 06:23
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