feat(design-gate): semantic contract 可執行化 — 143 條 DOM 案例 + pipeline.default 改掛 #pipeline - #349
Conversation
…efault 改掛 #pipeline - manifest:semantic_contract.status=executable、implemented_case_ids=11 全集; pipeline.default production_routes→[#pipeline](#conv 讓給 #345 轉檔歷史頁的 functional gate,雙路由分治解兩閘互斥);route_inventory 24 條、 reference_missing 11 條(+#conv) - design-system-semantic-cases.ts:13 screens × 11 required cases = 143 條 可執行 DOM 案例(family factory;prepare 自行導航;離線 503 決定性) - verify-design-system-reference.ps1:$expectedRoutes 23→24(+#pipeline) - 本樹自測:verify-design-system-reference / test-design-system-reference / test-design-system-change-scope 全 passed - 產品側(UnifiedConsole 13 screens 像素移植)隨後續 PR 上;本 PR 為 reference_authority+gate_infrastructure,依 fail-closed 憲法與產品碼分離 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR implements semantic E2E case definitions for 13 screens, marks the semantic contract executable, updates ChangesExecutable semantic contract
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR operationalizes the design gate's semantic contract and re-routes the pipeline.default screen, as a gate-infrastructure-only change (no product code touched). Previously semanticCaseDefinitions was an empty map and the contract status was state_variants_reference_missing; this PR ships 143 executable DOM cases and flips the contract to executable, while moving the pipeline.default reference from #conv to a new unified #pipeline route so #conv is freed for #345's functional gate. The registry is forward-looking: it targets data-uc/data-prov selectors that arrive in the follow-up product PR, so the semantic gate is fail-closed until that product PR lands (acknowledged in the description).
I verified internal consistency: the manifest now has 24 route_inventory entries (13 approved + 11 reference_missing), #conv no longer appears in any screen's production_routes, routes_without_approved_pixel_reference matches the reference_missing set, the verify-design-system-reference.ps1 $expectedRoutes array (24) and its assertion message (22 canonical + #review + #pipeline) line up, and the manifest's 13 screens exactly match the 13 registry screen families (13 × 11 = 143 unique keys). The design-semantic-visual job remains required_check_not_configured and is gate-infrastructure-only on this PR, so the not-yet-existing #pipeline route/selectors do not break a required check here.
Changes:
- Replace the empty
semanticCaseDefinitionsmap with 13 screen-family factories producing 143 executable DOM cases (self-navigatingprepare+locator/expectation assertions), including honestcount_equals: 0mappings where a state surface is intentionally absent. - Manifest:
semantic_contract.status→executable,implemented_case_ids→ full 11-case set,pipeline.default.production_routes→["#pipeline"],#convdemoted toreference_missing. verify-design-system-reference.ps1: add#pipelineto$expectedRoutes(23 → 24) and update assertion messages.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| web-viewer-sample/e2e/design-system-semantic-cases.ts | Adds 143 executable semantic DOM cases via per-screen family factories; consumed by design-system-visual.spec.ts. |
| docs/plans/design-system-reference.manifest.json | Flips contract to executable, fills implemented_case_ids, remaps pipeline.default to #pipeline, moves #conv to reference_missing. |
| scripts/tests/verify-design-system-reference.ps1 | Extends $expectedRoutes with #pipeline and updates the route-coverage assertion messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 822aa5ac92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "id": "pipeline.default", | ||
| "production_routes": [ | ||
| "#conv" | ||
| "#pipeline" |
There was a problem hiding this comment.
Keep approved routes backed by the console router
When the design-semantic-visual workflow runs for any frontend product change, design-system-visual.spec.ts iterates these manifest screens and navigates to screen.production_routes[0] before running the semantic cases and pixel comparison. This new approved route sends pipeline.default to /#pipeline, but the current console router has no pipeline case (repo-wide search only finds this manifest/test usage; EdgeConsole.tsx still has conv and minio and falls back to Home for unknown hashes). As a result, the pipeline screen assertions/baselines run against the Home page and the required design gate fails until a product route is added; keep the approved route on an existing route or land the router change with the manifest update.
Useful? React with 👍 / 👎.
| prepare: gotoRoute, | ||
| assertions: [ | ||
| { id: "failed-service-dots-count", locator: '[data-uc="svc-dot"][data-ok="false"]', expectation: "count_equals", expected: 0 }, |
There was a problem hiding this comment.
Require real failure states before marking semantic pass
For runtime.ops.default:failure, this case passes when there are zero failed service dots, so the Playwright result records the required failure semantic state as successful even though no failure UI is present. Because the visual-result validator only checks that each semantic state is true, product changes can get 100% semantic parity while never rendering the required failure surface for this screen; use a fixture/interaction that produces an actual visible failure state, or leave the contract non-executable for this state.
Useful? React with 👍 / 👎.
| "semantic_contract": { | ||
| "schema_version": 2, | ||
| "status": "state_variants_reference_missing", | ||
| "status": "executable", |
There was a problem hiding this comment.
Land executable semantics with the matching DOM hooks
This flips the contract to executable, but the current app does not render the data-uc/data-prov hooks that the new Playwright cases require; a repo-wide search finds those hooks only in this new spec, not under web-viewer-sample/src. Consequently the next frontend product change will run design-semantic-visual and fail even on existing approved routes like #home before pixel comparison. Keep the contract non-executable until the product instrumentation lands, or include the matching DOM hooks in the same change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/design-system-reference.manifest.json`:
- Around line 437-438: Update the manifest’s pipeline entry to reference an
existing supported route instead of the unhandled `#pipeline` alias, or remove it
until a real pipeline route is implemented. Ensure both the pipeline navigation
entry and its default target remain consistent with routes handled by
routing.ts, EdgeConsole.renderBody(), and App.tsx.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9021ffa6-c250-4058-99e6-712c3fdcb90a
📒 Files selected for processing (3)
docs/plans/design-system-reference.manifest.jsonscripts/tests/verify-design-system-reference.ps1web-viewer-sample/e2e/design-system-semantic-cases.ts
| "#pipeline" | ||
| ], |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
fd . web-viewer-sample --type f -e ts -e tsx -e js -e jsx | xargs rg -n '`#pipeline`|`#conv`'Repository: monkey1sai/AI-BIM-governance
Length of output: 7099
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the manifest around the referenced lines.
sed -n '430,445p;646,660p;670,715p' docs/plans/design-system-reference.manifest.json
echo '---'
# Search for actual route wiring / handling for `#pipeline` in the app source.
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '`#pipeline`|pipeline\.default|productionRoute|route_inventory|gotoRoute|page\.goto\(`/#pipeline|page\.goto\("\/#pipeline' web-viewer-sample/src web-viewer-sample/e2e docs/plans
echo '---'
# Identify files that define hash-based route handling.
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' 'window\.location\.hash|location\.hash|hashchange|`#conv`|`#pipeline`|`#minio`|`#intake`|`#runtime`' web-viewer-sample/srcRepository: monkey1sai/AI-BIM-governance
Length of output: 2146
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find concrete hash-route handling for pipeline in the runtime source.
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
'`#pipeline`|route["'\'' ]*: "?`#pipeline`|route:\s*"?`#pipeline`|hash.*pipeline|pipeline\.default|productionRoute|gotoRoute|hashchange|window\.location\.hash|location\.hash' \
web-viewer-sample/src web-viewer-sample/e2e
echo '---'
# Inspect the semantic cases file mentioned by the initial search.
sed -n '330,370p' web-viewer-sample/e2e/design-system-semantic-cases.tsRepository: monkey1sai/AI-BIM-governance
Length of output: 25015
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline web-viewer-sample/src/main.tsx --view expanded
echo '---'
ast-grep outline web-viewer-sample/src/console/pages.tsx --view expanded
echo '---'
ast-grep outline web-viewer-sample/src/console/EdgeConsole.tsx --view expandedRepository: monkey1sai/AI-BIM-governance
Length of output: 3160
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- pages.tsx pipeline references ---'
rg -n 'pipeline|nav-pipe|PAGE_TITLE|PAGES|`#pipeline`' web-viewer-sample/src/console/pages.tsx
echo '--- EdgeConsole.tsx relevant slices ---'
sed -n '1,240p' web-viewer-sample/src/console/EdgeConsole.tsx
echo '--- main.tsx relevant slice ---'
sed -n '1,90p' web-viewer-sample/src/main.tsxRepository: monkey1sai/AI-BIM-governance
Length of output: 14729
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- isOperatorConsolePath ---'
sed -n '1,220p' web-viewer-sample/src/console/routing.ts
echo '--- data routes around pipeline ---'
rg -n 'pipeline|conv|minio|PAGES|NAV_GROUPS' web-viewer-sample/src/console/data.ts
sed -n '1,220p' web-viewer-sample/src/console/data.tsRepository: monkey1sai/AI-BIM-governance
Length of output: 15745
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline web-viewer-sample/src/App.tsx --view expanded
echo '---'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' '`#pipeline`|pipeline|hash|location\.hash|window\.location\.hash|pathname' web-viewer-sample/src/App.tsx web-viewer-sample/srcRepository: monkey1sai/AI-BIM-governance
Length of output: 29891
#pipeline has no live route handler docs/plans/design-system-reference.manifest.json:437-438, 652-655 — web-viewer-sample/src/console/routing.ts does not whitelist pipeline, EdgeConsole.renderBody() has no pipeline case, and web-viewer-sample/src/App.tsx doesn’t route that hash either. pipeline.default will break navigation until a real #pipeline alias exists or this manifest points back to an existing route.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/plans/design-system-reference.manifest.json` around lines 437 - 438,
Update the manifest’s pipeline entry to reference an existing supported route
instead of the unhandled `#pipeline` alias, or remove it until a real pipeline
route is implemented. Ensure both the pipeline navigation entry and its default
target remain consistent with routes handled by routing.ts,
EdgeConsole.renderBody(), and App.tsx.
Source: Path instructions
#357) * docs(specs): 彙整 migrate-console-to-hifi-design OpenSpec change 為 Superpowers spec 供 /spec-to-done P1(std-plan) 讀取的單一 specPath 入口;內容逐字保留自 openspec/changes/migrate-console-to-hifi-design/ 的 proposal.md/design.md/ tasks.md/specs/console-design-token-authority/spec.md,不新增範圍。 OpenSpec 原始檔案維持不動,仍是最終依歸。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * plan: migrate-console-to-hifi-design 實作 plan——11 tasks 落地 ai-bim-governance.css 唯一 token 權威 以 spec §6 任務分解為骨架:token 盤點+缺口延伸+真實 import(§6.1)、 unified 頁值恆等 hex→var(--ab-*)(§6.2×3,visual gate 零漂移證明)、 legacy overlay/viewer/pages 品牌綠轉青(§6.3)、主題切換移除(§6.4)、 edge-console.css retire+legacy-console.css 移植+--ec- 歸零(§6.5)、 §08 R1 改寫+品牌決策卡+origin 同步(§6.6)、真 coordinator 垂直切片 browser E2E(§9)、rebaseline+VerifyOrigin(§6.7)、archive 前置(§6.8)。 含全域 token 對照表與 capture 腳本 origin-擷取機理的誠實揭露。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * plan: fix 補前置 npm ci(buildability)——linked worktree 兩 sub-repo 皆無 node_modules reviewer [major/buildability]:整份 plan(與 spec)從未出現 npm install/npm ci。 本 linked worktree 的 web-viewer-sample/ 與 bim-review-coordinator/ 皆無 node_modules (git worktree 不共用 main checkout 的安裝;已實測 ls -d node_modules 兩處皆失敗)。 照字面執行,Task 1 Step 2 起每個 task 首條指令(npx vitest / npm run typecheck / npm run build / npx playwright test,及 Task 9 harness 解析的 bim-review-coordinator/node_modules/.bin/tsx.cmd)會先因缺依賴以 「'vitest' 不是命令 / Cannot find module」失敗,恐被誤判為 TDD red,稀釋 plan 的 TDD 嚴謹度。 修法:於「導航前提」新增一次性前置安裝條目——Task 1 之前於兩目錄各跑一次 npm ci (精確自 tracked lockfile 安裝、不改寫 package-lock.json,契合 Global Constraints 「不動 package-lock.json」;不同步時退回 npm install --no-audit --no-fund 且不納入 commit), 並明示「缺依賴失敗 ≠ Expected FAIL 的 TDD red」。僅改 plan 文件,未刪任何需求。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#0: ai-bim-governance.css 真實 import + 缺口 token 盤點延伸(§6.1) EdgeConsole.tsx 改為真實 import docs/plans/ai-bim-governance.css 正本(非手抄色碼副本), 授權檔追加 24 個缺口 token(soft/strong 語意色、spacing、motion、tracking、font-size 階、 scrollbar),vite.config.ts 加 dev server fs.allow 放行 repo 根 docs/plans/。新增 design-token-authority.test.ts 靜態把關 import 邊與 24 個缺口 token 定義邊,核心 token 值凍結。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#1: refactor(console): unified.css/UnifiedShell/HomePage inline hex → var(--ab-*)(§6.2,值恆等) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#2: refactor(console): WorkspacePage/docks/fixtures inline hex → var(--ab-*)(§6.2,值恆等) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#3: refactor(console): Pipeline/Ops/Concept hex → var(--ab-*) + 13 screens visual gate 零漂移證明(§6.2 收尾) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#3: fix(console): 凍結 --ab-violet-bright 精確值斷言,補 §6.2 視覺閘死角 review IMPORTANT:本 commit 唯一新增的色值 --ab-violet-bright(#c9befc) 只被 ConceptPage 的 imgFailed fallback 分支消費,而 13 screens 視覺閘每頁末 runtime_truth case 一律 gotoFreshRoute 且零互動、截圖恆為圖片正常載入態, 永遠照不到該 fallback 卡;design-token-authority 原本又只斷言 token「存在」不 斷言其值 → 此新色值落在「視覺零漂移證明」的死角外、無任何 gate 把關。 於「核心 token 值未被漂移(權威值凍結)」補一條精確值凍結斷言 (authorityCss 直讀 docs/plans/ai-bim-governance.css),杜絕靜默漂移。 先以錯值 #c9befd 驗證斷言確實讀取權威 CSS 位元組並會抓到漂移(RED),再 校正為 #c9befc(GREEN)。design-token-authority + unified 39/39 綠、tsc 乾淨。 純測試改動,未觸及任何 production symbol(detect_changes:0 symbols/low)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#4: feat(console): legacy overlay/viewer/pages 遷移至 --ab-* token,品牌綠轉 Hi-Fi 青(§6.3) overlay.css 移除本地 --ec-* token 副本改消費 ai-bim-governance.css 全域 --ab-* token; viewer.css 全數 hex/rgba 值 token 化,NVIDIA 品牌綠(#76b900)與舊 sky/cyan 統一收斂為 Hi-Fi 青(--ab-accent 系);pages.tsx 5 處 inline var(--ec-*) 改 var(--ab-*); RealIfcConsolePage/KitConsolePage/EmbeddedViewer 零星 inline hex 一併 token 化。 行為斷言(GovernanceOverlay/viewer/ConversionPage/console 共 124 test)不受影響,全綠。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#4: fix overlay.css 補 --ec-*→--ab-* 相容 shim,修復 .gov-overlay 治理面板失色迴歸 27d6c0c 移除 .gov-overlay 本地 --ec-* token 副本後,GovernanceOverlay.tsx 仍渲染的 .ec-btn / .ec-note / .ec-warn-note / .ec-cap / .ec-table(規則在 edge-console.css、引用 var(--ec-*))在 .ec-root 之外無 token 可解析 → 按鈕背景/邊框整條失效、警示色坍縮成內文色 (治理/合規工具的警示可辨識度屬功能需求)。--ec-* 只定義於 .ec-root,而 .gov-overlay 掛在 App.tsx→Window.tsx(非 EdgeConsole.tsx),永遠不是 .ec-root 後代。 修法(finding 認可的 Option 2):在 .gov-overlay 補一份薄的 --ec-* → --ab-* 相容 shim,值 全轉接全域 --ab-* token(品牌綠→Hi-Fi 青,沿用本遷移既定對應與 §6.1 承接 token),不回退 硬寫 hex;GovernanceOverlay.tsx 自身完成 --ab-* 遷移後整組可移除。只動 overlay.css,不碰 GovernanceOverlay.tsx(避開其 renderToString 斷言的 class 改名衝擊)。 新增 e2e/overlay-ec-token-resolution.spec.ts:以真實三支 CSS(ai-bim-governance / edge-console / overlay)+ setContent 重現 .gov-overlay 不在 .ec-root 下的 DOM,斷言 computed style——警示色 = --ab-warn 且異於內文色、按鈕背景非透明、邊框非 none。renderToString unit test 無 CSS engine 結構性抓不到此類失效,故補真實瀏覽器 computed-style 守門。 驗證:新 spec 由紅(warn 收到 rgb(219,230,243) 內文色)轉綠(rgb(230,178,62) 琥珀); tsc --noEmit 乾淨;vitest 664/664 全綠(行為斷言不受影響)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#4: fix plan 追記 overlay.css --ec-* 過渡 shim — 校正 Task 5 誠實度、Task 7 補收尾 reviewer important #1:97e6875 修復 .gov-overlay 失色迴歸時於 overlay.css 保留一份 --ec-* → var(--ab-*) 相容 shim(fix 本身正確且已 E2E 驗證),但淨結果使本 change 對 「overlay.css --ec- 用量」11→0→11 無淨減,與兩處承諾牴觸而無任何追蹤點: - plan Task 5 Interfaces「Produces: overlay.css 零 --ec-」已成假; - capability spec Requirement 1「--ec- 使用量 SHALL 歸零」為 change 終態,由 Task 7 收尾, 但 Task 7 Files/Step 6 grep gate 未涵蓋 overlay.css,照原文執行會卡住或被略過。 採 finding Option (a)(純 plan 文件校正,不動 code;Option (b) 遷移 .ec-* class 名超出 Task 5 範圍、需使用者確認故不採): - Task 5 Consumes/Produces:誠實記錄 overlay.css 保留過渡 shim、grep 回傳 edge-console.css 與 overlay.css 兩檔、--ec- 歸零由 Task 7 收尾;修正「本地副本可整塊刪除」的錯誤前提。 - Task 5 Step 2:標頭警示「勿照抄整塊刪除原案」、校正 Expected、補「Task 5 fix 追記」歷程。 - Task 7:Files 補 overlay.css;新增 Step 3(d) 明確移除 shim(前置=Step 2 已把全域 .ec-* 規則的 var(--ec-*) 移植成 var(--ab-*),:root 全域,overlay 內可解析,shim 成 dead code); Step 6 grep gate Expected 與 Step 7 git add 一併納入 overlay.css。 不弱化 spec capital-SHALL(Requirement 1 終態不變,改由 Task 7 真正交付歸零)。 純 docs/plan 變更、無 code 改動;只動 plan markdown 一檔,未觸及 3 個既有無關 dirty 檔。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * plan: fix Task 7 Step 6 精確度——overlay-ec-token-resolution.spec.ts 是 Playwright 非 vitest quality review(task#4)發現 159cdb4 引入的 line 896 宣稱「vitest 全綠(含 overlay-ec-token-resolution.spec.ts)」不成立:該 spec 是 Playwright spec,不在 vitest.config.ts include 範圍、也不在任何現有 CI/npm script 的 testMatch 內。 加一行明確的 npx playwright test 指令到 Step 6,並修正 Expected 措辭,避免 Task 7 執行者誤信 vitest 涵蓋此守門測試、在移除 overlay.css shim 後對迴歸失去追蹤。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#5: 移除亮/暗主題切換,UnifiedConsole 收斂純深色(§6.4,BREAKING) LegacyEdgeConsole 移除 theme state、localStorage["aibim:ec-theme"] 讀寫、 .theme-light class 套用與切換按鈕;新增 EdgeConsole.theme-removal.test.ts 靜態掃描把關(theme-light CSS token 塊留待 Task 7 隨 retire 一併處理)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#6: retire edge-console.css,legacy-console.css 移植消費 --ab-*,--ec- 全域歸零(§6.5,BREAKING) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#6: fix 補 --ec- token 全域歸零的持久化回歸守門(Important #1) commit 3d3b004 自稱「--ec- 全域歸零」且標記 BREAKING,但當時唯一驗證是 plan Step 6 的一次性手動 grep,未把「console CSS 零 --ec- 殘留」凍結成任何 vitest 斷言——與同序列 Task 5 的 BREAKING 不變量(EdgeConsole.theme-removal.test.ts)不對稱。 新增 web-viewer-sample/src/console/ec-token-retirement.test.ts,比照 theme-removal 手法 讀取 legacy-console.css 與 governance/overlay.css,斷言 not.toMatch(/--ec-/)。正規式鎖 --ec- 自訂屬性 token,不誤傷刻意保留的 .ec-* class 命名空間。日後若有人從歷史 spec / openspec archive 貼回舊片段,CI 會在視覺 QA 前先攔下。 驗證:新測 2 case 綠;注入 var(--ec-accent) canary 後如期在 line 22 RED、git checkout 還原後綠;typecheck 乾淨;full vitest 670 passed(原 668 + 2)。純新增測試檔,無 production code 變更。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(console): 修正 legacy-console.css/ConversionPage.test.tsx 殘留「綠」註解 quality review(task#6 Retire edge-console.css)發現 6 處敘述性註解仍寫「綠」, 但實際色值已隨本次 Hi-Fi 遷移改為 --ab-accent(Hi-Fi 青),與「品牌綠轉青」的 遷移成果自相矛盾。純注釋修正,不動任何選擇器/屬性值,不影響測試或行為。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#6: fix 消除 ConversionPage delivered 狀態殘留「綠」描述(Important #1) quality review 指出 003a79c 的「掃綠字收尾」漏掉同性質兩處: - ConversionPage.tsx:18 設計意圖註解仍寫 delivered=綠,但 3d3b004 後 .ec-status-dot.ok 已改吃 --ab-accent(#41c7e8 Hi-Fi 青),非綠,且直接 鄰接 OUTBOX_STATUS_TONE(delivered→ok),敘述已成事實錯誤。 - ConversionPage.test.tsx:167 測試標題仍寫 delivered=綠,與同一 it block 內第 190 行已修正的行內註解(ok=Hi-Fi 青)自相矛盾。 兩處一律比照 legacy-console.css/line190 既用字改為 delivered=Hi-Fi 青。 純註解/測試標題字串置換,OUTBOX_STATUS_TONE 物件與測試斷言本體零變更; ConversionPage.test.tsx 7 tests 全綠、detect_changes staged 0 symbol / low。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#6: fix FlowBar done 內點填色迴歸——.ec-flow-step.done .ec-flow-n 綠(--ab-ok)不再被後段 polish 覆寫回青 legacy-console.css 同一選擇器 .ec-flow-step.done .ec-flow-n 被宣告兩次:line 202 基礎規則給 background:var(--ab-ok)(綠 #31c56d,與 line 201 chip 外框同色),line 412 後段 polish 區塊 (§6.5 遷移時 --ec-grn→--ab-accent 機械替換的殘留)又覆寫回 background:var(--ab-accent)(青 #41c7e8)。 兩條 specificity 相同、無 @media/!important,cascade 後者勝出 → done 內點誤渲成與 active 同色的青, 與同一 chip 仍為綠的外框自相矛盾,違反 a1Machine.ts:91-97/a1Machine.test.ts:145 記載的 spec §2.1 「已完成=綠、當前=青」。 修法(line 412):background、border-color 皆改回 var(--ab-ok)(呼應基礎規則與 chip 外框,內外同綠、 不留青環殘影);color 保留 var(--ab-on-accent) 深墨(DS 無 --ab-on-ok,深墨於綠底可讀)。active 態不動, 仍為深底青圈,兩態明確可辨。 守門:新增 e2e/flowbar-stepper-done-active-color.spec.ts(Playwright,真瀏覽器 setContent 載入 DS+legacy 兩支真實 CSS)——修前 done 內點 background=rgb(65,199,232) 青(紅燈),修後=rgb(49,197,109) 綠(綠燈)。 此衝突屬 computed-style 層級,字串測試 ec-token-retirement.test.ts 抓不到(兩 token 皆合法 --ab-*)。 tsc --noEmit 乾淨;vitest 62 files/670 tests 全綠;detect_changes staged 0 symbol / low。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#7: docs §08 R1 改寫指向 ai-bim-governance.css --ab-* + 新增 R1a 品牌決策卡 R1 卡的 design token 敘述由已 retire 的 edge-console.css --ec-* 改為指向 docs/plans/ai-bim-governance.css --ab-*(OpenSpec change console-design-token-authority 的唯一 production 權威)。R1 卡後新增 R1a 卡,明文記錄「NVIDIA 綠 #76b900 → Hi-Fi 青色系 #41c7e8/#2f7bf6」與 「移除亮/暗雙主題切換」為使用者明確拍板的有意識決策(D4),防止未來 AI coding agent 誤以為是疏忽覆蓋而「修回」舊品牌。全文件 grep 核對 edge-console/亮色/雙主題/76b900/NVIDIA 綠等關鍵字,確認§03 等其他章節 無殘留過時敘述。已同步覆寫 out-of-repo 唯讀 authoring origin 副本 (C:\Repos\design\desigin-system\AI-BIM 前後端設計文件.dc.html,比照 PR #353 作法,該路徑不受本 repo git 追蹤)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#7: fix §08 R1/R1a 引用改指 migrate-console-to-hifi-design + 補回真實 import/操作標準敘述 修掉 Task 8(§08 R1 改寫 + 品牌決策卡)三處 spec-compliance gap,對齊 plan docs/superpowers/plans/2026-07-16-migrate-console-to-hifi-design.md Step 1(:922)與 Step 2(:928-934)明列文字: 1. 誤導性引用(R1:619、R1a:626):原寫「OpenSpec change console-design-token-authority」, 但 repo 內不存在該 change——console-design-token-authority 只是 change migrate-console-to-hifi-design 底下的 capability(proposal.md:18),D4 決策全文實際在 migrate-console-to-hifi-design/design.md:50。兩處改指真實存在的 change migrate-console-to-hifi-design,恢復可信賴追溯路徑(D4 目的)。 2. R1a 漏做(626):補回 plan Step 2 明列的「以 AI-BIM Console Hi-Fi.dc.html 為前端唯一操作標準」 決策記錄(proposal.md Why 引用的使用者原始拍板內容之一);先前只記錄顏色/主題兩項。 3. R1 漏做(619):補回 plan Step 1 的「production 真實 import,不手抄色碼」完整敘述, 對應 console-design-token-authority spec Requirement 1 的 SHALL(真實引入 CSS、禁手抄色碼)。 Step 3 stale-narrative grep:edge-console|theme-light|亮色|雙主題|76b900|NVIDIA 綠 命中僅落在 R1/R1a 卡且全為「已退役/REMOVED/請勿修回」語境,其他章節無過時敘述。 repo 外側效應(不入 git,比照 PR #353):已同步 C:\Repos\design\desigin-system\AI-BIM 前後端設計文件.dc.html (byte-identical 102244,console-design-token-authority 命中歸零)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#8: test(e2e) hifi-token-authority 垂直切片——真 coordinator、runtime ID、四態、品牌青與 --ec- 絕跡斷言(spec §9) playwright.functional-runtime.config.ts testMatch 加入 hifi-token-authority.spec.ts; 新建 e2e/hifi-token-authority.spec.ts:真 coordinator 起 :8017、webhook 種 ifc_ready_job_id、 /ui #conv 頁 loading/failure/retry/success 四態、unified home 與 legacy 頁 computed style 斷言 --ab-accent #41c7e8 生效、--ec-grn 絕跡、主題鍵/淺色 class/切換鈕全數退場; #/demo-control 與 #/kit 路由仍可達。以舊 dist-ui 先驗證真紅(brandColor 仍 rgb(118,185,0)), npm run build:ui 後 4 test 全綠,截圖入庫。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#8: fix hifi-token-authority 垂直切片三缺口——retry 改點 conv-refresh 鈕、loading 綁對 /api/external/ifc-ready 並硬斷言、截圖證物誠信 - 缺口1(spec §9「UI route → 按鈕」):retry 由 page.reload() 整頁重載改為點擊 conv-refresh 鈕 (onClick → refresh() → data.load() → GET /api/external/ifc-ready),與被測佇列同一條 fetch, 屬佇列層使用者重試入口;per-job conv-prioritize-*/conv-retry- 語意不同故不採。全檔自此有真實 按鈕操作,conv-refresh 的 onClick handler 若被砍/改壞即會被此 E2E 測到。 - 缺口2(loading 綁錯資料流且從未斷言):移除綁在 GET /api/dev/conversions 的 conv-history-loading 觀測(先前僅 console.log、無 expect),改硬斷言 conv-refresh 鈕的 data.busy 載入態 (toBeDisabled + toContainText「載入中」);掛「延遲放行」route(route.continue 前 setTimeout 800ms, 仍打真實 coordinator)留出穩定觀測窗。loading 自此綁對被測 /api/external/ifc-ready 資料流並被真正驗證。 - 缺口3(截圖證物誠信):legacy-demo-control.png 改在導往 #/kit 之前拍攝,確保檔名與畫面一致 (原檔實拍到 #/kit 的 Kit Manager 台);新增 legacy-kit.png 對應本 test 第二條 #/kit 可達性斷言的畫面。 Evidence: npm run build:ui + playwright functional-runtime(port 8017 真 coordinator),3 tests 全綠(8.9s)。 scope 驗證:detect_changes(staged) changed=0 affected=0 risk=low(test-only + 證據)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#8: fix hifi-token-authority 補 coordinator 埠前置守門——殘留舊 coordinator 佔埠即 fail-fast,杜絕頂替假綠 依 conv-history.spec.ts 既有慣例(plan「harness 逐段依 conv-history.spec.ts」),在 beforeAll dist-ui 檢查之後、spawn 之前新增 requireCoordinatorPortAvailable():spawn 前先自己 bind 一次目標埠 (缺省 8017,可經 HIFI_E2E_COORDINATOR_PORT 覆寫)。bind 失敗=有未知程序占用(最常見:前一輪本機 執行被 Ctrl+C/除錯器中止,afterAll taskkill 未跑完,殘留舊 coordinator 仍佔埠),直接丟明確錯誤 fail-fast。否則新 spawn 撞 EADDRINUSE 崩潰、而 waitForHealth 首輪輪詢(最遲 250ms)先打中殘留舊 程序回綠,整組測試會悄悄對舊 build 跑出假綠燈——正是本檔 fix commit 想根除的同一類證物綁錯問題。 此缺口只在本機重複執行的取證流程踩到;CI 全新 runner 單 job 無殘留 process 不受影響。 驗證:npx eslint(乾淨)、獨立 tsc --noEmit(乾淨)、git diff --cached --check(無 trailing)、 GitNexus detect_changes(staged)(changed_files=1、0 symbols、0 processes、low risk)。僅動測試檔, 不碰 production code;3 張 legacy PNG 為前輪殘留、非本 fix 產物,刻意排除在本次 commit 外。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#10: docs(pr-evidence) migrate-console-to-hifi-design Archive 前置驗證 + PR 證據包(spec §6.8) Step 1-3 逐字驗證: - openspec validate --strict PASS - 邊界零污染 gate(origin/main...HEAD 對 unified-governance-console/edge-console-operator-frontend/ align-frontend-design-system-reference 三既有 spec/change):零觸碰 - 完成定義三連:--ec- 於 production CSS(legacy-console.css/overlay.css)核實為 0;唯一非零命中是 Task 6 新增的持久化回歸守門測試 ec-token-retirement.test.ts 自身(斷言正規式字面量必然含該字串, 已於證據檔誠實記錄,非production 殘留);console/unified/ 十六進位色碼歸零;git log 涵蓋 Task 1-10 共 24 commits。 新發現並升級(不在 plan Step 4 原始清單內):用真實 base(origin/main)/head(HEAD) 跑 Get-DesignSystemChangeScope(check-pr-body-evidence.ps1/pr-review-agent required check 同一支函式), status=reference_authority_mixed_fail_closed——本分支同時修改 design-system-reference.manifest.json (Task 10 rebaseline)與產品碼(Task 1-9),觸發 gate 無 override 路徑的 fail-closed throw。本 repo 既有先例 PR #349(reference_authority+gate_infrastructure)與 #350(純產品碼)刻意拆成兩個 PR 正是為 了繞開同一條規則。此衝突需 P6(PR + ship-item)階段解決(例如仿 #349/#350 拆分 PR),不屬本 task (純驗證+PR body 組裝、Global Constraints 明文禁改 design-system-gate.ps1)範圍,已寫入 artifacts/2026-07-16-migrate-console-to-hifi-design-pr-body.md §2 供下階段處理。 新增 artifacts/2026-07-16-migrate-console-to-hifi-design-pr-body.md:Step 1-3 驗證逐字記錄、 CI Gate 風險、遷移前後截圖對照、golden baseline diff 摘要、既有功能 E2E 證據、BREAKING 揭露、 Frontend Verification 素材(pr-review-agent 完整欄位,非僅七列)。 驗證:GitNexus detect_changes(staged) changed_files=1、0 symbols、0 processes、risk=low (純新增 markdown 證據檔);git diff --cached --check 乾淨。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * task#10: fix 修正 PR 證據包兩處事實錯誤——測試數 4→3、c75a832 歸屬 Task 6→7(quality review) 純文件校正,僅動 artifacts/2026-07-16-migrate-console-to-hifi-design-pr-body.md,無 production/測試 code 變更。 Important #1(§5 line 126-127):hifi-token-authority.spec.ts 全歷史快照(e513d6c/8788f3d/ HEAD)git 實測皆為 3 個 test() 區塊,從未有 4 個;e513d6c→8788f3d 的 diff 僅改既有 test 內部 斷言、未增刪任何 test。原文「4 tests 全綠/初版 4 綠」既與 git 事實不符,又與同句下半「3 tests」 自相矛盾。校正為 3 tests,並註明 8788f3d 未增刪 test。 Important #2(§1 line 30):commit c75a832(task#6 前綴 → Task 7)message 開頭即 「commit 3d3b004 自稱『--ec- 全域歸零』…」,為 3d3b004(§6.5/Task 7)的直接後續補測; 依 plan §6.5→Task 7 與 task#N→Task(N+1) 前綴慣例應歸 Task 7,非 Task 6(§6.4 主題移除)。 本檔 line 41 已正確標 3d3b004 為 Task 7,line 30 為同檔唯一誤標,校正 Task 6→Task 7。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: 補強 --ec- 守門測試動態掃描與真後端故障 E2E(對抗複驗 f2/e2) [f2] ec-token-retirement.test.ts 改為遞迴掃描 src/console 下全部 *.css(不再寫死 legacy-console.css / governance/overlay.css 兩檔),未來新增 CSS 檔自動受守;並加防呆斷言 「至少掃到一檔」避免 discovery 壞掉靜默偽綠。同步在測試 header、design.md §6.5、tasks.md 5.1、 plan 完成定義補註:字面 grep -rc 唯一允許的非零命中是守門測試檔自身(斷言 /--ec-/ 必然寫出 該字串的自我參照),非 production CSS 殘留。 [e2] hifi-token-authority.spec.ts 新增第二個 describe:起專屬 coordinator、確認佇列端點真 200 後把該進程殺掉,使使用者點 refresh 時 fetch 命中真實 ECONNREFUSED(不攔任何請求、非 page.route abort),驗證 conv-queue-error 在真後端故障下等價誠實浮現;附截圖為證。並修正 header「無瀏覽器 API mock」的不精確自述——界定第一個 describe 的 abort 屬「狀態機腳本化」 的瀏覽器流量控制、非後端行為 mock。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: 本 PR 不觸碰 design-system-reference.manifest.json 依先例 PR #349/#350,manifest 的 token_projection.production_projection 欄位 翻轉(edge-console.css → ai-bim-governance.css)與完整 rebaseline 一併移到 merge 後的追加 PR,避免同一 PR 同時碰 reference_authority 路徑與 product 路徑觸發 Get-DesignSystemChangeScope 的 reference_authority_mixed_fail_closed。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(ci): design-semantic-visual 呼叫改 dot-source,避免跨 process 陣列傳參被拆散 Recompute and validate design result 步驟原本用 pwsh -File 開子行程呼叫 verify-design-system-visual-result.ps1,把 $requiredScreenIds(13 個螢幕 ID 的陣列)當引數傳過去。PowerShell 對原生執行檔呼叫的引數繫結會把陣列攤平 成多個獨立命令列 token,導致子行程端把部分元素誤綁到宣告順序在後的 -MaxAgeHours([int])參數,拋出型別轉換錯誤(CI run 29564973077 實測重現)。 改為同一個 PowerShell session 內 dot-source 呼叫,陣列以原生物件繫結,不再 跨 process 邊界。已確認 MaxAgeHours 誤綁不再發生(本機模擬 13 元素陣列, throw 變成合法的 manifest SHA 業務邏輯錯誤,而非型別轉換錯誤)。 此為與本次 console 遷移無關的既有 CI 基礎設施 bug,任何觸發 frontend_visual_required=true 且 approved screen 數 ≥3 的 PR 皆會撞到。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…-e2e 本 change 的 Non-goals 與 design.md §4 寫「不放寬 design gate;pixel/semantic 仍由既有 design-system 路徑判定」。該敘述成立,但不等於既有路徑健康。2026-07-29 對 subject 13033cb 的唯讀查證顯示 design gate 已為紅燈,成因與本 change 無關;此處揭露並指派 owner, 避免本 change 的 functional evidence 被誤讀為 design 覆蓋、也避免缺口變成無主債務。 新增 proposal.md「相鄰既有缺口」D-1~D-5: - D-1 main design-semantic-visual FAILURE;唯一失敗項 workspace.a4.default (diff ratio 0.2794 / 0.3186 > max_diff_pixel_ratio 0.01);其餘 12 screens PASS 且 semantic_parity = 1 → 純 pixel 失效 - D-2 成因為 route IA 遷移:UNIFIED_WS_KEYS 已移除 a4,#a4 改渲染 A4SemanticSearchPage, manifest 釘的 golden 描繪的 WorkspacePage A4 dock 已無路由可達 - D-3 A4SemanticSearchPage 未套 --ab-* 且 IA 偏離 Hi-Fi canon(canon 的 A4 是 3D 工作區內的 dock)→ 需使用者裁決改 code 或依 R-A1 提案改 canon - D-4 R-A2 治理缺口:雙旗標腳本只重算 hash,無法增刪 screens[] 或改 route 歸屬, route IA 變更後 manifest 無合法更新路徑(#349 先例早於 R-A2 落地的 #360) - D-5 pinned origin 對 manifest.source.files 23/23 hash MATCH(rebaseline 對該面為 no-op,不需設計側核准);但 repo 正本副本與 pinned 快照分歧,support.js 另違 R-A3 同時附上未實作 change 盤點(machine truth = lifecycle-ledger.json)作為 owner 指派依據。 其他變更: - design.md §4 補「該路徑目前為紅」限定,§5 增兩列風險 - tasks.md 新增 6.6:PR body 逐字揭露 D-1~D-5 且證明 diff 未觸及 manifest/baseline/ R-A1 手寫正本面 - lifecycle-ledger.json task_ledger.total 27 → 28 - NOW.md 增 design gate 現況揭露與變更紀錄列 本 commit 不修復任何一項缺口,不觸碰 design-system-reference.manifest.json、 design-system-baseline/** 或任何 R-A1 手寫正本面檔案。 Verification: npx openspec validate isolated-branch-stack-browser-e2e --strict PASS; npx openspec validate --all --strict 70 passed / 0 failed;git diff --check clean。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017jRpqq8bEbss9pPyzngcXS
…離 stack browser E2E 契約 (#428) * docs(openspec): 立 isolated-branch-stack-browser-e2e(A4 tasks 4.x 的隔離 stack browser E2E 契約) a4-console-convergence tasks 4.1-4.4 把 A4 的全部 runtime evidence 押在「隔離 alt-port branch stack(coordinator :8005 / governance :49103)」,且 4.1 指向 docs/agents/product-operability-and-script-contract.md。實測 subject 13033cb: 該檔 206 行內 8005 / 49103 / 隔離 stack 出現 0 次,repo 內也沒有 launcher、 沒有 port 不相交檢查、沒有 machine check。指標是懸空的。 現況知識散在三處且都不是 product contract: - web-viewer-sample/playwright.config.ts(註解 + fallback 常數) - web-viewer-sample/e2e/a4-closeout.spec.ts(檔頭註解) - .claude/skills/spec-to-done/ensure-host-native-ports-free.ps1 (agent skill;openspec/config.yaml 明令 skill 不得作為 product source of truth) 兩個真實失效模式:打錯環境污染唯一測試部署區;a4-closeout.spec.ts 缺 A4_E2E_REQUIRE_REAL=1 時 conditional skip 後仍回報綠燈。 本 change 新增 capability isolated-branch-stack-verification(6 條 Requirement / 15 個 Scenario):未 merge branch 的 runtime evidence 一律在隔離 stack 取得; port 集合與部署區及 Kit range 不相交且 fail closed;launcher 必須是 repo-owned script 而非 agent skill;evidence 引用必須 require-real 且不得推論 design gate、 deploy path 或 3D/WebRTC 結論;契約需 machine check。 不承接 a4-console-convergence tasks 4.x 本身,不改任何 A4 實作,不碰凍結面。 capability 與 a4-semantic-search 不重疊,不觸發 NoSuccessorWhilePredecessorOpen。 驗證: - npx openspec validate isolated-branch-stack-browser-e2e --strict -> valid - npx openspec validate --all --strict -> 70 passed, 0 failed - verify-openspec-lifecycle.ps1 -BaseRef main -> non_deferred=5(<=6), deferred=5 - test-agent-governance-check.ps1 -> 17/17 pass - scan-secret-patterns.ps1 -> passed - git diff --cached --check -> clean Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PbxS3tBaQ1o8yn5LnVoeJY * docs(openspec): 將 design gate 唯讀查證結論整合進 isolated-branch-stack-browser-e2e 本 change 的 Non-goals 與 design.md §4 寫「不放寬 design gate;pixel/semantic 仍由既有 design-system 路徑判定」。該敘述成立,但不等於既有路徑健康。2026-07-29 對 subject 13033cb 的唯讀查證顯示 design gate 已為紅燈,成因與本 change 無關;此處揭露並指派 owner, 避免本 change 的 functional evidence 被誤讀為 design 覆蓋、也避免缺口變成無主債務。 新增 proposal.md「相鄰既有缺口」D-1~D-5: - D-1 main design-semantic-visual FAILURE;唯一失敗項 workspace.a4.default (diff ratio 0.2794 / 0.3186 > max_diff_pixel_ratio 0.01);其餘 12 screens PASS 且 semantic_parity = 1 → 純 pixel 失效 - D-2 成因為 route IA 遷移:UNIFIED_WS_KEYS 已移除 a4,#a4 改渲染 A4SemanticSearchPage, manifest 釘的 golden 描繪的 WorkspacePage A4 dock 已無路由可達 - D-3 A4SemanticSearchPage 未套 --ab-* 且 IA 偏離 Hi-Fi canon(canon 的 A4 是 3D 工作區內的 dock)→ 需使用者裁決改 code 或依 R-A1 提案改 canon - D-4 R-A2 治理缺口:雙旗標腳本只重算 hash,無法增刪 screens[] 或改 route 歸屬, route IA 變更後 manifest 無合法更新路徑(#349 先例早於 R-A2 落地的 #360) - D-5 pinned origin 對 manifest.source.files 23/23 hash MATCH(rebaseline 對該面為 no-op,不需設計側核准);但 repo 正本副本與 pinned 快照分歧,support.js 另違 R-A3 同時附上未實作 change 盤點(machine truth = lifecycle-ledger.json)作為 owner 指派依據。 其他變更: - design.md §4 補「該路徑目前為紅」限定,§5 增兩列風險 - tasks.md 新增 6.6:PR body 逐字揭露 D-1~D-5 且證明 diff 未觸及 manifest/baseline/ R-A1 手寫正本面 - lifecycle-ledger.json task_ledger.total 27 → 28 - NOW.md 增 design gate 現況揭露與變更紀錄列 本 commit 不修復任何一項缺口,不觸碰 design-system-reference.manifest.json、 design-system-baseline/** 或任何 R-A1 手寫正本面檔案。 Verification: npx openspec validate isolated-branch-stack-browser-e2e --strict PASS; npx openspec validate --all --strict 70 passed / 0 failed;git diff --check clean。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017jRpqq8bEbss9pPyzngcXS * docs(openspec): 三層交叉對抗驗證結果——撤回被推翻的裁決並補 D-6~D-13 依使用者指令對 D-1~D-5 衍生的設計問題執行三層交叉對抗驗證(L1 提案 → L2 三個獨立 refute-by-default 驗證者從 code-truth / canon-governance / runtime-capacity 三視角攻擊 → L3 仲裁)。基準 main 13033cb,全程唯讀。 結果:L1 多數裁決被推翻。本 commit 誠實記錄撤回,避免同批錯誤結論被後續 agent 從對話紀錄撿回重做。不新增 requirement、不改變 capability 範圍。 事實修正(前一 commit 已推送的錯誤): - D-2 原寫「golden 描繪的 UI 已無任何路由可達」不精確。A4 dock tab 與 A4Dock 元件兩者都仍在(fixtures.ts:178-184、WorkspacePage.tsx:159、 unified.test.tsx:44-50 pin 住),只是面板被掏空為 data-prov="redirect" 導流卡(docks.tsx:237-249)。不可達的是 golden 描繪的「已填充」版本。 - D-4 原寫的治理缺口為 latent 而非 active:結構性斷言目前全數仍成立, 且封鎖是三道牆——capture 腳本、verify-design-system-reference.ps1:280 的 hard-coded $expectedRoutes、ci.yml:386-390 的 base-approved screen fail-closed。原指派候選 owner align-frontend-design-system-reference 已撤回(rebaseline ownership 是其解凍前必裁的四項互斥設計之一)。 被推翻並撤回的 L1 裁決(含機器證據): - 「改 code 對齊 canon:A4 回 dock、viewport 改真 EmbeddedViewer」——與 a4-console-convergence tasks 3.3/3.4 直接對撞(#427 落地的正是該 owner 自己的 task);且 golden 由 authority.authoring_origin 擷取即 canon 投影、畫面內含 fixture 數字,故無法閉合 D-1;改 viewport 是偏離 canon 而非對齊,並會讓 a1/a2/a3 三個現行 PASS screen 一併轉紅。 - 「S3 已交付故 3D 高亮不是 vaporware」——偷換概念。producer 端在前端 不存在,A4 頁 UI 文案逐字自陳停用且無 3D 按鈕。 - 「擴充 capture 腳本加第三旗標」——只動三道牆的第一道。 - 「spectator 預算固定為 1、保留 4 個給真人」——active canon 明令 KIT_SPECTATOR_COUNT 預設 MUST 為 0;且 viewerLeaseStore 無名額記帳。 原引用 .claude/skills/** 為依據違反 openspec/config.yaml:27-28。 - 「A5–A10 dashboard 殼可先做」——以 R3 當建置許可,違反 R2 三態。 - 「A1–A4 共用單一 primary lease」——降級為現況觀察。 新增缺口 D-6~D-13(皆不在本 change 範圍):A4 handoff producer 缺口、 KIT_SPECTATOR_COUNT canon-vs-deploy 衝突、canon 已具名的假複製 R3 違規 未修、spectator 名額無記帳、零 admission control、dedicated_instance 容量謊報、靜態縮圖能力零實作、golden 含 fixture 導致誠實化結構性不可能。 新增 U-1~U-9 待使用者裁決清單。根節點 U-1:canon 的 fixture 數字與 R3 誠實鐵律哪一邊讓步——價值取捨,工程判斷關不掉。 Verification: npx openspec validate isolated-branch-stack-browser-e2e --strict PASS;git diff --check clean;tasks 仍為 28 項與 ledger 一致。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017jRpqq8bEbss9pPyzngcXS * docs(openspec): 記錄 A1–A10 viewer 架構的使用者裁決、現況落差與 C-1~C-6 約束 依使用者 2026-07-29 指令,將 grill-me 第二題(A1–A10 viewer 架構)的結論 寫入本 change。前一 commit 只記錄了被推翻的裁決,遺漏了使用者自己的裁決與 架構層可用結論——本 commit 補上。記錄性質,不新增 requirement、不改變本 change 的 capability 範圍、不對 A1–A10 授權任何實作。 寫入本 change 的理由:本 harness 明文不在隔離 stack 內啟動 Kit/WebRTC/GPU, 因此所有 A1–A10 viewer 面都落在覆蓋邊界外。把邊界寫清楚,才不會有人拿隔離 stack 的 functional evidence 去推論 3D/串流已驗證。本節末新增一條與既有 evidence 標示同等強度的禁止句。 內容: - 使用者陳述的目標架構(逐字保存) - 使用者已裁決:「只有外殼相似,runtime 分級」——A5–A10 沿用同一套 viewport 視覺語言但預設不起自己的 Kit session,有 session 時 spectator 唯讀掛入, 無 session 時靜態縮圖並誠實停用。依 docs-plans-README §3.1 為最高權威。 - 目標 vs 現況落差表(唯讀查證 main 13033cb):A1–A4 dock 內無任何 WebRTC (viewport 是 data-prov="fixture" 的 PNG);唯一 EmbeddedViewer 硬編碼 streamRole="primary" 且只在 legacy route;「邀請 Spectator」是 toast 假複製; A5–A10 現為靜態概念圖;全域單一 Kit 進程單一 stage;repo 未建置瀏覽器端 非 WebRTC 的 3D viewer 能力。 - C-1~C-6 約束(經三層對抗驗證後仍成立,任何未來實作 SHALL 先滿足): spectator 唯讀鏡像無法當獨立 3D 視圖、跨 session 必重連且可能顯示假畫面、 route 切換會 unmount viewer 且 repo 無 portal/hoist 機制、兩面各自 claim primary 會 409、A5–A10 資料須依 R2 三態、無 admission control 且容量承諾 受 gpu-session-baseline 硬 gate 限制。 Verification: npx openspec validate isolated-branch-stack-browser-e2e --strict PASS;git diff --check clean。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017jRpqq8bEbss9pPyzngcXS * fix(governance)+docs(openspec): 修 agent-governance 紅燈並套用收斂輪三驗證者的更正 收斂輪對最終產出再跑一次三層驗證(W1 事實正確性/W2 治理形式/W3 完整性 批評),三份報告合計指出一個 required check 紅燈、兩處事實錯誤、四項殘留 越權與六個引用錯誤。本 commit 全部處理。 修 required check 紅燈(本 change 自己造成,原本無人認領): - lifecycle-ledger 新增第 5 筆 active 撞上 test-ai-coding-metrics.mjs 對 active-change-wip 的硬編碼期望值(4/3),使 agent-governance FAILURE。 - 改為由同一份 ledger 推導 activeChangeCount。兩處斷言驗的是「零觀測→null」 與 held/completed 處理,WIP 數字對其為附帶值;硬編碼會讓每次新增或封存 change 都誤觸紅燈。WIP 上限(≤6)的真正 gate 在 verify-openspec-lifecycle.ps1,未受影響。 - tasks 6.2 擴為三步順序契約;proposal Impact 與 design.md §5 補記。 - 驗證:node --test test-ai-coding-metrics.mjs 13 pass / 0 fail; test-openspec-ledger-reconciliation.ps1 all assertions passed。 修事實錯誤: - 「branch-protected gate」措辭全數移除(U-2/U-4/U-5)。design-semantic-visual 不在 main 的 11 個 required contexts 內,該措辭會灌高緊急度。 - design.md §5 與 tasks 6.6 原稱本 PR 帶著 design gate 紅燈;實為 skipped (本 PR 只動 docs/plans 與 openspec,未觸發 frontend_visual_required)。 6.6 改為據實描述 main failure vs 本 PR skipped 的差異。 撤回殘留越權: - D-3 對 migrate-console-to-hifi-design 的 owner 指派(該 change tasks 為 列舉式封閉清單,對 A4SemanticSearchPage 命中數 0)。 - D-6「非缺陷」裁決 → U-11(正本記 A4 含 3D 高亮,與 a4-console-convergence tasks 3.4/4.4 的 table-only 停用直接衝突,只能由使用者裁決)。 - D-10 對 gpu-session-baseline-and-idle-reclaim 的指派 → U-12(該 change 「明確不做」逐字列出 primary 佇列)。 - 「不採用 Kit extension 作為 A5–A10 的 3D 路徑」→ U-10(對未建置之物做 技術選型屬產品決定;且原依據是成本陳述而非否決依據)。 - NOW.md 的無條件 owner 指派句一併改為待裁決。 - D-8 反向調整:canon 已是 MUST、同 repo 有參考實作、修法 pixel-neutral, 移出「待裁決」;並補上初版漏掉的兩處違規(PipelinePage.tsx:128/:123)。 修引用錯誤(W1 逐條核對): - capture-design-system-reference.mjs 行號 40-45/43-46 → 43-47,並補記 DESIGN_SYSTEM_REFERENCE_ROOT env 優先(此為 D-13 論證的唯一漏洞)。 - D-8 canon 引文補回被吞掉的「列入改寫說明」。 - D-12 的「全 repo 無 Pillow/PIL/sharp」限縮為產品目錄範圍(agent skill references 內確有 14 處)。 - D-7 由「canon 衝突」降級為「canon 記述與部署既成預設待對齊」:引文補回 「(開啟=部署決策入部署說明)」,並揭露其父需求 R-B6 自陳實作 deferred、 Scenario 規範對象是正本文字而非 deploy 層。 - D-10「409 不可達」限縮為「預設政策+預設 kit_profile 下不會因併發觸發」。 - 「R2 三態無一允許」過度絕對 → 改用逐元件判定(in-repo 可建面不得 mock 過渡;外接依賴面 mock 合法且須掛 ProvTag,依 R-B5)。 - 另修 D-4 斷言性質、D-11 測試涵蓋、agent skill 鏡像數等四處次要措辭。 補使用者原始問題的直接回答: - 新增「rebaseline 關不掉這個紅燈」節:capture 腳本無 per-screen scope (跑它必然重寫全部 26 張 golden 與三個 manifest 欄位)、baseline 自 canon 擷取、canon 未變則重截等價 → 沒有「只補 A4 兩張圖」的合法捷徑。並標註 a4-semantic-search-model-qa tasks.md:82 的「只重新 capture workspace.a4.default」以現行腳本不可執行,屬既有缺陷。 tasks 6.6 拆為 6.6/6.7(一個 outcome 一個 task);ledger total 28 → 29。 Verification: openspec validate --strict PASS;test-ai-coding-metrics 13/0; ledger reconciliation PASS;git diff --check clean;tasks 29 = ledger 29。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017jRpqq8bEbss9pPyzngcXS * docs(openspec)+fix(governance): 重跑輪收斂——#429 後事實更新、Q1–Q8 委任裁決落地、修 merge-evidence 紅燈 baseline 前進(13033cb → bfcc433,含 #430/#429/#422)後依三個重跑輪驗證者 (X1 引用存活/X2 spec 保全/X3 未竟提問)與答案輪雙驗證者(Y1 事實/Y2 治理形式)的交叉結果做 L3 仲裁。 #429 事件(test(design): reapprove canonical A4 baseline)帶來的事實更新: - D-1 改列歷史(CI 三連證 failure→success→success);「rebaseline 關不掉 這個紅燈」節改寫為 v2,誠實記錄 v1 結論被 #429 實證推翻,含 v1 論證 #1 在 13033cb 當下即可被 DESIGN_SYSTEM_SCREEN_IDS 證偽的查證疏漏。 - D-13 拆分:對 A4 失效(golden 改溯產品面),對其餘 12 screens 仍成立; manifest 混合權威與 A4 entry 內部不一致記入新增之 D-15。 - D-3 風險反轉:未套 token 的產品面已被固化進 golden,日後套 token 會反紅。 - D-4 緊急度歸零(#429 的第四條路不觸發三道牆;斷言本身仍成立)。 - 新增 D-14(harness/fakeReviewSocket 證據面,含雙閘門與 design gate 已走 harness route 的精確描述)、D-15(#429 provenance 切換:使用者授權、非 R-A2 雙旗標路徑、四項待收編)、D-16(spectator 裸連結安全模型,提權前提 精確化:primary 空缺或 TTL 45s 過期時)、D-17(ledger 92/93 vs 66/71 漂移)。 - X1 行號更新表全數套用(viewerLeaseStore 348-360、app.ts 1275-1282、 Window.tsx 1882-1886 等 18 處);六處路徑補全;D-12 自我指涉修正。 Q1–Q8 委任裁決落地(新增「使用者委任 AI 裁決」節): - 節首 provenance 三 qualifier(非使用者原話/可單方推翻/不構成 canon 或 requirement);A1/A3/A6/A7/A8 照案通過,A2/A4/A5 依 Y1 修正—— A5 為最重修正:viewer-viewport:24「spectator SHALL 不內嵌於 console」無 scope 限定,使用者裁決的 A5–A10 內嵌 spectator 在 MODIFIED delta 收窄 console 措辭前屬 spec-nonconforming;MODIFIED delta 是必要前提。 - U 表原地標記不改寫不重編號:U-8/U-9 關閉(分標 AI-裁決/事實更正)、 U-6+U-12 合併(參 D-9/D-11;仍待使用者裁決)、U-2 記 #429 實質處置、 U-7/U-10 部分回答。A1–A10 節補 F-1 更正(兩份 approved spec 對照)與 C-3 重定性(spec 要求不 unmount vs 現況 key={page} 落差)。 spec 增補(純加強,6 條 Requirement 原文未動,核心裁決保全): - R5 新增 harness 揭露 Scenario(揭露+不得跨界引用,不開 fake 白名單); tasks 新增 3.6 對應;proposal What Changes 同步一句;ledger total 29→30。 修 merge-evidence 紅燈(fix ci): - required merge evidence 失敗根因=D-17 ledger 漂移:merge origin/main 後 分支含 #422 更新的 cross-service-structured-log-baseline tasks.md(92/93) 但 ledger 仍記 66/71,reconciliation fail。同步 ledger 至 openspec list 機器真值(92/93、subject bfcc433)。 Verification: openspec validate change --strict PASS;--all --strict 70/70; test-ai-coding-metrics 13/0;ledger reconciliation PASS;git diff --check clean;tasks 30 = ledger 30。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sfoZB7CAZJUxm9AuUBpM8 --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
design gate 的 semantic contract 可執行化 +
pipeline.default雙路由分治(gate-infrastructure / reference-authority 專用 PR;產品碼零觸碰,依 fail-closed 憲法與產品 PR 分離)。semantic_contract.status→executable、implemented_case_ids= 11 required 全集;pipeline.default.production_routes→["#pipeline"](#conv讓給 feat(console): 新增轉檔歷史頁與功能證據閘 #345 轉檔歷史頁的 functional gate——解除兩道機器閘在同一路由上的互斥);route_inventory24 條、routes_without_approved_pixel_reference11 條(+#conv)。prepare自行導航;全程/api/**503 離線決定性)。$expectedRoutes23→24(+#pipeline),訊息文字同步。本 PR 樹上自測(本機實跑):
verify-design-system-reference.ps1/test-design-system-reference.ps1/test-design-system-change-scope.ps1全 passed。⚠ 合併後、產品 PR 合併前的窗口內,任何 product-path PR 會因 semantic cases 對準新 IA 而視覺閘紅——此為既有 fail-closed 方向(現狀 main 上 product PR 本就必紅於
status!=executable);產品 PR(UnifiedConsole 13 screens 像素移植,本地 26/26 pixel 0.00% + 143 cases 全綠)緊隨本 PR。Change Classification
AI Coding Governance
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
#pipeline.#convas a reference-only route when no approved visual reference is available.Tests