Skip to content

fix(console): coverage 抽屜標註 usd_stage_enumeration 自我參照(避免 100% 誤讀為 IFC lossless) - #220

Merged
monkey1sai merged 1 commit into
mainfrom
fix/conv-coverage-selfref-annotation
Jun 16, 2026
Merged

monkey1sai merged 1 commit into
mainfrom
fix/conv-coverage-selfref-annotation

Conversation

@monkey1sai

Copy link
Copy Markdown
Owner

背景

#218(conv-coverage-report, M2-a 唯讀 passthrough)部署後,多 agent 交叉對抗驗證(Opus xhigh 反方)發現一個真實語意 nuance:

coverage_ratio=100% 在 materialization_strategy=usd_stage_enumeration 下是自我參照——source_ifc_entity_count 與 mapped_count 同源於同一次 USD stage prim 枚舉(adapter 端 source_count = len(mapping_items) = mapped_count),數學上結構性恆等於 1.0。意義是「枚舉到的都對映上」,並非對 IFC 原始 entity 全量的 lossless 覆蓋率。

資料值為真、passthrough 也誠實(coordinator 零計算、轉檔失敗誠實回 null),但 UI 未對此本質加註,使用者可能把 100% 誤讀成「IFC 零遺漏」。

修正

web-viewer-sample/src/console/pages.tsx 的 CoverageDrawer:

  • materialization_strategy === "usd_stage_enumeration" 時,新增誠實 caveat note(紅色 ec-warn-note,data-testid=conv-coverage-selfref-note)。
  • 同策略下 source 欄標籤 source IFC entity → source(USD 枚舉 prim 數)。
  • 其他策略(如 sidecar)行為不變(caveat 不顯)。
  • 數值不變,仍為真;僅補語意誠實標註。真 IFC 分母為 M2-b follow-up。

驗證

  • npm run build 綠(129 modules)
  • npm run test 249 passed(含新增正向 caveat 測試 + sidecar 負向守門)
  • GitNexus detect_changes:risk=LOW、0 affected processes
  • 瀏覽器實證:新 build 餵真 demo_lib payload(coverage 100% / 543 / usd_stage_enumeration),caveat + 改寫標籤正確渲染

🤖 Generated with Claude Code

#218 conv-coverage-report 的 coverage_ratio=100% 在
materialization_strategy=usd_stage_enumeration 下是自我參照:source_ifc_entity_count
與 mapped_count 同源於同一次 USD stage prim 枚舉(adapter source_count=len(mapping_items)
=mapped_count),數學上結構性恆等於 1.0,意義是「枚舉到的都對映上」,非對 IFC 原始 entity
全量的 lossless 覆蓋率。

修正:該策略下 CoverageDrawer 新增誠實 caveat note,並將 source 欄標籤改為
「source(USD 枚舉 prim 數)」,避免 100% 被誤讀為 IFC 零遺漏。資料值不變(仍為真)。

驗證:vite build 綠、vitest 249 passed(含正向 caveat 測試 + sidecar 負向守門)、
GitNexus detect_changes risk=LOW。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 11:07
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

More reviews will be available in 55 minutes and 6 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a22bc814-f3c2-4a9f-94a1-b04a7390135f

📥 Commits

Reviewing files that changed from the base of the PR and between 81ba1df and e0b4752.

📒 Files selected for processing (2)
  • web-viewer-sample/src/console/ConversionSchedulingPage.test.tsx
  • web-viewer-sample/src/console/pages.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/conv-coverage-selfref-annotation

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 and usage tips.

@monkey1sai
monkey1sai merged commit ecd1f53 into main Jun 16, 2026
2 of 3 checks passed
@monkey1sai
monkey1sai deleted the fix/conv-coverage-selfref-annotation branch June 16, 2026 11:08

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.

Pull request overview

This PR adds a semantic caveat annotation to the CoverageDrawer component in the Edge Console's conversion scheduling page. When the materialization_strategy is usd_stage_enumeration, the coverage ratio is structurally always 1.0 (self-referential — source count and mapped count derive from the same USD stage prim enumeration). Without this annotation, users could misinterpret 100% coverage as meaning zero IFC entity loss, which is not what the metric represents in this strategy.

Changes:

  • Conditionally renders a warning note (ec-warn-note) when materialization_strategy === "usd_stage_enumeration", explaining the self-referential nature of the coverage ratio.
  • Relabels the source field from "source IFC entity" to "source(USD 枚舉 prim 數)" under the same condition.
  • Adds a positive test case verifying the caveat appears for usd_stage_enumeration, and a negative assertion in the existing sidecar test ensuring it does not appear for other strategies.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
web-viewer-sample/src/console/pages.tsx Adds usdEnumSelfRef flag and conditional caveat <p> + source label rewrite in CoverageDrawer
web-viewer-sample/src/console/ConversionSchedulingPage.test.tsx Adds positive test for usd_stage_enumeration caveat rendering and negative guard for sidecar strategy

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Agent Summary

Field Value
Status blocked
Risk high
PR 220
Head fix/conv-coverage-selfref-annotation / e0b4752b04c7e8b3b5c8552b5783ce2e6503117c
Base main / 81ba1df33a7fabdb3384b1f8189dfea55c456682

Blockers

  • [high] Behavior, workflow, code, or repo-boundary changes require an OpenSpec change id or documented exception.

Warnings

  • [medium] GitNexus detect changes did not pass: warning.

Validation Commands

  • npm run verify

Checks

  • passed web-viewer-sample verify (web-viewer-sample)

Human Review Notes

  • Optional AI adapter is not required by policy and was skipped.

monkey1sai added a commit that referenced this pull request Jun 18, 2026
#229)

把 13 個產品碼已 merge 進 main 的 active change 歸檔為不可變快照,
並將其 spec delta 併入 canonical specs。對齊 #197 收斂規約。

歸檔(archive/<merge-date>-<id>,git 偵測為 R100 純改名、零內容漂移):
  a1-m1-closeout(#213) a2-version-diff-selector(#207) conv-coverage-report(#218/#220)
  conv-prioritize-retry(#221) conv-watch-toggle(#225) conversion-artifact-id-sanitize(#206)
  governance-service-deploy(#215) minio-fileserver-source(#204) minio-watch-auto-intake(#210)
  raise-claude-md-line-budget(#199) sessions-terminate(#226) stop-all-single-pid-cleanup(#217)
  test-deploy-rebuild-workflow(#198)

canonical 併入:
- 9 個新 capability(純 ADDED → 新建 spec):a1-m1-closeout、a2-version-diff-selector、
  conv-coverage-report、conv-prioritize-retry、conversion-control、conversion-artifact-id-sanitize、
  minio-fileserver-source、minio-watch-auto-intake、test-deploy-rebuild-workflow。
- review-session-request-lifecycle:append sessions-terminate 的 ADDED requirement
  「Operator 結束 session controlled action」(5 scenario),既有 7 requirement 不動。
- one-click-deploy-hybrid:併入 governance-service-deploy 與 stop-all-single-pid-cleanup
  兩 delta,採「合併不取代」保全既有更豐富內容。依 deploy.ps1 現況權威
  (4a=governance/4b=conversion/4c=Kit/4d=docker)調和 Phase 4 編號,並修正
  canonical 其他兩處陳舊的舊 3 段編號(Mode C 入口 scenario、退出碼 stage 清單補 4d)。
- agent-doc-context-budget:raise-claude-md-line-budget 的 130 行預算已於 #199 併入,
  本次為 archive-only。

驗證:
- 結構檢查無殘留 ## ADDED/MODIFIED header、每 requirement 皆有 scenario、
  43 archive 檔全 R100、git diff --cached --check 無 whitespace。
- 雙 agent 對抗驗證:完整性 PASS(無規範遺失);一致性初判 FAIL 抓到 2 處
  Phase 4 編號矛盾,已修正後複驗。
- 本機 openspec CLI 不可用(結構驗證代替);openspec validate --strict 由 CI pr-review-agent 執行。


Claude-Session: https://claude.ai/code/session_01JEyNWhEmb3x8oinY3B2v9V

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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