Skip to content

perf(cli): a lookup miss reads the component matcher's Core inputs from a kept summary instead of every Core doc - #12538

Merged
josephfarina merged 3 commits into
mainfrom
josephfarina/search-warm-miss-kept-core
Nov 18, 2026
Merged

josephfarina merged 3 commits into
mainfrom
josephfarina/search-warm-miss-kept-core

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

Record change: spec:AST-081 FR7's list of kept items in the per-user catalogs folder now names Core's component views, Core hooks' declared keywords for the not-found hint, and whether the installed Core matches the CLI's stored component list; doctor's catalogs row says the same.

What changes

A component lookup that found nothing scored every Core component doc, read the Core hook docs for the hook hint, and re-read Core's files to check the stored component list, on every call. Each is now a kept summary in the per-user catalogs folder, checked by the stamps of what it read, like the integration component views beside it. Answers are unchanged; an edited, added or removed doc shows on the next call.

Evidence

  • Warm component lookups that miss are 60–125 ms faster; every answer is unchanged.
  • Independent gate: search, lookups, docs forms, build and the typo grid are identical to main; 599 component names give the same answers cold, warm and with an unwritable catalogs folder; 20 staleness steps (edit, add, remove a doc) show on the next call.

Testing

  • New core-component-views.test.mjs (kept summaries, stamps, staleness) and the packed gather-cache records test.

…e doc

A component lookup miss scored every Core component doc, read the Core hook
docs for the hook hint, and re-read Core's files to check the stored
component list, on every call. Each is now a kept summary in the per-user
catalogs folder, checked by the stamps of what it read, like the integration
component views beside it. Answers are unchanged; an edited, added or removed
doc shows on the next call.
@vercel

vercel Bot commented Nov 18, 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 Nov 18, 2026 4:24am UTC

Request Review

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

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 4:31 AM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): a component lookup that finds nothing reads the not-found matcher's Core inputs (Core's component views, Core hooks' declared keywords and the stored-component-list check) from kept summaries in the per-user catalogs folder, checked by the stamps of what they read, like the integration component views beside them. Every answer stays the same, and an edited, added or removed doc shows on the next call. spec:AST-081 FR7's kept-items line and doctor's catalogs row name these summaries.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 48ea06e

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 9e44e23

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: unknown (base surface unavailable): richtext, theme-butter, theme-chocolate, theme-gothic, theme-matcha, theme-neutral, theme-stone, theme-y2k

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

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

Changes requested: lookup answers stay the same and the kept summaries follow the existing kept-catalog pattern, but two things need fixing before this can merge.

  • Add a Changeset naming @astryxdesign/cli (for example pnpm changeset:new --packages @astryxdesign/cli --category perf), because without one the required lint check fails at "Check Changeset coverage".
  • Amend architecture:cli-surface INV10 so its list of the only per-user writes also names the three entries this pull request adds to spec:AST-081 FR7 (the stored-list match check, Core's component match views and Core hooks' declared keywords).

The required test, build and docsite-test checks were cancelled because CI was full, so they need a re-run. Two optional suggestions: reuse hook discovery's skip set in coreHookKeywords, and add a warm-read and staleness test for the kept stored-list check and the kept hook keywords.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: FR7's list of kept items names the three new entries. Verified (docs/specs/AST-081-global-mode/spec.md:425-428).
  • Claim: doctor's catalogs row says the same. Verified (packages/cli/api/doctor/doctor.mjs:2757).
  • Claim: before, a miss read every Core doc, scanned the hook docs and re-read the stored list's Core inputs on each run. Verified in the base string-utils.mjs, other-command.mjs and stored-component-list.mjs.
  • Claim: each is now a kept summary checked by stamps, like the integration views. Verified (core-component-views.mjs:55-158, other-command.mjs:524-540, stored-component-list.mjs:106-117).
  • Claim: answers are unchanged. Verified: 411 typed names give identical results on the base and the head, and a warm miss prints what a fresh run prints.
  • Claim: an edited, added or removed doc shows on the next call. Verified for the views (core-component-views.test.mjs) and for a Core component added after the list was kept; not tested for the kept stored-list check or hook keywords.
  • Claim: warm misses are 60-125 ms faster. Consistent: about 120-130 ms faster in a local measurement.
  • Claim: an independent gate over 599 names and 20 staleness steps. Not reproduced; its harness is not in the pull request.
  • Claim: new tests for the kept views and the doctor row. Verified; they pass locally.
  • File docs/specs/AST-081-global-mode/spec.md: clear (owner-approved); INV10 needs the same items (blocking).
  • File packages/cli/api/doctor/doctor.mjs: clear.
  • File packages/cli/foundation/discovery/core-component-views.mjs: clear.
  • File packages/cli/foundation/discovery/core-component-views.test.mjs: clear.
  • File packages/cli/foundation/discovery/stored-component-list.mjs: clear; no warm-path test (non-blocking).
  • File packages/cli/foundation/suggest/other-command.mjs: copied skip names (non-blocking).
  • File packages/cli/foundation/text/string-utils.mjs: clear.
  • File packages/cli/test/packed-gather-cache.records.test.mjs: clear.
  • No Changeset in the pull request: the required lint check fails (blocking).

Automated review (maintainer link)

Comment thread docs/specs/AST-081-global-mode/spec.md Resolved
… the kept checks

The architecture record's list of per-user writes names the stored-list
match check, Core's component match views and Core hooks' keywords, as
AST-081 FR7 does. The hook keywords' walk skips hook discovery's own folder
set. New tests cover the stored-list check and the hook keywords: kept, read
back warm without reading Core, an edit shown on the next run, and the same
answer when the cache folder cannot be written.
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision update (engineering owner, covering this pull request at its current head): architecture:cli-surface INV10's list of the CLI's only per-user writes also names the three kept summaries this pull request adds (the stored-list match check, Core's component match views and Core hooks' declared keywords), in the same words as spec:AST-081 FR7.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 1c9c822

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

Changes requested: the kept summaries give the same suggestions as before and both record edits are approved for this head, but the kept component-list check breaks the packed kept-catalog tests.

  • Miss: the kept stored-list check in packages/cli/foundation/discovery/stored-component-list.mjs now stores a second entry on every search and build run, which the packed test fixture counts as a catalog, so five tests in packed-gather-cache.fresh, .changes, .installed and .malformed fail (CI's test-node (4/9) already shows the two fresh failures); skip summary entries in the fixture's entries() and add the summary kind to the malformed test's list of kinds.
  • Miss: the same check accepts any stored value, so a damaged entry with a null value is never stored over and one with a truthy value of the wrong shape passes the check, which fails two more packed-gather-cache.malformed cases; pass accept: value => typeof value === 'boolean' to its kept summary.

The Changeset, the INV10 list and the shared hook skip folders from the last review are all fixed. The kept component views and hook keywords could take the same kind of shape check.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the global-mode record's list of kept items names the three new entries. Verified (docs/specs/AST-081-global-mode/spec.md:425-428).
  • Claim: doctor's catalogs row says the same. Verified (packages/cli/api/doctor/doctor.mjs:2757, records test).
  • Claim: the CLI-surface record's list of per-user writes names them too. Verified (docs/architecture/cli-surface.md:298).
  • Claim: before, a miss loaded every Core component doc, read every hook doc and re-read the stored list's Core files on each call. Verified in the base matcher, hook hint and stored-list check.
  • Claim: each is now a kept summary checked by the stamps of what it read, like the integration component views. Verified (core-component-views.mjs:71-158, other-command.mjs:524-537, stored-component-list.mjs:106-117).
  • Claim: answers are unchanged. Verified: 2,228 typed names give the base's suggestions on first and warm runs, and all 89 hooks' kept keywords match.
  • Claim: an edited, added or removed doc shows on the next call. Verified by the three new tests.
  • Claim: warm misses are 60-125 ms faster. Consistent: a warm miss loads no Core doc; not re-timed.
  • Claim: an independent gate over 599 names and 20 staleness steps. Not reproduced; its harness is not in the pull request.
  • Claim: new tests cover the kept summaries and the doctor row. Verified; they pass.
  • Changeset: a mistyped component name answers faster on repeat runs because the Core docs its suggestions read are kept. Verified in mechanism.
  • File .changeset/a-mistyped-astryx-component-name-answers-faster--mzrf.md: clear.
  • File docs/architecture/cli-surface.md: clear (owner-approved).
  • File docs/specs/AST-081-global-mode/spec.md: clear (owner-approved).
  • File packages/cli/api/doctor/doctor.mjs: clear.
  • File packages/cli/foundation/discovery/core-component-views.mjs: clear.
  • File packages/cli/foundation/discovery/core-component-views.test.mjs: clear.
  • File packages/cli/foundation/discovery/hook-discovery.mjs: clear.
  • File packages/cli/foundation/discovery/stored-component-list.kept.test.mjs: clear.
  • File packages/cli/foundation/discovery/stored-component-list.mjs: two blocking findings (above).
  • File packages/cli/foundation/suggest/other-command.hook-keywords-kept.test.mjs: clear.
  • File packages/cli/foundation/suggest/other-command.mjs: clear.
  • File packages/cli/foundation/text/string-utils.mjs: clear.
  • File packages/cli/test/packed-gather-cache.records.test.mjs: clear.

Automated review (maintainer link)

…mmaries in the packed tests

A stored stored-list verdict that is not a boolean, Core component views
that are not a list of name and view pairs, and hook keywords that are not
a list of names with keyword lists are read again and stored over, as a
damaged entry of any other kind is. The packed kept-catalog fixture leaves
summaries out of the catalogs it counts, and the malformed-entry test names
the stored-list check among the kinds search and build keep.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 9e44e23

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

Approved pending CI: CI has not finished on this head yet.

Both fixes from the last review are in: the packed test fixture skips summary entries, and each kept summary checks its stored shape before reuse, so the packed kept-catalog tests pass. Lookup answers are unchanged, and both record list edits are approved for this head. No further changes are needed; the required checks still have to pass.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: the global-mode record's list of kept items names Core's component views, Core hooks' declared keywords and whether the installed Core matches the stored component list. Verified (docs/specs/AST-081-global-mode/spec.md:425-428).
  • Claim: doctor's catalogs row says the same. Verified (packages/cli/api/doctor/doctor.mjs:2757, packed-gather-cache.records.test.mjs:61).
  • Claim: before, a miss scored every Core component doc, read the Core hook docs and re-read the stored list's Core files on each call. Verified in the matcher, hook hint and stored-list check before this change.
  • Claim: each is now a kept summary checked by the stamps of what it read, like the integration component views. Verified (core-component-views.mjs:72-176, other-command.mjs:524-550, stored-component-list.mjs:106-119).
  • Claim: answers are unchanged. Verified: 91 typed names print identical output before and after this change.
  • Claim: an edited, added or removed doc shows on the next call. Verified by the three new tests.
  • Claim: warm misses that find nothing are 60-125 ms faster. Consistent: a warm miss loads no Core doc; not re-timed.
  • Claim: an independent gate over 599 names and 20 staleness steps. Not reproduced, since its harness is not in the pull request; consistent with the name comparison and the packed suites.
  • Claim: new tests cover the kept summaries, stamps and staleness, and the packed records test checks doctor's row. Verified; they pass.
  • Changeset: a mistyped astryx component name answers faster on repeat runs because the Core docs its suggestions read are kept between runs. Verified in the mechanism and the tests.
  • File .changeset/a-mistyped-astryx-component-name-answers-faster--mzrf.md: clear.
  • File docs/architecture/cli-surface.md: clear (owner-approved).
  • File docs/specs/AST-081-global-mode/spec.md: clear (owner-approved).
  • File packages/cli/api/doctor/doctor.mjs: clear.
  • File packages/cli/foundation/discovery/core-component-views.mjs: clear.
  • File packages/cli/foundation/discovery/core-component-views.test.mjs: clear.
  • File packages/cli/foundation/discovery/hook-discovery.mjs: clear.
  • File packages/cli/foundation/discovery/stored-component-list.kept.test.mjs: clear.
  • File packages/cli/foundation/discovery/stored-component-list.mjs: clear (both earlier findings fixed).
  • File packages/cli/foundation/suggest/other-command.hook-keywords-kept.test.mjs: clear.
  • File packages/cli/foundation/suggest/other-command.mjs: clear.
  • File packages/cli/foundation/text/string-utils.mjs: clear.
  • File packages/cli/test-utils/packed-gather-cache-fixture.mjs: clear.
  • File packages/cli/test/packed-gather-cache.malformed.test.mjs: clear.
  • File packages/cli/test/packed-gather-cache.records.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit 8b176db into main Nov 18, 2026
81 checks passed
@github-actions
github-actions Bot deleted the josephfarina/search-warm-miss-kept-core branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 9e44e239 Deployed Nov 18, 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