@quikit/quikpilot-runner 9.3.0-rc.67 → 9.3.0-rc.68

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.68 - the switch `QUIKPILOT_KEEP_WORKING_FILES=on` no longer gets a request refused, and a refusal says why in the log (QUIKTR-1963).** The first live run with the switch on (QuikIT bug 4, run QTRIA-37, 4 Nov 2026) was refused by the AI Runtime four times (`CONTRACT_REJECTED`), each time costing the run a contract version (`codegen.version_fallback`) and a restart of the phase. Cause, reproduced by reading requests this runner built with the AI Runtime's own shape check: under the switch a repeat's copy of an earlier answer (status `duplicate`, carrying the earlier text) was shrunk to the stub `{dropped: true, note}` by the three-turn rule and by the make-room drop, and the AI Runtime takes that stub only on an `ok` look result (`check_look_output_3`). Now a repeat's copy is shrunk by leaving its text out (a `duplicate` with no `output` is a shape the AI Runtime already takes), and its message says it was shrunk and to read it again if needed; every other answer is shrunk as before. The re-read report (`codegen.reread`) reads such a copy as `stubbed`. New log line `codegen.contract_rejected` `{turn, version, reason}` on any refused code-writing request, whatever the switch: `reason` is the AI Runtime's one fixed sentence (the job's secrets taken out, one line, at most 300 characters). With the switch off nothing the AI Runtime receives changes. Also in rc.68: everything in rc.67.
176
+
175
177
  **9.3.0-rc.67 - before its tests are frozen, the AI is asked once to check WHY each bug test fails on the old code (QUIKTR-2058; off unless `QUIKPILOT_RED_REVIEW=on`).** Phase 1 ends only once each bug case's own test is seen failing on the code before any change (QUIKTR-1608), and any failure counted. In QuikIT run QTRIA-34 (3 Nov) two bug tests failed there with "expected 500 to be 409" because they never set up a mock the code needs, so the code crashed while the old code really answers 200; the check accepted them, the tests were frozen, and the code phase could never make them pass. In QTRIA-35 (same bug) the AI saw this in the failure text by itself and fixed its test. With the switch on, the first phase-1 DONE that gets past the red check (whatever that check found: in QTRIA-34 its one send-back went to a test that must keep working) is sent back once, as a refused turn with rule word `done_rule`, quoting the first line of each bug case's failure on the code as it is (`[id] fails on the code as it is with: ...`, the job's secrets scrubbed, at most 7 cases) and asking the AI to confirm each shows the bug, not a broken test (a missing mock or stub, an error in the test's own set-up, a crash the bug does not cause); a broken one is fixed and run again, otherwise the AI answers DONE again. It is never sent on a final turn, nor when no failure text is there to quote (`no_message`: a one-file run with no report, no baseline run), nor when no test run is left to show a corrected test failing (`no_runs_left`); a give-up with red tests is not reviewed. The red check and its own counter are unchanged. Logs (counts, never text): `codegen.red_check` `review_sent`, `review_skipped` (with `reason`), and `review_answered` (`testsChanged`, `rerun`, `linesChanged`, `linesSame`, `linesGone`) at the next answer; `red_review.on` once per job. Only with two phases; a fix and the review fix never get it. With the switch off every request is byte-for-byte what rc.66 sent. Nothing changes on the AI Runtime (it never reads a refused sentence's text) or in QuikProjects (the run record keeps rule words only). Also in rc.67: everything in rc.66.
176
178
 
177
179
  **9.3.0-rc.66 - the early look's report is tried again when QuikProjects cannot take it (QUIKTR-1999).** On 2 Nov two early looks (QuikIT Q2, QuikSplit S5) finished their work and then logged `investigate.failed report_failed`: the one report to QuikProjects failed once, while several runs overlapped and its database was busy, and was never tried again, so the look was lost and the run waited out its 200 s. The report now follows the rule the main callback got in rc.43, with a longer wait: a server error (500/502/503/504) or a dropped connection is tried again, 6 tries in all, waiting 2, 5, 10, 20 and 30 s (about 67 s, because the database stalls seen on 2 Nov and in the stress test lasted over 75 s), sending the same bytes each time; any other answer (a refusal such as 403) is final. When it still fails, the job log says which status the server last answered (`status`) or which connection error it was (`error`), next to the same closed reason as before. The main callback (`reportBack`) is unchanged. Needs the QuikProjects change from the same ticket to be most useful (it answers a busy database with 503 + Retry-After instead of a bare 500 or a 403), but works without it. Also in rc.66: everything in rc.65.
package/dist/index.js CHANGED
@@ -42362,6 +42362,15 @@ function stubNoteFor(call) {
42362
42362
  function isStubbed(output) {
42363
42363
  return typeof output === "object" && output !== null && output.dropped === true;
42364
42364
  }
42365
+ function shrunkAnswer(r, marker) {
42366
+ if (r.status !== "duplicate") return { ...r, output: marker };
42367
+ const copy = {
42368
+ ...r,
42369
+ message: `Same call as ${r.reason ?? "an earlier one"}: its text has since been shrunk to keep the request small. Read it again if you need it.`
42370
+ };
42371
+ delete copy.output;
42372
+ return copy;
42373
+ }
42365
42374
  function stubOldLooks(i3) {
42366
42375
  let shrunk = 0;
42367
42376
  for (let index = 0; index < i3.results.length; index++) {
@@ -42373,7 +42382,7 @@ function stubOldLooks(i3) {
42373
42382
  if (turn === void 0 || turn > i3.currentTurn - KEEP_TURNS) continue;
42374
42383
  const call = i3.callOf(r.id);
42375
42384
  if (!call) continue;
42376
- i3.results[index] = { ...r, output: { dropped: true, note: stubNoteFor(call) } };
42385
+ i3.results[index] = shrunkAnswer(r, { dropped: true, note: stubNoteFor(call) });
42377
42386
  const key = i3.ledger.keys?.get(r.id);
42378
42387
  if (key !== void 0 && i3.ledger.seen.get(key) === r.id) i3.ledger.seen.delete(key);
42379
42388
  i3.ledger.answers?.delete(r.id);
@@ -47207,6 +47216,7 @@ function overlapOf(a, b) {
47207
47216
  }
47208
47217
  function stateOf(output, writtenSince, dropNotes) {
47209
47218
  if (writtenSince) return "after_write";
47219
+ if (output === void 0) return "stubbed";
47210
47220
  if (!isStubbed(output)) return "whole";
47211
47221
  const note = output.note;
47212
47222
  return typeof note === "string" && dropNotes.has(note) ? "dropped" : "stubbed";
@@ -47724,7 +47734,7 @@ async function runCodegenLoop(args2, deps) {
47724
47734
  if (keep?.has(r.id)) continue;
47725
47735
  const stale = READ_TOOLS.has(r.name) && (r.status === "ok" || keepOn && r.status === "duplicate" && r.output !== void 0) || r.name === RUN_TESTS_TOOL && i3 !== lastTestRun && r.output !== void 0 || r.name === CALL_FUNCTION_TOOL && i3 !== lastCall && r.output !== void 0 || r.name === RUN_SCRATCH_TOOL && i3 !== lastScratch && r.output !== void 0;
47726
47736
  if (!stale) continue;
47727
- toolResults[i3] = { ...r, output };
47737
+ toolResults[i3] = shrunkAnswer(r, output);
47728
47738
  dropped++;
47729
47739
  }
47730
47740
  return dropped;
@@ -47850,6 +47860,13 @@ async function runCodegenLoop(args2, deps) {
47850
47860
  try {
47851
47861
  checkHardFailure(envelope, "pilot.codegen");
47852
47862
  } catch (err2) {
47863
+ if (code === "CONTRACT_REJECTED") {
47864
+ const said = envelope;
47865
+ const text3 = typeof said?.error === "string" ? said.error : typeof said?.normalizedText === "string" ? said.normalizedText : "";
47866
+ const reason = text3.trim() ? firstLine(scrub(text3), void 0, 300) : "";
47867
+ const version2 = contextData.contractVersion;
47868
+ log({ event: "codegen.contract_rejected", turn, ...typeof version2 === "string" ? { version: version2 } : {}, ...reason ? { reason } : {} });
47869
+ }
47853
47870
  throw new CodegenLoopFailure(code === "CONTRACT_REJECTED" ? "contract_rejected" : "semantic_mismatch", String(code), err2);
47854
47871
  }
47855
47872
  if (envelope?.success === false) {
@@ -51734,7 +51751,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
51734
51751
  var REPORT_COPY = "final-test-report.xml";
51735
51752
  var MAX_REPORT_BYTES = 5 * 1024 * 1024;
51736
51753
  var MAX_FILES = 200;
51737
- var RUNNER_VERSION = true ? "9.3.0-rc.67" : "dev";
51754
+ var RUNNER_VERSION = true ? "9.3.0-rc.68" : "dev";
51738
51755
  function safeDestination(base, repoPath) {
51739
51756
  if (!repoPath || (0, import_node_path26.isAbsolute)(repoPath)) return null;
51740
51757
  const destination = (0, import_node_path26.resolve)(base, repoPath);