36 KiB
stepsCompleted, lastStep, lastSaved, workflowType, storyId, storyKey, storyFile, atddChecklistPath, generatedTestFiles, inputDocuments, acceptanceCriteria
| stepsCompleted | lastStep | lastSaved | workflowType | storyId | storyKey | storyFile | atddChecklistPath | generatedTestFiles | inputDocuments | acceptanceCriteria | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
step-05-validate-and-complete | 2026-10-03 | testarch-atdd | 2.12 | 2-12-preview-partial-mode | _bmad-output/implementation-artifacts/spec-2-12-preview-partial-mode.md | _bmad-output/test-artifacts/atdd-checklist-2-12-preview-partial-mode.md |
|
|
|
ATDD Checklist — Story 2.12: Предоставить полный preview и явный partial mode
Date: 2026-10-03
Author: Bsodfather
Primary test level: E2E (Playwright Chromium) для UI-наблюдаемых AC; существующие Rust INT/UNIT suites переиспользуются для backend-only AC (P1; epic scenario 2.12-API-A,B, risks E2-R1/E2-R4).
Story summary
Администратор до импорта видит полный детерминированный preview и может осознанно применить либо весь документ, либо явно выбранное подмножество actionable candidates. Неизменяемый ImportPlan связывает selections, findings и metadata без секретов, а stale/revalidation виден при повторном открытии.
As a администратор I want просмотреть все будущие Operations, конфликты и проблемы документа So that могу исправить контракт либо осознанно импортировать только безопасную часть.
Approved acceptance criteria snapshot
Supplied AC-<n> IDs в спецификации отсутствуют; IDs назначены детерминированно по source order. Этот snapshot взят только из Acceptance Criteria в _bmad-output/implementation-artifacts/spec-2-12-preview-partial-mode.md, единственного источника требований для story.
| ID | ID source | Acceptance criterion |
|---|---|---|
| AC-1 | generated | Preview возвращает groups/tags, candidates, proposed names, methods/paths, schemas, mappings, security bindings, conflicts, warnings, unsupported findings; каждый элемент связан с source location и stable finding code. |
| AC-2 | generated | Preview/plan не создаёт и не изменяет Operations/Versions/Agent bindings/Auth Profiles; сохраняются только immutable snapshots и preview/plan artifacts. |
| AC-3 | generated | При одинаковых digests/config/catalog/selections ordered candidates, findings, summary и plan digest детерминированны; timestamps/request IDs не входят в canonical digest. |
| AC-4 | generated | Duplicate/invalid/taken names дают deterministic rename proposal и conflict type; выбор допустимого имени не меняет исходный snapshot. |
| AC-5 | generated | Candidate без blockers и с разрешённой authentication получает actionable из typed findings/requirements, не от клиента. |
| AC-6 | generated | При blocker в full mode Apply всего документа запрещён; UI показывает полный blocker count и affected candidates без частичного набора Operations. |
| AC-7 | generated | Явный partial mode принимает только actionable subset с замкнутыми разрешёнными dependencies; excluded/blocked и причины сохраняются в ImportPlan и report. |
| AC-8 | generated | Изменение selection/name/Auth Profile/conflict policy создаёт новую immutable ImportPlan version с новым digest; прежний plan остаётся доступным, не мутируется in place. |
| AC-9 | generated | Immutable ImportPlan связывает source/external digests, importer/support-matrix version, catalog revision, candidates, selections, mappings, findings, conflict decisions; без raw credentials и mutable remote references. |
| AC-10 | generated | При изменении catalog/Auth Profile после preview повторное открытие plan даёт stale/revalidation-required status; UI не гарантирует успешный Apply. |
| AC-11 | generated | До 2000 candidates и bounded findings с search/filter/grouping и bounded pagination/virtualized rendering без unbounded DOM; интерактивность ≤2 s p95 на Reference Deployment. |
| AC-12 | generated | RU/EN состояния uploading/parsing/loading/empty/no-methods/error/actionable/blocked/stale/confirmation; request generation guard не даёт старому preview перезаписать новый файл/selection. |
| AC-13 | generated | E2E upload regression для valid/invalid/empty/oversized/no-method; valid показывает методы загруженного файла; DB assertions подтверждают отсутствие Operations до Apply. |
| AC-14 | generated | API/Playwright suite покрывает deterministic output, blockers, explicit partial selection, dependency closure, naming conflicts, stale plan, cross-workspace access, no-mutation; just verify и UI build проходят. |
Story integration metadata
- Story ID:
2.12 - Story key:
2-12-preview-partial-mode - Story file:
_bmad-output/implementation-artifacts/spec-2-12-preview-partial-mode.md - Checklist:
_bmad-output/test-artifacts/atdd-checklist-2-12-preview-partial-mode.md - Test file:
apps/ui/tests/e2e/openapi-preview-partial.spec.js(9 leaves: AC-7 активирован и реально RED; остальные 8 остаются skipped preparation) - Context:
_bmad-output/implementation-artifacts/epic-2-context.md; canonical Epic 2 test design2.12 / 2.12-API-A,B(FR-7, AC groups 14, P1, E2-R1/E2-R4).
Preflight and generation decisions
- Baseline из frontmatter спецификации и текущий HEAD:
d1ba0bd0e4135a42bd710ee06df0acf27e5b488f. Worktree уже содержал оставленный незавершённым предыдущим запуском untracked E2E-файл; он изучен и продолжен. - Stack:
fullstack(RustCargo.toml+ Playwright вapps/ui/playwright.config.js). Framework config:apps/ui/playwright.config.js, testDirapps/ui/tests/e2e, Chromium, workers=1. - Generation mode: AI specification mode, unattended. Запись браузером не выполнялась (нет поднятого dev-стека); селекторы для ещё не реализованных контролов — предлагаемые доступные имена/
data-testid(см. DOM contract). @seontechnologies/playwright-utilsотсутствует вapps/ui/package.json; applicability gate закрыт. Существующий suite использует@playwright/testиpage.route; новые scaffolds следуют этой же манере. Pact-ветка не релевантна (нет Pact-артефактов/брокера).- Заданий production-кода не вносилось. Изменены только E2E test-файл и этот checklist;
sprint-status.yamlне трогался. npm ciвыполнен вapps/uiпо существующему lockfile; tracked manifests/lockfile не изменялись. Локальный Chromium уже был установлен.- Reuse over duplication: для API/backend AC не создавались дублирующие E2E проверки. Упомянутые ниже существующие Rust/Playwright cases пока только проверены по исходникам: в этой стадии они не запускались и поэтому не объявляются измеренным GREEN.
Scenario-to-AC mapping
Каждый AC имеет один основной oracle. Таблица различает source-level найденные reusable tests, новые E2E UI contract mocks и отсутствующие/неисполненные доказательства. Только AC-7 получил выполненный RED. Ни один существующий тест не объявляется GREEN по одному наличию исходника.
| AC | Уровень | Reuse / evidence status | Primary scaffold и оставшаяся работа |
|---|---|---|---|
| AC-1 | API/INT + E2E | Reusable parser/source tests found in preview.rs, http_contract_regressions.rs, coverage.rs, security suites; not run here. |
Skipped E2E asserts UI rendering only with mocked API. Backend projection still needs Rust test: finding/candidate source locations and typed conflicts are absent from preview DTO. |
| AC-2 | INT | No-mutation candidates found in import_plan_create/creation.rs, openapi_import.rs, registry create suite, and operations.spec.js; not run here. |
Reuse these as implementation evidence after running on candidate; no new E2E leaf. |
| AC-3 | UNIT/INT | Corpus equality covers normalized output; it does not establish canonical plan digest. Relevant plan tests found but not run here. | Required new/extended Rust regression: independent equivalent plan generations with different random IDs/times must have equal semantic digest while semantic changes differ. Source currently includes random plan_reference in digest material. |
| AC-4 | E2E + API | Legacy import/name conflict tests and registry plan conflict case found; not run here. | Skipped E2E uses a mocked preview conflict and proposed name; backend typed conflict/source-location projection still needs an API/Rust test. |
| AC-5 | API | Client-authority rejection/count/security availability tests found; not run here. | No new E2E leaf. Run/reuse typed-readiness tests on candidate; preserve proof that client cannot set actionable. |
| AC-6 | E2E + INT | Blocked apply suites and existing mixed-plan UI test found; not run here. | Skipped E2E uses mocked findings/plan to check UI blocker summary. API/DB authority and no-mutation need executed backend tests. |
| AC-7 | E2E + INT | resolve_plan_selection, partial apply and dependency snapshot tests found; not run here. |
E2E leaf is active and gives actual RED at missing #openapi-import-partial-mode. Later assertions use mocked preview/plan and only specify the UI request/display contract; dependency closure, persisted exclusions, and report require real Rust/API tests. Closure follows spec Design Notes (materialized schemas/mappings and immutable snapshot validation). |
| AC-8 | E2E + INT | Immutable replay/version cases found; not run here. | Skipped E2E assigns synthetic d…/e… digests by call count; this checks intended UI rendering only and cannot prove digest derivation, plan immutability, or old-plan auditability. Backend audit/reopen route and tests remain required. |
| AC-9 | INT | Existing source/dependency/fingerprint/no-secret cases found; not run here. | Required Rust payload/storage tests for source/external digests, importer/support-matrix version, catalog revision, findings and conflict decisions, plus raw-secret/mutable-reference rejection. Current plan payload lacks required metadata fields. |
| AC-10 | E2E + INT | Auth Profile/secret drift/apply stale cases found; not run here. Apply-time stale rejection is not proof of read-only reopen UI. | Skipped E2E mocks plan and a 409 apply response; must be changed to exercise actual persisted-plan reopen/revalidation route. |
| AC-11 | E2E + benchmark | No pagination source found; UI currently renders rows directly and server cap is 512. | Skipped 2,000-row mock E2E is unexecuted and itself has weak pagination/search assertions; interaction p95 must be separately measured on Reference Deployment LAN. Local 4-CPU/browser same-host evidence is not a substitute. |
| AC-12 | E2E | Existing stale-request guards in operations/security tests found; not run here. | Skipped mock E2E currently checks uploading text and a no-method response plus held older response. It does not assert parsing, loading, empty, generic error, actionable, blocked, stale, confirmation, RU coverage or a changed selection race; expand/split in implementation. |
| AC-13 | E2E + INT | Existing upload and no-mutation cases found; not run here. | Skipped E2E covers valid and empty only. It intercepts /operations, so it can detect a browser POST but provides no DB assertion; invalid, oversized, no-method outcomes and real DB state require additional API/Rust integration coverage. |
| AC-14 | Process | just verify, UI build/e2e targets and source tests found; not run here. |
Meta-AC remains open until all mandatory API/Playwright scenarios execute on the implementation candidate and just verify + UI build pass. |
Red-phase leaf coverage note
Это checklist фиксирует наличие исходного кода тестов отдельно от факта их исполнения. На baseline выполнен один RED: AC-7 дошёл до первого обещанного UI-предиката и упал из-за отсутствующего partial toggle. Остальные пропуски — подготовленные сценарии, не RED; перечисленные существующие tests не являются измеренным GREEN, поскольку здесь не запускались. AC-3 и AC-9 требуют новых/расширенных backend assertions; mock E2E не может закрыть контракт digest/persistence.
Red-phase E2E scaffolds
File: apps/ui/tests/e2e/openapi-preview-partial.spec.js (AC-7 active; 8 leaves remain test.skip preparation).
| Test leaf | AC | Expected failing behavior after activation | Baseline status |
|---|---|---|---|
[P1] AC-1 preview renders source locations and stable finding codes for candidates and conflicts |
AC-1 | API и UI ещё не отдают/не рендерят source_location и conflicts. |
Skipped scaffold (prepared). |
[P1] AC-4 preview shows conflict type and deterministic rename proposal without mutating the snapshot |
AC-4 | Нет conflict type и deterministic rename proposal в preview/UI. | Skipped scaffold. |
[P1] AC-6 full mode disables Apply and lists blocker count and affected candidates |
AC-6 | UI не показывает полный blocker count/affected candidates как authority (backend GREEN). | Skipped scaffold. |
[P1] AC-7 explicit partial mode submits only the actionable closed subset and shows excluded reasons |
AC-7 | #openapi-import-partial-mode отсутствует в DOM. |
Executed RED: UI E2E on baseline, 2026-10-03; first criterion assertion failed (toBeVisible, no element). Later mocked assertions were not reached and do not prove dependency closure/persistence. |
[P1] AC-8 confirming a changed selection creates a new plan version with a new digest |
AC-8 | UI не показывает version/digest нового плана. | Skipped scaffold. |
[P1] AC-10 reopening a stored plan reports stale/revalidation-required without implying Apply succeeds |
AC-10 | Нет read-only reopen/revalidation и stale-состояния. | Skipped scaffold. |
[P1] AC-11 renders bounded pages for 2000 candidates and preserves selection across pages |
AC-11 | UI рендерит все строки; нет pagination/virtualization и cap 2000. | Skipped scaffold. |
[P1] AC-12 renders uploading/parsing/loading/empty/error/stale states and drops a stale preview response |
AC-12 | Нет полного набора UI states; current leaf omits several named states/locales and selection replacement. | Skipped and incomplete contract mock; expand before relying on it. |
[P1] AC-13 real upload round-trip gives exact pre-mutation outcomes and creates no Operations before Apply |
AC-13 | Нет полного upload corpus/DB assertion. | Skipped and incomplete: only valid+empty; operation route is mocked, so no DB claim. |
Leaf bodies опираются на существующие селекторы (#openapi-import-*, .openapi-import-operation, [data-openapi-operation], [data-testid="openapi-import-apply-confirmation"]) и на предлагаемые контракты ниже. Backend endpoints/payload grounded in apps/admin-api/src/dto.rs, routes/imports.rs, app.rs; preview shape grounded in crates/crank-import/src/rest/model.rs.
Proposed DOM / accessibility contract (for implementation stage)
#openapi-import-partial-mode— явный checkbox/label «Partial import» / «Частичный импорт».[data-testid="openapi-import-blockers"]— полный blocker count и affected candidate keys.[data-testid="openapi-import-operation-location"],[data-testid="openapi-import-finding-code"],[data-testid="openapi-import-finding-location"]— source locations и stable codes.[data-testid="openapi-import-conflict"],[data-testid="openapi-import-rename-proposal"]— conflict type и deterministic proposal (editable input).[data-testid="openapi-import-excluded-reason"]— причиныnot_selected/blocked.[data-testid="openapi-import-pagination"],[data-testid="openapi-import-page-status"]— bounded pages и общее число кандидатов.[data-testid="openapi-import-plan-stale"],[data-testid="openapi-import-plan-version"],[data-testid="openapi-import-plan-reopen"]— stale/revalidation, digest version и read-only переоткрытие плана.- Сохранить keyboard/focus и
role=status/aria-live=polite; секреты/raw credentials не попадают в DOM, storage, plans, logs.
Proposed API contract deltas (implementation stage)
- Preview response:
ImportPreview.conflicts[] = {operation_key, conflict_type, proposed_name, source_location}; per-candidatesource_location; per-findingsource_location(+ existingcode). Backward replay compatibility для persisted v2/v4/v5 previews сохранить. - Existing
crank_import::rest::SourceLocationis{ pointer }(RFC 6901) by design; do not addsource_digestto the location object. Source snapshot digests belong to plan metadata. - ImportPlan payload/fingerprint: убрать random
plan_referenceиз digest-материала; добавитьcatalog_revision,support_matrix_version,findings. Digest должен быть стабилен при иных request IDs/timestamps. - Read-only reopen/revalidation endpoint для plan: возвращает stale/revalidation-required без мутаций.
- 2000 bound: не повышать unbounded DOM; cap 512 для plan keys пересмотреть согласованно с AC (2000 display) — архитектурное решение ведущего.
Implementation checklist (для следующего stage, не выполнено здесь)
crates/crank-import: добавитьsource_locationв finding/candidate projection иconflicts[], не теряя current ordering/coverage; добавить Rust tests.apps/admin-api: детерминированный semantic digest (без random plan_reference/time/request ID);catalog_revision,support_matrix_version,findingsв plan payload; read-only reopen/revalidation; naming conflict/rename proposal projection.apps/ui/openapi-import.js+index.html+i18n.js+ css: явный partial control, locations/conflicts, blocker summary, bounded pagination (2000), stale revalidation, RU/EN, keyboard/live status.apps/ui/tests/e2e/openapi-preview-partial.spec.js: активировать по одному листу, подтвердить RED, реализовать, GREEN.cargo test -p crank-import;cargo test -p admin-api --test integration;cargo test -p crank-registry --test integration;cd apps/ui && npm run build; обязательные Playwright suites--workers=1;just verify.- Reproducible benchmark 2000 candidates: bounded DOM, p95 ≤2 s на Reference Deployment, raw samples и environment записаны; поддельные mock-латентности не выдаются за proof.
Test execution evidence (this ATDD stage)
cd apps/ui && npm ci— PASS; использован lockfile, tracked package files не менялись.node --check apps/ui/tests/e2e/openapi-preview-partial.spec.js— результат ниже после activation.cd apps/ui && npx playwright test tests/e2e/openapi-preview-partial.spec.js --grep 'AC-7' --workers=1— EXPECTED RED (EXIT=1) на baselined1ba0bd…: реальный Chromium/webServer стартовал, после upload/preview первый AC-предикат#openapi-import-partial-modeупалelement(s) not found; это отсутствующий feature, не setup failure. Штатная сборка/migration завершилась, PostgreSQL 16 поднят тестовым stack script и им же остановлен при завершении.- Полный Playwright discovery и остальные Rust reuse suites в этом ATDD stage не запускались. Следовательно, 0 existing GREEN переизмерено; исходный код тестов ниже — candidates for reuse, не pass evidence. Reference Deployment p95 benchmark не запускался: local browser/application share one machine и не составляют требуемый LAN setup.
- Execution summary: 9 E2E leaves: 1 active executed RED (AC-7), 8 skipped preparation, 0 new GREEN;
generatedTestFilesсодержит один E2E файл.
Red-Green-Refactor workflow
- RED: AC-7 выполнен против baseline и подтвердил отсутствие явного partial control. Остальные 8
test.skip— подготовка, а не executed RED. - GREEN: реализовать минимальный production-код из Tasks спецификации; включить существующие Rust оракулы; прогонять suite по одному листу.
- REFACTOR: после зелёного — quality pass без изменения поведения; повторный прогон
just verify+ UI build.
Knowledge fragments applied
test-quality.md,component-tdd.md: один primary leaf на AC, скалярный first-failure, Given-When-Then.data-factories.md: reused deterministic helpers (importDocument,candidate,previewResponse,planResponse) вместо хардкода секретов; секретные canary не добавлялись.network-first.md,timing-debugging.md: route mocking до навигации, deterministic request settlement barrier вместоwaitForTimeout.selector-resilience.md: доступные имена и стабильныеdata-testid.fixture-architecture.md,test-healing-patterns.md: reuse существующегоloginhelper; без лишних fixture-абстракций.- Playwright Utils / Pact.js mandates: N/A (пакеты отсутствуют; contract boundary отсутствует).
Handoff
ATDD-only выход готов к отдельному implementation stage. Один реальный RED: AC-7 отсутствует partial toggle. UI mocks дают лишь interaction contracts; AC-7 closure/report, AC-8 digest/version, AC-10 reopen/revalidation, AC-12 полный state/locale/request-generation набор, AC-13 oversized/no-method/DB assertions и AC-11 performance остаются незакрытыми. AC-2/3/5/9 source suites не запускались и не объявляются GREEN; AC-3/9 требуют отдельного proof по semantic digest и stored metadata. sprint-status.yaml не изменён.
Implementation-stage evidence (2026-10-03; separate from historical RED snapshot)
Все девять подготовленных E2E leaves AC-1/4/6/7/8/10/11/12/13 активированы; в openapi-preview-partial.spec.js больше нет test.skip. AC-1/4 проверяют UI projection с mock response и соответствующий Rust/API typed contract; AC-8/10 проверяют UI GET/selection flow, а хранение и server authority подтверждаются отдельными integration tests. AC-13 browser leaf обращается к реальному preview API и сравнивает operations GET до/после; прямые SQL-счётчики для пяти upload-исходов проверяет preview_outcomes_do_not_mutate_operation_catalog.
| AC | Executed implementation evidence | Ограничение |
|---|---|---|
| 1–5 | crank-import preview/source corpus, API naming/readiness и registry semantic digest tests; v5 persisted replay regression |
Group/count/summary получают provenance через membership candidates, не вымышленный singular pointer/code. |
| 6–7 | Active UI leaves; API partial blocker/selection tests; registry material/Apply checks сохраняют excluded reasons | UI mock не заменяет registry closure authority. |
| 8–10 | Active UI leaves; v2 payload/digest, catalog/Auth drift и read-only GET integration; старый план остаётся readable | UI version — номер обзора в modal; неизменяемый server reference/digest — authority. |
| 11 | Active UI leaf: 2 000 candidates, preview/plan/result rows ≤100, 20 raw local browser handler samples; real API 2 000 YAML → full plan → GET current, SQL no-mutation | Reference Deployment LAN full interaction p95 не измерен; отдельный operator-run harness openapi-preview-reference.spec.js ожидает удалённую инфраструктуру и manifest. |
| 12–13 | Active RU/EN states/race/real upload leaves; typed invalid/empty/oversized/no-method SQL regression | Локальный Playwright stack не является Reference Deployment. |
| 14 | Обязательные Rust/UI проверки ниже, just verify и обязательный review выполняет ведущий после handoff |
Gate не считается закрытым до фактического PASS. |
Измеренные команды к моменту handoff: cargo test -p crank-import — PASS, 0 ignored; cargo test -p admin-api --test integration import_plan_create -- --test-threads=1 — 17 PASS; адресные preview_outcomes_do_not_mutate_operation_catalog, previews_and_plans_two_thousand_operations_without_catalog_mutation, older_v2_support_matrix_rejects_new_apply_but_keeps_plan_auditable, http_contract_preview_apply_and_replay_preserve_json_multipart_schemas_mapping_and_mime — по 1 PASS; cargo test -p admin-api --lib preview_name_tests — 1 PASS; cargo test -p crank-registry --test integration -- --test-threads=1 — 139 PASS, 1 ранее существовавший unrelated ignored; just clippy — PASS. Первый полный API run выявил устаревшее буквальное сравнение persisted projection с workspace-aware response status (122 tests: 121 PASS, 1 FAIL); адресный regression после точечного исправления PASS. Финальный полный API/just verify gate ещё нужен.
cd apps/ui && npx playwright test tests/e2e/openapi-preview-partial.spec.js tests/e2e/openapi-import-plan.spec.js tests/e2e/openapi-security-mapping.spec.js tests/e2e/operations.spec.js --workers=1 — 40 PASS, 0 skipped на final production UI; после этого добавлен только keyboard assertion в AC-12, адресный rerun выполняется перед handoff, а полный final gate повторит ведущий. Локальные raw AC-11 samples и воспроизводимый Reference command/manifest находятся в docs/openapi-import.md; mock handler timings не используются как LAN p95 proof.