feat(code-review): wire start.md to the run-prefix loop (PLN-1229 Phase 3) - #175
Merged
Conversation
…se 3) Rewrite the orchestrator's deterministic-prefix walk into a run-prefix loop — the payoff phase that collapses ~19 helper stages (and their serial model turns) into a handful of orchestrator turns. start.md: - New "Deterministic Prefix — run-prefix loop" section: invoke run-prefix and dispatch on next_action — needs_singleton (singleton-dispatch skill, then re-invoke --resume-from), hygiene_exit (Gate A present + EXIT), ready_for_reviewers (print cache/fast-path notices, read CACHE_DIR from cache_config.json, hand off to the Walker Contract at stage_20), and error (fall back to the per-stage walk from failed_stage). - Reframe the Walker Contract as (a) the always-walked reviewer/verify/present tail from stage_20 onward and (b) the labeled per-stage fallback for the prefix. Gate A/B now execute inside run-prefix (their prose is the fallback recipe); Gate C/D still fire in the tail. Update the "Batch deterministic helper stages" note to point at run-prefix. - Keep the operator todo list accurate across the now-silent prefix. singleton-dispatch skill: step 4 now branches on caller — return to start.md for --resume-from in the run-prefix flow, advance the walker only in the fallback. SCHEMA.md: correct the route-failure failed_stage to stage_19_cache_check (matching the merged runner) and note the shallow-tier derive-static-spec stage. Additive with a live per-stage fallback (no behavior lost); MINOR bump. Prose change validated by an expert review of the rewire (no HIGH findings; all flagged items fixed) — the runner itself is parity-proven by Phases 1-2. Full code-review suite 1306 passed / 3 skipped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ing (PLN-1229 Phase 3) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wongk
commented
Jul 2, 2026
The Phase 3 feat commit accidentally swept in plugins/code-review/.closedloop-ai/subagent-start-hook-debug.log, a runtime artifact written by the SubagentStart hook. The existing .gitignore patterns for .closedloop-ai/ are root-anchored, so they never covered plugin-local runtime dirs. Remove the file and add a plugins/**/.closedloop-ai/ guard so hook/review artifacts can't be committed under the plugin tree again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
PLN-1229 Phase 3 — orchestrator wiring. The payoff phase: rewires the
/code-revieworchestrator (start.md) to run the deterministic prefix via therun-prefixloop (built + parity-proven in #173/#174) instead of walking ~19 helper stages one at a time. This collapses the prefix's serial model turns into a handful of orchestrator turns — the single biggest turn-count reduction in a review — while keeping the per-stage walk as a live, documented fallback (no behavior lost).This is a prose-only change (orchestrator command + one skill + a SCHEMA doc fix). The runner it drives is already byte-parity-proven; this phase's safety net is careful authoring + an expert review of the rewire.
What changed
commands/start.mdrun-prefixloop" section: invokerun-prefix, then dispatch onnext_action—needs_singleton→ invoke thesingleton-dispatchskill, then re-invoke--resume-from <resume_stage>;hygiene_exit→ Gate A present + EXIT;ready_for_reviewers→ print the cache/fast-path notices, readCACHE_DIRfromcache_config.json, hand off to the Walker Contract atstage_20_spawn_reviewers;error→ fall back to the per-stage walk fromfailed_stage.run-prefix(their prose is the fallback recipe); Gate C/D still fire in the tail. Updated the "Batch deterministic helper stages" note to point atrun-prefix, and kept the operator todo list accurate across the now-silent prefix.skills/singleton-dispatch/SKILL.md— step 4 now branches on caller: return tostart.mdfor--resume-fromin therun-prefixflow; advance the walker only in the fallback.SCHEMA.md— corrected the route-failurefailed_stagetostage_19_cache_check(matching the merged runner) and noted the shallow-tierderive-static-specstage.Review
An expert review traced all four
next_actionoutcomes against the runner code and confirmed the tail resolves everything it needs from on-disk artifacts (no HIGH findings). All flagged items fixed: the stale skill step 4, fast-path notice model-name parity, the shallow-tier stage note, and the SCHEMAfailed_stagevalue.Testing
ruff/pyrightunaffected (no code changed)Version: code-review 3.3.0 → 3.4.0 (MINOR — additive with a live fallback; touches the orchestration contract).
Completes the landable sequence Phase 0→3. Phase 4 (measure the turn/cost reduction with the cost tool) is the remaining follow-up.
🤖 Generated with Claude Code