Repository navigation
[local-test-e2e-cover-the-local-auto-review-loo] test(e2e): cover the local --auto-review loop and iteration cap - #373
Conversation
…(e2e): cover the local --auto-review loop and iteration cap
Artifacts & verificationRun: 50 · Commit: Change explanationProduced by Reviewer Notes: Local
|
Why
Task local-test-e2e-cover-the-local-auto-review-loo: test(e2e): cover the local --auto-review loop and iteration cap
--auto-reviewis in the default worker task args, but no e2e test touched the local review/fix loop or the--auto-review-iterationscap. A parser, commit, or off-by-one regression could approve without review or land review commits on the wrong branch. The loop is local (it diffs withgit), so it can be proven offline with the deterministic fake agent.What changed
packages/e2e/helpers/fake-agent.ts: added two prompt-driven modes detected beforeE2E_AGENT_MODE(existing modes and precedence untouched):auto-review-feedbackmatches the bundled review header, parses**Review Iteration**: N, prints only JSON. Iteration 1 reports onemedium/code-qualityfinding with concrete evidence andapproved: false; iteration 2+ returnsapproved: truewith no items.E2E_AUTO_REVIEW_STUCK=1keeps every iteration unapproved.auto-review-fixmatches the bundled fix header, idempotently editssrc/greeting.tsto"Hello, reviewer!", and never commits or pushes.E2E_AGENT_INVOCATIONS.packages/e2e/helpers/fixture-workspace.ts: added additiveextraArgs?: string[]torunTask, appended after the fixture defaults.packages/e2e/tests/local/cli-auto-review.test.ts: two offline scenarios usingFixtureWorkspaceand a temp bare Git remote:feature/<key>, exactsrc/greeting.tsdiff, two commits ahead (HEAD subjectfix: address PR review feedback),auto-review-summary.json(iterations: 2,success: true, 2 history entries),iteration-1/feedback.json, exact invocation sequenceimplement → auto-review-feedback → auto-review-fix → auto-review-feedback, loop success output,succeededrun record, clean tree.E2E_AUTO_REVIEW_STUCK=1with--auto-review-iterations 1: exactly one review and one fix turn,iterations: 1,success: false, incomplete output, exit 0, branch pushed with two commits.packages/e2e/README.md: new "Local auto-review loop" section covering fake reviewer/fixer modes, the cap, and the summary artifact.packages/e2e/docs/coverage-matrix.md: both--auto-reviewrows set todefaultwith the new test file and command; GitHub row notes provider parity remains live/opt-in; backlog item 6 marked implemented for the local loop/cap.Scope
Included: the local
--auto-reviewloop, its iteration cap, commit/amend behavior, artifacts, and the two documented scenarios. Excluded: remote review polling (address-review), live GitHub/GitLab PR review feedback, provider parity, and any production-loop change. No tracker-plan changes were needed.Tradeoffs
PR approved, but that branch is unreachable under the defaultmediumthreshold: the loop breaks on "No important issues to address" before itsapprovedcheck, andvalidateReviewFeedbackrejects an approval that still has medium-or-higher findings. Changing that would require altering production, which is out of scope, so the test asserts the observable converged success output (Review loop complete!+Status: ✅ Success) instead.git diff's volatileindex <hash>line; headers, hunk header, and both content lines are compared exactly.extraArgswas preferred over building a command outside the isolated environment, keeping env isolation intact.Blast Radius
helpers/fake-agent.tsis shared by all e2e scenarios. The new detection only matches the bundledreview.md/fix.mdheaders and sits beforeE2E_AGENT_MODE; the full local suite (including tracker, worker, and harness tests) passes.FixtureWorkspace.runTaskgains an optional argument; existing callers are unaffected.Verification
From the monorepo root, in order:
bun run --filter @getdevintern/code build— passed.bun run --filter @devintern/e2e test— 137 pass, 16 skip, 4 todo, 0 fail across 25 files.bun run --filter @devintern/e2e typecheck— passed.bun run --filter @devintern/e2e lint— passed.bun run --filter @devintern/e2e format:check— all matched files correctly formatted.Also ran the new file directly (
bun test tests/local/cli-auto-review.test.ts): 2 pass, 0 fail. The tests dispose the fixture workspace infinally; no temp directories were left behind.This PR was automatically created by @devintern/code