@qijenchen/design-system 0.1.0-beta.43 → 0.1.0-beta.45
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/ds-canonical/skills/deep-audit-cross-codex/SKILL.md +6 -22
- package/ds-canonical/skills/deep-audit-cross-codex/references/triage-rubric.md +24 -0
- package/ds-story-manifest.json +1 -1
- package/package.json +1 -1
- package/src/components/Field/field.anatomy.stories.tsx +1 -1
- package/src/components/Sidebar/sidebar.principles.stories.tsx +0 -1
|
@@ -87,6 +87,7 @@ detect_mode() {
|
|
|
87
87
|
**為何不能只靠 deterministic grep**:2026-05-30 嘗試建 `audit-anatomy-prop-existence.mjs`(已刪除不存在)機械驗 prop-existence,但 **prop passthrough(元件 `...props` 轉發 Radix/react-day-picker)使 naive grep 必 over-flag 合法 prop** → 不可靠 → 刪除。**結論:FALSE_CLAIM 驗證本質需 LLM 讀 source 判斷,無法純 grep gate → 故必用「強制 + 報告驗證確認真跑」的機制保證**。
|
|
88
88
|
|
|
89
89
|
**強制流程**(deep-audit 每次必跑,no skip):
|
|
90
|
+
0. **機械 gate 先跑(deterministic,2026-06-02 加)**:`npm run typecheck:stories`(deterministic 抓 stories 的 `{var}`-undefined / prop 型別錯 —— **這是 SizeMatrix `{size}` crash 的真防線**;主 tsc -b exclude stories 故必跑此)+ `node scripts/storybook-smoke-test.mjs --full`(runtime crash render 掃)。先過才進 adversarial read。Anchor:2026-06-02 Field SizeMatrix `{size}` JSX-undefined crash 隨 beta.44 ship。**注**:smoke 全覆蓋 coverage-gate(防靜默-skip 假綠燈)attempted 但 CI server 規模化降級(~60 story 後 timeout 撞 20-min budget)→ **defer**(需 robust-server / browser-recycle + 可靠測試環境);故 typecheck:stories 是目前 deterministic 主防線。
|
|
90
91
|
1. **per-component(NO-SAMPLE,全 62 component + 全 pattern)** dispatch adversarial agent。
|
|
91
92
|
2. 每 agent 必 **Read 元件 .tsx + 其 wrap 的 lib(Radix/cmdk/react-day-picker/sonner 等)source**,對該元件**所有** anatomy / a11y / principles / spec 宣稱**逐句**比對:鍵盤 map / ARIA role / focus 行為 / prop 存在性 / 視覺 token / 預設值 / native-vs-custom。
|
|
92
93
|
3. **「自上次 audit 無 code 改動」≠ 可跳過** —— content 宣稱可在 code 沒變下就是假的(前期正是用此藉口跳過 = 違規)。
|
|
@@ -154,28 +155,7 @@ detect_mode() {
|
|
|
154
155
|
|
|
155
156
|
### B.1 — Brief codex 跑相同 Phase A 完整流程
|
|
156
157
|
|
|
157
|
-
Brief
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
## User 原話(verbatim,prompt 中段引用)
|
|
161
|
-
「<user 原文 quote,中英符號圖文全保>」
|
|
162
|
-
|
|
163
|
-
## Claude Phase A 結果摘要
|
|
164
|
-
- 全 dim audit:<N P0 / M P1 / K P2 findings>
|
|
165
|
-
- SSOT-UI/UX propose:N 項(已 ASK user)
|
|
166
|
-
- Autonomous landed:M 項(列具體 file:line)
|
|
167
|
-
- 不 verify 但 Phase A 結論:<列出>
|
|
168
|
-
|
|
169
|
-
## 請你執行 Phase A 相同流程(獨立)
|
|
170
|
-
1. 全盤閱讀(CLAUDE.md / rules / spec.md ×60 / tokens / patterns / memory)
|
|
171
|
-
2. 全 dim deep audit NO-SAMPLE
|
|
172
|
-
3. 整理完整報告(P0 / P1 / P2 分類 + file:line + 引文 cite)
|
|
173
|
-
4. 跟 Claude Phase A 結果**獨立**比對,不 frame 答案
|
|
174
|
-
|
|
175
|
-
請回:Phase A 你抓但 Claude 漏的 / Claude 抓但你不同意的 / 兩邊都漏的盲區。
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Send via `codex exec`(local CLI per M31 Step 0.4)或 cloud `@codex` 後序。
|
|
158
|
+
Brief 必含 4 段(完整 template SSOT → `references/phase-b-codex-brief.md`,per codex-collab Step 0.05 user-verbatim faithful relay + Step 0.5 own-version invariant):**(1)** user 原話 verbatim(中英符號圖文全保)**(2)** Claude Phase A 結果摘要(P0/P1/P2 count + propose N 項 + landed M 項 file:line)**(3)** 請 codex 獨立跑相同 Phase A(全盤閱讀 + 全 dim NO-SAMPLE + 完整報告 + 不 frame 答案)**(4)** 回「你抓 Claude 漏 / Claude 抓你不同意 / 兩邊都漏」。Send via `codex exec`(local CLI per M31 Step 0.4)或 cloud `@codex`。
|
|
179
159
|
|
|
180
160
|
### B.2 — Receive codex report + Step 4 self-check + Step 4.5 verify
|
|
181
161
|
|
|
@@ -207,6 +187,10 @@ Send via `codex exec`(local CLI per M31 Step 0.4)或 cloud `@codex` 後序。
|
|
|
207
187
|
|
|
208
188
|
## Phase C — Final report + commit + push trigger gate
|
|
209
189
|
|
|
190
|
+
### C.0 — 收斂判準(rerun stop gate,2026-06-01)
|
|
191
|
+
|
|
192
|
+
決定「**再 rerun 嗎**」必過此 gate:deep-audit = LLM 對抗式 non-deterministic + 高假陽性,**追零 = 跑步機 + 誘發 regression**。STOP 判準 = **某輪 adversarial 二次驗證後真 material/regression = 0(只剩 marginal + false-positive)**——不追零、不過早收。收斂靠 CI gate + 寫入時紀律,非 audit loop。三分類表 + 「改一處看 N 處」→ `references/triage-rubric.md`「收斂判準」。
|
|
193
|
+
|
|
210
194
|
### C.1 — Final report(送 user)
|
|
211
195
|
|
|
212
196
|
```
|
|
@@ -81,6 +81,30 @@
|
|
|
81
81
|
|
|
82
82
|
任一軸明顯 degrade → 撤回方案重來,**禁** 「先這樣 / 之後優化」defer keyword(M33 BLOCKER)。
|
|
83
83
|
|
|
84
|
+
## 收斂判準 — 何時停止 rerun(Phase C.0,2026-06-01 codify)
|
|
85
|
+
|
|
86
|
+
**Why**:deep-audit 是 LLM 對抗式稽核 = **non-deterministic + 生成式永遠找得到東西 + 高假陽性**。同一份沒改的 code,每次 rerun 都會吐「新問題」——多數是措辭 nit 或誤判。盲目 **auto-rerun-to-zero = 追不到的跑步機**,且假陽性會誘發你「修」出 regression。但**過早宣稱遞減**也錯(漏掉真 material)。
|
|
87
|
+
|
|
88
|
+
**停止判準**(每跑完一輪 audit,先過此 gate 再決定要不要再跑):
|
|
89
|
+
|
|
90
|
+
> 迭代到某輪「**adversarial 二次驗證後,真 material 或 regression = 0**」(只剩 marginal nit + false-positive)→ **STOP**。既不追零、也不過早收手。
|
|
91
|
+
|
|
92
|
+
**每 finding 必三分類 + adversarial 二次驗證**(filter audit 高估):
|
|
93
|
+
|
|
94
|
+
| 類別 | 定義 | 處置 |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| **material** | 影響使用者 / contract / a11y / 真 regression(spec 改了但 tsx meta / story 漏跟)| 修(non-SSOT → autonomous;SSOT-UI/UX → propose)|
|
|
97
|
+
| **marginal** | 措辭 nit / 缺一欄非必要 doc / 風格偏好 | 記錄,**不修**(低於 materiality threshold)|
|
|
98
|
+
| **false-positive** | 讀 .tsx + wrap lib source 後證實宣稱錯(audit 誤判)| 駁回 + 標 evidence |
|
|
99
|
+
|
|
100
|
+
每個 raw finding 跑 **adversarial 二次驗證**(讀 source 逐句比對,不信第一輪結論)再歸類——audit 第一輪系統性高估(本 session Avatar 硬互斥 / FileViewer listbox / DropdownMenu child-only / Input naked 全 over-flag,二驗後降級)。
|
|
101
|
+
|
|
102
|
+
**「改一處看 N 處」doc-alignment 紀律**:一個 component 有多面向(spec frontmatter / tsx meta / props 表 / Inspector argTypes / ColorMatrix / ModeMatrix / Accessibility prose / principles / showcase / jsDoc)——改一處要**全掃同步**,否則 reruns 一直抓這缺口(本 session 2-4 輪全在清這個)。
|
|
103
|
+
|
|
104
|
+
**實證**(本 session,沒改 code 反覆 rerun):material **7→3→2→2→0**(5 輪)—— 第 1 輪抓我引入的 regression、2-4 輪清 doc 傳播缺口、第 5 輪歸零 STOP。
|
|
105
|
+
|
|
106
|
+
**收斂真正靠**:決定性 CI gate(`tsc` / invariant script / hook BLOCKER)+ **寫入時紀律**,**不是** audit loop。deep-audit 是**週期性工具**(release / SSOT 大改 / 季度),不該對「沒變的內容」反覆跑。對齊 Linux kernel `checkpatch.pl` deterministic pre-submit / Toyota TPS Jidoka(機器發現異常自停,非人工反覆巡)。
|
|
107
|
+
|
|
84
108
|
## 共識決策(Phase B.5)同 format
|
|
85
109
|
|
|
86
110
|
Phase B 共識(Claude + Codex 雙 verify PASS)走相同 propose / autonomous 分流:
|
package/ds-story-manifest.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"scripts/composition-fidelity-visual-diff.mjs",
|
|
8
8
|
"product-workspace apps/template/src/AllDsComponents.stories.tsx (DsCanonicalPortal)"
|
|
9
9
|
],
|
|
10
|
-
"generatedAt": "2026-06-
|
|
10
|
+
"generatedAt": "2026-06-02T08:11:50.389Z"
|
|
11
11
|
},
|
|
12
12
|
"components": {
|
|
13
13
|
"accordion": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qijenchen/design-system",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.45",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "World-class design system — components, patterns, tokens, hooks (single source of truth for team distribution).",
|
|
6
6
|
"type": "module",
|
|
@@ -262,7 +262,7 @@ export const SizeMatrix: Story = {
|
|
|
262
262
|
<div className="flex flex-col gap-10">
|
|
263
263
|
<div>
|
|
264
264
|
<H3>三種 Size — 對齊 field-height 系統</H3>
|
|
265
|
-
<Desc>Field 的 size 透過 context 傳遞給 input-class control(Input / NumberInput / Select),控制其內部高度對齊 `--field-height-*` tier(見 uiSize.spec.md)。Slider / Switch / Checkbox 等 primitive 維持原生尺寸不讀 context size(見 field.spec.md「為什麼 primitive 不自己變高」),其行高節奏改由 Field control-area 的 min-h-field-{size} 提供——同一 Field 內所有 control 因此自動對齊高度。</Desc>
|
|
265
|
+
<Desc>Field 的 size 透過 context 傳遞給 input-class control(Input / NumberInput / Select),控制其內部高度對齊 `--field-height-*` tier(見 uiSize.spec.md)。Slider / Switch / Checkbox 等 primitive 維持原生尺寸不讀 context size(見 field.spec.md「為什麼 primitive 不自己變高」),其行高節奏改由 Field control-area 的 min-h-field-{'{size}'} 提供——同一 Field 內所有 control 因此自動對齊高度。</Desc>
|
|
266
266
|
<div className="grid grid-cols-3 gap-6">
|
|
267
267
|
{(['sm', 'md', 'lg'] as const).map(size => (
|
|
268
268
|
<div key={size} className="border border-dashed border-divider rounded-md p-4">
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
SidebarMenuButton,
|
|
23
23
|
} from './sidebar'
|
|
24
24
|
import { TreeView, TreeItem } from '@/design-system/components/TreeView/tree-view'
|
|
25
|
-
import { ItemAvatar } from '@/design-system/patterns/element-anatomy/item-anatomy'
|
|
26
25
|
import { Avatar } from '@/design-system/components/Avatar/avatar'
|
|
27
26
|
|
|
28
27
|
const meta: Meta = {
|