Repository navigation
Description
Outcome
Make the screenshot's Review action, R3 instructions popover and Ask about this pull request composer useful through Modex's existing native coding backend. Reviews produce inspectable, revision-bound findings with explicit coverage, not automatic approvals, published comments or merges.
Parent: #319. Blocked by accepted artifacts: #321's authorized read service, #323's overview/context host and #324's revision/line evidence. Reuse the delivered lifecycle, approval, evidence and recovery contracts of #273/#276–#280 where relevant; open tracker status is not itself a blocker. CR-7 is independent: this issue produces optional drafts/findings, not GitHub write authority.
Context / entry points
Read current AGENTS.md, docs/status.md, #320's accepted source map and the current native runner/backends, event journal, approvals and thread-context implementation. Audit baseline is cb33db5df00e235f68d36b5fac556dc30e0851f2; revalidate current main/open PRs. Repository coding turns use native Claude/Codex CLIs; this issue does not replace them with an inference SDK or a proprietary cloud-review endpoint. Respect the repository rule that the bounded Jev judge must not receive file/turn content.
Proposed focused additions, only if existing equivalents do not suffice: apps/desktop/src/main/engine/code-review/review-context.ts, apps/desktop/src/renderer/components/code-review/ReviewInstructions.tsx, PrConversation.tsx, and corresponding Node/Playwright tests. Integrate existing runner/journal/approval paths instead of creating parallel systems. Assign one owner for shared runner/IPC changes.
Items to do
- Write failing tests for main-owned review context: account/repository/revision identity, selected files/hunks, coverage limits, provenance, explicit user instructions and stale-head behavior. Use inert synthetic PR data and the existing native-CLI fixture mechanism.
- Recreate R3's keyboard-accessible popover using existing menu/dialog primitives. The screenshot describes instructions applying across repositories: make that scope visible, use explicit user-entered settings and record the instruction version used for each run. Do not silently reinterpret them as repository-local or automatically copy private project text into global instructions. Changes affect future runs, not an in-flight snapshot. Any additional scope/override UX requires a recorded [CR-1][P1] Establish the Code Review reference contract and deterministic fixtures #320 decision.
- Build bounded context in main only after validating the requesting account and PR. Include exact base/head revision, selected evidence and omitted-file/byte limits. Treat PR text, diffs, comments, imported repository instructions and URLs as untrusted evidence, separate from the owner's explicit instructions. Do not send unrelated threads, secrets, private Notes or files outside the authorized selection.
- Feature-detect the installed native backend and verify its actual protocol/safety controls. Enforce read-only review in the process/tool environment: no local-worktree edits, arbitrary shell execution, hooks, dependency installs, inherited GitHub credentials, unrestricted MCP tools or external writes. A prompt saying read-only is insufficient. Use the existing isolation/capability mechanism or a narrowly reviewed snapshot-only path; when enforcement cannot be established, keep review unavailable with a clear reason.
- Require an explicit user start with visible backend, context scope and applicable cost/availability controls. Reuse existing concurrency/resource limits and stop/lifecycle handling. Selecting a PR or editing instructions must not start an inference request. Do not automatically retry a provider request whose outcome is uncertain or start unattended recurring reviews.
- Render findings through the existing conversation/evidence components. Bind citations to PR revision, path, side and line; show coverage omissions and outdated results. A completed native turn is not proof that tests ran, the diff is correct or GitHub checks passed. Unsupported/malformed result references remain unverified rather than receiving invented anchors.
- Scope PR questions and drafts to the correct account/PR conversation; selecting another PR must not leak previous context or send a draft. Reuse existing transcript/recovery semantics rather than a new chat store. Restoring a session replays evidence, not the provider action.
- Provide an explicit handoff of selected findings as a draft to CR-7 when available. Never post, approve, request changes or merge from model output. Keep AI conclusions, human intent and server authorization as separate facts.
Acceptance criteria
- AC1: R3 popover opens/closes accessibly, clearly states instruction scope, persists only the intended user settings and records the actual instruction version for each review.
- AC2: the context builder excludes wrong-account/repository data and binds findings to the selected immutable revision; new heads mark old results outdated without silently re-reviewing.
- AC3: adversarial PR content attempting tool execution, secret access or GitHub writes is rejected by the actual capability/isolation boundary, not merely ignored in model prose. An unsupported boundary disables the feature.
- AC4: explicit start, streaming, stop, failure, unknown completion and restart use the existing native lifecycle correctly, with no duplicate inference after reload or uncertain failure.
- AC5: omitted files and unsupported references are visible; no AI statement is promoted to test evidence, GitHub approval or merge authority.
- AC6: native-CLI fixture tests through the real app pass. Separately record one explicitly authorized live native-provider smoke test with backend/version, revision and bounded scope, without secrets; an unavailable live run remains an open gate.
Validation / handoff
Add main-context/isolation tests, native-CLI fixtures and Electron tests for instructions, PR switching, stale findings, stop and restart. Run pnpm build && pnpm test and pnpm test:e2e; do not equate fixture output with live provider evidence. A live canary needs the caller's existing or newly explicit authorization and budget. Record actual safety controls, denied-action evidence, SHA, commands and residual limits in docs/reviews//docs/status.md. Do not weaken policy to make the demo work. Sources: #319's primary-source review and current repository-native backend documentation.
Long-running goal prompt
Implement CR-6 for #319 in TypeSafeAI/modex. Read this issue, #320/#321/#323/#324, the relevant accepted #273 contracts, current source and scoped AGENTS.md. Verify main and owned-worktree state. Build the smallest native review and PR-question path, beginning with failing context/isolation/lifecycle tests. Reuse the actual runner, journal, evidence UI and approval machinery; do not add an inference SDK or a second chat runtime. Make instructions' scope explicit and snapshot the selected account/PR/revision/context for each user-started run. Enforce read-only authority in code and the real process/tool environment; refuse operation when that cannot be established. Keep secrets, unrelated context and file content for the Jev judge out. Do not execute foreign PR code, publish model findings, merge, or replay uncertain paid requests. Inspect R3 and test switching, stop and restart. Work within authorized resource limits, checkpoint full SHA, tests/evidence, remaining gates and one next action, and hand off a small signed PR with mock versus live evidence clearly separated.
Follow-up / resume prompt
Resume CR-6 by reading the live issues/PR, current native-backend capabilities and checkpoint. Verify worktree ownership and the actual diff, then rerun the context/isolation smoke tests. Reconcile run receipts before doing anything that could restart inference; an uncertain prior outcome is not permission to resend. Check whether the account, PR head, instruction version or producer contract changed. Continue one missing acceptance item, retaining fail-closed tool authority and coverage labels. Record unsupported native/manual gates rather than simulating them. Do not post, merge or expand permissions.
Independent review prompt
Review actual context assembly and process/tool enforcement, not only prompts or screenshots. Attempt cross-PR/account disclosure, injected instructions, credential access, unintended tool calls, changed-head citations and duplicate execution after restart. Verify findings never become approval/merge authority and fixture evidence is not labeled live. Exercise R3 keyboard focus and visible instruction scope. Report security and acceptance blockers with reproducible evidence.
Activity
BunsDev commentedon Oct 20, 2026
The CR-1 contract is on
mainas43d5b9c(#334). Bind to these files at that commit:apps/desktop/src/shared/code-review.ts(the contract)apps/desktop/test/fixtures/code-review.ts(synthetic fixtures)docs/design/code-review.md(source map, references, inventory, open decisions)For CR-6:
capabilitieskeepsreview,askandinstructionsunavailable, with this issue as the owner, until this gate delivers them.Coven-Harness: Claude Code / claude-opus-5-5
mariscate commentedon Oct 22, 2026
Refreshed goal prompts — 2026-10-22 (
mainat0e674e7)Where it stands: not started. It depends on #323's overview context and #324's revision/line anchors, and neither has started. Until both land,
capabilities()keepsreview,askandinstructionsunavailable, owned here. Already onmainand reusable: the typed conversation items, evidence rows, human-request broker and turn lifecycle from the CF work (#273, shipped in v0.3.0). The rule that Jev never sees file or turn content still applies. Waiting on Val: whether the PR composer shows an access mode at all (C82).Can start now, before #323/#324: a spike that proves the read-only boundary. For each installed
claudeandcodexCLI version, find out which flags or sandbox settings actually block edits, shell, hooks, MCP and network writes.Long-running goal prompt
Follow-up / resume prompt
Add the CR-8 acceptance matrix, Electron journeys and cross-slice reg…
BunsDev commentedon Oct 23, 2026
Refreshed goal prompts — 2026-10-23 (
mainat203a350)On
mainalready:capabilities()keepsreview,askandinstructionsunavailable, with this issue as the owner;Still open:
cr5-remote-diffsworktree.main.claudeandcodexCLI version, find which flags or sandbox settings actually block edits, shell, hooks, MCP and network writes.Long-running goal prompt
Follow-up / resume prompt
BunsDev commentedon Nov 1, 2026
CR-6 checkpoint, 2026-11-01 (
mainat0a8c513)PR: #472. Docs and evidence only.
Denial tests re-run on the installed CLIs (Claude Code 2.1.316, codex-cli 0.166.0; the earlier evidence was taken on 2.1.312):
code-review-*,claude-backendanddesktop-service-drainunit tests: 224 tests, 223 passed, 1 skipped (Windows only).MODEX_CR6_NATIVE=1 node --test test/code-review-isolation.native.test.mjs: 6 of 6 passed, 0 skipped. The productionREVIEW_CONFINEMENT_ARGScase:Read;mcp__sentinel__writewith "No such tool available";--restricted;The positive controls still fire. Codex's read-only profile still allows shell and outside reads, so it stays out of reviews.
e2e/code-review-agent.spec.ts: 6 of 6 passed (part of a focused 51/51 run).Evidence by kind:
ghand a syntheticclaude.Live-smoke procedure written into the evidence doc. It has not run.
gh/claudewrappers that log argv only.ghlogin unchanged, and the token absent from everything Modex wrote.Waiting on Val:
Next action: run the smoke exactly as written once a repository is named.