Skip to content

feat(ghost-drift): support token references in role palette fields#48

Merged
nahiyankhan merged 1 commit intomainfrom
feat/role-token-references
Apr 22, 2026
Merged

feat(ghost-drift): support token references in role palette fields#48
nahiyankhan merged 1 commit intomainfrom
feat/role-token-references

Conversation

@nahiyankhan
Copy link
Copy Markdown
Collaborator

@nahiyankhan nahiyankhan commented Apr 22, 2026

Summary

  • roles[].tokens.palette.{background,foreground,border} now accept {palette.dominant.<role>} and {palette.semantic.<role>} references, so renames in the palette cascade into every role that cites them.
  • ghost-drift lint flags unresolved references as broken-role-reference (error). Three failure kinds surface as distinct messages: unknown role, unsupported namespace (with the supported list), malformed syntax.
  • Positional inventories (palette.neutrals, typography, spacing, surfaces) stay raw — they have no named slots to point at. Called out explicitly under "What's deliberately excluded" in the format docs, so the narrow surface is on the record.

Frame for reviewers: this is the first of two potential moves inspired by Google Labs' design.md. It adds the reference surface where naming already exists; the harder question — whether typography/spacing should grow a named layer — is deferred until a profile recipe has a real reason to emit one.

No schema version bump, no new required fields, no breaking change. Raw hexes continue to work untouched.

Test plan

  • pnpm test — 175/175 green (12 new resolver tests + 4 new lint tests)
  • pnpm check — biome + typecheck + file-size + docs-frontmatter + cli-manifest all pass
  • schemas/fingerprint.schema.json stays byte-identical after pnpm --filter ghost-drift build && node scripts/emit-fingerprint-schema.mjs && pnpm fmt
  • Eyeball the new "Token references" subsection in docs/fingerprint-format.md once deployed

🤖 Generated with Claude Code

Role palette fields (background, foreground, border) now accept
`{palette.dominant.<role>}` and `{palette.semantic.<role>}` references
in addition to raw hex values. Renames in the palette cascade into
every role that cites them, and `ghost-drift lint` flags unresolved
references as `broken-role-reference` — unknown role, unsupported
namespace, or malformed syntax each surface as distinct messages.

Positional inventories (palette.neutrals, typography, spacing,
surfaces) stay raw — they have no named slots to point at. The
"What's deliberately excluded" section in docs/fingerprint-format.md
spells this out, so the narrow surface is on the record.

No schema version bump, no breaking change. Raw hexes work untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nahiyankhan nahiyankhan merged commit adf6b96 into main Apr 22, 2026
6 checks passed
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