feat(sdk): op-based extensions/mode-sets/ grammar for platform manifests - #1449
Open
GarthDB wants to merge 2 commits into
Open
feat(sdk): op-based extensions/mode-sets/ grammar for platform manifests#1449GarthDB wants to merge 2 commits into
GarthDB wants to merge 2 commits into
Conversation
Platforms could previously only declare-or-replace a whole mode set, forcing
a full restatement of foundation's other modes to add just one value. This
adds addMode/removeMode/setDefault/remove ops, mirroring the existing
extensions/relationships/ add/override/remove grammar.
- sdk/core/src/manifest.rs: dedicated mode-sets/ loader block partitioning
plain adds before ops; new FragmentValidation::ModeSetAdds variant.
- sdk/core/src/graph.rs: op dispatch in apply_platform_manifest with loud
validation errors for missing fields, unknown ops, and invalid targets.
- sdk/core/src/lib.rs: conformance harness gains absent/modes/default
predicates for modeSets.
- packages/design-data-spec/spec/{manifest,mode-sets}.md: documented the
op grammar and updated the capability matrix.
- packages/design-data-spec/conformance/manifest-extensions/: new valid and
invalid fixtures covering each op.
🦋 Changeset detectedLatest commit: 414d5c4 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 |
Contributor
Run report for 414d5c44Total time: 2m 19s | Comparison time: 4m 4s | Estimated savings: 1m 45s (42.9% faster)
Changed files |
Contributor
🧩 Component Schema Changes ReportNo component schema changes detected.This comment was automatically generated by the component schema diff tool. 🤖 |
Contributor
🎨 Token Changes ReportTokens Changed (0)Original Branch: This comment was automatically generated by the token diff tool. 🤖 |
… fields Addresses PR review findings on the mode-set op grammar: - sdk/core/src/graph.rs: removeMode and remove now check the resolved graph for tokens still carrying the affected mode value/mode-set key, erroring instead of silently orphaning them for cascade matching (mirrors the authoring API's remove_mode/remove_mode_set "still referenced" guard). - sdk/core/src/graph.rs: a non-string "op" now errors instead of falling through to the plain add/replace path; op entries missing "name" now error instead of being silently skipped. - packages/design-data-spec/spec/manifest.md: documented both guards.
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
Platform manifests could previously only declare-or-replace a whole mode set by name under
extensions/mode-sets/, forcing a platform to restate every other foundation mode value just to add one (e.g. a thirdscalemode). This adds anop-based grammar —addMode/removeMode/setDefault/remove— mirroring the existingextensions/relationships/add/override/remove precedent, while leaving the no-opwhole-set add/replace behavior unchanged.Related Issue
No open issue tracked this; came out of a design discussion about supporting custom mode declarations (e.g. high contrast, additional color schemes/scale modes) without full-set restatement.
Motivation and Context
Redeclaring a full mode set to add one value drifts from foundation as foundation evolves. Granular ops let a platform add/drop a single mode value, retarget the default, or drop a whole set, without restating the rest.
How Has This Been Tested?
sdk/core/src/graph.rscovering every op's success and error paths (missing target, missing required field, unknown op, removing the current default, removing the last mode, retargeting to a non-member default), plus an end-to-end cascade-resolution test.sdk/core/src/manifest.rsverifying op-only fragments bypass schema validation and that plain adds are ordered before ops regardless of file sort order.packages/design-data-spec/conformance/manifest-extensions/.design-data-corelib suite (cargo nextest runviamoon run sdk:test) passes.cargo clippy -p design-data-core --lib -- -D warningsshows no new warnings (pre-existinghas_relationship_recorddead-code warning predates this change).Types of changes
Checklist: