@tekyzinc/gsd-t 2.70.11 → 2.70.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [2.70.12] - 2026-04-06
6
+
7
+ ### Added (design pipeline — element count reconciliation)
8
+ - **Element Count Reconciliation** — new mandatory verification step that runs BEFORE any property or visual comparison. Counts widgets and elements from the Figma decomposition (stored in INDEX.md), counts the built page's widgets and elements via Playwright, and compares. Any mismatch (missing or extra widgets/elements) is a CRITICAL deviation. Added to: `gsd-t-execute` (Step 0 inside Design Verification Agent), `gsd-t-quick` (Step 0), `gsd-t-design-audit` (Step 1.5).
9
+ - **Figma Element Counts table in INDEX.md** — `gsd-t-design-decompose` now writes element/widget/page counts and a per-page element manifest to INDEX.md as the verification anchor. The verification agent reads these counts as ground truth.
10
+ - **5-layer verification model** — design-to-code.md now documents Targets 0-4 in execution order: count reconciliation → contract comparison → Figma comparison → SVG overlay → DOM box model inspection.
11
+
12
+ ### Why
13
+ A missing widget is the most catastrophic deviation but the easiest to miss in a 30+ row comparison table. The agent compares what exists but doesn't notice what's absent. An explicit count gate catches "Figma has 10 widgets, built page has 9 — WHERE IS THE 10TH?" before any property-level work begins.
14
+
5
15
  ## [2.70.11] - 2026-04-06
6
16
 
7
17
  ### Added (design pipeline — DOM box model inspection + layout arithmetic)
@@ -62,6 +62,35 @@ Widget: "Member Segmentation: State"
62
62
  CLASSIFICATION: chart-bar-stacked-vertical (two instances side-by-side)
63
63
  ```
64
64
 
65
+ ## Step 1.5: Element Count Reconciliation (MANDATORY)
66
+
67
+ Before any property comparison, verify the built page has the correct number of elements:
68
+
69
+ 1. **Count from Figma** (from Step 1):
70
+ - Total widgets/cards identified
71
+ - Total elements within widgets (charts, legends, stat cards, controls, tables)
72
+ - Record: `Figma: {N} widgets, {M} total elements`
73
+
74
+ 2. **Count from built page** (open in browser via Playwright):
75
+ - Count top-level visual groups (cards/widgets)
76
+ - Count elements within each group
77
+ - Record: `Built: {N} widgets, {M} total elements`
78
+
79
+ 3. **Compare**:
80
+ - Widget count match? If NO → ❌ CRITICAL: identify MISSING or EXTRA widgets by name
81
+ - Element count match per widget? If NO → ❌ CRITICAL: identify MISSING or EXTRA elements
82
+
83
+ ```markdown
84
+ ### Element Count Reconciliation
85
+
86
+ | Level | Figma | Built | Verdict |
87
+ |--------------------|-------|-------|---------|
88
+ | Widgets (page) | 10 | 9 | ❌ MISSING: video-playlist-widget |
89
+ | Elements (total) | 27 | 24 | ❌ MISSING: 3 elements in video-playlist-widget |
90
+ ```
91
+
92
+ A missing widget is the most catastrophic deviation — it means an entire section of the design was silently dropped. Catch it here before spending effort on property-level comparison of widgets that DO exist.
93
+
65
94
  ## Step 2: Capture the Built Screen
66
95
 
67
96
  Open the built app at the target URL/route. For each widget identified in Step 1:
@@ -280,6 +280,25 @@ Write `INDEX.md` as a navigation map:
280
280
  element contract > widget contract > page contract
281
281
 
282
282
  Widgets and pages reference elements by name. They CANNOT override element visual spec. To customize, create a new element variant.
283
+
284
+ ## Figma Element Counts (MANDATORY — verification anchor)
285
+
286
+ These counts are captured from the Figma decomposition and serve as the
287
+ ground truth during verification. Any mismatch between these counts and
288
+ the built output is a CRITICAL deviation.
289
+
290
+ | Level | Count | Source |
291
+ |----------|-------|---------------------------------|
292
+ | Elements | {N} | Inventory table (Step 1d) |
293
+ | Widgets | {N} | Widget inventory (Step 3) |
294
+ | Pages | {N} | Page inventory (Step 4) |
295
+ | Total | {N} | Sum of all contracts |
296
+
297
+ Per-page element manifest (for verification agent):
298
+ | Page | Widgets | Elements (including widget-internal) |
299
+ |--------------------|---------|--------------------------------------|
300
+ | {dashboard} | {N} | {N} — {list: stat-card ×4, chart-donut ×1, ...} |
301
+ | {analytics} | {N} | {N} — {list} |
283
302
  ```
284
303
 
285
304
  ## Step 6.5: Contract-vs-Figma Verification Gate (MANDATORY)
@@ -632,7 +632,28 @@ each one matches — not assume it does. 'Looks close' is not a verdict.
632
632
  'Appears to match' is not a verdict. The only valid verdicts are MATCH
633
633
  (with proof) or DEVIATION (with specifics).
634
634
 
635
- ## Step 0: Data-Labels Cross-Check (MANDATORY — run FIRST)
635
+ ## Step 0: Element Count Reconciliation (MANDATORY — run BEFORE anything else)
636
+
637
+ Before any visual or property comparison, verify the built page has the
638
+ correct NUMBER of elements. A missing widget is the easiest deviation to
639
+ miss in a 30+ row comparison table — and the most catastrophic.
640
+
641
+ 1. Read INDEX.md (hierarchical) or design-contract.md (flat) to get the
642
+ Figma element counts:
643
+ - Per-page: how many widgets on this page? How many total elements
644
+ (including widget-internal charts, legends, cards, controls)?
645
+ 2. Count the built page's distinct visual elements via Playwright:
646
+ - Widgets/cards (top-level visual groups)
647
+ - Charts, tables, stat cards, legends, controls within each widget
648
+ 3. Compare:
649
+ - Figma widget count vs built widget count → mismatch = ❌ CRITICAL
650
+ - Figma element count vs built element count → mismatch = ❌ CRITICAL
651
+ 4. If counts match → proceed to Step 0.5
652
+ If counts DON'T match → identify WHICH elements are missing or extra:
653
+ 'Figma has {N} widgets, built page has {M}. MISSING: {list}. EXTRA: {list}'
654
+ Log as CRITICAL deviation — do NOT skip, continue with remaining steps.
655
+
656
+ ## Step 0.5: Data-Labels Cross-Check (MANDATORY)
636
657
 
637
658
  Before any visual comparison, verify the built UI is rendering the CORRECT
638
659
  DATA from the design. This is the most common failure mode: agents use
@@ -259,7 +259,12 @@ comparison table. You write ZERO feature code.
259
259
 
260
260
  FAIL-BY-DEFAULT: Every visual element starts as UNVERIFIED. Prove each matches.
261
261
 
262
- STEP 0 (MANDATORY FIRST): Data-labels cross-check.
262
+ STEP 0 (MANDATORY FIRST): Element count reconciliation.
263
+ Read INDEX.md or design-contract.md for Figma element counts (widgets per page,
264
+ total elements per page). Count the built page's widgets and elements via Playwright.
265
+ If counts don't match → CRITICAL DEVIATION: identify which are MISSING or EXTRA.
266
+
267
+ STEP 0.5: Data-labels cross-check.
263
268
  For each element contract (or design-contract.md section), read the Test Fixture.
264
269
  Verify EVERY label, value, percentage from the fixture appears verbatim in the
265
270
  rendered UI. If any is missing → CRITICAL DEVIATION (wrong data). Wrong data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.70.11",
3
+ "version": "2.70.12",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 54 slash commands with headless CI/CD mode, graph-powered code analysis, real-time agent dashboard, execution intelligence, task telemetry, doc-ripple enforcement, backlog management, impact analysis, test sync, milestone archival, and PRD generation",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",
@@ -560,7 +560,12 @@ MANDATORY:
560
560
  The verification agent compares the built frontend against **TWO sources** — not just one:
561
561
 
562
562
  ```
563
- VERIFICATION TARGETS:
563
+ VERIFICATION TARGETS (run in this order):
564
+ ├── TARGET 0: ELEMENT COUNT RECONCILIATION (run FIRST)
565
+ │ Does the built page have the same NUMBER of widgets and elements
566
+ │ as the Figma design? A missing widget is the most catastrophic
567
+ │ deviation — catch it before spending effort on property comparison.
568
+
564
569
  ├── TARGET 1: Built screen vs DESIGN CONTRACTS
565
570
  │ Does the code match the contract's claimed values?
566
571
  │ (This is what the 13-task validation proved works — airtight.)
@@ -570,15 +575,19 @@ VERIFICATION TARGETS:
570
575
  │ This catches: contracts that were wrong to begin with,
571
576
  │ chart type misclassification, hallucinated data, missing elements.
572
577
 
573
- └── TARGET 3: SVG STRUCTURAL OVERLAY (MANDATORY)
574
- Export Figma frame as SVG → parse element positions/dimensions/colors
575
- → compare geometrically against built DOM bounding boxes.
576
- This catches: aggregate spacing drift, alignment issues, proportion
577
- errors that pass property-level checks but look wrong visually.
578
- Mechanical, non-interpretive — no agent reasoning, just geometry.
578
+ ├── TARGET 3: SVG STRUCTURAL OVERLAY (MANDATORY)
579
+ Export Figma frame as SVG → parse element positions/dimensions/colors
580
+ → compare geometrically against built DOM bounding boxes.
581
+ This catches: aggregate spacing drift, alignment issues, proportion
582
+ errors that pass property-level checks but look wrong visually.
583
+
584
+ └── TARGET 4: DOM BOX MODEL INSPECTION (fixed-height containers)
585
+ Evaluate offsetHeight vs scrollHeight per child element.
586
+ This catches: inflated flex boxes, wrong space distribution,
587
+ elements growing beyond their content size.
579
588
  ```
580
589
 
581
- **Targets 2 and 3 are complementary.** Target 2 catches wrong values (property-level). Target 3 catches wrong placement (geometry-level). Together they cover both "is each value correct?" and "does the whole page look right?"
590
+ **Each target catches a different failure class.** Target 0: missing elements. Target 1: wrong values. Target 2: wrong contracts. Target 3: wrong placement. Target 4: wrong space distribution. All five are needed no single layer catches everything.
582
591
 
583
592
  ### Verification agent workflow
584
593
 
@@ -652,6 +661,8 @@ Before marking any design implementation task as complete:
652
661
  - [ ] Design system / component library identified (or confirmed none) and documented in design contract
653
662
  - [ ] Library components mapped to design elements — custom build only where no library match exists
654
663
  - [ ] Design source identified and documented in design contract
664
+ - [ ] Element counts recorded in INDEX.md (widgets per page, elements per page)
665
+ - [ ] Built page element count matches Figma element count (no missing/extra widgets)
655
666
  - [ ] Stack capability evaluated — all design requirements achievable (or alternatives approved)
656
667
  - [ ] All design tokens extracted (colors, typography, spacing, borders, shadows)
657
668
  - [ ] Tokens written to `.gsd-t/contracts/design-contract.md`