Regenerate the stale framework candidate list and gate it - #3195
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
There was a problem hiding this comment.
Pull request overview
Regenerates the committed framework Tailwind candidate artifact and adds a --check gate to the generator pipeline so drift is detected early (via generate:manifests:check).
Changes:
- Regenerated
framework-candidates.generated.tsto match current extraction sources. - Added
--checksupport toprebundle-client-scripts.ts, including stale-file aggregation and stdin-based formatting for byte-stable comparisons. - Wired the new check into
deno task generate:manifests:check.
Verification
- Not run in this review environment (relies on the PR’s stated verification).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/server/handlers/dev/framework-candidates.generated.ts | Updates the generated candidate list to match current extractor output. |
| scripts/build/prebundle-client-scripts.ts | Adds --check mode and makes formatting/checking deterministic for generated TS artifacts. |
| deno.json | Ensures the new --check gate runs as part of generate:manifests:check. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kwakayama
enabled auto-merge
July 31, 2026 13:26
kwakayama
previously approved these changes
Jul 31, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Jul 31, 2026
framework-candidates.generated.ts was last regenerated at c6ffd43 (#3092). UI components have landed since — anchored-surface.tsx, disclosure.ts, floating.tsx, modal-surface.tsx — so the committed artifact no longer matches the sources it is extracted from. Running the real generator on a clean checkout of main produces a 27-token difference every time. That is why `deno task generate` has been dirtying otherwise-clean worktrees this session: every lane's test run regenerates this file correctly, and each one then has to notice and restore it before committing. The regeneration is deterministic, not flaky — the same 27 tokens appear on every machine. The token delta is entirely extractor noise: identifiers and comment prose ("warnedMissingAnchor", "React.Ref<HTMLButtonElement>", "including", "warns"), plus "positioning-anchor" which is a phrase from a JSDoc comment rather than a class name. The one dropped token, "Anchor", is likewise not a class. So no utility class was missing from the candidate set and no stylesheet output changes — the cost of this staleness was developer time, not CSS. Constraint: generated content only; the generator itself is unchanged in this commit. Tested: deno run -A scripts/build/prebundle-client-scripts.ts leaves the tree clean afterwards; deno test --no-check --allow-all src/server/handlers/dev/framework-candidates.generated.test.ts src/build/production-build/templates.test.ts src/html/styles-builder/ src/server/handlers/dev/ (35 passed, 371 steps).
Nothing caught the drift the previous commit fixed. prebundle-client-scripts.ts only ever wrote its two generated files, so a source change without a regenerate was invisible until someone noticed the file missing from a PR diff — which, for eight months, nobody did. It now takes --check, matching generate-templates-manifest.ts and generate-dev-ui-manifest.ts, and runs as part of generate:manifests:check. That is the first step of verify:quick, so drift now fails fast with the file name and a regenerate instruction. Both generated files are gated: templates.ts is in sync today and regenerates byte-identically from a copy another machine committed, which is the evidence that gating it will not be flaky. Two details worth knowing. Formatting moved from write-then-`deno fmt <path>` to `deno fmt -`, because --check has to compare against the same shape the write path lands on disk rather than the pre-format text; the emitted files are byte-identical to before. And stale files are collected rather than exited on at the first miss, so one run tells you everything that needs regenerating instead of making you rerun to find the second one. The check adds about 0.15s warm — esbuild is fast enough that gating this costs nothing measurable on verify:quick. Constraint: write-mode output unchanged; this adds a mode, it does not alter what gets generated. Tested: --check exercised in all three states — both files fresh (exit 0), candidates drifted (exit 1, names only that file, reports templates.ts as current), both drifted (exit 1, reports both); deno task generate:manifests:check; every verify:quick gate individually; deno run --allow-read --allow-run scripts/lint/check-test-typecheck-baseline.ts. Known pre-existing and untouched: lint:cli-boundary (cli/shared/deployment/_deploy-test-support.ts), docs:validate @example on src/release-assets/index.ts.
formatTypeScript threw "Failed to format generated output", which is unhelpful in a script that generates two files — templates.ts and framework-candidates.generated.ts go through the same helper, so the failure told you a format broke but not which artifact to look at. The path is already the caller's argument; it is now threaded through and named in the error, matching the message the pre-refactor writeFormattedTypeScriptFile produced before --check moved formatting to stdin. Not covered by a test: the branch only fires when `deno fmt` itself fails on generated output, which cannot be provoked without breaking the formatter. Constraint: no behaviour change on any successful path. Tested: write mode leaves both generated files byte-identical (only the script shows in git status); --check passes when fresh and exits 1 naming the drifted file; deno task fmt:check; deno task lint; deno task generate:manifests:check.
kojiwakayama
force-pushed
the
refactor/framework-candidates-freshness
branch
from
July 31, 2026 14:01
6030a0d to
ce12249
Compare
kwakayama
enabled auto-merge
July 31, 2026 14:19
kwakayama
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two commits:
framework-candidates.generated.ts— the committed artifact no longer matched its sources.--checktoprebundle-client-scripts.tsand wire it intogenerate:manifests:check, so this cannot silently recur.The staleness, and how it was found
framework-candidates.generated.tswas last regenerated atc6ffd43e5(#3092). UI components have landed since —anchored-surface.tsx,disclosure.ts,floating.tsx,modal-surface.tsx— so running the real generator on a pristine checkout ofmainproduces a 27-token difference, every time, on every machine.This surfaced as a workflow problem rather than a bug report. Across a multi-lane session,
deno task generate(whichdeno task testand the pre-push hook both run) kept dirtying otherwise-clean worktrees. Each lane independently hit it, diagnosed it as possible cross-worktree contamination or generator nondeterminism, and worked around it by restoring the file before committing. It is neither of those: every lane's regeneration was correct, and each one was producing content thatmainhad simply never committed.Honest scope: no CSS changed
The 27-token delta is entirely extractor noise — identifiers and prose lifted out of comments:
The one token that looks like a class,
positioning-anchor, is a phrase inside a JSDoc comment inanchored-surface.tsx, not aclassName. The single dropped token,Anchor, is likewise not a class.So no utility class was missing from the candidate set and no stylesheet output changes. The cost of this staleness was developer time and tree hygiene, not user-visible CSS. Worth stating plainly so the fix is not mistaken for a rendering bugfix.
The gate
prebundle-client-scripts.tsonly ever wrote its two generated files, so a source change without a regenerate was invisible until someone noticed the file missing from a PR diff — which, for months, nobody did.It now takes
--check, matching the existinggenerate-templates-manifest.tsandgenerate-dev-ui-manifest.ts, and runs as part ofgenerate:manifests:check— the first step ofverify:quick. Drift now fails fast, naming the file and the fix.Both generated files are gated.
templates.tsis in sync today and regenerates byte-identically from a copy another machine committed at0e2f403b5, which is the evidence that gating it will not be flaky.Two implementation details:
deno fmt <path>todeno fmt -, because--checkhas to compare against the same shape the write path lands on disk rather than the pre-format text. The emitted files are byte-identical to before — verified by running write mode and confirmingtemplates.tsdoes not appear ingit status.Cost: ~0.15s warm. esbuild is fast enough that gating this is free on
verify:quick.Verification
--checkexercised in all three states: both fresh (exit 0); candidates drifted (exit 1, names only that file, reportstemplates.tsas current); both drifted (exit 1, reports both).verify:quickgate individually, plus the test-typecheck baseline gate.deno testacrossframework-candidates.generated.test.ts,templates.test.ts,src/html/styles-builder/,src/server/handlers/dev/— 35 passed, 371 steps.deno task generateleft the working tree completely clean, where before it reliably dirtied it.deno.lockuntouched.Known pre-existing failures on
main, untouched by this PR:lint:cli-boundary(cli/shared/deployment/_deploy-test-support.ts) anddocs:validate(@exampleonsrc/release-assets/index.ts).