Skip to content

fix(ci): restore OpenCode coverage honesty and mermaid surfaces - #1363

Merged
seonghobae merged 48 commits into
mainfrom
feat/opencode-review-honesty-surfaces
Aug 28, 2026
Merged

fix(ci): restore OpenCode coverage honesty and mermaid surfaces#1363
seonghobae merged 48 commits into
mainfrom
feat/opencode-review-honesty-surfaces

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Stacked on main after #1360 squash 17052a7; COVERAGE_BLOCKED after fallback COMMENT; no invented mermaid edges; no fake opencode-review.yml:1; no generic-only Changed file (N files); does not touch noema-review.yml (PM owns feat/noema-orchestrator-free-zdr); not NIM-2h.

Honesty slice only

Summary by CodeRabbit

  • 개선 사항

    • OpenCode 리뷰가 현재 PR 커밋과 정확한 실행 결과를 기준으로 검증됩니다.
    • 커버리지 기준 미달·실패 시 COVERAGE_BLOCKED 상태를 명확히 표시합니다.
    • 리뷰 요약과 Mermaid 다이어그램이 실제 변경 파일과 코드 구조를 더 정확히 반영합니다.
    • 모델 리뷰를 사용할 수 없는 경우에도 변경 파일 기반의 대체 리뷰를 제공합니다.
  • 문서

    • OpenCode 리뷰 및 커버리지 정책 변경 사항을 변경 로그와 가이드에 반영했습니다.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 10 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a350f50b-413e-47e7-a610-8f45c2ff6aa1

📥 Commits

Reviewing files that changed from the base of the PR and between 8d7d137 and c5772d8.

📒 Files selected for processing (2)
  • scripts/ci/opencode_review_surfaces.py
  • tests/test_opencode_review_surfaces.py
📝 Walkthrough

Walkthrough

OpenCode 리뷰를 공식 리뷰와 게이트 상태 댓글로 분리했습니다. 현재 HEAD와 workflow run ID에 연결된 커버리지를 검증합니다. 커버리지 실패 시 변경 파일 폴백 리뷰와 COVERAGE_BLOCKED 상태를 게시합니다. 공식 리뷰 영수증과 verdict를 별도로 검증합니다.

Changes

OpenCode 리뷰 무결성

Layer / File(s) Summary
리뷰 표면과 Mermaid 생성
scripts/ci/opencode_review_surfaces.py, scripts/ci/opencode_review_comment_helpers.sh, scripts/ci/opencode_review_prompt_template.md, tests/test_opencode_review_surfaces.py, tests/test_opencode_review_comment_helpers.py
변경 파일 표면 분류, Rust API 추출, Mermaid 생성, 공식 리뷰와 상태 댓글 분리를 구현했습니다. 변경되지 않은 워크플로 앵커는 Review process로 변환합니다.
커버리지 증거와 게이트 게시
scripts/ci/opencode_coverage_identity.py, .github/workflows/opencode-review-dispatch.yml, tests/test_opencode_coverage_identity.py, tests/test_opencode_coverage_publication_regression.py, tests/test_opencode_agent_contract.py, scripts/ci/test_strix_quick_gate.sh, docs/doctoring/opencode-review-surfaces-originweave-47.md, CHANGELOG.md
현재 HEAD, workflow 저장소, PR 번호 및 run ID에 연결된 canonical coverage-evidence 결과를 검증합니다. 커버리지 실패 시 모델 흐름을 유지하고 폴백 리뷰와 COVERAGE_BLOCKED 상태를 게시합니다.
현재 HEAD 리뷰 영수증과 필수 verdict
scripts/ci/opencode_review_receipt_gate.py, scripts/ci/opencode_dispatch_status.py, .github/workflows/opencode-review.yml, tests/test_opencode_review_receipt_gate.py, tests/test_opencode_required_verdict_regression.py, tests/test_pr_review_autofix_nvidia_nim_contract.py
현재 HEAD, 공식 작성자, 리뷰 상태, 리뷰 ID, 본문 형식을 검증합니다. 현재 HEAD의 APPROVED 또는 CHANGES_REQUESTED verdict만 필수 체크에 사용합니다.
리뷰 계약 검증
ci-review-prompt.md, scripts/ci/opencode_review_prompt_template.md, tests/test_opencode_agent_contract.py, tests/test_opencode_required_verdict_regression.py
정식 리뷰가 변경 파일과 동작을 설명하도록 요구합니다. 커버리지 증거를 별도 게이트로 처리합니다. 워크플로의 jq verdict 필터를 직접 실행해 검증합니다.

Estimated code review effort: 5 (Critical) | ~100 minutes

Merge Risk: 🔵 Low · up to 8d7d1

The change makes coverage failures visibly block approval and improves review file and graph output, but malformed or traversal-shaped paths can still cause incorrect authenticated lookups or interrupt review rendering, while the initial status may show coverage as unknown. The impact is bounded to CI/review correctness and security hardening, so merge is reasonable with explicit owner follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant CoverageEvidence
  participant CoverageIdentity
  participant ReviewDispatch
  participant GitHub
  participant ReceiptGate
  CoverageEvidence->>CoverageIdentity: 현재 HEAD와 run ID의 coverage 조회
  CoverageIdentity-->>ReviewDispatch: 검증된 coverage 결과 전달
  ReviewDispatch->>GitHub: 공식 리뷰 또는 폴백 COMMENT 게시
  ReviewDispatch->>GitHub: 게이트 상태 댓글에 결과 기록
  GitHub-->>ReceiptGate: 현재 HEAD의 PR 리뷰 목록 반환
  ReceiptGate->>ReceiptGate: 공식 OpenCode 영수증 검증
  ReceiptGate-->>GitHub: 필수 체크 성공 또는 실패 반환
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 OpenCode 커버리지 정직성 복원과 Mermaid 표면 개선이라는 주요 변경 사항을 정확하고 간결하게 요약합니다.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 160 functions across 13 files. (3 skipped: …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 160 functions across 13 files. (3 skipped: 2 unsupported, 1 too large.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/opencode-review-honesty-surfaces

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.

Stacked on main after #1360 squash 17052a7. Coverage-evidence failure publishes a COMMENT product-file review then sets the status comment to COVERAGE_BLOCKED. Mermaid labels crates/packages instead of generic Changed file (N files) and does not invent class edges. Findings say Review process instead of opencode-review.yml:1 unless that file is in the diff. Does not touch noema-review.yml and is not NIM-2h.
@seonghobae
seonghobae force-pushed the feat/opencode-review-honesty-surfaces branch from 16eec2b to 848d796 Compare August 27, 2026 12:43
@seonghobae seonghobae changed the title fix(ci): restore OpenCode coverage honesty and review surfaces fix(ci): restore OpenCode coverage honesty and mermaid surfaces Aug 27, 2026
Additive on 848d796. Exact #1052abf47ce blobs for coverage-identity and receipt-gate, plus the smallest dispatch invocations so they run. Honesty surfaces stay. PRT stub stays 7f1ad6d. Does not touch noema-review.yml.
Additive on 7c9e472. Pair REVIEW_DISPATCH_BLOB_SHA with live dispatch blob e106d01. Keep COVERAGE_BLOCKED after COMMENT fallback instead of a fake REQUEST_CHANGES finished gate. Allow the coverage-fallback insert in the model-pool regex. Does not touch noema-review.yml or dispatch honesty hunks.
Keep COMMENT fallback then update_review_overview "COVERAGE_BLOCKED".
Restore ## OpenCode Review Overview on the status builder, restore
quoted mermaid honesty phrases in helpers, and retarget the leftover
REQUEST_CHANGES-as-finished-gate path-policy string to the honesty
wording. Pair REVIEW_DISPATCH_BLOB_SHA with the updated dispatch blob.

Copy link
Copy Markdown
Contributor Author

Live regression repair added on exact head 3705a5d3f3c95958b1a954fd4ec142162aa456a3.

  • Reproduction: PR fix(security): fail closed on unavailable dependency review #897 head 1f834b4d0f86abb407fa286b1f7b857889d8ec33 had opencode-review job 98517399091 conclude success after only echoing that approval was separate, while the Reviews API had no current-head formal OpenCode verdict.
  • Root cause: protected main's .github/workflows/opencode-review.yml had lost the fix(review): fail closed when required check is not a verdict #1002 fail-closed Reviews API step and pull-requests: read permission.
  • RED: tests/test_opencode_required_verdict_regression.py produced 7 expected failures against the echo-only workflow and missing decision API.
  • GREEN: focused workflow/review contracts: 121 passed; decision-module coverage: 94 passed at 100% statements/branches; full central suite: 1,629 passed, 1 skipped, 16 subtests; git diff --check, compile, and docstring checks passed.

The source PR remains draft while fresh hosted evidence is non-terminal. Operational acceptance still requires protected-main integration and a fresh current-head canary where opencode-review is non-passing until Reviews API contains an exact-head APPROVED or CHANGES_REQUESTED verdict.

@seonghobae
seonghobae marked this pull request as ready for review August 27, 2026 18:10
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae marked this pull request as ready for review August 27, 2026 22:00
devin-ai-integration[bot]

This comment was marked as resolved.

@opencode-agent opencode-agent Bot 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

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head b4919d36f63e835b2503d9d8c1e882bb755b4c6a.

  • Head SHA: b4919d36f63e835b2503d9d8c1e882bb755b4c6a

  • Workflow run: 33122874846

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (2 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (2 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file (2 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (2 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: opencode-review-surfaces-originweave-47.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: opencode-review-surfaces-originweave-47.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script (7 files)"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script (7 files)"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (8 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (8 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: b4919d36f63e835b2503d9d8c1e882bb755b4c6a
  • Workflow run: 33122874846
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head b4919d36f63e835b2503d9d8c1e882bb755b4c6a.

  • Head SHA: b4919d36f63e835b2503d9d8c1e882bb755b4c6a

  • Workflow run: 33122874846

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow (2 files)"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow (2 files)"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file (2 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (2 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs: opencode-review-surfaces-originweave-47.md"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs: opencode-review-surfaces-originweave-47.md"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script (7 files)"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script (7 files)"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (8 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (8 files)"]
  R5 --> V5["targeted test run"]
Loading

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 2 new potential issues.

Devin Review

Comment thread scripts/ci/opencode_review_receipt_gate.py
Comment thread scripts/ci/opencode_review_surfaces.py
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.

1 participant