From bbc5934e98dfc3fa62428eaf281017f7f9772720 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Mon, 26 Oct 2026 14:49:44 -0700 Subject: [PATCH] spec(AST-093): a native component lives in the folder where core keeps it (FR1) --- docs/architecture/knowledge-contracts.md | 2 +- .../AST-093-native-component-guidelines/spec.md | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/architecture/knowledge-contracts.md b/docs/architecture/knowledge-contracts.md index a2a2d24b328d6..8d57208b98c2a 100644 --- a/docs/architecture/knowledge-contracts.md +++ b/docs/architecture/knowledge-contracts.md @@ -682,7 +682,7 @@ this flow passes the historical review benchmark and is enforced on pull request keeps the shared contract (INV2). Until the core component has its own record, its public source and documentation stand in as that contract. The public name normally matches the root; a parent/member exception requires an exact top-level or full inline consumer-doc entry in - that root. Public semantic module records are nested at least one directory + that root. A platform implementation's record instead sits in the folder where core keeps the component, which is `/` when core keeps it in its own folder, and core's folder otherwise (`spec:AST-093` FR1). Public semantic module records are nested at least one directory beneath the same root as `.spec.md`; the parent component's `modules` list and the module's `parent_component` field must agree. Hidden, fixture, test, generated, build-output, coverage, dependency, and diff --git a/docs/specs/AST-093-native-component-guidelines/spec.md b/docs/specs/AST-093-native-component-guidelines/spec.md index e544890340500..720c9589031f7 100644 --- a/docs/specs/AST-093-native-component-guidelines/spec.md +++ b/docs/specs/AST-093-native-component-guidelines/spec.md @@ -53,12 +53,15 @@ validating, and reviewing individual native components while ## Requirements - **FR1 — A native component's spec lives beside its implementation.** Each - native component has its own folder in its language's implementation, named - as the core component, and its spec is `.spec.md` in that folder, as - core does (`packages/core/src//.spec.md`). Each language has one + native component's views and spec live in one folder of its language's + implementation: the folder where core keeps the component, which is + `/` when core keeps it in its own folder, and core's folder otherwise + (core's `Avatar/AvatarStatusDot`, `List/ListItem`). The spec is + `.spec.md` in that folder, as core does + (`packages/core/src//.spec.md`). Each language has one implementation package; for Swift that is `packages/native/apple/`, and the - spec is `packages/native/apple/Sources/Astryx//.spec.md`, beside - the component's views. `` is the core component's name. The spec is a + spec is `packages/native/apple/Sources/Astryx//.spec.md` in the + common case, beside the component's views. `` is the core component's name. The spec is a knowledge record of kind `component` with id `component:/` that names its core component in `platform_of`, built from `docs/templates/knowledge/component-spec.md` @@ -170,7 +173,7 @@ validating, and reviewing individual native components while | Contract | Verification | Representative states | Mutation or failure expectation | | -------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| FR1 | Review of the spec's path beside the component, plus `pnpm check:knowledge` on its record frontmatter, id, and `platform_of` | a spec per language; a spec for a component with no core contract | A component spec outside its component's folder, without valid record frontmatter, under another id, naming no core component, or renaming a core prop passes | +| FR1 | Review of the spec's path beside the component, plus `pnpm check:knowledge` on its record frontmatter, id, and `platform_of` | a spec per language; a spec for a component with no core contract; a member core keeps in another component's folder | A component spec outside the folder where core keeps its component, without valid record frontmatter, under another id, naming no core component, or renaming a core prop passes | | FR2 | The spec's account of the platform control it builds on, or why none fits, and the state captures | a component built on a platform control; a component with no platform control | A component draws its own control where a platform control fits, with no reason in its spec | | FR3 | The spec's account of the platform guidelines it follows, and the captures | hit target size; largest Dynamic Type; Reduce Motion; VoiceOver focus | A capture shows a hit target below the platform minimum or text that does not scale | | FR4 | Theme test with two themes, plus source review for literals | default theme; a second theme with different color, type, and shape | A brand value stays the same across both themes, or a platform-only visual prop is added |