Skip to content

Verify Figma states and requirements before claiming completion - #133

Merged
owjs3901 merged 1 commit into
mainfrom
devfive/3099154426bffbeef8b62999b80bb038/state-requirement-verify
Nov 28, 2026
Merged

owjs3901 merged 1 commit into
mainfrom
devfive/3099154426bffbeef8b62999b80bb038/state-requirement-verify

Conversation

@devfive-relay-c70423

@devfive-relay-c70423 devfive-relay-c70423 Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

devup_feature_trace gains four optional, backward-compatible inputs (stateChecks, requirements, designGaps, changes). When any of them is supplied, the response carries a verification matrix. Calls without these inputs are unchanged apart from verification: null. The logic lives in the new crates/devup-mcp/src/server/verification_matrix* and reuses the existing visual compare, UI inventory, cached Figma snapshot and component-set variant data.

1. Per-state verification

  • stateChecks are grouped by target and route (verification.stateGroups). States are normalized: pressed→active, focus-visible→focus, checked→selected.
  • Figma size, position, colour, border and typography are read from the artifactId snapshot, or from explicit design values. They are compared with implementation values: 0.5px default tolerance, RGBA channel delta ≤1, first font family.
  • visual takes the exact devup_visual_compare input and runs through visual_compare::compare unchanged.
  • The component set's variants (e.g. State=Hover) become expectedStates. A variant with no check becomes an unverified row.
  • Missing design, missing capture, unmeasured properties, an inconclusive pixel comparison and static-only values are all unverified, never a pass. capture.needed is set only for failures that have no pixel comparison.

2. Requirements ↔ screens/components/states

  • requirements (design spec cards or user requirements) carry targets and a check kind.
  • Each verdict is verified, unverified or not-applicable, with an outcome, a reason and the evidence.
  • Interaction and visual requirements need browser, automated-test or manual evidence. With only static passes they become browser-verification-required.
  • scope lists screens (component targets expand through static importers), sharedComponents and multiScreen. Every screen in scope needs its own evidence, otherwise the outcome is scope-not-covered.

3. Incomplete Figma data

  • designData.gaps merges the gaps found:
    • caller designGaps;
    • export failures;
    • error or lossy snapshot diagnostics;
    • failed asset exports;
    • unreadable fields;
    • children that are referenced but not collected;
    • an unreadable artifact.
  • Each gap carries its kind and cause. cannotJudge names the blocked screens, states and requirements.
  • claims.designMatch and claims.verificationComplete are blocked while anything is open. summary.required repeats this as "Do not claim a design match or a finished verification: …".

4. Reuse and change impact

  • Existing reuseCandidates are kept.
  • New changeImpact labels each component shared, screen-only, unreferenced or unknown, with affectedScreens.
  • New configScope separates shared files (devup.json, root layout, globals, screen-plan config) from screen-only ones.
  • resultsBySource counts static and observed results separately.

5. User review report

reviewReport.changes lists, for each change:

  • the path, steps and expected result (derived from the linked states and requirements when not given);
  • results split into automated, browser, manual and static;
  • captures only for failed visual comparisons that wrote a diff.

6. Unfinished verification

  • followUp follows the 5-step order: fixInScope (with the next action), askUser (cause / recommendation / verifies / userAction, plus the fields still missing), continueWhileWaiting, and unresolved (attempts and remaining constraint).
  • The same rules are documented in devup://guide/usage §17 and the devup-implementation-plan skill (manifest hash updated).
  • The server instructions are at 1,495 of their 1,500-character cap, so they were not extended.

Compatibility

Tests

  • 14 new unit tests in verification_matrix_tests.rs.
  • 4 new integration tests in feature_trace_tests.rs: anchor acceptance, untargeted refusal, unchanged legacy output, missing artifact as a gap, unknown-field rejection.
  • cargo fmt --all --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test --workspace: passed. The lib suite (943 tests) was re-run on the final commit.

Changepack: Minor.

🤖 Generated with Claude Code

devup_feature_trace gains optional stateChecks, requirements, designGaps
and changes inputs that return a verification matrix:

- per-state groups (default/hover/active/focus/selected/disabled) comparing
  Figma size, position, colour, border and typography with implementation
  values, optional pixel checks through devup_visual_compare, and expected
  component-set variant states; missing design, missing capture and
  static-only states stay unverified
- requirement verdicts (verified/unverified/not-applicable) with evidence,
  screen/component/state scope and browser-verification-required for
  interaction or visual requirements proven only statically
- Figma data gaps (missing nodes/properties, failed reads/exports) with the
  screens, states and requirements they block; claims gate design-match
  and completion
- change impact for shared components, shared vs screen-only config scope,
  static vs observed result counts
- a review report per change and an ordered followUp for unfinished
  verification, documented in the guide (section 17) and the
  devup-implementation-plan skill

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@owjs3901
owjs3901 marked this pull request as ready for review November 28, 2026 17:38
@owjs3901
owjs3901 merged commit e0b2b81 into main Nov 28, 2026
9 checks passed
@owjs3901
owjs3901 deleted the devfive/3099154426bffbeef8b62999b80bb038/state-requirement-verify branch November 28, 2026 17:38
devfive-relay-c70423 Bot pushed a commit that referenced this pull request Nov 28, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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