# Quality Gate v3.0 ```xml Preflight requirements: - Latest assessments (risk/test design, trace, automation, NFR) are available. - Team has consensus on fixes/mitigations. Gather required assessments and confirm consensus; halt if information is stale or missing. Assemble story metadata (id, title, links) for the gate file. Apply deterministic rules: PASS (all critical issues resolved), CONCERNS (minor residual risk), FAIL (critical blockers), WAIVED (business-approved waiver). Document rationale, residual risks, owners, due dates, and waiver details where applicable. Update gate YAML with schema fields (story info, status, rationale, waiver, top issues, risk summary, recommendations, NFR validation, history). Provide summary message for the team highlighting decision and next steps. If reviews are incomplete or risk data is outdated, halt and request the necessary reruns. Pull the risk-governance, probability-impact, and test-quality fragments via `{project-root}/bmad/bmm/testarch/tea-index.csv` before issuing a gate decision. FAIL whenever unresolved P0 risks/tests or security issues remain. CONCERNS when mitigations are planned but residual risk exists; WAIVED requires reason, approver, and expiry. Maintain audit trail in the history section. Gate YAML entry and communication summary documenting the decision. ```