Repository navigation
fix(cli): build's start reads only ready page templates from search - #11940
Conversation
|
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.
Approval waits on an engineering owner deciding this pull request's AST-048 amendments: FR4's new sentence that a not-ready template never changes which template build starts from, and "search matched no ready template directly" in FR3, DEC-10 and DEC-12. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The text on main today lets a not-ready top search match keep the app shell, so this moves starts such as astryx build "data table" (app shell to table-grouped, with directMatch now true).
Also needed:
packages/cli/api/build/build.type.mjs:77still saysdirectMatchis false when search's direct match is not ready, but build now returns true there (for example fordata table), so the published type doc contradicts the response.- The description's "Measured" section points to a replay comment that is not on this pull request, so post those results or put them in the description.
- FR4's verification row (
docs/specs/AST-048-build-recommendation/spec.md:269) names no failure for the new MUST NOT, so add a start, direct match or shell lift that changes when a not-ready template leads search.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: a not-ready template is no longer build's direct match: verified (
signals.mjs:200,:223-224;data tablenow takes its direct match fromtable-collapsible). - Changeset: a not-ready template no longer keeps an idea on the app shell: verified (the new test fails on the base for
employee intranet portal home;data tablemoves off the shell). - Build reads only ready page matches, and a not-ready one is never listed: verified (
signals.mjs:191-201). - A not-ready template the idea names is passed on for the reason alone: verified (
signals.mjs:202-208,start.mjs:167-168). chooseStarttakes that name as an optional argument and keeps the "isn't ready yet" reason: verified (start.mjs:159,:227,:250).- AST-048 FR3, DEC-10 and DEC-12 say "no ready template", and FR4 adds the new sentence: verified (
spec.md:84,:94-96,:416,:453). - The spec approval on this pull request records the decision: not yet, since no approval exists at this head.
- Measured: a comment lists which starts move: false, since no such comment exists.
- Rubric R3: FR4's verification row covers the added sentence: false, since the row's failure column does not name it.
- Rubric R1, R2 and R4 to R7: verified (present tense; no research, alternatives, change references, open questions or status added).
- The new test keeps start,
directMatch,pagesand blocks unchanged and never mentions the injected template, and fails before this change: verified (fails on the base, passes at this head). - An idea that names the template gets the not-ready reason and the same start: verified (passes at this head).
- Build, CLI text and related tests pass: verified for the suites run (build 193 passed; text, template, response-type and debug suites 124 passed). The exact 246 count was not reproduced.
- File
.changeset/build-ready-only-starts.md: clear. - File
docs/specs/AST-048-build-recommendation/spec.md: awaiting owner approval; verification row gap. - File
packages/cli/api/build/kit/signals.mjs: leavesbuild.type.mjs:77stale. - File
packages/cli/api/build/kit/start.mjs: clear apart from a stale "ready or not" comment (non-blocking). - File
packages/cli/api/build/kit/unready-search.test.mjs: clear.
| ? proposed | ||
| : weighed === null | ||
| ? isAppShell(proposed) || (proposed && direct && !unreadyMatch) | ||
| ? isAppShell(proposed) || (proposed && direct) |
There was a problem hiding this comment.
Non-blocking: the comment just below (lines 212-213) still says "A direct match, ready or not, keeps the start and reason it already has". direct is now always a ready template, so "ready or not" can go.
66b3dc5 to
3c0a72d
Compare
|
/approve-spec 3c0a72d |
PR Analysis Report🔎 Preview ·
|
… ready-only start
|
/approve-spec 8cc4e10 |
There was a problem hiding this comment.
Approved pending CI: most of the CI workflow's test-node shards and docsite-browser had not finished on this head yet.
astryx build now ignores not-ready page templates when it picks its direct match and decides on the shell lift, as the amended AST-048 FR3, FR4, DEC-10 and DEC-12 say, and an engineering owner approved those amendments at this head. The new test fails before the change and passes after it. Two optional cleanups:
packages/cli/api/build/kit/start.mjs:211-213still says a direct match keeps its start "ready or not", but the direct match is now always ready.packages/cli/api/build/kit/signals.mjs:233-247still says the start is chosen from every match, and itsstartablere-filter repeatsisReady, soshownDirectalways equalsdirectMatch; buildingpagesfrommatchedPageslets both go.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Title, build's start reads only ready page templates from search: verified (
signals.mjs:191-200). - Changeset, the start comes from ready templates only and a not-ready template is no longer the direct match or keeps an idea on the app shell: verified (
signals.mjs:200,:223-224;data tablenow starts fromtable-groupedinstead of the shell). - Signals read only ready page matches, never list a not-ready one, and pass a directly matched, named one on for the reason alone: verified (
signals.mjs:191-208,:278-287). - The start function takes that name as an optional argument and keeps the not-ready reason: verified (
start.mjs:147-168; the new test's second case). - The record adds the FR4 sentence and says "no ready template" in FR3, DEC-10 and DEC-12: verified (
spec.md:84-85,:94-96,:416,:453). - The record describes the shipped rule and the spec approval records the decision: verified (an engineering owner's spec approval at this head).
- Replay measurements (starts that move, quality judgments, label sets, hold-out runs): not checkable, since the replay sets are not in the repository; an independent 40-idea replay agrees in direction, with one start moving from the shell to a table page and none the other way.
- A not-ready template's own words move no start: verified by reading the code (the start and alternatives read only ready templates' own scores,
signals.mjs:200,:223-224,:267-305). - The new test fails before this change: verified (its first case fails on the base and passes at the head; the second case passes on both, as described).
- Build, CLI text and theme-stress tests pass: partly verified (build kit 193 and build CLI text, playbook, error-code and debug 32 pass at the head; theme-stress not run).
- Writing rubric R1 to R7: verified (present tense; FR4's verification row names the new failure,
spec.md:269).
Files:
.changeset/build-ready-only-starts.md: clear.docs/specs/AST-048-build-recommendation/spec.md: clear.packages/cli/api/build/build.type.mjs: clear.packages/cli/api/build/kit/signals.mjs: non-blocking, stale comment and dead re-filter at 233-247.packages/cli/api/build/kit/start.mjs: non-blocking, stale comment at 211-213.packages/cli/api/build/kit/unready-search.test.mjs: clear.
| r.score >= PAGE_FLOOR && | ||
| covers(r), | ||
| ); | ||
| const matchedPages = pageMatches.filter(isReady).slice(0, 3); |
There was a problem hiding this comment.
Non-blocking: matchedPages is now ready-only, so the block at lines 233-247 is stale. Its comment says "The start is still chosen from every match (chooseStart)", and startable repeats isReady, which makes shownDirect always equal directMatch. Consider building pages from matchedPages, returning directMatch, and dropping startable, shownDirect and that sentence.
What changes
astryx buildstarts only from ready page templates, but a template that is not ready yet could still steer which ready template it started from: when search ranked it first with a direct-match score, it became build's direct match, which holds back the shell lift and changes the start's reason; a not-ready template's own description could therefore move other requests' starts.kit/signals.mjs: build reads only search's ready page matches. A not-ready template is never build's direct match and never in the list the start is chosen from. When the idea names a not-ready template that search matched directly, its name is passed on for the reason alone.kit/start.mjs:chooseStarttakes that name as an optional argument; the reason still reads "incident-consoleisn't ready yet, so build started from…."AST-048FR4: a not-ready template does not change which template build starts from; FR3, DEC-10 and DEC-12 say "search matched no ready template directly", so only a ready template is the direct match that holds the shell. The record describes the rule this PR's code ships (the spec approval on this PR records the decision).Measured
On our private evaluation sets, the starts that move are mostly requests a not-ready template steered; the quality check rates the moved starts better, with none worse, and nothing moves on the newest requests. A fair cold-start check passes: held-out templates' own starts are unchanged and the overall count is within noise.
Writing rubric results
Tests
New
kit/unready-search.test.mjs: with a not-ready template injected at the top of search's results with a direct-match score, the start,directMatch,pagesand blocks are unchanged for ideas that do not name it, and the response never mentions it (fails before this change); an idea that names it gets the not-ready reason and the same start. Build, CLI text and theme-stress tests: 246 passed, 1 skipped.