kwikqa 0.8.1 → 0.9.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 +27 -0
- package/README.md +6 -3
- package/dist/cypress-capture.js +2 -0
- package/dist/cypress-reporter.cjs +25 -5
- package/dist/kwikqa.mjs +155 -148
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
What's new in each release of the KwikQA CLI.
|
|
4
4
|
|
|
5
|
+
## 0.9.0 — 2026-11-21
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- 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.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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.
|
|
12
|
+
- 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.
|
|
13
|
+
- 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.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- 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).
|
|
18
|
+
- 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.
|
|
19
|
+
- 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.
|
|
20
|
+
- `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.
|
|
21
|
+
- `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.
|
|
22
|
+
- When no file in the evidence may be edited, `fix` names those files and says what makes a file editable.
|
|
23
|
+
- `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.
|
|
24
|
+
- `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.
|
|
25
|
+
- `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.
|
|
26
|
+
- 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: …".
|
|
27
|
+
- 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).
|
|
28
|
+
- `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.
|
|
29
|
+
- 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.
|
|
30
|
+
- `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.
|
|
31
|
+
|
|
5
32
|
## 0.8.1 — 2026-11-17
|
|
6
33
|
|
|
7
34
|
### 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
|
|
45
|
-
pnpm, Yarn, or Bun. KwikQA runs your project's own copy and never installs
|
|
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`.
|
|
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
|
|
package/dist/cypress-capture.js
CHANGED
|
@@ -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);
|