Skip to content

feat: taxonomy registry split, schema update, and SPEC-009 validation#810

Merged
GarthDB merged 5 commits intomainfrom
feat/taxonomy-registry-split
Apr 2, 2026
Merged

feat: taxonomy registry split, schema update, and SPEC-009 validation#810
GarthDB merged 5 commits intomainfrom
feat/taxonomy-registry-split

Conversation

@GarthDB
Copy link
Copy Markdown
Member

@GarthDB GarthDB commented Apr 2, 2026

Description

Implements the taxonomy follow-through work from #806: splits the registry, updates the token schema, and implements SPEC-009 validation.

Phase 1 — Registry split and new registries:

  • Split anatomy-terms.json: removed styling surfaces and positional terms
  • Created token-objects.json (background, border, edge, visual, content)
  • Created 6 new taxonomy registries: structures, substructures, orientations, positions, densities, shapes

Phase 2 — Token schema update:

  • Added all 13 semantic fields explicitly to nameObject in token.schema.json
  • Added descriptions distinguishing semantic fields from dimension fields

Phase 3 — SPEC-009 implementation:

  • Created registry.rs module embedding registry JSON at compile time
  • Expanded ValidationContext with RegistryData
  • Implemented SPEC-009 validation: checks 12 semantic name-object fields against registries with Warning severity

Related Issue

Motivation and Context

The spec (taxonomy.md, token-format.md) defines 13 semantic fields on the name object with advisory validation against the design system registry. Until now, the registry conflated anatomy parts with styling surfaces, the schema only explicitly defined 7 of 13 fields, and SPEC-009 was a stub. This PR bridges the gap between the spec and the implementation.

How Has This Been Tested?

  • Registry: 63 AVA tests pass including new tests for all 7 taxonomy registries (load, no duplicates, expected values, anatomy/token-objects split verification). Registry schema validation passes for all 18 registry files.
  • Schema: All 146 Rust SDK tests pass including structural validation of existing Spectrum token sources.
  • SPEC-009: 10 new Rust unit tests covering valid values (no warning), unknown values (warning), anatomy/objects split behavior, dimension field exclusion, property field exclusion, and multiple-field scenarios.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

GarthDB and others added 2 commits April 2, 2026 16:19
Split anatomy-terms.json to separate component anatomy parts from
styling surfaces and positional terms per the taxonomy spec (taxonomy.md,
discussion #806):

- anatomy-terms.json: now only visible named parts (icon, label, etc.)
- token-objects.json: NEW — styling surfaces (background, border, edge,
  visual, content)
- structures.json: NEW — reusable visual patterns (base, container, etc.)
- substructures.json: NEW — child structures (item)
- orientations.json: NEW — direction terms (vertical, horizontal)
- positions.json: NEW — positional terms (top, bottom, start, end, affixed)
- densities.json: NEW — spacing options (spacious, compact)
- shapes.json: NEW — shape terms (uniform)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explicitly define the 9 semantic fields from taxonomy.md that were
previously falling through additionalProperties: structure, substructure,
anatomy, object, orientation, position, size, density, shape. Add
descriptions distinguishing semantic fields from dimension fields.

Purely additive — existing tokens that use these fields via
additionalProperties continue to validate unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

🦋 Changeset detected

Latest commit: 12375e0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@adobe/design-system-registry Minor
@adobe/design-data-spec Minor
markdown-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Add registry module that embeds design-system-registry JSON at compile
time via include_str!. Expand ValidationContext with RegistryData.
Replace SPEC-009 stub with real validation logic that checks 12 semantic
name-object fields (component, state, variant, size, anatomy, object,
structure, substructure, orientation, position, density, shape) against
their corresponding registries with advisory (Warning) severity.

Excluded fields: property (free-form), colorScheme/scale/contrast
(dimension fields validated by SPEC-005/SPEC-008).

Closes #763.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@GarthDB GarthDB force-pushed the feat/taxonomy-registry-split branch from 83ca76e to 12e62c2 Compare April 2, 2026 23:23
@GarthDB
Copy link
Copy Markdown
Member Author

GarthDB commented Apr 2, 2026

Run report for 12375e02

Total time: 1m 47s | Comparison time: 5m 17s | Estimated savings: 3m 30s (66.2% faster)

Action Time Status Info
⬛️ SetupProto(0.51.4) 0.1ms Skipped
🟩 SyncWorkspace 6.9ms Passed
🟩 SyncProject(designDataSpec) 0.3ms Passed
🟩 SyncProject(sdk) 0.4ms Passed
🟩 SyncProject(componentSchemas) 0.4ms Passed
🟩 SyncProject(tokens) 0.3ms Passed
🟩 SyncProject(design-system-registry) 0.4ms Passed
🟩 SyncProject(markdown-generator) 0.3ms Passed
🟩 SyncProject(site) 0.4ms Passed
🟩 RunTask(site:copySpec) 1s Passed
🟩 SetupToolchain(rust:1.85.0) 8s Passed
🟩 InstallWorkspaceDeps(rust:1.85.0, sdk) 999.7ms Passed
⬛️ SetupToolchain(node:20.17.0) 9.4s Skipped
🟩 InstallWorkspaceDeps(node:20.17.0) 14.8s Passed
🟩 RunTask(design-system-registry:validate) 366.7ms Passed
🟩 RunTask(tokens:buildManifest) 326.9ms Passed
🟩 RunTask(sdk:build) 1m 4s Passed
🟩 RunTask(design-system-registry:test) 2.3s Passed
🟩 RunTask(componentSchemas:test) 5.8s Passed
🟩 RunTask(site:generateToolsPage) 1.4s Passed
And 13 more...
Expanded report
Action Time Status Info
🟩 RunTask(sdk:test) 1m 14s Passed
🟩 RunTask(designDataSpec:check) 219.6ms Passed
🟩 RunTask(tokens:verifyDesignDataSnapshot) 2s Passed
🟩 RunTask(tokens:validateDesignData) 2.9s Passed
🟩 RunTask(tokens:verifyLegacyRoundtrip) 1.4s Passed
🟩 RunTask(sdk:lint) 1m 30s Passed
🟩 RunTask(tokens:buildTokens) 1m 17s Passed
🟩 RunTask(tokens:build) 13.8ms Passed
🟩 RunTask(markdown-generator:generate) 335.1ms Passed
🟩 RunTask(site:copyContent) 73.4ms Passed
🟩 RunTask(tokens:test) 4.2s Passed
🟩 RunTask(site:build) 4.2s Passed
🟩 RunTask(site:export) 7.6ms Passed
Touched files
.changeset/taxonomy-registry-split.md
packages/design-data-spec/schemas/token.schema.json
packages/design-system-registry/index.js
packages/design-system-registry/package.json
packages/design-system-registry/registry/anatomy-terms.json
packages/design-system-registry/registry/densities.json
packages/design-system-registry/registry/orientations.json
packages/design-system-registry/registry/positions.json
packages/design-system-registry/registry/shapes.json
packages/design-system-registry/registry/structures.json
packages/design-system-registry/registry/substructures.json
packages/design-system-registry/registry/token-objects.json
packages/design-system-registry/test/registry.test.js
sdk/core/src/figma/mapping.rs
sdk/core/src/lib.rs
sdk/core/src/registry.rs
sdk/core/src/validate/rule.rs
sdk/core/src/validate/rules/mod.rs
sdk/core/src/validate/rules/spec009.rs

GarthDB and others added 2 commits April 2, 2026 16:31
- Add doc comment to registry.rs explaining include_str! paths are
  relative to sdk/core/src/registry.rs and will fail at compile time
  if the file is moved
- Expand shapes.json description to note it is a starting vocabulary
- Add changeset for @adobe/design-system-registry and
  @adobe/design-data-spec (both minor: new registries + schema fields)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@GarthDB GarthDB merged commit 4a55a5f into main Apr 2, 2026
4 checks passed
@GarthDB GarthDB deleted the feat/taxonomy-registry-split branch April 2, 2026 23:45
@GarthDB GarthDB mentioned this pull request Apr 2, 2026
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.

1 participant