@quikit/quikpilot-runner 9.3.0-rc.20 → 9.3.0-rc.21

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
@@ -150,6 +150,18 @@ it, the callback carries it as `unsuppliedInputs` (at most 10 functions, 5 names
150
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
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
152
 
153
+ **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.**
154
+
155
+ **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.**
156
+
157
+ **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.**
158
+
159
+ **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.**
160
+
161
+ **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.**
162
+
163
+ **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.
164
+
153
165
  **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
166
 
155
167
  **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.