Repository navigation
fix(cli): a not-ready page template no longer takes a search result place in build's kit - #11968
Conversation
Build's kit search asks for one more result per page template that is not ready yet, sets those entries aside, and keeps the same number of results, so a not-ready template never takes the place of a ready page, a block or a component. The named-not-ready reason now finds the template the idea names wherever it ranks among search's page matches.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Requesting changes for one wording fix; the code change itself looks right and is well tested.
- The changeset (
.changeset/build-unready-as-if-absent.md, line 5) says the page list, the block suggestions "and the rest of the kit" are what they would be without a not-ready template, butdata.matchCountanddata.hasResultsstill count a matching not-ready template, asbuild.type.mjsnow documents; please narrow the sentence, for example: "…so the page list, the block suggestions and the components are what they would be without it;matchCountstill counts it."
The new tests fail on main and pass on this branch, and the start and the kit's page, block and component lists stay the same with or without Core's not-ready templates. The kit test's search mock keeps matchCount unchanged, which is why it does not catch the count difference; counting the injected entry there would keep the test honest.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Build reads search as if a not-ready page template were absent, so it no longer takes a result's place: verified (
kit/signals.mjs:156-177; the new kit test fails onmainand passes here). - The page list, the block suggestions and the rest of the kit are what they would be without it: false in part; the start, pages, blocks and components match, but
matchCountandhasResultsstill count it (kit/answer.mjs:95-96). - When the idea names a not-ready template, the reason still says so even if another not-ready template ranks above it: verified (
kit/signals.mjs:214-221;kit/unready-search.test.mjs:84-90fails onmain). - A not-ready template took one of search's capped result slots, so the last result fell off: verified (on
mainthe limit is applied before not-ready templates are dropped). - With a leading not-ready template,
build "export report"listed two dashboard pages instead of three and its reason named two: verified (the new test's failure onmain). - Build asks for one more result per not-ready page template, sets those entries aside and keeps the same number: verified (
kit/signals.mjs:156-177). - Search's scores do not depend on those entries, so the kit is exactly what it would be without them: partly verified; each entry's score is its own, but whole-name and named-run ordering reads every candidate (
search/_lexical.mjs:205,:321-347), andmatchCountdiffers; the kit lists matched in every idea tried. - The set-aside entries serve only the named-not-ready reason, which now finds the template wherever it ranks: verified (
kit/signals.mjs:177,:214-221). spec:AST-048FR4 governs the change: verified (FR4 covers the start and the reason; FR11 and the record's non-goals leave which blocks and pages appear to ranking).matchCountstays search's own total and its field doc says so: verified (build.type.mjs:76).- The change touches
kit/signals.mjs,_adapter.mjsand two tests as described: verified. - The new kit test changes the kit for four ideas before the fix and none after: verified after the fix; before the fix, the first idea fails and stops the loop.
- The named-not-ready case fails before the fix: verified.
- Replay results over 15,635 requests (52 block changes, accuracy unchanged, no change with an added not-ready template): not checked; the request set is not available.
- The build and search suites pass: verified (442 tests pass).
- eslint passes on the changed files: verified.
- One defect restored, no tagalongs, no hidden public API, no internal context: verified.
Files:
.changeset/build-unready-as-if-absent.md: finding (overstated kit claim).packages/cli/api/build/_adapter.mjs: clear.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: clear (its mock keepsmatchCount, noted above).packages/cli/api/build/kit/unready-search.test.mjs: clear.
…plate; the kit test checks it
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes for one remaining wording issue; the code change and its tests look right, and the earlier matchCount wording is fixed.
- Miss: the title, the changeset (
.changeset/build-unready-as-if-absent.md, line 5) and the description say the page list, the block suggestions and the components are what they would be without a not-ready template, but search still reads a one-word identifier idea differently while one exists (build "MessagingShell"returns no pages, blocks or components with Core's not-readymessaging-shellin the catalog, and 3 pages, 5 blocks and 6 components without it), so please word the claim as the slot fix it is, for example "…such a template no longer takes one of search's result places, so it no longer pushes a page, a block suggestion or a component out of the kit;matchCountstill counts it."
The earlier review suggested that wording and missed these ideas; main behaves the same way, so only the claim needs to change, unless search is changed to leave not-ready page templates out of how it reads the query for build. The new tests fail on main and pass on this branch, and the build and search suites pass.
Claims and files checked
Review mode: incremental; reason: none
Changeset claims:
- Build treats a not-ready page template as absent from search: false for a one-word identifier idea that names one (
MessagingShell,IncidentConsole); search decides how to read that idea from every template (search/_lexical.mjs:159-179). - Such a template no longer takes a search result's place: verified (
kit/signals.mjs:167,:177; the new kit test fails onmain). - So the page list, the block suggestions and the components are what they would be without it: false for those identifier ideas; verified for every multi-word idea tried.
matchCountstill counts it: verified (kit/signals.mjs:183,kit/answer.mjs:96).- When the idea names a not-ready template, the reason still says so even when another not-ready template ranks above it: verified (
kit/signals.mjs:214-221;kit/unready-search.test.mjs:84-90fails onmain).
Description claims:
- A not-ready template took one of search's capped result places, so the last result fell off: verified (on
mainthe cap applies before not-ready templates are dropped). - Adding one changed the page list and block suggestions for unrelated ideas: verified (the new kit test fails on
main). - With a leading not-ready template,
build "export report"listed two dashboard pages instead of three and its reason named two: verified (that failure onmain). - Search caps its results at the requested count and counts not-ready templates: verified.
- Build asks for one more result per not-ready template, sets those entries aside and keeps the same number of results: verified (
kit/signals.mjs:156-177). - Search's scores do not depend on those entries, so the kit is exactly what it would be without them: false for one-word identifier ideas (above).
- The set-aside entries serve only the not-ready reason, which now finds the named template wherever it ranks among search's page matches: verified (
kit/signals.mjs:214-221). - The start rule governs the change and the rest of the kit is ranking: verified (the build recommendation record's FR4, FR11 and non-goals).
matchCountstays search's own total and its field doc says so: verified (build.type.mjs:76).- The change touches
kit/signals.mjs,_adapter.mjsand two tests: verified. - Before the fix the new kit test changes the kit for four ideas, and after it the whole kit is identical: before, it fails on the first idea and stops; after, verified for the injected template apart from
matchCount, which the test expects to grow by one. - The named-not-ready case fails before the fix: verified.
- The replay over 15,635 requests (52 block changes, accuracy unchanged): not checked; the request set is not available.
- With another not-ready template added, the replay shows no change: not checked; the request set is not available.
- One defect restored, no tagalongs, no hidden public API, no internal context: verified.
- The build and search suites pass: verified (442 tests).
- eslint passes on the changed files: verified.
Files:
.changeset/build-unready-as-if-absent.md: finding (the kit claim is broader than the change).packages/cli/api/build/_adapter.mjs: clear.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: clear (it injects its template after search has ranked, so it cannot cover search's reading).packages/cli/api/build/kit/unready-search.test.mjs: clear.
There was a problem hiding this comment.
Requesting changes for one description fix; the code, its tests and the narrowed changeset look right, and the earlier changeset finding is fixed.
- Miss: the description's Evidence section says the new kit test changes the kit for four ideas before the fix, but on this branch's base only
export report(its page list) and the grouped-rows idea (its block order) change, while the settings and retention-cohort ideas give the same kit apart frommatchCount, so please say two ideas there or swap in two ideas whose kit changes before the fix.
This is a description edit; no code change is needed. The new tests fail before the fix and pass on this branch, and the build and search suites pass here and when merged into the current main.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Changeset: a not-ready page template no longer takes a place in the search results build reads: verified (
kit/signals.mjs:167,:177; the new kit test fails before the fix). - Changeset: so it no longer pushes a page, a block suggestion or a component out of the kit: verified for result places (
kit/unready-blocks.test.mjs, four of four ideas identical here); search's own reading of an identifier idea is outside it, as the description says. - Changeset:
matchCountstill counts it: verified (kit/signals.mjs:183; the test expects one more). - Changeset: the reason still names a not-ready template the idea names when another not-ready template ranks above it: verified (
kit/signals.mjs:214-221;kit/unready-search.test.mjs:84-90fails before the fix). - Title: a not-ready page template no longer takes a search result place in build's kit: verified (as above).
- Description: a not-ready template took one of search's capped places, so the last result fell off: verified (before the fix, search was capped at
max(limit, 200)and not-ready pages were dropped afterwards). - Description: adding one changed the page list and block suggestions for unrelated ideas: verified (
export reportand the grouped-rows idea before the fix). - Description: with a not-ready template matching the idea,
build "export report"listed two dashboard pages instead of three and the reason named two: verified (red-first failure). - Description: search caps at the requested count and counts not-ready templates: verified (
search/_lexical.mjs:407). - Description: build asks for one more result per not-ready template, sets them aside and keeps the same number: verified (
kit/signals.mjs:156-177). - Description: search can still read the query differently while a not-ready template exists, for example an idea that is exactly its identifier: verified (
search/_lexical.mjs:156-181;build MessagingShellreturns an empty kit here). - Description: the set-aside entries serve only the not-ready reason, which now finds the named template wherever it ranks: verified (
kit/signals.mjs:176-177,:214-221). - Description: the start rule governs, and the change extends it to the rest of the kit: verified as within the build record's ranking latitude (FR4, FR11, non-goals).
- Description:
matchCountstays search's total and its field doc says so: verified (build.type.mjs:76). - Description: the files the change touches: verified.
- Description: before the fix the new kit test changes the kit for four ideas: false (two; see above).
- Description: after the fix the kit is identical with and without the template, except
matchCount: verified (four of four ideas). - Description: the named-not-ready case keeps its start and reason and fails before the fix: verified.
- Description: the replay over about 15,600 requests (52 block changes, accuracy unchanged): not checked; the request set is not available.
- Description: the replay with another not-ready template added shows no change: not checked; same reason.
- Description: one defect restored, no tagalongs, no hidden public API, no internal context: verified.
- Description: the build and search suites pass (441 pass, 1 skipped): verified (442 pass here; the skip depends on host locale data).
- Description: eslint passes on the changed files: verified.
.changeset/build-unready-as-if-absent.md: clear (the earlier finding is fixed).packages/cli/api/build/_adapter.mjs: clear.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: clear; two of its four ideas also pass before the fix (the finding above).packages/cli/api/build/kit/unready-search.test.mjs: clear.
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head.
The earlier finding is fixed: the description now says that two of the new kit test's four ideas change before the fix and the other two are controls, which is what the base does. The code, its tests and the release note look right, and nothing else is needed from you; merging waits for the required checks.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Changeset: a not-ready page template no longer takes a place in the search results build reads: verified (
kit/signals.mjs:167,:177; the new kit test fails before the fix). - Changeset: so it no longer pushes a page, a block suggestion or a component out of the kit: verified for result places (
kit/unready-blocks.test.mjs, four of four ideas identical apart frommatchCount). - Changeset:
matchCountstill counts it: verified (kit/signals.mjs:183; the test expects one more). - Changeset: the reason still names a not-ready template the idea names when another not-ready template ranks above it: verified (
kit/signals.mjs:214-221;kit/unready-search.test.mjs:84-90fails before the fix). - Title: a not-ready page template no longer takes a search result place in build's kit: verified (as above).
- Description: build asks search for the kit with a result limit: verified (
kit/signals.mjs:156-168). - Description: a not-ready template took one of those places, so the last result fell off, with a ready page or a searched block: verified (before the fix, search was capped and not-ready pages were dropped afterwards;
export reportand the grouped-rows idea). - Description: adding a not-ready template changed the page list and block suggestions for unrelated ideas: verified (same two ideas before the fix).
- Description: with a not-ready template matching the idea,
build "export report"listed two pages instead of three and its reason named two: verified (failure before the fix). - Description: search caps at the requested count and counts not-ready templates: verified (
search/_lexical.mjs:407,:414; search's template gather keeps not-ready pages). - Description: the page list and block suggestions then depend on templates build does not use: verified.
- Description: build asks for one more result per not-ready template, sets them aside and keeps the same number: verified (
kit/signals.mjs:167,:174-177;_adapter.mjs:110-112). - Description: so a not-ready template no longer pushes a page, a block suggestion or a component out: verified for result places.
- Description: search can still read the query differently while a not-ready template exists, for example an idea that is exactly its identifier: verified (
build MessagingShellreturns no pages, blocks or components here). - Description: the set-aside entries serve only the not-ready reason, which now finds the named template wherever it ranks: verified (
kit/signals.mjs:177,:214-221). - Description: the build record's start rule governs, and the change extends it to the rest of the kit: verified as within the build record's ranking latitude (FR4, FR11, non-goals); the cited earlier fix is merged into the base.
- Description:
matchCountstays search's total and its field doc says so: verified (build.type.mjs:76). - Description: the files the change touches: verified.
- Description: before the fix, two of the new test's four ideas change (the
export reportpage list and the grouped-rows block order) and two are controls: verified (one test per idea on the base). - Description: after the fix, all four kits are identical with and without the template except
matchCount: verified. - Description: the named-not-ready case keeps its start and reason and fails before the fix: verified.
- Description: the replay over about 15,600 requests (no start or alternative change, 52 block changes, accuracy unchanged): not checked; the request set is not available, and no conclusion rests on it.
- Description: the replay with another not-ready template added shows no change: not checked; same reason.
- Description: one defect restored, no tagalongs, no hidden public API, no internal context: verified.
- Description: the build and search suites pass (441 pass, 1 skipped): verified (442 pass here; the skip depends on host locale data).
- Description: eslint passes on the changed files: verified.
.changeset/build-unready-as-if-absent.md: clear.packages/cli/api/build/_adapter.mjs: clear.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: clear (the earlier note on its two control ideas is resolved by the description).packages/cli/api/build/kit/unready-search.test.mjs: clear.
User impact
astryx buildasks search for the kit (page templates, blocks, components) with a result limit. A page template that is not ready yet is still a search match, so it took one of those result slots: the last result fell off, and with it a ready page from the page list or a searched block the block suggestions read. Adding a not-ready template to the catalog therefore changed build's page list and block suggestions for unrelated ideas, even though build never starts or lists it.For example, with a not-ready template whose docs match "export report",
build "export report"listed two dashboard pages instead of three, and its reason named two matches instead of three.Problem and solution fit
Build now asks search for one more result per not-ready page template in the project, sets the not-ready page entries aside, and keeps the same number of results, so a not-ready template no longer pushes a page, a block suggestion or a component out of the kit. This fixes the result places only: search can still read the query itself differently while a not-ready template exists (for example, an idea that is exactly a not-ready template's identifier), which is a separate gap. The only use of the set-aside entries is the existing reason that says a template the idea names is not ready yet; that reason now finds the named template wherever it ranks among search's page matches, not only when it ranks first.
Expected behavior and authority
spec:AST-048FR4 (after #11940): build starts only from ready page templates, and a not-ready template steers no start. This extends the same rule to the rest of the kit.matchCountstays search's own total of matches, so it still counts a not-ready template that matches; its field doc now says so.Smallest restoration
kit/signals.mjs: the wider search, the set-aside, and the named-not-ready reason's lookup._adapter.mjs:loadTemplatesalso reports how many page templates are not ready.kit/unready-blocks.test.mjs(new) and one case inkit/unready-search.test.mjs.Evidence
matchCount. After: all four kits are identical with and without it, exceptmatchCount, which counts it.Scope
Components: cli (build)
Testing
vitest run --project node packages/cli/api/build packages/cli/api/search: 441 pass, 1 skipped.eslinton the changed files.