feat: add /code-review built-in workflow command (#32) - #62
Merged
Conversation
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>
This was referenced Jul 11, 2026
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.
Adds the
/code-reviewbuilt-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
maxBufferto 64MB with a clear over-limit message, added aMAX_DIFF_CHARS(200k) truncation guard (visible warning +diffTruncatedflag, 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