fix(engine): reconcile transient in-review frontmatter to done (0.7.10)#27
Conversation
….10) A `bmad-dev-auto` session that dies in its step-04 Finalize tail leaves the spec frontmatter at the transient `in-review` marker while the `## Auto Run Result` prose already says `Status: done` — the same stale- frontmatter gate bug as 0.7.8 with a different value. The gates read only frontmatter, so completed, tested work false-deferred and was rolled back, then re-bundled on the next sweep (a ~47M-token/cycle loop). The 0.7.8 reconcile excluded `in-review` only to protect the legacy `bmad-auto-dev` review-handoff. That fork is retired; on the sole generic path `in-review` is never a deliberate terminal, so add it to `devcontract.RECONCILABLE_FROM`. The existing reconcile mutate-block already re-reads the frontmatter and re-attaches `followup_review_recommended` when it advances to done, so a `followup_review_recommended: true` spec still triggers the follow-up review pass; the prose `Status: done` requirement and every deterministic gate are unchanged. Tests: doctrine + reset_spec_status param (devcontract), 3 engine cases (advance-in-review, followup-true-runs-review, followup-false-skips), 1 sweep case (bundle ledger closes). Version 0.7.9 -> 0.7.10 + CHANGELOG. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
WalkthroughAdds Changesin-review Frontmatter Reconciliation + v0.7.10
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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: Fixes stale
🤖 Was this summary useful? React with 👍 or 👎 |
Problem
A
bmad-dev-autosession that dies in its step-04 Finalize tail leaves the spec frontmatter at the transientin-reviewmarker (set at the start of step-04) while the## Auto Run Resultprose already saysStatus: done. This is the same stale-frontmatter gate bug fixed in 0.7.8, with a different stale value.Since every gate reads only frontmatter, completed, tested work false-deferred → was rolled back → the open ledger entry got re-bundled on the next sweep → re-run and discarded again. Observed in
~/dev/Lights-Out: a repeating sweep loop burning ~47M tokens/cycle (e.g. DW-153, whose spec showed frontmatterin-review+ proseStatus: done+ 1432/1432 EditMode & 222/222 PlayMode green).The 0.7.8 reconcile (
_reconcile_generic_terminal_status) could not catch it becausein-reviewwas deliberately excluded fromdevcontract.RECONCILABLE_FROM.Fix
That exclusion only ever protected the legacy
bmad-auto-devfork's review-handoff, wherein-reviewwas a real terminal. That fork is retired; on the sole genericbmad-dev-autopath_dev_review_enabled()is alwaysFalse, so the success status is alwaysdoneandin-reviewis never a deliberate terminal."in-review"todevcontract.RECONCILABLE_FROM(one token) + rationale comment.engine.py(comment-only): the existing reconcile mutate-block already re-reads the frontmatter and re-attachesresult_json["followup_review_recommended"]when advancing todone, so afollowup_review_recommended: truespec still triggers the follow-up review pass (a secondbmad-dev-autorun — there is no separatebmad-auto-reviewskill).Status: donerequirement and every deterministic gate (worktree diff, dw-ids, verify commands, ledger) are unchanged — reconcile repairs bookkeeping only, it cannot pass uncompleted work.Scope is intentionally minimal: no prose-absent ("Mode B") handling, no adapter nudge.
Tests
test_devcontract.py— doctrine test updated to assertin-review∈ allowlist (anddone/blockedstill excluded);reset_spec_statusparametrize gainsin-review.test_engine.py—test_generic_reconcile_advances_in_review_frontmatter_done,_preserves_followup_review_true,_followup_false_skips_review.test_sweep.py—test_generic_bundle_reconcile_closes_ledger_on_in_review_frontmatter.Full suite 1226 passed,
trunk checkclean. Version bumped 0.7.9 → 0.7.10 (sync_version.py) + CHANGELOG[0.7.10].Recovery note
Rolled-back work left no code in the tree; the affected Lights-Out ledger entries stay open and will re-run + commit on the next post-fix sweep. No manual ledger edits.
🤖 Generated with Claude Code
Summary by CodeRabbit
in-reviewstate can now progress todonecorrectly.in-reviewappears.