Skip to content

fix(noema): reject truncated-diff approvals - #2650

Open
seonghobae wants to merge 1 commit into
mainfrom
fix/noema-truncated-approval-adoption-20261014
Open

seonghobae wants to merge 1 commit into
mainfrom
fix/noema-truncated-approval-adoption-20261014

Conversation

@seonghobae

@seonghobae seonghobae commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Adopts only the independently reviewed three-file Noema patch (SHA256 891365c4ab2a44f9ef8504abe805798e5c80daac862bbcb46fa3775277f9eddb) on main acb8b34. Rejects truncated approve with NoemaModelOutputError; preserves complete approve, comment and request_changes and the formal App publisher. Nested workflow pin already shipped in PR2646 and is not changed. Retained independent review: 153 passed. Local adoption checks: 150 passed with two Bash-3 harness failures; both failed cases passed unchanged using Bash 5; new focused regression 15 passed. Missing actual Actions execution and formal App approval remain incomplete; no security/protection/runner/key changes.

Summary by CodeRabbit

  • 버그 수정
    • 검토에 필요한 변경 내용이 일부 누락된 경우 승인이 처리되지 않도록 했습니다. 이를 통해 불완전한 정보만으로 변경 사항이 승인되는 일을 방지합니다.
    • 변경 내용이 모두 제공된 경우에는 기존처럼 승인할 수 있습니다. 수정 요청과 의견 제출은 이번 변경의 영향을 받지 않습니다.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 74338e51-8f38-4506-95fe-9463161161f6
📥 Commits

Reviewing files that changed from the base of the PR and between acb8b34 and 923d96c.

📒 Files selected for processing: 3
  • scripts/ci/noema_review_gate.py
  • tests/test_noema_review_gate.py
  • tests/test_noema_truncated_approval.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

diff가 잘린 상태에서 approve 결정이 반환되면 call_llm이 이를 거부합니다. 회귀 테스트는 verdict 처리와 준비·게시 경로, HTTP 오류 분류를 확인합니다.

Changes: 잘린 diff 승인 처리

Layer / File(s) Summary
승인 거부 검사
scripts/ci/noema_review_gate.py
diff가 잘린 상태에서 approve 결정이 반환되면 NoemaModelOutputError를 발생시킵니다.
Verdict 처리 회귀 테스트
tests/test_noema_truncated_approval.py, tests/test_noema_review_gate.py
완전한 diff의 승인과 잘린 diff의 comment 및 request-changes 처리를 검증합니다. 승인 거부의 대소문자·공백 변형과 모델 출력 오류 분류도 확인합니다.
준비·게시 경로 회귀 테스트
tests/test_noema_truncated_approval.py
잘린 diff의 승인이 준비 단계에서 실패하고 envelope, GitHub 출력, 재시도 또는 review 게시를 만들지 않는지 확인합니다. 지원되는 verdict의 게시 결과와 HTTP 오류 분류도 검증합니다.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 923d9

No actionable merge-blocking issue is established; the change is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 10.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed PR 제목은 잘린 diff에 대한 승인을 거부하는 핵심 변경을 정확하고 간결하게 설명합니다.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cwl-noema-review cwl-noema-review 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.

Noema LLM review

The new guard rejects approvals based on truncated diffs without changing admission of complete-diff approvals or partial-context comments and change requests. Static analysis falsified the regression hypotheses below; the added tests cover rejection, publication boundaries, and error classification.

Reviewed changed lines

  • scripts/ci/noema_review_gate.py:1699 (RIGHT): The conjunction limits rejection to truncated approvals. Complete-diff approvals and other supported decisions continue through the existing validation path.
  • scripts/ci/noema_review_gate.py:1700 (RIGHT): Uses the model-output error class for an unacceptable verdict rather than treating it as transport-capacity failure.
  • tests/test_noema_review_gate.py:1452 (RIGHT): Updates the successful-approval fixture to use a complete diff, keeping the existing transport/configuration test compatible with the new admission policy.
  • tests/test_noema_truncated_approval.py:243 (RIGHT): The consumer regression checks that rejection leaves no publication envelope; surrounding assertions also check one model request, unchanged workflow output, and no review posts.
  • tests/test_noema_truncated_approval.py:269 (RIGHT): The prepare/publish regression checks the exact GitHub event for complete-diff approval, truncated comment, and truncated request_changes.

Adversarial validation

  • scripts/ci/noema_review_gate.py:1699 (RIGHT) falsified: An otherwise valid approval can still be admitted when the diff supplied to the reviewer was truncated. — Static evaluation makes the new condition true and immediately raises NoemaModelOutputError before subsequent verdict validation. The new consumer fixture additionally constructs an oversized diff with an omitted source file and asserts rejection without a publication envelope.
  • tests/test_noema_truncated_approval.py:269 (RIGHT) falsified: The guard also blocks complete-diff approvals or prevents actionable partial-context reviews from being published. — The condition is false for all three combinations, leaving their existing validation path unchanged. The parameterized consumer test exercises these combinations and asserts APPROVE, COMMENT, and REQUEST_CHANGES respectively, along with the exact head commit.
  • scripts/ci/noema_review_gate.py:1700 (RIGHT) falsified: A truncated approval is rejected as provider-capacity failure and consequently enters the transport retry path. — The added rejection explicitly raises NoemaModelOutputError rather than NoemaTransportError. The regression tests distinguish these exception classes, assert unchanged workflow output for the rejected approval, and separately retain transport classification checks for HTTP failures.
  • Residual risk: Validation was static: the supplied tests were inspected but not executed. Surrounding production-file context was only partially provided, so runtime integration remains unverified.

Findings

  • No blocking findings.
  • Result: APPROVE
  • Head SHA: 923d96cee78fe644d104acf2c9ca2e4e15ca99ba
  • Reviewer credential: noema-review-github-app-refresh
  • Actor: cwl-noema-review[bot]

@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 reviewed the current-head product diff. Coverage is a separate gate.

Changed files

  • scripts/ci/noema_review_gate.py — review and security gate shell path
  • tests/test_noema_review_gate.py — regression suite
  • tests/test_noema_truncated_approval.py — regression suite

Changed behavior

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: noema_review_gate.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: noema_review_gate.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test: test_noema_review_gate.py (2 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_noema_review_gate.py (2 files)"]
  R2 --> V2["targeted test run"]
Loading

Findings

No source-backed product finding is synthesized from the coverage gate. A coverage miss belongs in the status comment.

  • Head SHA: 923d96cee78fe644d104acf2c9ca2e4e15ca99ba
  • Workflow run: 38510545621
  • Workflow attempt: 1
  • Coverage gate: failure

Review outcome

Coverage is a gate, not the review. This body reviews the changed product files.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["CI script: noema_review_gate.py"]
  S1 --> I1["review and security gate shell path"]
  I1 --> R1["Review risk: CI script: noema_review_gate.py"]
  R1 --> V1["bash -n plus Strix self-test"]
  Evidence --> S2["Test: test_noema_review_gate.py (2 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_noema_review_gate.py (2 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

Coverage evidence did not pass, so approval is blocked. The formal pull-request review is the source-backed diff review, not this status comment.

This branch has not been deployed

No deployments
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