refactor(review): wire entire review on new architecture; delete legacy (3/3)#1107
Open
peyton-alt wants to merge 2 commits intofeat/entire-review-v2-a2from
Open
refactor(review): wire entire review on new architecture; delete legacy (3/3)#1107peyton-alt wants to merge 2 commits intofeat/entire-review-v2-a2from
peyton-alt wants to merge 2 commits intofeat/entire-review-v2-a2from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes the entire review refactor by wiring the new cmd/entire/cli/review/ architecture into the actual Cobra command registration and removing the legacy monolithic implementation (cmd/entire/cli/review.go + its tests). It also updates docs and lint configuration to reflect the new reviewer/orchestrator design.
Changes:
- Registers
review.NewCommand(...)on the root command and introduces cli-package “bridge” helpers to avoid import cycles. - Adds the new review command implementation (config picker, non-launchable marker fallback, command/help tests) under
cmd/entire/cli/review/. - Updates documentation/lint config and deletes the legacy
review.goimplementation + tests.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/root.go | Switches root command registration to cli/review.NewCommand(buildReviewDeps(...)). |
| cmd/entire/cli/review/cmd.go | New entire review command entry point + dispatch between launchable reviewers and marker fallback. |
| cmd/entire/cli/review/cmd_test.go | Verifies help surface, hook gating, non-launchable marker behavior, and --agent override behavior. |
| cmd/entire/cli/review/picker.go | Implements interactive review config picker, config persistence helpers, and agent selection helpers. |
| cmd/entire/cli/review/picker_test.go | Unit tests for picker helpers (merge/split/selection/SaveReviewConfig). |
| cmd/entire/cli/review/marker_fallback.go | Reintroduces marker file helpers + “manual agent” fallback path for non-launchable agents. |
| cmd/entire/cli/review/marker_fallback_test.go | Tests marker round-trip and marker fallback behavior/output. |
| cmd/entire/cli/review/status_test.go | Comment-only stub documenting why status logic tests live outside the subpackage. |
| cmd/entire/cli/review/attach_test.go | Tests entire review attach help surface and no-args behavior. |
| cmd/entire/cli/review_bridge.go | Builds review.Deps and provides launchableReviewerFor to break import cycles. |
| cmd/entire/cli/review_helpers.go | Hosts cycle-bound functions (headHasReviewCheckpoint, newReviewAttachCmd) in cli package. |
| cmd/entire/cli/attach_test.go | Updates attach tests to call review.SaveReviewConfig from the new package. |
| CLAUDE.md | Updates entire review documentation to reflect env-var handshake + new architecture. |
| .golangci.yaml | Adds review/types.AgentReviewer to the ireturn allow-list. |
| cmd/entire/cli/review.go | Deletes the legacy entire review implementation. |
| cmd/entire/cli/review_test.go | Deletes legacy tests, replaced by tests under cmd/entire/cli/review/. |
013d5f4 to
c6c5aef
Compare
76fd30d to
4b847f0
Compare
c6c5aef to
ce17205
Compare
694ffe9 to
11df159
Compare
Contributor
Author
|
@BugBot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 11df159. Configure here.
This was referenced May 4, 2026
CU6 migrates the entire review command from the legacy 1,513-line cmd/entire/cli/review.go into the cmd/entire/cli/review/ subpackage, routing user-facing entry points through CU1-CU5b's new abstractions: env-handshake, AgentReviewer/Sink/Run, ReviewerTemplate, ComposeReviewPrompt, scope detection. Surface preserved (matches PR #993 + #1009): entire review — main command entire review --edit — re-open picker entire review --agent <name> — override agent entire review attach <session-id> — post-hoc attach entire review attach {--force,--agent,--skills} --track-only is intentionally NOT included (dropped by #1009). Architecture: - review/cmd.go: NewCommand() with Deps struct; runReview() dispatches to launchable agents (claude/codex/gemini → AgentReviewer.Run() with DumpSink) or non-launchable (cursor/opencode/factoryai-droid → marker_fallback.go which writes PendingReviewMarker + prints guidance — single shared file, no per-agent fallback files). - review/picker.go: pickConfig + first-run setup migrated from old code. - review/attach_test.go: smoke test for the migrated subcommand. - cli/review_bridge.go + review_helpers.go: small bridge files in the cli package holding functions that can't move into review/ due to import cycles (review → checkpoint → codex → review; review → claudecode/codex/geminicli → review). Bridge wires cli-package implementations into review.NewCommand's Deps struct. Deletes cmd/entire/cli/review.go and review_test.go (1,513 + ~600 lines). All still-used functions migrated; the rest were already replaced by CU1-CU5b. Per-feature tests now live alongside their implementations under review/. .golangci.yaml: add review/types.AgentReviewer to ireturn allow-list (was Process only); the new bridge legitimately returns the interface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates the entire review section to reflect the new architecture
shipped in CU1-CU6:
- Command surface: --edit, --agent <name>, attach subcommand
(--track-only is intentionally absent per #1009)
- Settings schema: ReviewConfig with skills + prompt fields
- Env-var handshake: ENTIRE_REVIEW_{SESSION,AGENT,SKILLS,PROMPT,
STARTING_SHA} replaces the marker file (each spawned process
has its own env)
- Launchable vs non-launchable split: launchable agents (claude-
code, codex, gemini-cli) run via AgentReviewer.Run; non-
launchable (cursor, opencode, factoryai-droid) route to the
shared marker_fallback.go
- Architecture: AgentReviewer interface, ReviewerTemplate shared
scaffolding, Sink contract with serial-dispatch guarantee,
scope detection via closest-ancestor + fallback chain
- Anti-feature list: explicit "do NOT recreate" callouts for
PendingReviewMarker on launchable agents, WorktreePath,
AgentEntries, --track-only, Launcher/HeadlessLauncher split,
filterCodexOutput in shared code, sync.Once-guarded onCancel
- Key files: updated paths to reflect the cmd/entire/cli/review/
subpackage, the bridge files in cli/, and the per-agent
AgentReviewer implementations
AGENTS.md is a symlink to CLAUDE.md — auto-synced.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ce17205 to
aa8be02
Compare
11df159 to
cdb69ef
Compare
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.
https://entire.io/gh/entireio/cli/trails/286
Summary
Final of three stacked PRs rebuilding `entire review`'s internals. Stacked on PR-A2 (#1106). Wires the new architecture as `entire review`'s actual code path and deletes the legacy 1,513-line `cmd/entire/cli/review.go`. User-visible surface preserved — matches PR #993 + #1009.
Stack:
What's in this PR
CU6 — Wire `entire review` command (`dd1482b36`)
User-visible surface (matches #993):
```
entire review # main command
entire review --edit # re-open the picker
entire review --agent # override which configured agent runs
entire review attach # post-hoc attach (discoverability shortcut)
entire review attach --force # skip confirmation
entire review attach --agent # agent that created the session
entire review attach --skills <s,...> # declare which skills ran
```
`--track-only` is intentionally NOT included (dropped by #1009).
Architecture:
CU7 — Documentation (`76fd30d2b`)
Files changed:
entire reviewa bit #998/one more pass on top of feat/entire-review #1009 stays goneWhy bridge files in `cli/` package
Two real import cycles required the DI bridge:
The fix: `Deps` struct injection. `buildReviewDeps` (in `review_bridge.go`) constructs a `Deps` with cli-package implementations of cycle-bound functions; `review.NewCommand` accepts the `Deps`. The `review/` subpackage stays pure (only depends on `review/types`, settings, etc.).
Adding a new launchable agent in the future = one case in `launchableReviewerFor`. No edits to the `review/` subpackage.
Test plan
Smoke test (full command flow)
End-to-end verification that `entire review` works against a real binary in a real repo. Procedure:
```bash
git checkout feat/entire-review-v2-a3
go build -o /tmp/entire-smoke-a3 ./cmd/entire
Run unit + package tests against this branch
go test ./cmd/entire/cli/review/... \
./cmd/entire/cli/agent/{claudecode,codex,geminicli}/ -count=1
Verify command surface
/tmp/entire-smoke-a3 review --help # should list --edit, --agent, attach (no --track-only)
/tmp/entire-smoke-a3 review attach --help # should list --force, --agent, --skills
Verify no --track-only or stale references
grep -rn 'track-only\|TrackOnly\|trackOnly' cmd/ # expect empty
ls cmd/entire/cli/review.go cmd/entire/cli/review_test.go 2>&1 # expect 'No such file'
Optional: full end-to-end run with a real agent (~$0.02)
```
Expected: all package tests green; `--help` shows the right flags; legacy file is gone.
Actual output (verified locally on `feat/entire-review-v2-a3` @ 76fd30d):
```
ok cmd/entire/cli/review 1.604s
ok cmd/entire/cli/review/types 0.181s
ok cmd/entire/cli/agent/claudecode 3.640s
ok cmd/entire/cli/agent/codex 1.466s
ok cmd/entire/cli/agent/geminicli 1.334s
$ entire review --help
Flags:
--agent string select a specific configured agent (default: alphabetically first)
--edit re-open the review config picker
```
✓ Surface matches #993 (no `--track-only`).
Real-agent end-to-end smoke (configured `entire review --agent claude-code` against a live claude-code) requires API access and is documented in the optional procedure above for reviewers who want to verify with a real agent.
Anti-features explicitly NOT recreated
Behavioural parity with PR #993
Note
Medium Risk
Moderate risk because it replaces the
entire reviewexecution path (agent selection, scope computation, and launch/non-launch dispatch) and moves logic across new packages/DI boundaries; regressions could break review runs or marker/attach behavior.Overview
entire reviewis now wired to the new review architecture (AgentReviewer+Run+ sinks) and the legacy monolithic implementation is deleted, with a newreviewsubpackage handling command routing, config picking, and launchable-vs-non-launchable flows.Non-launchable agents now use a shared marker-file fallback (
RunMarkerFallback), while launchable agents rely on the env-var handshake; the CLI package adds small bridge/helpers to inject cycle-bound dependencies and to keepreview attachdiscoverable underentire review.Docs and lint config are updated accordingly (new review settings schema/prompt support, updated CLAUDE.md section, and
golangciireturnallow-list), and tests are reorganized/added to cover the new command surface and marker/picker behaviors.Reviewed by Cursor Bugbot for commit 11df159. Configure here.