Skip to content

feat(cli): search sees your integrations, and build stops calling one word a match - #5320

Merged
josephfarina merged 2 commits into
mainfrom
cli-search-integrations-build-coverage
Sep 3, 2026
Merged

josephfarina merged 2 commits into
mainfrom
cli-search-integrations-build-coverage

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Three changes to the two commands an agent reaches for first.

search could not see integrations

search gathered components straight off the resolved core directory, so a package listed in astryx.config.mjs was reachable by component and template and invisible to the one command whose job is finding things. The search command already loaded a Project — purely to print integration warnings beside results that could not contain an integration's components.

It now gathers through Project, so an integration's components rank next to Core's and carry their own package and import. The per-integration skip+warn policy is inherited, so one broken manifest is skipped rather than failing the command, and Project is loaded once per search and shared with the docs gatherer.

Usage guidance was not indexed

Component candidates carried name + keywords + usage.description. The reader's vocabulary usually lives further down: Banner describes itself as "a persistent message", and only its guidance names the form errors and maintenance notices someone would search for.

features and best-practice text are now indexed, at a tier below the description. The tiers stay apart deliberately — collapsed into one, Toast ("a brief, non-blocking notification") ties with every component that mentions notifications in passing advice, and ties break alphabetically.

MIN_TOKEN_SCORE moves with the new tier, since it gates which per-token hits count in the multi-word pass and build sends multi-word queries almost exclusively.

build called a one-word coincidence a direct match

astryx --json build "actionable warning banner"
→ directMatch: true
→ pages: contact-form 95, documentation-design 95, login 95

None of those is a warning page. A page's keywords include every component its source renders, so each keyword-matched "banner" at 90; the multi-word branch adds a coverage garnish of up to 15 points, landing exactly on the 95 direct-match threshold. Coverage was decorating the score when it should have been gating it — matching one of three concepts is not the claim that matching three is.

Results now carry matchedTerms / queryTerms (a whole-phrase match reports full coverage), and the pages group gates on them. Consumers no longer have to parse "matches 1/3 terms: banner" back out of the reason string.

A thin kit says what to try

Left unsaid, an empty kit reads as "the package has nothing for this" rather than "these words missed", and the caller falls back on whatever it already believed about the package — which is the failure build exists to prevent. build.kit now carries an optional hint when the kit is nearly empty, naming the browse commands; the renderer prints it.

Testing

  • Full suite green: 544 files, 11280 tests. lint:strict clean on every touched file; check:cli-structure, typecheck:authoring, typecheck:strict, readme:check all pass; API declarations regenerated with sync:api-types.
  • New tests cover each behaviour, including a temp-directory fixture integration (manifest + doc + same-stem source) proving an integration-owned component is found with its package and import path, and that Core results still come back beside it.
  • directMatch positive control: build "contact form" still reports a direct match at 2/2 coverage.

The type additions are additive.

@vercel

vercel Bot commented Aug 22, 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 5:28pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 22, 2026
@github-actions

github-actions Bot commented Aug 22, 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

github-actions Bot added a commit that referenced this pull request Aug 22, 2026
@josephfarina
josephfarina marked this pull request as ready for review September 1, 2026 21:23
@josephfarina
josephfarina requested a review from ernestt September 1, 2026 21:24

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

Thanks — two headline fixes landed while this was open: #5259 added integration search and #5614 fixed false direct matches at the scorer, so this head now conflicts in both search files.

The remaining rewrite regresses two established paths. A builder following an integration result gets @astryxdesign/core, while component correctly reports @acme/widgets/DiffLink. An invalid or duplicate config also turns the parent’s 20-result Core button search into an empty success (exit 0), telling the agent Astryx has nothing.

Please rebase onto current main and reuse the component lookup/fallback path. Could the guidance indexing and thin-kit hint return as separate small PRs, each with true red→green evidence and updated public response docs?

[Reviewed by Robohands]

@josephfarina
josephfarina force-pushed the cli-search-integrations-build-coverage branch from 9821a61 to 53acd1b Compare September 2, 2026 18:39
@github-actions
github-actions Bot requested a review from cixzhang September 2, 2026 18:39
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
josephfarina added a commit that referenced this pull request Sep 3, 2026
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.
Joey Farina and others added 2 commits September 3, 2026 10:22
…in 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.
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.
@josephfarina
josephfarina force-pushed the cli-search-integrations-build-coverage branch from 38b8c96 to 1df29b1 Compare September 3, 2026 17:24
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 1df29b1 (review was against 9821a61). Rebased onto current main, which landed #5259 and #5614 while this was open — both are main's implementations, untouched, so the two regressions that rewrite caused are gone with it. What remains is the coverage gate plus the matchedTerms/queryTerms plumbing it needs; the guidance tier shipped separately as #5937 and the thin-kit hint as #5938, as asked. Re-requesting review on the current head.

@josephfarina
josephfarina merged commit 70b5295 into main Sep 3, 2026
26 checks passed
josephfarina added a commit that referenced this pull request Sep 3, 2026
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 added a commit that referenced this pull request Sep 3, 2026
…5938)

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 added a commit that referenced this pull request Sep 4, 2026
scoreQuery's signature says every hit carries matched/total, and #5320 added
them, but the promote tier #5289 added returns before that. tsc catches it, so
sync:api-types fails and `pnpm build` is red on main.

A whole-phrase hit answered the whole query by definition, which is what asFull
already means - so reuse it and override the score.
@github-actions
github-actions Bot deleted the cli-search-integrations-build-coverage branch September 4, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — 1df29b13 Deployed Sep 3, 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.

2 participants