blastproof 0.24.0 → 0.26.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.
package/README.md CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  [![CI](https://github.com/hamc/blastproof/actions/workflows/ci.yml/badge.svg)](https://github.com/hamc/blastproof/actions/workflows/ci.yml)
10
10
  [![Dogfood](https://github.com/hamc/blastproof/actions/workflows/dogfood.yml/badge.svg)](https://github.com/hamc/blastproof/actions/workflows/dogfood.yml)
11
+ [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-blastproof%20e2e%20AI%20testing-blue?logo=github)](https://github.com/marketplace/actions/blastproof-e2e-ai-testing)
11
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
12
13
 
13
14
  **Open-source AI testing agent for pull requests.** Write end-to-end tests as plain English. An agent drives a real browser to run them, selects only the ones your diff can affect, and scores the result before merge.
@@ -77,7 +78,7 @@ Three questions. The first one decides most cases.
77
78
 
78
79
  **A hard requirement, not a preference.** blastproof finds elements the way a screen reader does — by role, by label, by visible text. That is what removes selectors and survives redesigns. The cost is that there is deliberately no CSS or XPath fallback, so anything the accessibility tree cannot describe cannot be driven at all.
79
80
 
80
- The name is matched **exactly first**, then by substring if nothing matches exactly — so a control named `Add` is found even when `Add New` sits above it. When several controls answer to the same name, the first one on the page wins. Give each control an accessible name no other control on the page shares; a page that cannot offer one cannot be driven unambiguously, and no matching rule fixes that.
81
+ The agent acts on the element it read, not on a search for its name. Each element in the snapshot it reads carries a ref, and an action names that ref: two controls called `Delete` are two different targets, and `Add` is never mistaken for `Add New`. If the role and name the agent gives do not match the element the ref points at, the action is refused rather than performed. A ref is valid only for the snapshot it came from, so nothing like a selector is ever stored.
81
82
 
82
83
  | works | cannot be driven |
83
84
  | --- | --- |
@@ -106,7 +107,7 @@ If a critical journey needs one of these, that journey stays with your existing
106
107
 
107
108
  **Use a seeded database, a staging environment you can reset, or a throwaway account. Do not gate on a run against production data.**
108
109
 
109
- Within a step, an action that commits — a click, or pressing Enter — is never performed twice: the runner refuses the repeat and tells the agent it already did that. This closes the case that used to produce duplicate records, where a submit answered by a redirect came back to a reset form and the agent, seeing no evidence of its own work, submitted again.
110
+ Within a step, an action that commits — a click, or pressing Enter — is not performed twice: the runner refuses the repeat and tells the agent it already did that. This closes the case that used to produce duplicate records, where a submit answered by a redirect came back to a reset form and the agent, seeing no evidence of its own work, refilled it and submitted again. One repeat goes through: the same control pressed again right after itself, with nothing else done in between, when the page changed after the last press — a tour's "Next", a wizard, "load more".
110
111
 
111
112
  It is **not** a guarantee of zero duplicate writes. An agent that reaches the same effect by a genuinely different route — another control that does the same thing — is not caught.
112
113
 
@@ -252,7 +253,7 @@ blastproof run --min-score 80 # one failing P2 is tolerated
252
253
 
253
254
  The calls that *choose* an action, and the one that drafts a test, are deliberately left free — that latitude is what re-resolves a control after a redesign instead of failing on it.
254
255
 
255
- Wiring this into a pipeline, with the gating patterns worth knowing: [Running in CI](./docs/ci.md).
256
+ Wiring this into a pipeline, with the gating patterns worth knowing: [Running in CI](./docs/ci.md). The Action is listed on the GitHub Marketplace as [blastproof e2e AI testing](https://github.com/marketplace/actions/blastproof-e2e-ai-testing).
256
257
 
257
258
  ## Without a browser or a key
258
259
 
@@ -305,15 +306,17 @@ A merge gate is judged by two numbers. A **false PASS** is a test that passes on
305
306
 
306
307
  | | `claude-haiku-4.5` | `gpt-6-luna` |
307
308
  | --- | --- | --- |
308
- | false FAIL, correct app (40 test runs) | 0 (≤ 8.8%) | 0 (≤ 8.8%) |
309
+ | false FAIL, correct app (40 test runs) | 1 (≤ 12.9%) | 0 (≤ 8.8%) |
309
310
  | false PASS, literal bugs (30) | 0 (≤ 11.4%) | 0 (≤ 11.4%) |
310
311
  | false PASS, subtle bugs (20) | 0 (≤ 16.1%) | 0 (≤ 16.1%) |
311
312
 
312
- The bounds are 95% upper bounds: zero errors in 40 runs means "below about 9%", not "never". The first run of this table found a false PASS on Haiku, 2 subtle runs in 20. The confirmation showed order `#BP-1002`, another paragraph mentioned `#BP-1001` as a previous order, and a step checking for `#BP-1001` *in the confirmation* passed. That was fixed in the judge ([#147](https://github.com/hamc/blastproof/issues/147)), and this is the run after the fix.
313
+ The bounds are 95% upper bounds: zero errors in 40 runs means "below about 9%", not "never". The first run of this table found a false PASS on Haiku, 2 subtle runs in 20. The confirmation showed order `#BP-1002`, another paragraph mentioned `#BP-1001` as a previous order, and a step checking for `#BP-1001` *in the confirmation* passed. That was fixed in the judge ([#147](https://github.com/hamc/blastproof/issues/147)). The false FAIL on Haiku is in the notes test: the note was listed and counted, but the model had typed it into the empty field again, and the judge read the filled field as a form not yet submitted.
313
314
 
314
315
  The demo app is small and well labelled, so these numbers flatter. Expect a real application to do worse. The point of this table is that it can be reproduced, and that every change claiming better verdicts has to move it.
315
316
 
316
- Measured 2026-10-07 on `main` after 0.23.0 with #147's fix, 5 samples, through OpenRouter. To reproduce:
317
+ The same benchmark over seven more models, and why it chose the OpenAI and Ollama defaults, is in [Choosing a model](./docs/configuration.md#choosing-a-model).
318
+
319
+ Measured 2026-10-12 on 0.26.0, 5 samples, through OpenRouter. To reproduce:
317
320
 
318
321
  ```bash
319
322
  npm run build
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/runner/snapshot.ts
4
+ var DEFAULT_MAX_LINES = 200;
5
+ function indentOf(line) {
6
+ return line.length - line.trimStart().length;
7
+ }
8
+ var DIALOG_LINE = /^\s*- '?(?:dialog|alertdialog)(?=[\s:"']|$)/;
9
+ var OMITTED_LINE = /^\s*- \.\.\. \(\d+ lines? omitted: max_snapshot_lines is (\d+)\)$/m;
10
+ function snapshotCutAt(snapshot) {
11
+ const match = OMITTED_LINE.exec(snapshot);
12
+ return match ? Number(match[1]) : void 0;
13
+ }
14
+ function linesToKeep(lines, maxLines) {
15
+ const keep = /* @__PURE__ */ new Set();
16
+ const subtreeEnd = (i) => {
17
+ let j = i + 1;
18
+ while (j < lines.length && indentOf(lines[j]) > indentOf(lines[i])) j++;
19
+ return j;
20
+ };
21
+ const ancestors = (i) => {
22
+ const found = [];
23
+ let indent = indentOf(lines[i]);
24
+ for (let j = i - 1; j >= 0 && indent > 0; j--) {
25
+ if (indentOf(lines[j]) < indent) {
26
+ found.unshift(j);
27
+ indent = indentOf(lines[j]);
28
+ }
29
+ }
30
+ return found;
31
+ };
32
+ const dialogs = lines.flatMap((line, i) => DIALOG_LINE.test(line) ? [i] : []).reverse();
33
+ const focused = lines.flatMap((line, i) => line.includes("[active]") ? [i] : []);
34
+ for (const anchor of [...dialogs.slice(0, 1), ...focused, ...dialogs.slice(1)]) {
35
+ for (const line of ancestors(anchor)) if (keep.size < maxLines) keep.add(line);
36
+ for (let line = anchor; line < subtreeEnd(anchor) && keep.size < maxLines; line++) keep.add(line);
37
+ }
38
+ for (let line = 0; line < lines.length && keep.size < maxLines; line++) keep.add(line);
39
+ return keep;
40
+ }
41
+ function trimSnapshot(snapshotYaml, maxLines = DEFAULT_MAX_LINES) {
42
+ let lines = snapshotYaml.split("\n").filter((line) => line.trim().length > 0);
43
+ for (let pass = 0; pass < 5; pass++) {
44
+ const kept = [];
45
+ let removed = 0;
46
+ for (let i = 0; i < lines.length; i++) {
47
+ const line = lines[i];
48
+ const isContainer = line.trimEnd().endsWith(":");
49
+ if (isContainer) {
50
+ const next = lines[i + 1];
51
+ const hasChildren = next !== void 0 && indentOf(next) > indentOf(line);
52
+ if (!hasChildren) {
53
+ removed++;
54
+ continue;
55
+ }
56
+ }
57
+ kept.push(line);
58
+ }
59
+ lines = kept;
60
+ if (removed === 0) break;
61
+ }
62
+ if (lines.length <= maxLines) return lines.join("\n");
63
+ const keep = linesToKeep(lines, maxLines);
64
+ const out = [];
65
+ let omitted = 0;
66
+ for (let i = 0; i <= lines.length; i++) {
67
+ if (i < lines.length && !keep.has(i)) {
68
+ omitted++;
69
+ continue;
70
+ }
71
+ if (omitted > 0) {
72
+ const indent = " ".repeat(indentOf(lines[i - omitted]));
73
+ out.push(`${indent}- ... (${omitted} ${omitted === 1 ? "line" : "lines"} omitted: max_snapshot_lines is ${maxLines})`);
74
+ omitted = 0;
75
+ }
76
+ if (i < lines.length) out.push(lines[i]);
77
+ }
78
+ return out.join("\n");
79
+ }
80
+ async function captureSnapshot(page, options = {}) {
81
+ const raw = await page.locator("body").ariaSnapshot({ mode: "ai" });
82
+ return `url: ${page.url()}
83
+ ${trimSnapshot(raw.replace(/ \[cursor=pointer\]/g, ""), options.maxLines)}`;
84
+ }
85
+ var REF_MARKER = / \[ref=[A-Za-z0-9_-]+\]/g;
86
+ function withoutRefs(snapshot) {
87
+ return snapshot.replace(REF_MARKER, "");
88
+ }
89
+ function unquote(value) {
90
+ const trimmed = value.trim();
91
+ if (trimmed.length >= 2 && trimmed.startsWith('"') && trimmed.endsWith('"')) {
92
+ return trimmed.slice(1, -1).replace(/\\(["\\])/g, "$1");
93
+ }
94
+ if (trimmed.length >= 2 && trimmed.startsWith("'") && trimmed.endsWith("'")) {
95
+ return trimmed.slice(1, -1).replace(/''/g, "'");
96
+ }
97
+ return trimmed;
98
+ }
99
+ var ELEMENT_LINE = /^\s*- ([a-z][a-zA-Z]*)(?: ("(?:[^"\\]|\\.)*"))?((?: \[[^\]]*\])*)(?::(?: (.*))?)?$/;
100
+ function indexRefs(snapshot) {
101
+ const index = /* @__PURE__ */ new Map();
102
+ for (const raw of snapshot.split("\n")) {
103
+ const quoted = /^(\s*- )'((?:[^']|'')*)'(:.*)?$/.exec(raw);
104
+ const line = quoted ? `${quoted[1]}${quoted[2].replace(/''/g, "'")}${quoted[3] ?? ""}` : raw;
105
+ const match = ELEMENT_LINE.exec(line);
106
+ if (!match) continue;
107
+ const ref = /\[ref=([A-Za-z0-9_-]+)\]/.exec(match[3] ?? "")?.[1];
108
+ if (!ref) continue;
109
+ const element = { role: match[1] };
110
+ if (match[2] !== void 0) element.name = unquote(match[2]);
111
+ if (match[4] !== void 0 && match[4].trim() !== "") element.text = unquote(match[4]);
112
+ index.set(ref, element);
113
+ }
114
+ return index;
115
+ }
116
+
117
+ export {
118
+ snapshotCutAt,
119
+ trimSnapshot,
120
+ captureSnapshot,
121
+ withoutRefs,
122
+ indexRefs
123
+ };
124
+ //# sourceMappingURL=chunk-DO4WZKLT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/runner/snapshot.ts"],"sourcesContent":["import type { Page } from 'playwright';\n\nexport interface SnapshotOptions {\n /** Maximum number of snapshot lines sent to the LLM. Default 200. */\n maxLines?: number;\n}\n\nconst DEFAULT_MAX_LINES = 200;\n\nfunction indentOf(line: string): number {\n return line.length - line.trimStart().length;\n}\n\n// A line whose role is a dialog, YAML single-quoted or not.\nconst DIALOG_LINE = /^\\s*- '?(?:dialog|alertdialog)(?=[\\s:\"']|$)/;\nconst OMITTED_LINE = /^\\s*- \\.\\.\\. \\(\\d+ lines? omitted: max_snapshot_lines is (\\d+)\\)$/m;\n\n/**\n * The cap a snapshot was cut at, read from its markers, or `undefined` when\n * nothing was omitted (design keep-the-open-dialog-in-the-snapshot, D3). Read\n * from the text so a step's reason cannot disagree with what the model saw.\n */\nexport function snapshotCutAt(snapshot: string): number | undefined {\n const match = OMITTED_LINE.exec(snapshot);\n return match ? Number(match[1]) : undefined;\n}\n\n/**\n * Which lines of an over-cap snapshot to keep (design\n * keep-the-open-dialog-in-the-snapshot, D1). Frameworks render dialogs, menus\n * and palettes in a portal at the end of `<body>`, so a cut from the top\n * dropped first the element the last action opened (#162). The open dialogs\n * (the last one, on top, first) and the focused element are kept with their\n * subtree and the lines they sit under; the rest of the cap is filled from the\n * top, as before. Never more than `maxLines`.\n */\nfunction linesToKeep(lines: string[], maxLines: number): Set<number> {\n const keep = new Set<number>();\n const subtreeEnd = (i: number): number => {\n let j = i + 1;\n while (j < lines.length && indentOf(lines[j]!) > indentOf(lines[i]!)) j++;\n return j;\n };\n const ancestors = (i: number): number[] => {\n const found: number[] = [];\n let indent = indentOf(lines[i]!);\n for (let j = i - 1; j >= 0 && indent > 0; j--) {\n if (indentOf(lines[j]!) < indent) {\n found.unshift(j);\n indent = indentOf(lines[j]!);\n }\n }\n return found;\n };\n\n const dialogs = lines.flatMap((line, i) => (DIALOG_LINE.test(line) ? [i] : [])).reverse();\n const focused = lines.flatMap((line, i) => (line.includes('[active]') ? [i] : []));\n for (const anchor of [...dialogs.slice(0, 1), ...focused, ...dialogs.slice(1)]) {\n for (const line of ancestors(anchor)) if (keep.size < maxLines) keep.add(line);\n for (let line = anchor; line < subtreeEnd(anchor) && keep.size < maxLines; line++) keep.add(line);\n }\n for (let line = 0; line < lines.length && keep.size < maxLines; line++) keep.add(line);\n return keep;\n}\n\n/**\n * Trims an aria snapshot: drops empty containers (e.g. `- group:` with no children)\n * and caps the line count. Over the cap, each run of omitted lines is replaced in\n * place by a marker naming the setting that cut it (design\n * keep-the-open-dialog-in-the-snapshot, D2). Pure function, exported for tests.\n */\nexport function trimSnapshot(snapshotYaml: string, maxLines: number = DEFAULT_MAX_LINES): string {\n let lines = snapshotYaml.split('\\n').filter((line) => line.trim().length > 0);\n\n // Removing empty containers can empty their parents; iterate until stable (bounded).\n for (let pass = 0; pass < 5; pass++) {\n const kept: string[] = [];\n let removed = 0;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!;\n const isContainer = line.trimEnd().endsWith(':');\n if (isContainer) {\n const next = lines[i + 1];\n const hasChildren = next !== undefined && indentOf(next) > indentOf(line);\n if (!hasChildren) {\n removed++;\n continue;\n }\n }\n kept.push(line);\n }\n lines = kept;\n if (removed === 0) break;\n }\n\n if (lines.length <= maxLines) return lines.join('\\n');\n\n const keep = linesToKeep(lines, maxLines);\n const out: string[] = [];\n let omitted = 0;\n for (let i = 0; i <= lines.length; i++) {\n if (i < lines.length && !keep.has(i)) {\n omitted++;\n continue;\n }\n if (omitted > 0) {\n const indent = ' '.repeat(indentOf(lines[i - omitted]!));\n out.push(`${indent}- ... (${omitted} ${omitted === 1 ? 'line' : 'lines'} omitted: max_snapshot_lines is ${maxLines})`);\n omitted = 0;\n }\n if (i < lines.length) out.push(lines[i]!);\n }\n return out.join('\\n');\n}\n\n/**\n * Captures the current page as a compact accessibility snapshot (design D1),\n * prefixed with the page URL so the model can reason about navigation.\n *\n * Always in AI mode (design act-on-the-element-the-model-read, D3): every\n * element carries the `[ref=…]` an action names it by, and a plain\n * `ariaSnapshot()` invalidates the refs of the last AI-mode one, measured. The\n * `[cursor=pointer]` marker it adds is dropped: it is about the mouse, not the\n * element, and it was most of the growth that was not a ref.\n */\nexport async function captureSnapshot(page: Page, options: SnapshotOptions = {}): Promise<string> {\n const raw = await page.locator('body').ariaSnapshot({ mode: 'ai' });\n return `url: ${page.url()}\\n${trimSnapshot(raw.replace(/ \\[cursor=pointer\\]/g, ''), options.maxLines)}`;\n}\n\nconst REF_MARKER = / \\[ref=[A-Za-z0-9_-]+\\]/g;\n\n/**\n * The snapshot as a reader that chooses no element sees it: the judge and the\n * planner (design act-on-the-element-the-model-read, D3). Refs are ids, not\n * page content, and the judge corpus's stored snapshots have none.\n */\nexport function withoutRefs(snapshot: string): string {\n return snapshot.replace(REF_MARKER, '');\n}\n\n/** What the snapshot line holding a ref shows about its element. */\nexport interface SnapshotElement {\n role: string;\n /** The accessible name, unquoted; absent when the line has none. */\n name?: string;\n /** Inline text after the colon (`- generic [ref=e4]: Promo code`), unquoted. */\n text?: string;\n}\n\n/** Undoes YAML double-quote escaping, the form a name containing `\"` is printed in. */\nfunction unquote(value: string): string {\n const trimmed = value.trim();\n if (trimmed.length >= 2 && trimmed.startsWith('\"') && trimmed.endsWith('\"')) {\n return trimmed.slice(1, -1).replace(/\\\\([\"\\\\])/g, '$1');\n }\n if (trimmed.length >= 2 && trimmed.startsWith(\"'\") && trimmed.endsWith(\"'\")) {\n return trimmed.slice(1, -1).replace(/''/g, \"'\");\n }\n return trimmed;\n}\n\n// `- role \"name\" [attr] [ref=x] [attr]: inline text`, every part after the role optional.\nconst ELEMENT_LINE =\n /^\\s*- ([a-z][a-zA-Z]*)(?: (\"(?:[^\"\\\\]|\\\\.)*\"))?((?: \\[[^\\]]*\\])*)(?::(?: (.*))?)?$/;\n\n/**\n * Each ref in a snapshot, with the role and name its line shows (design\n * act-on-the-element-the-model-read, D2). Read from the snapshot text the model\n * was given, masked as it was, so what is checked and recorded is what the\n * model read and no secret enters the record.\n */\nexport function indexRefs(snapshot: string): Map<string, SnapshotElement> {\n const index = new Map<string, SnapshotElement>();\n for (const raw of snapshot.split('\\n')) {\n // YAML single-quotes a whole entry whose text holds `: `, as in\n // `- 'heading \"Notes on file: 1\" [level=2] [ref=e16]'`.\n const quoted = /^(\\s*- )'((?:[^']|'')*)'(:.*)?$/.exec(raw);\n const line = quoted ? `${quoted[1]}${quoted[2]!.replace(/''/g, \"'\")}${quoted[3] ?? ''}` : raw;\n const match = ELEMENT_LINE.exec(line);\n if (!match) continue;\n const ref = /\\[ref=([A-Za-z0-9_-]+)\\]/.exec(match[3] ?? '')?.[1];\n if (!ref) continue;\n const element: SnapshotElement = { role: match[1]! };\n if (match[2] !== undefined) element.name = unquote(match[2]);\n if (match[4] !== undefined && match[4].trim() !== '') element.text = unquote(match[4]);\n index.set(ref, element);\n }\n return index;\n}\n"],"mappings":";;;AAOA,IAAM,oBAAoB;AAE1B,SAAS,SAAS,MAAsB;AACtC,SAAO,KAAK,SAAS,KAAK,UAAU,EAAE;AACxC;AAGA,IAAM,cAAc;AACpB,IAAM,eAAe;AAOd,SAAS,cAAc,UAAsC;AAClE,QAAM,QAAQ,aAAa,KAAK,QAAQ;AACxC,SAAO,QAAQ,OAAO,MAAM,CAAC,CAAC,IAAI;AACpC;AAWA,SAAS,YAAY,OAAiB,UAA+B;AACnE,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,aAAa,CAAC,MAAsB;AACxC,QAAI,IAAI,IAAI;AACZ,WAAO,IAAI,MAAM,UAAU,SAAS,MAAM,CAAC,CAAE,IAAI,SAAS,MAAM,CAAC,CAAE,EAAG;AACtE,WAAO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