Files
crank/_bmad-output/test-artifacts/test-design/crank-handoff.md
T

118 lines
7.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 'TEA Test Design → BMAD Handoff Document'
version: '1.0'
workflowType: 'testarch-test-design-handoff'
inputDocuments:
- '_bmad-output/test-artifacts/test-design-architecture.md'
- '_bmad-output/test-artifacts/test-design-qa.md'
- '_bmad-output/planning-artifacts/epics.md'
sourceWorkflow: 'testarch-test-design'
generatedBy: 'BMad TEA / Bsodfather'
generatedAt: '2026-08-08T00:00:00+03:00'
projectName: 'crank'
---
# TEA → BMAD Integration Handoff: crank
## Purpose
This document maps the system test design into the already-created epics/stories. Story refinement and ATDD must preserve these quality requirements; implementation status is not implied.
## TEA Artifacts Inventory
| Artifact | Path | Integration point |
|---|---|---|
| Architecture testability contract | `_bmad-output/test-artifacts/test-design-architecture.md` | Production seams, blockers, ASRs and risk ownership |
| QA execution recipe | `_bmad-output/test-artifacts/test-design-qa.md` | Scenario families, evidence, schedules and estimates |
| Progress/source analysis | `_bmad-output/test-artifacts/test-design-progress.md` | Detailed NFR thresholds and 34-group coverage matrix |
| Product stories | `_bmad-output/planning-artifacts/epics.md` | Requirements and acceptance-criteria insertion point |
## Epic-Level Integration Guidance
### Risk references
- **Epic 1:** R-001, R-004, R-012, R-013 — freeze baseline; establish deterministic fixtures, security/correlation foundations and evidence schemas.
- **Epic 2:** R-002 — OpenAPI semantic oracle, immutable preview/apply and zero-silent-loss gate.
- **Epic 3:** R-009 — immutable catalog plus version/client compatibility evidence.
- **Epic 4:** R-003, R-015 — model-based Task lifecycle, real-PG crash/contention proof and early long-run trends.
- **Epic 5:** R-005, R-006, R-011 — trace truth, spool/loss accounting, metric cardinality/rollups and overhead evidence.
- **Epic 6:** R-006, R-010 — calibrated workload, generator accounting, signed limits and independent stop path.
- **Epic 7:** R-004, R-007, R-008, R-014 — web security, secret/egress protection, N/N-1 recovery and trusted air-gap delivery.
- **Epic 8:** R-001, R-006, R-013, R-015 plus all residual risks — complete one-RC qualification and fail-closed Habr gate.
### Quality gates per epic
| Epic | Gate |
|---|---|
| 1 | Existing core baseline passes; test controls and evidence schema exist; correlation/metrics foundations have contract tests |
| 2 | ≥50-spec corpus, ≥95% actionable Draft, zero silent loss, deterministic preview and atomic apply |
| 3 | Tools/Resources/Prompts pass stable/N-1/N-2 protocol and ≥3 representative clients |
| 4 | No illegal/stale terminal transitions; 128 active/10k queue/fairness and ≤60 s recovery evidence |
| 5 | 100% correlation, delivery/completeness/spool/overhead budgets, bounded cardinality, tested dashboards/alerts |
| 6 | Built-in/external results agree; 100/250 RPS thresholds pass; stop/kill/security controls proven |
| 7 | Fresh/N-1/rollback/three restores/air-gap/default-deny pass with real encrypted-auth MCP probes |
| 8 | P0/mandatory P1/manual/matrices/security/72 h/30 d all pass on one signed immutable RC |
## Story-Level Integration Guidance
### P0/P1 scenarios that must become acceptance criteria
1. Every story names its Requirements tags and primary test level; fixed defects include a regression test.
2. State/storage stories include deterministic seed/cleanup, contention/crash and fail-closed negative criteria where applicable.
3. Wire/UI stories assert stable `error_code`, safe RU/EN message, `request_id` and `trace_id`; no raw payload/cause leakage.
4. OpenAPI stories add/modify corpus fixtures and expected findings for every supported or defective construct.
5. MCP stories update protocol snapshots/matrix and prove Agent scope/catalog revision before serialization.
6. Task stories prove legal lifecycle transitions, CAS/fencing, pinned semantics, idempotency and `outcome_unknown` reconciliation.
7. Observability stories deliver queryable machine-readable evidence, not only screenshots; UI distinguishes local/delivered/lost/unknown.
8. Metrics stories include registry/cardinality lint and idempotent event-rollup replay.
9. Load stories prove plan authorization, ceiling enforcement, runner/SUT accounting and forced-stop recovery.
10. Deploy/recovery/release stories bind evidence to code/config/topology digests and reject stale/cross-RC artifacts.
### UI testability requirements
- Prefer accessible roles/labels; add stable `data-testid` only where semantic locators are ambiguous.
- Required stable hooks include Operation/Agent/Resource/Prompt revision/state, import finding/operation IDs, Task ID/status/progress/attempt, request/trace copy/deep-link controls, telemetry delivery state, metric/SLO panel identifiers, Load Run ID/state/stop and security/error boundaries.
- Async lists/details must expose identity/revision so stale-response tests can assert the winning response.
- API-first per-worker data setup and cleanup is mandatory; never rely on shared fixed records.
## Risk-to-Story Mapping
| Risk | P×I | Recommended stories/epic | Primary level |
|---|---:|---|---|
| R-001 | 9 | 1.1–1.2, all regression stories, 8.3/8.9 | API + guided/E2E |
| R-002 | 9 | 2.1a–2.1d, 2.2–2.9 | Rust corpus + API/PG |
| R-003 | 9 | 4.1 onward (Task/admission/worker lifecycle) | Model/property + PG chaos |
| R-004 | 9 | 1.9–1.10, observability redaction, 7 security/offline stories | Security integration/system |
| R-005 | 6 | 5.1–5.7 correlation/spool/loss | Contract + telemetry E2E/chaos |
| R-006 | 9 | 5 overhead/metrics, 6 load, 8 perf/soak | Performance/system |
| R-007 | 6 | Epic 7 admin auth/hardening/recovery | API/browser security |
| R-008 | 6 | Epic 7 migration/upgrade/backup/restore | Deployment/recovery |
| R-009 | 6 | 3.1–3.14 | MCP protocol/client matrix |
| R-010 | 6 | Epic 6 authorization/runner/UI stories | API/system/Playwright |
| R-011 | 6 | 1.6 and Epic 5 metrics/rollups/Grafana | Unit/PG/config integration |
| R-012 | 4 | All UI stories and Epic 8 automation | Playwright quality/burn-in |
| R-013 | 6 | 1 enabling evidence work; Epic 8 manifest/gate | CLI/schema/signature |
| R-014 | 6 | Epic 7 offline/supply chain; Epic 8 security | Air-gap/system scan |
| R-015 | 6 | Epic 4 onward trends; 8 soak/burn-in | Long-duration system |
## Recommended BMAD → TEA Sequence
1. This system Test Design is complete.
2. Correct/refine existing stories using this handoff where acceptance criteria are missing.
3. Run epic-level Test Design per epic when it enters implementation.
4. Run ATDD for the next story before implementation.
5. Implement story and its lowest-level tests.
6. Expand automation, then generate traceability/gate evidence.
7. Run NFR assessment only after implementation evidence exists.
## Phase Transition Quality Gates
| From | To | Gate |
|---|---|---|
| System design | Epic refinement | Every score ≥6 risk has owner, mitigation and target epic |
| Epic refinement | ATDD | Story contains risk-linked, measurable and testable acceptance criteria |
| ATDD | Implementation | Failing P0/P1 acceptance scaffolds and deterministic prerequisites exist |
| Implementation | Automation/trace | Story tests pass and artifacts are machine-readable |
| Epic completion | Next epic | Epic gate above passes; residual risks recorded |
| RC qualification | Publication | Complete signed same-RC evidence, no prohibited waiver or missing run |