feat: implement bounded parallel story fan-out with isolated worktrees
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo việc phân tích cú pháp và xác thực policy, vòng lặp dispatch của engine, tích hợp worktree, trạng thái run được lưu bền vững và journal, việc verification, cùng các điểm kết nối diagnostics/TUI/status/attach được nêu trong issue. Sử dụng các acceptance test làm định nghĩa hoàn tất, bao quát admission có giới hạn, tích hợp xác định, xử lý base đã lỗi thời, hành vi pause và resume, cleanup và tính tương đương của max_parallel = 1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
scm.max_parallel already exists, but upstream main clamps every value greater than 1 to 1 because Phase 5 parallel fan-out is not implemented. The engine remains sequential: it dispatches one story, runs its development/review/verification flow, integrates it, and only then selects the next story. Worktree isolation, per-unit branches, and merge-back already exist. This is an upstream bmad-loop Phase 5 design request, not an OpenEngine-specific fork.
Design request
Implement bounded parallel story fan-out with these invariants:
- A configured scm.max_parallel greater than 1 must hard-fail unless scm.isolation is worktree and scm.branch_per is story. Keep scm.max_parallel = 1 behavior unchanged.
- Admit work using declared file globs plus named exclusive resources, such as database, lockfile, service:name, generated artifacts, or shared verification infrastructure. File/resource conflicts serialize. Unknown or invalid footprints are exclusive, and the journal must record why. Shared verification infrastructure should be able to reserve migrations, test databases, or services so parallel source work cannot race them.
- Allow up to N workers in flight, but keep exactly one coordinator/integration lane. Workers must never write the target branch concurrently.
- Persist deterministic dispatch and integration order in run state. Completion timing must not determine run history.
- Each worker must record the target base SHA from which it was started.
- Integrate each worker against the latest target through a candidate branch/worktree. Run deterministic verification commands against the combined candidate, then advance the target only if its SHA is still the candidate's recorded target SHA; never force-advance a target that moved.
- Define and test stale-base behavior for all merge strategies: ff may advance only when the candidate is a valid fast-forward from the current target; merge must compose against the latest target and preserve/escalate conflicts; squash must create its deterministic squash candidate against the latest target. A stale target must trigger deterministic recomposition/retry or an explicit escalation, with the candidate and evidence preserved.
- Define one worker pause/escalation behavior: the coordinator stops dispatching, lets already-running siblings reach a safe terminal boundary, persists their outcomes, and pauses without silently dropping results. If maintainers prefer cancel-on-first-failure, make that an explicit design choice rather than an assumption.
- Persist durable state for every in-flight worker: task, worktree, branch, phase, session, and base SHA. Support crash-safe resume, stop, orphan cleanup, and useful TUI/status/attach behavior for these workers and candidate integrations.
- Preserve the existing semantics of max_stories, epic boundaries, selectors, plan/spec/done checkpoints, notifications, keep_failed, delete_branch, seed_adapter_defaults, and worktree_seed.
- rollback_on_failure remains an in-place-only knob and is irrelevant in parallel worktree mode.
- Defer sweep-bundle parallelism unless maintainers explicitly opt it into this issue.
Acceptance tests
The implementation should cover:
- N-in-flight cap.
- Overlap of independent stories, proven with deterministic barriers.
- Serialization of file/resource conflicts.
- Unknown footprint treated as exclusive, with the journal reason.
- Isolation and branch_per guards.
- Deterministic merge order when completion order is inverted.
- ff, merge, and squash stale-base paths.
- Post-composition verification failure.
- Target SHA movement during integration.
- Merge-conflict preservation and escalation.
- A worker pause while siblings continue to a safe terminal boundary.
- Crash/resume, stop, and orphan cleanup.
- Regression equivalence for max_parallel = 1.
A manual two-story timing run is supplementary only; deterministic barrier-based tests are the primary concurrency proof.
Implementation Notes
Relevant current-main seams include policy parsing and validation; the engine dispatch loop; per-unit worktree creation, integration, and cleanup; persisted run state and journal; adapter sessions; verification; orphan/reconciliation cleanup; sweep; and diagnostics/TUI/status/attach surfaces. Please use the current symbols and contracts in those areas without depending on exact line numbers, which are not stable.
- Ngôn ngữ chính
- Python
- Star
- 165
- Fork
- 69
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 79
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bmad-code-org/bmad-loop
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
bmad-code-org/bmad-loop#973 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bmad-code-org/bmad-loop#965 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
bmad-code-org/bmad-loop#835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
bmad-code-org/bmad-loop#1004 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 49/100
bmad-code-org/bmad-loop#1002 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bmad-code-org/bmad-loop
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
pydot/pydot#601 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
letsencrypt/cp-cps#361 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declaresCó thể đã có người làm @maykonmichel đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
linuxmint/mintupdate#1107 ·