Skip to content

fix(cli): build's start reads only ready page templates from search - #11940

Merged
josephfarina merged 2 commits into
mainfrom
josephfarina/build-ready-only-starts
Nov 16, 2026
Merged

josephfarina merged 2 commits into
mainfrom
josephfarina/build-ready-only-starts

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What changes

astryx build starts 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: chooseStart takes that name as an optional argument; the reason still reads "incident-console isn't ready yet, so build started from …."
  • AST-048 FR4: 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

  • R1 narration: none; FR3, FR4, DEC-10 and DEC-12 describe present behavior.
  • R2 research: none in the record.
  • R3 evidence: FR4's verification row (build kit tests for a not-ready direct match) covers the added sentence.
  • R4 rejected alternatives: none added.
  • R5 change references: none in the record.
  • R6 open questions: none touched.
  • R7 project status: none.

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, pages and 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.

@vercel

vercel Bot commented Nov 15, 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 15, 2026 11:53pm UTC

Request Review

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

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 16, 2026, 12:06 AM UTC

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

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:77 still says directMatch is false when search's direct match is not ready, but build now returns true there (for example for data 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 table now takes its direct match from table-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 table moves 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).
  • chooseStart takes 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, pages and 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: leaves build.type.mjs:77 stale.
  • 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.

Automated review (maintainer link)

Comment thread packages/cli/api/build/kit/signals.mjs Resolved
? proposed
: weighed === null
? isAppShell(proposed) || (proposed && direct && !unreadyMatch)
? isAppShell(proposed) || (proposed && direct)

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.

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.

@josephfarina
josephfarina changed the base branch from josephfarina/build-ready-matches to main November 15, 2026 23:25
@josephfarina
josephfarina force-pushed the josephfarina/build-ready-only-starts branch from 66b3dc5 to 3c0a72d Compare November 15, 2026 23:29
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 3c0a72d

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 3c0a72d

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@josephfarina
josephfarina enabled auto-merge (squash) November 15, 2026 23:44
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8cc4e10

@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: 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-213 still 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-247 still says the start is chosen from every match, and its startable re-filter repeats isReady, so shownDirect always equals directMatch; building pages from matchedPages lets 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 table now starts from table-grouped instead 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.

Automated review (maintainer link)

r.score >= PAGE_FLOOR &&
covers(r),
);
const matchedPages = pageMatches.filter(isReady).slice(0, 3);

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.

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.

This branch was successfully deployed

1 active deployment
Preview — 8cc4e107 Deployed Nov 15, 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