Skip to content

Commit 96ad2f7

Browse files
mpstatonclaude
andcommitted
fix(design-drift): the member parser ate the comma, so every per-file check was blind
`pnpm design:drift` reported 18 fail on the merged tree. The real number is 98. The difference was not progress — it was the checker failing to look. parseMemberList matched each frontmatter field with `(\S+)`, which is greedy across the comma separating them. `path: shell, prefix: …` therefore yielded the path "shell,", and resolve(REPO_ROOT, "shell,", "src") does not exist. So findMemberFiles returned an empty array for all nineteen members, and every check that walks member files — F8 hardcoded hex and box-shadow, F4 raw z-index, F1a Tier-1 consumption, leaked selectors — found nothing to inspect and passed. The failure was well disguised. The one check that still fired was F6, whose own path resolution broke the same way, so it failed for every member — and "no DESIGN.md at member root" reads as Phase 8 work not yet done, not as an instrument that cannot see the tree. A near-clean report with a plausible explanation for its only failures. This is the exact failure mode the Phase 1 handoff warned about in its own notes: a checker reporting success because it failed to look. It warned about two instances (an argv off-by-one and a CRLF read) and this is a third. Each field now stops at the comma, and root_class is stripped of the quotes it carries. With the parser fixed: 98 fail · 0 warn — 59 F8, 21 F4, 17 F6, 1 P2. Not reconciled: the Phase 1 handoff reports 480 fail · 212 warn and 108/108 contrast pairs, against 98 · 0 and 30/30 here. The parser fix accounts for the 18 → 98 jump but not the rest, and the contrast pair count is a separate question. Flagged on the PR rather than guessed at — those figures were measured on another machine and their author should confirm what they counted. Files changed: - scripts/design-drift.mjs Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019a8tSPbFdvF1pKtADnWyDg
1 parent 4285ec2 commit 96ad2f7

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

scripts/design-drift.mjs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,27 @@ function parseMemberList(fm) {
9191
const members = [];
9292
for (const entry of list) {
9393
if (typeof entry === 'string') {
94-
const parts = entry.match(/name:\s*(\S+).*?path:\s*(\S+).*?prefix:\s*(\S+).*?root_class:\s*(\S+)/);
94+
// `(\S+)` was greedy across the comma that separates frontmatter fields,
95+
// so `path: shell, prefix: …` yielded the path "shell," — and
96+
// resolve(REPO_ROOT, "shell,", "src") does not exist. findMemberFiles()
97+
// then returned [] for EVERY member, so every per-file check (F4 z-index,
98+
// F8 hardcoded hex / box-shadow, F1a Tier-1 consumption, leaked
99+
// selectors) silently found nothing and the run reported near-clean.
100+
// The only surviving symptom was F6 failing for all 19 members, which
101+
// reads as "per-member DESIGN.md files are Phase 8 work" rather than
102+
// "the checker cannot see the tree".
103+
//
104+
// This is the same failure this script's own notes warn about: a checker
105+
// reporting success because it failed to look. Stop each field at the
106+
// comma, and strip the quotes root_class carries.
107+
const parts = entry.match(/name:\s*([^,\s]+).*?path:\s*([^,\s]+).*?prefix:\s*([^,\s]+).*?root_class:\s*([^,\s]+)/);
95108
if (parts) {
96-
members.push({ name: parts[1], path: parts[2], prefix: parts[3], rootClass: parts[4] });
109+
members.push({
110+
name: parts[1],
111+
path: parts[2],
112+
prefix: parts[3],
113+
rootClass: parts[4].replace(/^["']|["']$/g, ''),
114+
});
97115
}
98116
}
99117
}

0 commit comments

Comments
 (0)