@sun-asterisk/sungen 3.2.32 → 3.2.34-beta.1

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 (503) hide show
  1. package/dist/cli/commands/audit.d.ts +5 -0
  2. package/dist/cli/commands/audit.d.ts.map +1 -1
  3. package/dist/cli/commands/audit.js +64 -11
  4. package/dist/cli/commands/audit.js.map +1 -1
  5. package/dist/cli/commands/capability.d.ts.map +1 -1
  6. package/dist/cli/commands/capability.js +40 -18
  7. package/dist/cli/commands/capability.js.map +1 -1
  8. package/dist/cli/commands/changed.d.ts.map +1 -1
  9. package/dist/cli/commands/changed.js +2 -3
  10. package/dist/cli/commands/changed.js.map +1 -1
  11. package/dist/cli/commands/dashboard.d.ts.map +1 -1
  12. package/dist/cli/commands/dashboard.js +2 -28
  13. package/dist/cli/commands/dashboard.js.map +1 -1
  14. package/dist/cli/commands/defect.d.ts +7 -0
  15. package/dist/cli/commands/defect.d.ts.map +1 -0
  16. package/dist/cli/commands/defect.js +68 -0
  17. package/dist/cli/commands/defect.js.map +1 -0
  18. package/dist/cli/commands/delivery.d.ts.map +1 -1
  19. package/dist/cli/commands/delivery.js +113 -59
  20. package/dist/cli/commands/delivery.js.map +1 -1
  21. package/dist/cli/commands/generate.d.ts.map +1 -1
  22. package/dist/cli/commands/generate.js +14 -7
  23. package/dist/cli/commands/generate.js.map +1 -1
  24. package/dist/cli/commands/results-merge.d.ts +9 -0
  25. package/dist/cli/commands/results-merge.d.ts.map +1 -1
  26. package/dist/cli/commands/results-merge.js +9 -12
  27. package/dist/cli/commands/results-merge.js.map +1 -1
  28. package/dist/cli/commands/results-sanitize.d.ts.map +1 -1
  29. package/dist/cli/commands/results-sanitize.js +2 -13
  30. package/dist/cli/commands/results-sanitize.js.map +1 -1
  31. package/dist/cli/commands/select.d.ts +12 -0
  32. package/dist/cli/commands/select.d.ts.map +1 -0
  33. package/dist/cli/commands/select.js +122 -0
  34. package/dist/cli/commands/select.js.map +1 -0
  35. package/dist/cli/commands/triage.d.ts +7 -0
  36. package/dist/cli/commands/triage.d.ts.map +1 -0
  37. package/dist/cli/commands/triage.js +98 -0
  38. package/dist/cli/commands/triage.js.map +1 -0
  39. package/dist/cli/commands/update.d.ts.map +1 -1
  40. package/dist/cli/commands/update.js +3 -0
  41. package/dist/cli/commands/update.js.map +1 -1
  42. package/dist/cli/commands/viewpoint.d.ts +7 -0
  43. package/dist/cli/commands/viewpoint.d.ts.map +1 -0
  44. package/dist/cli/commands/viewpoint.js +70 -0
  45. package/dist/cli/commands/viewpoint.js.map +1 -0
  46. package/dist/cli/index.js +13 -2
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
  49. package/dist/dashboard/snapshot-builder.js +6 -10
  50. package/dist/dashboard/snapshot-builder.js.map +1 -1
  51. package/dist/dashboard/templates/index.html +1 -1
  52. package/dist/dashboard/types.d.ts +1 -0
  53. package/dist/dashboard/types.d.ts.map +1 -1
  54. package/dist/exporters/csv-exporter.d.ts +4 -0
  55. package/dist/exporters/csv-exporter.d.ts.map +1 -1
  56. package/dist/exporters/csv-exporter.js +12 -11
  57. package/dist/exporters/csv-exporter.js.map +1 -1
  58. package/dist/exporters/feature-parser.d.ts +29 -0
  59. package/dist/exporters/feature-parser.d.ts.map +1 -1
  60. package/dist/exporters/feature-parser.js +44 -1
  61. package/dist/exporters/feature-parser.js.map +1 -1
  62. package/dist/exporters/json-exporter.d.ts.map +1 -1
  63. package/dist/exporters/json-exporter.js +7 -0
  64. package/dist/exporters/json-exporter.js.map +1 -1
  65. package/dist/exporters/locale-variants.d.ts +7 -1
  66. package/dist/exporters/locale-variants.d.ts.map +1 -1
  67. package/dist/exporters/locale-variants.js +23 -16
  68. package/dist/exporters/locale-variants.js.map +1 -1
  69. package/dist/exporters/manual-hybrid-oracle.d.ts +54 -0
  70. package/dist/exporters/manual-hybrid-oracle.d.ts.map +1 -0
  71. package/dist/exporters/manual-hybrid-oracle.js +114 -0
  72. package/dist/exporters/manual-hybrid-oracle.js.map +1 -0
  73. package/dist/exporters/matrix/build.d.ts.map +1 -1
  74. package/dist/exporters/matrix/build.js +68 -19
  75. package/dist/exporters/matrix/build.js.map +1 -1
  76. package/dist/exporters/matrix/carry-manual-results.d.ts +89 -0
  77. package/dist/exporters/matrix/carry-manual-results.d.ts.map +1 -0
  78. package/dist/exporters/matrix/carry-manual-results.js +302 -0
  79. package/dist/exporters/matrix/carry-manual-results.js.map +1 -0
  80. package/dist/exporters/matrix/export.d.ts +9 -1
  81. package/dist/exporters/matrix/export.d.ts.map +1 -1
  82. package/dist/exporters/matrix/export.js +21 -3
  83. package/dist/exporters/matrix/export.js.map +1 -1
  84. package/dist/exporters/matrix/gates.js +6 -0
  85. package/dist/exporters/matrix/gates.js.map +1 -1
  86. package/dist/exporters/matrix/render-csv.js +1 -1
  87. package/dist/exporters/matrix/render-csv.js.map +1 -1
  88. package/dist/exporters/matrix/render-testcase-sheet.d.ts.map +1 -1
  89. package/dist/exporters/matrix/render-testcase-sheet.js +10 -4
  90. package/dist/exporters/matrix/render-testcase-sheet.js.map +1 -1
  91. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -1
  92. package/dist/exporters/matrix/render-xlsx.js +3 -0
  93. package/dist/exporters/matrix/render-xlsx.js.map +1 -1
  94. package/dist/exporters/matrix/types.d.ts +13 -1
  95. package/dist/exporters/matrix/types.d.ts.map +1 -1
  96. package/dist/exporters/matrix/types.js.map +1 -1
  97. package/dist/exporters/matrix/wording.d.ts +8 -1
  98. package/dist/exporters/matrix/wording.d.ts.map +1 -1
  99. package/dist/exporters/matrix/wording.js +37 -2
  100. package/dist/exporters/matrix/wording.js.map +1 -1
  101. package/dist/exporters/playwright-report-parser.d.ts.map +1 -1
  102. package/dist/exporters/playwright-report-parser.js +1 -0
  103. package/dist/exporters/playwright-report-parser.js.map +1 -1
  104. package/dist/exporters/run-environment.d.ts +32 -0
  105. package/dist/exporters/run-environment.d.ts.map +1 -0
  106. package/dist/exporters/run-environment.js +125 -0
  107. package/dist/exporters/run-environment.js.map +1 -0
  108. package/dist/exporters/scenario-merger.d.ts +18 -0
  109. package/dist/exporters/scenario-merger.d.ts.map +1 -1
  110. package/dist/exporters/scenario-merger.js +49 -3
  111. package/dist/exporters/scenario-merger.js.map +1 -1
  112. package/dist/exporters/test-data-resolver.d.ts +0 -4
  113. package/dist/exporters/test-data-resolver.d.ts.map +1 -1
  114. package/dist/exporters/test-data-resolver.js +0 -7
  115. package/dist/exporters/test-data-resolver.js.map +1 -1
  116. package/dist/exporters/types.d.ts +5 -0
  117. package/dist/exporters/types.d.ts.map +1 -1
  118. package/dist/exporters/xlsx-exporter.d.ts +2 -0
  119. package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
  120. package/dist/exporters/xlsx-exporter.js +7 -2
  121. package/dist/exporters/xlsx-exporter.js.map +1 -1
  122. package/dist/generators/gherkin-parser/index.d.ts +11 -4
  123. package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
  124. package/dist/generators/gherkin-parser/index.js +49 -19
  125. package/dist/generators/gherkin-parser/index.js.map +1 -1
  126. package/dist/generators/test-generator/adapters/adapter-interface.d.ts +4 -0
  127. package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
  128. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/reinstall-app-action.hbs +2 -2
  129. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +8 -2
  130. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/visible-with-role-variable-assertion.hbs +7 -3
  131. package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +68 -4
  132. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/click-select-action.hbs +1 -1
  133. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/select-action.hbs +1 -1
  134. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/label-value-assertion.hbs +7 -1
  135. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +8 -4
  136. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/pick-option.hbs +13 -0
  137. package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/url-assertion.hbs +5 -1
  138. package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +16 -0
  139. package/dist/generators/test-generator/code-generator.d.ts +2 -1
  140. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  141. package/dist/generators/test-generator/code-generator.js +90 -5
  142. package/dist/generators/test-generator/code-generator.js.map +1 -1
  143. package/dist/generators/test-generator/diagnostics.d.ts +36 -5
  144. package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
  145. package/dist/generators/test-generator/diagnostics.js +35 -4
  146. package/dist/generators/test-generator/diagnostics.js.map +1 -1
  147. package/dist/generators/test-generator/patterns/index.d.ts +12 -2
  148. package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
  149. package/dist/generators/test-generator/patterns/index.js +15 -9
  150. package/dist/generators/test-generator/patterns/index.js.map +1 -1
  151. package/dist/generators/test-generator/patterns/types.d.ts +15 -0
  152. package/dist/generators/test-generator/patterns/types.d.ts.map +1 -1
  153. package/dist/generators/test-generator/patterns/with-parent-scope.d.ts +5 -0
  154. package/dist/generators/test-generator/patterns/with-parent-scope.d.ts.map +1 -1
  155. package/dist/generators/test-generator/patterns/with-parent-scope.js +6 -0
  156. package/dist/generators/test-generator/patterns/with-parent-scope.js.map +1 -1
  157. package/dist/generators/test-generator/step-mapper.d.ts +46 -0
  158. package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
  159. package/dist/generators/test-generator/step-mapper.js +84 -9
  160. package/dist/generators/test-generator/step-mapper.js.map +1 -1
  161. package/dist/generators/test-generator/utils/data-resolver.d.ts +25 -0
  162. package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
  163. package/dist/generators/test-generator/utils/data-resolver.js +39 -8
  164. package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
  165. package/dist/generators/test-generator/utils/selector-entry-fields.d.ts.map +1 -1
  166. package/dist/generators/test-generator/utils/selector-entry-fields.js +1 -0
  167. package/dist/generators/test-generator/utils/selector-entry-fields.js.map +1 -1
  168. package/dist/generators/test-generator/utils/selector-resolver.d.ts +37 -4
  169. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  170. package/dist/generators/test-generator/utils/selector-resolver.js +212 -79
  171. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  172. package/dist/harness/audit.d.ts +3 -0
  173. package/dist/harness/audit.d.ts.map +1 -1
  174. package/dist/harness/audit.js +60 -19
  175. package/dist/harness/audit.js.map +1 -1
  176. package/dist/harness/capability.d.ts +7 -1
  177. package/dist/harness/capability.d.ts.map +1 -1
  178. package/dist/harness/capability.js +15 -12
  179. package/dist/harness/capability.js.map +1 -1
  180. package/dist/harness/catalog/universal-viewpoints.yaml +5 -5
  181. package/dist/harness/config-file.d.ts +17 -0
  182. package/dist/harness/config-file.d.ts.map +1 -0
  183. package/dist/harness/config-file.js +100 -0
  184. package/dist/harness/config-file.js.map +1 -0
  185. package/dist/harness/counted-assertions.d.ts +2 -0
  186. package/dist/harness/counted-assertions.d.ts.map +1 -0
  187. package/dist/harness/counted-assertions.js +38 -0
  188. package/dist/harness/counted-assertions.js.map +1 -0
  189. package/dist/harness/data-driven-lint.d.ts.map +1 -1
  190. package/dist/harness/data-driven-lint.js +69 -27
  191. package/dist/harness/data-driven-lint.js.map +1 -1
  192. package/dist/harness/defect-draft.d.ts +14 -0
  193. package/dist/harness/defect-draft.d.ts.map +1 -0
  194. package/dist/harness/defect-draft.js +143 -0
  195. package/dist/harness/defect-draft.js.map +1 -0
  196. package/dist/harness/defects.d.ts +24 -0
  197. package/dist/harness/defects.d.ts.map +1 -0
  198. package/dist/harness/defects.js +118 -0
  199. package/dist/harness/defects.js.map +1 -0
  200. package/dist/harness/depth-lint.d.ts.map +1 -1
  201. package/dist/harness/depth-lint.js +2 -1
  202. package/dist/harness/depth-lint.js.map +1 -1
  203. package/dist/harness/flow-check.d.ts.map +1 -1
  204. package/dist/harness/flow-check.js +6 -2
  205. package/dist/harness/flow-check.js.map +1 -1
  206. package/dist/harness/keyword-match.d.ts +59 -0
  207. package/dist/harness/keyword-match.d.ts.map +1 -0
  208. package/dist/harness/keyword-match.js +86 -0
  209. package/dist/harness/keyword-match.js.map +1 -0
  210. package/dist/harness/manifest.d.ts.map +1 -1
  211. package/dist/harness/manifest.js +2 -2
  212. package/dist/harness/manifest.js.map +1 -1
  213. package/dist/harness/next-step.d.ts +2 -4
  214. package/dist/harness/next-step.d.ts.map +1 -1
  215. package/dist/harness/next-step.js +50 -5
  216. package/dist/harness/next-step.js.map +1 -1
  217. package/dist/harness/parse.d.ts +45 -0
  218. package/dist/harness/parse.d.ts.map +1 -1
  219. package/dist/harness/parse.js +142 -24
  220. package/dist/harness/parse.js.map +1 -1
  221. package/dist/harness/perf.d.ts +7 -1
  222. package/dist/harness/perf.d.ts.map +1 -1
  223. package/dist/harness/perf.js +13 -10
  224. package/dist/harness/perf.js.map +1 -1
  225. package/dist/harness/quality-gates.d.ts +9 -2
  226. package/dist/harness/quality-gates.d.ts.map +1 -1
  227. package/dist/harness/quality-gates.js +22 -8
  228. package/dist/harness/quality-gates.js.map +1 -1
  229. package/dist/harness/query-catalog.js +0 -0
  230. package/dist/harness/query-catalog.js.map +1 -1
  231. package/dist/harness/read-text.d.ts +21 -0
  232. package/dist/harness/read-text.d.ts.map +1 -1
  233. package/dist/harness/read-text.js +32 -1
  234. package/dist/harness/read-text.js.map +1 -1
  235. package/dist/harness/script-check.d.ts.map +1 -1
  236. package/dist/harness/script-check.js +7 -1
  237. package/dist/harness/script-check.js.map +1 -1
  238. package/dist/harness/secret-scan.d.ts +27 -1
  239. package/dist/harness/secret-scan.d.ts.map +1 -1
  240. package/dist/harness/secret-scan.js +57 -4
  241. package/dist/harness/secret-scan.js.map +1 -1
  242. package/dist/harness/select-by-ids.d.ts +31 -0
  243. package/dist/harness/select-by-ids.d.ts.map +1 -0
  244. package/dist/harness/select-by-ids.js +106 -0
  245. package/dist/harness/select-by-ids.js.map +1 -0
  246. package/dist/harness/sensors.d.ts +20 -1
  247. package/dist/harness/sensors.d.ts.map +1 -1
  248. package/dist/harness/sensors.js +133 -39
  249. package/dist/harness/sensors.js.map +1 -1
  250. package/dist/harness/spec-branches.d.ts +0 -18
  251. package/dist/harness/spec-branches.d.ts.map +1 -1
  252. package/dist/harness/spec-branches.js +24 -3
  253. package/dist/harness/spec-branches.js.map +1 -1
  254. package/dist/harness/spec-coverage.d.ts.map +1 -1
  255. package/dist/harness/spec-coverage.js +14 -4
  256. package/dist/harness/spec-coverage.js.map +1 -1
  257. package/dist/harness/triage-signals.d.ts +20 -0
  258. package/dist/harness/triage-signals.d.ts.map +1 -0
  259. package/dist/harness/triage-signals.js +30 -0
  260. package/dist/harness/triage-signals.js.map +1 -0
  261. package/dist/harness/triage-unit.d.ts +23 -0
  262. package/dist/harness/triage-unit.d.ts.map +1 -0
  263. package/dist/harness/triage-unit.js +142 -0
  264. package/dist/harness/triage-unit.js.map +1 -0
  265. package/dist/harness/triage.d.ts +28 -0
  266. package/dist/harness/triage.d.ts.map +1 -0
  267. package/dist/harness/triage.js +99 -0
  268. package/dist/harness/triage.js.map +1 -0
  269. package/dist/harness/ui-inventory.d.ts +40 -0
  270. package/dist/harness/ui-inventory.d.ts.map +1 -0
  271. package/dist/harness/ui-inventory.js +191 -0
  272. package/dist/harness/ui-inventory.js.map +1 -0
  273. package/dist/harness/viewpoint-baseline.d.ts.map +1 -1
  274. package/dist/harness/viewpoint-baseline.js +7 -1
  275. package/dist/harness/viewpoint-baseline.js.map +1 -1
  276. package/dist/harness/viewpoint-draft-header.d.ts +7 -0
  277. package/dist/harness/viewpoint-draft-header.d.ts.map +1 -0
  278. package/dist/harness/viewpoint-draft-header.js +100 -0
  279. package/dist/harness/viewpoint-draft-header.js.map +1 -0
  280. package/dist/harness/viewpoint-ledger.d.ts +13 -3
  281. package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
  282. package/dist/harness/viewpoint-ledger.js +106 -19
  283. package/dist/harness/viewpoint-ledger.js.map +1 -1
  284. package/dist/harness/viewpoint-mode.d.ts +9 -0
  285. package/dist/harness/viewpoint-mode.d.ts.map +1 -0
  286. package/dist/harness/viewpoint-mode.js +52 -0
  287. package/dist/harness/viewpoint-mode.js.map +1 -0
  288. package/dist/harness/viewpoint-priority.d.ts +19 -0
  289. package/dist/harness/viewpoint-priority.d.ts.map +1 -0
  290. package/dist/harness/viewpoint-priority.js +36 -0
  291. package/dist/harness/viewpoint-priority.js.map +1 -0
  292. package/dist/harness/viewpoint-review-open.d.ts +6 -0
  293. package/dist/harness/viewpoint-review-open.d.ts.map +1 -0
  294. package/dist/harness/viewpoint-review-open.js +90 -0
  295. package/dist/harness/viewpoint-review-open.js.map +1 -0
  296. package/dist/harness/viewpoint-scan-refs.d.ts +50 -0
  297. package/dist/harness/viewpoint-scan-refs.d.ts.map +1 -0
  298. package/dist/harness/viewpoint-scan-refs.js +200 -0
  299. package/dist/harness/viewpoint-scan-refs.js.map +1 -0
  300. package/dist/harness/viewpoint-scan.d.ts +41 -0
  301. package/dist/harness/viewpoint-scan.d.ts.map +1 -0
  302. package/dist/harness/viewpoint-scan.js +118 -0
  303. package/dist/harness/viewpoint-scan.js.map +1 -0
  304. package/dist/harness/write-atomic.d.ts +2 -0
  305. package/dist/harness/write-atomic.d.ts.map +1 -0
  306. package/dist/harness/write-atomic.js +62 -0
  307. package/dist/harness/write-atomic.js.map +1 -0
  308. package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -1
  309. package/dist/orchestrator/ai-skills/writer.js +15 -7
  310. package/dist/orchestrator/ai-skills/writer.js.map +1 -1
  311. package/dist/orchestrator/assets-drift.d.ts.map +1 -1
  312. package/dist/orchestrator/assets-drift.js +11 -6
  313. package/dist/orchestrator/assets-drift.js.map +1 -1
  314. package/dist/orchestrator/flow-manager.d.ts +0 -1
  315. package/dist/orchestrator/flow-manager.d.ts.map +1 -1
  316. package/dist/orchestrator/flow-manager.js +3 -52
  317. package/dist/orchestrator/flow-manager.js.map +1 -1
  318. package/dist/orchestrator/project-deps-sync.d.ts.map +1 -1
  319. package/dist/orchestrator/project-deps-sync.js +22 -1
  320. package/dist/orchestrator/project-deps-sync.js.map +1 -1
  321. package/dist/orchestrator/project-initializer.d.ts +8 -0
  322. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  323. package/dist/orchestrator/project-initializer.js +49 -7
  324. package/dist/orchestrator/project-initializer.js.map +1 -1
  325. package/dist/orchestrator/screen-manager.d.ts.map +1 -1
  326. package/dist/orchestrator/screen-manager.js +8 -62
  327. package/dist/orchestrator/screen-manager.js.map +1 -1
  328. package/dist/orchestrator/security-overrides-catalog.d.ts +39 -0
  329. package/dist/orchestrator/security-overrides-catalog.d.ts.map +1 -0
  330. package/dist/orchestrator/security-overrides-catalog.js +63 -0
  331. package/dist/orchestrator/security-overrides-catalog.js.map +1 -0
  332. package/dist/orchestrator/security-overrides.d.ts +51 -0
  333. package/dist/orchestrator/security-overrides.d.ts.map +1 -0
  334. package/dist/orchestrator/security-overrides.js +165 -0
  335. package/dist/orchestrator/security-overrides.js.map +1 -0
  336. package/dist/orchestrator/templates/ai-src/agents/discovery.md +11 -3
  337. package/dist/orchestrator/templates/ai-src/agents/reviewer.md +8 -0
  338. package/dist/orchestrator/templates/ai-src/commands/create-test.md +32 -24
  339. package/dist/orchestrator/templates/ai-src/commands/review.md +2 -2
  340. package/dist/orchestrator/templates/ai-src/commands/run-test.md +78 -15
  341. package/dist/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md +2 -2
  342. package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -0
  343. package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +25 -1
  344. package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +26 -8
  345. package/dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +5 -1
  346. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +58 -14
  347. package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +13 -1
  348. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +42 -2
  349. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +7 -0
  350. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +18 -0
  351. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/review-checklist.md +63 -0
  352. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/viewpoint-template.md +158 -0
  353. package/dist/orchestrator/templates/playwright.config.ts +4 -2
  354. package/dist/orchestrator/templates/specs-locale-fixture.ts +21 -9
  355. package/dist/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
  356. package/dist/orchestrator/templates/specs-url-assert.d.ts +17 -1
  357. package/dist/orchestrator/templates/specs-url-assert.d.ts.map +1 -1
  358. package/dist/orchestrator/templates/specs-url-assert.js +38 -4
  359. package/dist/orchestrator/templates/specs-url-assert.js.map +1 -1
  360. package/dist/orchestrator/templates/specs-url-assert.ts +47 -4
  361. package/dist/orchestrator/templates/wdio.conf.ts +24 -1
  362. package/dist/orchestrator/trace-mode-install.d.ts +14 -0
  363. package/dist/orchestrator/trace-mode-install.d.ts.map +1 -0
  364. package/dist/orchestrator/trace-mode-install.js +132 -0
  365. package/dist/orchestrator/trace-mode-install.js.map +1 -0
  366. package/dist/orchestrator/viewpoint-pattern-catalog.d.ts +23 -0
  367. package/dist/orchestrator/viewpoint-pattern-catalog.d.ts.map +1 -0
  368. package/dist/orchestrator/viewpoint-pattern-catalog.js +48 -0
  369. package/dist/orchestrator/viewpoint-pattern-catalog.js.map +1 -0
  370. package/dist/orchestrator/viewpoint-scaffold.d.ts +3 -0
  371. package/dist/orchestrator/viewpoint-scaffold.d.ts.map +1 -0
  372. package/dist/orchestrator/viewpoint-scaffold.js +70 -0
  373. package/dist/orchestrator/viewpoint-scaffold.js.map +1 -0
  374. package/package.json +3 -3
  375. package/src/cli/commands/audit.ts +59 -12
  376. package/src/cli/commands/capability.ts +54 -19
  377. package/src/cli/commands/changed.ts +2 -4
  378. package/src/cli/commands/dashboard.ts +1 -26
  379. package/src/cli/commands/defect.ts +49 -0
  380. package/src/cli/commands/delivery.ts +106 -56
  381. package/src/cli/commands/generate.ts +15 -7
  382. package/src/cli/commands/results-merge.ts +9 -9
  383. package/src/cli/commands/results-sanitize.ts +2 -9
  384. package/src/cli/commands/select.ts +88 -0
  385. package/src/cli/commands/triage.ts +57 -0
  386. package/src/cli/commands/update.ts +3 -0
  387. package/src/cli/commands/viewpoint.ts +58 -0
  388. package/src/cli/index.ts +13 -2
  389. package/src/dashboard/snapshot-builder.ts +6 -8
  390. package/src/dashboard/templates/index.html +1 -1
  391. package/src/dashboard/types.ts +1 -0
  392. package/src/exporters/csv-exporter.ts +12 -11
  393. package/src/exporters/feature-parser.ts +44 -2
  394. package/src/exporters/json-exporter.ts +6 -1
  395. package/src/exporters/locale-variants.ts +23 -17
  396. package/src/exporters/manual-hybrid-oracle.ts +112 -0
  397. package/src/exporters/matrix/build.ts +71 -19
  398. package/src/exporters/matrix/carry-manual-results.ts +292 -0
  399. package/src/exporters/matrix/export.ts +24 -4
  400. package/src/exporters/matrix/gates.ts +6 -0
  401. package/src/exporters/matrix/render-csv.ts +1 -1
  402. package/src/exporters/matrix/render-testcase-sheet.ts +10 -4
  403. package/src/exporters/matrix/render-xlsx.ts +3 -0
  404. package/src/exporters/matrix/types.ts +13 -1
  405. package/src/exporters/matrix/wording.ts +36 -2
  406. package/src/exporters/playwright-report-parser.ts +1 -0
  407. package/src/exporters/run-environment.ts +89 -0
  408. package/src/exporters/scenario-merger.ts +51 -5
  409. package/src/exporters/test-data-resolver.ts +0 -6
  410. package/src/exporters/types.ts +5 -0
  411. package/src/exporters/xlsx-exporter.ts +7 -2
  412. package/src/generators/gherkin-parser/index.ts +50 -18
  413. package/src/generators/test-generator/adapters/adapter-interface.ts +6 -2
  414. package/src/generators/test-generator/adapters/appium/templates/steps/actions/reinstall-app-action.hbs +2 -2
  415. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +8 -2
  416. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/visible-with-role-variable-assertion.hbs +7 -3
  417. package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +68 -4
  418. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/click-select-action.hbs +1 -1
  419. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/select-action.hbs +1 -1
  420. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/label-value-assertion.hbs +7 -1
  421. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +8 -4
  422. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/pick-option.hbs +13 -0
  423. package/src/generators/test-generator/adapters/playwright/templates/steps/partials/url-assertion.hbs +5 -1
  424. package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +16 -0
  425. package/src/generators/test-generator/code-generator.ts +77 -5
  426. package/src/generators/test-generator/diagnostics.ts +36 -5
  427. package/src/generators/test-generator/patterns/index.ts +15 -8
  428. package/src/generators/test-generator/patterns/types.ts +15 -0
  429. package/src/generators/test-generator/patterns/with-parent-scope.ts +6 -0
  430. package/src/generators/test-generator/step-mapper.ts +90 -8
  431. package/src/generators/test-generator/utils/data-resolver.ts +41 -12
  432. package/src/generators/test-generator/utils/selector-entry-fields.ts +1 -0
  433. package/src/generators/test-generator/utils/selector-resolver.ts +238 -82
  434. package/src/harness/audit.ts +69 -24
  435. package/src/harness/capability.ts +23 -12
  436. package/src/harness/catalog/universal-viewpoints.yaml +5 -5
  437. package/src/harness/config-file.ts +66 -0
  438. package/src/harness/counted-assertions.ts +33 -0
  439. package/src/harness/data-driven-lint.ts +82 -24
  440. package/src/harness/defect-draft.ts +115 -0
  441. package/src/harness/defects.ts +94 -0
  442. package/src/harness/depth-lint.ts +2 -1
  443. package/src/harness/flow-check.ts +6 -2
  444. package/src/harness/keyword-match.ts +85 -0
  445. package/src/harness/manifest.ts +2 -2
  446. package/src/harness/next-step.ts +47 -5
  447. package/src/harness/parse.ts +151 -27
  448. package/src/harness/perf.ts +15 -7
  449. package/src/harness/quality-gates.ts +22 -8
  450. package/src/harness/query-catalog.ts +0 -0
  451. package/src/harness/read-text.ts +32 -1
  452. package/src/harness/script-check.ts +7 -1
  453. package/src/harness/secret-scan.ts +60 -4
  454. package/src/harness/select-by-ids.ts +83 -0
  455. package/src/harness/sensors.ts +141 -40
  456. package/src/harness/spec-branches.ts +6 -3
  457. package/src/harness/spec-coverage.ts +14 -4
  458. package/src/harness/triage-signals.ts +46 -0
  459. package/src/harness/triage-unit.ts +113 -0
  460. package/src/harness/triage.ts +127 -0
  461. package/src/harness/ui-inventory.ts +164 -0
  462. package/src/harness/viewpoint-baseline.ts +7 -1
  463. package/src/harness/viewpoint-draft-header.ts +55 -0
  464. package/src/harness/viewpoint-ledger.ts +113 -25
  465. package/src/harness/viewpoint-mode.ts +49 -0
  466. package/src/harness/viewpoint-priority.ts +38 -0
  467. package/src/harness/viewpoint-review-open.ts +51 -0
  468. package/src/harness/viewpoint-scan-refs.ts +154 -0
  469. package/src/harness/viewpoint-scan.ts +111 -0
  470. package/src/harness/write-atomic.ts +22 -0
  471. package/src/orchestrator/ai-skills/writer.ts +18 -3
  472. package/src/orchestrator/assets-drift.ts +10 -5
  473. package/src/orchestrator/flow-manager.ts +3 -53
  474. package/src/orchestrator/project-deps-sync.ts +23 -1
  475. package/src/orchestrator/project-initializer.ts +54 -6
  476. package/src/orchestrator/screen-manager.ts +7 -61
  477. package/src/orchestrator/security-overrides-catalog.ts +69 -0
  478. package/src/orchestrator/security-overrides.ts +149 -0
  479. package/src/orchestrator/templates/ai-src/agents/discovery.md +11 -3
  480. package/src/orchestrator/templates/ai-src/agents/reviewer.md +8 -0
  481. package/src/orchestrator/templates/ai-src/commands/create-test.md +32 -24
  482. package/src/orchestrator/templates/ai-src/commands/review.md +2 -2
  483. package/src/orchestrator/templates/ai-src/commands/run-test.md +78 -15
  484. package/src/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md +2 -2
  485. package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -0
  486. package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +25 -1
  487. package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +26 -8
  488. package/src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +5 -1
  489. package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +58 -14
  490. package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +13 -1
  491. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +42 -2
  492. package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +7 -0
  493. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +18 -0
  494. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/review-checklist.md +63 -0
  495. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/viewpoint-template.md +158 -0
  496. package/src/orchestrator/templates/playwright.config.ts +4 -2
  497. package/src/orchestrator/templates/specs-locale-fixture.ts +21 -9
  498. package/src/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
  499. package/src/orchestrator/templates/specs-url-assert.ts +47 -4
  500. package/src/orchestrator/templates/wdio.conf.ts +24 -1
  501. package/src/orchestrator/trace-mode-install.ts +94 -0
  502. package/src/orchestrator/viewpoint-pattern-catalog.ts +61 -0
  503. package/src/orchestrator/viewpoint-scaffold.ts +36 -0
@@ -1,6 +1,33 @@
1
1
  import * as path from 'path';
2
2
  import { readYamlIfExists } from '../../../utils/yaml-io';
3
3
 
4
+ /**
5
+ * A `{{var}}` the compiler could not resolve: missing data file, missing key, or a key holding
6
+ * something that is not a primitive.
7
+ *
8
+ * A TYPE rather than a message convention, because the one thing callers must never do with this
9
+ * failure is guess. Twenty-four step patterns used to catch it and substitute the placeholder text
10
+ * as the VALUE — `fill('${valid_partner_id}')` typed 20 literal characters into the app, `generate`
11
+ * exited 0, and the scenario failed at the assertion it was written to fail at, for the reason it
12
+ * was written to fail. Nothing distinguished that run from a correct one (#781).
13
+ *
14
+ * So the failure is now carried, not converted, and it is answered in exactly one place —
15
+ * `StepMapper.mapStep`, which turns it into SG-E038 plus a step that throws by name. Catching this
16
+ * anywhere else to produce a value is the defect, and the type is what makes that visible in review.
17
+ */
18
+ export class DataRefError extends Error {
19
+ constructor(
20
+ message: string,
21
+ /** The `{{ref}}` as written in the feature, e.g. `valid_partner_id` or `user.email`. */
22
+ readonly dataRef: string,
23
+ /** The test-data file consulted, relative to the project root. Absent when no file was reached. */
24
+ readonly file?: string,
25
+ ) {
26
+ super(message);
27
+ this.name = 'DataRefError';
28
+ }
29
+ }
30
+
4
31
  /**
5
32
  * DataResolver - Resolves data references to actual values
6
33
  *
@@ -106,16 +133,17 @@ export class DataResolver {
106
133
 
107
134
  private resolveValue(dataRef: string, featureName?: string): string {
108
135
  const { fileName, valuePath } = this.parseDataRef(dataRef, featureName);
109
- const data = this.loadDataFile(fileName);
136
+ const data = this.loadDataFile(fileName, dataRef);
137
+ const rel = this.screenName
138
+ ? `qa/${this.flowMode ? 'flows' : 'screens'}/${this.screenName}/test-data/${fileName}.yaml`
139
+ : undefined;
110
140
 
111
141
  let current = data;
112
142
  for (const key of valuePath) {
113
143
  if (current && typeof current === 'object' && key in current) {
114
144
  current = current[key];
115
145
  } else {
116
- throw new Error(
117
- `Data path not found: ${dataRef}. Failed at key: ${key}`
118
- );
146
+ throw new DataRefError(`Data path not found: ${dataRef}. Failed at key: ${key}`, dataRef, rel);
119
147
  }
120
148
  }
121
149
 
@@ -124,8 +152,10 @@ export class DataResolver {
124
152
  } else if (typeof current === 'number' || typeof current === 'boolean') {
125
153
  return String(current);
126
154
  } else {
127
- throw new Error(
128
- `Data reference ${dataRef} must resolve to a primitive value, got: ${typeof current}`
155
+ throw new DataRefError(
156
+ `Data reference ${dataRef} must resolve to a primitive value, got: ${typeof current}`,
157
+ dataRef,
158
+ rel,
129
159
  );
130
160
  }
131
161
  }
@@ -147,7 +177,7 @@ export class DataResolver {
147
177
  }
148
178
 
149
179
  if (parts.length < 2) {
150
- throw new Error(`Invalid data reference: ${dataRef}. Expected format: file.path.to.value or provide featureName`);
180
+ throw new DataRefError(`Invalid data reference: ${dataRef}. Expected format: file.path.to.value or provide featureName`, dataRef);
151
181
  }
152
182
  return { fileName: parts[0], valuePath: parts.slice(1) };
153
183
  }
@@ -168,24 +198,23 @@ export class DataResolver {
168
198
  * Load data file from disk (with caching)
169
199
  * Merges base + env-specific: {name}.yaml + {name}.{SUNGEN_ENV}.yaml
170
200
  */
171
- private loadDataFile(fileName: string): any {
201
+ private loadDataFile(fileName: string, dataRef: string): any {
172
202
  if (this.dataCache.has(fileName)) {
173
203
  return this.dataCache.get(fileName)!;
174
204
  }
175
205
 
176
206
  if (!this.screenName) {
177
- throw new Error(`Data resolution requires screen/flow context for "${fileName}"`);
207
+ throw new DataRefError(`Data resolution requires screen/flow context for "${fileName}"`, dataRef);
178
208
  }
179
209
 
180
210
  const subDir = this.flowMode ? 'flows' : 'screens';
181
211
  const baseDir = path.join(process.cwd(), 'qa', subDir, this.screenName, 'test-data');
182
212
  const basePath = path.join(baseDir, `${fileName}.yaml`);
213
+ const rel = `qa/${subDir}/${this.screenName}/test-data/${fileName}.yaml`;
183
214
  const data = readYamlIfExists(basePath);
184
215
 
185
216
  if (!data || typeof data !== 'object' || Object.keys(data).length === 0) {
186
- throw new Error(
187
- `Data file not found or empty: qa/${subDir}/${this.screenName}/test-data/${fileName}.yaml`
188
- );
217
+ throw new DataRefError(`Data file not found or empty: ${rel}`, dataRef, rel);
189
218
  }
190
219
 
191
220
  let merged = { ...data };
@@ -36,6 +36,7 @@ export const CONSUMED_ENTRY_FIELDS: ReadonlySet<string> = new Set([
36
36
  'scope', // dialog/landmark scoping in the locator partial
37
37
  'match', // collapses into `exact` for getByText
38
38
  'anchor', // page assertions — the rendered-content proof (#662)
39
+ 'query', // page assertions — `any` drops the bare-page no-query rule (#748)
39
40
  'android', // appium adapter → androidSelector (#392)
40
41
  'ios', // appium adapter → iosSelector (#392)
41
42
  'variant', // widget recipes / native select / upload subtype
@@ -6,7 +6,7 @@ import { readYaml, readYamlIfExists } from '../../../utils/yaml-io';
6
6
 
7
7
  import { SelectorType } from '../../../utils/selector-types';
8
8
  import { DataResolver } from './data-resolver';
9
- import { DiagnosticsCollector } from '../diagnostics';
9
+ import { DiagnosticsCollector, type DiagnosticCode } from '../diagnostics';
10
10
  import { DEFAULT_CONTENT_NAMED_ROLES } from '../app-profile';
11
11
  import { reportUnknownEntryFields } from './selector-entry-fields';
12
12
  import { reportUnknownSelectorTypes } from './selector-type-validation';
@@ -33,6 +33,25 @@ interface SelectorEntry {
33
33
  // that bounces the user after the URL has already matched turns the step red instead of green.
34
34
  anchor?: SelectorEntry;
35
35
 
36
+ // === Page query identity (#748) ===
37
+ // For a `type: page` entry: `any` means the query string is NOT part of this page's identity.
38
+ //
39
+ // A bare `see [X] page` asserts that the URL carries NO query at all (#464 — a filter/search
40
+ // regression read as green while the query was wrong or gone). That is right for a page whose
41
+ // identity IS its path, and unsatisfiable for one keyed by a query — `/admins/detail?id=5`,
42
+ // where the id comes from the row the previous step clicked and is unknowable when the scenario
43
+ // is written. `with {{v}}` cannot rescue it: that asserts a LITERAL value.
44
+ //
45
+ // Declared on the ENTRY rather than added to the step grammar because it is a fact about the
46
+ // PAGE — every step targeting it needs the same reading — and because `wait for [X] page`
47
+ // already ignores the query. A step-form escape hatch would serve only the Then side and widen
48
+ // the very drift the shared url-assertion partial was written to end.
49
+ //
50
+ // It does NOT weaken a step that declares its own query: `with {{v}}` still asserts every
51
+ // declared param. This changes only what SILENCE means — from "there must be no query" to
52
+ // "the query is not mine to judge".
53
+ query?: 'any';
54
+
36
55
  // === Mobile per-platform variant (issue #392) ===
37
56
  // `android:`/`ios:` sub-selectors for one logical element whose locator differs per OS (composite
38
57
  // content-desc, partial/dynamic text, native predicate). Each is a full SelectorEntry.
@@ -166,12 +185,114 @@ export interface ResolvedSelector {
166
185
  checkedClass?: string;
167
186
  checkedAttribute?: string;
168
187
  anchor?: ResolvedSelector; // page entries only — the rendered-content proof behind `see [X] page` (#662)
188
+ query?: 'any'; // page entries only — the query is not part of this page's identity (#748)
169
189
  }
170
190
 
171
191
  /**
172
192
  * SelectorResolver - Resolves selector references to direct Playwright locator code
173
193
  * Supports natural language references with auto-generated keys
174
194
  */
195
+ /**
196
+ * Read an OWN property of a lookup table, or undefined.
197
+ *
198
+ * Every type table here — the alias map, the strategy map, the reverse index, and the parsed
199
+ * selectors.yaml itself — is a bare object literal, so it inherits Object.prototype and answers for
200
+ * keys it does not have. `elementType` is whatever word the author wrote after `]`, and the three
201
+ * readers failed three different ways on an inherited one: normalizeElementType is declared
202
+ * `: string` and returned a FUNCTION to be interpolated into a selector key; inferFromElementType
203
+ * CALLED that function with no receiver and crashed the compiler with "Cannot convert undefined or
204
+ * null to object"; and `ALIAS_SPELLINGS[t] ?? []` sailed past its own `??` guard, because a
205
+ * function is neither null nor undefined, and died on `.map`.
206
+ *
207
+ * No real feature file says `[X] valueOf`. The rule is the point: a lookup table must not answer
208
+ * for a key it does not have, and one helper is cheaper to keep right than four call sites.
209
+ */
210
+ function own<T>(table: Record<string, T>, key: string): T | undefined {
211
+ return Object.prototype.hasOwnProperty.call(table, key) ? table[key] : undefined;
212
+ }
213
+
214
+ /**
215
+ * Gherkin element-type spelling → the canonical suffix used in selectors.yaml keys.
216
+ *
217
+ * Module-scope so the table has exactly ONE reader-facing definition and the reverse index below
218
+ * can be DERIVED from it. A second, hand-written reverse table is the failure mode issue #728
219
+ * recorded: a hand-maintained mirror of something the source already states drifts, quietly, for
220
+ * months. Declaration order is meaningful — it decides which alias wins when a selectors.yaml
221
+ * declares two spellings of one canonical type (see ALIAS_SPELLINGS).
222
+ */
223
+ const ELEMENT_TYPE_ALIASES: Record<string, string> = {
224
+ // Text-like aliases → "text"
225
+ 'title': 'text',
226
+ 'label': 'text',
227
+ 'caption': 'text',
228
+ // Heading aliases → "heading" (role-based)
229
+ 'heading': 'heading',
230
+ 'header': 'heading',
231
+ 'message': 'text',
232
+ // Table-related aliases
233
+ 'column': 'columnheader',
234
+ // List-related aliases
235
+ 'list-item': 'listitem',
236
+ // Image aliases
237
+ 'logo': 'img',
238
+ 'image': 'img',
239
+ 'icon': 'img',
240
+ // Button aliases
241
+ 'btn': 'button',
242
+ // Field aliases
243
+ 'input': 'field',
244
+ 'textbox': 'field',
245
+ 'textarea': 'field',
246
+ 'editor': 'field',
247
+ // Search alias → searchbox role
248
+ 'search': 'searchbox',
249
+ // Toggle alias → switch role
250
+ 'toggle': 'switch',
251
+ // Alert alias → alertdialog role.
252
+ // UNREACHABLE in practice, kept for the same reason it is not changed: in sungen's grammar
253
+ // `alert` means the BROWSER system dialog, so `see [X] alert` matches a dedicated step pattern
254
+ // and compiles to `page.on('dialog', …)` without ever entering the selector resolver
255
+ // (verified by compiling the step; target-dictionary.mdx documents it as `page.on('dialog')`).
256
+ // This entry only answers a step form that reaches the resolver with the type `alert`, and
257
+ // none does. Removing it would be a behaviour change with no caller to benefit, so it stays.
258
+ 'alert': 'alertdialog',
259
+ // Modal/drawer alias → dialog role
260
+ 'modal': 'dialog',
261
+ 'drawer': 'dialog',
262
+ // Dropdown/select alias -> combobox role
263
+ 'dropdown': 'combobox',
264
+ 'select': 'combobox',
265
+ // Data aliases
266
+ 'item': 'listitem',
267
+ 'card': 'article',
268
+ 'cell': 'cell',
269
+ 'section': 'region',
270
+ // Feedback aliases
271
+ 'badge': 'text',
272
+ 'tooltip': 'text',
273
+ 'tag': 'text',
274
+ // Trigger aliases
275
+ 'menuitem': 'menuitem',
276
+ // System aliases
277
+ 'progressbar': 'progressbar',
278
+ 'spinner': 'status',
279
+ 'breadcrumb': 'navigation',
280
+ };
281
+
282
+ /**
283
+ * Canonical type → every alias spelling that normalizes to it, in ELEMENT_TYPE_ALIASES declaration
284
+ * order. Derived, never authored. Identity entries ('heading': 'heading') are excluded: they are
285
+ * already covered by the canonical candidate and would only duplicate a lookup.
286
+ */
287
+ const ALIAS_SPELLINGS: Record<string, string[]> = (() => {
288
+ const out: Record<string, string[]> = {};
289
+ for (const [alias, canonical] of Object.entries(ELEMENT_TYPE_ALIASES)) {
290
+ if (alias === canonical) continue;
291
+ (out[canonical] ??= []).push(alias);
292
+ }
293
+ return out;
294
+ })();
295
+
175
296
  export class SelectorResolver {
176
297
  private selectorCache = new Map<string, SelectorFile | LegacySelectorFile>();
177
298
  private selectorsDir: string;
@@ -393,69 +514,54 @@ export class SelectorResolver {
393
514
  'navigation': () => ({ strategy: 'role', role: 'navigation', name: label, value: 'navigation' }),
394
515
  };
395
516
 
396
- const factory = strategyMap[normalized];
517
+ const factory = own(strategyMap, normalized);
397
518
  return factory ? factory() : null;
398
519
  }
399
520
 
521
+ /**
522
+ * Does the compiler have an OPINION about this element type — is it an alias it normalizes, or a
523
+ * type auto-infer can serve?
524
+ *
525
+ * The distinction decides whether the last-resort sweep may run, and it exists because
526
+ * `step.elementType` is not always an element type. The parser takes the first word after `]`
527
+ * (gherkin-parser/index.ts), so `see [Quick Panel] is hidden` arrives here with the "type" `is`
528
+ * and `drag [Item] to [Drop Zone]` with `to`. Nine such function words appear across the shipped
529
+ * features. A word the compiler cannot reason about carries no type information at all, so it must
530
+ * not be treated as a narrowing signal — a step like that has to keep the same open fallback a
531
+ * bare `[Ref]` gets, or a project whose label needs suffixed keys loses every state-clause step.
532
+ *
533
+ * Derived from the two maps rather than listed, so a new alias or strategy is known here the day
534
+ * it is added. tests/docs/element-type-vocabulary-parity.run.ts pins the maps against the parser's
535
+ * own list and the published table.
536
+ */
537
+ private static isKnownElementType(elementType: string): boolean {
538
+ if (own(ELEMENT_TYPE_ALIASES, elementType) !== undefined) return true;
539
+ return SelectorResolver.inferFromElementType(elementType, '') !== null;
540
+ }
541
+
542
+ /**
543
+ * Every selectors.yaml key that could legitimately hold the entry for `[label] <elementType>`.
544
+ *
545
+ * Shared by the lookup and by the not-found message, so the error can never advertise a key the
546
+ * resolver did not actually try — the two drifting apart is how #752 stayed invisible: the throw
547
+ * that would have named the missing key was unreachable, and when it did fire it listed two
548
+ * candidates while the resolver had its own idea of which to check.
549
+ */
550
+ private static typedKeyCandidates(key: string, elementType: string, normalizedType: string): string[] {
551
+ return [...new Set([
552
+ `${key}--${normalizedType}`,
553
+ `${key}--${elementType}`,
554
+ ...(own(ALIAS_SPELLINGS, normalizedType) ?? []).map((alias) => `${key}--${alias}`),
555
+ ])];
556
+ }
557
+
400
558
  /**
401
559
  * Normalize elementType aliases to canonical YAML suffix
402
560
  * Gherkin writers may use: title, label, heading, text → all map to "text"
403
561
  * Similarly: btn → button, link → link, input/field → field
404
562
  */
405
563
  private static normalizeElementType(elementType: string): string {
406
- const aliasMap: Record<string, string> = {
407
- // Text-like aliases → "text"
408
- 'title': 'text',
409
- 'label': 'text',
410
- 'caption': 'text',
411
- // Heading aliases → "heading" (role-based)
412
- 'heading': 'heading',
413
- 'header': 'heading',
414
- 'message': 'text',
415
- // Table-related aliases
416
- 'column': 'columnheader',
417
- // List-related aliases
418
- 'list-item': 'listitem',
419
- // Image aliases
420
- 'logo': 'img',
421
- 'image': 'img',
422
- 'icon': 'img',
423
- // Button aliases
424
- 'btn': 'button',
425
- // Field aliases
426
- 'input': 'field',
427
- 'textbox': 'field',
428
- 'textarea': 'field',
429
- 'editor': 'field',
430
- // Search alias → searchbox role
431
- 'search': 'searchbox',
432
- // Toggle alias → switch role
433
- 'toggle': 'switch',
434
- // Alert alias → alertdialog role
435
- 'alert': 'alertdialog',
436
- // Modal/drawer alias → dialog role
437
- 'modal': 'dialog',
438
- 'drawer': 'dialog',
439
- // Dropdown/select alias -> combobox role
440
- 'dropdown': 'combobox',
441
- 'select': 'combobox',
442
- // Data aliases
443
- 'item': 'listitem',
444
- 'card': 'article',
445
- 'cell': 'cell',
446
- 'section': 'region',
447
- // Feedback aliases
448
- 'badge': 'text',
449
- 'tooltip': 'text',
450
- 'tag': 'text',
451
- // Trigger aliases
452
- 'menuitem': 'menuitem',
453
- // System aliases
454
- 'progressbar': 'progressbar',
455
- 'spinner': 'status',
456
- 'breadcrumb': 'navigation',
457
- };
458
- return aliasMap[elementType] || elementType;
564
+ return own(ELEMENT_TYPE_ALIASES, elementType) ?? elementType;
459
565
  }
460
566
 
461
567
  /**
@@ -475,33 +581,37 @@ export class SelectorResolver {
475
581
  // Try nth-suffixed key first: hay.gui.loi.cam.on--3
476
582
  if (nth && nth > 0) {
477
583
  const nthKey = `${key}--${nth}`;
478
- const nthEntry = selectorFile[nthKey];
584
+ const nthEntry = own(selectorFile, nthKey);
479
585
  if (nthEntry) {
480
586
  return this.resolveFromEntry(nthEntry, displayLabel);
481
587
  }
482
588
  }
483
589
 
484
- // Try type-suffixed key first: add.campaign--button, add.campaign--text
590
+ // Try type-suffixed keys: add.campaign--button, add.campaign--text
591
+ //
592
+ // EVERY spelling of the step's type is tried, not just the two the step itself could have been
593
+ // written with (#752). The alias table maps a Gherkin spelling onto a canonical one, but it was
594
+ // only ever applied to the STEP; the file's keys were compared raw. So `confirm--modal` was
595
+ // invisible to `[Confirm] dialog` while `confirm--dialog` resolved for `[Confirm] modal` —
596
+ // the mapping is one-directional and the lookup inherited that. The hole was not specific to
597
+ // modal/drawer: all 30 non-identity aliases had it.
598
+ //
599
+ // Order is deterministic and NOT file order: canonical first (the spelling the compiler thinks
600
+ // in), then whatever the author literally typed, then the remaining aliases in alias-table
601
+ // declaration order. A file declaring both `--modal` and `--drawer` therefore resolves the same
602
+ // way on every machine.
485
603
  if (elementType) {
486
604
  const normalizedType = SelectorResolver.normalizeElementType(elementType);
487
- const typedKey = `${key}--${normalizedType}`;
488
- const typedEntry = selectorFile[typedKey];
489
- if (typedEntry) {
490
- return this.resolveFromEntry(typedEntry, displayLabel);
491
- }
492
-
493
- // If normalized differs from original, also try original as-is
494
- if (normalizedType !== elementType) {
495
- const originalKey = `${key}--${elementType}`;
496
- const originalEntry = selectorFile[originalKey];
497
- if (originalEntry) {
498
- return this.resolveFromEntry(originalEntry, displayLabel);
605
+ for (const candidate of SelectorResolver.typedKeyCandidates(key, elementType, normalizedType)) {
606
+ const typedEntry = own(selectorFile, candidate);
607
+ if (typedEntry) {
608
+ return this.resolveFromEntry(typedEntry, displayLabel);
499
609
  }
500
610
  }
501
611
  }
502
612
 
503
613
  // Fallback to base key
504
- const entry = selectorFile[key];
614
+ const entry = own(selectorFile, key);
505
615
  if (entry) {
506
616
  return this.resolveFromEntry(entry, displayLabel);
507
617
  }
@@ -545,20 +655,30 @@ export class SelectorResolver {
545
655
  }
546
656
  }
547
657
 
548
- // Last resort: find any suffixed key matching key--*
549
- const suffixedKeys = Object.keys(selectorFile).filter(k => k.startsWith(`${key}--`));
550
- if (suffixedKeys.length > 0) {
551
- return this.resolveFromEntry(selectorFile[suffixedKeys[0]], displayLabel);
552
- }
553
-
554
- const tried: string[] = [];
555
- if (elementType) {
556
- const normalizedType = SelectorResolver.normalizeElementType(elementType);
557
- tried.push(`${key}--${normalizedType}`);
558
- if (normalizedType !== elementType) {
559
- tried.push(`${key}--${elementType}`);
658
+ // Last resort: any suffixed key matching key--*, for a [Ref] the compiler could not type.
659
+ //
660
+ // Two cases reach here and they are the same case: a bare [Ref] with no word after it, and a
661
+ // [Ref] followed by a word that is not an element type. The parser cannot tell the two apart —
662
+ // it takes the FIRST word after `]`, so `see [Quick Panel] is hidden` arrives typed `is`. In
663
+ // both, nothing is known about what kind of element is wanted, so any suffixed key is as good a
664
+ // guess as the next, and a project whose label needs suffixed keys keeps its state-clause steps.
665
+ //
666
+ // A step the compiler CAN type gets no such guess. The candidate scan above already tried every
667
+ // spelling that normalizes to that type, so whatever is still sitting under `key--` is a
668
+ // DIFFERENT element, and handing it back is the silent-wrong-answer shape of #752 itself.
669
+ // Falling through to the throw is better: it names the keys that were tried, and "add an entry"
670
+ // is an instruction the author can act on.
671
+ if (!elementType || !SelectorResolver.isKnownElementType(elementType)) {
672
+ const suffixedKeys = Object.keys(selectorFile).filter(k => k.startsWith(`${key}--`));
673
+ if (suffixedKeys.length > 0) {
674
+ return this.resolveFromEntry(selectorFile[suffixedKeys[0]], displayLabel);
560
675
  }
561
676
  }
677
+
678
+ const tried: string[] = elementType
679
+ ? SelectorResolver.typedKeyCandidates(
680
+ key, elementType, SelectorResolver.normalizeElementType(elementType))
681
+ : [];
562
682
  const suffix = tried.length > 0 ? ` (also tried ${tried.join(', ')})` : '';
563
683
  throw new Error(
564
684
  `Selector "${label}" (key: ${key}) not found in ${featureName}.yaml${suffix}. ` +
@@ -751,6 +871,20 @@ export class SelectorResolver {
751
871
  return out.class || out.attribute ? out : undefined;
752
872
  }
753
873
 
874
+ /**
875
+ * Report a selectors.yaml problem ONCE per entry+field, not once per step that resolves it.
876
+ *
877
+ * An entry is resolved again for every step that names it, so an unguarded `diagnostics.add`
878
+ * here repeats the same sentence a dozen times for one typo and buries everything else in the
879
+ * channel. `warnedContentNamed` is the existing de-dupe set; `key` namespaces the callers so two
880
+ * diagnostics about one entry cannot silence each other.
881
+ */
882
+ private warnOnce(key: string, code: DiagnosticCode, message: string): void {
883
+ if (this.warnedContentNamed.has(key)) return;
884
+ this.warnedContentNamed.add(key);
885
+ this.diagnostics?.add(code, message, { feature: this.featureName });
886
+ }
887
+
754
888
  /**
755
889
  * Resolve a selectors.yaml entry that is NOT reachable by key — a `columns.<col>.elements.cell`
756
890
  * declaration, which lives nested under a table entry. Public for that one caller; everything
@@ -824,6 +958,28 @@ export class SelectorResolver {
824
958
  // The anchor is a selector in its own right; it must not inherit the PAGE's label as its
825
959
  // accessible name, so it resolves against its own name (or nothing).
826
960
  if (entry.anchor) v2Fields.anchor = this.resolveFromEntry(entry.anchor, entry.anchor.name ?? '');
961
+ // Gated on the entry KIND, like the value check below: `query:` means nothing on a non-page
962
+ // entry, and both the field and its diagnostic are worded purely in page terms. Today's two
963
+ // consumers re-check `selectorType === 'page'` at the read site (the `anchor:` precedent), so
964
+ // this is belt-and-braces — but a third consumer that forgets the guard would otherwise inherit
965
+ // a field that was never meant for it.
966
+ if (type === 'page' && entry.query !== undefined) {
967
+ const declared = String(entry.query).trim().toLowerCase();
968
+ // Exactly one value is legal today. A typo must NOT read as the permissive form: it would
969
+ // silently turn off the bare-page query assertion (#464) on a page the author meant to keep
970
+ // strict, which is the class of quiet weakening this whole diagnostic channel exists for.
971
+ if (declared === 'any') v2Fields.query = 'any';
972
+ else this.warnOnce(`w037:${originalLabel}:query`, 'SG-W037',
973
+ `selector "${originalLabel}": query: ${JSON.stringify(String(entry.query))} is not a query rule — the only value is \`any\` ("the query is not part of this page's identity"). The declaration is ignored, so a bare \`see [${originalLabel}] page\` still requires the URL to carry NO query at all.`);
974
+ }
975
+ // A page `value` is the PATH only — pathToRegexSource strips a `?`/`#` before building the
976
+ // pattern. Silently, until now: an author who hit the bare-page query rule (#464) and reached
977
+ // for the obvious workaround got byte-identical output and no hint why, which is exactly how
978
+ // #748 was misdiagnosed in the field as a regex-escaping bug.
979
+ if (type === 'page' && typeof entry.value === 'string' && /[?#]/.test(entry.value)) {
980
+ this.warnOnce(`w037:${originalLabel}:value`, 'SG-W037',
981
+ `selector "${originalLabel}": the page value ${JSON.stringify(entry.value)} carries a query/fragment, which is DROPPED — a page value is the path only, and the pattern is matched against \`u.pathname\`, which never holds one. Writing it here changes nothing. To assert the query, declare it on the step (\`see [${originalLabel}] page with {{v}}\`); to say the query is not part of this page's identity, add \`query: any\` to the entry.`);
982
+ }
827
983
 
828
984
  // Helper to attach v2 fields and inputMethod
829
985
  const withExtras = (resolved: ResolvedSelector): ResolvedSelector => {