--- name: up-traceability-gate description: Run the enforced traceability completeness check against the single traceability graph and the iteration delivery-surface matrix — scanning for use cases with zero requirements, requirements with no owning use case, requirements with no SRS/HLD/LLD linkage, unimplemented frontend/API/data/integration surfaces, or iterations that closed with undelivered scope. Use this at the end of Stage 5, Stage 9, every Construction iteration, before any baseline/sign-off, and any time drift is suspected. Covers Gates 5.1, 9.1, and 14.1 of the UP-AI v1.0 Process (process/AI_Native_Unified_Process_v1.md). --- # up-traceability-gate — Gates 5.1 / 9.1 / 14.1 (cross-cutting) ## Objective Make traceability completeness a mandatory, executable checkpoint at every stage boundary touching requirements, architecture, or delivery. Progress is strictly blocked if any story or delivery surface lacks specification or test evidence. There is exactly **one** traceability graph — `project_sdlc/00_process_control/traceability_graph.md` — this skill is the only thing that writes to it. Never hand-edit it directly. ## When to invoke Three mandatory checkpoints, plus ad hoc use: 1. **Gate 5.1** — after any `up-use-case-author` run (or batch of runs), before proceeding to `up-arch-risk-spike` (Stage 6). 2. **Gate 9.1** — after `up-srs-derive` (Stage 8) and `up-hld-lld-generate` (Stage 9), before proceeding to Construction (`up-iteration-plan`, Stage 10). 3. **Gate 14.1** — at the end of every Construction iteration, before marking any `FR-xxx` as "Delivered" and before starting the next iteration or entering Transition. 4. **Ad hoc** — any time graph drift is suspected. ## Read first - `tech-profile.yaml` (identifies coverage thresholds, auth claims, and sandboxes) - `project_sdlc/03_requirements/use_cases/` (all UC + FR files) - `project_sdlc/03_requirements/` SRS/NFR outputs (Stage 8) - `project_sdlc/04_architecture_design/` HLD/LLD outputs (Stage 9) - Current iteration's `project_sdlc/05_iteration_planning/iterations/iteration-NN/` (Gate 14.1 only) - Current iteration's `iteration_surface_matrix.md` (Gate 14.1 only) - `project_sdlc/07_test_design/regression_test_cases.md` (Gate 14.1 only — regression-suite health check) - Current iteration's `parallel_work_plan.md`, if present (Gate 14.1 only), plus `integration_manifest.md` produced by `up-parallel-work-integrate` when named branches were used - `project_sdlc/00_process_control/traceability_graph.md` (previous state, if any) - `process/AI_Native_Unified_Process_v1.md` §9 (Quality Gates) ## Procedure ### Step 0 — Automated Deterministic Validation Before manual or semantic evaluation, run the deterministic gate validator script: ```bash python3 scripts/verify_traceability_gates.py --gate <5.1|9.1|14.1> [--iteration iteration-NN] ``` If the script exits with non-zero (Critical issues detected), STOP and resolve them immediately before performing further reviews. ### Gate 5.1 — UC ↔ FR Completeness 1. Execute `python3 scripts/verify_traceability_gates.py --gate 5.1`. 2. Inspect every file under `project_sdlc/03_requirements/use_cases/`. For each `UC-xxx`, confirm at least one `FR-xxx` declares `parent_uc = UC-xxx`. For every `FR-xxx` found anywhere in the tree, confirm its `parent_uc` resolves to an existing `UC-xxx` file. Produce a table: `Check-ID | UC or FR | Issue | Severity (Critical/Major/Minor) | Required Action`. FAIL (do not proceed) if any Critical issue exists: - Critical: a `UC-xxx` with zero `FR-xxx` children. - Critical: an `FR-xxx` with a `parent_uc` that does not exist. - Major: an `FR-xxx` with `source_brd_fr = "new — not in BRD"` and no business justification cited. ### Gate 9.1 — FR ↔ SRS ↔ HLD ↔ LLD Completeness 1. Execute `python3 scripts/verify_traceability_gates.py --gate 9.1`. 2. Scan every `FR-xxx` and confirm each resolves to: at least one SRS/NFR requirement, at least one HLD component, and at least one LLD artifact (API, table, or event). Same table format. FAIL if any FR has no SRS linkage, no HLD component, or no LLD artifact. ### Gate 14.1 — Iteration Definition of Done (Hardened per UP-AI v1.4) 1. Execute deterministic validator: ```bash python3 scripts/verify_traceability_gates.py --gate 14.1 --iteration iteration-NN --run-tests ``` 2. For the current iteration, confirm for every `STORY-xxx`: 1. Requirement mapped across all applicable delivery surfaces in `iteration_surface_matrix.md`. 2. API documented; database migration present; integration adapter verified. 3. Tests passing: unit + API integration + real-runtime tests via `scripts/run_tests.sh`. 4. Browser-E2E evidence for all web portals/views in scope. 5. Explicit Unit/Smoke/Usability applicability decisions recorded. 6. Required QA deliverables exist and meet **semantic density**: - `project_sdlc/07_test_design/manual_qa/iteration-NN/MANUAL_TESTING_GUIDE.md` present. - 21-sheet Excel QA Workbook (`IterationNN__Complete_Manual_Testcases.xlsx`) compiled and densely populated with **$\ge 20$ concrete test cases** (zero-row/stub templates are strictly blocked with Critical errors). 7. Bruno API Collections: Git-versioned `.bru` requests present under `project_code/docs/api/bruno/` for every declared API endpoint in the surface matrix. 8. Functional Test Models: `07_test_design/functional_test_cases/TC-xxx.md` files verified across all 4 mandatory dimensions: Happy Path, Boundary/Edge, Negative/Security, and FSM Invariant. 9. Multi-path automated code and branch coverage meets or exceeds configured tier budgets (e.g. **≥95.0%** for domain FSMs, **≥90.0%** for adapters, **≥80.0%** for frontend components). 10. Cumulative regression suite passes via `scripts/run_tests.sh --scope iteration-NN`. FAIL if any story lacks passing tests, automated test coverage does not meet configured thresholds, regression tests fail, QA workbooks have < 20 test cases, Bruno collections are missing, or delivery surfaces are unowned. **Requirement Status Lifecycle:** - While stories and code are being implemented: status is `In Construction` or `Implemented (Domain/Schema)`. - ONLY when all 10 criteria above are satisfied and Gate 14.1 passes with zero Critical findings, mark associated `FR-xxx` as **`Delivered (E2E Verified)`** in `traceability_graph.md`. Never jump directly from `Baselined` to `Delivered`. ## Output expected Updated `project_sdlc/00_process_control/traceability_graph.md` with a dated Gate-check section; blocking issue table if findings exist. ## Exit criteria Zero Critical issues for the gate being run. ## Sample invocation > "Run up-traceability-gate (Gate 5.1) across all use cases authored so far in project_sdlc/03_requirements/use_cases/." > "Run up-traceability-gate (Gate 14.1) for iteration-01." ## Related skills Feeds from: `up-use-case-author`, `up-srs-derive`, `up-hld-lld-generate`, `up-code-generate`/`up-defect-fix`, and `up-parallel-work-integrate`. Feeds into: `up-arch-risk-spike`, `up-iteration-plan`, `up-uat-handover`.