Skip to content

fix(core): keep all fields and record provenance when a manifest overrides a token - #1573

Merged
GarthDB merged 5 commits into
mainfrom
fix/override-keeps-fields
Oct 31, 2026
Merged

GarthDB merged 5 commits into
mainfrom
fix/override-keeps-fields

Conversation

@GarthDB

@GarthDB GarthDB commented Oct 31, 2026

Copy link
Copy Markdown
Member

Description

A manifest overrides entry now replaces the foundation record in place and keeps every field of it ($schema, $valueType, description, lifecycle, uuid and so on), changing only value or $ref. The replaced record carries overriddenBy and overriddenFrom. Two commits:

  1. fix(core): the override fix, its spec text in manifest.md, and a fixture-platform cascade test.
  2. fix(figma): design-data figma export --platform kept only one color-scheme mode of an overridden token (the three iOS seafoam tokens lost their dark value). Overrides now group with their foundation siblings.

Related Issue

Bead spectrum-design-data-p6ga.8.9 (override field preservation), part of the split of #1569 (bead p6ga.9). Follow-up for the shared root cause: spectrum-design-data-p6ga.8.50.

Motivation and Context

Before this, an override produced a synthetic record with only name, value and uuid, so every other field was lost. The fix is independent of the visual recipes work.

Behavior change to know about:

  • Markers in query output (intentional). overriddenBy ({platform} or {manifest}) and overriddenFrom (the foundation value or $ref) now appear on overridden tokens in platform query output. Untouched tokens carry no marker. With two overrides on one token the last value wins and the first overriddenFrom is kept.
  • Legacy output is unchanged. legacy.rs drops the markers, but that strip is defensive: the legacy converter copies only a fixed set of fields, so the markers never reach the output either way. The legacy test is a contract pin (the override value is exported, no provenance appears). It passes without the strip, and it does not claim the strip fixes anything.
  • Known pre-existing split, not a regression and not fixed here. An override record carries file: manifest.json, so cascaded legacy output writes it to a separate file and splits its color set. The Figma fix in commit 2 works around the same overloaded field. The cleaner end state is to keep the foundation record's file, carry provenance only in overriddenBy and drop the exporter special case. Tracked in spectrum-design-data-p6ga.8.50.

How Has This Been Tested?

  • sdk/core/tests/platform_cascade.rs replaces the earlier tests (which needed core::visual) and keeps every case: field preservation, value to $ref and back, the type-change error, the manifest-name fallback, two overrides on one token (first overriddenFrom wins), and the legacy-output contract. It also keeps the cascade audit tests (include/exclude, extensions, mode sets). Only the render test is left out; it follows with the recipes work.
  • Figma golden: overridden_color_token_keeps_all_its_modes.
  • cargo fmt --check, cargo clippy -p design-data-core -p design-data-figma --all-targets -- -D warnings, cargo test for both crates, moon run sdk:test (1598 passed), design-data:legacy-output, tokens:verifyLegacyOutput, design-data:validate. No golden or legacy output changed.
  • pnpm install --frozen-lockfile, pnpm ai:check, changeset linter with --fail-on-warnings, empty git diff pnpm-lock.yaml.

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Changesets: platform-override-keeps-fields (@adobe/design-data-spec patch, @adobe/design-data-wasm patch, 18 body lines) and figma-export-override-modes (@adobe/design-data-tui patch, 8 body lines), each under 20 lines.

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.

test added 2 commits October 31, 2026 13:13
…rides a token

An override now replaces the foundation record in place, keeps its other fields and records
overriddenBy and overriddenFrom. Legacy output drops the provenance markers. Specify the
behavior in manifest.md and cover it with a fixture-platform cascade test.
@changeset-bot

changeset-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cd7bdb5

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

This PR includes changesets to release 9 packages
Name Type
@adobe/design-data-tui Patch
@adobe/design-data-spec Patch
@adobe/design-data-wasm Patch
@adobe/design-data Patch
s2-tokens-viewer Patch
@adobe/design-data-agent-mcp Patch
@adobe/design-data-mcp Patch
@adobe/spectrum-design-data-mcp Patch
@adobe/token-naming-audit 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

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Run report for cd7bdb5e

Total time: 2m 46s | Comparison time: 4m 39s | Estimated savings: 1m 53s (40.6% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 8.7ms Passed
🟩 SyncProject(sdk) 0.5ms Passed
⬛️ SetupToolchain(node:20.17.0) 401.6ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 535.1ms Skipped
🟩 SetupEnvironment(rust, sdk) 96.2ms Passed
⬛️ InstallDependencies(rust, sdk) 2.2ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 286.8ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.4ms Skipped
🟩 RunTask(sdk:fmt-check) 1.2s Passed
🟩 InstallDependencies(javascript, sdk) 6.6s Passed
🟩 RunTask(sdk:codegen-check) 236.3ms Passed
🟩 RunTask(sdk:lint) 53.1s Passed
🟩 RunTask(sdk:test-doc) 1m 46s Passed
🟩 RunTask(sdk:test) 2m 38s Passed SLOW
Changed files
.changeset/figma-export-override-modes.md
.changeset/platform-override-keeps-fields.md
packages/design-data-spec/spec/manifest.md
sdk/core/src/graph.rs
sdk/core/src/legacy.rs
sdk/core/tests/fixtures/platform-cascade/extensions/mode-sets/fixture.json
sdk/core/tests/fixtures/platform-cascade/extensions/relationships/fixture.json
sdk/core/tests/fixtures/platform-cascade/extensions/tokens/fixture.tokens.json
sdk/core/tests/fixtures/platform-cascade/manifest.json
sdk/core/tests/platform_cascade.rs
sdk/plugins/figma/src/mapping/golden_tests.rs
sdk/plugins/figma/src/mapping/graph.rs

@github-actions

Copy link
Copy Markdown
Contributor

🧩 Component Schema Changes Report

No component schema changes detected.

This comment was automatically generated by the component schema diff tool. 🤖

@github-actions

Copy link
Copy Markdown
Contributor

🎨 Token Changes Report

Tokens Changed (0)

Original Branch: main


This comment was automatically generated by the token diff tool. 🤖

GarthDB and others added 3 commits October 31, 2026 13:43
…rriddenBy to the code

Revert the Prettier rewrite of unrelated sections so the diff shows only the overrides change.
The manifest case of overriddenBy is the literal file name, so the spec says that.
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