Repository navigation
spec(knowledge-contracts): every spec in the repository is a knowledge record - #8113
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/approve-spec 0ad2d14 |
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Changes requested: the owner-approved INV27 direction is clear, but this head leaves two current records disagreeing about native specs. spec:AST-093 FR1 still says a native component spec is packages/native/specs/<language>/<Name>.md built from packages/native/specs/TEMPLATE.md, which INV27 now rules out, so please amend FR1 with its verification row and Current-state impact in this pull request, or hold the native placement until that amendment lands.
- The new enforcement-gap paragraph says discovery reads only Core, Lab, themes and
docs/, butscripts/check-knowledge.mjsalready validates the registered flat component packages, including six draft records inpackages/charts/src/that the new component-root list leaves out. - The gap should also name the component
idPatternchange, since^component:[A-Z][A-Za-z0-9]*$rejectscomponent:swift/Button. - The package-record example
packages/native/specs/swift/accessibility.spec.mddoes not follow thespecs/<slug>.spec.mdrule it illustrates. - Please list the open pull requests you searched in the description, including #8033, which keeps the package template.
[Automated review]
| today or is added later, is a record of a kind this record names. It carries | ||
| that kind's frontmatter, follows that kind's template in | ||
| `docs/templates/knowledge/`, and sits at that kind's canonical location | ||
| (Owning code). No package defines its own spec format, template, or location. |
There was a problem hiding this comment.
This conflicts with current spec:AST-093 FR1, which still says a native component spec is packages/native/specs/<language>/<Name>.md and follows packages/native/specs/TEMPLATE.md; its FR1 verification row counts a spec outside that folder passing review as a failure. With both current, native authors can't satisfy both. Please amend AST-093 FR1, its verification row and its Current-state impact in this PR, including which swift-ios-<n> package holds a language's record, or hold the native placement until that amendment lands.
| - Component records are direct `<PublicName>.spec.md` children of a component | ||
| root. Component roots are the component directories of Core | ||
| (`packages/core/src/`), Lab (`packages/lab/src/`), and every platform | ||
| implementation package, such as `packages/native/swift-ios-<n>/core/` for |
There was a problem hiding this comment.
Discovery already treats charts, richtext and vega as component packages (scripts/component-packages.cjs, flat layout with records directly under src/) and reads six draft records in packages/charts/src/ today. This list leaves them out, so under INV27 they would sit outside their kind's location. Consider listing the registered flat component packages here.
| Current enforcement gap: discovery does not yet read record candidates outside | ||
| Core, Lab, themes, and `docs/`, and component records have no `platform_of` | ||
| field until the next schema version. Until both land, records under | ||
| `packages/native/` are checked only by review. |
There was a problem hiding this comment.
scripts/check-knowledge.mjs already reads component records outside Core, Lab, themes and docs/ (the flat packages above), so this sentence understates what discovery does. The schema work is also more than platform_of: the v3 component idPattern (^component:[A-Z][A-Za-z0-9]*$) rejects component:swift/Button.
| and id `architecture:<package>-<slug>`. For example, the Swift accessibility | ||
| rules are `architecture:native-swift-accessibility` at | ||
| `packages/native/specs/swift/accessibility.spec.md`. Repository-wide |
There was a problem hiding this comment.
The rule puts <slug>.spec.md directly in the package's specs/ directory with id architecture:<package>-<slug>, but the example nests it as specs/swift/accessibility.spec.md. By the rule this is packages/native/specs/swift-accessibility.spec.md; either change the example or let the rule allow subdirectories and define the slug.
There was a problem hiding this comment.
Approval waits on an engineering owner's decision: INV27, DEC-13 and the new package and platform placement rules are new requirements, and the earlier /approve-spec named the previous commit, so this head has no spec-owner approval. Current spec:AST-093 FR1 still places native component specs at packages/native/specs/<language>/<Name>.md from packages/native/specs/TEMPLATE.md, so approval also needs an engineering owner to update FR1, its verification row and its Current-state impact in this pull request (or to hold out the native placement sentences); an engineering owner then records the decision by commenting /approve-spec with the full SHA of the head being approved (for this head, /approve-spec 57e419b5b02cf18ca4585d813411c207915e2a67), and the author may do so as an engineering owner. Three wording fixes are needed as well:
- Platform ids are per language while every versioned platform package is a component root, so two
swift-ios-<n>packages would both holdcomponent:swift/Button; say which package holds a language's record. - Charts, RichText and Vega are flat packages whose component records sit directly in
src/, not in component directories, and the spec-writing guide's list leaves them out. - INV27's first sentence ("a file that states what any part of the system does") also covers consumer docs and READMEs; scope it to specifications.
[Automated review]
| `scripts/component-packages.cjs`) and of every platform implementation | ||
| package, such as `packages/native/swift-ios-<n>/core/` for Swift. A platform implementation's record has the id | ||
| `component:<language>/<PublicName>` (for example `component:swift/Button`), | ||
| names its core record in `platform_of`, and states only what that platform |
There was a problem hiding this comment.
Every platform implementation package is a component root, but the record's id is per language. With versioned packages (swift-ios-1, swift-ios-2, …), a Button in two packages gives two records the same id component:swift/Button, which check-knowledge rejects as a duplicate. Please say which package holds a language's record, or put the package in the id.
| root. Component roots are the component directories of every registered | ||
| component package's source root (Core `packages/core/src/`, Lab | ||
| `packages/lab/src/`, Charts `packages/charts/src/`, and the others in |
There was a problem hiding this comment.
Charts, RichText and Vega are flat packages: their component records are direct children of src/ (for example packages/charts/src/Chart.spec.md), and a .spec.md inside a component directory of a flat package is classified as a module. Please say that a flat package's component records sit directly in its src/.
| - `docs/templates/knowledge/` contains the only authoring forms; a package keeps | ||
| no template of its own (INV27). |
There was a problem hiding this comment.
Current spec:AST-093 FR1 still says a native component spec follows packages/native/specs/TEMPLATE.md at packages/native/specs/<language>/<Name>.md. Both records are current, so FR1, its verification row and its Current-state impact need amending in this pull request (or the native placement held out) before reviewers can rely on this rule.
| - **INV27 — Every specification in the repository is a knowledge record.** A | ||
| file that states what any part of the system does, in any package that exists | ||
| today or is added later, is a record of a kind this record names. It carries |
There was a problem hiding this comment.
"A file that states what any part of the system does" also describes consumer docs, package READMEs and CLI guide pages, which this record keeps outside the record kinds, while the discovery sentence below excludes README.md. Please scope this sentence to specifications, for example files that state requirements an implementation must meet.
| `<Name>.spec.md` component and module contracts in Core, Lab, and platform | ||
| implementation packages. A spec that is not a valid knowledge record is not |
There was a problem hiding this comment.
This list leaves out the registered flat component packages (Charts, RichText, Vega), whose colocated records the guide also covers.
|
/approve-spec 27f07cc |
57e419b to
27f07cc
Compare
There was a problem hiding this comment.
The exact-head spec approval settles the direction, and amending AST-093 in this pull request resolves the earlier conflict between the two records; four wording fixes remain before it can land.
platform_of: knowledge-contracts says a platform record names its core record, AST-093 says its core component, and Button, Card, Heading and TextInput have no core record yet, so please make both records say the same thing and cover that case.- Charts, RichText and Vega keep their component records directly in
src/, but the Owning code text describes component directories, a layoutpnpm check:knowledgerejects, and the spec-writing guide leaves those packages out. - AST-093's FR2 and FR3 verification rows still point at the package template's native-control and guideline sections, which the shared component template does not have.
- INV27's first sentence ("a file that states what any part of the system does") also covers consumer docs and READMEs, so please scope it to specifications.
The next commit resets the spec approval, so an engineering owner will need to approve the final head again.
[Automated review]
| `scripts/component-packages.cjs`) and of every platform implementation | ||
| package, such as `packages/native/swift-ios-<n>/core/` for Swift. A platform implementation's record has the id | ||
| `component:<language>/<PublicName>` (for example `component:swift/Button`), | ||
| names its core record in `platform_of`, and states only what that platform |
There was a problem hiding this comment.
This says a platform record names its core record in platform_of, while AST-093 FR1 (docs/specs/AST-093-native-component-guidelines/spec.md:62) says its core component. Button, Card, Heading and TextInput, four of the six first Swift views AST-093 lists, have no core record today (their core contract is packages/native/src/components/<Name>.ts), so their Swift records can follow AST-093 but not this line or DEC-13. Please make both records say the same thing: what platform_of holds, and what a platform record covers when its core component has no record (or require a core record first).
| | FR2 | The spec's native-control section 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 guideline section 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 | |
There was a problem hiding this comment.
FR1 now builds the spec from docs/templates/knowledge/component-spec.md and retires packages/native/specs/TEMPLATE.md, but these rows still verify "the spec's native-control section" and "the spec's guideline section", which only the package template has. Consider verifying what the spec states (the platform control it looked for and why it does not fit; the guideline pages it follows), or naming the component-template section that holds each.
|
/approve-spec 9c7398a |
27f07cc to
9c7398a
Compare
There was a problem hiding this comment.
Changes requested: the exact-head spec approval settles the direction and the earlier wording fixes are in, but the native package's own instructions still point at the template this head retires, and two sentences restate the rule inaccurately.
packages/native/specs/README.md(Adding a spec) and the two Swift READMEs still say to copyTEMPLATE.mdfor a new component spec, which amended AST-093 FR1 and INV27 rule out; please point them at the record form, or say in AST-093's Current-state impact that new component specs follow FR1 until the conversion.docs/contributing/spec-writing.mdsays a spec that is not a valid record “is not a spec”, while INV27 says it fails the knowledge check; please state it as the requirement.- DEC-13 still says a platform record names its core record, while the Owning code rule and AST-093 FR1 cover core components with no record yet (Button, Card, Heading, TextInput); please align it.
The next commit resets the spec approval, so an engineering owner will need to record /approve-spec on the final head.
[Automated review]
| packages. A spec that is not a valid knowledge record is not | ||
| a spec (`architecture:knowledge-contracts` INV27). An implementation |
There was a problem hiding this comment.
INV27 says a spec-shaped file that is not a valid record fails pnpm check:knowledge; this sentence instead says it “is not a spec”, which reads as putting such files outside INV27 and outside this guide's rubric. Consider: “Every spec is a valid knowledge record (architecture:knowledge-contracts INV27); one that is not fails the knowledge check.”
| record kinds, frontmatter, templates, and placement this record defines, and | ||
| discovery fails a spec-shaped file that is not a valid record. A platform | ||
| implementation's component record is a `component` record with a | ||
| language-qualified id that names its core record, so the core record keeps the |
There was a problem hiding this comment.
The Owning code rule and AST-093 FR1 now have a platform record name its core component and let that component's public source and documentation stand in until it has a record, but DEC-13 still says it names its core record and that the core record keeps the shared contract. Button, Card, Heading and TextInput have no core record yet; consider “names its core component” here, or citing the Owning code rule.
| - The Swift specs under `packages/native/specs/swift/` and the package template | ||
| `packages/native/specs/TEMPLATE.md` predate FR1's record form. They convert | ||
| to knowledge records in one change, which removes the template. |
There was a problem hiding this comment.
packages/native/specs/README.md (Adding a spec, step 1) and the two Swift READMEs still tell authors to copy TEMPLATE.md for a new component spec, which FR1 now rules out. Please update those instructions in this pull request, or say here that new component specs follow FR1 rather than the package READMEs until the conversion.
… record INV27 makes every specification, in any package, a knowledge record; DEC-13 records the owner decision. Platform packages place component records as component:<language>/<Name> naming the core component in platform_of, with the core component's public source standing in until its core record exists. spec-writing covers every record anywhere. AST-093 FR1 builds native component specs from the standard component template.
|
/approve-spec 8b8d6b3 |
9c7398a to
8b8d6b3
Compare
There was a problem hiding this comment.
Recommend approval: the exact-head spec approval covers INV27, DEC-13 and the amended AST-093 FR1, and the three fixes requested on the previous revision are in. pnpm check:knowledge passes on this revision, and the enforcement-gap paragraph covers the only specs discovery does not read yet, the eight files under packages/native/specs/. Optionally, the package specs/ placement bullet could say whether Core's own cross-component architecture counts as repository-wide, since four Core-only architecture records stay in docs/architecture/. Any new commit resets the spec approval, so an engineering owner would record /approve-spec again on the final head.
[Automated review]
Exact decision needed
Whether every spec in the repository, in any package including ones added later, must be a standard knowledge record.
Existing authority searched
architecture:knowledge-contractsdefines record kinds, frontmatter, templates and placement, but only places component records under Core and Lab, themes underpackages/themes/, and everything else underdocs/.docs/contributing/spec-writing.mdapplies to knowledge records, but doesn't say a spec outside those places must be one.packages/native/specs/currently holds Markdown specs with no frontmatter and a package-local template, whichpnpm check:knowledgeandpnpm specs:fordon't see.Decision
docs/templates/knowledge/, and its canonical location. No package defines its own format, template or location. Discovery treats every*.spec.mdfile and every Markdown file under aspecsdirectory as a record candidate, and fails one that isn't a valid record (README.md,plan.mdand already-ignored paths excepted).component:<language>/<PublicName>(e.g.component:swift/Button), names its core record inplatform_of, and holds only the platform's part. A package's cross-component rules live inpackages/<package>/specs/as<slug>.spec.mdarchitecture records (architecture:<package>-<slug>).docs/, plus theplatform_ofschema field) is stated until the implementing change lands.Rejected alternatives
Claim scope and non-goals
Record kinds, frontmatter fields for existing kinds, and current records outside
packages/native/are unchanged.Evidence and implementation relationship
Record only. A follow-up updates
check:knowledgediscovery, addsplatform_ofin the next schema version, and converts the native specs (and amends AST-093 FR1 to cite this placement).Writing rubric results
Scope
architecture:knowledge-contracts), affected claims, and overlapping open work (native spec PRs) are named.Validation
Prettier-formatted with the repository config;
check:knowledgeruns in CI.Overlapping open work searched
packages/native/specs/(spec(native): Swift theme generator turns any Astryx theme into an AstryxTheme #8031, spec(native): Swift component API takes the generated contract in SwiftUI's shape #8035, spec(native): typed slots for Swift (text, icon, named components, content) #8037, spec(native): augmentable variants on Swift are open types the theme extends #8039, spec(native): the Swift theme rides on SwiftUI's environment both ways #8040, spec(native): Astryx looks as SwiftUI styles, with views built on them #8091). They land in their current shape and are converted by the implementing change.Landing order
After #8033, so FR1 is amended against its merged text.