@quikit/quikpilot-runner 9.3.0-rc.2 → 9.3.0-rc.20
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 +71 -7
- package/dist/index.js +9716 -6913
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ writing, is waited for first. The checkout is fingerprinted (git status plus a h
|
|
|
52
52
|
before the write and after the restore; whatever the test run itself added (a snapshot file, a tracked file it changed or deleted,
|
|
53
53
|
something it staged) is cleaned up, and if the tree still differs, or git cannot report on it, the whole run ends: no per-file fallback,
|
|
54
54
|
no pull request. A file that was already changed or untracked before the call is never repaired or deleted; the report the baseline run
|
|
55
|
-
left behind is saved and put back.
|
|
55
|
+
left behind is saved and put back. A second attempt (below) refuses to start from a checkout that is not what it was when the loop began.
|
|
56
56
|
The tests run with the same allow-listed environment as every other repository command, in their own process group, with a time limit
|
|
57
57
|
of three times the baseline run (never under 2 minutes, never over 10); a suite whose baseline took over 10 minutes gets no `run_tests`
|
|
58
58
|
and the run record says so. At most three runs; the same failing tests twice in a row is answered `no_progress` and ends the runs. What
|
|
@@ -67,7 +67,7 @@ a few milliseconds) and adds a plain warning to that tool result when the change
|
|
|
67
67
|
declared twice, an `import` that is not at the top of the file, an unterminated string or a stray brace), a name that is not defined or
|
|
68
68
|
imported, or a `const`, `let` or class used higher up in the same function than the line that declares it. The change still applies, so the
|
|
69
69
|
AI can read the file at the reported line and fix it; the warning is a closed phrase and a line number, never file text. If the AI still
|
|
70
|
-
ends with such a file, the
|
|
70
|
+
ends with such a file, the attempt is thrown away and is handled like any other ordinary failure (a second attempt; `syntax_error`
|
|
71
71
|
in the run record). Only what a change *introduces* is reported: a file that already had the problem, or that did not parse before (JSX,
|
|
72
72
|
Flow or decorators in a `.js` file), and TypeScript, JSX and every other language, are left alone; a new file is judged only once the
|
|
73
73
|
project's own files are known to parse, and a name the project's other files already use without defining (a global the build supplies) is
|
|
@@ -101,15 +101,79 @@ TypeScript files; other languages keep the older rule of new text before or afte
|
|
|
101
101
|
(one hop, JavaScript and TypeScript, the same scan and the same limits as the one-file-at-a-time path: 40,000 characters a file
|
|
102
102
|
and 60,000 in all, never a denied path, never the targets themselves), so the project's own names, values and rates are in front
|
|
103
103
|
of it instead of being guessed; the run's context record lists them like the one-file path's. The AI cannot finish before it has
|
|
104
|
-
changed something and written a test for every case it was given. If the loop cannot finish for an ordinary reason (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
retried (
|
|
104
|
+
changed something and written a test for every case it was given. If the loop's first attempt cannot finish for an ordinary reason (a
|
|
105
|
+
timeout, a refused edit it cannot recover from, a cut-short file) everything it held is thrown away and the runner makes ONE more
|
|
106
|
+
attempt of the same loop from a clean start (9.3.0-rc.11, QUIKTR-1544); see "One code-writing path" below. A budget or credential
|
|
107
|
+
refusal from the AI Runtime is never retried (a second attempt would be refused again or paid for twice). A protected path is refused to the AI as an
|
|
108
108
|
ordinary answer, never read, listed or written, and the run carries on. Limits are told to the AI as ordinary answers: 20 turns, 40 actions, 60,000 characters read, 120,000 written, and the
|
|
109
109
|
same 90,000-token ceiling per turn. The callback gains an optional `codegenLoop` record (paths, counts, statuses and the AI's
|
|
110
110
|
short note per step; never file text) that QuikProjects shows as "What QuikPilot did". Without the variable nothing
|
|
111
111
|
changes. The workflow file is unchanged; the `env:` line is the only edit, and it is optional. The AI Runtime must have
|
|
112
|
-
`PILOT_CODEGEN_LOOP_ENABLED` on; while it is off the runner
|
|
112
|
+
`PILOT_CODEGEN_LOOP_ENABLED` on; while it is off (or the runtime does not have the loop at all) the runner writes the files one at a time,
|
|
113
|
+
as before, and says so in the run's warnings. That is the ONE case that still does.
|
|
114
|
+
|
|
115
|
+
**9.3.0-rc.11 — one code-writing path (QUIKTR-1544).** When the loop's first attempt ends without a result (and the AI Runtime has the
|
|
116
|
+
loop), the runner makes ONE more attempt of the same loop, from a clean start (a new in-memory overlay, the same per-attempt limits, three
|
|
117
|
+
`run_tests` runs per attempt, the baseline test run shared), and tells it how the first one ended in `loop.previousAttempt` (needs the AI
|
|
118
|
+
Runtime from the same release): the attempt number, a closed reason word, a short sentence, the last test result the AI saw, and the rule
|
|
119
|
+
words its replies broke. NOTHING NEW LEAVES: only what the AI Runtime already received during this run. The short sentence is built from
|
|
120
|
+
closed words (the ids of the test cases never written, the file the AI itself broke with a fixed phrase and a line number, the AI's own
|
|
121
|
+
summary when it said it could not complete); the names the truncated-rewrite check reads from the original file are never sent. If the
|
|
122
|
+
second attempt ends without a result too, the run FAILS with a plain reason and both attempts in the record; nothing is written and the
|
|
123
|
+
files are not written one at a time. A checkout that did not come back identical ends the run before any second attempt. Both attempts
|
|
124
|
+
share ONE clock of about 30 minutes, test runs included (the pilot job is cut at 45); a second attempt starts only when the time left is at
|
|
125
|
+
least as long as the first took, one run of the project's tests when they are on, and never under 3 minutes. The record keeps the
|
|
126
|
+
attempts and tells a run the clock ended (`out_of_time`) from one where the AI could not do it (`failed`). The log carries
|
|
127
|
+
`codegen.attempt_start`, `codegen.attempt_end` and `codegen.attempt_skipped` lines with counts and closed words only, and the second
|
|
128
|
+
attempt's start says which of the three additions to what it is told it carried (`hasDetail`, `rulesCount`, `hasLastTestRun`).
|
|
129
|
+
|
|
130
|
+
**9.3.0-rc.12 — the early look, and a warning for a field nothing supplies (QUIKTR-1545).** Two additions, both off unless QuikProjects
|
|
131
|
+
and the AI Runtime switch them on, and neither changes a run that does not use them.
|
|
132
|
+
|
|
133
|
+
*The early look (`MODE=investigate`).* Before the first question QuikProjects can dispatch the same workflow with `mode: investigate` and
|
|
134
|
+
`run_id: investigate:<run id>`. This mode is READ-ONLY: it exchanges the OIDC token for a run token whose only scope is
|
|
135
|
+
`pilot:investigate`, fetches a small packet (the person's report, the denied paths, the gateway), checks out the repository, and runs a
|
|
136
|
+
three-tool loop (`list_files`, `grep`, `read_file`) with at most 8 turns, 60 seconds for a turn and 120 seconds in all. It never installs,
|
|
137
|
+
runs the project's tests, commits or pushes. Extra paths are denied on top of the project's own (`**/.npmrc`, `**/*.pem`, `**/*.key`,
|
|
138
|
+
`**/*.tfvars`, `**/*credentials*.json`, `**/docker-compose*`), and everything it reads is scrubbed of secret-shaped text before the AI sees
|
|
139
|
+
it: five recorded kinds (`credential`, `private_key`, `cloud_key`, `url_credentials`, `assigned_secret`), COUNTED and never shown. The AI's
|
|
140
|
+
answer is checked, not trusted: every path must be in the checkout and not denied, every cited line must be one the AI really saw, every
|
|
141
|
+
symbol must occur in text it really read, and "not found" needs the zero-hit searches on record; otherwise the verdict becomes
|
|
142
|
+
`CANNOT_TELL`. The runner reports ONE record to QuikProjects (paths, line numbers, short names, the commit it read and counts; never file
|
|
143
|
+
text) or a closed failure reason. An unknown `MODE` now stops the job instead of falling into a full run, which is what keeps an old
|
|
144
|
+
template from ever treating the look as a run. The AI Runtime needs `PILOT_INVESTIGATE_ENABLED`; if it is off the look ends at once as
|
|
145
|
+
`switch_off` and the run goes on without it.
|
|
146
|
+
|
|
147
|
+
*A field nothing supplies.* After the code is written, the runner looks at the functions a change adds or changes in JavaScript files
|
|
148
|
+
(not tests). If one reads a field of its input that appears nowhere else in the project's non-test text and nothing in the change supplies
|
|
149
|
+
it, the callback carries it as `unsuppliedInputs` (at most 10 functions, 5 names each) and QuikProjects lists it under "What QuikPilot
|
|
150
|
+
noticed" as a check. This is the shape of a change whose new tests pass only because they hand the function the field themselves. It can be
|
|
151
|
+
wrong (a field that arrives from a database row or a request), so it only warns and never blocks. TypeScript is not covered (QUIKTR-1547).
|
|
152
|
+
|
|
153
|
+
**9.3.0-rc.20 — a change with blocks no test depends on gets ONE fix attempt (QUIKTR-1569 Stage C).** Twice in live runs the AI fixed the requested bug and also rewrote a neighbouring line wrongly, with every test green; the check added in QUIKTR-1569 (put each changed block back on its own and see whether any test notices) found it, but only told the reviewer afterwards. Now, in `loop-tests` mode, when the change has passed every check and the fix allowance and the time allow it, the check runs BEFORE the change is committed. If it flags blocks, the change is taken off the disk and ONE fix attempt starts from it, told the file and line numbers (`loop.previousAttempt`: `endedWith: "unneeded_changes"`, `changesKept`, the passing run, `detail` e.g. `src/history.js, line 36`; never code, at most 300 characters): put each block back if the issue and the cases do not ask for it, or add a test of it that can fail. It can only improve the run: if the fix gives up, errors, or its change no longer passes every check, the change that had already passed is checked again and shipped, with the same notice as before. One review fix per run; it uses one of the fix attempts, so the three-in-all limit still holds. The check's result is reused for the final notice when the change did not change. The run record marks the earlier attempt `checks: passed` and the fix as started by `heal`; a fix put back ends as the new stop word `review_reverted`. **`QUIKPILOT_REVIEW_FIX=off` restores today's notice-only behaviour without a release.** The AI Runtime's contract 24.12g (one new reason word and one fixed paragraph) must be deployed FIRST; without it the new word is only logged as `other` and the fix gets the general kept-change paragraph. No QuikProjects change. **Also in rc.20 -** the failure line the AI reads names the failing assertion (below).
|
|
154
|
+
|
|
155
|
+
**9.3.0-rc.20 — the failure line the AI reads names the failing assertion (test-expectations plan, Part A2).** In the one failed run of the 12-run live test (F7) the AI's own test asserted a field its case never named; the message was `expected false to be true // Object.is equality`, which fits any of a test's assertions, and the fix argued with the code instead of the test. The test report's failure body holds the stack, so the first frame that points into a source file and is not under `node_modules` (vitest `❯ src/a.test.js:6:23`, node and jest `at fn (/abs/src/a.test.js:130:30)`) now gives `path:line`, made relative to the checkout. It is added to the END of the first line of the failure message the AI is shown for a test written in this run: `expected false to be true // Object.is equality [at src/a.test.js:6]`, in the `run_tests` answer and in the fix attempt's `lastTestRun.messages` (the same function). A path and a line number only; the line is cut so the place always survives within 120 characters. It is kept in its own map and is NOT added to the general failure text that appears in run reasons and logs, which still carries no ordinary stack frame. Tests the run did not write show no message and so no place. No AI Runtime change.
|
|
156
|
+
|
|
157
|
+
**9.3.0-rc.19 — when no old test broke, the test answer says so (test-expectations plan, Part 0).** Checking 11 runs of one pagination bug, every give-up was a test the AI had written itself with a wrong expectation (which item is first, in what order) over code that was already right; where its test data had no explicit date the code stamped the current time, records tied within a millisecond and the order of tied records depended on the clock. The `run_tests` answer for a failed run now carries one more fixed sentence when `regressions` is 0, `newFailures` is above 0 and a baseline was compared with: no test that passed before the change fails now, and the failures counted in `newFailures` are tests that were not in the test run before it. It names no test and quotes no text, changes no key of the answer, and the log line `codegen.run_tests` gains `ownOnly` (a flag). What to do with it is said in the AI Runtime's prompt, which is deployed FIRST (its loop-2 text moved); without that prompt the sentence is only a fact. **Also in rc.19 - a fix may correct a test written in this run, but not empty it (test-expectations plan, Part 4).** The AI Runtime's fix instruction (§24.12f) now lets a fix correct a test the run itself wrote when no test that passed before fails. Wording cannot stop a model from making a test pass by emptying it, so during a fix attempt an edit that removes a test written in this run, renames it away from its `[QP-...]` token, skips it (`it.skip`, `xit`, `it.todo`) or leaves it with fewer `expect`/`assert` checks is refused with the ordinary `protected` answer and the closed reason `test_removed` or `test_emptied`; the AI edits again. Tests that existed before the run stay locked exactly as before, and a first attempt or a clean retry is not touched. JavaScript test files only (like the existing-test rule; TypeScript is QUIKTR-1547); a file it cannot read is never refused. When a fix was made and the change then passed every check, the run also reports which tests written in this run the fix changed, as paths and line numbers only (`testsCorrected`), so the run page and the pull request can say so; `QUIKPILOT_TESTS_CORRECTED=off` stops that report. The rail cannot judge whether a changed expectation is right; it only closes the way of passing by saying nothing. QuikProjects must be deployed first (it validates the new field); an older one ignores it. Nothing else changes, and the sentence about no old test breaking has no switch: a revert of this release restores the old sentence.
|
|
158
|
+
|
|
159
|
+
**9.3.0-rc.18 — an honest "I cannot finish" no longer throws away a change that is one fix away (QUIKSPL-139).** The AI wrote the fix and its tests, ran the project's tests until its runs were used (4 failing, then 3, then 3) and answered `CANNOT_COMPLETE`; the whole change was thrown away and a second attempt started from nothing, which did worse. Had it said `DONE`, every check would have run and the fix step (QUIKTR-1527) would have continued from the same change. Now a give-up is KEPT when the change would have passed as a `DONE` (something changed, every required test case written, no file cut short or broken) and the AI's LAST test run came back with failing tests that are the change's doing. It is recorded as attempt 1 `kept`, goes through every check like any result, and when only the tests fail the existing fix continues from it (three attempts in all, so at most two fixes). Only in `loop-tests` mode with fixing on (the project's setting above 0); a fix attempt that gives up is not kept again; time-outs, network errors and every other ending behave as before. `QUIKPILOT_KEEP_ON_GIVE_UP=off` restores the clean second attempt without a new release. Nothing new goes to the AI service.
|
|
160
|
+
|
|
161
|
+
**9.3.0-rc.17 — the list of files that hold tests is read from this run's own test run (QUIKTR-1526).** Before the AI picks files, the AI service is given the files the project's test runner discovers and refuses an answer that puts test cases on any other existing file. That list used to come from the last merged QuikPilot run, so a test file added by hand since then was unknown and an honest answer about it was refused (QUIKSPL-140 died at targeting). Now `Setup` and the baseline test run come BEFORE targeting, and the list is built from that run's own report: the files it attributes tests to, put in the form of the file list and kept only if they are in it (the AI service rejects the whole request otherwise); each file that cannot be placed, and each test the report names without a file (a Java class name, a Jest describe title), is counted in `unmappedEntries`, which switches the refusal off. Doubt turns the check off, never on: no test command, no report, a report with no tests, or a wait that ran out sends `ABSENT`. Targeting waits for the baseline at most 90 seconds (`QUIKPILOT_DISCOVERY_WAIT_SECONDS`); past that the run says so in its notes and the baseline carries on beside the code-writing step exactly as before (it is started once). The list QuikProjects stores is no longer used by this runner. The log gets one `test_discovery` line with counts only. No change in the AI service or in QuikProjects.
|
|
162
|
+
|
|
163
|
+
**9.3.0-rc.16 — changes no test depends on are named (QUIKTR-1569).** A green test run only proves what the tests check (QUIKSPL-138: the pagination fix also rewrote the neighbouring `hasMore` line, wrongly, and all 75 tests stayed green). In `loop-tests` mode, after a change has passed every check, each changed block of an existing code file that is not a test is put back as it was, ON ITS OWN, and the project's tests run once more (a block that looks unneeded is run a second time before it is flagged). A block with every test still passing is reported under "What QuikPilot noticed" as a file and line numbers only, never the code: it is a statement about the tests, not about the code, since a block can be right and untested. It warns and never blocks. A run that times out, leaves no report or a stale one counts as unknown and is never flagged; a block put back that makes tests vanish counts as needed; at most 8 blocks are checked, for at most 6 minutes and never in the last 2 minutes before the job's stop; a suite too slow to run again, or a project with no readable baseline, is skipped. Files the run created, tests, documents and configuration are not looked at. The checkout and the final test report are put back after every run; a checkout that does not come back ends the run, as for `run_tests`. Switch it off with `QUIKPILOT_HUNK_CHECK=off`. An older QuikProjects ignores the new field.
|
|
164
|
+
|
|
165
|
+
**9.3.0-rc.15 — QuikPilot fixes its own change when the project's final tests fail (QUIKTR-1527).** In `loop-tests` mode, when the final comparison of the project's tests finds tests that passed before and fail now (or new tests that fail), the run no longer ends Failed at once. It takes the checkout back, starts another attempt FROM the change it just wrote (kept in memory), tells the AI which tests failed (names, and for tests it wrote itself the first line of the error: exactly what `run_tests` shows it), and then runs EVERY check again from scratch (dependencies, scope, placement, format, lint, the project's tests, coverage). At most three attempts at writing the change per run in all (an ordinary retry counts as one); `maxHealIterations` (the project's "fix attempts" setting) can lower it, and 0 turns fixing off. A fix is made only for a failing test comparison (never for lint, scope, dependency, placement or coverage), never after the same tests fail the same way twice in a row, and only if the time left fits it (the job limit less seven minutes for pushing and reporting). Nothing is pushed unless the final code passes every check; an existing test is never edited to make code pass. A run that still fails ends Failed as before, with "; QuikPilot tried to fix it N times (stopped: …)" added to the reason, and the run's record gains the fix attempts and a stop word. Needs the AI service with contract 24.12d (otherwise the fix is refused and the run fails exactly as before). Other modes and a run whose tests pass are unchanged.
|
|
166
|
+
|
|
167
|
+
**9.3.0-rc.14 — the early look's findings reach the targeting step (QUIKTR-1561).** When QuikProjects' work packet carries `findings` (only after a look COMPLETED), the runner filters them to this checkout (entries whose path is not in the listing or matches the protected list are dropped, and the look's free-text questions are never sent) and adds them as the last key of the targeting request, on every turn of the loop and on the single call. If the AI service does not know the key and refuses it (`CONTRACT_REJECTED`), the request is asked ONCE more without it and a warning says so; any other failure, a second refusal, and a refusal of a request that carried no findings fail exactly as before. A run without a completed look sends exactly the request it always did. Deploy the AI service and QuikProjects first.
|
|
168
|
+
|
|
169
|
+
**9.3.0-rc.13 — a run that finds no file to change now fails (QUIKTR-1557).** When targeting answers "no file" for a run that has an approved
|
|
170
|
+
issue (every real run: dispatch attaches one after Gate 1), the runner no longer writes the Phase 0 marker file, runs setup and tests, pushes a
|
|
171
|
+
branch and reports success. The run ends at once, before anything is written, installed or pushed, with the reason
|
|
172
|
+
`QuikPilot found no file to change for this request — <the AI's own reason>` (`no reason was given.` when it gave none; credentials scrubbed,
|
|
173
|
+
cut at 1,000 characters like every reason). The callback is `failed`, carries that reason in `unresolved`, and still carries the targeting
|
|
174
|
+
record (outcome `NO_TARGET` and the AI's reason), so no pull request is opened and the work item is free for a new run. A run with NO approved
|
|
175
|
+
issue (the development skeleton) keeps the old marker path unchanged. QuikProjects shows what to change in the request; nothing in the
|
|
176
|
+
workflow file changes.
|
|
113
177
|
|
|
114
178
|
**9.1.0 — the code-writing step sees the files the changed file imports.** For every existing file a run changes (code or
|
|
115
179
|
test), the runner now reads that file's own imports (JavaScript and TypeScript, one hop, never what those files import)
|