kwikqa 0.8.1 → 0.10.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/CHANGELOG.md CHANGED
@@ -2,6 +2,46 @@
2
2
 
3
3
  What's new in each release of the KwikQA CLI.
4
4
 
5
+ ## 0.10.0 — 2026-11-22
6
+
7
+ ### Changed
8
+
9
+ - Plans are priced per account or organization, not per seat (KQA-145). `kwikqa upgrade` lists each plan's monthly price and its yearly price with its rate a month, and the organization's shared pool on Teams and Enterprise. Enterprise is arranged with KwikQA's sales, so `upgrade enterprise` says where to write instead of opening checkout. `--seats` is no longer used: it's accepted and ignored with a note, so scripts keep working. `status` no longer shows seats.
10
+ - In CI, KwikQA no longer sends the pull request's author with its requests. Plans have no seats, so the service doesn't count people.
11
+ - A CI job past the plan's concurrent CI jobs waits for a free slot instead of leaving the run undiagnosed at once. It waits as long as the service asks, plus up to 4 seconds, and says so in the job's log, for up to `KWIKQA_CI_WAIT_SECONDS` (600 by default; `0` doesn't wait). Past that, the run isn't diagnosed, as before.
12
+ - When a company member reaches the month's limit, KwikQA suggests asking an admin about a top-up pack or a bigger plan, not seats.
13
+
14
+ ### Fixed
15
+
16
+ - A cancelled command (Ctrl-C, or a CI job cancelled by a newer push) closes the analysis or repair session it has open before it ends. The session used to stay open until it expired 30 minutes later, holding one of the plan's concurrent CI jobs, and an analysis or fix that got no answer came back only then. The command waits up to 3 seconds for the service, then ends as the signal would have ended it (KQA-145).
17
+
18
+ ## 0.9.0 — 2026-11-21
19
+
20
+ ### Changed
21
+
22
+ - Change evidence also finds a commit or an uncommitted edit that changes one value of a data record the failure names, such as a sample project's revision date two fields below its `name: "Apollo"`. Its changed line names nothing the failure is about, so the search used to miss it, and the diagnosis could only leave the owner undetermined. Such a hunk says which line of its record it was found through, and only a change of a single value inside a bounded record counts, never a change merely near a failure term. The diagnosis prompt (1.7) treats it as evidence only when the changed value itself produces the failure. The change search also reads CSV, TSV, SQL, XML, and JSON Lines files.
23
+ - The change search also looks for what the failing line and the three lines before it locate, such as the `cy.contains("a", "Apollo")` or `$("a=Apollo")` that opened the page a failed assertion was on, or the `page.locator("#dirtyFields")` a polled value was read from. A Cypress or WebdriverIO error names only the element it failed on, and an assertion on a value names no element at all, so these failures were searched for with fewer terms or none. A text selector (`a=Apollo`, `*=Apollo`, `text=Apollo`) is searched for by the text it finds.
24
+ - KwikQA names the application as the owner only when a runtime fault in the failing attempt shows it: a server error (5xx) response, or an uncaught exception or crash. A change that breaks what the test checks is not enough by itself, because a commit can't tell an intended change from a regression. When a diagnosis names the application without citing such a fault, KwikQA withholds that owner after grading: the owner is undetermined, the output says "leans application", and the diagnosis keeps its statement, evidence, and next steps. `kwikqa check` still fails a test change when the diagnosis leans toward the application: a withheld owner, or an undetermined one whose likeliest cause is an application regression. The diagnosis prompt doesn't change for this. On real projects' intended changes (held-out ReproBreak cases), 0.8.1 blamed the application in 4 of 22 runs.
25
+ - When a failure names nothing to search for, such as a regex assertion on a positional selector, the change search still lists the recent commits' subjects.
26
+ - The evidence says plainly how uncommitted changes reach the diagnosis. KwikQA never sends the whole uncommitted diff. The change search reads uncommitted changes, with the recent commits, for hunks that mention the failure. But the packet said only "Current-diff selection was not authorized for this run", next to the change search's "Searched uncommitted changes". Diagnoses read that as uncommitted changes left unchecked. In 453 of 541 diagnoses on KwikLabs and the held-out dev cases, the model listed them as missing evidence. Some then held back a repair until someone would "authorize current-diff selection", which no KwikQA command does. The packet now says that the whole diff isn't sent and that the change search covers uncommitted changes that mention the failure, or that the change search was off.
27
+
28
+ ### Fixed
29
+
30
+ - A Playwright run that stopped at its failure limit (`maxFailures`, `--max-failures`, `-x`) is diagnosed from the failures it finished. KwikQA refused it as `inconclusive (interrupted-run)` without saying why, because the limit cuts off the tests still running. Those tests have no result, and the diagnosis is told they aren't known to pass. A run stopped by `globalTimeout`, Ctrl-C or a cancelled job is still refused, and the message now names which; a `globalTimeout` used to be reported as a run error. `analyze --capture` and validation run with `--max-failures=0`, so a project's limit no longer cuts KwikQA's own runs short (KQA-144).
31
+ - A repair proposal was sometimes declined after the model call because one of its edits cited evidence the accepted diagnosis doesn't rest on, such as the test excerpt being edited. The repair prompt (1.4) now says what KwikQA's proposal check has always required: every edit, like the stated intent, cites only the accepted hypothesis's supporting evidence. The check itself is unchanged, and its message now names the evidence an edit cited outside that set. Found in the KwikLabs benchmark, where Playwright `assertion.text_changed` was diagnosed right and its repair declined in about 1 of 4 runs, on 0.8.1's prompt as on later builds.
32
+ - Test source with TypeScript or JavaScript decorators is read. A page object whose methods carry a `@step` decorator, which wraps each one in `test.step`, failed to parse, so its source and the helpers it imports never reached the diagnosis. Standard decorators and TypeScript's `experimentalDecorators` (parameter decorators such as `@Inject(TOKEN)`) are both read. A file without decorators is parsed exactly as before.
33
+ - `analyze --capture` and `fix`'s validation run Cypress from the project's own folder when its config sits in a subfolder. A project that keeps `test/cypress.config.ts`, with paths relative to the repository root, and runs `cypress run --config-file test/cypress.config.ts` from there (Angular-Slickgrid does) got "no spec files were found". So the diagnosis had no page evidence, and a repair couldn't be validated. KwikQA now takes the folder under which the failing spec matches the config's `specPattern`, and loads the support file from it. Tests and errors in the capture report are filed under the spec's own path, so a rerun's failure matches the original one.
34
+ - `kwikqa init` proposes rules that name the project's own specs. It proposed `tests/**/*.ts` for a project whose specs are in `test/` (which that rule doesn't match), and only TypeScript rules for JavaScript specs, so `fix` could never repair them. Now each proposed rule names files the repository has, as the Java and pytest rules already did. A spec no rule covers, named as Playwright (`.spec`, `.test`) or Cypress (`.cy`) name theirs, gets a rule for its folder, naming, and extension, such as `test/**/*.cy.ts` or `e2e/**/*.cy.js`. A `kwikqa.config.json` already written isn't changed: add the rule to it.
35
+ - When no file in the evidence may be edited, `fix` names those files and says what makes a file editable.
36
+ - `fix` lints a repair with the repository's own ESLint wherever the repository configures ESLint. Validation only knew four of ESLint's config names (`eslint.config.js`, `.mjs`, `.cjs`, and `.eslintrc.json`), and only in the folder KwikQA runs from. So a repair skipped lint in a repository that keeps `.eslintrc.js`, `.eslintrc.cjs`, a YAML or bare `.eslintrc`, `eslintConfig` in package.json, or a TypeScript `eslint.config.ts`, and in a monorepo package whose config is at the repository root. KwikQA now knows every name ESLint reads and looks for it as ESLint does, from its folder up to the repository root, never above. It runs the config the way that repository's ESLint reads it: an eslintrc config on ESLint 9 with `ESLINT_USE_FLAT_CONFIG=false`, as ESLint documents. On ESLint 10, which no longer reads eslintrc, an eslintrc config adds no lint check. On 27 real projects' failing specs, the repositories' own ESLint (8.8 to 9.39) passed every one before any edit, and KwikQA lints all 27 now, against 12 before.
37
+ - `fix` tries first a failure group whose diagnosis allows a repair. It ranked test-owned groups by the strength of their diagnosis and their size, so a large group whose diagnosis left repair undetermined came first. A fix that tries one group (without a repair session, on a retry, or in a CI run of one group per call) then repaired nothing, although a smaller group's diagnosis was eligible. Found on a real project's held-out case, react-hook-form #13363. In 12 of 148 analyses with two or more test-owned groups in KwikLabs and the held-out dev cases, a repairable group was ranked behind one that wasn't. The repairable group also leads `analyze`'s numbering.
38
+ - `fix` no longer asks for, and pays for, a repair proposal that its own check would then refuse. A diagnosis can name ownership evidence that its accepted hypothesis doesn't cite as support. The proposal check has always refused a repair resting on such a diagnosis, but only after the paid repair request. That diagnosis is now refused before the request, and `fix` moves on to the next group.
39
+ - When `fix` tries several failure groups and more than one falls back, the message gives each group's outcome once. It used to repeat the earlier groups' outcomes inside the next one's, as in "Failure group 3: Failure group 1: …".
40
+ - A failed Cypress `contains` chained off a query, such as `cy.get('.row > .cell:nth(3)').contains(/20\d\d-/)`, gets DOM evidence for the element it searched, with that element's text. KwikQA took the `contains` argument as the locator, so the diagnosis was told that a RegExp "uses a selector form the local DOM adapter does not evaluate" and was shown the page's links instead. Now the failure capture records which commands were chained off another, and a `contains` chained off a subject, or given a RegExp, leaves that subject as the failing element. The DOM evidence also evaluates jQuery's positional selectors, which `cy.get` accepts (`:first`, `:last`, `:eq(n)`, and its alias `:nth(n)`), by position in the whole matched set, as jQuery does. Found on a real project's held-out case (Angular-Slickgrid).
41
+ - `validate` says why a repair failed validation. It said only "Validation did not pass, so the patch was rolled back". Now it names what failed: the repaired test, with its first error and line after the patch; other tests that newly fail; or a required static check. A repair can fix the assertion that failed and leave a later one in the same test, which the first failure hid. Cypress stops a test at its first failed assertion, and on a real project's held-out case (react-hook-form #13363) the repaired test then failed two lines further down. The message shows that, which is what makes the offered retry worth taking.
42
+ - Playwright JSON reports from before 1.51 are read. KwikQA refused them as unreadable: they have no `parallelIndex` on each result (Playwright writes it from 1.51.0), and before 1.39 no run totals (`stats`). A missing `parallelIndex` now takes the result's `workerIndex`, which KwikQA only carries through. Missing totals are counted from the results, and the run starts at its earliest result, with a `run-stats-derived` warning. Real runs of Playwright 1.38.1 and 1.50.1 are now tested, and the README states the oldest version: Playwright Test 1.38 or later. A report from an older Playwright that can't be read says so, and names that minimum.
43
+ - `fix` validates repairs in repositories that lint with ESLint 8 or later. When a repository has an `eslint.config.js`, `.mjs`, or `.cjs`, or an `.eslintrc.json`, and no Biome config, validation runs the repository's own ESLint on the repaired files, and KwikQA couldn't find it: since 8.0, ESLint's package `exports` hide `bin/eslint.js`, the file KwikQA asked for. So every repair there stopped at "Required eslint check could not be resolved locally" and was never validated. KwikQA now finds ESLint's CLI through the package's declared `eslint` bin, as it already did for Cypress, WebdriverIO, and TypeScript 7. Found on real projects using ESLint 8.8 through 9.39, which all resolve now. Repositories that use Biome were not affected.
44
+
5
45
  ## 0.8.1 — 2026-11-17
6
46
 
7
47
  ### Changed
package/README.md CHANGED
@@ -41,8 +41,9 @@ Using pnpm, Yarn, or Bun? See [Package managers and monorepos](#package-managers
41
41
  ## Requirements
42
42
 
43
43
  - Node.js 22, 24, 26, or later: any release of the long-term support lines, each tested in CI at its first and latest release
44
- - Playwright Test, Cypress, or WebdriverIO (Mocha or Jasmine) installed in your project with npm,
45
- pnpm, Yarn, or Bun. KwikQA runs your project's own copy and never installs packages or browsers.
44
+ - Playwright Test 1.38 or later, Cypress, or WebdriverIO (Mocha or Jasmine) installed in your
45
+ project with npm, pnpm, Yarn, or Bun. KwikQA runs your project's own copy and never installs
46
+ packages or browsers.
46
47
  - A git repository
47
48
 
48
49
  For repairs, KwikQA needs a framework listed under [supported frameworks](#supported-frameworks).
@@ -58,7 +59,9 @@ npx kwikqa login
58
59
  ```
59
60
 
60
61
  `init` proposes a `kwikqa.config.json` that lists which files KwikQA may edit, and offers to add
61
- `.kwikqa/` (local run records) to `.gitignore`. Review and commit the config like any other code.
62
+ `.kwikqa/` (local run records) to `.gitignore`. Each proposed rule names spec files your repository
63
+ has, such as `test/**/*.cy.ts`. Page objects and support files are listed for you to add. Review
64
+ and commit the config like any other code.
62
65
 
63
66
  Then point KwikQA at your runs:
64
67
 
@@ -223,7 +226,7 @@ doesn't. It never runs one from outside the repository, so pnpm's global virtual
223
226
  | `npx kwikqa fix --retry` | After a failed validation, re-diagnose from the new evidence and propose one revised patch. |
224
227
  | `npx kwikqa check` | Check test changes KwikQA didn't write, such as an agent's or Playwright's healer's, with the gates KwikQA's own repairs get. **Scope and policy:** only the test paths the committed `kwikqa.config.json` makes editable, with no skips, `fixme`, fixed waits, retries, forced actions, or removed, swapped, or loosened assertions. **Ownership:** the failing tests the change touches must be diagnosed as the test's fault, by an analysis of the code before the change, so run `analyze` before the agent edits the test. **Validation:** each touched failing test must pass three times in a row with retries off (once, for a shared change in a Maven, Gradle, pytest, or Cucumber-JVM suite), and the static checks must pass; for a change to a shared page object, fixture, or helper, so must every test that uses it, compared with how it did in the analyzed run; it asks before running anything (`--yes` approves). Java and pytest changes get the same gates, validated with the project's own Maven, Gradle, or pytest; a Cucumber-JVM change is validated under Maven or Gradle. Each finding names its file and line. It exits 0 only when every gate passed. After a failed check of uncommitted changes, it offers to put the changed files back as `HEAD` has them, keeping a copy of the change in `.kwikqa/adopted/`; only a yes at the terminal restores anything. `--base <ref>` checks a branch's changes since it left `<ref>`; `--analysis <path>` names the failing run's record. It sends nothing to KwikQA; in CI it publishes its verdict, see [Checking an agent's pull request](#checking-an-agents-pull-request). |
225
228
  | `npx kwikqa status` | Show your plan and this month's usage, and in a company account your role and the team this sign-in counts for. |
226
- | `npx kwikqa upgrade [plan]` | Show plans, or get a checkout link for one. `--annual` bills yearly; `--seats <n>` sets seats on team plans. On a paid plan it points you to Billing in the dashboard. While the paid plans are coming soon, it lists them without a link. |
229
+ | `npx kwikqa upgrade [plan]` | Show plans, or get a checkout link for one. `--annual` bills yearly, for less than monthly. Enterprise is arranged with KwikQA's sales, so it prints where to write. On a paid plan it points you to Billing in the dashboard. While the paid plans are coming soon, it lists them without a link. `--seats` is no longer used: plans have no seats. |
227
230
  | `npx kwikqa billing` | Open Paddle's customer portal to update your payment method or download invoices. |
228
231
  | `npx kwikqa init` / `login` / `logout` | Set up the project, sign in, sign out (`logout` also revokes the token). `login` opens kwikqa.com/device in your browser with the code filled in; `--no-browser` only prints the page and the code. |
229
232
 
@@ -253,21 +256,22 @@ replaces a file it wrote itself, and `init` offers to add `kwikqa-report.html` t
253
256
 
254
257
  ## Plans
255
258
 
256
- | Plan | Monthly | Annual | Analyses / month | Fixes / month |
259
+ | Plan | Monthly | Yearly | Analyses / month | Fixes / month |
257
260
  | --- | --- | --- | --- | --- |
258
261
  | Hobby | $0 | – | 10 | 3 |
259
- | Pro | $29 | $290 | 120 | 30 |
260
- | BYOK | $19 | $190 | 200 | 50 |
261
- | Teams (3+ seats) | $39 / seat | $390 / seat | 150 / seat, pooled | 40 / seat, pooled |
262
- | BYOK Teams (3+ seats) | $29 / seat | $290 / seat | 250 / seat, pooled | 65 / seat, pooled |
263
- | Enterprise (12+ seats) | $69 / seat | $690 / seat | 300 / seat, pooled | 75 / seat, pooled |
264
- | BYOK Enterprise (12+ seats) | $49 / seat | $490 / seat | 500 / seat, pooled | 150 / seat, pooled |
262
+ | Pro | $35 | $348 ($29 / month) | 100 | 25 |
263
+ | BYOK | $25 | $228 ($19 / month) | 200 | 50 |
264
+ | Teams | $179 | $1,788 ($149 / month) | 250, pooled | 65, pooled |
265
+ | BYOK Teams | $149 | $1,428 ($119 / month) | 500, pooled | 150, pooled |
266
+ | Enterprise | – | from $10,788 ($899 / month) | 1,800, pooled | 450, pooled |
267
+ | BYOK Enterprise | – | from $7,788 ($649 / month) | 3,600, pooled | 900, pooled |
265
268
 
266
269
  No plan is unlimited, and `--local` analysis is free on every plan. Hobby analyzes CI runs
267
- locally; Pro and BYOK run hosted analysis in CI on one repository of your own. CI on an
268
- organization's repositories, `ci.fix` beyond your own repository, and Slack and Teams alerts need a
269
- team plan, and a seat is an active committer: each person whose pull request ran KwikQA in CI that
270
- month. The Enterprise plans add single sign-on and SCIM, an audit log, and an
270
+ locally; Pro and BYOK run hosted analysis in CI on repositories of your own. CI on an
271
+ organization's repositories, `ci.fix` beyond your own repositories, and Slack and Teams alerts need
272
+ a company account on Teams or Enterprise, which is priced for the whole organization: there are no
273
+ seats, no repository limit, and KwikQA never counts who opened a pull request. A top-up pack adds
274
+ to a month's pool. The Enterprise plans add single sign-on and SCIM, an audit log, and an
271
275
  [SLA](https://kwikqa.com/sla/). [Plans](https://kwikqa.com/docs/plans/) has the details.
272
276
 
273
277
  One analysis is one diagnosis sent to the AI. One fix is one repair attempt, validated by
@@ -279,7 +283,8 @@ The paid plans are coming soon: until they open, every account uses Hobby, and C
279
283
  plan. Hobby runs hosted analysis, draft pull requests, and Slack and Teams alerts in CI within its
280
284
  monthly limits, and the CI rules above apply once the paid plans open.
281
285
 
282
- Annual billing gives two months free. Cancel within 14 days of your first payment, monthly or
286
+ A year costs less than twelve months billed monthly, up to 24% less. Enterprise is billed yearly and
287
+ arranged with KwikQA's sales. Cancel within 14 days of your first payment, monthly or
283
288
  annual, and it is refunded in full, once in any 12 months. After that, cancelling an annual plan from the dashboard refunds
284
289
  its unused months; monthly plans stay active until the end of the paid month. Payments go through
285
290
  Paddle, the merchant of record.
@@ -757,7 +762,7 @@ Then keep `kwikqa-report.html` as a build artifact.
757
762
  ## Account and billing
758
763
 
759
764
  The dashboard at https://kwikqa.com/dashboard/ shows your plan, usage, and recent requests. There
760
- you can change your plan, seats, or billing period, cancel, manage your team, create and revoke
765
+ you can change your plan or billing period, cancel, manage your team, create and revoke
761
766
  CLI and CI tokens, download your data, or delete your account.
762
767
 
763
768
  ## Support and license
@@ -91,6 +91,8 @@ function brief(attributes) {
91
91
  name: String(attributes.name || ""),
92
92
  ...(attributes.displayName ? { displayName: String(attributes.displayName) } : {}),
93
93
  message: String(message === undefined ? "" : message).slice(0, MAX_TEXT),
94
+ // "child" when the command was chained off another's subject, such as cy.get(...).contains(...).
95
+ ...(attributes.type ? { type: String(attributes.type) } : {}),
94
96
  state: String(attributes.state || ""),
95
97
  ...(attributes.err
96
98
  ? { error: String(attributes.err.message || attributes.err).slice(0, MAX_TEXT) }
@@ -44,7 +44,7 @@ function text(value) {
44
44
  }
45
45
  }
46
46
 
47
- function convertError(err) {
47
+ function convertError(err, inProject = (file) => file) {
48
48
  if (err === undefined || err === null) return undefined;
49
49
  const out = { message: String(err.message !== undefined ? err.message : err) };
50
50
  if (err.name) out.name = String(err.name);
@@ -52,7 +52,7 @@ function convertError(err) {
52
52
  const frame = err.codeFrame;
53
53
  if (frame && (frame.relativeFile || frame.originalFile) && frame.line) {
54
54
  out.location = {
55
- file: String(frame.relativeFile || frame.originalFile),
55
+ file: inProject(String(frame.relativeFile || frame.originalFile)),
56
56
  line: Number(frame.line),
57
57
  column: Number(frame.column || 1),
58
58
  };
@@ -135,11 +135,31 @@ function KwikqaCypressReporter(runner, options) {
135
135
  const specs = new Set();
136
136
  let currentSpec = "";
137
137
  let interrupted = false;
138
+ // Cypress names the spec (`suite.file`) relative to the folder it runs in, but where a test or an
139
+ // error is declared (`relativeFile`) relative to the folder its bundler ran in. Those differ when
140
+ // the project's config sits in a subfolder: Angular-Slickgrid's `test/cypress.config.ts` gives
141
+ // `cypress/e2e/x.cy.ts` for the spec `test/cypress/e2e/x.cy.ts`. A path that names no file here
142
+ // and ends the spec's path takes the spec's; the folder that adds is then tried for other paths.
143
+ let bundlerPrefix = "";
144
+ const existing = new Map();
145
+ const exists = (file) => {
146
+ if (!existing.has(file)) existing.set(file, fs.existsSync(path.resolve(cwd, file)));
147
+ return existing.get(file);
148
+ };
149
+ const inProject = (file) => {
150
+ if (!file || path.isAbsolute(file) || exists(file)) return file;
151
+ if (currentSpec && currentSpec !== file && currentSpec.endsWith(`/${file}`)) {
152
+ bundlerPrefix = currentSpec.slice(0, currentSpec.length - file.length);
153
+ return currentSpec;
154
+ }
155
+ if (bundlerPrefix && exists(bundlerPrefix + file)) return bundlerPrefix + file;
156
+ return file;
157
+ };
138
158
 
139
159
  const recordFor = (test) => {
140
160
  const titlePath = titlePathOf(test);
141
161
  const details = test.invocationDetails || {};
142
- const file = String(details.relativeFile || test.file || currentSpec || "");
162
+ const file = inProject(String(details.relativeFile || test.file || currentSpec || ""));
143
163
  const key = `${file}\u0000${titlePath.join("\u0000")}`;
144
164
  let entry = tests.get(key);
145
165
  if (!entry) {
@@ -179,7 +199,7 @@ function KwikqaCypressReporter(runner, options) {
179
199
  attempt.status = status;
180
200
  attempt.duration =
181
201
  typeof duration === "number" ? duration : Date.now() - Date.parse(attempt.startTime);
182
- const converted = convertError(err);
202
+ const converted = convertError(err, inProject);
183
203
  if (converted) attempt.errors.push(converted);
184
204
  };
185
205
 
@@ -212,7 +232,7 @@ function KwikqaCypressReporter(runner, options) {
212
232
  runner.on("fail", (runnable, err) => {
213
233
  if (runnable && runnable.type === "hook") {
214
234
  const test = runnable.ctx?.currentTest;
215
- const hookError = convertError(err) || { message: "hook failed" };
235
+ const hookError = convertError(err, inProject) || { message: "hook failed" };
216
236
  hookError.message = `${runnable.title}: ${hookError.message}`;
217
237
  if (test) {
218
238
  const entry = recordFor(test);