@quikit/quikpilot-runner 9.3.0-rc.93 → 9.3.0-rc.94

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
@@ -194,6 +194,8 @@ wrong (a field that arrives from a database row or a request), so it only warns
194
194
 
195
195
  **9.3.0-rc.81 (also) - pytest and go test reports place their tests on files (QUIKTR-2465 item 3).** The Python and Go trial repositories' reports placed no test on a file, so the test-file list was empty and the AI Runtime's early check was off. pytest tests are placed by the longest dotted prefix that is a `.py` file of the listing; Go tests by go.mod's module and the one `_test.go` file of the package's folder that declares the function. Real reports: sqlparse 454 tests on 9 files, decimal 145 tests on 3 files, 0 unmapped each. A report that places none of its tests says so in the run's notes. JavaScript reports are unchanged.
196
196
 
197
+ **9.3.0-rc.94 - the two reports back to QuikProjects are tried again after any connection failure that brought no answer, and a lost report names its cause (QUIKTR-2790).** On UAT (17 Nov) the early look finished its work and its one report failed with a connection error that was not ECONNRESET or ETIMEDOUT (about 10.5 s later: most likely a connect timeout); it was not tried again, the log said only `report_failed`, and the run went on without the look. The look's report and the run's final report now try again after any fetch that threw with no HTTP answer (a connect timeout, a closed socket, DNS, a refused connection), with the same waits and the same bytes each time; a refusal (4xx), an invalid URL, a certificate problem and the runner's own 60 s limit for a try stay final. Every lost look now logs `report_failed` with the cause: the last HTTP status, or a closed word (an error code or an error name; never the message, the URL, the token or the body). The AI calls keep their old two-code retry on purpose: a repeated AI call that reached the AI service is paid twice. No change to the work packet, the contract or the site.
198
+
197
199
  **9.3.0-rc.93 - a turn the AI service calls too big is not mistaken for a switch that is off (QUIKTR-2712, RT-05).** The AI service refused a loop turn over its per-turn size limit with the same code (`CONTRACT_REJECTED`) it uses for "switch off", "unknown version" and "malformed request", which the run answers by stepping down a version, dropping a key or writing the files one at a time (on a first request it could even end the run as "needs a database change"). The service now sends its own code, `LOOP_TURN_TOO_LARGE`, for that one refusal, and the three loops (code writing, the file search and the early look) end the attempt as `token_ceiling` ("the request grew too large for one step") with the service's code kept in the record: no step down, no key dropped, no per-file fallback. A runner of this version against the older service behaves as before. Release this runner BEFORE the service half.
198
200
 
199
201
  **9.3.0-rc.92 - each loop version's fixed prompt part counted honestly (QUIKTR-2709, RT-01).** A loop turn was sized as 5,000 for the fixed part (instruction, forms, user turn) plus its context, against 90,000; the fixed part is really 7,000 to 23,500 depending on the contract version, so the ceiling allowed ~104,000. The 90,000 is now the whole request: the fixed part comes from one table per version (`PROMPT_OVERHEAD_BY_VERSION`, the AI Runtime's values word for word), and an unknown version is charged the largest. Long runs drop old file contents a little sooner. Release this runner BEFORE the runtime half: it trims sooner, which today's runtime accepts.
package/dist/index.js CHANGED
@@ -40130,13 +40130,14 @@ function jobStoppedMessage() {
40130
40130
  }
40131
40131
  var SHORT_CALL_MS = 6e4;
40132
40132
  var LONG_CALL_MS = 5 * 6e4;
40133
+ var STEP_TIMEOUT_CODE = "STEP_TIMEOUT";
40133
40134
  async function fetchWithin(what, url, init2, limitMs) {
40134
40135
  const signal = AbortSignal.timeout(limitMs);
40135
40136
  try {
40136
40137
  return await fetch(url, { ...init2, signal });
40137
40138
  } catch (err2) {
40138
40139
  if (signal.aborted && err2?.name === "TimeoutError") {
40139
- throw new Error(`${what} did not answer within ${minutesOrSeconds(limitMs)} and was stopped`);
40140
+ throw Object.assign(new Error(`${what} did not answer within ${minutesOrSeconds(limitMs)} and was stopped`), { code: STEP_TIMEOUT_CODE });
40140
40141
  }
40141
40142
  throw err2;
40142
40143
  }
@@ -40219,6 +40220,37 @@ function isRetryableNetworkError(err2) {
40219
40220
  const code = networkErrorCode(err2);
40220
40221
  return code !== void 0 && RETRYABLE_NETWORK_ERROR_CODES.has(code);
40221
40222
  }
40223
+ var TRANSPORT_FAILURE_CODES = /* @__PURE__ */ new Set([
40224
+ "ECONNRESET",
40225
+ "ETIMEDOUT",
40226
+ "ECONNREFUSED",
40227
+ "EAI_AGAIN",
40228
+ "ENOTFOUND",
40229
+ "EPIPE",
40230
+ "ENETUNREACH",
40231
+ "EHOSTUNREACH",
40232
+ "UND_ERR_CONNECT_TIMEOUT",
40233
+ "UND_ERR_SOCKET",
40234
+ "UND_ERR_HEADERS_TIMEOUT",
40235
+ "UND_ERR_BODY_TIMEOUT",
40236
+ "UND_ERR_CLOSED"
40237
+ ]);
40238
+ function isTransportFailure(err2) {
40239
+ if (typeof err2 !== "object" || err2 === null) return false;
40240
+ const code = networkErrorCode(err2);
40241
+ if (code !== void 0) return TRANSPORT_FAILURE_CODES.has(code);
40242
+ const e = err2;
40243
+ return e.name === "TypeError" && e.message === "fetch failed";
40244
+ }
40245
+ function describeFailureCause(err2) {
40246
+ const word = (s) => {
40247
+ if (typeof s !== "string") return void 0;
40248
+ const clean = s.replace(/[^A-Za-z0-9_.-]/g, "").slice(0, 40);
40249
+ return clean === "" ? void 0 : clean;
40250
+ };
40251
+ if (typeof err2 !== "object" || err2 === null) return "unknown";
40252
+ return word(networkErrorCode(err2)) ?? word(err2.name) ?? "unknown";
40253
+ }
40222
40254
  async function fetchWithRetry(url, init2, { retries = 2, backoffMs = 250 } = {}) {
40223
40255
  for (let attempt2 = 0; ; attempt2++) {
40224
40256
  try {
@@ -40275,8 +40307,8 @@ async function reportBack(params) {
40275
40307
  signal: AbortSignal.timeout(params.urgent ? URGENT_REPORT_TIMEOUT_MS : SHORT_CALL_MS)
40276
40308
  });
40277
40309
  } catch (err2) {
40278
- if (!isRetryableNetworkError(err2)) throw err2;
40279
- failure = `the connection failed (${networkErrorCode(err2)})`;
40310
+ if (!isTransportFailure(err2)) throw err2;
40311
+ failure = `the connection failed (${describeFailureCause(err2)})`;
40280
40312
  if (attempt2 === tries) throw new Error(`Report back to QuikTrack failed: ${failure} after ${tries} tries`);
40281
40313
  await waitBeforeRetry(failure, attempt2);
40282
40314
  continue;
@@ -54918,7 +54950,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
54918
54950
  var REPORT_COPY = "final-test-report.xml";
54919
54951
  var MAX_REPORT_BYTES = 5 * 1024 * 1024;
54920
54952
  var MAX_FILES = 200;
54921
- var RUNNER_VERSION = true ? "9.3.0-rc.93" : "dev";
54953
+ var RUNNER_VERSION = true ? "9.3.0-rc.94" : "dev";
54922
54954
  function safeDestination(base, repoPath) {
54923
54955
  if (!repoPath || (0, import_node_path27.isAbsolute)(repoPath)) return null;
54924
54956
  const destination = (0, import_node_path27.resolve)(base, repoPath);
@@ -57100,8 +57132,10 @@ async function reportInvestigation(callbackUrl, runToken, body2, sleep = (ms) =>
57100
57132
  failure = await describeQuikTrackFailure(res);
57101
57133
  status = res.status;
57102
57134
  } catch (err2) {
57103
- if (!isRetryableNetworkError(err2)) throw err2;
57104
- networkCode = networkErrorCode(err2);
57135
+ networkCode = describeFailureCause(err2);
57136
+ if (!isTransportFailure(err2)) {
57137
+ throw new InvestigationReportError(`Investigation callback failed: the request could not be completed (${networkCode})`, void 0, networkCode);
57138
+ }
57105
57139
  failure = `the connection failed (${networkCode})`;
57106
57140
  }
57107
57141
  if (status !== void 0 && !REPORT_RETRY_STATUSES.has(status)) throw new InvestigationReportError(`Investigation callback failed: ${failure}`, status);