Repository navigation
fix(cli): build reads search without page templates that are not ready - #12031
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes: build now ranks search as if not-ready page templates were absent, and its kit matches a catalog without them, but the reason that names a not-ready template now fires too widely.
packages/cli/api/build/kit/signals.mjs:200-203no longer needs search's direct match before naming a not-ready template, so any idea containing "table" names the not-readytabletemplate andchooseStartreplaces the real reason:table-comparison, "a pricing page with three plans and a comparison table" and "a run history table" go from "Matches the idea." to "tableisn't ready yet, so build started from …", althoughspec:AST-048FR4 asks for that reason only when the request names a template that search matches directly.
Keeping FR4's direct-match condition (for example, by scoring the not-ready entries search sets aside) and asserting the reason for table-comparison would fix it. Non-blocking: searchCore's JSDoc now repeats @param {string} query (search.mjs:128 and :134).
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Changeset: build reads search as if not-ready page templates were absent, with the same start, pages, blocks, components and
matchCount. Verified: identical to a tree with Core's nine not-ready templates deleted on 80 ideas; the new kit test passes here and fails on main. - Changeset: a not-ready template's name typed as the idea no longer empties the kit. Verified for
MessagingShell(0 to 3 pages, 0 to 5 blocks);incident-consolestays empty because no ready entry matches it. - Changeset: when the idea names a not-ready template, the reason still says it is not ready yet. False as unchanged behaviour: the reason now also replaces other reasons for ideas that only contain a not-ready template's id word (the finding above).
- Changeset:
astryx searchstill lists every template. Verified: the search path never applies the filter, and the new search test passes. - Description: not-ready templates raised
matchCount, and an exact name made search answer with that template alone. Verified (matchCountdrops on 52 of 80 ideas;MessagingShellandincident-consoleanswer alone on main); place and order shifts were not reproduced in 80 ideas. - Description:
searchCoregains an internal, default-offreadyTemplatesOnlythat only build sets. Verified (search.mjs:158-185,signals.mjs:168; no other caller; not exported). - Description: build's re-cap and page filter go, and the
matchCountnote goes. Verified (signals.mjs,build.type.mjs:77). - Description: the named-not-ready reason compares the idea with not-ready names directly. Verified (
signals.mjs:200-203); its effect is the finding above. - Description: fixture evidence for kit equality, a named reason below another not-ready template, cold and warm re-reads, and byte-equal search. Verified: those tests pass at this head.
- Description: the kit tests fail on main. Verified for two of the three kit tests and the search test; the cold-and-warm test also passes on main.
- Description: the request replay results. Not checkable here (the replay set is not in the repository); it reports no reason comparison.
- Description: the stated vitest command, eslint and tsc pass. Verified: 496 tests pass; eslint is clean; strict tsc reports nothing in the changed files.
- Scope: no new public API. Verified:
searchCoreis not exported.
Files:
.changeset/build-ready-templates-only.md: its "still" sentence depends on the finding above.packages/cli/api/build/_adapter.mjs: clear.packages/cli/api/build/build.test.mjs: clear (thematchCountcomparison changes; the rest is line-wrapping).packages/cli/api/build/build.type.mjs: clear.packages/cli/api/build/kit/signals.mjs: finding at lines 200-203.packages/cli/api/build/kit/unready-blocks.test.mjs(deleted): clear; the rewritten kit test covers it.packages/cli/api/build/kit/unready-search.test.mjs: clear; it has no reason assertion for an idea that only contains a not-ready template's word.packages/cli/api/search/_gather-templates.mjs: clear.packages/cli/api/search/ready-templates-only.test.mjs: clear.packages/cli/api/search/search.mjs: non-blocking JSDoc repeat.
There was a problem hiding this comment.
Requesting changes: build now ranks search as if not-ready page templates were absent, and the latest commit correctly keeps that private mark out of exported search indexes, but the reason that names a not-ready template still fires too widely.
packages/cli/api/build/kit/signals.mjs:200-203no longer needs search's direct match before naming a not-ready template, so any idea containing "table" names the not-readytabletemplate and replaces the real reason:table-comparison, "a pricing page with three plans and a comparison table" and "a data table with filters" go from "Matches the idea." to "tableisn't ready yet, so build started from …", althoughspec:AST-048FR4 asks for that reason only when the request names a template that search matches directly.
Keeping FR4's direct-match condition (for example, by scoring the not-ready entries search sets aside) and asserting the reason for table-comparison would fix it. Non-blocking: searchCore's JSDoc still repeats @param {string} query (search.mjs:128 and :134).
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Changeset: build reads search as if not-ready page templates were absent, with the same start, pages, blocks, components and
matchCount. Verified: on 15 ideas the head equals a tree with Core's nine not-ready templates deleted on every field but the reason; the kit test passes. - Changeset: a not-ready template's name typed as the idea no longer empties the kit. Verified for
MessagingShell(0 to 3 pages, 0 to 5 blocks);incident-consolestays empty because no ready entry matches it. - Changeset: when the idea names a not-ready template, the reason still says it is not ready yet. False as unchanged behaviour: the reason now also replaces other reasons for ideas that only contain a not-ready template's id word (the finding above).
- Changeset:
astryx searchstill lists every template. Verified: the search path never applies the filter, and the new search test passes. - Description: not-ready templates raised
matchCount, and an exact name made search answer with that template alone. Verified (matchCountdrops by 2 to 7 on the probed ideas;MessagingShellandincident-consoleanswer alone on main); place and order shifts were not reproduced on the probed ideas. - Description:
searchCoregains an internal, default-offreadyTemplatesOnlythat only build sets. Verified (search.mjs:158-185,signals.mjs:168; no other caller; not exported). - Description: an exported search index leaves the mark out, so the index export and ranking are unchanged. Verified (
search-index.mjs:44; the new index assertion fails without the change and passes with it). - Description: build's re-cap and page filter go, and the
matchCountnote goes. Verified (signals.mjs,build.type.mjs:77). - Description: the named-not-ready reason compares the idea with not-ready names directly. Verified (
signals.mjs:200-203); its effect is the finding above. - Description: fixture evidence for kit equality, a named reason below another not-ready template, cold and warm re-reads, and byte-equal search. Verified: those tests pass at this head.
- Description: the kit tests fail on main. Verified for two of the three kit tests and the search test; the cold-and-warm test also passes on main.
- Description: the request replay results. Not checkable here (the replay set is not in the repository); it reports no reason comparison.
- Description: the stated vitest command, eslint and tsc pass. Verified: 39 files and 496 tests pass at this head; lint passes in CI; strict tsc reports nothing in the changed files.
- Scope: no new public API. Verified:
searchCoreis not exported, and the index export keeps its shape.
Files:
.changeset/build-ready-templates-only.md: its "still" sentence depends on the finding above.packages/cli/api/build/_adapter.mjs: clear.packages/cli/api/build/build.test.mjs: clear (thematchCountcomparison changes; the rest is line-wrapping).packages/cli/api/build/build.type.mjs: clear.packages/cli/api/build/kit/signals.mjs: finding at lines 200-203.packages/cli/api/build/kit/unready-blocks.test.mjs(deleted): clear; the rewritten kit test covers it.packages/cli/api/build/kit/unready-search.test.mjs: clear; it has no reason assertion for an idea that only contains a not-ready template's word.packages/cli/api/search/_gather-templates.mjs: clear.packages/cli/api/search/ready-templates-only.test.mjs: clear.packages/cli/api/search/search-index.mjs: clear.packages/cli/api/search/search-index.test.mjs: clear.packages/cli/api/search/search.mjs: non-blocking JSDoc repeat.
There was a problem hiding this comment.
Requesting changes: build now reads search as if not-ready page templates were absent, and the latest commit fixes the over-firing not-ready reason (table ideas keep their own reasons), but one sentence of the release note no longer matches the behaviour.
- Regression:
.changeset/build-ready-templates-only.mdsays a named not-ready template still gets the "not ready yet" reason, but since this commit restored the direct-match check thatspec:AST-048FR4 asks for,astryx build MessagingShell(the description's own example) prints "Search matchedblankby name, but the app shell is the closer start." because search scoresmessaging-shellbelow a direct match, so please reword it to "When the idea names a not-ready template that search matches directly, the reason still says it is not ready yet."
The code needs no change: the tests pass at this head, four of the seven new kit and search tests fail on main, and build's kit equals a catalog without the not-ready templates on every idea checked.
Claims and files checked
Review mode: incremental; reason: none
changed rules (0): none
Claims:
- Changeset: build reads search as if not-ready page templates were absent, so the start, page list, blocks, components and
matchCountequal those without them. Verified: on 208 ideas the head equals a tree with Core's nine not-ready templates removed; the kit test passes here and fails on main. - Changeset: a not-ready template's name typed as the idea no longer empties the kit. Verified for
MessagingShell(0 to 3 pages, 0 to 5 blocks);incident-consolestays empty, as it is without the template. - Changeset: when the idea names a not-ready template, the reason still says it is not ready yet. False for
MessagingShellsince the latest commit (the finding above). - Changeset:
astryx searchstill lists every template. Verified: the search path never applies the filter, and the new search test passes. - Description: not-ready templates raised
matchCount, and an exact name made search answer with that template alone. Verified (matchCountdrops by up to 9 on the probed ideas;MessagingShellandincident-consoleanswer alone on main); place and order shifts were not reproduced on 208 probed ideas. - Description:
searchCoregains an internal, default-offreadyTemplatesOnlythat only build sets, andastryx searchand every other caller are unchanged. Verified (search.mjs:137-183,signals.mjs:193; no other caller; not exported). - Description: build's re-cap and page-match filter go. Verified (
signals.mjs). - Description: the not-ready reason keeps FR4's condition (named outright and matched directly), with one more search only when the idea names one outright. Verified (
signals.mjs:139-149,:223-231); table ideas keep their own reasons. - Description: a not-ready page entry carries a private mark, and an exported index leaves it out, so the index export and ranking are unchanged. Verified (
_gather-templates.mjs:138,search-index.mjs:44; the index tests pass). - Description:
matchCountno longer counts not-ready templates and its note goes. Verified (build.type.mjs:77). - Description: the tests listed (new search test, rewritten kit test, removed re-cap test, build test comparing with the option). Verified.
- Description: fixture evidence (kit equal without the template, a named reason below another not-ready template, cold and warm re-reads, a ready template sharing a not-ready word keeps its reason, byte-equal search). Verified: those tests pass at this head.
- Description: the kit tests fail on main. Verified: 3 of 5 kit tests and 1 of 2 search tests fail on main (one only by a type error, since main's loader returns a count); the cold-and-warm and shared-word tests also pass on main.
- Description: the replay results. Not checkable here (the replay set is not in the repository); the 208 probed ideas agree with it.
- Description: the stated vitest command, eslint and strict tsc pass. Verified: 39 files and 498 tests pass; eslint is clean; strict tsc reports nothing in the changed files.
- Scope: no new public API. Verified:
searchCoreis not exported, and every exported function keeps its shape.
Files:
.changeset/build-ready-templates-only.md: finding at line 5.packages/cli/api/build/_adapter.mjs: clear.packages/cli/api/build/build.test.mjs: clear (thematchCountcomparison changes; the rest is line-wrapping).packages/cli/api/build/build.type.mjs: clear.packages/cli/api/build/kit/signals.mjs: clear; the earlier reason finding is fixed.packages/cli/api/build/kit/unready-blocks.test.mjs(deleted): clear; the rewritten kit test covers it.packages/cli/api/build/kit/unready-search.test.mjs: clear.packages/cli/api/search/_gather-templates.mjs: clear.packages/cli/api/search/ready-templates-only.test.mjs: clear.packages/cli/api/search/search-index.mjs: clear.packages/cli/api/search/search-index.test.mjs: clear.packages/cli/api/search/search.mjs: clear; the duplicate JSDoc tag is gone.
ec95daf to
0865f77
Compare
There was a problem hiding this comment.
Requesting changes: build's ready-only search and the reworded release note hold at this head, but main has since landed #11931, which uses the same _notReady mark, and the two do not combine correctly.
- Regression: merged with current
main,exportSearchIndexdrops_notReady(packages/cli/api/search/search-index.mjs:44), whichmainnow reads for each template result'sisReady, sorankSearchIndexand the docsite's search report not-ready templates such astableas ready andreadyTemplatesOnlyalso drops not-ready blocks, failing 9 tests on the merge (8 insearch-index.test.mjs, 1 innot-ready.test.mjs).
To fix it, merge main, drop the page-only mark in _gather-templates.mjs, take '_notReady' out of BUILD_FIELDS and its test assertion, and filter only page candidates in withoutNotReady (c._notReady && c._kind === 'page'); with those edits the merged tree passes all 517 tests in the pull request's command plus not-ready.test.mjs and packed-search-catalog.test.mjs. CI's tests had not run on this head yet: its first run found CI full, and the re-run was still waiting for room.
Claims and files checked
Review mode: full; reason: history
Claims:
- Changeset: build reads search as if not-ready page templates were absent, so the start, pages, blocks, components and
matchCountequal those without them. Verified: on 25 ideas the head equals a tree with Core's nine not-ready templates removed, apart from the reasons FR4 requires; the kit test passes here and fails onmain. - Changeset: a not-ready template's name typed as the idea no longer empties the kit. Verified for
MessagingShell(0 to 3 pages, 0 to 5 blocks);incident-consolestays empty, as it is without the template. - Changeset: when the idea names a not-ready template that search matches directly, the reason still says it is not ready yet. Verified ("an incident console page", "messaging shell", "table"; the reason test passes here and fails on
main). - Changeset:
astryx searchstill lists every template. Verified: the search path never applies the filter, and the new search test passes. - Description: not-ready templates raised
matchCount, and an exact name made search answer with that template alone. Verified (matchCountdrops by up to 7 on the probed ideas;MessagingShellandincident-consoleanswer alone onmain); place and order shifts were not reproduced on the probed ideas. - Description: adding or removing a not-ready template could change build's page list and block suggestions. Not reproduced on the probed ideas (only
matchCountand the exact-name case moved); the description's replay reports a few block lists. - Description:
searchCoregains an internal, default-offreadyTemplatesOnlythat only build sets, andastryx searchand every other caller are unchanged. Verified (search.mjs:128-183,signals.mjs:193; not exported). - Description: build's re-cap and page-match filter go. Verified (
signals.mjs). - Description: the reason keeps the spec's condition (named outright and matched directly), with one more search only when the idea names a not-ready template outright. Verified (
signals.mjs:139-149,:223-231). - Description: a not-ready page entry carries a private mark. Verified at this head;
mainnow sets the same mark on every not-ready template (the finding above). - Description: an exported index leaves the mark out, so
exportSearchIndexandrankSearchIndexare unchanged. False against currentmain(the finding above); true against the older base it was written on. - Description:
matchCountno longer counts not-ready templates and its note goes. Verified (build.type.mjs:77). - Description: the tests listed (new search test, rewritten kit test, removed re-cap test, build test comparing with the option). Verified.
- Description: fixture evidence (kit equal without the template, a named reason below another not-ready template, cold and warm re-reads, a ready template sharing a not-ready word keeps its reason, byte-equal search). Verified: those tests pass at this head.
- Description: the kit tests fail on
main. Verified: 3 of 5 kit tests and 1 of 2 search tests fail onmain(one only by a type error); the cold-and-warm and shared-word tests pass onmaintoo. - Description: the replay results. Not checkable (the replay set is not in the repository); the 25 probed ideas agree with it.
- Description: the stated vitest command, eslint and strict tsc pass. Verified: 39 files and 498 tests pass; eslint is clean; strict tsc reports nothing in the changed files.
- Scope: no new public API. Verified:
searchCoreis not exported, and every exported function keeps its shape.
Files:
.changeset/build-ready-templates-only.md: clear; line 5 now names the direct-match condition.packages/cli/api/build/_adapter.mjs: clear.packages/cli/api/build/build.test.mjs: clear (thematchCountcomparison changes; the rest is line-wrapping).packages/cli/api/build/build.type.mjs: clear.packages/cli/api/build/kit/signals.mjs: clear.packages/cli/api/build/kit/unready-blocks.test.mjs(deleted): clear; the rewritten kit test covers it.packages/cli/api/build/kit/unready-search.test.mjs: clear.packages/cli/api/search/_gather-templates.mjs: finding: lines 137-138 duplicatemain's mark once merged.packages/cli/api/search/ready-templates-only.test.mjs: clear.packages/cli/api/search/search-index.mjs: finding at line 44.packages/cli/api/search/search-index.test.mjs: finding: line 151 asserts the strip.packages/cli/api/search/search.mjs: finding: once merged,withoutNotReadydrops every marked candidate, blocks included.
searchCore takes readyTemplatesOnly, off by default: search leaves page templates marked not ready out of the entries it ranks, so they take no place, move no order and add nothing to the count. Build sets it and drops its own not-ready handling of search's results (the wider search and re-cap). Build's reason for a not-ready template the idea names compares the idea with the not-ready names directly.
…t directly The reason that names a not-ready template the idea asks for again requires search's direct match, as spec AST-048 FR4 says. Build's kit search leaves not-ready templates out, so an idea that names one outright pays for one more search that keeps them.
…nd drops only pages Search now marks every not-ready template and reports it as each result's isReady, so the mark is no longer one only build reads: an exported index keeps it, and the ready-only search leaves out not-ready page templates only, keeping not-ready blocks as before.
0865f77 to
1b60a3f
Compare
There was a problem hiding this comment.
Approved pending CI: CI's node tests, UI tests and test build had not finished on this head yet.
astryx build now ranks search without page templates marked not ready, astryx search is unchanged, and it now combines correctly with main's _notReady mark: the search index keeps the mark, and only not-ready pages are left out of build's search. Nothing else needs to change.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Changeset: build reads search as if not-ready page templates were absent, so the start, pages, blocks, components and
matchCountequal those without them. Verified: on 78 ideas the head's kit equals a tree with Core's nine not-ready page templates removed, apart from the not-ready reason; the kit test passes here and fails onmain. - Changeset: a not-ready template's name typed as the idea no longer empties the kit. Verified for
MessagingShell(0 to 3 pages, 0 to 5 blocks);incident-consolestays empty, as it is without the template. - Changeset: when the idea names a not-ready template that search matches directly, the reason still says it is not ready yet. Verified on 14 ideas, each with the same reason as on
main; the reason test passes here and fails onmain. - Changeset:
astryx searchstill lists every template. Verified: its template results equalmain's on 32 ideas, withisReady: falseon not-ready ones. - Description: not-ready templates raised
matchCount. Verified (by 1 to 9 on 25 of 32 ideas). - Description: an idea that is such a template's whole name made search answer with it alone, so the kit came back empty. Verified (
MessagingShellandincident-consoleeach matched one entry onmain). - Description: those templates took result places and moved tied order, so adding or removing one could change page and block lists. Verified in the ranker, which reads every candidate for its whole-name, named-floor and mention decisions; in output, only the whole-name case reproduced on 78 ideas.
- Description: build filtered not-ready templates out only after search had ranked with them. Verified in
main's build kit. - Description:
searchCoregains an internal, default-offreadyTemplatesOnlythat only build sets, and other callers are unchanged. Verified (search.mjs:128-186,signals.mjs:193; not exported). - Description: build's re-cap and page-match filter go. Verified (
signals.mjs). - Description: the not-ready reason keeps its condition, with one more search only when the idea names a not-ready template outright. Verified (
signals.mjs:139-149,:223-231). - Description: build's search reads search's existing not-ready mark and drops only page templates, so not-ready blocks stay. Verified (
search.mjs:146; the not-ready block test passes). - Description:
matchCountno longer counts not-ready templates, and its note goes. Verified (build.type.mjs:79). - Description: the tests listed (a new search test, the kit test on a fixture project, the re-cap test removed,
matchCountcompared with the option). Verified. - Description: the fixture evidence (kit equality, the named reason below a stronger not-ready template, readiness flips cold and warm, ready templates sharing a not-ready word, byte-equal search). Verified: those tests pass at this head.
- Description: the kit tests fail on
main. Verified: the kit test file fails onmain(3 of 5 tests; the flip and shared-word tests pass there too), and so does the search test file (1 of 2). - Description: the replay results (equal to the catalog without not-ready templates; no start or alternative change against
main). Verified on 78 ideas; the replay set and its block-pick figure are not in the repository. - Description: the stated vitest command, eslint and strict tsc pass. Verified: 41 files and 505 tests pass (the CLI not-ready test included); eslint is clean; strict tsc reports nothing in the changed files.
- Scope: no new public API, and
readyTemplatesOnlyis internal and off by default. Verified. - Scope: public text holds no internal context. Verified.
Files:
.changeset/build-ready-templates-only.md: clear.packages/cli/api/build/_adapter.mjs: clear.packages/cli/api/build/build.test.mjs: clear (thematchCountcomparison changes; the rest is line wrapping).packages/cli/api/build/build.type.mjs: clear.packages/cli/api/build/kit/signals.mjs: clear.packages/cli/api/build/kit/unready-blocks.test.mjs(deleted): clear; the fixture kit test covers it.packages/cli/api/build/kit/unready-search.test.mjs: clear.packages/cli/api/search/ready-templates-only.test.mjs: clear.packages/cli/api/search/search.mjs: clear.
User impact
astryx buildstarts only from ready page templates, but templates that are not ready yet still shaped what build read from search: they took result places, moved the order of tied results, raisedmatchCount, and an idea that was exactly such a template's name (MessagingShell,incident-console) made search answer with that template alone, so build's kit came back empty. Adding or removing a not-ready template could therefore change build's page list and block suggestions for unrelated ideas.Problem and solution fit
searchCoregainsreadyTemplatesOnly, off by default. With it, search leaves the page templates whose doc saysisReady: falseout of the entries it ranks, so they take no place, move no order and add nothing to the count, exactly as if they were absent. Build sets it.astryx searchand every other caller are unchanged and still list every template.Build's own not-ready handling of search's results goes: the wider search with a re-cap, and the filter on page matches. Build's reason for a not-ready template the idea names (
spec:AST-048FR4) keeps its condition: the idea names the template outright and search matches it directly. Because the kit's search leaves not-ready templates out, build runs one more search that keeps them, only when the idea names one outright.Expected behavior and authority
spec:AST-048FR4: build starts only from ready page templates; when the idea names a not-ready template, the reason says it is not ready yet.Smallest restoration
_notReady, which it also reports as each result'sisReady); build's ready-only search reads that mark.search/search.mjs:readyTemplatesOnlyleaves marked page templates out before ranking (kept per gathered catalog); not-ready blocks stay, as before.build/kit/signals.mjs,build/_adapter.mjs: build sets the option; the re-cap and page filter are removed; the named-not-ready reason checks the not-ready names first and confirms search's direct match with a search that keeps them.build/build.type.mjs:matchCountno longer counts not-ready templates, so its note saying so is removed.search/ready-templates-only.test.mjs(new);build/kit/unready-search.test.mjsrewritten on a fixture project;build/kit/unready-blocks.test.mjsremoved (it tested the re-cap);build/build.test.mjscomparesmatchCountwith the option.Evidence
tally-sheetbeside a not-readytally, and every such pair in Core's catalog) keeps the ready template's own reason. Search with the option equals search without the template, byte for byte; search without the option lists it. The kit tests fail on main.Scope
Components: cli (search, build)
readyTemplatesOnlyis an internal option ofsearchCore, off by default.)Testing
vitest run --project node packages/cli/api/build packages/cli/api/search packages/cli/test/experimental-isolation.test.mjs packages/cli/test/json-contract.test.mjs: pass.eslintandtsc -p tsconfig.strict.jsonon the changed files.