@quikit/quikpilot-runner 9.3.0-rc.98 → 9.3.0-rc.99
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 +10 -5
- package/dist/index.js +59 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -194,11 +194,16 @@ 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.
|
|
198
|
-
- **What is
|
|
199
|
-
- **What
|
|
200
|
-
- **
|
|
201
|
-
|
|
197
|
+
**9.3.0-rc.99 - the running AI cost reaches QuikProjects while the job runs (QUIKTR-2834).** The run page's Spend stayed at $0.00 until the final report, because the job's AI cost was sent only then, and a job that died without that report kept $0.00 for good.
|
|
198
|
+
- **What is sent.** When the packet carries `progressUrl`, the job POSTs `{ aiCostUsd }` (its running total, `spendSoFar()`) to it every 10 s, only when the figure changed. QuikProjects writes the figure only (no status move, no event) and only upward, while the run is still working. The final report still sends the final total.
|
|
199
|
+
- **What it never does.** One short try per report (8 s); a failure is never thrown and the next tick tries again. 401/403/404/410 stop the reports for good (an older QuikProjects without the route, or a run it no longer accepts). The reports stop before the final report and before the last-resort one, and the timer never keeps the job alive. The run token is sent in the header only and never logged.
|
|
200
|
+
- **Older QuikProjects.** No `progressUrl` in the packet: nothing is reported, exactly as before.
|
|
201
|
+
|
|
202
|
+
**9.3.0-rc.98 - the tests the run wrote reach the pull request even when the repository ignores test files (QUIKTR-2851).** A repository that lists its test files in .gitignore (`*.test.ts`; QuikProjects' own repository does) got pull requests without the tests QuikPilot wrote and ran: the change was staged with `git add -A`, which skips ignored files, and nothing said so.
|
|
203
|
+
- **What is committed now.** The files the run itself created (through its one write of the change to disk) are staged with `git add -f`, inside the run's folder when it has one. A file created by an attempt that was undone is gone from disk, so it is not staged.
|
|
204
|
+
- **What is still left out.** Every other ignored file: a build output, a file a command wrote, and a file that was there before the run, even if the AI edited it. The denied paths are checked on everything staged, as before.
|
|
205
|
+
- **The final-change listing** (the parts check and the database-change check) counts the created files too, so both see what the pull request holds.
|
|
206
|
+
|
|
202
207
|
**9.3.0-rc.97 - the early look can say the reported behaviour already works (QUIKTR-2821).** On UAT (17 Nov) the look read an already-fixed bug's fix and had no word for it: the model answered NOT_PRESENT, its searches had found code, and the runner turned that into CANNOT_TELL, so the run went through both gates and a build first.
|
|
203
208
|
- **The new verdict.** The look now speaks the AI Runtime's `investigate-loop-2`, which adds a fifth verdict, **ALREADY_WORKS**: the code the report points at exists and already behaves as the report says it should. It stands only on a citation the runner checked (the rule PRESENT has), otherwise CANNOT_TELL, and a trimmed record keeps a citation for it.
|
|
204
209
|
- **Older AI Runtimes.** An AI Runtime that predates loop-2 refuses it on the first turn: that turn is asked once more on `investigate-loop-1` (`investigate.version_fallback`) and the look carries on there. A switched-off look and any later refusal end the look as before. The fixed part of a loop-2 request is 7,000 tokens (the AI Runtime's value).
|
package/dist/index.js
CHANGED
|
@@ -55087,6 +55087,56 @@ function packetShapeProblem(data2) {
|
|
|
55087
55087
|
return null;
|
|
55088
55088
|
}
|
|
55089
55089
|
|
|
55090
|
+
// src/progressReport.ts
|
|
55091
|
+
var PROGRESS_INTERVAL_MS = 1e4;
|
|
55092
|
+
var PROGRESS_TIMEOUT_MS = 8e3;
|
|
55093
|
+
var STOP_FOR_GOOD = /* @__PURE__ */ new Set([401, 403, 404, 410]);
|
|
55094
|
+
function startProgressReports(opts) {
|
|
55095
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
55096
|
+
let lastSaved = null;
|
|
55097
|
+
let stopped = false;
|
|
55098
|
+
let inFlight = false;
|
|
55099
|
+
let warned = false;
|
|
55100
|
+
const warnOnce = (why) => {
|
|
55101
|
+
if (warned) return;
|
|
55102
|
+
warned = true;
|
|
55103
|
+
console.warn(`::warning::QuikPilot could not report its running AI cost (${why}); the final report still sends it.`);
|
|
55104
|
+
};
|
|
55105
|
+
const tick = async () => {
|
|
55106
|
+
if (stopped || inFlight) return;
|
|
55107
|
+
const raw = opts.read();
|
|
55108
|
+
const cost = Math.round((Number.isFinite(raw) ? raw : 0) * 1e4) / 1e4;
|
|
55109
|
+
if (!(cost > 0) || cost === lastSaved) return;
|
|
55110
|
+
inFlight = true;
|
|
55111
|
+
try {
|
|
55112
|
+
const res = await fetchImpl(opts.progressUrl, {
|
|
55113
|
+
method: "POST",
|
|
55114
|
+
headers: { authorization: `Bearer ${opts.runToken}`, "content-type": "application/json" },
|
|
55115
|
+
body: JSON.stringify({ aiCostUsd: cost }),
|
|
55116
|
+
signal: AbortSignal.timeout(PROGRESS_TIMEOUT_MS)
|
|
55117
|
+
});
|
|
55118
|
+
if (STOP_FOR_GOOD.has(res.status)) {
|
|
55119
|
+
stop2();
|
|
55120
|
+
console.log(JSON.stringify({ event: "runner.progress_stopped", status: res.status }));
|
|
55121
|
+
return;
|
|
55122
|
+
}
|
|
55123
|
+
if (res.ok) lastSaved = cost;
|
|
55124
|
+
else warnOnce(`HTTP ${res.status}`);
|
|
55125
|
+
} catch (err2) {
|
|
55126
|
+
warnOnce(err2 instanceof Error ? err2.name : "network error");
|
|
55127
|
+
} finally {
|
|
55128
|
+
inFlight = false;
|
|
55129
|
+
}
|
|
55130
|
+
};
|
|
55131
|
+
const timer = setInterval(() => void tick(), opts.intervalMs ?? PROGRESS_INTERVAL_MS);
|
|
55132
|
+
timer.unref?.();
|
|
55133
|
+
function stop2() {
|
|
55134
|
+
stopped = true;
|
|
55135
|
+
clearInterval(timer);
|
|
55136
|
+
}
|
|
55137
|
+
return { stop: stop2 };
|
|
55138
|
+
}
|
|
55139
|
+
|
|
55090
55140
|
// src/runnerSwitches.ts
|
|
55091
55141
|
var RUNNER_SWITCHES = {
|
|
55092
55142
|
// Opt-ins (named in QUIKPILOT_FEATURES on QuikProjects).
|
|
@@ -55149,7 +55199,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
|
55149
55199
|
var REPORT_COPY = "final-test-report.xml";
|
|
55150
55200
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
55151
55201
|
var MAX_FILES = 200;
|
|
55152
|
-
var RUNNER_VERSION = true ? "9.3.0-rc.
|
|
55202
|
+
var RUNNER_VERSION = true ? "9.3.0-rc.99" : "dev";
|
|
55153
55203
|
function safeDestination(base, repoPath) {
|
|
55154
55204
|
if (!repoPath || (0, import_node_path27.isAbsolute)(repoPath)) return null;
|
|
55155
55205
|
const destination = (0, import_node_path27.resolve)(base, repoPath);
|
|
@@ -56112,6 +56162,8 @@ async function runUnderGuard(env2, guard) {
|
|
|
56112
56162
|
let packet;
|
|
56113
56163
|
let branch;
|
|
56114
56164
|
let runToken;
|
|
56165
|
+
let stopProgress = () => {
|
|
56166
|
+
};
|
|
56115
56167
|
const warnings = [];
|
|
56116
56168
|
let scopeRoot = "";
|
|
56117
56169
|
let installationToken;
|
|
@@ -56181,6 +56233,7 @@ async function runUnderGuard(env2, guard) {
|
|
|
56181
56233
|
};
|
|
56182
56234
|
};
|
|
56183
56235
|
const lastResort = async (reason) => {
|
|
56236
|
+
stopProgress();
|
|
56184
56237
|
if (!runToken) return;
|
|
56185
56238
|
const message = reason === "time_limit" && packet ? jobTimeLimitMessage(packet.guardrails.maxWallClockMinutes) : jobStoppedMessage();
|
|
56186
56239
|
let body2;
|
|
@@ -56200,6 +56253,10 @@ async function runUnderGuard(env2, guard) {
|
|
|
56200
56253
|
}
|
|
56201
56254
|
jobStopAtMs = runStopAtMs(runStartedAt, packet.guardrails.maxWallClockMinutes);
|
|
56202
56255
|
guard.arm({ stopAtMs: jobStopAtMs, watchdogAtMs: watchdogAtMs(jobStopAtMs), send: lastResort });
|
|
56256
|
+
if (typeof packet.progressUrl === "string" && packet.progressUrl.length > 0) {
|
|
56257
|
+
const reports = startProgressReports({ progressUrl: packet.progressUrl, runToken, read: () => spendSoFar().costUsd });
|
|
56258
|
+
stopProgress = () => reports.stop();
|
|
56259
|
+
}
|
|
56203
56260
|
for (const [label, name2] of [["branch", packet.branch], ["target branch", packet.targetBranch]]) {
|
|
56204
56261
|
const why = typeof name2 === "string" ? checkBranchName(name2) : null;
|
|
56205
56262
|
if (why) throw new Error(`QuikProjects sent a ${label} name git cannot use safely (${why}), so QuikPilot did not start. Nothing was changed.`);
|
|
@@ -56835,6 +56892,7 @@ async function runUnderGuard(env2, guard) {
|
|
|
56835
56892
|
console.warn(`::warning::Could not keep the failed run's files: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
56836
56893
|
}
|
|
56837
56894
|
}
|
|
56895
|
+
stopProgress();
|
|
56838
56896
|
if (!guard.claim()) return { hardFailure: true };
|
|
56839
56897
|
await reportBack({ callbackUrl: env2.callbackUrl, runToken, ...finalReportBody(), secrets: secrets() });
|
|
56840
56898
|
return { hardFailure };
|