Repository navigation
ci: a visual gate a test runs builds no theme into the checkout - #11355
Conversation
The gate's loadThemeOverrides builds any theme whose dist/source.mjs is missing (pnpm -F <theme> build in the repository). gate-context.test.mjs runs the gate as a Node test, and Node legs build no themes, so that test rebuilt all eight theme packages in place mid-leg. Neutral's build deletes dist, writes neutral.js, then icons.mjs, so a CLI run resolving Neutral at the same time saw it missing or half written: door-conformance's bin and host runs of 'theme editor new --like neutral' diverged. ASTRYX_VISUAL_GATE_READ_ONLY=1, set only by the Node test project (vitest.config.ts), makes the gate build nothing: it reads the themes that are built and names the rest in the verdict (context.themesNotBuilt). The visual-gate job never sets it and keeps building what it cannot read. Prettier formats gate.mjs and sources.mjs, which Lint checks once changed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 118.9 | 118.9 | 0 |
| Runner pool, runner-minutes a day | 54,138 | 54,138 | 0 (0%) |
| Average concurrent jobs | 37.6 | 37.6 | 0 |
| Time to green (median → this run) | 25.2 min | 18.2 min | −7 min |
| Runs a day | 455 | 455 | 0 |
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/visual-gate/gate-context.test.mjs, .github/scripts/visual-gate/gate.mjs, .github/scripts/visual-gate/lib/sources.mjs, .github/scripts/visual-gate/lib/sources.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved pending CI: CI has not run on this draft yet, and marking it ready for review starts it.
The read-only switch is scoped the way the description says. Only the node Vitest project sets ASTRYX_VISUAL_GATE_READ_ONLY, and no workflow does, so the visual-gate job still builds the themes it cannot read. A built theme that fails to load still fails. There are no blocking findings.
Claims and files checked
- Door-conformance failed on two unrelated pull requests because its bin and host runs of the
--like neutraltheme example disagreed: not reproduced here; the mechanism matches the code, because door-conformance runs every command example, and that example needs Neutral's built package. - The gate's theme loader builds any theme it cannot read with
pnpmin the repository: verified (lib/sources.mjs, build path). gate-context.test.mjsruns the gate as a Node test in legs that build no themes, so it rebuilt the theme packages in place: verified by reading the test and thenodeproject configuration.- Neutral's build deletes
dist, writes the theme files, then has tsup writeicons.mjs: verified (packages/themes/neutral/package.jsonbuild script,tsup.config.ts). - A process watcher caught the gate's Neutral build mid-leg: a runtime observation, not reproducible from the repository.
- The switch makes the gate build nothing and list unbuilt themes in
context.themesNotBuilt: verified (lib/sources.mjs:150-166,gate.mjs:555-557and:670-672). - Only the Node test project sets the switch, and the visual-gate job never does: verified (
vitest.config.ts:207; no workflow mentions it;ci.ymlrunsgate.mjsdirectly). - A built theme that fails to load still fails as a broken build: verified (
lib/sources.mjs:152-163,lib/sources.test.mjs:168-185). - No timeout, retry or door-conformance assertion changes: verified (only these five files change).
- Prettier formats
gate.mjsandlib/sources.mjs, which were not Prettier-clean on main, and Lint checks changed files: verified (Lint's changed-file Prettier step; the base files had lines past Prettier's 80-column width). Formatting is most of those two files' change and about half of the whole diff. - The listed
lib/sources.test.mjsandgate-context.test.mjscases exist and assert what the description says: verified by reading (lib/sources.test.mjs:62-185,gate-context.test.mjs:247-292). - The new cases fail on main's code because main calls
pnpm: verified by reading, not run. - All 20 cases pass with theme dists absent: the count is verified (12 and 8); the run was not reproduced here.
- No new jobs or workflows, and the visual-gate job is unchanged: verified (no workflow file changes).
.github/scripts/visual-gate/gate.mjs: clear..github/scripts/visual-gate/lib/sources.mjs: clear..github/scripts/visual-gate/gate-context.test.mjs: clear..github/scripts/visual-gate/lib/sources.test.mjs: clear.vitest.config.ts: clear.
There was a problem hiding this comment.
Changes requested: one claim in the description is false.
- Miss: the description and commit message say Lint's changed-file formatting check requires reformatting
gate.mjsandlib/sources.mjs, but that check, like the pre-commit hook, only covers.ts,.tsxand.mdfiles (.github/workflows/lint.yml:336), so either drop the formatting-only hunks or reword the claim to call them optional cleanup.
The read-only switch itself works as described: only the node Vitest project sets it, no workflow does, a built theme that fails to load still fails, and both changed test files pass in CI. Optional: the CI impact section could give before and after minutes for the Node legs, as AST-030 FR19 lists.
Claims and files checked
- Door-conformance failed on two unrelated pull requests because its bin and host runs of the Neutral theme example disagreed: a runtime report, not reproduced; the mechanism matches the code, since that example needs Neutral's built package.
- The gate's theme loader builds any theme it cannot read with
pnpmin the repository: verified (lib/sources.mjs, build path). - The gate-context test runs the gate in Node legs, which build no themes, so it rebuilt all eight theme packages in place: verified (the
nodeproject's global setup builds Core only; eight folders underpackages/themes). - Neutral's build deletes
dist, writes the theme files, then has tsup writeicons.mjs: verified (Neutral's build script andtsup.config.ts). - A process watcher caught the gate's Neutral build mid-leg: a runtime observation, not reproducible from the repository.
- The switch makes the gate build nothing and name unbuilt themes in
context.themesNotBuilt: verified (lib/sources.mjs:151-166,gate.mjs:555-557and:670-672); the markdown summary does not name them and the run still exits 0. - Only the Node test project sets the switch, and the visual-gate job never does: verified (
vitest.config.ts:207; no workflow mentions it;ci.ymlrunsgate.mjsdirectly). - A built theme that fails to load still fails as a broken build: verified (
lib/sources.mjs:152-163,lib/sources.test.mjs:168-185). - No timeout, retry or door-conformance assertion changes: verified (only these five files change).
gate.mjsandsources.mjswere not Prettier-clean on main: verified by line width (57 and 18 lines past Prettier's 80 columns); Prettier was not run.- Lint's changed-file formatting check requires the reformatting: false (
.github/workflows/lint.yml:336checks.ts,.tsxand.mdonly). - Prettier alone changes 192 and 45 lines of those files, and the change itself is 20 and 31 lines: not verified by running Prettier; formatting-only blocks come to 177 and 39 lines by comparison.
- Formatting is most of the diff: true for those two files (about three quarters); about half of the whole diff.
- The listed
lib/sources.test.mjsandgate-context.test.mjscases exist and assert what the description says: verified (lib/sources.test.mjs:62-185,gate-context.test.mjs:247-292). - The new cases fail on main's code: verified by reading (main exports no
readOnlyGate, and its gate callspnpm); not run. - All 20 cases pass with this change: verified in CI (12 and 8 cases passed).
- No new jobs or workflows, and the visual-gate job is unchanged: verified (no workflow file changes).
.github/scripts/visual-gate/gate.mjs: the read-only wiring is clear; its formatting-only hunks rest on the false claim above..github/scripts/visual-gate/lib/sources.mjs: the read-only branch is clear; same formatting finding..github/scripts/visual-gate/gate-context.test.mjs: clear..github/scripts/visual-gate/lib/sources.test.mjs: clear.vitest.config.ts: clear.
The earlier commit reformatted gate.mjs, lib/sources.mjs and lib/sources.test.mjs with Prettier and said Lint required it. That was wrong: Lint's changed-file formatting step and the pre-commit hook cover .ts, .tsx and .md only. These files now keep main's formatting, and the change is only the read-only switch, the themesNotBuilt verdict field and their tests.
There was a problem hiding this comment.
Approved pending CI: the first CI run on this head was cancelled because CI was full, and the re-run has not finished, so the required checks have not reported here yet.
The earlier blocking finding is fixed: gate.mjs and lib/sources.mjs now keep main's formatting, and the description no longer says Lint requires reformatting them. The read-only switch works as described, and both changed test files passed in CI on the previous revision, whose code differs from this head only in formatting. Optional: the CI impact section could give before and after minutes for the Node legs, as AST-030 FR19 lists.
Claims and files checked
- Door-conformance failed on two unrelated pull requests because its bin and host runs of the Neutral theme example disagreed: a runtime report, not reproduced; the mechanism matches the code, since that example resolves Neutral's built package.
- The gate's theme loader reads each theme's built source and builds any it cannot read with
pnpmin the repository: verified (lib/sources.mjs:152-166). - The gate-context test runs the gate as an ordinary Node test and Node legs build no themes, so it rebuilt all eight theme packages in place: verified (the
nodeproject's global setup builds Core only; eight folders underpackages/themes). - Neutral's build deletes
dist, writes the theme files, then has tsup writeicons.mjs: verified (Neutral's build script andtsup.config.ts). - A process watcher caught the gate's Neutral build mid-leg: a runtime observation, not reproducible from the repository.
- The switch makes the gate build nothing, read the built themes and name the rest in
context.themesNotBuilt, a typed field: verified (lib/sources.mjs:113,:145-151;gate.mjs:210,:509,:604); the verdict's status, the exit code and the markdown summary do not change. - Only the Node test project sets the switch, and the visual-gate job runs the gate directly and never sets it: verified (
vitest.config.ts:207; no workflow names it;ci.ymlrunsgate.mjsdirectly). - A built theme that fails to load still fails as a broken build: verified (
lib/sources.mjs:146-147,lib/sources.test.mjs:135-146). - No timeout, retry or door-conformance assertion changes: verified (only these five files change).
gate.mjschanges 13 lines andlib/sources.mjs28, and the files keep their own formatting: verified (+10/−3 and +27/−1; the import line stays as on main).- The listed
lib/sources.test.mjsandgate-context.test.mjscases exist and assert what the description says: verified (lib/sources.test.mjs:59-146,gate-context.test.mjs:247-292). - The new cases fail on main's code: verified by reading (main exports no
readOnlyGate, and its gate callspnpm, which the stub fails); not run. - With the change and theme dists absent, all 20 cases pass and no dist is created: verified in CI on the previous revision, whose code differs from this head only in formatting (12 and 8 cases passed).
- The partial run under load saw no theme
distappear: a runtime observation, not reproduced. - No new jobs or workflows, and the visual-gate job is unchanged: verified (no workflow file changes).
- The latest commit message says Lint's changed-file formatting step and the pre-commit hook cover only
.ts,.tsxand.md: verified (.github/workflows/lint.yml:336;lint-stagedinpackage.json). .github/scripts/visual-gate/lib/sources.mjs: clear..github/scripts/visual-gate/gate.mjs: clear..github/scripts/visual-gate/lib/sources.test.mjs: clear..github/scripts/visual-gate/gate-context.test.mjs: clear.vitest.config.ts: clear.
Who this helps
Anyone whose pull request runs the Node test legs.
packages/cli/host/door-conformance.test.mjsfailed on unrelated pull requests (#10592, #11283): its bin and host runs ofastryx experimental theme editor new brand --like neutraldisagreed. The bin run said "The neutral theme is not installed"; the host run said "Cannot find module packages/themes/neutral/dist/icons.mjs imported from dist/neutral.js".Root cause
The visual gate's
loadThemeOverrides(.github/scripts/visual-gate/lib/sources.mjs) reads every theme's builtdist/source.mjs, and builds any theme it can't read withpnpm -F <theme> buildin the repository. That's right for the visual-gate job.But
gate-context.test.mjsruns the gate as an ordinary Node test, and the Node legs build no themes. So that test rebuilt all eight theme packages in place, mid-leg. Neutral's build deletesdist, writesneutral.js, then has tsup writeicons.mjs. A CLI run that resolved Neutral during that build found it missing or half written.Caught live: a process watcher on
packages/themes/neutral/dist, running the files that shared #11283's leg, sawpnpm -F @astryxdesign/theme-neutral build, started bygate.mjs checkfromgate-context.test.mjs, producedist/neutral.jswith noicons.mjs.What changes
ASTRYX_VISUAL_GATE_READ_ONLY=1makes the gate build nothing. It reads the themes that are built and names the rest in the verdict ascontext.themesNotBuilt, a typed field, so a run with missing themes is never a silent pass.vitest.config.ts), so every gate a test runs inherits it. The visual-gate job runs the gate directly and never sets it, so there the gate keeps building what it can't read.Size
gate.mjschanges 13 lines: one import, onethemesNotBuiltlist, that list passed at the two existingloadThemeOverridescalls, and the field on the two verdicts it writes.lib/sources.mjschanges 28: the switch and the read-only branch. The files keep their own formatting.Tests
lib/sources.test.mjs:gate-context.test.mjs: a gate run on the component-scope path, with a stubpnpmfirst on its PATH:pnpm;distas it was;pnpmto build. Main's run also rebuilds the real theme dists through the other component-scope cases, which is the bug itself. With this change and theme dists absent, all 20 cases pass and no dist is created.distappeared. On main, the same run had the gate build Neutral mid-run. The run was stopped early to get this change out.CI impact
+0 jobs, +0 workflows. The Node legs stop building eight theme packages inside a test (several minutes of CPU on a loaded runner). The visual-gate job is unchanged.