@ia-qa/qa-discovery 0.11.1 → 0.12.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 +19 -3
- package/ROADMAP.md +11 -0
- package/TUTORIAL.md +69 -0
- package/dist/ai/model.js +4 -3
- package/dist/ai/model.js.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +28 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/scenarios.d.ts +1 -0
- package/dist/cli/scenarios.js +142 -0
- package/dist/cli/scenarios.js.map +1 -0
- package/dist/cli-ai/index.js +4 -2
- package/dist/cli-ai/index.js.map +1 -1
- package/dist/mcp/server.d.ts +61 -0
- package/dist/mcp/server.js +48 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/scenarios/emit.d.ts +17 -0
- package/dist/scenarios/emit.js +62 -0
- package/dist/scenarios/emit.js.map +1 -0
- package/dist/scenarios/gherkin.d.ts +29 -0
- package/dist/scenarios/gherkin.js +111 -0
- package/dist/scenarios/gherkin.js.map +1 -0
- package/dist/scenarios/live.d.ts +50 -0
- package/dist/scenarios/live.js +479 -0
- package/dist/scenarios/live.js.map +1 -0
- package/dist/scenarios/run.d.ts +47 -0
- package/dist/scenarios/run.js +177 -0
- package/dist/scenarios/run.js.map +1 -0
- package/dist/scenarios/steps.d.ts +108 -0
- package/dist/scenarios/steps.js +143 -0
- package/dist/scenarios/steps.js.map +1 -0
- package/package.json +2 -2
- package/skills/ia-qa-discover/SKILL.md +7 -0
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ npx -p @ia-qa/qa-discovery ia-qa-discover scan https://your-app.example.com --sa
|
|
|
25
25
|
| my app is behind a login | `login` — a visible browser, you log in, the session is reused |
|
|
26
26
|
| most of the inputs are behind a menu or a tab | `scan --deep` — opens them one level and captures what they reveal |
|
|
27
27
|
| **what does my test suite not test?** | **`coverage`** — the gap, ranked; needs `@ia-qa/self-healing` and one watched run |
|
|
28
|
+
| **I have test scenarios, I want tests that run** | **`scenarios`** — Gherkin in, Playwright out, each test proven able to fail |
|
|
28
29
|
| what changed since last time? | `history` |
|
|
29
30
|
| what is each entry point *for*, and how sensitive? | `ia-qa-discover-ai classify` (optional, your own key) |
|
|
30
31
|
| what does somebody come to this page to **do**? | `ia-qa-discover-ai plan` (optional, your own key) |
|
|
@@ -37,12 +38,12 @@ ia-qa-discover skill --print # read it
|
|
|
37
38
|
ia-qa-discover skill --install # drop it in .claude/skills/, where agents actually look
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
`ia-qa-discover <verb> --help` for flags. Nothing here
|
|
41
|
-
|
|
41
|
+
`ia-qa-discover <verb> --help` for flags. Nothing here gates CI: a page count is not coverage,
|
|
42
|
+
a gap is a decision for a human, and `scenarios` judges the tests it writes, never your app.
|
|
42
43
|
|
|
43
44
|
**Same operations for an AI agent** — one contract served twice, never a simplified view for
|
|
44
45
|
one of them. `ia-qa-discover-mcp` exposes `scan_app`, `coverage_map`, `classify_app`,
|
|
45
|
-
`plan_pages` and `discovery_history`. `login` is deliberately not a tool: it waits for a
|
|
46
|
+
`plan_pages`, `prove_scenarios` and `discovery_history`. `login` is deliberately not a tool: it waits for a
|
|
46
47
|
person at a browser.
|
|
47
48
|
|
|
48
49
|
> **New here?** The [step-by-step tutorial](https://www.ia-qa.com/devtools/qa-discovery/tutorial)
|
|
@@ -317,6 +318,20 @@ Files land in `.ia-qa-discovery/generated/` and nothing is added to your suite.
|
|
|
317
318
|
|
|
318
319
|
`--out <dir>` to write them where your suite lives, `--json` for a machine-readable summary, or name pages explicitly to generate for them anyway.
|
|
319
320
|
|
|
321
|
+
### `scenarios [dir|file]`
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
npx ia-qa-discover scenarios --base-url https://your.app/
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
You write (or review) what is tested; this verb writes how. Scenarios are Gherkin files in `scenarios/` — English or French keywords — in a closed vocabulary: `I open`, `I click`, `I fill … with`, `I select … in`, `I choose`, `I check`, `I see`, `I don't see`, `the URL contains` (`j'ouvre`, `je clique sur`, `je vois`…). A scenario tagged `@draft` is a proposal and is not run; removing the tag is the validation, visible in the diff.
|
|
328
|
+
|
|
329
|
+
Each step is bound on the **live page** to the one element Playwright's own `getByRole` / `getByLabel` / `getByText` counts for it — never re-implemented, never guessed. None or several is a question for you, answered with what the page actually shows. Then every test is **proven**: green twice in fresh browsers, *and* red when what each check reads is altered on the page. That second half is the one generators skip, and it is where most generated tests fail: `the URL contains "my.app"` holds on every page of the site, so it is reported **blind** instead of being counted as a test.
|
|
330
|
+
|
|
331
|
+
Every scenario lands in exactly one column — ✅ proven · 🙈 blind · ❔ not proven (the page undid the alteration) · 🎲 flaky · ❌ fails on the app as it is (the app or the scenario is wrong, and only you can say which) · ✋ needs you · ⏸ not run. One spec per feature in `.ia-qa-discovery/generated/`, byte-identical when nothing moved, never overwritten without `--force`; lines `ia-qa-heal` cannot repair (a test id, a text) say so in the file. A browser on this machine and nothing else: no model, nothing sent. An app behind a login uses the session `scan` would use (one saved by `ia-qa-heal login` included, or `--session <storageState>`); the spec then says your Playwright config must give its tests a session too. The same run is the MCP tool `prove_scenarios`, where an agent may draft scenarios only with `@draft`, and a scenario opening another origin than the base URL is refused.
|
|
332
|
+
|
|
333
|
+
Measured on [Sandbox Bazaar](https://jeteste-qa.github.io/?scenario=bz-100): three scenarios written against the plain shop gave three proven tests, and the same files, run unchanged with `npx playwright test` against the shop's trapped variants, failed exactly where a total changed — a hidden fee (`53.40 EUR` instead of `46.90 EUR`) and a pre-checked subscription (`51.89 EUR`) — and stayed green where the trap does not touch what they check.
|
|
334
|
+
|
|
320
335
|
### `history`
|
|
321
336
|
|
|
322
337
|
The trend no single scan can reconstruct: pages, forms, API surface, and what changed run over run.
|
|
@@ -495,6 +510,7 @@ Configure it in `.ia-qa-discovery/config.json` — the file holds the *name* of
|
|
|
495
510
|
"ai": { "provider": "azure-openai", "model": "my-gpt4o-deployment",
|
|
496
511
|
"baseUrl": "https://<resource>.openai.azure.com",
|
|
497
512
|
"apiKey": { "source": "env", "key": "AZURE_OPENAI_API_KEY" } }
|
|
513
|
+
// …or the portal's full Target URI as baseUrl: the deployment it names is the one called.
|
|
498
514
|
|
|
499
515
|
// a model on this machine takes no key at all:
|
|
500
516
|
"ai": { "provider": "openai-compatible", "model": "llama3.1",
|
package/ROADMAP.md
CHANGED
|
@@ -278,6 +278,17 @@ assertion beyond what the app itself declares. What a submission *produces* stay
|
|
|
278
278
|
That is the deterministic floor. Everything below — deriving *intent* rather than structure —
|
|
279
279
|
is still net-new, and still needs the grid.
|
|
280
280
|
|
|
281
|
+
**Shipped next (lot 1 of `SPEC-scenarios-to-tests.md`, unpublished): `ia-qa-discover
|
|
282
|
+
scenarios`.** The other direction: the intent comes from a person's Gherkin scenario, and the
|
|
283
|
+
verb supplies the binding, the code and the proof. Steps are bound on the live page by
|
|
284
|
+
Playwright's own counts; a test is *proven* only when it passes twice in fresh browsers **and**
|
|
285
|
+
fails when what each check reads is altered. Measured on Sandbox Bazaar: 3 of 3 proven on the
|
|
286
|
+
plain shop, and the same files failed with the real runner exactly where a trapped variant
|
|
287
|
+
changed the total. **Not built yet, in order:** a BYOK model to bind the steps exact matching
|
|
288
|
+
could not (choosing only among elements the page offers, the names sent as data), a skill that
|
|
289
|
+
drafts `@draft` scenarios, `needs` answered by the tool asking (session via `ia-qa-heal login`,
|
|
290
|
+
secrets via the OS store), the `pal` and MCP doors, a second app we did not write.
|
|
291
|
+
|
|
281
292
|
**The audit found the assumed inputs do not exist.** There is no closed grid of test
|
|
282
293
|
patterns anywhere in the ecosystem to derive from — `QA_AGENT_RECIPES` and
|
|
283
294
|
`AUGMENTED_QA_PLAYBOOK` are editorial content, not structured data. So the intent→scenario
|
package/TUTORIAL.md
CHANGED
|
@@ -29,6 +29,7 @@ suite, a ranked list of the pages nobody tests.
|
|
|
29
29
|
7. [The four ways a page count lies](#7-the-four-ways-a-page-count-lies)
|
|
30
30
|
8. [What my suite does not test](#8-what-my-suite-does-not-test)
|
|
31
31
|
9. [Doing this every week](#9-doing-this-every-week)
|
|
32
|
+
9b. [From your test scenarios to tests that run](#9b-from-your-test-scenarios-to-tests-that-run)
|
|
32
33
|
10. [Optional: what is each entry point *for*?](#10-optional-what-is-each-entry-point-for)
|
|
33
34
|
11. [Optional: what does somebody come here to *do*?](#11-optional-what-does-somebody-come-here-to-do)
|
|
34
35
|
12. [Troubleshooting](#12-troubleshooting)
|
|
@@ -421,6 +422,74 @@ down in a file a reviewer can see.
|
|
|
421
422
|
|
|
422
423
|
---
|
|
423
424
|
|
|
425
|
+
## 9b. From your test scenarios to tests that run
|
|
426
|
+
|
|
427
|
+
The gap tells you which pages no test visits. If you already know **what** to test on them — in a
|
|
428
|
+
test-management tool, a ticket, your head — write it as scenarios and let this write the tests.
|
|
429
|
+
|
|
430
|
+
**1. Write the scenarios.** One file per feature in `scenarios/`, in plain Gherkin (English or
|
|
431
|
+
French keywords):
|
|
432
|
+
|
|
433
|
+
```gherkin
|
|
434
|
+
Feature: Buying headphones
|
|
435
|
+
|
|
436
|
+
Scenario: The total includes standard delivery
|
|
437
|
+
Given I open "/?scenario=bz-100"
|
|
438
|
+
When I click "Studio 2 over-ear headphones"
|
|
439
|
+
And I click "Add to cart"
|
|
440
|
+
And I click "Cart (1)"
|
|
441
|
+
And I click "Go to checkout"
|
|
442
|
+
And I choose "Standard delivery"
|
|
443
|
+
Then I see "46.90 EUR"
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
The steps it understands: `I open`, `I click`, `I fill "<label>" with "<value>"`,
|
|
447
|
+
`I select "<option>" in "<label>"`, `I choose`, `I check` / `I uncheck`, `I see`,
|
|
448
|
+
`I don't see`, `the URL contains` (`j'ouvre`, `je clique sur`, `je vois`…). Anything else is
|
|
449
|
+
not guessed: the scenario comes back asking you to rewrite that step. A scenario tagged `@draft`
|
|
450
|
+
is a proposal — an AI agent may draft them, always with that tag — and is not run until **you**
|
|
451
|
+
remove the tag.
|
|
452
|
+
|
|
453
|
+
**2. Run it.**
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
npx ia-qa-discover scenarios --base-url https://your.app/
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
What it prints, on the example shop used above (real output):
|
|
460
|
+
|
|
461
|
+
```console
|
|
462
|
+
3 proven · 1 needs-input · 1 not-run
|
|
463
|
+
|
|
464
|
+
✅ Proven — green twice, and red when what it checks is altered
|
|
465
|
+
· The total includes standard delivery (scenarios/checkout.feature:10)
|
|
466
|
+
…
|
|
467
|
+
✋ Needs you — a step the page cannot answer on its own
|
|
468
|
+
· A promo code lowers the total (scenarios/checkout.feature:25)
|
|
469
|
+
step 28: I click "Apply promo code"
|
|
470
|
+
nothing on the page answers to a button or link named "Apply promo code"
|
|
471
|
+
the page shows: button "Add to cart", link "Audio", link "Kitchen", … link "Cart (0)"
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
**3. Read the columns, all of them.** Each step was matched to the **one** element Playwright
|
|
475
|
+
counts for it on the live page — none or several comes back to you with what the page shows.
|
|
476
|
+
Then each test was **proven**: it passed twice in fresh browsers, *and* it failed when the text it
|
|
477
|
+
checks was altered on the page. That second half is the one to care about:
|
|
478
|
+
|
|
479
|
+
- **✅ proven** — it can fail. Read it, then move it into your suite.
|
|
480
|
+
- **🙈 blind** — it runs green and checks nothing that can change: `the URL contains "your.app"`
|
|
481
|
+
holds on every page of the site. Not a test yet; sharpen the `Then` step.
|
|
482
|
+
- **❌ fails on the app as it is** — the app or the scenario is wrong. Only you can say which;
|
|
483
|
+
never edit the expected text to what the page shows, or a bug report becomes a passing test.
|
|
484
|
+
- **✋ needs you**, **🎲 flaky**, **❔ not proven**, **⏸ not run** — each says why.
|
|
485
|
+
|
|
486
|
+
The specs land in `.ia-qa-discovery/generated/`, one per feature, never overwritten without
|
|
487
|
+
`--force`, byte-identical when nothing moved. Nothing is added to your suite and nothing is sent
|
|
488
|
+
anywhere: a browser on your machine, no model. Behind a login, the session `scan` uses is used
|
|
489
|
+
here too (`--session <file>` to name another).
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
424
493
|
## 10. Optional: what is each entry point *for*?
|
|
425
494
|
|
|
426
495
|
Everything above is deterministic and local. This section is neither, and it is a separate
|
package/dist/ai/model.js
CHANGED
|
@@ -21,11 +21,12 @@ function buildRequest(provider, model, apiKey, prompt, temperature, baseUrl) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
if (provider === 'azure-openai') {
|
|
24
|
-
// The
|
|
25
|
-
const
|
|
24
|
+
// The URL is read by heal (`azureTarget`), never restated here: one Azure URL for the toolkit.
|
|
25
|
+
const target = (0, self_healing_1.azureTarget)(baseUrl ?? '', model);
|
|
26
|
+
const body = { ...(target.modelInBody ? { model: target.deployment } : {}), messages: [{ role: 'user', content: prompt }] };
|
|
26
27
|
if (temperature !== undefined)
|
|
27
28
|
body.temperature = temperature;
|
|
28
|
-
return { url:
|
|
29
|
+
return { url: target.url, headers: { 'content-type': 'application/json', 'api-key': apiKey }, body };
|
|
29
30
|
}
|
|
30
31
|
if (provider === 'openai' || provider === 'openai-compatible') {
|
|
31
32
|
const body = { model, messages: [{ role: 'user', content: prompt }] };
|
package/dist/ai/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/ai/model.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/ai/model.ts"],"names":[],"mappings":";;;AA2IA,8BAUC;AAQD,wCAoBC;AAGD,sCAKC;AAzLD,sDAA6G;AA6B5E,2FA7BX,yBAAU,OA6BW;AAAjB,sFA7BQ,4BAAa,OA6BhB;AA6FtB,8FA1HwC,4BAAa,OA0HxC;AA/ET,QAAA,cAAc,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAA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C,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC"}
|
package/dist/cli/args.js
CHANGED
|
@@ -25,6 +25,7 @@ exports.KNOWN_FLAGS = {
|
|
|
25
25
|
history: ['--json', '--limit'],
|
|
26
26
|
coverage: ['--json', '--report', '--open'],
|
|
27
27
|
generate: ['--json', '--out', '--force', '--include-login-walls', '--include-error-pages'],
|
|
28
|
+
scenarios: ['--json', '--out', '--force', '--base-url', '--session'],
|
|
28
29
|
};
|
|
29
30
|
function rejectUnknownFlags(command, args) {
|
|
30
31
|
const known = exports.KNOWN_FLAGS[command];
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":";;;AA0BA,gDAQC;AAlCD,sGAAsG;AACzF,QAAA,WAAW,GAAsC;IAC5D,KAAK,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;IAC7D,IAAI,EAAE;QACJ,SAAS;QACT,OAAO;QACP,aAAa;QACb,eAAe;QACf,WAAW;QACX,cAAc;QACd,cAAc;QACd,QAAQ;QACR,eAAe;QACf,qBAAqB;QACrB,QAAQ;QACR,QAAQ;QACR,UAAU;QACV,QAAQ;KACT;IACD,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC;IACvC,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC9B,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC;IAC1C,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,uBAAuB,CAAC;IAC1F,SAAS,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,CAAC;CACrE,CAAC;AAEF,SAAgB,kBAAkB,CAAC,OAAe,EAAE,IAAc;IAChE,MAAM,KAAK,GAAG,mBAAW,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QACjC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,SAAS;QAChC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,OAAO,kDAAkD,CAAC,CAAC;IACxH,CAAC;AACH,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
declare const HELP = "ia-qa-discover \u2014 deterministic surface reconnaissance for a web app\n\nF1 of QA Discovery: crawl an app's same-origin pages and capture what each one\nis structurally about \u2014 title, headings, forms, and observed API calls. No\nLLM, no verdict: this is recon, not a gate. Runs entirely on your machine;\nnothing is uploaded anywhere.\n\n[FOR AI AGENTS] You are driving this for a human. Run `scan` to capture the\napp's surface, then read .ia-qa-discovery/capture/surface.json (the index) and\nthe per-page files it points at \u2014 that is the evidence for anything you\nreport about this app. Never assert a page's purpose or risk from the URL\nalone; ground it in the captured meta/headings/forms/apiCalls. Never read a\npage count as coverage: if scan warns that pages still show a login form, you\nmeasured the wall, not the app. You CANNOT run `login` \u2014 it waits for a human\nat a browser; ask them to run it, then scan again.\n`coverage` answers \"what does their suite NOT test\" \u2014 but only from a suite that was\nwatched running (one `ia-qa-heal run`, or one `ia-qa-pal tour --suite`). If it says there is no\nmeasurement, report that, never \"the suite covers nothing\": a contract means someone\nconfigured a page, only a watched run means a test went there.\n\nUsage:\n ia-qa-discover login Open a visible browser, log in by hand, keep the\n session (.ia-qa-discovery/session.json) for scan\n to reuse. The general answer to a login wall: it\n models nothing, so SSO, MFA, a consent screen or\n a magic link all work \u2014 you do them.\n Needs a terminal, refuses under CI. The file holds\n live cookies: gitignored, stays on this machine.\n Nothing to confirm afterwards: the window is\n watched and the session is saved the moment it\n actually opens the app. Already logged in with\n ia-qa-heal login? You do not need this at all \u2014\n scan picks that session up and says so.\n --wait <s> how long to watch (0 = press Enter)\n --url <path> page to open (default: your baseUrl)\n --session <f> where to write it\n Already have a storageState (a Playwright globalSetup\n writes one)? Skip this verb: point scan at it with\n --session <file> or \"session\" in config.json.\n ia-qa-discover scan [url] Crawl same-origin pages from <url> (or the saved\n baseUrl) and capture each page's structure.\n Writes .ia-qa-discovery/capture/, diffs against\n the previous run, appends history.jsonl.\n --depth <n> crawl link-depth (default 2)\n --max <n> page cap (default 60)\n --deep also open menus, tabs and dialogs one level\n down and capture the fields they reveal. Every\n non-GET request is blocked for the duration,\n so a click cannot mutate anything server-side.\n --deep-budget <n> max controls clicked per page (default 60)\n --no-sitemap do not read sitemap.xml / robots.txt\n --no-reveal do not open menus/dropdowns for hidden links\n --strict-host treat www./apex as different hosts\n --session <file> reuse an existing storageState (login) file\n --no-network skip API/network-call capture this run\n --network-threshold <n> shared-call promotion threshold 0-1 (default 0.6)\n --save persist this baseUrl to config.json\n --json machine-readable summary on stdout\n --report [file.html] branded ia-qa.com HTML dossier of the\n app (default ia-qa-discover-report.html)\n --open open that report in the browser\n ia-qa-discover coverage What your test suite does NOT test. Compares the\n pages this scan found against the pages your suite\n was OBSERVED visiting, ranks the gap by what each\n page takes as input, and writes coverage-map.json.\n Reads local files only \u2014 no browser, no network.\n Needs one watched run of your suite \u2014\n \"ia-qa-heal run\" or \"ia-qa-pal tour --suite\":\n without a watched run there is no measurement, and\n it says so instead of showing a number.\n Declare pages you deliberately do not test in\n \"outOfScope\" in config.json \u2014 they stay counted\n and named, never silently dropped.\n --json machine-readable map on stdout\n --report [file.html] branded HTML dossier with the gap\n (default ia-qa-discover-coverage.html)\n --open open that report in the browser\n ia-qa-discover generate [page\u2026] A starting Playwright suite for the pages nothing\n tests \u2014 one file per page, into its own directory.\n Every locator names an element the healing contract\n holds, so the file is REPAIRED when the app moves\n instead of going red. A field with no test id, id or\n name is left out and says so: its selector would be\n positional, which nobody can test reliably.\n Proposals \u2014 nothing is added to your suite, and the\n assertions stay yours (the app declares what it\n accepts, never what it promises).\n With no page, it generates for the coverage gap,\n minus the pages captured as a login wall or an\n error \u2014 those specs would assert a login form or\n a 404 under a feature's name. They are named, and\n naming one generates for it anyway.\n --out <dir> where to write (default\n .ia-qa-discovery/generated/)\n --force replace files already there\n --include-login-walls, --include-error-pages\n generate for those too\n --json machine-readable summary on stdout\n ia-qa-discover skill This CLI's agent instructions: the verb for each\n question, what every refusal means, and what an\n agent must never do. Read them before driving\n anything else here.\n --print write them to stdout and stop\n --install write .claude/skills/ia-qa-discover/\n --user into ~/ instead of this project\n --dir <d> into another project root\n --force overwrite an edited copy\n ia-qa-discover history Recorded scan runs \u2014 pages/forms/API-surface trend.\n --json --limit <n> (default 500)\n ia-qa-discover version Print the installed version (also --version, -v)\n ia-qa-discover help Show this help\n\nGlobal:\n --config <dir> Resolve .ia-qa-discovery/ under <dir> instead of the\n current directory. Also IAQA_DISCOVERY_CONFIG_DIR=<dir>.\n";
|
|
2
|
+
declare const HELP = "ia-qa-discover \u2014 deterministic surface reconnaissance for a web app\n\nF1 of QA Discovery: crawl an app's same-origin pages and capture what each one\nis structurally about \u2014 title, headings, forms, and observed API calls. No\nLLM, no verdict: this is recon, not a gate. Runs entirely on your machine;\nnothing is uploaded anywhere.\n\n[FOR AI AGENTS] You are driving this for a human. Run `scan` to capture the\napp's surface, then read .ia-qa-discovery/capture/surface.json (the index) and\nthe per-page files it points at \u2014 that is the evidence for anything you\nreport about this app. Never assert a page's purpose or risk from the URL\nalone; ground it in the captured meta/headings/forms/apiCalls. Never read a\npage count as coverage: if scan warns that pages still show a login form, you\nmeasured the wall, not the app. You CANNOT run `login` \u2014 it waits for a human\nat a browser; ask them to run it, then scan again.\n`coverage` answers \"what does their suite NOT test\" \u2014 but only from a suite that was\nwatched running (one `ia-qa-heal run`, or one `ia-qa-pal tour --suite`). If it says there is no\nmeasurement, report that, never \"the suite covers nothing\": a contract means someone\nconfigured a page, only a watched run means a test went there.\n\nUsage:\n ia-qa-discover login Open a visible browser, log in by hand, keep the\n session (.ia-qa-discovery/session.json) for scan\n to reuse. The general answer to a login wall: it\n models nothing, so SSO, MFA, a consent screen or\n a magic link all work \u2014 you do them.\n Needs a terminal, refuses under CI. The file holds\n live cookies: gitignored, stays on this machine.\n Nothing to confirm afterwards: the window is\n watched and the session is saved the moment it\n actually opens the app. Already logged in with\n ia-qa-heal login? You do not need this at all \u2014\n scan picks that session up and says so.\n --wait <s> how long to watch (0 = press Enter)\n --url <path> page to open (default: your baseUrl)\n --session <f> where to write it\n Already have a storageState (a Playwright globalSetup\n writes one)? Skip this verb: point scan at it with\n --session <file> or \"session\" in config.json.\n ia-qa-discover scan [url] Crawl same-origin pages from <url> (or the saved\n baseUrl) and capture each page's structure.\n Writes .ia-qa-discovery/capture/, diffs against\n the previous run, appends history.jsonl.\n --depth <n> crawl link-depth (default 2)\n --max <n> page cap (default 60)\n --deep also open menus, tabs and dialogs one level\n down and capture the fields they reveal. Every\n non-GET request is blocked for the duration,\n so a click cannot mutate anything server-side.\n --deep-budget <n> max controls clicked per page (default 60)\n --no-sitemap do not read sitemap.xml / robots.txt\n --no-reveal do not open menus/dropdowns for hidden links\n --strict-host treat www./apex as different hosts\n --session <file> reuse an existing storageState (login) file\n --no-network skip API/network-call capture this run\n --network-threshold <n> shared-call promotion threshold 0-1 (default 0.6)\n --save persist this baseUrl to config.json\n --json machine-readable summary on stdout\n --report [file.html] branded ia-qa.com HTML dossier of the\n app (default ia-qa-discover-report.html)\n --open open that report in the browser\n ia-qa-discover coverage What your test suite does NOT test. Compares the\n pages this scan found against the pages your suite\n was OBSERVED visiting, ranks the gap by what each\n page takes as input, and writes coverage-map.json.\n Reads local files only \u2014 no browser, no network.\n Needs one watched run of your suite \u2014\n \"ia-qa-heal run\" or \"ia-qa-pal tour --suite\":\n without a watched run there is no measurement, and\n it says so instead of showing a number.\n Declare pages you deliberately do not test in\n \"outOfScope\" in config.json \u2014 they stay counted\n and named, never silently dropped.\n --json machine-readable map on stdout\n --report [file.html] branded HTML dossier with the gap\n (default ia-qa-discover-coverage.html)\n --open open that report in the browser\n ia-qa-discover generate [page\u2026] A starting Playwright suite for the pages nothing\n tests \u2014 one file per page, into its own directory.\n Every locator names an element the healing contract\n holds, so the file is REPAIRED when the app moves\n instead of going red. A field with no test id, id or\n name is left out and says so: its selector would be\n positional, which nobody can test reliably.\n Proposals \u2014 nothing is added to your suite, and the\n assertions stay yours (the app declares what it\n accepts, never what it promises).\n With no page, it generates for the coverage gap,\n minus the pages captured as a login wall or an\n error \u2014 those specs would assert a login form or\n a 404 under a feature's name. They are named, and\n naming one generates for it anyway.\n --out <dir> where to write (default\n .ia-qa-discovery/generated/)\n --force replace files already there\n --include-login-walls, --include-error-pages\n generate for those too\n --json machine-readable summary on stdout\n ia-qa-discover scenarios [dir|file] Validated Gherkin scenarios in, proven Playwright tests\n out (default dir: scenarios/). Each step is bound to\n the ONE element Playwright counts for it on the live\n page \u2014 none or several is a question for you, never\n a guess. A test is \"proven\" when it passes twice in\n fresh browsers AND fails when what each check reads\n is altered on the page; one that stays green is\n reported blind. @draft scenarios are not run.\n Steps: I open / click / fill \u2026 with / select \u2026 in /\n choose / check / see / don't see / the URL contains\n (French: j'ouvre, je clique sur, je vois\u2026).\n Local: a browser on this machine, no model, nothing\n sent. One spec per feature, never overwritten\n without --force.\n --base-url <url> resolves \"I open \"/path\"\" (default:\n config.json baseUrl)\n --session <f> a storageState for an app behind a login\n (default: the one scan would use,\n ia-qa-heal login's included)\n --out <dir> where to write (default\n .ia-qa-discovery/generated/)\n --force replace a spec that differs\n --json machine-readable report on stdout\n ia-qa-discover skill This CLI's agent instructions: the verb for each\n question, what every refusal means, and what an\n agent must never do. Read them before driving\n anything else here.\n --print write them to stdout and stop\n --install write .claude/skills/ia-qa-discover/\n --user into ~/ instead of this project\n --dir <d> into another project root\n --force overwrite an edited copy\n ia-qa-discover history Recorded scan runs \u2014 pages/forms/API-surface trend.\n --json --limit <n> (default 500)\n ia-qa-discover version Print the installed version (also --version, -v)\n ia-qa-discover help Show this help\n\nGlobal:\n --config <dir> Resolve .ia-qa-discovery/ under <dir> instead of the\n current directory. Also IAQA_DISCOVERY_CONFIG_DIR=<dir>.\n";
|
|
3
3
|
declare function verbHelp(command: string | undefined): string | null;
|
|
4
4
|
declare function main(): Promise<void>;
|
|
5
5
|
export { HELP, verbHelp, main };
|
package/dist/cli/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const history_1 = require("./history");
|
|
|
12
12
|
const coverage_1 = require("./coverage");
|
|
13
13
|
const generate_1 = require("./generate");
|
|
14
14
|
const skill_1 = require("./skill");
|
|
15
|
+
const scenarios_1 = require("./scenarios");
|
|
15
16
|
// dist/cli/ → package root; npm ships package.json in every tarball.
|
|
16
17
|
const VERSION = require('../../package.json').version;
|
|
17
18
|
const HELP = `ia-qa-discover — deterministic surface reconnaissance for a web app
|
|
@@ -112,7 +113,30 @@ Usage:
|
|
|
112
113
|
--include-login-walls, --include-error-pages
|
|
113
114
|
generate for those too
|
|
114
115
|
--json machine-readable summary on stdout
|
|
115
|
-
ia-qa-discover
|
|
116
|
+
ia-qa-discover scenarios [dir|file] Validated Gherkin scenarios in, proven Playwright tests
|
|
117
|
+
out (default dir: scenarios/). Each step is bound to
|
|
118
|
+
the ONE element Playwright counts for it on the live
|
|
119
|
+
page — none or several is a question for you, never
|
|
120
|
+
a guess. A test is "proven" when it passes twice in
|
|
121
|
+
fresh browsers AND fails when what each check reads
|
|
122
|
+
is altered on the page; one that stays green is
|
|
123
|
+
reported blind. @draft scenarios are not run.
|
|
124
|
+
Steps: I open / click / fill … with / select … in /
|
|
125
|
+
choose / check / see / don't see / the URL contains
|
|
126
|
+
(French: j'ouvre, je clique sur, je vois…).
|
|
127
|
+
Local: a browser on this machine, no model, nothing
|
|
128
|
+
sent. One spec per feature, never overwritten
|
|
129
|
+
without --force.
|
|
130
|
+
--base-url <url> resolves "I open "/path"" (default:
|
|
131
|
+
config.json baseUrl)
|
|
132
|
+
--session <f> a storageState for an app behind a login
|
|
133
|
+
(default: the one scan would use,
|
|
134
|
+
ia-qa-heal login's included)
|
|
135
|
+
--out <dir> where to write (default
|
|
136
|
+
.ia-qa-discovery/generated/)
|
|
137
|
+
--force replace a spec that differs
|
|
138
|
+
--json machine-readable report on stdout
|
|
139
|
+
ia-qa-discover skill This CLI's agent instructions: the verb for each
|
|
116
140
|
question, what every refusal means, and what an
|
|
117
141
|
agent must never do. Read them before driving
|
|
118
142
|
anything else here.
|
|
@@ -199,6 +223,9 @@ async function main() {
|
|
|
199
223
|
case 'generate':
|
|
200
224
|
await (0, generate_1.runGenerate)(rest);
|
|
201
225
|
break;
|
|
226
|
+
case 'scenarios':
|
|
227
|
+
await (0, scenarios_1.runScenarios)(rest);
|
|
228
|
+
break;
|
|
202
229
|
case 'history':
|
|
203
230
|
await (0, history_1.runHistory)(rest);
|
|
204
231
|
break;
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;AAyQe,4BAAQ;AAAE,oBAAI;AAxQ7B,sCAAuC;AACvC,iCAAyD;AACzD,iCAAiC;AACjC,mCAAmC;AACnC,uCAAuC;AACvC,yCAAyC;AACz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,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,SAAS;YACZ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,MAAM;QACR;YACE,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,SAAS,IAAI,EAAE,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM;IAAE,GAAG,EAAE,CAAC;AAEnC,SAAS,GAAG;IACV,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QAC5B,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runScenarios(args: string[]): Promise<void>;
|
|
@@ -0,0 +1,142 @@
|
|
|
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.runScenarios = runScenarios;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const config_1 = require("../config");
|
|
39
|
+
const run_1 = require("../scenarios/run");
|
|
40
|
+
const generate_1 = require("./generate");
|
|
41
|
+
/**
|
|
42
|
+
* `ia-qa-discover scenarios [dir|file]` — validated Gherkin scenarios in, proven Playwright tests out.
|
|
43
|
+
*
|
|
44
|
+
* The person decides WHAT is tested and what the page should show; this verb decides HOW:
|
|
45
|
+
* which element each step means (counted on the live page), the code, and whether the test
|
|
46
|
+
* can actually fail. A scenario tagged `@draft` is not validated and is not run.
|
|
47
|
+
*
|
|
48
|
+
* Every scenario ends in exactly one column of the report, including the ones nothing could
|
|
49
|
+
* be written for — a scenario that silently produced no test would read as covered.
|
|
50
|
+
*/
|
|
51
|
+
const TITLE = {
|
|
52
|
+
proven: '✅ Proven — green twice, and red when what it checks is altered',
|
|
53
|
+
blind: '🙈 Blind — runs green, but a check stays green when its target changes',
|
|
54
|
+
unverified: '❔ Not proven — the page undid the alteration, so whether the check can fail is unknown',
|
|
55
|
+
flaky: '🎲 Flaky — passed, then failed on a replay',
|
|
56
|
+
failing: '❌ Fails on the app as it is now — either the app or the scenario is wrong, and only you can say which',
|
|
57
|
+
'needs-input': '✋ Needs you — a step the page cannot answer on its own',
|
|
58
|
+
'not-run': '⏸ Not run',
|
|
59
|
+
};
|
|
60
|
+
function takeValue(args, flag) {
|
|
61
|
+
const at = args.indexOf(flag);
|
|
62
|
+
if (at === -1)
|
|
63
|
+
return { rest: args };
|
|
64
|
+
const value = args[at + 1];
|
|
65
|
+
if (value === undefined || value.startsWith('-'))
|
|
66
|
+
throw new Error(`${flag} needs a value.`);
|
|
67
|
+
return { value, rest: [...args.slice(0, at), ...args.slice(at + 2)] };
|
|
68
|
+
}
|
|
69
|
+
async function runScenarios(args) {
|
|
70
|
+
const json = args.includes('--json');
|
|
71
|
+
const force = args.includes('--force');
|
|
72
|
+
let rest = args.filter((a) => a !== '--json' && a !== '--force');
|
|
73
|
+
const base = takeValue(rest, '--base-url');
|
|
74
|
+
const out = takeValue(base.rest, '--out');
|
|
75
|
+
const session = takeValue(out.rest, '--session');
|
|
76
|
+
rest = session.rest;
|
|
77
|
+
const outDir = out.value ? path.resolve(process.cwd(), out.value) : (0, generate_1.generatedDir)();
|
|
78
|
+
const named = rest.filter((a) => !a.startsWith('-'));
|
|
79
|
+
const source = path.resolve(process.cwd(), named[0] ?? path.join((0, config_1.baseDir)(), 'scenarios'));
|
|
80
|
+
const log = json ? (s) => console.error(s) : (s) => console.log(s);
|
|
81
|
+
log(`\n🧪 Scenarios from ${path.relative(process.cwd(), source) || source}`);
|
|
82
|
+
log(` Each one is run in a real browser on this machine; nothing is sent anywhere else.`);
|
|
83
|
+
const run = await (0, run_1.runScenarioSuite)({ source, outDir, baseUrl: base.value, session: session.value, force, onProgress: log });
|
|
84
|
+
if (!run.ran) {
|
|
85
|
+
process.exitCode = 2;
|
|
86
|
+
if (json)
|
|
87
|
+
console.log(JSON.stringify(run, null, 2));
|
|
88
|
+
else
|
|
89
|
+
console.log(`\nℹ️ ${run.reason}\n\n${(run.help ?? []).map((h) => ` ${h}`).join('\n')}`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (run.session)
|
|
93
|
+
log(` Session: ${run.session}${run.sessionSource === 'healing' ? ' (saved by ia-qa-heal login)' : ''}`);
|
|
94
|
+
const reach = (0, generate_1.healingReach)(outDir);
|
|
95
|
+
if (json) {
|
|
96
|
+
console.log(JSON.stringify({ ...run, healingCanRepair: reach.covered }, null, 2));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
printReport(run.features, reach);
|
|
100
|
+
}
|
|
101
|
+
function printReport(reports, reach) {
|
|
102
|
+
const all = reports.flatMap((r) => r.results.map((res) => ({ file: r.file, res })));
|
|
103
|
+
const counts = run_1.STATUS_ORDER.map((s) => [s, all.filter((a) => a.res.status === s).length]).filter(([, n]) => n > 0);
|
|
104
|
+
console.log(`\n ${counts.map(([s, n]) => `${n} ${s}`).join(' · ')}`);
|
|
105
|
+
for (const status of run_1.STATUS_ORDER) {
|
|
106
|
+
const rows = all.filter((a) => a.res.status === status);
|
|
107
|
+
if (rows.length === 0)
|
|
108
|
+
continue;
|
|
109
|
+
console.log(`\n${TITLE[status]}`);
|
|
110
|
+
for (const { file, res } of rows) {
|
|
111
|
+
console.log(` · ${res.name} (${file}:${res.line})`);
|
|
112
|
+
if (res.step)
|
|
113
|
+
console.log(` step ${res.step.line}: ${res.step.text}`);
|
|
114
|
+
if (res.reason && status !== 'proven')
|
|
115
|
+
console.log(` ${res.reason}`);
|
|
116
|
+
for (const b of res.blind ?? [])
|
|
117
|
+
console.log(` line ${b.line} "${b.text}": ${b.why}`);
|
|
118
|
+
if (res.candidates?.length)
|
|
119
|
+
console.log(` the page shows: ${res.candidates.join(', ')}`);
|
|
120
|
+
for (const a of res.also ?? [])
|
|
121
|
+
console.log(` and ${a}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const specs = reports.filter((r) => r.spec);
|
|
125
|
+
if (specs.length > 0) {
|
|
126
|
+
console.log('');
|
|
127
|
+
for (const r of specs) {
|
|
128
|
+
const s = r.spec;
|
|
129
|
+
const what = s.state === 'written' ? 'written' : s.state === 'unchanged' ? 'unchanged' : 'left untouched (it differs; --force to replace)';
|
|
130
|
+
console.log(` 📄 ${s.file} — ${what}`);
|
|
131
|
+
}
|
|
132
|
+
if (!reach.covered) {
|
|
133
|
+
console.log(`\n ⚠ ia-qa-heal cannot see these files, so it will not repair them when the app moves.\n` +
|
|
134
|
+
` ${reach.why}\n` +
|
|
135
|
+
` Write them where your suite lives (--out <dir under your testPaths>), or add this\n` +
|
|
136
|
+
` directory to "testPaths" in .ia-qa/config.json and run: ia-qa-heal ingest`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
console.log(`\n These tests are proposals: nothing was added to your suite. Proven means the test can\n` +
|
|
140
|
+
` fail when what it checks changes; it does not mean the scenario asks the right question.`);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.js","sourceRoot":"","sources":["../../src/cli/scenarios.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,oCA+BC;AAlED,2CAA6B;AAC7B,sCAAoC;AACpC,0CAAsF;AAEtF,yCAAwD;AAExD;;;;;;;;;GASG;AAEH,MAAM,KAAK,GAAmC;IAC5C,MAAM,EAAE,gEAAgE;IACxE,KAAK,EAAE,wEAAwE;IAC/E,UAAU,EAAE,wFAAwF;IACpG,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,uGAAuG;IAChH,aAAa,EAAE,wDAAwD;IACvE,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,SAAS,SAAS,CAAC,IAAc,EAA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|
process.exitCode = 2;
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
|
-
if (!
|
|
151
|
+
if (!(0, self_healing_1.declaredModel)(ai)) {
|
|
152
152
|
console.error(`❌ ai.model is required — pin one, so two runs are comparable. See \`ia-qa-discover-ai models\`.`);
|
|
153
153
|
process.exitCode = 2;
|
|
154
154
|
return null;
|
|
@@ -225,7 +225,9 @@ async function resolveAi() {
|
|
|
225
225
|
}
|
|
226
226
|
/** The `ai` block as declared — read for a dry run, where no key is resolved. */
|
|
227
227
|
function declaredAi() {
|
|
228
|
-
|
|
228
|
+
const ai = ((0, config_1.configExists)() ? (0, config_1.loadConfig)().ai : undefined) ?? {};
|
|
229
|
+
// The model the call will really reach (an Azure Target URI names its deployment), so a preview names it too.
|
|
230
|
+
return { ...ai, model: (0, self_healing_1.declaredModel)(ai) };
|
|
229
231
|
}
|
|
230
232
|
/**
|
|
231
233
|
* `--dry-run --json`: every prompt exactly as the real call would send it, the host, and no call.
|