feat(#2845): require provenance for UI-SPEC component inventories (#3745)

* test(#2845): failing-first suite for UI-SPEC inventory provenance

Binds two shared formats before either exists, so the suite is RED against
next: the gsd-ui-checker dimension roster (asserted independently on twelve
surfaces, eight English and four translated) and the provenance-line grammar
the UI-SPEC template emits and Dimension 7 consumes.

Every parity assertion is paired with a synthetic mutation case, so the guard's
failure branch executes rather than only reading a correct tree: limit-1 (a
surface still declaring 6), limit (7), limit+1 (8), a dropped dimension, a
label that drifts on one surface only, a non-contiguous roster, a duplicated
number, and a surface that stops declaring a count at all. A seeded fast-check
property renders the roster under formatting noise (CRLF, padding, interleaved
sections) and asserts the parse round-trips and is strictly sensitive to a
dropped heading.

Assertions are on parsed typed records, never raw substrings.

* docs: normalize design-a-ui-phase how-to to American English

House style for docs/ is American English (CLAUDE.md). This file carried
colour/initialisation/initialise/artefact throughout. Spelling only — no
content change; kept separate from the #2845 feature commit so the
release-notes classifier and the hotfix cherry-pick filter see it for what
it is.

* feat(#2845): require provenance for UI-SPEC component inventories

A UI-SPEC's component inventory was treated downstream as a closed allowlist
while the document recorded nothing about whether the list had been enumerated
from the installed design system or recalled from memory. A recalled inventory
is indistinguishable from an enumerated one, so an executor complying with the
spec builds against a fraction of what the package offers, and every gate stays
green because they assert semantics rather than composition.

The UI-SPEC template gains a Component Inventory slot carrying one of two
provenance lines: the command that enumerated the list, the count it returned,
the resolved package@version and the date; or a Could not enumerate record with
a real reason. gsd-ui-researcher gains an enumeration ladder and must record
the line rather than write the list from recall.

gsd-ui-checker gains Dimension 7. An inventory with no provenance line, a count
with no command, an empty could-not-enumerate reason, or a line still carrying
the template's unfilled placeholders BLOCKs; a partial line, a line placed below
its table, or an honest negative record FLAGs; a complete line passes, and so
does a spec carrying no inventory at all, which keeps every UI-SPEC predating
the dimension validating unchanged. Whatever the verdict, an unsourced inventory
is reported as a non-exhaustive list of known-good components rather than a
closed allowlist, so the executor is never blocked from a component the spec
merely failed to mention. The checker never runs the recorded command.

The dimension count moved on all thirteen surfaces that assert it, across five
languages. Also corrects the claim in the English, Korean and Portuguese how-tos
that this checker applies a scored six-pillar rubric — that rubric belongs to
/gsd-ui-review's retroactive audit.

* chore(#2845): backfill changeset pr number to 3745

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-08-21 11:59:56 -04:00
committed by GitHub
parent 2b42b28687
commit 4918c62d76
18 changed files with 902 additions and 37 deletions

View File

@@ -253,20 +253,21 @@
**需求:**
- REQ-UI-01:系统必须检测现有设计系统状态(shadcn components.json、Tailwind 配置、令牌)
- REQ-UI-02:系统必须只提问尚未回答的设计契约问题
- REQ-UI-03:系统必须从 6 个维度进行验证(文案、视觉、颜色、排版、间距、注册表安全)
- REQ-UI-03:系统必须从 7 个维度进行验证(文案、视觉、颜色、排版、间距、注册表安全、清单来源)
- REQ-UI-04:当验证返回 BLOCKED 时,系统必须进入修订循环(最多 2 次迭代)
- REQ-UI-05:对于没有 `components.json` 的 React/Next.js/Vite 项目,系统必须提供 shadcn 初始化
- REQ-UI-06:系统必须对第三方 shadcn 注册表实施注册表安全门控
**产出物:** `{padded_phase}-UI-SPEC.md` — 执行者使用的设计契约
**6 个验证维度:**
**7 个验证维度:**
1. **文案** — CTA 标签、空状态、错误消息
2. **视觉** — 焦点、视觉层次、图标无障碍
3. **颜色** — 强调色使用规范、60/30/10 合规性
4. **排版** — 字体大小/粗细约束遵守情况
5. **间距** — 网格对齐、令牌一致性
6. **注册表安全** — 第三方组件检查要求
7. **清单来源** — 组件清单必须从已安装的设计系统中枚举得出,而非凭记忆写出
**shadcn 集成:**
- 检测 React/Next.js/Vite 项目中缺失的 `components.json`

View File

@@ -35,7 +35,7 @@
该命令分两个阶段运行:
1. **`gsd-ui-researcher`** — 读取 `CONTEXT.md`、`RESEARCH.md` 和 `REQUIREMENTS.md` 中的已有决策,检测设计系统状态(shadcn `components.json`、Tailwind 配置、现有 token),并仅针对以下五个领域中尚未回答的设计问题进行提问:间距、颜色、字体、文案和注册表安全。
2. **`gsd-ui-checker`** — 从六个维度验证生成的 `UI-SPEC.md`。如果发现问题,修订循环会重新运行研究员(最多两次迭代),专门针对被标记的项目。
2. **`gsd-ui-checker`** — 从七个维度验证生成的 `UI-SPEC.md`。如果发现问题,修订循环会重新运行研究员(最多两次迭代),专门针对被标记的项目。
**输出:** `.planning/phases/{phase-dir}/` 中的 `{padded_phase}-UI-SPEC.md`。