cmd_run refuses to start on a dirty main tree; cmd_resume has no such gate
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- cli, documentation
Research direction
Read cmd_run at src/bmad_loop/cli.py:1703 and cmd_resume at src/bmad_loop/cli.py:2273, then compare the existing worktree_clean checks in cmd_validate, cmd_run, and cmd_sweep. Review the isolation behavior described in docs/FEATURES.md and resolve whether resume's asymmetry is intentional; done means the decision and its rationale are documented at the relevant entry point and in the feature documentation.
Written by the indexing model from the issue text.
Description
cmd_run refuses to start on a dirty main tree (src/bmad_loop/cli.py:1703):
if not verify.worktree_clean(paths.repo_root):
print("git worktree is not clean — commit or stash first", file=sys.stderr)
return 1
cmd_resume (src/bmad_loop/cli.py:2273) has no equivalent check — worktree_clean appears in
cmd_validate, cmd_run and cmd_sweep, and nowhere in the resume path.
Whether that asymmetry is intended is worth stating one way or the other. There is a coherent
argument for it: a resume continues a run whose worktrees already exist, and under
[scm] isolation = "worktree" the main checkout is explicitly expected to be usable while a run
is in flight (docs/FEATURES.md: "the main checkout stays free while a run is in flight"), so
demanding a clean tree to resume would refuse the very workflow the feature invites. There is also
an argument against: under isolation = "none" a resume drives the loop in the main checkout,
where pre-existing dirt is the same hazard cmd_run refuses over.
This surfaced while scoping #460. The gate is what bounds that issue's practical reach — a fresh
run cannot begin over pre-existing dirt, so the reachable triggers are dirt appearing after the
run starts, plus every resume — and that reasoning only holds while the asymmetry is deliberate
and documented. Right now it is neither confirmed nor written down.
Cheapest resolution may be a comment at the resume path plus a line in docs/FEATURES.md, rather
than a behavior change.
- Dominant language
- Python
- Stars
- 137
- Forks
- 60
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 44
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bmad-code-org/bmad-loop
-
area:adapters enhancement good first issue P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bmad-code-org/bmad-loop#780 · 2 comments ·
-
area:engine bug P3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
bmad-code-org/bmad-loop#723 ·
-
Re-cut test_merge_stray_dirt_escalates_with_clear_message to pin the hazard-first refusal lead-in Openarea:engine bug P3
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
bmad-code-org/bmad-loop#683 ·
-
area:adapters area:psmux bug P4
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bmad-code-org/bmad-loop#673 · 7 comments · 1 reaction ·
-
area:tui enhancement P4
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bmad-code-org/bmad-loop#666 · 1 comment · 1 reaction ·
All issues in bmad-code-org/bmad-loop
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100