Skip to content

Refactor TEA policy core integration#28

Open
dickymoore wants to merge 37 commits into
bmad-code-org:mainfrom
dickymoore:refactor/tea-policy-core
Open

Refactor TEA policy core integration#28
dickymoore wants to merge 37 commits into
bmad-code-org:mainfrom
dickymoore:refactor/tea-policy-core

Conversation

@dickymoore

@dickymoore dickymoore commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extract TEA policy selection and capability handling into core helpers
  • move progress table rendering and mutation into a core state-document layer
  • split TEA-focused tests into dedicated files with shared helpers

Notes

Validation

  • PYTHONPATH=skills/bmad-story-automator/src python3 -m unittest discover -s tests
  • npm run test:smoke
  • npm run pack:dry-run
  • local subreviews: no findings

Summary by CodeRabbit

  • New Features

    • Added an optional TEA workflow track with TEA configuration block and TEA-aware progress columns.
    • Extended CLI with policy/run helpers to build runtime policies, detect workflow track, and expose policy sequence/steps.
    • Added orchestration-backed state-progress updates for story progress.
  • Improvements

    • Policy handling is now more strictly validated and produces clearer structured error payloads.
    • Progress updates are more deterministic (no ad-hoc markdown editing), with safer storyRange/ID validation.
    • Updated TEA step orchestration and resume routing for additional step labels.
  • Tests

    • Added/expanded TEA flow, policy invariants, parsing, CLI, and progress-metric test coverage and supporting utilities.

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 96059c74-083f-4b59-8db3-450f1971b381

📥 Commits

Reviewing files that changed from the base of the PR and between e320c26 and 90fed7c.

📒 Files selected for processing (27)
  • scripts/run-smoke-policy-invariants.py
  • scripts/run-smoke-resume-matrix.py
  • skills/bmad-story-automator/data/orchestration-policy.json
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • skills/bmad-story-automator/src/story_automator/core/policy_state_rendering.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy_support.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy_config.py
  • skills/bmad-story-automator/src/story_automator/core/workflow_steps.py
  • skills/bmad-story-automator/steps-c/step-01b-continue.md
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • tests/test_orchestrator_parse.py
  • tests/test_policy_invariants.py
  • tests/test_progress_invariants.py
  • tests/test_resume_matrix.py
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • tests/test_tea_policy_flow.py
  • tests/test_tea_state_rendering.py
💤 Files with no reviewable changes (1)
  • skills/bmad-story-automator/data/orchestration-policy.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py

Walkthrough

Adds TEA workflow support: runtime-policy shape/snapshot handling, TEA run-policy builder and detector, state-document progress table generation and updates, orchestrator helper commands, CLI wiring, templates/docs updates, and many tests and test utilities.

Changes

TEA Workflow Support

Layer / File(s) Summary
Policy validation foundations
skills/bmad-story-automator/src/story_automator/core/runtime_policy_support.py
New 455-line module defining PolicyError, comprehensive policy schema validation (top-level keys, workflow sequences, step definitions, verifiers, labels), asset/data path resolution with confinement, JSON serialization, snapshot hash verification, and state policy mode detection.
Workflow definitions and runtime policy refactoring
skills/bmad-story-automator/src/story_automator/core/workflow_steps.py, skills/bmad-story-automator/src/story_automator/core/runtime_policy.py
New workflow_steps.py with WorkflowStep dataclass and workflow constants (standard/TEA sequences, step labels, optionality, skill aliases, helpers). Refactored runtime_policy.py delegating validation to support module, adding inline_override parameter, snapshot existence guards, and public utilities load_policy_shape_for_state, workflow_sequence, story_task_sequence.
TEA configuration and policy builders
skills/bmad-story-automator/src/story_automator/core/tea_policy_config.py, skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py, skills/bmad-story-automator/src/story_automator/core/tea_policy.py
New tea_policy_config.py for explicit policy file handling (path, loading, sequence extraction, normalization). New tea_policy_assets.py for asset-root resolution, skill availability, step contract generation, and completeness validation. New tea_policy.py implementing build_run_policy (run-specific overrides) and detect_workflow_track (TEA readiness detection).
State document and progress rendering
skills/bmad-story-automator/src/story_automator/core/state_document.py, skills/bmad-story-automator/src/story_automator/core/policy_state_rendering.py
New state_document.py generating Markdown progress tables from policy (headers, dividers, rows), normalizing/sanitizing progress values, updating rows in-place with validation, and parsing tables for metrics. New policy_state_rendering.py providing TEA frontmatter and summary block rendering.
Orchestrator state commands and CLI wiring
skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py, skills/bmad-story-automator/src/story_automator/commands/orchestrator.py, skills/bmad-story-automator/src/story_automator/commands/state.py, skills/bmad-story-automator/src/story_automator/cli.py
New orchestrator_state.py with action handlers for state/policy operations (state_list, state_latest, state_summary, state_update, policy_sequence, policy_steps, state_progress). Refactored orchestrator.py wiring commands to new handlers and removing in-file implementations. Updated cli.py registering build-run-policy and detect-workflow-track. Enhanced state.py with config validation, run-policy building, and state-document rendering with TEA support.
Agent error handling and policy-driven tasks
skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py, skills/bmad-story-automator/src/story_automator/core/agent_config.py
Updated to wrap policy loading in PolicyError handler, returning JSON error payload on failure. Compute tasks_in_scope from policy shape instead of fixed task list.
Step execution and routing updates
skills/bmad-story-automator/steps-c/*
Replaced sed/mktemp state edits with orchestrator-helper state-progress calls. Added TEA detection/preflight flow with user prompts and capability checking. Updated routing in step-01b for TEA step labels. Added ATDD execution with policy gating and outcome parsing in step-03-execute. Rewrote quality-phase runner, TEA step iteration, and progress management in step-03a-execute-review. Updated retrospective gating via policy sequence in step-03b-execute-finish.
Templates and documentation
skills/bmad-story-automator/templates/state-document.md, skills/bmad-story-automator/workflow.md, skills/bmad-story-automator/data/orchestration-policy.json
Added {{teaConfigurationBlock}} to state-document template. Updated workflow.md with TEA v1 scope clarification. Changed orchestration-policy step label to automate.
TEA data assets
skills/bmad-story-automator/data/tea-story-automator/prompts/tea_step.md, skills/bmad-story-automator/data/tea-story-automator/parse/tea_step.json
Added prompt and parse schema files for TEA workflow steps.
Test support utilities
tests/tea_test_support.py
New module providing patch_env context manager, bundle/skill installers, TEA asset writers, and tea_steps_override configuration helper.
Policy and invariant tests
tests/test_policy_invariants.py, tests/test_runtime_policy.py, tests/test_progress_invariants.py
New test_policy_invariants.py validating workflow requirements. Updated test_runtime_policy.py with inline-override and TEA allowlisting tests. New test_progress_invariants.py validating storyRange and column invariants.
Orchestrator and state tests
tests/test_orchestrator_progress.py, tests/test_resume_matrix.py, tests/test_agent_config_model.py, tests/test_orchestrator_parse.py
New test_orchestrator_progress.py covering state-progress and policy-sequence. New test_resume_matrix.py validating step routing. Updated agent config and parse tests with error handling and TEA step coverage.
TEA flow integration tests
tests/test_tea_detection.py, tests/test_tea_policy_flow.py, tests/test_tea_state_rendering.py, tests/test_state_policy_metadata.py
New comprehensive TEA detection, policy flow, and state rendering test suites. Refactored metadata tests to use shared utilities.
Smoke test runners
scripts/run-smoke-policy-invariants.py, scripts/run-smoke-resume-matrix.py
New smoke test runners for policy invariants and resume matrix with timeout and JSON output.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 A rabbit hops through TEA and code,
Policies pinned down on the road,
Progress tables neat in a row,
Automator humming — watch it go!
☕✨

Suggested reviewers

  • bma-d
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@dickymoore dickymoore marked this pull request as ready for review May 26, 2026 14:50
@dickymoore dickymoore requested a review from bma-d as a code owner May 26, 2026 14:50
@augmentcode

augmentcode Bot commented May 26, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR refactors TEA (Test Engineering Acceleration) workflow support into reusable core modules and makes the orchestrator policy-driven.

Changes:

  • Adds a core TEA policy module (core/tea_policy.py) with helpers for detecting TEA capability, building per-run policy overrides, and driving workflow sequencing from the pinned runtime policy snapshot.
  • Introduces core/state_document.py to own progress table rendering and per-column updates, replacing ad-hoc sed-based row rewrites in the step markdown.
  • Extracts orchestrator state actions (state-list, state-latest, state-summary, state-update, state-progress) into orchestrator_state.py, adding new policy-sequence and policy-steps helpers.
  • Defines workflow step metadata (core/workflow_steps.py) with step names, labels, track association, and aliases for canonical/legacy TEA skill names.
  • Moves low-level policy shape support functions to runtime_policy_support.py and adds label/sequence/duplicate validation.
  • Updates execution step docs (step-03, step-03a, step-03b) to guard ATDD/dev/auto/TEA-quality phases using the pinned policy sequence.
  • Splits TEA-focused tests into dedicated files with shared test helpers in tea_test_support.py.

Technical Notes: Standard workflows remain gated by the existing deterministic suite and smoke checks. TEA opt-in is policy-driven; the orchestrator never silently switches to TEA. The review step is now mandatory in all policy sequences.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread skills/bmad-story-automator/steps-c/step-03b-execute-finish.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
skills/bmad-story-automator/src/story_automator/commands/state.py (1)

42-50: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Validate config shape before accessing fields and building story ranges.

Line 50 assumes config is a dict, and Lines 62/174 assume storyRange is a list. With valid JSON that isn’t an object (or a string storyRange), this can crash or silently produce per-character story IDs instead of story keys.

Suggested fix
     try:
         config = json.loads(config_json)
     except json.JSONDecodeError:
         write_json({"ok": False, "error": "invalid_config_json"})
         return 1
+    if not isinstance(config, dict):
+        write_json({"ok": False, "error": "config_must_be_object"})
+        return 1
+    raw_story_range = config.get("storyRange", [])
+    if raw_story_range is not None and not isinstance(raw_story_range, list):
+        write_json({"ok": False, "error": "storyRange_must_be_array"})
+        return 1
+    story_range = [item for item in (raw_story_range or []) if isinstance(item, str)]
@@
-    progress_header, progress_divider, progress_rows = progress_table_lines(snapshot["policy"], [item for item in config.get("storyRange", []) if isinstance(item, str)])
+    progress_header, progress_divider, progress_rows = progress_table_lines(snapshot["policy"], story_range)
@@
-    story_range = [item for item in config.get("storyRange", []) if isinstance(item, str)]
+    # reuse validated story_range

Also applies to: 62-63, 174-174

🤖 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 `@skills/bmad-story-automator/src/story_automator/commands/state.py` around
lines 42 - 50, The code parses config_json into config but doesn't validate its
shape; add checks after json.loads to ensure config is a dict (if not,
write_json({"ok": False, "error": "invalid_config_shape"}) and return 1) and
validate that config.get("storyRange") is a list before using it (otherwise
return an error); update places that build story IDs/ranges to only iterate when
storyRange is a list and use safe access for epic (keep using epic =
str(config.get("epic") or "epic")) so non-object JSON or wrong types won't
produce per-character iteration or crashes.
skills/bmad-story-automator/steps-c/step-03b-execute-finish.md (1)

114-127: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Preserve retro-policy gating in the final trigger decision.

Lines 114-117 set trigger_retro=false when retro is not in policy, but Lines 123-127 can overwrite it back to true. This re-enables retrospective even when policy excludes it.

Suggested fix
 policy_sequence=$("{scriptsDir}" orchestrator-helper policy-sequence --state-file "{outputFile}")
-if ! echo "$policy_sequence" | jq -e '.ok == true and (.sequence | index("retro"))' >/dev/null; then
-    trigger_retro=false
-fi
+policy_has_retro=false
+if echo "$policy_sequence" | jq -e '.ok == true and (.sequence | index("retro"))' >/dev/null; then
+    policy_has_retro=true
+fi
@@
-if [ "$all_done" = "true" ] && [ "$epic_ok" = "true" ] && [ "$epic_complete" = "true" ]; then
+if [ "$policy_has_retro" = "true" ] && [ "$all_done" = "true" ] && [ "$epic_ok" = "true" ] && [ "$epic_complete" = "true" ]; then
     trigger_retro=true
 else
     trigger_retro=false
 fi
🤖 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 `@skills/bmad-story-automator/steps-c/step-03b-execute-finish.md` around lines
114 - 127, The current logic sets trigger_retro=false when the policy sequence
lacks "retro" (policy_sequence) but then unconditionally sets it to true if
story/epic checks pass; update the final gating so the policy check is honored:
preserve the earlier result (trigger_retro or a new boolean like
policy_allows_retro derived from policy_sequence) and include it in the combined
conditional alongside all_done, epic_ok, and epic_complete (i.e., require
policy_allows_retro to be true as well) so that retrospective is only triggered
when both policy and story/epic checks permit it; adjust uses of trigger_retro,
policy_sequence, epic_status, all_done, epic_ok, and epic_complete accordingly.
🧹 Nitpick comments (1)
tests/test_runtime_policy.py (1)

429-535: ⚡ Quick win

Use shared TEA test helpers instead of duplicating fixture builders.

Lines 429–535 duplicate helper behavior already centralized in tests/tea_test_support.py. Reusing the shared helpers will reduce drift and keep TEA policy fixtures consistent across suites.

Refactor direction
+from tests.tea_test_support import install_tea_skills, tea_steps_override
...
     def _install_tea_skills(self) -> None:
-        _write_tea_assets(self.project_root)
-        for name in (
-            "bmad-tea-testarch-atdd",
-            "bmad-tea-testarch-automate",
-            "bmad-tea-testarch-test-review",
-            "bmad-tea-testarch-trace",
-        ):
-            skill_dir = self.project_root / ".claude" / "skills" / name
-            skill_dir.mkdir(parents=True, exist_ok=True)
-            (skill_dir / "SKILL.md").write_text(f"# {name}\n", encoding="utf-8")
-            (skill_dir / "workflow.md").write_text(f"# {name}\n", encoding="utf-8")
+        install_tea_skills(self.project_root, include_nfr=False, canonical=False, write_assets=True)
...
-        steps = _tea_steps_override(self.project_root)
+        steps = tea_steps_override(include_nfr=False, canonical=False)
🤖 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_runtime_policy.py` around lines 429 - 535, The duplicated TEA
fixture builders (_install_tea_skills, _write_tea_assets, _tea_steps_override)
should be replaced with the shared helpers from tests/tea_test_support.py:
remove these local implementations and import the canonical helpers (e.g. the
tea asset writer/installer and steps override factory) from
tests.tea_test_support, then call those helper functions in tests instead of
reimplementing them so the suite uses the centralized TEA fixtures (reference
the local symbols _install_tea_skills, _write_tea_assets, and
_tea_steps_override to find and remove the duplicated code).
🤖 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 `@skills/bmad-story-automator/src/story_automator/core/state_document.py`:
- Around line 145-152: The metrics parser currently removes empty cells (values
= [part for part in parts[1:-1] if part]) which shifts columns and then uses
substring matching to detect completion (any(token in values[-1].lower() ...))
causing false positives like "incomplete"; update the logic to preserve empty
cells by assigning values = parts[1:-1] (but still strip whitespace when
checking), detect header separator by checking re.fullmatch(r"-+",
values[0].strip()) on the preserved first_cell, increment total using the
correct last column value, and determine completion by comparing
values[-1].strip().lower() for exact equality against a set like
{"done","complete","completed"} (or membership test) before incrementing
completed.

In `@tests/test_orchestrator_progress.py`:
- Around line 139-142: Update the _md5_hex8 helper to mark MD5 usage as
non-security by calling hashlib.md5(..., usedforsecurity=False) so Ruff S324 is
satisfied; locate the function _md5_hex8 and modify the hashlib.md5 invocation
to pass usedforsecurity=False before encoding and slicing the hexdigest, keeping
the returned value as the first 8 hex chars.

In `@tests/test_runtime_policy.py`:
- Around line 89-101: The test
test_tea_policy_fails_when_required_tea_skill_missing is currently ambiguous
because failure could be due to missing TEA assets rather than the missing
skill; update the test to precreate the required TEA assets (use the same
helpers/setup used elsewhere in tests or create the minimal files under
self.project_root before calling _write_override) so the only remaining failure
is the missing skill, then call load_effective_policy(str(self.project_root))
inside an assertRaisesRegex or similar to check PolicyError and assert the error
message contains the expected text about the missing TEA skill; keep references
to _tea_steps_override, _write_override, load_effective_policy, and PolicyError
when locating where to change the test.

In `@tests/test_tea_state_rendering.py`:
- Around line 229-232: The test currently assumes the desired note is at
payload["notes"][0], which is order-coupled and brittle; update the assertion to
check that at least one element in payload["notes"] contains the substring
"checkpoint-preview is out of scope" (e.g., replace the index-based
self.assertIn on payload["notes"][0] with an existence check such as any(...) or
a loop/collection membership check over payload["notes"]). Ensure you modify the
assertion around the payload variable in tests/test_tea_state_rendering.py so it
scans the whole notes list rather than indexing element 0.

---

Outside diff comments:
In `@skills/bmad-story-automator/src/story_automator/commands/state.py`:
- Around line 42-50: The code parses config_json into config but doesn't
validate its shape; add checks after json.loads to ensure config is a dict (if
not, write_json({"ok": False, "error": "invalid_config_shape"}) and return 1)
and validate that config.get("storyRange") is a list before using it (otherwise
return an error); update places that build story IDs/ranges to only iterate when
storyRange is a list and use safe access for epic (keep using epic =
str(config.get("epic") or "epic")) so non-object JSON or wrong types won't
produce per-character iteration or crashes.

In `@skills/bmad-story-automator/steps-c/step-03b-execute-finish.md`:
- Around line 114-127: The current logic sets trigger_retro=false when the
policy sequence lacks "retro" (policy_sequence) but then unconditionally sets it
to true if story/epic checks pass; update the final gating so the policy check
is honored: preserve the earlier result (trigger_retro or a new boolean like
policy_allows_retro derived from policy_sequence) and include it in the combined
conditional alongside all_done, epic_ok, and epic_complete (i.e., require
policy_allows_retro to be true as well) so that retrospective is only triggered
when both policy and story/epic checks permit it; adjust uses of trigger_retro,
policy_sequence, epic_status, all_done, epic_ok, and epic_complete accordingly.

---

Nitpick comments:
In `@tests/test_runtime_policy.py`:
- Around line 429-535: The duplicated TEA fixture builders (_install_tea_skills,
_write_tea_assets, _tea_steps_override) should be replaced with the shared
helpers from tests/tea_test_support.py: remove these local implementations and
import the canonical helpers (e.g. the tea asset writer/installer and steps
override factory) from tests.tea_test_support, then call those helper functions
in tests instead of reimplementing them so the suite uses the centralized TEA
fixtures (reference the local symbols _install_tea_skills, _write_tea_assets,
and _tea_steps_override to find and remove the duplicated code).
🪄 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: 6639226b-58ba-4e14-95a0-5be4381f5776

📥 Commits

Reviewing files that changed from the base of the PR and between 8176f31 and cd12d4c.

📒 Files selected for processing (27)
  • skills/bmad-story-automator/data/orchestration-policy.json
  • skills/bmad-story-automator/data/tea-story-automator/parse/tea_step.json
  • skills/bmad-story-automator/data/tea-story-automator/prompts/tea_step.md
  • skills/bmad-story-automator/src/story_automator/cli.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • skills/bmad-story-automator/src/story_automator/core/agent_config.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy.py
  • skills/bmad-story-automator/src/story_automator/core/state_document.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy.py
  • skills/bmad-story-automator/steps-c/step-01b-continue.md
  • skills/bmad-story-automator/steps-c/step-02a-preflight-config.md
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • skills/bmad-story-automator/templates/state-document.md
  • skills/bmad-story-automator/workflow.md
  • tests/tea_test_support.py
  • tests/test_agent_config_model.py
  • tests/test_orchestrator_parse.py
  • tests/test_orchestrator_progress.py
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • tests/test_tea_policy_flow.py
  • tests/test_tea_state_rendering.py

Comment thread skills/bmad-story-automator/src/story_automator/core/state_document.py Outdated
Comment thread tests/test_orchestrator_progress.py Outdated
Comment thread tests/test_runtime_policy.py
Comment thread tests/test_tea_state_rendering.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@skills/bmad-story-automator/src/story_automator/commands/state.py`:
- Around line 50-55: The code currently silently filters non-string items from
raw_story_range; instead validate that config.get("storyRange") when present is
a list of strings: after fetching raw_story_range, if raw_story_range is not
None and not isinstance(raw_story_range, list) return the existing error, and if
it is a list but any(not isinstance(item, str) for item in raw_story_range) call
write_json({"ok": False, "error": "storyRange_must_be_array_of_strings"}) and
return 1; only then set story_range = raw_story_range (or list(raw_story_range))
and continue to ensure_dir(output_folder).
🪄 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: c58b7b79-1876-4653-b9fb-edd8ad11d8b4

📥 Commits

Reviewing files that changed from the base of the PR and between cd12d4c and 7874e8c.

📒 Files selected for processing (6)
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • skills/bmad-story-automator/src/story_automator/core/state_document.py
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • tests/test_orchestrator_progress.py
  • tests/test_runtime_policy.py
  • tests/test_tea_state_rendering.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/test_orchestrator_progress.py
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • skills/bmad-story-automator/src/story_automator/core/state_document.py
  • tests/test_tea_state_rendering.py

Comment thread skills/bmad-story-automator/src/story_automator/commands/state.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@scripts/run-smoke-policy-invariants.py`:
- Line 24: The subprocess.run call that assigns to completed may hang; add a
timeout argument (e.g., timeout=300) to subprocess.run(cmd, text=True,
capture_output=True, cwd=repo_root, env=env) and wrap the call in a try/except
for subprocess.TimeoutExpired to handle timeouts gracefully (log or print a
clear message and set a non-zero exit/result). Update the code around the
completed assignment and the timeout handling should reference subprocess.run,
cmd, repo_root, env and handle subprocess.TimeoutExpired to avoid indefinitely
stalled CI/smoke jobs.

In `@scripts/run-smoke-resume-matrix.py`:
- Line 23: The subprocess.run call that assigns to completed currently blocks
indefinitely; add a timeout argument to subprocess.run (e.g., timeout=...) and
wrap the call in a try/except for subprocess.TimeoutExpired to handle hung runs;
on timeout, terminate/cleanup if needed, log an error including cmd and timeout
duration, and exit non-zero (or set appropriate return status) so the smoke
pipeline fails fast—update the call site where completed = subprocess.run(cmd,
text=True, capture_output=True, cwd=repo_root, env=env) and add the exception
handling around subprocess.run.
🪄 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: 986138ba-bf08-4dd3-8108-bdd3b1483a50

📥 Commits

Reviewing files that changed from the base of the PR and between e320c26 and 089740f.

📒 Files selected for processing (16)
  • scripts/run-smoke-policy-invariants.py
  • scripts/run-smoke-resume-matrix.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy.py
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • tests/test_policy_invariants.py
  • tests/test_progress_invariants.py
  • tests/test_resume_matrix.py
  • tests/test_runtime_policy.py
  • tests/test_tea_detection.py
  • tests/test_tea_policy_flow.py
  • tests/test_tea_state_rendering.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • tests/test_runtime_policy.py
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • tests/test_tea_detection.py
  • tests/test_tea_state_rendering.py

Comment thread scripts/run-smoke-policy-invariants.py Outdated
Comment thread scripts/run-smoke-resume-matrix.py Outdated
@dickymoore

Copy link
Copy Markdown
Contributor Author

Addressed the latest review comments on this branch.

Main fixes in this pass:

  • tightened Step 03 / 03a / 03b execution guards so skipped steps don’t write progress and invalid pinned-policy lookups fail closed
  • fixed TEA quality-step resume behavior so resume no longer replays earlier TEA steps
  • made includeRetro consistent on the TEA track, including explicit ignored-with-note behavior when an explicit TEA policy owns the sequence
  • tightened state/policy invariants around mandatory review, duplicate sequence entries, duplicate story IDs, markdown-unsafe story IDs, and progress-label collisions
  • hardened the new standalone smoke wrappers so they are actually standalone and fail with structured timeout JSON instead of hanging/crashing

I also followed the direction of PR 32 in a bounded way by adding standalone local verification for the maintainer repro classes, without widening this PR into the broader deterministic smoke work:

  • policy invariants
  • progress/state invariants
  • resume-matrix checks
  • standalone smoke wrappers for those checks

Local verification:

  • full deterministic suite passed
  • smoke passed
  • targeted standalone invariant/resume checks passed
  • local adversarial review loop was run repeatedly until it came back clean

@dickymoore dickymoore requested a review from bma-d June 4, 2026 15:36
@bma-d

bma-d commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@augmentcode review
@coderabbitai review

@augmentcode

augmentcode Bot commented Jun 12, 2026

Copy link
Copy Markdown

This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment "augment review" and we will review it.

@bma-d

bma-d commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

augment review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

@bma-d Sure, I'll kick off a review of PR #28 now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@augmentcode

augmentcode Bot commented Jun 12, 2026

Copy link
Copy Markdown

Sorry, Augment failed to review this pull request.

@bma-d

bma-d commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

augment review

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread tests/test_orchestrator_parse.py
Comment thread skills/bmad-story-automator/src/story_automator/commands/state.py
@bma-d

bma-d commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

@augmentcode review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

@bma-d Sure, I'll kick off a review of PR #28 now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
skills/bmad-story-automator/src/story_automator/core/workflow_steps.py (1)

46-47: 💤 Low value

Use TEA_OPTIONAL_STEPS constant instead of hardcoded tuple.

The function hardcodes ("nfr", "retro") while TEA_OPTIONAL_STEPS is defined on line 40 with the same values. Using the constant avoids drift.

♻️ Suggested fix
 def selected_optional_steps_from_sequence(sequence: list[str]) -> list[str]:
-    return [step for step in ("nfr", "retro") if step in sequence]
+    return [step for step in TEA_OPTIONAL_STEPS if step in sequence]
🤖 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 `@skills/bmad-story-automator/src/story_automator/core/workflow_steps.py`
around lines 46 - 47, The function selected_optional_steps_from_sequence
hardcodes the tuple ("nfr", "retro") in its list comprehension instead of using
the TEA_OPTIONAL_STEPS constant that is already defined on line 40 with the same
values. Replace the hardcoded tuple with TEA_OPTIONAL_STEPS in the list
comprehension to maintain a single source of truth and prevent drift if the
constant is updated in the future.
skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py (1)

145-156: 💤 Low value

Duplicated required-files list.

Lines 145-154 duplicate the required files list from tea_assets_complete_for_base (lines 61-70). Consider extracting to a shared constant or helper to avoid drift if the list changes.

🤖 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 `@skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py`
around lines 145 - 156, The required files list in this section (containing the
prompts and parse files: atdd.md, test_automate.md, test_review.md, trace.md,
and their corresponding .json files) duplicates an identical list that appears
in the tea_assets_complete_for_base function. Extract this list into a
module-level constant at the top of the file, then replace both occurrences (the
one here and the one in tea_assets_complete_for_base) with references to this
shared constant to prevent maintenance issues and drift if the list needs to
change in the future.
🤖 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
`@skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py`:
- Around line 98-99: The argument parsing logic for the `--set` flag in the
condition checking `if args[idx] == "--set"` does not validate that the argument
contains an equals sign before splitting. Add a check to verify that `args[idx +
1]` contains the `=` character before calling split, and either raise a clear
error message or skip the invalid argument if the format is incorrect (missing
the equals sign or value).

In `@skills/bmad-story-automator/steps-c/step-01b-continue.md`:
- Line 71: The fenced code block containing the warning message about Stories
being incomplete in sprint-status.yaml is missing a language label, which
violates markdownlint MD040. Add the language label "text" immediately after the
opening three backticks (```) of this fenced code block to resolve the linting
issue.

---

Nitpick comments:
In `@skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py`:
- Around line 145-156: The required files list in this section (containing the
prompts and parse files: atdd.md, test_automate.md, test_review.md, trace.md,
and their corresponding .json files) duplicates an identical list that appears
in the tea_assets_complete_for_base function. Extract this list into a
module-level constant at the top of the file, then replace both occurrences (the
one here and the one in tea_assets_complete_for_base) with references to this
shared constant to prevent maintenance issues and drift if the list needs to
change in the future.

In `@skills/bmad-story-automator/src/story_automator/core/workflow_steps.py`:
- Around line 46-47: The function selected_optional_steps_from_sequence
hardcodes the tuple ("nfr", "retro") in its list comprehension instead of using
the TEA_OPTIONAL_STEPS constant that is already defined on line 40 with the same
values. Replace the hardcoded tuple with TEA_OPTIONAL_STEPS in the list
comprehension to maintain a single source of truth and prevent drift if the
constant is updated in the future.
🪄 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: 96059c74-083f-4b59-8db3-450f1971b381

📥 Commits

Reviewing files that changed from the base of the PR and between e320c26 and 90fed7c.

📒 Files selected for processing (27)
  • scripts/run-smoke-policy-invariants.py
  • scripts/run-smoke-resume-matrix.py
  • skills/bmad-story-automator/data/orchestration-policy.json
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • skills/bmad-story-automator/src/story_automator/core/policy_state_rendering.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy_support.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy_config.py
  • skills/bmad-story-automator/src/story_automator/core/workflow_steps.py
  • skills/bmad-story-automator/steps-c/step-01b-continue.md
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • tests/test_orchestrator_parse.py
  • tests/test_policy_invariants.py
  • tests/test_progress_invariants.py
  • tests/test_resume_matrix.py
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • tests/test_tea_policy_flow.py
  • tests/test_tea_state_rendering.py
💤 Files with no reviewable changes (1)
  • skills/bmad-story-automator/data/orchestration-policy.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🧹 Nitpick comments (2)
skills/bmad-story-automator/src/story_automator/core/workflow_steps.py (1)

46-47: 💤 Low value

Use TEA_OPTIONAL_STEPS constant instead of hardcoded tuple.

The function hardcodes ("nfr", "retro") while TEA_OPTIONAL_STEPS is defined on line 40 with the same values. Using the constant avoids drift.

♻️ Suggested fix
 def selected_optional_steps_from_sequence(sequence: list[str]) -> list[str]:
-    return [step for step in ("nfr", "retro") if step in sequence]
+    return [step for step in TEA_OPTIONAL_STEPS if step in sequence]
🤖 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 `@skills/bmad-story-automator/src/story_automator/core/workflow_steps.py`
around lines 46 - 47, The function selected_optional_steps_from_sequence
hardcodes the tuple ("nfr", "retro") in its list comprehension instead of using
the TEA_OPTIONAL_STEPS constant that is already defined on line 40 with the same
values. Replace the hardcoded tuple with TEA_OPTIONAL_STEPS in the list
comprehension to maintain a single source of truth and prevent drift if the
constant is updated in the future.
skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py (1)

145-156: 💤 Low value

Duplicated required-files list.

Lines 145-154 duplicate the required files list from tea_assets_complete_for_base (lines 61-70). Consider extracting to a shared constant or helper to avoid drift if the list changes.

🤖 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 `@skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py`
around lines 145 - 156, The required files list in this section (containing the
prompts and parse files: atdd.md, test_automate.md, test_review.md, trace.md,
and their corresponding .json files) duplicates an identical list that appears
in the tea_assets_complete_for_base function. Extract this list into a
module-level constant at the top of the file, then replace both occurrences (the
one here and the one in tea_assets_complete_for_base) with references to this
shared constant to prevent maintenance issues and drift if the list needs to
change in the future.
🤖 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
`@skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py`:
- Around line 98-99: The argument parsing logic for the `--set` flag in the
condition checking `if args[idx] == "--set"` does not validate that the argument
contains an equals sign before splitting. Add a check to verify that `args[idx +
1]` contains the `=` character before calling split, and either raise a clear
error message or skip the invalid argument if the format is incorrect (missing
the equals sign or value).

In `@skills/bmad-story-automator/steps-c/step-01b-continue.md`:
- Line 71: The fenced code block containing the warning message about Stories
being incomplete in sprint-status.yaml is missing a language label, which
violates markdownlint MD040. Add the language label "text" immediately after the
opening three backticks (```) of this fenced code block to resolve the linting
issue.

---

Nitpick comments:
In `@skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py`:
- Around line 145-156: The required files list in this section (containing the
prompts and parse files: atdd.md, test_automate.md, test_review.md, trace.md,
and their corresponding .json files) duplicates an identical list that appears
in the tea_assets_complete_for_base function. Extract this list into a
module-level constant at the top of the file, then replace both occurrences (the
one here and the one in tea_assets_complete_for_base) with references to this
shared constant to prevent maintenance issues and drift if the list needs to
change in the future.

In `@skills/bmad-story-automator/src/story_automator/core/workflow_steps.py`:
- Around line 46-47: The function selected_optional_steps_from_sequence
hardcodes the tuple ("nfr", "retro") in its list comprehension instead of using
the TEA_OPTIONAL_STEPS constant that is already defined on line 40 with the same
values. Replace the hardcoded tuple with TEA_OPTIONAL_STEPS in the list
comprehension to maintain a single source of truth and prevent drift if the
constant is updated in the future.
🪄 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: 96059c74-083f-4b59-8db3-450f1971b381

📥 Commits

Reviewing files that changed from the base of the PR and between e320c26 and 90fed7c.

📒 Files selected for processing (27)
  • scripts/run-smoke-policy-invariants.py
  • scripts/run-smoke-resume-matrix.py
  • skills/bmad-story-automator/data/orchestration-policy.json
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py
  • skills/bmad-story-automator/src/story_automator/core/policy_state_rendering.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy.py
  • skills/bmad-story-automator/src/story_automator/core/runtime_policy_support.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy_assets.py
  • skills/bmad-story-automator/src/story_automator/core/tea_policy_config.py
  • skills/bmad-story-automator/src/story_automator/core/workflow_steps.py
  • skills/bmad-story-automator/steps-c/step-01b-continue.md
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • tests/test_orchestrator_parse.py
  • tests/test_policy_invariants.py
  • tests/test_progress_invariants.py
  • tests/test_resume_matrix.py
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • tests/test_tea_policy_flow.py
  • tests/test_tea_state_rendering.py
💤 Files with no reviewable changes (1)
  • skills/bmad-story-automator/data/orchestration-policy.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • skills/bmad-story-automator/steps-c/step-03b-execute-finish.md
  • skills/bmad-story-automator/src/story_automator/commands/orchestrator_epic_agents.py
  • skills/bmad-story-automator/steps-c/step-03-execute.md
  • skills/bmad-story-automator/steps-c/step-03a-execute-review.md
  • tests/test_runtime_policy.py
  • tests/test_state_policy_metadata.py
  • tests/test_tea_detection.py
  • skills/bmad-story-automator/src/story_automator/commands/state.py
🛑 Comments failed to post (2)
skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py (1)

98-99: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Missing validation for --set argument format.

If args[idx + 1] doesn't contain =, split("=", 1) returns a single-element list, causing ValueError on unpacking to key, value.

🐛 Proposed fix
         if args[idx] == "--set" and idx + 1 < len(args):
+            if "=" not in args[idx + 1]:
+                print_json({"ok": False, "error": "invalid_set_argument", "argument": args[idx + 1]})
+                return 1
             key, value = args[idx + 1].split("=", 1)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        if args[idx] == "--set" and idx + 1 < len(args):
            if "=" not in args[idx + 1]:
                print_json({"ok": False, "error": "invalid_set_argument", "argument": args[idx + 1]})
                return 1
            key, value = args[idx + 1].split("=", 1)
🤖 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
`@skills/bmad-story-automator/src/story_automator/commands/orchestrator_state.py`
around lines 98 - 99, The argument parsing logic for the `--set` flag in the
condition checking `if args[idx] == "--set"` does not validate that the argument
contains an equals sign before splitting. Add a check to verify that `args[idx +
1]` contains the `=` character before calling split, and either raise a clear
error message or skip the invalid argument if the format is incorrect (missing
the equals sign or value).
skills/bmad-story-automator/steps-c/step-01b-continue.md (1)

71-71: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language label to the fenced block.

The unlabeled fence will keep tripping markdownlint MD040 for this doc.

Suggested patch
-  ```
+  ```text
   **Warning:** Stories {X, Y} are not complete in sprint-status.yaml.
 
   [B]atch them first - Add to queue before continuing
   [S]kip - Continue from current story anyway
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 71-71: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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 `@skills/bmad-story-automator/steps-c/step-01b-continue.md` at line 71, The
fenced code block containing the warning message about Stories being incomplete
in sprint-status.yaml is missing a language label, which violates markdownlint
MD040. Add the language label "text" immediately after the opening three
backticks (```) of this fenced code block to resolve the linting issue.

Source: Linters/SAST tools

@augmentcode

augmentcode Bot commented Jun 17, 2026

Copy link
Copy Markdown

Sorry, Augment failed to review this pull request.

@bma-d

bma-d commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

augmentcode review

@augmentcode

augmentcode Bot commented Jun 17, 2026

Copy link
Copy Markdown

Sorry, Augment failed to review this pull request.

@bma-d

bma-d commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

augmentcode review

@augmentcode

augmentcode Bot commented Jun 17, 2026

Copy link
Copy Markdown

Sorry, Augment failed to review this pull request.

@bma-d

bma-d commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

augment review

@augmentcode

augmentcode Bot commented Jun 18, 2026

Copy link
Copy Markdown

Sorry, Augment failed to review this pull request.

@bma-d

bma-d commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@augmentcode review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

@bma-d Sure, I'll kick off a review of PR #28 now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@augmentcode

augmentcode Bot commented Jun 18, 2026

Copy link
Copy Markdown

Sorry, Augment failed to review this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants