@plune-ai/cairn 0.9.0 → 0.11.0

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 (337) hide show
  1. package/README.md +84 -8
  2. package/dist/agent/check-docs.d.ts +25 -0
  3. package/dist/agent/check-docs.d.ts.map +1 -0
  4. package/dist/agent/check-docs.js +57 -0
  5. package/dist/agent/check-docs.js.map +1 -0
  6. package/dist/agent/collect-docs.d.ts +94 -0
  7. package/dist/agent/collect-docs.d.ts.map +1 -0
  8. package/dist/agent/collect-docs.js +326 -0
  9. package/dist/agent/collect-docs.js.map +1 -0
  10. package/dist/agent/graph.d.ts +39 -2
  11. package/dist/agent/graph.d.ts.map +1 -1
  12. package/dist/agent/graph.js +113 -4
  13. package/dist/agent/graph.js.map +1 -1
  14. package/dist/agent/index.d.ts +14 -0
  15. package/dist/agent/index.d.ts.map +1 -1
  16. package/dist/agent/index.js +114 -10
  17. package/dist/agent/index.js.map +1 -1
  18. package/dist/agent/overlays.d.ts +88 -0
  19. package/dist/agent/overlays.d.ts.map +1 -0
  20. package/dist/agent/overlays.js +447 -0
  21. package/dist/agent/overlays.js.map +1 -0
  22. package/dist/agent/repair-loop.d.ts +8 -1
  23. package/dist/agent/repair-loop.d.ts.map +1 -1
  24. package/dist/agent/repair-loop.js +18 -3
  25. package/dist/agent/repair-loop.js.map +1 -1
  26. package/dist/analyze/index.d.ts +1 -1
  27. package/dist/analyze/index.d.ts.map +1 -1
  28. package/dist/analyze/index.js +3 -2
  29. package/dist/analyze/index.js.map +1 -1
  30. package/dist/api/adversarial.d.ts +1 -1
  31. package/dist/api/adversarial.js +1 -1
  32. package/dist/api/collection.d.ts +20 -0
  33. package/dist/api/collection.d.ts.map +1 -0
  34. package/dist/api/collection.js +357 -0
  35. package/dist/api/collection.js.map +1 -0
  36. package/dist/api/derived.d.ts +179 -0
  37. package/dist/api/derived.d.ts.map +1 -0
  38. package/dist/api/derived.js +852 -0
  39. package/dist/api/derived.js.map +1 -0
  40. package/dist/api/discover.d.ts +66 -0
  41. package/dist/api/discover.d.ts.map +1 -0
  42. package/dist/api/discover.js +125 -0
  43. package/dist/api/discover.js.map +1 -0
  44. package/dist/api/flows.d.ts +194 -0
  45. package/dist/api/flows.d.ts.map +1 -0
  46. package/dist/api/flows.js +663 -0
  47. package/dist/api/flows.js.map +1 -0
  48. package/dist/api/guard.d.ts +19 -0
  49. package/dist/api/guard.d.ts.map +1 -1
  50. package/dist/api/guard.js +18 -4
  51. package/dist/api/guard.js.map +1 -1
  52. package/dist/api/openapi.d.ts +17 -1
  53. package/dist/api/openapi.d.ts.map +1 -1
  54. package/dist/api/openapi.js +64 -3
  55. package/dist/api/openapi.js.map +1 -1
  56. package/dist/api/runner.d.ts.map +1 -1
  57. package/dist/api/runner.js +18 -14
  58. package/dist/api/runner.js.map +1 -1
  59. package/dist/api/two-actor.d.ts +165 -0
  60. package/dist/api/two-actor.d.ts.map +1 -0
  61. package/dist/api/two-actor.js +627 -0
  62. package/dist/api/two-actor.js.map +1 -0
  63. package/dist/artifacts/contract.d.ts +1 -1
  64. package/dist/artifacts/contract.d.ts.map +1 -1
  65. package/dist/artifacts/index.d.ts +5 -0
  66. package/dist/artifacts/index.d.ts.map +1 -1
  67. package/dist/artifacts/index.js +14 -10
  68. package/dist/artifacts/index.js.map +1 -1
  69. package/dist/artifacts/report.d.ts +29 -2
  70. package/dist/artifacts/report.d.ts.map +1 -1
  71. package/dist/artifacts/report.js +65 -1
  72. package/dist/artifacts/report.js.map +1 -1
  73. package/dist/artifacts/testcase-md.d.ts +18 -0
  74. package/dist/artifacts/testcase-md.d.ts.map +1 -1
  75. package/dist/artifacts/testcase-md.js +15 -1
  76. package/dist/artifacts/testcase-md.js.map +1 -1
  77. package/dist/browser/api-traffic.d.ts +85 -0
  78. package/dist/browser/api-traffic.d.ts.map +1 -0
  79. package/dist/browser/api-traffic.js +283 -0
  80. package/dist/browser/api-traffic.js.map +1 -0
  81. package/dist/browser/backends/playwright-cli.d.ts.map +1 -1
  82. package/dist/browser/backends/playwright-cli.js +3 -0
  83. package/dist/browser/backends/playwright-cli.js.map +1 -1
  84. package/dist/browser/backends/playwright-lib.d.ts +84 -1
  85. package/dist/browser/backends/playwright-lib.d.ts.map +1 -1
  86. package/dist/browser/backends/playwright-lib.js +677 -32
  87. package/dist/browser/backends/playwright-lib.js.map +1 -1
  88. package/dist/browser/click-effect.d.ts +84 -0
  89. package/dist/browser/click-effect.d.ts.map +1 -0
  90. package/dist/browser/click-effect.js +235 -0
  91. package/dist/browser/click-effect.js.map +1 -0
  92. package/dist/browser/gateway.d.ts +9 -1
  93. package/dist/browser/gateway.d.ts.map +1 -1
  94. package/dist/browser/index.d.ts +3 -0
  95. package/dist/browser/index.d.ts.map +1 -1
  96. package/dist/browser/index.js +5 -0
  97. package/dist/browser/index.js.map +1 -1
  98. package/dist/browser/types.d.ts +196 -1
  99. package/dist/browser/types.d.ts.map +1 -1
  100. package/dist/cli/index.d.ts +1 -1
  101. package/dist/cli/index.d.ts.map +1 -1
  102. package/dist/cli/index.js +123 -5
  103. package/dist/cli/index.js.map +1 -1
  104. package/dist/codegen/index.d.ts +10 -1
  105. package/dist/codegen/index.d.ts.map +1 -1
  106. package/dist/codegen/index.js +28 -7
  107. package/dist/codegen/index.js.map +1 -1
  108. package/dist/codegen/lint.d.ts +32 -1
  109. package/dist/codegen/lint.d.ts.map +1 -1
  110. package/dist/codegen/lint.js +286 -1
  111. package/dist/codegen/lint.js.map +1 -1
  112. package/dist/codegen/mailbox.d.ts +19 -0
  113. package/dist/codegen/mailbox.d.ts.map +1 -0
  114. package/dist/codegen/mailbox.js +78 -0
  115. package/dist/codegen/mailbox.js.map +1 -0
  116. package/dist/codegen/schema.d.ts.map +1 -1
  117. package/dist/codegen/schema.js +3 -2
  118. package/dist/codegen/schema.js.map +1 -1
  119. package/dist/config/profiles.d.ts +2 -0
  120. package/dist/config/profiles.d.ts.map +1 -1
  121. package/dist/config/profiles.js +2 -0
  122. package/dist/config/profiles.js.map +1 -1
  123. package/dist/core/modalities/api.d.ts.map +1 -1
  124. package/dist/core/modalities/api.js +265 -29
  125. package/dist/core/modalities/api.js.map +1 -1
  126. package/dist/core/modalities/check-docs.d.ts +3 -0
  127. package/dist/core/modalities/check-docs.d.ts.map +1 -0
  128. package/dist/core/modalities/check-docs.js +64 -0
  129. package/dist/core/modalities/check-docs.js.map +1 -0
  130. package/dist/core/modalities/collect-docs.d.ts +3 -0
  131. package/dist/core/modalities/collect-docs.d.ts.map +1 -0
  132. package/dist/core/modalities/collect-docs.js +48 -0
  133. package/dist/core/modalities/collect-docs.js.map +1 -0
  134. package/dist/core/modalities/explore.d.ts.map +1 -1
  135. package/dist/core/modalities/explore.js +2 -0
  136. package/dist/core/modalities/explore.js.map +1 -1
  137. package/dist/core/modalities/mcp-test.d.ts +3 -0
  138. package/dist/core/modalities/mcp-test.d.ts.map +1 -0
  139. package/dist/core/modalities/mcp-test.js +26 -0
  140. package/dist/core/modalities/mcp-test.js.map +1 -0
  141. package/dist/core/registry.d.ts.map +1 -1
  142. package/dist/core/registry.js +11 -3
  143. package/dist/core/registry.js.map +1 -1
  144. package/dist/decider/uses/repair-triage.d.ts +9 -0
  145. package/dist/decider/uses/repair-triage.d.ts.map +1 -1
  146. package/dist/decider/uses/repair-triage.js +20 -3
  147. package/dist/decider/uses/repair-triage.js.map +1 -1
  148. package/dist/design/critique.d.ts +1 -1
  149. package/dist/design/index.d.ts +7 -1
  150. package/dist/design/index.d.ts.map +1 -1
  151. package/dist/design/index.js +20 -2
  152. package/dist/design/index.js.map +1 -1
  153. package/dist/design/schema.d.ts +9 -3
  154. package/dist/design/schema.d.ts.map +1 -1
  155. package/dist/design/schema.js +4 -1
  156. package/dist/design/schema.js.map +1 -1
  157. package/dist/documentarian/check.d.ts +91 -0
  158. package/dist/documentarian/check.d.ts.map +1 -0
  159. package/dist/documentarian/check.js +230 -0
  160. package/dist/documentarian/check.js.map +1 -0
  161. package/dist/documentarian/docs.d.ts +103 -0
  162. package/dist/documentarian/docs.d.ts.map +1 -0
  163. package/dist/documentarian/docs.js +243 -0
  164. package/dist/documentarian/docs.js.map +1 -0
  165. package/dist/documentarian/index.d.ts +2 -0
  166. package/dist/documentarian/index.d.ts.map +1 -1
  167. package/dist/documentarian/index.js +5 -4
  168. package/dist/documentarian/index.js.map +1 -1
  169. package/dist/environment/apply.js +1 -1
  170. package/dist/environment/apply.js.map +1 -1
  171. package/dist/flow/crawl.d.ts +4 -0
  172. package/dist/flow/crawl.d.ts.map +1 -1
  173. package/dist/flow/crawl.js +9 -2
  174. package/dist/flow/crawl.js.map +1 -1
  175. package/dist/fs/inside-dir.d.ts +8 -0
  176. package/dist/fs/inside-dir.d.ts.map +1 -0
  177. package/dist/fs/inside-dir.js +15 -0
  178. package/dist/fs/inside-dir.js.map +1 -0
  179. package/dist/index.d.ts +6 -2
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +3 -0
  182. package/dist/index.js.map +1 -1
  183. package/dist/llm/index.d.ts +1 -1
  184. package/dist/llm/index.d.ts.map +1 -1
  185. package/dist/llm/index.js +1 -1
  186. package/dist/llm/index.js.map +1 -1
  187. package/dist/llm/structured.d.ts +19 -0
  188. package/dist/llm/structured.d.ts.map +1 -1
  189. package/dist/llm/structured.js +61 -0
  190. package/dist/llm/structured.js.map +1 -1
  191. package/dist/mailbox/doctor.d.ts +10 -0
  192. package/dist/mailbox/doctor.d.ts.map +1 -0
  193. package/dist/mailbox/doctor.js +33 -0
  194. package/dist/mailbox/doctor.js.map +1 -0
  195. package/dist/mailbox/rule.d.ts +34 -0
  196. package/dist/mailbox/rule.d.ts.map +1 -0
  197. package/dist/mailbox/rule.js +47 -0
  198. package/dist/mailbox/rule.js.map +1 -0
  199. package/dist/mailbox/session.d.ts +5 -0
  200. package/dist/mailbox/session.d.ts.map +1 -1
  201. package/dist/mailbox/session.js +8 -0
  202. package/dist/mailbox/session.js.map +1 -1
  203. package/dist/mcp/server.d.ts +15 -5
  204. package/dist/mcp/server.d.ts.map +1 -1
  205. package/dist/mcp/server.js +75 -27
  206. package/dist/mcp/server.js.map +1 -1
  207. package/dist/mcp/tools.d.ts +194 -82
  208. package/dist/mcp/tools.d.ts.map +1 -1
  209. package/dist/mcp/tools.js +82 -8
  210. package/dist/mcp/tools.js.map +1 -1
  211. package/dist/mcp-test/adversarial.d.ts +80 -0
  212. package/dist/mcp-test/adversarial.d.ts.map +1 -0
  213. package/dist/mcp-test/adversarial.js +99 -0
  214. package/dist/mcp-test/adversarial.js.map +1 -0
  215. package/dist/mcp-test/advice.d.ts +20 -0
  216. package/dist/mcp-test/advice.d.ts.map +1 -0
  217. package/dist/mcp-test/advice.js +22 -0
  218. package/dist/mcp-test/advice.js.map +1 -0
  219. package/dist/mcp-test/call.d.ts +76 -0
  220. package/dist/mcp-test/call.d.ts.map +1 -0
  221. package/dist/mcp-test/call.js +105 -0
  222. package/dist/mcp-test/call.js.map +1 -0
  223. package/dist/mcp-test/cases.d.ts +154 -0
  224. package/dist/mcp-test/cases.d.ts.map +1 -0
  225. package/dist/mcp-test/cases.js +643 -0
  226. package/dist/mcp-test/cases.js.map +1 -0
  227. package/dist/mcp-test/connect.d.ts +70 -0
  228. package/dist/mcp-test/connect.d.ts.map +1 -0
  229. package/dist/mcp-test/connect.js +426 -0
  230. package/dist/mcp-test/connect.js.map +1 -0
  231. package/dist/mcp-test/coverage.d.ts +61 -0
  232. package/dist/mcp-test/coverage.d.ts.map +1 -0
  233. package/dist/mcp-test/coverage.js +76 -0
  234. package/dist/mcp-test/coverage.js.map +1 -0
  235. package/dist/mcp-test/discover.d.ts +40 -0
  236. package/dist/mcp-test/discover.d.ts.map +1 -0
  237. package/dist/mcp-test/discover.js +149 -0
  238. package/dist/mcp-test/discover.js.map +1 -0
  239. package/dist/mcp-test/guard.d.ts +161 -0
  240. package/dist/mcp-test/guard.d.ts.map +1 -0
  241. package/dist/mcp-test/guard.js +363 -0
  242. package/dist/mcp-test/guard.js.map +1 -0
  243. package/dist/mcp-test/model.d.ts +89 -0
  244. package/dist/mcp-test/model.d.ts.map +1 -0
  245. package/dist/mcp-test/model.js +88 -0
  246. package/dist/mcp-test/model.js.map +1 -0
  247. package/dist/mcp-test/payloads.d.ts +20 -0
  248. package/dist/mcp-test/payloads.d.ts.map +1 -0
  249. package/dist/mcp-test/payloads.js +20 -0
  250. package/dist/mcp-test/payloads.js.map +1 -0
  251. package/dist/mcp-test/report.d.ts +55 -0
  252. package/dist/mcp-test/report.d.ts.map +1 -0
  253. package/dist/mcp-test/report.js +157 -0
  254. package/dist/mcp-test/report.js.map +1 -0
  255. package/dist/mcp-test/run.d.ts +68 -0
  256. package/dist/mcp-test/run.d.ts.map +1 -0
  257. package/dist/mcp-test/run.js +467 -0
  258. package/dist/mcp-test/run.js.map +1 -0
  259. package/dist/mcp-test/runner.d.ts +133 -0
  260. package/dist/mcp-test/runner.d.ts.map +1 -0
  261. package/dist/mcp-test/runner.js +412 -0
  262. package/dist/mcp-test/runner.js.map +1 -0
  263. package/dist/mcp-test/schema.d.ts +103 -0
  264. package/dist/mcp-test/schema.d.ts.map +1 -0
  265. package/dist/mcp-test/schema.js +513 -0
  266. package/dist/mcp-test/schema.js.map +1 -0
  267. package/dist/mcp-test/secrets.d.ts +25 -0
  268. package/dist/mcp-test/secrets.d.ts.map +1 -0
  269. package/dist/mcp-test/secrets.js +67 -0
  270. package/dist/mcp-test/secrets.js.map +1 -0
  271. package/dist/observe/index.d.ts +3 -1
  272. package/dist/observe/index.d.ts.map +1 -1
  273. package/dist/observe/index.js +1 -0
  274. package/dist/observe/index.js.map +1 -1
  275. package/dist/observe/locator-hints.d.ts +18 -0
  276. package/dist/observe/locator-hints.d.ts.map +1 -0
  277. package/dist/observe/locator-hints.js +36 -0
  278. package/dist/observe/locator-hints.js.map +1 -0
  279. package/dist/observe/overlays.d.ts +135 -0
  280. package/dist/observe/overlays.d.ts.map +1 -0
  281. package/dist/observe/overlays.js +242 -0
  282. package/dist/observe/overlays.js.map +1 -0
  283. package/dist/observe/parse-aria.d.ts +7 -1
  284. package/dist/observe/parse-aria.d.ts.map +1 -1
  285. package/dist/observe/parse-aria.js +79 -4
  286. package/dist/observe/parse-aria.js.map +1 -1
  287. package/dist/probe/index.d.ts +3 -1
  288. package/dist/probe/index.d.ts.map +1 -1
  289. package/dist/probe/index.js +3 -2
  290. package/dist/probe/index.js.map +1 -1
  291. package/dist/project/index.d.ts +2 -0
  292. package/dist/project/index.d.ts.map +1 -1
  293. package/dist/project/index.js +10 -2
  294. package/dist/project/index.js.map +1 -1
  295. package/dist/prompts/local/describe-screen.d.ts +7 -0
  296. package/dist/prompts/local/describe-screen.d.ts.map +1 -0
  297. package/dist/prompts/local/describe-screen.js +29 -0
  298. package/dist/prompts/local/describe-screen.js.map +1 -0
  299. package/dist/prompts/local/index.d.ts.map +1 -1
  300. package/dist/prompts/local/index.js +7 -0
  301. package/dist/prompts/local/index.js.map +1 -1
  302. package/dist/prompts/local/name-overlays.d.ts +6 -0
  303. package/dist/prompts/local/name-overlays.d.ts.map +1 -0
  304. package/dist/prompts/local/name-overlays.js +16 -0
  305. package/dist/prompts/local/name-overlays.js.map +1 -0
  306. package/dist/prompts/local/qa-api-flows.d.ts +8 -0
  307. package/dist/prompts/local/qa-api-flows.d.ts.map +1 -0
  308. package/dist/prompts/local/qa-api-flows.js +19 -0
  309. package/dist/prompts/local/qa-api-flows.js.map +1 -0
  310. package/dist/prompts/local/qa-playwright-ts-writer.d.ts +1 -1
  311. package/dist/prompts/local/qa-playwright-ts-writer.d.ts.map +1 -1
  312. package/dist/prompts/local/qa-playwright-ts-writer.js +5 -1
  313. package/dist/prompts/local/qa-playwright-ts-writer.js.map +1 -1
  314. package/dist/prompts/local/qa-testcase-from-ui.d.ts +1 -1
  315. package/dist/prompts/local/qa-testcase-from-ui.d.ts.map +1 -1
  316. package/dist/prompts/local/qa-testcase-from-ui.js +2 -0
  317. package/dist/prompts/local/qa-testcase-from-ui.js.map +1 -1
  318. package/dist/session/index.d.ts.map +1 -1
  319. package/dist/session/index.js +24 -2
  320. package/dist/session/index.js.map +1 -1
  321. package/dist/validate/index.d.ts +11 -0
  322. package/dist/validate/index.d.ts.map +1 -1
  323. package/dist/validate/index.js +21 -0
  324. package/dist/validate/index.js.map +1 -1
  325. package/dist/validate/runner.d.ts +15 -1
  326. package/dist/validate/runner.d.ts.map +1 -1
  327. package/dist/validate/runner.js +158 -25
  328. package/dist/validate/runner.js.map +1 -1
  329. package/dist/validate/write-guard.d.ts +24 -0
  330. package/dist/validate/write-guard.d.ts.map +1 -0
  331. package/dist/validate/write-guard.js +210 -0
  332. package/dist/validate/write-guard.js.map +1 -0
  333. package/dist/view/index.d.ts +9 -0
  334. package/dist/view/index.d.ts.map +1 -0
  335. package/dist/view/index.js +126 -0
  336. package/dist/view/index.js.map +1 -0
  337. package/package.json +3 -2
@@ -41,19 +41,34 @@ function rankFor(role, interactive) {
41
41
  return 1;
42
42
  return 0;
43
43
  }
44
+ /** #225: roles whose children are scoped to them in a locator. */
45
+ const SCOPE_ROLES = new Set(["dialog", "alertdialog"]);
46
+ /** #225: roles overlay detection groups elements by. */
47
+ const CONTAINER_ROLES = new Set(["dialog", "alertdialog", "menu", "listbox", "complementary"]);
48
+ /** #226: containers whose accessible name tells apart the identical elements inside them (the rows of a table, the cards of a list). */
49
+ const CONTEXT_ROLES = new Set(["row", "listitem", "article", "group", "region", "form", "treeitem"]);
50
+ const MAX_CONTEXT = 3;
51
+ /** `role|name` — how a dialog is named in {@link ParseOptions.nonModal} and `Observation.nonModal`. */
52
+ export const overlayKey = (role, name) => `${role}|${name ?? ""}`;
44
53
  /**
45
54
  * Parses the Playwright `ariaSnapshot()` output (YAML-like) into ranked `ElementRef[]`
46
55
  * in document order. Skips property lines (`/url`, `/checked`…) and text nodes (`text:`).
47
56
  * A pure function — fully testable without a browser.
48
57
  */
49
- export function parseAriaSnapshot(aria) {
58
+ export function parseAriaSnapshot(aria, opts = {}) {
50
59
  const out = [];
51
60
  let n = 0;
61
+ /** #225: the open ancestors of the line being read, by indentation. */
62
+ const open = [];
63
+ /** #225: for each output element, the output index of every dialog around it (itself last when it is one). */
64
+ const chains = [];
65
+ const modals = [];
52
66
  for (const raw of aria.split(/\r?\n/)) {
53
67
  const line = raw.trimStart();
54
68
  if (!line.startsWith("- "))
55
69
  continue;
56
- const content = line.slice(2).trim();
70
+ const indent = raw.length - line.length;
71
+ const content = unquoteKey(line.slice(2).trim());
57
72
  if (content.startsWith("/")) {
58
73
  // Property line (/url, /checked, /disabled…). Capture /url onto the preceding element (its link)
59
74
  // so crawl can dedup links by (name, href) — #102. Other properties are skipped.
@@ -68,13 +83,73 @@ export function parseAriaSnapshot(aria) {
68
83
  const role = content.match(/^([a-zA-Z][\w-]*)/)?.[1];
69
84
  if (!role || role === "text")
70
85
  continue; // text node or unparseable
71
- const name = content.match(/"([^"]*)"/)?.[1];
86
+ // #238: the snapshot quotes a name as a JSON string, so `Say "hi"` arrives as `"Say \"hi\""`; read past escaped quotes and unescape.
87
+ const quoted = content.match(/"((?:[^"\\]|\\.)*)"/)?.[1];
88
+ const name = quoted === undefined ? undefined : unescapeName(quoted);
72
89
  // A native ref from the cli/MCP snapshot (`[ref=e15]`) takes priority over a synthesized one.
73
90
  const nativeRef = content.match(/\[ref=([^\]\s]+)\]/)?.[1];
74
91
  const interactive = INTERACTIVE.has(role);
75
92
  n += 1;
76
- out.push({ ref: nativeRef ?? `e${n}`, role, name, interactive, rank: rankFor(role, interactive) });
93
+ while (open.length > 0 && open[open.length - 1].indent >= indent)
94
+ open.pop();
95
+ const scopeOf = (roles) => {
96
+ const a = [...open].reverse().find((x) => roles.has(x.role));
97
+ return a ? { role: a.role, ...(a.name !== undefined ? { name: a.name } : {}) } : undefined;
98
+ };
99
+ const scope = scopeOf(SCOPE_ROLES);
100
+ const inside = scopeOf(CONTAINER_ROLES);
101
+ const el = { ref: nativeRef ?? `e${n}`, role, name, interactive, rank: rankFor(role, interactive) };
102
+ if (scope)
103
+ el.scope = scope;
104
+ // #226: stop at the dialog: what is above it is not its context
105
+ const context = [];
106
+ for (const a of [...open].reverse()) {
107
+ if (SCOPE_ROLES.has(a.role))
108
+ break;
109
+ if (CONTEXT_ROLES.has(a.role) && a.name)
110
+ context.push({ role: a.role, name: a.name });
111
+ if (context.length >= MAX_CONTEXT)
112
+ break;
113
+ }
114
+ if (context.length > 0)
115
+ el.context = context;
116
+ if (inside)
117
+ el.inside = inside;
118
+ // #225 review: a disabled control is never pressed (a disabled Next would only wait out the click timeout).
119
+ if (/\[disabled(?:=true)?\]/.test(content))
120
+ el.disabled = true;
121
+ out.push(el);
122
+ const index = out.length - 1;
123
+ const chain = open.filter((x) => SCOPE_ROLES.has(x.role)).map((x) => x.index);
124
+ if (SCOPE_ROLES.has(role)) {
125
+ chain.push(index);
126
+ if (!opts.nonModal?.has(overlayKey(role, name)))
127
+ modals.push(index);
128
+ }
129
+ chains.push(chain);
130
+ open.push({ indent, role, name, index });
131
+ }
132
+ // #225: while a modal overlay is open, what is not in its top one lies under it.
133
+ const top = modals[modals.length - 1];
134
+ if (top !== undefined) {
135
+ out.forEach((el, i) => {
136
+ if (!chains[i].includes(top))
137
+ el.underOverlay = true;
138
+ });
77
139
  }
78
140
  return out;
79
141
  }
142
+ /** #238: Playwright single-quotes a whole key YAML would misread (a name with `: `, ` #`, `{`): `'button "a: b"':` → `button "a: b":`. */
143
+ function unquoteKey(content) {
144
+ const m = /^'((?:[^']|'')*)'(.*)$/.exec(content);
145
+ return m ? (m[1] ?? "").replace(/''/g, "'") + (m[2] ?? "") : content;
146
+ }
147
+ function unescapeName(quoted) {
148
+ try {
149
+ return JSON.parse(`"${quoted}"`);
150
+ }
151
+ catch {
152
+ return quoted.replace(/\\(.)/g, "$1");
153
+ }
154
+ }
80
155
  //# sourceMappingURL=parse-aria.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-aria.js","sourceRoot":"","sources":["../../src/observe/parse-aria.ts"],"names":[],"mappings":"AAEA,+DAA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AAC,CAAC,CAAC,OAAO,CAAC;AACvE,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,GAAG,CAAW,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { BrowserGateway } from "../browser/index.js";
2
- import type { ElementRef, ElementState } from "../browser/types.js";
2
+ import type { ClickOutcome, ElementRef, ElementState } from "../browser/types.js";
3
3
  /** An observed state transition after a safe action (act→observe). */
4
4
  export interface Transition {
5
5
  ref: string;
@@ -7,6 +7,8 @@ export interface Transition {
7
7
  name?: string;
8
8
  before: ElementState;
9
9
  after: ElementState;
10
+ /** What the click did (#224): a dialog it opened or a request it sent counts even when checked/enabled did not move. */
11
+ outcome?: ClickOutcome;
10
12
  }
11
13
  /** Convert transitions into text for the prompt (designer/codegen ground assertions on them). */
12
14
  export declare function formatTransitions(transitions: Transition[]): string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/probe/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEpE,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;CACrB;AAKD,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,CAWnE;AAED,MAAM,WAAW,YAAY;IAC3B,6FAA6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Q,EAAE,UAAU,EAAE,EACtB,EAAE,UAAU,EAAE,gBAAqC,EAAE,QAAoB,EAAE,GAAE,YAAiB,GAC7F,OAAO,CAAC,UAAU,EAAE,CAAC,CAgCvB"}
@@ -40,7 +40,7 @@ async function probeOne(gateway, el, skipped) {
40
40
  if (!clicked.ok)
41
41
  return undefined;
42
42
  const after = await gateway.getState(el);
43
- return { ref: el.ref, role: el.role, name: el.name, before, after };
43
+ return { ref: el.ref, role: el.role, name: el.name, before, after, ...(clicked.outcome ? { outcome: clicked.outcome } : {}) };
44
44
  }
45
45
  /**
46
46
  * Stage B grounding: for safe (reversible) elements, perform a click, OBSERVE the state transition,
@@ -72,7 +72,8 @@ export async function probeTransitions(gateway, elements, { onProgress, elementT
72
72
  });
73
73
  if (transition) {
74
74
  out.push(transition);
75
- await gateway.act({ kind: "click", ref: el.ref, timeoutMs: CLICK_TIMEOUT_MS }).catch(() => undefined); // revert (reversibility)
75
+ // revert (reversibility): not watched, its effect is the click's own undone (#224)
76
+ await gateway.act({ kind: "click", ref: el.ref, timeoutMs: CLICK_TIMEOUT_MS, watch: false }).catch(() => undefined);
76
77
  }
77
78
  }
78
79
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/probe/index.ts"],"names":[],"mappings":"AAYA,6EAA6E;AAC7E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAE5D,iGAAiG;AACjG,MAAM,UAAU,iBAAiB,CAAC,WAAyB;IACzD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,iEAAiE,CAAC;IACvG,OAAO,WAAW;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,MAAM,MAAM,GACV,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS;YAC7D,CAAC,C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,CAAC,CAAC;YACH,IAAI,UAAU,EAAE,CAAC;gBACf,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACrB,mFAAmF;gBACnF,MAAM,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;YACtH,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,CAAC,CAAC,YAAY,YAAY,CAAC;gBAAE,MAAM,CAAC,CAAC;YAC1C,UAAU,EAAE,CAAC,+BAA+B,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,mBAAmB,gBAAgB,KAAK,CAAC,CAAC;QAC3I,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -58,6 +58,8 @@ export interface EjectResult {
58
58
  from: string;
59
59
  to: string;
60
60
  }[];
61
+ /** Generated paths NOT written because they leave testDir or are absolute (as generated). */
62
+ skipped: string[];
61
63
  testDir: string;
62
64
  }
63
65
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,iFAAiF;AACjF,eAAO,MAAM,eAAe,6GAKlB,CAAC;AAEX,sFAAsF;AACtF,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,uFAAuF;IACvF,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,UAAU,EAAE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AAE,QAAQ,EAAE,EACjB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,GACrC,WAAW,EAAE,CAaf;AAWD,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yFAAyF;IACzF,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,6FAA6F;IAC7F,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CA6BxG"}
@@ -6,7 +6,7 @@
6
6
  * `runs/<id>/tests` folder: the `testDir` the project's runner discovers, and the spec-filename
7
7
  * suffix (`.spec.ts` vs `.test.ts`) implied by `testMatch`.
8
8
  *
9
- * Leaf module — depends only on node fs/path (and the codegen `FileBlob` type). Detection is opt-in
9
+ * Leaf module — depends only on node fs/path, the `src/fs` path guard (and the codegen `FileBlob` type). Detection is opt-in
10
10
  * (the `--into-project` flag); without it nothing here runs and the greenfield path is unchanged.
11
11
  *
12
12
  * Config parsing is best-effort (text regex, not evaluation): a TS/JS/ESM config can't be imported
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { stat, readFile, mkdir, writeFile, access } from "node:fs/promises";
17
17
  import { dirname, join, resolve, parse as parsePath } from "node:path";
18
+ import { resolveInside } from "../fs/inside-dir.js";
18
19
  /** Playwright config filenames, in the order Playwright itself resolves them. */
19
20
  export const PW_CONFIG_NAMES = [
20
21
  "playwright.config.ts",
@@ -151,8 +152,15 @@ export async function ejectSuiteToProject(files, target) {
151
152
  const used = new Set(); // names placed within THIS batch (avoid intra-batch collisions)
152
153
  const written = [];
153
154
  const renamed = [];
155
+ const skipped = [];
154
156
  for (const f of files) {
155
157
  const normalized = applySuffix(f.path.replace(/\\/g, "/"), target.specSuffix);
158
+ // #259: a path that climbs out of testDir or is absolute is skipped, never written. A rename
159
+ // only touches the basename, so checking the normalized path covers every candidate below.
160
+ if (!resolveInside(target.testDir, normalized)) {
161
+ skipped.push(f.path);
162
+ continue;
163
+ }
156
164
  // A path is free when it is neither used in this batch nor already present on disk — so a
157
165
  // pre-existing project file is never overwritten; Cairn disambiguates its own file instead.
158
166
  let rel = normalized;
@@ -168,6 +176,6 @@ export async function ejectSuiteToProject(files, target) {
168
176
  if (rel !== normalized)
169
177
  renamed.push({ from: f.path, to: rel });
170
178
  }
171
- return { written, renamed, testDir: target.testDir };
179
+ return { written, renamed, skipped, testDir: target.testDir };
172
180
  }
173
181
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAGvE,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,sBAAsB;IACtB,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;CACf,CAAC;AAcX,gHAAgH;AAChH,MAAM,YAAY,GAAG,gCAAgC,CAAC;AAEtD,gGAAgG;AAChG,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,2GAA2G;AAC3G,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACzD,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC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AAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,0FAA0F;QAC1F,4FAA4F;QAC5F,IAAI,GAAG,GAAG,UAAU,CAAC;QACrB,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACzE,GAAG,GAAG,YAAY,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzC,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,MAAM,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,IAAI,GAAG,KAAK,UAAU;YAAE,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;AAChE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * #24: describes one screen of an app and its overlays for the user docs `cairn collect-docs` writes. The screen and the
3
+ * overlays are already found and listed from the page's ARIA; this only says what they are for. What is unclear is
4
+ * returned as a question, never guessed at.
5
+ */
6
+ export declare const DESCRIBE_SCREEN = "You write user documentation for one screen of a web application, in {{language}}.\nUse ONLY what is given below: the screen's address, its title, its accessibility tree and the overlays (dialogs, drawers,\nmenus, wizards) found on it. Do not invent features, roles, data or meanings.\n\nReturn:\n- purpose: what the screen is for, in one sentence. \"\" when what is given does not tell.\n- userMight: up to 5 tasks a user might come to this screen for, each an action (\"invite a teammate\"), and only tasks its\n controls support.\n- overlays: one { id, purpose, userMight } per overlay id given: purpose in at most 8 words (\"create a project\"), userMight\n up to 3 tasks.\n- questions: everything a new user could not understand from the screen alone \u2014 a status, a code, a number or a label\n shown without explanation, an abbreviation, a control whose effect is not clear \u2014 each as a short question, e.g.\n 'What does the status \"Paused\" mean?'. Never answer a question yourself, and never use a guessed meaning in purpose or\n userMight. [] when everything is clear.\n\nAddress: {{url}}\nTitle: {{title}}\n\nAccessibility tree:\n{{aria}}\n\nOverlays:\n{{overlays}}";
7
+ //# sourceMappingURL=describe-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-screen.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/describe-screen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,eAAe,yqCAsBf,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * #24: describes one screen of an app and its overlays for the user docs `cairn collect-docs` writes. The screen and the
3
+ * overlays are already found and listed from the page's ARIA; this only says what they are for. What is unclear is
4
+ * returned as a question, never guessed at.
5
+ */
6
+ export const DESCRIBE_SCREEN = `You write user documentation for one screen of a web application, in {{language}}.
7
+ Use ONLY what is given below: the screen's address, its title, its accessibility tree and the overlays (dialogs, drawers,
8
+ menus, wizards) found on it. Do not invent features, roles, data or meanings.
9
+
10
+ Return:
11
+ - purpose: what the screen is for, in one sentence. "" when what is given does not tell.
12
+ - userMight: up to 5 tasks a user might come to this screen for, each an action ("invite a teammate"), and only tasks its
13
+ controls support.
14
+ - overlays: one { id, purpose, userMight } per overlay id given: purpose in at most 8 words ("create a project"), userMight
15
+ up to 3 tasks.
16
+ - questions: everything a new user could not understand from the screen alone — a status, a code, a number or a label
17
+ shown without explanation, an abbreviation, a control whose effect is not clear — each as a short question, e.g.
18
+ 'What does the status "Paused" mean?'. Never answer a question yourself, and never use a guessed meaning in purpose or
19
+ userMight. [] when everything is clear.
20
+
21
+ Address: {{url}}
22
+ Title: {{title}}
23
+
24
+ Accessibility tree:
25
+ {{aria}}
26
+
27
+ Overlays:
28
+ {{overlays}}`;
29
+ //# sourceMappingURL=describe-screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-screen.js","sourceRoot":"","sources":["../../../src/prompts/local/describe-screen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;aAsBlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAYA,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAYhD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAeA,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgBhD,CAAC"}
@@ -9,6 +9,9 @@ import { IDENTIFY_ELEMENTS } from "./identify-elements.js";
9
9
  import { JUDGE_TEST_CASES } from "./judge-test-cases.js";
10
10
  import { JUDGE_CHECKLIST_COVERAGE } from "./judge-checklist-coverage.js";
11
11
  import { PILOT_REVIEW } from "./pilot-review.js";
12
+ import { NAME_OVERLAYS } from "./name-overlays.js";
13
+ import { DESCRIBE_SCREEN } from "./describe-screen.js";
14
+ import { QA_API_FLOWS_DESIGN, QA_API_FLOWS_CODEGEN } from "./qa-api-flows.js";
12
15
  /** Local prompts (fallback, ADR-0004). Names match the Langfuse prompt names. */
13
16
  export const LOCAL_PROMPTS = {
14
17
  "qa-testcase-from-ui": QA_TESTCASE_FROM_UI,
@@ -22,5 +25,9 @@ export const LOCAL_PROMPTS = {
22
25
  "judge-test-cases": JUDGE_TEST_CASES,
23
26
  "judge-checklist-coverage": JUDGE_CHECKLIST_COVERAGE,
24
27
  "pilot-review": PILOT_REVIEW,
28
+ "name-overlays": NAME_OVERLAYS,
29
+ "describe-screen": DESCRIBE_SCREEN,
30
+ "qa-api-flows-design": QA_API_FLOWS_DESIGN,
31
+ "qa-api-flows-codegen": QA_API_FLOWS_CODEGEN,
25
32
  };
26
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,iFAAiF;AACjF,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,qBAAqB,EAAE,mBAAmB;IAC1C,yBAAyB,EAAE,uBAAuB;IAClD,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,oBAAoB;IAC5C,kBAAkB,EAAE,gBAAgB;IACpC,cAAc,EAAE,YAAY;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ClD,mBAAmB,EAAE,iBAAiB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,0BAA0B,EAAE,wBAAwB;IACpD,cAAc,EAAE,YAAY;IAC5B,eAAe,EAAE,aAAa;IAC9B,iBAAiB,EAAE,eAAe;IAClC,qBAAqB,EAAE,mBAAmB;IAC1C,sBAAsB,EAAE,oBAAoB;CAC7C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Names what each overlay found by exploration is for (#225). The overlays are already found and described from the
3
+ * page's ARIA; this only gives each one a short purpose for cases and docs. It never decides what is an overlay.
4
+ */
5
+ export declare const NAME_OVERLAYS = "For each overlay below (a dialog, drawer, menu or wizard of a web page), write what it is FOR in at most 8 words,\nin {{language}}, as an action a user takes, e.g. \"create a project\", \"confirm discarding changes\", \"pick a row action\".\nUse only what is given: the page purpose, what opened the overlay, its name and its elements. Do not invent features.\n\nPage purpose:\n{{pageSemantics}}\n\nOverlays:\n{{overlays}}\n\nReturn one { id, purpose } per overlay id given.";
6
+ //# sourceMappingURL=name-overlays.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name-overlays.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/name-overlays.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,+dAUuB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Names what each overlay found by exploration is for (#225). The overlays are already found and described from the
3
+ * page's ARIA; this only gives each one a short purpose for cases and docs. It never decides what is an overlay.
4
+ */
5
+ export const NAME_OVERLAYS = `For each overlay below (a dialog, drawer, menu or wizard of a web page), write what it is FOR in at most 8 words,
6
+ in {{language}}, as an action a user takes, e.g. "create a project", "confirm discarding changes", "pick a row action".
7
+ Use only what is given: the page purpose, what opened the overlay, its name and its elements. Do not invent features.
8
+
9
+ Page purpose:
10
+ {{pageSemantics}}
11
+
12
+ Overlays:
13
+ {{overlays}}
14
+
15
+ Return one { id, purpose } per overlay id given.`;
16
+ //# sourceMappingURL=name-overlays.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name-overlays.js","sourceRoot":"","sources":["../../../src/prompts/local/name-overlays.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;iDAUoB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * #230 — the API flows section, appended to the design and codegen prompts only when `--flows <file>` is given (a run
3
+ * without it sends the same prompt as before). Saved API flows set up a case's data or sign-in, so the UI test does
4
+ * not click through them.
5
+ */
6
+ export declare const QA_API_FLOWS_DESIGN = "API flows \u2014 saved API requests that set up a test's starting state:\n{{flows}}\n\nWhen a case's precondition is data that one of these flows creates, or a signed-in user that the sign-in flow provides, write that precondition as \"API flow <name>: <what it gives>\" (e.g. \"API flow project: a project exists (projectId)\") and do NOT add steps that create that data or sign in through the UI. Do not add steps that delete what a flow created: its cleanup does that after the test. A precondition no flow provides is written as before.";
7
+ export declare const QA_API_FLOWS_CODEGEN = "API flows: the tests folder has {{fixtureFile}}, a Playwright fixture module with one fixture per flow:\n{{flows}}\n\nFor a case whose preconditions name an API flow, or need data or a signed-in user that a flow above provides:\n- in its spec file, import { test, expect } from './{{fixtureModule}}'; instead of from '@playwright/test', and keep that spec file at the top of the tests folder;\n- take the flow's fixture as a test argument and use its values, e.g. test('opens the project', async ({ page, project }) => { await page.goto('{{baseUrl}}/projects/' + project.projectId); ... });\n- do NOT create that data or sign in through the UI, and do NOT delete it in the test: the fixture's cleanup runs after the test, also when it fails;\n- a sign-in flow sets the session (storageState) of every test that imports the module: do not sign in through the UI.\nDo not write {{fixtureFile}} yourself; Cairn writes it.";
8
+ //# sourceMappingURL=qa-api-flows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-api-flows.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-api-flows.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iiBAGka,CAAC;AAEnc,eAAO,MAAM,oBAAoB,25BAQuB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * #230 — the API flows section, appended to the design and codegen prompts only when `--flows <file>` is given (a run
3
+ * without it sends the same prompt as before). Saved API flows set up a case's data or sign-in, so the UI test does
4
+ * not click through them.
5
+ */
6
+ export const QA_API_FLOWS_DESIGN = `API flows — saved API requests that set up a test's starting state:
7
+ {{flows}}
8
+
9
+ When a case's precondition is data that one of these flows creates, or a signed-in user that the sign-in flow provides, write that precondition as "API flow <name>: <what it gives>" (e.g. "API flow project: a project exists (projectId)") and do NOT add steps that create that data or sign in through the UI. Do not add steps that delete what a flow created: its cleanup does that after the test. A precondition no flow provides is written as before.`;
10
+ export const QA_API_FLOWS_CODEGEN = `API flows: the tests folder has {{fixtureFile}}, a Playwright fixture module with one fixture per flow:
11
+ {{flows}}
12
+
13
+ For a case whose preconditions name an API flow, or need data or a signed-in user that a flow above provides:
14
+ - in its spec file, import { test, expect } from './{{fixtureModule}}'; instead of from '@playwright/test', and keep that spec file at the top of the tests folder;
15
+ - take the flow's fixture as a test argument and use its values, e.g. test('opens the project', async ({ page, project }) => { await page.goto('{{baseUrl}}/projects/' + project.projectId); ... });
16
+ - do NOT create that data or sign in through the UI, and do NOT delete it in the test: the fixture's cleanup runs after the test, also when it fails;
17
+ - a sign-in flow sets the session (storageState) of every test that imports the module: do not sign in through the UI.
18
+ Do not write {{fixtureFile}} yourself; Cairn writes it.`;
19
+ //# sourceMappingURL=qa-api-flows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-api-flows.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-api-flows.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;kcAG+Z,CAAC;AAEnc,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;wDAQoB,CAAC"}
@@ -2,5 +2,5 @@
2
2
  * Prompt for generating @playwright/test code from test cases (ADR-0005).
3
3
  * Provenance: ported from AZANIR/qa-skills → `qa-playwright-ts-writer` (authored by the maintainer; included here under Apache-2.0). ADR-0008.
4
4
  */
5
- export declare const QA_PLAYWRIGHT_TS_WRITER = "You are an experienced Playwright test automation engineer (@playwright/test, TypeScript).\nGenerate RUNNABLE spec files covering the provided test cases.\n\nPage under test:\n- URL: {{baseUrl}}\n- Purpose: {{pageSemantics}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical):\n{{elements}}\n\nTest cases to cover:\n{{testCases}}\n\nObserved state transitions (for state-transition assertions \u2014 use exactly these before\u2192after):\n{{transitions}}\n\nRules (STRICT):\n- Each file is complete valid TypeScript: import { test, expect } from '@playwright/test';\n- At the start of each test: await page.goto('{{baseUrl}}');\n- Locators ONLY user-facing by role+name: page.getByRole('button', { name: 'Sign In' }), getByLabel, getByText. NO CSS/XPath/testid.\n- Repeated elements (marked \u00D7N \u2014 list/table rows): the locator resolves to several \u2192 ALWAYS use .first() (or .nth(i)), e.g. page.getByRole('button', { name: 'Download PDF' }).first(). Otherwise Playwright throws a strict-mode error.\n- An element marked [first click tab \"X\"] lives behind a tab/view: first await page.getByRole(...{ name: 'X' }).click(), and ONLY then interact with it (otherwise it is not visible).\n- Waiting (STRICT): rely on web-first auto-retrying assertions (await expect(locator).toBeVisible()/toBeEnabled()). NEVER page.waitForTimeout(...) or waitForLoadState('networkidle') \u2014 both are flaky. Playwright auto-waits for actionability; do NOT add manual sleeps.\n- One test case \u2192 one test('<name>', async ({ page }) => { ... }) with verifiable await expect(...).\n- Wrap logical steps in await test.step('<step description>', async () => { ... }) \u2014 a more readable run report.\n- Assertions must match really observable behavior; do not invent elements outside the list.\n- Read-only assertions by default (toBeVisible/toBeEnabled/toBeChecked). For destructive controls (Delete, Submit, Convert, Log out, Add) \u2014 only await expect(...).toBeVisible(), do NOT click.\n- Each test() is INDEPENDENT: starts with await page.goto('{{baseUrl}}') (clean state); do NOT rely on state from another test.\n- One or two RELATED assertions per test; no brittle chains or mega-tests.\n- The code is self-contained and must parse with tsc.\n\nFILE STRUCTURE:\n- All STATIC cases (visibility/state checks, no actions) \u2192 ONE file static-checks.spec.ts (each case = a separate test() inside).\n- Each ACTIVE case (with actions) \u2192 a SEPARATE file, named after the case (e.g. add-user-flow.spec.ts).\n\nReturn files: an array of objects { path: '<name>.spec.ts', content: '<full file code>' }.";
5
+ export declare const QA_PLAYWRIGHT_TS_WRITER = "You are an experienced Playwright test automation engineer (@playwright/test, TypeScript).\nGenerate RUNNABLE spec files covering the provided test cases.\n\nPage under test:\n- URL: {{baseUrl}}\n- Purpose: {{pageSemantics}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical):\n{{elements}}\n\nTest cases to cover:\n{{testCases}}\n\nObserved state transitions (for state-transition assertions \u2014 use exactly these before\u2192after):\n{{transitions}}\n\n{{overlays}}\n\nRules (STRICT):\n- Each file is complete valid TypeScript: import { test, expect } from '@playwright/test';\n- At the start of each test: await page.goto('{{baseUrl}}');\n- Locators ONLY user-facing by role+name: page.getByRole('button', { name: 'Sign In' }), getByLabel, getByText. NO CSS/XPath/testid.\n- Every locator must resolve to exactly ONE visible element of the list above. Pass exact: true with every name, and always when the element's line says its name is part of another's. Never use an element marked as outside the viewport.\n- Repeated elements (marked \u00D7N \u2014 list/table rows): never pick by position. Narrow by context: go through the accessible name of the row, card, section or list item the element sits in, e.g. page.getByRole('row', { name: 'Jane Roe Delete', exact: true }).getByRole('button', { name: 'Delete', exact: true }). Use the locator given on the element's line when there is one. .first() / .nth(i) ONLY with a comment (on the same line or the line above) saying why the position is the point of the check, for example sorting: the first row must be the lowest. An element marked \"ambiguous\" cannot be told apart from the others: do not click it; at most assert it is visible.\n- FORBIDDEN (the code is rejected before it runs): page.mouse.click(...), { force: true }, and .first() / .nth(...) without such a comment.\n- An element marked [first click tab \"X\"] lives behind a tab/view: first await page.getByRole(...{ name: 'X' }).click(), and ONLY then interact with it (otherwise it is not visible).\n- Waiting (STRICT): rely on web-first auto-retrying assertions (await expect(locator).toBeVisible()/toBeEnabled()). NEVER page.waitForTimeout(...) or waitForLoadState('networkidle') \u2014 both are flaky. Playwright auto-waits for actionability; do NOT add manual sleeps.\n- One test case \u2192 one test('<name>', async ({ page }) => { ... }) with verifiable await expect(...).\n- Wrap logical steps in await test.step('<step description>', async () => { ... }) \u2014 a more readable run report.\n- Assertions must match really observable behavior; do not invent elements outside the list.\n- Read-only assertions by default (toBeVisible/toBeEnabled/toBeChecked). For destructive controls (Delete, Submit, Convert, Log out, Add) \u2014 only await expect(...).toBeVisible(), do NOT click.\n- Each test() is INDEPENDENT: starts with await page.goto('{{baseUrl}}') (clean state); do NOT rely on state from another test.\n- One or two RELATED assertions per test; no brittle chains or mega-tests.\n- The code is self-contained and must parse with tsc.\n\nFILE STRUCTURE:\n- All STATIC cases (visibility/state checks, no actions) \u2192 ONE file static-checks.spec.ts (each case = a separate test() inside).\n- Each ACTIVE case (with actions) \u2192 a SEPARATE file, named after the case (e.g. add-user-flow.spec.ts).\n\nReturn files: an array of objects { path: '<name>.spec.ts', content: '<full file code>' }.";
6
6
  //# sourceMappingURL=qa-playwright-ts-writer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"qa-playwright-ts-writer.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,6lFAmCuD,CAAC"}
1
+ {"version":3,"file":"qa-playwright-ts-writer.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,uBAAuB,w5GAuCuD,CAAC"}
@@ -18,11 +18,15 @@ Test cases to cover:
18
18
  Observed state transitions (for state-transition assertions — use exactly these before→after):
19
19
  {{transitions}}
20
20
 
21
+ {{overlays}}
22
+
21
23
  Rules (STRICT):
22
24
  - Each file is complete valid TypeScript: import { test, expect } from '@playwright/test';
23
25
  - At the start of each test: await page.goto('{{baseUrl}}');
24
26
  - Locators ONLY user-facing by role+name: page.getByRole('button', { name: 'Sign In' }), getByLabel, getByText. NO CSS/XPath/testid.
25
- - Repeated elements (marked ×N — list/table rows): the locator resolves to several → ALWAYS use .first() (or .nth(i)), e.g. page.getByRole('button', { name: 'Download PDF' }).first(). Otherwise Playwright throws a strict-mode error.
27
+ - Every locator must resolve to exactly ONE visible element of the list above. Pass exact: true with every name, and always when the element's line says its name is part of another's. Never use an element marked as outside the viewport.
28
+ - Repeated elements (marked ×N — list/table rows): never pick by position. Narrow by context: go through the accessible name of the row, card, section or list item the element sits in, e.g. page.getByRole('row', { name: 'Jane Roe Delete', exact: true }).getByRole('button', { name: 'Delete', exact: true }). Use the locator given on the element's line when there is one. .first() / .nth(i) ONLY with a comment (on the same line or the line above) saying why the position is the point of the check, for example sorting: the first row must be the lowest. An element marked "ambiguous" cannot be told apart from the others: do not click it; at most assert it is visible.
29
+ - FORBIDDEN (the code is rejected before it runs): page.mouse.click(...), { force: true }, and .first() / .nth(...) without such a comment.
26
30
  - An element marked [first click tab "X"] lives behind a tab/view: first await page.getByRole(...{ name: 'X' }).click(), and ONLY then interact with it (otherwise it is not visible).
27
31
  - Waiting (STRICT): rely on web-first auto-retrying assertions (await expect(locator).toBeVisible()/toBeEnabled()). NEVER page.waitForTimeout(...) or waitForLoadState('networkidle') — both are flaky. Playwright auto-waits for actionability; do NOT add manual sleeps.
28
32
  - One test case → one test('<name>', async ({ page }) => { ... }) with verifiable await expect(...).
@@ -1 +1 @@
1
- {"version":3,"file":"qa-playwright-ts-writer.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FAmCoD,CAAC"}
1
+ {"version":3,"file":"qa-playwright-ts-writer.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-playwright-ts-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FAuCoD,CAAC"}
@@ -2,5 +2,5 @@
2
2
  * Main prompt for generating test cases from a page.
3
3
  * Provenance: ported from AZANIR/qa-skills → `qa-testcase-from-ui` (authored by the maintainer; included here under Apache-2.0). ADR-0008.
4
4
  */
5
- export declare const QA_TESTCASE_FROM_UI = "You are an experienced QA engineer. Based on the explored page, generate UI test cases.\nIMPORTANT: write all title, steps, expected in {{language}} \u2014 do not mix languages (even if the checklist/page is in another language).\n\nPage purpose:\n{{pageSemantics}}\n\n{{goal}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical on the page \u2014 e.g. list rows). All REALLY present. In elementRefs use ONLY these refs \u2014 do not invent or change them:\n{{elements}}\n\nObserved state transitions (act\u2192observe). GROUND state-transition assertions ON THESE \u2014 do not invent consequences:\n{{transitions}}\n\nDomain knowledge (credentials, validation rules, nuances \u2014 account for these in the cases):\n{{knowledge}}\n\n{{experience}}\n\n{{style}}\n\n{{methodology}}\n\n{{checklist}}\n\nGenerate clear, verifiable test cases. For each:\n- title \u2014 concise title;\n- technique \u2014 applied 29119-4 technique;\n- kind \u2014 \"static\" (visibility/state check only, no actions) or \"active\" (with actions: click/fill/navigation);\n- type \u2014 \"Positive\" (valid scenario) or \"Negative\" (invalid/erroneous input);\n- execution \u2014 \"auto\" (can be RELIABLY automated: read-only checks on verified locators) or \"manual\" (full generation/submit, security/XSS, UI-UX/visual/responsiveness, irreversible actions \u2014 the bot does NOT automate these);\n- preconditions \u2014 preconditions (e.g. \"user is logged in\", \"page X is open\");\n- steps \u2014 DETAILED unambiguous steps with REAL element labels (e.g. 'Click \"Generate CV\"', 'Enter text into the \"Vacancy text\" field');\n- expected \u2014 verifiable expected result;\n- priority \u2014 critical | high | medium | low;\n- elementRefs \u2014 real refs from the list above that the case touches.\n\nASSERTION SAFETY:\n- Read-only by default: check visibility/state (toBeVisible/toBeEnabled/toBeChecked), not the consequences of actions.\n- For destructive/irreversible controls (Delete, Remove, Submit, Convert, Log out, Add \u2014 anything that writes data or signs out) \u2014 only check that the element is VISIBLE; do NOT click or perform the action.\n\nSTABILITY (CRITICAL):\n- One case = ONE logical check (one expected). Do NOT combine many assertions in one case \u2014 a mega-test fails entirely if any single part is off.\n- Each case is INDEPENDENT and starts from a CLEAN page. Do NOT assume state left by another case.\n- Do NOT generate contradictory cases (e.g. one expects toggle=on, another toggle=off from a fresh start). For a toggle take EXACTLY ONE transition from the \"Observed state transitions\" (before\u2192after).\n\nCover happy path AND negative/edge scenarios. No duplicates or trivialities (no two cases with the same technique + same elements + same steps).\nTECHNIQUE BREADTH: apply a VARIETY of 29119-4 techniques where the page allows \u2014 equivalence-partitioning, boundary-value, decision-table, state-transition, error-guessing \u2014 not just exploratory.\n\nFULL CHECKLIST COVERAGE: do NOT skip checklist items. If an item cannot be reliably automated (full generation/submit flow, security/XSS, UI-UX/visual/responsiveness, irreversible actions) \u2014 STILL create a case, but set execution=\"manual\" (it will not be automated, but it is documented for manual testing). Every checklist item \u2192 at least one case (auto or manual).";
5
+ export declare const QA_TESTCASE_FROM_UI = "You are an experienced QA engineer. Based on the explored page, generate UI test cases.\nIMPORTANT: write all title, steps, expected in {{language}} \u2014 do not mix languages (even if the checklist/page is in another language).\n\nPage purpose:\n{{pageSemantics}}\n\n{{goal}}\n\nInteractive elements (ref \u00B7 role \u00B7 name; \u00D7N = repeated, several identical on the page \u2014 e.g. list rows). All REALLY present. In elementRefs use ONLY these refs \u2014 do not invent or change them:\n{{elements}}\n\nObserved state transitions (act\u2192observe). GROUND state-transition assertions ON THESE \u2014 do not invent consequences:\n{{transitions}}\n\n{{overlays}}\n\nDomain knowledge (credentials, validation rules, nuances \u2014 account for these in the cases):\n{{knowledge}}\n\n{{experience}}\n\n{{style}}\n\n{{methodology}}\n\n{{checklist}}\n\nGenerate clear, verifiable test cases. For each:\n- title \u2014 concise title;\n- technique \u2014 applied 29119-4 technique;\n- kind \u2014 \"static\" (visibility/state check only, no actions) or \"active\" (with actions: click/fill/navigation);\n- type \u2014 \"Positive\" (valid scenario) or \"Negative\" (invalid/erroneous input);\n- execution \u2014 \"auto\" (can be RELIABLY automated: read-only checks on verified locators) or \"manual\" (full generation/submit, security/XSS, UI-UX/visual/responsiveness, irreversible actions \u2014 the bot does NOT automate these);\n- preconditions \u2014 preconditions (e.g. \"user is logged in\", \"page X is open\");\n- steps \u2014 DETAILED unambiguous steps with REAL element labels (e.g. 'Click \"Generate CV\"', 'Enter text into the \"Vacancy text\" field');\n- expected \u2014 verifiable expected result;\n- priority \u2014 critical | high | medium | low;\n- elementRefs \u2014 real refs from the list above that the case touches.\n\nASSERTION SAFETY:\n- Read-only by default: check visibility/state (toBeVisible/toBeEnabled/toBeChecked), not the consequences of actions.\n- For destructive/irreversible controls (Delete, Remove, Submit, Convert, Log out, Add \u2014 anything that writes data or signs out) \u2014 only check that the element is VISIBLE; do NOT click or perform the action.\n\nSTABILITY (CRITICAL):\n- One case = ONE logical check (one expected). Do NOT combine many assertions in one case \u2014 a mega-test fails entirely if any single part is off.\n- Each case is INDEPENDENT and starts from a CLEAN page. Do NOT assume state left by another case.\n- Do NOT generate contradictory cases (e.g. one expects toggle=on, another toggle=off from a fresh start). For a toggle take EXACTLY ONE transition from the \"Observed state transitions\" (before\u2192after).\n\nCover happy path AND negative/edge scenarios. No duplicates or trivialities (no two cases with the same technique + same elements + same steps).\nTECHNIQUE BREADTH: apply a VARIETY of 29119-4 techniques where the page allows \u2014 equivalence-partitioning, boundary-value, decision-table, state-transition, error-guessing \u2014 not just exploratory.\n\nFULL CHECKLIST COVERAGE: do NOT skip checklist items. If an item cannot be reliably automated (full generation/submit flow, security/XSS, UI-UX/visual/responsiveness, irreversible actions) \u2014 STILL create a case, but set execution=\"manual\" (it will not be automated, but it is documented for manual testing). Every checklist item \u2192 at least one case (auto or manual).";
6
6
  //# sourceMappingURL=qa-testcase-from-ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"qa-testcase-from-ui.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,q1GAiD+U,CAAC"}
1
+ {"version":3,"file":"qa-testcase-from-ui.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,q2GAmD+U,CAAC"}
@@ -16,6 +16,8 @@ Interactive elements (ref · role · name; ×N = repeated, several identical on
16
16
  Observed state transitions (act→observe). GROUND state-transition assertions ON THESE — do not invent consequences:
17
17
  {{transitions}}
18
18
 
19
+ {{overlays}}
20
+
19
21
  Domain knowledge (credentials, validation rules, nuances — account for these in the cases):
20
22
  {{knowledge}}
21
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"qa-testcase-from-ui.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+WAiD4U,CAAC"}
1
+ {"version":3,"file":"qa-testcase-from-ui.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-testcase-from-ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+WAmD4U,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKxD,OAAO,EAAE,cAAc,EAAE,MAAM,cA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qB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAahF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3D;AAED;;;GAGG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,MAAM;IAExC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIvB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAMtD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAM/C;;;;OAIG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAmCjD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS5C,yFAAyF;IACnF,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAa/B,6FAA6F;IACvF,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS5C,8DAA8D;IAC9D,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY;CAK/C;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAIzF"}
@@ -6,6 +6,12 @@ import { dirname, join } from "node:path";
6
6
  export { captureSession } from "./capture.js";
7
7
  /** File suffix for a saved session (one storageState per name). */
8
8
  const SESSION_SUFFIX = ".storageState.json";
9
+ const CAPTURE_AGAIN = "Capture the session again: cairn session capture --url <loginUrl> --name <name>";
10
+ /** The fields of a cookie this package and Playwright read as text. */
11
+ const isCookie = (c) => {
12
+ const cookie = c;
13
+ return typeof cookie?.name === "string" && typeof cookie.value === "string" && typeof cookie.domain === "string";
14
+ };
9
15
  /**
10
16
  * Actionable message for a missing named session — NEVER a raw ENOENT.
11
17
  * Names the exact fix so a design partner can self-serve (L1-05).
@@ -52,8 +58,21 @@ export class SessionStore {
52
58
  * If there are neither cookies nor origins (bare tokens) — throws a clear error.
53
59
  */
54
60
  async loadFile(filePath) {
55
- const raw = await readFile(filePath, "utf8");
56
- const parsed = JSON.parse(raw);
61
+ let raw;
62
+ try {
63
+ raw = await readFile(filePath, "utf8");
64
+ }
65
+ catch (e) {
66
+ throw new Error(`Cannot read the session file '${filePath}' (${e.code ?? "read error"}).`);
67
+ }
68
+ let parsed;
69
+ try {
70
+ parsed = JSON.parse(raw);
71
+ }
72
+ catch {
73
+ // The parser quotes the text around the error, and this text holds cookies: its message is never repeated.
74
+ throw new Error(`File '${filePath}' is not valid JSON, so it is not a usable storageState. ${CAPTURE_AGAIN}`);
75
+ }
57
76
  if (typeof parsed !== "object" || parsed === null) {
58
77
  throw new Error(`File '${filePath}' is not a storageState JSON object.`);
59
78
  }
@@ -64,6 +83,9 @@ export class SessionStore {
64
83
  throw new Error(`File '${filePath}' does not look like a Playwright storageState (no cookies/origins arrays). ` +
65
84
  `Capture the session via 'npm run session:save' or convert it into the {cookies, origins} form.`);
66
85
  }
86
+ if (hasCookies && !obj.cookies.every(isCookie)) {
87
+ throw new Error(`File '${filePath}' is not a usable storageState: a cookie has no name, value or domain. ${CAPTURE_AGAIN}`);
88
+ }
67
89
  return {
68
90
  cookies: hasCookies ? obj.cookies : [],
69
91
  origins: hasOrigins ? obj.origins : [],