Skip to content

feat(code-review): wire start.md to the run-prefix loop (PLN-1229 Phase 3) - #175

Merged
wongk merged 3 commits into
mainfrom
feat/code-review-run-prefix-orchestrator
Jul 2, 2026
Merged

feat(code-review): wire start.md to the run-prefix loop (PLN-1229 Phase 3)#175
wongk merged 3 commits into
mainfrom
feat/code-review-run-prefix-orchestrator

Conversation

@wongk

@wongk wongk commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

PLN-1229 Phase 3 — orchestrator wiring. The payoff phase: rewires the /code-review orchestrator (start.md) to run the deterministic prefix via the run-prefix loop (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.md

  • New "Deterministic Prefix — run-prefix loop" section: invoke run-prefix, then dispatch on next_action
    • needs_singleton → invoke the singleton-dispatch skill, then re-invoke --resume-from <resume_stage>;
    • hygiene_exit → Gate A present + EXIT;
    • ready_for_reviewers → print the cache/fast-path notices, read CACHE_DIR from cache_config.json, hand off to the Walker Contract at stage_20_spawn_reviewers;
    • error → fall back to the per-stage walk from failed_stage.
  • Reframed the Walker Contract as (a) the always-walked reviewer/verify/present tail and (b) the labeled per-stage prefix fallback. Gate A/B now execute inside 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 at run-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 to start.md for --resume-from in the run-prefix flow; advance the walker only in the fallback.

SCHEMA.md — corrected the route-failure failed_stage to stage_19_cache_check (matching the merged runner) and noted the shallow-tier derive-static-spec stage.

Review

An expert review traced all four next_action outcomes 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 SCHEMA failed_stage value.

Testing

  • Full code-review suite: 1306 passed, 3 skipped (prose-only change — confirms no code impact)
  • ruff / pyright unaffected (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

wongk and others added 2 commits July 2, 2026 13:16
…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>
Comment thread plugins/code-review/.closedloop-ai/subagent-start-hook-debug.log Outdated
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>
@wongk
wongk merged commit dded59a into main Jul 2, 2026
5 checks passed
@wongk
wongk deleted the feat/code-review-run-prefix-orchestrator branch July 2, 2026 18:50
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.

1 participant