Skip to content

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

Draft
josephfarina wants to merge 2 commits into
mainfrom
cli-search-integrations-build-coverage
Draft

feat(cli): search sees your integrations, and build stops calling one word a match#5320
josephfarina wants to merge 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.

… word a match

`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 even loaded a `Project` already — 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`, and one broken integration
is still skipped rather than failing the command.

Component candidates now index `features` and best-practice text as well as
the one-line description, at a lower tier. The reader's vocabulary usually
lives there: `Banner` describes itself as "a persistent message", and only its
guidance names the form errors and maintenance notices someone would actually
search for. The tiers stay apart because collapsing them is worse than not
indexing at all — `Toast` is "a brief, non-blocking notification" and would
tie with every component that mentions notifications in passing advice, and
ties break alphabetically.

`build` reported a direct match on one incidental word. A page's keywords
include every component its source renders, so "actionable warning banner"
scored `login`, `contact-form` and `documentation-design` at 95 apiece on
"banner" alone — exactly the direct-match threshold — and offered three pages
that are not warnings as the place to start. Coverage was garnishing the score
by up to 15 points when it should have been gating: matching one of three
concepts is not the claim that matching three is. Results now carry
`matchedTerms`/`queryTerms`, and the pages group gates on them.

A kit that comes back thin now 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.
@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 (UTC)
astryx Ready Ready Preview Aug 22, 2026 2:23am

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

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