Repository navigation
Conversation
The run queue no longer merges every queued phase into one LLM turn. Each run-plan phase runs in its own executor turn, in its own worktree and branch cut from the default branch, with its own provider session, token budget, and wall-clock watchdog. A new dependency-aware scheduler validates the plan graph, holds dependents in Waiting until every upstream lands green, then fans out ready phases concurrently — four by default, configurable per plan — while a non-green upstream fails only its dependents and leaves independent in-flight phases running. Restart reconciliation now handles multiple in-flight phases, auto-resuming only when the worktree and saved provider session both survive and parking the rest with a reason. Rubric: PASS — 7/7 criteria Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
suprie
marked this pull request as ready for review
October 30, 2026 06:39
6 of 7 tasks
Integrate bounded artifact injection and citation attribution into isolated phase turns. Reconcile waiting-only restarts, unify Waiting states and transitions, and retain the dependency-aware scheduler. Validated: cargo test (762 passed, 9 ignored), cargo clippy -- -D warnings, TypeScript type-check, 34 frontend tests, cargo fmt, and git diff --check.
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
The run queue no longer merges every queued phase into one LLM turn.
prd-parallel-schedulingmakes the phase the unit of execution: each run-plan phase runs in its own executor turn, in its own worktree and branch cut from the default branch, with its own provider session, token budget, and wall-clock watchdog. A new dependency-aware scheduler validates the plan graph, holds dependents inWaitinguntil every upstream lands green, then fans out ready phases concurrently — four by default, configurable per plan — while a non-green upstream fails only its dependents and leaves independent in-flight phases running. Restart reconciliation now handles multiple in-flight phases, auto-resuming only when the worktree and saved provider session both survive and parking the rest with a reason for the morning report.What changed
scheduler.rs: graph validation (cycles, self-edges, dangling edges),Waitinggate release/fail, ready-set selection, per-phase watchdog, restart classification, and generated-graph property tests.PhaseTaskand one turn per phase, aJoinSetbounded byRunPlan.max_concurrency, per-phase worktrees, per-phase token/wall-clock budgets, and serialized plan bookkeeping.RunPhaseStatus::Waiting,RunPlan.max_concurrency(default 4), and per-phase worktree/session fields torun-plan.yaml, with legacy plans loading unchanged.waitingin the run surfaces..loopdeck/handoff-artifacts/.PRD
docs/epics/role-based-orchestration/prd-parallel-scheduling.md
Decisions
max_concurrency, with aWaitinggate and fail-dependents policy.workspaceWritewithon-request, subject to the destructive-command floor.Test plan
cargo test(fromsrc-tauri/)cargo clippy -- -D warnings(fromsrc-tauri/)npx tsc --noEmitnpm run test:frontendVerify Verdict
PRD Verification — prd-parallel-scheduling.md
Verdict: PASS
src-tauri/src/commands/run_queue.rs:2218(execute_run) spawns onePhaseTaskper ready phase;:1803builds the prompt from a single-loop slice;next_queued_batchand the combined-batch turn are deleteddepends_onare satisfied and disjoint, each in its own worktree, under a bounded concurrency limit (P0)src-tauri/src/scheduler.rs:304(select_ready);run_queue.rs:2239(JoinSet),:2293(max_concurrency),:202(each branch cut from the default branch); default 4 inlimits.rs:114; pickerPlanTonightWizard.tsx:659runplan.rs:54addsWaiting;scheduler.rs:153(mark_waiting),:186(reconcile_gates),:272(fail_dependentsleaves Running phases alone); gate edges intransition.rsrun_executor.rs:582iterates everyRunningphase;scheduler.rs:354classifies resume vs park on worktree+session survival; the resumed turn passes the saved id throughagent.rs:1947run_queue.rs:1705creates oneTokenBudgetperPhaseTask;scheduler.rs:333(phase_watchdog);run_queue.rs:1991kills only that phase and fails its dependentsscheduler.rs:721/:773/:799generated-DAG, cycle, and restart properties;run_executor.rs:1006/:1520crash recovery;run_queue.rs:3216disjoint-worktree cleanup checkrun_queue.rs:636validates before persisting;scheduler.rs:69rejects cycles, self-edges, and dangling edges; also checked at run start (run_queue.rs:2232)Non-goals audit
Roll-up: PASS — 0 FAIL, 0 PARTIAL, 7 PASS.
Run metadata
parallel-scheduling/one-turn-per-phase— "Replace the combined queued-batch turn with one executor turn per run-plan phase" (role-based-orchestration / prd-parallel-scheduling / Phase 1 — Per-phase turn execution)parallel-scheduling/parallel-batches— "Run phases with satisfied, disjoint depends_on concurrently in separate worktrees under a bounded concurrency limit" (role-based-orchestration / prd-parallel-scheduling / Phase 2 — Dependency-aware fan-out)parallel-scheduling/gated-start— "Hold dependent phases in Waiting until upstream phases complete, releasing or failing per the stall policy" (role-based-orchestration / prd-parallel-scheduling / Phase 2 — Dependency-aware fan-out)parallel-scheduling/restart-reconcile— "Extend restart reconciliation to multiple in-flight phases after a crash or restart" (role-based-orchestration / prd-parallel-scheduling / Phase 3 — Reconciliation + budgets)parallel-scheduling/budget-split— "Apply per-phase token and wall-clock budgets per in-flight phase instead of per combined batch" (role-based-orchestration / prd-parallel-scheduling / Phase 3 — Reconciliation + budgets)parallel-scheduling/tests— "Add scheduler property tests (diamond graphs, cycle rejection, mid-flight crash recovery) and worktree cleanup race checks" (role-based-orchestration / prd-parallel-scheduling / Phase 4 — Tests/verification)