Skip to content

feat: add /code-review built-in workflow command (#32) - #62

Merged
QuintinShaw merged 1 commit into
mainfrom
code-review-command
Jul 11, 2026
Merged

feat: add /code-review built-in workflow command (#32)#62
QuintinShaw merged 1 commit into
mainfrom
code-review-command

Conversation

@QuintinShaw

Copy link
Copy Markdown
Owner

Adds the /code-review built-in workflow command: a finder → verify → report workflow over a git diff (working tree, staged, a commit range, or a GitHub PR). Split out from #46 (gr3enarr0w) so it can land independently of that PR's auto-resume half.

Maintainer follow-ups applied on top of the original: raised the diff-capture maxBuffer to 64MB with a clear over-limit message, added a MAX_DIFF_CHARS (200k) truncation guard (visible warning + diffTruncated flag, applied both at the command layer and defensively inside the generated workflow), and documented the command in the README.

Verified: 826/826 tests, tsc + biome clean, and a real-pi run (found a real off-by-one bug, handled a ~4MB diff and an empty diff gracefully).

Closes #32. Co-authored-by: gr3enarr0w gr3enarr0w@users.noreply.github.com

Extracts the /code-review half of #46 onto current main, leaving the
auto-resume half (run-persistence.ts / workflow-manager.ts) for a later PR.

- src/code-review.ts: generateCodeReviewWorkflow() — 7 parallel finder
  agents (correctness x3, cleanup x3, altitude x1) -> per-candidate verify
  pass -> ranked markdown report.
- src/builtin-commands.ts: register /code-review alongside the other
  bundled commands; gather the diff via execFile (no shell) so
  branch/range/path input can't break out into a shell command.
- src/index.ts: export generateCodeReviewWorkflow + MAX_DIFF_CHARS.
- tests/builtin-commands.test.ts, tests/builtin-workflows.test.ts:
  /code-review coverage.
- README.md: document /code-review's input modes and behavior.

Addresses the maintainer's earlier review nits on this half:
- maxBuffer on the diff-gathering exec raised from Node's 1MB default to
  64MB, with a clear notify (not a raw ERR_CHILD_PROCESS_STDOUT_MAXBUFFER)
  when even that's exceeded.
- Diffs over 200k chars (MAX_DIFF_CHARS) are truncated with a visible
  notice at both the command layer and, defensively, inside the generated
  workflow script itself (which also stamps diffTruncated on the result).
- Verify phase deliberately keeps its hand-rolled 3-way CONFIRMED /
  PLAUSIBLE / REFUTED agent() call instead of the verify() stdlib, which
  only returns a boolean and would collapse that signal for no behavioral
  gain (only REFUTED is filtered) — documented inline in code-review.ts.

Co-Authored-By: Clark Everson <clark@everson.dev>
@QuintinShaw
QuintinShaw merged commit 0c9df7a into main Jul 11, 2026
1 check passed
@QuintinShaw
QuintinShaw deleted the code-review-command branch July 11, 2026 17:20
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.

feat: add /code-review built-in workflow command

1 participant