Repository navigation
Add CR-6 agent review, PR questions and review instructions (#325) - #422
Merged
Merged
Conversation
Main gains a local-only `code-review:agent` channel. A review or a question runs the installed Claude Code CLI under the person's own login on a snapshot of the pull request's diff that main reads itself through gh (GET only, repository by id, pull request, every files page, then the pull request again to prove the head and target held). The run is recorded before the CLI starts; the CLI is confined to `--safe-mode --restricted --tools Read` with no permission tool and an environment stripped of gh, GitHub, Modex and other credentials; the snapshot is removed when the run ends. Findings bind to CR-5 line anchors only where the named lines are in an included patch; otherwise they are shown as unverified. Runs are bound to the head they read, marked outdated when it moves, stopped explicitly, and read as unknown after a crash; nothing is retried or posted. Review instructions are one versioned text per Mac whose scope the popover states; each run records the version it used. Renderer: Review panel (C27), instructions popover (C28/C56), "Claude's review" in the overview with coverage, reply, findings and trail, "Add to review draft" for anchored findings, Ask about this pull request (C57), Add to chat (C54). Evidence: unit (code-review-agent.test.ts and friends), E2E over a synthetic claude and gh (code-review-agent.spec.ts), the opt-in native isolation test extended with the shipped argv. No authenticated live run is recorded; that and C82 stay open. See docs/reviews/2026-10-28-cr6-native-review.md. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code coverage overviewLanguages: TypeScript TypeScript / code-coverage-agent
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
This was referenced Oct 28, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CR-6 for #319, per #325: the native AI review and PR-question slice of Code Review, built on Phase 1's isolation proof.
What it does
code-review:agent, a local-only main channel (status,instructions,start,stop). A review or a question runs the installed Claude Code CLI under the person's own login on a snapshot of the PR's diff. Main reads everything itself throughgh(GET only): identity, the repository by id, the pull request, every files page, then the pull request again so the head and target are proven to have held across the reads. A moved head or target refuses the start and the pane offers Reload.--safe-mode --restricted --tools Read --strict-mcp-config --mcp-config {"mcpServers":{}} --disable-slash-commands --setting-sources "" --permission-mode dontAsk --permission-prompts none --no-session-persistence, no permission tool (a prompt that arrives anyway is refused and counted), and an environment withoutGH_*,GITHUB_*,MODEX_*,AWS_*, the other provider's keys, or anything named like a token or secret. The CLI's cwd is a 0700 snapshot directory holding only main's own files; it is removed when the run ends.review-agent/state.jsonbefore the CLI spawns; a crash leaves a record the next start marksunknown. Nothing is ever re-run or retried. One run per PR, two at once.jsonblock, bound to CR-5 line anchors only where every named line is in an included patch's head side, otherwise shown as unverified or without a location. Omitted files (binary, too large, over budget, over the file cap, no patch) are listed per run. A run shows "Outdated" once the PR's head or base differs. "Add to review draft" exists only for anchored findings at the current head and feeds CR-7's review draft; nothing reaches GitHub without CR-7's preview and submit.Mock evidence (no model, no network, synthetic
ghandclaude)pnpm test, apps/desktop): 2025 tests, 0 failed, 17 skipped (platform-gated). Newtest/code-review-agent.test.ts(15) plus extensions to the Claude backend, contract and drain tests.e2e/code-review-agent.spec.ts(5 passed) in real Electron with a syntheticclaudethat answers the probes, records each run's argv and environment, and plays fail / hang / scripted-reply modes: instructions scope and versioning across reload; Start as the only trigger, the exact confined argv withMODEX_HOME,GH_CONFIG_DIRandGH_TOKENunset, snapshot cleanup, failure shown, no second start after reload; scripted findings anchored and unverified, Add to review draft, head move refused then Outdated; question with Add to chat; Stop,busyfrom main, crash → unknown with nothing replayed.code-review-regressions.spec.tsnow proves opening the panel and popover starts nothing.MODEX_CR6_NATIVE=1, Claude Code 2.1.312 under asandbox-execguard against a scripted loopback provider): 6 passed, including a new case that runs the shippedREVIEW_CONFINEMENT_ARGSimported from the build. OnlyReadadvertised; injected Bash, Write, WebFetch, MCP, outside and symlink reads all denied; no write, hook or MCP marker.Live evidence
None. No authenticated Claude Code run against a real pull request was made. The open gate is one authorized smoke on a repository Val names, recording the argv used, the snapshot's file list, the reply, the bound findings and the absence of any GitHub write.
Docs
docs/design/code-review.md(new "CR-6 agent review and questions" section, inventory rows for C27/C28/C54/C56/C57/C59, open decision 7 note),docs/status.md,docs/reviews/2026-10-28-cr6-native-review.md.Checkpoint
fecdfcfb3dd9b5496798d562b6b6b65c7952dc38(signed) oncr6-review, cut frommainat6c9000f.🤖 Generated with Claude Code