@quikit/quikpilot-runner 9.2.0-rc.5 → 9.2.0-rc.7
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 +13 -1
- package/dist/index.js +314 -111
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,18 @@ gains `targeting.loop_start`, `targeting.loop_turn`, `targeting.loop_refused`, `
|
|
|
43
43
|
and counts only, never content). Without the variable nothing changes. The workflow file is unchanged; the `env:` line
|
|
44
44
|
is the only edit, and it is optional.
|
|
45
45
|
|
|
46
|
+
**9.2.0 (release candidates) — repository commands no longer see the runner's credentials (always on).** Your setup,
|
|
47
|
+
lint, format and test commands, and the baseline checks, run code nobody has reviewed yet (new tests, a dependency's install
|
|
48
|
+
script). They used to inherit the runner's whole environment, which includes the variables GitHub gives a job that has
|
|
49
|
+
`id-token: write` and the addresses the runner reports to. They now run with an allow-listed environment: the search path,
|
|
50
|
+
home and locale, proxy and certificate settings, the toolchain locations the `setup-*` actions export (`JAVA_HOME`, `GOROOT`,
|
|
51
|
+
`CARGO_HOME`, `pythonLocation`, `PNPM_HOME`, ...), and the non-secret `GITHUB_*` and `RUNNER_*` context such as
|
|
52
|
+
`GITHUB_WORKSPACE`. Withheld: `ACTIONS_*`, `GITHUB_TOKEN`, the files that steer later steps of the job (`GITHUB_ENV`,
|
|
53
|
+
`GITHUB_PATH`, `GITHUB_OUTPUT`, `GITHUB_STATE`, `GITHUB_STEP_SUMMARY`), anything whose name reads like a credential, and the
|
|
54
|
+
runner's own inputs (`TOKEN_URL`, `RUN_ID`, ...). The job log says once, by name only, how many variables were withheld. A
|
|
55
|
+
command that needs a variable outside the list will no longer find it. The workflow file is unchanged. This is the second layer
|
|
56
|
+
of QUIKTR-1502; the first is that QuikTrack accepts one token exchange per start of a run.
|
|
57
|
+
|
|
46
58
|
**9.2.0 (release candidates) — the AI can look at the code and edit as it writes it (off by default).** Set
|
|
47
59
|
`QUIKPILOT_CODEGEN_MODE: loop` in the runner step's `env:` and the code-writing step stops making one blind call per file:
|
|
48
60
|
over several short turns the AI may use five tools, the three read-only ones above plus `edit_file` (replace one piece of
|
|
@@ -53,7 +65,7 @@ coverage check, protected paths). A test file that already existed may only be a
|
|
|
53
65
|
must stay, in the same order, and the only change is one block of whole new lines that declares a new test (`it`, `test` or
|
|
54
66
|
`describe`) or new `import` lines, placed before the matched text, after it or between two of its lines (JavaScript and
|
|
55
67
|
TypeScript files; other languages keep the older rule of new text before or after the match). Anything else is answered
|
|
56
|
-
`protected`, an ordinary result the AI reads and tries again from, so a test is never weakened to make code pass. Before its first turn the loop is shown the files the plan named for each target and the files each existing target imports
|
|
68
|
+
`protected`, an ordinary result the AI reads and tries again from, so a test is never weakened to make code pass. Before its first turn the loop is shown the files the plan named for each target, then the EXISTING TESTS of the code it will change (the test file beside each code target, and each existing test target itself, as LF text so an edit can match it), then the files each existing target imports
|
|
57
69
|
(one hop, JavaScript and TypeScript, the same scan and the same limits as the one-file-at-a-time path: 40,000 characters a file
|
|
58
70
|
and 60,000 in all, never a denied path, never the targets themselves), so the project's own names, values and rates are in front
|
|
59
71
|
of it instead of being guessed; the run's context record lists them like the one-file path's. The AI cannot finish before it has
|
package/dist/index.js
CHANGED
|
@@ -94,10 +94,149 @@ async function reportBack(params) {
|
|
|
94
94
|
|
|
95
95
|
// src/commands.ts
|
|
96
96
|
var import_node_child_process = require("node:child_process");
|
|
97
|
+
|
|
98
|
+
// src/commandEnv.ts
|
|
99
|
+
var ALLOWED_NAMES = /* @__PURE__ */ new Set([
|
|
100
|
+
// Identity, locale and scratch space.
|
|
101
|
+
"PATH",
|
|
102
|
+
"Path",
|
|
103
|
+
"HOME",
|
|
104
|
+
"USER",
|
|
105
|
+
"USERNAME",
|
|
106
|
+
"LOGNAME",
|
|
107
|
+
"SHELL",
|
|
108
|
+
"HOSTNAME",
|
|
109
|
+
"TMPDIR",
|
|
110
|
+
"TMP",
|
|
111
|
+
"TEMP",
|
|
112
|
+
"TZ",
|
|
113
|
+
"LANG",
|
|
114
|
+
"LANGUAGE",
|
|
115
|
+
"TERM",
|
|
116
|
+
"COLORTERM",
|
|
117
|
+
"NO_COLOR",
|
|
118
|
+
"FORCE_COLOR",
|
|
119
|
+
"DISPLAY",
|
|
120
|
+
"CI",
|
|
121
|
+
// Windows system variables, for the developer machine.
|
|
122
|
+
"SystemRoot",
|
|
123
|
+
"SYSTEMROOT",
|
|
124
|
+
"windir",
|
|
125
|
+
"COMSPEC",
|
|
126
|
+
"PATHEXT",
|
|
127
|
+
"USERPROFILE",
|
|
128
|
+
"APPDATA",
|
|
129
|
+
"LOCALAPPDATA",
|
|
130
|
+
// Network settings a hosted or self-hosted runner may rely on.
|
|
131
|
+
"HTTP_PROXY",
|
|
132
|
+
"HTTPS_PROXY",
|
|
133
|
+
"NO_PROXY",
|
|
134
|
+
"ALL_PROXY",
|
|
135
|
+
"http_proxy",
|
|
136
|
+
"https_proxy",
|
|
137
|
+
"no_proxy",
|
|
138
|
+
"all_proxy",
|
|
139
|
+
"SSL_CERT_FILE",
|
|
140
|
+
"SSL_CERT_DIR",
|
|
141
|
+
"NODE_EXTRA_CA_CERTS",
|
|
142
|
+
"REQUESTS_CA_BUNDLE",
|
|
143
|
+
"CURL_CA_BUNDLE",
|
|
144
|
+
// Toolchain locations the setup-* actions and the runner image export.
|
|
145
|
+
"NODE_OPTIONS",
|
|
146
|
+
"NODE_PATH",
|
|
147
|
+
"NVM_DIR",
|
|
148
|
+
"ImageOS",
|
|
149
|
+
"ImageVersion",
|
|
150
|
+
"AGENT_TOOLSDIRECTORY",
|
|
151
|
+
"CONDA",
|
|
152
|
+
"pythonLocation",
|
|
153
|
+
"PKG_CONFIG_PATH",
|
|
154
|
+
"LD_LIBRARY_PATH",
|
|
155
|
+
"CARGO_HOME",
|
|
156
|
+
"RUSTUP_HOME",
|
|
157
|
+
"GOPATH",
|
|
158
|
+
"GOMODCACHE",
|
|
159
|
+
"GOCACHE",
|
|
160
|
+
"GOFLAGS",
|
|
161
|
+
"JAVA_HOME",
|
|
162
|
+
"GRADLE_HOME",
|
|
163
|
+
"GRADLE_USER_HOME",
|
|
164
|
+
"MAVEN_HOME",
|
|
165
|
+
"M2_HOME",
|
|
166
|
+
"ANDROID_HOME",
|
|
167
|
+
"ANDROID_SDK_ROOT",
|
|
168
|
+
"GEM_HOME",
|
|
169
|
+
"GEM_PATH",
|
|
170
|
+
"BUNDLE_PATH",
|
|
171
|
+
"PIPX_HOME",
|
|
172
|
+
"PIPX_BIN_DIR",
|
|
173
|
+
"POETRY_HOME",
|
|
174
|
+
"PNPM_HOME",
|
|
175
|
+
"BUN_INSTALL",
|
|
176
|
+
"DENO_INSTALL",
|
|
177
|
+
"DENO_DIR",
|
|
178
|
+
"VOLTA_HOME",
|
|
179
|
+
"COREPACK_HOME",
|
|
180
|
+
"PYENV_ROOT",
|
|
181
|
+
"RBENV_ROOT"
|
|
182
|
+
]);
|
|
183
|
+
var ALLOWED_PREFIXES = [
|
|
184
|
+
"LC_",
|
|
185
|
+
"RUNNER_",
|
|
186
|
+
"GITHUB_",
|
|
187
|
+
"JAVA_HOME_",
|
|
188
|
+
"GOROOT",
|
|
189
|
+
"ANDROID_NDK",
|
|
190
|
+
"Python",
|
|
191
|
+
// Python_ROOT_DIR, Python2_ROOT_DIR, Python3_ROOT_DIR
|
|
192
|
+
"XDG_",
|
|
193
|
+
"DOTNET_",
|
|
194
|
+
"VCPKG_",
|
|
195
|
+
"npm_config_",
|
|
196
|
+
"NPM_CONFIG_"
|
|
197
|
+
];
|
|
198
|
+
var ALWAYS_WITHHELD = /* @__PURE__ */ new Set([
|
|
199
|
+
"GITHUB_TOKEN",
|
|
200
|
+
"GITHUB_ENV",
|
|
201
|
+
"GITHUB_PATH",
|
|
202
|
+
"GITHUB_OUTPUT",
|
|
203
|
+
"GITHUB_STATE",
|
|
204
|
+
"GITHUB_STEP_SUMMARY"
|
|
205
|
+
]);
|
|
206
|
+
var CREDENTIAL_NAME = /(token|secret|password|passwd|credential|private_?key|api_?key)/i;
|
|
207
|
+
function isAllowed(name) {
|
|
208
|
+
if (ALWAYS_WITHHELD.has(name) || CREDENTIAL_NAME.test(name)) return false;
|
|
209
|
+
if (ALLOWED_NAMES.has(name)) return true;
|
|
210
|
+
return ALLOWED_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
211
|
+
}
|
|
212
|
+
function commandEnv(source = process.env) {
|
|
213
|
+
const out = {};
|
|
214
|
+
for (const [name, value] of Object.entries(source)) {
|
|
215
|
+
if (value === void 0) continue;
|
|
216
|
+
if (isAllowed(name)) out[name] = value;
|
|
217
|
+
}
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
220
|
+
function withheldNames(source = process.env) {
|
|
221
|
+
return Object.entries(source).filter(([name, value]) => value !== void 0 && !isAllowed(name)).map(([name]) => name).sort();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// src/commands.ts
|
|
225
|
+
var withheldLogged = false;
|
|
226
|
+
function repositoryCommandEnv() {
|
|
227
|
+
if (!withheldLogged) {
|
|
228
|
+
withheldLogged = true;
|
|
229
|
+
const names = withheldNames();
|
|
230
|
+
if (names.length > 0) {
|
|
231
|
+
console.log(`Repository commands run without ${names.length} environment variable(s): ${names.join(", ")}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return commandEnv();
|
|
235
|
+
}
|
|
97
236
|
function runCommand(command, label) {
|
|
98
237
|
if (!command) return;
|
|
99
238
|
try {
|
|
100
|
-
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit" });
|
|
239
|
+
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit", env: repositoryCommandEnv() });
|
|
101
240
|
} catch (err) {
|
|
102
241
|
throw new Error(`${label} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
103
242
|
}
|
|
@@ -105,7 +244,7 @@ function runCommand(command, label) {
|
|
|
105
244
|
function runTestCommand(command) {
|
|
106
245
|
if (!command) return "success";
|
|
107
246
|
try {
|
|
108
|
-
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit" });
|
|
247
|
+
(0, import_node_child_process.execSync)(command, { shell: "/bin/bash", stdio: "inherit", env: repositoryCommandEnv() });
|
|
109
248
|
return "success";
|
|
110
249
|
} catch {
|
|
111
250
|
return "failure";
|
|
@@ -114,7 +253,7 @@ function runTestCommand(command) {
|
|
|
114
253
|
function runTestCommandAsync(command) {
|
|
115
254
|
if (!command) return Promise.resolve("success");
|
|
116
255
|
return new Promise((resolve5) => {
|
|
117
|
-
const child = (0, import_node_child_process.spawn)(command, { shell: "/bin/bash", stdio: "inherit" });
|
|
256
|
+
const child = (0, import_node_child_process.spawn)(command, { shell: "/bin/bash", stdio: "inherit", env: repositoryCommandEnv() });
|
|
118
257
|
child.on("exit", (code) => resolve5(code === 0 ? "success" : "failure"));
|
|
119
258
|
child.on("error", () => resolve5("failure"));
|
|
120
259
|
});
|
|
@@ -128,7 +267,12 @@ function runCommandWithTimeout(command, timeoutMs) {
|
|
|
128
267
|
clearTimeout(timer);
|
|
129
268
|
resolve5(outcome);
|
|
130
269
|
};
|
|
131
|
-
const child = (0, import_node_child_process.spawn)(command, {
|
|
270
|
+
const child = (0, import_node_child_process.spawn)(command, {
|
|
271
|
+
shell: "/bin/bash",
|
|
272
|
+
stdio: "inherit",
|
|
273
|
+
detached: true,
|
|
274
|
+
env: repositoryCommandEnv()
|
|
275
|
+
});
|
|
132
276
|
const timer = setTimeout(() => {
|
|
133
277
|
try {
|
|
134
278
|
if (child.pid !== void 0) process.kill(-child.pid, "SIGKILL");
|
|
@@ -1220,12 +1364,148 @@ function buildCodegenLoopRecord(loop) {
|
|
|
1220
1364
|
|
|
1221
1365
|
// src/codegenLoopContext.ts
|
|
1222
1366
|
var import_node_fs2 = require("node:fs");
|
|
1367
|
+
|
|
1368
|
+
// src/overlapCheck.ts
|
|
1369
|
+
var TEST_PATH_RE = /(\.(test|spec)\.[jt]sx?$)|(^|\/)(__tests__|tests?)\//i;
|
|
1370
|
+
function isTestTarget(path) {
|
|
1371
|
+
return TEST_PATH_RE.test(path);
|
|
1372
|
+
}
|
|
1373
|
+
var STOPWORDS = /* @__PURE__ */ new Set([
|
|
1374
|
+
"a",
|
|
1375
|
+
"an",
|
|
1376
|
+
"the",
|
|
1377
|
+
"is",
|
|
1378
|
+
"are",
|
|
1379
|
+
"was",
|
|
1380
|
+
"were",
|
|
1381
|
+
"be",
|
|
1382
|
+
"been",
|
|
1383
|
+
"being",
|
|
1384
|
+
"of",
|
|
1385
|
+
"to",
|
|
1386
|
+
"in",
|
|
1387
|
+
"on",
|
|
1388
|
+
"for",
|
|
1389
|
+
"with",
|
|
1390
|
+
"at",
|
|
1391
|
+
"by",
|
|
1392
|
+
"from",
|
|
1393
|
+
"as",
|
|
1394
|
+
"and",
|
|
1395
|
+
"or",
|
|
1396
|
+
"not",
|
|
1397
|
+
"no",
|
|
1398
|
+
"nor",
|
|
1399
|
+
"this",
|
|
1400
|
+
"that",
|
|
1401
|
+
"these",
|
|
1402
|
+
"those",
|
|
1403
|
+
"it",
|
|
1404
|
+
"its",
|
|
1405
|
+
"cannot",
|
|
1406
|
+
"can't",
|
|
1407
|
+
"should",
|
|
1408
|
+
"must",
|
|
1409
|
+
"may",
|
|
1410
|
+
"will",
|
|
1411
|
+
"shall",
|
|
1412
|
+
"when",
|
|
1413
|
+
"if",
|
|
1414
|
+
"than",
|
|
1415
|
+
"then",
|
|
1416
|
+
"so",
|
|
1417
|
+
"do",
|
|
1418
|
+
"does",
|
|
1419
|
+
"did"
|
|
1420
|
+
]);
|
|
1421
|
+
var MIN_WORD_LENGTH = 3;
|
|
1422
|
+
function significantWords(step) {
|
|
1423
|
+
return new Set(
|
|
1424
|
+
step.toLowerCase().replace(/[^a-z0-9\s]/g, " ").split(/\s+/).filter((w) => w.length >= MIN_WORD_LENGTH && !STOPWORDS.has(w))
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1427
|
+
function jaccard(a, b) {
|
|
1428
|
+
if (a.size === 0 || b.size === 0) return 0;
|
|
1429
|
+
let intersection = 0;
|
|
1430
|
+
for (const w of a) if (b.has(w)) intersection++;
|
|
1431
|
+
const union = a.size + b.size - intersection;
|
|
1432
|
+
return intersection / union;
|
|
1433
|
+
}
|
|
1434
|
+
function normalizedStep(step) {
|
|
1435
|
+
return step.trim().toLowerCase().replace(/\s+/g, " ");
|
|
1436
|
+
}
|
|
1437
|
+
var OVERLAP_THRESHOLD = 0.5;
|
|
1438
|
+
function findOverlappingSteps(targets) {
|
|
1439
|
+
const items = targets.flatMap(
|
|
1440
|
+
(target) => target.planStepsImplemented.map((step) => ({
|
|
1441
|
+
target: target.path,
|
|
1442
|
+
step,
|
|
1443
|
+
words: significantWords(step)
|
|
1444
|
+
}))
|
|
1445
|
+
);
|
|
1446
|
+
const warnings = [];
|
|
1447
|
+
for (let i = 0; i < items.length; i++) {
|
|
1448
|
+
for (let j = i + 1; j < items.length; j++) {
|
|
1449
|
+
if (items[i].target === items[j].target) continue;
|
|
1450
|
+
if (isTestTarget(items[i].target) || isTestTarget(items[j].target)) continue;
|
|
1451
|
+
if (jaccard(items[i].words, items[j].words) >= OVERLAP_THRESHOLD) {
|
|
1452
|
+
warnings.push({
|
|
1453
|
+
targetA: items[i].target,
|
|
1454
|
+
stepA: items[i].step,
|
|
1455
|
+
targetB: items[j].target,
|
|
1456
|
+
stepB: items[j].step,
|
|
1457
|
+
severity: normalizedStep(items[i].step) === normalizedStep(items[j].step) ? "identical" : "similar"
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
return warnings;
|
|
1463
|
+
}
|
|
1464
|
+
function describeOverlapWarnings(warnings) {
|
|
1465
|
+
return warnings.map(
|
|
1466
|
+
(w) => `${w.targetA} and ${w.targetB} both implement what looks like the same rule \u2014 "${w.stepA}" / "${w.stepB}". Check these aren't two independent implementations of the same behavior.`
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
// src/codegenLoopContext.ts
|
|
1471
|
+
var TEST_NAME_RE = /^(.+)\.(?:test|spec)\.[cm]?[jt]sx?$/i;
|
|
1472
|
+
var CODE_NAME_RE = /^(.+)\.[cm]?[jt]sx?$/i;
|
|
1473
|
+
function dirOf(path) {
|
|
1474
|
+
const i = path.lastIndexOf("/");
|
|
1475
|
+
return i === -1 ? "" : path.slice(0, i);
|
|
1476
|
+
}
|
|
1477
|
+
function baseOf(path) {
|
|
1478
|
+
return path.slice(path.lastIndexOf("/") + 1);
|
|
1479
|
+
}
|
|
1480
|
+
function parentOf(dir) {
|
|
1481
|
+
return dir === "" ? "" : dirOf(dir);
|
|
1482
|
+
}
|
|
1483
|
+
function pairedTestPaths(codePath, listing) {
|
|
1484
|
+
if (isTestTarget(codePath)) return [];
|
|
1485
|
+
const m = CODE_NAME_RE.exec(baseOf(codePath));
|
|
1486
|
+
if (!m) return [];
|
|
1487
|
+
const stem = m[1].toLowerCase();
|
|
1488
|
+
const dir = dirOf(codePath);
|
|
1489
|
+
const parent = parentOf(dir);
|
|
1490
|
+
const join6 = (d, leaf) => d === "" ? leaf : `${d}/${leaf}`;
|
|
1491
|
+
const homes = /* @__PURE__ */ new Set([dir, join6(dir, "__tests__"), join6(parent, "__tests__"), join6(parent, "tests"), join6(parent, "test")]);
|
|
1492
|
+
const found = [];
|
|
1493
|
+
for (const path of listing) {
|
|
1494
|
+
if (!homes.has(dirOf(path))) continue;
|
|
1495
|
+
const t = TEST_NAME_RE.exec(baseOf(path));
|
|
1496
|
+
if (t && t[1].toLowerCase() === stem) found.push(path);
|
|
1497
|
+
}
|
|
1498
|
+
return found.sort();
|
|
1499
|
+
}
|
|
1500
|
+
function asLf(text) {
|
|
1501
|
+
return toLf(text.charCodeAt(0) === 65279 ? text.slice(1) : text);
|
|
1502
|
+
}
|
|
1223
1503
|
function collectLoopContext(p) {
|
|
1224
1504
|
const readFile = p.readFile ?? ((path) => (0, import_node_fs2.readFileSync)(path, "utf8"));
|
|
1225
1505
|
const listing = new Set(p.listing);
|
|
1226
|
-
const
|
|
1227
|
-
const seen = new Set(targetPaths);
|
|
1506
|
+
const seen = new Set(p.targets.filter((t) => !(t.kind === "EXISTING" && isTestTarget(t.path))).map((t) => t.path));
|
|
1228
1507
|
const entries = [];
|
|
1508
|
+
const testPaths = [];
|
|
1229
1509
|
const records = [];
|
|
1230
1510
|
let total = 0;
|
|
1231
1511
|
for (const target of p.targets) {
|
|
@@ -1258,6 +1538,30 @@ function collectLoopContext(p) {
|
|
|
1258
1538
|
total += content.length;
|
|
1259
1539
|
}
|
|
1260
1540
|
}
|
|
1541
|
+
const wantedTests = target.kind !== "EXISTING" ? [] : isTestTarget(target.path) ? [target.path] : pairedTestPaths(target.path, listing);
|
|
1542
|
+
for (const path of wantedTests) {
|
|
1543
|
+
if (seen.has(path)) continue;
|
|
1544
|
+
seen.add(path);
|
|
1545
|
+
if (matchesDeniedPath(path, p.deniedPaths)) {
|
|
1546
|
+
skipped.push({ path, reason: "denied" });
|
|
1547
|
+
continue;
|
|
1548
|
+
}
|
|
1549
|
+
let content;
|
|
1550
|
+
try {
|
|
1551
|
+
content = asLf(readFile(path));
|
|
1552
|
+
} catch {
|
|
1553
|
+
skipped.push({ path, reason: "unreadable" });
|
|
1554
|
+
continue;
|
|
1555
|
+
}
|
|
1556
|
+
if (content.length > MAX_ADDED_FILE_CHARS) skipped.push({ path, reason: "too large" });
|
|
1557
|
+
else if (total + content.length > MAX_ADDED_CONTEXT_CHARS) skipped.push({ path, reason: "over budget" });
|
|
1558
|
+
else {
|
|
1559
|
+
entries.push({ path, content });
|
|
1560
|
+
added.push(path);
|
|
1561
|
+
testPaths.push(path);
|
|
1562
|
+
total += content.length;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1261
1565
|
let importedPaths = [];
|
|
1262
1566
|
let aliasImports = 0;
|
|
1263
1567
|
if (target.kind === "EXISTING") {
|
|
@@ -1299,7 +1603,7 @@ function collectLoopContext(p) {
|
|
|
1299
1603
|
...aliasImports > 0 ? { aliasImports } : {}
|
|
1300
1604
|
});
|
|
1301
1605
|
}
|
|
1302
|
-
return { entries, records };
|
|
1606
|
+
return { entries, testPaths, records };
|
|
1303
1607
|
}
|
|
1304
1608
|
|
|
1305
1609
|
// src/addOnly.ts
|
|
@@ -2573,108 +2877,6 @@ async function runCodegenLoop(args, deps) {
|
|
|
2573
2877
|
}
|
|
2574
2878
|
}
|
|
2575
2879
|
|
|
2576
|
-
// src/overlapCheck.ts
|
|
2577
|
-
var TEST_PATH_RE = /(\.(test|spec)\.[jt]sx?$)|(^|\/)(__tests__|tests?)\//i;
|
|
2578
|
-
function isTestTarget(path) {
|
|
2579
|
-
return TEST_PATH_RE.test(path);
|
|
2580
|
-
}
|
|
2581
|
-
var STOPWORDS = /* @__PURE__ */ new Set([
|
|
2582
|
-
"a",
|
|
2583
|
-
"an",
|
|
2584
|
-
"the",
|
|
2585
|
-
"is",
|
|
2586
|
-
"are",
|
|
2587
|
-
"was",
|
|
2588
|
-
"were",
|
|
2589
|
-
"be",
|
|
2590
|
-
"been",
|
|
2591
|
-
"being",
|
|
2592
|
-
"of",
|
|
2593
|
-
"to",
|
|
2594
|
-
"in",
|
|
2595
|
-
"on",
|
|
2596
|
-
"for",
|
|
2597
|
-
"with",
|
|
2598
|
-
"at",
|
|
2599
|
-
"by",
|
|
2600
|
-
"from",
|
|
2601
|
-
"as",
|
|
2602
|
-
"and",
|
|
2603
|
-
"or",
|
|
2604
|
-
"not",
|
|
2605
|
-
"no",
|
|
2606
|
-
"nor",
|
|
2607
|
-
"this",
|
|
2608
|
-
"that",
|
|
2609
|
-
"these",
|
|
2610
|
-
"those",
|
|
2611
|
-
"it",
|
|
2612
|
-
"its",
|
|
2613
|
-
"cannot",
|
|
2614
|
-
"can't",
|
|
2615
|
-
"should",
|
|
2616
|
-
"must",
|
|
2617
|
-
"may",
|
|
2618
|
-
"will",
|
|
2619
|
-
"shall",
|
|
2620
|
-
"when",
|
|
2621
|
-
"if",
|
|
2622
|
-
"than",
|
|
2623
|
-
"then",
|
|
2624
|
-
"so",
|
|
2625
|
-
"do",
|
|
2626
|
-
"does",
|
|
2627
|
-
"did"
|
|
2628
|
-
]);
|
|
2629
|
-
var MIN_WORD_LENGTH = 3;
|
|
2630
|
-
function significantWords(step) {
|
|
2631
|
-
return new Set(
|
|
2632
|
-
step.toLowerCase().replace(/[^a-z0-9\s]/g, " ").split(/\s+/).filter((w) => w.length >= MIN_WORD_LENGTH && !STOPWORDS.has(w))
|
|
2633
|
-
);
|
|
2634
|
-
}
|
|
2635
|
-
function jaccard(a, b) {
|
|
2636
|
-
if (a.size === 0 || b.size === 0) return 0;
|
|
2637
|
-
let intersection = 0;
|
|
2638
|
-
for (const w of a) if (b.has(w)) intersection++;
|
|
2639
|
-
const union = a.size + b.size - intersection;
|
|
2640
|
-
return intersection / union;
|
|
2641
|
-
}
|
|
2642
|
-
function normalizedStep(step) {
|
|
2643
|
-
return step.trim().toLowerCase().replace(/\s+/g, " ");
|
|
2644
|
-
}
|
|
2645
|
-
var OVERLAP_THRESHOLD = 0.5;
|
|
2646
|
-
function findOverlappingSteps(targets) {
|
|
2647
|
-
const items = targets.flatMap(
|
|
2648
|
-
(target) => target.planStepsImplemented.map((step) => ({
|
|
2649
|
-
target: target.path,
|
|
2650
|
-
step,
|
|
2651
|
-
words: significantWords(step)
|
|
2652
|
-
}))
|
|
2653
|
-
);
|
|
2654
|
-
const warnings = [];
|
|
2655
|
-
for (let i = 0; i < items.length; i++) {
|
|
2656
|
-
for (let j = i + 1; j < items.length; j++) {
|
|
2657
|
-
if (items[i].target === items[j].target) continue;
|
|
2658
|
-
if (isTestTarget(items[i].target) || isTestTarget(items[j].target)) continue;
|
|
2659
|
-
if (jaccard(items[i].words, items[j].words) >= OVERLAP_THRESHOLD) {
|
|
2660
|
-
warnings.push({
|
|
2661
|
-
targetA: items[i].target,
|
|
2662
|
-
stepA: items[i].step,
|
|
2663
|
-
targetB: items[j].target,
|
|
2664
|
-
stepB: items[j].step,
|
|
2665
|
-
severity: normalizedStep(items[i].step) === normalizedStep(items[j].step) ? "identical" : "similar"
|
|
2666
|
-
});
|
|
2667
|
-
}
|
|
2668
|
-
}
|
|
2669
|
-
}
|
|
2670
|
-
return warnings;
|
|
2671
|
-
}
|
|
2672
|
-
function describeOverlapWarnings(warnings) {
|
|
2673
|
-
return warnings.map(
|
|
2674
|
-
(w) => `${w.targetA} and ${w.targetB} both implement what looks like the same rule \u2014 "${w.stepA}" / "${w.stepB}". Check these aren't two independent implementations of the same behavior.`
|
|
2675
|
-
);
|
|
2676
|
-
}
|
|
2677
|
-
|
|
2678
2880
|
// src/codegenStep.ts
|
|
2679
2881
|
var MAX_PROTECTED_PATHS_ON_WIRE = 300;
|
|
2680
2882
|
async function postCodegenTurn(gateway, contextData, signal) {
|
|
@@ -2764,7 +2966,8 @@ async function runCodegenStep(p) {
|
|
|
2764
2966
|
event: "codegen.loop_context",
|
|
2765
2967
|
files: context.entries.length,
|
|
2766
2968
|
chars: context.entries.reduce((n, e) => n + e.content.length, 0),
|
|
2767
|
-
paths: context.entries.map((e) => e.path)
|
|
2969
|
+
paths: context.entries.map((e) => e.path),
|
|
2970
|
+
existingTests: context.testPaths
|
|
2768
2971
|
})
|
|
2769
2972
|
);
|
|
2770
2973
|
try {
|
|
@@ -3548,7 +3751,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
|
|
|
3548
3751
|
var REPORT_COPY = "final-test-report.xml";
|
|
3549
3752
|
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
3550
3753
|
var MAX_FILES = 200;
|
|
3551
|
-
var RUNNER_VERSION = true ? "9.2.0-rc.
|
|
3754
|
+
var RUNNER_VERSION = true ? "9.2.0-rc.7" : "dev";
|
|
3552
3755
|
function safeDestination(base, repoPath) {
|
|
3553
3756
|
if (!repoPath || (0, import_node_path9.isAbsolute)(repoPath)) return null;
|
|
3554
3757
|
const destination = (0, import_node_path9.resolve)(base, repoPath);
|