chore(bmad): preserve planning and acceptance artifacts in Git
This commit is contained in:
1 parent
fed5b7dfb3
commit
ea3b71cb5e
93 files changed
+20696
No files matched your search
@@ -0,0 +1,200 @@
|
||||
---
|
||||
stepsCompleted: ['step-01-preflight-and-context', 'step-02-generation-mode', 'step-03-test-strategy', 'step-04c-aggregate', 'step-05-validate-and-complete']
|
||||
lastStep: 'step-05-validate-and-complete'
|
||||
lastSaved: '2026-08-08'
|
||||
storyId: '1.1'
|
||||
storyKey: '1-1-capability-inventory'
|
||||
storyFile: '_bmad-output/planning-artifacts/epics.md'
|
||||
atddChecklistPath: '_bmad-output/test-artifacts/atdd-checklist-1-1-capability-inventory.md'
|
||||
generatedTestFiles:
|
||||
- 'tests/unit/test_validate_capability_inventory.py'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/project-context.md'
|
||||
- '_bmad-output/test-artifacts/test-design-epic-1.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- 'scripts/check-community-scope.py'
|
||||
- 'tests/unit/test_check_community_scope.py'
|
||||
- 'apps/ui/playwright.config.js'
|
||||
---
|
||||
|
||||
# ATDD Checklist — Story 1.1 Capability Inventory
|
||||
|
||||
## Step 1: Preflight and Context
|
||||
|
||||
- **Detected stack:** fullstack (Rust backend plus existing Playwright UI), while Story 1.1 itself is a repository-level Python/CLI/schema guardrail with no new browser behavior.
|
||||
- **Story approval:** acceptance criteria are complete in `_bmad-output/planning-artifacts/epics.md`, Story 1.1.
|
||||
- **Framework readiness:** Python `unittest` runs in `just test` and Gitea CI; Rust and Playwright frameworks are configured. Development environment is available.
|
||||
- **Story key:** `1-1-capability-inventory`; **Story ID:** `1.1`.
|
||||
- **Affected contracts:** Capability Inventory schema, validator CLI, machine-readable inventory, evidence references, Community scope scanner/guardrails, Community docs and `project-context.md`.
|
||||
- **Risk links:** E1-R-001 (score 9), coverage groups E1-01 and E1-02.
|
||||
- **Existing pattern:** `scripts/check-community-scope.py` exposes deterministic stdlib CLI behavior and explicit `--files`; `tests/unit/test_check_community_scope.py` uses temporary repositories and subprocess assertions.
|
||||
- **TEA flags:** Playwright Utils on; Pact.js Utils off; Pact MCP off; browser automation auto; stack auto→fullstack. Contract testing is relevant at CLI/schema boundary; browser automation is not required for this Story.
|
||||
- **Preflight result:** PASS. No prerequisite or user input is missing.
|
||||
|
||||
## Step 2: Generation Mode
|
||||
|
||||
- **Mode:** AI generation.
|
||||
- **Reason:** Story 1.1 is a deterministic repository CLI/schema contract. Acceptance criteria are explicit, existing subprocess/unit patterns are authoritative, and no live UI selector or interaction must be recorded.
|
||||
- **Browser state:** no session opened; no recording artifact created.
|
||||
|
||||
## Step 3: Test Strategy
|
||||
|
||||
### Acceptance-criteria mapping
|
||||
|
||||
| Scenario | Acceptance contract | Level | Priority | Red-phase mechanism |
|
||||
|---|---|---|---|---|
|
||||
| ATDD-1.1-01 | Valid inventory requires unique ID, `ui/api/mcp`, FRs, outcome, owner, status and evidence | CLI contract/unit | P0 | Future validator script and schema do not exist |
|
||||
| ATDD-1.1-02 | `implemented/planned/gap/blocked` accepted, while last three never counted as pass | CLI contract | P0 | Future summary/status logic absent |
|
||||
| ATDD-1.1-03 | Duplicate ID, unknown status, owner missing and required field missing fail with stable codes | CLI contract | P0 | Future validation rules absent |
|
||||
| ATDD-1.1-04 | Missing mandatory FR and broken evidence reference fail | CLI/filesystem integration | P0 | Future required-FR/evidence resolution absent |
|
||||
| ATDD-1.1-05 | Error report is deterministic, ≤64 KiB and does not echo secret canaries/raw invalid payload | CLI security contract | P0 | Future bounded/redacted reporter absent |
|
||||
| ATDD-1.1-06 | `resources`, `prompts`, `tasks`, `load_runs` are allowed planned capability kinds | CLI/schema contract | P0 | Future capability enum absent |
|
||||
| ATDD-1.1-07 | `multi_workspace`, `enterprise_rbac`, `sso`, `non_rest_upstream`, `arbitrary_distributed_load_targets` remain forbidden even with allow-marker text | CLI/schema security | P0 | Future scope contract absent |
|
||||
| ATDD-1.1-08 | Canonical inventory/schema/docs/project context files exist and do not claim planned target capabilities are implemented | Repository contract | P1 | Required artifacts/markers absent |
|
||||
|
||||
### Contract decisions for the red scaffold
|
||||
|
||||
- Canonical CLI: `scripts/validate-capability-inventory.py`.
|
||||
- Canonical artifacts: `docs/capability-inventory.json` and `docs/schemas/capability-inventory.schema.json`.
|
||||
- CLI accepts `--root`, `--inventory`, `--schema` and repeatable `--required-fr`; tests use temporary repositories and JSON only, adding no dependency.
|
||||
- Deterministic failures use stable machine codes and sorted paths; sensitive values are never printed. Maximum human report is 64 KiB.
|
||||
- Inventory `flows[]` owns `id`, `type`, `requirements`, `user_outcome`, `owner`, `status`, `capabilities` and `evidence`. Evidence links are repository-relative and must resolve to regular files.
|
||||
- These are external test contracts, not implementation prescriptions: internal parsing/validation structure remains free.
|
||||
|
||||
### Existing green evidence retained, not duplicated
|
||||
|
||||
- `tests/unit/test_check_community_scope.py` already proves explicit `--files` scanning, forbidden markers, narrow inline directives and binary/default exclusions.
|
||||
- New red tests focus on the missing Inventory-aware contract; they do not duplicate current scope-scanner branch tests or introduce browser tests.
|
||||
|
||||
### Red-phase expectation
|
||||
|
||||
All newly generated acceptance tests describe behavior that will fail before implementation because the validator/schema/inventory documentation contract is absent. During the shared RED-scaffold phase they are deliberately decorated with `@unittest.skip(RED_PHASE)` so ordinary CI stays green; each test is activated task-by-task and must be observed failing before the corresponding implementation is added.
|
||||
|
||||
## Step 4: RED-Phase Test Scaffolds
|
||||
|
||||
### Generation result
|
||||
|
||||
- **Execution:** SUBAGENT (API + E2E); capability probe enabled and resolved to the available subagent runner.
|
||||
- **CLI/API contract tests:** 10 scenarios in `tests/unit/test_validate_capability_inventory.py`, all guarded by `@unittest.skip(RED_PHASE)`.
|
||||
- **E2E browser tests:** 0. Story 1.1 introduces no UI journey, so browser scaffolding would duplicate the repository-level CLI contract.
|
||||
- **TDD compliance:** PASS. Every generated test has a RED-phase skip guard, contains behavioral assertions rather than placeholders, and is marked `expected_to_fail` in generation metadata.
|
||||
- **Browser session:** not opened.
|
||||
|
||||
### Acceptance Criteria Coverage
|
||||
|
||||
1. Complete inventory schema and every `ui`/`api`/`mcp` flow field are covered by the valid-inventory scenario.
|
||||
2. The four statuses are accepted, while only `implemented` contributes to pass.
|
||||
3. Duplicate IDs, unknown status/type, missing owner/field, mandatory FR gaps, and invalid evidence links produce stable failures.
|
||||
4. Reports are deterministic, sorted, redacted, and bounded to 64 KiB.
|
||||
5. `resources`, `prompts`, `tasks`, and `load_runs` are accepted as planned Community capabilities.
|
||||
6. Multi-workspace, enterprise RBAC/SSO, non-REST upstream, and arbitrary distributed load targets remain forbidden despite allow-marker text.
|
||||
7. New/untracked inventory and guardrail files are explicitly scanned with positive and negative coverage.
|
||||
8. Canonical schema, inventory, Community documentation, and project context exist without promoting planned work to implemented.
|
||||
|
||||
### Fixture Infrastructure
|
||||
|
||||
The Python scaffold contains the minimal RED-phase fixture infrastructure locally: temporary repository factory, canonical-schema installer, flow/evidence factories, validator and scope-scanner subprocess runners, plus a secret canary. Keeping these helpers in the single Story 1.1 module avoids adding an unused cross-suite fixture API before the contract exists.
|
||||
|
||||
### Task-by-Task Activation
|
||||
|
||||
During implementation:
|
||||
|
||||
1. Remove `@unittest.skip(RED_PHASE)` only from the scenario for the current task.
|
||||
2. Run `python3 -m unittest tests.unit.test_validate_capability_inventory` and observe the activated test fail for the missing behavior.
|
||||
3. Implement the smallest production change that satisfies the contract, then rerun until green.
|
||||
4. Keep unrelated scenarios skipped until their implementation task begins.
|
||||
5. Finish with scope/boundary tests and `just verify` as required by Story 1.1.
|
||||
|
||||
### Implementation Handoff
|
||||
|
||||
- Validator CLI: `scripts/validate-capability-inventory.py` with `--root`, `--inventory`, `--schema`, and repeatable `--required-fr`.
|
||||
- Canonical schema: `docs/schemas/capability-inventory.schema.json`.
|
||||
- Canonical inventory: `docs/capability-inventory.json`.
|
||||
- Community boundary: extend the existing scope checker without weakening narrow allow directives.
|
||||
- Documentation: link the inventory from Community documentation and `_bmad-output/project-context.md`.
|
||||
- Story backlink was not inserted because Story 1.1 lives inside the shared `epics.md` and has no dedicated `## Dev Notes` section. Use this checklist and its frontmatter as the implementation handoff.
|
||||
|
||||
### Generated Files
|
||||
|
||||
- `tests/unit/test_validate_capability_inventory.py`
|
||||
- `_bmad-output/test-artifacts/atdd-checklist-1-1-capability-inventory.md`
|
||||
|
||||
### Summary
|
||||
|
||||
- Total tests: **10**, all skipped in shared RED scaffold.
|
||||
- API/CLI tests: **10**.
|
||||
- E2E tests: **0** (not applicable).
|
||||
- Embedded fixture capabilities: **7**.
|
||||
- Covered acceptance-contract groups: **8/8**.
|
||||
- Activated tests are expected to fail until their corresponding behavior is implemented.
|
||||
|
||||
## Step 5: Validation and Completion
|
||||
|
||||
### Validation Result
|
||||
|
||||
- **Prerequisites:** PASS — approved Story 1.1, testable acceptance criteria, working Python `unittest` harness, and existing scope-checker patterns are present.
|
||||
- **Scaffold syntax/discovery:** PASS — `python3 -m unittest tests.unit.test_validate_capability_inventory` discovered 10 tests and reported `OK (skipped=10)`.
|
||||
- **RED safety:** PASS — AST inspection found 10 test methods and 10 `@unittest.skip` decorators; no generated acceptance scenario is active in ordinary CI.
|
||||
- **Acceptance mapping:** PASS — all eight contract groups from Story 1.1 are represented.
|
||||
- **Handoff metadata:** PASS — story ID/key/source, checklist path, generated test path, activation commands, and implementation targets are recorded.
|
||||
- **Session cleanup:** PASS — no browser was opened and no CLI/browser process remains.
|
||||
- **Artifact hygiene:** PASS — transient worker JSON files were removed from `/tmp`; durable summary metadata is stored in `_bmad-output/test-artifacts/atdd-summary-1-1-capability-inventory.json`.
|
||||
- **Formatting:** PASS — Python compilation and `git diff --check` complete without errors.
|
||||
|
||||
### Applicability Decisions
|
||||
|
||||
- Primary level is **CLI contract / repository integration**. The file lives under the repository's established `tests/unit/` convention even though it exercises subprocess and filesystem boundaries.
|
||||
- Browser E2E, component tests, selectors, `data-testid`, headed/debug commands, network interception, HTTP status matrices, external mocks, Pact, routes, and UI components are **N/A** for this story.
|
||||
- Faker/TypeScript factory requirements are **N/A**. Deterministic Python builders are preferable for a schema validator; every test gets a fresh temporary root and `tearDown()` removes it.
|
||||
- The ten scenarios intentionally group closely related assertions around one contract outcome (for example bounded + deterministic + redacted report). This gives actionable diagnostics without multiplying expensive subprocess setup.
|
||||
|
||||
### Implementation Checklist
|
||||
|
||||
- [ ] Create the canonical JSON schema and a minimal canonical inventory with the required flow fields and enum values.
|
||||
- [ ] Implement CLI parsing plus structural validation for IDs, types, owners, outcomes, requirements, status, and evidence shape.
|
||||
- [ ] Implement required-FR completeness and repository-contained regular-file evidence resolution.
|
||||
- [ ] Implement stable error codes and deterministic, sorted, redacted, 64 KiB-bounded reporting.
|
||||
- [ ] Encode allowed target capabilities and forbidden Community capability kinds without a text-marker bypass.
|
||||
- [ ] Extend explicit scope-scanner coverage for new/untracked inventory and guardrail files.
|
||||
- [ ] Update Community documentation and `_bmad-output/project-context.md` without marking planned capabilities implemented.
|
||||
- [ ] Activate scenarios task-by-task, prove RED then GREEN, and finish with targeted tests, boundary/scope tests, and `just verify`.
|
||||
|
||||
Estimated implementation effort: **5–8 story points** (roughly 2–4 focused engineering days, excluding review latency).
|
||||
|
||||
### Red–Green–Refactor Contract
|
||||
|
||||
1. **RED:** remove the skip decorator from only the current scenario and run the specific module; retain the failing output in implementation evidence.
|
||||
2. **GREEN:** implement the smallest compatible behavior until that scenario passes, without changing Rust dependencies, toolchain, or wire contracts.
|
||||
3. **REFACTOR:** consolidate parser/reporting helpers only while all activated scenarios and existing scope tests remain green.
|
||||
|
||||
Execution commands:
|
||||
|
||||
```bash
|
||||
# Discover the complete safe scaffold (all scenarios remain skipped initially)
|
||||
python3 -m unittest tests.unit.test_validate_capability_inventory
|
||||
|
||||
# After activating one or more scenarios
|
||||
python3 -m unittest -v tests.unit.test_validate_capability_inventory
|
||||
|
||||
# Existing boundary regression suite
|
||||
python3 -m unittest -v tests.unit.test_check_community_scope
|
||||
|
||||
# Final repository gate
|
||||
just verify
|
||||
```
|
||||
|
||||
### Deliverable Summary
|
||||
|
||||
- Story: **1.1**, key `1-1-capability-inventory`.
|
||||
- Story source: `_bmad-output/planning-artifacts/epics.md`.
|
||||
- Primary level: CLI contract / repository integration.
|
||||
- Tests: 10 CLI/API-contract, 0 E2E, 0 component.
|
||||
- Generated test file: `tests/unit/test_validate_capability_inventory.py` (388 lines).
|
||||
- Factories/fixtures: five local builders/runners plus temporary-root lifecycle and secret canary; no shared fixture files required.
|
||||
- External mock requirements: 0; `data-testid` requirements: 0.
|
||||
- Implementation tasks: 8; estimate: 5–8 points.
|
||||
- Durable generation summary: `_bmad-output/test-artifacts/atdd-summary-1-1-capability-inventory.json`.
|
||||
- Knowledge/patterns applied: API testing patterns, deterministic data factories, contract-testing principles, and the existing Community scope unittest/subprocess convention.
|
||||
- Next workflow: implement Story 1.1 with `bmad-dev-story`; broader automation expansion follows after GREEN behavior exists.
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"story_id": "1.1",
|
||||
"story_key": "1-1-capability-inventory",
|
||||
"tdd_phase": "RED",
|
||||
"total_tests": 10,
|
||||
"api_cli_tests": 10,
|
||||
"e2e_tests": 0,
|
||||
"component_tests": 0,
|
||||
"all_tests_skipped": true,
|
||||
"expected_to_fail_when_activated": true,
|
||||
"embedded_fixture_capabilities": 7,
|
||||
"acceptance_contract_groups_covered": 8,
|
||||
"subagent_execution": "SUBAGENT (API + E2E)",
|
||||
"generated_test_files": [
|
||||
"tests/unit/test_validate_capability_inventory.py"
|
||||
],
|
||||
"validation": {
|
||||
"syntax": "passed",
|
||||
"discovery": "passed",
|
||||
"tests_discovered": 10,
|
||||
"tests_skipped": 10,
|
||||
"browser_session_opened": false,
|
||||
"orphaned_sessions": false
|
||||
},
|
||||
"knowledge_fragments_applied": [
|
||||
"api-testing-patterns",
|
||||
"data-factories",
|
||||
"contract-testing",
|
||||
"existing tests/unit/test_check_community_scope.py pattern"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
---
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
lastEdited: '2026-09-13'
|
||||
editScope: 'system-level inventory and evidence-aware strategy refresh'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
workflowType: 'testarch-test-design'
|
||||
inputDocuments:
|
||||
- '_bmad-output/project-context.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/addendum.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
---
|
||||
|
||||
# Test Design for Architecture: Crank Community Production Readiness
|
||||
|
||||
**Purpose:** Architectural testability contract between Engineering, Architecture, Security and QA. It defines what the system must expose so production claims can be proven; execution details live in `test-design-qa.md`.
|
||||
|
||||
**Date:** 2026-09-13 (original design: 2026-08-08)
|
||||
**Author:** BMad TEA / Bsodfather
|
||||
**Status:** System-level design updated; production qualification remains unproven
|
||||
**Project:** crank
|
||||
**PRD:** `_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md`
|
||||
**Architecture:** `_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md`
|
||||
|
||||
## Executive Summary
|
||||
|
||||
The Community edition is being advanced from a working brownfield REST→MCP core to a production-ready, self-hosted product for small organizations and private developers. Scope covers 54 FRs, 30 NFRs and 8 epics: real-world OpenAPI import; complete modern MCP Tools/Resources/Prompts and Tasks; safe concurrency; end-to-end traceability; Prometheus/Grafana/GlitchTip; built-in load testing; secure offline deployment/recovery; and evidence-backed release.
|
||||
|
||||
Key decisions are a Rust hexagonal modular monolith; PostgreSQL as correctness authority with optional rebuildable Valkey; immutable/versioned capability catalogs; unified outbound execution; durable CAS/fenced Tasks; typed observability/metrics; and a fail-closed signed evidence manifest.
|
||||
|
||||
Expected reference scale is 100 RPS for 30 minutes, a 250 RPS five-minute burst, 128 concurrent executions, 10,000 queued Tasks and a production-size catalog/history dataset on 4 vCPU/8 GiB. Platform overhead is bounded at 50 ms p95/150 ms p99.
|
||||
|
||||
**Risk summary:** 15 risks: 14 high (score ≥6), 1 medium, 0 low. Five score-9 risks are release blockers. Scores describe inherent release risk, not a measured residual defect rate. The August effort estimate is superseded as a remaining-work forecast: significant foundation code and tests now exist. The PRD's 30-day burn-in remains non-accelerable calendar time.
|
||||
|
||||
## Audit Boundary and Evidence State — 2026-09-13
|
||||
|
||||
This refresh inspects tracked source at `083974c27f3a21a15807dd248bb6bc4fe04a5cd8` (`main`). It does not declare the system production-ready or reopen epic/story implementation.
|
||||
|
||||
- Story 2.9 commit `f8ee7c9bfeaa8a3f73a4850ff3f82b2bc2155fe8` is separate and not integrated into main. Its HTTP-contract tests and prior successful `just verify` apply to that candidate, not main.
|
||||
- `docs/capability-baseline/results.json` contains historical revision-bound evidence, including records for `767428436d3a54e60809a727044dfcec48e1f1dd`. Validating that snapshot does not execute today's product or establish today's manual-regression verdict.
|
||||
- Test source, an executed test report, measured coverage, and release qualification are four different claims. The QA companion records the inventory and required evidence; no current line/branch coverage report was found.
|
||||
- Prior system and Epic 1 checkpoints are historical records. Epic plans, sprint statuses and the handoff document are unchanged by this edit; the two refreshed system documents take precedence for current inventory and CP-to-FR mapping.
|
||||
|
||||
## Quick Guide
|
||||
|
||||
### 🚨 BLOCKERS — architecture must provide
|
||||
|
||||
1. **B-001 Deterministic control plane:** aggregate builders, per-test namespaces, controllable clock/IDs/scheduler and reliable cleanup. Owner: Core/Task Architecture; foundation through Epic 4.
|
||||
2. **B-002 Named fault-injection seams:** upstream/DNS/redirect, PostgreSQL/Valkey, worker crash, telemetry endpoint, disk/fsync and network failure controls. Owner: Platform/SRE; before affected epic qualification.
|
||||
3. **B-003 Queryable observability sinks:** local history, captured OTLP/Sentry envelopes, Prometheus exposition and Grafana provisioning queryable by request/trace ID. Owner: Observability; before Epic 5 qualification.
|
||||
4. **B-004 Executable evidence contract:** stable schemas, content-addressed collectors and RC/config/topology provenance from the first enabling epic. Owner: Release Architecture; establish in Epic 1.
|
||||
5. **B-005 Independently measurable load runner:** isolated resource accounting, calibrated stub/external reference, heartbeat and kill path. Owner: Performance/Platform; before Epic 6.
|
||||
|
||||
The B-001..B-005 list is a required-capability contract, not a claim that all foundations are absent:
|
||||
|
||||
| Seam | Existing foundation | Remaining system-level gap |
|
||||
|---|---|---|
|
||||
| B-001 | PostgreSQL Testcontainers, per-test schemas, runtime doubles, typed builders | Deterministic durable Task time/claim/crash control; UI isolation before increasing workers |
|
||||
| B-002 | DNS/redirect/proxy negatives, artifact crash/disk-full tests, DB failure/rollback tests | Worker, telemetry-spool and full-stack recovery fault orchestration |
|
||||
| B-003 | Captured OTLP, redaction, local request/trace identity and Prometheus tests | Actual GlitchTip receiver/delivery evidence, browser-to-receiver correlation, dashboards/alerts |
|
||||
| B-004 | Versioned capability inventory, bounded collectors and accepted-run validation | Complete same-RC signed release evidence across every required surface, not only OpenAPI UI |
|
||||
| B-005 | Local overhead/budget probes and an ignored million-row history query test | Calibrated full workload, built-in Load Runs, separate generator/SUT accounting and stop control |
|
||||
|
||||
### ⚠️ HIGH PRIORITY — validate during implementation
|
||||
|
||||
1. Freeze Task lease/poll/batch/fairness parameters by performance evidence without weakening NFRs.
|
||||
2. Freeze MCP versions and digest-pinned observability images at feature freeze, then bind them into the RC manifest.
|
||||
3. Prove PostgreSQL/artifact/config/key consistency before readiness and after restore; a green health endpoint alone is insufficient.
|
||||
4. Start nightly contention, telemetry-replay and soak trends before the final epics so long-duration defects are found early.
|
||||
|
||||
### 📋 INFO ONLY — agreed strategy
|
||||
|
||||
- Lowest effective test level is authoritative; E2E is reserved for critical cross-boundary outcomes.
|
||||
- PostgreSQL 16 Testcontainers, Rust property/state-machine tests, MCP protocol harnesses and Playwright browser journeys build on existing repository patterns.
|
||||
- Target execution tiers are PR, nightly, weekly and immutable-RC qualification. Current Gitea files implement PR/push and release gates; scheduled qualification tiers are not yet established.
|
||||
- Release requires 100% P0, complete mandatory evidence, no Critical/High findings and all quantitative NFRs met.
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
| ID | Category | Risk | P | I | Score | Mitigation | Owner | Timeline |
|
||||
|---|---|---|---:|---:|---:|---|---|---|
|
||||
| R-001 | TECH | Untested brownfield regressions | 3 | 3 | **9** | Capability inventory, characterization and guided baseline | QA Lead + Core | Epic 1 |
|
||||
| R-002 | DATA | OpenAPI semantic loss/mapping errors | 3 | 3 | **9** | ≥50-spec oracle corpus, deterministic IR/plan, atomic apply | Import Lead | Epic 2 |
|
||||
| R-003 | TECH | Duplicate effects/stale Task writes after contention or crash | 3 | 3 | **9** | State model, PG contention/crash tests, fencing and reconciliation | Task Lead | Epic 4 |
|
||||
| R-004 | SEC | SSRF/bypass or secret leakage crosses closed contour | 3 | 3 | **9** | Malicious network lab, canaries, fail-closed config | Security Owner | Every epic + RC |
|
||||
| R-005 | OPS | Trace spool/replay failure creates false correlation claims | 2 | 3 | **6** | Capacity/outage/corruption tests and loss accounting | Observability Lead | Epic 5 |
|
||||
| R-006 | PERF | DB/telemetry/runner contention breaches SLO | 3 | 3 | **9** | Calibrated workload, query plans, resource differential | Performance Owner | Epics 5–6 + RC |
|
||||
| R-007 | SEC | Admin bootstrap/session/recovery authorization failure | 2 | 3 | **6** | Auth state model and full web-security matrix | Security + Admin API | Epic 7 |
|
||||
| R-008 | OPS | Upgrade/restore produces schema/artifact/key mismatch | 2 | 3 | **6** | N/N-1 matrix and three product-probed PITR restores | Release/SRE | Epic 7 |
|
||||
| R-009 | BUS | MCP clients see inconsistent catalog/semantics | 2 | 3 | **6** | Immutable snapshots and ≥3-client version matrix | MCP Lead | Epic 3 |
|
||||
| R-010 | OPS | Built-in load runner escapes scope or cannot stop | 2 | 3 | **6** | Signed bounds, reserved capacity, watchdog/kill tests | Load + Security | Epic 6 |
|
||||
| R-011 | DATA | Metrics rollups double-count or explode cardinality | 2 | 3 | **6** | Typed registry lint and idempotent differential replay | Metrics Lead | Epic 5 |
|
||||
| R-012 | TECH | Flaky E2E hides defects and slows feedback | 2 | 2 | 4 | Isolated factories, deterministic waits and burn-in | QA Automation | Continuous |
|
||||
| R-013 | OPS | Evidence mixes builds or is stale/incomplete | 2 | 3 | **6** | Fail-closed signed manifest binding all digests | Release Owner | Epic 1→8 |
|
||||
| R-014 | SEC | Offline bundle is untrusted/vulnerable or leaks egress | 2 | 3 | **6** | SBOM/signature/air-gap/default-deny tests | Supply-chain Owner | Epics 7–8 |
|
||||
| R-015 | OPS | 30-day run reveals leaks/corruption too late | 2 | 3 | **6** | Early nightly trends, 72 h pre-soak, final burn-in | QA/SRE | Epic 4→8 |
|
||||
|
||||
Category meanings: TECH architecture/integration; SEC security/privacy; PERF performance/scalability; DATA integrity; BUS user/business behavior; OPS deployment/operations.
|
||||
|
||||
## NFR Testability Requirements
|
||||
|
||||
| Category | Bound requirement | Design support | Required seam / decision | Planned evidence |
|
||||
|---|---|---|---|---|
|
||||
| Security/privacy | Default deny; encrypted secrets; per-connection SSRF; no Critical/High; no opt-out egress | Strong invariants, partial implementation | Malicious network lab, secret canaries, security configuration fixture | Negative suites, SARIF/SBOM, egress and canary reports |
|
||||
| Performance/scale | 100/250 RPS; 99.95% success; 128/10k; 50/150 ms overhead | Quantified and topology-bound | Calibrated stub/external generator, production dataset, independent runner accounting | Raw samples, resource series, query plans, threshold JSON |
|
||||
| Reliability/recovery | 30 s drain, 60 s lease recovery, RPO 5 m/RTO 30 m, 72 h/30 d | Durable architecture defined | Crash/fault control, virtual time, consistency manifest | Crash schedule, restore manifests/probes, soak series |
|
||||
| Observability | 100% IDs/traces; 99.99%/60 s delivery; 25 h completeness; 30 h spool; bounded overhead | Typed ownership and spool designed | Queryable capture sinks, disk/outage controls, loss oracle | Correlation graph, captured envelopes, spool ledger, metric/dashboard tests |
|
||||
| Maintainability/compatibility | MSRV/wire discipline; MCP stable/N-1/N-2; RU+EN | Conventions defined | Feature-freeze matrix and executable architecture rules | Coverage/lint, protocol/corpus/browser matrices |
|
||||
| Release provenance | One immutable RC, signed complete evidence, no mandatory waivers | Fail-closed manifest designed | Stable schemas/collectors/trust store from Epic 1 | Validated signed manifest and content-addressed raw tree |
|
||||
|
||||
Product thresholds come from PRD §5 and §10; this design does not invent replacements. Exact client/revision/image matrices, measurement tooling, reference-host allocation and release trust material still require recorded freeze inputs. A missing measurement environment or report is an evidence gap even when the numerical threshold is known.
|
||||
|
||||
## Testability Concerns and Architectural Gaps
|
||||
|
||||
### 🚨 Actionable concerns
|
||||
|
||||
| Concern | Impact | Architecture must provide | Owner | Timeline |
|
||||
|---|---|---|---|---|
|
||||
| Deterministic state/time | Flaky or impractically slow Task/retention tests | Builders, scoped cleanup, clock/ID/scheduler ports | Core/Task | Epic 1–4 |
|
||||
| Incomplete fault controls | Recovery/security behavior cannot be reproduced | Named injection points with observable activation | Platform/SRE | Before each NFR epic gate |
|
||||
| Non-queryable telemetry | Trace assertions depend on external UI/manual inspection | Local capture/query adapters and stable schemas | Observability | Epic 5 |
|
||||
| Generator/SUT ambiguity | Invalid performance verdicts | Separate budgets/metrics plus external calibration | Performance | Epic 6 |
|
||||
| Late evidence plumbing | Cross-RC or irreproducible release proof | Manifest schemas and collectors from foundation | Release | Epic 1 |
|
||||
| UI shared state | Parallel browser collisions and stale assertions | Per-worker namespaces, seed/cleanup APIs, stable selectors | Admin/QA | Before full regression |
|
||||
|
||||
### Required architectural improvements
|
||||
|
||||
1. Reuse existing builders, runtime doubles and fault seams. Introduce time/claim/failure controls only at new stateful boundaries that require them; do not refactor all modules solely to match a testing pattern.
|
||||
2. Treat test/evidence schemas as supported internal contracts, versioned alongside wire and migration changes.
|
||||
3. Expose only safe, bounded test control in test profiles; production profiles must reject it.
|
||||
4. Make observability truth distinguish `captured locally`, `delivered`, `lost` and `unknown`; UI must never infer GlitchTip presence.
|
||||
5. Add resource ownership/accounting to load runner and telemetry spools so product and harness costs are separable.
|
||||
|
||||
### Testability assessment summary
|
||||
|
||||
- ✅ Hexagonal, framework-free core supports unit/property testing and adapter replacement.
|
||||
- ✅ PostgreSQL authority plus optional Valkey enables correctness-first and differential cache tests.
|
||||
- ✅ Existing Testcontainers support, Rust suites, in-memory runtime stores and Playwright coverage are a solid base.
|
||||
- ✅ Typed errors/events/metrics, immutable revisions and version-isolated MCP adapters provide stable oracles.
|
||||
- Quantitative NFRs and bounded capability collectors provide an objective starting point; complete signed release qualification is still a required future capability.
|
||||
|
||||
Accepted trade-offs: single-instance drain/restart is the only claimed upgrade model; HA/rolling upgrades, S3 artifacts, SSO/RBAC, non-REST adapters and arbitrary distributed load targets remain out of this release and must not appear in evidence or documentation claims.
|
||||
|
||||
## Risk Mitigation Plans
|
||||
|
||||
All high risks follow the same gate: the owner implements the production seam/control, QA captures machine-readable evidence, and the risk closes only when the linked scenarios pass on the bound topology. Owners below are accountable roles, not claims that separate staffed teams exist. The product owner must assign a person before scheduling qualification. Existing tests reduce implementation work but do not by themselves close a risk.
|
||||
|
||||
| Risk | Numbered strategy | Owner / timeline | Status | Verification |
|
||||
|---|---|---|---|---|
|
||||
| R-001 | 1. Inventory; 2. characterize; 3. run guided baseline before semantic changes | QA Lead + Core / Epic 1 | Open; see seam inventory | CP-01..04 and zero blocked baseline items |
|
||||
| R-002 | 1. Build oracle corpus; 2. prove deterministic IR/plan; 3. prove rollback/zero loss | Import Lead / Epic 2 | Open; see seam inventory | CP-05..07 thresholds |
|
||||
| R-003 | 1. Model states; 2. inject crash/contention; 3. prove fencing/reconciliation | Task Lead / Epic 4 | Open; see seam inventory | CP-12..15, no illegal/stale transition |
|
||||
| R-004 | 1. Centralize policy; 2. attack every ingress; 3. scan every output with canaries | Security Owner / every epic + RC | Open; see seam inventory | CP-03/04/25/27 and malicious-network report |
|
||||
| R-005 | 1. Implement delivery/loss ledger; 2. force outage/disk faults; 3. verify UI truth | Observability Lead / Epic 5 | Open; see seam inventory | CP-16..18 and spool accounting |
|
||||
| R-006 | 1. Calibrate; 2. baseline/query-plan; 3. run contention and immutable-RC profiles | Performance Owner / Epics 5–6 + RC | Open; see seam inventory | CP-14/18/23/29 raw thresholds |
|
||||
| R-007 | 1. Model auth; 2. exercise web config matrix; 3. prove recovery revocation | Security + Admin API / Epic 7 | Open; see seam inventory | CP-25 negative matrix |
|
||||
| R-008 | 1. Bind consistency manifest; 2. exercise N/N-1/rollback; 3. restore three times | Release/SRE / Epic 7 | Open; see seam inventory | CP-26 and measured product probes |
|
||||
| R-009 | 1. Isolate adapters; 2. freeze snapshots; 3. run revisions × clients | MCP Lead / Epic 3 | Open; see seam inventory | CP-08..11 matrix |
|
||||
| R-010 | 1. Sign/bound plan; 2. reserve control capacity; 3. force watchdog/kill recovery | Load + Security / Epic 6 | Open; see seam inventory | CP-22..24 |
|
||||
| R-011 | 1. Type registry; 2. enforce label budget; 3. replay/diff rollups and alerts | Metrics Lead / Epic 5 | Open; see seam inventory | CP-19..21 |
|
||||
| R-013 | 1. Version schemas; 2. bind all digests/freshness; 3. verify trust/revocation failures | Release Owner / Epic 1→8 | Open; see seam inventory | CP-31 negative matrix |
|
||||
| R-014 | 1. Pin/sign/SBOM; 2. scan; 3. install/upgrade with captured default-deny egress | Supply-chain Owner / Epics 7–8 | Open; see seam inventory | CP-27 |
|
||||
| R-015 | 1. Start nightly trends; 2. pass 72 h soak; 3. complete 30-day immutable-RC burn-in | QA/SRE / Epic 4→8 | Open; see seam inventory | CP-29 with no drift/SLO breach |
|
||||
|
||||
R-012 is medium (score 4): QA owns deterministic Playwright practices and continuous burn-in; it is monitored rather than treated as a production-architecture blocker. Final NFR status belongs to the later NFR assessment.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Assumptions:
|
||||
|
||||
1. Reference Deployment and all numeric thresholds in PRD/epics are normative.
|
||||
2. PostgreSQL remains the correctness source; Valkey outage may reduce throughput but cannot change results.
|
||||
3. Feature-freeze inputs may select versions/digests but cannot relax requirements.
|
||||
4. Release identity changes on any code/config/topology digest change.
|
||||
|
||||
Dependencies:
|
||||
|
||||
1. Foundation test controls and evidence schemas — Epic 1.
|
||||
2. Stable OpenAPI corpus oracle — Epic 2.
|
||||
3. Representative MCP clients and protocol harness — Epic 3.
|
||||
4. Fault/telemetry/load/recovery environments — before Epics 4–7 qualification.
|
||||
5. Protected release signing/trust material — before Epic 8 RC.
|
||||
|
||||
Risk to plan: specialized performance/security/SRE capacity or reference hardware may be unavailable. Contingency is to prepare hermetic fixtures and rehearsal environments early; qualification remains blocked rather than using incomparable evidence.
|
||||
|
||||
## System-Level Handoff Boundary
|
||||
|
||||
First review the QA inventory, evidence gaps and shared execution rules. Resolve common fixture, report-retention, compatibility and measurement prerequisites at system level; only then derive epic-level deltas from the same CP/R identifiers. Do not restart completed stories or create new mandatory features from this test design. Security, data-loss and unsupported-contract findings discovered during later testing must be triaged explicitly.
|
||||
|
||||
This edit ran no product tests, load jobs or deployment operations. The only test-discovery command was Playwright `--list`; source inspection and document consistency checks are not a final NFR assessment.
|
||||
@@ -0,0 +1,288 @@
|
||||
---
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
lastEdited: '2026-09-13'
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-1'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
workflowType: 'testarch-test-design'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/project-context.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 1 — Надёжный базовый REST → MCP продукт
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated regression planning baseline; implementation status unchanged, qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
This epic-level plan covers Stories 1.1–1.16 and proves the safe core journey: create/test/version/publish a REST Operation, publish an Agent catalog, manage credentials/approvals, execute through MCP and diagnose the result. It also establishes configuration, migrations, identity, metrics and evidence contracts required by later epics.
|
||||
|
||||
There are 15 risks: 13 high (six score 9), two medium and none low. The dominant categories are security, data integrity, execution consistency and operational correctness.
|
||||
|
||||
Coverage retains the 41 historical scenario-family IDs for continuity. The former 650–1,050-case / 655–1,150-hour forecast predates completed Epic 1 work and is not a remaining-work estimate. Reuse existing tests before identifying gaps; do not reopen completed stories or create hundreds of tests just to satisfy a forecast.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Full modern Resources/Prompts/Tasks | Epics 3–4 | Epic 1 establishes shared config/identity/metrics/runtime contracts |
|
||||
| GlitchTip spool, Grafana/SLO implementation | Epic 5 | Epic 1 proves correlation/redaction/typed metric foundations |
|
||||
| Built-in load runner | Epic 6 | Use test-only calibrated performance harness for Epic 1 thresholds |
|
||||
| Complete deployment/restore/air-gap qualification | Epics 7–8 | Migration/master-key contracts remain compatible and evidence-ready |
|
||||
| 72-hour soak and 30-day burn-in | Epic 8 | Bounded contention/resource trend checks are proposed; nightly scheduling is not currently configured |
|
||||
|
||||
## Existing Evidence Baseline
|
||||
|
||||
- Real PostgreSQL 16 Testcontainers and unique-schema fixtures exist.
|
||||
- Admin API covers basic Operation/Agent/key/secret/history/usage flows.
|
||||
- MCP suites cover tool calls, catalog scope/refresh, approvals, transport and correlation.
|
||||
- Runtime covers confirmation, idempotency, fail-closed stores and uncertain outcomes.
|
||||
- Metrics/observability cover closed labels, redaction, propagation, Prometheus and OTLP configuration.
|
||||
- Playwright covers key current screens, but is Chromium-only, one-worker and not yet production-qualification complete.
|
||||
|
||||
Existing tests are reusable evidence candidates, not automatic acceptance: each must be linked to the Inventory and rerun against the Epic candidate.
|
||||
|
||||
### 2026-09-13 Source and Gap Audit
|
||||
|
||||
Main is `083974c27f3a21a15807dd248bb6bc4fe04a5cd8`. Epic 1 is already implemented in sprint tracking; this is a regression/evidence update, not instructions to restart 1.1. Source presence is not current execution evidence. Historical baseline `2026.08.24.1` binds revision `767428`, not this HEAD. No product tests were rerun during this planning update.
|
||||
|
||||
| Story | Existing source to reuse | Remaining qualification distinction |
|
||||
|---|---|---|
|
||||
| 1.1 | `tests/unit/test_validate_capability_inventory.py`, `docs/capability-inventory.json` | Inventory schema correctness is not functional pass for every listed flow |
|
||||
| 1.2 | `docs/capability-baseline/results.json`, `scripts/collect-capability-baseline.py` | Old results and manual not-run/fail entries require fresh disposition, not inferred pass |
|
||||
| 1.3 | `crates/crank-config/tests/{contract,generation,redaction}.rs` | Config exists; later-process fields belong to owning stories/7.1 |
|
||||
| 1.4 | `crates/crank-registry/tests/integration/migrations.rs`, `apps/admin-api/tests/migration_command.rs` | Real migration regressions exist; full production N/N-1 qualification is 7.2 |
|
||||
| 1.5 | `crates/crank-observability/tests/{request_correlation,propagation}.rs` | Support IDs/capture do not prove GlitchTip delivery |
|
||||
| 1.6 | `crates/crank-metrics/tests/`, `crates/crank-runtime/tests/product_metrics.rs` | Typed schema/budget tests are not complete future subsystem coverage |
|
||||
| 1.7 | `apps/admin-api/tests/integration/operation_lifecycle.rs`, `apps/ui/tests/e2e/operation-lifecycle.spec.js` | Reuse immutable/conflict and RU/EN cases on changed lifecycle paths |
|
||||
| 1.8 | `crates/crank-runtime/tests/stages.rs`, `apps/mcp-server/tests/integration/execution_stages.rs` | Preserve synchronous parity; candidate 2.9 evidence remains separate |
|
||||
| 1.9 | `crates/crank-adapter-rest/tests/integration/outbound_security.rs` | Extend only new connection surfaces; production security qualification remains separate |
|
||||
| 1.10 | `apps/admin-api/tests/integration/credential_lifecycle.rs` | Reuse credential scope/rotation/canary tests |
|
||||
| 1.11 | `apps/admin-api/tests/migration_command.rs`, `apps/admin-api/tests/config_startup.rs` | Rotation/startup tests are not three qualified restore runs |
|
||||
| 1.12 | `apps/admin-api/tests/integration/auth_rate_limit.rs`, `apps/ui/tests/e2e/login.spec.js` | Full deployment exposure matrix belongs to 7.4 |
|
||||
| 1.13 | `apps/mcp-server/tests/integration/catalog_access.rs` | Source access/refresh regressions do not measure reference-scale discovery |
|
||||
| 1.14 | `crates/crank-runtime/tests/integration/confirmation.rs` | Preserve counted side effects, replay/race and honest uncertainty |
|
||||
| 1.15 | `apps/admin-api/tests/integration/logs_usage.rs`, `crates/crank-registry/tests/integration/observability.rs` | `production_size_invocation_history_queries_stay_bounded` is ignored; 1M-row qualification not claimed |
|
||||
| 1.16 | `apps/ui/tests/e2e/onboarding.spec.js` | Real public MCP path exists; fresh-user five-participant ≤15-min protocol remains separate manual evidence |
|
||||
|
||||
Current browser discovery: 56 tests /13 files, Chromium only, one worker. This is not full Firefox/WebKit × RU/EN coverage. No measured code-coverage report was found. Read the updated system QA inventory before scheduling gaps.
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
### High-priority risks
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | Mitigation | Owner | Target |
|
||||
|---|---|---|---:|---:|---:|---|---|---|
|
||||
| E1-R-001 | TECH | False Capability Inventory/baseline hides gaps/regressions | 3 | 3 | **9** | Strict validator, checksummed evidence and blocked severe flows | QA + Release | 1.1–1.2 |
|
||||
| E1-R-002 | OPS | Cross-process config drift/unsafe defaults | 3 | 3 | **9** | Single typed schema, golden config and boundary scans | Config/Core | 1.3 |
|
||||
| E1-R-003 | DATA | Migration corruption/race/incompatibility | 2 | 3 | **6** | Real-PG fresh/current/concurrent/failure matrix | Registry | 1.4 |
|
||||
| E1-R-004 | OPS | Missing/conflated/attacker-controlled IDs | 2 | 3 | **6** | Boundary contracts and golden correlation chain | Observability | 1.5 |
|
||||
| E1-R-005 | PERF | Metric cardinality/overhead exhaustion | 2 | 3 | **6** | Closed API, million-value stress and budget | Metrics | 1.6 |
|
||||
| E1-R-006 | DATA | Draft/import/archive mutates published behavior | 2 | 3 | **6** | State model, conflicts, roundtrip and snapshot regression | Operation | 1.7 |
|
||||
| E1-R-007 | TECH | Admin and MCP execute/classify differently | 3 | 3 | **9** | Table-driven parity and architecture guardrails | Runtime | 1.8 |
|
||||
| E1-R-008 | SEC | SSRF/proxy/redirect/header/retry bypass | 3 | 3 | **9** | Malicious-network matrix on Admin and MCP | Security + REST | 1.9 |
|
||||
| E1-R-009 | SEC | Credential leak/scope bypass/master-key data loss | 3 | 3 | **9** | Canaries, purpose/scope matrix and crash-safe rotation | Security + Registry | 1.10–1.11 |
|
||||
| E1-R-010 | SEC | Bootstrap/session/CSRF/proxy/recovery takeover | 2 | 3 | **6** | Auth model, concurrency and web-security matrix | Auth + Security | 1.12 |
|
||||
| E1-R-011 | DATA | Stale/foreign/Draft catalog leakage | 2 | 3 | **6** | Atomic snapshot, exact pinning and cache differential | Agent + MCP | 1.13 |
|
||||
| E1-R-012 | BUS | Approval race/replay causes unauthorized duplicate side effect | 3 | 3 | **9** | PG race model, single-use admission and uncertainty proof | Approval + Runtime | 1.14 |
|
||||
| E1-R-013 | SEC | History/CSV leaks data or large queries fail | 2 | 3 | **6** | Redaction/scope/CSV/UTC/retention and 1M dataset | History + Admin | 1.15 |
|
||||
|
||||
### Medium risks
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | Mitigation | Owner |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E1-R-014 | BUS | Onboarding duplicates state or never proves real MCP value | 2 | 2 | 4 | Server-authoritative real-endpoint/resume/usability E2E | Product + UI |
|
||||
| E1-R-015 | TECH | Serial/shared-state browser suite masks races | 2 | 2 | 4 | Per-worker data/ports, trace-on-failure and burn-in | QA Automation |
|
||||
|
||||
No low-priority risks were identified. Score 9 blocks the epic gate; score 6 requires verified mitigation.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
| Category | Epic threshold/invariant | Risks | Validation | Evidence |
|
||||
|---|---|---|---|---|
|
||||
| Security/privacy | Default deny; no metadata/secret leakage; encryption; SSRF on actual connections; zero Critical/High | E1-R-008/009/010/013 | Malicious network, key/auth scope matrix, canaries, web-security, SAST/SCA | JUnit/JSON, network capture, canary and scanner reports |
|
||||
| Performance/scale | Discovery ≤150 ms p95 at 200 Agents/2,000 Operations; Logs/Usage ≤2 s p95 at 1M records; bounded metric cardinality | E1-R-005/011/013 | Checksummed datasets, PG plans, raw browser/API timings, million-value metric stress | Plans, timing samples, resource/series report |
|
||||
| Reliability/data | Durable immutable revisions/config/approvals; transactional checksummed migrations; safety stores fail closed | E1-R-003/006/011/012 | PG contention/restart/failure, state/property tests and adapter call counters | Seeds/schedules, checksums and invariant results |
|
||||
| Observability | 100% Epic ingress/execution/history records have separate Request/Trace IDs; labels bounded; no secret payloads | E1-R-004/005/013 | Boundary/cross-process correlation, persistence queries, schema/redaction | Correlation map, trace capture, metric/redaction report |
|
||||
| Compatibility/maintainability | Existing wire/core behavior retained; MSRV/boundaries unchanged; RU+EN; regression per defect | E1-R-001/002/007/015 | Inventory, `just verify`, snapshots, localization/static/flake checks | Inventory/evidence links and CI reports |
|
||||
| UX/business | Fresh manual path reaches real MCP call ≤15 min; async states/recovery/stale guards/accessibility | E1-R-014 | Real-stack Playwright and frozen guided-usability protocol | Traces, accessibility and timing results |
|
||||
|
||||
Controlled inputs and remaining execution prerequisites:
|
||||
|
||||
- Reuse the shipped typed metric contract/series budgets from 1.6; freeze additional subsystem metrics in their owning stories, not by reopening 1.6.
|
||||
- Session/bootstrap/backoff/retention defaults and bounds are authoritative in `crank-config`; regression tests must use that contract.
|
||||
- The manual regression checklist specifies five fresh participants and median time-to-first-value ≤15 minutes; execution evidence is still required.
|
||||
|
||||
This plan defines evidence; final NFR PASS/CONCERNS/FAIL belongs to the later NFR assessment.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Story acceptance criteria and Requirements tags are unchanged or their change is reviewed.
|
||||
- Applicable typed config/migration/test-control seam exists and is production-safe.
|
||||
- PostgreSQL/Valkey/upstream/telemetry/browser fixtures use deterministic scoped data and cleanup.
|
||||
- Expected wire/state/security oracle is frozen before implementation.
|
||||
- Existing affected suites pass or their baseline failure is recorded in Capability Inventory.
|
||||
|
||||
## Exit Criteria
|
||||
|
||||
- Every acceptance criterion in Stories 1.1–1.16 maps to test and immutable evidence.
|
||||
- P0 and Story-acceptance P1 pass 100%; no blocked/skipped mandatory/manual item.
|
||||
- Six score-9 risks are closed; score-6 risks have verified mitigations.
|
||||
- No Critical/High defect or security finding; secret and cross-scope scans are clean.
|
||||
- Numeric discovery/UI/cardinality/usability targets pass on checksummed inputs.
|
||||
- Existing REST→MCP journey remains green; no unrelated dependency/toolchain/wire change is mixed in.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 describe risk priority, not execution timing. Detailed IDs E1-01..E1-41 are stable scenario-family identifiers.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
| IDs | Story | Primary coverage | Risk | Historical sizing, not remaining cases |
|
||||
|---|---|---|---|---:|
|
||||
| E1-01, E1-02, E1-03, E1-04 | 1.1–1.2 | Inventory/scope validator and real current REST→MCP baseline | E1-R-001 | 40–69 |
|
||||
| E1-06, E1-07 | 1.3 | Typed config values, conflicts, redaction, fingerprints and boundary scan | E1-R-002 | 53–85 |
|
||||
| E1-08, E1-09 | 1.4 | PG migration sequence/checksum/concurrency/failure/backfill | E1-R-003 | 30–48 |
|
||||
| E1-10, E1-11 | 1.5 | Hostile IDs and full correlation/persistence chain | E1-R-004 | 30–48 |
|
||||
| E1-12, E1-13 | 1.6 | Metric schema/guardrail/cardinality/exemplar/overhead | E1-R-005 | 28–44 + profiles |
|
||||
| E1-14, E1-15 | 1.7 | Operation state/revision/YAML/API/history invariants | E1-R-006 | 55–85 |
|
||||
| E1-17, E1-18, E1-19 | 1.8 | Admin/MCP target and failure parity plus boundaries | E1-R-007 | 51–82 |
|
||||
| E1-20, E1-21 | 1.9 | Actual-connect SSRF, redirects, proxy, headers, bounds/retries | E1-R-008 | 60–95 |
|
||||
| E1-22, E1-23, E1-24, E1-25 | 1.10–1.11 | Credential lifecycle/UI canary and master-key rotation/crash | E1-R-009 | 85–141 |
|
||||
| E1-26, E1-27 | 1.12 | Bootstrap/auth/session concurrency and security config | E1-R-010 | 55–90 |
|
||||
| E1-29, E1-30 | 1.13 | Atomic catalog/pinning/scope/cache/performance | E1-R-011 | 50–75 + profiles |
|
||||
| E1-32, E1-33 | 1.14 | Approval model/races/scope/single-use/uncertainty | E1-R-012 | 55–85 |
|
||||
| E1-35, E1-36, E1-37 | 1.15 | History redaction/scope/CSV/UTC/retention/1M performance | E1-R-013 | 53–87 + profiles |
|
||||
|
||||
### P1 — High
|
||||
|
||||
| IDs | Story | Primary coverage | Risk | Historical sizing, not remaining cases |
|
||||
|---|---|---|---|---:|
|
||||
| E1-05 | 1.2 | Bounded exploratory RU/EN baseline | E1-R-001 | 10–16 charters |
|
||||
| E1-16 | 1.7 | Operation lifecycle stale/immutable/YAML UI journey | E1-R-006 | 8–14 |
|
||||
| E1-23 | 1.10 | One-time secret DOM/storage/telemetry behavior | E1-R-009 | 10–16 |
|
||||
| E1-28 | 1.12 | Login/throttle/expiry/recovery browser states | E1-R-010 | 10–16 |
|
||||
| E1-31 | 1.13 | Agent Draft/Published/revision/conflict UI | E1-R-011 | 8–14 |
|
||||
| E1-34 | 1.14 | Approval safe summary/expiry/conflict/stale UI | E1-R-012 | 8–12 |
|
||||
| E1-38, E1-39, E1-40 | 1.16 | Authoritative onboarding, real call, failures, accessibility and usability | E1-R-014 | 41–69 + usability |
|
||||
| E1-41 | All | Isolation, deterministic burn-in and traceability quality | E1-R-015 | 8–12 harness checks |
|
||||
|
||||
### P2/P3
|
||||
|
||||
P2/P3 are optional focused exploratory/benchmark variants only. No numeric quota of new tests is required; neither replaces mandatory evidence.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional coverage in PR when it fits the ≤15-minute target; defer only expensive infrastructure or duration.
|
||||
|
||||
Nightly/weekly below describe the intended execution tiers, not existing scheduled jobs. Current CI runs PR/push and release gates. `just verify` does not include UI E2E, image or deployment qualification. Mandatory owning-story acceptance still requires its evidence even when a profile is expensive.
|
||||
|
||||
- **PR:** changed unit/property/static tests; targeted PostgreSQL/Admin/MCP integration; Inventory/config/boundary contracts; changed Playwright plus shared auth/API smoke.
|
||||
- **Nightly:** full Epic Rust/PG/Valkey/Admin/MCP and Chromium UI; security negatives; correlation; cardinality; migration/rotation/approval contention and flake burn-in.
|
||||
- **Weekly:** malicious network, 200/2k/1M performance profiles, web-security matrix, master-key crash/recovery, guided onboarding/accessibility and required exploratory refresh.
|
||||
- **Epic qualification:** complete traceability and evidence for one Epic candidate digest. Product-wide 72-hour/30-day qualification remains Epic 8.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
The old initial-implementation estimate is superseded. Provisional incremental QA audit/regression effort, assuming existing seams are reusable, excluding product implementation and qualification elapsed time:
|
||||
|
||||
| Priority | Effort |
|
||||
|---|---:|
|
||||
| P0 | ~16–32 hours |
|
||||
| P1 | ~8–16 hours |
|
||||
| P2 | ~0–8 hours |
|
||||
| P3 | ~0–4 hours |
|
||||
| **Total** | **~24–60 hours** |
|
||||
|
||||
Approximately 1–2 contributor-weeks, low confidence until AC-to-existing-test reconciliation. These are planning bounds, not authorizations for extra work or a token target. Missing reference hardware/manual reviewers add lead time; do not fold 1M-row or release qualification into every story session.
|
||||
|
||||
Prerequisites include scoped data factories, malicious upstream/DNS proxy, controllable clock/IDs, ciphertext/key fixtures, production-size datasets, captured telemetry and safe failure injection.
|
||||
|
||||
## Quality Gate Criteria
|
||||
|
||||
- P0 100%; P1 ≥95% during development and 100% for acceptance/epic qualification.
|
||||
- Security scenarios and score-9 mitigations 100%; no Critical/High findings.
|
||||
- Requirement-to-test-to-evidence mapping 100% for Stories 1.1–1.16.
|
||||
- Workspace coverage ≥80%; new critical config/migration/state/security code targets ≥90% where measured. These remain goals: no current coverage report proves them, and test counts cannot substitute for one.
|
||||
- Discovery/UI/cardinality/usability targets pass; metric budget must be frozen first.
|
||||
- Full NFR decision is deferred until implementation evidence is assessed.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
The statuses below mean pending qualification evidence, not absent implementation. Use the source audit above to distinguish implemented controls from unexecuted qualification; no risk is closed solely by source presence. Risk scores are inherited conservative planning scores, not observed current failures.
|
||||
|
||||
| Risk | Strategy | Verification | Status |
|
||||
|---|---|---|---|
|
||||
| E1-R-001 | Schema/validator → full mapping → immutable baseline | E1-01..05 and zero hidden severe flow | Planned |
|
||||
| E1-R-002 | Central schema → process parity → env-read guardrail | E1-06, E1-07 | Planned |
|
||||
| E1-R-003 | Immutable sequence → contention/faults → N/N-1 fixture | E1-08, E1-09 | Planned |
|
||||
| E1-R-004 | Typed IDs → hostile boundary inputs → golden chain | E1-10, E1-11 | Planned |
|
||||
| E1-R-005 | Closed registry → series budget → stress/overhead | E1-12, E1-13 | Planned |
|
||||
| E1-R-006 | State model → PG revision conflicts → API/UI roundtrip | E1-14..16 | Planned |
|
||||
| E1-R-007 | Unified request → stage parity → dependency guardrail | E1-17, E1-18, E1-19 | Planned |
|
||||
| E1-R-008 | Actual-connect policy → attack matrix → no-secret scan | E1-20, E1-21 | Planned |
|
||||
| E1-R-009 | Credential scope/canary → durable rotation → browser proof | E1-22, E1-23, E1-24, E1-25 | Planned |
|
||||
| E1-R-010 | Auth model → web config matrix → browser/recovery proof | E1-26..28 | Planned |
|
||||
| E1-R-011 | Atomic snapshot → cache/scope differential → scale/UI | E1-29..31 | Planned |
|
||||
| E1-R-012 | Fingerprint/model → PG races → side-effect counters/UI | E1-32..34 | Planned |
|
||||
| E1-R-013 | Redaction/scope → time/CSV/retention → 1M UI | E1-35, E1-36, E1-37 | Planned |
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Assumptions:
|
||||
|
||||
1. PostgreSQL remains correctness authority; Valkey is optional acceleration.
|
||||
2. Reference datasets and thresholds in PRD/epics are normative.
|
||||
3. Existing tests may be refactored for traceability/isolation without changing product semantics.
|
||||
4. Security-sensitive test controls are unavailable in production configuration.
|
||||
|
||||
Dependencies:
|
||||
|
||||
1. Preserve completed 1.1–1.16 state; rerun only relevant regressions when a later story touches shared contracts.
|
||||
2. Reuse existing metric/security/key fixtures and approved usability protocol; remaining full-system evidence follows Epics 5–8.
|
||||
3. Docker is available for PostgreSQL/Valkey/full-stack evidence.
|
||||
|
||||
Risk to plan: single-worker/default-port Playwright infrastructure may delay PR feedback. Contingency is to keep targeted browser smoke serial while building per-worker data/ports; do not raise workers until repeated burn-in proves isolation.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
| Component | Regression scope |
|
||||
|---|---|
|
||||
| Scope/docs/project context | Community boundary and Inventory validator tests |
|
||||
| Admin API/UI | Existing Operations/Agents/keys/secrets/login/Logs/Usage specs plus owning Story gaps |
|
||||
| MCP server/catalog | Transport, catalog access/search, approval and tool execution suites |
|
||||
| Runtime/REST adapter | Mapping/stages/idempotency/confirmation/Valkey and outbound client suites |
|
||||
| Registry/PostgreSQL | Operations/artifacts/workspace/approval/observability/migration suites |
|
||||
| Metrics/trace/observability | Closed schema, propagation, redaction, Prometheus/OTLP/history-loss suites |
|
||||
|
||||
Every defect fix starts with the lowest-level regression and adds a boundary test when the contract crossed layers.
|
||||
|
||||
## Manual Follow-on
|
||||
|
||||
- Do not restart Epic 1. For a separately approved new/fix story, run bounded ATDD before implementation, reusing existing tests and completed matching checklists. Never add red tests solely to make already-correct behavior fail.
|
||||
- The requested automatic pre-implementation handoff is configured separately from this design; stock bmad-loop 0.11.1 TEA runs ATDD after dev and must not be mistaken for the intended order.
|
||||
- Run broader automation after the corresponding production seams exist.
|
||||
- Run traceability and NFR assessment only against implementation evidence.
|
||||
|
||||
## References
|
||||
|
||||
- `_bmad-output/planning-artifacts/epics.md` — Epic 1 Stories 1.1–1.16
|
||||
- `_bmad-output/test-artifacts/test-design-architecture.md`
|
||||
- `_bmad-output/test-artifacts/test-design-qa.md`
|
||||
- `_bmad-output/test-artifacts/test-design/crank-handoff.md` — historical handoff, not current execution evidence; current system QA/design and epic plans take precedence
|
||||
- Risk governance, probability-impact, test levels/priorities and NFR criteria knowledge fragments
|
||||
|
||||
**Generated by:** BMad TEA Agent
|
||||
**Workflow:** `bmad-testarch-test-design`
|
||||
@@ -0,0 +1,185 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-2'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 2 — Надёжное создание Tools из реальных OpenAPI
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-7–FR-12, 15 stories, system scenario families CP-05..07. This plan reflects the approved numbering revision; it neither changes product scope nor marks stories complete.
|
||||
|
||||
4 inherent risks, 3 high (score ≥6). Coverage seeds: 22 P0 and 8 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: `crates/crank-artifacts/tests/{artifact_store,artifact_store_io,reconciliation}.rs`; `crates/crank-registry/tests/integration/{artifact_sources,artifact_reconciliation}.rs`; `apps/admin-api/tests/integration/openapi_source/`; `crates/crank-import/tests/{preview,coverage,normalization_details,reference_resolution}.rs`; `apps/admin-api/tests/integration/openapi_import/`; `apps/ui/tests/e2e/operations.spec.js`.
|
||||
|
||||
2.1–2.6 source/metadata/reconciliation/preview and 2.7–2.8 have reusable source tests, not fresh acceptance evidence. 2.9 tests exist only at candidate f8ee7c9, not main 083974c; rerun after integration. Security-scheme API/UI mapping, full partial/re-import policy matrix, ≥50-spec corpus and OpenAPI onboarding still need story-level deltas. Two candidate review deferrals (reverse URL placeholder validation and object/array default projection) remain explicit triage inputs, not automatically accepted or added to every story.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 2 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E2-R1 | DATA | Silent HTTP/schema loss in supported imports | 3 | 3 | 9 | R-002 | Wire oracle + IR/ref/plan golden tests; Import owner, before 2.14 |
|
||||
| E2-R2 | SEC | Hostile files/refs escape scope, leak secrets or exhaust resources | 3 | 3 | 9 | R-004 | Bounded parser/network/storage canaries; Security + Import, each source story |
|
||||
| E2-R3 | DATA | GC/re-import races lose pinned artifacts or overwrite revisions | 2 | 3 | 6 | R-008 | Real PG + filesystem fault interleavings; Registry, before 2.13 |
|
||||
| E2-R4 | TECH | Flaky preview UI/evidence masks failed import | 2 | 2 | 4 | R-012 | Stale-response tests + strict evidence; UI/QA, 2.6/2.15 |
|
||||
|
||||
Medium risks: E2-R4 (4), tracked UI flakiness. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
Zero silent semantic loss; ≥50 versioned specs and ≥95% actionable Draft operations (2.14). Source size/depth/time/scan budgets come from the typed contract; test min/max/over-limit, do not invent limits. No secrets outside allowed encrypted authority. Test artifact retention under reference/cleanup contention.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- Immutable hostile/valid YAML/JSON corpus with expected IR and wire outcomes; local allowlisted HTTP/DNS fixtures; isolated temp roots; real PostgreSQL schemas; reproducible crash checkpoints. File-size fault tests must retain pipe/PTY stdout rather than a regular-file redirect.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories `Given` groups, including the five shared groups inherited by both Stories 2.3 and 2.4; their physical placement under 2.4 does not mean 2.3 has no AC. Counts are not a claim that two tests exhaust those groups. The former security-mapping story is split without loss: 2.10 owns its former API groups 1–10 and 12, while 2.11 owns former group 11 plus the UI perspectives of groups 3 and 5. ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 2.1 / 2.1-INT-A,B | FR-7, FR-9 | 6 | INT | E2-R2/E2-R3 | Immutable bytes: digest roundtrip and concurrent no-clobber dedupe | Corrupt/missing bytes, symlink/traversal and crash/disk-full must fail safely |
|
||||
| 2.2 / 2.2-INT-A,B | FR-7, FR-9 | 6 | INT | E2-R2/E2-R3 | Workspace-owned metadata attach/read/detach and idempotent replay | Foreign scope indistinguishable from missing; conflicting replay and missing blob rejected |
|
||||
| 2.3 / 2.3-INT-A,B | FR-7, FR-9 | 5 shared | INT | E2-R3 | Bounded scan continuation visits eligible entries exactly once | Malformed entries, quarantine/unlink race and retries preserve live bytes |
|
||||
| 2.4 / 2.4-INT-A,B | FR-7, FR-9 | 5 | INT | E2-R3 | Claim/finalize recovery converges after process restart | Global reference recheck wins over cleanup; stale token and DB/fsync crash windows cannot delete referenced content |
|
||||
| 2.5 / 2.5-API-A,B | FR-7, FR-9 | 6 | API | E2-R2 | Verified YAML/JSON multipart preview creates no Draft | Malformed/oversized/cancelled upload, foreign scope, corruption and parser canaries remain bounded/sanitized |
|
||||
| 2.7 / 2.7-UNIT-A,B | FR-7, FR-8 | 12 | UNIT | E2-R1 | OAS3.0/3.1/Swagger2 normalize byte-for-byte to stable source-construct identities | Malformed, duplicate IDs and unsupported constructs yield bounded explicit findings, never silent loss |
|
||||
| 2.8 / 2.8-INT-A,B | FR-9 | 13 | INT | E2-R1/E2-R2 | Local/external refs and supported composition preserve provenance/snapshot digests | Cycles, depth/size, SSRF/redirect/TOCTOU and foreign cached snapshots denied |
|
||||
| 2.9 / 2.9-INT-A,B | FR-8 | 14 | INT | E2-R1 | All supported methods/parameter locations/body encodings replay expected wire bytes; 2xx/204 outcomes match | Unsupported XML/serialization or lost semantics block with findings; hostile headers/bodies fail before dispatch |
|
||||
| 2.10 / 2.10-API-A,B | FR-10 | 11 | API | E2-R2 | Global/operation security overrides, OR/AND and explicit no-auth bind compatible AuthProfileRef | Revoked/foreign/wrong-scheme refs rejected; imported secret canaries absent from API IR/plan/export surfaces |
|
||||
| 2.13 / 2.13-INT-A,B | FR-11 | 15 | INT | E2-R1/E2-R3 | skip/rename/new_version decisions apply atomically with immutable report and scoped replay | Concurrent/stale/conflicting plans and crash before/after commit leave no partial or mutated Published state |
|
||||
| 2.14 / 2.14-INT-A,B | FR-12 | 13 | INT | E2-R1 | Checksummed corpus of at least 50 specs yields ≥95% actionable operations and zero silent loss | Bad fixture/checksum/unsupported construct is explicit; offline rerun reproduces oracle and evidence |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 2.6 / 2.6-E2E-A,B | FR-7, FR-9 | 5 | E2E | E2-R4 | Real multipart upload renders actionable preview and safe support IDs | Replace/navigation/cancel races reject stale responses; RU/EN keyboard flow and clean required evidence |
|
||||
| 2.11 / 2.11-E2E-A,B | FR-10 | 3 | E2E | E2-R2/E2-R4 | Security mapping UI makes the selected compatible AuthProfileRef and explicit no-auth state visible without exposing secrets | Stale/foreign/revoked/wrong-scheme selections and secret canaries are rejected or absent from browser-visible state |
|
||||
| 2.12 / 2.12-API-A,B | FR-7 | 14 | API | E2-R1/E2-R4 | Preview classifies every operation and computes dependency-closed explicit partial ImportPlan | Blockers/stale digest cannot apply; bounded 2k pagination and out-of-order UI updates do not change selection |
|
||||
| 2.15 / 2.15-E2E-A,B | FR-7, FR-11, FR-33 | 7 | E2E | E2-R4 | OpenAPI onboarding reuses upload → selection → publish → Agent → real MCP call | Return context/digest changes/retry must not auto-publish, duplicate records or claim activation without call |
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 40–80 hours |
|
||||
| P1 | 20–40 hours |
|
||||
| Optional P2 | 0–8 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 60–132 hours, approximately 2–4 contributor-weeks |
|
||||
|
||||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Epic 1 safety foundation → 2.1/b/e/f → 2.5/d → 2.7 → 2.8 → 2.9 → 2.10/2.11 → 2.12 → 2.13 → 2.14 → 2.15; retain the explicit dependency graph in epics.md. Do not start later work by treating candidate-only 2.9 as merged.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 2.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs, approved old→new AC allocation, requirements, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,189 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-3'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 3 — Полноценный современный MCP-каталог
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-13–FR-20, 20 stories, system scenario families CP-08..11. This plan reflects the approved numbering revision; it neither changes product scope nor marks stories complete.
|
||||
|
||||
3 inherent risks, 3 high (score ≥6). Coverage seeds: 26 P0 and 14 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: `crates/crank-community-mcp/tests/unit/{manifest,session,tool_error}.rs`; `apps/mcp-server/tests/integration/{transport_protocol,catalog_access,tool_search,execution_stages}.rs`; `apps/ui/tests/e2e/onboarding.spec.js`.
|
||||
|
||||
Existing tests cover baseline Tools, transport, catalog and runtime only. Resources/Prompts/modern adapter matrix are planned; no feature-level tests were found in main. Do not confuse MCP client-library behavior with implementation evidence. Tasks cells are completed by Story 4.7; 3.20 must mark them pending rather than falsely PASS.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 3 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E3-R1 | BUS | Advertised capabilities or version behavior disagree | 2 | 3 | 6 | R-009 | Revision/client matrix and wire errors; MCP owner, 3.20 |
|
||||
| E3-R2 | SEC | Resource/Prompt scope or REST expansion leaks data | 3 | 3 | 9 | R-004 | Negative authorization + SSRF + redaction; Security, 3.8/3.11/3.16 |
|
||||
| E3-R3 | DATA | Mutable catalog or stale cursor serves wrong published version | 2 | 3 | 6 | R-009 | Snapshot/revoke races; Registry/MCP, publication stories |
|
||||
|
||||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
Discovery p95 ≤150 ms on 2,000 Operations/200 Agents; zero unauthorized metadata/content reads. Pin stable/N-1/N-2 and ≥3 clients at feature freeze. The 2026-07-28 wire shapes named in epics.md are planning inputs, not a newly verified claim about latest MCP; verify official specifications/digests before adapter ATDD, preserving legacy deprecation gate.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- Wire fixtures per protocol era; scope-separated Agent catalogs; text/JSON/binary hostile resources; exact-version graphs; capture upstream; clock/cancellation barriers; browser keyboard and RU/EN fixtures.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. The approved splits preserve source ACs: 3.4 owns former 3.4 groups 1–4 and part of 7; 3.5 owns 5, 6 and the remaining signal part of 7. Former Prompt groups distribute as 3.12 (1–3 plus Draft/preview portions), 3.13 (4–5 plus publish/binding portions), 3.14 (6–8 plus list/get portion) and 3.15 (9 plus portability UI portion). Former 3.13 groups distribute as 3.17 (1 plus completion portions), 3.18 (2 plus logging portions), and 3.19 (3–4 plus Resource/Prompt-signal portions). ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 3.1 / 3.1-API-A,B | FR-13 | 14 | API | E3-R1 | Separate stateless server/discover and legacy initialize/session adapters according to pinned requirements | Malformed/mixed-era identity, disabled extension and unsupported revision never silently route to another adapter |
|
||||
| 3.3 / 3.3-API-A,B | FR-14 | 7 | API | E3-R1/E3-R2 | tools/call validates exact schema and returns revision-correct structured outcomes | Invalid input/auth/approval failures perform no dispatch; upstream outcomes remain honest |
|
||||
| 3.6 / 3.6-INT-A,B | FR-15, FR-16 | 8 | INT | E3-R2 | Typed text/JSON/binary Resource Draft stores verified immutable content reference | Oversize/corrupt content and unsafe HTML/SVG preview cannot execute or leak |
|
||||
| 3.7 / 3.7-INT-A,B | FR-15, FR-16 | 6 | INT | E3-R3 | Publishing and Agent binding pin Resource Version/catalog revision | Concurrent edit/archive/publish and stale Agent revision cannot mutate a published snapshot |
|
||||
| 3.8 / 3.8-API-A,B | FR-15, FR-16 | 5 | API | E3-R2/E3-R3 | resources/list/read returns bound content with correct MIME/binary shape | Authorization precedes content read; foreign/revoked/unpublished versions and stale cursor denied |
|
||||
| 3.10 / 3.10-UNIT-A,B | FR-16 | 6 | UNIT | E3-R2 | REST-backed template binds exact read-only Published Operation and typed URI variables | Write/approval-dependent operation, host/path injection and invalid cache scope rejected |
|
||||
| 3.11 / 3.11-INT-A,B | FR-16 | 11 | INT | E3-R2/E3-R3 | Resource read uses shared runtime/auth/cache/REST adapter and correct content conversion | Traversal/SSRF/credential revocation or dependency change fails safely without cross-scope cache reuse |
|
||||
| 3.12 / 3.12-API-A,B | FR-17 | 5 | API | E3-R2/E3-R3 | Prompt Draft and preview preserve typed parameters and fixed role boundaries before publication | Invalid args, unsafe preview and foreign Draft access produce no partial render or leaked output |
|
||||
| 3.13 / 3.13-INT-A,B | FR-17 | 4 | INT | E3-R2/E3-R3 | Prompt publication and Agent binding pin an immutable typed revision | Concurrent edit/archive/publish and stale Agent revision cannot mutate a published prompt |
|
||||
| 3.14 / 3.14-API-A,B | FR-17 | 4 | API | E3-R2/E3-R3 | prompts/list and prompts/get expose only exact bound Published revisions | Foreign/archive/revocation, bad arguments and stale cursor cannot reveal or partially render content |
|
||||
| 3.16 / 3.16-INT-A,B | FR-18 | 10 | INT | E3-R2/E3-R3 | Prompt composition pins Resource graph and propagates sensitivity | Cycles, delimiter/role injection and dynamic resource failure cannot yield leaked/partial output |
|
||||
| 3.20 / 3.20-INT-A,B | FR-20 | 9 | INT | E3-R1 | Executable matrix maps each stable capability to exact adapter and ≥3 representative clients | Deferred stable cell/missing evidence blocks claim; experimental cells isolated and disabled path preserved |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 3.2 / 3.2-API-A,B | FR-14 | 5 | API | E3-R1/E3-R3 | tools/list exposes only exact bound Published versions with opaque pagination | Stale/foreign/tampered cursor and revoked binding do not reveal metadata or wrong revision |
|
||||
| 3.4 / 3.4-API-A,B | FR-14 | 5 | API | E3-R1 | Monotonic bounded progress and cancel lifecycle preserve certainty across dispatch boundaries | Cancel-before/after-dispatch races preserve certainty; abusive tokens denied |
|
||||
| 3.5 / 3.5-API-A,B | FR-14 | 3 | API | E3-R1 | Negotiated Tool catalog-change signal has authoritative refresh after loss | Unnegotiated notifications and malformed/rate-abusive tokens are denied |
|
||||
| 3.9 / 3.9-E2E-A,B | FR-15 | 3 | E2E | E3-R2/E3-R3 | Resource import/export creates new owned Draft and verifies digest | Malformed/oversized/foreign artifact or stale UI action rejected; keyboard/RU/EN and inert preview verified |
|
||||
| 3.15 / 3.15-E2E-A,B | FR-17 | 3 | E2E | E3-R2/E3-R3 | Prompt portability/import-export UI creates an owned Draft without changing a Published revision | Malformed/foreign import or stale UI action is rejected; keyboard/RU/EN and inert preview verified |
|
||||
| 3.17 / 3.17-API-A,B | FR-19 | 3 | API | E3-R1/E3-R2 | Completion returns bounded authorized suggestions for Prompt arguments and Resource template parameters under the negotiated capability | Suggestions enforce scope and malformed tokens/rate bounds fail safely |
|
||||
| 3.18 / 3.18-API-A,B | FR-19 | 3 | API | E3-R1/E3-R2 | Logging follows the negotiated capability with redacted structured entries | Sensitive fields and malformed tokens/rate bounds cannot leak or alter logs |
|
||||
| 3.19 / 3.19-API-A,B | FR-19 | 3 | API | E3-R1/E3-R2 | Resource/Prompt change signals follow negotiated capability with polling recovery | Unauthorized, malformed or unnegotiated signals cannot change client-visible catalog state |
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 60–120 hours |
|
||||
| P1 | 32–64 hours |
|
||||
| Optional P2 | 0–12 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 92–200 hours, approximately 3–6 contributor-weeks |
|
||||
|
||||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Epic 1 foundation; 3.1 adapter registration before capability stories. 3.7 publication before static reads/templates/prompts; 3.11 + 3.13 before composition. 3.20 matrix extends in 4.7 rather than fabricating Tasks support.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 3.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,179 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-4'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 4 — Безопасные параллельные и фоновые выполнения
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-21–FR-26, 10 stories, system scenario families CP-12..15. This plan reflects the approved numbering revision; it neither changes product scope nor marks stories complete.
|
||||
|
||||
3 inherent risks, 3 high (score ≥6). Coverage seeds: 16 P0 and 4 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: `crates/crank-runtime/tests/{stages,product_metrics}.rs`, `crates/crank-runtime/tests/integration/{idempotency,confirmation,valkey}.rs`, `crates/crank-test-support/src/lib.rs` supply synchronous safety and real-PG fixture patterns.
|
||||
|
||||
No durable Task/worker/admission lifecycle tests found in main. tokio::task usage is not MCP Tasks coverage. All story-specific Task acceptance scenarios are planned. Existing synchronous idempotency and approval tests must remain regression coverage, not be rewritten to make unsafe Task behavior pass.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 4 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E4-R1 | DATA | Stale lease or retry duplicates an external side effect | 3 | 3 | 9 | R-003 | Fencing + side-effect counters + unknown outcomes; Task owner, 4.3–4.6 |
|
||||
| E4-R2 | PERF | Admission/queue exhaustion starves control plane | 3 | 3 | 9 | R-006 | Limits/fairness/recovery under load; Performance, 4.10 |
|
||||
| E4-R3 | SEC | Cross-scope Task control or resume bypasses consent | 2 | 3 | 6 | R-004 | Owner-bound cancel/input/reconciliation; Security, 4.5–4.9 |
|
||||
|
||||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
128 concurrent sync/background executions, up to 10,000 queued; start and steady queue wait p95 ≤5 s within service rate, oldest age ≤30 s; 10k backlog drains ≤60 minutes after overload ends. Shutdown ≤30 s and eligible lease recovery ≤60 s. Fencing protects Crank state, not exactly-once external side effects.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- Real PG independent worker connections; controllable clock/barriers and crash checkpoints before/after commit, claim, dispatch, side effect and terminal commit; counted upstream with and without verified idempotency; Valkey-off fixture; separate measured capacity host.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. The approved split preserves former 4.5 groups: 4.5 owns groups 1–3 and part of 6, while 4.6 owns 4–5 and the reconciliation part of 6. Former Admin UI groups split between 4.8 (1–3 and its basic/UI portions) and 4.9 (4–5 and the input/reconciliation portions). ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 4.1 / 4.1-INT-A,B | FR-21, FR-24 | 7 | INT | E4-R2/E4-R3 | Pinned synchronous/background/adaptive admission shares safety policy and fair bounded permits | Global/per-Agent/per-Tool exhaustion and safety-store loss reject before allocation/dispatch |
|
||||
| 4.2 / 4.2-INT-A,B | FR-22, FR-23 | 11 | INT | E4-R1/E4-R3 | Task and dispatch intent commit before acknowledgement; replay returns same Task/support IDs | Crash before/after commit, conflicting fingerprint, foreign access and terminal CAS races preserve durable truth |
|
||||
| 4.3 / 4.3-INT-A,B | FR-22, FR-23 | 10 | INT | E4-R1 | SKIP LOCKED claim, renew and dispatch checkpoint enforce current fencing owner | Crash/partition/stale worker and lost Valkey wake-up recover via PG; stale owner cannot dispatch before checkpoint or commit after lease loss |
|
||||
| 4.4 / 4.4-INT-A,B | FR-25 | 8 | INT | E4-R1 | Read/verified-idempotent retry respects attempt count, deadline and child spans | Write uncertainty after dispatch stays outcome_unknown; cancel/timeout/lease-loss cannot fabricate safe failure |
|
||||
| 4.5 / 4.5-INT-A,B | FR-25 | 4 | INT | E4-R1/E4-R3 | Versioned input update transitions once under CAS and preserves task authority | TTL expiry, identical/conflicting replay and unauthorized update cause no new side effect |
|
||||
| 4.6 / 4.6-INT-A,B | FR-25 | 3 | INT | E4-R1/E4-R3 | Evidence-bearing reconciliation transitions a Task once under CAS | Unauthorized normal retry of outcome_unknown and reconciliation replay cannot fabricate a safe result or new side effect |
|
||||
| 4.7 / 4.7-API-A,B | FR-21, FR-22, FR-25 | 11 | API | E4-R1/E4-R3 | Negotiated Tasks extension returns durable IDs and supports exact get/update/cancel shapes plus fallback | Mixed revision/client-chosen collision/foreign scope denied; no invented tasks/list; disconnect does not cancel accepted work |
|
||||
| 4.10 / 4.10-SYS-A,B | FR-23, FR-24 | 7 | SYS | E4-R1/E4-R2 | Qualified 128 concurrent / 10k queued workload meets start/wait/recovery budgets | Overload stop drains backlog without loss/duplicate terminal results; PG/Valkey/crash matrix preserves declared behavior |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 4.8 / 4.8-E2E-A,B | FR-26 | 6 | E2E | E4-R3 | Basic Task filters/detail and conditional actions preserve authoritative state | Stale polling and basic repeated actions remain safe; RU/EN keyboard/a11y and canary negatives |
|
||||
| 4.9 / 4.9-E2E-A,B | FR-26 | 5 | E2E | E4-R3 | Input and reconciliation UI preserves authoritative state and conditional actions | Repeated submit and unknown-outcome Retry/Cancel remain safe; stale polling, RU/EN keyboard/a11y and canary negatives |
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 64–128 hours |
|
||||
| P1 | 20–40 hours |
|
||||
| Optional P2 | 0–8 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 84–180 hours, approximately 3–5 contributor-weeks |
|
||||
|
||||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Shared runtime/admission and MCP negotiation first; 4.1 → 4.2 → 4.3 → 4.4/4.5 → 4.6 → 4.7 → 4.8/4.9 → 4.10. Worker authority is PG; cache may only accelerate.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 4.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,231 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-5'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
lastEditMode: 'E'
|
||||
lastEditScope: 'approved 5.9–5.13 Prometheus, notification gateway, Grafana, SLO and alert-delivery decomposition'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 5 — Полная эксплуатационная видимость
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-27–FR-35, 13 stories, system scenario families CP-16..21. This plan reflects the approved numbering revision; it neither changes product scope nor marks stories complete.
|
||||
|
||||
Approved decision 2026-09-13: application alert delivery uses self-hosted Apprise API (HTTP gateway, no embedded Python in Rust). Story 5.9 owns Prometheus integration; 5.10 owns the provider-neutral notification gateway and tested evaluator payload adapter; 5.11 owns Grafana; 5.12 owns SLO measurement; 5.13 owns application alert delivery and end-of-epic evidence. Host/network/disk/infrastructure-service monitoring and independent whole-application outage detection belong to the infrastructure owner; application-visible dependency failures and existing safety/recovery obligations remain in scope. This is updated planning, not implementation evidence.
|
||||
|
||||
6 inherent risks, 6 high (score ≥6). Coverage seeds: 22 P0 and 4 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. The 19 source AC rows now allocated across 5.9/5.10/5.12/5.13 below refine these seeds rather than add unrelated requirements or prescribe a test-file count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: `crates/crank-observability/tests/{request_correlation,propagation,json_logging,redaction,critical_errors,otlp,prometheus,http_metrics,metrics_signals}.rs`; `apps/mcp-server/tests/integration/execution_stages.rs`; `apps/admin-api/tests/integration/logs_usage.rs`; `crates/crank-metrics/tests/`.
|
||||
|
||||
IDs, local metric registry, redaction and captured OTLP are source-present foundations. Real GlitchTip receiver delivery, durable encrypted spool/loss reconciliation, complete ProductEvent rollups, packaged Prometheus/Grafana and SLO qualification are not proven by them. No services are provisioned in this task.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
Edit-mode source check at the same main revision: no Rust/Cargo matches for `NotificationMessage`, `NotificationSink`, `AppriseNotificationSink` or `apprise` under `crates`/`apps`. This search does not evidence the planned port/adapter; existing telemetry tests cannot be counted as its implementation or delivery proof. This targeted edit does not claim a whole-codebase re-audit.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 5 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||||
| Host/LXC/VM, disk/network and infrastructure-service incident monitoring/remediation | Infrastructure owner responsibility | Document external availability monitoring handoff; preserve Crank dependency-failure diagnostics and safety tests |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E5-R1 | OPS | Spool/replay loss yields false trace completeness | 2 | 3 | 6 | R-005 | Independent envelope accounting and crash/outage; Observability, 5.6 |
|
||||
| E5-R2 | SEC | Browser/export/link or notification route leaks secrets or executes unsafe URL | 3 | 3 | 9 | R-004 | Canaries, authenticated fixed routes and egress rejection; Security/UI, 5.2–5.4 and 5.10/5.13 |
|
||||
| E5-R3 | DATA | Rollups/cardinality/SLI denominators lie | 2 | 3 | 6 | R-011 | Idempotency + UTC + rules oracles; Metrics, 5.8/5.12 |
|
||||
| E5-R4 | PERF | Telemetry or notification pressure blocks product requests | 3 | 3 | 9 | R-006 | Quota isolation, bounded queue/retry/expiry and enabled/disabled comparison; Observability, 5.6/5.13 |
|
||||
| E5-R5 | TECH | Provider fields escape the port or replacement silently changes queued recipients | 2 | 3 | 6 | Epic-local / AD-13 | Same suite on Apprise and recording sink; source boundaries and pinned route revision; Backend, 5.10 |
|
||||
| E5-R6 | OPS | Accepted/uncertain/partial delivery is reported as received, or retries create an alert storm | 2 | 3 | 6 | Epic-local / FR-35 | Independent receiver ledger, fault classification and virtual-clock lifecycle; Backend/QA, 5.13 |
|
||||
|
||||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
100% support IDs independent of sampling; healthy delivery ≥99.99% within60s; outage≤24h with100% saved-envelope delivery within25h, sized30h spool. Observability overhead≤5% p95 latency and≤10% CPU; drain≤30s. Availability30d≥99.95%, control plane≥99.9%. Exact series budgets/buckets and burn windows must use versioned typed/rule contracts; unspecified values remain UNKNOWN until owning story freezes them.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
Notification unknowns to freeze once in the owning spec: evaluator/payload adapter and pinned Apprise version, queue/body capacity, timeout, retry/backoff/attempt limit, expiry and repeat/silence windows. Boundary tests use limit−1/limit/limit+1 and virtual time against these values. The trace spool's 24-hour/25-hour obligation is not automatically a notification delivery SLA. Unavailable pinned routes produce an explicit bounded failure, not fallback to another recipient.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- For applicable stories only: local trace receiver and real GlitchTip qualification environment; independent generated/accepted/ACK/lost envelope ledger; bounded disk partitions and fault controls; golden UTC events; Prometheus synthetic series; provisioned Grafana fixture without committed secrets. Pure notification port tests do not require the whole stack.
|
||||
- For 5.10/5.13: recording/fault-injection sink, controlled clock, bounded queue fixture and versioned logical routes; pinned Apprise API/private auth proxy and isolated local destination for integration. Gateway-acceptance and destination-receipt ledgers are separate. No production tokens, operator destinations or external messaging accounts.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 5.1 / 5.1-INT-A,B | FR-27 | 5 | INT | E5-R1/E5-R2 | Distinct Request/Trace IDs survive ingress, persistence, cache, retry and outbound spans with sampling off | Hostile/malformed upstream context cannot replace identity or leak raw fields |
|
||||
| 5.3 / 5.3-API-A,B | FR-30 | 5 | API | E5-R2 | Scrubbed browser events use authenticated same-origin relay with bounded schemas | Disabled mode has no hooks/egress; CSRF/rate/body and secrets-in-stack/DOM/query tests reject leakage |
|
||||
| 5.4 / 5.4-INT-A,B | FR-29 | 5 | INT | E5-R1/E5-R2 | Compatible receiver accepts envelopes with parent topology, release and IDs | Retryable/permanent/duplicate ACK classified; slow/outage exporter cannot change product result or readiness |
|
||||
| 5.5 / 5.5-INT-A,B | FR-31 | 6 | INT | E5-R1/E5-R4 | Encrypted per-process/destination spool durably appends then ACKs and checkpoints consumption | Crash during append/ACK/compaction, corrupt tail, permissions and disk quota preserve accounting/reserves |
|
||||
| 5.6 / 5.6-SYS-A,B | FR-29, FR-31 | 5 | SYS | E5-R1/E5-R4 | Measured 30h envelope and 24h outage/recovery satisfy delivery/completeness bounds | Disk-full/drop/rejection emits immutable local loss records; enabled-vs-disabled overhead stays bounded |
|
||||
| 5.7 / 5.7-UNIT-A,B | FR-32 | 6 | UNIT | E5-R3/E5-R4 | Typed metric names/units/buckets/enum dimensions cover each implemented subsystem | Millions of distinct inputs do not increase series outside budget; IDs only exemplars |
|
||||
| 5.8 / 5.8-INT-A,B | FR-33 | 7 | INT | E5-R3/E5-R2 | Idempotent ProductEvents and UTC rollups compute unique-Agent DAU, funnel and explicit denominators | Duplicates/late/cross-day/deleted entities give deterministic aggregates; missing data is not zero; offline no phone-home |
|
||||
| 5.9 / 5.9-INT-A,B | FR-34 | 6 | INT | E5-R2/E5-R3 | Authorized scrape/rules and packaged Prometheus assets work without exposing secrets or blocking product probes | Wrong identity/TLS, arbitrary scrape paths, invalid rules/config reload and service outage remain visible and bounded |
|
||||
| 5.10 / 5.10-INT-A,B | FR-35 | 3 | UNIT + INT | E5-R2/E5-R4/E5-R5 | Provider-neutral NotificationSink and evaluator payload adapter work with Apprise and recording sink without producer/rule/UI changes | Provider leakage, silent queued-message rerouting, arbitrary routes and disabled egress cannot compromise runtime or expose secrets |
|
||||
| 5.12 / 5.12-INT-A,B | FR-35 | 5 | UNIT + INT | E5-R3/E5-R4 | Synthetic series prove denominators, burn windows, missing-data treatment and SLO state | Missing scrapes, duplicate/out-of-order data and zero denominators cannot create false green |
|
||||
| 5.13 / 5.13-INT-A,B | FR-35 | 5 | UNIT + INT | E5-R2/E5-R4/E5-R6 | Real-stack firing/resolved application alerts reach configured test receiver with grouping and silence; final Epic 5 evidence links the same candidate | Uncertain delivery, partial failures, restart, queue/retry expiry and canary leakage cannot create false receipt, notification storm or product blocking |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 5.2 / 5.2-E2E-A,B | FR-28 | 6 | E2E | E5-R1/E5-R2 | Scoped exact-ID timeline, separate copy actions and validated trace link find real call | Foreign search, stale response and script/credential URL template rejected; backend outage retains local diagnosis |
|
||||
| 5.11 / 5.11-E2E-A,B | FR-34 | 5 | E2E | E5-R1/E5-R3 | Provisioned Grafana datasource/panels return correctly unit-labelled data and exemplar links | Missing/stale datasource, unsafe links/variables and upgrade UID drift are visible, never false green; actual Load Run data acceptance is deferred to 6.6 |
|
||||
|
||||
### Mandatory Prometheus, notification, SLO and alert-delivery design — refinements of the P0 seeds
|
||||
|
||||
For 5.9/5.10/5.12/5.13 ATDD, freeze finite cases for endpoint authentication (a config key is not authentication), operator-controlled routes, outbound opt-in, sanitized payloads, stable fingerprint and firing/resolved lifecycle, silence/repeat policy, timeout/permanent/partial failure and bounded retry/expiry. Separate API acceptance from downstream receipt evidence; never infer exactly-once delivery. Use a pinned gateway with a local controlled destination, not real customer channels. No infrastructure monitoring product or new public alert-management surface is implied.
|
||||
|
||||
Provider-neutrality regression: run the same NotificationSink contract suite against Apprise and an independent recording/fault-injection sink; assert canonical message serialization, logical routes, typed delivery outcomes, common retry/redaction/accounting and versioned queued-route behavior. Source-boundary checks reject provider DTOs/URLs/credentials in producers and common message types. A second production delivery integration is not required. This general gateway covers operator/application notifications, not MCP wire notifications.
|
||||
|
||||
AC identities below retain the ordinal `Given` group from the pre-split source story and its approved destination. 5.9 owns former groups 1–6, 5.10 former 7–9, 5.12 former SLO groups 1–5, and 5.13 former delivery groups 6–10. ATDD retains quoted text as well as ordinal, so later insertion cannot silently change the mapping. All rows are planned/not-run. Separate fixtures may split a row without adding scope.
|
||||
|
||||
| AC / source Given | Level | Required oracle and reusable seam |
|
||||
|---|---|---|
|
||||
| 5.9-AC01 — Community minimal profile | INT | Minimal metrics works without gateway; enabled versioned production profile starts its intended services. |
|
||||
| 5.9-AC02 — metrics endpoint на non-loopback interface | API/INT | Dedicated machine identity accepted; absent/wrong identity and Admin/MCP credentials denied under the configured TLS/proxy policy. |
|
||||
| 5.9-AC03 — authorized scrape | INT | Valid bounded OpenMetrics; concurrent/slow/unauthorized scrapes respect limits while product probes remain responsive. |
|
||||
| 5.9-AC04 — packaged Prometheus assets | UNIT/INT | Versioned rules/config validate against registry labels/buckets, not just file existence. |
|
||||
| 5.9-AC05 — config reload либо service outage | INT | Reload/outage preserves product result/readiness; local diagnostic identifies scrape/auth failure without secret values. |
|
||||
| 5.9-AC06 — integration/security suite | INT | Supported deployment modes cover auth, proxy, cardinality, rule syntax and restart; evidence records build/config fingerprint. |
|
||||
| 5.10-AC07 — оператор включает application alert delivery | INT | Packaged and operator-managed fixtures use explicit payload mapping; authenticated private ingress rejects config-key-only access; disabled egress produces no external traffic; local receiver confirms enabled delivery. No embedded Python in Rust. |
|
||||
| 5.10-AC08 — application producer либо alert evaluator ingress | UNIT/contract | Roundtrip canonical envelope and logical route; dependency/source checks keep provider fields out of producers/core. MCP wire notifications do not invoke the sink; shared dispatch policies are provider-independent. |
|
||||
| 5.10-AC09 — Apprise sink и независимый recording/fault-injection test sink | UNIT/INT | Unchanged producer fixture/harness run on both sinks with accepted/retryable/permanent/uncertain outcomes. Queue under route revision A, switch config to B: no silent recipient change, identical common sanitization/accounting. |
|
||||
| 5.12-AC01 — versioned SLO specification | UNIT | Golden contract contains approved objectives, numerator/denominator, exclusions, maintenance and missing-data semantics. |
|
||||
| 5.12-AC02 — recording rules | UNIT | Synthetic outcome taxonomy separates product, saturation, upstream and client failures as runtime codes prescribe. |
|
||||
| 5.12-AC03 — 30-day window | INT/E2E | Seeded series drive objective/compliance/budget/trend and distinct Task/telemetry panels; not a real 30-day burn-in claim. |
|
||||
| 5.12-AC04 — fast либо slow burn | UNIT/INT | Virtual-time thresholds yield expected severity/SLO/burn/dashboard/runbook; unavailable GlitchTip does not erase basic diagnosis. |
|
||||
| 5.12-AC05 — synthetic good/bad series и missing scrapes | UNIT | Fire/recover at pinned windows, including missing data and zero denominators; linked rule/runbook coverage has no false green. |
|
||||
| 5.13-AC06 — завершение Epic 5 | SYS | At epic acceptance, link FR-27..35/NFR-O evidence on the same candidate and demonstrate real local/GlitchTip Trace ID lookup. Not a whole-epic rerun on each adapter edit. |
|
||||
| 5.13-AC07 — каталог application alerts | UNIT/MANUAL | Catalog/runbooks cover application signals and infrastructure handoff. Dependency injection proves application diagnosis/SLI classification, not host remediation. |
|
||||
| 5.13-AC08 — firing, repeated и resolved состояния | UNIT/INT | Script fingerprint/lifecycle and virtual-clock repeat/silence boundaries; independent receiver confirms grouped firing/resolved and safe links. Missing trace omits the link, never fabricates correlation. |
|
||||
| 5.13-AC09 — slow/unavailable gateway, partial channel failure, timeout после отправки либо restart dispatcher | INT | Inject timeout before/after receipt, partial/permanent failure and restart. Assert bounded queue/attempts/expiry, typed uncertainty and local accounting without recursive alerts; product probes stay responsive. Gateway ACK alone never proves receipt. |
|
||||
| 5.13-AC10 — real-stack notification suite и canary secrets | INT | Pinned gateway/local receiver verify routing/lifecycle/recovery. Reject unauthorized ingress/arbitrary targets/attachments; scan captured sinks for canaries and traffic for opt-in. Bind evaluator/adapter/gateway/config versions to sanitized evidence. |
|
||||
|
||||
Policy seams: evaluator owns grouping/silence/repeat; common dispatcher owns retry/queue/expiry/redaction/accounting; adapter owns one bounded transport attempt and response translation. Inject failure at each seam and assert no multiplying retries. The receiver ledger must not derive its receipt count from the dispatcher's success counter.
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional exploratory/cosmetic variants need owner and justification, not an endless review queue. Notification checks above are mandatory P0 refinements, not P2/P3 work.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 60–120 hours |
|
||||
| P1 | 24–48 hours |
|
||||
| Optional P2 | 0–8 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 84–180 hours, approximately 3–5 contributor-weeks |
|
||||
|
||||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||||
|
||||
The earlier estimate envelope has not been independently recalibrated for the gateway decision. It is historical low-confidence sizing until 5.10/5.13 ATDD maps existing fixtures and the selected adapter, not a promise that all contract cases fit that budget.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
1.5/1.6 foundations; each new subsystem owns its metric/trace additions. 5.4 receiver port → 5.5 spool → 5.6 capacity. 5.7/5.8 metric semantics → 5.9 Prometheus → 5.10 gateway and 5.11 Grafana → 5.12 SLO → 5.13 alert delivery/evidence. Task/Load views must not be called complete before respective epics provide data; actual Load Run data acceptance belongs to 6.6.
|
||||
|
||||
5.10 freezes common message/port, route bindings and provider contract before 5.13 verifies delivery lifecycle; reuse that suite rather than recreate it. Pending numeric limits and evaluator/gateway compatibility block affected assertions until frozen, not permission to add infrastructure monitoring, another production provider or a new UI.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 5.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,175 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-6'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 6 — Встроенная проверка производительности
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-36–FR-40, 6 stories, system scenario families CP-22..24. This plan refines the current system design; it neither changes approved product scope nor marks stories complete.
|
||||
|
||||
3 inherent risks, 3 high (score ≥6). Coverage seeds: 8 P0 and 4 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: Runtime metric/overhead patterns in `crates/crank-runtime/tests/product_metrics.rs` and `crates/crank-metrics/tests/overhead.rs`; real MCP fixture in `apps/ui/scripts/playwright-http-fixture.js` and `apps/ui/tests/e2e/onboarding.spec.js`.
|
||||
|
||||
No Load Scenario, runner, safety-plan or report feature suites found. Existing microbenchmarks/local budget checks do not prove generated RPS, control-plane isolation or product capacity. DAU preview is a load model, not the measured unique-Agent DAU rollup of 5.8.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 6 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E6-R1 | SEC | Forged/stale load plan dispatches damaging writes | 3 | 3 | 9 | R-010 | Signed fingerprint + replay/SSRF/write negatives; Security, 6.3 |
|
||||
| E6-R2 | OPS | Runner duplicates generation or cannot stop | 2 | 3 | 6 | R-010 | Owner fencing + reserved path + independent kill; Runner, 6.4–6.5 |
|
||||
| E6-R3 | PERF | Generator bottleneck/aggregation reports false SUT performance | 3 | 3 | 9 | R-006 | External calibration + independent counts; Performance, 6.6 |
|
||||
|
||||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
Hard non-overridable ceilings1000RPS/512VU/2h/10,000,000iterations (6.3). Qualification100RPS30m +250RPS5m, per-minute success≥99.95% and saturation rejects≤0.1%; platform overheadp95≤50ms/p99≤150ms with10ms upstream/cache off. Arrival tolerance and stop/drain policy must be frozen by owning story, never chosen silently by tests.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- Counted controllable upstream; signed-plan negative fixtures with exact change fingerprints; isolated runner CPU/memory/network and reserved control path; host kill socket in disposable sandbox; external calibrated generator/counters to separate harness saturation from SUT saturation.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. The last two former 6.1 full-workflow acceptance groups now belong to 6.6; 6.1 retains scenario definition only. Story 6.4 adds the approved correlation acceptance group. ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 6.3 / 6.3-INT-A,B | FR-38 | 6 | INT | E6-R1 | Signed short-lived exact LoadAuthorizationPlan covers scope, resolved targets and safety limits | Forgery/expiry/replay/rebinding/revocation/writes without sandbox-cleanup fail before dispatch |
|
||||
| 6.4 / 6.4-INT-A,B | FR-38 | 7 | INT | E6-R1/E6-R2 | Idempotent durable Start grants one isolated generator owner using only public MCP and correlates accepted Run, generator and report identities | Crash/restart/missing heartbeat or overloaded API cannot defeat ceilings and independent permission-restricted emergency kill; per-process spool is used only where the owning telemetry contract applies, not introduced as a blanket runner requirement |
|
||||
| 6.5 / 6.5-E2E-A,B | FR-39 | 6 | E2E | E6-R2 | Fresh bounded live stats and idempotent Stop operate through reserved control capacity | Out-of-order/disconnect/terminal update cannot claim false pass; emergency stop reconciles after recovery |
|
||||
| 6.6 / 6.6-SYS-A,B | FR-40 | 9 | SYS | E6-R3 | Immutable digest-bound report independently accounts achieved load, percentiles and comparable fingerprints, and owns the transferred full-workflow acceptance from 6.1 | Interrupted/changed/incompatible runs cannot pass/compare silently; malformed responses stay valid redacted JSON |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 6.1 / 6.1-API-A,B | FR-36 | 6 | API | E6-R1 | Scenario versions pin Tool/Agent/schema/generator refs and weighted mix | Draft/foreign/unsafe write/invalid weights or oversized samples rejected; editing never changes old Run semantics; end-to-end navigation/fingerprint acceptance is owned by 6.6 |
|
||||
| 6.2 / 6.2-UNIT-A,B | FR-37 | 5 | UNIT | E6-R3 | Explicit DAU assumptions + seed deterministically produce matching backend/UI arrival curve | Zero/overflow/NaN/short-window/think-time conflicts rejected; peak capacity breach blocks Start |
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 40–80 hours |
|
||||
| P1 | 24–48 hours |
|
||||
| Optional P2 | 0–8 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 64–140 hours, approximately 2–4 contributor-weeks |
|
||||
|
||||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Published Tools + shared execution safety, metrics/artifacts and observable outcomes before live validation. 6.1 → 6.2 → 6.3 → 6.4 → 6.5 → 6.6. No arbitrary external targets or production writes authorized by this plan.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 6.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,178 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-7'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 7 — Автономное production-развёртывание и восстановление
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-41–FR-45, 9 stories, system scenario families CP-25..27. This plan refines the current system design; it neither changes approved product scope nor marks stories complete.
|
||||
|
||||
3 inherent risks, 3 high (score ≥6). Coverage seeds: 16 P0 and 2 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: `crates/crank-config/tests/{contract,generation,redaction}.rs`; `crates/crank-registry/tests/integration/migrations.rs` and `migrations/`; `apps/admin-api/tests/migration_command.rs`; `apps/admin-api/tests/config_startup.rs`; `scripts/restore-community.sh`; `scripts/authenticated-product-smoke.py`; `.gitea/workflows/ci.yml`.
|
||||
|
||||
Config/migration/auth foundations and Compose authenticated smoke exist. Restore script presence is not three qualified PITR restores. Complete offline signed bundle, role isolation with future worker/runner and full N/N-1 online/offline matrix need evidence. Prior deployment failures require regression fixtures for legacy fingerprint, missing core, external PG topology and failed migrate diagnostics, not permission to reset databases.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 7 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
| Product-wide 72-hour soak / 30-day burn-in | Owned by Epic 8 | Component fault/performance obligations in this epic remain required |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E7-R1 | DATA | Schema/artifact/key mismatch destroys recovery | 2 | 3 | 6 | R-008 | Manifest + N/N-1 + three real restores; SRE, 7.8–7.9 |
|
||||
| E7-R2 | SEC | Unsafe defaults/proxy/privileges expose installation | 2 | 3 | 6 | R-007 | Fresh-host negative exposure tests; Security, 7.4/7.6 |
|
||||
| E7-R3 | SEC | Offline bundle untrusted or phones home | 2 | 3 | 6 | R-014 | Offline signature/tamper/egress tests; Release, 7.5 |
|
||||
|
||||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
Each of3independent restores RPO≤5m/RTO≤30m with real MCP probe; drain≤30s and eligible Task recovery≤60s. Production sizing retains≥30% measured headroom. Zero known Critical/High, zero unapproved egress. Trust material/reference-host allocation and exact image digests are execution prerequisites, never generated secrets in docs.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- Disposable fresh host/network namespaces; PG16 current/N-1/legacy snapshots; checksummed artifacts/WAL plus out-of-band test keys; fault checkpoints; offline registry-less image archive; default-deny egress capture; fresh scanner DB pinned in report.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. The former offline-upgrade acceptance group moves from 7.5 to 7.9: 7.5 remains bundle creation/install trust coverage, while 7.9 owns upgrade/rollback continuity. ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 7.1 / 7.1-UNIT-A,B | FR-45 | 6 | UNIT | E7-R2 | Typed schema generates matching examples/Compose/docs/redacted effective config | Unknown/unused/divergent/unsafe cross-field and conflicting alias values fail safely |
|
||||
| 7.2 / 7.2-INT-A,B | FR-43 | 6 | INT | E7-R1 | Fresh/current/N-1/legacy PG16 states migrate idempotently through canonical authority | Checksum/future/partial drift and concurrent preflight reject before mutation; large backfill resumable |
|
||||
| 7.4 / 7.4-API-A,B | FR-41 | 6 | API | E7-R2 | Explicit TLS/origin/host/trusted proxy and separate Admin/MCP/metrics identities work | Spoofed forwarded headers, host/CORS/CSRF/cookie downgrade and exposed recovery denied |
|
||||
| 7.5 / 7.5-SYS-A,B | FR-42 | 5 | SYS | E7-R3 | Signed digest-pinned complete bundle installs with default-deny egress | Extra/missing/tampered/unpinned artifacts or invalid trust fail offline; no CDN/registry/phone-home |
|
||||
| 7.6 / 7.6-SYS-A,B | FR-44 | 7 | SYS | E7-R2/E7-R3 | Images enforce role-scoped non-root/caps/read-only/resource/mount policy and≤30s drain | Runner cannot access DB/secrets; OOM/disk pressure isolated; changed hardened image invalidates and rebuilds bundle |
|
||||
| 7.7 / 7.7-INT-A,B | FR-43 | 6 | INT | E7-R1 | Online consistent WAL/artifact/config cut produces immutable complete BackupManifest | Interrupted backup/missing WAL/wrong epoch/tampered bytes never become usable; retention keeps pinned dependencies |
|
||||
| 7.8 / 7.8-SYS-A,B | FR-43 | 6 | SYS | E7-R1 | Three independent fresh-host restores prove RPO/RTO and real authenticated MCP plus key recovery | Mismatch blocks mutation; ciphertext/manifest errors explicit; crash during re-encryption preserves decryptability |
|
||||
| 7.9 / 7.9-SYS-A,B | FR-43 | 8 | SYS | E7-R1 | N-1→N preflight/backup/drain/migrate/probe preserves pinned state online and through the transferred offline-upgrade path | Fault before reversible boundary rolls back safely; irreversible boundary requires explicit manifest restore |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 7.3 / 7.3-SYS-A,B | FR-41 | 6 | SYS | E7-R2 | Fresh minimal/production profile starts, persists, restarts and makes real MCP call; PG-only correct | Missing secrets/unsafe exposure fail readiness; optional backend outage cannot pretend safety store is optional |
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 48–96 hours |
|
||||
| P1 | 16–32 hours |
|
||||
| Optional P2 | 0–8 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 64–140 hours, approximately 2–4 contributor-weeks |
|
||||
|
||||
If a measurement environment is missing, report the prerequisite; do not run large workloads opportunistically inside a story session.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
All shipped processes/config/metrics contracts from preceding epics. 7.1/7.2 preflight → profiles/exposure/bundle/hardening; 7.7 complete manifest →7.8 restore→7.9 upgrade. 7.6 image changes require7.5 bundle requalification.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 7.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,178 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-8'
|
||||
workflowStatus: 'completed'
|
||||
workflowType: 'testarch-test-design'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
---
|
||||
|
||||
# Test Design: Epic 8 — Доказанный production-релиз
|
||||
|
||||
**Date:** 2026-09-13
|
||||
**Author:** Bsodfather / BMad TEA
|
||||
**Status:** Updated planning baseline; qualification not evaluated.
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope: FR-46–FR-54, 10 stories, system scenario families CP-28..34. This plan refines the current system design; it neither changes approved product scope nor marks stories complete.
|
||||
|
||||
3 inherent risks, 3 high (score ≥6). Coverage seeds: 16 P0 and 4 P1 independently assertable scenarios. Counts describe the two seeds per story below, not implemented tests, coverage percentages or the eventual parameterized case count. Every source AC remains mandatory.
|
||||
|
||||
## Existing Coverage and Evidence
|
||||
|
||||
Source inventory at main `083974c`: `docs/capability-inventory.json`; `docs/capability-baseline/results.json`; `scripts/collect-capability-baseline.py`; `scripts/validate-capability-run.py`; `tests/unit/`; `.gitea/workflows/{ci,release}.yml`; `scripts/scan-images.sh`; `docs/manual-regression-checklist.md`.
|
||||
|
||||
Existing inventory/collector and CI scans are foundations, not full signed RC evidence. Historical baseline2026.08.24.1 uses revision767428, not current main. Chromium-only current suite is not Firefox/WebKit×RU/EN qualification. No measured coverage report,72h/30day accepted run or3PITR restores was produced by this planning task.
|
||||
|
||||
Source presence ≠ execution ≠ requirement coverage ≠ qualification. No product test, deployment or load execution was performed for this plan. Reuse source tests only after matching their oracle to the current AC and recording a run on the candidate under test.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| Unrelated future-epic implementation and whole-product refactoring | This is Epic 8 test planning | Keep explicit prerequisites below; do not invent additional story acceptance |
|
||||
| SSO/RBAC enterprise features, non-REST adapters, HA/rolling deployment | Outside approved Community scope | Preserve Community boundary checks |
|
||||
| Declaring current production readiness from source inventory | No bound qualification run | Require real evidence before gate |
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
Score = probability × impact on a 1–3 scale. Score ≥6 needs verified mitigation; 9 is an unresolved critical release risk, not a command to implement every mitigation immediately. Categories: SEC security, DATA integrity, OPS operations, PERF performance, BUS user behavior, TECH architecture/testing.
|
||||
|
||||
| Risk ID | Category | Failure | P | I | Score | System risk | Mitigation / accountable role / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E8-R1 | OPS | Mixed/stale/forged evidence produces PUBLIC_READY | 3 | 3 | 9 | R-013 | Offline signed verifier with negative fixture per gate input; Release, 8.1/8.10 |
|
||||
| E8-R2 | OPS | Leaks/recovery failures appear only after sustained traffic | 2 | 3 | 6 | R-015 | 72h + 30 calendar days fixed RC; SRE, 8.6/8.9 |
|
||||
| E8-R3 | SEC | Incomplete matrix/security/manual pass hides unsafe claims | 2 | 3 | 6 | R-014 | Full qualified cells + zero mandatory skips; QA/Security, 8.3/8.4/8.7 |
|
||||
|
||||
Medium risks: shared R-012 (4), deterministic test isolation; QA owns continuous monitoring. No additional low risk is invented just to fill a template. Residual risk is unmeasured until evidence exists.
|
||||
|
||||
## NFR Planning
|
||||
|
||||
Inherit every PRD/system quantitative gate: full P0 and mandatory P1/manual pass, zero mandatory flakes and Critical/High; 3performance runs;72h then30calendar days≥1M eligible events on exact RC, no acceleration/stitching. Reference dataset2kOperations/200Agents/500keys/1Mhistory; UI≤2sp95. MCP stable window and exact tool/browser/image/scanner versions freeze at execution, not invented now.
|
||||
|
||||
| Category | Scenario linkage | Planned validation / evidence |
|
||||
|---|---|---|
|
||||
| Security/privacy | SEC risks and B scenarios below | Scope/abuse/canary tests, bounded sanitized logs and network/scan report |
|
||||
| Reliability/data integrity | DATA/OPS risks and fault scenarios | Real authority/state assertions, fault schedule and reconciled counters/digests |
|
||||
| Performance/scalability | Numeric epic obligations above | Calibrated raw latency/resource samples, achieved load and immutable config/topology fingerprint |
|
||||
| Maintainability/compatibility | Every changed component | Existing `just verify`/UI gates as applicable, schema/contract diffs and traceable regression reports |
|
||||
|
||||
Unknowns: exact execution hardware and fresh qualification artifacts are not available from this audit. Where the owning story requires a new tolerance, limit or version selection, freeze it in its approved contract before writing a numeric assertion; never replace the PRD threshold with a guessed easier value. Full NFR verdict belongs to `bmad-testarch-nfr` after execution.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Approved owning story/spec and prerequisites are available in the same worktree.
|
||||
- ATDD loads the actual ACs from `epics.md` / selected spec and the system QA design.
|
||||
- Existing tests and baseline failures are inspected before adding tests; no duplicate test suite solely for new IDs.
|
||||
- Content-addressed valid and one-fault-per-input signed manifests with disposable test trust root; immutable RC environment with calibrated load/fault schedule; actual fresh-user/manual reviewers; sanitized raw reports and logs plus independent timestamps. External qualification owners must return accepted, candidate-bound evidence for manual, soak, documentation and burn-in handoffs; a requested or planned handoff is not completion. Synthetic verifier fixtures never count as production qualification.
|
||||
- Missing fixture, service or approval is reported as blocked/not-run, not silently skipped.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. Each table row has two separate scenario seeds: `<Story>-<Level>-A` and `...-B`. Split a seed when independent assertions require different fixtures. Reuse an existing equivalent test rather than duplicating it; ATDD records exact test name/path and AC mapping.
|
||||
|
||||
The AC-count column inventories all `Given` groups under that source story, not a claim that two tests exhaust those groups. ATDD must map each group (story + ordinal + quoted acceptance text) to existing test, new test, or explicit not-run prerequisite before implementation. The approved spec controls finer-grained cases.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, irreversible data integrity and false acceptance have no safe user workaround.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 8.1 / 8.1-UNIT-A,B | FR-52 | 7 | UNIT | E8-R1 | Offline verifier binds one RC/source/image/config/workload to signed complete evidence and current trust state | Unknown/revoked key, forged/stale/missing/conflicting digest/time/status and trust rollback reject |
|
||||
| 8.2 / 8.2-INT-A,B | FR-46 | 6 | INT | E8-R1/E8-R3 | Every supported capability maps to mandatory CI/manual evidence; exact command/version/seed/duration retained | Absent services, skipped/flaky/retried tests or deferred stable capability cannot normalize to pass |
|
||||
| 8.4 / 8.4-SYS-A,B | FR-48 | 6 | SYS | E8-R3 | Pinned MCP revisions×≥3clients,≥50OpenAPI corpus and PG16/Valkey8/PG-only/browser matrix qualify | Missing/failed/stale cells block claims; experimental never substitutes stable and unsupported constructs never disappear |
|
||||
| 8.5 / 8.5-SYS-A,B | FR-49 | 6 | SYS | E8-R2 | Three consecutive calibrated runs on fixed RC/dataset prove exact performance envelope | Generator saturation/config drift/telemetry gaps invalidate run; >10% regression needs recorded disposition |
|
||||
| 8.6 / 8.6-SYS-A,B | FR-49 | 6 | SYS | E8-R2 | Continuous72h prescribed mix with fault/recovery schedule shows bounded growth and consistent accounting, then external qualification accepts the candidate-bound run evidence | Partition/DB/cache/telemetry/disk faults obey safety contracts; integrity interruption cannot stitch partial durations; a planned or unaccepted handoff is not done |
|
||||
| 8.7 / 8.7-SYS-A,B | FR-50 | 6 | SYS | E8-R3 | Threat→control→test evidence and fresh pinned source/dependency/image/secret/license scans cover final surface | SSRF/bombs/scope/fencing/load-plan and full-output canaries reject abuse; no unresolved Critical/High |
|
||||
| 8.9 / 8.9-SYS-A,B | FR-49, FR-53 | 7 | SYS | E8-R1/E8-R2 | Same RC completes30calendar days and≥1M eligible events; external qualification accepts the evidence and honest readiness page binds accepted results | Digest/environment integrity change resets window; a planned restart is not continuity evidence; probes excluded; loss/hidden issues or an unaccepted handoff block publication |
|
||||
| 8.10 / 8.10-UNIT-A,B | FR-54 | 7 | UNIT | E8-R1 | Complete signed fixtures yield PUBLIC_READY only for matching immutable manifest/bundle/readiness digests | Each missing/stale/tampered/failing mandatory input blocks; FR54 cannot prove itself; no mandatory waiver path |
|
||||
|
||||
### P1 — High
|
||||
|
||||
Core user journeys and complex integrations; limited workaround, not relaxed acceptance.
|
||||
|
||||
| Story / scenario IDs | Requirements | AC groups | Primary level | Risk | A: expected behavior | B: rejection / fault |
|
||||
|---|---|---:|---|---|---|---|
|
||||
| 8.3 / 8.3-MANUAL-A,B | FR-47 | 6 | MANUAL | E8-R3 | Named external qualification reviewer completes all versioned RU/EN core and recovery flows against same RC and returns accepted evidence | Validation/error/permission/confirmation/retry states checked; a planned/rejected/missing handoff is not done; defect fix invalidates affected evidence and creates new RC |
|
||||
| 8.8 / 8.8-MANUAL-A,B | FR-51 | 6 | MANUAL | E8-R3 | Fresh external qualification user follows only shipped online/offline docs to MCP call, trace and backup/restore and returns accepted evidence | Broken commands/config/links or unavailable external dashboard must not hide recovery/runbook instructions; a planned/rejected/missing handoff is not done |
|
||||
|
||||
### P2 / P3
|
||||
|
||||
No additional mandatory scope. Optional focused exploratory/cosmetic variants may be recorded later with owner and justification; they do not become an endless implementation/review queue.
|
||||
|
||||
Levels: UNIT pure contract/model; INT real filesystem/database/runtime boundary; API actual handler/protocol; E2E critical browser journey; SYS isolated full-stack qualification; MANUAL named human protocol. Use unit cases for algorithms, real PG for transaction/fencing, wire fixtures for protocol, browser only for user-visible interaction. Intentional defense-in-depth checks different failure surfaces, not identical duplicated assertions.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Run all functional tests in PRs when they fit the target 15-minute feedback window; defer only expensive infrastructure/duration, not inconvenient failures. Current Playwright is Chromium, one worker: parallelization is a future isolation-dependent optimization, not a current claim.
|
||||
|
||||
- **PR:** changed functional/negative regressions and boundary suites; applicable Rust/tooling/config and UI gates.
|
||||
- **Nightly:** bounded fault/contention, repeated isolation and resource trend tests after the required seams exist.
|
||||
- **Weekly:** calibrated production-size performance, fresh-host/offline/recovery and manual qualification as applicable.
|
||||
- **Epic / RC acceptance:** every mandatory AC and quantitative obligation must have exact-candidate evidence, even if its normal execution tier is weekly. Epic 8 owns the immutable long-duration release windows.
|
||||
|
||||
Nightly/weekly scheduling is a proposed execution model; the current Gitea pipeline has PR/push and release jobs, not those schedules. This planning task does not create them. `just verify` does not replace Playwright, deployment/image or qualification jobs.
|
||||
|
||||
## Resource Estimates
|
||||
|
||||
Incremental QA test/evidence effort with working production seams and reusable fixtures, excluding feature implementation, provisioning lead time and unaccelerated duration. Low-confidence planning ranges, not token budgets or compulsory numbers of new tests; reassess at each story ATDD after deduplication.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---|
|
||||
| P0 | 48–96 hours |
|
||||
| P1 | 24–48 hours |
|
||||
| Optional P2 | 0–8 hours |
|
||||
| Optional P3 | 0–4 hours |
|
||||
| Total envelope | 72–156 hours, approximately 2–5 contributor-weeks |
|
||||
|
||||
The 72-hour soak and subsequent 30 calendar days of burn-in are additional elapsed time and cannot be compressed into the effort estimate.
|
||||
|
||||
## Exit Criteria and Quality Gates
|
||||
|
||||
- P0 pass 100%; P1 ≥95% is an interim development signal only, **100% of mandatory P1 and manual ACs must pass for acceptance**.
|
||||
- Every owning-story AC has test/protocol plus bound execution evidence; no mandatory skipped/flaky/blocked/not-run item becomes pass.
|
||||
- No unresolved Critical/High defect; high-risk mitigation verified on the owning scenario before release. Mandatory Habr conditions have no waiver.
|
||||
- Coverage targets remain system planning goals (80% workspace /90% new critical code where measured); **no coverage report currently proves them**. Scenario counts do not substitute for coverage instrumentation.
|
||||
- NFR evidence names revision, config/topology, tool/data versions, command, seed, timestamps, raw sanitized output digest and result.
|
||||
- Story completion follows its spec, not all remaining epic/system gaps; no automatic reopening of done stories.
|
||||
|
||||
## Mitigation Plans
|
||||
|
||||
Each high-risk owner in the matrix: (1) implement/reuse the production-safe seam; (2) run its A/B and detailed AC cases with controlled failures; (3) bind the output to the candidate; (4) re-evaluate residual risk. Status is planned or source-partial, never verified solely by this document. Required completion time is the owning story/epic milestone in the risk table. No generic follow-up review loop is created.
|
||||
|
||||
## Assumptions and Dependencies
|
||||
|
||||
Epics1–7 functionality and component evidence →8.1RC/evidence contract →8.2/8.3/8.4 quality→8.5performance→8.6soak→8.9burn-in→8.10publication; security/docs qualify same RC before gate. 8.3/8.6/8.8/8.9 require an explicit external-qualification handoff with accepted candidate-bound evidence. A blocking defect requires new RC and applicable resets. A planned product restart is operational maintenance; it does not establish qualification continuity, and an integrity-changing restart resets the 8.9 burn-in window.
|
||||
|
||||
Accountable roles are responsibilities, not claims of staffed teams. Reference hardware, operator credentials and manual reviewers must be assigned before relevant qualification. Use disposable fixtures while waiting; lack of resources blocks the affected evidence, not permission to mutate a live deployment.
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
Affected components and reusable suites are named in Existing Coverage. Preserve existing REST→MCP, auth/credential/approval, config/migration, correlation and Community-boundary behavior whenever those shared contracts change. Frontend failures need actual browser regression; registry races need real-PG assertions, not UI mocks.
|
||||
|
||||
## ATDD Handoff
|
||||
|
||||
For the selected not-yet-implemented story only, load this plan and the exact approved spec; freeze its finite AC-to-test checklist before implementation. Prefer existing Rust/PG/Playwright patterns, add only uncovered acceptance scenarios and reproduce RED for missing behavior without artificial failure. Existing correct behavior may already be GREEN: record it honestly. Resume matching incomplete ATDD, reuse completed matching checklists and update only changed ACs. Do not invoke whole-epic automation on each review.
|
||||
|
||||
Automatic pre-implementation ATDD requires the project build-auto handoff override; the stock bmad-loop0.11.1 TEA ATDD injection is post-dev and is not that sequence. Loop configuration is separate from completion of this plan. The design workflow itself does not run ATDD or product implementation.
|
||||
|
||||
## References and Validation
|
||||
|
||||
- Epic/AC source: `_bmad-output/planning-artifacts/epics.md`, Epic 8.
|
||||
- System contract: [architecture](test-design-architecture.md), [QA inventory and execution](test-design-qa.md).
|
||||
- Normative PRD and architecture spine: frontmatter inputDocuments.
|
||||
- TEA knowledge: risk-governance, probability-impact, test-levels-framework, test-priorities-matrix, nfr-criteria.
|
||||
- Utility integration: Playwright/Pact flags are true but packages absent. No imports, framework migration or Pact service are generated. Browser CLI unavailable; source-based design only.
|
||||
- Validation: story IDs/requirements/AC counts, risk arithmetic/linkage and document paths checked; no final test/NFR PASS issued. Approval is planning-level user direction, not fabricated reviewer signatures.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Epic Test Design Index
|
||||
|
||||
Updated 2026-09-13 against main `083974c27f3a21a15807dd248bb6bc4fe04a5cd8`. Eight plans cover all 99 stories from the approved current epics decomposition (25 historically done, 74 backlog). Plans are not acceptance or execution evidence; the numbering revision does not change a tested commit or fabricate a new run.
|
||||
|
||||
| Epic | Story count | Plan |
|
||||
|---|---:|---|
|
||||
| 1 — REST → MCP foundation | 16 | [Regression and remaining evidence](test-design-epic-1.md) |
|
||||
| 2 — OpenAPI import | 15 | [Storage, refs, HTTP contract, preview and re-import](test-design-epic-2.md) |
|
||||
| 3 — MCP catalog | 20 | [Protocol adapters, Tools, Resources and Prompts](test-design-epic-3.md) |
|
||||
| 4 — Background execution | 10 | [Durable Tasks, fencing and recovery](test-design-epic-4.md) |
|
||||
| 5 — Observability | 13 | [Correlation, GlitchTip, spool, metrics and SLO](test-design-epic-5.md) |
|
||||
| 6 — Load testing | 6 | [Safety plans, runner, stop and reports](test-design-epic-6.md) |
|
||||
| 7 — Deployment | 9 | [Offline installation, migrations, backup and restore](test-design-epic-7.md) |
|
||||
| 8 — Release qualification | 10 | [Immutable RC, matrices, soak and publication gate](test-design-epic-8.md) |
|
||||
|
||||
Shared authority: [system architecture testability](test-design-architecture.md), [current QA inventory and execution strategy](test-design-qa.md), approved PRD and epic acceptance criteria. Historical handoff/baseline artifacts are not current pass evidence.
|
||||
|
||||
Current plans use the approved sequential IDs: Epic 2 2.1–2.15, Epic 3 3.1–3.20, Epic 4 4.1–4.10 and Epic 5 5.1–5.13. The old→new mapping and AC allocation are recorded in the corresponding plan tables. Archived execution records retain their original identifiers; no new test execution is implied by renumbering.
|
||||
|
||||
## Development boundary
|
||||
|
||||
ATDD should freeze a finite, story-scoped AC-to-test checklist before implementation, reuse existing tests and matching completed checklists, and avoid regenerating tests in review. A green existing behavior must not be deliberately broken to fake RED. Qualification work runs only at its owning milestone; updating these plans does not reopen completed stories or launch any workload.
|
||||
|
||||
The project now configures pre-implementation ATDD through `_bmad/custom/bmad-build-auto.toml`. The TEA plugin remains enabled; only its stock post-dev ATDD injection is disabled in `.bmad-loop/policy.toml`. Test artifacts are seeded into new worktrees. Mandatory acceptance scaffolds must be activated and pass before story completion; skipped scaffolds are not executed RED evidence. This is workflow configuration, not evidence of a completed live loop run; existing runs were not modified.
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-2'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 2 test design progress
|
||||
|
||||
Output: test-design-epic-2.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
15 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). Approved numbering splits former 2.10 into 2.10 API (former groups 1–10, 12) and 2.11 UI (former 11 plus UI perspectives of 3 and 5); old 2.11–2.14 become 2.12–2.15. All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-7–FR-12; system families CP-05..07. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: `crates/crank-artifacts/tests/{artifact_store,artifact_store_io,reconciliation}.rs`; `crates/crank-registry/tests/integration/{artifact_sources,artifact_reconciliation}.rs`; `apps/admin-api/tests/integration/openapi_source/`; `crates/crank-import/tests/{preview,coverage,normalization_details,reference_resolution}.rs`; `apps/admin-api/tests/integration/openapi_import/`; `apps/ui/tests/e2e/operations.spec.js`.
|
||||
|
||||
Gaps: 2.1–2.6 source/metadata/reconciliation/preview and 2.7–2.8 have reusable source tests, not fresh acceptance evidence. 2.9 tests exist only at candidate f8ee7c9, not main 083974c; rerun after integration. Security-scheme API/UI mapping, full partial/re-import policy matrix, ≥50-spec corpus and OpenAPI onboarding still need story-level deltas. Two candidate review deferrals (reverse URL placeholder validation and object/array default projection) remain explicit triage inputs, not automatically accepted or added to every story.
|
||||
|
||||
NFR: Zero silent semantic loss; ≥50 versioned specs and ≥95% actionable Draft operations (2.14). Source size/depth/time/scan budgets come from the typed contract; test min/max/over-limit, do not invent limits. No secrets outside allowed encrypted authority. Test artifact retention under reference/cleanup contention.
|
||||
|
||||
Fixtures: Immutable hostile/valid YAML/JSON corpus with expected IR and wire outcomes; local allowlisted HTTP/DNS fixtures; isolated temp roots; real PostgreSQL schemas; reproducible crash checkpoints. File-size fault tests must retain pipe/PTY stdout rather than a regular-file redirect.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 40–80h; P1 20–40h; optional P2 0–8h/P3 0–4h; total 60–132h (~2–4 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E2-R1 | DATA | Silent HTTP/schema loss in supported imports | 3 | 3 | 9 | R-002 | Wire oracle + IR/ref/plan golden tests; Import owner, before 2.14 |
|
||||
| E2-R2 | SEC | Hostile files/refs escape scope, leak secrets or exhaust resources | 3 | 3 | 9 | R-004 | Bounded parser/network/storage canaries; Security + Import, each source story |
|
||||
| E2-R3 | DATA | GC/re-import races lose pinned artifacts or overwrite revisions | 2 | 3 | 6 | R-008 | Real PG + filesystem fault interleavings; Registry, before 2.13 |
|
||||
| E2-R4 | TECH | Flaky preview UI/evidence masks failed import | 2 | 2 | 4 | R-012 | Stale-response tests + strict evidence; UI/QA, 2.6/2.15 |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 2. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-3'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 3 test design progress
|
||||
|
||||
Output: test-design-epic-3.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
20 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). Approved decomposition separates call lifecycle from Tool signals, Prompt Draft/publish/list/portability, and completion/logging/Resource-Prompt signals; former 3.14 is now 3.20. All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-13–FR-20; system families CP-08..11. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: `crates/crank-community-mcp/tests/unit/{manifest,session,tool_error}.rs`; `apps/mcp-server/tests/integration/{transport_protocol,catalog_access,tool_search,execution_stages}.rs`; `apps/ui/tests/e2e/onboarding.spec.js`.
|
||||
|
||||
Gaps: Existing tests cover baseline Tools, transport, catalog and runtime only. Resources/Prompts/modern adapter matrix are planned; no feature-level tests were found in main. Do not confuse MCP client-library behavior with implementation evidence. Tasks cells are completed by Story 4.7; 3.20 must mark them pending rather than falsely PASS.
|
||||
|
||||
NFR: Discovery p95 ≤150 ms on 2,000 Operations/200 Agents; zero unauthorized metadata/content reads. Pin stable/N-1/N-2 and ≥3 clients at feature freeze. The 2026-07-28 wire shapes named in epics.md are planning inputs, not a newly verified claim about latest MCP; verify official specifications/digests before adapter ATDD, preserving legacy deprecation gate.
|
||||
|
||||
Fixtures: Wire fixtures per protocol era; scope-separated Agent catalogs; text/JSON/binary hostile resources; exact-version graphs; capture upstream; clock/cancellation barriers; browser keyboard and RU/EN fixtures.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 60–120h; P1 32–64h; optional P2 0–12h/P3 0–4h; total 92–200h (~3–6 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E3-R1 | BUS | Advertised capabilities or version behavior disagree | 2 | 3 | 6 | R-009 | Revision/client matrix and wire errors; MCP owner, 3.20 |
|
||||
| E3-R2 | SEC | Resource/Prompt scope or REST expansion leaks data | 3 | 3 | 9 | R-004 | Negative authorization + SSRF + redaction; Security, 3.8/3.11/3.16 |
|
||||
| E3-R3 | DATA | Mutable catalog or stale cursor serves wrong published version | 2 | 3 | 6 | R-009 | Snapshot/revoke races; Registry/MCP, publication stories |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 3. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-4'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 4 test design progress
|
||||
|
||||
Output: test-design-epic-4.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
10 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). Former 4.5 splits into input (4.5) and reconciliation (4.6); former Admin UI splits into basic Task UI (4.8) and input/reconciliation UI (4.9). All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-21–FR-26; system families CP-12..15. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: `crates/crank-runtime/tests/{stages,product_metrics}.rs`, `crates/crank-runtime/tests/integration/{idempotency,confirmation,valkey}.rs`, `crates/crank-test-support/src/lib.rs` supply synchronous safety and real-PG fixture patterns.
|
||||
|
||||
Gaps: No durable Task/worker/admission lifecycle tests found in main. tokio::task usage is not MCP Tasks coverage. All story-specific Task acceptance scenarios are planned. Existing synchronous idempotency and approval tests must remain regression coverage, not be rewritten to make unsafe Task behavior pass.
|
||||
|
||||
NFR: 128 concurrent sync/background executions, up to 10,000 queued; start and steady queue wait p95 ≤5 s within service rate, oldest age ≤30 s; 10k backlog drains ≤60 minutes after overload ends. Shutdown ≤30 s and eligible lease recovery ≤60 s. Fencing protects Crank state, not exactly-once external side effects.
|
||||
|
||||
Fixtures: Real PG independent worker connections; controllable clock/barriers and crash checkpoints before/after commit, claim, dispatch, side effect and terminal commit; counted upstream with and without verified idempotency; Valkey-off fixture; separate measured capacity host.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 64–128h; P1 20–40h; optional P2 0–8h/P3 0–4h; total 84–180h (~3–5 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E4-R1 | DATA | Stale lease or retry duplicates an external side effect | 3 | 3 | 9 | R-003 | Fencing + side-effect counters + unknown outcomes; Task owner, 4.3–4.6 |
|
||||
| E4-R2 | PERF | Admission/queue exhaustion starves control plane | 3 | 3 | 9 | R-006 | Limits/fairness/recovery under load; Performance, 4.10 |
|
||||
| E4-R3 | SEC | Cross-scope Task control or resume bypasses consent | 2 | 3 | 6 | R-004 | Owner-bound cancel/input/reconciliation; Security, 4.5–4.9 |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 4. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-5'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 5 test design progress
|
||||
|
||||
Output: test-design-epic-5.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
13 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). Former 5.9 splits into Prometheus (5.9) and notification gateway/Apprise (5.10); Grafana becomes 5.11; former 5.11 splits into SLO (5.12) and alert delivery/end-of-epic evidence (5.13). All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-27–FR-35; system families CP-16..21. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: `crates/crank-observability/tests/{request_correlation,propagation,json_logging,redaction,critical_errors,otlp,prometheus,http_metrics,metrics_signals}.rs`; `apps/mcp-server/tests/integration/execution_stages.rs`; `apps/admin-api/tests/integration/logs_usage.rs`; `crates/crank-metrics/tests/`.
|
||||
|
||||
Gaps: IDs, local metric registry, redaction and captured OTLP are source-present foundations. Real GlitchTip receiver delivery, durable encrypted spool/loss reconciliation, complete ProductEvent rollups, packaged Prometheus/Grafana and SLO qualification are not proven by them. Actual Load Run data acceptance remains in 6.6, not Grafana story 5.11. No services are provisioned in this task.
|
||||
|
||||
NFR: 100% support IDs independent of sampling; healthy delivery ≥99.99% within60s; outage≤24h with100% saved-envelope delivery within25h, sized30h spool. Observability overhead≤5% p95 latency and≤10% CPU; drain≤30s. Availability30d≥99.95%, control plane≥99.9%. Exact series budgets/buckets and burn windows must use versioned typed/rule contracts; unspecified values remain UNKNOWN until owning story freezes them.
|
||||
|
||||
Fixtures: Queryable local trace/error receiver and real GlitchTip qualification environment; independent generated/accepted/ACK/lost envelope ledger; bounded disk partitions and fault controls; golden UTC events; Prometheus synthetic series; provisioned Grafana fixture without committed secrets.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 60–120h; P1 24–48h; optional P2 0–8h/P3 0–4h; total 84–180h (~3–5 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E5-R1 | OPS | Spool/replay loss yields false trace completeness | 2 | 3 | 6 | R-005 | Independent envelope accounting and crash/outage; Observability, 5.6 |
|
||||
| E5-R2 | SEC | Browser/export/link leaks secrets or executes unsafe URL | 3 | 3 | 9 | R-004 | Canaries at every sink and hostile links; Security/UI, 5.2–5.4 |
|
||||
| E5-R3 | DATA | Rollups/cardinality/SLI denominators lie | 2 | 3 | 6 | R-011 | Idempotency + UTC + rules oracles; Metrics, 5.8/5.12 |
|
||||
| E5-R4 | PERF | Telemetry pressure blocks product requests | 3 | 3 | 9 | R-006 | Quota isolation + enabled/disabled comparison; SRE, 5.6 |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 5. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-6'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 6 test design progress
|
||||
|
||||
Output: test-design-epic-6.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
6 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). The last two former 6.1 full-workflow groups move to 6.6; 6.4 adds the approved Run/generator/report correlation group (7 AC groups), and 6.6 has 9. Per-process spool applies only where the owning telemetry contract requires it; this revision does not add a blanket new spool. All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-36–FR-40; system families CP-22..24. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: Runtime metric/overhead patterns in `crates/crank-runtime/tests/product_metrics.rs` and `crates/crank-metrics/tests/overhead.rs`; real MCP fixture in `apps/ui/scripts/playwright-http-fixture.js` and `apps/ui/tests/e2e/onboarding.spec.js`.
|
||||
|
||||
Gaps: No Load Scenario, runner, safety-plan or report feature suites found. Existing microbenchmarks/local budget checks do not prove generated RPS, control-plane isolation or product capacity. DAU preview is a load model, not the measured unique-Agent DAU rollup of 5.8.
|
||||
|
||||
NFR: Hard non-overridable ceilings1000RPS/512VU/2h/10,000,000iterations (6.3). Qualification100RPS30m +250RPS5m, per-minute success≥99.95% and saturation rejects≤0.1%; platform overheadp95≤50ms/p99≤150ms with10ms upstream/cache off. Arrival tolerance and stop/drain policy must be frozen by owning story, never chosen silently by tests.
|
||||
|
||||
Fixtures: Counted controllable upstream; signed-plan negative fixtures with exact change fingerprints; isolated runner CPU/memory/network and reserved control path; host kill socket in disposable sandbox; external calibrated generator/counters to separate harness saturation from SUT saturation.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 40–80h; P1 24–48h; optional P2 0–8h/P3 0–4h; total 64–140h (~2–4 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E6-R1 | SEC | Forged/stale load plan dispatches damaging writes | 3 | 3 | 9 | R-010 | Signed fingerprint + replay/SSRF/write negatives; Security, 6.3 |
|
||||
| E6-R2 | OPS | Runner duplicates generation or cannot stop | 2 | 3 | 6 | R-010 | Owner fencing + reserved path + independent kill; Runner, 6.4–6.5 |
|
||||
| E6-R3 | PERF | Generator bottleneck/aggregation reports false SUT performance | 3 | 3 | 9 | R-006 | External calibration + independent counts; Performance, 6.6 |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 6. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-7'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 7 test design progress
|
||||
|
||||
Output: test-design-epic-7.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
9 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). The offline-upgrade AC moves from 7.5 to 7.9: bundle install/trust remains 5 groups in 7.5 and upgrade/rollback continuity becomes 8 groups in 7.9. All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-41–FR-45; system families CP-25..27. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: `crates/crank-config/tests/{contract,generation,redaction}.rs`; `crates/crank-registry/tests/integration/migrations.rs` and `migrations/`; `apps/admin-api/tests/migration_command.rs`; `apps/admin-api/tests/config_startup.rs`; `scripts/restore-community.sh`; `scripts/authenticated-product-smoke.py`; `.gitea/workflows/ci.yml`.
|
||||
|
||||
Gaps: Config/migration/auth foundations and Compose authenticated smoke exist. Restore script presence is not three qualified PITR restores. Complete offline signed bundle, role isolation with future worker/runner and full N/N-1 online/offline matrix need evidence. Prior deployment failures require regression fixtures for legacy fingerprint, missing core, external PG topology and failed migrate diagnostics, not permission to reset databases.
|
||||
|
||||
NFR: Each of3independent restores RPO≤5m/RTO≤30m with real MCP probe; drain≤30s and eligible Task recovery≤60s. Production sizing retains≥30% measured headroom. Zero known Critical/High, zero unapproved egress. Trust material/reference-host allocation and exact image digests are execution prerequisites, never generated secrets in docs.
|
||||
|
||||
Fixtures: Disposable fresh host/network namespaces; PG16 current/N-1/legacy snapshots; checksummed artifacts/WAL plus out-of-band test keys; fault checkpoints; offline registry-less image archive; default-deny egress capture; fresh scanner DB pinned in report.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 48–96h; P1 16–32h; optional P2 0–8h/P3 0–4h; total 64–140h (~2–4 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E7-R1 | DATA | Schema/artifact/key mismatch destroys recovery | 2 | 3 | 6 | R-008 | Manifest + N/N-1 + three real restores; SRE, 7.8–7.9 |
|
||||
| E7-R2 | SEC | Unsafe defaults/proxy/privileges expose installation | 2 | 3 | 6 | R-007 | Fresh-host negative exposure tests; Security, 7.4/7.6 |
|
||||
| E7-R3 | SEC | Offline bundle untrusted or phones home | 2 | 3 | 6 | R-014 | Offline signature/tamper/egress tests; Release, 7.5 |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 7. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
runScope: 'epic-level'
|
||||
runKey: 'epic-8'
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
inputDocuments:
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad/tea/config.yaml'
|
||||
lastSaved: '2026-09-13'
|
||||
---
|
||||
|
||||
# Epic 8 test design progress
|
||||
|
||||
Output: test-design-epic-8.md. Completed 2026-09-13. Story/requirement/AC-count coverage, source references, risk scores and format validated. Template adapted to existing-project inventory: counts are scenario seeds, estimates are provisional QA deltas, no synthetic code-coverage or execution claim. Native loop ATDD is post-dev; pre-implementation customization is a separate pending approval, not executed by this design run.
|
||||
|
||||
## Coverage decisions
|
||||
|
||||
10 story families, two independently assertable scenario seeds per family (A positive contract; B rejection/fault). Stories 8.3, 8.6, 8.8 and 8.9 require external-qualification handoff with accepted candidate-bound evidence; planned/rejected/missing handoff is not done. In 8.9, a planned restart is operational maintenance, not qualification continuity; an integrity-changing restart resets its window. All owning-story Given/When/Then groups remain required ATDD input; these are not a claim of exhaustive implemented test cases.
|
||||
|
||||
Scope: FR-46–FR-54; system families CP-28..34. Lowest effective level assigned per family. P0 security/data integrity with no workaround; P1 user/core flow. No speculative mandatory P2/P3 additions.
|
||||
|
||||
Source reuse: `docs/capability-inventory.json`; `docs/capability-baseline/results.json`; `scripts/collect-capability-baseline.py`; `scripts/validate-capability-run.py`; `tests/unit/`; `.gitea/workflows/{ci,release}.yml`; `scripts/scan-images.sh`; `docs/manual-regression-checklist.md`.
|
||||
|
||||
Gaps: Existing inventory/collector and CI scans are foundations, not full signed RC evidence. Historical baseline2026.08.24.1 uses revision767428, not current main. Chromium-only current suite is not Firefox/WebKit×RU/EN qualification. No measured coverage report,72h/30day accepted run or3PITR restores was produced by this planning task.
|
||||
|
||||
NFR: Inherit every PRD/system quantitative gate: full P0 and mandatory P1/manual pass, zero mandatory flakes and Critical/High; 3performance runs;72h then30calendar days≥1M eligible events on exact RC, no acceleration/stitching. Reference dataset2kOperations/200Agents/500keys/1Mhistory; UI≤2sp95. MCP stable window and exact tool/browser/image/scanner versions freeze at execution, not invented now.
|
||||
|
||||
Fixtures: Content-addressed valid and one-fault-per-input signed manifests with disposable test trust root; immutable RC environment with calibrated load/fault schedule; actual fresh-user/manual reviewers; sanitized raw reports and logs plus independent timestamps. Synthetic verifier fixtures never count as production qualification.
|
||||
|
||||
Execution: PR functional tests, nightly bounded expensive/fault work, weekly calibrated qualifications; scheduled tiers are planned, not configured. Mandatory story ACs still must pass before acceptance, regardless of tier. 72h/30day release windows only in Epic8. QA effort assumption with prerequisite implementation ready: P0 48–96h; P1 24–48h; optional P2 0–8h/P3 0–4h; total 72–156h (~2–5 contributor-weeks). Not a backlog of compulsory new tests; refine against existing-test reuse during ATDD.
|
||||
|
||||
|
||||
## Risks and NFR planning
|
||||
|
||||
| Risk | Category | Failure | P | I | Score | System risk | Mitigation / owner / deadline |
|
||||
|---|---|---|---:|---:|---:|---|---|
|
||||
| E8-R1 | OPS | Mixed/stale/forged evidence produces PUBLIC_READY | 3 | 3 | 9 | R-013 | Offline signed verifier with negative fixture per gate input; Release, 8.1/8.10 |
|
||||
| E8-R2 | OPS | Leaks/recovery failures appear only after sustained traffic | 2 | 3 | 6 | R-015 | 72h + 30 calendar days fixed RC; SRE, 8.6/8.9 |
|
||||
| E8-R3 | SEC | Incomplete matrix/security/manual pass hides unsafe claims | 2 | 3 | 6 | R-014 | Full qualified cells + zero mandatory skips; QA/Security, 8.3/8.4/8.7 |
|
||||
|
||||
Scores describe inherent risk, not observed failures or a release verdict. Security/reliability/performance thresholds inherit the system design and owning story ACs; missing environment/measurement evidence remains explicit, never inferred PASS.
|
||||
|
||||
|
||||
Context: Rust/PostgreSQL + browser JavaScript fullstack. Existing test source inventory at main 083974c; f8ee7c9 candidate is separate. Browser CLI absent; no live exploration, no fabricated evidence. Playwright/Pact utility flags are intentions only: packages absent; no library migration or Pact scaffolding in this planning scope. Required risk, probability/impact, test levels/priorities and NFR knowledge loaded; concrete source reuse and gaps appear in the epic plan.
|
||||
|
||||
Explicit batch request, independent epic scope. Requirements and acceptance criteria: planning-artifacts/epics.md, Epic 8. System designs already updated; no product implementation or test execution authorized by this planning run.
|
||||
@@ -0,0 +1,447 @@
|
||||
---
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-08-08'
|
||||
inputDocuments:
|
||||
- '_bmad-output/project-context.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md'
|
||||
- '_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/addendum.md'
|
||||
- '_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md'
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/tea-index.csv'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/adr-quality-readiness-checklist.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/nfr-criteria.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/test-levels-framework.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/risk-governance.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/test-quality.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/playwright-cli.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/contract-testing.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/test-priorities-matrix.md'
|
||||
- '.agents/skills/bmad-testarch-test-design/resources/knowledge/probability-impact.md'
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/test-artifacts/test-design-qa.md'
|
||||
- '_bmad-output/test-artifacts/test-design/crank-handoff.md'
|
||||
---
|
||||
|
||||
# Test Design Progress — crank
|
||||
|
||||
## Step 1: Mode and Prerequisites
|
||||
|
||||
- **Mode:** System-Level.
|
||||
- **Reason:** одновременно доступны PRD, Architecture Spine/architecture decisions и полные Epics/Stories; по правилу workflow системный test design предшествует epic-level plans.
|
||||
- **PRD:** `_bmad-output/planning-artifacts/prds/prd-crank-2026-08-03/prd.md`.
|
||||
- **Architecture:** `_bmad-output/planning-artifacts/architecture/architecture-crank-2026-08-03/ARCHITECTURE-SPINE.md`.
|
||||
- **Story coverage:** `_bmad-output/planning-artifacts/epics.md` — 8 эпиков, 99 Story (25 исторически done, 74 backlog), 54 FR. Изменение декомпозиции не меняет факт или commit ранее выполненных проверок.
|
||||
- **Prerequisite result:** PASS; обязательные входы найдены.
|
||||
|
||||
## Step 2: Loaded Context and Knowledge Base
|
||||
|
||||
- **Configuration:** `tea_use_playwright_utils=true`, `tea_use_pactjs_utils=false`, `tea_pact_mcp=none`, `tea_browser_automation=auto`, `test_stack_type=auto`, `test_artifacts=_bmad-output/test-artifacts`.
|
||||
- **Detected stack:** `fullstack`. Backend indicators: Rust workspace/Cargo, Axum/Tokio/SQLx/PostgreSQL. Frontend indicators: `apps/ui/package.json`, Playwright config and existing browser specs using `page.goto`/locators.
|
||||
- **Product inputs:** PRD plus addendum, Architecture Spine/ADRs, complete approved 8-epic/99-story plan and project-context rules. No required input is missing.
|
||||
- **Pinned technology:** Rust 1.96.1 / Edition 2024 / MSRV 1.96, Axum 0.8, Tokio 1, SQLx 0.9, Reqwest 0.12, PostgreSQL 16, optional Valkey 8, Node 22, Alpine.js 3.15.12 and Playwright 1.61.1.
|
||||
- **Primary integration boundaries:** Admin UI/API; version-isolated MCP server; REST upstream and OpenAPI external refs; PostgreSQL authority; optional Valkey acceleration; durable Task Worker; isolated Load Runner; artifact storage; GlitchTip/Sentry-compatible telemetry; Prometheus/Grafana; backup/PITR and signed offline release bundle.
|
||||
- **Test-design scope:** all 54 FR, 30 NFR and 34 architecture requirements, including current REST→MCP regression, real-world OpenAPI corpus, Tools/Resources/Prompts and MCP revision matrix, synchronous/background execution, trace correlation, technical/business metrics, built-in Load Runs, deployment/recovery and one-RC release evidence.
|
||||
|
||||
### Extracted NFR thresholds
|
||||
|
||||
- Reference workload: 100 RPS for 30 minutes and 250 RPS for 5 minutes; per-minute product success ≥99.95%, saturation rejection ≤0.1%.
|
||||
- Capacity: ≥128 concurrent executions, 10,000 queued Tasks, and production dataset of 2,000 Operations / 200 Agents / 500 keys / 1,000,000 history records.
|
||||
- Latency: platform overhead ≤50 ms p95 / ≤150 ms p99 against a 10 ms stub; discovery ≤150 ms p95; principal UI screens ≤2 s p95 over local LAN.
|
||||
- Reliability: product success ≥99.95%, control-plane availability ≥99.9%; graceful shutdown ≤30 s; Task start ≤5 s p95; lease recovery ≤60 s; RPO ≤5 min and RTO ≤30 min.
|
||||
- Observability: IDs on 100% of requests/records; traces generated for 100%; delivery ≥99.99% within 60 s and 100% completeness within 25 h for outages ≤24 h; 30 h spool capacity; overhead ≤5% p95 latency and ≤10% CPU.
|
||||
- Security: default deny, encrypted/non-returnable secrets, per-connection SSRF enforcement, bounded resources/cardinality, fail-closed safety stores, no Critical/High vulnerabilities or findings, and no telemetry egress without opt-in.
|
||||
- Compatibility/release: latest stable MCP at feature freeze plus N-1/N-2; ≥50 OpenAPI fixtures with ≥95% actionable Drafts and zero silent loss; 72 h soak; non-accelerable 30-day/≥1M-event burn-in; complete manual regression and signed evidence for one immutable RC.
|
||||
|
||||
### Threshold completeness and deferred parameters
|
||||
|
||||
Critical release thresholds are measurable and sufficiently defined for system test design. Remaining values are implementation-time tuning parameters rather than missing product targets: PostgreSQL partition/index thresholds, Task polling/lease/batch/fairness values, exact Grafana panel layout/derived alert thresholds, digest-pinned observability images and feature-freeze MCP revisions. They must be frozen before the corresponding epic qualification tests and cannot weaken the NFRs above.
|
||||
|
||||
### Loaded testing guidance
|
||||
|
||||
- System-level readiness uses the 8-category/29-criterion ADR checklist and objective PASS/CONCERNS/FAIL evidence.
|
||||
- Risk scoring is probability × impact (1–9); score ≥6 requires owner/mitigation and score 9 blocks the gate.
|
||||
- Coverage follows the lowest effective level: Rust unit/property tests for pure invariants, PostgreSQL/container integration tests for persistence/concurrency, protocol/API contract tests for boundaries, Playwright only for critical UI journeys, and dedicated load/security/recovery tools for NFRs.
|
||||
- Tests must be deterministic, isolated, parallel-safe, self-cleaning, without hard waits, with explicit assertions, focused files and controlled test data.
|
||||
- Contract testing is relevant to Admin/OpenAPI/MCP/runtime boundaries, but Pact.js Utils and Pact MCP are disabled; contracts must be verified against authoritative Rust handlers/types or OpenAPI rather than consumer assumptions.
|
||||
- Browser exploration is not required in this system-level step. With automation=`auto`, Playwright CLI remains the preferred lightweight selector/trace investigation path for later epic-level work, with trace artifacts retained on failure.
|
||||
|
||||
## Step 3: Testability and Risk Assessment
|
||||
|
||||
### 🚨 Testability concerns
|
||||
|
||||
1. **Deterministic control plane is not yet a complete test contract.** The repository has `crank-test-support`, PostgreSQL Testcontainers, in-memory runtime stores and some seeded UI scenarios, but the target architecture still needs reusable builders/fixtures for every aggregate, controllable clocks/UUIDs, lifecycle transitions, cleanup and production-size datasets. Without these, Tasks, retention, leases and parallel runs will be slow or flaky. **Required before Epic 4 qualification.**
|
||||
2. **Fault injection is not an explicit shared facility.** We need deterministic doubles/proxies for DNS rebinding, redirects, partial/oversized bodies, upstream timeouts/resets, PostgreSQL/Valkey interruptions, worker crash points, telemetry endpoint outage/corruption and disk-full/fsync failures. Each injected fault must be named and observable. **Required before reliability/security evidence.**
|
||||
3. **Time-dependent Task semantics need virtual-time seams.** Lease expiry, retry/backoff, deadlines, input-required timeout, 30-hour spool, 25-hour completeness and retention cannot depend on wall-clock sleeps. Ports for clock/scheduler and persisted timestamps must be controllable while production wiring remains monotonic/UTC-correct. **Required during foundation/Task implementation.**
|
||||
4. **End-to-end observability assertions need queryable sinks.** The architecture defines IDs, traces, GlitchTip, local records and metrics, but tests need bounded APIs/helpers to query local history, captured OTLP/Sentry envelopes, Prometheus exposition and Grafana provisioning by `request_id`/`trace_id`. Direct dependence on a live external GlitchTip is insufficiently deterministic. **Required before Epic 5.**
|
||||
5. **Load generation must be independently measurable.** The built-in runner shares the host with the SUT in the reference profile; its own CPU/memory/network use, heartbeat and kill path must be measured separately so generator saturation cannot be misreported as product failure. A stub upstream and externally cross-checked reference load tool are required. **Required before Epic 6 evidence.**
|
||||
6. **Release evidence needs executable provenance from the start.** Corpus/matrix/load/recovery/manual outputs must use stable schemas, content-addressed storage, deterministic commands and one-RC identity. Retrofitting this at Epic 8 risks unrepeatable or stale evidence. **Establish schemas and collectors in Epic 1, extend per epic.**
|
||||
7. **Browser tests need parallel-safe state and selectors.** Existing Playwright coverage proves some flows, but production qualification requires API-first seeding, per-worker namespaces, self-cleanup, RU/EN coverage, stable role/test-id selectors and retained traces. Avoid UI setup for non-UI behavior. **Required before full manual/automated regression.**
|
||||
|
||||
### ✅ Testability assessment summary
|
||||
|
||||
- Hexagonal boundaries and framework-free core permit low-cost unit/property/state-machine tests and replaceable adapters.
|
||||
- PostgreSQL is the single correctness authority and Valkey is explicitly rebuildable/optional, enabling PG-only reference assertions and differential cache tests.
|
||||
- Existing `crank-test-support`, PostgreSQL 16 Testcontainers, runtime in-memory stores, Rust integration suites and Playwright tests provide a usable brownfield foundation.
|
||||
- Typed errors, events, metric registry, identity conventions and immutable revisions create deterministic assertion surfaces.
|
||||
- The OpenAPI NormalizedIR/ImportPlan pipeline, version-isolated MCP adapters and unified runtime execution path expose natural corpus, contract and differential-test boundaries.
|
||||
- Quantified NFRs, immutable evidence artifacts and a fail-closed release manifest allow objective gates rather than subjective sign-off.
|
||||
|
||||
### Architecturally Significant Requirements (ASRs)
|
||||
|
||||
| ASR | Classification | Test-design consequence |
|
||||
|---|---|---|
|
||||
| PostgreSQL-authoritative Tasks with transactional dispatch, CAS leases and fencing | ACTIONABLE | Model/state-machine, crash-point, concurrency and real-PG tests; prove no stale terminal writes and explicit `outcome_unknown`. |
|
||||
| Unified outbound pipeline with per-connection DNS/redirect policy and hard bounds | ACTIONABLE | Hermetic malicious-network lab; verify every ingress path uses identical policy. |
|
||||
| Canonical W3C context across browser/MCP/runtime/worker and durable telemetry spool | ACTIONABLE | One cross-boundary golden E2E plus outage/replay/corruption/disk-capacity tests. |
|
||||
| Immutable OpenAPI ParsedDocument→IR→Plan→Apply pipeline | ACTIONABLE | ≥50-spec corpus, metamorphic/determinism tests, transactional rollback and zero-silent-loss oracle. |
|
||||
| Modern MCP adapters: stable N/N-1/N-2, Tools/Resources/Prompts and Tasks | ACTIONABLE | Protocol harness plus ≥3 real clients; adapter contract snapshots and negative negotiation tests. |
|
||||
| Signed LoadAuthorizationPlan and isolated Load Runner | ACTIONABLE | Authorization/kill-switch tests and calibrated load/overload/soak evidence on reference hardware. |
|
||||
| One migration authority, N/N-1 data compatibility, backup manifest and product-probe restore | ACTIONABLE | Upgrade/rollback matrix and three independent PITR restores measuring RPO/RTO. |
|
||||
| One-time admin bootstrap, fail-closed security, encrypted secrets and air-gap bundle | ACTIONABLE | Abuse/negative tests, secret canaries, configuration matrix, SAST/SCA/container scans and default-deny egress test. |
|
||||
| Alpine/vanilla JS remains the UI model | FYI | Use current bundle/build conventions; test async revision guards, safe DOM sinks, localization and accessibility without framework migration. |
|
||||
| Single-instance drain/restart; HA/rolling upgrades deferred | FYI | Qualify claimed topology only and explicitly prevent HA claims in docs/evidence. |
|
||||
|
||||
### Risk register
|
||||
|
||||
Scoring is Probability (P) × Impact (I), each 1–3. Scores ≥6 are high and require owned mitigation; score 9 blocks release while open.
|
||||
|
||||
| ID | Category | Risk | P | I | Score | Mitigation / evidence | Owner | Timeline |
|
||||
|---|---|---|---:|---:|---:|---|---|---|
|
||||
| R-001 | TECH | Brownfield regressions remain hidden because current core and UI are not fully manually/automatically baselined. | 3 | 3 | 9 | Capability inventory, characterization tests and complete guided baseline before semantic changes. | QA Lead + Core | Epic 1, before feature branches |
|
||||
| R-002 | DATA | OpenAPI normalization silently drops or mis-maps real constructs, security or schema branches. | 3 | 3 | 9 | Versioned ≥50-spec corpus, finding oracle, round-trip/metamorphic tests, immutable preview and atomic apply rollback. | Import Lead | Epic 2 gate |
|
||||
| R-003 | TECH | Concurrent workers duplicate side effects or accept stale writes after crash/lease expiry. | 3 | 3 | 9 | Model-based Task lifecycle, deterministic crash points, PG contention suite, fencing/idempotency invariants and reconciliation evidence. | Task Lead | Epic 4 gate |
|
||||
| R-004 | SEC | SSRF, redirect/proxy bypass or secret leakage crosses the closed-contour boundary. | 3 | 3 | 9 | Malicious DNS/HTTP lab on every execution path; secret canaries across logs/traces/metrics/UI/artifacts; fail-closed configuration tests. | Security Owner | Per-epic + RC security gate |
|
||||
| R-005 | OPS | Trace delivery outage, spool overflow/corruption or unsafe replay makes UI/GlitchTip correlation incomplete while UI claims success. | 2 | 3 | 6 | 30 h capacity, 24 h outage/replay, corruption and disk-pressure tests; loss records; golden trace query/deep-link E2E. | Observability Lead | Epic 5 gate |
|
||||
| R-006 | PERF | Reference workload breaches latency/success due to DB contention, metric cardinality, telemetry or load-runner interference. | 3 | 3 | 9 | Calibrated stub, baseline/telemetry differential, production-size query plans, 100/250 RPS runs, generator resource accounting and ceilings. | Performance Owner | Epics 5–6; RC repeat |
|
||||
| R-007 | SEC | Admin/session/bootstrap/recovery paths allow unauthorized state changes or metadata disclosure. | 2 | 3 | 6 | Auth state-machine tests, CSRF/CORS/cookie/proxy/TLS matrix, rate-limit tests, cross-scope negative corpus and recovery revocation proof. | Security + Admin API | Epic 7 gate |
|
||||
| R-008 | OPS | Upgrade, rollback or PITR restore yields schema/artifact/key mismatch despite services becoming healthy. | 2 | 3 | 6 | N/N-1 expand/migrate/contract matrix, consistency manifest and three timed restores ending in encrypted-auth MCP probe. | Release/SRE | Epic 7 gate |
|
||||
| R-009 | BUS | Resources, Prompts or current/previous MCP clients observe inconsistent catalog revisions or unsupported semantics. | 2 | 3 | 6 | Immutable catalog snapshots, adapter golden contracts, negotiation/change-signal tests and ≥3-client protocol matrix. | MCP Lead | Epic 3 gate |
|
||||
| R-010 | OPS | Built-in load test can overload the control plane, escape its target scope or fail to stop. | 2 | 3 | 6 | Signed authorization bounds, reserved control capacity, target allowlist, heartbeat/watchdog, Unix kill socket and forced-stop chaos tests. | Load Lead + Security | Epic 6 gate |
|
||||
| R-011 | DATA | Metrics/business rollups double count or expose high-cardinality/user identifiers. | 2 | 3 | 6 | Typed registry lint, label allowlist, idempotent rollup replay/differential tests, cardinality budget and exemplar validation. | Metrics Lead | Epic 5 gate |
|
||||
| R-012 | TECH | Flaky or over-broad E2E suite delays feedback and hides low-level defects. | 2 | 2 | 4 | Test pyramid, per-worker data, network-first waits, no hard sleeps, burn-in/quarantine policy and trace-on-failure. | QA Automation | Continuous |
|
||||
| R-013 | OPS | Evidence from different builds/configurations is combined or signed despite being stale/incomplete. | 2 | 3 | 6 | Schema-validated manifest binds RC/image/config/topology/commands/digests; freshness checks and fail-closed verifier. | Release Owner | Framework Epic 1; final Epic 8 |
|
||||
| R-014 | SEC | Air-gapped deployment contains vulnerable/untrusted images or performs undeclared egress. | 2 | 3 | 6 | Digest/signature/SBOM/license verification, fresh install/N-1 upgrade in disconnected lab and default-deny egress capture. | Supply-chain Owner | Epic 7/8 |
|
||||
| R-015 | OPS | 30-day burn-in exposes leaks or corruption too late for planned publication. | 2 | 3 | 6 | Begin continuous nightly/burn-in runs as soon as foundations exist; 72 h soak precheck; trend memory, handles, queues, spool and DB growth. | QA/SRE | Start Epic 4; final Epic 8 |
|
||||
|
||||
### NFR validation plan
|
||||
|
||||
| Category | Planned evidence sources | Threshold status |
|
||||
|---|---|---|
|
||||
| Security / privacy | Rust negative integration tests, malicious upstream lab, auth/browser E2E, secret-canary scans, SAST/SCA/SBOM/container/config scans, air-gap egress capture | Defined; no Critical/High and all default-deny/leak invariants are release blocking. |
|
||||
| Performance / scalability | Criterion/k6-equivalent external calibration plus built-in runner, Prometheus snapshots, production-size DB plans, telemetry-on/off differential, 100/250 RPS and 128/10k concurrency variants | Defined numerically; hardware/topology fixed by Reference Deployment. |
|
||||
| Reliability / recovery | Task model/crash tests, kill/restart/drain chaos, telemetry outage/replay, N/N-1 upgrade/rollback, three WAL/PITR restores with real MCP probe, 72 h soak and 30-day burn-in | Defined numerically; exact internal lease/poll tuning remains implementation-owned within limits. |
|
||||
| Observability | Correlation contract tests, golden UI→API/MCP→runtime→upstream→history→GlitchTip flow, OTLP/Sentry capture, Prometheus schema/cardinality lint, Grafana provisioning/alert-rule tests | Defined; 100% identity/trace and delivery/completeness/overhead budgets apply. |
|
||||
| Maintainability / compatibility | `cargo fmt/clippy/test`, architecture dependency checks, unsafe/panic lint, wire round-trips, OpenAPI corpus, MCP/client/browser/PG/Valkey matrices, localization lint and regression-per-defect rule | Version matrix is frozen at feature freeze; no unsupported compatibility claim before evidence. |
|
||||
| Compliance / release provenance | Content-addressed raw evidence, JSON-Schema manifest validation, signature/trust/rotation/revocation tests, RC/config/topology digest checks and manual sign-off | Defined as fail-closed Habr/production release gate; no waivers for mandatory capabilities or Critical/High failures. |
|
||||
|
||||
### Highest-priority mitigation order
|
||||
|
||||
1. Close R-001 with an immutable current-product baseline and establish reusable deterministic fixtures/evidence schemas.
|
||||
2. Develop R-002, R-003 and R-004 tests alongside OpenAPI, Task and outbound-security code; these are score-9 design drivers, not post-implementation QA.
|
||||
3. Build observability and performance measurement seams before optimizing (R-005/R-006/R-011), including independent load-generator accounting.
|
||||
4. Exercise upgrade/restore/security/offline paths continuously before the final RC (R-007/R-008/R-014), and start long-duration testing early enough to absorb R-015.
|
||||
5. The release gate remains FAIL while any score-9 risk is open or required evidence cannot be tied to the same immutable RC.
|
||||
|
||||
## Step 4: Coverage Plan and Execution Strategy
|
||||
|
||||
### Coverage matrix
|
||||
|
||||
The indicated level is the primary oracle. Defense-in-depth E2E is reserved for cross-boundary user outcomes; it does not repeat every branch already proven by unit/integration tests.
|
||||
|
||||
| ID | Requirements / risks | Atomic validation scenario | Primary level / tool | Priority | Planned automated cases |
|
||||
|---|---|---|---|---|---:|
|
||||
| CP-01 | FR-1..6, R-001 | Characterize existing manual REST Operation → test → publish Agent → MCP discovery/call → history, including validation/upstream/store failures | API integration + 2 golden Playwright/MCP E2E | P0 | 30–45 |
|
||||
| CP-02 | FR-1..6, AR-2/16/17 | Immutable revisions, publish snapshot atomicity, config bounds and migration compatibility/locking | Rust unit + PostgreSQL integration | P0 | 35–55 |
|
||||
| CP-03 | FR-4/6, NFR-S1/S7 | Approval/idempotency state machines, deduplication, expiry, scope isolation and fail-closed store outage | Rust model/property + PostgreSQL contention | P0 | 25–40 |
|
||||
| CP-04 | FR-5, NFR-S2 | Secret create/use/rotate/revoke lifecycle; ciphertext versioning; canary absent from every output channel | API/integration + artifact scanner | P0 | 25–40 |
|
||||
| CP-05 | FR-7..12, R-002 | Parse/normalize/preview deterministic across YAML/JSON OAS 3.0/3.1/Swagger 2; explicit unsupported findings and zero silent loss | Rust corpus/property tests | P0 | 150–250 corpus assertions |
|
||||
| CP-06 | FR-7..12 | Upload/encoding/size/ref limits, conflict selection, explicit partial mode and all-or-nothing apply/retry | API + PostgreSQL integration | P0 | 35–55 |
|
||||
| CP-07 | FR-7..12 | User uploads, reviews findings, edits, applies and publishes representative OpenAPI specs | Playwright critical journey (RU/EN) | P1 | 8–14 |
|
||||
| CP-08 | FR-013..16, NFR-C2 | MCP initialize/negotiation, list/call Tools, pagination/change signals, stable/N-1/N-2 wire contracts | Protocol harness + snapshots | P0 | 45–70 |
|
||||
| CP-09 | FR-17..18 | Static/dynamic Resource draft/publish/list/read/templates; read-safe pinned Operation and sensitivity enforcement | Rust/API contract + MCP harness | P0 | 35–55 |
|
||||
| CP-10 | FR-19..20 | Prompt draft/publish/list/get/render/completion; DAG validation, argument errors and side-effect freedom | Rust unit/property + MCP harness | P0 | 30–45 |
|
||||
| CP-11 | FR-013..20, R-009 | ≥3 representative clients discover/use identical immutable catalog revisions across negotiated MCP versions | Cross-client E2E matrix | P0 | 18–30 |
|
||||
| CP-12 | FR-21..26, R-003 | Task lifecycle model permits only legal/versioned/idempotent transitions and immutable terminal result | Rust model/property tests | P0 | 50–80 |
|
||||
| CP-13 | FR-21..26 | Transactional enqueue, bounded SKIP LOCKED claim, CAS lease/fencing, retries, cancellation/input and `outcome_unknown` under contention/crash | PostgreSQL integration/chaos | P0 | 45–70 |
|
||||
| CP-14 | FR-21..26, NFR-P2/R5 | Sync/background fairness, 128 active + 10k queue, deadline propagation, overload/retry guidance and ≤60 s recovery | Load/concurrency harness | P0 | 12–20 profiles |
|
||||
| CP-15 | FR-21..26 | Client starts/observes/cancels/resumes a Task through disconnect/restart; fallback on revisions without Tasks | MCP E2E | P1 | 10–16 |
|
||||
| CP-16 | FR-27..31, R-005 | Canonical IDs/W3C propagation through browser/Admin/MCP/runtime/upstream/worker retry/history; safe boundary errors | Rust/API contracts | P0 | 30–45 |
|
||||
| CP-17 | FR-27..31 | Golden request is searchable/copied in UI and deep-links to captured GlitchTip trace; loss record suppresses false claim | Playwright + MCP + telemetry-sink E2E | P0 | 8–12 |
|
||||
| CP-18 | FR-27..31, NFR-O2/O3 | Telemetry outage, 30 h spool sizing, encrypted persistence, restart, replay ordering/idempotency, corruption/disk pressure and overhead | Soak/chaos/performance | P0 | 15–25 profiles |
|
||||
| CP-19 | FR-32..35, R-011 | Metric registry names/types/units/labels/buckets stable; cardinality rejects IDs/arbitrary values | Rust unit/schema lint | P0 | 25–40 |
|
||||
| CP-20 | FR-32..35 | Product events/UTC rollups exactly-once under replay; Prometheus exposition and exemplar correlation agree with source records | PostgreSQL/API differential | P0 | 25–40 |
|
||||
| CP-21 | FR-32..35 | Grafana dashboards/recording rules/SLO denominators and fast/slow burn alerts provision and fire against synthetic series | Config-as-code test + Prometheus/Grafana integration | P1 | 18–28 |
|
||||
| CP-22 | FR-36..40, R-010 | Load plan validates/authenticates target and ceilings; start/status/stop/forced kill are safe and auditable | Rust/API integration | P0 | 25–40 |
|
||||
| CP-23 | FR-36..40, NFR-P1/P4 | Built-in runner results cross-check external generator at 100 RPS/30 m and 250 RPS/5 m; error classes and percentiles are accurate | Calibrated performance test | P0 | 8–12 profiles |
|
||||
| CP-24 | FR-36..40 | Operator launches RPS/DAU run, sees live status, safely stops and inspects correlated results | Playwright critical journey | P1 | 6–10 |
|
||||
| CP-25 | FR-41..45, R-007 | Fresh bootstrap/login/session/recovery and TLS/proxy/cookie/CSRF/CORS/default-deny matrix | API/browser security suite | P0 | 35–55 |
|
||||
| CP-26 | FR-41..45, R-008 | Fresh install, preflight, N/N-1 migration, drain/restart, rollback compatibility and three PITR restores ending in real encrypted-auth MCP probe | Deployment/recovery harness | P0 | 18–28 workflows |
|
||||
| CP-27 | FR-41..45, R-014 | Signed digest-pinned offline bundle installs/updates in air gap; SBOM/license/signature valid and undeclared egress absent | Supply-chain/air-gap system test | P0 | 12–20 |
|
||||
| CP-28 | FR-46..50 | Complete regression, OpenAPI/MCP/client/browser/PG/Valkey matrices, static/security scans and production-size dataset | CI matrix | P0 | Matrix-defined |
|
||||
| CP-29 | FR-49, R-015 | 72 h soak and non-accelerable 30-day ≥1M-event burn-in show no leak, corruption, queue/spool drift or SLO breach | Long-duration system test | P0 | 2 qualification runs + probes |
|
||||
| CP-30 | FR-51..53 | Fresh user/operator follows quickstart, upgrade, recovery, alert and incident runbooks in connected and air-gapped profiles | Guided manual + docs executable checks | P1 | 20–35 checks |
|
||||
| CP-31 | FR-54, R-013 | Manifest rejects missing/stale/cross-RC/digest-mismatched/untrusted/revoked evidence and accepts only complete signed RC | Rust/CLI schema and signature tests | P0 | 30–45 |
|
||||
| CP-32 | NFR-C1/C3/C4, AR-31..34 | Dependency direction, MSRV, unsafe/panic rules, wire compatibility, Gitea CI and simultaneous RU/EN strings | Static/contract CI | P1 | 15–25 gates |
|
||||
| CP-33 | UX/accessibility | Loading/error/empty/stale-response states, keyboard/focus/labels, responsive critical screens and safe DOM sinks | Component/Playwright + axe-equivalent | P1 | 30–50 |
|
||||
| CP-34 | Exploratory | Unscripted real OpenAPI/client combinations, operator diagnostics and usability under partial failures | Time-boxed exploratory/manual | P2 | 15–25 charters |
|
||||
|
||||
### NFR coverage and evidence artifacts
|
||||
|
||||
| NFR category | Validation scenarios | Evidence consumed later by `nfr-assess` |
|
||||
|---|---|---|
|
||||
| Security/privacy | CP-03/04/19/25/27/28 plus malicious-network and secret-canary suites | JUnit/JSON results, scanner SARIF, SBOM/signature reports, egress capture, redaction canary report and config digest |
|
||||
| Performance/scalability | CP-14/18/20/21/23/28/29 on the checksummed Reference Workload | Raw request samples/histograms, generator and SUT resource series, Prometheus snapshot, query plans, run metadata and threshold verdict JSON |
|
||||
| Reliability/recovery | CP-02/12/13/14/18/26/29 | State-model coverage, crash schedule/seed, Task invariants, telemetry accounting, upgrade/rollback logs, BackupManifest, measured RPO/RTO and product-probe output |
|
||||
| Observability | CP-16..21 | Trace/ID correlation map, captured redacted envelopes, spool ledger/loss records, metric schema/cardinality report, dashboard/alert test results and overhead differential |
|
||||
| Maintainability/compatibility | CP-01/05/08/11/28/31/32 | Rust/UI coverage, lint/architecture reports, corpus and protocol matrices, browser traces, signed manifest verifier results and regression index |
|
||||
| Release provenance/manual quality | CP-28..31/34 | Content-addressed evidence tree for one RC, signed manifest, manual checklist with zero blocked/not-run, docs execution logs and defect disposition |
|
||||
|
||||
No critical NFR threshold is UNKNOWN. Feature-freeze versions, image digests and implementation tuning values are controlled gate inputs; absence at their freeze point blocks the corresponding qualification run.
|
||||
|
||||
### Execution strategy
|
||||
|
||||
- **PR (target ≤15 minutes, fail fast):** formatting/lints/architecture checks; all changed-crate unit/property tests; targeted PostgreSQL integration; contract/corpus delta; P0 API/MCP smoke; Chromium critical UI smoke; manifest/schema tests. A full small suite may replace selection only while it stays below 15 minutes.
|
||||
- **Nightly:** complete Rust and PostgreSQL/Valkey suites; full OpenAPI corpus; MCP adapters and representative-client matrix; Chromium full UI plus Firefox/WebKit critical paths; security negative suite; production-size dataset smoke; telemetry outage/replay short profile; flaky-test burn-in.
|
||||
- **Weekly:** full browser/client matrices, dependency/container/security scans, high-contention Task chaos, migration/rollback, dashboard/alert integration, performance baseline and 100/250 RPS qualification rehearsal, spool/disk-pressure and backup/restore rotation.
|
||||
- **Release candidate:** immutable RC only; all automated/manual matrices, three restore runs, air-gap fresh/N-1 flows, 72-hour soak, then non-accelerable 30-day burn-in. Any code/config/topology change creates a new RC and restarts freshness-dependent evidence.
|
||||
|
||||
### Resource estimates
|
||||
|
||||
These ranges estimate design and implementation of the automated/manual test capability and qualification assets, not feature development or the unavoidable 30-day wall-clock gate.
|
||||
|
||||
| Priority | Estimated effort |
|
||||
|---|---:|
|
||||
| P0 | ~900–1,400 engineering hours |
|
||||
| P1 | ~300–520 engineering hours |
|
||||
| P2 | ~80–160 engineering hours |
|
||||
| P3 / optional benchmarks | ~30–70 engineering hours |
|
||||
| **Total** | **~1,310–2,150 engineering hours** |
|
||||
|
||||
With 3–4 effective engineers spanning QA automation, Rust/backend, SRE/performance and security, implementation is roughly **12–22 working weeks**, followed/overlapped by the mandatory 30-day burn-in. A single engineer should plan roughly **8–13 person-months**; long-running environments and manual qualification add calendar time but not equivalent active hours.
|
||||
|
||||
### Quality gates
|
||||
|
||||
- P0 pass rate is **100%** on every applicable PR and RC; no quarantine or waiver for mandatory P0 release evidence.
|
||||
- P1 pass rate is **≥95%** for development/nightly signal and **100% for RC scenarios mapped to FR-1..FR-54 or critical user journeys**. Any remaining P1 failure requires explicit non-release classification; it cannot mask an NFR or mandatory capability.
|
||||
- All score-9 risks must be mitigated/closed; every score 6–8 risk needs verified mitigation and no expired waiver. Critical/High security risks cannot be waived for release.
|
||||
- Rust line coverage target is **≥80% workspace-wide**, **≥90% for safety/domain state-machine crates**, with branch/property/mutation evidence on Task, import, auth, admission, redaction and manifest logic. Coverage percentage never substitutes for requirement traceability.
|
||||
- 100% of FRs, NFR categories and ASRs map to planned scenarios and later immutable evidence; no manual item may be blocked or not-run.
|
||||
- OpenAPI corpus has zero silent loss and ≥95% actionable Drafts; all required MCP/client/browser/database/cache matrices pass.
|
||||
- All stated performance, availability, recovery, observability and spool thresholds must have raw machine-readable evidence from the same RC/reference topology.
|
||||
- Full NFR PASS/CONCERNS/FAIL decision is intentionally deferred to `bmad-testarch-nfr` after implementation evidence exists.
|
||||
- Habr/production release gate is fail-closed on missing/stale/cross-RC evidence, invalid signature/schema/digest, any open Critical/High defect or any mandatory SLO failure.
|
||||
|
||||
## Step 5: Final Outputs and Validation
|
||||
|
||||
- **Mode:** System-Level; resolved execution mode: sequential.
|
||||
- **Architecture output:** `_bmad-output/test-artifacts/test-design-architecture.md`.
|
||||
- **QA output:** `_bmad-output/test-artifacts/test-design-qa.md`.
|
||||
- **BMAD handoff:** `_bmad-output/test-artifacts/test-design/crank-handoff.md`.
|
||||
- **Validation:** workflow checklist reviewed; template-required sections, risk IDs R-001..R-015, priority separation, NFR planning boundary, PR/nightly/weekly strategy, ranges, fenced code and placeholders checked. No browser session was opened and no temporary artifact exists outside the test-artifacts tree.
|
||||
- **Open controlled inputs:** feature-freeze MCP revisions and image digests, implementation tuning values, named owners where the repository does not identify a person, and provision of reference/performance/security environments. Missing any of these at its freeze/qualification point is a blocker, not an implicit default.
|
||||
- **Next workflow:** epic-level Test Design or ATDD for the first implementation story; final NFR verdict waits for implementation evidence.
|
||||
|
||||
---
|
||||
|
||||
# Epic-Level Test Design Progress — Epic 1
|
||||
|
||||
## Run 2 / Step 1: Mode and Prerequisites
|
||||
|
||||
- **Mode:** Epic-Level.
|
||||
- **Scope:** Epic 1 — «Надёжный базовый REST → MCP продукт»; выбран первым по утверждённому dependency order.
|
||||
- **Reason:** system-level TD завершён, полный Epic 1 со Story и acceptance criteria доступен в `_bmad-output/planning-artifacts/epics.md`.
|
||||
- **Architecture context:** Architecture Spine, PRD, project context and system-level test-design outputs are available.
|
||||
- **Prerequisite result:** PASS; дополнительных материалов от пользователя не требуется.
|
||||
|
||||
## Run 2 / Step 2: Epic 1 Context and Existing Coverage
|
||||
|
||||
- **Configuration:** Playwright Utils enabled; Pact.js Utils disabled; Pact MCP disabled; browser automation `auto`; detected stack `fullstack`; artifacts root `_bmad-output/test-artifacts`.
|
||||
- **Loaded product scope:** Epic 1 Stories 1.1–1.16 with all acceptance criteria; PRD/Architecture Spine/project context; completed system architecture/QA TD and handoff.
|
||||
- **Epic requirements:** FR-1..FR-6, FR-27, FR-32, FR-33, FR-43, FR-45 and FR-46; inherited security, performance, reliability, observability and compatibility NFRs.
|
||||
- **Integration boundaries:** Community scope validator/docs; typed configuration and process startup; PostgreSQL migration authority; Admin/MCP identity propagation; metric registry; Operation/Agent lifecycle; runtime/REST adapter; DNS/network boundary; Auth Profiles/machine/master keys; Admin auth/session; approvals/idempotency; history/usage/CSV/retention; real MCP onboarding.
|
||||
|
||||
### Existing coverage and reusable patterns
|
||||
|
||||
- `crank-test-support` supplies PostgreSQL 16 Testcontainers and unique schemas; registry, Admin API and MCP suites already use real PostgreSQL.
|
||||
- Existing Admin API integration proves create/test/publish/archive Operations, Agent binding/publish/unpublish/archive, Auth Profile import/rotation, keys/revocation, Logs/Usage and request context.
|
||||
- MCP integration proves published-tool discovery/call, catalog refresh/scope, direct/search behavior, transport negotiation/session, approvals, rate limits, request/trace context and uncertain approval recovery.
|
||||
- Runtime tests cover confirmation single-use, idempotency contention/conflict, fail-closed coordination and uncertain outcomes; REST adapter tests cover private-target defaults, redirects and response size limits.
|
||||
- `crank-metrics`, `crank-observability` and `crank-trace` have contract tests for closed labels, cardinality, redaction, propagation, Prometheus protection, OTLP config and history-loss signals.
|
||||
- Existing Playwright specs cover Operations, Agents, keys, secrets, login, Logs/Usage and observability, but use Chromium only, one worker, retries only in CI and `trace: on-first-retry`.
|
||||
|
||||
### Confirmed coverage gaps
|
||||
|
||||
1. No executable Capability Inventory schema/validator/evidence mapping or frozen exploratory baseline for Story 1.1–1.2.
|
||||
2. No demonstrated single `crank-config` authority covering every process, alias/deprecation conflict, generated docs and boundary scan (1.3).
|
||||
3. Current migration coverage does not yet prove the full append-only checksummed authority, legacy consolidation, concurrent migrator/failure/resume and N/N-1 contract (1.4).
|
||||
4. Correlation tests exist, but the full 100% UI/Admin/MCP/runtime/history contract and hostile header matrix are incomplete (1.5).
|
||||
5. Metrics foundation exists, but million-distinct-value cardinality budget, direct-declaration workspace scan and measured overhead remain to prove (1.6).
|
||||
6. Operation/Agent happy lifecycle exists, while immutable revision conflict/YAML semantic roundtrip/stale UI/cross-scope/production-size discovery cases remain incomplete (1.7/1.13).
|
||||
7. Outbound tests do not yet form the complete DNS-rebinding/actual-connect/IPv4+IPv6/redirect credential stripping/proxy/encoded-host/deadline/concurrency matrix (1.9).
|
||||
8. Auth Profile/key basics exist; one-time UI disclosure persistence, wrong-purpose/cross-scope/cache-loss matrix and master-key epoch/re-encryption/crash/abort/revocation lifecycle are incomplete (1.10–1.11).
|
||||
9. Login/rate-limit coverage exists, but bootstrap race/replay, session fixation, CSRF/Origin/trusted-proxy/TLS, recovery misuse and password-rotation revocation need system proof (1.12).
|
||||
10. Approval coverage is substantial; canonical full-scope fingerprint, conditional races, exact single-use dispatch and store-readiness coupling need explicit real-PG assertions (1.14).
|
||||
11. History/Usage basic flows exist; bounded preview redaction, CSV injection, UTC boundary/no-double-count, retention and 1M-record/≤2s evidence are missing (1.15).
|
||||
12. Getting Started checklist and first-call authoritative/resumable/accessibility flow are not present (1.16).
|
||||
13. Browser suite is not parallel-safe by configuration and does not yet retain trace on first failure; this blocks the eventual fast PR target until per-worker data/ports exist.
|
||||
|
||||
### Knowledge and exploration
|
||||
|
||||
- Applied required epic-level risk governance, probability-impact, test-level, priority and NFR guidance, plus prior system TD.
|
||||
- Contract testing remains relevant for Admin/MCP/runtime boundaries; provider Rust handlers/types are authoritative.
|
||||
- `playwright-cli` is not installed and no bound-browser MCP is configured, so browser exploration was skipped per workflow fallback. No browser session or exploration artifact was created.
|
||||
- **Loaded-input result:** complete; no user-supplied material is missing.
|
||||
|
||||
## Run 2 / Step 3: Epic 1 Risk and NFR Planning
|
||||
|
||||
### Epic 1 risk register
|
||||
|
||||
| ID | Category | Real failure risk | P | I | Score | Mitigation / evidence | Owner | Timeline |
|
||||
|---|---|---|---:|---:|---:|---|---|---|
|
||||
| E1-R-001 | TECH | Capability Inventory/baseline marks gaps or flaky/manual flows as production-ready, allowing regressions to propagate through every later epic. | 3 | 3 | **9** | Strict schema/validator negative matrix, checksum baseline, traceable automated/manual evidence and blocked Critical/High flows. | QA Lead + Release | Stories 1.1–1.2 |
|
||||
| E1-R-002 | OPS | Multiple env readers/defaults diverge across Admin/MCP/worker, causing unsafe or unreproducible startup. | 3 | 3 | **9** | One typed schema, cross-process golden config, alias-conflict/redaction/boundary tests and fingerprint comparison. | Config/Core Lead | Story 1.3 |
|
||||
| E1-R-003 | DATA | Migration authority changes baseline, races, partially applies or prevents N/N-1 recovery. | 2 | 3 | **6** | Fresh/baseline/current/concurrent/failure PG matrix, immutable checksum and expand/migrate/contract fixtures. | Registry Lead | Story 1.4 |
|
||||
| E1-R-004 | OPS | Request/Trace IDs are missing, attacker-controlled, conflated or lost between UI/Admin/MCP/runtime/history. | 2 | 3 | **6** | Boundary contract/property tests plus one real UI/Admin/MCP/upstream/history correlation chain at sampling off/on. | Observability Lead | Story 1.5 |
|
||||
| E1-R-005 | PERF | Dynamic metric labels/cardinality or instrumentation overhead exhausts resources before later observability work. | 2 | 3 | **6** | Compile/API restriction, workspace scan, million-value stress, schema snapshots and overhead baseline. | Metrics Lead | Story 1.6 |
|
||||
| E1-R-006 | DATA | Editing/importing/archiving an Operation mutates published Agent behavior or historical evidence. | 2 | 3 | **6** | Revision/state model, PG conflicts, YAML semantic roundtrip and Agent snapshot regression. | Operation Lead | Story 1.7 |
|
||||
| E1-R-007 | TECH | Admin Test and MCP execute different targets/pipelines or classify the same failure differently. | 3 | 3 | **9** | Table-driven parity contracts for success/all stages, dependency-boundary guardrails and outbound call counters. | Runtime Lead | Story 1.8 |
|
||||
| E1-R-008 | SEC | DNS/redirect/proxy/header/retry bypass enables SSRF, credential forwarding or resource exhaustion. | 3 | 3 | **9** | Hermetic malicious-network matrix against both Admin and MCP paths; actual-connect validation and no-secret outputs. | Security + REST Adapter | Story 1.9 |
|
||||
| E1-R-009 | SEC | Credentials/master-key material leak, wrong-purpose/cross-scope keys work, or rotation makes stored secrets unreadable. | 3 | 3 | **9** | Secret canaries, full credential matrix, ciphertext corruption and crash-resumable epoch rotation with verified revocation. | Security + Registry | Stories 1.10–1.11 |
|
||||
| E1-R-010 | SEC | Remote bootstrap takeover, session fixation, CSRF/proxy spoofing or recovery bypass compromises Admin UI. | 2 | 3 | **6** | Auth state-model/concurrency tests, web-security config matrix, browser flow and local-only recovery proof. | Auth/Security Lead | Story 1.12 |
|
||||
| E1-R-011 | DATA | Agent publication/cache exposes Draft/foreign/stale Tools or changes exact published versions. | 2 | 3 | **6** | Atomic PG publish/conflict, exact-version snapshots, cache-loss differential, scope negatives and dataset discovery test. | Agent/MCP Lead | Story 1.13 |
|
||||
| E1-R-012 | BUS | Approval races/replay/retries produce duplicate or unauthorized side effects or falsely claim exactly-once. | 3 | 3 | **9** | Real-PG concurrency model, single-use admission, scope fingerprint, store-outage and uncertain-dispatch assertions. | Approval/Runtime Lead | Story 1.14 |
|
||||
| E1-R-013 | SEC | History/CSV/UI exposes sensitive data or foreign metadata; aggregation double-counts and large datasets time out. | 2 | 3 | **6** | Redaction/property/cross-scope/CSV injection/UTC boundary/retention tests and 1M-record query plans/UI timings. | History/Admin Lead | Story 1.15 |
|
||||
| E1-R-014 | BUS | Onboarding uses browser flags or test bypass, loses one-time key, duplicates mutations or never proves a real MCP call. | 2 | 2 | 4 | Server-authoritative checklist, real public endpoint E2E, refresh/tab/stale/lost-key/recovery and accessibility/usability run. | Product/UI Lead | Story 1.16 |
|
||||
| E1-R-015 | TECH | Serial, shared-port/state browser tests mask races and cannot meet PR feedback goals. | 2 | 2 | 4 | Per-worker data/ports, API-first fixtures, trace-on-failure, sharding and deterministic burn-in before raising workers. | QA Automation | Epic 1 continuous |
|
||||
|
||||
### NFR planning for Epic 1
|
||||
|
||||
| Category | Applicable threshold / invariant | Planned evidence source | Status |
|
||||
|---|---|---|---|
|
||||
| Security/privacy | Default deny; no foreign metadata; secrets encrypted/non-returnable and absent from logs/traces/metrics/reports/DOM; SSRF policy on every actual connection; no Critical/High findings | Rust/API/MCP security suites, malicious network, secret-canary artifact scan, Playwright auth/key flows, SAST/SCA | Defined; P0 |
|
||||
| Performance/scale | Tool discovery ≤150 ms p95 at 200 Agents/2,000 Operations; Logs/Usage interactive ≤2 s p95 at 1M history records; bounded resource use/cardinality | Criterion/external timing harness, PG plans, browser timings, metric-series/heap/CPU measurements | Defined except exact metric series budget |
|
||||
| Reliability/data | Published Operation/Agent revisions, approvals and config changes durable; migration transactional/checksummed; safety stores fail closed | PostgreSQL contention/failure/restart tests, checksum audit, cache-loss differential and execution call counters | Defined invariants |
|
||||
| Observability | 100% Epic 1 ingress and Execution/history records have separate Request/Trace IDs; bounded labels; no secret payloads | Correlation contract/E2E, persistence queries, metric schema/cardinality and redaction reports | Defined |
|
||||
| Compatibility/maintainability | Rust/MSRV/boundaries unchanged; existing wire behavior retained; new user text RU+EN; regression per defect | `just verify`, boundary/health scripts, wire snapshots, localization/static checks, baseline inventory | Defined |
|
||||
| UX/business | Fresh manual REST path reaches real first MCP call in ≤15 minutes; all async flows expose loading/error/empty/recovery and stale-response protection | Guided usability timing and real-stack Playwright RU/EN/accessibility suite | Defined |
|
||||
|
||||
### Controlled UNKNOWN inputs
|
||||
|
||||
- **Metric cardinality budget:** Story 1.6 says series count stays “in budget” but does not give a numeric maximum. Before Story 1.6 implementation, the Metrics owner must freeze per-process/per-metric series ceilings and measurement window; E1-R-005 remains open until then.
|
||||
- **Session/bootstrap/backoff durations and history retention:** exact values are typed configuration decisions. Tests must validate declared bounds/defaults/precedence and boundary behavior; absence from the schema is a blocker under E1-R-002/E1-R-010/E1-R-013, but values are not guessed here.
|
||||
- **Reference usability sample/protocol:** the ≤15-minute outcome is defined, while participant count and timing procedure must be frozen before Story 1.16 qualification; tracked under E1-R-014.
|
||||
|
||||
### Highest-priority mitigation order
|
||||
|
||||
1. E1-R-001 and E1-R-002 first: truthful baseline and one config contract are prerequisites for meaningful evidence from every later Story.
|
||||
2. E1-R-003/004/005 establish durable schema, identity and metrics before capability state changes.
|
||||
3. E1-R-006/007/008 lock immutable execution semantics and the outbound security boundary before adding credentials and Agents.
|
||||
4. E1-R-009/010 close secret/admin takeover risks before production exposure.
|
||||
5. E1-R-011/012/013 prove catalog, side-effect and diagnostic integrity; E1-R-014 validates first-user value only after those authoritative contracts exist.
|
||||
6. Epic 1 gate is FAIL while any score-9 risk is open; implementation evidence, not existing partial tests, determines mitigation status.
|
||||
|
||||
## Run 2 / Step 4: Epic 1 Coverage and Execution Plan
|
||||
|
||||
### Atomic coverage matrix
|
||||
|
||||
The primary level owns the detailed oracle. E2E validates only cross-boundary user outcomes and does not repeat domain branches.
|
||||
|
||||
| Test group | Story | Atomic scenario / oracle | Primary level | Priority | Risk | New/extended cases |
|
||||
|---|---|---|---|---|---|---:|
|
||||
| E1-01 | 1.1 | Inventory schema accepts every required field/status and rejects duplicate/missing/unknown/broken evidence deterministically | Unit/CLI contract | P0 | E1-R-001 | 15–25 |
|
||||
| E1-02 | 1.1 | Community scope positive/negative matrix includes target capabilities, rejects enterprise markers and explicitly scans untracked inputs | Python/unit + boundary CI | P0 | E1-R-001 | 10–18 |
|
||||
| E1-03 | 1.2 | Inventory maps every existing UI/Admin/MCP flow and never promotes failed/flaky/skipped/manual-only/gap evidence | CLI/integration | P0 | E1-R-001 | 12–20 |
|
||||
| E1-04 | 1.2 | Current REST Operation→test→publish→Agent→key→public MCP call→history passes with safe checksummed evidence | Real-stack API/MCP E2E | P0 | E1-R-001 | 3–6 |
|
||||
| E1-05 | 1.2 | Bounded exploratory RU/EN pass captures loading/empty/error/recovery/stale/unsafe-output gaps with severity/owner | Guided manual/Playwright support | P1 | E1-R-001 | 10–16 charters |
|
||||
| E1-06 | 1.3 | Typed config default/min/max/invalid/cross-field/unknown and alias precedence/conflict are identical across processes | Rust unit/property + app contract | P0 | E1-R-002 | 35–55 |
|
||||
| E1-07 | 1.3 | Generated env/docs/effective fingerprint are stable; diagnostics redact every secret; direct env reads fail boundary scan | Snapshot/static/integration | P0 | E1-R-002 | 18–30 |
|
||||
| E1-08 | 1.4 | Fresh, immutable baseline, sequential current, already-current and checksum mismatch states are deterministic and preserve data | PostgreSQL integration | P0 | E1-R-003 | 18–28 |
|
||||
| E1-09 | 1.4 | Concurrent migrators, failed transaction, incompatible/partial legacy state and bounded resumable backfill fail safely | PostgreSQL contention/fault | P0 | E1-R-003 | 12–20 |
|
||||
| E1-10 | 1.5 | Missing/malformed/oversized/multiple/untrusted IDs create separate UUIDv7 Request ID and valid W3C Trace ID with safe boundary response | Unit/API/MCP contract | P0 | E1-R-004 | 20–32 |
|
||||
| E1-11 | 1.5 | System correlation overrides user mappings and persists through Admin/MCP/runtime/upstream/history for success/auth/retry/failure and sampling-off | Cross-boundary integration/E2E | P0 | E1-R-004 | 10–16 |
|
||||
| E1-12 | 1.6 | Typed metric schema names/types/units/help/labels/buckets snapshot is closed; direct declarations/aliases fail workspace scan | Unit/static contract | P0 | E1-R-005 | 20–30 |
|
||||
| E1-13 | 1.6 | Million distinct hostile values stay inside frozen series budget; exemplars do not alter aggregates; overhead is measured | Stress/benchmark | P0 | E1-R-005 | 8–14 profiles |
|
||||
| E1-14 | 1.7 | Operation state/revision model rejects illegal/stale/cross-workspace mutations and keeps Published Version immutable | Unit/property + PostgreSQL | P0 | E1-R-006 | 30–45 |
|
||||
| E1-15 | 1.7 | Draft test, publish/edit/archive, YAML semantic roundtrip/upsert/conflict/malformed/oversized and history preservation work through Admin API | API/PG integration | P0 | E1-R-006 | 25–40 |
|
||||
| E1-16 | 1.7 | RU/EN lifecycle UI proves stale-response guards, confirmations, safe IDs and minimal immutable-publish/YAML journey | Playwright | P1 | E1-R-006 | 8–14 |
|
||||
| E1-17 | 1.8 | Admin Draft and MCP exact Published snapshot enter one RuntimeExecutionRequest path and make only expected adapter calls | Rust/API/MCP integration | P0 | E1-R-007 | 18–28 |
|
||||
| E1-18 | 1.8 | Success and schema/mapping/auth/persistence/adapter/upstream/runtime/timeout/cancel/uncertain failures have parity in stage/code/retryability/IDs | Table-driven contract | P0 | E1-R-007 | 25–40 |
|
||||
| E1-19 | 1.8 | Architecture checks reject app/runtime/adapter/persistence dependency bypass through alias/re-export/helper | Static boundary tests | P0 | E1-R-007 | 8–14 |
|
||||
| E1-20 | 1.9 | IPv4/IPv6 forbidden classes, encoded/embedded hosts, DNS rebinding and actual retry addresses are blocked before bytes leave | Malicious-network integration | P0 | E1-R-008 | 30–50 |
|
||||
| E1-21 | 1.9 | Redirect hop revalidation/credential stripping, proxy env, reserved headers, byte/deadline/concurrency limits and write retry rules are fail closed | REST adapter + Admin/MCP contract | P0 | E1-R-008 | 30–45 |
|
||||
| E1-22 | 1.10 | Auth Profile/key create/list/get/export/rotate/revoke enforce encryption, one-time disclosure, exact purpose/scope and immediate revocation/cache loss | API/PG/MCP security | P0 | E1-R-009 | 30–50 |
|
||||
| E1-23 | 1.10 | RU/EN key UI does not restore raw secret via refresh/back/DOM/storage/telemetry and requires destructive confirmation | Playwright + artifact canary | P0 | E1-R-009 | 10–16 |
|
||||
| E1-24 | 1.11 | Process fingerprint/epoch readiness, ciphertext version/integrity/corruption and non-secret backup reference behave safely | Rust/PG integration | P0 | E1-R-009 | 20–35 |
|
||||
| E1-25 | 1.11 | Rotation preflight/re-encrypt/checkpoint/crash/resume/verify/promote/abort/old-key revoke is idempotent with concurrent writes | State-machine + PostgreSQL fault | P0 | E1-R-009 | 25–40 |
|
||||
| E1-26 | 1.12 | Bootstrap one-time/race/replay, login constant shape/backoff, session entropy/rotation/expiry/revocation and password change are correct | Rust/API/PG concurrency | P0 | E1-R-010 | 30–50 |
|
||||
| E1-27 | 1.12 | TLS/trusted proxy/spoofed headers/cookies/CSRF/CORS/hostile Origin and local recovery matrix is default deny | API/security integration | P0 | E1-R-010 | 25–40 |
|
||||
| E1-28 | 1.12 | RU/EN browser login/logout/throttle/expiry/recovery states use shared guard and reveal no account/security details | Playwright | P1 | E1-R-010 | 10–16 |
|
||||
| E1-29 | 1.13 | Agent draft/publish transaction, exact bindings/revision, concurrent conflict, pinning/unpublish/archive and stale search result preserve catalog | PostgreSQL + MCP integration | P0 | E1-R-011 | 30–45 |
|
||||
| E1-30 | 1.13 | Cross-Agent/workspace/key scope and cache-loss differential expose no metadata; direct/search discovery ≤150 ms p95 at 200/2k | Security integration + performance | P0 | E1-R-011 | 20–30 + 4 profiles |
|
||||
| E1-31 | 1.13 | RU/EN Agent UI displays exact Draft/Published/revision and handles conflicts/stale responses safely | Playwright | P1 | E1-R-011 | 8–14 |
|
||||
| E1-32 | 1.14 | Canonical full-scope fingerprint deduplicates pending approval; concurrent decision/expiry/recovery permits one legal transition | Rust model + PostgreSQL race | P0 | E1-R-012 | 30–45 |
|
||||
| E1-33 | 1.14 | Approval/key scope/replay/revalidation/store outage/idempotency mismatch and uncertain dispatch never produce duplicate/false exactly-once side effect | Runtime/MCP integration | P0 | E1-R-012 | 25–40 |
|
||||
| E1-34 | 1.14 | RU/EN approval UI has safe summary/IDs, expiry/conflict/stale/confirmation states | Playwright | P1 | E1-R-012 | 8–12 |
|
||||
| E1-35 | 1.15 | History redaction/bounds/UTF-8 marker/persistence-loss metric and cross-scope filters/details are correct | Property + API/PG | P0 | E1-R-013 | 25–40 |
|
||||
| E1-36 | 1.15 | UTC ranges/percentiles/no overlap, CSV formula escaping/limits and retention preserve audit/aggregates/evidence | Unit/API/PG integration | P0 | E1-R-013 | 20–35 |
|
||||
| E1-37 | 1.15 | 1M-record plans and Logs/Usage UI meet ≤2 s p95 with pagination, stale guards and RU/EN states | Performance + Playwright | P0 | E1-R-013 | 6 profiles + 8–12 |
|
||||
| E1-38 | 1.16 | Server-authoritative checklist derives each step, survives refresh/workspace/tab/revision changes and never duplicates publish/key creation | API/component/Playwright | P1 | E1-R-014 | 18–30 |
|
||||
| E1-39 | 1.16 | Fresh user reaches first real public MCP call ≤15 min; lost/revoked key and validation/auth/upstream failure recover safely | Real-stack Playwright + guided usability | P1 | E1-R-014 | 8–14 + usability sample |
|
||||
| E1-40 | 1.16 | Keyboard/focus/screen-reader/reduced-motion, RU/EN and bounded ProductEvent denominators/opt-in pass | Accessibility/component/API | P1 | E1-R-014 | 15–25 |
|
||||
| E1-41 | All | Existing test fixtures are deterministic, isolated and traceable; selected Playwright suites pass repeated burn-in without order/state dependence | Test-quality audit/burn-in | P1 | E1-R-015 | 8–12 harness checks |
|
||||
|
||||
### NFR evidence artifacts
|
||||
|
||||
| Category | Coverage groups | Evidence for later NFR assessment |
|
||||
|---|---|---|
|
||||
| Security/privacy | E1-10/11, E1-20..28, E1-30, E1-32..37 | JUnit/JSON, malicious-network capture, secret-canary scan, web-security matrix, SAST/SCA and browser traces |
|
||||
| Performance/scale | E1-13, E1-30, E1-37 | Metric-series/CPU/memory report, raw discovery/UI timings, PG query plans and checksummed dataset/topology |
|
||||
| Reliability/data | E1-08/09, E1-14/15, E1-24/25, E1-29, E1-32/33/35/36 | Migration/checksum logs, state-model/concurrency seeds, call counters, ciphertext/rotation audit and cache-loss differential |
|
||||
| Observability | E1-10..13, E1-18, E1-35 | Correlation map, persistence queries, trace capture, metric schema/cardinality and redaction/history-loss reports |
|
||||
| Compatibility/maintainability | E1-01..07, E1-19, E1-41 | Inventory/boundary/`just verify` results, wire/config snapshots, test-quality and flake report |
|
||||
| UX/business | E1-05/16/23/28/31/34/37..40 | Playwright traces/screens, accessibility report, RU/EN coverage and timed usability protocol/results |
|
||||
|
||||
### Execution strategy
|
||||
|
||||
- **PR, target ≤15 minutes:** all changed-crate unit/property/static tests; targeted real-PG/API/MCP integration; inventory/scope/config/boundary contracts; changed Playwright spec plus shared auth/API smoke. Run all functional coverage when it remains within the target; otherwise select by changed contract and always include its P0 boundary cases.
|
||||
- **Nightly:** full Epic 1 Rust/PG/Valkey/Admin/MCP suites, all current Chromium Playwright, full security negative subset, correlation chain, million-value cardinality stress, migration/rotation/approval contention and repeated flake burn-in.
|
||||
- **Weekly:** malicious-network matrix, production-size 200/2k/1M performance profiles, browser security configuration matrix, master-key crash/recovery, fresh-user guided usability/accessibility and full exploratory baseline refresh where changes require it.
|
||||
- **Epic qualification:** all 1.1–1.16 acceptance criteria traced; complete Inventory and manual checklist; all P0/P1 evidence bound to one Epic candidate digest. Full product RC soak/burn-in remains Epic 8, not duplicated here.
|
||||
|
||||
### Incremental resource estimate
|
||||
|
||||
Estimate covers closing Epic 1 test gaps and integrating evidence, reusing existing suites. It excludes feature implementation and later full-product qualification.
|
||||
|
||||
| Priority | Effort range |
|
||||
|---|---:|
|
||||
| P0 | ~420–700 engineering hours |
|
||||
| P1 | ~180–320 engineering hours |
|
||||
| P2 exploratory extensions | ~40–90 engineering hours |
|
||||
| P3 optional benchmarks | ~15–40 engineering hours |
|
||||
| **Total** | **~655–1,150 engineering hours** |
|
||||
|
||||
For 2–3 effective contributors across Rust/security/SRE/QA, this is approximately **7–14 working weeks**, overlapped with Story implementation.
|
||||
|
||||
### Epic 1 quality gates
|
||||
|
||||
- P0 = **100%**; P1 ≥**95%** during development and **100% for Story acceptance/epic qualification**.
|
||||
- Every Story 1.1–1.16 has bidirectional requirement→test→evidence mapping; no acceptance criterion is silently manual or skipped.
|
||||
- E1-R-001/002/007/008/009/012 (score 9) are closed by evidence; all score 6 risks have verified mitigation/owner.
|
||||
- No Critical/High defect or security finding; secret-canary and scope-isolation scans are clean.
|
||||
- Workspace coverage remains ≥80%, and newly introduced critical state/security/config/migration code targets ≥90% branch/contract evidence; coverage cannot replace traceability.
|
||||
- Catalog discovery and Logs/Usage thresholds pass on checksummed production-size datasets; metric budget is frozen and passed before Story 1.6 closes.
|
||||
- Existing REST→MCP baseline remains green, and no toolchain/dependency/wire change is mixed into the Epic without its own compatibility change.
|
||||
- Final NFR PASS/CONCERNS/FAIL remains deferred to the NFR assessment after implementation evidence exists.
|
||||
|
||||
## Run 2 / Step 5: Epic 1 Output and Validation
|
||||
|
||||
- **Mode:** Epic-Level; Epic 1; single-worker sequential output as required for epic-level mode.
|
||||
- **Output:** `_bmad-output/test-artifacts/test-design-epic-1.md`.
|
||||
- **Validation:** template/checklist sections, E1-R-001..E1-R-015, E1-01..E1-41, priorities, NFR planning boundary, estimates, quality gates, placeholders and Markdown structure checked.
|
||||
- **Browser hygiene:** Playwright CLI was unavailable, no browser session was opened, and no temporary exploration artifact was created.
|
||||
- **Open controlled inputs:** numeric metric series budget, typed security/retention configuration values and Story 1.16 usability protocol must be frozen by their owning Story; no values were guessed.
|
||||
- **Recommended next workflow:** ATDD for Story 1.1, followed by its implementation; Epic-level trace/NFR verdict waits for implementation evidence.
|
||||
@@ -0,0 +1,295 @@
|
||||
---
|
||||
workflowStatus: 'completed'
|
||||
totalSteps: 5
|
||||
stepsCompleted: ['step-01-detect-mode', 'step-02-load-context', 'step-03-risk-and-testability', 'step-04-coverage-plan', 'step-05-generate-output']
|
||||
lastStep: 'step-05-generate-output'
|
||||
nextStep: ''
|
||||
lastSaved: '2026-09-13'
|
||||
lastEdited: '2026-09-13'
|
||||
editScope: 'system-level inventory and evidence-aware strategy refresh'
|
||||
auditedRevision: '083974c27f3a21a15807dd248bb6bc4fe04a5cd8'
|
||||
workflowType: 'testarch-test-design'
|
||||
inputDocuments:
|
||||
- '_bmad-output/test-artifacts/test-design-architecture.md'
|
||||
- '_bmad-output/planning-artifacts/epics.md'
|
||||
---
|
||||
|
||||
# Test Design for QA: Crank Community Production Readiness
|
||||
|
||||
**Purpose:** Execution recipe for proving Crank Community production readiness. Architectural requirements and production-code mitigations are in `test-design-architecture.md`.
|
||||
|
||||
**Date:** 2026-09-13 (original design: 2026-08-08)
|
||||
**Author:** BMad TEA / Bsodfather
|
||||
**Status:** System-level design updated; current evidence inventory precedes epic-level planning
|
||||
**Project:** crank
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Scope covers all 54 FRs, 30 NFRs and the eight production-readiness epics. There are 15 risks: 14 high (five score 9), one medium and none low. Dominant categories are operations, security, technical/concurrency, data integrity and performance.
|
||||
|
||||
The plan retains 34 scenario families, not a promise to write 850–1,250 additional tests. Existing tests must be reused. P0 denotes a security/data-integrity/core-operation failure with no safe workaround; ordinary feature variants are P1, not automatically P0. E2E checks cross-boundary outcomes rather than repeating parser or state-machine branch tests.
|
||||
|
||||
Audit boundary: main `083974c27f3a21a15807dd248bb6bc4fe04a5cd8`. Story 2.9 candidate `f8ee7c9bfeaa8a3f73a4850ff3f82b2bc2155fe8` is recorded separately and is not integrated into main. This update is a source/configuration audit, not a fresh product test run.
|
||||
|
||||
## Not in Scope
|
||||
|
||||
| Item | Reason | Mitigation |
|
||||
|---|---|---|
|
||||
| HA/multi-instance rolling upgrade | Explicit post-launch scope | Document single-instance claim and reject HA evidence claims |
|
||||
| S3-compatible artifacts, SSO/RBAC, non-REST adapters | Deferred by architecture | Preserve ports/invariants; revisit in later test design |
|
||||
| Arbitrary distributed load targets or loads above built-in ceilings | Unsafe/outside Community goal | Load runner allowlists only Crank MCP and enforces signed ceilings |
|
||||
| MCP revisions published after feature freeze | Unbounded moving target | Enter next adapter/compatibility cycle |
|
||||
|
||||
## Dependencies and Test Blockers
|
||||
|
||||
### Backend/architecture dependencies
|
||||
|
||||
1. **B-001 deterministic control plane:** typed factories/builders, scoped cleanup, controllable time/IDs/scheduler.
|
||||
2. **B-002 named fault injection:** network, stores, worker, telemetry and disk failure controls.
|
||||
3. **B-003 queryable observability sinks:** captured trace/envelope/metric/dashboard state searchable by IDs.
|
||||
4. **B-004 evidence contract:** stable artifact schemas and RC provenance collectors.
|
||||
5. **B-005 measurable load runner:** calibrated stub/external generator, separate resource metrics and reliable kill path.
|
||||
|
||||
### QA infrastructure setup
|
||||
|
||||
- Extend `crank-test-support` with PostgreSQL 16/Valkey/telemetry/malicious-upstream fixtures and per-worker schemas.
|
||||
- Provide seeded production-size and minimal datasets with deterministic seeds and automatic cleanup.
|
||||
- Create MCP protocol/client matrix harness, OpenAPI corpus runner, browser storage-state fixtures and artifact collectors.
|
||||
- Provision PR ephemeral dependencies, nightly full topology, weekly reference hardware/air-gap lab and immutable RC qualification environment.
|
||||
- Retain JUnit/JSON, Playwright traces, raw metrics, logs and content-addressed evidence under `_bmad-output/test-artifacts/` or the release evidence store.
|
||||
|
||||
### Actual Tooling vs Configuration
|
||||
|
||||
`tea_use_playwright_utils=true` and `tea_use_pactjs_utils=true` are workflow preferences, not installed dependencies. The UI package currently contains `@playwright/test` 1.61.1 and esbuild; neither Utils nor Pact is installed. This design does not install or mandate a wholesale test rewrite. Retain working fixtures; evaluate additional tooling only for an identified gap.
|
||||
|
||||
### Existing Test Inventory
|
||||
|
||||
Presence below means inspected test source, not current pass or a coverage percentage.
|
||||
|
||||
| Surface / FR | Representative existing source | What it exercises | Missing qualification / next evidence |
|
||||
|---|---|---|---|
|
||||
| Config, FR-45 | `crates/crank-config/tests/{contract,generation,redaction}.rs`; app `tests/config_startup.rs` | Config bounds, deterministic contracts, read-only startup, safe failures | Production-profile matrix on a bound artifact |
|
||||
| Auth/secrets, FR-3/5 | `apps/admin-api/tests/integration/{auth_rate_limit,credential_lifecycle,secrets_import_auth}.rs`; runtime `tests/integration/{confirmation,idempotency}.rs` | CSRF/origin/rate-limit, lifecycle, encrypted credentials, approval/idempotency | Whole web-security and deployed secret-canary matrix |
|
||||
| Operation/Agent lifecycle, FR-1/4/6 | Admin `tests/integration/{operation_lifecycle,operations_agents}.rs`; registry `tests/integration/operations_artifacts.rs` | Versions, publish, concurrency, immutable snapshots, history | Same-revision UI→API→MCP proof and complete manual pass |
|
||||
| REST runtime, FR-2 | `crates/crank-runtime/tests/stages.rs`; adapter `tests/integration/{client,outbound_security}.rs` | Validation, retries/deadlines, SSRF/proxy/DNS, bounded execution | Calibrated performance and deployed network-fault profiles |
|
||||
| OpenAPI, FR-7..12 | `crates/crank-import/tests/{preview,coverage,normalization_details,reference_resolution}.rs`; Admin `tests/integration/openapi_import.rs` and `openapi_import/external_references.rs` | Parser/IR/ref limits, provenance, preview/apply/replay, atomicity | ≥50-spec independent oracle corpus, remaining security/re-import semantics; candidate 2.9 tracked separately |
|
||||
| Artifacts / recovery foundations | `crates/crank-artifacts/tests/{artifact_store,artifact_store_io,reconciliation}.rs`; registry migration tests | Digest integrity, symlink protection, crash/disk-full, reconciliation, schema drift/rollback | Full deployment restore with DB/artifacts/keys and measured RPO/RTO |
|
||||
| MCP Tools, FR-13/14/20 | MCP app `tests/integration/{transport_protocol,catalog_access,tool_search}.rs`; `crates/crank-community-mcp/tests/` | JSON/SSE sessions, list/call, scope/revocation, stale catalog | Frozen revision matrix and ≥3 actual clients |
|
||||
| Resources/Prompts/Tasks, FR-15..19/21..26 | Capability inventory marks planned flows | No implemented feature-level suite found | Model/contract tests plus public MCP/UI outcomes after features exist; internal tokio tasks are not MCP Tasks |
|
||||
| Correlation / metrics, FR-27..35 | `crates/crank-observability/tests/`; app `tests/{request_context,product_metrics}.rs`; `crates/crank-metrics/tests/` | Local IDs, propagation, captured OTLP, redaction, metric contracts | Actual GlitchTip delivery/spool truth; browser correlation; Grafana/alerts; full overhead workload |
|
||||
| Load Runs, FR-36..40 | Local metric overhead and concurrency probes only | Narrow budgets, not a built-in load capability | Bounded runner, external calibration, safe stop and report accuracy |
|
||||
| Browser | `apps/ui/tests/e2e/`, `playwright.config.js` | 56 discovered tests in 13 files; selected RU/EN and mobile viewport cases | Firefox/WebKit; complete locale/critical-viewport matrix; isolation before parallelism |
|
||||
| CI / tooling, FR-46/50 | `tests/unit/`, `justfile`, `.gitea/workflows/{ci,release}.yml` | 138 Python test methods; Rust/UI guards, dependency checks, image smoke, scan/evidence collectors | Coverage reports, scheduled long-run lanes, full release evidence and retention policy |
|
||||
|
||||
Rust inventory method: `git ls-tree -r --name-only HEAD -- apps crates` filtered for `/tests/.*\\.rs$` or `/src/.*_tests\\.rs$` yields 116 files. `git grep -h -E '#\\[(tokio::test|test)' HEAD -- apps crates | wc -l` yields 768 attributes (including inline tests). These static counts are not executed cases or line/branch coverage.
|
||||
|
||||
Playwright discovery was actually run: `./node_modules/.bin/playwright test --list --reporter=line` → 56 tests / 13 files, exit 0. No browsers or product services were started by this command. Real-stack scenarios include `onboarding.spec.js` public tools/call and OpenAPI upload; many failure/race UI tests use `page.route` and prove browser handling only. A local controlled upstream is appropriate for deterministic wire assertions, but does not qualify arbitrary external APIs.
|
||||
|
||||
### Available Execution Evidence and Exclusions
|
||||
|
||||
- Historical baseline `docs/capability-baseline/results.json` (`2026.08.24.1`) contains revision-bound accepted runs, historical failures and a not-run manual item. Do not transplant its verdicts to current main; validate the baseline as a historical contract only.
|
||||
- Candidate 2.9 has a prior successful full `just verify`, documented in `_bmad-output/implementation-artifacts/spec-2-9-http-contract.md`; local log `/tmp/crank-24-verify-final-gate.log` is non-durable supporting evidence. It includes admin integration 81 and MCP integration 40 passes. It does not prove browser E2E, deployment or public readiness.
|
||||
- Its review also leaves two explicitly deferred pre-existing cases: undeclared URL placeholders and composite object/array defaults. Preserve them in the future corpus/gap triage; a green candidate gate does not close these cases.
|
||||
- `crates/crank-registry/tests/integration/observability.rs` has ignored `production_size_invocation_history_queries_stay_bounded`, inserting 1,000,000 rows. Standard workspace tests do not execute it; it belongs in an explicitly provisioned performance lane.
|
||||
- No measured workspace line/branch coverage report was found. The existing ≥80%/≥90% targets below remain design targets, not observed values.
|
||||
- Presence of restore scripts, manual checklists or SLO thresholds is not evidence that restores, manual qualification, 72-hour soak or 30-day burn-in passed.
|
||||
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
| Risk | Score | QA coverage |
|
||||
|---|---:|---|
|
||||
| R-001 brownfield regressions | **9** | CP-01..04 characterization/manual baseline |
|
||||
| R-002 OpenAPI semantic loss | **9** | CP-05..07 corpus, API and representative UI |
|
||||
| R-003 Task duplicate/stale writes | **9** | CP-12..15 model, PG contention, chaos and MCP E2E |
|
||||
| R-004 SSRF/secret leakage | **9** | CP-03/04/19/25/27 plus malicious-network/canary scans |
|
||||
| R-005 trace spool/replay false claims | **6** | CP-16..18 outage/replay and golden correlation |
|
||||
| R-006 SLO breach under contention | **9** | CP-14/18/20/23/29 calibrated performance |
|
||||
| R-007 admin/session/recovery auth | **6** | CP-25 web-security state/config matrix |
|
||||
| R-008 inconsistent upgrade/restore | **6** | CP-26 three restores and N/N-1 workflows |
|
||||
| R-009 MCP catalog/client inconsistency | **6** | CP-08..11 protocol and real-client matrix |
|
||||
| R-010 unsafe/uncontrollable Load Run | **6** | CP-22..24 authorization/kill/UI tests |
|
||||
| R-011 metric double count/cardinality | **6** | CP-19..21 registry/differential/dashboard tests |
|
||||
| R-013 mixed/stale evidence | **6** | CP-28..31 manifest negative matrix |
|
||||
| R-014 untrusted/leaky offline bundle | **6** | CP-27 supply-chain and air-gap capture |
|
||||
| R-015 late soak defect | **6** | CP-29 early trends + 72 h/30 d qualification |
|
||||
| R-012 flaky E2E | 4 | Parallel-safety burn-in, trace-on-failure and quality lint |
|
||||
|
||||
## NFR Test Coverage Plan
|
||||
|
||||
| Category | Requirement / threshold | Planned validation | Tool / level | Evidence artifact | Priority |
|
||||
|---|---|---|---|---|---|
|
||||
| Security/privacy | Default deny, encrypted/no-leak secrets, per-connection SSRF, no Critical/High, opt-in egress | Auth/config abuse, malicious DNS/redirect/proxy, secret canaries, supply-chain scans | Rust/API/Playwright + SAST/SCA/SBOM | SARIF/JUnit, SBOM/signature, canary and egress reports | P0 |
|
||||
| Performance/scale | 100 RPS/30 m, 250 RPS/5 m, ≥99.95%, reject ≤0.1%, 128/10k, overhead 50/150 ms | Calibrated built-in/external load, contention, production dataset and telemetry differential | External load tool + built-in runner + Prometheus | Raw samples, SUT/generator resource series, plans, verdict JSON | P0 |
|
||||
| Reliability/recovery | drain ≤30 s, Task start ≤5 s p95, lease recovery ≤60 s, RPO≤5 m/RTO≤30 m | Crash schedules, restart/drain, N/N-1, three PITR restores, 72 h/30 d | PG integration/chaos/recovery/soak | State invariants, manifests, probe logs and time series | P0 |
|
||||
| Observability | 100% IDs/traces, delivery ≥99.99%/60 s, completeness 100%/25 h, 30 h spool, overhead limits | Golden correlation, outage/replay/corruption/disk, metrics/cardinality/dashboard/alerts | API/MCP/Playwright + captured telemetry + Prom/Grafana | Correlation graph, envelopes, loss ledger, dashboard tests | P0 |
|
||||
| Compatibility | MCP stable/N-1/N-2, ≥3 clients; OpenAPI ≥50/≥95%/zero silent loss; browser/PG/Valkey matrices | Corpus, protocol/clients, browser and dependency matrices | Rust corpus/protocol/CI matrix | Machine-readable matrices and raw failures | P0 |
|
||||
| Maintainability/provenance | ≥80% overall, ≥90% critical crates; immutable one-RC evidence; RU/EN | Coverage/lint/architecture/wire/localization and manifest negative tests | CI/static/contract | Coverage, lint and signed manifest reports | P1/P0 manifest |
|
||||
|
||||
Threshold source is PRD §5/§10; exact client/revision/image selections are freeze inputs, not guessed current versions. Missing evidence sources: reference performance host, calibrated generator, durable report storage, GlitchTip/Prometheus/Grafana test topology, recovery/air-gap environment and release signing trust.
|
||||
|
||||
Measure steady and burst acceptance per minute (NFR-P1a/P1b), not only whole-run averages. Use PRD SLI denominators for handled upstream/client errors, product failures, saturation and missing probes. Run the required workload three consecutive times and retain raw inputs/config/resource series. Measure platform overhead separately from the controlled upstream delay. A million-row query-plan test alone cannot prove the mixed 100/250 RPS workload or UI p95.
|
||||
|
||||
## Entry Criteria
|
||||
|
||||
- Requirements/architecture/epics are versioned and the selected story has ATDD-ready acceptance criteria.
|
||||
- Applicable B-001..B-005 seams are implemented and production-disabled where required.
|
||||
- Test environment, deterministic factories, cleanup and artifact retention are operational.
|
||||
- Feature is deployed with exact code/config/topology digest and migrations compatible with the test matrix.
|
||||
- Test oracle (corpus expected result, protocol version, SLO formula or recovery checkpoint) is frozen.
|
||||
|
||||
## Exit Criteria
|
||||
|
||||
- P0 = 100%; development P1 ≥95%; RC P1 mapped to mandatory FR/critical journeys = 100%.
|
||||
- No open Critical/High defect, security finding or score-9 risk; score 6–8 mitigations have evidence.
|
||||
- Workspace coverage ≥80% and critical state/security crates ≥90%, without requirement gaps.
|
||||
- All required corpus/client/browser/store matrices and manual checks pass; no manual item blocked/not-run.
|
||||
- Every NFR has same-RC raw evidence and later NFR assessment; all numerical thresholds pass.
|
||||
- Signed manifest validates and binds the exact published RC, config, topology and artifacts.
|
||||
|
||||
## Test Coverage Plan
|
||||
|
||||
P0/P1/P2/P3 indicate priority, **not execution timing**. The table is the corrected current system mapping; older CP mappings in the historical progress/handoff files are not authoritative. Each family will be decomposed only when its epic is planned. “Partial” means some source exists, not that the complete FR passes.
|
||||
|
||||
### P0 — Critical
|
||||
|
||||
Security, data integrity and core-operation invariants without a safe workaround. Negative subcases of P1 families are P0 where stated.
|
||||
|
||||
### P1 — High
|
||||
|
||||
Required feature variants, compatibility and operator outcomes with material reach. Mandatory release requirements still require 100% accepted evidence even when P1.
|
||||
|
||||
### P2 — Medium
|
||||
|
||||
Supplementary exploratory cases with an acceptable workaround; they do not replace the mandatory manual regression pass.
|
||||
|
||||
### P3 — Low
|
||||
|
||||
Optional cosmetic/experimental probes only; not mandatory release evidence.
|
||||
|
||||
| ID | Requirement | Priority | Primary level | Risk | Required oracle / outcome | Main inventory |
|
||||
|---|---|---|---|---|---|---|
|
||||
| CP-01 | FR-1..6 | P0 | API + golden UI/MCP | R-001/R-004 | Create→test→publish→call→history; exact result and safe failure | Partial |
|
||||
| CP-02 | FR-1/4/43/45 | P0 | Unit + PG | R-001/R-008 | Immutable versions, atomic publish, compatible migration and config | Partial |
|
||||
| CP-03 | FR-5; NFR-S1/S7 | P0 | State/PG + boundary | R-004 | Approval/idempotency cannot duplicate effects or fail open | Partial |
|
||||
| CP-04 | FR-3; NFR-S2 | P0 | API/PG + canary | R-004 | Create/use/rotate/revoke; no plaintext in output channels | Partial |
|
||||
| CP-05 | FR-7/8/9/10/12 | P0 | Pure corpus + wire contract | R-002 | Canonical parse/replay; exact blockers; no silent semantic loss | Partial; 2.9 candidate separate |
|
||||
| CP-06 | FR-7/11 | P0 | API/PG | R-002 | Preview no mutation; scoped, atomic, idempotent apply; re-import conflicts | Partial |
|
||||
| CP-07 | FR-7..12 | P1 | Playwright real stack | R-002 | Upload→findings→selection→draft→publish; cancellation/recovery | Partial |
|
||||
| CP-08 | FR-13/14/19 | P1 | MCP protocol | R-009 | Negotiation, Tools schema/results, pagination and notifications | Partial |
|
||||
| CP-09 | FR-15/16 | P1 | Unit/API + public MCP | R-009/R-004 | Static/dynamic resources, templates, pinned read-safe operation; negative access P0 | Planned |
|
||||
| CP-10 | FR-17/18/19 | P1 | Unit/API + public MCP | R-009/R-004 | Prompt arguments/render/DAG/completion; forbidden side effects P0 | Planned |
|
||||
| CP-11 | FR-20; NFR-C2 | P1 | Actual-client matrix | R-009 | ≥3 clients × frozen stable/N-1/N-2; identical versioned semantics | Gap |
|
||||
| CP-12 | FR-21/22 | P0 | Model/property | R-003 | Only legal Task states; immutable terminal result and pinned versions | Planned |
|
||||
| CP-13 | FR-23/25 | P0 | PG crash/concurrency | R-003 | Enqueue/claim/fencing/retry/cancel; no stale writes or false exactly-once claim | Planned |
|
||||
| CP-14 | FR-24; NFR-P2/R5 | P0 | Controlled load | R-003/R-006 | 128 active/10k queued; bounded wait/fairness and ≤60s recovery | Planned |
|
||||
| CP-15 | FR-21..26 | P1 | Public MCP + UI | R-003/R-009 | Observe/cancel/resume through disconnect/restart and supported fallback | Planned |
|
||||
| CP-16 | FR-27/30; NFR-O1/O5 | P0 | Contract/API | R-005/R-004 | Request/trace identities survive boundaries; redaction and invalid-input replacement | Partial |
|
||||
| CP-17 | FR-28/29/30 | P1 | Browser→MCP→receiver | R-005 | Search/copy/deep-link actual delivered trace; missing/lost is never shown as delivered | Gap |
|
||||
| CP-18 | FR-29/31; NFR-O2/O2a/O3 | P0 | Telemetry fault/capacity | R-005/R-006 | Outage/restart/replay/disk corruption; delivery/loss and resource budgets | Gap |
|
||||
| CP-19 | FR-32; NFR-O4 | P0 | Unit/contract | R-011 | Names/units/buckets/labels bounded; no user identifiers as labels | Partial |
|
||||
| CP-20 | FR-33 | P0 | PG differential | R-011 | UTC DAU/usage events and rollups agree; replay cannot double count | Partial |
|
||||
| CP-21 | FR-34/35 | P1 | Prometheus/Grafana integration | R-011 | Provision dashboards/rules; known synthetic series trigger correct SLO alerts | Gap |
|
||||
| CP-22 | FR-36/37/38/39 | P0 | API/state/security | R-010 | Validate target/auth/ceilings; reserve stop path; reject scope escape | Planned |
|
||||
| CP-23 | FR-40; NFR-P1/P4 | P1 | Calibrated performance | R-006 | Report classifications/percentiles match external generator at reference workload | Planned |
|
||||
| CP-24 | FR-36..40 | P1 | Playwright real stack | R-010 | RPS/DAU configuration→launch→live statistics→stop→report | Planned |
|
||||
| CP-25 | FR-41/42/44/45 | P0 | API/browser security | R-007/R-004 | Bootstrap/session/recovery, TLS/proxy/cookie/CSRF/CORS/default-deny matrix | Partial |
|
||||
| CP-26 | FR-43 | P0 | Deployment/restore | R-008 | Fresh/N-1/rollback + 3 PITR restores; real encrypted-auth MCP probe | Partial foundations |
|
||||
| CP-27 | FR-42/44/50 | P0 | Supply-chain/air-gap | R-014 | Trusted pinned bundle/SBOM; zero undeclared egress and Critical/High findings | Partial scans |
|
||||
| CP-28 | FR-46/48/50 | P1 | CI matrix | R-001/R-009 | Required suites, browsers, clients, PG/cache modes; retain failures too | Partial |
|
||||
| CP-29 | FR-49 | P0 | Soak/recovery | R-006/R-015 | 72h then supervised 30-day qualification on immutable RC, no loss/drift | Gap |
|
||||
| CP-30 | FR-47/51/52/53 | P1 | Guided manual/docs | R-001/R-008 | Operator can follow runbooks; readiness page reflects evidence, not promises | Partial docs; qualification missing |
|
||||
| CP-31 | FR-54 | P0 | Manifest negative contract | R-013 | Reject missing/stale/mixed/untrusted evidence; FR-54 cannot prove itself | Partial collectors only |
|
||||
| CP-32 | NFR-C1/C3/C4 | P1 | Static/contract | R-001/R-012 | Dependency/MSRV/wire rules; simultaneous RU/EN; coverage report | Partial |
|
||||
| CP-33 | UI across FR-1..53 | P1 | Component/browser | R-012 | Loading/empty/error/stale states; keyboard/focus/viewport; no hidden controls | Partial |
|
||||
| CP-34 | FR-47/51 | P2 | Time-boxed exploratory | R-001/R-002 | Real-spec/operator/client combinations beyond deterministic corpus | Not evidenced |
|
||||
|
||||
This is family-level traceability, not a measured AC-to-test coverage matrix. Use the lowest effective test for exhaustive variants, then one representative cross-boundary success and failure for each critical journey. Retain explicit negative cases for authorization, secret leakage, corruption, concurrent mutation, cancellation and limits. Do not generate duplicate E2E tests for every unit-level combination.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
Current reality: Gitea runs full functional Rust tests, UI build/audit, Chromium E2E and image smoke on configured PR/push paths; release adds artifact/scanning steps. `just verify` does **not** run UI E2E, Docker image smoke or deployment. Playwright currently uses one worker and CI retry=1, not sharding. No scheduled nightly/weekly workflows or measured coverage gate were found.
|
||||
|
||||
Target: run functional regression in PRs; move only explicitly expensive load/chaos/long-run qualification to provisioned lanes. The 10–15-minute feedback target below is aspirational, not measured. Do not weaken assertions, omit a failing test or increase timeouts merely to meet it.
|
||||
|
||||
- **Every PR (10–15 min feedback target, not a current duration claim):** existing full functional Rust/PG suite, format/lint/boundaries, dependency/UI build checks, Chromium E2E, contract/evidence validation and applicable image smoke. Keep selected local tests for fast iteration, not as a substitute for the integration gate. Parallelism requires isolation evidence first.
|
||||
- **Nightly (duration to measure after provisioning):** expanded browser/client/cache matrices, production-size history, bounded contention, telemetry outage/replay and repeat-run flake detection. Ordinary functional failures must not be moved here merely to unblock PRs.
|
||||
- **Weekly (hours):** full browser/client matrices, scans, Task contention/chaos, upgrade/rollback, dashboard/alerts, 100/250 RPS rehearsal, spool/disk pressure and backup/restore rotation.
|
||||
- **RC:** exact immutable artifact; all matrices/manual work, three restores, air-gap flows, 72-hour soak and then non-accelerable 30-day/≥1M-event burn-in. Any digest-changing fix creates a new RC.
|
||||
|
||||
Before enabling Playwright sharding, prove per-worker data/ports/storage/session isolation; the existing single-worker setting stays until that evidence exists. Current traces are `on-first-retry`; screenshots/videos retain failures. A retry pass is flaky evidence, not a clean pass: existing OpenAPI accepted-run collection already rejects flaky/missing required cases.
|
||||
|
||||
Before integration: targeted regression → affected subsystem → full Rust gate plus affected UI/deploy gate. Reuse a completed gate only for the identical source tree and relevant environment; record subsequent documentation-only changes. Capture subprocess fault tests through pipes (not direct regular-file stdout under RLIMIT_FSIZE). Keep a bounded log and the complete machine-readable outcome so failed attempts remain diagnosable.
|
||||
|
||||
Provision explicitly for expensive probes: PostgreSQL16 and disk headroom for the million-row test; a PRD reference host for load; isolated backup/restore destinations and keys; test-only telemetry sinks; no production endpoints or customer secrets. Scheduled execution and provisioning are follow-up implementation work, not changes made by this design.
|
||||
|
||||
## QA Effort Estimate
|
||||
|
||||
The August estimate (~42–71 engineer-weeks, ~850–1,250 cases) predates the inventory and is **not a forecast of remaining work**. Remaining automation effort is UNKNOWN until each family separates reusable tests from missing assertions and unavailable product features. No new test-count quota is introduced.
|
||||
|
||||
Estimate each epic delta as a range after system-design acceptance, based on fixture reuse and actual test durations; exclude production-feature implementation and infrastructure operations from QA effort. The 30-day burn-in is a PRD calendar constraint, not 30 days of full-time test-authoring effort.
|
||||
|
||||
## Implementation Planning Handoff
|
||||
|
||||
| Work item | Owner | Target | Dependencies |
|
||||
|---|---|---|---|
|
||||
| Deterministic fixtures/factories and per-worker cleanup | QA + Core | Epic 1 | B-001 |
|
||||
| OpenAPI corpus oracle/runner | Import + QA | Epic 2 | Stable IR/findings |
|
||||
| MCP protocol/representative-client harness | MCP + QA | Epic 3 | Version adapters |
|
||||
| Task model/PG chaos harness | Task + QA/SRE | Epic 4 | B-001/B-002 |
|
||||
| Telemetry/metrics capture and assertions | Observability + QA | Epic 5 | B-003 |
|
||||
| Calibrated load and reference topology | Performance/SRE | Epic 6 | B-005 |
|
||||
| Upgrade/restore/air-gap automation | Release/Security/QA | Epic 7 | B-002/B-004 |
|
||||
| Evidence collector/manifest verifier and RC qualification | Release + QA | Epic 1→8 | B-004, all suites |
|
||||
|
||||
## Tooling and Access
|
||||
|
||||
| Tool/service | Purpose | Access | Status |
|
||||
|---|---|---|---|
|
||||
| PostgreSQL 16/Valkey Testcontainers | Storage/coordination integration | Container runtime | Existing foundation; extend |
|
||||
| Playwright 1.61.1 | UI and real-stack/mocked-boundary browser tests | Node + Chromium | Installed; Utils/Pact are preferences only, absent from package.json |
|
||||
| MCP protocol harness + ≥3 clients | Compatibility matrix | Pinned clients | Pending feature-freeze selection |
|
||||
| Captured OTLP/Sentry endpoint, Prometheus/Grafana/GlitchTip | Observability assertions | Self-hosted test profile | Pending Epic 5 |
|
||||
| External calibrated load/chaos tooling | Cross-check and fault injection | Reference host/lab | Pending |
|
||||
| cargo-deny, npm audit, Trivy / SBOM | Dependency/container policy | CI toolchain/images | Configured; current scan reports and complete SAST/secret/signature evidence not established by this audit |
|
||||
|
||||
## Interworking and Regression
|
||||
|
||||
| Component | Impact | Regression scope | Validation |
|
||||
|---|---|---|---|
|
||||
| Core/runtime/REST adapter | Shared execution semantics/security | Existing REST→MCP + all ingress paths | CP-01..04, CP-16, malicious upstream |
|
||||
| Import/artifacts/registry | New parser/transactional plans | OpenAPI and persisted revisions | CP-05..07 |
|
||||
| MCP server/catalog | New capabilities and adapters | Stable/N-1/N-2 clients | CP-08..11 |
|
||||
| Task worker/PostgreSQL/Valkey | New durable concurrency | State, contention, restart, PG-only | CP-12..15 |
|
||||
| UI/Admin API | New operator flows/security | RU/EN, async state, auth, browser matrix | CP-07/17/24/25/33 |
|
||||
| Observability/metrics stack | Cross-cutting data path | Correlation, redaction, cardinality, SLO | CP-16..21 |
|
||||
| Load/deploy/release assets | Production operations | Safety, recovery, air gap, evidence | CP-22..31 |
|
||||
|
||||
Every fixed defect adds the lowest-level regression and a boundary case if the failure crossed a contract.
|
||||
|
||||
## Appendix A: Reproducible Discovery and Evidence
|
||||
|
||||
```bash
|
||||
# From apps/ui: enumerate only; does not prove a pass.
|
||||
./node_modules/.bin/playwright test --list --reporter=line
|
||||
# From the repository: static test attributes, not coverage.
|
||||
git grep -h -E '#\[(tokio::test|test)' HEAD -- apps crates | wc -l
|
||||
```
|
||||
|
||||
For each future accepted run retain source revision/tree, image/config/topology identifiers, dependency/client/browser versions, command, timestamps, cases passed/failed/skipped/flaky, raw report digest and sanitized diagnostics. Source files and generated “completed” planning metadata cannot serve as execution evidence. Keep secrets, credentials and unbounded payloads out of retained reports.
|
||||
|
||||
Current tests do not have a complete @P0/@P1 tag taxonomy; selecting tags before annotating the suite may run zero tests. Use known files/test names now, and make empty mandatory selections fail. Report retention must cover ordinary failing runs as well as successful sanitized OpenAPI release evidence.
|
||||
|
||||
## Edit Verification — 2026-09-13
|
||||
|
||||
Read source/configuration and previous plans; ran Playwright discovery only. Product tests, benchmarks, browser runs and deploy were not rerun. Document checks confirm 34 unique CP families covering all FR-1..54 at family level, shared risk identifiers, preserved PRD thresholds and explicit missing evidence. This is not an assertion-level coverage proof or final NFR PASS/CONCERNS/FAIL verdict.
|
||||
|
||||
## Appendix B: Knowledge Base References
|
||||
|
||||
- `risk-governance.md` and `test-priorities-matrix.md`
|
||||
- `test-levels-framework.md` and `test-quality.md`
|
||||
- `nfr-criteria.md` and `adr-quality-readiness-checklist.md`
|
||||
- `playwright-cli.md` and `contract-testing.md`
|
||||
|
||||
**Generated by:** BMad TEA Agent
|
||||
**Workflow:** `bmad-testarch-test-design`
|
||||
@@ -0,0 +1,117 @@
|
||||
---
|
||||
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 |
|
||||
Reference in new issue
Block a user