Skip to content

feat(autoreview): add grok review engine - #15

Open
ci wants to merge 6 commits into
mainfrom
feat/autoreview-grok-engine
Open

feat(autoreview): add grok review engine#15
ci wants to merge 6 commits into
mainfrom
feat/autoreview-grok-engine

Conversation

@ci

@ci ci commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Problem

The autoreview helper had no Grok engine, so --reviewers codex,grok panels were not possible. Grok Build has a headless mode but a few sharp edges: its plan mode and an empty or unknown --tools allowlist still allow writes, MCP meta-tools survive the built-in allowlist, it has no ephemeral session mode, and its JSON envelope reports a stopReason that can mark partial output.

Changes

  • scripts/autoreview: new grok engine (grok --prompt-file --output-format json --json-schema), pinned to grok-4.6, --effort mapped from --thinking (low-xhigh), prompt passed through a 0600 temp file.
  • Read-only gating: --tools read_file,grep,list_dir (+ web tools), --no-subagents, --disallowed-tools search_tool,use_tool; --no-tools is rejected for grok since there is no reliable tool-off switch.
  • Structured output taken from structuredOutput; runs that stop with anything but end_turn are refused as partial.
  • Sessions: a preassigned --session-id is deleted in a finally block so review bundles do not persist under ~/.grok; deletion failure on a successful run fails the review.
  • --no-tools engine validation now runs after the empty-diff guard, so dry-run and live runs agree and clean targets still exit 0.
  • Claude's default model is now the fable alias (latest Fable) instead of the pinned claude-fable-5; a panel may list one engine several times with different models, so an Amp orb can run amp:openai/gpt-5.6-sol:xhigh,amp:xai/grok-4.6:xhigh.
  • test-review-harness accepts --engine grok; SKILL.md and UPSTREAM.txt document the engine and the local trust model.

Tests

  • test-review-harness --fixture malicious --vcs git --engine grok: 3 P0 findings (command injection, path traversal, password leak).
  • test-review-harness --fixture benign --vcs jj --engine grok: clean.
  • autoreview --reviewers codex,grok on this branch: clean at the final round; grok sessions list empty afterwards.
  • Dry-run/live parity: --engine grok --no-tools --dry-run rejects; --engine codex --no-tools on a clean tree prints empty diff: nothing to review.
  • Probes: grok honours --session-id; --tools allowlist blocks writes while plan mode and --tools none do not.

@ci ci changed the title fix(review): always clean up grok sessions; validate no-tools after empty-diff guard feat(autoreview): add grok review engine Sep 2, 2026
@ci

ci commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

This PR is part of a stack:

  1. feat/autoreview-grok-engine <-- this PR
  2. feat/ai-pipeline-skill
  3. feat/pipeline-verify-stage

Created with jjpr

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