@quikit/quikpilot-runner 9.3.0-rc.62 → 9.3.0-rc.63

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
@@ -172,6 +172,8 @@ wrong (a field that arrives from a database row or a request), so it only warns
172
172
 
173
173
  **9.3.0-rc.62 - an approved test that is reported again is refused with what to do (QUIKTR-1951).** When a person has approved a change to an existing test and the AI reports that test again before the final test run (a second row of a table test that still expects the old behaviour), the answer was only `already_decided`: "Do not report it again". It now also says what the AI can do: finish the code first, and if rows of that test still fail in the final test run, the fix step that follows may report the test once more (QUIKTR-1844). Nothing about WHEN a test can be reported changes, so a person is still asked only when there is evidence; a test a person judged right, or reported in another file, keeps the bare refusal exactly. A new log event `codegen.conflict_refused_approved` (phase only) counts how often it happens. No change to the contract with the AI service. The AI Runtime's QUIKTR-1952 (a hung OpenRouter call is cut at 150 s for QuikPilot calls, so the backup model answers inside the runner's turn limit) ships with this version and needs no runner setting.
174
174
 
175
+ **9.3.0-rc.63 - a reply the AI service could not read is asked again once instead of ending the attempt (QUIKTR-1953).** On 30 Oct 3% of the AI calls of a run (8 of 267) came back as `SCHEMA_MISMATCH`: the AI service could not read the AI's reply in the required format, even after its own repair and one retry. Each one ended the whole attempt, and with two attempts per job two of them ended a job with nothing written (QTRIA-28 lost its file search to one). The runner lost nothing with such a turn, so the request is now made again, once, in the way a cut-off or a slow turn already is (QUIKTR-1853): one fixed sentence in the AI's transcript says its last answer could not be read in the required format and asks for exactly one reply in that format and a smaller step; the turn is recorded like the other recovered turns and is never counted as a refusal. It applies to the code-writing loop and to the file-search loop (where only this code is recovered: a cut-off or a slow turn there still falls back to the single call, as before). A second unreadable reply straight after the first, the final turn, and `QUIKPILOT_TURN_RECOVERY=off` end the attempt exactly as before; when it is the second in a row the failure message says so. New log event `targeting.loop_recovered` (the code-writing loop's `codegen.loop_recovered` now also carries `reason: schema_mismatch`). Nothing is deployed on the AI service, and nothing about the reply that failed is shown to the AI or logged.
176
+
175
177
  **9.3.0-rc.58 - write the fix first, then ask once about every existing test it breaks, with proof (QUIKTR-1851, absorbing QUIKTR-1850; release 1).** Until now, when an existing test expected the bug, the run stopped BEFORE any code was written and a person approved a change to that test with nothing to show it could ever pass, and the tests were found one at a time: QTRIA-23 approved a change that moved the status line off 401 and left `expect(body).toEqual({ ..., error: "Unauthorized" })`, which no fix can satisfy, and spent all three stops. Now, when the project switches it on (`packet.fixFirst`; `QUIKPILOT_FIX_FIRST=off` turns it off without a rebuild) the run speaks `codegen-loop-8`: a `report_test_conflict` is a PROPOSAL that does not end the run, the AI writes the tests and the fix and reports every existing test its fix breaks, and at its DONE the runner proves the proposals (`proofCheck.ts`): it runs the project's WHOLE suite (the related-tests planner off, a fresh tool, outside the AI's run allowance) with the fix and every proposed change written over the old code. A proposal whose test still fails is sent back with its name ("change EVERY expectation of it"), and an existing test the fix broke that no proposal covers is sent back by name (never a failure message: QUIKTR-1474), at most twice; one that still fails after that is not offered to a person. Then ONE stop, as before, whose proposals carry `oldCodeChecked` (fails on the old code with the change alone), `newCode` (`passes` / `fails` / `not_checked`) and `newEndLine` (where the changed test now ends, for showing the whole test); no time, no answer or a list of failures cut to fit is `not_checked`, never proven. The tests phase hands its proposals to the code phase. An AI Runtime that refuses `codegen-loop-8` is asked again as loop-7 (nothing else changes), a fix turn stays loop-7, and a project that did not switch it on sends and receives exactly what it did. Release 2 (keeping the fix across the stop) is not in this version: the next job still writes the code again. Also in rc.58: everything in rc.57.
176
178
 
177
179
  **9.3.0-rc.57 - rc.56 and rc.55 together.** rc.56 (QUIKTR-1701 release 2) was built and published from a source that did not yet contain rc.55's turn recovery (QUIKTR-1853: a cut-off answer or a slow turn is asked again once in a smaller step instead of ending the attempt), so a project pinned to rc.56 lost it. rc.57 is the merge of the two and nothing else: everything in rc.56 and everything in rc.55. Also in rc.57: everything in rc.54.
package/dist/index.js CHANGED
@@ -46707,6 +46707,7 @@ function missingImportSentence(m) {
46707
46707
 
46708
46708
  // src/turnRecovery.ts
46709
46709
  var RECOVERY_RULE = "length";
46710
+ var MALFORMED_REPLY_CODE = "SCHEMA_MISMATCH";
46710
46711
  var COMMON = "Take a smaller step: fewer files and fewer edits in one turn, and make each edit a small find-and-replace change.";
46711
46712
  var SENTENCES = {
46712
46713
  cut_off: {
@@ -46716,8 +46717,13 @@ var SENTENCES = {
46716
46717
  slow: {
46717
46718
  violation: "Your last step took too long, so none of it was run.",
46718
46719
  message: `Your last step took too long, so none of it was run. ${COMMON}`
46720
+ },
46721
+ malformed: {
46722
+ violation: "Your last answer could not be read as the required format, so none of it was run.",
46723
+ message: `Your last answer was not in the required format, so none of it was run. Answer again with exactly one reply in the required format and nothing else. ${COMMON}`
46719
46724
  }
46720
46725
  };
46726
+ var IN_WORDS = { cut_off: "cut off", slow: "too slow", malformed: "unreadable" };
46721
46727
  function turnRecoveryOff(env2 = process.env) {
46722
46728
  return env2.QUIKPILOT_TURN_RECOVERY === "off";
46723
46729
  }
@@ -46729,9 +46735,7 @@ function recoveryAnswer(kind) {
46729
46735
  return { rules: [RECOVERY_RULE], violations: [s.violation], message: s.message };
46730
46736
  }
46731
46737
  function repeatedLossDetail(kind, first) {
46732
- const now = kind === "cut_off" ? "cut off" : "too slow";
46733
- const before = first === "cut_off" ? "cut off" : "too slow";
46734
- return `a turn was ${before}, and the next one, after the AI was asked for a smaller step, was ${now} too`;
46738
+ return `a turn was ${IN_WORDS[first]}, and the next one, after the AI was asked for a smaller step, was ${IN_WORDS[kind]} too`;
46735
46739
  }
46736
46740
 
46737
46741
  // src/conflictVerify.ts
@@ -46946,6 +46950,7 @@ async function runTargetingLoop(args2, deps) {
46946
46950
  const usedIds = /* @__PURE__ */ new Set();
46947
46951
  const refusedTurns = [];
46948
46952
  let refusedStreak = 0;
46953
+ let unreadableStreak = 0;
46949
46954
  let peakRequestTokens = 0;
46950
46955
  const usage = new TurnUsage();
46951
46956
  let turns = 0;
@@ -47028,6 +47033,13 @@ async function runTargetingLoop(args2, deps) {
47028
47033
  const fallbackText = `pilot.targeting failed: ${runtimeCode}`;
47029
47034
  throw new SafetyRefusalError(inner?.message ?? fallbackText, inner?.summary ?? fallbackText);
47030
47035
  }
47036
+ if (runtimeCode === MALFORMED_REPLY_CODE && shouldRecover({ isFinal, consecutive: unreadableStreak })) {
47037
+ unreadableStreak += 1;
47038
+ refusedTurns.push({ turn, rules: [RECOVERY_RULE] });
47039
+ transcript.push({ turn, toolCalls: [], refused: recoveryAnswer("malformed") });
47040
+ log({ event: "targeting.loop_recovered", turn, reason: "schema_mismatch", runtimeCode, elapsedMs: now() - turnStarted });
47041
+ continue;
47042
+ }
47031
47043
  throw new LoopFailure(runtimeCode && OUTPUT_TOO_LARGE_CODES.has(runtimeCode) ? "output_too_large" : "runtime_failed", runtimeCode);
47032
47044
  }
47033
47045
  let body2;
@@ -47036,6 +47048,7 @@ async function runTargetingLoop(args2, deps) {
47036
47048
  } catch (err2) {
47037
47049
  throw new LoopFailure("bad_reply", void 0, err2);
47038
47050
  }
47051
+ unreadableStreak = 0;
47039
47052
  if (body2.outcome === REFUSED_OUTCOME) {
47040
47053
  const answer = readRefusedAnswer(body2);
47041
47054
  if (!answer) throw new LoopFailure("bad_reply");
@@ -47594,7 +47607,7 @@ async function runCodegenLoop(args2, deps) {
47594
47607
  };
47595
47608
  log({ event: "codegen.loop_start", maxTurns: limits.maxTurns, maxToolCalls: limits.maxToolCalls, listingFiles: args2.listing.length });
47596
47609
  const loseTurn = (turn, kind, isFinalTurn, runtimeCode, elapsedMs) => {
47597
- const reason = kind === "cut_off" ? "output_too_large" : "turn_timeout";
47610
+ const reason = kind === "cut_off" ? "output_too_large" : kind === "slow" ? "turn_timeout" : "runtime_failed";
47598
47611
  if (!shouldRecover({ isFinal: isFinalTurn, consecutive: lostStreak })) {
47599
47612
  const again = lostLast !== null && lostStreak > 0;
47600
47613
  const failure = new CodegenLoopFailure(reason, runtimeCode, void 0, again ? repeatedLossDetail(kind, lostLast) : void 0);
@@ -47605,7 +47618,7 @@ async function runCodegenLoop(args2, deps) {
47605
47618
  lostLast = kind;
47606
47619
  refusedTurns.push({ turn, rules: [RECOVERY_RULE] });
47607
47620
  transcript.push({ turn, toolCalls: [], refused: recoveryAnswer(kind) });
47608
- log({ event: "codegen.loop_recovered", turn, reason, ...runtimeCode ? { runtimeCode } : {}, elapsedMs });
47621
+ log({ event: "codegen.loop_recovered", turn, reason: kind === "malformed" ? "schema_mismatch" : reason, ...runtimeCode ? { runtimeCode } : {}, elapsedMs });
47609
47622
  forced = settleNextTurn(turn, forced);
47610
47623
  return true;
47611
47624
  };
@@ -47662,6 +47675,11 @@ async function runCodegenLoop(args2, deps) {
47662
47675
  if (handled === true) continue;
47663
47676
  throw handled;
47664
47677
  }
47678
+ if (runtimeCode === MALFORMED_REPLY_CODE) {
47679
+ const handled = loseTurn(turn, "malformed", isFinal, runtimeCode, now() - turnStarted);
47680
+ if (handled === true) continue;
47681
+ throw handled;
47682
+ }
47665
47683
  throw new CodegenLoopFailure("runtime_failed", runtimeCode);
47666
47684
  }
47667
47685
  let body2;
@@ -51448,7 +51466,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
51448
51466
  var REPORT_COPY = "final-test-report.xml";
51449
51467
  var MAX_REPORT_BYTES = 5 * 1024 * 1024;
51450
51468
  var MAX_FILES = 200;
51451
- var RUNNER_VERSION = true ? "9.3.0-rc.62" : "dev";
51469
+ var RUNNER_VERSION = true ? "9.3.0-rc.63" : "dev";
51452
51470
  function safeDestination(base, repoPath) {
51453
51471
  if (!repoPath || (0, import_node_path26.isAbsolute)(repoPath)) return null;
51454
51472
  const destination = (0, import_node_path26.resolve)(base, repoPath);