@quikit/quikpilot-runner 9.3.0-rc.71 → 9.3.0-rc.73
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 +5 -1
- package/dist/index.js +127 -153
- package/dist/index.js.map +3 -3
- package/package.json +30 -30
package/README.md
CHANGED
|
@@ -172,7 +172,11 @@ 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.
|
|
175
|
+
**9.3.0-rc.73 - an endpoint part no longer needs a route line in the added code; every part of a feature counts as built when a file planned for it changed (QUIKTR-2325).** In the live trial of 8 Nov 2026 (run QUIKSPL-370) the AI built every layer of a feature: a new POST restore route in `src/server.js` and a "Recently deleted" section in `public/index.html`. The run still failed in both attempts with "P3 Expense restore action (endpoint, no route added in src/ledger.js, src/server.js)", because an endpoint part also needed a route line in what its planned file added. That rule refused correct changes: the part's name gave no method or route (the request never named one), QuikSplit writes a route over two lines (`match("api/groups/:id/expenses/:itemId/restore", parts)`, then `method === "POST"` on the next line), and a change to an EXISTING endpoint (a filter added, a field added to its answer) adds no route line at all. Now every part, endpoints included, counts as built when one of the files targeting marked for it (`[Pn]`) was changed or created and is not a test file; targeting sees the code and ties each endpoint part to its file. The same rule holds at the code phase's DONE and at the last gate before the commit. A part none of whose planned files changed still gets the one send-back, which says none of its planned files was changed and names them, and then fails the run `part_missing` ("A part of the feature was not built: P1 … (endpoint, planned in …)."); a changed test file still builds no part. The last gate now reads only which planned files changed (`git status`), not their added lines, and the scope check's route helpers are private again, as in rc.70. Removed tests that asserted the route-line rule; new tests in `partsCheck.test.ts`, `codegenLoopParts.test.ts`, `run.parts.test.ts` and `finalChange.test.ts` (QuikSplit's two-line route, an existing Next.js handler changed in place, a name with no method or route, a change that only took lines out, and the trial's F4 shape passing DONE and the last gate) all fail on rc.72. Two mutations (a route requirement put back for endpoints; a test file counted as building a part) turn tests red. Switched off (`QUIKPILOT_PARTS_CHECK` not `on`), nothing changes.
|
|
176
|
+
|
|
177
|
+
**9.3.0-rc.72 - a stored value the code already has, marked `[Pn=exists]` by targeting, no longer stops the run; only a new stored value QuikPilot cannot add here does (QUIKTR-2326).** In the live trial of 8 Nov 2026 a feature's design listed a stored part for a value that is already in the code ("The existing deleted state on an expense"). Nothing needed building for it, so targeting left it unmarked, and the run stopped before any code with "This feature needs a stored value QuikPilot cannot add here": a false stop. With the AI Runtime change that ships alongside, targeting marks such a part `[P5=exists]` at the start of a plan step that uses it (lower case `exists`; only a stored part may carry it). Behind `QUIKPILOT_PARTS_CHECK=on`, the runner now reads that mark: a stored part marked `=exists` is not a stop, and it is left out of the parts the code phase's DONE and the last gate before the commit hold the change to, so neither asks for a value that is already there to be built. Everything else is what it was: a stored part marked plainly (`[P5]`) must be built like any part, even when it also carries `=exists`; a stored part with no mark at all still stops the run `needs_database_change` with the same sentence; a part of any other kind whose only mark is `=exists` counts as unmarked and stops the run `part_not_placed`; a mark with any other ending (`[P5=foo]`, `[P5=EXISTS]`) is no mark. The log names the stored parts taken as already there (`parts_check.after_targeting`: a count and the ids, plus `ignored` for an `=exists` mark on a part that is not stored), only when there is one; never a step's text. Switched off, nothing changes. New tests in `partsCheck.test.ts`, `run.parts.test.ts` (the F4 shape: a screen, two endpoints and the page's data marked plainly and the stored value `[P5=exists]` goes on to write the code and commit, in two phases and in one) and `codegenLoopParts.test.ts`; three mutations (`=exists` read as a plain mark, the stored-only rule dropped, the existing part kept in the code phase's parts) all turn tests red. Until the AI Runtime sends `[Pn=exists]`, the run is what it was in rc.71.
|
|
178
|
+
|
|
179
|
+
**9.3.0-rc.71 - a feature's parts must each be built before a pull request, a feature needing a database change stops before any code, and the files left out of a pull request are named (QUIKTR-2325, QUIKTR-2326).** In Round B (8 Nov 2026) pull requests opened for features with only one layer built and said nothing was wrong: F4 built two inner functions and never the route or the page section, F7 a card nothing feeds data, F8 used a database field that does not exist. With the AI Runtime's design step asked for them, a feature design now lists its `parts` (`P1`..`P8`, each `endpoint`, `screen`, `data`, `stored` or `logic`, with a name and what it is for), and targeting marks the plan step that builds each one (`[P2] add the restore route`); a stored value whose definition is outside the folder the run may change is left unmarked. Behind `QUIKPILOT_PARTS_CHECK=on` (off by default, read once; `parts_check.on` in the log) the runner then: (1) sends targeting `partsCheck: true` with the design as it is, and only then: otherwise `design.parts` is taken out, so the request is byte for byte rc.70's; (2) after targeting and before any code, stops the run when a part has no marked step: a stored part as `needs_database_change` ("This feature needs a stored value QuikPilot cannot add here: <name> — <what>. Add the field and its migration first, or narrow the feature."), any other as `part_not_placed` ("No file was planned for a part of the feature: <id> <name> (<kind>). Nothing was written. Run it again, or narrow the feature."), reported like a refused plan (a failed run whose reason is that sentence; no code, no commit, no pull request); (3) at the code phase's DONE (two phases only), holds each part to a changed or created file among its marked files that is not a test, and an endpoint to a route line with its method (and its route, when the name gives one) in what that file added, read with the scope check's own route patterns (the route-line rule was dropped in rc.73). A part missing gets ONE send-back (rule `done_rule`, a sentence per part naming its planned files, its own counter, never on a final turn), then the attempt fails `part_missing`, and the run's reason starts "A part of the feature was not built:" with the parts and their files; (4) just before the commit, after every fix and the project's Format, holds the FINAL change to the same rule once more, read from the working tree against the checkout's commit (`git status`, then each part file's added lines, no longer read since rc.73; a new file's whole text; the loop's own test rule), which also covers a give-up whose change was kept, one phase and the per-file calls: a part missing fails the run with the same "A part of the feature was not built:" reason, no commit, no push, no pull request (`parts_check.final` in the log). The parts never reach the tests phase, the one amendment, a fix or the review fix, and are never sent to the code-writing AI; logs carry the word, counts and ids only (`codegen.parts_check`, `parts_check.stop`). Always on, reporting only: the note about files a scoped stage left out now names them (at most ten), "2 changed files outside apps/x were left out of the pull request (changed while the project's commands ran): a, b + 1 protected file."; a protected file (the project's denied paths, credential, secret-shaped, other-ecosystem lock and git files) is counted, never named. New tests in `partsCheck.test.ts`, `codegenLoopParts.test.ts`, `targeting.parts.test.ts`, `run.parts.test.ts`, `finalChange.test.ts` and `guardrail.test.ts`; ten mutations (no once-guard, the counter shared with the import check, no route check, parts sent to the tests phase, parts not taken out when off, no stored stop; and for the last gate: logged but not failed, only with one phase, on the switch alone, no test rule) all turn tests red. Needs the AI Runtime and QuikProjects of QUIKTR-2325 for parts to exist at all; with none, nothing changes.
|
|
176
180
|
|
|
177
181
|
**9.3.0-rc.70 - the scope check no longer fails a run for a route the design did declare when a comment puts a colon straight after the route (QUIKTR-2077).** Run QUIKSPL-354 (6 Nov 2026, a Task on the QuikSplit pilot repo) failed at the scope check with "adds POST /api/groups/:id/expenses/:expenseId/restore:, not declared in the design's API changes", although the design listed exactly that route. The route pattern lets `:` into every segment so that `:id` parameters match, and that also let a colon that only ended the route in a comment join the path, so `.../restore:` did not match the declared `.../restore`. Now a route read from the added code has trailing colons removed before it is compared (and before it is shown in the failure message). Nothing else changes: an undeclared route still fails, with or without a colon after it; comment lines are still read (the original QUIKTR-1081 incident was a documenting comment); parameter routes ending in `:name` are untouched. Four new tests in `scopeCheck.test.ts`; three mutations (no strip, strip a trailing `:name` too, skip comment lines) all turn tests red.
|
|
178
182
|
|
package/dist/index.js
CHANGED
|
@@ -47367,72 +47367,6 @@ function reviewAnswer(lines) {
|
|
|
47367
47367
|
return { rules: ["done_rule"], violations: [...lines.slice(0, MAX_REVIEW_CASES), REVIEW_CLOSING], message: REVIEW_MESSAGE };
|
|
47368
47368
|
}
|
|
47369
47369
|
|
|
47370
|
-
// src/scopeCheck.ts
|
|
47371
|
-
var import_node_fs16 = require("node:fs");
|
|
47372
|
-
var ROUTE_METHOD_RE = /\b(GET|POST|PUT|PATCH|DELETE)\b/i;
|
|
47373
|
-
var ROUTE_PATH_RE = /\/[A-Za-z0-9_\-{}[\]]+(?:\/[A-Za-z0-9_\-:{}[\]]+)+/;
|
|
47374
|
-
var ROUTE_EXPORT_RE = /\bexport\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)\s*\(/;
|
|
47375
|
-
var NO_PATH = "(this file's route)";
|
|
47376
|
-
function detectMentions(text3) {
|
|
47377
|
-
const found = [];
|
|
47378
|
-
for (const line of text3.split("\n")) {
|
|
47379
|
-
const methodMatch = ROUTE_METHOD_RE.exec(line);
|
|
47380
|
-
const pathMatch = ROUTE_PATH_RE.exec(line);
|
|
47381
|
-
if (methodMatch && pathMatch) {
|
|
47382
|
-
found.push({ method: methodMatch[1].toUpperCase(), path: pathMatch[0].replace(/:+$/, "") });
|
|
47383
|
-
}
|
|
47384
|
-
const exportMatch = ROUTE_EXPORT_RE.exec(line);
|
|
47385
|
-
if (exportMatch) {
|
|
47386
|
-
found.push({ method: exportMatch[1].toUpperCase(), path: NO_PATH });
|
|
47387
|
-
}
|
|
47388
|
-
}
|
|
47389
|
-
return found;
|
|
47390
|
-
}
|
|
47391
|
-
function normalizePath(path) {
|
|
47392
|
-
return path.replace(/:[A-Za-z0-9_]+|\{[^}]+\}|\[[^\]]+\]/g, "*");
|
|
47393
|
-
}
|
|
47394
|
-
function surfaceCovers(surface, mention) {
|
|
47395
|
-
if (!new RegExp(`\\b${mention.method}\\b`, "i").test(surface)) return false;
|
|
47396
|
-
if (mention.path === NO_PATH) return true;
|
|
47397
|
-
const declaredPath = normalizePath(surface);
|
|
47398
|
-
const mentionPath = normalizePath(mention.path);
|
|
47399
|
-
return declaredPath.includes(mentionPath) || mentionPath.includes(declaredPath);
|
|
47400
|
-
}
|
|
47401
|
-
function addedLines(before, after) {
|
|
47402
|
-
const beforeLines = new Set(before.split("\n"));
|
|
47403
|
-
return after.split("\n").filter((line) => !beforeLines.has(line)).join("\n");
|
|
47404
|
-
}
|
|
47405
|
-
function checkApiScope(results, targets, apiChanges) {
|
|
47406
|
-
const targetsByPath = new Map(targets.map((t) => [t.path, t]));
|
|
47407
|
-
const violations = [];
|
|
47408
|
-
for (const { targetPath, newContent } of results) {
|
|
47409
|
-
if (isTestFile(targetPath)) continue;
|
|
47410
|
-
const target = targetsByPath.get(targetPath);
|
|
47411
|
-
const isNewFile = target?.kind === "NEW_FILE";
|
|
47412
|
-
let scanned;
|
|
47413
|
-
if (isNewFile) {
|
|
47414
|
-
scanned = newContent;
|
|
47415
|
-
} else {
|
|
47416
|
-
let currentContent;
|
|
47417
|
-
try {
|
|
47418
|
-
currentContent = (0, import_node_fs16.readFileSync)(targetPath, "utf8");
|
|
47419
|
-
} catch {
|
|
47420
|
-
currentContent = "";
|
|
47421
|
-
}
|
|
47422
|
-
scanned = addedLines(currentContent, newContent);
|
|
47423
|
-
}
|
|
47424
|
-
for (const mention of detectMentions(scanned)) {
|
|
47425
|
-
if (!apiChanges.some((c) => surfaceCovers(c.surface, mention))) {
|
|
47426
|
-
violations.push({ file: targetPath, method: mention.method, path: mention.path });
|
|
47427
|
-
}
|
|
47428
|
-
}
|
|
47429
|
-
}
|
|
47430
|
-
return { blocked: violations.length > 0, violations };
|
|
47431
|
-
}
|
|
47432
|
-
function describeScopeViolations(check) {
|
|
47433
|
-
return check.violations.map((v) => `${v.file} adds ${v.method} ${v.path}, not declared in the design's API changes`).join("; ");
|
|
47434
|
-
}
|
|
47435
|
-
|
|
47436
47370
|
// src/partsCheck.ts
|
|
47437
47371
|
var PARTS_CHECK_ENV = "QUIKPILOT_PARTS_CHECK";
|
|
47438
47372
|
function partsCheckOn(env2 = process.env) {
|
|
@@ -47443,7 +47377,7 @@ var MAX_PARTS = 8;
|
|
|
47443
47377
|
var MAX_NAME_CHARS3 = 150;
|
|
47444
47378
|
var MAX_WHAT_CHARS = 300;
|
|
47445
47379
|
var PART_ID_RE = /^P\d+$/;
|
|
47446
|
-
var MARKER_RE = /\[(P\d+)
|
|
47380
|
+
var MARKER_RE = /\[(P\d+)(?:=(exists))?\]/g;
|
|
47447
47381
|
function isRecord3(x) {
|
|
47448
47382
|
return typeof x === "object" && x !== null && !Array.isArray(x);
|
|
47449
47383
|
}
|
|
@@ -47472,19 +47406,35 @@ function designForTargeting(design, on) {
|
|
|
47472
47406
|
void _parts;
|
|
47473
47407
|
return { design: rest, partsCheck: false };
|
|
47474
47408
|
}
|
|
47475
|
-
function
|
|
47476
|
-
const
|
|
47409
|
+
function readMarks(targets) {
|
|
47410
|
+
const placed = /* @__PURE__ */ new Map();
|
|
47411
|
+
const exists = /* @__PURE__ */ new Set();
|
|
47477
47412
|
for (const t of targets) {
|
|
47478
47413
|
for (const step of t.planStepsImplemented ?? []) {
|
|
47479
47414
|
if (typeof step !== "string") continue;
|
|
47480
47415
|
for (const m of step.matchAll(MARKER_RE)) {
|
|
47481
|
-
|
|
47416
|
+
if (m[2] === "exists") {
|
|
47417
|
+
exists.add(m[1]);
|
|
47418
|
+
continue;
|
|
47419
|
+
}
|
|
47420
|
+
const paths = placed.get(m[1]) ?? [];
|
|
47482
47421
|
if (!paths.includes(t.path)) paths.push(t.path);
|
|
47483
|
-
|
|
47422
|
+
placed.set(m[1], paths);
|
|
47484
47423
|
}
|
|
47485
47424
|
}
|
|
47486
47425
|
}
|
|
47487
|
-
return
|
|
47426
|
+
return { placed, exists };
|
|
47427
|
+
}
|
|
47428
|
+
function takenAsExisting(part, marks) {
|
|
47429
|
+
return part.kind === "stored" && marks.exists.has(part.id) && !marks.placed.has(part.id);
|
|
47430
|
+
}
|
|
47431
|
+
function existsMarked(parts2, targets) {
|
|
47432
|
+
const marks = readMarks(targets);
|
|
47433
|
+
const onlyExists = parts2.filter((p) => marks.exists.has(p.id) && !marks.placed.has(p.id));
|
|
47434
|
+
return {
|
|
47435
|
+
existing: onlyExists.filter((p) => takenAsExisting(p, marks)).map((p) => p.id),
|
|
47436
|
+
ignored: onlyExists.filter((p) => !takenAsExisting(p, marks)).map((p) => p.id)
|
|
47437
|
+
};
|
|
47488
47438
|
}
|
|
47489
47439
|
function words(text3) {
|
|
47490
47440
|
return text3.trim().replace(/\s+/g, " ").replace(/[\s.;:,]+$/, "");
|
|
@@ -47502,8 +47452,8 @@ function notPlacedSentence(parts2) {
|
|
|
47502
47452
|
}
|
|
47503
47453
|
function afterTargeting(parts2, targets) {
|
|
47504
47454
|
if (parts2.length === 0) return null;
|
|
47505
|
-
const
|
|
47506
|
-
const unplaced = parts2.filter((p) => !
|
|
47455
|
+
const marks = readMarks(targets);
|
|
47456
|
+
const unplaced = parts2.filter((p) => !marks.placed.has(p.id) && !takenAsExisting(p, marks));
|
|
47507
47457
|
if (unplaced.length === 0) return null;
|
|
47508
47458
|
const stored = unplaced.filter((p) => p.kind === "stored");
|
|
47509
47459
|
if (stored.length > 0) return { reason: "needs_database_change", ids: stored.map((p) => p.id), sentence: storedSentence(stored) };
|
|
@@ -47520,54 +47470,12 @@ var PartsStopError = class extends Error {
|
|
|
47520
47470
|
}
|
|
47521
47471
|
};
|
|
47522
47472
|
function partsForCode(parts2, targets) {
|
|
47523
|
-
const
|
|
47524
|
-
return parts2.map((p) => ({ id: p.id, kind: p.kind, name: p.name, paths:
|
|
47525
|
-
}
|
|
47526
|
-
function
|
|
47527
|
-
const m = ROUTE_METHOD_RE.exec(name2);
|
|
47528
|
-
return m && m[1] === m[1].toUpperCase() ? m[1] : void 0;
|
|
47529
|
-
}
|
|
47530
|
-
function routeIsThePart(name2, mention) {
|
|
47531
|
-
const method = methodOf(name2);
|
|
47532
|
-
if (method && mention.method !== method) return false;
|
|
47533
|
-
const path = ROUTE_PATH_RE.exec(name2)?.[0]?.replace(/:+$/, "");
|
|
47534
|
-
if (!path) return true;
|
|
47535
|
-
return surfaceCovers(`${mention.method} ${path}`, mention);
|
|
47536
|
-
}
|
|
47537
|
-
function lastFixedSegment(name2) {
|
|
47538
|
-
const path = ROUTE_PATH_RE.exec(name2)?.[0]?.replace(/:+$/, "");
|
|
47539
|
-
if (!path) return void 0;
|
|
47540
|
-
const fixed = path.split("/").filter((s) => s && !/^[:{[]/.test(s));
|
|
47541
|
-
return fixed.length ? fixed[fixed.length - 1].toLowerCase() : void 0;
|
|
47542
|
-
}
|
|
47543
|
-
var EXPORTED_HANDLER_RE = /\bexport\s+(?:const|let|(?:async\s+)?function)\s+(GET|POST|PUT|PATCH|DELETE)\b/;
|
|
47544
|
-
function looseRouteIsThePart(name2, filePath, added) {
|
|
47545
|
-
const method = methodOf(name2);
|
|
47546
|
-
const segment = lastFixedSegment(name2);
|
|
47547
|
-
const hasSegment = (text3) => segment === void 0 || new RegExp(`(^|[^A-Za-z0-9_])${segment.replace(/[.*+?^${}()|[\]\\-]/g, "\\$&")}([^A-Za-z0-9_]|$)`, "i").test(text3);
|
|
47548
|
-
const exported = EXPORTED_HANDLER_RE.exec(added);
|
|
47549
|
-
if (exported && (!method || exported[1] === method) && hasSegment(filePath.replace(/\\/g, "/"))) return true;
|
|
47550
|
-
if (segment === void 0) return false;
|
|
47551
|
-
const methodSaid = !method || new RegExp(`\\b${method}\\b`, "i").test(added);
|
|
47552
|
-
return methodSaid && hasSegment(added);
|
|
47553
|
-
}
|
|
47554
|
-
function missingAtDone(parts2, changed, addedLinesOf, isTest) {
|
|
47473
|
+
const marks = readMarks(targets);
|
|
47474
|
+
return parts2.filter((p) => !takenAsExisting(p, marks)).map((p) => ({ id: p.id, kind: p.kind, name: p.name, paths: marks.placed.get(p.id) ?? [] }));
|
|
47475
|
+
}
|
|
47476
|
+
function missingAtDone(parts2, changed, isTest) {
|
|
47555
47477
|
const changedSet = new Set(changed);
|
|
47556
|
-
|
|
47557
|
-
for (const part of parts2) {
|
|
47558
|
-
const built = part.paths.filter((p) => changedSet.has(p) && !isTest(p));
|
|
47559
|
-
if (built.length === 0) {
|
|
47560
|
-
missing.push({ part, why: "unchanged" });
|
|
47561
|
-
continue;
|
|
47562
|
-
}
|
|
47563
|
-
if (part.kind === "endpoint" && !built.some((p) => {
|
|
47564
|
-
const added = addedLinesOf(p) ?? "";
|
|
47565
|
-
return detectMentions(added).some((m) => routeIsThePart(part.name, m)) || looseRouteIsThePart(part.name, p, added);
|
|
47566
|
-
})) {
|
|
47567
|
-
missing.push({ part, why: "no_route" });
|
|
47568
|
-
}
|
|
47569
|
-
}
|
|
47570
|
-
return missing;
|
|
47478
|
+
return parts2.filter((part) => !part.paths.some((p) => changedSet.has(p) && !isTest(p))).map((part) => ({ part, why: "unchanged" }));
|
|
47571
47479
|
}
|
|
47572
47480
|
var PARTS_MESSAGE = "Your answer was sent back: the approved design lists parts this feature needs, and your change does not build each one yet. Each sentence names a part and the files the plan chose for it. This check is made once.";
|
|
47573
47481
|
function withFiles(build, paths) {
|
|
@@ -47580,7 +47488,7 @@ function withFiles(build, paths) {
|
|
|
47580
47488
|
}
|
|
47581
47489
|
function partSentence(m) {
|
|
47582
47490
|
const head = `Part ${m.part.id} (${m.part.kind}) "${words(m.part.name)}" is not built: `;
|
|
47583
|
-
return
|
|
47491
|
+
return withFiles((files) => `${head}none of its planned files was changed (${files}). Build it there.`, m.part.paths);
|
|
47584
47492
|
}
|
|
47585
47493
|
function partsAnswer(missing) {
|
|
47586
47494
|
return { rules: ["done_rule"], violations: missing.slice(0, MAX_REFUSED_SENTENCES).map(partSentence), message: PARTS_MESSAGE };
|
|
@@ -47589,7 +47497,7 @@ function partMissingSentence(missing) {
|
|
|
47589
47497
|
const item = (m, short) => {
|
|
47590
47498
|
const paths = m.part.paths;
|
|
47591
47499
|
const files = paths.length === 0 ? "no file" : short && paths.length > 1 ? `${paths[0]} and ${paths.length - 1} more` : paths.join(", ");
|
|
47592
|
-
return `${m.part.id} ${words(m.part.name)} (${m.part.kind},
|
|
47500
|
+
return `${m.part.id} ${words(m.part.name)} (${m.part.kind}, planned in ${files})`;
|
|
47593
47501
|
};
|
|
47594
47502
|
const fits = (s) => s.length <= MAX_REFUSED_SENTENCE_CHARS;
|
|
47595
47503
|
for (const short of [false, true]) {
|
|
@@ -48352,16 +48260,7 @@ async function runCodegenLoop(args2, deps) {
|
|
|
48352
48260
|
}
|
|
48353
48261
|
}
|
|
48354
48262
|
if (args2.phase === "code" && args2.parts && args2.parts.length > 0) {
|
|
48355
|
-
const missingParts = missingAtDone(
|
|
48356
|
-
args2.parts,
|
|
48357
|
-
overlay.changedPaths(),
|
|
48358
|
-
(p) => {
|
|
48359
|
-
const entry = overlay.get(p);
|
|
48360
|
-
if (!entry) return null;
|
|
48361
|
-
return entry.created || entry.originalLf === null ? entry.lf : addedLines(entry.originalLf, entry.lf);
|
|
48362
|
-
},
|
|
48363
|
-
looksLikeTest
|
|
48364
|
-
);
|
|
48263
|
+
const missingParts = missingAtDone(args2.parts, overlay.changedPaths(), looksLikeTest);
|
|
48365
48264
|
if (missingParts.length > 0) {
|
|
48366
48265
|
const ids = missingParts.map((m) => m.part.id);
|
|
48367
48266
|
if (partRefusals < 1 && !isFinal) {
|
|
@@ -49018,7 +48917,7 @@ function buildCodegenLoopRecord(loop) {
|
|
|
49018
48917
|
}
|
|
49019
48918
|
|
|
49020
48919
|
// src/codegenLoopContext.ts
|
|
49021
|
-
var
|
|
48920
|
+
var import_node_fs16 = require("node:fs");
|
|
49022
48921
|
|
|
49023
48922
|
// src/langReach.ts
|
|
49024
48923
|
var import_node_path19 = require("node:path");
|
|
@@ -49414,7 +49313,7 @@ function asLf(text3) {
|
|
|
49414
49313
|
return toLf(text3.charCodeAt(0) === 65279 ? text3.slice(1) : text3);
|
|
49415
49314
|
}
|
|
49416
49315
|
function collectLoopContext(p) {
|
|
49417
|
-
const readFile = p.readFile ?? ((path) => (0,
|
|
49316
|
+
const readFile = p.readFile ?? ((path) => (0, import_node_fs16.readFileSync)(path, "utf8"));
|
|
49418
49317
|
const listing = new Set(p.listing);
|
|
49419
49318
|
const mapSpecifier = p.mapSpecifier ?? createAliasMapper({
|
|
49420
49319
|
readText: (path) => {
|
|
@@ -49581,7 +49480,7 @@ function mapModeMessage(phase, reason) {
|
|
|
49581
49480
|
}
|
|
49582
49481
|
|
|
49583
49482
|
// src/testsToCheck.ts
|
|
49584
|
-
var
|
|
49483
|
+
var import_node_fs17 = require("node:fs");
|
|
49585
49484
|
var import_node_path20 = require("node:path");
|
|
49586
49485
|
var MAX_TESTS_TO_CHECK = 10;
|
|
49587
49486
|
var SECOND_HOP_BELOW = 3;
|
|
@@ -49633,7 +49532,7 @@ function testsToCheck(i3) {
|
|
|
49633
49532
|
}
|
|
49634
49533
|
var readFromRoot = (root) => (rel) => {
|
|
49635
49534
|
try {
|
|
49636
|
-
return (0,
|
|
49535
|
+
return (0, import_node_fs17.readFileSync)((0, import_node_path20.join)(root, rel), "utf8");
|
|
49637
49536
|
} catch {
|
|
49638
49537
|
return null;
|
|
49639
49538
|
}
|
|
@@ -50069,7 +49968,7 @@ async function runCodegenStep(p) {
|
|
|
50069
49968
|
}
|
|
50070
49969
|
|
|
50071
49970
|
// src/codegenHeal.ts
|
|
50072
|
-
var
|
|
49971
|
+
var import_node_fs18 = require("node:fs");
|
|
50073
49972
|
|
|
50074
49973
|
// src/heal.ts
|
|
50075
49974
|
var MAX_ATTEMPTS_IN_ALL = 3;
|
|
@@ -50149,7 +50048,7 @@ async function runHealAttempt(i3) {
|
|
|
50149
50048
|
const created = i3.results.map((r) => r.targetPath).filter((path) => !listed.has(path));
|
|
50150
50049
|
const workspaceListing = [...p.workspaceListing, ...created];
|
|
50151
50050
|
const targets = p.targets.map((t) => t.kind === "NEW_FILE" && keptText.has(t.path) ? { ...t, kind: "EXISTING" } : t);
|
|
50152
|
-
const disk = p.readFile ?? ((path) => (0,
|
|
50051
|
+
const disk = p.readFile ?? ((path) => (0, import_node_fs18.readFileSync)(path, "utf8"));
|
|
50153
50052
|
const readFile = (path) => keptText.get(path) ?? disk(path);
|
|
50154
50053
|
const discoveredTests = discoveredTestsOf(p.testDiscovery);
|
|
50155
50054
|
const context = collectLoopContext({ targets, listing: workspaceListing, deniedPaths: p.deniedPaths, writeRoot: p.writeRoot ?? "", ...discoveredTests ? { discoveredTests } : {}, readFile });
|
|
@@ -50413,6 +50312,74 @@ async function runVerifyAndFix(p) {
|
|
|
50413
50312
|
var import_node_child_process9 = require("node:child_process");
|
|
50414
50313
|
var import_node_fs20 = require("node:fs");
|
|
50415
50314
|
var import_node_path21 = require("node:path");
|
|
50315
|
+
|
|
50316
|
+
// src/scopeCheck.ts
|
|
50317
|
+
var import_node_fs19 = require("node:fs");
|
|
50318
|
+
var ROUTE_METHOD_RE = /\b(GET|POST|PUT|PATCH|DELETE)\b/i;
|
|
50319
|
+
var ROUTE_PATH_RE = /\/[A-Za-z0-9_\-{}[\]]+(?:\/[A-Za-z0-9_\-:{}[\]]+)+/;
|
|
50320
|
+
var ROUTE_EXPORT_RE = /\bexport\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)\s*\(/;
|
|
50321
|
+
var NO_PATH = "(this file's route)";
|
|
50322
|
+
function detectMentions(text3) {
|
|
50323
|
+
const found = [];
|
|
50324
|
+
for (const line of text3.split("\n")) {
|
|
50325
|
+
const methodMatch = ROUTE_METHOD_RE.exec(line);
|
|
50326
|
+
const pathMatch = ROUTE_PATH_RE.exec(line);
|
|
50327
|
+
if (methodMatch && pathMatch) {
|
|
50328
|
+
found.push({ method: methodMatch[1].toUpperCase(), path: pathMatch[0].replace(/:+$/, "") });
|
|
50329
|
+
}
|
|
50330
|
+
const exportMatch = ROUTE_EXPORT_RE.exec(line);
|
|
50331
|
+
if (exportMatch) {
|
|
50332
|
+
found.push({ method: exportMatch[1].toUpperCase(), path: NO_PATH });
|
|
50333
|
+
}
|
|
50334
|
+
}
|
|
50335
|
+
return found;
|
|
50336
|
+
}
|
|
50337
|
+
function normalizePath(path) {
|
|
50338
|
+
return path.replace(/:[A-Za-z0-9_]+|\{[^}]+\}|\[[^\]]+\]/g, "*");
|
|
50339
|
+
}
|
|
50340
|
+
function surfaceCovers(surface, mention) {
|
|
50341
|
+
if (!new RegExp(`\\b${mention.method}\\b`, "i").test(surface)) return false;
|
|
50342
|
+
if (mention.path === NO_PATH) return true;
|
|
50343
|
+
const declaredPath = normalizePath(surface);
|
|
50344
|
+
const mentionPath = normalizePath(mention.path);
|
|
50345
|
+
return declaredPath.includes(mentionPath) || mentionPath.includes(declaredPath);
|
|
50346
|
+
}
|
|
50347
|
+
function addedLines(before, after) {
|
|
50348
|
+
const beforeLines = new Set(before.split("\n"));
|
|
50349
|
+
return after.split("\n").filter((line) => !beforeLines.has(line)).join("\n");
|
|
50350
|
+
}
|
|
50351
|
+
function checkApiScope(results, targets, apiChanges) {
|
|
50352
|
+
const targetsByPath = new Map(targets.map((t) => [t.path, t]));
|
|
50353
|
+
const violations = [];
|
|
50354
|
+
for (const { targetPath, newContent } of results) {
|
|
50355
|
+
if (isTestFile(targetPath)) continue;
|
|
50356
|
+
const target = targetsByPath.get(targetPath);
|
|
50357
|
+
const isNewFile = target?.kind === "NEW_FILE";
|
|
50358
|
+
let scanned;
|
|
50359
|
+
if (isNewFile) {
|
|
50360
|
+
scanned = newContent;
|
|
50361
|
+
} else {
|
|
50362
|
+
let currentContent;
|
|
50363
|
+
try {
|
|
50364
|
+
currentContent = (0, import_node_fs19.readFileSync)(targetPath, "utf8");
|
|
50365
|
+
} catch {
|
|
50366
|
+
currentContent = "";
|
|
50367
|
+
}
|
|
50368
|
+
scanned = addedLines(currentContent, newContent);
|
|
50369
|
+
}
|
|
50370
|
+
for (const mention of detectMentions(scanned)) {
|
|
50371
|
+
if (!apiChanges.some((c) => surfaceCovers(c.surface, mention))) {
|
|
50372
|
+
violations.push({ file: targetPath, method: mention.method, path: mention.path });
|
|
50373
|
+
}
|
|
50374
|
+
}
|
|
50375
|
+
}
|
|
50376
|
+
return { blocked: violations.length > 0, violations };
|
|
50377
|
+
}
|
|
50378
|
+
function describeScopeViolations(check) {
|
|
50379
|
+
return check.violations.map((v) => `${v.file} adds ${v.method} ${v.path}, not declared in the design's API changes`).join("; ");
|
|
50380
|
+
}
|
|
50381
|
+
|
|
50382
|
+
// src/hunkCheck.ts
|
|
50416
50383
|
var MAX_REPORTED_HUNKS = 20;
|
|
50417
50384
|
function toFinding(r) {
|
|
50418
50385
|
if (r.unnecessary.length === 0) return void 0;
|
|
@@ -51985,7 +51952,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
|
51985
51952
|
var REPORT_COPY = "final-test-report.xml";
|
|
51986
51953
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
51987
51954
|
var MAX_FILES = 200;
|
|
51988
|
-
var RUNNER_VERSION = true ? "9.3.0-rc.
|
|
51955
|
+
var RUNNER_VERSION = true ? "9.3.0-rc.73" : "dev";
|
|
51989
51956
|
function safeDestination(base, repoPath) {
|
|
51990
51957
|
if (!repoPath || (0, import_node_path26.isAbsolute)(repoPath)) return null;
|
|
51991
51958
|
const destination = (0, import_node_path26.resolve)(base, repoPath);
|
|
@@ -52080,19 +52047,14 @@ function changesAgainstBase(root, wanted) {
|
|
|
52080
52047
|
const changed = new Set(
|
|
52081
52048
|
status.split("\0").filter((entry) => entry.length > 3).map((entry) => entry.slice(3))
|
|
52082
52049
|
);
|
|
52083
|
-
|
|
52084
|
-
|
|
52085
|
-
if (!changed.has(path)) continue;
|
|
52086
|
-
let current2;
|
|
52050
|
+
return [...wanted].sort().filter((path) => {
|
|
52051
|
+
if (!changed.has(path)) return false;
|
|
52087
52052
|
try {
|
|
52088
|
-
|
|
52053
|
+
return (0, import_node_fs26.statSync)((0, import_node_path27.join)(root, path)).isFile();
|
|
52089
52054
|
} catch {
|
|
52090
|
-
|
|
52055
|
+
return false;
|
|
52091
52056
|
}
|
|
52092
|
-
|
|
52093
|
-
out2.push({ path, added: base === null ? current2 : addedLines(base.replace(/\r\n/g, "\n"), current2) });
|
|
52094
|
-
}
|
|
52095
|
-
return out2;
|
|
52057
|
+
});
|
|
52096
52058
|
}
|
|
52097
52059
|
|
|
52098
52060
|
// src/testDiscovery.ts
|
|
@@ -52849,6 +52811,19 @@ async function run2(env2) {
|
|
|
52849
52811
|
`QuikPilot's generated plan gives two files identical instructions \u2014 ${describeOverlapWarnings(blockingOverlaps).join("; ")}`
|
|
52850
52812
|
);
|
|
52851
52813
|
}
|
|
52814
|
+
if (designParts.length > 0) {
|
|
52815
|
+
const exists = existsMarked(designParts, targeting.targets);
|
|
52816
|
+
if (exists.existing.length > 0 || exists.ignored.length > 0) {
|
|
52817
|
+
console.log(
|
|
52818
|
+
JSON.stringify({
|
|
52819
|
+
event: "parts_check.after_targeting",
|
|
52820
|
+
existing: exists.existing.length,
|
|
52821
|
+
ids: exists.existing,
|
|
52822
|
+
...exists.ignored.length > 0 ? { ignored: exists.ignored } : {}
|
|
52823
|
+
})
|
|
52824
|
+
);
|
|
52825
|
+
}
|
|
52826
|
+
}
|
|
52852
52827
|
const partsStop = afterTargeting(designParts, targeting.targets);
|
|
52853
52828
|
if (partsStop) {
|
|
52854
52829
|
console.log(JSON.stringify({ event: "parts_check.stop", reason: partsStop.reason, ids: partsStop.ids }));
|
|
@@ -53071,9 +53046,8 @@ async function run2(env2) {
|
|
|
53071
53046
|
}
|
|
53072
53047
|
if (designParts.length > 0) {
|
|
53073
53048
|
const finalParts = partsForCode(designParts, targeting.targets);
|
|
53074
|
-
const
|
|
53075
|
-
const
|
|
53076
|
-
const missing = missingAtDone(finalParts, [...added.keys()], (p) => added.get(p) ?? null, testRule(discoveredTestsOf(codegenDiscovery)));
|
|
53049
|
+
const changed = changesAgainstBase(process.cwd(), new Set(finalParts.flatMap((p) => p.paths)));
|
|
53050
|
+
const missing = missingAtDone(finalParts, changed, testRule(discoveredTestsOf(codegenDiscovery)));
|
|
53077
53051
|
const ids = missing.map((m) => m.part.id);
|
|
53078
53052
|
console.log(JSON.stringify({ event: "parts_check.final", outcome: missing.length > 0 ? "missing" : "ok", missing: missing.length, ids }));
|
|
53079
53053
|
if (missing.length > 0) throw new PartsStopError({ reason: "part_missing", ids, sentence: partMissingSentence(missing) });
|