@plune-ai/cairn 0.12.0 → 0.14.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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/index.d.ts.map +1 -1
  3. package/dist/agent/index.js +24 -22
  4. package/dist/agent/index.js.map +1 -1
  5. package/dist/cli/index.d.ts +1 -1
  6. package/dist/cli/index.d.ts.map +1 -1
  7. package/dist/cli/index.js +16 -1
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/codegen/lint.d.ts.map +1 -1
  10. package/dist/codegen/lint.js +5 -1
  11. package/dist/codegen/lint.js.map +1 -1
  12. package/dist/eval/judge.d.ts +8 -1
  13. package/dist/eval/judge.d.ts.map +1 -1
  14. package/dist/eval/judge.js +34 -6
  15. package/dist/eval/judge.js.map +1 -1
  16. package/dist/failure-variants/index.d.ts +89 -0
  17. package/dist/failure-variants/index.d.ts.map +1 -0
  18. package/dist/failure-variants/index.js +369 -0
  19. package/dist/failure-variants/index.js.map +1 -0
  20. package/dist/prompts/local/index.d.ts.map +1 -1
  21. package/dist/prompts/local/index.js +2 -0
  22. package/dist/prompts/local/index.js.map +1 -1
  23. package/dist/prompts/local/judge-test-cases-run.d.ts +7 -0
  24. package/dist/prompts/local/judge-test-cases-run.d.ts.map +1 -0
  25. package/dist/prompts/local/judge-test-cases-run.js +28 -0
  26. package/dist/prompts/local/judge-test-cases-run.js.map +1 -0
  27. package/dist/prompts/local/qa-case-critique.d.ts +1 -1
  28. package/dist/prompts/local/qa-case-critique.d.ts.map +1 -1
  29. package/dist/prompts/local/qa-case-critique.js +2 -2
  30. package/dist/prompts/local/qa-gap-cases.d.ts +1 -1
  31. package/dist/prompts/local/qa-gap-cases.d.ts.map +1 -1
  32. package/dist/prompts/local/qa-gap-cases.js +2 -2
  33. package/dist/prompts/local/qa-journey-from-flow.d.ts +1 -1
  34. package/dist/prompts/local/qa-journey-from-flow.d.ts.map +1 -1
  35. package/dist/prompts/local/qa-journey-from-flow.js +2 -2
  36. package/dist/prompts/local/qa-playwright-ts-writer.d.ts +1 -1
  37. package/dist/prompts/local/qa-playwright-ts-writer.d.ts.map +1 -1
  38. package/dist/prompts/local/qa-playwright-ts-writer.js +1 -1
  39. package/dist/prompts/local/qa-testcase-from-ui.d.ts +1 -1
  40. package/dist/prompts/local/qa-testcase-from-ui.d.ts.map +1 -1
  41. package/dist/prompts/local/qa-testcase-from-ui.js +6 -6
  42. package/dist/telemetry/index.d.ts +11 -1
  43. package/dist/telemetry/index.d.ts.map +1 -1
  44. package/dist/telemetry/index.js +21 -5
  45. package/dist/telemetry/index.js.map +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1,369 @@
1
+ /**
2
+ * `cairn propose-failures`: variants of one eval of `plune.yaml` under a provider failure, for a person to review.
3
+ * No model is called and no answer is written here. The answer the provider gives after the failure is the one the
4
+ * person recorded with `plune mock --record`; a variant is that recorded stub with a `failure` added, and the eval as
5
+ * written with a new id and that stub file. Nothing is run and nothing is written into `plune.yaml`.
6
+ *
7
+ * What a variant checks: the stub server answers the model call of the `plune run` client itself, so a variant says
8
+ * how the eval (its prompt, its checks, the client's retries) survives the failure, not how the user's product does.
9
+ */
10
+ import { randomUUID } from "node:crypto";
11
+ import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
12
+ import { basename, join, resolve } from "node:path";
13
+ import { stableCaseId } from "../artifacts/contract.js";
14
+ import { defaultRunsBaseDir } from "../fs/run-dir.js";
15
+ import { safeText } from "../mcp-test/model.js";
16
+ export const PROPOSED_FILE = "plune.failures.proposed.yaml";
17
+ export const SUMMARY_FILE = "failure-variants.json";
18
+ /** A `design`-kind run artifact (cases under `testCases`, no verdict): `plune ingest <run>/variants` puts every variant in the review queue. */
19
+ export const VARIANTS_DIR = "variants";
20
+ export const STUBS_DIR = "stubs";
21
+ /** The failure kinds of a stub file (version 1), in the order they are proposed. */
22
+ export const FAILURE_KINDS = ["http_500", "http_429", "reset", "timeout", "slow_stream", "truncated_json"];
23
+ /** `plune run` reads a stub file of at most 1 MiB, so a larger recording gives no variant it could run. */
24
+ const MAX_FILE_BYTES = 1024 * 1024;
25
+ /** The longest eval id whose variants fit the review queue: its title takes 300 characters, its explanation 400. */
26
+ export const MAX_EVAL_ID = 64;
27
+ /** The retries of the `plune run` client when the config names none. */
28
+ const DEFAULT_MAX_RETRIES = 2;
29
+ /** Slow enough to notice, fast enough to end: a 1 KiB answer takes four seconds. A person changes it in the stub file. */
30
+ const SLOW_BYTES_PER_SEC = 256;
31
+ const isObject = (v) => !!v && typeof v === "object" && !Array.isArray(v);
32
+ const indentOf = (line) => line.length - line.trimStart().length;
33
+ /** A line that ends no block: blank, or a comment. */
34
+ const idle = (line) => /^\s*(#.*)?$/.test(line);
35
+ /** `key:` at exactly `indent` and everything nested under it, as one text; empty when the key is not there. */
36
+ function nested(lines, key, indent) {
37
+ const at = lines.findIndex((l) => indentOf(l) === indent && l.trimStart().startsWith(`${key}:`));
38
+ if (at < 0)
39
+ return "";
40
+ const rest = lines.slice(at + 1);
41
+ const end = rest.findIndex((l) => !idle(l) && indentOf(l) <= indent);
42
+ return [lines[at], ...(end < 0 ? rest : rest.slice(0, end))].join("\n");
43
+ }
44
+ /** A line without its comment: a `#` at the start of the line or after a space, outside quotes. */
45
+ function uncomment(line) {
46
+ let quote = "";
47
+ for (let i = 0; i < line.length; i += 1) {
48
+ const c = line[i];
49
+ if (quote !== "")
50
+ quote = c === quote ? "" : quote;
51
+ else if (c === '"' || c === "'")
52
+ quote = c;
53
+ else if (c === "#" && (i === 0 || /\s/.test(line[i - 1])))
54
+ return line.slice(0, i);
55
+ }
56
+ return line;
57
+ }
58
+ /**
59
+ * The `provider` key at exactly `indent` with what is nested under it, comments taken out; empty when it is not there.
60
+ * Refused, not guessed: a list of providers (`plune run` then runs every eval once per model, and a recording answers
61
+ * one of them) and a YAML alias, whose values are written somewhere else.
62
+ */
63
+ function providerText(lines, indent, where) {
64
+ const at = lines.findIndex((l) => indentOf(l) === indent && l.trimStart().startsWith("provider:"));
65
+ if (at < 0)
66
+ return "";
67
+ // An anchor on the key line names the value and is no part of it.
68
+ const inline = uncomment(lines[at].trimStart().slice("provider:".length)).trim().replace(/^&\S+\s*/, "");
69
+ const first = lines.slice(at + 1).map(uncomment).find((l) => l.trim() !== "");
70
+ // A list may sit at the indent of its key, so its dash, or the bracket of a flow list, is looked for from there on.
71
+ if (inline.startsWith("[") || (inline === "" && first !== undefined && indentOf(first) >= indent && /^(\[|-(\s|$))/.test(first.trimStart()))) {
72
+ throw new Error(`${where} is a list of models: plune run runs every eval once for every model of the list, and a recording answers one of them. Make the variants from a plune.yaml with one provider.`);
73
+ }
74
+ const text = nested(lines, "provider", indent).split("\n").map(uncomment).join("\n");
75
+ if (inline.startsWith("*") || /<<[ \t]*:/.test(text))
76
+ throw new Error(`${where} is given as a YAML alias, which is not read here: write its model, timeout and max_retries out.`);
77
+ return text;
78
+ }
79
+ function providerIn(text) {
80
+ const word = (key) => {
81
+ const m = new RegExp(`\\b${key}:[ \\t]*(?:"([^"]*)"|'([^']*)'|([^\\s"',}\\]]+))`).exec(text);
82
+ return m?.[1] ?? m?.[2] ?? m?.[3];
83
+ };
84
+ const num = (key) => (/^\d+$/.test(word(key) ?? "") ? Number(word(key)) : undefined);
85
+ const p = {};
86
+ const model = word("model");
87
+ const timeout = num("timeout");
88
+ const maxRetries = num("max_retries");
89
+ if (model !== undefined)
90
+ p.model = model;
91
+ if (timeout !== undefined)
92
+ p.timeout = timeout;
93
+ if (maxRetries !== undefined)
94
+ p.maxRetries = maxRetries;
95
+ return p;
96
+ }
97
+ /**
98
+ * The eval `id` of a `plune.yaml`, read line by line: its lines as written and the provider it runs on (the root
99
+ * `provider`, overridden by the eval's own).
100
+ * Limit: not a YAML parse (Cairn has no YAML dependency). `evals` has to be a block list (`- id: x` items, one key per
101
+ * line), and the provider one object with `model`, `timeout` and `max_retries` as plain or quoted values; an eval
102
+ * written another way is reported as not found, and a provider that is a list or an alias is refused.
103
+ */
104
+ export function readEval(planText, id) {
105
+ if (!/^[a-z0-9_-]+$/.test(id))
106
+ throw new Error(`--eval must be an eval id of plune.yaml: lowercase letters, digits, "-" and "_" (got "${safeText(id, 60)}").`);
107
+ if (id.length > MAX_EVAL_ID)
108
+ throw new Error(`--eval: the id is longer than ${MAX_EVAL_ID} characters, and the texts of its variants would not fit the review queue (a title of 300 characters, an explanation of 400). Give the eval a shorter id.`);
109
+ const lines = planText.split(/\r?\n/);
110
+ const top = lines.findIndex((l) => /^evals:[ \t]*(#.*)?$/.test(l));
111
+ const body = top < 0 ? [] : lines.slice(top + 1);
112
+ const end = body.findIndex((l) => !idle(l) && indentOf(l) === 0 && !l.startsWith("- "));
113
+ const evals = end < 0 ? body : body.slice(0, end);
114
+ const firstItem = evals.find((l) => /^\s*- /.test(l));
115
+ const listIndent = firstItem === undefined ? 0 : indentOf(firstItem);
116
+ const isItem = (l) => indentOf(l) === listIndent && l.trimStart().startsWith("- ");
117
+ const idLine = new RegExp(`^\\s*(?:- )?id:[ \\t]*(["']?)${id}\\1[ \\t]*(#.*)?$`);
118
+ for (let i = 0; i < evals.length; i += 1) {
119
+ if (!isItem(evals[i]))
120
+ continue;
121
+ const next = evals.findIndex((l, j) => j > i && isItem(l));
122
+ const item = evals.slice(i, next < 0 ? evals.length : next);
123
+ // Blank lines and the comments above the next item are not the eval's. A `#` line indented deeper than the item is
124
+ // kept: it may be the last line of a block scalar, which is text of the prompt and not a comment.
125
+ const trailing = (l) => l.trim() === "" || (idle(l) && indentOf(l) <= listIndent);
126
+ while (item.length > 0 && trailing(item.at(-1)))
127
+ item.pop();
128
+ // The keys of the item sit two columns in from its dash; a deeper `id:` belongs to something nested.
129
+ const keyIndent = listIndent + 2;
130
+ if (!item.some((l, j) => idLine.test(l) && (j === 0 || indentOf(l) === keyIndent)))
131
+ continue;
132
+ // The dash line holds the first key: read it as that key at the key indent.
133
+ const keys = [`${" ".repeat(keyIndent)}${item[0].trimStart().slice(2)}`, ...item.slice(1)];
134
+ if (nested(keys, "mcp", keyIndent) !== "")
135
+ throw new Error(`eval "${id}" has mcp: a stub file answers the model call of an eval without mcp, so it gets no failure variant.`);
136
+ return {
137
+ id,
138
+ block: item.map((l) => (idle(l) && indentOf(l) < listIndent ? l.trimStart() : ` ${l.slice(listIndent)}`)),
139
+ provider: { ...providerIn(providerText(lines, 0, "the root provider of plune.yaml")), ...providerIn(providerText(keys, keyIndent, `the provider of eval "${id}"`)) },
140
+ };
141
+ }
142
+ throw new Error(`no eval "${id}" under evals: in the plune.yaml (it is read line by line: a block list of "- id: ${id}" items).`);
143
+ }
144
+ /**
145
+ * The stubs of a recording as `plune mock --record` writes it: comment lines, then one JSON document.
146
+ * Limit: not a YAML parse (Cairn has no YAML dependency), so a stub file rewritten by hand as YAML is refused.
147
+ * The error never holds text of the file: a recording holds prompts and answers.
148
+ */
149
+ export function readRecording(text) {
150
+ let doc;
151
+ try {
152
+ doc = JSON.parse(text.replace(/^(?:[ \t]*#.*(?:\r?\n|$))+/, ""));
153
+ }
154
+ catch {
155
+ throw new Error("the recording is not in the form `plune mock --record` writes (comment lines, then JSON).");
156
+ }
157
+ if (!isObject(doc) || doc["version"] !== 1 || !Array.isArray(doc["stubs"]))
158
+ throw new Error("the recording is not a stub file: a stub file has version: 1 and a list of stubs.");
159
+ return doc["stubs"].filter(isObject);
160
+ }
161
+ /** A recorded answer to the eval's model call: a POST whose body names the eval's model, a 2xx response with a body, and no failure of its own. */
162
+ function isAnswer(stub, model) {
163
+ const response = stub["response"];
164
+ if (!isObject(response) || stub["failure"] !== undefined)
165
+ return false;
166
+ const status = response["status"] ?? 200;
167
+ const body = stub["body"];
168
+ return (String(stub["method"] ?? "POST").toUpperCase() === "POST" &&
169
+ isObject(body) &&
170
+ body["model"] === model &&
171
+ typeof status === "number" &&
172
+ status >= 200 &&
173
+ status <= 299 &&
174
+ ["json", "sse", "text"].some((k) => response[k] !== undefined));
175
+ }
176
+ const CALLS = (n) => (n === 1 ? "the first call" : `the first ${n} calls`);
177
+ function failureOf(kind, source, stubs) {
178
+ const retries = source.provider.maxRetries ?? DEFAULT_MAX_RETRIES;
179
+ const passes = `The run passes as eval "${source.id}" does: the client of plune run tries again and gets the recorded answer.`;
180
+ const retried = (first, what, extra = {}) => retries === 0 ? { reason: "provider.max_retries is 0: no call is tried again, so the recorded answer would never arrive" } : { failure: { type: kind, first, ...extra }, what: `${CALLS(first)} ${what}`, expected: passes };
181
+ switch (kind) {
182
+ case "http_500":
183
+ return retried(Math.min(DEFAULT_MAX_RETRIES, retries), "to the provider end with HTTP 500");
184
+ case "http_429":
185
+ return retried(1, "to the provider ends with HTTP 429 and retry-after of 1 second", { retry_after_seconds: 1 });
186
+ case "reset":
187
+ return retried(1, "to the provider ends with a connection reset");
188
+ case "timeout":
189
+ if (source.provider.timeout === undefined)
190
+ return { reason: "provider.timeout is not set: only the client's own timeout ends such a call, and plune run refuses a timeout stub without it" };
191
+ return retried(1, "to the provider is never answered, until the client's own timeout");
192
+ case "slow_stream":
193
+ return {
194
+ failure: { type: kind, bytes_per_sec: SLOW_BYTES_PER_SEC },
195
+ what: `the provider's answer arrives at ${SLOW_BYTES_PER_SEC} bytes per second`,
196
+ expected: `The run passes as eval "${source.id}" does, later: the whole recorded answer arrives, slowly. With provider.timeout set, an answer that takes longer than it errors the row.`,
197
+ };
198
+ case "truncated_json":
199
+ if (stubs.some((s) => s["response"]["json"] === undefined))
200
+ return { reason: "the recorded answer is not JSON (a stream or a text), and only a JSON body is cut" };
201
+ return {
202
+ failure: { type: kind },
203
+ what: "half of the provider's answer arrives and the connection ends",
204
+ // No `first`: the stub cuts the answer of every call, so a client that tries again gets the half again.
205
+ expected: "The row is errored and plune run exits 2: every call gets half of the recorded answer, so no attempt gets a whole one. Keep the variant only to pin that the eval reports the failure, not a pass.",
206
+ };
207
+ }
208
+ }
209
+ /**
210
+ * The variants of `source` from the stubs of a recording; `planText` is the text of `plune.yaml`, whose ids are not
211
+ * proposed again. Throws when the recording holds no answer for the eval.
212
+ */
213
+ export function proposeVariants(source, recorded, kinds, planText) {
214
+ const { model } = source.provider;
215
+ if (model === undefined)
216
+ throw new Error(`cannot read provider.model of eval "${source.id}" (at the root of plune.yaml or on the eval): without it the eval's answers in the recording cannot be told from others.`);
217
+ const answers = recorded.filter((s) => isAnswer(s, model));
218
+ // The same request recorded several times: the last recording answers every repeat (`times: always`), the earlier
219
+ // ones once each. A failure that counts calls needs one stub per request, so the last one is kept.
220
+ const stubs = answers.filter((s) => (s["times"] ?? "always") === "always");
221
+ if (stubs.length === 0) {
222
+ throw new Error(`the recording holds no answer for eval "${source.id}": no POST stub with body.model "${safeText(model, 80)}" and a 2xx response with a body. Record the eval's own call with plune mock --record first.`);
223
+ }
224
+ const accepted = [];
225
+ const rejected = [];
226
+ for (const kind of kinds) {
227
+ const id = `${source.id}-${kind.replace(/_/g, "-")}`;
228
+ if (new RegExp(`^\\s*(?:- )?id:[ \\t]*["']?${id}["']?[ \\t]*(#.*)?$`, "m").test(planText)) {
229
+ rejected.push({ id, reason: "already in plune.yaml" });
230
+ continue;
231
+ }
232
+ const d = failureOf(kind, source, stubs);
233
+ if ("reason" in d) {
234
+ rejected.push({ id, reason: d.reason });
235
+ continue;
236
+ }
237
+ accepted.push({
238
+ id,
239
+ failure: d.failure,
240
+ stubs: stubs.map((s) => ({ ...s, failure: d.failure })),
241
+ title: `Eval "${source.id}" when ${d.what} (${kind})`,
242
+ expected: d.expected,
243
+ rationale: `Variant of eval "${source.id}": the same prompt, data and checks, but ${d.what}. The answer after the failure is the one recorded from the provider; none was generated. It shows how the eval's own model call survives the failure, not how your product does.`,
244
+ });
245
+ }
246
+ return { accepted, rejected, repeatsLeftOut: answers.length - stubs.length };
247
+ }
248
+ const stubPath = (v) => `${STUBS_DIR}/${v.id}.stubs.yaml`;
249
+ /** The variants as `plune.yaml` evals: the eval's own lines, with the variant's id and stub file. */
250
+ export function renderProposedYaml(source, variants) {
251
+ const lines = [
252
+ "# Proposed failure variants of an eval, written by `cairn propose-failures`.",
253
+ "# Nothing here runs by itself. Review each one, move what you agree with into plune.yaml, and copy its stub file",
254
+ `# from ${STUBS_DIR}/ to the same path next to plune.yaml. A run answered from stubs is not a measurement of the model.`,
255
+ "evals:",
256
+ ];
257
+ // After readEval the item sits at two spaces and its keys at four.
258
+ const keyOf = (line, i) => (i === 0 ? /^ {2}- ([\w-]+):/ : /^ {4}([\w-]+):/).exec(line)?.[1];
259
+ const ownStubs = source.block.some((l, i) => keyOf(l, i) === "stubs");
260
+ for (const v of variants) {
261
+ const stubsLine = `stubs: ${JSON.stringify(stubPath(v))}`;
262
+ lines.push(` # Variant of eval "${source.id}": ${v.title.slice(v.title.indexOf(" when ") + 1)}.`);
263
+ source.block.forEach((line, i) => {
264
+ const key = keyOf(line, i);
265
+ // The eval's own stub file, if it names one, gives way to the variant's.
266
+ if (key === "stubs")
267
+ lines.push(line.replace(/stubs:.*$/, stubsLine));
268
+ else if (key === "id")
269
+ lines.push(line.replace(/id:.*$/, `id: ${v.id}`), ...(ownStubs ? [] : [` ${stubsLine}`]));
270
+ else
271
+ lines.push(line);
272
+ });
273
+ }
274
+ return `${lines.join("\n")}\n`;
275
+ }
276
+ /**
277
+ * The stub file of a variant: JSON under comment lines, as a recording is. A YAML reader folds the line break
278
+ * characters JSON leaves as they are inside a string, so those are written as escapes.
279
+ */
280
+ export function renderStubFile(v, source, recordingName) {
281
+ const json = JSON.stringify({ version: 1, stubs: v.stubs }, null, 2).replace(/[\u0085\u2028\u2029\ufeff]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
282
+ return [
283
+ `# Written by \`cairn propose-failures\` for eval "${source.id}": the answers recorded in ${safeText(recordingName, 120).replace(/[^\w.-]/g, "_")}, each with the failure ${v.failure.type}.`,
284
+ "# Prompts and answers are stored as they were recorded: they may hold personal or confidential text. Read the file before you commit it.",
285
+ json,
286
+ "",
287
+ ].join("\n");
288
+ }
289
+ /** A `design`-kind run artifact with one case per variant and no verdict: `plune ingest` turns each into a proposal in the review queue. */
290
+ export function buildVariantReport(runId, target, source, variants) {
291
+ return {
292
+ schemaVersion: 1,
293
+ runId,
294
+ url: target,
295
+ mode: "design",
296
+ testCases: variants.map((v) => ({
297
+ stableId: stableCaseId(["failure-variant", source.id, JSON.stringify(v.failure)]),
298
+ id: v.id,
299
+ title: v.title,
300
+ type: "Negative",
301
+ technique: "provider-failure",
302
+ execution: "auto",
303
+ steps: [
304
+ `Move eval "${v.id}" from ${PROPOSED_FILE} into plune.yaml and copy ${stubPath(v)} to the same path next to plune.yaml.`,
305
+ `Run: plune run --only ${v.id}`,
306
+ ],
307
+ expected: v.expected,
308
+ rationale: v.rationale,
309
+ })),
310
+ // No model was asked.
311
+ cost: { totalTokens: 0, totalCostUsd: 0 },
312
+ };
313
+ }
314
+ async function readSmall(file, what, hint) {
315
+ const info = await stat(file).catch(() => undefined);
316
+ if (!info?.isFile())
317
+ throw new Error(`${what} was not found: ${file.replace(/\\/g, "/")}. ${hint}`);
318
+ if (info.size > MAX_FILE_BYTES)
319
+ throw new Error(`${what} is over 1 MiB: ${file.replace(/\\/g, "/")}.`);
320
+ return readFile(file, "utf8");
321
+ }
322
+ export async function runProposeFailures(opts, io) {
323
+ const runId = randomUUID();
324
+ const outDir = opts.out ? resolve(opts.out) : join(defaultRunsBaseDir(), `failures-${runId}`);
325
+ const shown = (p) => p.replace(/\\/g, "/");
326
+ try {
327
+ const names = (opts.failures ?? FAILURE_KINDS.join(",")).split(",").map((s) => s.trim()).filter(Boolean);
328
+ const unknown = names.filter((n) => !FAILURE_KINDS.includes(n));
329
+ if (unknown.length > 0 || names.length === 0)
330
+ throw new Error(`--failures: unknown failure ${unknown.map((n) => `"${safeText(n, 40)}"`).join(", ") || "(none given)"}; the kinds are ${FAILURE_KINDS.join(", ")}.`);
331
+ const kinds = FAILURE_KINDS.filter((k) => names.includes(k));
332
+ const planFile = resolve(opts.pluneConfig ?? "plune.yaml");
333
+ const planText = await readSmall(planFile, "plune.yaml", "Name it with --plune-config.");
334
+ const source = readEval(planText, opts.eval);
335
+ const recordingFile = resolve(opts.recording);
336
+ const recorded = readRecording(await readSmall(recordingFile, "the recording", "Record the eval's own call with plune mock --record and name the file with --recording."));
337
+ const { accepted, rejected, repeatsLeftOut } = proposeVariants(source, recorded, kinds, planText);
338
+ if (accepted.length === 0)
339
+ throw new Error(`no variant can be proposed for eval "${source.id}", so nothing was written:${rejected.map((r) => `\n ${r.id}: ${r.reason}`).join("")}`);
340
+ // Stub files of an earlier run would stay beside the new ones and be copied next to plune.yaml with them.
341
+ if ((await readdir(outDir).catch(() => [])).length > 0)
342
+ throw new Error(`--out is not empty: ${shown(outDir)}. Name a new or an empty folder.`);
343
+ await mkdir(join(outDir, STUBS_DIR), { recursive: true });
344
+ await mkdir(join(outDir, VARIANTS_DIR), { recursive: true });
345
+ // The prompts and the recorded answers, for their owner only, as the recorder writes a recording.
346
+ const own = { encoding: "utf8", mode: 0o600 };
347
+ await writeFile(join(outDir, PROPOSED_FILE), renderProposedYaml(source, accepted), own);
348
+ for (const v of accepted)
349
+ await writeFile(join(outDir, stubPath(v)), renderStubFile(v, source, basename(recordingFile)), own);
350
+ await writeFile(join(outDir, SUMMARY_FILE), `${JSON.stringify({ eval: source.id, accepted: accepted.length, rejected, repeatsLeftOut }, null, 2)}\n`, "utf8");
351
+ await writeFile(join(outDir, VARIANTS_DIR, "report.json"), `${JSON.stringify(buildVariantReport(`${runId}-variants`, basename(planFile), source, accepted), null, 2)}\n`, "utf8");
352
+ io.out(`Failure variants of eval "${source.id}": ${accepted.length} proposed, ${rejected.length} rejected: ${shown(join(outDir, PROPOSED_FILE))}\n`);
353
+ for (const v of accepted)
354
+ io.out(` ${v.id}: ${v.failure.type}${typeof v.failure["first"] === "number" ? ` (first ${v.failure["first"]})` : ""}\n`);
355
+ for (const r of rejected)
356
+ io.out(` rejected ${r.id}: ${r.reason}\n`);
357
+ if (repeatsLeftOut > 0)
358
+ io.out(` Left out: ${repeatsLeftOut} earlier recording(s) of a request recorded more than once; the last one answers.\n`);
359
+ io.out(` Stub files (they hold the recorded prompts and answers): ${shown(join(outDir, STUBS_DIR))}\n`);
360
+ io.out(` Review queue: plune ingest ${shown(join(outDir, VARIANTS_DIR))}\n`);
361
+ io.out(" No model was called. Nothing was run and plune.yaml was not changed.\n");
362
+ return { exitCode: 0, outDir };
363
+ }
364
+ catch (e) {
365
+ io.err(`✗ propose-failures: ${e.message}\n`);
366
+ return { exitCode: 1, outDir };
367
+ }
368
+ }
369
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/failure-variants/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,8BAA8B,CAAC;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAG,uBAAuB,CAAC;AACpD,gJAAgJ;AAChJ,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,oFAAoF;AACpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,CAAU,CAAC;AAEpH,2GAA2G;AAC3G,MAAM,cAAc,GAAG,I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AO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACpJ,KAAK,MAAM,CAAC,IAAI,QAAQ;YAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;QACtE,IAAI,cAAc,GAAG,CAAC;YAAE,EAAE,CAAC,GAAG,CAAC,eAAe,cAAc,qFAAqF,CAAC,CAAC;QACnJ,EAAE,CAAC,GAAG,CAAC,8DAA8D,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC;QACzG,EAAE,CAAC,GAAG,CAAC,gCAAgC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;QAC9E,EAAE,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC;QACnF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,EAAE,CAAC,GAAG,CAAC,uBAAwB,CAAW,CAAC,OAAO,IAAI,CAAC,CAAC;QACxD,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,CAAC;AACH,CAAC"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/index.ts"],"names":[],"mappings":"AAgBA,iFAAiF;AACjF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiBhD,CAAC"}
@@ -7,6 +7,7 @@ import { QA_GAP_CASES } from "./qa-gap-cases.js";
7
7
  import { QA_PLAYWRIGHT_TS_WRITER } from "./qa-playwright-ts-writer.js";
8
8
  import { IDENTIFY_ELEMENTS } from "./identify-elements.js";
9
9
  import { JUDGE_TEST_CASES } from "./judge-test-cases.js";
10
+ import { JUDGE_TEST_CASES_RUN } from "./judge-test-cases-run.js";
10
11
  import { JUDGE_CHECKLIST_COVERAGE } from "./judge-checklist-coverage.js";
11
12
  import { PILOT_REVIEW } from "./pilot-review.js";
12
13
  import { NAME_OVERLAYS } from "./name-overlays.js";
@@ -23,6 +24,7 @@ export const LOCAL_PROMPTS = {
23
24
  "qa-playwright-ts-writer": QA_PLAYWRIGHT_TS_WRITER,
24
25
  "identify-elements": IDENTIFY_ELEMENTS,
25
26
  "judge-test-cases": JUDGE_TEST_CASES,
27
+ "judge-test-cases-run": JUDGE_TEST_CASES_RUN,
26
28
  "judge-checklist-coverage": JUDGE_CHECKLIST_COVERAGE,
27
29
  "pilot-review": PILOT_REVIEW,
28
30
  "name-overlays": NAME_OVERLAYS,
@@ -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,MAA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,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,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;IAC5B,yBAAyB,EAAE,uBAAuB;IAClD,mBAAmB,EAAE,iBAAiB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,sBAAsB,EAAE,oBAAoB;IAC5C,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,7 @@
1
+ /**
2
+ * Test-case quality judge for a run that executed its tests (#327). The run-less judge stays in judge-test-cases.ts.
3
+ * The three levels mirror the human labels it was checked against: on 33 labelled runs, Cohen's kappa rose from 0.06
4
+ * (cases only) to 0.83 once the judge saw the test results.
5
+ */
6
+ export declare const JUDGE_TEST_CASES_RUN = "You are a QA test-case quality judge. Judge the cases a test generator produced for one web page, using what the page is and what the generated tests did when they were run.\n\nPage: {{url}}\nWhat the page is: {{pageSemantics}}\nGoal the run was given: {{goal}}\nShare of automated tests that passed: {{greenRatio}}\n\nCases (status = result of running the generated automated test; \"manual\" = no automated test; \"not run\" = no result):\n{{cases}}\n\nOther test results from the run (not matched to a case):\n{{suiteResults}}\n\nScore test_case_quality on exactly one of three levels:\n- 0: the cases describe things the page does not have (invented fields, flows or messages), OR there is effectively no automated evidence: no automated test passed (none ran, all failed, or all cases are manual).\n- 0.5: the cases are true to the page, but the page's core action (its main purpose: submitting the form, choosing the option, toggling the control, navigating the main flow) is not confirmed by a passing automated test. Also 0.5 when the goal names a feature the page does not have and the cases honestly test only what is really there.\n- 1: the page's core action is confirmed by at least one passing automated test, and the cases are true to the page. For a static page whose only purpose is to show content, passing checks of that content count as the core action.\n\nJudge by the run results, not by how well the cases are written: well-written cases that no passing test confirms are not a 1.\nAlso score methodology_adherence 0..1: whether the cases reflect ISO/IEC/IEEE 29119-4 techniques (EP / BVA / decision-table / state-transition / error-guessing).\nA core action that only changes the page (a click that adds or removes an element, a toggle, a key press, a hover, a browser dialog, sorting a table) and is left manual is not confirmed: such a suite is not a 1, and the comment says the action was left manual although it is page-only.\nThe comment is one short sentence: the core action and whether a passing test confirms it.";
7
+ //# sourceMappingURL=judge-test-cases-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-test-cases-run.d.ts","sourceRoot":"","sources":["../../../src/prompts/local/judge-test-cases-run.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kgEAqB0D,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Test-case quality judge for a run that executed its tests (#327). The run-less judge stays in judge-test-cases.ts.
3
+ * The three levels mirror the human labels it was checked against: on 33 labelled runs, Cohen's kappa rose from 0.06
4
+ * (cases only) to 0.83 once the judge saw the test results.
5
+ */
6
+ export const JUDGE_TEST_CASES_RUN = `You are a QA test-case quality judge. Judge the cases a test generator produced for one web page, using what the page is and what the generated tests did when they were run.
7
+
8
+ Page: {{url}}
9
+ What the page is: {{pageSemantics}}
10
+ Goal the run was given: {{goal}}
11
+ Share of automated tests that passed: {{greenRatio}}
12
+
13
+ Cases (status = result of running the generated automated test; "manual" = no automated test; "not run" = no result):
14
+ {{cases}}
15
+
16
+ Other test results from the run (not matched to a case):
17
+ {{suiteResults}}
18
+
19
+ Score test_case_quality on exactly one of three levels:
20
+ - 0: the cases describe things the page does not have (invented fields, flows or messages), OR there is effectively no automated evidence: no automated test passed (none ran, all failed, or all cases are manual).
21
+ - 0.5: the cases are true to the page, but the page's core action (its main purpose: submitting the form, choosing the option, toggling the control, navigating the main flow) is not confirmed by a passing automated test. Also 0.5 when the goal names a feature the page does not have and the cases honestly test only what is really there.
22
+ - 1: the page's core action is confirmed by at least one passing automated test, and the cases are true to the page. For a static page whose only purpose is to show content, passing checks of that content count as the core action.
23
+
24
+ Judge by the run results, not by how well the cases are written: well-written cases that no passing test confirms are not a 1.
25
+ Also score methodology_adherence 0..1: whether the cases reflect ISO/IEC/IEEE 29119-4 techniques (EP / BVA / decision-table / state-transition / error-guessing).
26
+ A core action that only changes the page (a click that adds or removes an element, a toggle, a key press, a hover, a browser dialog, sorting a table) and is left manual is not confirmed: such a suite is not a 1, and the comment says the action was left manual although it is page-only.
27
+ The comment is one short sentence: the core action and whether a passing test confirms it.`;
28
+ //# sourceMappingURL=judge-test-cases-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-test-cases-run.js","sourceRoot":"","sources":["../../../src/prompts/local/judge-test-cases-run.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;2FAqBuD,CAAC"}
@@ -4,5 +4,5 @@
4
4
  * redesign and does NOT touch the methodology / assertion-safety rules — those live in
5
5
  * `qa-testcase-from-ui` and `qa-manual-test-designer` and stay fixed.
6
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.";
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 in your own wording. Text the page itself shows (button labels, headings, messages, placeholders) that a step clicks or an expected result checks for is quoted verbatim in the page's own language, never translated, so the test looks for the string that is really there.\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 - Page-only actions are automated: click, toggle, type, key press, hover, a browser dialog (accept / dismiss / answer), adding or removing an element on the page, opening or closing an overlay, sorting or filtering a table; their effect stays in the browser. Only an action that changes data on a server or the session (a submit that sends data, deleting a saved record, a payment, sending a message, signing out) is left to a human: check that its control is VISIBLE and do not perform it. Judge an action by what it does, never by a word in its label such as Add or Remove.;\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
8
  //# sourceMappingURL=qa-case-critique.d.ts.map
@@ -1 +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"}
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,u9EA0BqF,CAAC"}
@@ -5,7 +5,7 @@
5
5
  * `qa-testcase-from-ui` and `qa-manual-test-designer` and stay fixed.
6
6
  */
7
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.
8
+ Write everything (titles, steps, expected) in {{language}} — do not mix languages in your own wording. Text the page itself shows (button labels, headings, messages, placeholders) that a step clicks or an expected result checks for is quoted verbatim in the page's own language, never translated, so the test looks for the string that is really there.
9
9
 
10
10
  Current test cases (id · [technique/type] · title → expected):
11
11
  {{cases}}
@@ -25,7 +25,7 @@ Do TWO things:
25
25
  2. TOP UP — add NEW cases ONLY for the under-represented techniques above, where the page supports them.
26
26
  Each new case follows the SAME rules as the original design:
27
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;
28
+ - Page-only actions are automated: click, toggle, type, key press, hover, a browser dialog (accept / dismiss / answer), adding or removing an element on the page, opening or closing an overlay, sorting or filtering a table; their effect stays in the browser. Only an action that changes data on a server or the session (a submit that sends data, deleting a saved record, a payment, sending a message, signing out) is left to a human: check that its control is VISIBLE and do not perform it. Judge an action by what it does, never by a word in its label such as Add or Remove.;
29
29
  - real element labels in steps; elementRefs taken ONLY from the refs listed above.
30
30
  Add nothing if the techniques cannot be honestly covered — an empty top-up is a valid answer.
31
31
 
@@ -3,5 +3,5 @@
3
3
  * that close the gaps. Worker-tier. Output is treated as SUGGESTIONS (gap- id prefix). Does not touch
4
4
  * the design methodology — it reuses the same case shape, scoped to the untested surface.
5
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.";
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 in your own wording. Text the page itself shows (button labels, headings, messages, placeholders) that a step clicks or an expected result checks for is quoted verbatim in the page's own language, never translated, so the test looks for the string that is really there.\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- Page-only actions are automated: click, toggle, type, key press, hover, a browser dialog (accept / dismiss / answer), adding or removing an element on the page, opening or closing an overlay, sorting or filtering a table; their effect stays in the browser. Only an action that changes data on a server or the session (a submit that sends data, deleting a saved record, a payment, sending a message, signing out) is left to a human: check that its control is VISIBLE and do not perform it. Judge an action by what it does, never by a word in its label such as Add or Remove.\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
7
  //# sourceMappingURL=qa-gap-cases.d.ts.map
@@ -1 +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"}
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,wzDAeuD,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * the design methodology — it reuses the same case shape, scoped to the untested surface.
5
5
  */
6
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.
7
+ Write all titles, steps, expected in {{language}} — do not mix languages in your own wording. Text the page itself shows (button labels, headings, messages, placeholders) that a step clicks or an expected result checks for is quoted verbatim in the page's own language, never translated, so the test looks for the string that is really there.
8
8
 
9
9
  Page purpose:
10
10
  {{pageSemantics}}
@@ -15,7 +15,7 @@ Untested elements (ref · role · name · page — why it matters). In elementRe
15
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
16
 
17
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.
18
+ - Page-only actions are automated: click, toggle, type, key press, hover, a browser dialog (accept / dismiss / answer), adding or removing an element on the page, opening or closing an overlay, sorting or filtering a table; their effect stays in the browser. Only an action that changes data on a server or the session (a submit that sends data, deleting a saved record, a payment, sending a message, signing out) is left to a human: check that its control is VISIBLE and do not perform it. Judge an action by what it does, never by a word in its label such as Add or Remove.
19
19
  - One logical check per case; independent; start from a clean page.
20
20
  - Only reference the untested refs above — do not invent elements or re-test already-covered ones.
21
21
  - These are SUGGESTIONS to fill coverage gaps; keep them concrete and runnable.`;
@@ -3,5 +3,5 @@
3
3
  * graph. SEPARATE from the per-page design prompt — it does not redesign per-page cases and does not
4
4
  * touch the methodology / assertion-safety rules in `qa-testcase-from-ui`.
5
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).";
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 in your own wording. Text the page itself shows (button labels, headings, messages, placeholders) that a step clicks or an expected result checks for is quoted verbatim in the page's own language, never translated, so the test looks for the string that is really there.\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- Page-only actions are automated: click, toggle, type, key press, hover, a browser dialog (accept / dismiss / answer), adding or removing an element on the page, opening or closing an overlay, sorting or filtering a table; their effect stays in the browser. Only an action that changes data on a server or the session (a submit that sends data, deleting a saved record, a payment, sending a message, signing out) is left to a human: check that its control is VISIBLE and do not perform it. Judge an action by what it does, never by a word in its label such as Add or Remove.\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
7
  //# sourceMappingURL=qa-journey-from-flow.d.ts.map
@@ -1 +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"}
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,i7EAsBsD,CAAC"}