Release 0.6.1 — short run refs, list command, flexible --story#5
Conversation
`--story` now accepts more than the exact full key: - `--epic 3 --story 1` / `--story 3-1` / `--story 3.1` -> epic 3, story 1 - `--story user-auth` / `auth` -> slug fragment (errors if not unique) - `--story 3-1-user-auth` -> exact key (unchanged) Adds StorySelector + parse_selector/select_actionable in sprintstatus, routes engine._pick_next and cli run/dry-run through it, and surfaces targeted errors (no match / ambiguous slug / matched-but-not-actionable) before a run is launched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Every command that takes a run id (status, attach, resume, resolve, stop, delete, archive) now accepts a partial — the tail after the last `-`, shortened to any unique prefix. Full ids still resolve exactly; an ambiguous ref fails listing the candidates. Resolution funnels through a single runs.resolve_run_dir helper, replacing the duplicated lookup at each site. New `bmad-auto list` (alias `ls`) prints each run/sweep with its short ref, type, and status, reusing the TUI's import-safe discover_runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make RELEASING.md a local-only doc: remove it from version control and gitignore it. Drop the two dead links to it from CONTRIBUTING.md so the public contributing guide stays coherent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
WalkthroughVersion 0.6.1 adds two features: (1) partial run-id resolution via new ChangesRun-ref resolution and story selector features
Version bump and release doc cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Augment PR SummarySummary: This PR prepares the 0.6.1 release and expands the CLI’s run/story selectors for a smoother UX. Changes:
Technical Notes: The CLI now validates story selection before launching a run, and run-id handling is normalized to full ids once resolved. 🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
|
|
||
| def cmd_list(args: argparse.Namespace) -> int: | ||
| from .tui.data import discover_runs # import-safe: data.py has no textual imports |
There was a problem hiding this comment.
src/automator/cli.py:640 — cmd_list imports automator.tui.data, but tui/data.py imports pyte and rich (and pyte is declared under the [tui] extra), so bmad-auto list will crash on minimal installs without TUI deps. Consider keeping list in the core dependency surface (or handling missing optional deps similarly to cmd_tui).
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/test_cli.py (1)
221-229: ⚡ Quick winStrengthen
listassertions to verify the short-ref column.Line 227 can pass even if REF output regresses, since
aaaa/bbbbare also present in full run IDs. Assert the row prefix (or first token) so the test validates the short-ref column itself.Suggested test tightening
def test_list_shows_short_refs(project, capsys): _make_run_with_decision(project, run_id="20260101-000000-aaaa") _make_run_with_decision(project, run_id="20260102-000000-bbbb") assert cli.main(["list", "--project", str(project.project)]) == 0 out = capsys.readouterr().out assert "REF" in out - assert "aaaa" in out and "bbbb" in out + lines = [line for line in out.splitlines() if line.strip()] + data_lines = [line for line in lines[1:]] # skip header + assert any(line.startswith("aaaa ") for line in data_lines) + assert any(line.startswith("bbbb ") for line in data_lines) assert "20260101-000000-aaaa" in out🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_cli.py` around lines 221 - 229, The assertions in test_list_shows_short_refs checking for "aaaa" and "bbbb" are too weak because these strings also appear in the full run IDs, so the test would pass even if the REF column regresses. Strengthen the assertions by checking for the short refs as they would appear at the row prefix or first token level in the output (for example, by verifying the presence of patterns like row headers or column-aligned formats that would demonstrate the short-ref column is actually functioning), rather than just checking if the substrings exist anywhere in the output.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/automator/cli.py`:
- Around line 909-910: The add() function uses help as a parameter name which
shadows the Python builtin, triggering the Ruff A002 lint error. Rename the help
parameter to a non-builtin name such as help_text or description throughout the
add() function, and update all references to this parameter (including where it
is passed to sub.add_parser as the help argument) to use the new parameter name
consistently.
In `@src/automator/runs.py`:
- Around line 95-102: The run-ref resolution is vulnerable to path traversal
attacks because `ref` is passed directly to `run_dir_for(project, ref)` without
validation, allowing inputs like `../...` to escape the `.automator/runs`
directory. Validate or sanitize the `ref` parameter before using it in the
`run_dir_for` call to ensure it does not contain path traversal sequences (such
as `../` or leading slashes) and only contains safe characters that represent
valid run identifiers.
---
Nitpick comments:
In `@tests/test_cli.py`:
- Around line 221-229: The assertions in test_list_shows_short_refs checking for
"aaaa" and "bbbb" are too weak because these strings also appear in the full run
IDs, so the test would pass even if the REF column regresses. Strengthen the
assertions by checking for the short refs as they would appear at the row prefix
or first token level in the output (for example, by verifying the presence of
patterns like row headers or column-aligned formats that would demonstrate the
short-ref column is actually functioning), rather than just checking if the
substrings exist anywhere in the output.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 29fb9b59-30fc-40ee-92bd-9ff0ea39fb42
⛔ Files ignored due to path filters (12)
docs/images/dashboard.pngis excluded by!**/*.pngdocs/images/dashboard.svgis excluded by!**/*.svgdocs/images/demo.gifis excluded by!**/*.gifdocs/images/settings-scm.pngis excluded by!**/*.pngdocs/images/settings-scm.svgis excluded by!**/*.svgdocs/images/settings.pngis excluded by!**/*.pngdocs/images/settings.svgis excluded by!**/*.svgdocs/images/start-run-modal.pngis excluded by!**/*.pngdocs/images/start-run-modal.svgis excluded by!**/*.svgdocs/images/sweep-decision.pngis excluded by!**/*.pngdocs/images/sweep-decision.svgis excluded by!**/*.svguv.lockis excluded by!**/*.lock
📒 Files selected for processing (19)
.claude-plugin/marketplace.json.gitignoreCHANGELOG.mdCONTRIBUTING.mdREADME.mdRELEASING.mddocs/FEATURES.mdmodule.yamlpyproject.tomlsrc/automator/__init__.pysrc/automator/cli.pysrc/automator/data/skills/bmad-auto-setup/assets/module.yamlsrc/automator/engine.pysrc/automator/runs.pysrc/automator/sprintstatus.pysrc/automator/tui/screens/modals.pytests/test_cli.pytests/test_runs.pytests/test_sprintstatus.py
💤 Files with no reviewable changes (1)
- RELEASING.md
| def add(name: str, func, help: str, *, aliases=()) -> argparse.ArgumentParser: | ||
| p = sub.add_parser(name, help=help, aliases=aliases) |
There was a problem hiding this comment.
Rename help parameter in add() to fix Ruff A002.
Line 909 uses help as a parameter name, which shadows the Python builtin and triggers the reported lint error.
Suggested fix
-def add(name: str, func, help: str, *, aliases=()) -> argparse.ArgumentParser:
- p = sub.add_parser(name, help=help, aliases=aliases)
+def add(name: str, func, help_text: str, *, aliases=()) -> argparse.ArgumentParser:
+ p = sub.add_parser(name, help=help_text, aliases=aliases)🧰 Tools
🪛 Ruff (0.15.17)
[error] 909-909: Function argument help is shadowing a Python builtin
(A002)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/automator/cli.py` around lines 909 - 910, The add() function uses help as
a parameter name which shadows the Python builtin, triggering the Ruff A002 lint
error. Rename the help parameter to a non-builtin name such as help_text or
description throughout the add() function, and update all references to this
parameter (including where it is passed to sub.add_parser as the help argument)
to use the new parameter name consistently.
Source: Linters/SAST tools
| exact = run_dir_for(project, ref) | ||
| if is_run(exact): | ||
| return exact | ||
| matches = [ | ||
| d | ||
| for d in list_run_dirs(project) | ||
| if short_ref(d.name).startswith(ref) or d.name.endswith(ref) | ||
| ] |
There was a problem hiding this comment.
Prevent path traversal in exact run-ref resolution.
Line 95 trusts ref as a path segment (run_dir_for(project, ref)), so inputs like ../... can escape .automator/runs. If that escaped directory contains a state.json, this resolver will accept it, and downstream commands (e.g., delete/archive/stop) can act on the wrong location.
Suggested fix
def resolve_run_dir(project: Path, ref: str) -> Path:
@@
- exact = run_dir_for(project, ref)
- if is_run(exact):
- return exact
+ if not ref or Path(ref).name != ref or ref in {".", ".."}:
+ raise RunRefError(f"invalid run ref: {ref!r}")
+
+ run_dirs = list_run_dirs(project)
+ exact = next((d for d in run_dirs if d.name == ref), None)
+ if exact is not None:
+ return exact
matches = [
d
- for d in list_run_dirs(project)
+ for d in run_dirs
if short_ref(d.name).startswith(ref) or d.name.endswith(ref)
]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/automator/runs.py` around lines 95 - 102, The run-ref resolution is
vulnerable to path traversal attacks because `ref` is passed directly to
`run_dir_for(project, ref)` without validation, allowing inputs like `../...` to
escape the `.automator/runs` directory. Validate or sanitize the `ref` parameter
before using it in the `run_dir_for` call to ensure it does not contain path
traversal sequences (such as `../` or leading slashes) and only contains safe
characters that represent valid run identifiers.
cmd_validate fell back to "on PATH" when the Windows multiplexer version probe (tmux -V) errored, falsely implying tmux was present. Report version-unavailable instead; a genuinely missing tmux is still surfaced by the existing PATH check. Refs: _bmad-output/implementation-artifacts/deferred-work.md (deferred-work.md, Adversarial-review deferrals bmad-code-org#5) Claude-Session: https://claude.ai/code/session_019ohWeC44Mto4upsYNNaVh8
Release 0.6.1
Added
status,attach,resume,resolve,stop,delete,archive) now accepts a partial — the tail after the last-(e.g.a1b2, shortened to any unique prefix). Full ids still work; an ambiguous ref fails listing the candidates. Newbmad-auto list(aliasls) prints each run/sweep with its short ref, type, and status.--storyselection.bmad-auto run --storynow takes an epic+number (--epic 3 --story 1,--story 3-1,--story 3.1) or a slug fragment (--story user-auth), not just the full key. Mismatches are caught before launch with a targeted error (no match / ambiguous slug / matched-but-not-actionable).Release mechanics
uv.lock; CHANGELOG curated; TUI screenshots + demo regenerated (StartRunModal placeholder changed).RELEASING.mduntracked (maintainer-local) and its dead links dropped fromCONTRIBUTING.md.Once merged, the Release workflow auto-creates the
v0.6.1tag and GitHub release from the CHANGELOG.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
list(aliasls) command to display runs/sweeps with short references, type, and status.--storyargument to accept short references (e.g.,3-1), epic+number formats, and slug fragments.Bug Fixes
Documentation
Tests