Skip to content

feat: Astryx contract slice — 9 components, 6 rules from Meta's own doc source (PR-19)#14

Merged
ryandmonk merged 2 commits into
mainfrom
feat/astryx-contract
Jul 4, 2026
Merged

feat: Astryx contract slice — 9 components, 6 rules from Meta's own doc source (PR-19)#14
ryandmonk merged 2 commits into
mainfrom
feat/astryx-contract

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

What

M3 plan Phase 3, PR-19 (ADR-M3-5 as confirmed): examples/astryx.dspack.json — a governed slice of Astryx (MIT, explicitly guidance-over-enforcement), pinned v0.1.2 (commit 6c533c70).

The authoring story (write-up material)

Astryx's "agent-ready" claim turned out to be literally true for contract authoring: the repo ships structured *.doc.mjs files per component — descriptions, full prop tables, and bestPractices entries with machine-readable do/don't flags. The contract's component entries are derived from Meta's own doc source, and every component and rule carries an x-source provenance link to the exact file at the pinned tag. Categories mirror Astryx's own docs taxonomy.

Structural findings the contract documents

  • Props-based where shadcn is compositional: AlertDialog carries title/description/actionLabel as required string props — no trigger sub-component. Button.label is the required accessible name. The shadcn projection-gap class is structurally impossible in this API — governance shifts to prop-presence rules (required-props' prop form, now used in anger). The ADR-M3-5 caveat (Astryx does not exercise the A2UI projection gap) is confirmed from the API side.
  • Data-driven collections: Table (data/columns) and DropdownMenu (items) take array props, not children — documented as array-typed props; generation-schema array support will surface in the pipeline leg (PR-20).
  • IconButton excluded, honestly: its required icon prop is ReactNode — not surface-expressible.

The rules (each provenance-quoted in its rationale)

Rule Type Source guidance (verbatim) ADR-M3-3 shape
destructive-requires-alertdialog component-choice "Don't use AlertDialog for non-destructive actions; use a standard Dialog instead" substitution ✓ (2nd rule)
alertdialog-carries-content required-props (props) "Describe what will happen in the description…" + required API props addition ✓
alertdialog-action-label-specific forbiddenProps "'Delete project' is better than 'OK' or 'Confirm'" substitution ✓
button-carries-label required-props (props) "Always provide a label for icon-only buttons…" addition ✓
input-carries-label required-props (props) "Always provide a visible label…" addition ✓
dialog-no-nested-overlays forbiddenCategories modality guidance; categories in anger deletion ✓ (2nd rule)

The conversion-rate finding (previewed; quantified in the Phase 3 findings)

Not everything converts — the misses are ceiling evidence, verbatim: "don't place more than one primary button in the same view" (max-cardinality, a documented v0.4 ceiling item), "don't use the destructive variant without a confirmation step" (ancestor requirement), plus quality judgments ("labels that describe the action") and runtime behaviors (loading states). The full do/don't census lands with the eval leg.

Acceptance

npm run validate — green (both example contracts; the worked example passes S1/S2 + referential consistency and satisfies all six rules).

Hand-review surface

The contract itself — the second-biggest review artifact of M3 (per the plan). Every claim in it is checkable against the pinned x-source files.

🤖 Generated with Claude Code

…oc source (PR-19)

M3 plan Phase 3, ADR-M3-5 as confirmed: a governed slice of Astryx (MIT,
guidance-over-enforcement), pinned v0.1.2 (commit 6c533c70), authored from
the repository's structured *.doc.mjs files — component descriptions, prop
tables, and do/don't bestPractices are machine-readable at the source, so
every component and rule carries an x-source provenance link to the exact
file at the pinned tag.

Structural findings the contract documents (write-up material):
- Astryx is PROPS-BASED where shadcn is compositional: AlertDialog carries
  title/description/actionLabel as required string props (no trigger
  sub-component); Button.label is the required accessible name. The shadcn
  projection-gap class is structurally impossible here — governance shifts
  to prop-presence rules (required-props' prop form, used in anger).
- Tables and menus are DATA-DRIVEN (array props), documented as such;
  generation-schema array support surfaces in the pipeline leg.
- IconButton is EXCLUDED: its required icon prop is ReactNode, not
  surface-expressible (documented honest scope).

Rules (all provenance-quoted): destructive-requires-alertdialog
(component-choice; the AlertDialog/Dialog analog), alertdialog-carries-
content + button-carries-label + input-carries-label (required-props, prop
form), alertdialog-action-label-specific (forbiddenProps — 'OK'/'Confirm'
forbidden verbatim from the guidance), dialog-no-nested-overlays
(forbiddenCategories; categories mirror Astryx's own taxonomy).

validate green (both example contracts).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 4, 2026 17:29

Copilot AI 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.

Pull request overview

Adds a new governed example contract for Meta’s Astryx design system (pinned to upstream v0.1.2) to illustrate a props-based, doc-derived component slice and corresponding governance rules, and links it from the examples README.

Changes:

  • Added examples/astryx.dspack.json: Astryx slice (9 components) with categories, intents, 6 governance rules, and a worked example surface.
  • Updated examples/README.md to list and describe the new Astryx example contract.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
examples/README.md Adds the Astryx example to the examples index with a brief description.
examples/astryx.dspack.json Introduces a new dspack v0.4 contract example for Astryx with components, categories, rules, and an example surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/astryx.dspack.json Outdated
Comment thread examples/astryx.dspack.json Outdated
…rsion alignment

- description says 'nine-component slice' (was '~10', the map has 9)
- top-level version now 0.1.2, matching the pinned upstream tag per the
  schema's documented meaning ('version of the design system content') —
  the pin (metadata.x-upstream) and the displayed version now agree

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryandmonk ryandmonk merged commit 303096d into main Jul 4, 2026
1 check passed
@ryandmonk ryandmonk deleted the feat/astryx-contract branch July 4, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants