Repository navigation
perf(cli): a lookup miss reads the component matcher's Core inputs from a kept summary instead of every Core doc - #12538
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
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. |
|
/approve-spec 48ea06e |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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 examplepnpm changeset:new --packages @astryxdesign/cli --category perf), because without one the requiredlintcheck fails at "Check Changeset coverage". - Amend
architecture:cli-surfaceINV10 so its list of the only per-user writes also names the three entries this pull request adds tospec:AST-081FR7 (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.mjsandstored-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
lintcheck fails (blocking).
… 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.
|
Owner decision update (engineering owner, covering this pull request at its current head): |
|
/approve-spec 1c9c822 |
There was a problem hiding this comment.
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.mjsnow stores a second entry on everysearchandbuildrun, which the packed test fixture counts as a catalog, so five tests inpacked-gather-cache.fresh,.changes,.installedand.malformedfail (CI'stest-node (4/9)already shows the twofreshfailures); skip summary entries in the fixture'sentries()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
nullvalue is never stored over and one with a truthy value of the wrong shape passes the check, which fails two morepacked-gather-cache.malformedcases; passaccept: 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.
…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.
|
/approve-spec 9e44e23 |
There was a problem hiding this comment.
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 componentname 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.
Record change:
spec:AST-081FR7'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
Testing
core-component-views.test.mjs(kept summaries, stamps, staleness) and the packed gather-cache records test.