Open Code Review as a merge gate: 8 of 8 tests green, LLM review untested
We pinned Open Code Review v1.13.0 behind a fail-closed PR gate. Keyless: 8 of 8 tests and 8 of 8 lab CI jobs passed. Without a provider key the findings come from our own scanners.
By David Discua
Measured in the lab
- 8
- tests passed
- 4.5 s
- test time
- 8
- lab ci jobs green
- 327 s
- upstream test job
- hard-coded key on app.ts line 1 flagged, exit 1
- SQL string concat on app.ts line 3 flagged
- clean diff passes, exit 0
- missing OCR binary fails closed, exit 2
From reports/gate.json · run on October 14, 2026. Open Code Review v1.13.0 (pin 1672852136fc), npm @alibaba-group/open-code-review@1.13.0; keyless delegate path; live LLM review no-op without keys
How it is wired
01/03The agent finishes a branch and runs the review gate against main.
alibaba/open-code-review is a code review tool that pairs deterministic pipelines with an LLM agent and leaves line-level comments. We pinned v1.13.0 behind a gate that fails a PR on any finding at or above a chosen severity, and our keyless run on October 14, 2026 passed 8 of 8 tests with all 8 lab CI jobs green. Without a provider key the gate never asks OCR for findings, so the keyless verdict comes from three scanners we wrote and OCR serves as a preflight.
The catch
In keyless mode the gate calls ocr delegate preview --format json, checks that the output parses as JSON, and moves on. The findings come from three regular expressions in src/keyless.ts. One matches a secret literal assigned to a name like API_KEY, SECRET, TOKEN or PASSWORD. One matches an sk-live, sk-test or sk-proj key. One matches a SELECT, INSERT, UPDATE or DELETE built with string +. Null dereferences, XSS and thread-safety bugs, the rules OCR advertises, pass the keyless gate untouched.
OCR's own review runs only when a provider key such as GEMINI_API_KEY or ANTHROPIC_API_KEY is present. The gate then calls ocr review --format json --audience agent and normalizes the comments. Our CI has no provider secrets, so the live-review job no-ops and the report records it as pass_noop_without_keys. We have no measured LLM review in this lab, and the cost and latency of that path are yours to find out.
What we ran (keyless)
bun install --frozen-lockfile
bun run ensure:ocr
bun test
bun run review --base origin/main --head HEAD --fail-on high --keyless
From reports/gate.json, run on October 14, 2026:
| Check | Result |
|---|---|
bun test | 8 passed, 0 failed, 4.5 s |
| lint, typecheck, skills layout, upstream parity | pass |
secrets (gitleaks), bun audit | pass |
Node 24 compat (node dist/cli.js --help) | pass |
| live review | pass, no-op without keys |
| Lab CI | 8 of 8 jobs succeeded, each between 7 s and 13 s |
| Upstream CI at the pin | test job 327 s, Windows job 250 s, both succeeded |
The review tests build a throwaway git repo for each case. The bad fixture adds a hard-coded sk-live key on line 1 of app.ts and a SQL query built by concatenation on line 3. The gate reports hardcoded-secret on line 1 and sql-string-concat on line 3 and exits 1. A clean diff exits 0 with zero findings. Pointing OCR_BINARY at a path that does not exist exits 2, so a broken install blocks the merge.
The lab name refers to Scion, the source control system Anthropic describes in its post on redesigning source control. Scion is internal and not for general use, so this gate runs on plain git.
How it is wired
The gate runs on the agent's branch before merge. It takes git diff --unified=0 base...head, picks the keyless or LLM path, and writes review.json and review.md with file, line, severity and rule for each finding. Exit 0 lets the merge through. Exit 1 sends the agent back to fix the named lines. Exit 2 means the review could not run. The ocr-merge-gate skill under .claude/skills/ tells the agent to get exit 0 before it merges.
Minilab (open source)
Upstream is alibaba/open-code-review (47,166 stars, Apache-2.0, Go, as of October 14, 2026), pinned at 1672852136fc (v1.13.0). Clone the lab with submodules and run bun test. With a provider key set, drop --keyless from the review command to measure OCR's own findings on your diffs.
Run it yourself
SkilledDragonCorp/minilab-ocr-scion-review
Clone, install and run the report with no API keys. The numbers above are what that run writes.
bun install --frozen-lockfile && bun run ensure:ocr && bun testSkilledDragon is not affiliated with Alibaba Group or alibaba/open-code-review. Numbers are from our own keyless lab run; re-run the report before relying on them. Marks belong to their owners.
All labs