Skip to content

feat(01KW5W08): BMad adapter derives per-AC verification markers at scan time so the reviewer stops stalling on manual-check-required (#447)#451

Merged
jackmcintyre merged 1 commit into
mainfrom
story/native-01kw5w081x3tjpqbcyf3wak9rz-bmad-adapter-derives-per-ac-verification
Jun 29, 2026
Merged

feat(01KW5W08): BMad adapter derives per-AC verification markers at scan time so the reviewer stops stalling on manual-check-required (#447)#451
jackmcintyre merged 1 commit into
mainfrom
story/native-01kw5w081x3tjpqbcyf3wak9rz-bmad-adapter-derives-per-ac-verification

Conversation

@jackmcintyre

Copy link
Copy Markdown
Owner

What changed

BMad adapter derives per-AC verification markers at scan time so the reviewer stops stalling on manual-check-required (#447)

This change delivers the following acceptance criteria:

  • AC1: Given a BMad source story whose acceptance criteria carry no vitest:/artifact: marker, When scanSources parses it via parse-bmad-story, Then each AC for which a real test or artifact target can be derived carries that derived marker, so it is no longer classified manual-check-required at review.
  • AC2: Given a BMad AC for which no real test or artifact target can be derived, When the adapter resolves the candidate target against the working tree at scan time, Then it falls back to manual verification rather than emitting a non-existent path.
  • AC3: Given a scanned BMad story whose ACs now carry derived markers, When runReviewerSession classifies them, Then each derived-marker AC is classified runnable-vitest/runnable-artifact (not manual-check-required) end-to-end through the manifest-to-reviewer data flow.

Why

As an operator, I want BMad source-story acceptance criteria to become mechanically verifiable at review without me hand-adding vitest:/artifact: markers to gitignored source files, so that a /flow:run over a BMad repo does not stall on needs-human-decision for a marker-only gap (this recurred 5x across Epic 1 - stories 1.3/1.4/1.6/1.7/1.8).

How to check it yourself

Unit (AC1/AC2): pnpm exec vitest run src/adapters/bmad/tests/parse-bmad-story-ac-headings.test.ts — covers deriving a vitest marker from a test path cited in AC prose and in dev notes, the integration artifact-convention marker, the integration-vs-unit notes split, and the manual fallback when a candidate target does not resolve on disk or no repoRoot is supplied. Integration (AC3): pnpm exec vitest run src/tools/tests/run-reviewer-session.test.ts — the new BMad case scans a real BMad workspace (asserts the to-do manifest carries the derived artifact + vitest markers), then runs runReviewerSession against a worktree containing those targets and asserts AC1 classifies runnable-artifact-check, AC2 runnable-vitest, and a signal-less AC3 still falls back to manual-check-required.

Risk and blast radius

Risk tier: medium

The change is scoped to the files in the diff below. Review the diff to judge its actual blast radius — including any effect on shared state, data schemas, or authentication paths — before approving.

What is explicitly not covered: reviewer verification of this summary's accuracy is handled by a separate companion story.

Evidence

The pre-pull-request build-and-test gate passed before this pull request was opened. No pull request can be opened by the automated flow unless both pnpm build and pnpm test exit 0 in the developer's working directory.

Per-criterion covering checks:

  • AC1 → plugins/flow/mcp-server/src/adapters/bmad/__tests__/parse-bmad-story-ac-headings.test.ts (automated test)
  • AC2 → plugins/flow/mcp-server/src/adapters/bmad/__tests__/parse-bmad-story-ac-headings.test.ts (automated test)
  • AC3 → plugins/flow/mcp-server/src/tools/__tests__/run-reviewer-session.test.ts (automated test)

Story: native:01KW5W081X3TJPQBCYF3WAK9RZ
Spec: .flow/native-stories/01KW5W081X3TJPQBCYF3WAK9RZ.md
ACs:

  • AC1: Given a BMad source story whose acceptance criteria carry no vitest:/artifact: marker, When scanSources parses it via parse-bmad-story, Then each AC for which a real test or artifact target can be derived carries that derived marker, so it is no longer classified manual-check-required at review.
  • AC2: Given a BMad AC for which no real test or artifact target can be derived, When the adapter resolves the candidate target against the working tree at scan time, Then it falls back to manual verification rather than emitting a non-existent path.
  • AC3: Given a scanned BMad story whose ACs now carry derived markers, When runReviewerSession classifies them, Then each derived-marker AC is classified runnable-vitest/runnable-artifact (not manual-check-required) end-to-end through the manifest-to-reviewer data flow.

Derive per-AC verification markers for BMad stories at scan + review so the reviewer stops stalling on manual-check-required

Closes #447

…can time so the reviewer stops stalling on manual-check-required (#447)

BMad source-story ACs carry no inline vitest:/artifact: markers, so
every BMad AC classified manual-check-required and the verdict
deterministically stalled /flow:run on a marker-only gap (recurred 5x
across Epic 1). This adds a shared deriveBmadAcVerification helper that
mines a verification target from each AC own signals — a test-file path
cited in the AC prose (vitest, either kind), the implementation-artifact
path convention for integration ACs (artifact), or a test referenced in
the story implementation notes for unit ACs (vitest) — and emits a
marker ONLY when that target resolves on the tree being checked, falling
back to manual otherwise so no non-existent path is ever fabricated (the
#422-mirror risk). parseBmadStory gains an optional repoRoot to
derive+resolve at scan time (persisted into the manifest via the BMad
adapter), and runReviewerSession re-derives against the PR-branch
worktree when an AC has no inline marker, upgrading
manual-check-required to runnable-vitest/runnable-artifact only when the
target genuinely exists there. Native stories are untouched (derivation
is gated to the BMad adapter and the manual branch, which native ACs
never reach).
@jackmcintyre jackmcintyre merged commit 05f2658 into main Jun 29, 2026
1 check passed
@jackmcintyre jackmcintyre deleted the story/native-01kw5w081x3tjpqbcyf3wak9rz-bmad-adapter-derives-per-ac-verification branch June 29, 2026 06:29
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.

[bmad adapter] Source-story ACs lack vitest:/artifact: markers → reviewer stalls on manual-check-required (5x in Epic 1)

1 participant