Repository navigation
feat(figma): guard exports and verify write readback - #1530
Merged
Merged
Conversation
Add exact raw-state concurrency checks and temp-ID-aware readback verification. Provide explicit bypasses, numeric tolerance and credential-safe ambiguous-write handling. Never retry mutations; preserve raw numbers without changing SDK cache serialization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 642864f 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
🧩 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. 🤖 |
Contributor
Run report for 642864ffTotal time: 2m 4s | Comparison time: 3m 46s | Estimated savings: 1m 42s (45.3% faster)
Changed files |
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
Add concurrency guards and readback verification to
design-data figma export.variableIdsordering is normalized; mode order and all other metadata remain significant.1e-6), fresh-directory verification reports and a hidden loopback-only API override for offline tests.@adobe/design-data-tui, which distributes the CLI.Related Issue
Bead
spectrum-design-data-11k.25: Add concurrency guards and readback verification to Figma CLI writes.Parent epic:
spectrum-design-data-11k.Motivation and Context
The previous export path fetched variables, built a payload, posted it and printed
Donewithout checking concurrent edits or verifying the resulting file. This promotes the safeguards proven in the earlier publication scripts into the normal CLI path.Typed snapshots omit API metadata such as collection
isExtensionand can round JSON floats. The guard therefore retains original number text locally withRawValue, while parsing typed mapping data from the same response bytes. A workspace-widearbitrary_precisionfeature was rejected because it changed native MessagePack cache serialization and caused WASM parity failures; the final implementation preserves that compatibility.The final GET and POST are not atomic, so a residual concurrency window remains and is documented. Collection/mode mutations are rejected rather than left unverified. Explicitly skipping readback produces an unverified write warning, not verified-success output.
How Has This Been Tested?
Validated locally on macOS using the repository's pinned Rust toolchain and pnpm 10.17.1:
moon run :test sdk:lint sdk:fmt-check sdk:test-doc— passed; 35 tasks completed, including 1,543 passing Rust tests with 2 existing skips and the WASM parity suite.node tools/changeset-linter/src/cli.js check --fail-on-warnings— passed, no warnings or errors.git diff --cached --check— passed before committing.Offline tests cover concurrent metadata/mode-order drift blocking POST, membership-only reordering, CREATE/UPDATE and temporary-ID remapping, aliases, preserved unrelated/deprecated state, numeric tolerance thresholds, readback mismatches and missing targets/mappings, ambiguous outcomes with exactly one POST, explicit bypass warnings, dry-run behavior, report reuse rejection and credential-safe diagnostics.
All Figma HTTP tests use a local loopback server. No shared Figma file was mutated, and no separate Figma library Publish was performed. Live writes still require separate explicit approval.
Screenshots (if appropriate):
Not applicable; CLI safety checks and offline HTTP behavior.
Types of changes
Checklist: