feat(spec): string-name escape hatch for tokens (Proposal 012)#820
Merged
Conversation
Allow a token's name field to be a plain string when the structured name-object taxonomy cannot express the token's identity. String-named tokens are schema-valid but trigger SPEC-017 (severity: warning, category: tech-debt), surfacing them in conformance reports for remediation tracking — analogous to CSS !important. Adds the oneOf union to tokenWithValue and tokenWithRef in token.schema.json, a new spec section in token-format.md, SPEC-017 in rules.yaml, a Rust validator (spec017.rs) with three unit tests, and conformance fixtures for both the valid and warning cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…design-data-spec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: acb6cd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Member
Author
Run report for acb6cd28Total time: 1m 54s | Comparison time: 5m 13s | Estimated savings: 3m 18s (63.3% faster)
Touched files |
This was referenced Apr 28, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements Proposal 012: a formal escape hatch for tokens whose names cannot
be expressed using the structured name-object taxonomy.
Allows a token's
namefield to be a plain string (e.g."focus-ring-color-key-focus") instead of a name object. String-named tokensare schema-valid but trigger SPEC-017 (severity:
warning, category:tech-debt), making the debt visible and trackable in conformance reports —analogous to CSS
!important.Changes:
token.schema.json—namefield in bothtokenWithValueandtokenWithRefbecomes aoneOf [nameObject, string]uniontoken-format.md— new "String-name escape hatch" section with NORMATIVEstatements
rules.yaml— SPEC-017 (string-name-tech-debt, severity: warning)sdk/core/src/validate/rules/spec017.rs— Rust validator with 3 unit testsinvalid/SPEC-017/Related Issue
Closes the formal gap for the 730+ tokens tracked in
naming-exceptions.json.Follows Proposals 009, 010 from the token spec gap analysis.
Motivation and Context
naming-exceptions.jsonalready tracks 730+ tokens that don't roundtripthrough the name-object taxonomy. This proposal gives those tokens a formal,
spec-blessed path: they can be written with
"name": "raw-string"and toolingwill surface them as tech debt rather than silently accepting them.
How Has This Been Tested?
cargo testinsdk/)— includes 3 new SPEC-017-specific tests
cargo clippy -- -D warningspasses cleanTypes of changes
Checklist: