Skip to content

spec(native): Swift theme generator turns any Astryx theme into an AstryxTheme - #8031

Merged
cixzhang merged 10 commits into
mainfrom
spec/native-swift-theme-generator
Oct 24, 2026
Merged

cixzhang merged 10 commits into
mainfrom
spec/native-swift-theme-generator

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

How any Astryx theme becomes a Swift AstryxTheme: the input, the output file, the token set, value conversion, which themes are generated, and the drift check. Draft until the owner approves this spec; nothing is built from it before then.

Existing authority searched

  • spec:AST-082 (current) owns native theming: one theme definition as the token authority (FR10), the portable theme (FR18), and the one-way, build-time read of core with nothing from core at run time (FR16). It does not say how a theme's resolved values reach Swift.
  • spec:AST-093 (current) requires brand values to come from the theme (FR4). It defines one spec per component and no place for rules shared by every Swift component, so this PR adds packages/native/specs/swift/library/ beside the component specs.
  • The current generator, packages/native/scripts/swift-ios-theme.mjs, and its drift test generate core's default theme only. This spec describes the general form that script grows into.

Decision

  • G1 Input is a PortableTheme (a DefinedTheme passes unchanged); values come only from core's resolveThemeTokens for light and dark.
  • G2 Core is read only at build time; generated Swift imports only SwiftUI.
  • G3 One generated, theme-independent AstryxTokens.swift (typed members per group) and one file per theme declaring AstryxTheme.<name> (neutral → .neutral, y2k → .y2k; core's defaults, resolved with no theme, → .default).
  • G4 Deterministic output.
  • G5 The kept token groups are a contract, including font-family-*; adding a group is one PR with its first reader.
  • G6 One token-name → Swift-member rule (color-text-primary → color.textPrimary, spacing-0-5 → space.s0_5, text-body-size → font.bodySize); collisions and keywords fail with both names.
  • G7 Typed exact values (Color, CGFloat, [String]) or the run fails with theme, mode, token, and value.
  • G8 A theme's local tokens are generated once core's resolver returns them per mode, keyed by their exact custom-property names in per-type maps (AstryxTheme.neutral.local.dark.colors["--astryx-theme-neutral-color-status-fill-accent"]); an undeclared name returns nil.
  • G9 Components read typed members only; a string lookup may exist internally for wire-driven code.
  • G10 Font families map to Font.custom(_:size:relativeTo:) when the app has the font, otherwise the system font; the library never bundles fonts.
  • G11 AstryxTheme.native is reserved and empty.
  • G12 Every non-private theme package is generated; a product generates its own theme with the same function.
  • G13 The drift check covers the typed surface and every theme file.
  • G14 Generated files stay committed until CI publishes generated Swift.
  • D1 The package-boundary check covers every folder under packages/native/, listing by name every build-time read AST-082 FR16 allows: the generator's two theme entries, the contract generator's reads of core's component documentation and built-in icon names, and the strings generator's read of core's locale catalogs.
  • D2 Typed tokens from the start.
  • D3 Native intent comes from defineNativeTheme into the reserved slot; composing intent inside defineTheme is outside this spec.
  • D4 Increase Contrast is outside this spec; interim emphasized borders.

Rejected alternatives

  • String-keyed token dictionaries (D2): a typo ships invisible text.

Claim scope and non-goals

Moving the existing SwiftUI views to typed members, filling the native slot, and a core Increase Contrast mode are outside this PR. Extending the package-boundary check (D1) lands as its own pull request.

Evidence and implementation relationship

Files only: packages/native/specs/swift/library/theme-generator.md, packages/native/specs/swift/library/README.md, and one line in packages/native/specs/README.md. Published theme packages checked: butter, chocolate, gothic, matcha, neutral, stone, y2k (probe is private); their oklch() and color-mix() values sit outside the kept groups.

Writing rubric results

  • R1 narration: none; requirements describe what the generator does.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; checks name tests and files.
  • R4 rejected alternatives: one, in D2, one line.
  • R5 pull request or issue references remaining: none in the record.
  • R6 ruled open questions still listing options: none. The four original questions were answered and moved into D1–D4. A later OQ1, asking AST-082 FR16 to allow the interim build-time reads, is resolved by that amendment (spec(AST-082): native build scripts may read core until the portable entry ships #8048, which lands first) and removed; G2 and D1 cite FR16 as amended. Open questions reads None.

Scope

  • Specification only; no implementation.
  • Every changed file is under packages/native/.
  • Public text contains no internal context.

Validation

  • Prettier and the commit hook's repository checks (including check:knowledge and check:package-boundaries) pass.

@vercel

vercel Bot commented Oct 24, 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 Oct 24, 2026 6:32am UTC

Request Review

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

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 24, 2026, 7:09 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 688c263

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the theme-generator record is owner-approved, but it conflicts with two current specs it leaves unchanged and specifies a step core cannot supply yet. Please amend spec:AST-082 FR16 (or drop the interim import exception in G2 and D1), and rework G8 so theme-local tokens get a per-mode value source and are typed without reading the astryx-theme-<theme>- prefix that spec:AST-006 DEC-2 rules out. Then rebase onto the Swift package from #7981 (or rewrite Current state for what is on main), and close the macOS gap in G10 and the missing rule D4 points to.

  • resolveThemeTokens never returns localTokens, and neutral's local colors are stored as light-dark(…) strings that G7 rejects, so G8 cannot be met for neutral as written.

[Automated review]

Comment on lines +28 to +32
- **G2 — Core is read only at build time.** The generator runs at build time;
generated Swift imports only SwiftUI and carries nothing from core at run
time (AST-082 FR16). Once core's portable entry ships, the generator imports
core only through it. Until then it imports `@astryxdesign/core/theme` and
`@astryxdesign/core/theme/tokens`, a named interim exception to FR16 (D1).

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.

This names an exception to spec:AST-082 FR16 ("native never imports core outside the portable entry"), whose verification row fails an import of the web theme entry from native. A library spec cannot carve that out: amend FR16 in AST-082 to list the interim build-time reads (including scripts/core-docs.mjs, which already imports core's doc modules), or drop the exception here and in D1.

Comment on lines +88 to +93
- **G8 — Theme-local tokens are typed in the theme's own namespace.** A
theme-local token (`astryx-theme-<theme>-<rest>`) whose `<rest>` is in a G5
group becomes a typed member, by the G6 rule applied to `<rest>`, of a
namespace generated only in that theme's file: `AstryxTheme.Neutral.local`,
with light and dark values (`AstryxTheme.Neutral.local.dark.color.statusFillAccent`).
Only code written for that theme reads them; shared components never do.

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.

G1 allows values only from resolveThemeTokens, which never returns localTokens, and core stores local [light, dark] pairs as light-dark(…) strings that G7 rejects, so neutral's ten local colors have no permitted source. Parsing astryx-theme-<theme>-<rest> also conflicts with spec:AST-006 DEC-2 (no prefix is interpreted). Name a per-mode source for local values and type them from their exact names and owner metadata.

and no component uses it.
- **G10 — Font names map to SwiftUI fonts, with a system fallback.** The reader
walks a family list in order and uses the first family the app has
available (`UIFont(name:size:)` is not nil) as

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.

UIFont(name:size:) is UIKit-only, but both Swift packages declare macOS 14 and CI tests them on macOS. Name the AppKit counterpart (NSFont(name:size:)) or a platform-neutral check, and scope the Large-to-AX5 scaling check to iOS.

Comment on lines +167 to +169
until it exists, components follow the Swift theme-environment rule of
drawing borders and separators with the emphasized border token when
Increase Contrast is on.

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.

No "Swift theme-environment rule" exists in the repository yet. State the interim emphasized-border rule here as a requirement with an acceptance check, or drop this clause.

Comment on lines +173 to +180
- `scripts/swift-ios-theme.mjs` generates core's default theme only, as
string-keyed `AstryxTokens.defaultLight` and `.defaultDark` dictionaries,
with every G5 group except `font-family-*` and theme-local tokens, and with
the G7 color and length conversions; `AstryxTheme.default` is written by
hand.
- The Swift components and the Login template read tokens by string name
(`astryx.color("color-text-primary")`); a missing name draws clear.
- `src/theme/swiftIOSTheme.test.ts` checks the default theme only.

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.

None of these files (scripts/swift-ios-theme.mjs, src/theme/swiftIOSTheme.test.ts, swift-ios-1/, the Login template) is on main yet; they come from #7981. Land this after it, or describe the package as it is now (apple/, generated contracts only).

…light-dark per mode, FR16 interim reads, macOS fonts, contrast rule, unprefixed names, no version
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 597dea4

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the theme-generator record is owner-approved for this commit, but two of its requirements still contradict current specs that this pull request leaves unchanged. G2 and D1 keep the interim imports of @astryxdesign/core/theme and @astryxdesign/core/theme/tokens that spec:AST-082 FR16 forbids, so please amend FR16 (OQ1's own recommendation) in this pull request or one that lands first, or drop the exception until core's portable entry ships. G8 builds each local-token member by camel-casing its custom-property name, a second identifier spec:AST-006 FR3 rules out, so amend FR3 for native identifiers, key local values by their exact names, or drop the naming clause for now.

  • Smaller fixes for the same revision: the Summary's “any Astryx theme” fails on hsl() colors under G7, G3's examples should use the real theme names (neutral, y2k), and the R6 rubric result should mention OQ1.

[Automated review]

Comment on lines +34 to +39
impact). Until it ships, the generator reads core through
`@astryxdesign/core/theme` and `@astryxdesign/core/theme/tokens` at build
time, the same kind of build-time read the contract generator makes of
core's documentation; once the portable entry ships, it reads core only
through that entry. Whether AST-082 FR16 lists these interim build-time
reads is OQ1.

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.

This keeps native importing core's web theme entry until the portable entry ships, which current spec:AST-082 FR16 forbids (“native never imports core outside the portable entry”; its verification row lists “an import of a core component or the web theme entry from native”). OQ1 records the amendment but leaves it out, so the record requires what a current spec forbids. Please amend FR16 to list both interim build-time reads (these two entries and the contract generator's scripts/core-docs.mjs) and when they end, here or in a pull request that lands first, or drop the interim reads here, in D1 and in the G2 acceptance row.

Comment on lines +98 to +100
reports each local token it leaves out. When generated, each keeps its exact
name (AST-006 DEC-2): its Swift member is the whole custom-property name in
lower camel case (`--neutral-status-fill` → `neutralStatusFill`), with no

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.

Camel-casing the custom-property name creates a second identifier, which current spec:AST-006 FR3 rules out for “generated theme-specific types or metadata” (“No transform may create a second identifier”), and DEC-2 rejects generated names and hidden normalization, so “keeps its exact name” does not hold. A Swift identifier cannot hold -, so this needs a decision: amend AST-006 FR3 to allow a deterministic native projection with a collision rule, key local values by their exact name, or drop this naming clause until that is decided.

Comment on lines +9 to +12
An iOS app built with Astryx shows its own brand, not only core's default: any
Astryx theme, from a published theme package such as neutral or from the
product itself, becomes a Swift `AstryxTheme` that `.astryxTheme(.neutral)`
applies, with the same light and dark values and typeface the web uses. Every

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.

G7 fails any kept-group value outside its listed forms, and core passes hsl() through: the private probe theme resolves 16 color-syntax-* tokens to hsl() values in both modes, so a product theme written that way would not generate. Consider an exact hsl() conversion in G7, or narrow “any Astryx theme” here.

Comment on lines +49 to +51
- `<swiftName>` is the theme's `name` with a leading `astryx-` removed, in
lower camel case (`astryx-neutral` → `neutral`, `astryx-y2k` → `y2k`, a
product's `acme-brand` → `acmeBrand`). Core's default theme (`astryx`) is

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.

The published themes are named neutral and y2k (neutralTheme.ts:71, y2kTheme.ts:107); astryx-neutral and astryx-y2k name their syntax themes, and core resolves its defaults with no theme name. The rule's output is unchanged, but the examples should use the real inputs.

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

This needs an owner decision before it can be approved: no engineering owner has approved the latest commit, so the theme-generator record's requirements (G1–G14, D1–D4) and the new swift/library/ spec area are still unsettled. Any engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. G2, D1 and the G2 acceptance check also depend on the AST-082 FR16 amendment in #8048, which has to land on main before they match current spec.

  • The G2 acceptance check allows only the two theme entries in packages/native/scripts/, but the existing core-docs.mjs already reads core's component documentation at build time, a read the FR16 amendment allows, so please widen the check and D1 to the reads FR16 lists.
  • Smaller fixes: the hsl(210 100% 50%) example equals #0080FF only after 8-bit rounding that G7 doesn't state, G8's string-keyed local maps conflict with D2, and G3 names a core default theme (astryx) that doesn't exist.

[Automated review]

generated Swift imports only SwiftUI and carries nothing from core at run
time (AST-082 FR16). Until core's portable entry ships, the generator reads
core at build time through `@astryxdesign/core/theme` and
`@astryxdesign/core/theme/tokens`, the build-time reads AST-082 FR16 allows

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.

Current spec:AST-082 FR16 on main still says "native never imports core outside the portable entry"; this allowance exists only in open #8048. G2 and D1 match current spec once that amendment lands.

light and one for dark.
- `<swiftName>` is the theme's `name` with a leading `astryx-` removed, in
lower camel case (`neutral` → `neutral`, `y2k` → `y2k`, a product's
`acme-brand` → `acmeBrand`). Core's default theme (`astryx`) is

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.

Core has no theme named astryx; its defaults resolve with no theme (resolveThemeTokens(null, …)). Saying that core's defaults render from no theme as default would also give G1 an input for the default file G12 requires.

by its exact custom-property name (AST-006 FR3, DEC-2), with no second
identifier and no prefix read or removed, in a map of its value's type (G7)
for light and for dark, carried only by that theme
(`AstryxTheme.neutral.local.dark.colors["--neutral-status-fill"]`). Only code written for that theme reads them; shared components never

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.

These string-keyed maps are what D2 rejects ("not string-keyed dictionaries"), so a misspelled local key compiles and returns nil. Scoping D2 to the shared surface and saying what a missing key does would resolve it; --neutral-status-fill is also not one of neutral's local tokens, which are named --astryx-theme-neutral-color-*.

| Requirement | Check |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| G1 | A theme whose resolved token differs from its raw `theme.tokens` entry (a reference) shows the resolved value in Swift. A `DefinedTheme` with web component overrides generates the same file as the same theme without them. |
| G2 | A source check finds no import of core in `packages/native/scripts/` outside the two named theme entries (later, outside the portable entry). Generated Swift imports only SwiftUI. |

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.

packages/native/scripts/core-docs.mjs already imports core's .doc.mjs files at build time, a read #8048's FR16 text allows, so this check would flag the existing contract generator. Consider checking for core imports "outside the build-time reads AST-082 FR16 lists", and naming that read in D1 too.

| G4 | Generating twice, and on two CI machines, gives byte-identical output. |
| G5 | Every theme's light and dark values fill every member of `AstryxTokens`, equal to core's resolved names filtered by the G5 groups. |
| G6 | Unit tests map every row of the G6 table; two tokens that collide fail with both names. A Swift fixture referencing `theme.color.textPrimray` fails to compile. |
| G7 | A token written as `light-dark(#000, #fff)` generates black in light and white in dark. `hsl(210 100% 50%)` generates the same color as `#0080FF`. Unit tests convert every listed form; `oklch(0 0 0 / 5%)` in a kept group fails with theme, mode, token, and value in the message; `"Figtree", -apple-system, sans-serif` becomes `["Figtree", "-apple-system", "sans-serif"]`. |

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.

The exact sRGB value of hsl(210 100% 50%) is (0, 0.5, 1), while #0080FF is (0, 128/255, 1), so an exact converter (G4, G7) fails this check. Either say hsl() rounds to 8-bit channels, or use an example that is exact both ways, such as hsl(0 100% 50%) and #FF0000.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 639f694

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec ca81828

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the theme-generator record is owner-approved for this commit, but G2, D1 and the G2 acceptance check say AST-082 FR16 allows build-time reads of @astryxdesign/core/theme, @astryxdesign/core/theme/tokens, core's component documentation and its icon names, while FR16 on main still says native never imports core outside the portable entry. Please land the FR16 amendment in #8048 first, after which this commit matches as written, or drop the interim reads here until FR16 allows them.

  • Smaller fixes: the Summary's "Every token is a typed Swift member" should say shared tokens because G8 keys local values by name, Current state's color-mix() sentence misses --color-syntax-added and --color-syntax-removed (kept color-* tokens that core resolves from color-mix()), and the description's G3, G8 and D1 lines no longer match the record.

[Automated review]

Comment on lines +32 to +36
time (AST-082 FR16). Until core's portable entry ships, the generator reads
core at build time through `@astryxdesign/core/theme` and
`@astryxdesign/core/theme/tokens`, the build-time reads AST-082 FR16 allows
a native build script, each listed in the boundary check; once the portable
entry ships, it reads core only through that entry.

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.

spec:AST-082 FR16 on main still says native never imports core outside the portable entry and lists no build-time reads; this allowance, D1's list (line 161) and the G2 check (line 142) cite text that is only in open #8048. Landing #8048 first makes this match as written; otherwise drop the interim reads until FR16 allows them.

Comment on lines +12 to +14
applies, with the same light and dark values and typeface the web uses. Every
token is a typed Swift member, so a misspelled token fails to compile instead
of drawing nothing. The generator runs core's own resolver, so Swift never

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.

G8 keys theme-local values by exact name, so a misspelled local name compiles and returns nil; “Every shared token” would match G8 and D2.

Comment on lines +197 to +199
- Published theme packages: butter, chocolate, gothic, matcha, neutral, stone,
y2k (probe is private). Their raw values use `oklch()` and `color-mix()` only
outside the G5 groups (shadows, component styles).

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.

The defined butter, chocolate, matcha and neutral themes carry --color-syntax-added and --color-syntax-removed as color-mix(in srgb, …) (core's syntax defaults), inside the kept color-* group. Core evaluates them to rgba() (neutral light: rgba(188, 224, 187, 0.25)), so generation still works; saying the resolved kept values use only G7's forms would be accurate.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 3c93d14

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested: the theme-generator record is owner-approved for this commit, and the AST-082 FR16 amendment it relies on is now on main, but D1 and the G2 acceptance check list FR16's allowed build-time reads without core's locale catalogs, which FR16 now includes. A boundary check built from D1 as written would refuse a read FR16 allows, such as the locale-catalog read in the strings generator in #7981, so please add locale catalogs to both lists or have them point at FR16's list.

  • Smaller fix: main already has swift/library/accessibility.md, so the new library/README.md index should list it.

[Automated review]

Comment on lines +160 to +163
import anywhere in the package is checked against AST-082 FR16, with every
build-time read FR16 allows listed by name: the generator's two theme entries
(G2) and the contract generator's reads of core's component documentation
and built-in icon names.

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.

FR16 on main also allows core's locale catalogs (“read core's component documentation, its built-in icon names, and its locale catalogs as data”), so this list of “every build-time read FR16 allows” leaves one out, and a check built from it would refuse the strings generator's read of @astryxdesign/core/locales/*.json in #7981. Add the locale catalogs here, or refer to FR16's list instead of restating it.

| Requirement | Check |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| G1 | A theme whose resolved token differs from its raw `theme.tokens` entry (a reference) shows the resolved value in Swift. A `DefinedTheme` with web component overrides generates the same file as the same theme without them. |
| G2 | A source check finds no import of core in `packages/native/` outside the build-time reads AST-082 FR16 lists (the two theme entries, core's component documentation, and core's built-in icon names; later only the portable entry). Generated Swift imports only SwiftUI. |

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.

This parenthetical should match FR16's list, which now includes core's locale catalogs; as written, the check would flag a locale-catalog read that FR16 allows.


| File | Concern |
| -------------------- | -------------------------------------------------- |
| `theme-generator.md` | How any Astryx theme becomes a Swift `AstryxTheme` |

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.

main already has accessibility.md in this directory (the Swift accessibility contract); add its row when you merge main so the index lists every file.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 02a7bb9

@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: the theme-generator record is owner-approved at this commit, G2, D1 and the G2 acceptance check now list every build-time read the amended AST-082 FR16 allows, including core's locale catalogs, and the library index lists accessibility.md. No changes are required. Two optional follow-ups are noted inline: the Summary's "every shared token" and "typeface the web uses" read broader than G5 and G10, and naming the package version in G3's header means each release-version change on main must also regenerate the theme files or the drift test fails.

[Automated review]

Comment on lines +12 to +13
applies, with the same light and dark values and typeface the web uses. Every shared
token is a typed Swift member, so a misspelled token fails to compile instead

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.

Optional: two Summary claims read broader than the requirements. G5 keeps 229 of core's 263 shared tokens, so --shadow-*, --duration-*, --ease-standard, --focus-outline-*, --text-code-* and --text-display-* get no member, and the web's typeface reaches Swift only when the app bundles and registers the font (G10). Saying "every token in the G5 groups" and "the typeface the web uses, once the app registers it" would match.

Comment on lines +52 to +53
- Each file starts with a header naming the source package, its version, and
the theme name, says "Do not edit", and names the regenerate command.

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.

Optional: with the source package's version in this header, G13's drift test fails whenever the fixed release group's version changes on main (.changeset/config.json keeps core and all seven published theme packages on one version), unless that pull request also regenerates every theme file. An earlier revision of this record said "The header never names a version, so a release that only bumps versions changes no generated file"; restoring that, or naming the regeneration step, avoids the churn.

@cixzhang
cixzhang merged commit 0026f37 into main Oct 24, 2026
69 checks passed
@github-actions
github-actions Bot deleted the spec/native-swift-theme-generator branch October 25, 2026 06:20

This branch was successfully deployed

1 active deployment
Preview — 02a7bb96 Deployed Oct 24, 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