Skip to content

feat(opencode): add empirical review-quality gate - #829

Open
seonghobae wants to merge 18 commits into
mainfrom
feat/opencode-review-quality-gate
Open

feat(opencode): add empirical review-quality gate#829
seonghobae wants to merge 18 commits into
mainfrom
feat/opencode-review-quality-gate

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

Establish an evidence-based quality program for the organization-wide OpenCode reviewer and prevent unearned claims that it has reached CodeRabbit parity.

Exact integration identity

  • protected base: 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba (main);
  • branch: feat/opencode-review-quality-gate;
  • exact current head: 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7;
  • state: Ready for review and mechanically mergeable;
  • predecessor-head checks, comments, and review attempts are historical only.

Empirical pilot and limitation

The committed pilot records directly observed lifecycle evidence from three organization pull requests where both reviewers left observable GitHub records:

  • ContextualWisdomLab/disksage#140;
  • ContextualWisdomLab/EgressWeave#62;
  • ContextualWisdomLab/inkspan#65.

This is a deliberately selected operational pilot, not a random sample and not a head-matched expert-gold benchmark. The benchmark therefore remains INSUFFICIENT_EVIDENCE until at least 50 head-matched cases and 50 expert-gold findings exist.

Observed lifecycle totals are encoded rather than asserted in prose: OpenCode produced eight completed, infrastructure-only reviews with zero source findings and five duplicate reviews; CodeRabbit produced three completed reviews with eight actionable source comments, with one directly observed rate-limit event. These values measure lifecycle yield and observed availability only. They do not establish precision, recall, or CodeRabbit superiority on identical heads.

Implemented quality contract

  • standard-library-only benchmark scorer;
  • fail-closed exact-field validation at benchmark, policy, case, gold-finding, reviewer, and reviewer-finding layers;
  • immutable exact base/head SHA validation for head-matched evidence;
  • reviewer-specific reviewed-head binding;
  • case-fold duplicate reviewer rejection;
  • required candidate/reference presence on every head-matched case;
  • source-backed true-positive contract;
  • lifecycle availability, infrastructure-only, duplicate, actionable-yield, source-anchor, fix-direction, and regression-direction metrics;
  • expert-gold precision, recall, F1, critical/high recall, and Wilson 95% intervals;
  • five-percentage-point non-inferiority gate;
  • deterministic atomic JSON and Markdown reports;
  • exact-head Python 3.14 quality workflow with hash-verified dependencies;
  • production statement and branch coverage 100%;
  • public production callable docstring coverage 100%;
  • APA 7th doctoring, implementation plan, design record, and changelog traceability.

Exact-current-head verification

The authoritative OpenCode Review Quality CI run 31252748759 checked out exact head 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7 and completed successfully:

  • 54 passed;
  • scorer statements: 303/303;
  • scorer branches: 118/118;
  • production coverage: 100%;
  • compilation and clean-tree checks: success;
  • pilot output: INSUFFICIENT_EVIDENCE as required.

The exact-head Strix Changed Path Quality CI run 31252748779 succeeded. The latest exact-head CodeQL, Python Security, SAST Semgrep, Security Scan, Secret Scan, OSV, Scorecard, and SBOM workflows also completed successfully.

CodeRabbit commit status is successful, but the latest full-review attempt was rate-limited and is not treated as a completed formal review or independent approval. Formal review submissions and inline review threads are currently absent.

Production architecture consequence

The current central dispatch can transform coverage-evidence failure into a synthetic source-level REQUEST_CHANGES finding before semantic review publication. This PR intentionally does not edit that actively contested workflow. The required follow-up architecture remains:

  1. keep review_verdict independent from merge_readiness;
  2. allow failed coverage/check evidence to block approval and merge readiness;
  3. never present infrastructure failure as a source-code defect;
  4. continue semantic review whenever bounded exact-head source evidence is available;
  5. add detector–verifier orchestration in shadow mode;
  6. freeze a head-matched, independently adjudicated expert-gold corpus before any parity claim.

Safety and merge gate

  • no review credential, secret, provider key, branch protection, or production publication path changed;
  • no COPILOT_GITHUB_TOKEN use;
  • exact-head checkout keeps persisted credentials disabled;
  • no production dispatch edit while other branches own that file;
  • no parity claim until the frozen statistical gate is eligible and passing.

Merge only after a fresh exact-current-head automated review completes, a qualifying independent non-author formal approval exists, every required check and branch-protection rule passes, and no valid unresolved finding remains. Rate-limited, status-only, author-only, absent, queued, cancelled, stale-head, or predecessor evidence is not acceptance.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 26 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 178aff03-3c38-43e5-9946-daa9ca778666

📥 Commits

Reviewing files that changed from the base of the PR and between 6eb06cd and 523e883.

📒 Files selected for processing (9)
  • .github/workflows/opencode-review-quality-ci.yml
  • CHANGELOG.md
  • benchmarks/opencode_review/pilot_baseline_v1.json
  • docs/doctoring/opencode-review-quality-evaluation.md
  • docs/superpowers/plans/2026-08-08-opencode-review-quality.md
  • docs/superpowers/specs/2026-08-08-opencode-review-quality.md
  • scripts/ci/opencode_review_quality_score.py
  • tests/test_opencode_review_quality_evidence_contract.py
  • tests/test_opencode_review_quality_score.py

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

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Exact-head RED→GREEN repair for current Draft head 30c9529197c6a2932d54c7ca1235e84aff6f2ef4 on protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba. Before any write, refetch the PR head/base and the target files. Observed blobs: tests/test_opencode_review_quality_evidence_contract.py = e4940d520ea045d0949f21d05427d1662283afd5; scripts/ci/opencode_review_quality_score.py = e21e89b5df0f4aec01f2633fe8627e76bcf672a6. If any identity moved, do not write.

OpenCode Review Quality CI run 31249327392, job 93083060907, on this exact head has 44 passed, 9 failed. The failures expose two valid contract gaps; do not weaken either one:

  1. The canonical benchmark() fixture in tests/test_opencode_review_quality_evidence_contract.py creates head-matched cases but its reviewer() objects omit required reviewed_head_sha. Populate each candidate/reference reviewer fixture with the exact enclosing case head_sha, so every negative regression starts from a valid exact-head benchmark and reaches the condition it is intended to test.
  2. The production scorer promises strict schema validation, and the RED tests add unknown fields at benchmark, parity-policy, case, gold-finding, reviewer, and reviewer-finding layers. The current validator reads known fields but does not reject extras. Add a small fail-closed exact-field helper and apply it at every governed schema layer before semantic validation. Preserve stable bounded errors containing unknown fields; do not silently ignore extension keys.

Also preserve and make GREEN the existing contracts for case-fold duplicate reviewer names, required presence of both candidate/reference reviewers on each exact-head case, and source_backed=False never counting as a true positive. Do not relax the required 40-character lowercase reviewed_head_sha, head equality, parity eligibility thresholds, Wilson intervals, critical/high recall floor, or INSUFFICIENT_EVIDENCE behavior.

Run the two focused quality modules first, then exact production statement+branch coverage 100%, public docstring coverage 100%, compile/diff hygiene, full central tests, and normal Strix/security/supply-chain checks. Update doctoring/changelog only if the governing schema contract materially changes. Commit normally to the existing branch only if the pre-write head/blobs remain unchanged. Keep Draft; do not modify central dispatch/reviewer credentials/model policy, approve, merge, or introduce temporary/write-capable workflows.

@seonghobae
seonghobae marked this pull request as ready for review August 8, 2026 11:08
@seonghobae
seonghobae enabled auto-merge (squash) August 8, 2026 11:08

Copy link
Copy Markdown
Contributor Author

Exact-current-head review request for 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7 on protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

The complete exact-head quality/security surface is terminal-success, including OpenCode Review Quality CI and Strix Changed Path Quality CI. This PR is now Ready and auto-merge is armed only behind repository policy. Please perform read-only current-head review; do not modify the branch, synthesize approval, weaken tests, or merge.

@coderabbitai review
@opencode-agent review
@cwl-noema-review review
@strix review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@seonghobae I will perform a read-only review of the current head. I will not modify the branch, approve, weaken tests, or merge.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review

Review-only request for exact current head 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7 against protected base 6eb06cdd08c79a06f7b390069d4ffa49e2eb7dba.

Inspect the complete nine-file diff, scorer semantics, strict evidence schema, exact-head binding, true-positive contract, CI workflow, APA 7 doctoring, and claim boundaries. Distinguish substantive findings from lifecycle-pilot limitations and from infrastructure-only states. Submit any formal review only on this exact head. Do not modify the branch, update the base, approve on behalf of an author, merge, release, weaken tests, alter reviewer credentials/model policy, or reuse predecessor-head evidence.

@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 could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review-quality-ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review-quality-ci.yml"]
  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 (3 files)"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs (3 files)"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script: opencode_review_quality_score.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: opencode_review_quality_score.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (2 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (2 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7
  • Workflow run: 31255778426
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: opencode-review-quality-ci.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: opencode-review-quality-ci.yml"]
  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 (3 files)"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs (3 files)"]
  R3 --> V3["docs review"]
  Evidence --> S4["CI script: opencode_review_quality_score.py"]
  S4 --> I4["review and security gate shell path"]
  I4 --> R4["Review risk: CI script: opencode_review_quality_score.py"]
  R4 --> V4["bash -n plus Strix self-test"]
  Evidence --> S5["Test (2 files)"]
  S5 --> I5["regression suite"]
  I5 --> R5["Review risk: Test (2 files)"]
  R5 --> V5["targeted test run"]
Loading

@opencode-agent
opencode-agent Bot disabled auto-merge August 8, 2026 14:00
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