Skip to content

test: add deterministic smoke coverage#32

Open
bma-d wants to merge 19 commits into
bma-d/e2e-testsfrom
bma-d/smoke-suite
Open

test: add deterministic smoke coverage#32
bma-d wants to merge 19 commits into
bma-d/e2e-testsfrom
bma-d/smoke-suite

Conversation

@bma-d

@bma-d bma-d commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds deterministic smoke coverage for the Story Automator control plane on top of bma-d/e2e-tests.

This PR hardens the package/install, helper-contract, mode, dev-loop, finish-loop, retrospective, wrapup, and host-isolation smoke surfaces so smoke readiness is backed by structured assertions instead of command-exit-only success.

Changes

  • Adds the deterministic smoke coverage plan and gate map under docs/plans/automator-deterministic-smoke-coverage/.
  • Adds package/version/input assertions for release metadata, tarball identity, installed manifests, required package files, executable modes, and forbidden generated paths.
  • Adds smoke runners for contract matrices, create/dev/resume/validate/edit mode coverage, and finish-loop lifecycle coverage.
  • Wires fast deterministic gates into npm run verify.
  • Adds npm run smoke:deterministic-full for the explicit prepared-repo release smoke.
  • Extends parser support for BMAD numbered story headers such as ### 1.1: ....

Docs For Review

  • docs/plans/automator-deterministic-smoke-coverage/README.md: plan intent, boundaries, and release-blocking priorities.
  • docs/plans/automator-deterministic-smoke-coverage/gate-map.md: command ownership, pass/fail signal, diagnostics, and reset/cache policy for each gate.
  • docs/plans/automator-deterministic-smoke-coverage/implementation-notes.md: implementation decisions, tradeoffs, and remaining live/manual boundaries.
  • docs/development.md: prepared .smoke/gunz setup and local smoke usage.
  • docs/changelog/260602.md: chronological implementation summary.

Local Verification

Route: T4 broad/source/unknown.

Rationale: this branch changes package scripts, smoke runners, runtime helper contracts, parser behavior, tests, and release-readiness docs.

Passed:

  • git diff --check origin/bma-d/e2e-tests...HEAD
  • npm run verify
  • npm run smoke:deterministic-full
  • isolated Python package build/install/CLI check:
    • python3 -m venv <tmp>/venv
    • <tmp>/venv/bin/python -m pip install --upgrade pip build
    • <tmp>/venv/bin/python -m build skills/bmad-story-automator --outdir <tmp>/dist
    • <tmp>/venv/bin/python -m pip install <tmp>/dist/*.whl
    • <tmp>/venv/bin/python -m story_automator --help
    • <tmp>/venv/bin/story-automator --help
  • unsafe host target negative probe:
    • PYTHONPATH=skills/bmad-story-automator/src python3 scripts/run-smoke-finish-loop.py --target-repo /Users/joon/.codex/worktrees/9b27/bmad-story-automator
    • expected failure observed: unsafe commit repo outside smoke workspace

Smoke artifacts checked:

  • .smoke/PACKAGE_IDENTITY.json
  • .smoke/INSTALLED_AUTOMATOR_MANIFEST.json
  • .smoke/MODE_SMOKE_REPORT.json
  • .smoke/FINISH_LOOP_SMOKE_REPORT.json
  • .smoke/AUTOMATED_SMOKE_REPORT.md
  • .smoke/AUTOMATED_DEV_LOOP_SMOKE_REPORT.md

Key asserted outcomes:

  • package identity: bmad-story-automator@1.15.0, 195 packed entries
  • installed root: .claude/skills
  • finish-loop: 3 of 3 stories completed
  • unsafe host target rejected
  • marker removed during wrapup
  • host HEAD/status unchanged

Skipped by route:

  • Live provider/auth quality checks. Deterministic smoke intentionally does not claim Claude/Codex auth, rate limits, trust prompts, provider outages, or semantic quality of generated stories/code/reviews.
  • Waiting on GitHub-hosted CI. Local routed verification is the readiness record for this PR creation pass.

Reviewer Guide

Suggested review order:

  1. Read gate-map.md first to understand which behavior each command proves.
  2. Review scripts/smoke_prep/package_contracts.py and scripts/prepare-smoke-test.py for package/install identity guarantees.
  3. Review scripts/run-smoke-contracts.py, tests/test_runtime_helper_contracts.py, and related helper tests for fail-closed contract coverage.
  4. Review scripts/run-smoke-modes.py for create/resume/validate/edit assertions.
  5. Review scripts/run-smoke-finish-loop.py for commit isolation, review/finalize, retrospective skip semantics, wrapup, and unsafe-target rejection.
  6. Review package.json gate wiring last.

High-risk areas:

  • .smoke reset and package install flow
  • host commit isolation around commit-story
  • story-file versus sprint-status.yaml source-of-truth fallback behavior
  • bmad-method@next handling as a recorded/asserted moving input
  • keeping default verify fast while preserving explicit release smoke coverage

Split Decision

Kept as one PR. The docs, gate wiring, smoke runners, helper contracts, and tests all support one technical goal: deterministic Story Automator smoke readiness. Splitting would separate the proof scripts from the gate map and make review less coherent.

Known Boundaries

  • Deterministic smoke verifies the automator control plane, source-of-truth transitions, package/install identity, and helper contracts.
  • It does not verify live LLM output quality or external provider behavior.
  • Prepared-repo smoke still uses the pinned gunz commit while recording/asserting the resolved bmad-method@next package identity.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added comprehensive deterministic smoke testing framework with multi-phase planning, execution scripts, and verification gates.
    • Added new verification scripts for package contracts, version alignment, and smoke test workflows.
    • Expanded npm verify pipeline to include package assertions and smoke contract testing.
  • Documentation

    • Added detailed planning documents for deterministic smoke coverage across six implementation phases.
    • Added implementation guides, handoff logs, and baseline coverage documentation.
    • Updated development documentation with smoke preparation instructions.
  • Tests

    • Added contract test suites for CLI parsing, runtime helpers, and smoke scripts.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd85e171-79e0-406a-9178-f3ba7b30547e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Adds a complete deterministic smoke coverage system for the Story Automator. Changes include: an epic parser extension for broader header formats and ID-based selection; a new scripts/smoke_prep/ Python library for pinned repo preparation and package contract validation; five smoke runner scripts covering create/dev/modes/finish/contracts flows; twelve new npm scripts wiring these gates into verify; runtime helper and smoke script contract test suites; and a six-phase planning document set with handoff logs, gate maps, and implementation notes.

Changes

Deterministic Smoke Coverage System

Layer / File(s) Summary
Epic parser breadth, version bump, and CLI tests
skills/bmad-story-automator/src/story_automator/core/epic_parser.py, skills/bmad-story-automator/workflow.md, docs/versioning.md, tests/test_cli_contracts.py
epic_parser.py gains case-insensitive regex, optional Story prefix matching, a composite boundary_re, and an id_index for ID-based story range selection. workflow.md version bumps from 1.12.0 to 1.15.0, docs/versioning.md adds it to the release checklist, and three new CLI contract tests validate BMAD-style headers and --ids selection.
smoke_prep Python library
scripts/smoke_prep/__init__.py, scripts/smoke_prep/config.py, scripts/smoke_prep/process.py, scripts/smoke_prep/workspace.py, scripts/smoke_prep/gunz.py, scripts/smoke_prep/inputs.py, scripts/smoke_prep/package_contracts.py, scripts/smoke_prep/automator.py, scripts/smoke_prep/cli.py, scripts/smoke_prep/report.py
Introduces the full smoke_prep package: repo config constants and repo_root(); SmokeError, deterministic_smoke_env, subprocess/tool utilities; gitignored workspace resolution/reset; pinned gunz repo clone+commit verification; bmad-method npm resolution and SMOKE_INPUTS.json writing; npm pack dry-run and real-pack tarball/checksum contract assertions with PACKAGE_IDENTITY.json and INSTALLED_AUTOMATOR_MANIFEST.json output; BMAD and automator install plus layout verification; CLI parse_args/main; and SMOKE_NEXT_STEPS.md generation.
CLI gate check scripts
scripts/check-version-alignment.py, scripts/check-smoke-inputs.py, scripts/assert-package-contracts.py, scripts/prepare-smoke-test.py
Four thin CLI scripts: check-version-alignment.py compares versions across package.json, Claude plugin, __init__.py, pyproject.toml, and workflow.md; check-smoke-inputs.py validates deterministic input generation; assert-package-contracts.py runs pack assertions and emits identity JSON; prepare-smoke-test.py delegates to smoke_prep.cli.main().
Smoke runner scripts
scripts/run-smoke-contracts.py, scripts/run-smoke-automator.py, scripts/run-smoke-dev-loop.py, scripts/run-smoke-modes.py, scripts/run-smoke-finish-loop.py
Five runners: run-smoke-contracts.py dispatches the unittest suite with skip-reason gating; run-smoke-automator.py orchestrates a single-story create/state/marker/artifact/verify pipeline; run-smoke-dev-loop.py runs a two-story create/dev/sprint-status transition loop; run-smoke-modes.py exercises all automator modes (preflight, startup, state, resume, marker lifecycle, validate, edit) in a temp project; run-smoke-finish-loop.py seeds a git-backed fixture and runs a multi-story finish/review/retro/wrapup flow with host isolation verification.
npm wiring, gitignore, and contract tests
.gitignore, package.json, tests/test_runtime_helper_contracts.py, tests/test_smoke_script_contracts.py
.gitignore ignores .smoke/; package.json rewrites verify to include version:check/pack:assert/smoke:contracts/smoke:modes/test:smoke and adds twelve new smoke-related scripts. test_runtime_helper_contracts.py covers parse_output_action fail-closed matrix, _build_cmd safety branches, cmd_monitor_session terminal state matrix, _terminal_runner_status edge mapping, and optional tmux runner tests. test_smoke_script_contracts.py covers version-alignment, smoke-contract skip gating, deterministic env cleanup, smoke-prep CLI failure, modes JSON parsing, story slug generation, and finish-loop diagnostics path redaction.
Planning docs, handoff log, and changelog
docs/plans/automator-deterministic-smoke-coverage/*, docs/development.md, docs/changelog/260602.md
Adds the full six-phase plan set: README, phase 01–06 spec files, per-phase TODO checklists, coverage-baseline.md, gate-map.md, implementation-notes.md, handoff-log.md with entries from plan creation through Phase 06, and updates to docs/development.md (smoke prep subsection) and docs/changelog/260602.md.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • bmad-code-org/bmad-automator#17: Both PRs modify the npm package.json verification pipeline; the retrieved PR adds build:python/test:cli and runs npm run verify, directly overlapping with the expanded verify and smoke gate scripts introduced here.

Poem

🐰 Hopping through smoke and deterministic mist,
Each gate, each tarball, carefully checked and kissed,
The parser now speaks BMAD headers with ease,
Pinned commits and checksums do exactly as they please,
Phase 01 through 06, all logged and complete,
This bunny's smoke coverage is impressively neat! 🎉

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bma-d/smoke-suite

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bma-d bma-d changed the title bma d/smoke suite test: add deterministic smoke coverage Jun 3, 2026
@bma-d

bma-d commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

@augmentcode review

@augmentcode

augmentcode Bot commented Jun 3, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds a comprehensive deterministic smoke/readiness testing suite for the Story Automator control plane and integrates fast gates into the default npm run verify pipeline.

Changes:

  • Adds a phased deterministic-smoke coverage plan with gate map, coverage baseline, implementation notes, and handoff log under docs/plans/automator-deterministic-smoke-coverage/
  • Adds version:check, pack:assert, smoke:input-check, smoke:contracts, smoke:modes, smoke:finish-loop, and smoke:deterministic-full npm scripts
  • Adds package identity, tarball checksum, installed-manifest verification, helper-contract matrices, mode-lifecycle assertions, finish-loop commit isolation, and host mutation sentinel guards
  • Extends the epic parser (epic_parser.py) and orchestrator agents to support BMAD numbered story headers like ### 1.1: title via shared STORY_HEADER_RE and EPIC_HEADER_RE compiled regexes
  • Updates npm run verify to include fast deterministic gates; keeps heavier prepared-repo checks under explicit smoke:deterministic-full
  • Adds regression tests for hyphenated explicit story IDs, bare numeric subheading filtering, and extensive smoke-script contract tests

Technical Notes: The production code changes are in epic_parser.py (new regex patterns and normalization logic) and orchestrator_epic_agents.py (consuming the shared regexes). Smoke runners use in-process function calls with os.environ manipulation, temp git repos for commit isolation, and a target-repo safety guard.

🤖 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. 3 suggestions posted.

Fix All in Augment

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

Comment thread scripts/check-version-alignment.py Outdated
Comment thread scripts/run-smoke-automator.py Outdated
Comment thread scripts/run-smoke-modes.py Outdated

@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. 3 suggestions posted.

Fix All in Augment

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

Comment thread scripts/smoke_prep/cli.py Outdated
Comment thread scripts/check-version-alignment.py Outdated
Comment thread scripts/run-smoke-finish-loop.py Outdated
@bma-d

bma-d commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

@augmentcode 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. 3 suggestions posted.

Fix All in Augment

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

Comment thread scripts/check-version-alignment.py Outdated
Comment thread scripts/run-smoke-contracts.py
Comment thread scripts/run-smoke-finish-loop.py Outdated
@bma-d

bma-d commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

@augmentcode review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

@bma-d I'll start reviewing the PR 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 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 scripts/run-smoke-automator.py
@bma-d

bma-d commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

@augmentcode 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. 2 suggestions posted.

Fix All in Augment

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

Comment thread scripts/run-smoke-automator.py Outdated
Comment thread tests/test_smoke_script_contracts.py
@bma-d

bma-d commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

@augmentcode review

@augmentcode

augmentcode Bot commented Jun 4, 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 force-pushed the bma-d/e2e-tests branch from be01317 to ddf8ad3 Compare June 5, 2026 06:46
@bma-d bma-d force-pushed the bma-d/smoke-suite branch from 1eddbb8 to 55d2cda Compare June 12, 2026 07:08
@bma-d

bma-d commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@augmentcode review
augment review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

@bma-d I'll kick off a review of this PR right away!

✅ 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.

@bma-d

bma-d commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

augment review

@bma-d

bma-d commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@augmentcode review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

@bma-d I'll start reviewing the PR 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 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. 2 suggestions posted.

Fix All in Augment

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

Comment thread skills/bmad-story-automator/src/story_automator/core/epic_parser.py Outdated
Comment thread scripts/run-smoke-finish-loop.py Outdated

@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: 14

Caution

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

⚠️ Outside diff range comments (1)
docs/development.md (1)

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

Update the verify checklist.

The current bullets still document the older test:python/pack:dry-run/test:smoke flow, but package.json now runs version, package, CLI, helper-contract, mode, Python, and shell-smoke gates under npm run verify.

♻️ Proposed fix
- `npm run verify` expands to:
-
-- `npm run test:python`
-- `npm run pack:dry-run`
-- `npm run test:smoke`
+ `npm run verify` expands to:
+
+- `npm run test:python`
+- `npm run version:check`
+- `npm run pack:assert`
+- `npm run test:cli`
+- `npm run smoke:contracts`
+- `npm run smoke:modes`
+- `npm run test:smoke`
🤖 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 `@docs/development.md` around lines 14 - 19, Update the bulleted list under the
`npm run verify` documentation to reflect the actual gates that are currently
executed in package.json. Replace the outdated entries (test:python,
pack:dry-run, test:smoke) with the actual list of gates that are run: version,
package, CLI, helper-contract, mode, Python, and shell-smoke gates. This ensures
the documentation accurately represents what npm run verify performs.
🤖 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 `@docs/plans/automator-deterministic-smoke-coverage/gate-map.md`:
- Line 14: In the gate-map.md file, row 14 for the Runner lifecycle matrix
currently states "tmux must be available because skipped tests fail this gate,"
which is inaccurate. Update this text to clarify that while tmux is preferred
for full test coverage, it is not required for the gate to pass. The
scripts/run-smoke-contracts.py script allows skipped tests when tmux is
unavailable and only fails on unexpected skips, so the gate will pass with zero
exit code even when tmux-dependent tests are skipped as expected. Revise the
wording to reflect that tmux availability affects test coverage completeness,
not gate success.

In `@docs/plans/automator-deterministic-smoke-coverage/handoff-log.md`:
- Around line 160-164: The Decisions And Assumptions section references the
non-existent `npm run pack:identity` command, which readers cannot run since it
does not exist in package.json. Remove the phrase "or an explicit `npm run
pack:identity`" from the bullet point about tarball identity binding, keeping
only the reference to the valid `npm run pack:assert` command that actually
exists in package.json.

In `@docs/plans/automator-deterministic-smoke-coverage/README.md`:
- Around line 88-92: The Clean Context Agent Protocol section does not include
gate-map.md in the list of required context files that phase agents must read
before starting work. Add gate-map.md to the list of files that every phase
agent must read as part of the protocol, placing it appropriately alongside the
other required context files like README.md, the assigned phase file, the
assigned phase TODO file, implementation-notes.md, and relevant earlier entries
in handoff-log.md. This ensures that gate ownership and pass-fail contract
information is not missed when starting work on a new phase.
- Around line 65-67: The Target repo line contains an absolute machine-specific
path `/Users/joon/.codex/worktrees/9b27/bmad-story-automator` that will not work
across different environments. Replace this absolute path with a relative
reference or environment-agnostic placeholder that describes where the target
repository should be located, ensuring the documentation remains valid
regardless of the local machine's directory structure.

In `@docs/versioning.md`:
- Line 151: The documentation correctly identifies that
`skills/bmad-story-automator/workflow.md` must be included in version bumps on
line 151, but the sample `git add` commands shown in the preview and stable
release sections omit this file. Update both the preview and stable `git add`
command examples in the versioning.md file to include
`skills/bmad-story-automator/workflow.md` alongside the other files being added,
ensuring consistency between the documented requirements and the example
commands provided to users.

In `@scripts/check-smoke-inputs.py`:
- Around line 18-27: The code accesses nested dictionary keys without validation
on the inputs dictionary and the gunz and bmad objects. If the smoke_inputs
payload is malformed or missing expected keys, uncaught KeyError or TypeError
exceptions will be raised, bypassing the controlled error handling. Wrap the
nested key accesses in a try-except block or validate that all required keys
exist before dereferencing them, then ensure any exceptions during this
validation are caught and reported through the same controlled failure path as
other smoke input determinism failures.

In `@scripts/run-smoke-dev-loop.py`:
- Around line 303-314: The _write_dev_log method attempts to write to a file
path that may not have its parent directory created in a fresh workspace. Before
calling write_text() to persist the log file, ensure the parent directory exists
by invoking .parent.mkdir(parents=True, exist_ok=True) on the target path object
to create any missing intermediate directories.

In `@scripts/smoke_prep/gunz.py`:
- Around line 11-30: The code at the gunz_dir.exists() check reuses an existing
clone without verifying that its origin URL still matches REPO_URL, which could
allow running smoke prep against an unintended repository if the cached
directory was manually modified. After the exists check but before reusing the
clone, add a validation step that runs a git command to retrieve the current
origin URL from the gunz_dir and compare it against REPO_URL; only proceed with
reusing the clone if the URLs match, otherwise handle the mismatch appropriately
(either delete and reclone, or raise an error).

In `@scripts/smoke_prep/inputs.py`:
- Around line 16-39: The subprocess.run() call for npm view is missing a timeout
parameter which can cause indefinite hangs if the npm registry stalls. Add a
timeout parameter set to 60 seconds to the subprocess.run() call, then wrap the
entire subprocess.run() statement in a try-except block to catch
subprocess.TimeoutExpired exceptions and convert them to a SmokeError with a
clear message indicating the npm command timed out.

In `@scripts/smoke_prep/package_contracts.py`:
- Around line 199-208: Add a timeout parameter to the subprocess.run() call
within the _npm_pack_json function to prevent npm pack from hanging
indefinitely. Set an appropriate timeout value (in seconds) as a parameter to
subprocess.run() alongside the existing parameters like check, stdout, and
stderr. This ensures that if npm pack stalls due to network issues or other
problems, the process will be interrupted with a subprocess.TimeoutExpired
exception rather than blocking indefinitely.

In `@scripts/smoke_prep/process.py`:
- Around line 32-49: The run() function has an unbounded subprocess.run() call
that can hang indefinitely on stalled git/npm/npx invocations. Add a timeout
parameter to the run() function signature with a default value of 900 seconds,
then pass this timeout parameter to the subprocess.run() call. Additionally,
wrap the subprocess.run() call in a try-except block to catch
subprocess.TimeoutExpired exceptions and convert them to SmokeError for
consistent failure handling across the codebase.

In `@scripts/smoke_prep/workspace.py`:
- Around line 29-31: The git check-ignore command in the subprocess.run call is
missing the `--` path delimiter before the path argument. Add `--` as a separate
list element before `relative.as_posix()` in the command list passed to
subprocess.run. This ensures that if the workspace path starts with `-`, it will
be correctly interpreted as a path argument rather than a git option.

In `@tests/test_smoke_script_contracts.py`:
- Around line 253-291: The test methods
test_dev_loop_story_slug_ignores_unfound_sprint_status_story and
test_dev_loop_story_slug_ignores_unfound_sprint_status_story_echo create
SmokeRunner and DevLoopSmokeRunner instances respectively, but never call
close() on them to clean up resources. Wrap the patched code block (the with
statement and assertions) in a try/finally block for each test method, and call
runner.close() in the finally block to ensure proper cleanup and prevent
resource leaks, similar to the pattern used in other runner-based tests in this
file.
- Line 18: Remove the sys.path.insert(0, str(SCRIPTS)) call from the
module-level scope (line 18). Instead, move this path insertion inside the
load_script_module function where it is actually needed, and consider using a
context manager or temporary patch to ensure the sys.path modification is scoped
appropriately and doesn't persist globally after the function call completes.

---

Outside diff comments:
In `@docs/development.md`:
- Around line 14-19: Update the bulleted list under the `npm run verify`
documentation to reflect the actual gates that are currently executed in
package.json. Replace the outdated entries (test:python, pack:dry-run,
test:smoke) with the actual list of gates that are run: version, package, CLI,
helper-contract, mode, Python, and shell-smoke gates. This ensures the
documentation accurately represents what npm run verify performs.
🪄 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: c68c64ca-f3ad-4816-83db-e927ddeee140

📥 Commits

Reviewing files that changed from the base of the PR and between 7615bd5 and 55d2cda.

📒 Files selected for processing (47)
  • .gitignore
  • docs/changelog/260602.md
  • docs/development.md
  • docs/plans/automator-deterministic-smoke-coverage/01-baseline-and-version-determinism.md
  • docs/plans/automator-deterministic-smoke-coverage/02-package-and-prepared-repo-contracts.md
  • docs/plans/automator-deterministic-smoke-coverage/03-runtime-helper-contract-smokes.md
  • docs/plans/automator-deterministic-smoke-coverage/04-create-dev-resume-validate-edit-coverage.md
  • docs/plans/automator-deterministic-smoke-coverage/05-automate-review-finish-retro-coverage.md
  • docs/plans/automator-deterministic-smoke-coverage/06-gate-integration-and-readiness-review.md
  • docs/plans/automator-deterministic-smoke-coverage/README.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO/phase-01.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO/phase-02.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO/phase-03.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO/phase-04.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO/phase-05.md
  • docs/plans/automator-deterministic-smoke-coverage/TODO/phase-06.md
  • docs/plans/automator-deterministic-smoke-coverage/coverage-baseline.md
  • docs/plans/automator-deterministic-smoke-coverage/gate-map.md
  • docs/plans/automator-deterministic-smoke-coverage/handoff-log.md
  • docs/plans/automator-deterministic-smoke-coverage/implementation-notes.md
  • docs/versioning.md
  • package.json
  • scripts/assert-package-contracts.py
  • scripts/check-smoke-inputs.py
  • scripts/check-version-alignment.py
  • scripts/prepare-smoke-test.py
  • scripts/run-smoke-automator.py
  • scripts/run-smoke-contracts.py
  • scripts/run-smoke-dev-loop.py
  • scripts/run-smoke-finish-loop.py
  • scripts/run-smoke-modes.py
  • scripts/smoke_prep/__init__.py
  • scripts/smoke_prep/automator.py
  • scripts/smoke_prep/cli.py
  • scripts/smoke_prep/config.py
  • scripts/smoke_prep/gunz.py
  • scripts/smoke_prep/inputs.py
  • scripts/smoke_prep/package_contracts.py
  • scripts/smoke_prep/process.py
  • scripts/smoke_prep/report.py
  • scripts/smoke_prep/workspace.py
  • skills/bmad-story-automator/src/story_automator/core/epic_parser.py
  • skills/bmad-story-automator/workflow.md
  • tests/test_cli_contracts.py
  • tests/test_runtime_helper_contracts.py
  • tests/test_smoke_script_contracts.py

Comment thread docs/plans/automator-deterministic-smoke-coverage/gate-map.md Outdated
Comment thread docs/plans/automator-deterministic-smoke-coverage/handoff-log.md
Comment thread docs/plans/automator-deterministic-smoke-coverage/README.md Outdated
Comment thread docs/plans/automator-deterministic-smoke-coverage/README.md
Comment thread docs/versioning.md
Comment thread scripts/smoke_prep/package_contracts.py Outdated
Comment thread scripts/smoke_prep/process.py Outdated
Comment thread scripts/smoke_prep/workspace.py
Comment thread tests/test_smoke_script_contracts.py Outdated
Comment thread tests/test_smoke_script_contracts.py
@bma-d

bma-d commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review
@augmentcode review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

@bma-d I'll kick off a full review of this PR right away!

✅ Action performed

Full review finished.

@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 skills/bmad-story-automator/src/story_automator/core/epic_parser.py Outdated
Comment thread skills/bmad-story-automator/src/story_automator/core/epic_parser.py
Comment thread scripts/run-smoke-finish-loop.py
Comment thread scripts/run-smoke-finish-loop.py Outdated
@bma-d

bma-d commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

@augmentcode review

@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.

1 participant