@quikit/quikpilot-runner 9.3.0-rc.3 → 9.3.0-rc.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -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. The per-file fallback refuses to start from a checkout that is not what it was when the loop began.
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 loop is thrown away and the files are written one at a time, as for any other ordinary failure (`syntax_error`
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,111 @@ 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 (an
105
- older runtime, a timeout, a refused edit it cannot recover from, a cut-short file) everything it held is thrown away and the
106
- files are written one at a time, and the run's warnings say so. A budget or credential refusal from the AI Runtime is never
107
- retried (the one-at-a-time attempt would be refused again or paid for twice). A protected path is refused to the AI as an
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 simply falls back.
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.31 — long test suites: a clock, and only the tests that matter (QUIKTR-1579, S4).** Runner only; nothing the AI is asked changes, the contract, the statuses and the run record are untouched, and a project whose suite takes under three minutes, or that is not a plain vitest project, behaves as before. (1) The project's whole suite is no longer unbounded: the baseline gets about 40% of what is left of the job (5-25 minutes) and the final check after the change 2.5 baselines (5-20 minutes, never more than the job has left). A baseline that ran out of time stops the run with a plain message; a final check that ran out of time, or that had under a minute left, is a failure at the gate - never a silent pass, and nothing is healed; one test file is capped at 3 minutes. `QUIKPILOT_TEST_LIMITS=off` brings back the unbounded runs. (2) On a vitest project whose baseline took 3 minutes or more, the AI's own `run_tests` runs execute `vitest related` for the files it changed, its own new tests, and the tests that read files with `fs` (which no import graph can see); the final check is still the whole suite, once. A project is recognised only when its command is `[cd <folder> &&] npm|pnpm|yarn test [-- flags]` (or `vitest [run]`), nothing chained, its `test` script is exactly `vitest` or `vitest run`, it has no workspace or projects, and vitest is found from that folder; the flags may only be reporters, the output file and `--maxWorkers=` (which is passed on). A change to `package.json`, a lock file, a tsconfig, a vitest/vite config, a setup file, a prisma schema, an `.env` file or a shared helper under `__tests__/` runs the whole suite once instead. Related tests are switched off for the rest of the job when more than 40 tests read files, or when one related run took as long as the whole suite. When vitest fails whole (a file cannot be parsed) the test files are run directly (the AI's own, the tests that import a changed file, the file-reading ones); if none of them fails the answer is "no report", never a pass. The AI reads one fixed sentence, "Related tests only; the whole suite runs last." `QUIKPILOT_RELATED_TESTS=off|force` and `QUIKPILOT_RELATED_MIN_BASELINE_SECONDS` switch it without a release. (3) The job log gains `timing` (setup, format, lint, gate), `baseline.timeout`, `gate.timeout`, `related.adapter`, `related.off`, and a `plan` (counts and closed words, no names) on the `run_tests` events. Measured on the QuikProjects suite (4,611 tests in 348 files): `vitest related` picked every test that loads a changed file (24 of 24 sampled files), 6% of the tests on average, 6-27 s a run; two workers instead of one took the whole suite from 441 s to 177 s.
154
+
155
+ **9.3.0-rc.30 — the code checks read TypeScript (QUIKTR-1578, S3; QUIKTR-1547).** Runner only; nothing the AI is asked changes, and plain JavaScript is read exactly as before. TypeScript (`.ts`, `.tsx`, `.mts`, `.cts`) and JSX (`.jsx`, and a `.js` file that only parses with its JSX) are turned into plain JavaScript on the same lines by Sucrase, bundled into the runner (it never loads the project's own `typescript`), and the existing checks read that: (1) a file that no longer parses, at its line (no column: removed types move columns), which stops the hand-over as for JavaScript; (2) a name that is not defined or imported, or used above its declaration: in TypeScript a warning only (the AI is told at the edit, `codegen.name_warning` is logged at hand-over, the run is not stopped) until live runs show it is reliable there, because some names come from declaration files; (3) existing test files get the parser rule instead of the text rule, compared without types, so a widened import line or a typed helper is accepted and a change to a type annotation alone is not a change to a test; (4) the AI's own new tests cannot be emptied; (5) the missing-import check resolves `.ts`/`.tsx`, `./x.js` written for `x.ts` and `index.ts`, and counts a name a module exports only as a type as exported; (6) the unsupplied-inputs warning reads TypeScript. Declaration files (`.d.ts`) are never read; a file with decorators is not read (it counts as "did not parse", never as broken). On all 1,849 TypeScript files of a real monorepo app: every one read with no line moved, no unknown name, no existing test refused, no missing import and no false unsupplied-inputs warning. The bundle grows from 705 KB to 1.39 MB.
156
+
157
+ **9.3.0-rc.29 — what the AI sees, and how it finds the right files (QUIKTR-1577, S2b).** Runner only; nothing the AI is asked changes, and a project with no tsconfig, no test report and clean files behaves as before. (1) The path aliases a project declares in its own `tsconfig.json` / `jsconfig.json` (`paths`, with `extends` followed) are followed for the files a changed file imports, so `@/lib/x` now finds the file; an alias that leaves the workspace folder (`@quikit/ui`) is counted (`outsideImports`) and not read. (2) A file's existing tests are found by who imports it, wherever they sit (up to 3 per file, about 24 KB), after the beside-the-file pairs. (3) A file in a bare `test/` or `tests/` folder is a test only if the project's test report lists it or its name says so (`.test.`, `.spec.`, `test_*.py`, `_test.go`, `FooTest.java`); with no report the folder still decides. `__tests__/` folders and `.test.`/`.spec.` names never depend on it. The list of existing tests sent to the AI Runtime (still capped at 300) is ordered: tests already shown, test targets, the nearest tests, then the rest. (4) Lock files of other ecosystems (`uv.lock`, `Gemfile.lock`, `composer.lock`, ...) are never read or written; `.npmrc`, `*.pem`, `*.key`, `*.tfvars`, `*credentials*.json` and `docker-compose*` are never read, listed, searched or shown (the edit gates keep the project's own list); `edit_file` refuses a file whose first five lines say `@generated` or `DO NOT EDIT` (`generated_file`); a binary file is never shown as context. (5) A search no longer stops early in a large folder: media files are not opened and binary files no longer count against its 20 MB budget (`apps/quikprojects`: all 2,171 text files, 1.5 s). (6) Credentials are hidden from the AI on every phase, not only the early look: private keys, cloud keys, passwords in web addresses, the usual credential shapes and the run's own tokens, in every file, search excerpt, diff and test message it is shown. The rule that hides any quoted value under a name like `password` stays in the early look only, because in code it also hides ordinary test data. The AI's own writes and the files on disk are never changed. An `NAME=value` line is now also found behind the line number `read_file` prints.
158
+
159
+ **9.3.0-rc.28 — safety for a big monorepo (QUIKTR-1577, S2a).** Runner only; nothing the AI is asked changes, and a project with no workspace folder set behaves exactly as before. (1) The folder QuikPilot may change is now enforced: `write_file`, `edit_file`, `revert_file`, `show_changes` and a kept change refuse a path outside the packet's `workspaceRoot` (`outside_workspace`), the finished result is checked again before anything is written, a planned target outside it is refused, and the commit stages only that folder, so a file a setup, format or lint command changed elsewhere is left out of the pull request and counted (`scope.left_out`). A `workspaceRoot` that cannot be understood (`..`, absolute, backslash, pattern characters) stops the run instead of being read as the whole repository. (2) The invented-import check judges only the imports a change adds, and a package another file under the folder already imports is accepted (proof it resolves here); an invented name is still blocked. (3) Where the project has no test command, or its test command writes no per-test report, tests-first is skipped with a note (`two_phase.off`) instead of failing the run. (4) The file list is read with `-z` and a 64 MiB buffer (accented names are exact; a 17,000-file repository no longer sits at 91% of the limit). (5) The whole-repository scan for unsupplied inputs is skipped when the change holds no plain JavaScript file it could judge. (6) `call_function` is not offered when the change targets TypeScript or another language it cannot load (`call_function.off`).
160
+
161
+ **9.3.0-rc.27 — "no test shows the bug" asks every case (QUIKTR-1608, live runs QUIKSPL-241 and QUIKSPL-246).** rc.26's rule counted only the cases held to the red check (those not labelled Regression). On gemini-3.8-flash the spec labelled two bugs' cases so that the only case held was one that must keep working, while tests of other cases did fail on the old code; both runs failed twice for nothing. Whether any test shows the bug is now asked of every case of the run, whatever its label; the "None of your tests fails" send-back is used only when that is true too. Runner only.
162
+
163
+ **9.3.0-rc.26 — no pull request from tests that prove nothing, and no import of a name that does not exist (QUIKTR-1608, live runs QUIKSPL-220 and QUIKSPL-226).** On rc.24 and rc.25 two pull requests (#118, #123) went out with every test green and the bug not fixed: none of the AI's tests had failed on the code before the change, so they tested nothing. #123 also imported `scaleShares` from `./splits.js`, which does not export it: plain Node cannot load that module, but vitest gives the name as `undefined`. (1) In phase `tests`, when none of the tests for the cases held to the red check has been seen failing on the code before any change, the one send-back says so ("None of your tests fails on the code before any change ... At least one case describes the bug"), and if the next DONE is the same the attempt fails `no_test_shows_bug` (log `codegen.red_check` `no_test_shows_bug`); the second attempt writes the tests again, and if it ends the same way no pull request is opened. A phase 1 whose tests were never run on the change as it stands ends the same way. (2) At DONE outside phase `tests` (the code phase, a fix, the review fix), the runner parses each changed JavaScript file (`importCheck.ts`) and names any name imported, or re-exported, from a module of the repository that the module does not export. The first time the DONE is sent back naming the file and the name (log `codegen.import_check`); after that the attempt ends `syntax_error`. ES modules only, relative imports only, and nothing is reported when it cannot be told for sure (`export *` from elsewhere, a destructured export, CommonJS, a module that cannot be found). Phase `tests` is not checked: a test may import what phase 2 is to write. Runner only.
164
+
165
+ **9.3.0-rc.25 — a corrected test must still show the bug (QUIKTR-1608, live run QUIKSPL-220).** On rc.24 the code phase of Bug 4 could not fix the bug and gave up with exactly one frozen test failing: the one test that proved the bug. The one correction, kept to that test's expected value as rc.24 requires, made it expect what the old code returns, so every test passed and PR #118 fixed nothing. After the correction the runner now runs the tests twice on the code before any change, once with the test as phase 1 froze it and once corrected (its own check, outside the AI's allowances; log `codegen.amend_old_code`). A test that failed there before its correction and passes after it no longer shows the bug: the run fails `test_case_disagree` and no pull request is opened. A test that passed on the old code by design is not held to it, and when either run gives no answer the correction stands. Runner only.
166
+
167
+ **9.3.0-rc.24 — cases that must keep working, a tighter amendment, and a stop for loops that change nothing (QUIKTR-1608, live batch of 15 Oct).** On rc.23 no pull request of bugs 1 to 7 was fully right. Six bugs had an approved case that passes on the old code by design ("splits that already divide cleanly must not change"); the red check told the AI to make it fail, and the AI broke a correct test. (1) Phase 1's DONE is sent back once, not twice, and the sentence says a case that must keep working may stay as it is; the second DONE is accepted and the reviewer warned about the cases seen passing. A phase-1 give-up with at least one own test failing on the untouched code is phase 1 done, the passing ones warned the same way. (2) A phase-2 DONE whose latest run still fails a frozen test is handed over as a give-up (live run QUIKSPL-210). (3) The amendment runs only when exactly one frozen test fails (QUIKSPL-209 rewrote three to match wrong code), and afterwards the runner checks that only that test's expected values changed: its set-up, its inputs and the rest of the file must be as phase 2 left them, or the run fails `test_case_disagree`. (4) Under the harness version, three replies in a row that change nothing (repeats, no-op or missed edits, unchanged test runs) make the next turn the last (`no_progress`). The AI Runtime's three phase paragraphs (contract §33.6) say the same; deploy them first.
168
+
169
+ **9.3.0-rc.23 — the red check counts one-file runs (QUIKTR-1608, live run QUIKSPL-208).** On rc.22 the first two-phase run opened a correct pull request (#112), but phase 1 proved the bug with a run of its test file (4 failing on the old code), the red check counted whole-suite runs only, sent the DONE back twice and ended phase 1 marked 5 cases unproven, so the reviewer was wrongly warned. Every run of phase 1 is now evidence, with the change it ran on: a case is FAILING when a run on the change as it stands lists its test failing; PASSING when such a run covered its test (the whole suite, or the one file that holds its `[QP-...]` token) and it did not fail; NOT RUN when nothing covered it. A test seen passing is sent back as before; one not run is sent back with a sentence naming it, and if phase 1 ends anyway it is logged (`ended_unrun`) but never shown to the reviewer as unproven: only a test seen passing on the old code is. A cut failing list still cannot tell. The next phase is told about the latest run on the change as it stands, a one-file run included. Runner only.
170
+
171
+ **9.3.0-rc.22 — phase 1 after the first live run (QUIKTR-1608, live run QUIKSPL-207).** On rc.21 the first live two-phase run failed in phase 1 in both attempts: the AI fought the existing-test rule for ten turns, then made its red tests pass and gave up. (1) In phase `tests`, a give-up (`CANNOT_COMPLETE`) whose change passes every hand-over check (every case covered, tests only) and whose tests were seen failing on the untouched code, in a whole-suite run on the change as it stands, is phase 1 done: the code phase follows (log `codegen.red_check` `gave_up_but_red`). (2) A failed two-phase attempt now records the phases it went through and their counts, as a finished one does. The AI Runtime's phase-1 paragraph (contract §33.4, amended) says failing is the goal (DONE then) and to put new tests and their helpers in a new test file when an existing one sends additions back; deploy it first.
172
+
173
+ **9.3.0-rc.21 (harness 6 of 7) — reproduce first, then fix (QUIKTR-1608, contract §33).** One step could change the tests and the code at once; when they disagreed the AI changed both (G18, G20, G23; fixes rescued 2 of 6 kept give-ups). Under the harness version an attempt is now written in phases, each held to its files by the runner (`codegenTools.ts` lane, answered `protected` before any budget is touched): (1) `loop.phase: "tests"` - only test files may change (the code answers `code_locked`); before the phase may end, each own test for a case with a known, non-Regression label must be seen FAILING in a whole-suite run on the untouched code. Otherwise the DONE is sent back as a refused turn (rule word `done_rule`, a fixed sentence naming the cases), at most twice; then the phase ends and the reviewer is warned (record `phases[].redUnproven`). (2) `loop.phase: "code"` - the phase-1 tests are frozen (`test_frozen`, also for any new or existing test file); the request carries them as a kept change (`endedWith: "tests_written"`, the red run, §32's steps). (3) When the code phase gives up while frozen tests of this run still fail: ONE amendment, a short code-phase loop with `loop.amend` (those files only, `edit_file` only, never emptied); the change then goes on with a warning naming the files. If the amendment fails too, the attempt fails `test_case_disagree` and is not tried again; no pull request. A second attempt after a failed code phase starts from the same frozen tests; fixes after the project's checks and the review fix are code-only with the tests frozen. The run record gains `phases` (phase, outcome, counts) and each test run its `phase`; the record now keeps 20 test runs and a run's `scope` (two gaps of the 1604 build). **`QUIKPILOT_TWO_PHASE=off` writes the change in one phase, as before.** AI Runtime contract §33 and QuikProjects (record schema) first. **Not published: waits for all seven harness tickets.**
174
+
175
+ **9.3.0-rc.21 (harness 5 of 7) — the next attempt is told what the one before it did, step by step (QUIKTR-1607, contract §32).** A second attempt or a fix was told how the earlier attempt ended, not what it tried, and in G18, G20 and G23 it started its diagnosis again and repeated the same kind of change. Under the harness version, `loop.previousAttempt` also carries `steps` (and `stepsTrimmed` when the oldest turns were left out): per turn, the AI's own note, and per call the tool, the path it named (or run_tests' `file`), the runner's closed answer and reason, test counts and `scope`, and the rule words of a reply the AI Runtime sent back. NO FILE TEXT: never an edit's find/replace/content, a function's arguments, any tool output text, a test name or a message (test names and messages stay in `lastTestRun`). Built only from what the AI Runtime was already SENT in that attempt (a turn that ran but was never sent stays out), within 15,000 characters, 40 turns, 8 calls a turn and 40 in all, oldest turns left out first. A second attempt gets the first attempt's steps; a fix gets the steps of the attempt whose change it keeps, and hands its own to the next fix. Wire only: never logged, never in the run record. Loop-2 never sends them. AI Runtime contract §32 first. **Not published: waits for all seven harness tickets.**
176
+
177
+ **9.3.0-rc.21 (harness 4 of 7) — rails that inform instead of ending (QUIKTR-1606, contract §31).** In G18, G20 and G23 rules about repeating, not a wrong answer, ended the attempts. Under the harness version only: (1) a call identical to one already answered is answered with that earlier result: `status: "duplicate"`, `reason` = the earlier id, a fixed message and the earlier `output` when it is still kept (a read whose output was dropped for room is simply done again). Nothing is run, read or applied twice, and it still costs a tool call. `call_function` does the same for an identical call on an unchanged change, spending no call. Once a write has changed a file, an EARLIER different write to it is judged again rather than served (so the AI is never told `ok` for text the file no longer holds); the same edit sent twice in a row is still a repeat. Replies made only of repeats no longer force a final turn: the call budget, the turn limit and the clock bound them. (2) An edit that leaves the file exactly as it was, or a write of the same text over a file this attempt created, is answered `no_effect` (one new status word), and nothing is written or counted. (3) A whole-suite test run where more tests fail than in the last one ends its message with one fixed sentence giving both counts and naming `show_changes` and `revert_file`. (4) Two whole-suite runs with the same failures answer `tests_failed` with one fixed sentence instead of `no_progress`, and the runs that are left stay; the log line carries `sameAsLast`. Every message stays within the AI Runtime's 500 characters. The targeting loop, the early look and loop-2 are exactly as before; the fix-level rule that stops fixing on the same failure is unchanged. AI Runtime contract §31 first. **Not published: waits for all seven harness tickets.**
178
+
179
+ **9.3.0-rc.21 (harness 3 of 7) — the AI can see what it has changed, and put a file back (QUIKTR-1605, contract §30).** In G23 a fix attempt edited a file that was already right, went from 1 failing test to 2, and could only keep editing forward. Two tools, under the harness version only: `show_changes` (a look; `args` nothing or `path`) answers `output: { text }`, a unified diff of every file this RUN has changed against the files as they were when it started (`/dev/null` for a created file, two lines of context, LF), at most 6,000 characters cut on a whole line and naming the files left out; it is charged to the read budget, dropped first when a request needs room, and forgotten after any change. It holds only what the AI wrote and lines of files it may read. `revert_file` (a write; `args.path`) puts one file back as it was at the START OF THIS ATTEMPT: the disk in a first attempt (a created file is removed, from the listing too), the kept change in a fix, never further; BOM and line endings are the file's own. It costs a tool call and no written characters, forgets earlier looks, takes the file off the changed-files count, and lets an earlier edit of that file be made again. A file this attempt has not changed is answered with the one new status word `not_changed`; a protected path is `refused`. An attempt whose change is put back to where it started still ends `no_writes` if it then says DONE. The line diff is the package's own (`lineDiff.ts`, `unifiedDiff`); no dependency was added. AI Runtime contract §30 first. **Not published: waits for all seven harness tickets.**
180
+
181
+ **9.3.0-rc.21 (harness 2 of 7) — the whole failure for the AI's own tests, and running one test file (QUIKTR-1604, contract §29).** The seven harness tickets ship together under ONE version: the loop now sends `codegen-loop-3` whenever the tests are on (`loop-tests`), on every repository; `call_function` stays ours-only through `remaining.functionCalls` (8 on a `deathvadeR-afk` repository, 0 elsewhere). (1) A failing test this run wrote used to be shown as its first line, cut at 120 characters, and that line is the framework's own message, which it already abbreviates (G20: `expected [ 'Item 5', 'Item 4', 'Item 3', …(7) ]`). The report's failure BODY holds the full expected/received comparison: the snapshot now keeps it (`failureDetail`: stack frames, code frames, separator rules and `node_modules` lines left out, control characters removed, line breaks kept; the short message when the body leaves nothing). Under the harness version the message is that whole text, `[at file:line]` on the end of its first line (so the first line is exactly the old message), credentials scrubbed THEN cut to 1,000 characters; all messages of one answer together stay within 4,000, each own test still to come keeping room for its first line. Which tests get a message is unchanged; a test that existed before is still names only. A fix attempt's `lastTestRun.messages` carries the same text (1,000 / 4,000); when the loop speaks loop-2 it cuts each back to its first line (120), so loop-2 is exactly as before. (2) `run_tests` takes an optional `file`: a test file of the listing or of this attempt, never a protected path (`bad_args` otherwise). It runs the space's "Test one file" command (`packet.commands.testFile`, `{file}` replaced, quoted) with the same limits and write-run-restore safety; the answer has the usual shape plus `scope: "file"`. Offered only when that command is set (`remaining.fileRuns` 6, else 0; the runner never guesses a command); file runs do not use the three whole-suite runs, are not repeated on an unchanged change (`no_change_since_last_run`, nothing spent), never end the attempt with `no_progress`, and are never the run a kept give-up rests on. The run record's test-run entry and the `codegen.run_tests` log line carry `scope: "file"`, never the path. The AI Runtime's contract §29 (on the harness branch) must be deployed first. **Not published: rc.21 waits for all seven harness tickets.**
182
+
183
+ **9.3.0-rc.21 — the AI can call one of the project's functions and see what it returns (QUIKTR-1603, contract §28 `codegen-loop-3`).** In the rc.20 live batches 3 of 4 failed runs were the AI's own tests expecting a value the (correct) code never returns: it guessed the expected value because it could not see what the code gives. A seventh loop tool, `call_function`, takes `path` (a `.js`/`.mjs`/`.cjs` file in the listing or created in this attempt, never a test file or a protected path), `export` (a plain name or `default`) and `callArgs` (the JSON text of an array of plain values). The runner writes the AI's changes so far to the checkout, runs a FIXED helper with the runner's own Node (no shell, the allow-listed environment, 20 s, its own process group) that imports the file and awaits the function, and puts every file back before it answers (`withOverlayOnDisk`, as for `run_tests`; a checkout that does not come back ends the run). The AI supplies no code: only the project's own code runs, as it already does when the AI's tests run before any pull request. The answer is ONE string: `ok` with `output.text` = the returned value as JSON text (Date as ISO, Map/Set as arrays, BigInt as `10n`, functions/undefined/cycles as fixed markers), credentials scrubbed THEN cut to 2,000 characters; `call_threw` with the error's name and first line (200); or `call_unavailable` with a closed `reason` (`not_found`, `not_a_function`, `unsupported_file`, `timed_out`, `could_not_start`, `write_refused`, `checkout_unverifiable`). Anything the function prints is discarded. At most 8 calls per attempt (`remaining.functionCalls`); the time counts on the shared clock like test time; only the latest call's text is kept when room is needed. Logs and the run record carry counts and closed words only (`codegen.call_function`: n, status, reason, seconds, chars), never the text, the export name or the arguments. **Offered only on repositories we own** - the owner part of `GITHUB_REPOSITORY` must be `deathvadeR-afk` (a constant in `ownedRepository.ts`; there is no setting that turns it on) - and only in `loop-tests` mode. **`QUIKPILOT_CALL_FUNCTION=off` turns it off without a release.** When the tool is offered the loop sends `codegen-loop-3`; an AI Runtime without it (or with `PILOT_CODEGEN_LOOP_3_ENABLED` off) refuses before any model call, and the runner makes the SAME first attempt again as `codegen-loop-2` (log `codegen.version_fallback`), never the per-file calls, and asks for loop-2 for the rest of the run. Everywhere else the request is exactly rc.20's. JavaScript only (Python and TypeScript files are not in this slice). No QuikProjects change is required (the two new status words are free text); its labels follow.
184
+
185
+ **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).
186
+
187
+ **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.
188
+
189
+ **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.
190
+
191
+ **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.
192
+
193
+ **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.
194
+
195
+ **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.
196
+
197
+ **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.
198
+
199
+ **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.
200
+
201
+ **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
202
+ 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
203
+ branch and reports success. The run ends at once, before anything is written, installed or pushed, with the reason
204
+ `QuikPilot found no file to change for this request — <the AI's own reason>` (`no reason was given.` when it gave none; credentials scrubbed,
205
+ cut at 1,000 characters like every reason). The callback is `failed`, carries that reason in `unresolved`, and still carries the targeting
206
+ 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
207
+ issue (the development skeleton) keeps the old marker path unchanged. QuikProjects shows what to change in the request; nothing in the
208
+ workflow file changes.
113
209
 
114
210
  **9.1.0 — the code-writing step sees the files the changed file imports.** For every existing file a run changes (code or
115
211
  test), the runner now reads that file's own imports (JavaScript and TypeScript, one hop, never what those files import)