Story 26: Establish TDD workflow and quality gates

Add workflow engine with acceptance gates, test recording, and review
queue. Frontend displays gate status (blocked/ready), test summaries,
failing badges, and warnings. Proceed action is disabled when gates
are not met. Includes 13 unit tests (Vitest) and 9 E2E tests
(Playwright) covering all five acceptance criteria.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-19 12:54:04 +00:00
parent 3a98669c4c
commit 013b28d77f
31 changed files with 3627 additions and 417 deletions

View File

@@ -0,0 +1,42 @@
---
name: Establish the TDD Workflow and Gates
test_plan: approved
---
# Story 26: Establish the TDD Workflow and Gates
## User Story
As a user, I want a clear, enforceable TDD workflow with quality gates, so development is test-first and regressions are blocked.
## Acceptance Criteria
- [ ] A test-first workflow is defined and enforced before implementation begins.
- [ ] Each story requires both unit tests and integration tests (standard Rust `tests/` layout).
- [ ] A test plan is produced and approved before any code changes.
- [ ] Stories cannot be accepted unless all required tests pass.
- [ ] The system warns when multiple tests fail and blocks acceptance until all required tests pass.
## Test Plan (Approved)
### Backend (Rust) — Unit + Integration
- AC1/AC3: Block write/exec when no approved test plan exists.
- AC2: Enforce presence of both unit + integration test categories before a story can proceed.
- AC4: Block story acceptance unless all required test results are passing.
- AC5: Allow only one failing test at a time (reject registering a second failure).
**Integration coverage:**
- Attempt to write before test plan approval → expect rejection.
- Add/approve test plan → write succeeds.
- Attempt acceptance with failing/missing tests → expect rejection.
- Acceptance with all passing tests → expect success.
- Register second failing test while one is red → expect rejection.
### Frontend (React) — Vitest + Playwright
- AC1/AC3: Gate status shown in story view; tools blocked until test plan approved.
- AC4: Acceptance action disabled when required tests are failing or missing.
- AC5: UI surfaces “red test count” and blocks when more than one failing test is present.
- E2E: Attempt blocked actions show a visible banner/toast and do not execute.
## Out of Scope
- Backfilling tests for legacy code (covered by a separate story).
- Adding new test frameworks beyond those defined in `specs/tech/STACK.md`.

View File

@@ -1,15 +0,0 @@
# Story 26: Establish the TDD Workflow and Gates
## User Story
As a user, I want a clear, enforceable TDD workflow with quality gates, so development is test-first and regressions are blocked.
## Acceptance Criteria
- [ ] A test-first workflow is defined and enforced before implementation begins.
- [ ] Each story requires both unit tests and integration tests (standard Rust `tests/` layout).
- [ ] A test plan is produced and approved before any code changes.
- [ ] Stories cannot be accepted unless all required tests pass.
- [ ] Only one failing test is allowed at a time during red-green-refactor.
## Out of Scope
- Backfilling tests for legacy code (covered by a separate story).
- Adding new test frameworks beyond those defined in `specs/tech/STACK.md`.