@ia-qa/pal 0.3.0 → 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.
package/README.md CHANGED
@@ -60,6 +60,32 @@ ia-qa-pal tour — https://app.example · level 1 (with a login)
60
60
 
61
61
  The time estimate only appears once a batch has been explored on your app: it is the pace measured there, never a constant.
62
62
 
63
+ ## The report as a web page
64
+
65
+ For whoever does not live in a terminal — the rest of the team, a PM, a ticket:
66
+
67
+ ```bash
68
+ npx ia-qa-pal tour --report --open # the tour, then its page
69
+ npx ia-qa-pal report --open # the last tour's page, again (after --background, say)
70
+ ```
71
+
72
+ [![The pal report after a real tour of a browser game with live data: "Worth a look" — 1472 elements ok, 2 buttons lost behind a click, 17 of 17 pages under contract, 10 of 16 explored in depth, and what was not seen, with the commands to copy](https://www.ia-qa.com/media/pal-report.png)](https://www.ia-qa.com/media/pal-report.png)
73
+
74
+ One self-contained HTML file (`.ia-qa/pal/report.html` by default, or `--report <file.html>`): the verdict, the same four sections as the terminal — rendered from the same result, so the two cannot disagree — the clicks that reached each element, a copy button on every command, and the last tours as a timeline. Light and dark, readable on a phone. Nothing in it loads from the network, and nothing is sent anywhere. "Not seen" is always shown, and counts are "10 of 16", never a percentage.
75
+
76
+ ![The same report on a phone, in dark mode](https://www.ia-qa.com/media/pal-report-mobile-dark.png)
77
+
78
+ ## What fails a tour, and what does not
79
+
80
+ - **Drift on what a page shows when it loads** — a control lost, ambiguous, or a selector now reaching another element — fails the tour.
81
+ - **Drift on what is reached only by clicking** — a profile opened from a ranking, a button that exists in one state of the app — is listed under *To decide* with the clicks that reached it, and does **not** fail the tour: on an app with live data it may simply depend on what the click landed on. `--strict` makes it fail too.
82
+ - **A label that differs only by a number** (`Cart (3)` → `Cart (5)`, `Activity60` → `Activity30`) comes with the `nameMask` to paste into `.ia-qa/config.json`; the element stays under contract, only its label stops being compared.
83
+ - **A change you intended**: review it, then make it the reference for those pages only —
84
+
85
+ ```bash
86
+ npx ia-qa-pal accept settings checkout # or --all: every page the last tour reported
87
+ ```
88
+
63
89
  ## With your test suite
64
90
 
65
91
  Declare it at setup (`--tests tests/`, or answer yes when the tour finds it) and every tour also reads it:
@@ -79,6 +105,7 @@ Without it, the report says the suite ran but recorded no page — never that it
79
105
  ```bash
80
106
  npx ia-qa-pal tour --background # returns at once
81
107
  npx ia-qa-pal status # phase and progress, then the report
108
+ npx ia-qa-pal report --open # once it is done: the report as a web page
82
109
  ```
83
110
 
84
111
  One tour runs per project; a second is refused while the first is alive, and a tour whose process died is reported as interrupted, never as running.
@@ -96,8 +123,11 @@ One tour runs per project; a second is refused while the first is alive, and a t
96
123
  | `--more` | explore the next batch in depth instead of a regression tour |
97
124
  | `--suite` | also run your test command once, with the capture hook |
98
125
  | `--background` | start detached and return at once |
126
+ | `--strict` | also fail on drift reached only by clicking |
99
127
  | `--batch <n>` | pages per depth batch (default 10) |
100
128
  | `--json` | the whole report as one JSON document on stdout; progress stays on stderr |
129
+ | `--report [file.html]` | also write the report as a web page (default `.ia-qa/pal/report.html`) |
130
+ | `--open` | open that page in your browser |
101
131
  | `--session <file>` | a Playwright `storageState` to reuse |
102
132
  | `--config <dir>` | the project holding `.ia-qa/` (default: current directory) |
103
133
 
@@ -106,7 +136,7 @@ One tour runs per project; a second is refused while the first is alive, and a t
106
136
  | code | meaning |
107
137
  |---|---|
108
138
  | `0` | nothing needs a decision (warnings and proposed repairs never fail a tour) |
109
- | `1` | a dead link, drift that blocks (an element lost, ambiguous, or a selector now pointing at another element), or your suite failed when run with `--suite` |
139
+ | `1` | a dead link, drift on what pages show on load (an element lost, ambiguous, or a selector now pointing at another element), a test about to act on the wrong element, or your suite failed when run with `--suite` |
110
140
  | `2` | could not answer: not set up, nothing could be mapped, the tour refused to run, or one is already running |
111
141
 
112
142
  Read `2` as "no answer", never as "the app is broken".
@@ -117,4 +147,4 @@ Read `2` as "no answer", never as "the app is broken".
117
147
  - **Exploration is read-only.** While menus, tabs and dialogs are opened, every non-GET request is blocked, and controls named like actions (log out, delete, pay…) are never clicked.
118
148
  - **The link check** requests your app's own links with GET, skipping any URL that acts (`/logout`, `/delete`…).
119
149
  - **Your test command** runs only with `--suite` (or `suite: true` from an agent), and it is always the one in your config — never a string passed on the call.
120
- - **Files** live in `.ia-qa/`: contracts, baseline, `usage.json` (your suite's locators), and `pal/` (the measured pace, findings already reported, the current run and its log). A saved session there holds live cookies — it is gitignored and never leaves your machine.
150
+ - **Files** live in `.ia-qa/`: contracts, baseline, `usage.json` (your suite's locators), and `pal/` (the measured pace, findings already reported, the current run and its log, one line per past tour for the timeline, and the report page). A saved session there holds live cookies — it is gitignored and never leaves your machine.
package/TUTORIAL.md CHANGED
@@ -96,10 +96,10 @@ The report has at most four sections, and each one appears only when it holds so
96
96
 
97
97
  | section | what it holds | what you do |
98
98
  |---|---|---|
99
- | 🔴 **Broken in the app** | links your app itself answers with an error | fix the link |
100
- | ⛔ **To decide** | drift that blocks, and findings seen for the first time | a person looks |
101
- | 🔧 **Ready to repair** | *(coming with test-suite support)* | |
102
- | 🔍 **Not seen** | pages not explored, not mapped, only partly explored, links it could not verify | decide whether it matters |
99
+ | 🔴 **Broken** | links your app itself answers with an error; your suite failing under `--suite` | fix it |
100
+ | ⛔ **To decide** | drift, and findings seen for the first time | a person looks — then fixes, or `accept`s |
101
+ | 🔧 **Ready to repair** | with your test suite declared: selector rewrites for your tests (section 7) | review, then apply with `ia-qa-heal fix` |
102
+ | 🔍 **Not seen** | pages not explored, not mapped, not compared, only partly explored, links it could not verify, pages your suite never visits | decide whether it matters |
103
103
 
104
104
  Three things are worth knowing about this first report:
105
105
 
@@ -128,15 +128,73 @@ ia-qa-pal tour — https://www.nodemented.com · level 1 (with a login)
128
128
 
129
129
  Each page is captured again **the way its baseline was captured** — on the surface, or opened in depth — and compared with it. A finding already reported is counted, not listed again: a list that never shrinks stops being read by the third tour.
130
130
 
131
- When something moved (illustrative):
131
+ When something moved — a real tour of a browser game with live data, five minutes after its baseline:
132
132
 
133
133
  ```
134
- ⛔ BLOCK · 1937 ok · 0 renamed · 1 lost · 0 ambiguous · 0 rebound
134
+ ia-qa-pal tour — https://project-1jpdv.vercel.app · level 2 (with your test suite)
135
+ ⛔ BLOCK · 1471 ok · 0 renamed · 2 lost · 0 ambiguous · 1 rebound
136
+ 17 of 17 pages under contract · 10 explored in depth of 16 pages with closed controls
135
137
 
136
138
  ⛔ To decide
137
- drift settings: 1 lost · 0 ambiguous · 0 rebound
139
+ drift jeu-journal: button "📡Activité60" rebound
140
+ behind 2 elements reached only by clicking changed — they may depend on the data the click lands on:
141
+ jeu-chantier: button "👽 Intercepter" lost, after "🌌Galaxie"
142
+ jeu-chantier: button "Reset" lost, after "🌌Galaxie"
143
+ If these changes are intended: ia-qa-pal accept jeu-journal jeu-chantier
144
+ 61 warnings already reported — not listed again.
145
+
146
+ 💡 1 label differs only by a number — a counter or a clock that changes on its own, and it is holding the verdict.
147
+ e.g. "📡Activité60" → "📡Activité30". To stop comparing those labels (the element stays under contract), add to .ia-qa/config.json:
148
+ "nameMask": ["📡Activité*"]
149
+ ```
150
+
151
+ Two kinds of drift, and they do not weigh the same:
152
+
153
+ - **What a page shows when it loads** fails the tour. Here, `📡Activité60` is a counter that moved on its own — the 💡 line gives the `nameMask` to paste once.
154
+ - **What is reached only by clicking** is listed with the clicks that reached it and does **not** fail the tour. "Intercepter" exists only while the game has something to intercept: the tour did nothing wrong, the data changed. `--strict` makes these fail too.
155
+
156
+ With the `nameMask` added, the next tour of the same game:
157
+
158
+ ```
159
+ ⚠️ Drift only behind interaction — not failing the tour (--strict would) · 1472 ok · 0 renamed · 2 lost · 0 ambiguous · 0 rebound
160
+ ```
161
+
162
+ and it exits `0`, still listing the two buttons under *To decide*.
163
+
164
+ ### The same report, as a page
165
+
166
+ The terminal is for you; the page is for the person you send it to.
167
+
168
+ ```bash
169
+ npx ia-qa-pal tour --report --open # run the tour, then open its page
170
+ npx ia-qa-pal report --open # the last tour's page, without running anything
138
171
  ```
139
172
 
173
+ That second tour of the game, as a page — nothing staged, this is the file pal wrote:
174
+
175
+ [![The pal report page: pal says "Nothing broke, but I found 2 things worth a look", verdict Worth a look, drift only behind interaction, 1472 ok and 2 lost, 17 of 17 pages under contract, 10 of 16 explored in depth, the two buttons with the click that reached them, the accept command with a copy button, and a Not seen section](https://www.ia-qa.com/media/pal-report.png)](https://www.ia-qa.com/media/pal-report.png)
176
+
177
+ How to read it, top to bottom:
178
+
179
+ - **The verdict** — ✅ *All clear* only when a comparison ran and nothing needs a look; ⚠️ *Worth a look* when nothing failed but something should be seen; ⛔ *Something broke*; 📌 *Baseline established* on a first tour, which is never shown as green; ⏸ *No answer this time* when the tour could not answer.
180
+ - **The gauges** — counts, "10 of 16", never a percentage: this is not code coverage.
181
+ - **To decide / Broken / Ready to repair** — the same lines as the terminal, with the clicks that reached each element and a **copy** button on every command.
182
+ - **Not seen** — always there, never folded away.
183
+ - **Recent tours** — one dot per tour, coloured by how it ended (hover for the date, the duration and the pages).
184
+ - **Raw report (JSON)** at the bottom, for whoever wants every field.
185
+
186
+ It is one HTML file — `.ia-qa/pal/report.html` unless you give `--report <file.html>` — with nothing loaded from the network, so it opens offline and survives being attached to a ticket. On a phone, and in dark mode:
187
+
188
+ ![The same report on a phone, in dark mode](https://www.ia-qa.com/media/pal-report-mobile-dark.png)
189
+
190
+ When a change **is** intended — you renamed a button, removed a page section — review it and make it the reference for those pages only:
191
+
192
+ ```bash
193
+ npx ia-qa-pal accept jeu-chantier # or --all: every page the last tour reported
194
+ ```
195
+
196
+ Nothing else in the baseline moves. An agent never runs this for you: accepting drift is the decision the report hands to a person.
197
+
140
198
  What the words mean:
141
199
 
142
200
  | word | meaning |
@@ -158,9 +216,9 @@ The control stays under contract; only its label is no longer compared.
158
216
 
159
217
  | code | meaning |
160
218
  |---|---|
161
- | `0` | nothing needs a decision — warnings never fail a tour |
162
- | `1` | a dead link, or drift that blocks |
163
- | `2` | no answer: not set up, nothing could be mapped, or the tour refused to run |
219
+ | `0` | nothing needs a decision — warnings, proposed repairs and drift behind interaction never fail a tour |
220
+ | `1` | a dead link, drift on what pages show on load, a test about to act on the wrong element, or your suite failed under `--suite` |
221
+ | `2` | no answer: not set up, nothing could be mapped, the tour refused to run, or one is already running |
164
222
 
165
223
  Read `2` as "could not answer", never as "the app is broken".
166
224
 
@@ -179,7 +237,7 @@ npx ia-qa-pal tour --more
179
237
 
180
238
  `--more` explores the next batch and adds those pages to the baseline. Run it when you have the time — the estimate told you how much. `--batch <n>` changes the batch size.
181
239
 
182
- It **refuses** when the last tour ended on BLOCK:
240
+ It **refuses** when the last tour ended on drift that fails (accept or fix it first — `ia-qa-pal accept` clears it):
183
241
 
184
242
  ```
185
243
  ⏸ Did not run — The last tour ended on BLOCK. Exploring now would promote those pages as they are today and accept that drift unseen — resolve it, then run `ia-qa-pal tour` again.
@@ -279,7 +337,7 @@ npx ia-qa-pal status
279
337
  ⏳ A tour is running (pid 34136, since 2026-09-15T14:04:32Z) — depth 4/10 · jeu-planete
280
338
  ```
281
339
 
282
- When it is done, `status` prints the report. Only one tour runs per project: a second is refused while the first is alive, because two tours would write the same contracts. A tour whose process died before finishing is reported as **interrupted** — never as still running, never as a result. Its output is in `.ia-qa/pal/run.log`.
340
+ When it is done, `status` prints the report, and `npx ia-qa-pal report --open` opens it as a page. Only one tour runs per project: a second is refused while the first is alive, because two tours would write the same contracts. A tour whose process died before finishing is reported as **interrupted** — never as still running, never as a result. Its output is in `.ia-qa/pal/run.log`.
283
341
 
284
342
  ---
285
343
 
@@ -360,9 +418,13 @@ Asked to tour a project that is not set up, `ia-qa-pal tour --json` answers with
360
418
 
361
419
  **A page is "not mapped" with a timeout.** One slow page costs that page, not the tour. It stays in **Not seen**; if its drift is shown, the report marks it as an older capture.
362
420
 
363
- **Every page behind the login is "not mapped".** The session expired, or never worked. Log in again with `ia-qa-heal login`, then run the tour.
421
+ **"N pages landed on a login page instead".** The session expired, or never worked. Log in again with `ia-qa-heal login`, then run the tour. Drift on those pages is from an older capture: it is not counted, and `accept` refuses them until a tour captures them again.
422
+
423
+ **"not compared — its contract file cannot be read".** A file under `.ia-qa/baseline/` or `.ia-qa/mapping/` is corrupt. Restore it from git, or run the tour again to re-capture it.
424
+
425
+ **`renamed` or `rebound` on a label you did not touch.** A counter, a date or generated content. The report gives the `nameMask` to paste (section 4).
364
426
 
365
- **`renamed` on a label you did not touch.** A counter, a date or generated content. Add a `nameMask` for it (section 4).
427
+ **Drift behind interaction on every tour.** Those elements depend on the app's data. They never fail the tour unless you pass `--strict`; if they are noise you never want to read, `ia-qa-pal accept` the page after the data settles, or keep the page on the surface.
366
428
 
367
429
  **"only partly explored (click budget reached)".** The page has more closed controls than one exploration opens (150 clicks). Its contract covers part of the page, and the report says so.
368
430
 
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A person looked at the drift and it is what they wanted: a new label, a removed button, data
3
+ * that moved. Only those pages' latest captures become the reference — nothing else in `mapping/`
4
+ * is promoted, and nothing is accepted that the last tour did not capture.
5
+ *
6
+ * Deliberately not an MCP tool: accepting drift is the decision the whole report hands to a person.
7
+ */
8
+ export interface AcceptOutcome {
9
+ accepted: string[];
10
+ skipped: Array<{
11
+ page: string;
12
+ reason: string;
13
+ }>;
14
+ refused?: string;
15
+ }
16
+ /** The pages whose drift the last finished tour reported. */
17
+ export declare function driftedPages(dir: string): string[];
18
+ export declare function acceptPages(dirGiven: string, pagesGiven: string[], opts?: {
19
+ all?: boolean;
20
+ }): Promise<AcceptOutcome>;
package/dist/accept.js ADDED
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.driftedPages = driftedPages;
37
+ exports.acceptPages = acceptPages;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const self_healing_1 = require("@ia-qa/self-healing");
41
+ const run_1 = require("./run");
42
+ const state_1 = require("./state");
43
+ /** The pages whose drift the last finished tour reported. */
44
+ function driftedPages(dir) {
45
+ const drift = (0, run_1.readRun)(dir)?.report?.drift;
46
+ if (!drift)
47
+ return [];
48
+ return [...new Set([...drift.onLoad, ...drift.behindInteraction].map((f) => f.page).concat(drift.suitePages))];
49
+ }
50
+ async function acceptPages(dirGiven, pagesGiven, opts = {}) {
51
+ const dir = path.resolve(dirGiven);
52
+ if (!fs.existsSync(path.join(dir, '.ia-qa', 'config.json'))) {
53
+ return { accepted: [], skipped: [], refused: 'This project is not set up yet — there is no .ia-qa/config.json.' };
54
+ }
55
+ if ((0, run_1.activeRun)(dir))
56
+ return { accepted: [], skipped: [], refused: 'A tour is running on this project — accept after it finishes (ia-qa-pal status).' };
57
+ (0, self_healing_1.setBaseDir)(dir);
58
+ const configured = new Set((0, self_healing_1.loadConfig)().pages.map((p) => p.name));
59
+ const wanted = opts.all ? driftedPages(dir) : pagesGiven;
60
+ if (wanted.length === 0) {
61
+ return { accepted: [], skipped: [], refused: opts.all ? 'The last tour reported no drift to accept.' : 'Name the pages to accept, or --all for every page the last tour reported.' };
62
+ }
63
+ const ready = [];
64
+ const skipped = [];
65
+ const notRecaptured = new Set(((0, run_1.readRun)(dir)?.report?.pages.notMapped ?? []).map((m) => m.page));
66
+ for (const page of wanted) {
67
+ if (!configured.has(page)) {
68
+ skipped.push({ page, reason: 'not a configured page' });
69
+ continue;
70
+ }
71
+ if (notRecaptured.has(page)) {
72
+ skipped.push({ page, reason: 'the last tour could not re-capture it — accepting would promote an older capture; run a tour first' });
73
+ continue;
74
+ }
75
+ let current;
76
+ try {
77
+ current = (0, self_healing_1.loadMapping)(page, (0, self_healing_1.mappingDir)());
78
+ }
79
+ catch {
80
+ skipped.push({ page, reason: 'no capture yet — run a tour first' });
81
+ continue;
82
+ }
83
+ try {
84
+ if ((0, self_healing_1.loadMapping)(page, (0, self_healing_1.baselineDir)()).capturedAt === current.capturedAt) {
85
+ skipped.push({ page, reason: 'the baseline already is its latest capture' });
86
+ continue;
87
+ }
88
+ }
89
+ catch {
90
+ /* not in the baseline yet: accepting it adds it */
91
+ }
92
+ ready.push(page);
93
+ }
94
+ if (ready.length > 0) {
95
+ const { log, info, warn } = console;
96
+ console.log = console.info = console.warn = (...a) => console.error(...a);
97
+ const before = process.exitCode;
98
+ process.exitCode = undefined;
99
+ try {
100
+ await (0, self_healing_1.runBaseline)([], { pages: ready });
101
+ if (process.exitCode)
102
+ return { accepted: [], skipped, refused: `baseline refused to promote ${ready.join(', ')}` };
103
+ }
104
+ finally {
105
+ process.exitCode = before;
106
+ console.log = log;
107
+ console.info = info;
108
+ console.warn = warn;
109
+ }
110
+ const remaining = driftedPages(dir).filter((p) => !ready.includes(p));
111
+ const state = (0, state_1.loadState)();
112
+ if (state.lastVerdict === 'BLOCK' && remaining.length === 0) {
113
+ delete state.lastVerdict;
114
+ (0, state_1.saveState)(state);
115
+ }
116
+ }
117
+ return { accepted: ready, skipped };
118
+ }
119
+ //# sourceMappingURL=accept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accept.js","sourceRoot":"","sources":["../src/accept.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,oCAIC;AAED,kCAkEC;AA7FD,uCAAyB;AACzB,2CAA6B;AAC7B,sDAAgH;AAChH,+BAA2C;AAC3C,mCAA+C;AAgB/C,6DAA6D;AAC7D,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,KAAK,GAAG,IAAA,aAAO,EAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACjH,CAAC;AAEM,KAAK,UAAU,WAAW,CAAC,QAAgB,EAAE,UAAoB,EAAE,OAA0B,EAAE;IACpG,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,kEAAkE,EAAE,CAAC;IACpH,CAAC;IACD,IAAI,IAAA,eAAS,EAAC,GAAG,CAAC;Q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;gBAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,+BAA+B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACrH,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC;YAC1B,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC;YAClB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YACpB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QACtB,CAAC;QACD,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,MAAM,KAAK,GAAG,IAAA,iBAAS,GAAE,CAAC;QAC1B,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5D,OAAO,KAAK,CAAC,WAAW,CAAC;YACzB,IAAA,iBAAS,EAAC,KAAK,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACtC,CAAC"}
package/dist/cli/index.js CHANGED
@@ -39,6 +39,8 @@ const path = __importStar(require("path"));
39
39
  const report_1 = require("../report");
40
40
  const setup_1 = require("../setup");
41
41
  const run_1 = require("../run");
42
+ const accept_1 = require("../accept");
43
+ const htmlReport_1 = require("../htmlReport");
42
44
  const VERSION = require('../../package.json').version;
43
45
  const HELP = `ia-qa-pal — a QA pal next to your team
44
46
 
@@ -68,11 +70,29 @@ Usage:
68
70
  the suite never visits
69
71
  --background start the tour detached and return at once;
70
72
  follow it with \`ia-qa-pal status\`
73
+ --strict also fail on drift behind interaction (elements
74
+ reached only by clicking, which may depend on
75
+ the data the click lands on)
71
76
  --batch <n> pages per depth batch (default 10)
72
77
  --json the report as one JSON document on stdout
78
+ --report [file.html] also write the report as a web page (default
79
+ .ia-qa/pal/report.html)
80
+ --open open that page in your browser
73
81
  --session <file> a Playwright storageState to reuse
74
82
  --config <dir> project holding .ia-qa/ (default: here)
75
83
 
84
+ ia-qa-pal accept <page>… A person reviewed the drift and it is intended:
85
+ make those pages' latest captures the reference.
86
+ --all every page the last tour reported drift on
87
+ --config <dir> project folder (default: here)
88
+ [FOR AI AGENTS] only on the human's decision.
89
+
90
+ ia-qa-pal report [file.html] Write the last tour's report as one web page:
91
+ verdict, the four sections, recent tours.
92
+ Self-contained, nothing sent anywhere.
93
+ --open open it in your browser
94
+ --config <dir> project folder (default: here)
95
+
76
96
  ia-qa-pal status The tour running now (phase, progress) or the
77
97
  last one (its report).
78
98
  --json as one JSON document
@@ -104,6 +124,11 @@ function valueOf(args, flag) {
104
124
  throw new Error(`${flag} needs a value.`);
105
125
  return v;
106
126
  }
127
+ function reportTarget(args, after) {
128
+ const i = args.indexOf(after);
129
+ const v = i === -1 ? undefined : args[i + 1];
130
+ return v && !v.startsWith('--') ? v : undefined;
131
+ }
107
132
  const interactive = () => !!process.stdin.isTTY && !!process.stderr.isTTY && !process.env.CI;
108
133
  async function withPrompt(fn) {
109
134
  const rl = readline.createInterface({ input: process.stdin, output: process.stderr });
@@ -189,12 +214,42 @@ async function main() {
189
214
  process.exitCode = outcome.written ? 0 : 2;
190
215
  return;
191
216
  }
217
+ if (command === 'accept') {
218
+ const pages = args.slice(1).filter((a, i, all) => !a.startsWith('--') && all[i - 1] !== '--config');
219
+ const outcome = await (0, accept_1.acceptPages)(dir, pages, { all: args.includes('--all') });
220
+ if (json)
221
+ process.stdout.write(`${JSON.stringify({ schema: 'ia-qa-pal/accept@1', ...outcome }, null, 2)}\n`);
222
+ else {
223
+ if (outcome.refused)
224
+ process.stderr.write(`❌ ${outcome.refused}\n`);
225
+ if (outcome.accepted.length > 0)
226
+ process.stderr.write(`✅ Accepted as the new reference: ${outcome.accepted.join(', ')}\n Commit .ia-qa/baseline — a reference that is not in git cannot be reviewed.\n`);
227
+ for (const s of outcome.skipped)
228
+ process.stderr.write(` skipped ${s.page} — ${s.reason}\n`);
229
+ }
230
+ process.exitCode = outcome.refused ? 2 : 0;
231
+ return;
232
+ }
192
233
  if (command === 'status') {
193
234
  const run = (0, run_1.readRun)(dir);
194
235
  process.stdout.write(json ? `${JSON.stringify({ schema: 'ia-qa-pal/status@1', run }, null, 2)}\n` : renderStatus(run, dir));
195
236
  process.exitCode = run?.status === 'done' ? run.exitCode ?? 0 : run ? 0 : 2;
196
237
  return;
197
238
  }
239
+ if (command === 'report') {
240
+ const run = (0, run_1.readRun)(dir);
241
+ if (!run?.report) {
242
+ process.stderr.write(run?.status === 'running' ? 'A tour is still running — its report comes when it ends: ia-qa-pal status\n' : 'No finished tour to report on yet. Run one: ia-qa-pal tour\n');
243
+ process.exitCode = 2;
244
+ return;
245
+ }
246
+ const file = (0, htmlReport_1.writeHtmlReport)(dir, run.report, { file: reportTarget(args, 'report'), version: VERSION, at: run.finishedAt });
247
+ process.stderr.write(`📄 Report: ${file}\n`);
248
+ if (args.includes('--open'))
249
+ (0, htmlReport_1.openFile)(file);
250
+ process.exitCode = 0;
251
+ return;
252
+ }
198
253
  if (command !== 'tour') {
199
254
  process.stderr.write(`Unknown command "${command}". Run ia-qa-pal help.\n`);
200
255
  process.exitCode = 2;
@@ -204,7 +259,7 @@ async function main() {
204
259
  const batch = batchRaw === undefined ? undefined : Number(batchRaw);
205
260
  if (batch !== undefined && (!Number.isInteger(batch) || batch < 1))
206
261
  throw new Error('--batch needs a positive whole number.');
207
- const tourOptions = { more: args.includes('--more'), suite: args.includes('--suite'), batch, session: valueOf(args, '--session') };
262
+ const tourOptions = { more: args.includes('--more'), suite: args.includes('--suite'), strict: args.includes('--strict'), batch, session: valueOf(args, '--session') };
208
263
  if (args.includes('--background')) {
209
264
  const started = (0, run_1.startBackground)(dir, tourOptions);
210
265
  if (json)
@@ -228,6 +283,12 @@ async function main() {
228
283
  }
229
284
  const result = await (0, run_1.trackedTour)({ dir, ...tourOptions });
230
285
  process.stdout.write(json ? `${JSON.stringify(result, null, 2)}\n` : (0, report_1.renderReport)(result));
286
+ if (args.includes('--report') || args.includes('--open')) {
287
+ const file = (0, htmlReport_1.writeHtmlReport)(dir, result, { file: reportTarget(args, '--report'), version: VERSION });
288
+ process.stderr.write(`📄 Report: ${file}\n`);
289
+ if (args.includes('--open'))
290
+ (0, htmlReport_1.openFile)(file);
291
+ }
231
292
  process.exitCode = result.exitCode;
232
293
  }
233
294
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA8C;AAC9C,2CAA6B;AAC7B,sCAAyC;AACzC,oCAAiE;AAEjE,gCAA4F;AAG5F,MAAM,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAiB,CAAC;AAEhE,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA4CsB,qBAAa;;;;;;;;;;CAU/C,CAAC;AAEF,SAAS,OAAO,CAAC,IAAc,EAAE,IAAY;IAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,iBAAiB,CAAC,CAAC;IACrF,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,WAAW,GAAG,GAAY,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,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AC,QAAQ,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,YAAY,wBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5J,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,OAAO,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,KAAK,IAAI,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { TourResult } from './tour';
2
+ /**
3
+ * One short line per finished tour, so a report can show how the last tours went. Only what
4
+ * the timeline draws — the full report of each tour is not kept, and nothing here is a secret.
5
+ */
6
+ export interface HistoryEntry {
7
+ at: string;
8
+ mode: TourResult['mode'];
9
+ mood: Mood;
10
+ exitCode: number;
11
+ durationMs: number;
12
+ underContract: number;
13
+ configured: number;
14
+ }
15
+ export type Mood = 'baseline' | 'clean' | 'look' | 'broken' | 'no-answer';
16
+ export declare const historyFile: (dir: string) => string;
17
+ /**
18
+ * The one mood a tour ends in, shared by the terminal-free report and its timeline.
19
+ * `look` is a tour that fails nothing but still holds something a person should see.
20
+ */
21
+ export declare function moodOf(r: TourResult): Mood;
22
+ export declare function appendHistory(dir: string, r: TourResult, at?: string): void;
23
+ export declare function readHistory(dir: string): HistoryEntry[];
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.historyFile = void 0;
37
+ exports.moodOf = moodOf;
38
+ exports.appendHistory = appendHistory;
39
+ exports.readHistory = readHistory;
40
+ const fs = __importStar(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ const MAX_ENTRIES = 60;
43
+ const historyFile = (dir) => path.join(dir, '.ia-qa', 'pal', 'history.jsonl');
44
+ exports.historyFile = historyFile;
45
+ /**
46
+ * The one mood a tour ends in, shared by the terminal-free report and its timeline.
47
+ * `look` is a tour that fails nothing but still holds something a person should see.
48
+ */
49
+ function moodOf(r) {
50
+ if (r.refused || r.exitCode === 2)
51
+ return 'no-answer';
52
+ if (r.exitCode === 1)
53
+ return 'broken';
54
+ if (r.mode !== 'regression')
55
+ return 'baseline';
56
+ const d = r.drift;
57
+ const s = r.suite;
58
+ const somethingToSee = !d ||
59
+ d.verdict !== 'PASS' ||
60
+ d.behindInteraction.length > 0 ||
61
+ d.maskSuggestions.length > 0 ||
62
+ (r.check && (r.check.newUnnamed.length + r.check.newAmbiguous.length + r.check.newOrphans.length > 0)) ||
63
+ (s && ((s.repairs?.total ?? 0) > 0 || s.newDeadNames.length > 0)) ||
64
+ r.pages.notMapped.length > 0 ||
65
+ (r.pages.unreadable?.length ?? 0) > 0;
66
+ return somethingToSee ? 'look' : 'clean';
67
+ }
68
+ function appendHistory(dir, r, at = new Date().toISOString()) {
69
+ const entry = {
70
+ at,
71
+ mode: r.mode,
72
+ mood: moodOf(r),
73
+ exitCode: r.exitCode,
74
+ durationMs: r.durationMs,
75
+ underContract: r.pages.underContract,
76
+ configured: r.pages.configured,
77
+ };
78
+ try {
79
+ const file = (0, exports.historyFile)(dir);
80
+ fs.mkdirSync(path.dirname(file), { recursive: true });
81
+ const lines = fs.existsSync(file) ? fs.readFileSync(file, 'utf8').split('\n').filter(Boolean) : [];
82
+ lines.push(JSON.stringify(entry));
83
+ fs.writeFileSync(file, lines.slice(-MAX_ENTRIES).join('\n') + '\n');
84
+ }
85
+ catch {
86
+ /* history is a courtesy to the report; a full disk must not cost the tour */
87
+ }
88
+ }
89
+ function readHistory(dir) {
90
+ try {
91
+ return fs
92
+ .readFileSync((0, exports.historyFile)(dir), 'utf8')
93
+ .split('\n')
94
+ .filter(Boolean)
95
+ .flatMap((line) => {
96
+ try {
97
+ return [JSON.parse(line)];
98
+ }
99
+ catch {
100
+ return [];
101
+ }
102
+ });
103
+ }
104
+ catch {
105
+ return [];
106
+ }
107
+ }
108
+ //# sourceMappingURL=history.js.map