@sun-asterisk/sungen 3.2.17 → 3.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/cli/commands/audit.d.ts.map +1 -1
  2. package/dist/cli/commands/audit.js +23 -0
  3. package/dist/cli/commands/audit.js.map +1 -1
  4. package/dist/cli/commands/delivery.d.ts.map +1 -1
  5. package/dist/cli/commands/delivery.js +209 -16
  6. package/dist/cli/commands/delivery.js.map +1 -1
  7. package/dist/cli/index.js +5 -0
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
  10. package/dist/dashboard/snapshot-builder.js +8 -1
  11. package/dist/dashboard/snapshot-builder.js.map +1 -1
  12. package/dist/dashboard/templates/index.html +1 -1
  13. package/dist/exporters/api-environment.d.ts +11 -0
  14. package/dist/exporters/api-environment.d.ts.map +1 -0
  15. package/dist/exporters/api-environment.js +129 -0
  16. package/dist/exporters/api-environment.js.map +1 -0
  17. package/dist/exporters/feature-parser.d.ts +16 -1
  18. package/dist/exporters/feature-parser.d.ts.map +1 -1
  19. package/dist/exporters/feature-parser.js +21 -2
  20. package/dist/exporters/feature-parser.js.map +1 -1
  21. package/dist/exporters/matrix/build.d.ts +70 -0
  22. package/dist/exporters/matrix/build.d.ts.map +1 -0
  23. package/dist/exporters/matrix/build.js +516 -0
  24. package/dist/exporters/matrix/build.js.map +1 -0
  25. package/dist/exporters/matrix/export.d.ts +50 -0
  26. package/dist/exporters/matrix/export.d.ts.map +1 -0
  27. package/dist/exporters/matrix/export.js +152 -0
  28. package/dist/exporters/matrix/export.js.map +1 -0
  29. package/dist/exporters/matrix/fingerprint.d.ts +20 -0
  30. package/dist/exporters/matrix/fingerprint.d.ts.map +1 -0
  31. package/dist/exporters/matrix/fingerprint.js +83 -0
  32. package/dist/exporters/matrix/fingerprint.js.map +1 -0
  33. package/dist/exporters/matrix/gates.d.ts +21 -0
  34. package/dist/exporters/matrix/gates.d.ts.map +1 -0
  35. package/dist/exporters/matrix/gates.js +367 -0
  36. package/dist/exporters/matrix/gates.js.map +1 -0
  37. package/dist/exporters/matrix/map-loader.d.ts +22 -0
  38. package/dist/exporters/matrix/map-loader.d.ts.map +1 -0
  39. package/dist/exporters/matrix/map-loader.js +193 -0
  40. package/dist/exporters/matrix/map-loader.js.map +1 -0
  41. package/dist/exporters/matrix/render-csv.d.ts +9 -0
  42. package/dist/exporters/matrix/render-csv.d.ts.map +1 -0
  43. package/dist/exporters/matrix/render-csv.js +92 -0
  44. package/dist/exporters/matrix/render-csv.js.map +1 -0
  45. package/dist/exporters/matrix/render-xlsx.d.ts +41 -0
  46. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -0
  47. package/dist/exporters/matrix/render-xlsx.js +430 -0
  48. package/dist/exporters/matrix/render-xlsx.js.map +1 -0
  49. package/dist/exporters/matrix/types.d.ts +199 -0
  50. package/dist/exporters/matrix/types.d.ts.map +1 -0
  51. package/dist/exporters/matrix/types.js +15 -0
  52. package/dist/exporters/matrix/types.js.map +1 -0
  53. package/dist/exporters/matrix/wording.d.ts +61 -0
  54. package/dist/exporters/matrix/wording.d.ts.map +1 -0
  55. package/dist/exporters/matrix/wording.js +221 -0
  56. package/dist/exporters/matrix/wording.js.map +1 -0
  57. package/dist/exporters/scenario-merger.d.ts.map +1 -1
  58. package/dist/exporters/scenario-merger.js +2 -1
  59. package/dist/exporters/scenario-merger.js.map +1 -1
  60. package/dist/exporters/spec-parser.d.ts.map +1 -1
  61. package/dist/exporters/spec-parser.js +2 -1
  62. package/dist/exporters/spec-parser.js.map +1 -1
  63. package/dist/exporters/xlsx-report-builder.d.ts +1 -1
  64. package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
  65. package/dist/exporters/xlsx-report-builder.js +3 -3
  66. package/dist/exporters/xlsx-report-builder.js.map +1 -1
  67. package/dist/harness/audit.d.ts +10 -0
  68. package/dist/harness/audit.d.ts.map +1 -1
  69. package/dist/harness/audit.js +98 -16
  70. package/dist/harness/audit.js.map +1 -1
  71. package/dist/harness/blindspot.d.ts.map +1 -1
  72. package/dist/harness/blindspot.js +2 -1
  73. package/dist/harness/blindspot.js.map +1 -1
  74. package/dist/harness/capability-plan.d.ts +2 -0
  75. package/dist/harness/capability-plan.d.ts.map +1 -1
  76. package/dist/harness/capability-plan.js +17 -4
  77. package/dist/harness/capability-plan.js.map +1 -1
  78. package/dist/harness/feedback.d.ts.map +1 -1
  79. package/dist/harness/feedback.js +3 -2
  80. package/dist/harness/feedback.js.map +1 -1
  81. package/dist/harness/flow-check.d.ts.map +1 -1
  82. package/dist/harness/flow-check.js +2 -1
  83. package/dist/harness/flow-check.js.map +1 -1
  84. package/dist/harness/flow-plan.d.ts.map +1 -1
  85. package/dist/harness/flow-plan.js +3 -2
  86. package/dist/harness/flow-plan.js.map +1 -1
  87. package/dist/harness/intent.d.ts.map +1 -1
  88. package/dist/harness/intent.js +2 -1
  89. package/dist/harness/intent.js.map +1 -1
  90. package/dist/harness/journey.d.ts.map +1 -1
  91. package/dist/harness/journey.js +3 -2
  92. package/dist/harness/journey.js.map +1 -1
  93. package/dist/harness/ledger.d.ts.map +1 -1
  94. package/dist/harness/ledger.js +3 -2
  95. package/dist/harness/ledger.js.map +1 -1
  96. package/dist/harness/manifest.d.ts.map +1 -1
  97. package/dist/harness/manifest.js +4 -3
  98. package/dist/harness/manifest.js.map +1 -1
  99. package/dist/harness/parse.d.ts.map +1 -1
  100. package/dist/harness/parse.js +16 -3
  101. package/dist/harness/parse.js.map +1 -1
  102. package/dist/harness/quality-gates.d.ts.map +1 -1
  103. package/dist/harness/quality-gates.js +2 -1
  104. package/dist/harness/quality-gates.js.map +1 -1
  105. package/dist/harness/read-text.d.ts +22 -0
  106. package/dist/harness/read-text.d.ts.map +1 -0
  107. package/dist/harness/read-text.js +64 -0
  108. package/dist/harness/read-text.js.map +1 -0
  109. package/dist/harness/script-check.d.ts.map +1 -1
  110. package/dist/harness/script-check.js +3 -2
  111. package/dist/harness/script-check.js.map +1 -1
  112. package/dist/harness/sensors.d.ts +13 -1
  113. package/dist/harness/sensors.d.ts.map +1 -1
  114. package/dist/harness/sensors.js +63 -20
  115. package/dist/harness/sensors.js.map +1 -1
  116. package/dist/harness/spec-coverage.d.ts +5 -0
  117. package/dist/harness/spec-coverage.d.ts.map +1 -1
  118. package/dist/harness/spec-coverage.js +17 -7
  119. package/dist/harness/spec-coverage.js.map +1 -1
  120. package/dist/harness/trace.d.ts.map +1 -1
  121. package/dist/harness/trace.js +4 -3
  122. package/dist/harness/trace.js.map +1 -1
  123. package/dist/harness/viewpoint-baseline.d.ts +49 -0
  124. package/dist/harness/viewpoint-baseline.d.ts.map +1 -0
  125. package/dist/harness/viewpoint-baseline.js +141 -0
  126. package/dist/harness/viewpoint-baseline.js.map +1 -0
  127. package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
  128. package/dist/harness/viewpoint-ledger.js +2 -1
  129. package/dist/harness/viewpoint-ledger.js.map +1 -1
  130. package/dist/orchestrator/assets-drift.d.ts +24 -0
  131. package/dist/orchestrator/assets-drift.d.ts.map +1 -0
  132. package/dist/orchestrator/assets-drift.js +80 -0
  133. package/dist/orchestrator/assets-drift.js.map +1 -0
  134. package/dist/orchestrator/templates/ai-src/commands/create-test.md +24 -0
  135. package/dist/orchestrator/templates/ai-src/commands/delivery.md +203 -120
  136. package/dist/orchestrator/templates/ai-src/config/claude.md +1 -1
  137. package/dist/orchestrator/templates/ai-src/config/copilot.md +1 -1
  138. package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +102 -6
  139. package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +1 -0
  140. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +23 -0
  141. package/package.json +3 -3
  142. package/src/cli/commands/audit.ts +23 -1
  143. package/src/cli/commands/delivery.ts +240 -18
  144. package/src/cli/index.ts +6 -0
  145. package/src/dashboard/snapshot-builder.ts +8 -1
  146. package/src/dashboard/templates/index.html +1 -1
  147. package/src/exporters/api-environment.ts +97 -0
  148. package/src/exporters/feature-parser.ts +21 -2
  149. package/src/exporters/matrix/build.ts +551 -0
  150. package/src/exporters/matrix/export.ts +149 -0
  151. package/src/exporters/matrix/fingerprint.ts +49 -0
  152. package/src/exporters/matrix/gates.ts +400 -0
  153. package/src/exporters/matrix/map-loader.ts +163 -0
  154. package/src/exporters/matrix/render-csv.ts +94 -0
  155. package/src/exporters/matrix/render-xlsx.ts +420 -0
  156. package/src/exporters/matrix/types.ts +226 -0
  157. package/src/exporters/matrix/wording.ts +221 -0
  158. package/src/exporters/scenario-merger.ts +2 -1
  159. package/src/exporters/spec-parser.ts +2 -1
  160. package/src/exporters/xlsx-report-builder.ts +3 -2
  161. package/src/harness/audit.ts +104 -18
  162. package/src/harness/blindspot.ts +2 -1
  163. package/src/harness/capability-plan.ts +17 -4
  164. package/src/harness/feedback.ts +3 -2
  165. package/src/harness/flow-check.ts +2 -1
  166. package/src/harness/flow-plan.ts +3 -2
  167. package/src/harness/intent.ts +2 -1
  168. package/src/harness/journey.ts +3 -2
  169. package/src/harness/ledger.ts +3 -2
  170. package/src/harness/manifest.ts +4 -3
  171. package/src/harness/parse.ts +17 -3
  172. package/src/harness/quality-gates.ts +2 -1
  173. package/src/harness/read-text.ts +28 -0
  174. package/src/harness/script-check.ts +3 -2
  175. package/src/harness/sensors.ts +55 -8
  176. package/src/harness/spec-coverage.ts +22 -7
  177. package/src/harness/trace.ts +4 -3
  178. package/src/harness/viewpoint-baseline.ts +128 -0
  179. package/src/harness/viewpoint-ledger.ts +2 -1
  180. package/src/orchestrator/assets-drift.ts +64 -0
  181. package/src/orchestrator/templates/ai-src/commands/create-test.md +24 -0
  182. package/src/orchestrator/templates/ai-src/commands/delivery.md +203 -120
  183. package/src/orchestrator/templates/ai-src/config/claude.md +1 -1
  184. package/src/orchestrator/templates/ai-src/config/copilot.md +1 -1
  185. package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +102 -6
  186. package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +1 -0
  187. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +23 -0
@@ -1,146 +1,229 @@
1
1
  ---
2
2
  name: delivery
3
- description: "Export Gherkin scenarios + Playwright results to CSV test case file for QA delivery."
4
- argument-hint: "[screen-name...] [--env <locale>] (omit screens for all; --env for locale-specific export)"
3
+ description: "Export the Test Case & Coverage Matrix (review/manual/customer deliverable) from Gherkin + Playwright results. --legacy exports the classic per-scenario CSV/XLSX."
4
+ argument-hint: "[name...] [--format csv] [--env <locale>] [--legacy] (omit names for all)"
5
5
  order: 50
6
- claude-tools: "Bash, Read, AskUserQuestion"
6
+ claude-tools: "Bash, Read, Write, AskUserQuestion"
7
7
  copilot-tools: "[read, execute, edit, vscode/askQuestions]"
8
- codex-trigger: "Run when the user asks to EXPORT or deliver test cases to CSV/XLSX for QA hand-off. Final step. Do NOT use for creating or running tests."
8
+ codex-trigger: "Run when the user asks to EXPORT or deliver test cases for QA hand-off. Final step. Do NOT use for creating or running tests."
9
9
  ---
10
10
  ## Role
11
11
 
12
- You are a **QA Test Delivery Engineer**. Your job is to invoke the deterministic `sungen delivery` CLI that performs all parsing and CSV export. Your role is minimal — just run the CLI and help the user if pre-flight checks fail.
12
+ You are a **QA Test Delivery Engineer**. The deterministic `sungen delivery` CLI does all parsing,
13
+ gating, and rendering. Your job is (1) invoking it, (2) **proposing the Delivery Map** when a unit
14
+ does not have one yet — the one semantic step the CLI cannot do — and (3) walking the user through
15
+ review → approve → official render.
16
+
17
+ ## The two delivery modes
18
+
19
+ - **Matrix (default)** — the Test Case & Coverage Matrix: one row per *delivery item* (one target +
20
+ one test intent + one oracle family), with each Gherkin scenario / `@cases` row preserved as a
21
+ collapsible *coverage variant* sub-row. No numbered step dumps. This is the reviewable /
22
+ manually-executable / customer-facing standard.
23
+ - **Legacy (`--legacy`, alias `--full`)** — the classic per-scenario-steps workbook (BM-2-901-13).
24
+ Use it when the user asks for the old format or a project is mid-engagement on it.
13
25
 
14
26
  ## Parameters
15
27
 
16
28
  Parse from `$ARGUMENTS`:
17
- {{#cap parallel-subagents}}
18
- - **screens** zero or more screen/flow names. Empty CLI processes all targets in `qa/screens/` + `qa/flows/`.
19
- {{/cap}}
20
- {{^cap parallel-subagents}}
21
- - **names** zero or more screen/flow names. Empty CLI processes all targets in `qa/screens/` + `qa/flows/`.
22
- {{/cap}}
23
- - **`--env <locale>`** — optional. Sets `SUNGEN_ENV=<locale>` for the run so the CLI merges `<name>.<locale>.yaml` over the base test-data and writes `<name>-testcases.<locale>.csv` / `.xlsx`. Accept `--locale <locale>` as an alias.
24
-
25
- If `--env` is passed but no value follows, ask the user which locale to use.
29
+ - **names** — zero or more screen/flow/api names. Empty → **a sweep of every unit**.
30
+ Strictness follows the scope: a **named** unit that is not ready aborts the run (the user asked
31
+ for that unit); a **sweep** exports every ready unit and skips the rest with an accounted
32
+ "Not exported" list, succeeding as long as something was written. So `/sungen:delivery` with no
33
+ argument is safe in a work-in-progress project scaffolded units (added but `create-test` not
34
+ run) no longer block the units that are ready.
35
+ - **`--format <xlsx|csv|both>`** — output format. **Default `xlsx` one artifact only.** Pass
36
+ `--format csv` when the user wants the flat CSV (pipelines/diffing), `--format both` for both.
37
+ - **`--env <locale>`** sets `SUNGEN_ENV=<locale>` for the run (accept `--locale` as alias).
38
+ - **`--legacy` / `--full`** — pass through to the CLI and skip the map flow entirely.
26
39
 
27
40
  ## Steps
28
41
 
29
- ### 1. Invoke the CLI
30
-
31
- {{#cap parallel-subagents}}
32
- Run via Bash (single command, no extra parsing). Prefer the local `./bin/sungen.js` when it exists — the sungen monorepo ships local-only features the global npm package doesn't have yet (multi-sheet locale aggregation, `.<env>` filename suffix, locale-aware step rendering). Fall back to `npx sungen` in downstream projects.
33
- {{/cap}}
34
- {{^cap parallel-subagents}}
35
- Run via Bash (single command, no extra parsing):
36
- {{/cap}}
42
+ ### 1. Run the CLI once
37
43
 
38
44
  ```bash
39
- # No env — local-first dispatcher:
40
- {{#cap parallel-subagents}}
41
- [ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <screens> || npx sungen delivery <screens>
42
- {{/cap}}
43
- {{^cap parallel-subagents}}
44
45
  [ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <names> || npx sungen delivery <names>
45
- {{/cap}}
46
-
47
- # Locale-specific:
48
- {{#cap parallel-subagents}}
49
- [ -x ./bin/sungen.js ] && SUNGEN_ENV=<locale> ./bin/sungen.js delivery <screens> || SUNGEN_ENV=<locale> npx sungen delivery <screens>
50
- {{/cap}}
51
- {{^cap parallel-subagents}}
52
- [ -x ./bin/sungen.js ] && SUNGEN_ENV=<locale> ./bin/sungen.js delivery <names> || SUNGEN_ENV=<locale> npx sungen delivery <names>
53
- {{/cap}}
46
+ ```
47
+ (prepend `SUNGEN_ENV=<locale>` when `--env` was given; append `--format <fmt>` when the user asked
48
+ for a non-default format; append `--legacy` when requested — then skip to step 5.)
49
+
50
+ Three outcomes per target:
51
+ - **Rendered** → done, go to step 5.
52
+ - **"no delivery map"** → go to step 2 (propose it).
53
+ - **Gate findings / "not approved"** go to step 4 (review & approve).
54
+
55
+ On a sweep, read the **"Not exported"** list at the end: units marked *not authored yet* need
56
+ `/sungen:create-test` first, the others each printed their own reason above (missing map, gate
57
+ errors, or awaiting approval). Handle them one unit at a time — do not re-run the sweep expecting
58
+ a different result.
59
+
60
+ ### 2. Propose the Delivery Map (only when missing or the user asks to regroup)
61
+
62
+ Read the unit's `.feature` (and `requirements/spec.md` for target naming). Write
63
+ `qa/<screens|flows|api>/<unit>/delivery/<unit>.map.yaml`:
64
+
65
+ ```yaml
66
+ version: 1
67
+ unit: <unit>
68
+ groups:
69
+ - id: DI-<TARGET>-<THEME> # stable kebab id, never renumbered
70
+ target: login.email # ONE target: field/component dot-path, flow phrase, or METHOD /path
71
+ intent: <one behavior/rule this item verifies>
72
+ oracle: <the shared observable Pass/Fail statement>
73
+ dimensions: violated rule — required ×3 · format ×10 · full-width ×2 # see below
74
+ category: normal | abnormal | security | nfr # see the rule below
75
+ review: proposed # ALWAYS proposed — only QA approval flips it
76
+ variants: [VP-VAL-001-B, VP-VAL-001-S] # the scenario ids of THIS project (VP-…, SEC-123, MS-HP-001 —
77
+ # whatever the titles use); a bare id on a @cases scenario = all its rows
78
+ dispositions: # scenarios intentionally NOT delivered as test cases
79
+ VP-DATA-000: { as: excluded, reason: data-setup checklist }
80
+ # as: excluded | blocked | covered_elsewhere | accepted_risk
81
+ ```
82
+
83
+ **Grouping rules (the aggregation signature) — group COMPACTLY.** The matrix exists to be
84
+ substantially shorter than the scenario list, so a reviewer can see missing viewpoints at a
85
+ glance. Merge whenever the cases share ALL of: target · test intent/business rule ·
86
+ precondition/condition · trigger or procedure shape · **the way the expected result is
87
+ determined** (its oracle *family*, not its exact message).
88
+
89
+ - **Oracle family = the determination method, parameterized.** All validation branches of ONE
90
+ field belong to ONE item — required, format, length, character-class are *expected branches*
91
+ (parameters) of "the field shows the validation message defined for the violated rule", shown
92
+ per variant, never separate items.
93
+ - MAY vary inside one item (coverage dimensions, visible on the sub-rows): data values, boundary
94
+ points, **account states** (a seeded/locked/deleted account next to a wrong-password case),
95
+ provider/browser/locale, `@cases` rows, a different trigger with the same oracle (blur vs
96
+ submit), **execution mode** (auto + manual mix — the parent shows `Auto n · Manual m`), and
97
+ **priority** (the item takes the highest; per-variant priorities stay visible).
98
+ - MUST split: different target, different intent/business rule, different way of determining the
99
+ expected result (a field-error family ≠ a session-established family), different test layer
100
+ (`@api`/`@query`), materially different precondition, or a different procedure shape —
101
+ sequence-sensitive flows (re-Given/When after a Then) stay solo. **Different risk classes never
102
+ merge**: XSS and SQL injection are separate items (different risk and determination), even on
103
+ the same field.
104
+ - **Look for these families before settling on a grouping** — they are where under-merging happens:
105
+ | Family | Merge into one item |
106
+ |---|---|
107
+ | Static render | every "element X is visible/has its content on load" scenario of the screen — title, instructions, progress step, buttons present, header/footer |
108
+ | Field validation branches | all rules of ONE field (required · format · length · character class · full-width) |
109
+ | Account/entity states | wrong-credentials · locked · deleted · unverified for the same rejection oracle |
110
+ | Provider / surface sets | the 3 OAuth providers, header+footer, the a11y surfaces of one behaviour |
111
+ | Lifetime / mode pairs | checked vs unchecked, mobile vs desktop, when the oracle is one rule with two branches |
112
+ On a 36-scenario screen, four separate one-variant "renders on load" items should have been one.
113
+ - When unsure, keep items separate — the gates and QA decide, never guess-merge.
114
+ - Every scenario must land in exactly one group **or** one disposition (Gate B enforces 100%
115
+ disposition). Data-setup blocks (`@manual:data-setup`) → `excluded`; SPEC-GAP placeholders →
116
+ `blocked`.
117
+
118
+ **`dimensions:` — the compact coverage digest (required for items with >3 variants).**
119
+ This one short line is what the collapsed parent row shows instead of listing every variant, so a
120
+ reviewer sees *which dimensions* the item covers without expanding it. Name the dimension, then the
121
+ branches with counts:
122
+ - `violated rule — required ×3 · format ×10 · full-width ×2`
123
+ - `account state — wrong password · unregistered · locked · soft-deleted`
124
+ - `submission method — Login button · Enter in Password · Enter in Email`
125
+
126
+ Keep it ≤120 chars (Gate W warns). **YAML caveat:** a bare `: ` inside the value breaks the parse —
127
+ use ` — ` as the label separator (as above) or quote the whole string.
128
+
129
+ **`category` is not free choice for two classes (Gate K checks it):** a group whose variants are
130
+ `VP-SEC-*` MUST be `category: security`, and `VP-NFR-*` MUST be `nfr` — otherwise the Coverage
131
+ sheet's security/nfr column renders empty and the grid reports a gap the unit does not have while
132
+ hiding the work it does have. `normal` vs `abnormal` stays your judgement.
133
+
134
+ **Wording rules for `intent`/`oracle` (customer-facing — Gate W lints these):**
135
+ - Plain product language, present simple, ~10–20 words, one behavior:
136
+ "A user can sign in with valid credentials and is redirected to the Jobs page."
137
+ - Oracle = the observable outcome as a definite assertion ("The Jobs page is displayed and the
138
+ Logout link is visible.") — no `should`, no tester actions.
139
+ - NEVER: `{{tokens}}`, `[Selector]` references, DSL phrasing (`User fill/click/see`), generator
140
+ labels (`Setup:`/`Observable:`/`Oracle:`), or vague verbs (`handles`, `surfaces`) when a precise
141
+ behavior exists. Use the visible UI label (the Login button, the Email field).
142
+ - **Preserve the source meaning exactly** — never strengthen, weaken, or reinterpret an oracle
143
+ (a security assertion especially: if the source says "the password appears ONLY in the HTTPS
144
+ POST body", do not write "no plaintext password on the network").
145
+
146
+ **Requirement coverage (`requirements:` section, optional):** `sungen delivery` scans
147
+ `requirements/spec.md` for FR-/TR-/NFR- ids; ids traced by `@spec:` tags are `covered`, the rest
148
+ are `gap` (Gate R warning). Record the reviewed status for genuine non-gaps:
149
+
150
+ ```yaml
151
+ requirements:
152
+ TR-007: { status: planned, note: Performance needs Lighthouse-style tooling }
153
+ TR-004: { status: partially_covered, note: client-side covered by VP-SEC-003; hashing needs DB verify }
154
+ # status: covered | partially_covered | covered_elsewhere | planned | gap | not_applicable
155
+ ```
156
+
157
+ **Never write `status: covered` for a requirement no variant traces to** (Gate R flags it). A note
158
+ saying "proven by DI-SEC-CSRF" is prose — nothing detects it when that scenario later changes. If a
159
+ scenario in THIS feature proves the requirement, **add `@spec:<id>` to that scenario** so the trace
160
+ is real, then drop the override (it derives as `covered` on its own). Use `covered_elsewhere` only
161
+ when another suite proves it, and name that suite; `not_applicable` when the spec itself excludes
162
+ the requirement.
163
+
164
+ Then validate and fix any ERROR findings:
165
+
166
+ ```bash
167
+ [ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <unit> --check || npx sungen delivery <unit> --check
54
168
  ```
55
169
 
56
- {{#cap parallel-subagents}}
57
- - If no screen args → omit `<screens>` (CLI processes all targets).
58
- {{/cap}}
59
- {{^cap parallel-subagents}}
60
- - If no name args omit `<names>` (CLI processes all targets).
61
- {{/cap}}
62
- - If `--env <locale>` was provided → prepend `SUNGEN_ENV=<locale>` to the command. Do NOT pass `--env` to the CLI itself — it's not a CLI flag, only a slash-command convenience.
63
-
64
- The CLI handles:
65
- {{#cap parallel-subagents}}
66
- - Scope detection (all screens + flows vs specific)
67
- {{/cap}}
68
- {{^cap parallel-subagents}}
69
- - Scope detection (all screens + flows vs specific names)
70
- - Auto-detect: `qa/flows/<name>/` flow, `qa/screens/<name>/` screen
71
- {{/cap}}
72
- - Pre-flight source checks with colorful output
73
- - Parsing `.feature`, `.spec.ts`, `test-data.yaml` (+ `<name>.<env>.yaml` overlay when `SUNGEN_ENV` is set), and per-target `<name>-test-result[.<env>].json`
74
- - Generating CSV/XLSX at `qa/deliverables/<name>-testcases[.<env>].csv` / `.xlsx`
75
- - Printing summary table
76
-
77
- ### 2. Handle pre-flight failures (if CLI exits non-zero)
78
-
79
- {{#cap parallel-subagents}}
80
- If the CLI exits with blocking issues, it will have already printed a clear table showing exactly what's missing per screen.
81
- {{/cap}}
82
- {{^cap parallel-subagents}}
83
- If the CLI exits with blocking issues, it will have already printed a clear table showing exactly what's missing per target.
84
- {{/cap}}
85
-
86
- Use `AskUserQuestion` to offer next steps:
87
-
88
- **Options:**
89
- - **Fix missing sources** (Recommended) — Print the suggested commands from CLI output and stop. User will run those commands manually, then re-invoke `/sungen:delivery`.
90
- {{#cap parallel-subagents}}
91
- - **Continue with available screens** — Re-run as `npx sungen delivery <screens> --continue-on-missing` to skip screens with blocking issues.
92
- {{/cap}}
93
- {{^cap parallel-subagents}}
94
- - **Continue with available targets** — Re-run as `npx sungen delivery <names> --continue-on-missing` to skip targets with blocking issues.
95
- {{/cap}}
96
- - **Cancel** — Exit.
97
-
98
- ### 3. Show summary + offer next steps (on success)
99
-
100
- Forward the CLI's summary table to the user verbatim. Then use `AskUserQuestion`:
101
-
102
- - **Open a specific CSV** — Help user inspect one of the exported files with Read tool.
103
- {{#cap parallel-subagents}}
104
- - **Run tests to refresh results** — Suggest `/sungen:run-test <screen>` to update `test-results/results.json`, then re-run delivery.
105
- - **Export another screen** — User can run `/sungen:delivery <other-screen>`.
106
- {{/cap}}
107
- {{^cap parallel-subagents}}
108
- - **Run tests to refresh results** — Suggest `/sungen-run-test <name>` to update test results, then re-run delivery.
109
- - **Export another target** — User can run `/sungen-delivery <other-name>`.
110
- {{/cap}}
111
- - **Done** — Exit.
170
+ ### 3. Present the grouping for review
171
+
172
+ Show the user a compact summary: item count vs variant count, the groups (id · target · intent ·
173
+ variant count), dispositions, and every remaining `review`-level finding (oracle-shape /
174
+ precondition heuristics these are exactly what QA must confirm). Then `AskUserQuestion`:
175
+
176
+ - **Approve all groups** (Recommended when the findings look right)
177
+ - **Adjust the grouping** — user names the groups to change; edit the map, re-run `--check`, re-present.
178
+ - **Preview draft first** — `sungen delivery <unit> --preview` (DRAFT watermark), then re-ask.
179
+ - **Cancel**
180
+
181
+ ### 4. Approve + official render
182
+
183
+ ```bash
184
+ [ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <unit> --approve || npx sungen delivery <unit> --approve
185
+ [ -x ./bin/sungen.js ] && ./bin/sungen.js delivery <unit> || npx sungen delivery <unit>
186
+ ```
187
+
188
+ `--approve` stamps scenario fingerprints into the map — if the `.feature` changes later, Gate E
189
+ flips the affected groups back to review (drift). Approved + unchanged groups render without
190
+ re-asking.
191
+
192
+ ### 5. Show summary + offer next steps
193
+
194
+ Forward the CLI summary verbatim (Items = review rows; **Variants = execution units progress is
195
+ counted in variants, never items**). Then `AskUserQuestion`:
196
+
197
+ - **Open the workbook** inspect `qa/deliverables/<unit>-testcases.xlsx` (Testcases sheet:
198
+ collapse outline level 1 for the customer view; Coverage sheet: target × category grid + gaps).
199
+ - **Run tests to refresh results** — `/sungen:run-test <unit>`, then re-run delivery.
200
+ - **Also export CSV** — `sungen delivery <unit> --format csv` (flat `item`/`variant` rows for pipelines).
201
+ - **Export the legacy workbook too** — `sungen delivery <unit> --legacy`.
202
+ - **Done**
112
203
 
113
204
  ## Important notes
114
205
 
115
- - **Do NOT parse files yourself** — the CLI is the source of truth for parsing logic. Your job is orchestration + user interaction.
116
- - **Do NOT modify feature/spec.ts/test-data files** the delivery is read-only.
117
- - **The CLI already respects `@manual` tags, skips `@steps:` base scenarios, groups by Category 2, and generates UTF-8 BOM CSV for Excel compatibility with Vietnamese.**
118
- - **Pre-flight check is built into the CLI** — use `--skip-preflight` only in CI/automated pipelines where checks are done externally.
206
+ - **Do NOT parse/duplicate what the CLI computes** gates recompute mode/layer/priority/oracle
207
+ shapes from the `.feature`; the map only carries the semantic fields (target/intent/oracle/
208
+ category/grouping).
209
+ - **Never write `review: approved` yourself** — only `--approve` after the user agreed. Proposing
210
+ with `review: approved` defeats the QA review this format exists for.
211
+ - **Do NOT modify feature/test-data files during delivery** — read-only except the map file.
212
+ - The map is committed and stable: adding a group never renumbers others; deleting scenarios →
213
+ update the map (Gate B lists exactly what's unmapped/stale).
119
214
 
120
- ## CLI Reference
215
+ ## CLI reference
121
216
 
122
217
  ```
123
- {{#cap parallel-subagents}}
124
- sungen delivery [screens...]
125
- {{/cap}}
126
- {{^cap parallel-subagents}}
127
- sungen delivery [names...]
128
- {{/cap}}
129
- [--skip-preflight] Skip pre-flight checks (not recommended)
130
- {{#cap parallel-subagents}}
131
- [--continue-on-missing] Skip screens with blocking misses
132
- {{/cap}}
133
- {{^cap parallel-subagents}}
134
- [--continue-on-missing] Skip targets with blocking misses
135
- {{/cap}}
136
-
137
- # Locale-aware export (env var, not a CLI flag):
138
- {{#cap parallel-subagents}}
139
- SUNGEN_ENV=<locale> sungen delivery [screens...]
140
- {{/cap}}
141
- {{^cap parallel-subagents}}
142
- SUNGEN_ENV=<locale> sungen delivery [names...]
143
- {{/cap}}
144
- → reads <name>.<locale>.yaml overlay, picks <name>-test-result.<locale>.json,
145
- writes <name>-testcases.<locale>.csv / .xlsx
218
+ sungen delivery [names...] # matrix (default; needs the map) → XLSX only
219
+ --format <xlsx|csv|both> # output format; default xlsx (one artifact)
220
+ --check # gates only — validate the map, write nothing
221
+ --approve [DI-a,DI-b] # flip proposed→approved (+ stamp fingerprints); all groups when bare
222
+ --preview # render despite review findings (DRAFT watermark)
223
+ --legacy | --full # classic per-scenario workbook (no map needed)
224
+ --skip-preflight | --continue-on-missing | --env <env> # as before
146
225
  ```
226
+
227
+ Outputs: `qa/deliverables/<unit>-testcases.xlsx` (Testcases + Coverage sheets) by default;
228
+ `--format csv` writes `<unit>-testcases.csv` instead (flat, `Level` column `item|variant`),
229
+ `--format both` writes both. Legacy mode writes the classic files instead.
@@ -30,7 +30,7 @@ You generate 3 files for sungen — a Gherkin compiler that produces Playwright
30
30
  | `/sungen:create-data-test <name>` | Generate standardized test-data (valid/boundary/invalid + CHK trace) from the Data Factory catalog; no name = all units (asks to confirm) |
31
31
  | `/sungen:review <name>` | Score syntax, coverage, viewpoint quality (auto-detects screen or flow) |
32
32
  | `/sungen:run-test <name>` | Generate `selectors.yaml`, compile, run, auto-fix (auto-detects screen or flow) |
33
- | `/sungen:delivery [name...]` | Export test cases CSV for QA delivery (all screens if no arg) |
33
+ | `/sungen:delivery [name...]` | Export the Test Case & Coverage Matrix (review/manual/customer deliverable; `--legacy` = classic CSV; all screens if no arg) |
34
34
  | `/sungen:locale <name> <locale>` | Bootstrap i18n for a screen — audit selectors, detect locale switch, generate overlay (run before `/sungen:run-test --env <locale>`) |
35
35
 
36
36
  **Screen path:** add-screen → create-test → review → run-test → delivery.
@@ -30,7 +30,7 @@ You generate 3 files for sungen — a Gherkin compiler that produces Playwright
30
30
  | `/sungen-create-data-test <name>` | Generate standardized test-data (valid/boundary/invalid + CHK trace) from the Data Factory catalog; no name = all units (asks to confirm) |
31
31
  | `/sungen-review <name>` | Score syntax, coverage, viewpoint quality (auto-detects screen or flow) |
32
32
  | `/sungen-run-test <name>` | Generate `selectors.yaml`, compile, run, auto-fix (auto-detects screen or flow) |
33
- | `/sungen-delivery [name...]` | Export test cases CSV for QA delivery (all screens if no arg) |
33
+ | `/sungen-delivery [name...]` | Export the Test Case & Coverage Matrix (review/manual/customer deliverable; `--legacy` = classic CSV; all screens if no arg) |
34
34
  | `/sungen-locale <name> <locale>` | Bootstrap i18n for a screen — audit selectors, detect locale switch, generate overlay (run before `/sungen-run-test --env <locale>`) |
35
35
 
36
36
  **Screen path:** add-screen → create-test → review → run-test → delivery.
@@ -1,21 +1,117 @@
1
1
  ---
2
2
  name: sungen-delivery
3
- description: 'Export Gherkin scenarios + Playwright results CSV test case deliverable. Auto-loaded by delivery command.'
3
+ description: 'Export the Test Case & Coverage Matrix (or the legacy per-scenario CSV) from Gherkin + Playwright results. Auto-loaded by delivery command.'
4
4
  user-invocable: false
5
5
  ---
6
6
 
7
7
  ## Purpose
8
8
 
9
- Export test cases from Sungen screens and flows to a standardized CSV file (format BM-2-901-13) for QA delivery.
9
+ Export test cases from Sungen units to the QA deliverable. Two modes:
10
10
 
11
- **This skill delegates all heavy work to the `sungen delivery` CLI.** The CLI is the single source of truth for parsing logic — do NOT re-parse files in AI. Your role is only to:
11
+ - **Matrix (default)** the **Test Case & Coverage Matrix**: one row per *delivery item* (one
12
+ target + one test intent + one oracle family); scenarios / `@cases` rows stay as collapsible
13
+ *coverage variant* sub-rows. Built for review, manual execution, customer hand-off, and
14
+ reporting — no numbered step dumps.
15
+ - **Legacy (`--legacy`/`--full`)** — the classic per-scenario BM-2-901-13 workbook (documented
16
+ in the second half of this skill; unchanged).
12
17
 
13
- 1. Invoke the CLI
14
- 2. Show its output verbatim
15
- 3. Help the user react to pre-flight failures
18
+ **This skill delegates all heavy work to the `sungen delivery` CLI.** The CLI is the single source
19
+ of truth for parsing + gating. The AI's only semantic contribution is **proposing the Delivery
20
+ Map** (grouping) — everything else is: invoke the CLI, show output verbatim, help on failures.
16
21
 
17
22
  ---
18
23
 
24
+ ## Matrix mode — the Delivery Map
25
+
26
+ `qa/<screens|flows|api>/<unit>/delivery/<unit>.map.yaml` — committed, AI-proposed
27
+ (`review: proposed`), gate-validated, QA-approved (`sungen delivery --approve` stamps scenario
28
+ fingerprints). Schema + grouping rules live in the delivery command instructions; the normative
29
+ spec is `docs/spec/delivery-coverage-matrix-spec.md`.
30
+
31
+ **Gates** (CLI `--check`): A source (VP-ids unique, oracle present, Background setup-only) ·
32
+ B mapping (every scenario in exactly one group XOR one disposition) · C aggregation (test layer
33
+ recomputed and equal within a group — **execution mode and priority are coverage dimensions, not
34
+ splits**: mixed items show `Auto n · Manual m` and take the highest variant priority; heuristic
35
+ oracle-shape/precondition mismatches are review-level, silenced once approved and unchanged) ·
36
+ D executability (precondition · condition+
37
+ data · trigger · oracle all renderable; every `{{var}}` resolves; **no template token may survive
38
+ into a rendered cell** — test-data cross-references are resolved for display) · E drift
39
+ (scenario fingerprint mismatch → back to review; the map's OWN reviewed
40
+ wording/grouping is fingerprinted as `__map__` too, so post-approval edits re-open review) · G review state (proposed groups block the official
41
+ render; `--preview` renders a DRAFT watermark) · K category class (a `VP-SEC-*` variant outside
42
+ `category: security`, or `VP-NFR-*` outside `nfr` → warning: the Coverage grid's column would render
43
+ empty and report a false gap) · R requirement coverage (spec FR/TR/NFR ids with no trace and no
44
+ `requirements:` status → warning; **and a `status: covered` override that no variant traces to** →
45
+ warning: tag the proving scenario `@spec:<id>` instead of asserting it in prose) · W wording lint (map intent/oracle containing
46
+ tokens, `[Selector]` refs, DSL phrasing, or generator labels → warning).
47
+
48
+ **Wording normalization (deterministic, after semantic normalization):** DSL steps render as
49
+ controlled manual-test English without changing meaning — actions in the imperative (`User fill
50
+ [Email] field with X` → `Enter X in the Email field.`), expected results as observable assertions
51
+ (`User see [Jobs] page` → `The Jobs page is displayed.`), preconditions as states (`The user is
52
+ signed out.`). Manual `# Tester verifies:` labels become structured fields: `Setup:` →
53
+ Precondition, `Action:` → Action, `Observable:` → Expected Result, `Oracle:` → a separate
54
+ `Verification method:` line. Sequence-sensitive flows keep event order: actions numbered with
55
+ mid-flow assertions inline as `Verify: …`; only the final Then block is the Expected Result.
56
+ Empty test values render as `(empty)`.
57
+
58
+ **Output format**: **XLSX only by default** (one artifact). `--format csv` writes the flat CSV
59
+ instead; `--format both` writes both.
60
+
61
+ **Scope decides strictness**: a **named** unit that is not ready aborts with exit 1 (pass
62
+ `--continue-on-missing` to tolerate it); a **no-argument sweep** exports every ready unit, lists
63
+ every unit it did not export with the reason, and exits 0 as long as it wrote something — a
64
+ scaffolded unit never blocks the ready ones.
65
+
66
+ **Workbook**: `Testcases` sheet — parent rows + outline-level-1 variant sub-rows for **every**
67
+ item (single-variant included: the sub-row carries the source VP-id, resolved data, and the
68
+ result/evidence entry). Sub-rows are **delta-only**: knowledge common to the whole item
69
+ (precondition, trigger) is written ONCE on the parent; a child repeats only what distinguishes it
70
+ (condition/data, precondition delta, trigger when it differs) plus its own precise oracle and
71
+ execution fields. The parent never carries placeholder text — when triggers differ the cell is
72
+ simply empty and the sub-rows carry them.
73
+
74
+ Parent preconditions are the **intersection** of the variants' and the parent's Action holds the
75
+ **shared leading steps**; each variant renders only its remaining steps, numbered to continue the
76
+ parent's list — so a shared prefix is written once, not repeated on every child. The parent's
77
+ Coverage cell is the map's short `dimensions:` digest (or the variant refs when none is declared),
78
+ never a concatenation of variant titles.
79
+
80
+ Variant Result cells hold exactly one of `Passed`/`Failed`/`Blocked`/`Pending`/`N/A` (dropdown) —
81
+ that vocabulary is the contract: the parent Result and the summary band are **live Excel formulas**
82
+ counting those words, so a parent label is always a composed `n/m Passed …` string (`All N/A` when
83
+ every variant is N/A) and never a bare state word. **`N/A` leaves the denominator.** Evidence and
84
+ Defect ID are separate columns; ID + Target frozen; ISO dates; landscape print with repeated
85
+ header rows.
86
+
87
+ `Coverage` sheet — requirement coverage table (every FR/TR/NFR id with an explicit status),
88
+ target × category grid with explicit `—` gaps, dispositions, manifest. CSV mirrors the same model
89
+ flat with a `Level` column (`item`/`variant`) + a requirement-coverage appendix.
90
+ `delivery_item_count` ≠ progress — variants are the execution metric.
91
+
92
+ **Id schemes**: the `VP-<CAT>-<NNN>` convention is a suggestion, not a requirement — a project's own
93
+ scheme (`SEC-123`, `PER-345`, `MS-HP-001`) is addressed the same way, and the category segment
94
+ (`SEC`, `PER`) still drives Gate K. Requirement ids come from the spec's own bolded declarations
95
+ (`- **REQ-12**: …`), so a project that does not use FR/TR/NFR still gets its coverage table.
96
+
97
+ **Runtime-captured values**: a scenario may produce its own values — `User remember [X] text as
98
+ {{v}}` (compared later) or a capability binding (`@query:`/`@api:`/`@dataFactory:`). These never
99
+ exist in test-data, so Gate D does not ask for them: the capture step renders as an instruction
100
+ (`Note the X text for later (as "v")`) and later references read `the captured v`.
101
+
102
+ **Data fidelity**: invisible test data is made visible, never normalized — `''` → `(empty)`,
103
+ whitespace-only → `(5 spaces)`, padded → `" value "` quoted verbatim. A trim/collapse here would
104
+ silently break the whitespace tests it describes.
105
+
106
+ **Authoring guidance the matrix rewards** (create-test side): payload/provider matrices (SQLi
107
+ payload lists, OAuth provider sets) belong in `@cases` datasets so each case is an atomic,
108
+ independently-reportable variant; keep dataset `case:` labels short and stable (`CHK-EMAIL-I1`),
109
+ with descriptions in other columns — the label is part of the variant's identity.
110
+
111
+ ---
112
+
113
+ ## Legacy mode (--legacy / --full)
114
+
19
115
  ## Architecture
20
116
 
21
117
  ```
@@ -295,6 +295,7 @@ Options: `nth` `exact` `scope` `match` `variant` `frame` `contenteditable` `colu
295
295
 
296
296
  | Tag | Effect |
297
297
  |---|---|
298
+ | `@spec:<id>` | **Traceability**: this scenario proves requirement `<id>` from `requirements/spec.md` (`@spec:FR-003`). Repeatable — a scenario may prove several. Read by `sungen audit` (requirement coverage) and by delivery (the Coverage sheet's requirement table). Without it the link is only inferred from wording and cannot survive an edit. |
298
299
  | `@manual` | Skip in generation |
299
300
  | `@auth:role` | Use auth storage state for role |
300
301
  | `@no-auth` | Disable inherited auth |
@@ -4,6 +4,28 @@ description: 'Use when create-test needs to translate spec.md/Figma/UI into .fea
4
4
  user-invocable: false
5
5
  ---
6
6
 
7
+
8
+ ## Traceability — tag the requirement each scenario proves
9
+
10
+ Every requirement id in `requirements/spec.md` (`FR-`/`TR-`/`NFR-`) must be reachable from a
11
+ scenario, and the link must be **written down, not inferred**:
12
+
13
+ ```gherkin
14
+ @high @spec:FR-003
15
+ Scenario: VP-VAL-002 An email in an invalid format shows the format error
16
+ ```
17
+
18
+ - Put `@spec:<id>` on the scenario that actually proves the requirement; repeat the tag when one
19
+ scenario proves several (`@spec:FR-003 @spec:FR-004`).
20
+ - One requirement may be proved by several scenarios — tag each of them.
21
+ - A requirement you deliberately do not cover here (performance budget, i18n suite, server-side
22
+ concern) needs no tag; record it later in the delivery map's `requirements:` section with a
23
+ status and reason.
24
+ - Why it matters: `sungen audit` also counts a requirement as covered when its keywords merely
25
+ resemble a scenario title, and reports `SPEC-TRACE-IMPLICIT` for those. Delivery's requirement
26
+ table follows **only** the explicit tag — an untagged requirement reads as an uncovered gap in
27
+ the customer-facing coverage sheet even when a scenario does prove it.
28
+
7
29
  ## ⚠️ Gotchas — read before generating
8
30
 
9
31
  - **Field-level test-data follows the Data Factory standard — don't hand-invent values.** When the unit has input fields, the field values (valid / boundary / invalid + error codes) come from the **`sungen-data-factory`** catalog via a field-map + `sungen data gen` (create-test step 5.3), not free-form guessing. Weave the standardized boundary/invalid sets into `@cases` with `CHK-*` trace. This skill still owns scenario structure, viewpoints, and non-field oracles.
@@ -318,6 +340,7 @@ Security: [S1 – admin only]
318
340
  `sungen audit` enforces these. Generate compliant output up front:
319
341
 
320
342
  1. **Taxonomy-match** (`VP-TAXONOMY-MISMATCH`, gate-FAIL) — when `test-viewpoint.md` declares its own viewpoint IDs (e.g. `VP0`, `VP1`, … `VP12`, `MS-HP-001`, `MS-EH-001`), **reuse those IDs verbatim as the scenario codes**. Do NOT invent a generic `VP-UI / VP-LOGIC / VP-VAL` scheme — that breaks the coverage matrix. Only fall back to `VP-<CATEGORY>-<NNN>` when the viewpoint file declares no IDs.
343
+ - **Match the scenarios to the file — never the file to the scenarios.** A filled `test-viewpoint.md` is an input; do not rewrite its declarations to fit what you generated. That is not compliance, it is moving the yardstick: `traceability` + `atomicLedger` then read 100% by construction and a dropped viewpoint stops being missing from anything. Disagree with the taxonomy → propose the diff and ask. `sungen audit` reports `VIEWPOINT-BASELINE-CHANGED` and excludes both axes until a human accepts the change (`sungen audit --screen <name> --accept-viewpoint`).
321
344
  2. **Spec-coverage triggers** (`TRIGGER-UNCOVERED`, gate-FAIL) — the Validation-Rules table lists a **trigger** per constraint (e.g. `blur, submit`). Generate one scenario **per (constraint × trigger)** — a `format` rule validating *on blur AND on submit* needs BOTH a blur scenario (`press Tab`) and a submit scenario (`click [Submit]` / `press Enter`). Never collapse the trigger × input matrix to one representative case.
322
345
  3. **Claim-Proof** (`CLAIM-UNPROVEN`) — a title claiming `all`/`only`/`every`/`single`/`correct`/`same`/`changes`/`hidden`/`cleared`/`restored`/`independent`/`sanitized`/`announces` MUST have the matching assertion (`see all …`, count, `remember`+compare, `is hidden`, return-and-assert-empty, etc.). If the title promises it, the steps must prove it.
323
346
  - **Negative / absence claims** (`does not` / `no` / `never` / `prevents` / `không` / `chưa` — any language; `no-side-effect/no-duplicate`, `negative-claim/absence`): the `Then` must **differ** between the claim holding and not holding. A terminal `see [X] page` that looks identical whether or not the bad thing happened proves nothing. For a side-effect that should NOT repeat (re-submit on back, re-charge, duplicate order, resend OTP), assert the **count is unchanged** (`User see [Records] table with {{one}}` / `row with {{count}}`); if it's not UI-observable, mark `@manual` with a request-count oracle (shape below). This is general — it covers any side-effect, not a fixed verb list.