feat(map-tokens): kind-scope the candidate list in the prompt - #201
Merged
Tyler Pina (tylerpina) merged 1 commit intoSep 4, 2026
Conversation
|
Bito Automatic Review Skipped - Branch Excluded |
Tyler Pina (tylerpina)
force-pushed
the
integ-4801-kind-scope-map-tokens-prompt
branch
from
September 2, 2026 21:18
513e37f to
89d8974
Compare
Every design-token prop received the full DTCG token tree as candidates, regardless of its own $token.kind — noise on every run and a truncation risk on real libraries where colors, spacing, and typography are all populated separately. The token path index is now split into one section per $token.kind present among the CDF's design-token props, each containing only tokens of that type, flattened to one path · type line per candidate instead of a nested JSON array. A prop with no $token.kind still falls back to the full, unscoped tree — unchanged from before. No change to apply.ts, the map_token_prop contract, or the CDF schema — this only reshapes what the agent sees before it decides.
Tyler Pina (tylerpina)
force-pushed
the
integ-4801-kind-scope-map-tokens-prompt
branch
from
September 3, 2026 23:59
89d8974 to
c467563
Compare
Tyler Pina (tylerpina)
marked this pull request as ready for review
September 4, 2026 21:08
Tyler Pina (tylerpina)
merged commit Sep 4, 2026
1479d78
into
integ-4683-design-token-auto-binding-m1
8 checks passed
Tyler Pina (tylerpina)
deleted the
integ-4801-kind-scope-map-tokens-prompt
branch
September 4, 2026 21:09
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.
Summary
map tokensstep's prompt gave every design-token prop the entire DTCG token tree as candidates, regardless of the prop's own$token.kind— a color prop saw spacing, typography, and every other tier too. That's noise on every run and a truncation risk on real libraries where each token category is separately populated.$token.kindpresent among the CDF's design-token props, each scoped to tokens of that type only, and flattened to onepath · typeline per candidate instead of a nested JSON array — legible and countable. A prop with no$token.kindstill falls back to the full, unscoped tree, unchanged from before.apply.ts, themap_token_propcontract, or the CDF schema — this only reshapes what the agent sees before it decides.Test plan
prompt-builder.test.ts: kind-scoping excludes other kinds, a prop with no$token.kindfalls back to the full tree, multiple distinct kinds render separate sections, and a determinism check (identical input produces a byte-identical prompt across repeated calls).experience-design-system-generationsuite passes (152 tests).experience-design-system-clisuite passes against a freshly rebuilt dist (3234 tests) — the CLI's map-tokens integration tests spawn the compiled binary, so this exercises the change end-to-end, not just the unit tests.