release: 0.7.2#15
Conversation
In worktree isolation the bmad-dev-auto skill runs with cwd set to the worktree and writes its terminal spec under the worktree's rebased implementation-artifacts dir, but GenericDevAdapter searched the main checkout's dir (resolved once at construction). The fresh status:done spec was never found, so a completed story was misread as a stalled session and rolled back + retried. Carry the full ProjectPaths and rebase onto spec.cwd at discovery time (reusing ProjectPaths.rebased), searching the worktree dir first with the configured dir as a defensive fallback. No-op in place and for artifact dirs configured outside the project tree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
policy.toml is the operator's orchestration config, tracked but living inside the kept .automator dir. A plain `git reset --hard` to baseline silently reverted an uncommitted edit — e.g. a freshly enabled scm.rollback_on_failure would vanish before it ever took effect — and a lone policy edit could read as attempt dirtiness, so the manual-recovery loop could never terminate. Always snapshot/restore policy.toml in safe_rollback and always exclude it in attempt_dirty, regardless of the preserve set, mirroring worktree_clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 23 minutes and 11 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThe PR bumps version metadata to 0.7.2, adds the matching changelog entry, updates ChangesWorktree-aware generic adapter
Policy.toml dirtiness and rollback
0.7.2 release metadata
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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: Releases Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| snapshot = out.strip() | ||
| # policy.toml first: always preserved (see above); preserve dirs follow. | ||
| restore = (POLICY_FILE_REL, *preserve) | ||
| rc, out = _git(repo, "stash", "create") |
There was a problem hiding this comment.
src/automator/verify.py:222: safe_rollback() only restores policy.toml when git stash create yields a non-empty snapshot, but git stash create typically outputs nothing on a clean working tree. If a rollback to baseline would remove policy.toml (e.g., the file was added/committed after baseline) and the tree is clean at rollback time, this path may still lose the policy file despite the intent to always restore it.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
Confirmed and fixed in e2b6df2. You're right — git stash create emits an empty snapshot on a clean tree, so a policy.toml change living in a commit after the baseline (with no other working-tree dirt) skipped the gated restore and was reverted by git reset --hard. The existing test_safe_rollback_restores_policy_deleted_by_reset only passed because it left an unrelated dirty src.txt in the tree, which kept the snapshot non-empty and masked the gap.
Fix: safe_rollback() now captures policy.toml's on-disk bytes before the reset and writes them back after, independent of the stash snapshot (the stash path now handles only the preserve dirs). This covers both the uncommitted-edit and committed-after-baseline cases. Added test_safe_rollback_restores_committed_policy_on_clean_tree (clean tree, no other dirt) as a regression — it fails on the old code and passes now.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/verify.py`:
- Around line 220-238: The rollback logic in verify.py does not reliably restore
POLICY_FILE_REL when git stash create returns an empty snapshot, so policy.toml
can be lost after git reset --hard. In the rollback flow around _git(...,
"stash", "create") and the restore loop, capture the current policy file content
before reset if it exists, then after the reset explicitly restore
POLICY_FILE_REL from that saved content regardless of whether snapshot is empty.
Keep the existing stash-based restore for preserve paths, but make policy.toml
restoration independent so committed or externally changed policy content is
always recovered.
🪄 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: 075bf4ad-e850-4b8a-8c95-30e6a7645d6d
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.claude-plugin/marketplace.jsonCHANGELOG.mdmodule.yamlpyproject.tomlsrc/automator/__init__.pysrc/automator/adapters/generic.pysrc/automator/cli.pysrc/automator/data/skills/bmad-auto-setup/assets/module.yamlsrc/automator/verify.pytests/test_generic_tmux.pytests/test_verify.py
… tree safe_rollback gated the policy.toml restore on a non-empty `git stash create` snapshot. On a clean working tree that snapshot is empty, so a policy.toml change living in a commit after the baseline (with no other working-tree dirt) skipped the restore and was reverted by `git reset --hard` — breaking the "always preserve policy.toml" guarantee. Capture policy.toml's on-disk bytes before the reset and write them back after, independent of the snapshot; the stash path now handles only the preserve dirs. Adds a clean-tree regression test (the existing committed- policy test only passed because an unrelated dirty file kept the snapshot non-empty). Addresses CodeRabbit + Augment review on PR #15. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
augment review |
|
|
||
| def test_safe_rollback_restores_policy_deleted_by_reset(project): | ||
| """policy.toml added/committed *after* the baseline would be deleted by a | ||
| reset to that older baseline; it is still restored from the snapshot.""" |
There was a problem hiding this comment.
test_safe_rollback_restores_policy_deleted_by_reset’s docstring says the file is “restored from the snapshot”, but safe_rollback() now restores policy.toml from the pre-reset on-disk capture (policy_content) regardless of the stash snapshot. Consider updating the docstring so it matches the mechanism being tested.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
Good catch — fixed in aa39064. Updated the docstring to say policy.toml is restored from the pre-reset on-disk capture (not the stash snapshot), and noted that the dirty src.txt here keeps the snapshot non-empty while the clean-tree/empty-snapshot path is covered by test_safe_rollback_restores_committed_policy_on_clean_tree below.
safe_rollback now restores policy.toml from its pre-reset on-disk capture, not the stash snapshot. Update test_safe_rollback_restores_policy_deleted_ by_reset's docstring to match. No behavior change. Addresses Augment review on PR #15. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0.7.2 — bug-fix release
Fixed
scm.isolation = worktreethebmad-dev-autosession runs with its cwd set to the worktree and leaves its terminal spec in the worktree's_bmad-output/implementation-artifacts, but the dev adapter searched the main checkout's dir (resolved once at startup). The completedstatus: donespec was never found, so the orchestrator misread the session as stalled, rolled the unit branch back to baseline, and re-ran the same story. The adapter now resolves the spec directory from the live session cwd; in-place runs and out-of-tree artifact dirs are unaffected.policy.tomledit no longer vanishes on rollback.policy.tomlis tracked but lives inside the kept.automatordir, so a rollback'sgit reset --hardto baseline silently reverted operator edits and a lone policy edit could register as attempt dirtiness, trapping the manual-recovery loop. Rollback now restorespolicy.tomlfrom its on-disk content unconditionally — so an edit committed after the baseline on an otherwise-clean tree survives too, not only one that rode a non-emptygit stashsnapshot — and the dirty check always excludes it.Summary by CodeRabbit
Bug Fixes
policy.tomledits.Chores
0.7.2.