Skip to content

spec(AST-082): native build scripts may read core until the portable entry ships - #8048

Merged
cixzhang merged 3 commits into
mainfrom
spec/ast-082-fr16-interim-build-reads
Oct 24, 2026
Merged

cixzhang merged 3 commits into
mainfrom
spec/ast-082-fr16-interim-build-reads

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Exact decision needed

Whether native build scripts may read core before core's portable entry exists.

Existing authority searched

  • spec:AST-082 FR16 lets native read core only through a portable entry, which doesn't exist yet (Current-state impact).
  • The Swift theme generator (approved native spec, packages/native/specs/swift/library/) and the contract generator already read core at build time: the theme entries and the component documentation.

Decision

  • FR16: until the portable entry ships, a native build script may read core at build time through @astryxdesign/core/theme and @astryxdesign/core/theme/tokens, and read core's component documentation as data, to generate native code.
  • The boundary check lists each such read by name and refuses any other.
  • No native runtime code or generated binding imports core.
  • FR16's verification row now covers a listed read and an unlisted one.

Rejected alternatives

  • Dropping the theme generator until the portable entry ships: it would leave Swift with only the default theme, which blocks theming on iOS.

Claim scope and non-goals

The portable entry's design (DEC-8) and the run-time boundary are unchanged.

Evidence and implementation relationship

Record only. The boundary check that enforces the list is a separate change.

Writing rubric results

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives: one, in this PR body.
  • R5 pull request or issue references remaining: none in the record.
  • R6 ruled open questions still listing options: none.

Scope

  • One requirement amended; no implementation.
  • It records observable behavior and preserves equivalent internal implementations.
  • Verification states the evidence and failure signal without prescribing CI topology.
  • One durable decision.
  • Canonical owner (AST-082), affected claims, and overlapping open work are named.
  • Public text contains no internal context.

Validation

Prettier-formatted with the repository config; spec validation runs in CI.

…e entry ships

FR16 allows a native build script to read core's theme entries and component
documentation at build time while core has no portable entry. The boundary
check lists each read by name and refuses any other; no native runtime code or
generated binding imports core.
@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 5:05am 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, 5:32 AM UTC

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current change has no visual or preview-producing scope. Visual checks are not applicable; preview links are not shown.

The exact-head preview is not available yet.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval of this amendment waits on an engineering owner's decision: it changes spec:AST-082 FR16, a current requirement, and no engineering owner has approved this head yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so if they are an engineering owner); what must be settled is FR16's interim list of build-time reads of core and whether that list is complete. Independently of that decision, the record needs these fixes:

  • The list leaves out core's built-in icon names, which packages/native/scripts/core-docs.mjs already reads from core's icon registry for the FR17 icon coverage test, so the amended FR16 would refuse that read; name it in the list (covering the native tests that read through the same loader) or remove the read.
  • DEC-7 still says native reads core only through the portable entry; point it at FR16's interim exception.

[Automated review]

and native never imports core outside the portable entry. Until the portable
entry ships, a native build script may read core at build time through
`@astryxdesign/core/theme` and `@astryxdesign/core/theme/tokens`, and read
core's component documentation as data, to generate native code. The

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 list leaves out a read main already makes: packages/native/scripts/core-docs.mjs (readCoreIconNames) reads core's src/Icon/globalIconRegistry.tsx, and the FR17 icon coverage test (packages/native/src/icons/defaults.test.ts) relies on it. Under the next sentence the boundary check would have to refuse that read. Either name core's built-in icon names here (and let the exception cover the native tests that read through the same loader), or remove the read.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e80747a BLOCKED

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec f7e7c76

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 24, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0c6f7b7

@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 amendment is ready to land: an engineering owner approved the spec:AST-082 FR16 and DEC-7 changes at this exact head, and the interim list now names every build-time read of core that native makes on main and in the open native work. One optional wording tweak: FR16's verification row still lists an import of the web theme entry from native as refused beside the newly allowed theme-entry read, so writing "from native runtime code" there would remove the overlap.

[Automated review]

| FR13 | Dependency manifest audit of each native platform package | platform SDK; first-party project; a React Native out-of-tree desktop platform; third-party optional integration; third-party fork | A third-party library or fork is required to install, build, or render on the platform |
| FR14 | Compiler and render output comparison, core dependency graph check, and a web type surface diff | each maintained theme with and without the native package installed; runtime-mounted and built CSS; components; web types before and after | Any byte of CSS, mounted rules, or rendered web markup differs, core depends on native, or a web prop disappears outside a planned minor |
| FR15 | Package metadata and release-channel checks | native package manifest; a stable release; a canary release | The native package is publishable as a stable release before a platform is supported |
| FR16 | Package-boundary check, plus a native fixture app installed and bundled without `react-dom` or StyleX | an import of the portable entry; an import of a core component or the web theme entry from native; a listed build-time read from a native build script; an unlisted one; a core import of native; a core contract change | Native resolves a DOM type, `react-dom`, StyleX, or a web module; either direction of the boundary is crossed, an unlisted build-time read passes; or a core contract change does not reach native contracts on the next build |

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 wording: @astryxdesign/core/theme is core's theme entry, which this record says "includes the web theme compiler", so this row now both refuses "an import of a core component or the web theme entry from native" and allows it as "a listed build-time read from a native build script". FR16's split (a build script may read it; no native runtime code imports core) decides which applies; writing "from native runtime code" in the first state would remove the overlap.

@cixzhang
cixzhang merged commit 21631be into main Oct 24, 2026
53 checks passed
@github-actions
github-actions Bot deleted the spec/ast-082-fr16-interim-build-reads branch October 24, 2026 06:20

This branch was successfully deployed

1 active deployment
Preview — 0c6f7b7f 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. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant