@plune-ai/cairn 0.4.1 → 0.5.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 (114) hide show
  1. package/README.md +49 -256
  2. package/dist/agent/graph.d.ts +24 -0
  3. package/dist/agent/graph.d.ts.map +1 -1
  4. package/dist/agent/graph.js +74 -2
  5. package/dist/agent/graph.js.map +1 -1
  6. package/dist/agent/index.d.ts +15 -1
  7. package/dist/agent/index.d.ts.map +1 -1
  8. package/dist/agent/index.js +110 -10
  9. package/dist/agent/index.js.map +1 -1
  10. package/dist/artifacts/index.d.ts +21 -0
  11. package/dist/artifacts/index.d.ts.map +1 -1
  12. package/dist/artifacts/index.js +58 -1
  13. package/dist/artifacts/index.js.map +1 -1
  14. package/dist/artifacts/report.d.ts +8 -0
  15. package/dist/artifacts/report.d.ts.map +1 -1
  16. package/dist/artifacts/report.js +47 -0
  17. package/dist/artifacts/report.js.map +1 -1
  18. package/dist/browser/backends/playwright-lib.d.ts +12 -0
  19. package/dist/browser/backends/playwright-lib.d.ts.map +1 -1
  20. package/dist/browser/backends/playwright-lib.js +48 -3
  21. package/dist/browser/backends/playwright-lib.js.map +1 -1
  22. package/dist/browser/recovery.d.ts +42 -0
  23. package/dist/browser/recovery.d.ts.map +1 -0
  24. package/dist/browser/recovery.js +62 -0
  25. package/dist/browser/recovery.js.map +1 -0
  26. package/dist/browser/types.d.ts +7 -0
  27. package/dist/browser/types.d.ts.map +1 -1
  28. package/dist/cli/index.d.ts.map +1 -1
  29. package/dist/cli/index.js +34 -12
  30. package/dist/cli/index.js.map +1 -1
  31. package/dist/codegen/journey-setup.d.ts +14 -0
  32. package/dist/codegen/journey-setup.d.ts.map +1 -0
  33. package/dist/codegen/journey-setup.js +69 -0
  34. package/dist/codegen/journey-setup.js.map +1 -0
  35. package/dist/core/modalities/explore.d.ts.map +1 -1
  36. package/dist/core/modalities/explore.js +12 -2
  37. package/dist/core/modalities/explore.js.map +1 -1
  38. package/dist/design/critique.d.ts +86 -0
  39. package/dist/design/critique.d.ts.map +1 -0
  40. package/dist/design/critique.js +62 -0
  41. package/dist/design/critique.js.map +1 -0
  42. package/dist/design/schema.d.ts +74 -0
  43. package/dist/design/schema.d.ts.map +1 -1
  44. package/dist/design/schema.js +22 -0
  45. package/dist/design/schema.js.map +1 -1
  46. package/dist/design/style.d.ts +18 -0
  47. package/dist/design/style.d.ts.map +1 -0
  48. package/dist/design/style.js +34 -0
  49. package/dist/design/style.js.map +1 -0
  50. package/dist/eval/coverage.d.ts +49 -0
  51. package/dist/eval/coverage.d.ts.map +1 -0
  52. package/dist/eval/coverage.js +60 -0
  53. package/dist/eval/coverage.js.map +1 -0
  54. package/dist/eval/gap-cases.d.ts +21 -0
  55. package/dist/eval/gap-cases.d.ts.map +1 -0
  56. package/dist/eval/gap-cases.js +27 -0
  57. package/dist/eval/gap-cases.js.map +1 -0
  58. package/dist/eval/legend.d.ts +3 -3
  59. package/dist/eval/legend.js +3 -3
  60. package/dist/eval/pilot.d.ts +4 -1
  61. package/dist/eval/pilot.d.ts.map +1 -1
  62. package/dist/eval/pilot.js +9 -2
  63. package/dist/eval/pilot.js.map +1 -1
  64. package/dist/flow/crawl.d.ts +66 -0
  65. package/dist/flow/crawl.d.ts.map +1 -0
  66. package/dist/flow/crawl.js +0 -0
  67. package/dist/flow/crawl.js.map +1 -0
  68. package/dist/flow/journey.d.ts +25 -0
  69. package/dist/flow/journey.d.ts.map +1 -0
  70. package/dist/flow/journey.js +51 -0
  71. package/dist/flow/journey.js.map +1 -0
  72. package/dist/flow/setup.d.ts +85 -0
  73. package/dist/flow/setup.d.ts.map +1 -0
  74. package/dist/flow/setup.js +65 -0
  75. package/dist/flow/setup.js.map +1 -0
  76. package/dist/fs/run-dir.d.ts +29 -0
  77. package/dist/fs/run-dir.d.ts.map +1 -0
  78. package/dist/fs/run-dir.js +113 -0
  79. package/dist/fs/run-dir.js.map +1 -0
  80. package/dist/llm/schema-lint.d.ts +9 -0
  81. package/dist/llm/schema-lint.d.ts.map +1 -0
  82. package/dist/llm/schema-lint.js +42 -0
  83. package/dist/llm/schema-lint.js.map +1 -0
  84. package/dist/observe/parse-aria.d.ts.map +1 -1
  85. package/dist/observe/parse-aria.js +11 -2
  86. package/dist/observe/parse-aria.js.map +1 -1
  87. package/dist/prompts/local/index.d.ts.map +1 -1
  88. package/dist/prompts/local/index.js +8 -0
  89. package/dist/prompts/local/index.js.map +1 -1
  90. package/dist/prompts/local/pilot-review.d.ts +1 -1
  91. package/dist/prompts/local/pilot-review.d.ts.map +1 -1
  92. package/dist/prompts/local/pilot-review.js +2 -1
  93. package/dist/prompts/local/pilot-review.js.map +1 -1
  94. package/dist/prompts/local/qa-case-critique.d.ts +8 -0
  95. package/dist/prompts/local/qa-case-critique.d.ts.map +1 -0
  96. package/dist/prompts/local/qa-case-critique.js +34 -0
  97. package/dist/prompts/local/qa-case-critique.js.map +1 -0
  98. package/dist/prompts/local/qa-gap-cases.d.ts +7 -0
  99. package/dist/prompts/local/qa-gap-cases.d.ts.map +1 -0
  100. package/dist/prompts/local/qa-gap-cases.js +22 -0
  101. package/dist/prompts/local/qa-gap-cases.js.map +1 -0
  102. package/dist/prompts/local/qa-journey-from-flow.d.ts +7 -0
  103. package/dist/prompts/local/qa-journey-from-flow.d.ts.map +1 -0
  104. package/dist/prompts/local/qa-journey-from-flow.js +29 -0
  105. package/dist/prompts/local/qa-journey-from-flow.js.map +1 -0
  106. package/dist/prompts/local/qa-setup-planner.d.ts +6 -0
  107. package/dist/prompts/local/qa-setup-planner.d.ts.map +1 -0
  108. package/dist/prompts/local/qa-setup-planner.js +28 -0
  109. package/dist/prompts/local/qa-setup-planner.js.map +1 -0
  110. package/dist/safety/guardrails.d.ts +36 -0
  111. package/dist/safety/guardrails.d.ts.map +1 -0
  112. package/dist/safety/guardrails.js +60 -0
  113. package/dist/safety/guardrails.js.map +1 -0
  114. package/package.json +1 -1
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Robust resolution of user-supplied run-directory arguments (`--run` / `--from-run`).
3
+ *
4
+ * The Windows/Git-Bash trap: in MINGW64 an unquoted backslash is a shell ESCAPE, so
5
+ * `--run runs\<id>` reaches the process as the glued string `runs<id>` (the separator is
6
+ * eaten) BEFORE Node ever runs. We cannot un-eat it at display time — the fix lives at the
7
+ * INPUT layer: accept a bare run id, recover the glued form, and otherwise fail with an
8
+ * actionable message instead of a raw ENOENT.
9
+ *
10
+ * `src/fs/` is a dependency-free leaf — it must NOT import from `src/agent/` (a higher layer),
11
+ * so the display normalization below is a small local copy of agent/summary.displayPath().
12
+ */
13
+ import { resolve, isAbsolute, basename } from "node:path";
14
+ import { stat, readdir, readFile } from "node:fs/promises";
15
+ /** Forward-slash a path for DISPLAY only (POSIX slashes are valid on all three platforms). */
16
+ function toPosix(p) {
17
+ return p.replace(/\\/g, "/");
18
+ }
19
+ /** Escape a string for safe use as a literal inside a RegExp. */
20
+ function escapeRe(s) {
21
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
22
+ }
23
+ /** Single source of truth for the default runs base dir (was duplicated across agent/index.ts). */
24
+ export function defaultRunsBaseDir() {
25
+ return resolve(process.cwd(), "runs");
26
+ }
27
+ async function dirExists(p) {
28
+ try {
29
+ return (await stat(p)).isDirectory();
30
+ }
31
+ catch {
32
+ return false;
33
+ }
34
+ }
35
+ async function listRunDirs(base) {
36
+ try {
37
+ const entries = await readdir(base, { withFileTypes: true });
38
+ return entries
39
+ .filter((e) => e.isDirectory())
40
+ .map((e) => e.name)
41
+ .sort();
42
+ }
43
+ catch {
44
+ return [];
45
+ }
46
+ }
47
+ /** Build the actionable "run dir not found" message: what we tried, what's available, and how to avoid the trap. */
48
+ export function runDirNotFoundMessage(value, runsBaseDir, available) {
49
+ const lines = [`Run directory not found for "${value}".`, ` Tried: ${toPosix(resolve(value))} (does not exist).`, ""];
50
+ if (available.length > 0) {
51
+ lines.push(`Available runs in ${toPosix(runsBaseDir)}:`);
52
+ for (const name of available.slice(0, 12))
53
+ lines.push(` - ${name}`);
54
+ if (available.length > 12)
55
+ lines.push(` …and ${available.length - 12} more`);
56
+ }
57
+ else {
58
+ lines.push(`No runs found in ${toPosix(runsBaseDir)} (none yet — run \`cairn design --url <u>\` or \`cairn explore\` first).`);
59
+ }
60
+ lines.push("", "Tip: pass just the run id (e.g. --run <id>) or an absolute path.", "In Git Bash (MINGW64) an unquoted \\ is eaten by the shell — quote the path or use forward slashes: --run 'runs/<id>'.");
61
+ return lines.join("\n");
62
+ }
63
+ /**
64
+ * Resolve a `--run`/`--from-run` value to an EXISTING run directory (absolute). See the module header.
65
+ * Order (first hit wins):
66
+ * (a) literal path exists → resolve(value) [runs/<id>, ./runs/<id>, absolute, PowerShell `\`]
67
+ * (b) bare id under the base → resolve(runsBaseDir, value) [`--run <uuid>`]
68
+ * (c) glued `<base><id>` → resolve(runsBaseDir, captured) [Git-Bash eaten-separator recovery]
69
+ * (d) nothing matched → throw runDirNotFoundMessage(...)
70
+ * A non-existent ABSOLUTE path falls straight through to (d) — it is never re-joined under the base.
71
+ */
72
+ export async function resolveRunDir(value, opts = {}) {
73
+ const runsBaseDir = resolve(opts.runsBaseDir ?? defaultRunsBaseDir());
74
+ const isDir = opts.isDir ?? dirExists;
75
+ const listRuns = opts.listRuns ?? listRunDirs;
76
+ // (a) literal path (relative/absolute/PowerShell `\`) — returned verbatim if it exists.
77
+ const direct = resolve(value);
78
+ if (await isDir(direct))
79
+ return direct;
80
+ if (!isAbsolute(value)) {
81
+ // (b) a bare run id living under the runs base dir.
82
+ const inBase = resolve(runsBaseDir, value);
83
+ if (await isDir(inBase))
84
+ return inBase;
85
+ // (c) Git-Bash glued case: `<base-name><id>` with the separator eaten. Prefix is the base dir name.
86
+ const captured = new RegExp(`^${escapeRe(basename(runsBaseDir))}(.+)$`, "i").exec(value)?.[1];
87
+ if (captured) {
88
+ const recovered = resolve(runsBaseDir, captured);
89
+ if (await isDir(recovered))
90
+ return recovered;
91
+ }
92
+ }
93
+ // (d) nothing matched — fail with an actionable message instead of a downstream ENOENT.
94
+ throw new Error(runDirNotFoundMessage(value, runsBaseDir, await listRuns(runsBaseDir)));
95
+ }
96
+ /**
97
+ * readFile, but a missing file becomes a friendly, actionable error (with the Git-Bash separator tip)
98
+ * instead of a raw ENOENT. For arbitrary file flags (`--checklist`/`--dataset`/`--candidate`) where the
99
+ * glued-path recovery used by resolveRunDir is impossible (no base+id convention to reconstruct from).
100
+ */
101
+ export async function readInputFile(value, label) {
102
+ try {
103
+ return await readFile(value, "utf8");
104
+ }
105
+ catch (err) {
106
+ if (err?.code === "ENOENT") {
107
+ throw new Error(`${label} not found: ${toPosix(resolve(value))}.\n` +
108
+ "In Git Bash (MINGW64) an unquoted \\ is eaten by the shell — quote the path or use forward slashes.");
109
+ }
110
+ throw err;
111
+ }
112
+ }
113
+ //# sourceMappingURL=run-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-dir.js","sourceRoot":"","sources":["../../src/fs/run-dir.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE3D,8FAA8F;AAC9F,SAAS,OAAO,CAAC,CAAS;IACxB,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,iEAAiE;AACjE,SAAS,QAAQ,CAAC,CAAS;IACzB,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,kBAAkB;IAChC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,CAAS;IAChC,IAAI,CAA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IAED,wFAAwF;IACxF,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAC1F,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAa,EAAE,KAAa;IAC9D,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAAyC,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YAClE,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,eAAe,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK;gBACjD,qGAAqG,CACxG,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type ZodType } from "zod";
2
+ /**
3
+ * Lint one structured-output schema. Returns the breadcrumb paths of every property that
4
+ * is NOT in its object's `required` set (empty array ⇒ provider-safe). Pure.
5
+ */
6
+ export declare function lintZodSchema(schema: ZodType, name?: string): string[];
7
+ /** Throw if a schema is not provider-safe (any property missing from `required`). */
8
+ export declare function assertStrictSchema(schema: ZodType, name?: string): void;
9
+ //# sourceMappingURL=schema-lint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-lint.d.ts","sourceRoot":"","sources":["../../src/llm/schema-lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAuCtC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,SAAW,GAAG,MAAM,EAAE,CAIxE;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,SAAW,GAAG,IAAI,CASzE"}
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ function isObj(v) {
3
+ return typeof v === "object" && v !== null && !Array.isArray(v);
4
+ }
5
+ /** Walk a JSON-Schema tree; collect breadcrumb paths of properties missing from `required`. */
6
+ function walk(node, path, out) {
7
+ if (Array.isArray(node)) {
8
+ node.forEach((n, i) => walk(n, `${path}[${i}]`, out));
9
+ return;
10
+ }
11
+ if (!isObj(node))
12
+ return;
13
+ if (isObj(node.properties)) {
14
+ const required = new Set(Array.isArray(node.required) ? node.required : []);
15
+ for (const key of Object.keys(node.properties)) {
16
+ if (!required.has(key))
17
+ out.push(path ? `${path}.${key}` : key);
18
+ }
19
+ }
20
+ // Recurse into every child schema node (properties, items, $defs, anyOf/allOf/oneOf, …).
21
+ for (const [k, v] of Object.entries(node))
22
+ walk(v, path ? `${path}/${k}` : k, out);
23
+ }
24
+ /**
25
+ * Lint one structured-output schema. Returns the breadcrumb paths of every property that
26
+ * is NOT in its object's `required` set (empty array ⇒ provider-safe). Pure.
27
+ */
28
+ export function lintZodSchema(schema, name = "schema") {
29
+ const out = [];
30
+ walk(z.toJSONSchema(schema), name, out);
31
+ return out;
32
+ }
33
+ /** Throw if a schema is not provider-safe (any property missing from `required`). */
34
+ export function assertStrictSchema(schema, name = "schema") {
35
+ const violations = lintZodSchema(schema, name);
36
+ if (violations.length > 0) {
37
+ throw new Error(`Schema "${name}" is not provider-safe for strict structured output — ` +
38
+ `these keys are not in \`required\`: ${violations.join(", ")}. ` +
39
+ `Use .nullable() or .default(...) instead of .optional() (#89, BORROW-01).`);
40
+ }
41
+ }
42
+ //# sourceMappingURL=schema-lint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-lint.js","sourceRoot":"","sources":["../../src/llm/schema-lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAgB,MAAM,KAAK,CAAC;AAiBtC,SAAS,KAAK,CAAC,CAAU;IACvB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,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aAAa,CAAC,MAAe,EAAE,IAAI,GAAG,QAAQ;IAC5D,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAY,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IACnD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAAC,MAAe,EAAE,IAAI,GAAG,QAAQ;IACjE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/C,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,WAAW,IAAI,wDAAwD;YACrE,uCAAuC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAChE,2EAA2E,CAC9E,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse-aria.d.ts","sourceRoot":"","sources":["../../src/observe/parse-aria.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6CtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAuB5D"}
1
+ {"version":3,"file":"parse-aria.d.ts","sourceRoot":"","sources":["../../src/observe/parse-aria.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6CtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAgC5D"}
@@ -54,8 +54,17 @@ export function parseAriaSnapshot(aria) {
54
54
  if (!line.startsWith("- "))
55
55
  continue;
56
56
  const content = line.slice(2).trim();
57
- if (content.startsWith("/"))
58
- continue; // property: /url, /checked, /disabled…
57
+ if (content.startsWith("/")) {
58
+ // Property line (/url, /checked, /disabled…). Capture /url onto the preceding element (its link)
59
+ // so crawl can dedup links by (name, href) — #102. Other properties are skipped.
60
+ const last = out[out.length - 1];
61
+ if (content.startsWith("/url") && last) {
62
+ const u = content.slice(4).replace(/^:\s*/, "").replace(/^"|"$/g, "").trim();
63
+ if (u)
64
+ last.url = u;
65
+ }
66
+ continue;
67
+ }
59
68
  const role = content.match(/^([a-zA-Z][\w-]*)/)?.[1];
60
69
  if (!role || role === "text")
61
70
  continue; // text node or unparseable
@@ -1 +1 @@
1
- {"version":3,"file":"parse-aria.js","sourceRoot":"","sources":["../../src/observe/parse-aria.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,QAAQ;IACR,MAAM;IACN,SAAS;IACT,UAAU;IACV,OAAO;IACP,UAAU;IACV,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,UAAU;IACV,kBAAkB;IAClB,eAAe;IACf,KAAK;IACL,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEH,uDAAuD;AACvD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACvB,MAAM;IACN,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,aAAa;IACb,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;CACT,CAAC,CAAC;AAEH,SAAS,OAAO,CAAC,IAAY,EAAE,WAAoB;IACjD,IAAI,WAAW;QAAE,OAAO,CAAC,CAAC;IAC1B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACjC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,K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,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;gBACvC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC7E,IAAI,CAAC;oBAAE,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;YACtB,CAAC;YACD,SAAS;QACX,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,MAAM;YAAE,SAAS,CAAC,2BAA2B;QAEnE,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,8FAA8F;QAC9F,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC,IAAI,CAAC,CAAC;QACP,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,IAAI,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAQA,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQhD,CAAC"}
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,5 +1,9 @@
1
1
  import { QA_TESTCASE_FROM_UI } from "./qa-testcase-from-ui.js";
2
2
  import { QA_MANUAL_TEST_DESIGNER } from "./qa-manual-test-designer.js";
3
+ import { QA_CASE_CRITIQUE } from "./qa-case-critique.js";
4
+ import { QA_JOURNEY_FROM_FLOW } from "./qa-journey-from-flow.js";
5
+ import { QA_SETUP_PLANNER } from "./qa-setup-planner.js";
6
+ import { QA_GAP_CASES } from "./qa-gap-cases.js";
3
7
  import { QA_PLAYWRIGHT_TS_WRITER } from "./qa-playwright-ts-writer.js";
4
8
  import { IDENTIFY_ELEMENTS } from "./identify-elements.js";
5
9
  import { JUDGE_TEST_CASES } from "./judge-test-cases.js";
@@ -9,6 +13,10 @@ import { PILOT_REVIEW } from "./pilot-review.js";
9
13
  export const LOCAL_PROMPTS = {
10
14
  "qa-testcase-from-ui": QA_TESTCASE_FROM_UI,
11
15
  "qa-manual-test-designer": QA_MANUAL_TEST_DESIGNER,
16
+ "qa-case-critique": QA_CASE_CRITIQUE,
17
+ "qa-journey-from-flow": QA_JOURNEY_FROM_FLOW,
18
+ "qa-setup-planner": QA_SETUP_PLANNER,
19
+ "qa-gap-cases": QA_GAP_CASES,
12
20
  "qa-playwright-ts-writer": QA_PLAYWRIGHT_TS_WRITER,
13
21
  "identify-elements": IDENTIFY_ELEMENTS,
14
22
  "judge-test-cases": JUDGE_TEST_CASES,
@@ -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,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE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uB;IAClD,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,oBAAoB;IAC5C,kBAAkB,EAAE,gBAAgB;IACpC,cAAc,EAAE,YAAY;IAC5B,yBAAyB,EAAE,uBAAuB;IAClD,mBAAmB,EAAE,iBAAiB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,0BAA0B,EAAE,wBAAwB;IACpD,cAAc,EAAE,YAAY;CAC7B,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /** Pilot supervisor prompt (idea from explorbot): holistic run verdict. */
2
- export declare const PILOT_REVIEW = "You are the Pilot supervisor of a QA run. Review the result and issue a holistic verdict.\n\nPage: {{pageSemantics}}\nValidation: {{validation}}\nTest cases:\n{{cases}}\n\nReturn:\n- verdict: \"pass\" (run is sufficient and high-quality) | \"needs-work\" (gaps exist but not critical) | \"fail\" (serious problems);\n- reason: ONE sentence \u2014 the main basis for the verdict;\n- guidance: ONE concrete next step to improve.";
2
+ export declare const PILOT_REVIEW = "You are the Pilot supervisor of a QA run. Review the result and issue a holistic verdict.\n\nPage: {{pageSemantics}}\nValidation: {{validation}}\nTest cases:\n{{cases}}\n\nReturn:\n- verdict: \"pass\" (run is sufficient and high-quality) | \"needs-work\" (gaps exist but not critical) | \"fail\" (serious problems);\n- reason: ONE sentence \u2014 the main basis for the verdict;\n- guidance: ONE concrete next step to improve;\n- entity: the NAME of the entity this run created or edited (e.g. the record/item title), or \"\" if the run was read-only and created nothing. Do NOT invent a name \u2014 use only what the cases above actually reference.";
3
3
  //# sourceMappingURL=pilot-review.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pilot-review.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,+aAUsB,CAAC"}
1
+ {"version":3,"file":"pilot-review.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,eAAO,MAAM,YAAY,8oBAW8L,CAAC"}
@@ -9,5 +9,6 @@ Test cases:
9
9
  Return:
10
10
  - verdict: "pass" (run is sufficient and high-quality) | "needs-work" (gaps exist but not critical) | "fail" (serious problems);
11
11
  - reason: ONE sentence — the main basis for the verdict;
12
- - guidance: ONE concrete next step to improve.`;
12
+ - guidance: ONE concrete next step to improve;
13
+ - entity: the NAME of the entity this run created or edited (e.g. the record/item title), or "" if the run was read-only and created nothing. Do NOT invent a name — use only what the cases above actually reference.`;
13
14
  //# sourceMappingURL=pilot-review.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pilot-review.js","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;+CAUmB,CAAC"}
1
+ {"version":3,"file":"pilot-review.js","sourceRoot":"","sources":["../../../src/prompts/local/pilot-review.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;uNAW2L,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * #82 — design-time self-critique prompt. A SEPARATE, cheap worker-tier pass that reviews the
3
+ * first design set: it PRUNES weak cases and TOPS UP under-represented techniques. It does NOT
4
+ * redesign and does NOT touch the methodology / assertion-safety rules — those live in
5
+ * `qa-testcase-from-ui` and `qa-manual-test-designer` and stay fixed.
6
+ */
7
+ export declare const QA_CASE_CRITIQUE = "You are a senior QA reviewer doing a SECOND pass over an already-designed set of UI test cases.\nWrite everything (titles, steps, expected) in {{language}} \u2014 do not mix languages.\n\nCurrent test cases (id \u00B7 [technique/type] \u00B7 title \u2192 expected):\n{{cases}}\n\nUnder-represented 29119-4 techniques on this page (cover these if the page genuinely supports them \u2014 do NOT invent cases the page can't back):\n{{underrepresented}}\n\nReal element refs you may reference (use ONLY these \u2014 never invent refs):\n{{elements}}\n\nDo TWO things:\n1. PRUNE \u2014 list the ids of cases to DROP, each with a one-line reason. Drop a case ONLY if it is:\n - trivial (asserts nothing meaningful, e.g. \"page loads\"),\n - contradictory with another case (e.g. two cases expect opposite states of the same toggle from a clean start), or\n - not verifiable (its \"expected\" cannot be objectively checked).\n When in doubt, KEEP the case \u2014 pruning is conservative.\n2. TOP UP \u2014 add NEW cases ONLY for the under-represented techniques above, where the page supports them.\n Each new case follows the SAME rules as the original design:\n - one logical check (one expected), independent, starting from a clean page;\n - read-only by default \u2014 for destructive/irreversible controls only check visibility, never perform the action;\n - real element labels in steps; elementRefs taken ONLY from the refs listed above.\n Add nothing if the techniques cannot be honestly covered \u2014 an empty top-up is a valid answer.\n\nEach new case has: title, technique (one of the under-represented ones), kind (\"static\"|\"active\"),\ntype (\"Positive\"|\"Negative\"), execution (\"auto\"|\"manual\"), preconditions, steps, expected, priority, elementRefs.";
8
+ //# sourceMappingURL=qa-case-critique.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-case-critique.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-case-critique.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,8vDA0BqF,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * #82 — design-time self-critique prompt. A SEPARATE, cheap worker-tier pass that reviews the
3
+ * first design set: it PRUNES weak cases and TOPS UP under-represented techniques. It does NOT
4
+ * redesign and does NOT touch the methodology / assertion-safety rules — those live in
5
+ * `qa-testcase-from-ui` and `qa-manual-test-designer` and stay fixed.
6
+ */
7
+ export const QA_CASE_CRITIQUE = `You are a senior QA reviewer doing a SECOND pass over an already-designed set of UI test cases.
8
+ Write everything (titles, steps, expected) in {{language}} — do not mix languages.
9
+
10
+ Current test cases (id · [technique/type] · title → expected):
11
+ {{cases}}
12
+
13
+ Under-represented 29119-4 techniques on this page (cover these if the page genuinely supports them — do NOT invent cases the page can't back):
14
+ {{underrepresented}}
15
+
16
+ Real element refs you may reference (use ONLY these — never invent refs):
17
+ {{elements}}
18
+
19
+ Do TWO things:
20
+ 1. PRUNE — list the ids of cases to DROP, each with a one-line reason. Drop a case ONLY if it is:
21
+ - trivial (asserts nothing meaningful, e.g. "page loads"),
22
+ - contradictory with another case (e.g. two cases expect opposite states of the same toggle from a clean start), or
23
+ - not verifiable (its "expected" cannot be objectively checked).
24
+ When in doubt, KEEP the case — pruning is conservative.
25
+ 2. TOP UP — add NEW cases ONLY for the under-represented techniques above, where the page supports them.
26
+ Each new case follows the SAME rules as the original design:
27
+ - one logical check (one expected), independent, starting from a clean page;
28
+ - read-only by default — for destructive/irreversible controls only check visibility, never perform the action;
29
+ - real element labels in steps; elementRefs taken ONLY from the refs listed above.
30
+ Add nothing if the techniques cannot be honestly covered — an empty top-up is a valid answer.
31
+
32
+ Each new case has: title, technique (one of the under-represented ones), kind ("static"|"active"),
33
+ type ("Positive"|"Negative"), execution ("auto"|"manual"), preconditions, steps, expected, priority, elementRefs.`;
34
+ //# sourceMappingURL=qa-case-critique.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-case-critique.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-case-critique.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;kHA0BkF,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * #61 — gap-case suggester. Given the observed-but-untested interactive elements, propose test cases
3
+ * that close the gaps. Worker-tier. Output is treated as SUGGESTIONS (gap- id prefix). Does not touch
4
+ * the design methodology — it reuses the same case shape, scoped to the untested surface.
5
+ */
6
+ export declare const QA_GAP_CASES = "You are a QA engineer reviewing test COVERAGE. Below are interactive elements that were observed on the app but are NOT referenced by any existing test case \u2014 the coverage gaps.\nWrite all titles, steps, expected in {{language}} \u2014 do not mix languages.\n\nPage purpose:\n{{pageSemantics}}\n\nUntested elements (ref \u00B7 role \u00B7 name \u00B7 page \u2014 why it matters). In elementRefs use ONLY these refs:\n{{gaps}}\n\nSuggest focused test cases that close these gaps. For each case: title, technique (29119-4), kind (\"static\"|\"active\"), type (\"Positive\"|\"Negative\"), execution (\"auto\"|\"manual\"), preconditions, steps (real labels), expected (verifiable), priority, elementRefs (only from the list above).\n\nRULES:\n- Read-only by default: assert visibility/state. For destructive/irreversible controls (Delete, Submit that writes, Log out) only assert VISIBLE \u2014 never perform the action.\n- One logical check per case; independent; start from a clean page.\n- Only reference the untested refs above \u2014 do not invent elements or re-test already-covered ones.\n- These are SUGGESTIONS to fill coverage gaps; keep them concrete and runnable.";
7
+ //# sourceMappingURL=qa-gap-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-gap-cases.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-gap-cases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,YAAY,6pCAeuD,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * #61 — gap-case suggester. Given the observed-but-untested interactive elements, propose test cases
3
+ * that close the gaps. Worker-tier. Output is treated as SUGGESTIONS (gap- id prefix). Does not touch
4
+ * the design methodology — it reuses the same case shape, scoped to the untested surface.
5
+ */
6
+ export const QA_GAP_CASES = `You are a QA engineer reviewing test COVERAGE. Below are interactive elements that were observed on the app but are NOT referenced by any existing test case — the coverage gaps.
7
+ Write all titles, steps, expected in {{language}} — do not mix languages.
8
+
9
+ Page purpose:
10
+ {{pageSemantics}}
11
+
12
+ Untested elements (ref · role · name · page — why it matters). In elementRefs use ONLY these refs:
13
+ {{gaps}}
14
+
15
+ Suggest focused test cases that close these gaps. For each case: title, technique (29119-4), kind ("static"|"active"), type ("Positive"|"Negative"), execution ("auto"|"manual"), preconditions, steps (real labels), expected (verifiable), priority, elementRefs (only from the list above).
16
+
17
+ RULES:
18
+ - Read-only by default: assert visibility/state. For destructive/irreversible controls (Delete, Submit that writes, Log out) only assert VISIBLE — never perform the action.
19
+ - One logical check per case; independent; start from a clean page.
20
+ - Only reference the untested refs above — do not invent elements or re-test already-covered ones.
21
+ - These are SUGGESTIONS to fill coverage gaps; keep them concrete and runnable.`;
22
+ //# sourceMappingURL=qa-gap-cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-gap-cases.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-gap-cases.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;gFAeoD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * #59 — journey design prompt. Generates multi-page USER JOURNEY cases from the observed page/flow
3
+ * graph. SEPARATE from the per-page design prompt — it does not redesign per-page cases and does not
4
+ * touch the methodology / assertion-safety rules in `qa-testcase-from-ui`.
5
+ */
6
+ export declare const QA_JOURNEY_FROM_FLOW = "You are an experienced QA engineer. From the observed page/flow GRAPH below, design end-to-end USER JOURNEY test cases that span MULTIPLE pages (e.g. login \u2192 dashboard \u2192 action).\nWrite all titles, actions, expected in {{language}} \u2014 do not mix languages.\n\nPages studied (each with its REAL interactive elements \u2014 ref \u00B7 role \u00B7 name). In a step's elementRefs use ONLY refs from THAT step's page \u2014 never invent refs and never use a ref from another page:\n{{pages}}\n\nObserved transitions between pages (act\u2192observe \u2014 these are REAL navigations you may rely on):\n{{edges}}\n\nDesign journeys that cross page boundaries. For each journey:\n- title \u2014 concise title of the end-to-end flow;\n- technique \u2014 applied 29119-4 technique (state-transition fits multi-step flows well);\n- type \u2014 \"Positive\" | \"Negative\";\n- preconditions \u2014 what must be true before the journey starts (e.g. \"a registered user\");\n- steps \u2014 an ORDERED list; each step has: page (one of the page URLs above), action (real labels), elementRefs (refs from THAT page only);\n- expected \u2014 a single verifiable end state;\n- priority \u2014 critical | high | medium | low.\n\nRULES (a journey is a TEST \u2014 keep it safe and runnable):\n- A journey MUST span at least TWO distinct pages (\u22652 different page URLs across its steps). Single-page checks are NOT journeys \u2014 omit them.\n- Read-only by default: assert visibility/state. For destructive/irreversible controls (Delete, Remove, Submit that writes, Log out) only assert the control is VISIBLE \u2014 do NOT perform the action.\n- Each step is grounded on its page's observed elements; do not assume elements the graph did not show.\n- Prefer journeys that follow the OBSERVED transitions above (they are known to work).";
7
+ //# sourceMappingURL=qa-journey-from-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-journey-from-flow.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-journey-from-flow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,8yDAsBsD,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * #59 — journey design prompt. Generates multi-page USER JOURNEY cases from the observed page/flow
3
+ * graph. SEPARATE from the per-page design prompt — it does not redesign per-page cases and does not
4
+ * touch the methodology / assertion-safety rules in `qa-testcase-from-ui`.
5
+ */
6
+ export const QA_JOURNEY_FROM_FLOW = `You are an experienced QA engineer. From the observed page/flow GRAPH below, design end-to-end USER JOURNEY test cases that span MULTIPLE pages (e.g. login → dashboard → action).
7
+ Write all titles, actions, expected in {{language}} — do not mix languages.
8
+
9
+ Pages studied (each with its REAL interactive elements — ref · role · name). In a step's elementRefs use ONLY refs from THAT step's page — never invent refs and never use a ref from another page:
10
+ {{pages}}
11
+
12
+ Observed transitions between pages (act→observe — these are REAL navigations you may rely on):
13
+ {{edges}}
14
+
15
+ Design journeys that cross page boundaries. For each journey:
16
+ - title — concise title of the end-to-end flow;
17
+ - technique — applied 29119-4 technique (state-transition fits multi-step flows well);
18
+ - type — "Positive" | "Negative";
19
+ - preconditions — what must be true before the journey starts (e.g. "a registered user");
20
+ - steps — an ORDERED list; each step has: page (one of the page URLs above), action (real labels), elementRefs (refs from THAT page only);
21
+ - expected — a single verifiable end state;
22
+ - priority — critical | high | medium | low.
23
+
24
+ RULES (a journey is a TEST — keep it safe and runnable):
25
+ - A journey MUST span at least TWO distinct pages (≥2 different page URLs across its steps). Single-page checks are NOT journeys — omit them.
26
+ - Read-only by default: assert visibility/state. For destructive/irreversible controls (Delete, Remove, Submit that writes, Log out) only assert the control is VISIBLE — do NOT perform the action.
27
+ - Each step is grounded on its page's observed elements; do not assume elements the graph did not show.
28
+ - Prefer journeys that follow the OBSERVED transitions above (they are known to work).`;
29
+ //# sourceMappingURL=qa-journey-from-flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-journey-from-flow.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-journey-from-flow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;uFAsBmD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * #60 — setup planner prompt. Turns a journey's PROSE preconditions into STRUCTURED ones, each with a
3
+ * satisfaction strategy. Worker-tier (mechanical extraction). Does not touch design methodology.
4
+ */
5
+ export declare const QA_SETUP_PLANNER = "You map a test journey's preconditions to a concrete SETUP plan \u2014 how to establish the starting state BEFORE the journey runs.\n\nJourney: {{title}}\nPages it visits: {{pages}}\nPage purpose: {{pageSemantics}}\n\nStated preconditions (prose):\n{{preconditions}}\n\nFor EACH precondition, choose ONE strategy, in this PRIORITY order (pick the highest that genuinely applies):\n1. \"session\" \u2014 already true because the run reuses a captured login session (auth / \"logged-in user\"). Prefer this for anything auth-related.\n2. \"fixture\" \u2014 can be set up by driving the UI to the starting state (navigate, open, select). Use when no API is known.\n3. \"api-seed\" \u2014 ONLY when a concrete, safe seeding endpoint is obvious (e.g. a REST path you can name). You MUST provide \"endpoint\" (and \"method\"). Never guess an endpoint.\n4. \"manual\" \u2014 anything else, or anything that would require fabricating data / destructive seeding. This is the safe fallback.\n\nRules:\n- NEVER invent an endpoint. If you can't name a concrete one, do NOT use api-seed \u2014 use fixture or manual.\n- NEVER propose destructive seeding (deleting/overwriting real data) \u2014 use manual.\n- \"description\" is always required (it doubles as the documented manual precondition).\n- \"entity\" is the thing the state is about (e.g. \"item\", \"user on plan Pro\"), or null if not identifiable.\n- ALWAYS return EVERY field in EACH precondition object \u2014 \"description\", \"strategy\", \"entity\", \"endpoint\" and \"method\". When a field does not apply (entity has none, or endpoint/method for a non-api-seed strategy), return it EXPLICITLY as null. Never omit a field.\n\nReturn { preconditions: [ { description, strategy, entity, endpoint, method } ] } \u2014 every key present in every object; use null for any that doesn't apply (endpoint and method are non-null ONLY for api-seed).";
6
+ //# sourceMappingURL=qa-setup-planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-setup-planner.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/qa-setup-planner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,+2DAsBoL,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * #60 — setup planner prompt. Turns a journey's PROSE preconditions into STRUCTURED ones, each with a
3
+ * satisfaction strategy. Worker-tier (mechanical extraction). Does not touch design methodology.
4
+ */
5
+ export const QA_SETUP_PLANNER = `You map a test journey's preconditions to a concrete SETUP plan — how to establish the starting state BEFORE the journey runs.
6
+
7
+ Journey: {{title}}
8
+ Pages it visits: {{pages}}
9
+ Page purpose: {{pageSemantics}}
10
+
11
+ Stated preconditions (prose):
12
+ {{preconditions}}
13
+
14
+ For EACH precondition, choose ONE strategy, in this PRIORITY order (pick the highest that genuinely applies):
15
+ 1. "session" — already true because the run reuses a captured login session (auth / "logged-in user"). Prefer this for anything auth-related.
16
+ 2. "fixture" — can be set up by driving the UI to the starting state (navigate, open, select). Use when no API is known.
17
+ 3. "api-seed" — ONLY when a concrete, safe seeding endpoint is obvious (e.g. a REST path you can name). You MUST provide "endpoint" (and "method"). Never guess an endpoint.
18
+ 4. "manual" — anything else, or anything that would require fabricating data / destructive seeding. This is the safe fallback.
19
+
20
+ Rules:
21
+ - NEVER invent an endpoint. If you can't name a concrete one, do NOT use api-seed — use fixture or manual.
22
+ - NEVER propose destructive seeding (deleting/overwriting real data) — use manual.
23
+ - "description" is always required (it doubles as the documented manual precondition).
24
+ - "entity" is the thing the state is about (e.g. "item", "user on plan Pro"), or null if not identifiable.
25
+ - ALWAYS return EVERY field in EACH precondition object — "description", "strategy", "entity", "endpoint" and "method". When a field does not apply (entity has none, or endpoint/method for a non-api-seed strategy), return it EXPLICITLY as null. Never omit a field.
26
+
27
+ Return { preconditions: [ { description, strategy, entity, endpoint, method } ] } — every key present in every object; use null for any that doesn't apply (endpoint and method are non-null ONLY for api-seed).`;
28
+ //# sourceMappingURL=qa-setup-planner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qa-setup-planner.js","sourceRoot":"","sources":["../../../src/prompts/local/qa-setup-planner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;iNAsBiL,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { PilotVerdict } from "../eval/pilot.js";
2
+ /**
3
+ * Two cheap safety rules borrowed from Explorbot (BORROW-04, #91), to land BEFORE any stateful /
4
+ * destructive automation:
5
+ * 1. Provenance-checked verdicts — a "pass" must be backed by evidence the entity it claims really
6
+ * exists in the run's session log (kills a class of LLM false-positives).
7
+ * 2. Data-protection — never delete pre-existing data or the resource under the current URL; only
8
+ * items this run created itself are disposable.
9
+ *
10
+ * Pure, side-effect-free — the host wires them into the Pilot judge and the setup planner.
11
+ */
12
+ /**
13
+ * Gate a Pilot verdict on provenance: a "pass" that names a created/edited entity is only trusted when
14
+ * that entity actually appears (by name) in the session log. An unfounded "pass" is downgraded to
15
+ * "needs-work" with the reason recorded. Non-"pass" verdicts and read-only runs (no entity) pass through.
16
+ */
17
+ export declare function checkProvenance(verdict: PilotVerdict, sessionLog: string[]): PilotVerdict;
18
+ export interface DeletionContext {
19
+ /** URL of the page/resource under test — deleting it is always forbidden. */
20
+ currentUrl?: string;
21
+ /** Names/ids this run created itself — the ONLY things that may be deleted. */
22
+ selfCreated?: Iterable<string>;
23
+ }
24
+ export interface GuardResult {
25
+ allowed: boolean;
26
+ /** Human-readable basis for the decision (always set — surfaced to the planner/report). */
27
+ reason: string;
28
+ }
29
+ /**
30
+ * Decide whether deleting `target` is permitted. Forbidden: the resource under the current URL, and any
31
+ * pre-existing datum (anything not in `selfCreated`). Permitted: an item this run created itself.
32
+ */
33
+ export declare function guardDeletion(target: string, ctx?: DeletionContext): GuardResult;
34
+ /** Whether a free-text step/precondition expresses an intent to delete or clear data. */
35
+ export declare function isDeletionIntent(text: string): boolean;
36
+ //# sourceMappingURL=guardrails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrails.d.ts","sourceRoot":"","sources":["../../src/safety/guardrails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;GASG;AAIH;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,YAAY,CAazF;AAID,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,2FAA2F;IAC3F,MAAM,EAAE,MAAM,CAAC;CAChB;AAID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,eAAoB,GAAG,WAAW,CAgBpF;AAKD,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Two cheap safety rules borrowed from Explorbot (BORROW-04, #91), to land BEFORE any stateful /
3
+ * destructive automation:
4
+ * 1. Provenance-checked verdicts — a "pass" must be backed by evidence the entity it claims really
5
+ * exists in the run's session log (kills a class of LLM false-positives).
6
+ * 2. Data-protection — never delete pre-existing data or the resource under the current URL; only
7
+ * items this run created itself are disposable.
8
+ *
9
+ * Pure, side-effect-free — the host wires them into the Pilot judge and the setup planner.
10
+ */
11
+ // ── 1. Provenance ───────────────────────────────────────────────────────────
12
+ /**
13
+ * Gate a Pilot verdict on provenance: a "pass" that names a created/edited entity is only trusted when
14
+ * that entity actually appears (by name) in the session log. An unfounded "pass" is downgraded to
15
+ * "needs-work" with the reason recorded. Non-"pass" verdicts and read-only runs (no entity) pass through.
16
+ */
17
+ export function checkProvenance(verdict, sessionLog) {
18
+ if (verdict.verdict !== "pass")
19
+ return verdict;
20
+ const entity = verdict.entity.trim();
21
+ if (!entity)
22
+ return verdict; // read-only run / nothing claimed → nothing to prove
23
+ const haystack = sessionLog.join("\n").toLowerCase();
24
+ if (haystack.includes(entity.toLowerCase()))
25
+ return verdict;
26
+ return {
27
+ ...verdict,
28
+ verdict: "needs-work",
29
+ reason: `Provenance check: entity "${entity}" was reported as created/edited but is absent from the ` +
30
+ `session log — rejecting "pass" to avoid a false-positive. ${verdict.reason}`.trim(),
31
+ };
32
+ }
33
+ const norm = (s) => s.trim().toLowerCase().replace(/\/+$/, "");
34
+ /**
35
+ * Decide whether deleting `target` is permitted. Forbidden: the resource under the current URL, and any
36
+ * pre-existing datum (anything not in `selfCreated`). Permitted: an item this run created itself.
37
+ */
38
+ export function guardDeletion(target, ctx = {}) {
39
+ const t = target.trim();
40
+ if (!t)
41
+ return { allowed: false, reason: "Refusing to delete: empty target." };
42
+ if (ctx.currentUrl && norm(t) === norm(ctx.currentUrl)) {
43
+ return { allowed: false, reason: `Refusing to delete the resource under the current URL (${ctx.currentUrl}).` };
44
+ }
45
+ const selfCreated = new Set([...(ctx.selfCreated ?? [])].map(norm));
46
+ if (selfCreated.has(norm(t))) {
47
+ return { allowed: true, reason: `Allowed: "${t}" was created by this run (disposable).` };
48
+ }
49
+ return {
50
+ allowed: false,
51
+ reason: `Refusing to delete pre-existing data "${t}" — only self-created items may be removed.`,
52
+ };
53
+ }
54
+ /** Words that signal an intent to delete/clear data — used to gate stateful setup steps. */
55
+ const DELETION_INTENT = /\b(delete|remove|clear|empty|purge|reset|wipe|drop|teardown|clean\s?-?up)\b/i;
56
+ /** Whether a free-text step/precondition expresses an intent to delete or clear data. */
57
+ export function isDeletionIntent(text) {
58
+ return DELETION_INTENT.test(text);
59
+ }
60
+ //# sourceMappingURL=guardrails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrails.js","sourceRoot":"","sources":["../../src/safety/guardrails.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAqB,EAAE,UAAoB;IACzE,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM;QAAE,OAAO,OAAO,CAAC;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC,CAAC,qDAAqD;IAClF,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IACrD,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAAE,OAAO,OAAO,CAAC;IAC5D,OAAO;QACL,GAAG,OAAO;QACV,OAAO,EAAE,YAAY;QACrB,MAAM,EACJ,6BAA6B,MAAM,0DAA0D;YAC7F,6DAA6D,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;KACvF,CAAC;AACJ,CAAC;AAiBD,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,MAAuB,EAAE;IACrE,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,mCAAmC,EAAE,CAAC;IAE/E,IAAI,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,0DAA0D,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;IAClH,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,yCAAyC,EAAE,CAAC;IAC5F,CAAC;IACD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,yCAAyC,CAAC,6CAA6C;KAChG,CAAC;AACJ,CAAC;AAED,4FAA4F;AAC5F,MAAM,eAAe,GAAG,8EAA8E,CAAC;AAEvG,yFAAyF;AACzF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plune-ai/cairn",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Cairn — an AI that walks your system and leaves a trail of tests. Autonomous QA agent (UI today; API/unit/docs planned) powered by Claude/OpenRouter, with self-improvement via Langfuse.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",