# QA Trigger Matrix (PM Reference)

Extension of `references/project-manager.md`. Use when choosing **`QA gate`** and **`QA mode`** on Assignments and before plan `Done`. NEVER rules → same file § PM-Specific NEVER Rules (QA gate bullets).

## Assignment fields (SSOT)

| Field | Values | Meaning |
| --- | --- | --- |
| **`QA gate`** | `mandatory` | After QC passes, dispatch `qa-engineer` |
| | `pm-acceptance` | Do **not** dispatch QA; PM completes acceptance checklist and may mark `Done` |
| | `report-only` | Primary route is investigation/repro only; dispatch `qa-engineer` (QC tri may be skipped per rules) |
| **`QA mode`** | `acceptance-only` (default when QA dispatched) | Evidence reuse first; map plan DoD to **implementer / CI / prior QA** evidence (QC reports are review findings, not the test log) |
| | `targeted` | Run only specified affected unit tests for changed behavior or a concrete evidence gap |
| | `report-only` | No business-code changes unless explicitly allowed |

**Deprecated:** `QA note: skipped / self-check` — use **`QA gate: pm-acceptance`** plus **`QA gate reason: <tier>`**.

All modes keep QA execution **unit-only**. Scope/authorization → `mstar-harness-core` § 定向执行与验证边界. No `full` QA mode: user-authorized full suites go to a separate implementer/ops action; QA reuses its evidence. Real browser/device/E2E goes to separately requested `mstar-e2e`, not an iteration QA gate.

Before setting or closing a development QA gate, reject ACs requiring live API/provider receipts, named/authenticated host/account, installed plugin/artifact, browser/device or deployed-environment proof; correct them during Prepare to isolated fixtures, relevant unit/component/integration checks, or locally built CLI/MCP evidence. Do not silently route such ACs to mandatory QA. Separately requested operational/E2E verification is independent.

Set **`QA gate`** on the **first implement Assignment** (or plan frontmatter) and keep it consistent through QC closure unless scope/risk changes force an upgrade to `mandatory`.

## Trigger matrix (default)

| Scenario | Default `QA gate` | Default `QA mode` (if QA dispatched) |
| --- | --- | --- |
| Hotfix / `Execution mode: inline` | `pm-acceptance` | N/A |
| Small feature: non-UI, no open issue, QC clean `Approve` (not `Approve with residuals`) | `pm-acceptance` | N/A |
| Bug fix (RCA + regression scope; default route) | `mandatory` | `acceptance-only` |
| Medium / Large feature | `mandatory` | `acceptance-only` |
| `Approve with residuals` or any open issue linked to the plan in `{HARNESS_DIR}/store.db` | `mandatory` | `acceptance-only` (includes open-issue verify) |
| UI-visible change (`Task category: visual` or observable evidence gate) | `mandatory` | `acceptance-only` (unit evidence; record unverified UI behavior for independent E2E) |
| High-risk ops | `mandatory` | `acceptance-only` (reuse ops evidence; named unit-test gaps only) |
| QA report-only primary route | `report-only` | `report-only` |
| Product-docs-only / tech-spec-only (no runtime diff) | N/A | — |
| User explicitly permits a local full suite | Preserve existing gate | QA consumes separately assigned implementer/ops evidence; permission does not authorize E2E |

**Upgrade rule:** If conditions change mid-round (e.g. QC becomes `Approve with residuals`, UI scope added, an issue captured and left open), change `QA gate` from `pm-acceptance` to `mandatory` before `Done`.

**Findings cleanup note:** Mode semantics → `mstar-artifacts`「Findings cleanup modes」. QA-tier consequence: any open issue linked to the plan, including blocker-defer, forces **`QA gate: mandatory`**; a clean approval with none open permits the small-feature `pm-acceptance` path only when the other tier rules allow.

## PM acceptance checklist (required before `Done` when `QA gate: pm-acceptance`)

PM completes this in **Status Update** (or plan closure note). PM **does not** run bash tests or reproduction in the orchestration thread.

1. **QC verdict:** `{SDD_DIR}/review/qc-consolidated.md` or `{SDD_DIR}/review/qc.md` shows `Approve` with **Critical = 0** and **Warning = 0** (not `Approve with residuals`), and the main plan has a durable gate summary.
2. **DoD mapping:** Each plan Acceptance Criterion maps to **existing** evidence (dev Completion Report, SDD test triple or applicable scoped-check, CI links; QC report for review verdict/findings only) — cite paths/commands, do not re-execute.
3. **Findings:** the issue store `{HARNESS_DIR}/store.db` has **no open issue linked to this `plan_id`** (or documented waiver per `mstar-artifacts`); closed ones carry their disposition and evidence.
4. **Checkout alignment:** `Working branch` and `Review range / Diff basis` match QC report verified lines.
5. **`QA gate reason`:** One line naming the tier (e.g. `hotfix-inline`, `small-feature-clean-qc`).

```markdown
## PM Acceptance (qa gate: pm-acceptance)
- QA gate reason: <tier>
- QC report: <bundle path> — Approve, Critical/Warning 0; durable summary: <main plan section>
- DoD mapping: <AC-id> → <evidence ref> …
- Findings: none open | waived issue <id> …
- Checkout: Working branch <name>; Review range <basis> (per QC Scope)
```
