Skip to content

fix: plans×code 修復輪 Wave B(合規 code 修+E2E 證據) - #322

Merged
monkey1sai merged 12 commits into
mainfrom
fix/remediation-wave-b
Jul 10, 2026
Merged

monkey1sai merged 12 commits into
mainfrom
fix/remediation-wave-b

Conversation

@monkey1sai

Copy link
Copy Markdown
Owner

摘要

依 spec R1–R10(PR #321)執行 Wave B 十項合規 code 修。凍結檔改動僅 R3/R6 已登記例外(app.ts 單行 mount+governance app.py export fallback)。

  • B1 typecheck 納入 verify(CI viewer job 走 verify 自動生效)+修既有 TS6133(F11)
  • B2 A1 local_fs 測試資料標記:TEST_DATA_PROJECT_IDS → GET /api/dev/test-data-projects(routes/devMeta 加性慣例首例)+前端 badge(R8)
  • B3 GovernanceOverlay 對齊權威 A1–A10(R9):A4/A8 asbuilt 撞名除役、碰撞歸 A3 clash(p1)、A4 引 data.ts 單一來源
  • B4 NAV 分組改依互動規格 A.1.1 群組欄(R4)
  • B5 願景 App 卡 phase 顯示消歧義(A6「規劃序 P2」)
  • B6 F4 實測誤報(Python sqlite3 connect 預設 timeout=5.0=busy_timeout 5000)→ 改留回歸守門測試
  • B7 useConversionData 同步防重入(F13,共享 in-flight promise)
  • B8 operator 頁 raw fetch 統一 coordinatorUrl base(W4;保留狀態碼原樣顯示語意,較原 plan 更小的正確修法)
  • B9 routing 支援 app/ 前綴 deep-link(F8-route)
  • B10 rule-run 匯出 cache miss 由 DB 重建,重啟後 409→200(F3)

Frontend Verification

Label Evidence
Frontend route branch 隔離 stack http://127.0.0.1:8005/ui(GOV_PORT=49103/PORT=8005/CONSOLE_DIST_DIR=dist-ui;不碰部署區 :8004):#home/#a1/#apps/#minio
Main button(s) tested a1-localfs-select(選項含測試資料 badge,DOM 佐證);NAV 四組重排渲染;A6 卡 phase 文案;互動行為由 569 條 unit tests(50 檔)覆蓋(含 overlay 7 條、防重入、routing 12 條)
Fixture used 主 checkout storage/270(真實三層 IFC fixtures,local_fs tree 經 branch governance :49103 proxy)+TEST_DATA_PROJECT_IDS=270,889,990,271
Visible success state 左欄新分組(核心治理含 3D/GPU/A6–A10;OMNIVERSE RUNTIME 含 SS/KG/MD;落地端控制台含 RT);A1 下拉 option「〔測試資料〕270 · 機電 · ver 000001.ifc」;A6 卡「規劃序 P2」與 ProvTag「願景 · Phase 4」並列不再矛盾
E2E command headless Chrome --screenshot/--dump-dom --virtual-time-budget=7000 對 branch stack;npm run verify(含新 typecheck);npx vitest run=569 passed
Screenshot / trace artifacts/e2e/2026-07-10-wave-b/{home,a1,apps,minio}.png+a1-dom-evidence.txt(DOM 節錄)
Known gaps GovernanceOverlay 視覺未取 live 3D 截圖(需 Kit WebRTC session,branch stack 未起 Kit;由 GovernanceOverlay.test 7 條+windowParentMessage 78 條 unit 覆蓋);.env.example 註記被工作區 .env* 保護規則擋下,TEST_DATA_PROJECT_IDS 說明見 config.ts 註解與本 PR body

Deploy Path Verification

Label Evidence
Affects runtime / docker / Kit / viewer / ports / env? governance-service:僅 export_rule_run cache-miss 行為(409→200,F3 例外已登記手冊 §1.1);coordinator:新增 optional env TEST_DATA_PROJECT_IDS(預設空=不標)+唯讀 GET 端點;無 docker/Kit/ports 變更
Canonical deploy path updated? no(deploy.ps1/compose 未動;kit-manager-api golden path 屬 Wave C)
Deploy dry-run command 未執行——本 PR 無部署腳本變更;runtime 面由 branch 隔離 stack 實跑驗證(:8005/:49103)
Verify command governance host pytest:115 passed, 1 skipped;coordinator npx vitest run:604+4 passed;viewer npx tsc --noEmit+npx vitest run:569 passed(50 檔);root contracts:85 passed

Requirement source

docs/superpowers/specs/2026-07-10-plans-code-remediation-design.md(R3/R4/R6/R8/R9+F 系列);exception ledger=手冊 §1.1(PR #321 補登)。

🤖 Generated with Claude Code

https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf

monkey1sai and others added 11 commits July 10, 2026 15:20
…例(R8)

- TEST_DATA_PROJECT_IDS csv env → GET /api/dev/test-data-projects(唯讀)
- A1 local_fs 下拉命中清單者加〔測試資料〕;MinIO 不標(真實資料監控)
- app.ts 僅 import+單行 mount(手冊 §1.13 加性慣例)
- .env.example 註記被工作區權限規則保護未寫入,key 說明見 config.ts 註解與 PR body

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf
- 已接能力歸 A1 管線/M4 連動基建;A4 條目改權威語意搜尋(title/prov 引 data.ts 單一來源)
- 碰撞條目改 A3 clash(未開工·ifcclash 已選型,p1);未列權威項不掛編號
- feature panel 顯示文字 A3→A1/A8→A1;gov-a8-*、gov-run-rulecheck testid 契約保留

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf
viewer/gpu/a6-a10→核心治理;sessions/instances/minio→OMNIVERSE RUNTIME;runtime→落地端控制台

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf
比照 sibling useConversionActions 的 race 解法;用 in-flight 共享而非 boolean 丟棄,
重入呼叫者拿同一份證據結果,不產生假 {jobsOk:false} 錯誤

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf
…173 分離部署斷裂)

保留「HTTP 狀態碼原樣顯示」誠實語意(不改走會 throw 的 jsonGet——比原 plan 更小的正確修法);
7 個 fetch 站點全套 coordinatorUrl;testid 與輸出格式零變

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf
…tion 已登記手冊 §1.1)

僅 succeeded run 重建;ifc_type/ifc_name 未持久化→空值誠實留白;查無 404、未完成 409

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9C6aJGUJR37PgWSBPBNVf
Copilot AI review requested due to automatic review settings July 10, 2026 07:58
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@monkey1sai, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e0eb9133-f118-42de-9ae9-49a73a07a4bf

📥 Commits

Reviewing files that changed from the base of the PR and between fcbd1f0 and 4d57bd7.

⛔ Files ignored due to path filters (4)
  • artifacts/e2e/2026-07-10-wave-b/a1.png is excluded by !**/*.png
  • artifacts/e2e/2026-07-10-wave-b/apps.png is excluded by !**/*.png
  • artifacts/e2e/2026-07-10-wave-b/home.png is excluded by !**/*.png
  • artifacts/e2e/2026-07-10-wave-b/minio.png is excluded by !**/*.png
📒 Files selected for processing (24)
  • artifacts/e2e/2026-07-10-wave-b/a1-dom-evidence.txt
  • bim-review-coordinator/src/app.ts
  • bim-review-coordinator/src/config.ts
  • bim-review-coordinator/src/routes/devMeta.ts
  • bim-review-coordinator/tests/dev-meta.test.ts
  • bim-review-coordinator/tests/unit_kitpool.test.ts
  • docs/superpowers/specs/2026-07-10-plans-code-remediation-design.md
  • governance-service/app.py
  • governance-service/tests/test_db_concurrency.py
  • governance-service/tests/test_export_fallback.py
  • web-viewer-sample/package.json
  • web-viewer-sample/src/console/GovernanceOverlay.test.tsx
  • web-viewer-sample/src/console/GovernanceOverlay.tsx
  • web-viewer-sample/src/console/KitConsolePage.tsx
  • web-viewer-sample/src/console/RealIfcConsolePage.tsx
  • web-viewer-sample/src/console/console.test.tsx
  • web-viewer-sample/src/console/coordinatorClient.ts
  • web-viewer-sample/src/console/data.ts
  • web-viewer-sample/src/console/modelData/useConversionData.test.ts
  • web-viewer-sample/src/console/modelData/useConversionData.ts
  • web-viewer-sample/src/console/pages.tsx
  • web-viewer-sample/src/console/routing.test.ts
  • web-viewer-sample/src/console/routing.ts
  • web-viewer-sample/src/console/windowParentMessage.dom.test.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remediation-wave-b

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@monkey1sai
monkey1sai merged commit b590c21 into main Jul 10, 2026
13 checks passed
@monkey1sai
monkey1sai deleted the fix/remediation-wave-b branch July 10, 2026 08:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3596f01dae

ℹ️ 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".

// R8(2026-07-10):local_fs 測試 fixtures 專案清單(如 270,889,990,271),由部署區 .env 注入;
// default 空=不標。前端據 GET /api/dev/test-data-projects 渲染「測試資料」badge——
// 編號不進程式碼(D-05),誠實標記由後端 config 驅動(鐵律 #3)。
testDataProjectIds: string[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the new config field to test fixtures

Adding testDataProjectIds as a required CoordinatorConfig property leaves existing full config literals incomplete; I ran npm run build in bim-review-coordinator and tsc fails with TS2741 on tests/unit_kitpool.test.ts because defaultConfig is missing this field. The coordinator verify gate stays red until those fixtures include the new value (for example an empty list) or the field is made optional/defaulted at the type boundary.

Useful? React with 👍 / 👎.

else setMwErr(`${t("未連線 coordinator /api/external/minio-watch/status:", "Not connected to coordinator /api/external/minio-watch/status: ")}${String(mwRes.reason)}`);
setBusy(false);
return { jobsOk, mwOk };
if (loadInFlightRef.current) return loadInFlightRef.current;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Force post-action refreshes to fetch fresh state

This shares any currently running load() request, not just duplicate calls from the same event loop. In the MD conversion pane the row action buttons remain usable while a manual Refresh is in progress, so if an operator starts Refresh and then confirms prioritize/retry/watch-toggle before that GET finishes, runAction awaits the pre-POST request, can see jobsOk=true, close the dialog, and leave the queue/watcher evidence at the state from before the mutation. Please let post-mutation refreshes bypass the in-flight promise or limit dedupe to true synchronous duplicate invocations.

Useful? React with 👍 / 👎.

Comment on lines +9 to +10
app.get("/api/dev/test-data-projects", (_request, response) => {
response.json({ projects: config.testDataProjectIds });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate the new dev metadata route in non-demo deployments

When ENABLE_DEV_ROUTES=false is used for production/non-demo coordinators, this new /api/dev/test-data-projects endpoint still returns the configured local fixture project IDs because it bypasses the existing /api/dev/* dev-route gate in app.ts. The A1 page already degrades safely when this request fails, so this route should return the same 404 as the other gated dev fixture endpoints instead of exposing test-data metadata in non-demo deployments.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants