Skip to content

fix(cli): expose built theme variants in component docs - #5103

Open
jiunshinn wants to merge 15 commits into
meta:mainfrom
jiunshinn:fix/5059-theme-build-runtime-variants
Open

jiunshinn wants to merge 15 commits into
meta:mainfrom
jiunshinn:fix/5059-theme-build-runtime-variants

Conversation

@jiunshinn

@jiunshinn jiunshinn commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #5059

User impact

Builders using custom theme values could not find them through astryx component. The theme's generated TypeScript declarations accepted those values, but the built JavaScript had no metadata for the CLI's * annotation, so the annotation could never appear.

Problem and solution fit

Custom values are collected once, using main's existing classification across root, onDark, and onLight. Both .variants.d.ts and the runtime metadata come from those entries, so the values the CLI shows always match the public types, including custom Heading types.

The metadata is a separate export next to the built theme object, not a field on it:

export const acmeTheme = { name: 'acme', __built: true, tokens: {...}, ... };

/** Custom component prop values this theme adds, by theme key and prop. CLI metadata, not theme data. */
export const themeVariants = {
  "banner": { "container": ["glass"], "status": ["critical"] },
  "badge": { "variant": ["gray"] }
};

resolveTheme() reads themeVariants from the configured module, and the theme export stays a DefinedTheme. astryx component shows each value as the prop:value key the author wrote in defineTheme. A component with two extensible props therefore says which prop accepts each value.

Expected behavior and authority

  • [Bug] Built themes never carry runtime variants, so astryx component's custom-variant * annotation can never fire #5059 describes the existing custom-value annotation promise.
  • Theme authoring contract says build/CLI metadata without a normalized-theme effect "stays outside DefineThemeInput and DefinedTheme" and needs a named current reader. Here the reader is resolveTheme() → astryx component. The export's declaration is an inline type (Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>) that imports nothing from Core, so it adds no Core/runtime compatibility requirement.
  • AST-024 requires custom Heading types to take part in generated augmentation.
  • AST-012 owns shared value classification and forbids conditional-only enrollment. The existing classifier and adaptation validation are unchanged.

Smallest restoration

  • Every standalone theme build module exports themeVariants and declares it in its .d.ts: the theme's custom values, or an empty object when it adds none (architecture:theme-compilation INV18, owner-approved as a public export).
  • Built-in values and closed prop axes stay excluded, the same as in the declarations.
  • --family output (AST-034) is unchanged.
  • Core behavior, styles, and public props are unchanged.
  • resolveTheme() no longer reads a variants field on the theme object. No build ever emitted one ([Bug] Built themes never carry runtime variants, so astryx component's custom-variant * annotation can never fire #5059), and reading it would put CLI metadata back into the theme object in the old flattened shape.

Split out

Loading a package's /built export automatically when a package root is configured stays out of this PR. Since then, main's generated theme record (#6874) loads the built module itself: a local <slug>.js, a package's themes/<slug> export, or a single-theme package's /built shorthand. resolveTheme() reads themeVariants from the module that path loads, so a project on the generated record gets the annotation with no extra lookup. On the released package.json#astryx.theme path, point the field at a built module (a file path or a /built subpath such as @astryxdesign/theme-neutral/built).

Evidence

Before: every built theme resolved with variants: null, so no * or footnote appeared (#5059).

After, with package.json → "astryx": {"theme": "./acme.js"} and a theme declaring banner['container:glass'], banner['status:critical'], and badge['variant:gray']:

$ astryx component Banner
| `astryx-banner` | `data-container`, `data-status` | container, status, container:glass*, status:critical* | - |
_\* = custom variant from acme theme_

$ astryx component Banner --detail brief
astryx-banner preferred attrs: data-container, data-status variants: container, status theme: container:glass*, status:critical*

$ astryx component Badge --detail brief
... theme: variant:gray*

Regression coverage:

  • Banner two-axis test, end to end (build, then component full and brief) and at the formatter unit level. Each value stays under its prop, and container:critical / status:glass never appear.
  • The theme object has no variants key, every single-theme module exports and declares themeVariants (an empty object without custom values, imported statically as ESM), and a --family module exports and declares none.
  • Resolver: reads the sibling export on both the generated-record path and the package.json#astryx.theme path, ignores a variants field on the theme object, and returns null without the export.
  • Kept from the previous revision: Heading hero, declaration/runtime agreement, root/dark/light deduplication, surface-only values, built-theme inheritance, closed props, and older artifacts.

Scope

  • Components: theme. The CLI theme build (@astryxdesign/cli) changes, and its output reaches the built theme packages, such as @astryxdesign/theme-neutral/built and @astryxdesign/theme-butter/built.
  • 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. The one new public export, themeVariants on every single-theme module, is recorded in architecture:theme-compilation INV18 and owner-approved.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

Record changed: architecture:theme-compilation INV18 (the themeVariants export).

  • R1 narration: none. INV18 states the export in the present tense.
  • R2 research: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives: none.
  • R5 pull request or issue references: none.
  • R6 open questions: none added.
  • R7 project status: none.

Testing

On head 63a40a651f (rebased onto 8f6f0008fe):

  • Focused suites (build-theme.variants, component-format, resolve-theme) with --maxWorkers=1: 3 files, 65 tests passed. With default parallelism, the existing 30s full-pipeline resolver test (loads a real built local default with an icon registry) timed out once under load; alone it passes in 6.5s.
  • Theme build and component suites (api/theme/build, commands/build-theme*, commands/component*, component-format): 38 files, 520 tests passed.
  • pnpm -F @astryxdesign/cli typecheck:strict: passed, after pnpm -F @astryxdesign/cli sync:api-types refreshed stale, git-ignored api/**/*.d.mts.
  • pnpm check:repo, pnpm check:cli-structure, pnpm check:changesets, Prettier, and ESLint on the changed files: passed.

Maintainer update (rebased onto main)

This pull request is carried forward by a maintainer, keeping jiunshinn's commit and authorship.

  • Merged current main. The build now keeps both main's work and this change: collectCustomVariants feeds the .variants.d.ts and the themeVariants export, and generateVariantDeclarations also writes a theme's icon variants into IconVariantMap in @astryxdesign/core/Icon; the main .d.ts still declares the theme with builtThemeType, plus themeVariants when the theme has custom values. The built module keeps main's component-icon prelude and node view, with themeVariants after the theme object.
  • A theme that lists icon variants but no custom component values writes its .variants.d.ts (the IconVariantMap augmentation, referenced from the main .d.ts) and exports an empty themeVariants, under a new test in build-theme.variants.test.mjs.
  • Family modules (themeBuildFamily) emit no themeVariants export and declare none.
  • Since that update: every single-theme module exports themeVariants, {} when the theme adds no custom values (INV18). build.icon-function-entries.test.mjs's node-view check skips that export.
  • Testing: vitest (node project) for build-theme.variants.test.mjs, component-format.test.mjs, resolve-theme.test.mjs and packages/cli/api/theme/build: 26 files, 392 tests pass. Strict lint on the changed files: clean.

Review outcomes at 1aa643f

One row per point in the earlier change request (at f329eb3), checked at this exact head.

Requested outcome Evidence at 1aa643f
Bring the branch up to date with main main merged without a rebase. The one conflict, in resolve-theme.mjs, keeps main's warnTheme (one inert warning line) beside this PR's extractVariants; every warning in the file goes through warnTheme.
Keep main's shared value classification across root, onDark and onLight collectCustomVariants reads every layer through getThemeComponentLayers and keeps a value only when classifyComponentValue (the classifier adaptation validation uses) calls it an enrollment. "unions and deduplicates root, onDark, and onLight values in types and runtime metadata" in build-theme.variants.test.mjs passes.
Derive declarations and runtime metadata from that same set generateVariantDeclarations renders the .variants.d.ts and collectRuntimeVariants shapes the themeVariants export, both from the one collectCustomVariants result, so the types and what astryx component reports cannot disagree.
Update the stale heading.type:hero expectation The test now expects 'hero': true; in the declarations and hero in themeVariants (heading: {type: ['shared', 'hero', 'editorial']}), matching Heading's extensible type.

Testing at this head: vitest for build-theme.variants.test.mjs, component-format.test.mjs, resolve-theme.test.mjs and packages/cli/api/theme: 42 files, 501 tests pass. CI at this head: pending; the drain adds ci:run and ci:run-a11y.

(Posted by Cindy's agent on her behalf.)

Owner and land path

@vercel

vercel Bot commented Aug 16, 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 1:07am UTC

Request Review

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Aug 16, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 16, 2026
@github-actions

github-actions Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c551100

Storybook · Sandbox · built from this PR's head

Package size:

  • @astryxdesign/cli 5.47 MB packed (+4.1 kB); no new dependencies
  • @astryxdesign/theme-butter 56.3 kB packed (+144 B); no new dependencies
  • @astryxdesign/theme-chocolate 18.2 kB packed (+104 B); no new dependencies
5 more packages
  • @astryxdesign/theme-gothic 40.2 kB packed (+195 B); no new dependencies
  • @astryxdesign/theme-matcha 29.6 kB packed (+126 B); no new dependencies
  • @astryxdesign/theme-neutral 41.4 kB packed (+117 B); no new dependencies
  • @astryxdesign/theme-stone 41.2 kB packed (+133 B); no new dependencies
  • @astryxdesign/theme-y2k 45.4 kB packed (+124 B); no new dependencies

API changes: cli +6 · ~2 · −0; theme-butter +1 · ~0 · −0; theme-chocolate +1 · ~0 · −0; theme-gothic +1 · ~0 · −0; theme-matcha +1 · ~0 · −0; theme-neutral +1 · ~0 · −0; theme-stone +1 · ~0 · −0; theme-y2k +1 · ~0 · −0

15 API changes (advisory)
Package Where Signature Usage
+ cli ./api · Types · type ComponentListLeafResponse type ComponentListLeafResponse import type {ComponentListLeafResponse} from '@astryxdesign/cli/api'
+ cli ./api · Types · type ComponentTheme type ComponentTheme import type {ComponentTheme} from '@astryxdesign/cli/api'
+ cli ./api · Types · type ComponentThemeField type ComponentThemeField import type {ComponentThemeField} from '@astryxdesign/cli/api'
+ cli ./json · Also exported from an earlier entry point · ComponentListLeafResponse ComponentListLeafResponse (./api) import {ComponentListLeafResponse} from '@astryxdesign/cli/json'
+ cli ./json · Also exported from an earlier entry point · ComponentTheme ComponentTheme (./api) import {ComponentTheme} from '@astryxdesign/cli/json'
+ cli ./json · Also exported from an earlier entry point · ComponentThemeField ComponentThemeField (./api) import {ComponentThemeField} from '@astryxdesign/cli/json'
~ cli ./api · Types · type ComponentDetailResponse data: ComponentDoc & ComponentOwnership & ComponentDetailScope → data: ComponentDoc & ComponentOwnership & ComponentDetailScope & ComponentThemeField import type {ComponentDetailResponse} from '@astryxdesign/cli/api'; const x: ComponentDetailResponse = {data: …}
~ cli ./api · Types · type ComponentListResponse data: ComponentListData → data: ComponentListData & ComponentThemeField import type {ComponentListResponse} from '@astryxdesign/cli/api'; const x: ComponentListResponse = {data: …}
+ theme-butter ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-butter/built'
+ theme-chocolate ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-chocolate/built'
+ theme-gothic ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-gothic/built'
+ theme-matcha ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-matcha/built'
+ theme-neutral ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-neutral/built'
+ theme-stone ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-stone/built'
+ theme-y2k ./built · Values · const themeVariants const themeVariants: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>> import {themeVariants} from '@astryxdesign/theme-y2k/built'

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 failure; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@jiunshinn
jiunshinn marked this pull request as ready for review August 16, 2026 11:48

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

Builders using current custom Heading types need those values to remain discoverable. This head conflicts with main, and its test still expects heading.type:hero to be excluded even though Heading is now intentionally extensible. Please rebase, preserve main’s shared value classification across root/onDark/onLight, derive declarations and runtime metadata from that same set, and update the stale expectation.

[Reviewed by Robohands]

@jiunshinn
jiunshinn force-pushed the fix/5059-theme-build-runtime-variants branch from f329eb3 to 7f76856 Compare September 13, 2026 00:53
@github-actions
github-actions Bot requested a review from cixzhang September 13, 2026 00:54
@jiunshinn jiunshinn changed the title fix(cli): theme build emits runtime variants so component docs annotate custom variants fix(cli): expose built theme variants in component docs Sep 13, 2026
github-actions Bot added a commit that referenced this pull request Sep 13, 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.

Thanks for rebasing onto the shared classification and keeping custom Heading types discoverable — the single collector keeping declarations and runtime data aligned is the right shape, and the focused coverage is strong.

Two changes are needed before this can be approved:

  • Carry the CLI metadata outside the built theme object. The built module's export is declared as DefinedTheme, and the current theme-authoring contract requires build/CLI metadata that has no normalized-theme effect to stay outside DefinedTheme. Emitting the same data as a separate export or sidecar that resolveTheme reads would preserve the fix without that contract break.
  • Preserve which prop each custom value belongs to. The runtime map currently flattens values by component, so for a component with two extensible props (for example Banner's container and status) the full and brief output lists the starred values beside both prop names without saying which prop accepts which value. Keeping the prop axis through the metadata and rendering each value under its exact prop — with a two-axis regression — would make the documentation trustworthy.

Separately, the resolver's new automatic loading of a package's /built export when a package root is configured is separable and has no governing specification yet; please split it into its own change so it can be settled on its own, rather than expanding this restoration.

[Automated review]

@jiunshinn
jiunshinn force-pushed the fix/5059-theme-build-runtime-variants branch from 7f76856 to 8916ca6 Compare September 30, 2026 13:28
@jiunshinn

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I rebased onto current main (conflict in generateBuiltModule, now resolved) and made all three changes in 8916ca6:

  1. Metadata outside the built theme object. The built module now has a separate export const themeVariants = {...} next to the theme export, plus an inline-typed export declare const themeVariants in the .d.ts that imports nothing from Core. The theme export no longer has a variants field, so it stays a DefinedTheme. resolveTheme() reads the sibling export and no longer looks for variants on the theme object. Themes without custom values build byte-identically, and --family output is unchanged.
  2. Prop axis kept. The shape is now { [componentKey]: { [prop]: value[] } }. Full and brief output show each value as the prop:value* key it was declared with, e.g. container:glass*, status:critical* on astryx-banner. A Banner container + status regression covers this end to end (build, then component full and brief) and at the formatter unit level, and asserts that container:critical / status:glass never appear.
  3. Split. Package-root /built loading and its tests are removed from this PR. Pointing astryx.theme at a built module (a file path or a /built subpath) is enough for the annotation. Automatic resolution from a package root can be proposed separately.

The PR description is updated with the new output and test results.

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

Thanks for reworking this — the metadata now sits beside the built theme instead of inside it, and each custom value is shown under the prop that accepts it, so the two-axis output is trustworthy.

Built themes with custom values now expose them to astryx component in both full and brief output, including custom Heading types, while themes without custom values and older artifacts keep their previous output. The focused builder, resolver, and formatter coverage passes, including the Banner two-prop regression.

Automatic loading of a package root's /built companion stays split out for its own decision, as discussed; pointing the theme config at the built module itself works with this change.

[Automated review]

github-actions Bot added a commit that referenced this pull request Sep 30, 2026
@jiunshinn
jiunshinn force-pushed the fix/5059-theme-build-runtime-variants branch from 8916ca6 to f0fda84 Compare October 3, 2026 23:29
@jiunshinn

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (73a6506d60). The earlier review fixes remain intact: a single collector supplies declarations and runtime metadata across root/dark/light, custom Heading types remain discoverable, CLI metadata is a sibling export outside DefinedTheme, and component values retain their exact prop axis. Automatic package-root /built fallback remains outside this PR.

Validation: all 43 builder/formatter/resolver regressions, CLI strict typecheck (after regenerating API declarations), strict lint/repository checks, and the full package build pass. The Banner two-axis and Heading custom-type regressions pass on this rebased head.

@cixzhang Please re-review the updated head and the previously addressed change request. The automated reviewer already approved those changes before this rebase.

The formal review-request API rejects my account's permissions in this repository, so this comment is the re-review request; existing reviewer assignments are retained. The separate repository-wide run during this update still has macOS tooling compatibility failures and is not reported as green.

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 5067578

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 12, 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: three fixes, plus the earlier change request.

The change does what #5059 asks: one collector feeds both the .variants.d.ts augmentations and the themeVariants export, astryx component stars each theme value under the prop that accepts it, and an engineering owner approved INV18 for this head.

Needs changes

  • Miss: the prop:value* entries and the brief theme: field appear only in text output while astryx component --json carries no theme values, which architecture:cli-surface INV4 and INV5 rule out and the INV18 approval does not amend, so either carry the values in the JSON result or add an owner-approved INV4/INV5 exception.
  • The description still says themes without custom values get no themeVariants and build byte-identically (Smallest restoration, Regression coverage, Maintainer update) and ticks "no new public API", but build.mjs:4248 and :4259-4261 export and declare it on every single-theme module, so those passages need rewriting to match the changeset.
  • The INV18 record change needs a ## Writing rubric results section in the description, which architecture:knowledge-contracts asks of any pull request that changes a record.

Also needed

  • The earlier change request (review 5153033104) still needs its reviewer's approving re-review or dismissal, and the test-build job needs a re-run: it was cancelled while checking out the merge commit and never ran against this change.

Optional: INV18's "the values the theme adds" leaves out the inherited values the build includes and has no Verification row; a [feat] changeset line would announce the new export as a capability (spec:AST-017 FR7); and the theme-authoring guide still lists the built .js as exporting only the theme object.

Claims and files checked

Claims (changeset):

  • Built themes export their custom values as themeVariants beside the theme object: verified (build.mjs:3152-3157, :4248, and a build of all seven themes).
  • astryx component stars them with the theme footnote: verified (component-format.mjs:245, :353-363, and a build-then-component run).
  • Each value prints as its prop:value key, so Banner says which prop takes it: verified (component-format.mjs:177-185; the run prints container:glass*, status:critical*).
  • The export and .variants.d.ts come from the same classified values across root, onDark and onLight, Heading types included: verified (build.mjs:2135-2200, :4214-4219, the deduplication test).
  • Built-in values and props without an augmentation point stay out: verified (build.mjs:2158, the Button size test).
  • Every single-theme module exports and declares themeVariants, an empty object when none: verified (build.mjs:4248, :4259-4261; five of the seven themes ship {}).
  • A --family module exports and declares none: verified (build.mjs:4924, :4938, build.family.test.mjs:179-182).

Claims (description):

  • One collector using the existing classification feeds both outputs: verified.
  • The metadata is a sibling export and the theme export stays a DefinedTheme: verified (the no-variants assertions).
  • resolveTheme() reads themeVariants from the loaded module on both config paths: verified (resolve-theme.mjs:88-112, the resolver tests).
  • The declaration is an inline type that imports nothing from Core: verified (build.mjs:3210).
  • The classifier and adaptation validation are unchanged: verified (only a comment changes).
  • The export and declaration appear only when the theme adds custom values, and other themes build byte-identically: false (build.mjs:4248, :4259-4261).
  • The .d.ts declares themeVariants only when values exist: false (the empty-export test).
  • An icon-only theme writes no themeVariants export: false (the icon-variant test expects {}).
  • No new public API ships under the bug-fix label: false (INV18; seven ./built exports).
  • --family output, Core, styles and public props are unchanged: verified (Core has no API change; theme.css is unchanged).
  • resolveTheme() no longer reads a variants field on the theme object: verified (resolver test).
  • Package-root /built loading stays out, and the generated theme record loads the built module: verified (the package-field loader is unchanged; the generated-record resolver test).
  • The Banner output shown: matches a run of the head CLI.
  • The stated test counts: stated for earlier heads; at this head the five touched suites pass (97 tests).
  • One defect is restored with no tagalongs, and public text has no internal context: verified.

Files:

  • .changeset/theme-build-runtime-variants.md: accurate; filed under [fix] (optional note).
  • docs/architecture/theme-compilation.md: INV18 approved by an engineering owner for this head; inherited-values wording and no Verification row (optional); rubric results missing.
  • packages/cli/api/theme/build/build.mjs: logic sound; the always-present export is the approved INV18 surface.
  • packages/cli/api/theme/build/build.family.test.mjs: clear.
  • packages/cli/api/theme/build/build.icon-function-entries.test.mjs: clear; the INV15 fixtures pass.
  • packages/cli/clients/cli/commands/build-theme.variants.test.mjs: clear.
  • packages/cli/clients/cli/lib/component-format.mjs: text-only annotation against cli-surface INV4/INV5.
  • packages/cli/clients/cli/lib/component-format.test.mjs: clear.
  • packages/cli/clients/cli/lib/resolve-theme.mjs: clear.
  • packages/cli/clients/cli/lib/resolve-theme.test.mjs: clear.

Automated review (maintainer link)

…t prints

The text view marks each theme value with `*` and the brief view prints a
`theme:` field, but the JSON result carried no theme values. A detail, list
or batch result now carries `data.theme`: the configured theme's name and
the custom values it adds by component and prop, or null without a theme.
The CommandDoc names the key, and the Banner end-to-end test checks that the
JSON values match the text.

Co-authored-by: jiunshinn <[email protected]>

@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: four fixes, all from the commit that adds theme values to astryx --json component.

Built themes now export their custom values as themeVariants, which an engineering owner approved as INV18 for this head. astryx component stars each value under the prop that accepts it, and the JSON result now carries the same values, which closes the earlier text-versus-JSON gap.

Needs changes

  • data.theme is added by the component command after component() returns (component.mjs:73-85, :307), so component() from @astryxdesign/cli/api and --json return different results, which spec:AST-042 FR1 rules out and which CI's API↔CLI parity check reports for 254 cases; return data.theme from component() itself.
  • data.theme is not declared in the component response types that @astryxdesign/cli/json exports, so the cast at component.mjs:81 fails strict typecheck (TS2352, which also fails the build gate) and the component.json and component-zh.json golden snapshots fail, while spec:AST-017 DEC-4 asks for the type, contract tests and docs of a new response field in the same change.
  • --json component now loads the theme on every call (component.mjs:294-305) and prints ⚠ theme: … warnings on stderr, including for --props, --source, --showcase and --blocks, against architecture:cli-surface INV12, and 9 tests in resolve-theme.test.mjs now fail: 8 on that stderr and 1 that still expects exit 0 when a recorded theme throws, where INV8 makes exit 1 correct.
  • The description's Scope says themeVariants is the one new public export, but data.theme in astryx --json component is new public schema too, so name it in Scope and in the changeset.

Also needed

  • The earlier change request (review 5153033104) still needs its reviewer's approving re-review or dismissal.

Optional: resolve-theme.mjs:125 still says JSON output never needs the theme; INV18's "the values the theme adds" leaves out inherited values, and INV18 has no Verification row; [feat] fits the changeset's two new capabilities (spec:AST-017 FR7); the theme-authoring guide still says the built .js exports only the theme object.

Claims and files checked

Claims (changeset):

  • Built themes export their custom values as themeVariants beside the theme object: verified (build.mjs:3152-3157, :4248, and a build of all seven themes).
  • astryx component stars them with a theme footnote: verified (component-format.mjs:245, :358-362, and a head CLI run).
  • Each value prints as its prop:value key, so Banner says which prop takes it: verified (component-format.mjs:177-185; the run prints container:glass*, status:critical*).
  • The export and .variants.d.ts come from the same classified values across root, onDark and onLight, Heading types included: verified (build.mjs:2135-2200, :4214-4219, the deduplication test).
  • Built-in values and props without an augmentation point stay out: verified (the Button size test).
  • Every single-theme module exports and declares themeVariants, an empty object when the theme adds none, so a named import resolves: verified (build.mjs:4248, :4260, the static-import test).
  • A --family module exports and declares none: verified (build.family.test.mjs:179-182).

Claims (description):

  • Built JavaScript carried no metadata, so the annotation never appeared before: verified (base theme builds have no such export).
  • One collector using the existing classification feeds both outputs: verified.
  • The metadata is a sibling export and the theme export stays a DefinedTheme: verified (the no-variants assertions).
  • resolveTheme() reads themeVariants from the loaded module on both config paths: verified (resolve-theme.mjs:96-112, the resolver tests).
  • The theme-authoring contract keeps such metadata outside DefinedTheme for a named reader: verified.
  • The declaration is an inline type that imports nothing from Core: verified (build.mjs:3209-3212).
  • Custom Heading types take part in the augmentation: verified (the deduplication test).
  • The classifier and adaptation validation are unchanged: verified (only a comment changes).
  • Every standalone module exports themeVariants, recorded in INV18 and owner-approved: verified (the spec-owner check succeeds for this head).
  • --family output, Core, styles and public props are unchanged: verified (Core has no API change).
  • resolveTheme() no longer reads a variants field on the theme object: verified (resolver test).
  • Package-root /built loading stays out, and the generated theme record loads the built module: verified.
  • The Banner and Badge output shown: matches a head CLI run and the passing end-to-end test.
  • The listed regression coverage exists: verified; those tests pass.
  • No new public API beyond themeVariants hides under the bug-fix label: false (data.theme in astryx --json component).
  • Writing rubric results for INV18: verified against the record.
  • The stated test counts: stated for earlier heads; at this head 9 resolve-theme.test.mjs tests fail, and CI typecheck, smoke-test and test-node (1/5) fail.
  • The maintainer update's "plus themeVariants when the theme has custom values": stale, corrected by its own "Since that update" line.
  • The merge with main keeps main's work, and every resolver warning goes through warnTheme: verified.

Files:

  • .changeset/theme-build-runtime-variants.md: accurate for themeVariants; omits data.theme; filed under [fix] (optional note).
  • docs/architecture/theme-compilation.md: INV18 owner-approved for this head; inherited-values wording and no Verification row (optional).
  • packages/cli/api/theme/build/build.mjs: clear.
  • packages/cli/api/theme/build/build.family.test.mjs: clear.
  • packages/cli/api/theme/build/build.icon-function-entries.test.mjs: clear.
  • packages/cli/clients/cli/commands/build-theme.variants.test.mjs: clear; passes, including the new JSON assertion.
  • packages/cli/clients/cli/commands/component.doc.mjs: describes data.theme, which the response types and component() do not carry.
  • packages/cli/clients/cli/commands/component.mjs: handler-only data.theme, a cast that fails typecheck, and theme warnings under --json.
  • packages/cli/clients/cli/lib/component-format.mjs: clear.
  • packages/cli/clients/cli/lib/component-format.test.mjs: clear.
  • packages/cli/clients/cli/lib/resolve-theme.mjs: clear; one stale comment (line 125).
  • packages/cli/clients/cli/lib/resolve-theme.test.mjs: its new tests pass; 9 existing tests in the file fail because of component.mjs.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec acbae9e

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 653eddd

@cixzhang

Copy link
Copy Markdown
Contributor

Decision: D-20261113-103

Records the owner's pick that every built theme module publicly exports themeVariants, at 653eddd. The CLI's JSON output carries the same theme values its text prints, as the CLI records require. It waives nothing.

@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: four fixes, all in how astryx --json component gains theme values.

Built themes now export their custom values as themeVariants, which an engineering owner approved as INV18 for this head, and astryx component stars each value under the prop that accepts it.

Needs changes

  • data.theme is added by the component command after component() returns (component.mjs:73-85, :307), so component() from @astryxdesign/cli/api and --json return different results, which spec:AST-042 FR1 rules out and which CI's API↔CLI parity check reports for 254 cases; return data.theme from component() itself.
  • data.theme is not declared in the component response types that @astryxdesign/cli/json exports, so the cast at component.mjs:81 fails strict typecheck (TS2352) and the component.json and component-zh.json golden snapshots fail, while spec:AST-017 DEC-4 asks for the canonical type and contract tests of a new response field in the same change.
  • --json component now loads the theme on every call (component.mjs:294-305) and prints ⚠ theme: … warnings on stderr, including for --props, --source, --showcase and --blocks, against architecture:cli-surface INV12, so 8 tests in resolve-theme.test.mjs fail, and a ninth still expects exit 0 when a recorded theme throws, where INV8 now makes exit 1 correct.
  • The description's Scope says themeVariants is the one new public export and that no other public API hides under the fix label, but data.theme in astryx --json component is new public schema too, so name it in Scope and in the changeset.

Also needed

  • The earlier change request (review 5153033104) still needs its reviewer's approving re-review or dismissal; this head meets the four points it raised.

Optional: resolve-theme.mjs:125 still says JSON output never needs the theme; INV18's "the values the theme adds" leaves out inherited values, and INV18 has no Verification row; [feat] fits the changeset's new capabilities (spec:AST-017 FR7); the theme-authoring guide still lists only the theme and icon exports for the built module.

Claims and files checked

Claims (changeset):

  • Built themes export their custom values as themeVariants beside the theme object: verified (build.mjs:3306-3311, :4491, and a build of all seven themes).
  • astryx component stars them with a theme footnote: verified (component-format.mjs:263, :374-378, and the end-to-end Badge, Heading and Banner tests).
  • Each value prints as its prop:value key, so Banner says which prop takes it: verified (component-format.mjs:195-203; the two-prop test).
  • The export and .variants.d.ts come from the same classified values across root, onDark and onLight, Heading types included: verified (build.mjs:2290-2320, :4457-4462, the deduplication test).
  • Built-in values and props without an augmentation point stay out: verified (the Button size test).
  • Every single-theme module exports and declares themeVariants, an empty object when the theme adds none, so a named import resolves: verified (build.mjs:4491, :4502-4504, the static-import test).
  • A --family module exports and declares none: verified (build.family.test.mjs:179-182).

Claims (description):

  • Built JavaScript carried no metadata, so the annotation never appeared before: verified (the base resolver read a theme field that no build emitted).
  • One collector using the existing classification feeds both outputs: verified.
  • The metadata is a sibling export and the theme export stays a DefinedTheme: verified (the no-variants assertions).
  • resolveTheme() reads themeVariants from the loaded module on both config paths: verified (resolve-theme.mjs:96-115, the resolver tests).
  • The theme-authoring contract keeps such metadata outside DefinedTheme for a named reader: verified.
  • The declaration is an inline type that imports nothing from Core: verified (build.mjs:3364-3366).
  • Custom Heading types take part in the augmentation: verified (the deduplication test).
  • The classifier and adaptation validation are unchanged: verified (only a comment changes).
  • Every standalone module exports themeVariants, recorded in INV18 and owner-approved: verified (owner approval for this head).
  • --family output, Core, styles and public props are unchanged: verified (Core has no API change).
  • resolveTheme() no longer reads a variants field on the theme object: verified (resolver test).
  • Package-root /built loading stays out, and the generated theme record loads the built module: verified.
  • The Banner and Badge output shown: matches the passing end-to-end tests.
  • The listed regression coverage exists: verified; those tests pass.
  • No new public API beyond themeVariants hides under the bug-fix label: false (data.theme in astryx --json component).
  • Writing rubric results for INV18: verified against the record.
  • The stated test results: stated for earlier heads; at this head 9 resolve-theme.test.mjs tests and 2 golden snapshots fail, and strict typecheck fails.
  • The maintainer update (the merge keeps main's work, icon-only themes write their augmentation and an empty export, family modules emit none, the icon test skips the export): verified; those tests pass.
  • The four outcomes of the earlier change request are met: verified.

Files:

  • .changeset/theme-build-runtime-variants.md: accurate for themeVariants; omits data.theme; filed under [fix] (optional note).
  • docs/architecture/theme-compilation.md: INV18 owner-approved for this head; inherited-values wording and no Verification row (optional).
  • packages/cli/api/theme/build/build.mjs: clear.
  • packages/cli/api/theme/build/build.family.test.mjs: clear.
  • packages/cli/api/theme/build/build.icon-function-entries.test.mjs: clear; passes.
  • packages/cli/clients/cli/commands/build-theme.variants.test.mjs: clear; passes, including the JSON assertion.
  • packages/cli/clients/cli/commands/component.doc.mjs: documents data.theme; clear.
  • packages/cli/clients/cli/commands/component.mjs: the first three findings.
  • packages/cli/clients/cli/lib/component-format.mjs: clear.
  • packages/cli/clients/cli/lib/component-format.test.mjs: clear; passes.
  • packages/cli/clients/cli/lib/resolve-theme.mjs: clear apart from the stale comment at :125 (optional).
  • packages/cli/clients/cli/lib/resolve-theme.test.mjs: new tests pass; its existing broken-theme block fails at this head (third finding).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) Hi @jiunshinn, thanks for sticking with this one. The design is settled: built themes export themeVariants, recorded at your current head. What's left is the automated review's four fixes to how astryx --json component carries theme values, plus a merge of main, since the branch now conflicts (a merge, not a rebase). Are you still up for finishing it? If you'd rather hand it off, say so here. We'll carry it on with you credited as co-author, and maintainer edits are already enabled. If we don't hear back in a couple of days, we'll do that so the fix ships.

Conflicts kept both sides:
- theme-compilation.md: main added INV18-INV20, so the built-theme export record becomes INV21.
- build.mjs: the built module keeps main's always-named cssFileName and the local compiled icon info, plus runtimeVariants; the .d.ts keeps themeVariants and main's colorModes declaration.
- component.mjs: main's batch receipt and failAfterOutput kept; the theme still loads before the JSON branch.
The command added data.theme after component() returned, so the API and
`--json` differed (spec:AST-042 FR1), the response types did not declare it,
and `--json` loaded the theme on every read and printed theme warnings on
stderr (cli-surface INV12).

- The theme resolver moves from clients/cli/lib/resolve-theme.mjs to the
  component subject's adapter helper api/component/_theme.mjs. It prints
  nothing: it reports each problem, and the INV22 seam check follows it.
- component() adds data.theme to a detail or list result, and a batch carries
  it on each found detail row: {name, values, problem}, or null without a
  theme. Props, source, showcase, and blocks do not load the theme.
- A configured theme that does not resolve is data.theme.problem; the text
  prints it as the `⚠ theme:` warning, and JSON prints nothing on stderr.
- A theme module that throws for another reason fails the read with
  ERR_THEME_LOAD in JSON too, as in text (cli-surface INV8).
- ComponentTheme and ComponentThemeField are declared in component.type.mjs,
  which @astryxdesign/cli/json exports; the golden snapshots gain
  "theme": null.
- INV21 names the inherited values the build includes and gains its
  Verification row. The changeset names data.theme as a [feat].
- Two build-then-component tests ask for --detail full, since main's
  component read now prints the compact answer by default.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026
@jiunshinn

Copy link
Copy Markdown
Contributor Author

@cixzhang Thanks. Yes, I am still on this one. I pushed two commits on top of 653eddde8a:

  • 5526882ca8 merges main (a merge, not a rebase). It contains only the conflict resolution. main added INV18–INV20 to architecture:theme-compilation, so the themeVariants record is now INV21. The text is the same as the INV18 you approved. build.mjs keeps main's cssFileName, compiled icon info and colorModes declaration beside themeVariants.

  • 271fd39472 makes the four fixes from the automated review (5886335615):

    1. component() adds data.theme itself, so --json and @astryxdesign/cli/api return the same result (AST-042 FR1). A detail or list result carries it, and a batch carries it on each found detail row. The resolver moves from clients/cli/lib/resolve-theme.mjs to api/component/_theme.mjs, behind the component adapter. The INV22 seam check follows it.
    2. ComponentTheme and ComponentThemeField are declared in component.type.mjs. Strict typecheck passes, and the golden snapshots gain "theme": null.
    3. Props, source, showcase and blocks reads do not load the theme. The resolver prints nothing: a theme that does not resolve is data.theme.problem, which the text prints as ⚠ theme: …, and JSON stderr stays empty (INV12). A theme module that throws fails with ERR_THEME_LOAD and exit 1 in JSON too (INV8).
    4. The changeset names data.theme as a [feat]. INV21 now names inherited values and has a Verification row.

    Two build-then-component tests now pass --detail full, because main (feat(cli): component reads print a short answer by default #12291) made the compact answer the default.

Validation at 271fd39472: 19 focused files, 742 tests (api/component, build-theme.variants, component-format, golden reads, doc-loads, build.family, build.icon-function-entries, text-json-parity); typecheck:strict, check:cli-structure, check:knowledge, Prettier and ESLint pass. api-cli-parity-test.mjs --no-baseline passes every component case. Its one failure, template nonexistent, comes from main: piped JSON output stops at 64 KiB.

One question before I update the description. The description's land path says this PR is held until #11510 merges and then drops its CLI half. #11510 makes the same change, and its design differs from 271fd39472:

#11510 271fd39472
Resolver api/theme/_adapter.mjs resolveActiveTheme api/component/_theme.mjs
values one list per component, as the text prints it today per prop ({banner: {container: [...], status: [...]}}), as the prop:value* text prints it
Theme that does not resolve null {name: null, values: {}, problem}

Which path do you prefer?

I recommend (a), because only the per-prop shape mirrors the text this PR prints. Either way works for me. After you choose, I will rewrite the description (Smallest restoration, Regression coverage, Scope, Writing rubric results for INV21, and Testing).

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision, and three fixes are needed either way.

This head adds architecture:theme-compilation INV21 (the themeVariants export), reworded since the earlier approval, and returns data.theme from component() and astryx --json component in a shape that differs from the open #11510. Any engineering owner, the author included if they are one, records the decision on both for this exact head by commenting /approve-spec <full head SHA>, or chooses #11510's CLI half instead. cixzhang's earlier change request also stays open until she re-reviews or dismisses it.

  • A batch beside a theme module that throws now becomes per-row ERR_THEME_LOAD errors instead of stopping before its receipt, so both "component: a batch beside a recorded theme that does not load" cases in packages/cli/clients/cli/commands/failure-codes.test.mjs fail (CI test-node (2/9)).
  • component() can now throw ERR_THEME_LOAD, but neither its throws list in api/component/component.doc.mjs nor the exit-code text in clients/cli/commands/component.doc.mjs names it.
  • The description's Scope, Owner and land path, Writing rubric results and Testing sections still describe INV18, an approval, a CLI half that drops and an older head, and Scope omits data.theme.

The fixes from the previous review hold: the API and --json now agree, the response types and golden snapshots are updated, and --json prints no theme warnings.

Claims and files checked

Review mode: full; reason: author-not-engowner

  • Claim, changeset: built themes export themeVariants beside the theme object, one value set across root, onDark and onLight including custom Heading types: verified (build-theme.variants.test.mjs).
  • Claim, changeset: each value shows as prop:value, and built-in or non-augmentable props stay excluded: verified (Banner and Button size tests).
  • Claim, changeset: every single-theme module exports and declares themeVariants, {} without custom values, and a --family module none: verified (variants and family tests; seven themes built).
  • Claim, changeset: --json and component() carry data.theme with name, values and problem, null without a theme, and props, source, showcase and blocks do not load the theme: verified (_theme.test.mjs, Banner test, parity script 416 of 416).
  • Claim, changeset: a theme module that throws fails the read with ERR_THEME_LOAD in JSON too: true for detail and list, false for a batch (finding above).
  • Claim, description: custom values were never visible for a built theme, and the theme export stays a DefinedTheme: verified (base resolver; 'variants' in test).
  • Claim, description: the existing classifier is reused, and Core behavior, styles and public props are unchanged: verified (classifyComponentValue; every theme's theme.css identical).
  • Claim, description: the resolver no longer reads a variants field, and reads the export on both the generated-record and package-field paths: verified (_theme.test.mjs).
  • Claim, description: the one new public export is themeVariants, recorded as INV18 and owner-approved: false (INV21, no approval at this head, data.theme also new).
  • Claim, description: the CLI half drops once #11510 merges: false at this head.
  • Claim, description: the testing results and the rubric's record number: stale (older head, INV18).
  • Claim, description: the earlier change request's four points are met: verified (merge of current main, one collector, Heading hero expectation).
  • Files: .changeset/theme-build-runtime-variants.md (batch claim false), docs/architecture/theme-compilation.md (needs owner approval), packages/cli/api/component/_adapter.mjs (ERR_THEME_LOAD undocumented), packages/cli/api/component/component.mjs (batch regression), packages/cli/api/component/component.doc.mjs (throws incomplete), packages/cli/clients/cli/commands/component.doc.mjs (exit codes incomplete), packages/cli/api/component/component.type.mjs (non-blocking note).
  • Files, clear: _theme.mjs, _theme.test.mjs, list/list.mjs, build.mjs, build.family.test.mjs, build.icon-function-entries.test.mjs, build-theme.variants.test.mjs, clients/cli/commands/component.mjs, component-format.mjs, component-format.test.mjs, doc-loads.test.mjs, both golden snapshots, scripts/check-cli-structure.mjs, both duration tables.

Automated review (maintainer link)

return response;
return {
...response,
data: {...response.data, theme: await componentTheme(cwd)},

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.

A batch reaches this once per found row, because componentBatch calls component() for each selector. When the theme module throws, each found row becomes an ERR_THEME_LOAD error row (batchFailure) instead of the read stopping before its receipt, as text did on main. Both cases of "component: a batch beside a recorded theme that does not load" in clients/cli/commands/failure-codes.test.mjs now fail (CI test-node (2/9)). Resolving the theme once per batch and throwing ERR_THEME_LOAD before the receipt keeps main's behavior and the changeset's "fails the read" claim. The JSON case then needs updating, because its receipt now needs the theme.

throw new AstryxError(
`Could not load the recorded theme: ${message}`,
undefined,
ERROR_CODES.ERR_THEME_LOAD,

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.

component() can now throw this. On main only the text handler loaded the theme. But the throws list in api/component/component.doc.mjs and the command's exit-code text in clients/cli/commands/component.doc.mjs do not name ERR_THEME_LOAD. spec:AST-017 DEC-4 asks for complete consumer documentation in the same change. One throws entry ("the configured theme's module throws while loading, for a detail, list or batch read") and a clause in the exit-code-1 text close it.

/**
* What the list leaf (`componentList`) returns: the catalog before the
* `component()` dispatcher adds `data.theme`.
* @typedef {object} ComponentListLeafResponse

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: @astryxdesign/cli/json re-exports this file with export type *, so this list-leaf shape, which exists only before component() adds data.theme, becomes public. An @internal tag, or a private typedef next to the leaf, would keep it off the CLI's public surface.

@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) A correction to my note above, @jiunshinn, sorry: please hold off on the four --json fixes for now. How astryx --json component carries theme values depends on a pending owner decision about the component response shape (a data.theme field plus exported theme types). Your --json output builds on that, so those fixes could change depending on the answer. What's settled is the themeVariants export itself. The one thing worth doing now, if you have time, is a small record chore: renumber the new theme-compilation invariant from INV18 to INV22, since INV18 has since been used elsewhere. We'll post here as soon as the decision lands, and the offer to carry it with your credit still stands.

@cixzhang
cixzhang dismissed their stale review November 18, 2026 21:22

(Posted by Cindy's agent.) Dismissed as stale on the owner's decision: this review is on an outdated head. Please re-review the current head if concerns remain.

@jiunshinn

Copy link
Copy Markdown
Contributor Author

@cixzhang Thanks for the correction. The renumber is done in c551100: the themeVariants invariant is now INV22, in its definition and in its Verification row. Main ends at INV20, and #12378 and #12564 both claim INV21.

One note on the number: #12639 also claims INV22 in the same record. Please tell me if you want a different number for this PR.

About the four --json fixes: your note arrived after I had pushed them (271fd39, described in my comment above). I did not revert them, for this reason:

  • Without 271fd39, the branch fails 11 focused tests after the merge with main. Main's feat(cli): component reads print a short answer by default #12291 makes the compact read the default, and the old command writes theme warnings to stderr in --json mode.
  • 271fd39 is one separate commit. When the owner decides the response shape, I will revert or change it to match. If you want the full revert now, I will add the small fix that keeps the tests green.

I will wait for the decision before I rewrite the description.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision, and three fixes are needed either way.

This head proposes architecture:theme-compilation INV22 (the themeVariants export), which no approval names yet, and returns data.theme from component() and astryx --json component in a shape that is still an open owner decision beside #11510. Any engineering owner, the author included if they are one, records the decision for this exact head by commenting /approve-spec <full head SHA> and saying which data.theme shape ships.

  • A batch beside a theme module that throws now becomes per-row ERR_THEME_LOAD errors instead of stopping before its receipt, so both "component: a batch beside a recorded theme that does not load" cases in packages/cli/clients/cli/commands/failure-codes.test.mjs fail.
  • component() can now throw ERR_THEME_LOAD, but neither its throws list in packages/cli/api/component/component.doc.mjs nor the exit-code text in packages/cli/clients/cli/commands/component.doc.mjs names it.
  • The description's Scope, Smallest restoration, Owner and land path, Writing rubric results and Testing sections still describe INV18, an approval, a CLI half that drops and an older head, and Scope omits data.theme.
Claims and files checked

Review mode: full; reason: author-not-engowner

  • Claim, changeset: built themes export themeVariants beside the theme object, from one value set across root, onDark and onLight, including custom Heading types: verified (build-theme.variants.test.mjs).
  • Claim, changeset: each value shows as prop:value, and built-in or non-augmentable props stay excluded: verified (Banner and Button size tests; a Banner project read with the head CLI).
  • Claim, changeset: every single-theme module exports and declares themeVariants, {} without custom values, and a --family module none: verified (variants and family tests; all seven themes built).
  • Claim, changeset: --json and component() carry data.theme with name, values and problem, null without a theme, and props, source, showcase and blocks reads do not load the theme: verified (_theme.test.mjs, Banner test, API and CLI parity check, 416 of 416).
  • Claim, changeset: a theme module that throws fails the read with ERR_THEME_LOAD in JSON too: true for detail and list reads, false for a batch (first finding).
  • Claim, description: custom values never showed for a built theme, and the theme export stays a DefinedTheme: verified (base CLI read of the same project; 'variants' in test).
  • Claim, description: the existing classifier is reused, and Core behavior, styles and public props are unchanged: verified (classifyComponentValue; every theme's theme.css identical).
  • Claim, description: the resolver no longer reads a variants field and reads the export on both the generated-record and package-field paths: verified (_theme.test.mjs).
  • Claim, description: --family output is unchanged: verified (build.family.test.mjs).
  • Claim, description: the one new public export is themeVariants, recorded as INV18 and owner-approved: false (the record is INV22, no approval names this head, and data.theme is also new).
  • Claim, description: the CLI half drops once #11510 merges: false at this head.
  • Claim, description: the testing results and the rubric's record number: stale (an older head, INV18).
  • Claim, description: the earlier change request's points are met (current main merged, one collector, the Heading hero expectation): verified (build-theme.variants.test.mjs).
  • Files with findings: .changeset/theme-build-runtime-variants.md (batch claim false), docs/architecture/theme-compilation.md (needs owner approval), packages/cli/api/component/component.mjs (batch regression), packages/cli/api/component/_adapter.mjs (ERR_THEME_LOAD undocumented), packages/cli/api/component/component.doc.mjs (throws incomplete), packages/cli/clients/cli/commands/component.doc.mjs (exit codes incomplete), packages/cli/api/component/component.type.mjs (non-blocking note).
  • Files, clear: packages/cli/api/component/_theme.mjs, _theme.test.mjs, list/list.mjs, packages/cli/api/theme/build/build.mjs, build.family.test.mjs, build.icon-function-entries.test.mjs, packages/cli/clients/cli/commands/build-theme.variants.test.mjs, packages/cli/clients/cli/commands/component.mjs, packages/cli/clients/cli/lib/component-format.mjs, component-format.test.mjs, packages/cli/foundation/doc-compiler/doc-loads.test.mjs, both golden snapshots, scripts/check-cli-structure.mjs, both duration tables.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — c5511002 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

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Built themes never carry runtime variants, so astryx component's custom-variant * annotation can never fire

2 participants