Skip to content

fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme - #12282

Closed
josephfarina wants to merge 7 commits into
mainfrom
josephfarina/theme-check-ignores-cli-release
Closed

josephfarina wants to merge 7 commits into
mainfrom
josephfarina/theme-check-ignores-cli-release

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

User impact

theme build writes a header into each output, and the header names the CLI release that built it (CLI: @astryxdesign/cli@<version>). theme build --check and doctor's theme-local-builds check compared that line as content. So outputs built by one CLI release were stale to every other release, even when every byte of the output was the same:

$ npx astryx theme build src/themes/team/teamTheme.ts --check
[fail] 6 theme output(s) are out of date with src/themes/team/teamTheme.ts:
$ npx astryx doctor
fail theme-local-builds  Local theme outputs are missing or stale: team.

That turns every update of the CLI that answers into a rebuild of every local theme, whose only change is the header line, and in some setups into a flip back and forth:

  • In an app with Core but no CLI of its own, the CLI that answers is the one the person or tool started: a global install, which updates on its own schedule, or a tool that runs the CLI for its users and moves to each new release.
  • Two people on different global releases rebuild the same theme in turn, each making the other's copy stale.
  • In a project with its own CLI, a patch update of the CLI fails theme build --check in CI until someone rebuilds, for a header-only change.

A built theme module's doc comment has the same problem with the command name: * <name> theme — built by \ theme build`. A module built while the CLI ran under one command name (a package runner, or a tool that runs the CLI for its users under its own name) is stale when checked under another, though only that name differs. In a check of 24 agent-built apps, the 8 that failed theme-local-builds` differed from a fresh build in only these two kinds of line.

After this change, neither line decides staleness: the CLI: line is left out, and the command in a built module's one built-by line is compared as a placeholder, as integration verify already does. The same outputs built by another CLI release, or under another command name, check clean. The header still names the release that built each output, the module still names the command, the Core: line still counts, the theme name on the built-by line still counts, and so does every change to real content.

Problem and solution fit

  1. Why does it happen? normalizeThemeBuildForCompare drops only the header's Command: line before comparing; the CLI: and Core: lines compared verbatim, on the assumption that the toolchain is the project's.
  2. Why does it harm the task? A check that fails on every CLI update with nothing to fix trains people and agents to rebuild by reflex, and it hides the real drift it exists to catch.
  3. Why does that matter? With a CLI installed for the computer, and tools that run the CLI for their users, the CLI release is not the project's choice, so the header line is history, not a requirement.

Expected behavior and authority

  • spec:AST-050 FR8 (--check), amended in this pull request: "--check compares each output with what the build writes from the theme's inputs now, the header's Core: line included. An output's header also names the CLI release that built it, and a built module's comment names the command that built it. Those two lines alone never make an output stale: an output that another CLI release or another command built checks clean when everything else matches."
  • spec:AST-081 FR1: one release gives the same files through every door; this makes outputs from different releases agree when their content does.

Smallest restoration

  • api/theme/build/build.mjs: withoutBuildCommandLine (CRLF as LF, without the Command: line) is split out of normalizeThemeBuildForCompare, which now also compares the release in the header's one CLI: line as <version> and the command in a built module's one built-by line as <command>. A header with no CLI: line or with two, and a CLI:-like line outside the header, stay significant. withBuiltByCommandPlaceholder and withCliReleasePlaceholder (with generatedHeaderEnd, the header's bounds), BUILT_BY_LINE and CLI_VERSION_LINE live here. doctor's check uses the same comparison.
  • api/integration/pack-check.mjs: integration verify's own normalization now starts from withoutBuildCommandLine and calls the same generatedHeaderEnd, withCliReleasePlaceholder and withBuiltByCommandPlaceholder, so the two checks share one rule for each of those lines, and verify behaves exactly as before.

Evidence

  • An app with its own CLI and a local theme (theme eject neutral, built and added): up to date, and theme-local-builds passes. Then the same CLI with only its version raised, as the next release with no theme change would be: before, --check fails on all 6 outputs and theme-local-builds fails; with only these files changed, --check is up to date and the check passes.
  • A check of 24 agent-built apps whose local themes were built through a tool that runs the CLI under its own command name: 8 failed theme-local-builds under a newer CLI, and in each, the only lines that differed from a fresh build were the header's CLI: line and the built module's built-by command. With this head and the pull request that makes theme build read the Core it builds with, installed as the CLI for the computer, all 24 apps pass every check with no rebuild (0 failing, was 8).
  • Regression tests: outputs whose headers name another CLI release are up to date, and so is a module whose built-by line names another command; content drift beside another release's header is stale; outputs whose headers name another Core are stale. The --check comparison leaves out only the CLI line's release and the built-by command: a Core, Source, body or theme-name difference still differs, and so does a missing or second CLI: line, or one outside the header.

Scope

Components: CLI (theme build --check, doctor's theme-local-builds)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

  • One record change: three sentences in FR8, in present tense, stating what --check compares, what the header's CLI line and a built module's command line record, and that those two lines alone never make an output stale; no history or project status.

Testing

  • With CI=1: vitest run --project node over api/theme/build/build.test.mjs, api/integration/pack-check.test.mjs and api/doctor/theme-checks.test.mjs: 3 files, 318 passed and 1 skipped.
  • tsc --project tsconfig.strict.json: no error in the changed files; pnpm check:knowledge passes.

…lt a theme

Each theme output's header names the CLI release that built it. --check and
doctor's theme-local-builds compared that line as content, so every update of
the CLI that answers marked every local theme stale, though a rebuild changed
only that line. The comparison now leaves out the header's CLI line; the Core
line and all real content still count. AST-050 FR8 states the rule.
@vercel

vercel Bot commented Nov 17, 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 18, 2026 12:52am UTC

Request Review

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

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 1:11 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 69ffc2c

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.30 MB packed (+1.4 kB); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded cancelled; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

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

Waiting on a spec decision: the code does what it says, since with the header's CLI: line ignored, theme build --check and doctor pass outputs that another CLI release built, and a different Core: line still fails them.

Approval needs an engineering-owner decision on the sentence this pull request adds to spec:AST-050 FR8: "An output's header names the CLI release that built it. That line alone never makes an output stale: an output that another CLI release built checks clean when everything else matches." No current spec claim already says whether that header line counts, so an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.

Blocking, independent of that decision:

  • The Testing section names api/integration/verify.test.mjs, which does not exist in the repository, so name the test file that actually timed out or drop that sentence.

A non-blocking note on the CLI: filter's scope is inline.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Changeset: theme build --check and doctor no longer call outputs stale only because another CLI release built them: verified (new test in build.test.mjs; doctor runs the same check).
  • Changeset: each output's header still names the CLI release that built it: verified (the header writer in build.mjs is unchanged).
  • Changeset: before, every CLI update made every local theme stale although only that line changed: verified (the new test fails on the base).
  • Changeset: the answering CLI can be a global install or a tool that runs it: verified (the global-mode spec's rule for projects without their own CLI).
  • Description: --check and doctor compared the CLI: line as content on the base: verified (the base comparison dropped only the Command: line).
  • Description: afterwards the Core: line and real content still count: verified (the new test's Core case and a terminal run).
  • Description: withoutBuildCommandLine is split out and integration verify behaves as before: verified (same filter; pack-check tests pass).
  • Description: FR8 is amended with the quoted sentence: verified; it is not yet approved.
  • Description: the cited global-mode FR1 says one release gives the same files through every door: accurate, but it covers a single release only.
  • Description: the manual before/after evidence: consistent (reproduced with a four-output theme).
  • Description: the build and pack-check suites pass (236, 1 skipped) and the doctor theme suite passes (79): verified.
  • Description: api/integration/verify.test.mjs times out locally: false, no such file exists.
  • Description: strict typecheck and the knowledge check pass: verified.
  • Description: no new public API and no internal context: verified (unchanged API surface; no residue).
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: needs an engineering-owner decision on the new FR8 sentence.
  • packages/cli/api/integration/pack-check.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: non-blocking note on the filter's scope.
  • packages/cli/api/theme/build/build.test.mjs: clear (fails on the base, passes on the head).

Automated review (maintainer link)

Comment thread packages/cli/api/theme/build/build.mjs Resolved
…ot the CLI line

AST-050 FR8 now says what --check compares: each output against what the
build writes from the theme's inputs, the header's Core line included. Tests
cover a CLI-line-only difference (not stale), content drift beside another
release's header (stale), a Core-line difference (stale), and pack-check's
build comparison leaving out only the CLI line.
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): a theme output is stale when the theme's inputs or the output's content differ. The output header's CLI release line only records which release built the file, so a difference in that line alone never makes an output stale; the header's Core line and the content still count. theme build --check and doctor's local theme-build check follow that rule, spec:AST-050 FR8 states it, and pack-check stays strict for everything except that one line. Tests cover a release-line-only difference (not stale), a Core-line difference (stale) and a content difference (stale).

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 701b273

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

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

Changes requested: the code does what it says, and the spec:AST-050 FR8 amendment it rests on is approved by an engineering owner at this head, so one description claim is all that stands in the way.

  • The Testing section names api/integration/verify.test.mjs, which does not exist in the repository, so name the test file that actually timed out or drop that sentence.

While you edit the description, update its test count (237 passed and 1 skipped in the two named files at this head) and quote the whole amended FR8 passage, including the new Core: sentence. A description-only edit keeps the existing spec approval; a new commit needs a new /approve-spec. CI's Node test legs stopped before running any test because the repository-wide Node suite plans past its time budget; this change adds no test file and does not cause that.

Claims and files checked

Review mode: full; reason: spec-record

  • Changeset: theme build --check and doctor no longer call a local theme's outputs stale only because another CLI release built them: verified (new tests in build.test.mjs and pack-check.test.mjs fail on the base and pass here; doctor runs the same check).
  • Changeset: each output's header still names the CLI release that built it: verified (the header writer in build.mjs is unchanged).
  • Changeset: before, every update of the answering CLI marked every local theme stale although a rebuild changed only that line: verified (the real CLI exits 1 on the base for a CLI:-line-only difference).
  • Changeset: that CLI can be a global install or a tool that runs it: verified (the global-mode spec answers a project without its own CLI with the copy that started the run).
  • Description: the header names the CLI release, and the base compared that line as content because the comparison dropped only the Command: line: verified (base normalizeThemeBuildForCompare).
  • Description: the quoted failure messages of --check and doctor: verified (both strings exist in the source).
  • Description: in a project without its own CLI, with people on different global releases, or after a patch update of a project's CLI, the check failed for a header-only change: verified by the same base failure.
  • Description: after the change the CLI: line no longer decides staleness, while the Core: line and content still count: verified (tests and a scratch-theme run).
  • Description: FR8 is amended with the quoted sentence: verified, though the quote predates the second commit, which also adds the Core: sentence.
  • Description: the global-mode spec's FR1 says one release gives the same files through every door: verified as a paraphrase; it covers one release, not different releases.
  • Description: withoutBuildCommandLine is split out, --check also leaves out the CLI: line, and doctor uses the same comparison: verified.
  • Description: integration verify behaves exactly as before: verified (its normalizer's input is byte-for-byte the old one; its tests pass).
  • Description: an app with 6 outputs flips from stale to up to date: consistent (reproduced with a 4-output scratch theme, not with that app).
  • Description: the regression test covers another CLI release (up to date) and another Core (stale): verified.
  • Description: build and pack-check tests, 236 passed and 1 skipped: stale count, 237 passed and 1 skipped at this head; doctor theme checks, 79 passed: verified.
  • Description: api/integration/verify.test.mjs times out locally: false, no such file exists.
  • Description: strict typecheck has no error in the changed files, and the knowledge check passes: verified.
  • Description: no new public API, and no internal context in public text: verified (no surface change in any published package).
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: clear (owner-approved at this head).
  • packages/cli/api/integration/pack-check.mjs: clear.
  • packages/cli/api/integration/pack-check.test.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: non-blocking note on the CLI: filter's whole-file scope (existing inline thread).
  • packages/cli/api/theme/build/build.test.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8254cb4

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

Changes requested: the code does what it says, and the spec:AST-050 FR8 amendment it rests on is approved by an engineering owner at this head, so one description claim is all that stands in the way.

  • The Writing rubric results line says the record change is one sentence, but the FR8 amendment adds three sentences, so correct the count or drop it.

A description edit keeps the existing spec approval; a new commit needs a new /approve-spec. CI's Node test legs stopped before running any test because the repository-wide Node suite plans past its time budget; this change adds no test file and does not cause that. The non-blocking note on the CLI: filter's scope stays inline.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset: theme build --check and doctor no longer call a local theme's outputs stale only because another CLI release built them: verified (new tests in build.test.mjs and pack-check.test.mjs fail on the base and pass here; a real local theme fork checks clean after a CLI version change).
  • Changeset: each output's header still names the CLI release that built it: verified (the header writer in build.mjs is unchanged).
  • Changeset: before, every update of the answering CLI marked every local theme stale although a rebuild changed only that line: verified (on the base, a CLI version change alone fails all six outputs and doctor's check).
  • Changeset: that CLI can be a global install or a tool that runs it: verified (the global-mode spec answers a project without its own CLI with the copy that started the run).
  • Description: the header names the CLI release, and --check and doctor compared that line as content because the comparison dropped only the Command: line: verified (base normalizeThemeBuildForCompare).
  • Description: the quoted --check and doctor failure messages: verified (both strings exist in the source).
  • Description: in a project without its own CLI, with people on different global releases, or after a patch update of a project's CLI, the check failed for a header-only change: verified by the same base failure.
  • Description: after the change the CLI: line no longer decides staleness, while the header still names the release and the Core: line and content still count: verified (tests and real CLI runs).
  • Description: the base compared the CLI: and Core: lines verbatim on the assumption that the toolchain is the project's: verified (base doc comment).
  • Description: FR8 is amended with the quoted passage: verified (word for word, spec.md:231-235).
  • Description: the global-mode spec's FR1 says one release gives the same files through every door: verified as a paraphrase; it covers one release.
  • Description: withoutBuildCommandLine is split out, --check also leaves out the CLI: line, and doctor uses the same comparison: verified.
  • Description: integration verify behaves exactly as before: verified (its normalizer's input is byte-for-byte the old one; its tests pass).
  • Description: an app with its own CLI and an ejected neutral theme goes from six stale outputs and a failing doctor check to up to date and passing when only the CLI version changes: verified (reproduced on the base and here).
  • Description: the regression tests cover another CLI release (up to date), content drift beside it (stale) and another Core (stale), and the comparison leaves out only the CLI: line: verified.
  • Description: one defect restored, no tagalongs, no new public API or default, and no internal context in public text: verified (no surface change in any published package).
  • Description: Writing rubric, one record change in present tense stating the rule and its consequence with no history or project status: verified; "one sentence": false, the amendment adds three sentences.
  • Description: build and pack-check tests, 237 passed and 1 skipped; doctor theme checks, 79 passed: verified (same counts here).
  • Description: strict typecheck has no error in the changed files, and the knowledge check passes: verified.
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: clear (owner-approved at this head).
  • packages/cli/api/integration/pack-check.mjs: clear.
  • packages/cli/api/integration/pack-check.test.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: non-blocking note on the CLI: filter's whole-file scope (existing inline thread).
  • packages/cli/api/theme/build/build.test.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec c029708

@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: the theme build --check and doctor change does what it says, and the spec:AST-050 FR8 amendment it rests on is approved by an engineering owner at this head.

CI's Node test legs stopped before running any test because the repository-wide Node suite plans past its time budget; this change adds no test file and does not cause that, but the merge still waits for the required checks to pass. The earlier description count is fixed, and the non-blocking note on the CLI: filter's whole-file scope stays inline.

Claims and files checked

Review mode: incremental; reason: none

  • Changeset: theme build --check and doctor no longer call a local theme's outputs stale only because another CLI release built them: verified (the new tests in build.test.mjs and pack-check.test.mjs fail on the base and pass here; a real local theme fork checks clean after a CLI version change).
  • Changeset: each output's header still names the CLI release that built it: verified (the header writer in build.mjs is unchanged).
  • Changeset: before, every update of the answering CLI marked every local theme stale although a rebuild changed only that line: verified (on the base, a CLI version change alone fails all six outputs and doctor's check).
  • Changeset: that CLI can be a global install or a tool that runs it: verified (the global-mode spec answers a project without its own CLI with the copy that started the run).
  • Description: the header names the CLI release, and --check and doctor compared that line as content because the comparison dropped only the Command: line: verified (base normalizeThemeBuildForCompare).
  • Description: the quoted --check and doctor failures: verified (the --check line matches the source; the doctor line abbreviates the real [fail] theme-local-builds - Local theme build freshness - … output with the same message).
  • Description: in a project without its own CLI, with people on different global releases, or after a patch update of a project's CLI, the check failed for a header-only change: verified by the same base failure.
  • Description: after the change the CLI: line no longer decides staleness, while the header still names the release and the Core: line and content still count: verified (tests and real CLI runs).
  • Description: the base compared the CLI: and Core: lines verbatim on the assumption that the toolchain is the project's: verified (base doc comment).
  • Description: FR8 is amended with the quoted passage: verified (word for word, spec.md:231-235).
  • Description: the global-mode spec's FR1 says one release gives the same files through every door: verified as a paraphrase; it covers one release.
  • Description: withoutBuildCommandLine is split out, --check also leaves out the CLI: line, and doctor uses the same comparison: verified.
  • Description: integration verify behaves exactly as before: verified (its normalizer's input is byte-for-byte the old one; its tests pass).
  • Description: an app with its own CLI and an ejected neutral theme goes from six stale outputs and a failing doctor check to up to date and passing when only the CLI version changes: verified (reproduced on the base and here).
  • Description: the regression tests cover another CLI release (up to date), content drift beside it (stale) and another Core (stale), and the comparison leaves out only the CLI: line: verified.
  • Description: one defect restored, no tagalongs, no new public API, visual, default or interaction model, and no internal context in public text: verified (no surface change in any published package).
  • Description: Writing rubric, one record change of three present-tense sentences stating what --check compares, what the CLI line records and that this line alone never makes an output stale, with no history or project status: verified.
  • Description: build and pack-check tests, 237 passed and 1 skipped; doctor theme checks, 79 passed: verified (316 passed and 1 skipped over the three files here).
  • Description: strict typecheck has no error in the changed files, and the knowledge check passes: verified (the two strict typecheck errors are unbuilt-theme imports in two page templates).
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: clear (owner-approved at this head).
  • packages/cli/api/integration/pack-check.mjs: clear.
  • packages/cli/api/integration/pack-check.test.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: non-blocking note on the CLI: filter's whole-file scope (existing inline thread).
  • packages/cli/api/theme/build/build.test.mjs: clear.

Automated review (maintainer link)

A built module's doc comment names the command that built it. Modules built
while the CLI ran under one command name (a package runner, or a tool that
runs the CLI for its users) were stale under any other, though only that name
differed. The --check comparison now treats that command as a placeholder, as
integration verify already does; the theme name on the line still counts.
BUILT_BY_LINE moves to build.mjs and pack-check imports it. AST-050 FR8 says
both lines alone never make an output stale.
@josephfarina josephfarina changed the title fix(cli): theme build --check and doctor ignore which CLI release built a theme fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): provenance is not an input. spec:AST-050 FR8 ends: "An output's header also names the CLI release that built it, and a built module's comment names the command that built it. Those two lines alone never make an output stale: an output that another CLI release or another command built checks clean when everything else matches." The theme name and the content still count. Tests cover a module built under a different command name (clean), a different theme name (stale) and a content difference (stale).

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec ce038da

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

Changes requested: the theme build --check and doctor change does what it says, and the spec:AST-050 FR8 amendment it rests on is approved by an engineering owner at this head, but one piece of logic is copied instead of shared.

  • normalizeThemeBuildForCompare (packages/cli/api/theme/build/build.mjs:876-881) copies the one-built-by-line placeholder that normalizeThemeVerifyForCompare already implements (packages/cli/api/integration/pack-check.mjs:133-138); export one helper beside BUILT_BY_LINE and call it from both, so theme build --check and integration verify cannot drift apart on that line.

The fix is a new commit, so an engineering owner comments /approve-spec again for that head. Two non-blocking notes are inline: two comments still list only the Command: and CLI: lines, and the CLI: filter covers the whole file rather than the header.

Claims and files checked

Review mode: full; reason: spec-record

  • Changeset: theme build --check and doctor no longer call outputs stale only because another CLI release built them or the CLI ran under another command name: verified (the new tests fail on the base and pass here; real CLI runs in an app with a local theme).
  • Changeset: each output's header still names the release, and a built module still names the build command: verified (the writers in build.mjs are unchanged).
  • Changeset: before, every update of the answering CLI marked every local theme stale: verified (on the base, a difference in the CLI: lines alone fails all six outputs and doctor's check).
  • Changeset: so did building under one command name and checking under another: verified (on the base, a difference in the built-by command alone fails the module and doctor's check).
  • Changeset: that CLI can be a global install or a tool that runs it: verified (the global-mode spec answers a project without its own CLI with the copy that started the run, and the CLI-command picker names a tool's command).
  • Description: the header names the CLI release, and --check and doctor compared that line as content: verified (the base comparison dropped only the Command: line).
  • Description: the quoted --check and doctor failures: verified (the --check line matches the source; the doctor line abbreviates the real output with the same message).
  • Description: a global install, two people on different releases, or a patch update in CI each fail the check for a header-only change: verified by the same base failure.
  • Description: a built module's comment names the command, and a module built under one command name is stale under another: verified (base behavior and the red-first tests).
  • Description: in a check of 24 agent-built apps, the 8 failures differed only in these two kinds of line: not reproducible here (the apps are not in the repository); the two kinds are exactly the two lines the change normalizes.
  • Description: after the change neither line decides staleness, while the header and module still name them and the Core: line, theme name and content still count: verified (tests and real CLI runs).
  • Description: the base compared the CLI: and Core: lines verbatim on the assumption that the toolchain is the project's: verified (the base doc comment).
  • Description: the app-themes spec's FR8 is amended with the quoted passage: verified (word for word).
  • Description: the global-mode spec's FR1 has one release give the same files through every door: verified as a paraphrase.
  • Description: withoutBuildCommandLine is split out, --check leaves out the CLI: line and compares the built-by command as a placeholder, BUILT_BY_LINE moves into build.mjs, and doctor uses the same comparison: verified, but the placeholder code is copied rather than shared (blocking finding).
  • Description: integration verify behaves exactly as before: verified (same input, same pattern; its tests pass).
  • Description: an app with its own CLI and a local theme goes from six stale outputs and a failing doctor check to up to date and passing when only the CLI version changes: verified (reproduced on the base and here).
  • Description: the regression tests cover another release, another command, content drift, another Core, and a Core, Source, body or theme-name difference: verified.
  • Description: one defect restored, no tagalongs, no new public API, visual, default or interaction model, and no internal context in public text: verified (no surface change in any published package).
  • Description: Writing rubric, one record change of three present-tense sentences with no history or project status: verified.
  • Description: build and pack-check tests 238 passed and 1 skipped, doctor theme checks 79 passed: verified (317 passed and 1 skipped over the three files here).
  • Description: strict typecheck has no error in the changed files, and the knowledge check passes: verified.
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: clear (owner-approved at this head).
  • packages/cli/api/integration/pack-check.mjs: keeps its copy of the built-by placeholder (part of the blocking finding).
  • packages/cli/api/integration/pack-check.test.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: blocking copied placeholder (:876-881); non-blocking stale comments (:50-53, :6255-6257) and whole-file CLI: filter (:875).
  • packages/cli/api/theme/build/build.test.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme/build/build.mjs Resolved
Comment thread packages/cli/api/theme/build/build.mjs Resolved
Comment thread packages/cli/api/theme/build/build.mjs Resolved
…header's one CLI line counts as provenance

withBuiltByCommandPlaceholder is the one rule for the built-by line, called by
theme build --check and integration verify. --check now replaces the release in
the header's one CLI line instead of dropping every CLI line, so a missing or
second CLI line, or one outside the header, stays significant. Comments name
the built-by command.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec ef701bb

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

Changes requested: the theme build --check and doctor change works, the built-by rule is now shared, and the spec:AST-050 FR8 amendment is approved by an engineering owner at this head, but the new header-only CLI: rule is a second copy of logic integration verify already has.

  • normalizeThemeBuildForCompare (packages/cli/api/theme/build/build.mjs:893-905) re-implements the header bounds, the exactly-one CLI: line guard and the <version> placeholder that normalizeThemeVerifyForCompare already applies (packages/cli/api/integration/pack-check.mjs:120-141); export one helper beside withBuiltByCommandPlaceholder and call it from both normalizers, so the two checks cannot drift apart on that line.

The three earlier findings are fixed. The fix is a new commit, so an engineering owner comments /approve-spec again for that head.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Changeset: theme build --check and doctor no longer call outputs stale only because another CLI release built them or the CLI ran under another command name: verified (tests that fail on the base pass here; real CLI runs in an app with a local theme).
  • Changeset: each output's header still names the release, and a built module still names the build command: verified (the writers in build.mjs are unchanged).
  • Changeset: before, every update of the answering CLI marked every local theme stale: verified (on the base, a difference in the CLI: lines alone fails all six outputs and doctor's check).
  • Changeset: so did building under one command name and checking under another: verified (on the base, a difference in the built-by command alone fails the module and doctor's check).
  • Changeset: that CLI can be a global install or a tool that runs it: verified (the global-mode spec answers a project without its own CLI with the copy that started the run).
  • Description: the header names the CLI release, and --check and doctor compared that line as content: verified (the base comparison dropped only the Command: line).
  • Description: the quoted --check and doctor failures: verified (the messages match the source and the real output).
  • Description: a global install, two people on different releases, or a patch update in CI each fail the check for a header-only change: verified by the same base failure.
  • Description: a built module's comment names the command, and a module built under one command name is stale under another: verified (base behavior and the tests).
  • Description: in a check of 24 agent-built apps, the 8 failures differed only in these two kinds of line, and all 24 pass with this change and another pull request installed globally: not reproducible here (the apps are not in the repository); the two kinds are exactly the lines the change normalizes.
  • Description: after the change neither line decides staleness, while the header and module still name them and the Core: line, theme name and content still count: verified (tests and real CLI runs).
  • Description: the base compared the CLI: and Core: lines verbatim on the assumption that the toolchain is the project's: verified (the base doc comment).
  • Description: the app-themes spec's FR8 is amended with the quoted passage: verified (word for word).
  • Description: the global-mode spec's FR1 has one release give the same files through every door: verified as a paraphrase.
  • Description: withoutBuildCommandLine is split out; --check compares the header's one CLI: release and the module's one built-by command as placeholders; a missing, second or out-of-header CLI: line stays significant; the helpers live in build.mjs; doctor uses the same comparison: verified, but the one-CLI:-line rule is copied from the verify normalizer rather than shared (blocking finding).
  • Description: integration verify starts from withoutBuildCommandLine, calls the same built-by helper, and behaves exactly as before: verified (same filter and guards; its tests pass).
  • Description: an app with its own CLI and a local theme goes from six stale outputs and a failing doctor check to up to date and passing when only the CLI version changes: verified (reproduced here).
  • Description: the regression tests cover another release, another command, content drift, another Core, a Source, body or theme-name difference, and a missing, second or out-of-header CLI: line: verified.
  • Description: one defect restored, no tagalongs, no new public API, visual, default or interaction model, and no internal context in public text: verified (no surface change in any published package).
  • Description: writing rubric, one record change of three present-tense sentences with no history or project status: verified.
  • Description: the build, pack-check and doctor theme tests give 318 passed and 1 skipped: verified (same count here).
  • Description: strict typecheck has no error in the changed files, and the knowledge check passes: verified.
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: clear (owner-approved at this head).
  • packages/cli/api/integration/pack-check.mjs: keeps its own copy of the one-CLI:-line rule (part of the blocking finding); the built-by rule is shared.
  • packages/cli/api/integration/pack-check.test.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: blocking copied one-CLI:-line rule (:893-905).
  • packages/cli/api/theme/build/build.test.mjs: clear.

Automated review (maintainer link)

Comment thread packages/cli/api/theme/build/build.mjs Resolved
withCliReleasePlaceholder (with generatedHeaderEnd) is the one rule for the
header's CLI line: the release becomes <version> when the header holds exactly
one. theme build --check and integration verify both call it.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 69ffc2c

@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: the theme build --check and doctor change does what it says, the spec:AST-050 FR8 amendment is approved by an engineering owner at this head, and the earlier finding about a second copy of the header CLI: line rule is fixed. CI's run on this head was refused for capacity ("CI is full"), so its required checks have not run yet: re-run all jobs, and the merge waits for them to pass.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Changeset: theme build --check and doctor no longer call outputs stale only because another CLI release built them or the CLI ran under another command name: verified (tests that fail on the merge base pass here; real CLI runs).
  • Changeset: each output's header still names the release, and a built module still names the build command: verified (the writers are unchanged; the head build writes both lines).
  • Changeset: before, every update of the answering CLI marked every local theme stale: verified (on the base, a difference in the CLI: lines alone fails every output).
  • Changeset: so did building under one command name and checking under another: verified (on the base, a difference in the built-by command alone fails the module).
  • Changeset: that CLI can be a global install or a tool that runs it: verified (the global-mode spec answers a project without its own CLI with the copy that started the run).
  • Description: the header names the CLI release, and --check and doctor compared that line as content: verified (the base comparison dropped only the Command: line).
  • Description: the quoted --check and doctor failure messages: verified (they match the source and the base output).
  • Description: a global install, two people on different releases, or a patch update in CI each fail the check for a header-only change: verified by the same base failure.
  • Description: a built module's comment names the command, and a module built under one command name is stale under another: verified (base behavior and tests).
  • Description: in a check of 24 agent-built apps, the 8 failures differed only in these two kinds of line, and all 24 pass with this change and another pull request installed globally: not reproducible here (the apps are not in the repository); the two kinds are exactly the lines the change normalizes.
  • Description: after the change neither line decides staleness, while the header and module still name them and the Core: line, theme name and content still count: verified (tests and real CLI runs).
  • Description: the base compared the CLI: and Core: lines verbatim on the assumption that the toolchain is the project's: verified (the base doc comment).
  • Description: the app-themes spec's FR8 is amended with the quoted passage: verified (word for word).
  • Description: the global-mode spec's FR1 has one release give the same files through every door: verified as a paraphrase.
  • Description: withoutBuildCommandLine is split out; --check compares the header's one CLI: release and the module's one built-by command as placeholders; a missing, second or out-of-header CLI: line stays significant; the helpers live in build.mjs; doctor uses the same comparison: verified.
  • Description: integration verify starts from withoutBuildCommandLine, calls the same header-bounds, CLI: and built-by helpers, and behaves exactly as before: verified (same guards and output; its unchanged tests pass).
  • Description: an app with its own CLI and a local theme goes from every output stale to up to date when only the CLI version changes: verified with a four-output local theme; doctor runs the same check.
  • Description: the regression tests cover another release, another command, content drift, another Core, a Source, body or theme-name difference, and a missing, second or out-of-header CLI: line: verified.
  • Description: one defect restored, no tagalongs, no new public API, visual, default or interaction model, and no internal context in public text: verified (no surface change in any published package).
  • Description: writing rubric, one record change of three present-tense sentences with no history or project status: verified.
  • Description: the build, pack-check and doctor theme tests give 318 passed and 1 skipped: verified (same count here).
  • Description: strict typecheck has no error in the changed files, and the knowledge check passes: verified.
  • .changeset/theme-check-ignores-cli-release.md: clear.
  • docs/specs/AST-050-app-themes/spec.md: clear (owner-approved at this head).
  • packages/cli/api/integration/pack-check.mjs: clear (calls the shared header-bounds, CLI: and built-by helpers).
  • packages/cli/api/integration/pack-check.test.mjs: clear.
  • packages/cli/api/theme/build/build.mjs: clear (one rule per provenance line).
  • packages/cli/api/theme/build/build.test.mjs: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12072 fix(templates): payment form and checkout wrap the summary below the form on a narrow first paint
  Author: Joey Farina <[email protected]>
- #12274 fix(core): cap the Selector family's trigger-width list minimum at the viewport
  Author: josephfarina <[email protected]>
- #12215 fix(cli): advise keeping one dependency when two packages declare one provider ID
  Author: Joey <[email protected]>
- #12322 [experimental] export --reverse: use the project's own copy of an aliased file, or restore the page's copy with its paths entry
  Author: josephfarina <[email protected]>
- #12403 docs(core): Text's as and PowerSearch's statusVariant list every value their types allow
  Author: Joey Farina <[email protected]>
- #12494 fix(templates): dashboard templates use page sections, not cards, for page regions
  Author: Joey Farina <[email protected]>
- #12282 fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme
  Author: Joey Farina <[email protected]>
- #12420 fix(Chat): ChatToolCalls and ChatDictationButton without a required prop name it and the fix in development
  Author: Joey Farina <[email protected]>
- #12205 fix(cli): equally scored icons put first one whose id the query names in full
  Author: Joey Farina <[email protected]>
- #12455 fix(core): a theme sets the room between a checkbox or a switch and its label
  Author: josephfarina <[email protected]>
- #12658 perf(cli): the first theme build after a CLI upgrade reuses the JavaScript it compiled from a theme's local modules
  Author: Joey <[email protected]>
- #12323 [experimental] export: React logs no render timings while the export draws a page
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12713.

@github-actions
github-actions Bot deleted the josephfarina/theme-check-ignores-cli-release branch November 19, 2026 06:04
cixzhang added a commit that referenced this pull request Nov 21, 2026
Main now hides the command on a built module's built-by line (#12282, by
Joey Farina), which was this branch's core, and a build now always names
`astryx theme build` there. Main hides the command only when the module
has exactly one such line. A theme family has one line per member, so a
family an earlier release built with another command still read as out of
date.

This merge keeps main's normalization and changes withBuiltByCommandPlaceholder
to hide the command on every member's line, unless two lines name the same
theme. integration verify shares the helper. The branch's own pack-check and
AST-050 changes are dropped: AST-050 already says that another command never
makes an output stale.
cixzhang added a commit that referenced this pull request Nov 22, 2026
… of a theme family (#11542)

* fix(cli): theme build --check ignores which package manager built the theme

* Merge remote-tracking branch 'origin/main' into fix/theme-check-ignores-runner

* chore(cli): credit the theme --check changeset

* Merge remote-tracking branch 'origin/main' into fix/theme-check-ignores-runner

* refactor(cli): integration verify relies on the shared built-by normalization

* Merge remote-tracking branch 'origin/main' into fix/theme-check-q

* docs(spec): AST-050 FR8 — --check and integration verify ignore the built-by command

* Merge remote-tracking branch 'origin/main' into fix/theme-check-ignores-runner

# Conflicts:
#	packages/cli/api/integration/pack-check.test.mjs

* fix(cli): theme build --check also ignores the command on each family member's built-by line; FR8 scopes verbatim provenance to --check

* Merge main and reshape to the family residual

Main now hides the command on a built module's built-by line (#12282, by
Joey Farina), which was this branch's core, and a build now always names
`astryx theme build` there. Main hides the command only when the module
has exactly one such line. A theme family has one line per member, so a
family an earlier release built with another command still read as out of
date.

This merge keeps main's normalization and changes withBuiltByCommandPlaceholder
to hide the command on every member's line, unless two lines name the same
theme. integration verify shares the helper. The branch's own pack-check and
AST-050 changes are dropped: AST-050 already says that another command never
makes an output stale.

* fix(cli): hide the command on every built-by line, and say so in the doc comments

A second built-by line for one theme already differs from a fresh build,
so the guard for it changed no result; the helper now hides the command on
every line. The doc comments of normalizeThemeBuildForCompare and
normalizeThemeVerifyForCompare name one line per theme. The drift cases
check that their build succeeded. Prettier formats two lines main left
unformatted in build.mjs.

This branch was successfully deployed

1 active deployment
Preview — 69ffc2c6 Deployed Nov 18, 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