Skip to content

fix(cli): theme palette generate names a newer CLI's recipe and the update step - #12407

Closed
josephfarina wants to merge 7 commits into
mainfrom
cli-newer-palette-recipe
Closed

josephfarina wants to merge 7 commits into
mainfrom
cli-newer-palette-recipe

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What users see

astryx theme palette generate on a palette config made with a newer Astryx CLI, whose recipe this CLI does not know yet, stops with a message that says what happened and how to fix it. Before, the refusal said only Unknown palette recipe: astryx-oklch-v3 (known: astryx-oklch-v1, astryx-oklch-v2). Now, in an npm project:

Error: palette.config.json was made with a newer Astryx CLI: its colors use the astryx-oklch-v3 recipe, and this CLI (0.7.17) knows astryx-oklch-v1, astryx-oklch-v2. Update the CLI and bring the project's code to it with the commands below, in order; then run the command again. Nothing was changed.

  npm install @astryxdesign/core@latest @astryxdesign/cli@latest  (install the newest CLI)
  npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply  (then bring the project's code to it)

Outside a project, run through a package runner, with 0.7.18 the newest release the CLI knows:

Error: palette.config.json was made with a newer Astryx CLI: its colors use the astryx-oklch-v3 recipe, and this CLI (0.7.17) knows astryx-oklch-v1, astryx-oklch-v2. Run the command again with the newest CLI: npx @astryxdesign/[email protected] theme palette generate palette.config.json. Nothing was changed.

  npx @astryxdesign/[email protected] theme palette generate palette.config.json  (run the newest CLI)
  • The message names no astryx command. In a project the commands are two suggestions, in order: the install, then the codemod run. Text mode prints the codemod run with the command name the CLI picks; --json carries it bare (astryx upgrade --from 0.7.17 --apply).
  • The install fits where the CLI runs, as the update notices name it (cliUpdateStep in foundation/release/notices.mjs):
    • in a project, its CLI and Core move together to the newest release (or latest before the CLI knows one), with the project's package manager; a project that pins Core to one version keeps its pins (-E);
    • from a tool folder inside a project, both steps run in the project's folder;
    • outside a project, a global copy updates through the package manager that holds it, and a package runner's copy is run again at the newest known release, pinned, through the command picker, with the run's own command; with no newer release known, the step installs the newest CLI for the computer (npm i -g @astryxdesign/cli@latest). A run that a host's door or an integration's declared command started names the release it needs (or the newest release) and no command, because that command runs the CLI the host carries; its --json envelope carries no picked name. The command is repeated only when the CLI's own bin started the run; a program that calls the API in-process gets <command>, as does a run with no arguments.
  • The error code stays ERR_PALETTE_GENERATION. Outside a project the refusal has one suggestion, or none when a host's door or a declared command started the run; in a project, two.
  • A recipe that is not an Astryx one ("dusty") still gets the generator's own refusal. A newer recipe is an astryx-oklch-vN numbered past every recipe this CLI knows.

Scope

Components: cli, palette

How

api/theme/palette/generate/newer-recipe.mjs decides whether a recipe is a newer one and builds the refusal. The palette command checks the config's recipe before it generates. The engine and its messages are unchanged. foundation/release/run-context.mjs exports binStartedRun(), which cliUpdateStep reads before it repeats the process's arguments.

Tests

  • newer-recipe.test.mjs: a run a host door started outside a project names the release it needs, with no suggestion and no picked name in --json; which recipes count as newer; the command's refusal (the whole message, code and suggestion) outside a project; in a project, the message holds no bare astryx command and the suggestions are the install and the codemod run; --json carries every command bare; an unknown non-Astryx recipe keeps the generator's refusal. The refusal tests fail without the change.
  • notices.test.mjs: cliUpdateStep in a project (the newest release known, and not yet known, pinned and ranged), from a tool folder, and outside a project for a global copy and a package runner's copy (the whole pinned command, with and without arguments; the computer install when no newer release is known; a host's door gets no command); a run the bin did not start names <command>, not the host program's arguments, and a run the bin started repeats its command. The last test fails without the change.
  • The theme palette suites, the update notices and stable-output goldens pass. The five CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean.

preflight: pass 96eed55

@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 19, 2026 6:14pm UTC

Request Review

@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 19, 2026, 6:30 PM UTC

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 96b38e9

⏳ Building… Until it's ready, Storybook · Sandbox open the branch's previous preview.

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


Generated by PR Enrichment workflow | View current CI run

@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 new refusal explains a newer recipe clearly, but the update command it prints is wrong for most folders it runs in.

  • The update command at newer-recipe.mjs:47 installs only the CLI at latest in the run's folder, which inside a project moves the CLI past the project's Core (the mismatch doctor warns about), outside a project adds it to a local package.json instead of upgrading the copy that ran, in a tool folder with its own package.json turns that folder into a project, and in the theme editor uses the package manager of the process's folder rather than the project's, so build it with the shared upgrade helpers in foundation/release/notices.mjs, pass the editor's cwd through, and test the command in each of these states.

Not blocking: the message says the config "was made with a newer version of" whichever surface reads it, and "made with a newer Astryx CLI" fits both. Lint and the CLI smoke test pass. The main CI run was cancelled for lack of CI capacity, so it has not run on this head.

Claims and files checked

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

  • Claim: a config from a newer CLI is refused with its recipe and the recipes this CLI knows. Verified: newer-recipe.mjs:49, test lines 200-203.
  • Claim: the refusal gives the command that updates the CLI. False inside a project with Core, outside a project, in a tool folder and in the editor run from another folder: newer-recipe.mjs:47 (the blocking finding).
  • Claim: both theme palette generate and the theme editor refuse it. Verified: generate.mjs:354-362, _palette.mjs:2014-2017, tests 191-232.
  • Claim: the error code stays ERR_PALETTE_GENERATION, with the update command added as a suggestion. Verified: newer-recipe.mjs:50-51, tests 199, 207 and 227, and a real --json run.
  • Claim: the message reads as shown in the description. Verified by running the command on the head.
  • Claim: the update command uses the project's package manager. True for the command line. False for the editor, which reads the process's folder: _palette.mjs:2016 (part of the blocking finding).
  • Claim: a non-Astryx unknown recipe keeps the generator's refusal. Verified: tests 234-244.
  • Claim: a newer recipe is an astryx-oklch-vN past every known recipe. Verified: newer-recipe.mjs:28-37, tests 183-189.
  • Claim: both surfaces check before they generate, and the engine is unchanged. Verified: generate.mjs:354 runs before line 369, and generator.mjs is untouched.
  • Claim: both refusal tests fail without the change. Verified by reading: without the checks, the existing messages lack the asserted text (generator.mjs:852-855, _palette.mjs:2021-2025).
  • Claim: palette and editor suites, typechecks, eslint and changesets pass. These pass here: palette and editor suites (208 tests), three CLI typechecks, eslint on the changed files, and the changeset check. The strict typecheck fails only on two template pages that need an unbuilt theme package, outside this change. Docs, goldens, prettier, CLI structure and package boundaries were not rerun.
  • File .changeset/cli-newer-palette-recipe.md: its update-command claim is the blocking finding.
  • File packages/cli/api/theme/palette/generate/newer-recipe.mjs: blocking finding at line 47; non-blocking wording note at lines 43 and 49.
  • File packages/cli/api/theme-edit/_palette.mjs: blocking finding, no cwd passed at line 2016.
  • File packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • File packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: does not pin the command for any state (part of the blocking fix).

Automated review (maintainer link)

@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 refusal now names the right update step in a project, from a tool folder and for a global copy, and the three earlier points are fixed, but two states still print a wrong command.

  • Outside a project, a package runner's copy is told to run npx @astryxdesign/cli@latest, which run as printed only prints the CLI's usage, so print the run's own command after that prefix (or a <command> placeholder where it is not known) and pin the whole message in the tests (packages/cli/foundation/release/notices.mjs:722).
  • When no newest release is known, a project that pins Core exactly, as every starter does, is told to install @latest without -E, which turns its exact pins into ^ ranges, so give that step the same exact-save decision as projectLag() and expect npm install -E in the new test (packages/cli/foundation/release/notices.mjs:730).

Not blocking: the step for a project can pin the newest release the last check found, which may predate the recipe, while the suggestion says that release knows it. Lint and the CLI smoke test pass; the main CI run was still going when this review finished.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: the refusal names the file, the recipe, the CLI's version and the recipes it knows, then the update step, then says nothing changed. Verified: newer-recipe.mjs:52 and a real run.
  • Claim: before, the refusal only called the recipe unknown. Verified: generator.mjs:854.
  • Claim: both the theme editor and theme palette generate refuse this way. Verified: generate.mjs:354-361, _palette.mjs:2015-2017, newer-recipe.test.mjs:58-100.
  • Claim: in a project, Core and the CLI move together to the newest release (or latest), then the codemods run, with the project's package manager. Verified for npm and pnpm projects; false for a project that pins Core when no newest release is known, where -E is missing (notices.mjs:730).
  • Claim: from a tool folder, the step runs in the project's folder. Verified: a real run and notices.test.mjs:550-564.
  • Claim: outside a project, a global copy updates through the package manager that holds it. Verified: notices.mjs:720-721, notices.test.mjs:566-583.
  • Claim: a package runner's copy is run again at the newest release. False as printed: the printed command only starts the CLI (notices.mjs:722).
  • Claim: the error code stays ERR_PALETTE_GENERATION and the step is added as a suggestion. Verified: a real --json run, newer-recipe.test.mjs:66 and :95.
  • Claim: a recipe that is not an Astryx one keeps the generator's refusal. Verified: newer-recipe.test.mjs:129-139.
  • Claim: a newer recipe is an astryx-oklch-vN numbered past every known recipe. Verified: newer-recipe.mjs:19-37, newer-recipe.test.mjs:50-56.
  • Claim: the editor passes the theme's project folder, and the engine and its messages are unchanged. Verified: _palette.mjs:1419, :2109, :2152; the generator is not changed.
  • Claim: the refusal tests fail without the change. Verified by reading: the base has neither newer-recipe.mjs nor cliUpdateStep.
  • Claim: the palette and editor suites, typechecks, eslint, prettier, changesets, CLI structure and package boundaries pass. Verified for what was rerun here: 119 tests, four CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries; the docs and stable-output goldens were not rerun.
  • Changeset: a config from a newer CLI is refused with its recipe, the known recipes and the command that updates the CLI, by both surfaces, keeping the code. Verified, except the package-runner case above.
  • File .changeset/cli-newer-palette-recipe.md: clear.
  • File packages/cli/api/theme-edit/_palette.mjs: clear.
  • File packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • File packages/cli/api/theme/palette/generate/newer-recipe.mjs: prints the package-runner step as a rerun; the suggestion's reason can overclaim (non-blocking).
  • File packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: accepts either sentence, so the package-runner case passes.
  • File packages/cli/foundation/release/notices.mjs: the two blocking findings.
  • File packages/cli/foundation/release/notices.test.mjs: pins the bare runner prefix and the command without -E.

Automated review (maintainer link)

@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: CI has not run on this head yet, because the CI run found no room under its ceiling and skipped its jobs, so it needs a re-run. The refusal now prints a step that runs where the CLI runs, and both points from the last review are fixed: a package runner's copy gets its own command back at @latest, and a project that pins Core keeps -E.

Not blocking:

  • A program that calls themePaletteGenerate() in-process with a folder outside any project gets its own process's arguments repeated after npx @astryxdesign/cli@latest, so printing <command> unless the bin started the run would keep that suggestion honest (packages/cli/foundation/release/notices.mjs:719).
  • The project step can pin the newest release the last update check found, which may predate the recipe, while the suggestion says that release knows it (packages/cli/api/theme/palette/generate/newer-recipe.mjs:53).
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: the refusal names the config file, the recipe, the CLI's version and the recipes it knows, then the update step, then says nothing changed. Verified: newer-recipe.mjs:52 and a real run.
  • Claim: before, the refusal only called the recipe unknown. Verified: generator.mjs:854.
  • Claim: both the theme editor and theme palette generate refuse this way. Verified: generate.mjs:354-361, _palette.mjs:2015-2017, newer-recipe.test.mjs:60-126.
  • Claim: in a project, Core and the CLI move together to the newest release (or latest), then the codemods run, with the project's package manager, and a project that pins Core keeps its pins with -E. Verified: notices.mjs:731-744, notices.test.mjs:528-557, real runs with pinned and ranged Core.
  • Claim: from a tool folder, the step runs in the project's folder. Verified: notices.test.mjs:560-574.
  • Claim: outside a project, a global copy updates through the package manager that holds it. Verified: notices.mjs:723-724, notices.test.mjs:593.
  • Claim: a package runner's copy is run again at the newest release with the run's own command, or <command> when there is none to repeat. Verified for CLI runs: notices.mjs:726-729, notices.test.mjs:612-632, a real run; a program calling the API in-process gets its own arguments (non-blocking, above).
  • Claim: the error code stays ERR_PALETTE_GENERATION and the step is added as a suggestion. Verified: a real --json run, newer-recipe.test.mjs:68 and :74.
  • Claim: a recipe that is not an Astryx one keeps the generator's refusal. Verified: newer-recipe.test.mjs:128-138.
  • Claim: a newer recipe is an astryx-oklch-vN numbered past every known recipe. Verified: newer-recipe.mjs:19-37, newer-recipe.test.mjs:52-58.
  • Claim: the editor passes the theme's project folder, and the engine and its messages are unchanged. Verified: _palette.mjs:1419, :2109, :2152; the generator is not changed.
  • Claim: the refusal tests fail without the change. Verified by reading: the base has neither newer-recipe.mjs nor cliUpdateStep.
  • Claim: the command's refusal test pins the whole message. Verified: newer-recipe.test.mjs:69-74.
  • Claim: the palette and editor suites, typechecks, eslint, prettier, changesets, CLI structure and package boundaries pass. Verified for what was rerun: 210 tests, the CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries; the docs and stable-output goldens were not rerun.
  • Changeset: a config from a newer CLI is refused with its recipe, the known recipes and the command that updates the CLI, by both surfaces, keeping the code. Verified.
  • File .changeset/cli-newer-palette-recipe.md: clear.
  • File packages/cli/api/theme-edit/_palette.mjs: clear.
  • File packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • File packages/cli/api/theme/palette/generate/newer-recipe.mjs: the suggestion's reason can overclaim (non-blocking).
  • File packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear.
  • File packages/cli/foundation/release/notices.mjs: an in-process caller's arguments are repeated (non-blocking).
  • File packages/cli/foundation/release/notices.test.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the cli-newer-palette-recipe branch from e14e165 to 96b38e9 Compare November 18, 2026 23:22
@josephfarina josephfarina changed the title fix(cli): a palette made with a newer CLI names its recipe and the update command fix(cli): theme palette generate names a newer CLI's recipe and the update step Nov 18, 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.

Approved pending CI: the CI run on this head was cancelled before its jobs ran, so it needs a re-run.

The refusal for a palette config from a newer CLI now names the recipe, the recipes this CLI knows and an update step that runs where the CLI runs, and every claim in the description and changeset holds at this head. Two optional follow-ups remain: a program that calls themePaletteGenerate() in-process outside a project gets its own arguments repeated after npx @astryxdesign/cli@latest (see the open thread on notices.mjs), and the suggestion's reason says the pinned newest-known release knows the recipe, which it may not.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • Title: theme palette generate names a newer CLI's recipe and the update step: verified (generate.mjs:354-361, newer-recipe.mjs:46-56).
  • Changeset: the command refuses a config from a newer CLI with its recipe, the known recipes and the update step that fits where the CLI runs, keeping the error code: verified (newer-recipe.mjs:52-54; newer-recipe.test.mjs:67).
  • Before, the refusal only named the unknown recipe and the known ones: verified (generator.mjs:852-855; the base CLI on the same config).
  • The example message for a project: verified, byte for byte, in an npm project that declares a Core range.
  • The step comes from the update notices' helper, cliUpdateStep: verified (notices.mjs:722-752).
  • In a project, the CLI and Core move together to the newest release (or latest before one is known), then the codemods run, with the project's package manager, and a pinned Core keeps -E: verified (notices.mjs:741-751, :414; notices.test.mjs:525-554).
  • From a tool folder, the step runs in the project's folder: verified (notices.mjs:747-749; notices.test.mjs:557-571).
  • Outside a project, a global copy updates through its package manager, and a runner's copy reruns at the newest release with the run's own command, or <command> with none: verified (notices.mjs:729-736; notices.test.mjs:573-628).
  • The error code stays and the update command is added as a suggestion: verified (newer-recipe.mjs:53-54; a --json run).
  • A non-Astryx recipe keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN numbered past every known one: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:51-57, :94-104).
  • The command checks the recipe before it generates, and the engine and its messages are unchanged: verified (generate.mjs:354-366; the generator is not changed).
  • The new tests cover the classification, the whole refusal outside a project, the step inside one and the kept refusal, and fail without the change: verified (newer-recipe.test.mjs:51-104).
  • The notices tests cover the step in a project (newest known or not, pinned or ranged), from a tool folder, and outside for a global and a runner copy: verified (notices.test.mjs:524-630).
  • The palette suites, update notices and stable-output goldens pass, and the five CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified at this head.

Files:

  • .changeset/cli-newer-palette-recipe.md: clear.
  • packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: non-blocking note on the suggestion's reason (:53).
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear.
  • packages/cli/foundation/release/notices.mjs: non-blocking note on the argv default (:726).
  • packages/cli/foundation/release/notices.test.mjs: clear.

Automated review (maintainer link)

@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: --json now carries the codemod run bare, but the text a person reads prints that same bare command, and the description's example no longer matches what the head prints.

  • newer-recipe.mjs:55 writes astryx upgrade --from <current> --apply into the message, which text mode prints as written, so in a project a person reads a command that is not the CLI's picked command (the suggestion line under it says npx @astryxdesign/[email protected] upgrade …) and that fails with command not found when no global copy is installed (AST-081 FR5, cli-surface INV38); naming the steps in the message without the command and letting the two suggestions carry it fixes both modes.
  • The description's "Now:" example and its "as the update notices name it" are no longer true, because the same npm project now prints Update the CLI: npm install @astryxdesign/core@latest @astryxdesign/cli@latest, then run astryx upgrade --from 0.7.17 --apply; then run the command again. Nothing was changed. and the refusal adds two suggestions in a project.

Non-blocking: in a project with no CLI of its own, the text-mode codemod suggestion pins the running release (npx @astryxdesign/[email protected] upgrade …) where the update notice names the project's own CLI, and the open thread on notices.mjs about in-process argv still applies. CI has not run on this head because its commit message carries [skip ci], so the next push should run it.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims:

  • Title: theme palette generate names a newer CLI's recipe and the update step: verified (generate.mjs:354-361, newer-recipe.mjs:52-58).
  • Changeset: the command refuses a config from a newer CLI with its recipe, the known recipes and the update step for where the CLI runs, keeping the error code: verified, except that the text prints the step's codemod command bare (first finding).
  • Before, the refusal only named the unknown recipe and the known ones: verified (the base CLI on the same config).
  • The example message for a project: false (second finding).
  • The step fits where the CLI runs, as the update notices name it: the install matches the notice; the codemod run does not (second finding).
  • In a project, the CLI and Core move together to the newest release (or latest), then the codemods run, with the project's package manager, and a pinned Core keeps -E: verified (notices.mjs:750-764, :415; notices.test.mjs:525-557).
  • From a tool folder, the step runs in the project's folder: verified (notices.mjs:762, :779; notices.test.mjs:559-577).
  • Outside a project, a global copy updates through its package manager, and a runner's copy reruns at the newest release with the run's own command, or <command> with none: verified (notices.mjs:731-749; notices.test.mjs:579-639).
  • The error code stays and the update command is added as a suggestion: verified; in a project there are now two suggestions, the install and then the codemod run.
  • A non-Astryx recipe keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN past every known one: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:53-59, :129-139).
  • The command checks the recipe before it generates, and the engine and its messages are unchanged: verified (generate.mjs:354-361; the generator is not changed).
  • The new tests cover the classification, the whole refusal outside a project, the step inside one and the kept refusal, and the refusal tests fail without the change: verified (three fail with the base generate.mjs).
  • The notices tests cover the step in a project, from a tool folder, and outside for a global and a runner copy, and the refusal test pins the whole message: verified (notices.test.mjs:524-640; newer-recipe.test.mjs:61-80).
  • The palette suites, update notices and goldens pass, and the five CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified at this head.

Files:

  • .changeset/cli-newer-palette-recipe.md: clear.
  • packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: first finding (:55); non-blocking note (:67).
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: pins the first finding (:99-101).
  • packages/cli/foundation/release/notices.mjs: first finding (:761); carried non-blocking note (:728).
  • packages/cli/foundation/release/notices.test.mjs: clear.

Automated review (maintainer link)

...(step.upgrade
? [
{
name: step.upgrade,

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: in text mode cliError picks this name at process.cwd() before the install, so in a project with no CLI of its own it prints npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply (pnpm dlx … under pnpm). The update notice names the same step with the project's CLI as it will be after the install (getCliInvocation(root, {installed: true}), foundation/release/notices.mjs:812). It still reaches the new release through the hand-off, but it fetches 0.7.17 first.

@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 refusal now keeps every command out of its message and gives the install and the codemod run as suggestions, which fixes the text and --json conflict, so only the pull request description still needs to match what the head prints.

  • The description's "Now:" example and its line "The refusal adds the update command as a suggestion" are not what the head prints, because in an npm project the message now ends Update the CLI and bring the project's code to it with the commands below, in order; then run the command again. Nothing was changed. and two suggestion lines follow (the install, then npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply), so the example needs the real output and the line needs to say two suggestions in a project.

Non-blocking: the open threads on newer-recipe.mjs (the codemod line runs the current release first) and notices.mjs (in-process argv) still apply. CI has not run on this head because its commit message carries [skip ci], so the next push should run it.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims:

  • Title: theme palette generate names a newer CLI's recipe and the update step: verified (generate.mjs:354-361, newer-recipe.mjs:53-59).
  • Changeset: the command refuses a config from a newer CLI with its recipe, the known recipes and the update step for where the CLI runs, keeping the error code: verified (newer-recipe.mjs:49-78; runs inside and outside a project).
  • Before, the refusal only named the unknown recipe and the known ones: verified (the base CLI on the same config).
  • The example message: false (finding above).
  • The step fits where the CLI runs, as the update notices name it: verified for the install (notices.mjs:760, :809); the codemod line's printed command differs from the notice's (non-blocking).
  • In a project, the CLI and Core move together to the newest release (or latest), then the codemods run, with the project's package manager, and a pinned Core keeps -E: verified (notices.mjs:750-764, :415; notices.test.mjs:524-557).
  • From a tool folder, the step runs in the project's folder: verified (notices.mjs:762, :779; notices.test.mjs:559-577).
  • Outside a project, a global copy updates through its package manager, and a runner's copy reruns at the newest release with the run's own command, or <command> with none: verified (notices.mjs:730-749; notices.test.mjs:579-640).
  • The error code stays: verified; the update command is added as a suggestion: false in a project, where the install and the codemod run are two suggestions (finding above).
  • A non-Astryx recipe keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN past every known one: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:53-59, :132-142).
  • The command checks the recipe before it generates, and the engine and its messages are unchanged: verified (generate.mjs:354-361; the generator is not changed).
  • The new tests cover the classification, the whole refusal outside a project, the step inside one and the kept refusal, and the refusal tests fail without the change: verified (the three refusal tests fail with the base generate.mjs, and the project test fails with the previous message).
  • The notices tests cover the step in a project, from a tool folder, and outside for a global and a runner copy, and the refusal test pins the whole message: verified (notices.test.mjs:524-640; newer-recipe.test.mjs:61-80).
  • The palette suites, update notices and goldens pass, and the five CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified at this head.

Files:

  • .changeset/cli-newer-palette-recipe.md: clear.
  • packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: clear; non-blocking note (:68).
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear.
  • packages/cli/foundation/release/notices.mjs: non-blocking note (:728).
  • packages/cli/foundation/release/notices.test.mjs: clear.

Automated review (maintainer link)

@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: CI has not run on this head yet because its commit message carries [skip ci], so it needs a run on this head before merge.

The description now shows exactly what the refusal prints in a project and outside one, and a program that calls the API in-process outside a project now gets <command> instead of its own arguments, so nothing blocking remains.

  • Non-blocking: the open thread on newer-recipe.mjs still applies: in a project with no CLI of its own, the codemod line prints npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply, which fetches the running release before it hands off to the new one.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none

Claims:

  • Title: theme palette generate names a newer CLI's recipe and the update step: verified (generate.mjs:354-361, newer-recipe.mjs:49-78).
  • Changeset: the command refuses a config from a newer CLI with its recipe, the known recipes and the update step for where the CLI runs, keeping the error code: verified (newer-recipe.mjs:49-78; runs inside and outside a project).
  • Before, the refusal only named the unknown recipe and the known ones: verified (the base CLI on the same config).
  • The npm-project example output: verified (identical to the head's run in an npm project with a ranged Core).
  • The outside-a-project example through a package runner: verified (identical to the head's run outside a project).
  • The message names no astryx command; in a project the install and then the codemod run are the two suggestions; text mode prints the codemod run with the picked name and --json carries it bare: verified (newer-recipe.mjs:53-75; text and --json runs).
  • The install fits where the CLI runs, as the update notices name it: verified for the install (notices.mjs:762, :811); the codemod line's printed command differs from the notice's (non-blocking).
  • In a project, the CLI and Core move together to the newest release (or latest) with the project's package manager, and a pinned Core keeps -E: verified (notices.mjs:416, :752-766; notices.test.mjs:526-558; runs with a pinned and a ranged Core).
  • From a tool folder, both steps run in the project's folder: verified (notices.mjs:764, :781; notices.test.mjs:560-578; the tool-folder run).
  • Outside a project, a global copy updates through its package manager, and a runner's copy reruns at the newest release with the run's own command: verified (notices.mjs:733-750; notices.test.mjs:580-640).
  • The command is repeated only when the CLI's own bin started the run; an in-process API caller and a run with no arguments get <command>: verified (notices.mjs:730, run-context.mjs:54-56; notices.test.mjs:642-676; an API call from a host program).
  • The error code stays; outside a project there is one suggestion, in a project two: verified (runs inside and outside a project).
  • A non-Astryx recipe keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN past every known one: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:53-59, :132-142).
  • The command checks the recipe before it generates, and the engine and its messages are unchanged: verified (generate.mjs:354-361; the generator is not changed).
  • run-context.mjs exports binStartedRun(), which cliUpdateStep reads before it repeats the arguments: verified (run-context.mjs:54-56, notices.mjs:730).
  • The refusal tests cover the classification, the whole refusal outside a project, the project suggestions, bare JSON and the kept refusal, and fail without the change: verified (newer-recipe.test.mjs:53-142; they fail with the base generate.mjs).
  • The notices tests cover the step in a project, from a tool folder and outside one, and the last test fails without the change: verified (notices.test.mjs:525-677; the last test fails on the previous commit, which repeats the host's --port 4000 --watch).
  • The palette suites, update notices and goldens pass, and the five CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified at this head.
  • The preflight line names this head: verified; the checks above pass here.

Files:

  • .changeset/cli-newer-palette-recipe.md: clear.
  • packages/cli/api/theme/palette/generate/generate.mjs: clear.
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: clear; non-blocking note (:68).
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear.
  • packages/cli/foundation/release/notices.mjs: clear.
  • packages/cli/foundation/release/notices.test.mjs: clear.
  • packages/cli/foundation/release/run-context.mjs: clear.

Automated review (maintainer link)

…wn one is not newer than the CLI that ran

[skip ci]

@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: CI has not run on this head yet because its commit message carries [skip ci], so it needs a run on this head before merge.

The new commit makes the in-project install name @latest whenever the release the update check knows is not newer than the CLI that refused, so the step no longer reinstalls that CLI or moves to an older one; notices.test.mjs:560-576 pins it and fails without the change.

  • Non-blocking: in a project with no CLI of its own, the codemod line still reads npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply, so it fetches the running release before the hand-off reaches the new one, where the update notice names the project's CLI after the install (open thread on newer-recipe.mjs).
Claims and files checked

Review mode: incremental; reason: none

Changed rules since the last review: changed rules (0)

Claims:

  • Title: the palette command names a newer CLI's recipe and the update step: verified (newer-recipe.mjs:49-78; runs outside and inside a project).
  • Changeset: a newer CLI's config is refused with its recipe, the known recipes and the update step that fits where the CLI runs, keeping the error code: verified (newer-recipe.mjs:49-78; newer-recipe.test.mjs:61-80).
  • Before, the refusal said only Unknown palette recipe: …: verified (base generate.mjs; with it the refusal tests fail on that message).
  • The npm-project and outside-a-project output blocks are what the CLI prints: verified, byte for byte against this head's runs.
  • The message names no astryx command; in a project the install and then the codemod run are two suggestions, with the picked name in text and bare in --json: verified (newer-recipe.mjs:53-75; newer-recipe.test.mjs:82-130; text and --json runs).
  • In a project, CLI and Core move together to the newest release, or latest before one is known, with the project's package manager, and a project that pins Core keeps -E: verified (notices.mjs:426-427, :858-866; notices.test.mjs:526-576; pinned and ranged runs); this head also names latest when the known newest release is not newer than the refusing CLI.
  • From a tool folder inside a project, both steps run in the project's folder: verified (notices.test.mjs:578-596).
  • Outside a project, a global copy updates through the package manager that holds it, and a package runner's copy reruns at the newest release with the run's own command: verified (notices.mjs:830-849; notices.test.mjs:598-658; outside-a-project runs).
  • The command is repeated only when the CLI's own bin started the run; an in-process call or a run with no arguments gets <command>: verified (notices.mjs:828, run-context.mjs:54-56; notices.test.mjs:660-694).
  • The error code stays ERR_PALETTE_GENERATION, with one suggestion outside a project and two in one: verified (--json runs inside and outside a project).
  • A recipe that is not an Astryx one keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN past every known recipe: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:53-59, :132-142; dusty run).
  • The engine and its messages are unchanged: verified (generator.mjs is not in the diff).
  • The refusal tests fail without the change, and the last update-step test fails without it: verified (red-first runs).
  • The palette suites, update notices and stable-output goldens pass, and the five CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified (this head's runs).

Files:

  • .changeset/cli-newer-palette-recipe.md: clear
  • packages/cli/api/theme/palette/generate/generate.mjs: clear
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: non-blocking note (line 68)
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear
  • packages/cli/foundation/release/notices.mjs: clear
  • packages/cli/foundation/release/notices.test.mjs: clear
  • packages/cli/foundation/release/run-context.mjs: clear

Automated review (maintainer link)

…e through the command picker, or installs the newest CLI for the computer

[skip ci]
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8e7ffd1

@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: pinning the package runner's rerun to the newest known release fixes the unpinned @latest command, but taking its stem from the command-name picker lets a host's door name it.

  • In a hosted run outside a project (started through @astryxdesign/cli/host with a command name such as acme astryx), notices.mjs:856-858 makes the refusal say Run the command again with the newest CLI: acme astryx theme palette generate palette.config.json, which starts the host's own CLI, the release that just refused, and its --json envelope carries acme astryx … in error and the suggestion although error envelopes carry commands bare (spec:AST-081 FR1, FR3, FR5); return runs: true only for the pinned runner stem, give a door or a declared cliCommand a step that does not claim to rerun the newest CLI, and pin that in notices.test.mjs:767-789 with a hosted --json case.
  • Non-blocking: in a project with no CLI of its own, the codemod line still reads npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply, so it fetches the refusing release before the hand-off reaches the new one (open thread on newer-recipe.mjs).
Claims and files checked

Review mode: incremental; reason: none

Changed rules since the last review: changed rules (0)

Claims:

  • Title: the palette command names a newer CLI's recipe and the update step: verified (newer-recipe.mjs:49-78; runs inside and outside a project), apart from the hosted case below.
  • Changeset: the refusal names the recipe, the known recipes and the update step that fits where the CLI runs, keeping its code: false for a hosted run outside a project, where the step reruns the refusing CLI (hosted runs); otherwise verified (newer-recipe.test.mjs:61-109; runs).
  • Before, the refusal named only the unknown recipe and the known ones: verified (base generator.mjs:854; the refusal tests fail with the base generate.mjs).
  • The npm-project and outside-a-project output blocks are what the CLI prints: verified, byte for byte against this head's runs.
  • The message names no bare astryx command; in a project the install and the codemod run are two suggestions, with the picked name in text and bare in --json: verified (newer-recipe.mjs:53-75; newer-recipe.test.mjs:82-130; text and --json runs).
  • In a project, CLI and Core move together to the newest release, or latest, with the project's package manager, keeping -E where Core is pinned: verified (notices.mjs:866-883; notices.test.mjs:526-576; npm runs).
  • From a tool folder inside a project, both steps run in the project's folder: verified (notices.test.mjs:578-596).
  • Outside a project, a global copy updates through the package manager that holds it: verified (notices.mjs:833-840; notices.test.mjs:598-620).
  • A package runner's copy is run again at the newest known release, pinned and named by the command picker, a declared command or a host's door first: false for a door or a declared command, which starts the host's own CLI (hosted runs; notices.test.mjs:767-789); verified for the pinned runner (notices.test.mjs:621-661; runs).
  • With no newer release known, the step installs the newest CLI for the computer: verified (notices.mjs:844-852; notices.test.mjs:663-689; runs).
  • The run's command is repeated only when the bin started the run, else <command>, also with no arguments: verified (notices.mjs:829, run-context.mjs:54-56; notices.test.mjs:691-726).
  • The code stays ERR_PALETTE_GENERATION, with one suggestion outside a project and two inside: verified (--json runs).
  • A non-Astryx recipe keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN past every known recipe: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:53-59, :132-142; dusty run).
  • The engine and its messages are unchanged: verified (generator.mjs is not in the diff).
  • The refusal tests fail without the change, and the bin-run test fails without it: verified (red-first runs).
  • The palette suites, update notices and stable-output goldens pass, and the CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified (this head's runs).

Files:

  • .changeset/cli-newer-palette-recipe.md: its update-step claim is false for hosted runs (blocking finding)
  • packages/cli/api/theme/palette/generate/generate.mjs: clear
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: non-blocking note (line 68)
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear
  • packages/cli/foundation/release/notices.mjs: blocking finding (lines 856-858)
  • packages/cli/foundation/release/notices.test.mjs: pins the door step (lines 767-789), part of the blocking finding
  • packages/cli/foundation/release/run-context.mjs: clear

Automated review (maintainer link)

…started names the release it needs, not a command that reruns the same CLI

[skip ci]
josephfarina added a commit that referenced this pull request Nov 19, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 96eed55

@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: a run that a host's door or a declared command started outside a project now names the release it needs instead of rerunning the CLI that refused, and one description sentence no longer matches that.

  • The description says "Outside a project the refusal has one suggestion; in a project, two.", but a hosted run outside a project now gets no suggestion (newer-recipe.mjs:64-73, asserted at newer-recipe.test.mjs:144); reword it to "Outside a project the refusal has one suggestion, or none when a host's door or a declared command started the run; in a project, two."
  • Non-blocking: in a project with no CLI of its own, the codemod line still reads npx @astryxdesign/[email protected] upgrade --from 0.7.17 --apply, so it fetches the refusing release before the hand-off reaches the new one (open thread on newer-recipe.mjs).
  • Non-blocking: the newer-recipe.mjs header still says the refusal names "the command that updates the CLI", and the new JSDoc sentence at line 44 leaves "That command is its own bare suggestion" pointing at the host's command instead of the codemod run.

CI has not run on this head ([skip ci]).

Claims and files checked

Review mode: incremental; reason: none

Changed rules since the last review: changed rules (0)

Claims:

  • Title: the palette command names a newer CLI's recipe and the update step: verified (newer-recipe.mjs:50-87; runs inside, outside and hosted).
  • Changeset: the refusal names the recipe, the known recipes and the update step that fits where the CLI runs, keeping its code: verified (newer-recipe.test.mjs:61-152; runs).
  • Before, the refusal named only the unknown recipe and the known ones: verified (base generator message; the refusal tests fail with the base generate.mjs).
  • The npm-project and package-runner output blocks are what the CLI prints: verified, byte for byte against this head's runs.
  • The message names no bare astryx command; in a project the install and the codemod run are two suggestions, with the picked name in text and bare in --json: verified (newer-recipe.test.mjs:82-130; text and --json runs).
  • In a project, CLI and Core move together to the newest release, or latest, keeping -E where Core is pinned: verified (notices.test.mjs:526-578; npm runs with a range and a pin).
  • From a tool folder inside a project, both steps run in the project's folder: verified (notices.test.mjs:580-599).
  • Outside a project, a global copy updates through the package manager that holds it: verified (notices.test.mjs:601-624).
  • A package runner's copy is run again at the newest known release, pinned, with the run's own command: verified (notices.test.mjs:625-666; runs).
  • With no newer release known, the step installs the newest CLI for the computer: verified (notices.test.mjs:668-695; runs).
  • A run that a host's door or a declared command started names the release it needs and no command, with no picked name in --json: verified (notices.mjs:852-860; notices.test.mjs:773-808, newer-recipe.test.mjs:132-152; hosted runs and a declared-command run).
  • The run's command is repeated only when the bin started the run, else <command>, also with no arguments: verified (notices.mjs:833, run-context.mjs:54-56; notices.test.mjs:697-731).
  • The error code stays ERR_PALETTE_GENERATION: verified (--json runs).
  • Outside a project the refusal has one suggestion, in a project two: false for hosted runs, which get none (blocking finding).
  • A non-Astryx recipe keeps the generator's refusal, and a newer recipe is an astryx-oklch-vN past every known recipe: verified (newer-recipe.mjs:28-37; newer-recipe.test.mjs:53-59, :154-164; dusty run).
  • The engine and its messages are unchanged: verified (the generator is not in the diff).
  • The refusal tests fail without the change, and the bin-run test fails without it: verified (red-first runs).
  • The palette suites, update notices and stable-output goldens pass, and the CLI typechecks, eslint, prettier, changesets, CLI structure and package boundaries are clean: verified (this head's runs).

Files:

  • .changeset/cli-newer-palette-recipe.md: clear
  • packages/cli/api/theme/palette/generate/generate.mjs: clear
  • packages/cli/api/theme/palette/generate/newer-recipe.mjs: two non-blocking notes (line 77; lines 4-6 and 43-44)
  • packages/cli/api/theme/palette/generate/newer-recipe.test.mjs: clear
  • packages/cli/foundation/release/notices.mjs: clear
  • packages/cli/foundation/release/notices.test.mjs: clear
  • packages/cli/foundation/release/run-context.mjs: clear
  • Pull request description: one false claim (blocking finding)

Automated review (maintainer link)

* palette generation refusal. The step it names fits where the CLI runs (see
* `cliUpdateStep`): in a project, its CLI and Core together, then the codemod
* run. A run that a host's door or an integration's command started gets no
* command, only the release it needs, as that command runs the CLI it carries. That command is its own bare suggestion (`astryx …`) and never part of

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: with the door sentence placed here, "That command is its own bare suggestion (astryx …)" now reads as the host's command, which gets no suggestion; it meant the codemod run. Moving the door sentence after the codemod sentence (and wrapping this 150-character line) keeps both true. The file header at lines 4-6 also still says the refusal names "the command that updates the CLI", which a hosted run no longer gets.

josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 20, 2026
josephfarina added a commit that referenced this pull request Nov 20, 2026
- #12407 fix(cli): theme palette generate names a newer CLI's recipe and the update step
  Author: @josephfarina
- #12729 fix(cli): a padding of two to four lengths where only one works offers its sides
  Author: @josephfarina
- #12893 docs(cli): name the StyleX plugin that works under Vite
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #13025.

@github-actions
github-actions Bot deleted the cli-newer-palette-recipe branch November 20, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — 96eed55b Deployed Nov 19, 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