@sun-asterisk/sungen 3.2.28 → 3.2.29

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 (217) hide show
  1. package/dist/capabilities/discover.d.ts +29 -0
  2. package/dist/capabilities/discover.d.ts.map +1 -1
  3. package/dist/capabilities/discover.js +144 -10
  4. package/dist/capabilities/discover.js.map +1 -1
  5. package/dist/capabilities/registry.d.ts +18 -0
  6. package/dist/capabilities/registry.d.ts.map +1 -1
  7. package/dist/capabilities/registry.js +25 -0
  8. package/dist/capabilities/registry.js.map +1 -1
  9. package/dist/cli/commands/audit.d.ts.map +1 -1
  10. package/dist/cli/commands/audit.js +9 -0
  11. package/dist/cli/commands/audit.js.map +1 -1
  12. package/dist/cli/commands/capability.js +1 -1
  13. package/dist/cli/commands/capability.js.map +1 -1
  14. package/dist/dashboard/templates/index.html +1 -1
  15. package/dist/exporters/feature-parser.d.ts +1 -1
  16. package/dist/exporters/feature-parser.js +1 -1
  17. package/dist/exporters/matrix/build.d.ts.map +1 -1
  18. package/dist/exporters/matrix/build.js +14 -1
  19. package/dist/exporters/matrix/build.js.map +1 -1
  20. package/dist/exporters/matrix/item-labels.d.ts +35 -0
  21. package/dist/exporters/matrix/item-labels.d.ts.map +1 -0
  22. package/dist/exporters/matrix/item-labels.js +90 -0
  23. package/dist/exporters/matrix/item-labels.js.map +1 -0
  24. package/dist/exporters/matrix/render-coverage-sheet.d.ts +14 -0
  25. package/dist/exporters/matrix/render-coverage-sheet.d.ts.map +1 -0
  26. package/dist/exporters/matrix/render-coverage-sheet.js +160 -0
  27. package/dist/exporters/matrix/render-coverage-sheet.js.map +1 -0
  28. package/dist/exporters/matrix/render-overview-sheet.d.ts +20 -0
  29. package/dist/exporters/matrix/render-overview-sheet.d.ts.map +1 -0
  30. package/dist/exporters/matrix/render-overview-sheet.js +36 -0
  31. package/dist/exporters/matrix/render-overview-sheet.js.map +1 -0
  32. package/dist/exporters/matrix/render-testcase-sheet.d.ts +30 -0
  33. package/dist/exporters/matrix/render-testcase-sheet.d.ts.map +1 -0
  34. package/dist/exporters/matrix/render-testcase-sheet.js +156 -0
  35. package/dist/exporters/matrix/render-testcase-sheet.js.map +1 -0
  36. package/dist/exporters/matrix/render-xlsx.d.ts +41 -31
  37. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -1
  38. package/dist/exporters/matrix/render-xlsx.js +72 -425
  39. package/dist/exporters/matrix/render-xlsx.js.map +1 -1
  40. package/dist/exporters/matrix/testcase-summary-band.d.ts +30 -0
  41. package/dist/exporters/matrix/testcase-summary-band.d.ts.map +1 -0
  42. package/dist/exporters/matrix/testcase-summary-band.js +75 -0
  43. package/dist/exporters/matrix/testcase-summary-band.js.map +1 -0
  44. package/dist/exporters/matrix/wording.d.ts.map +1 -1
  45. package/dist/exporters/matrix/wording.js +13 -0
  46. package/dist/exporters/matrix/wording.js.map +1 -1
  47. package/dist/exporters/matrix/xlsx-cells.d.ts +38 -0
  48. package/dist/exporters/matrix/xlsx-cells.d.ts.map +1 -0
  49. package/dist/exporters/matrix/xlsx-cells.js +52 -0
  50. package/dist/exporters/matrix/xlsx-cells.js.map +1 -0
  51. package/dist/exporters/xlsx-report-builder.d.ts +12 -1
  52. package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
  53. package/dist/exporters/xlsx-report-builder.js +10 -2
  54. package/dist/exporters/xlsx-report-builder.js.map +1 -1
  55. package/dist/generators/gherkin-parser/index.d.ts +7 -0
  56. package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
  57. package/dist/generators/gherkin-parser/index.js +3 -3
  58. package/dist/generators/gherkin-parser/index.js.map +1 -1
  59. package/dist/generators/test-generator/adapters/appium/os-support.d.ts +53 -0
  60. package/dist/generators/test-generator/adapters/appium/os-support.d.ts.map +1 -0
  61. package/dist/generators/test-generator/adapters/appium/os-support.js +200 -0
  62. package/dist/generators/test-generator/adapters/appium/os-support.js.map +1 -0
  63. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/alert-fill-action.hbs +9 -2
  64. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/capture-variable.hbs +24 -1
  65. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/hover-action.hbs +6 -2
  66. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/hover-element-with-text.hbs +4 -3
  67. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/unknown-element-action.hbs +9 -0
  68. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/have-value-assertion.hbs +34 -1
  69. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +14 -6
  70. package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/go-back-action.hbs +21 -0
  71. package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/set-geolocation-action.hbs +16 -0
  72. package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +8 -0
  73. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row-nth.hbs +4 -1
  74. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +4 -1
  75. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +7 -0
  76. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +7 -0
  77. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-empty.hbs +4 -1
  78. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-match-data.hbs +4 -1
  79. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-count.hbs +4 -1
  80. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-exists.hbs +12 -4
  81. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-not-exists.hbs +14 -2
  82. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +8 -8
  83. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/id.hbs +1 -1
  84. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/testid.hbs +1 -1
  85. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +8 -8
  86. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  87. package/dist/generators/test-generator/code-generator.js +5 -1
  88. package/dist/generators/test-generator/code-generator.js.map +1 -1
  89. package/dist/generators/test-generator/diagnostics.d.ts +38 -2
  90. package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
  91. package/dist/generators/test-generator/diagnostics.js +37 -1
  92. package/dist/generators/test-generator/diagnostics.js.map +1 -1
  93. package/dist/generators/test-generator/patterns/index.d.ts +33 -6
  94. package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
  95. package/dist/generators/test-generator/patterns/index.js +71 -7
  96. package/dist/generators/test-generator/patterns/index.js.map +1 -1
  97. package/dist/generators/test-generator/patterns/types.d.ts +8 -0
  98. package/dist/generators/test-generator/patterns/types.d.ts.map +1 -1
  99. package/dist/generators/test-generator/step-mapper.d.ts +40 -1
  100. package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
  101. package/dist/generators/test-generator/step-mapper.js +100 -17
  102. package/dist/generators/test-generator/step-mapper.js.map +1 -1
  103. package/dist/generators/test-generator/utils/selector-resolver.d.ts +23 -1
  104. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  105. package/dist/generators/test-generator/utils/selector-resolver.js +78 -12
  106. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  107. package/dist/harness/audit.d.ts +3 -1
  108. package/dist/harness/audit.d.ts.map +1 -1
  109. package/dist/harness/audit.js +51 -28
  110. package/dist/harness/audit.js.map +1 -1
  111. package/dist/harness/capability-plan.d.ts +4 -0
  112. package/dist/harness/capability-plan.d.ts.map +1 -1
  113. package/dist/harness/capability-plan.js +32 -2
  114. package/dist/harness/capability-plan.js.map +1 -1
  115. package/dist/harness/catalog/drivers.yaml +1 -1
  116. package/dist/harness/catalog/universal-viewpoints.yaml +145 -0
  117. package/dist/harness/parse.d.ts +6 -0
  118. package/dist/harness/parse.d.ts.map +1 -1
  119. package/dist/harness/parse.js +1 -1
  120. package/dist/harness/parse.js.map +1 -1
  121. package/dist/harness/repair.d.ts.map +1 -1
  122. package/dist/harness/repair.js +8 -1
  123. package/dist/harness/repair.js.map +1 -1
  124. package/dist/harness/sensors.d.ts +48 -0
  125. package/dist/harness/sensors.d.ts.map +1 -1
  126. package/dist/harness/sensors.js +26 -1
  127. package/dist/harness/sensors.js.map +1 -1
  128. package/dist/harness/viewpoint-ledger.d.ts +10 -0
  129. package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
  130. package/dist/harness/viewpoint-ledger.js +23 -2
  131. package/dist/harness/viewpoint-ledger.js.map +1 -1
  132. package/dist/orchestrator/templates/ai-src/commands/delivery.md +4 -3
  133. package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -5
  134. package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +48 -1
  135. package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +18 -3
  136. package/dist/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md +16 -1
  137. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +11 -0
  138. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +10 -3
  139. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +88 -2
  140. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +58 -1
  141. package/dist/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md +13 -0
  142. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +59 -10
  143. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-f-mobile-native.md +419 -0
  144. package/dist/orchestrator/templates/readme.md +1 -1
  145. package/dist/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
  146. package/dist/orchestrator/templates/wdio.conf.ts +105 -1
  147. package/package.json +3 -3
  148. package/src/capabilities/discover.ts +146 -10
  149. package/src/capabilities/registry.ts +30 -0
  150. package/src/cli/commands/audit.ts +9 -0
  151. package/src/cli/commands/capability.ts +1 -1
  152. package/src/dashboard/templates/index.html +1 -1
  153. package/src/exporters/feature-parser.ts +1 -1
  154. package/src/exporters/matrix/build.ts +13 -1
  155. package/src/exporters/matrix/item-labels.ts +78 -0
  156. package/src/exporters/matrix/render-coverage-sheet.ts +168 -0
  157. package/src/exporters/matrix/render-overview-sheet.ts +56 -0
  158. package/src/exporters/matrix/render-testcase-sheet.ts +178 -0
  159. package/src/exporters/matrix/render-xlsx.ts +67 -448
  160. package/src/exporters/matrix/testcase-summary-band.ts +79 -0
  161. package/src/exporters/matrix/wording.ts +13 -0
  162. package/src/exporters/matrix/xlsx-cells.ts +56 -0
  163. package/src/exporters/xlsx-report-builder.ts +16 -2
  164. package/src/generators/gherkin-parser/index.ts +1 -1
  165. package/src/generators/test-generator/adapters/appium/os-support.ts +176 -0
  166. package/src/generators/test-generator/adapters/appium/templates/steps/actions/alert-fill-action.hbs +9 -2
  167. package/src/generators/test-generator/adapters/appium/templates/steps/actions/capture-variable.hbs +24 -1
  168. package/src/generators/test-generator/adapters/appium/templates/steps/actions/hover-action.hbs +6 -2
  169. package/src/generators/test-generator/adapters/appium/templates/steps/actions/hover-element-with-text.hbs +4 -3
  170. package/src/generators/test-generator/adapters/appium/templates/steps/actions/unknown-element-action.hbs +9 -0
  171. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/have-value-assertion.hbs +34 -1
  172. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +14 -6
  173. package/src/generators/test-generator/adapters/appium/templates/steps/gestures/go-back-action.hbs +21 -0
  174. package/src/generators/test-generator/adapters/appium/templates/steps/gestures/set-geolocation-action.hbs +16 -0
  175. package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +8 -0
  176. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row-nth.hbs +4 -1
  177. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +4 -1
  178. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +7 -0
  179. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +7 -0
  180. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-empty.hbs +4 -1
  181. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-match-data.hbs +4 -1
  182. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-count.hbs +4 -1
  183. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-exists.hbs +12 -4
  184. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-not-exists.hbs +14 -2
  185. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +8 -8
  186. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/id.hbs +1 -1
  187. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/testid.hbs +1 -1
  188. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +8 -8
  189. package/src/generators/test-generator/code-generator.ts +5 -1
  190. package/src/generators/test-generator/diagnostics.ts +39 -2
  191. package/src/generators/test-generator/patterns/index.ts +78 -8
  192. package/src/generators/test-generator/patterns/types.ts +8 -0
  193. package/src/generators/test-generator/step-mapper.ts +107 -17
  194. package/src/generators/test-generator/utils/selector-resolver.ts +88 -12
  195. package/src/harness/audit.ts +55 -30
  196. package/src/harness/capability-plan.ts +33 -1
  197. package/src/harness/catalog/drivers.yaml +1 -1
  198. package/src/harness/catalog/universal-viewpoints.yaml +145 -0
  199. package/src/harness/parse.ts +7 -1
  200. package/src/harness/repair.ts +8 -1
  201. package/src/harness/sensors.ts +75 -1
  202. package/src/harness/viewpoint-ledger.ts +26 -5
  203. package/src/orchestrator/templates/ai-src/commands/delivery.md +4 -3
  204. package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -5
  205. package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +48 -1
  206. package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +18 -3
  207. package/src/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md +16 -1
  208. package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +11 -0
  209. package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +10 -3
  210. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +88 -2
  211. package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +58 -1
  212. package/src/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md +13 -0
  213. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +59 -10
  214. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-f-mobile-native.md +419 -0
  215. package/src/orchestrator/templates/readme.md +1 -1
  216. package/src/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
  217. package/src/orchestrator/templates/wdio.conf.ts +105 -1
@@ -76,6 +76,9 @@ export interface CatalogTheme { theme: string; keywords: string[]; depth?: Theme
76
76
  export interface Catalog {
77
77
  page_types: Record<string, { detect_keywords: string[]; must_cover: CatalogTheme[] }>;
78
78
  universal: CatalogTheme[];
79
+ /** Reminder themes offered to MOBILE targets only — `universal` also applies to web, where
80
+ * orientation and connectivity have no meaning. Optional so an older catalog still parses. */
81
+ mobile_universal?: CatalogTheme[];
79
82
  }
80
83
 
81
84
  export function loadCatalog(): Catalog {
@@ -181,7 +184,10 @@ export function viewpointGate(scenarios: ScenarioInfo[], viewpoints: ViewpointEn
181
184
  }
182
185
  }
183
186
 
184
- const universalGaps = catalog.universal
187
+ // Mobile targets are also reminded of the native-only themes. Same weight as `universal`:
188
+ // these surface as narrative, not as score — see the note in the catalog.
189
+ const reminderThemes = [...catalog.universal, ...(isMobile ? catalog.mobile_universal ?? [] : [])];
190
+ const universalGaps = reminderThemes
185
191
  .filter((t) => !t.keywords.some((k) => has(scenarios.map((s) => s.haystack), k)))
186
192
  .map((t) => t.theme);
187
193
 
@@ -521,6 +527,74 @@ export function duplicateClusters(scenarios: ScenarioInfo[]): DuplicateResult {
521
527
  };
522
528
  }
523
529
 
530
+ // ---------- Sensor 4b: Reused scenario IDs ----------
531
+
532
+ /**
533
+ * Two DIFFERENT scenarios wearing the same `VP-<CAT>-<NNN>` id (#694).
534
+ *
535
+ * Sensor 4 above is content-shaped — it clusters identical STEP SKELETONS — so two scenarios that
536
+ * merely share an id sail past it, and every other axis stays green. `VIEWPOINT-ID-REUSED` reads
537
+ * ids out of `test-viewpoint.md` only; the `.feature`'s own `Scenario:` lines were never compared
538
+ * against each other. The reported symptom was a ledger item showing UNCOVERED — pointing at the
539
+ * wrong cause, since the scenario exists and is just wearing the wrong number.
540
+ *
541
+ * This is BLOCKING (it joins the gate conjunction) where its three declaration-integrity siblings
542
+ * are advisory, because a reused id does not stop at the audit — it reaches the client:
543
+ *
544
+ * - `generateTcId()` builds the delivered testcase id straight out of the vpId
545
+ * (`${SCREEN}-${vpCore}`), so two scenarios under one id ship as two rows with ONE id in the
546
+ * CSV/XLSX the customer reviews.
547
+ * - It has already shipped a false green. `scenario-merger.ts` records the field report: a
548
+ * feature carried `VP-NAV-001` on 14 scenarios and the result-merge fallback attached an
549
+ * automated sibling's result to every @manual sibling — 7 testcases nobody ran were delivered
550
+ * as "Passed". The guard added there degrades to "Pending"; it never closed the cause.
551
+ * - `matrix/gates.ts` already grades the same condition `severity: 'error'` — but at delivery,
552
+ * after generation and review. This moves that judgment to where it can still be acted on
553
+ * cheaply: renumber and regenerate.
554
+ *
555
+ * Scoped PER FILE, matching the issue's wording. A unit may hold several `.feature`s
556
+ * (`add --feature`) and ids colliding ACROSS two of them still collapse into one `generateTcId`,
557
+ * because that id keys on the screen and not on the file — deliberately out of scope here.
558
+ *
559
+ * `@cases:<dataset>` is safe: a data-driven scenario is ONE `ScenarioInfo` that expands to N row
560
+ * tests at runtime, so it can never look like a collision to this count. `Scenario Outline` is not
561
+ * a vector either — this DSL does not support it (`@cases` is the data-driven form).
562
+ *
563
+ * One CONVENTION dependency, stated rather than hidden: `vpId` is whatever leading title token
564
+ * `isIdLike` accepts (uppercase-first, alphanumeric, carries a digit), not specifically `VP-`/`FL-`.
565
+ * Two scenarios both titled `iOS15 …` would therefore read as a collision. Every generator path
566
+ * and skill doc mandates the `VP-<CAT>-<NNN>` scheme, so this has no real surface today — but it is
567
+ * a convention holding it up, not the parser.
568
+ */
569
+ export interface ReusedScenarioId {
570
+ id: string;
571
+ count: number;
572
+ titles: string[];
573
+ /** Basename of the `.feature` holding the collision; '' for hand-built scenarios with no source. */
574
+ file: string;
575
+ }
576
+
577
+ export function scenarioIdReuse(scenarios: ScenarioInfo[]): ReusedScenarioId[] {
578
+ // Keyed by file THEN id: the check is per-file, and a bare id key would silently widen it to
579
+ // the whole unit. NUL-joined because a feature path may legitimately contain a space.
580
+ const byFileAndId = new Map<string, ScenarioInfo[]>();
581
+ for (const s of scenarios) {
582
+ if (!s.vpId) continue; // an id-less scenario is a different finding
583
+ const key = `${s.sourceFile ?? ''}\u0000${s.vpId.toUpperCase()}`;
584
+ byFileAndId.set(key, [...(byFileAndId.get(key) ?? []), s]);
585
+ }
586
+ // Read the id and the file off the GROUP, never by splitting the key back apart.
587
+ return [...byFileAndId.values()]
588
+ .filter((group) => group.length > 1)
589
+ .map((group) => ({
590
+ id: group[0].vpId!.toUpperCase(),
591
+ count: group.length,
592
+ titles: group.map((s) => s.name),
593
+ file: group[0].sourceFile ? path.basename(group[0].sourceFile) : '',
594
+ }))
595
+ .sort((a, b) => b.count - a.count || a.id.localeCompare(b.id));
596
+ }
597
+
524
598
  // ---------- Sensor 5: Traceability ----------
525
599
 
526
600
  export interface TraceResult {
@@ -222,7 +222,14 @@ export function viewpointLedger(viewpointPath: string, scenarios: ScenarioInfo[]
222
222
  * The language has no reload/back step at all (#593), so the honest outcome is a `@manual`
223
223
  * deferral naming the gesture — not a silent swap.
224
224
  */
225
- const BROWSER_GESTURES: Array<{ gesture: string; re: RegExp; appSubstitute: RegExp; platform?: string }> = [
225
+ /**
226
+ * `stepForm` is the step that ANSWERS the gesture, when one exists. The web three have none
227
+ * (#593), so their honest reply is still `@manual` naming the gesture. The mobile three all
228
+ * compile now — `go back` closed the last of them (#626) — and the finding must say so, or it
229
+ * keeps telling the author to defer work the compiler can already do. Data, not a sentence in
230
+ * the finding: when a reload/back step lands for web, filling this field is the whole change.
231
+ */
232
+ const BROWSER_GESTURES: Array<{ gesture: string; re: RegExp; appSubstitute: RegExp; platform?: string; stepForm?: string }> = [
226
233
  { gesture: 'browser back', re: /\bbrowser(?:'s)?[ -]?(?:back|history)\b|\bhistory[ -]back\b/i,
227
234
  appSubstitute: /\bclick \[[^\]]*back[^\]]*\]/i, platform: 'web' },
228
235
  { gesture: 'browser reload/refresh', re: /\b(?:page |browser )?(?:reload|refresh)(?:ing|ed|es)?\b/i,
@@ -236,21 +243,35 @@ const BROWSER_GESTURES: Array<{ gesture: string; re: RegExp; appSubstitute: RegE
236
243
  // an in-app navigation never touches — so a defect that only appears on the OS path lives
237
244
  // exactly in the substitution (#626). The check was web-only, so mobile flows were silent about
238
245
  // the very risk it exists to catch.
239
- { gesture: 'the OS/hardware back gesture', platform: 'mobile',
246
+ { gesture: 'the OS/hardware back gesture', platform: 'mobile', stepForm: 'When User go back',
240
247
  re: /\b(?:hardware|system|os|device|android|physical)[ -]?back\b|\bback (?:gesture|button|swipe)\b|\bswipe[ -]back\b/i,
241
248
  appSubstitute: /\b(?:tap|click) \[[^\]]*back[^\]]*\]/i },
242
249
  { gesture: 'backgrounding and resuming the app', platform: 'mobile',
250
+ stepForm: 'When User background the app for 5 seconds',
243
251
  re: /\b(?:background(?:ing|ed)?|foreground(?:ing|ed)?|app switcher|recent apps|minimi[sz]|resum(?:e|ing)|kill(?:ed|ing)? the app|force[ -]stop|process death)\b/i,
244
252
  appSubstitute: /\b(?:tap|click) \[[^\]]+\]|is on \[[^\]]+\] screen\b/i },
245
253
  { gesture: 'rotating the device', platform: 'mobile',
254
+ stepForm: 'When User rotate the device to landscape',
246
255
  re: /\b(?:rotat(?:e|ing|ion)|landscape|portrait|orientation change)\b/i,
247
256
  appSubstitute: /\bis on \[[^\]]+\] screen\b/i },
248
257
  ];
249
258
 
259
+ /**
260
+ * The remedy sentence for one substitution. Lives beside the gesture table rather than in the
261
+ * audit finding: the table is what knows whether a step exists, and a ternary buried in
262
+ * `audit.ts` would be one branch nothing tests. Both branches are pinned in
263
+ * `tests/codegen/os-back-step.run.ts`.
264
+ */
265
+ export function substitutionRemedy(sub: { stepForm?: string }): string {
266
+ return sub.stepForm
267
+ ? `That gesture DOES have a step: write \`${sub.stepForm}\` instead of the in-app control.`
268
+ : 'The step vocabulary has no reload/back step (#593), so defer it with `@manual` naming the gesture rather than substituting silently.';
269
+ }
270
+
250
271
  export function browserGestureSubstitutions(
251
272
  viewpointPath: string, scenarios: ScenarioInfo[], platform?: string,
252
- ): Array<{ gesture: string; item: string }> {
253
- const out: Array<{ gesture: string; item: string }> = [];
273
+ ): Array<{ gesture: string; item: string; stepForm?: string }> {
274
+ const out: Array<{ gesture: string; item: string; stepForm?: string }> = [];
254
275
  // A gesture only applies where its platform does: "reload" means nothing on a native app, and
255
276
  // "backgrounding" means nothing in a browser tab. An unknown platform checks everything, which
256
277
  // is how the web-only set behaved before.
@@ -266,7 +287,7 @@ export function browserGestureSubstitutions(
266
287
  if (!g.re.test(item.text)) continue;
267
288
  // A @manual scenario whose own subject IS the gesture is the honest answer.
268
289
  if (deferred.some((h) => g.re.test(h))) break;
269
- if (automated.some((h) => g.appSubstitute.test(h))) out.push({ gesture: g.gesture, item: item.text });
290
+ if (automated.some((h) => g.appSubstitute.test(h))) out.push({ gesture: g.gesture, item: item.text, stepForm: g.stepForm });
270
291
  break;
271
292
  }
272
293
  }
@@ -201,8 +201,9 @@ re-asking.
201
201
  Forward the CLI summary verbatim (Items = review rows; **Variants = execution units — progress is
202
202
  counted in variants, never items**). Then `AskUserQuestion`:
203
203
 
204
- - **Open the workbook** — inspect `qa/deliverables/<unit>-testcases.xlsx` (Testcases sheet:
205
- collapse outline level 1 for the customer view; Coverage sheet: target × category grid + gaps).
204
+ - **Open the workbook** — inspect `qa/deliverables/<unit>-testcases.xlsx` (Overview: live roll-up;
205
+ Auto / Manual: collapse outline level 1 for the customer view; Coverage: target × category
206
+ grid + gaps).
206
207
  - **Run tests to refresh results** — `/sungen:run-test <unit>`, then re-run delivery.
207
208
  - **Also export CSV** — `sungen delivery <unit> --format csv` (flat `item`/`variant` rows for pipelines).
208
209
  - **Export the legacy workbook too** — `sungen delivery <unit> --legacy`.
@@ -231,6 +232,6 @@ sungen delivery [names...] # matrix (default; needs the map) → XLSX onl
231
232
  --skip-preflight | --continue-on-missing | --env <env> # as before
232
233
  ```
233
234
 
234
- Outputs: `qa/deliverables/<unit>-testcases.xlsx` (Testcases + Coverage sheets) by default;
235
+ Outputs: `qa/deliverables/<unit>-testcases.xlsx` (Overview + Auto + Manual + Coverage sheets) by default;
235
236
  `--format csv` writes `<unit>-testcases.csv` instead (flat, `Level` column `item|variant`),
236
237
  `--format both` writes both. Legacy mode writes the classic files instead.
@@ -63,7 +63,16 @@ instead; `--format both` writes both.
63
63
  every unit it did not export with the reason, and exits 0 as long as it wrote something — a
64
64
  scaffolded unit never blocks the ready ones.
65
65
 
66
- **Workbook**: `Testcases` sheet — parent rows + outline-level-1 variant sub-rows for **every**
66
+ **Workbook** (matrix mode): four sheets — `Overview` (live roll-up over the two below), `Auto`,
67
+ `Manual`, `Coverage`. Auto and Manual split **per variant**, so a **mixed item's parent row
68
+ appears on both**, each side carrying only its own variants and rolling up only what is on that
69
+ sheet — expect the same ID twice in the workbook, with two different numbers. Both detail sheets
70
+ always exist even when one is empty. Layout is BM-2-901-13: band on rows 6/7/8, `*: Mandatory`
71
+ legend on row 12, the 16 headers `A..P` on row 13, data from row 14, frozen at `A14`.
72
+ `Testcase type` (`K`) is variant-level (`Auto` · `Auto · Mocked` · `Manual (M6)`) and blank on a
73
+ parent row. Full detail: `docs/spec/delivery-coverage-matrix-spec.md` §8.
74
+
75
+ `Auto` / `Manual` — parent rows + outline-level-1 variant sub-rows for **every**
67
76
  item (single-variant included: the sub-row carries the source VP-id, resolved data, and the
68
77
  result/evidence entry). Sub-rows are **delta-only**: knowledge common to the whole item
69
78
  (precondition, trigger) is written ONCE on the parent; a child repeats only what distinguishes it
@@ -80,9 +89,9 @@ never a concatenation of variant titles.
80
89
  Variant Result cells hold exactly one of `Passed`/`Failed`/`Blocked`/`Pending`/`N/A` (dropdown) —
81
90
  that vocabulary is the contract: the parent Result and the summary band are **live Excel formulas**
82
91
  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.
92
+ every variant is N/A) and never a bare state word. **`N/A` leaves the denominator.** Note, Defect ID
93
+ and actual result share one column `P`; the header row is frozen; ISO dates; landscape print with
94
+ repeated header rows.
86
95
 
87
96
  `Coverage` sheet — requirement coverage table (every FR/TR/NFR id with an explicit status),
88
97
  target × category grid with explicit `—` gaps, dispositions, manifest. CSV mirrors the same model
@@ -201,7 +210,7 @@ The base sheet label comes from `base_locale:` (default **EN**). Undeclared env
201
210
 
202
211
  ## API delivery — extra worksheet
203
212
 
204
- For **api-kind units** (`qa/api/<area>/`), the `.xlsx` gains a final worksheet **`API detail`** (appended after Overview/Auto/Manual). The main BM-2-901-13 Testcases layout is unchanged. The CSV is unchanged (16-column, no extra sheet).
213
+ For **api-kind units** (`qa/api/<area>/`), the `.xlsx` gains a final worksheet **`API detail`** (appended after Overview/Auto/Manual). The main BM-2-901-13 testcase-sheet layout is unchanged. The CSV is unchanged (16-column, no extra sheet).
205
214
 
206
215
  ### Required sources (API detail sheet only)
207
216
 
@@ -101,13 +101,15 @@ needs any of these, it is a **finding for QA** — surface it in the run summary
101
101
  | `SG-W013` | A page assertion (`see [X] page` / `is on [X] page`) whose `[Ref]` has no `type: page` selector entry (or collides with a non-page entry) — the step falls back to the feature's own path (or `/<ref>/`) instead of `X`'s real URL, so the anchored assertion can never pass | Declare a `type: page` entry for `[Ref]` with its real URL; if the key collides with another type, disambiguate with a `--type` suffix (`sungen-selector-keys` § Collision rule) |
102
102
  | `SG-W014` | `[X] page with {{v}}` where `{{v}}`'s base test-data value carries no query and no fragment — the step checks the PATH only, asserting less than it reads as | Informational — pass a value like `?q=…` if you meant to assert a query, or drop `with {{v}}` for a bare page |
103
103
  | `SG-W015` | `see [X] card/item with {{n}}` where `{{n}}`'s test-data value is a **bare number** — this compiles to a TEXT assertion (`toHaveText('3')`), NOT a count. An author reaching for "3 cards are shown" gets an assertion that can only pass if the card's TEXT is literally the digit: a wrong test with no error. Scoped to container-ish element types (`card`/`item`/`option` + plurals); a text element asserting a numeric readout (`[Row Quantity] text with 4`) stays silent | For a COUNT use a form that has count semantics: `see [Ref] row with {{n}}` / `see [T] table with {{n}}`, or a list `should have count`. If the number really is the element's text, assert it on a **text/label** element instead |
104
+ | `SG-W016` | A table step on a table located by CSS/testid whose value does not mention `table` and that declares no `rows:` — the table templates find rows by `getByRole('row')`; on a list built from `<div>`s that is 0 rows, so `is hidden`/`is empty` PASS without checking anything and counts/clicks time out (issue #688). A heuristic — the compiler cannot see the DOM — so it warns once per table | Declare the row shape on the TABLE entry (`rows: 'div.job-row'`, relative to the table) — it drives all seven table steps — or locate the table by `role: table` if it really is one. Do not put the shape on a row label's entry: that key positions ONE row |
104
105
  | `SG-E020` | A step matched a pattern, but the **active adapter ships no template** for it (e.g. a web-only step compiled under `platform: mobile`). The feature file still generates — that one step compiles to `throw new Error("[sungen] …")` naming the step, feature, pattern, template and adapter, so the failure is loud and traceable rather than a crashed build | Rephrase to a step the target adapter actually ships (see `sungen-gherkin-syntax` Platform Support section / `sungen-mobile-gestures`), or tag the scenario `@manual` with the platform reason |
105
106
  | `SG-E021` | The step carries a trailing **state clause** (`… is hidden`) that the pattern which matched it does not assert — the clause would be SILENTLY DROPPED. Worst shape in this table: it does not weaken an assertion, it can INVERT one. `see [X] page is hidden` matched `page-assertion` (priority 13) ahead of `is-hidden` (11), so the step compiled to `toHaveURL(...)` — asserting the page IS displayed, and passing. Also fires on `wait for [X] is checked` (a wait honours only `hidden`/`visible`/`disabled`/`enabled`; everything else silently fell back to `visible`) and on `row`/`column in [T] table … is <state>` for any state but `hidden` | Move the state onto the element that has it: `Then User see [X] checkbox is checked`. For a page, assert the page you expect (`Then User see [Other] page`) or a marker element (`Then User see [Banner] is hidden`). If sungen cannot express the check, tag the scenario `@manual`. The diagnostic names the pattern that swallowed the clause — that name tells you which form you actually hit |
106
- | `SG-W020` | The matched pattern **declares `platforms`** (today: `@mock`) and the active platform isn't among them. Caught before template lookup, so the diagnostic can name the native alternative directly | Drop `@mock` from a mobile unit (there is no Mock Driver on Appium) — use `@api`/`@query` or a `@manual` note instead |
107
+ | `SG-W020` | The matched pattern **declares `platforms`** and the active platform isn't among them. Caught before template lookup, so the diagnostic names the alternative for the platform you are on. This is now the MAIN off-platform channel, not a corner case: the whole web-only set (`table-*`, `storage-*`, `route-assertion`, `tab-order`, `sorted`, `upload`, `alert-fill`) and the whole mobile-only set (gestures, device state, app lifecycle, device oracles) declare it, so the refusal arrives at compile time with a concrete substitute instead of at run time from inside a template. It still compiles to a `throw` — moving the message earlier never turns a refusal into a silent pass | Do what the message says: it carries the pattern's OWN `platformAlternative`, e.g. a table assertion on mobile → per-row accessibility-id assertions; `local storage` on mobile → assert the state via a UI element or `@api`/`@query`; a swipe on web → drive the control the swipe reveals. `@mock` on a mobile unit is the same shape (there is no Mock Driver on Appium) |
107
108
  | `SG-W021` | `use dialog` / `User is on [X] dialog` scope under the **mobile** adapter — the scope is recorded but no Appium template reads `inDialog`, so every following step resolves against the whole screen, not just the dialog | Don't rely on `scope: dialog`/`use dialog` for disambiguation on mobile — give the element inside the dialog its own unique accessibility-id/testid instead |
108
109
  | `SG-W022` | `Then User see [X] page` under the **mobile** adapter — a native app has no URL, so the step compiles to a bare COMMENT: it reads as an assertion, checks nothing, and the scenario passes whatever is on screen. Worse than a hard failure, because nothing ever goes red. (Its `is on [X] page` twin throws via `route-assertion`; `Given User is on [X] page` is the app-LAUNCH directive and correctly emits nothing) | Assert something actually on the screen — `Then User see [Some Header] text` / a screen-marker accessibility-id — instead of a page/URL check, or tag the scenario `@manual` |
109
110
  | `SG-W023` | A mobile **setup** step that emitted NO executable code, so a declared PRECONDITION is never established. `Given the user is logged out` matches `user-not-logged-in` → the `clear-auth` template, which on Appium is a bare COMMENT: mobile auth lives in the keychain/prefs, not in cookies, so no per-step action can clear it. The scenario then runs against whatever the PREVIOUS scenario left signed in and passes regardless — the same false-pass class as `SG-W022`, arriving through setup instead of assertion. Deliberately NOT a `throw` (an unestablished precondition weakens setup, it does not INVERT an assertion) | Declare a feature-level reset tier — `@reset:data` on the Feature — so each scenario starts from a wiped data layer; app state is reset in the `beforeEach` hook, not mid-scenario by a step. For BACKEND state (`database is empty`) the remedy is different: reset through a test API/script, or bind a `@query:` precondition, the same way the web adapter has to |
110
111
  | `SG-W024` | Two or more scenarios in one feature **share a name** and at least ONE carries a `@reset:` tag. The generated per-scenario tier lookup is keyed on the scenario NAME (a `@cases` title is built at runtime, so no compile-time key can match the rendered title), so every same-named scenario resolves to the SAME tier — including one that declared none, which then silently runs at its namesake's tier: a `@reset:none` chain broken, or a reinstall nobody asked for. Counted over EVERY scenario rather than the tagged subset, because the untagged twin is the one that gets the wrong tier and has no tag to be counted by | **Rename** the scenarios so each title is unique. Reported rather than resolved by precedence on purpose — two tests genuinely sharing one title cannot be told apart by a name-keyed lookup, so a rename is the only honest fix (silently picking a winner would be the same silent-discard shape as `SG-W021`) |
112
+ | `SG-W026` | A mobile **active-navigation** step that emitted NO executable code, so a promised screen change never happens. `When User open [Settings] page` compiles to the one-line `navigation` template — a COMMENT noting the app was already launched by the wdio capabilities — so the step reads as "go to Settings" and goes nowhere; pair it with a `page` assertion (itself a no-op, `SG-W022`) and the scenario passes without ever touching the app. Scoped to the ACTIVE forms only: `Given User is on [X] page|screen` is the app-LAUNCH anchor and correctly emits nothing, so it is never reported. Deliberately NOT a `throw` — an unfulfilled navigation weakens the scenario rather than INVERTING an assertion, and throwing would break every mobile suite already carrying one | Change screens the way a user does — `When User tap [Settings] button` — then assert a marker on the new screen (`Then User see [Settings Header] text`). Keep `is on [X] screen` only as the feature's opening anchor. Note `generate --strict` fails on any diagnostic, so this code is blocking there from the day it lands |
111
113
  | `SG-E022` | The **generated spec file itself** is not parseable JS/TS, so NOTHING in it runs — Playwright reports one `SyntaxError` and every scenario in the unit is lost. A compiler self-check (`@babel/parser`) on the emitted code, added after a field report where the runtime-data marker post-processor mis-paired quote delimiters across two literals and the user only found out at `npx playwright test`. Reported, never thrown — the file is still written so you keep the artifact to inspect. **Unlike every other code in this table this one blames the COMPILER, not your `.feature`** | Nothing to fix in the Gherkin — this should be impossible. **Report it** with the `.feature` (and the step) the file was generated from, attaching the unparseable `.spec.ts`. Check first that you are running the project-local compiler (`npx sungen`), not an older global one |
112
114
  | `SG-E023` | The step carries an **assertion clause** (`matches "…"`, `contains`, `has text`) but the generated code is a BARE VISIBILITY check — the clause was swallowed by a catch-all and the test would pass whatever the element says. The sibling of `SG-E021`, for the clauses that are not states: `SG-E021` closed the state case declaratively, but a dropped `matches`/`contains`/`has text` still slid through (reproduced live: a `matches "<format>"` step compiled by an older sungen lost the assertion entirely, emitted no warning, and left a `toBeVisible()` that passed whatever the label said). Four separate defects arrived this way, so the step now compiles to a runtime `throw`. Deliberately narrow — fires only on the bare-visibility shape, so a pattern that genuinely consumed the clause (`is-hidden`, `contains`, `matches-format`, the state family, or a `filter({ hasText })` on a list member) is untouched | Either the phrasing is not the supported one for that clause — check the exact form in `sungen-gherkin-syntax` — or this sungen predates the step: verify you are running the project-local compiler (`npx sungen`), not an older global one |
113
115
  | `SG-E024` | A mobile **app-lifecycle** step (`User restart the app` / `User reinstall the app`) in a feature that declares no `Path:` app id. The lifecycle templates resolve the target app through `__resolveAppId()`, a helper the appium test-file template emits ONLY when the id is present, so the spec used to compile clean and then die at runtime with `ReferenceError: __resolveAppId is not defined` — taking the WHOLE spec down, not the one step, because the failure lands in a before hook. (Field case: a mobile unit scaffolded with the nav recipe in `--path` instead of `--reach`, so `Path` never carried an app id.) Now refused at compile time as a `throw` naming the missing line | Add the app id under the `Feature` line: `Path: com.example.app/.MainActivity \| com.example.app`. For a mobile unit `--path` carries the **APP ID** and `--reach` carries the navigation recipe — if the nav recipe ended up in `--path`, that is the mistake |
@@ -202,6 +204,51 @@ If `toHaveText` fails on an input → the Gherkin step has the wrong target type
202
204
 
203
205
  ---
204
206
 
207
+ ## Mobile Runtime Errors (Appium / WebdriverIO)
208
+
209
+ **The fixes are NOT written here.** They live once, as data, in `driver-mobile/src/mobile-repair.ts`,
210
+ and `sungen repair --screen <unit>` prints the matching one for the failure you actually got:
211
+
212
+ ```bash
213
+ sungen audit --screen <unit> # findings
214
+ npx playwright test # (or the wdio run) — leaves the result JSON
215
+ sungen repair --screen <unit> # → the concrete fix for each finding + each failure
216
+ ```
217
+
218
+ This table is the INDEX into that catalog — symptom → rule id — so you can recognise a failure class
219
+ by eye and know a rule already covers it. Two copies of a fix drift; one copy plus an index does not.
220
+ `tests/ai-skills/error-mapping-repair-parity.run.ts` fails if this table and the catalog disagree in
221
+ either direction.
222
+
223
+ | What you see | Rule id | Class |
224
+ |---|---|---|
225
+ | `Element not found: ~key` / `no such element` | `mobile-element-absent` | selector |
226
+ | `iOS geometry oracle: rect={…0x0…}` | `mobile-ios-offscreen` | selector |
227
+ | `element click intercepted` / `is not clickable at point` | `mobile-tap-intercepted` | selector |
228
+ | `Default scrollable element '//android.widget.ScrollView' not found` | `mobile-scroll-no-scrollable` | selector |
229
+ | `A new session could not be created` | `mobile-session-not-created` | session |
230
+ | `Could not proxy command to the remote server` / `socket hang up` | `mobile-driver-proxy-lost` | session |
231
+ | `The instrumentation process cannot be initialized` | `mobile-instrumentation-failed` | session |
232
+ | `No Chromedriver found that can automate Chrome '…'` | `mobile-chromedriver-mismatch` | session |
233
+ | `@auth:<role> login did not complete` / `could not decide the login state` | `mobile-auth-session` | session |
234
+ | `device log (logcat) did not contain "…"` | `mobile-device-log-silent` | oracle |
235
+ | `[sungen] … web-only` / `not supported on the appium adapter` | `mobile-web-only-step` | compile (SG-W020/E020) |
236
+ | `[sungen] step "…" matched no pattern` | `mobile-step-unmatched` | compile (SG-W001) |
237
+ | `… needs the app id: the mobile lifecycle steps resolve …` | `mobile-lifecycle-no-app-id` | compile (SG-E024) |
238
+ | `… This feature declares @platform:ios` | `mobile-ios-unsupported-step` | compile (SG-E025) |
239
+ | `UNIVERSAL: missing theme(s): …` | `mobile-universal-theme` | audit |
240
+ | `GATE: critical theme "…" has NO covering scenario` | `mobile-gate-theme-uncovered` | audit |
241
+ | `GATE: critical theme "…" covered only by SHALLOW` | `mobile-gate-theme-shallow` | audit |
242
+ | `VIEWPOINT-GESTURE-SUBSTITUTED: …` | `mobile-gesture-substituted` | audit |
243
+ | `MANUAL-CODE-MISSING: …` | `mobile-manual-uncoded` | audit |
244
+ | `PAGE-TYPE-UNDETERMINED: …` | `mobile-page-type-undetermined` | audit |
245
+
246
+ A failure with no rule id is reported by `sungen repair` under **"No known rule (review manually)"**.
247
+ That list is deliberately not empty-by-construction: a rule broad enough to match everything would
248
+ hide the findings nobody has looked at yet.
249
+
250
+ ---
251
+
205
252
  ## Performance & Infrastructure Errors → Fix in `specs/base.ts`
206
253
 
207
254
  All generated `.spec.ts` import from `specs/base.ts` — shared context caching, navigation, overlay cleanup. AI **can and should** tune `base.ts` to match the project.
@@ -35,7 +35,7 @@ AND → inherits from preceding keyword
35
35
  ### Setup / Form / Interaction
36
36
 
37
37
  ```
38
- User is on [T] page | page with {{v}} | dialog
38
+ User is on [T] page | page with {{v}} | dialog # {{v}} = query/fragment ("?id=200", "#tab") APPENDED to the page value — a bare "200" onto "/x?id=199" gives "?id=199200"
39
39
  User fill [T] field | textarea | search | slider | date-picker with {{v}} # date-picker: web only unless qa/app.yaml declares widgets.datepicker — appium refuses it
40
40
  User fill [T] uploader with {{f}} [web]
41
41
  User clear [T] field
@@ -103,6 +103,9 @@ two content-filtered queries can hit different rows if the table re-renders in b
103
103
  ```
104
104
  # 1. Visibility: User see [T] type (NEVER add "is visible") | is hidden
105
105
  # 2. Text (toHaveText): User see [T] message | header | label with {{v}}
106
+ # `label` forks on the entry: declared by IDENTITY (xpath/accessibility-id/testid/id/css)
107
+ # → asserts THAT element contains {{v}} (add `exact: true` for a strict match); no entry,
108
+ # or `type: text` → matches the caption+value text pair anywhere on screen
106
109
  # 3. Partial (toContainText): User see [T] text contains {{v}}
107
110
  # 3b. Format (shape, not value): User see [T] label matches "yyyy/mm/dd ~ yyyy/mm/dd"
108
111
  # 4. Input (toHaveValue): User see [T] field | date-picker | search | slider with {{v}}
@@ -153,6 +156,8 @@ detail:
153
156
  | `… page with {{v}}`, `v` = `/vi/search` (no query) | **path only**, and the compiler warns (`SG-W014`): the step asserts less than it reads as |
154
157
  | `… page with {{v}}`, `v` empty or key missing at run time | **throws, naming the key** — an unusable value is never a silent pass |
155
158
 
159
+ **Navigating** with data (`Given User is on [T] page with {{v}}`) appends `{{v}}` to the page selector's value **verbatim** — no merging, by design (the primary use is injecting malformed query input, which the compiler must not sanitize). So the page value carries the PATH only and `{{v}}` carries the whole query: `value: '/job/detail'` + `job_query: "?id=200"`. A page value that already holds `?id=199` plus `{{v}}` = `"200"` navigates to `?id=199200`. A rooted `{{v}}` (`/other/path`) replaces the page's path; an absolute URL replaces everything.
160
+
156
161
  So pass `with {{v}}` whenever the URL carries state worth proving, and leave it off when the page
157
162
  must be reached clean. A dynamic segment in the selector value (`/users/:id/profile`) wildcards to
158
163
  `[^/]+` on its own, still anchored — `/users/42/profile/edit` does not match. Params compare
@@ -214,6 +219,15 @@ first contact row:
214
219
  ```
215
220
  → compiles to `expect(table.locator('tbody tr:first-child')).toContainText(v)` — the exact row must hold the value — and still enters row scope for `[Col] column` checks.
216
221
 
222
+ **A list built from `<div>`s is a table only if you tell sungen what a row is.** Every table step finds rows by `getByRole('row')`; a `<div>` list has none, so `is hidden` and `is empty` would pass on 0 rows (asserting nothing) and counts/clicks would time out. Declare the row SHAPE on the **table** entry — `rows:` is relative to the table and drives all seven table steps:
223
+ ```yaml
224
+ job table:
225
+ type: locator
226
+ value: 'div.job-list'
227
+ rows: 'div.job-row' # what EVERY row matches — NOT a row label's entry
228
+ ```
229
+ Two different keys, two meanings: `rows:` on the table = every row (the shape); a `type: locator` entry on a **row label** = ONE positioned row (`tbody tr:first-child`). A shape put on a row label fails at run time with a `toHaveCount(1)` message that points back here. A CSS-located table with no `rows:` gets `SG-W016`. On a shaped table `table row {{n}}` counts from the first data row (no header offset).
230
+
217
231
  ### Browser storage `[web]`
218
232
 
219
233
  ```
@@ -374,7 +388,7 @@ entirely (a *pattern* gap, not a template gap), which is what the catalogue belo
374
388
 
375
389
  **Mobile-only `[mobile]`** — the gesture catalog (swipe, long-press, pinch-zoom, pull-to-refresh,
376
390
  rotate, background/foreground, notifications, grant-permission, clipboard set, set-geolocation,
377
- hide-keyboard, tap-top-of) has no web counterpart, and neither do the lifecycle / device-state /
391
+ hide-keyboard, tap-top-of, `go back`) has no web counterpart, and neither do the lifecycle / device-state /
378
392
  timing steps (`restart the app`, `reinstall the app`, `turn airplane mode|wifi|mobile data on|off`,
379
393
  `turn device location on|off` — the latter two Android-only, throw on iOS — the window
380
394
  assertions `see [X] disappear within N seconds` / `still visible after N seconds`, and the
@@ -387,8 +401,9 @@ Full syntax → `sungen-mobile-gestures`.
387
401
  | Step | Web | Mobile |
388
402
  |---|---|---|
389
403
  | `see [T] page` \| `page with {{v}}` | asserts path+query | **silent no-op** — asserts nothing; the scenario passes regardless. Assert a screen-marker element instead |
390
- | `is on [T] page` \| `open [T] page` (Given/When) | navigates via URL | no-op — the app is already launched; use tap/gesture steps for mobile screen changes |
404
+ | `is on [T] page` \| `open [T] page` (Given/When) | navigates via URL | `is on` = the app-launch anchor, correctly a no-op. `open`/`navigate to` = a no-op that **reports `SG-W026`** — it promises a screen change and performs none; use tap/gesture steps instead |
391
405
  | `wait for [T] page` | waits for the URL | fixed `driver.pause(500)` settle — not a real wait condition |
406
+ | `go back` (OS/hardware back) | **not a web step** — reports `SG-W020`; re-enter with `is on [X] page` or tag `@manual` | Android: `KEYCODE_BACK`, the real hardware key. iOS: WDA **navigation**-back, *not* the user's edge swipe-back (iOS has no hardware back). Distinct from `tap [Back] button`: system back skips the screen's own handler unless the app wires it |
392
407
  | `hover [T] icon \| row` | real hover | no-op — hover-revealed content is normally already visible on mobile; use `tap` |
393
408
  | `fill [T] alert with {{v}}` | fills native `prompt()` | no-op (comment only) — app-specific, handle manually |
394
409
  | `switch to [T] frame` | enters an `<iframe>` | switches a hybrid app's WebView context; no-op on a pure-native screen. **Needs `APPIUM_CHROMEDRIVER_AUTODOWNLOAD=1`** (.env.appium) or the switch fails with "No Chromedriver found". INSIDE the webview, selectors are **css/xpath only** — UiSelector-based types and the text-value asserts (`label with {{v}}`) don't apply there; assert element presence via css/xpath refs, then `switch to [main] frame` back |
@@ -17,6 +17,21 @@ patterns (`click`, `hover`, `fill`) don't cover.
17
17
  > - **`swipe <dir> on [X]`** → `mobile: swipeGesture`.
18
18
  > - **`long-press [X] [for N seconds]`** → `mobile: longClickGesture`.
19
19
  > - **`rotate to landscape|portrait`** → `driver.setOrientation(...)`.
20
+ > - **`go back`** (also `goes back` · `press the back button` · `hardware|system|device back` ·
21
+ > `back gesture` · `swipe back`) → Android `mobile: pressKey` with keycode 4 (KEYCODE_BACK — the
22
+ > real hardware key); iOS `driver.back()`, which is WebDriverAgent's **navigation** back and *not*
23
+ > the user's edge swipe-back gesture — iOS has no hardware back key. **This is NOT `tap [Back]`:**
24
+ > Android's system back does not run the screen's own handler unless the app wires it
25
+ > (`onBackPressed` / `BackHandler`), so a defect on the OS path is invisible to an in-app tap —
26
+ > which is why the viewpoint ledger refuses the in-app button as an answer to its "OS/hardware
27
+ > back gesture" theme. The step takes **no `[Ref]`**; that absence is what selects it. A phrasing
28
+ > that names a target (`go back to [List] screen`) is refused rather than reinterpreted, so pick
29
+ > one form: `go back`, or a tap.
30
+ > **`swipe back` is only a spelling of this step, not a swipe.** It compiles to the same
31
+ > `KEYCODE_BACK` / `driver.back()` as every other phrasing above, so on iOS — where the edge
32
+ > swipe-back *is* what a real user does — a scenario named for the gesture never performs it. If
33
+ > the edge swipe itself is under test, that needs a left-edge `mobile: swipe`, which no step
34
+ > currently emits: tag it `@manual` rather than letting the wording imply coverage it does not have.
20
35
  > - **`pull-to-refresh on [X]`** → fast `mobile: swipeGesture` (direction down).
21
36
  > - **`pinch-zoom in|out on [X]`** → `mobile: pinchOpenGesture` / `pinchCloseGesture`.
22
37
  > - **`send app to background for N seconds`** → `driver.background(N)`.
@@ -108,7 +123,7 @@ from `appium_find_element`; screen gestures pass `direction` or coordinates.
108
123
  | Scroll a list | `User scroll down on [Feed]` | `action=scroll, direction=down` |
109
124
  | Scroll until visible | `User scroll to [Footer]` | `action=scroll_to_element, strategy, selector, direction` |
110
125
  | Pinch zoom in/out | `User pinch-zoom in on [Map]` | `action=pinch_zoom, elementUUID, scale` (>1 in, <1 out) |
111
- | System back | `User go back` | `action=back` |
126
+ | System back | `User go back` | `action=back` — **compiles** (see codegen status; per-OS) |
112
127
  | Drag & drop | `User drag [A] onto [B]` | `appium_drag_and_drop` (separate tool) |
113
128
 
114
129
  Other device-level actions (separate MCP tools for exploration; Gherkin now compiles — see codegen
@@ -428,6 +428,17 @@ users:
428
428
 
429
429
  **How to build `columns`**: count column headers in snapshot (left to right, 0-indexed). Map each `[Col] column` reference from feature file to its index.
430
430
 
431
+ **A list built from `<div>`s (no `<table>`, no `role="row"` in the snapshot)** — the table steps still work, but you must declare the row SHAPE on the table entry, or every row step resolves 0 rows (`is hidden`/`is empty` pass vacuously — `SG-W016` warns about exactly this):
432
+
433
+ ```yaml
434
+ job list:
435
+ type: 'locator'
436
+ value: 'div.job-list'
437
+ rows: 'div.job-row' # RELATIVE to the table: what every row matches
438
+ ```
439
+
440
+ Pick `rows` from the snapshot as the repeating child that holds one record (a class like `.job-row`, `[data-testid="job-item"]`, or `> div`). Do **not** put it on a row label's entry — that key positions ONE row (`div.job-row:first-child`) and strict-mode-fails when it matches many.
441
+
431
442
  ---
432
443
 
433
444
  ## Detail Screens with Dynamic IDs
@@ -225,7 +225,7 @@ If no YAML key exists, the resolver infers from the Gherkin element type:
225
225
  | `[X] text` / `message` / `label` | `getByText('X')` | Visible text = X (partial match) |
226
226
  | `[X] logo/image/icon` | `getByRole('img', { name: 'X' })` | Image alt = X |
227
227
  | `[X] search` | `getByRole('searchbox', { name: 'X' })` | Searchbox label = X |
228
- | `[X] option` | `getByRole('option', { name: 'X' })` | Option text = X |
228
+ | `[X] option` | `getByRole('option')` — **no name** | web only (see the list-member note below) |
229
229
  | `[X] slider` | `getByRole('slider', { name: 'X' })` | Slider label = X |
230
230
  | `[X] toggle` | `getByRole('switch', { name: 'X' })` | Toggle label = X |
231
231
  | `[X] tab` | `getByRole('tab', { name: 'X' })` | Tab text = X |
@@ -238,12 +238,19 @@ If no YAML key exists, the resolver infers from the Gherkin element type:
238
238
  | `[X] progressbar` | `getByRole('progressbar', { name: 'X' })` | Progressbar label = X |
239
239
  | `[X] section` | `getByRole('region', { name: 'X' })` | Section aria-label = X |
240
240
  | `[X] card` | `getByRole('article', { name: 'X' })` | Card aria-label = X |
241
- | `[X] item` | `getByRole('listitem', { name: 'X' })` | List item text = X |
242
- | `[X] cell` | `getByRole('cell', { name: 'X' })` | Cell text = X |
241
+ | `[X] item` | `getByRole('listitem')` — **no name** | web only (see the list-member note below) |
242
+ | `[X] cell` | `getByRole('cell')` — **no name** | web only (see the list-member note below) |
243
243
  | `[X] spinner` | `getByRole('status', { name: 'X' })` | Spinner aria-label = X |
244
244
  | `[X] breadcrumb` | `getByRole('navigation', { name: 'X' })` | Navigation aria-label = X |
245
245
  | `[X] badge` / `tooltip` / `tag` | `getByText('X')` | Visible text = X |
246
246
 
247
+ **Special note on the list members `[X] item` / `[X] option` / `[X] cell`** — the only rows above that behave differently per platform:
248
+
249
+ - **Web**: they infer the role with **no `name`**, on purpose. A list member takes its accessible name from its own CONTENT, so a name defaulted from the `[Reference]` text matches zero elements — and `toBeHidden()` PASSES on an empty locator, so the scenario would go green having proved nothing. The role alone is the whole locator; `nth` or a count assertion narrows it. An explicit `name:` you write yourself is always honoured.
250
+ - **Mobile**: they do **not** auto-infer at all. A native a11y tree has no role concept, so with no name there is nothing to build an accessibility-id from — the old behaviour emitted the role token itself (`~listitem`), which no tree ever contains. `sungen generate` now fails naming the key to add, and selector generation (Phase 0) scans the live page for it instead of skipping. **Write an explicit entry**, e.g. `job list--item: { type: accessibility-id, value: 'job-row' }`.
251
+
252
+ **On mobile, `type: role` needs a `name:`.** The rule above is not about these three types — it is about a role with **no accessible name**, whichever way it got that way. On mobile such a role compiles to the role token (`~status`) and can never match, so it is refused at compile time. That includes `name: null`, which is the web opt-out for a content-named role: it has no mobile meaning, and `SG-W003` (which recommends it) does not fire on mobile for that reason. On a native app, prefer `type: accessibility-id`, `type: xpath` or `type: id` over `type: role` — the device exposes content-desc / accessibilityIdentifier, not ARIA roles.
253
+
247
254
  **Special note on `[X] field`**: `getByPlaceholder('X')` only works when (1) the field has a placeholder attribute AND (2) the placeholder text equals X. For fields without placeholders (floating labels, aria-label), write explicit YAML: `type: label, value: "Actual label text"`.
248
255
 
249
256
  **Only add a YAML entry when** auto-infer cannot work: DOM name differs from Gherkin label, need `testid`, need `nth`, need `exact: true`, need `name: null`, or the field type requires explicit config.
@@ -309,7 +309,7 @@ Security: [S1 – admin only]
309
309
  **Depth is a GATE dimension (harness-roadmap P1) — self-raise, never silently go shallow:**
310
310
  - For every data-correctness theme the catalog marks `depth.requires: data-assertion`, emit its `depth.template` shape by **default** — don't wait for the repair loop. `sungen audit` measures `businessDepth` (ratio of these scenarios that assert data) against an intent threshold (functional ≥ 0.70); below it the **gate FAILs**.
311
311
  - **Verify depth deterministically before the gate:** run `sungen depth-lint --screen <name>`. It classifies every shallow business-critical scenario into **deepen-in-place** (add the theme's value assertion — the printed `template` is a hint, fit it to the actual claim) vs **cross-screen** (route to a flow / `@manual:Mx`). Clear the `deepen` list first — this is the mechanical way to hit `businessDepth` on the first pass instead of churning repair rounds. Never fake a value assertion onto a visibility/behavior scenario the lint over-counts; leave it and note the over-count.
312
- - `depth.cross_screen: true` (cart / detail / filter / brand correctness) → write the deep capture/compare shape as an **automated flow scenario** (in the flow — do NOT leave a full-step `@manual` duplicate on the screen). `@manual` is **only** for genuine judgment (M6 visual/UX · M8 not-worth · M9 human) or a missing capability (M1–M5/M7), and it **must** carry a reason code (`@manual:Mx`, or a reason comment the planner can infer). A `@manual` scenario that still has full automatable steps (a data assertion, no visual/mock/a11y judgment) is now flagged by `sungen audit` as `MANUAL-AUTOMATABLE`, and business-critical scenarios you defer to `@manual` are reported as `DEPTH-DEFERRED` (they do NOT silently inflate `businessDepth`). Deferring automatable work to `@manual` lowers quality — automate it in the flow instead.
312
+ - `depth.cross_screen: true` (cart / detail / filter / brand correctness) → write the deep capture/compare shape as an **automated flow scenario** (in the flow — do NOT leave a full-step `@manual` duplicate on the screen). `@manual` is **only** for genuine judgment (M6 visual/UX · M8 not-worth · M9 human), a device/OS limit on mobile (M10 OS capability · M11 real-device only), or a missing capability (M1–M5/M7), and it **must** carry a reason code (`@manual:Mx`, or a reason comment the planner can infer). A `@manual` scenario that still has full automatable steps (a data assertion, no visual/mock/a11y judgment) is now flagged by `sungen audit` as `MANUAL-AUTOMATABLE`, and business-critical scenarios you defer to `@manual` are reported as `DEPTH-DEFERRED` (they do NOT silently inflate `businessDepth`). Deferring automatable work to `@manual` lowers quality — automate it in the flow instead.
313
313
  - **Pick the right `@manual:Mx` code — it decides which driver can later automate the case** (`sungen audit` flags a code↔reason mismatch). Tag the code that matches the **oracle the reason describes**:
314
314
 
315
315
  | The reason needs… | Code | Unblocked by |
@@ -321,9 +321,11 @@ Security: [S1 – admin only]
321
321
  | an external dependency (email, payment gateway, download) | `M5` | mail-file / contract |
322
322
  | visual / UX / responsive / a11y judgment | `M6` | — (keep manual) |
323
323
  | not worth automating · true human judgment | `M8` / `M9` | — (keep manual) |
324
+ | **mobile** — what the OS/driver will not expose (notification shade, app switcher/recents, permission variance by OS version, call interruption) | `M10` | — (keep manual) |
325
+ | **mobile** — what an emulator/simulator cannot be (biometrics, real camera, NFC, a real push token) | `M11` | — (keep manual) |
324
326
 
325
327
  e.g. "submit a payload then check the subscribers **table**" is an API+DB oracle → `@manual:M2` (NOT `M1`); "seed a DB with zero products" is a data state → `M1`; "throttle the network" → `M3`.
326
- - **Prefer automation-ready `@requires:<cap>` over prose `@manual`.** When you *can* write the steps for a capability-manual case (an API/DB oracle, a seeded state), write it **automation-ready** — the real `@api`/`@query`/… steps tagged `@requires:<cap>` (e.g. `@requires:db @query:subscriber_row`) — instead of a prose `@manual:M2`. It compiles to a skipped-with-reason stub until `sungen capability add <cap>`, then runs as a real test with **no rewrite**. Reserve prose `@manual:Mx` for cases whose steps genuinely can't be expressed (M6/M8/M9 judgment, or a capability with no driver). `sungen audit` reports these as `AUTOMATION-READY-PENDING` (not a gap, not manual).
328
+ - **Prefer automation-ready `@requires:<cap>` over prose `@manual`.** When you *can* write the steps for a capability-manual case (an API/DB oracle, a seeded state), write it **automation-ready** — the real `@api`/`@query`/… steps tagged `@requires:<cap>` (e.g. `@requires:db @query:subscriber_row`) — instead of a prose `@manual:M2`. It compiles to a skipped-with-reason stub until `sungen capability add <cap>`, then runs as a real test with **no rewrite**. Reserve prose `@manual:Mx` for cases whose steps genuinely can't be expressed (M6/M8/M9 judgment, M10/M11 device-or-OS limits on mobile, or a capability with no driver). `sungen audit` reports these as `AUTOMATION-READY-PENDING` (not a gap, not manual).
327
329
  - **If the spec lacks the concrete value** a deep assertion needs (exact message, price, count): still write the deep shape with a `{{var}}` placeholder and leave a `# SPEC-GAP: <field> value not in spec` comment — do **not** downgrade to `see [X] section`. A visible gap is better than a silent shallow pass.
328
330
  - **Blind-Spot Memory:** before finishing, run `sungen blindspot list --prompt` (Bash) and make sure the suite satisfies each recorded pattern (e.g. "for any Add/Create action: check success + resulting data state + duplicate/double-submit"). These are gaps QA hit before — don't repeat them.
329
331
 
@@ -478,6 +480,90 @@ And User wait for [Page Title] heading is visible
478
480
 
479
481
  ---
480
482
 
483
+ ## Mobile — the two axes web has no concept of
484
+
485
+ Applies to a `@platform:mobile/android/ios` unit. Read `sungen-viewpoint` →
486
+ `group-f-mobile-native.md` for *what to check* per native pattern (it carries the theme↔catalog
487
+ map the audit scores against); this section is the two **cross-cutting** axes that multiply every
488
+ other scenario on a device, and that a web-shaped coverage map has no row for.
489
+
490
+ ### Axis 1 — the app lifecycle state machine
491
+
492
+ A browser tab is either open or closed. An app has five states, and a screen can be wrong in any of
493
+ them. Generate lifecycle scenarios from the transitions, not from the states.
494
+
495
+ ```
496
+ launch (cold)
497
+ │
498
+ ▼
499
+ ┌──────────────► FOREGROUND ──────────────┐
500
+ │ │ │
501
+ │ background N seconds restart (kill)
502
+ │ ▼ ▼
503
+ │ BACKGROUNDED RELAUNCHED ── reinstall ──► FIRST-RUN
504
+ │ │ (install state cleared)
505
+ └──── resume ─────────┤
506
+ ▼
507
+ PROCESS DEATH (the OS reclaims a backgrounded app)
508
+ ```
509
+
510
+ | Transition | Step | Availability |
511
+ |---|---|---|
512
+ | foreground → backgrounded → resumed | `User background the app for 5 seconds` | both OSes |
513
+ | foreground → killed → relaunched | `User restart the app` | both OSes — **the** persistence oracle |
514
+ | → first-run | `User reinstall the app` | both OSes; needs the session to have installed via `APP_APK` / `IOS_APP` |
515
+ | a clean state *between* scenarios | `@reset:none\|soft\|data\|full` on the Feature | a tag, never a step — a step that tries reports **SG-W023** |
516
+ | backgrounded → process death → resumed | *no step* | `@manual:M10` (OS capability) |
517
+
518
+ **Every lifecycle scenario needs a DATA oracle.** "The screen is still there" passes on an empty
519
+ shell and on a silently re-logged-in session. Assert the value that must have survived:
520
+
521
+ ```gherkin
522
+ @high @platform:mobile
523
+ Scenario: VP-LOGIC-001 The session survives a cold restart
524
+ Given User is on [Account] screen
525
+ When User restart the app
526
+ Then User see [Account Name] text contains {{user_name}}
527
+ ```
528
+
529
+ Minimum for any mobile unit: **one resume scenario** (the screen owes its own data back) and, when
530
+ the screen persists anything — a session, a setting, a dismissal, a show-once card — **one restart
531
+ scenario per persisted thing**. Rotation belongs here too: `User rotate to landscape` must not lose
532
+ entered values or fire the request twice.
533
+
534
+ ### Axis 2 — permission × network decision table
535
+
536
+ These two multiply: a permission-gated feature behaves differently offline, and the honest expected
537
+ result is often "which message wins". Build the table, then **test only the rows with distinct
538
+ outcomes** — the usual decision-table discipline, not all 12 combinations.
539
+
540
+ | # | Permission | Network | Expected | How |
541
+ |---|---|---|---|---|
542
+ | 1 | granted | online | the happy path, feature content asserted | `User grant camera permission` — both OSes (iOS Simulator needs `applesimutils`) |
543
+ | 2 | granted | offline | the spec's cached/queued behaviour + a clear message; entered data never silently lost | `User turn wifi off` → `@platform:android` (XCUITest cannot toggle connectivity); iOS is `@manual:M10` |
544
+ | 3 | granted | off → on | recovers and refreshes with no manual reload | `@platform:android` |
545
+ | 4 | denied | online | an in-app explanation with a route to Settings — never a crash or a dead button | `@manual:M10` — no step denies a permission |
546
+ | 5 | denied | offline | one message wins per spec; do NOT generate this row unless the spec says which | `@manual:M10` |
547
+ | 6 | never-ask-again | online | no request loop; the Settings route is shown | `@manual:M10` |
548
+ | 7 | revoked while running | online | the app re-checks instead of trusting a stale grant | `@manual:M10` |
549
+
550
+ Row 1 is `@high` and automated. Rows 2–3 are `@high` and automated **on Android only** — tag them,
551
+ do not write them platform-neutral and hope. Rows 4–7 carry `@manual:M10`, which is a reason code
552
+ and a real oracle, not a shrug: write the steps a human follows and the value they must see.
553
+
554
+ ### Two mobile traps worth naming while generating
555
+
556
+ - **A `page` assertion proves nothing on mobile.** A native app has no URL, so `Then User see [Login]
557
+ page` compiles to an empty comment (**SG-W022**) and the scenario passes without looking. The
558
+ `screen` spelling is different and is what you want: it treats the target as a plain element and
559
+ emits a real visibility assertion — so name a marker only that screen has (`Then User see [Login
560
+ Submit] button`, or `Then User see [Login] screen` against a screen-root selector), and pair it
561
+ with the previous screen's marker going `is hidden`.
562
+ - **An `open [X] page` / `navigate to` step on mobile navigates nowhere** (**SG-W026**) — the app was
563
+ already launched by the capabilities. Change screens with a real tap or gesture.
564
+
565
+ ---
566
+
481
567
  ## Cleanup & Hooks
482
568
 
483
569
  Add cleanup tags per the `sungen-gherkin-syntax` Cleanup table. Key rules: