loki-mode 11.129.0 → 11.130.0
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/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/loki +32 -0
- package/bin/loki +62 -4
- package/dashboard/__init__.py +1 -1
- package/docs/CLI-INVENTORY.md +38 -38
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/TESTING.md +1 -1
- package/docs/exit-codes.md +7 -0
- package/docs/v10/GUIDE.md +11 -0
- package/loki-ts/dist/loki.js +1607 -1606
- package/mcp/__init__.py +1 -1
- package/package.json +3 -3
- package/packages/control-plane/dist/server.js +302 -85
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-uxbsIyND.js → AdminPage-CNxvd-uy.js} +1 -1
- package/web-app/dist/assets/{Avatar-5GhUf4pP.js → Avatar-DdLoiZKv.js} +1 -1
- package/web-app/dist/assets/{Badge-93rdLyl8.js → Badge-DrdPaBOH.js} +1 -1
- package/web-app/dist/assets/{Button-C94f2_e6.js → Button-BQ0UyQAk.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-C8cDx1mp.js → CockpitPage-BLFBjBZW.js} +1 -1
- package/web-app/dist/assets/{ComparePage-BU7VVcVf.js → ComparePage-NHaUjY-d.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-Bn81ZPkG.js → ErrorBoundary-ClaDCylr.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-CVqzhxXI.js → EvidenceReceiptPanel-BBW0IhXb.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-i1Yjc0mH.js → GitHubIssuesPanel-B_dAtNuN.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-eoXw0hiw.js → GitHubPRsPanel-Tv3JF9E0.js} +1 -1
- package/web-app/dist/assets/{HomePage-Cv_BXFF9.js → HomePage-8fLInImK.js} +2 -2
- package/web-app/dist/assets/{LoginPage-CWYdAQSQ.js → LoginPage-BGL-xm0l.js} +1 -1
- package/web-app/dist/assets/{MagicPage-5r2ci7MS.js → MagicPage-D7nHpNuT.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-C37jE1uR.js → MetricsPage-BZh8ZOug.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-CuBrziZd.js → NotFoundPage-DJ5YwC3-.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-59GLzJlR.js → ProjectPage-DYaGNgFt.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-DgDtFRNm.js → ProjectsPage-9GbGTW3g.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-DjMSy-kZ.js → SettingsPage-DdRI8LZ5.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-DESkYmrG.js → ShowcasePage-ClEeMHAu.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-d5jFreyF.js → SystemSettingsPage-rqj2byaP.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-BEVAkxj3.js → TeamsPage-OaJ999dm.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-DeK9wx22.js → TemplatesPage-CrqXt5pd.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-2vwck437.js → TerminalOutput-DzOk3P-J.js} +1 -1
- package/web-app/dist/assets/{activity-XgL1xWCM.js → activity-C3XPvqFU.js} +1 -1
- package/web-app/dist/assets/{bell-EXDsjrzh.js → bell-BADR28Ic.js} +1 -1
- package/web-app/dist/assets/{bot-B9I58zKH.js → bot-BOfl_osT.js} +1 -1
- package/web-app/dist/assets/{check-DgLUYM2x.js → check-DyeRhpqt.js} +1 -1
- package/web-app/dist/assets/{chevron-left-BhHLpt7K.js → chevron-left-DytHCita.js} +1 -1
- package/web-app/dist/assets/{circle-alert-rgioMmC9.js → circle-alert-ej7tR0w9.js} +1 -1
- package/web-app/dist/assets/{clock-BO__fq1n.js → clock-CMmgiaJ3.js} +1 -1
- package/web-app/dist/assets/{cloud-iLJ3RtJs.js → cloud-BmoOA5GK.js} +1 -1
- package/web-app/dist/assets/{code-xml-BFYU6YlU.js → code-xml-DjcElMOx.js} +1 -1
- package/web-app/dist/assets/{database-CXDLeUh_.js → database-BxK55gai.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-C9Jbgo-O.js → dollar-sign-MxE9EOHB.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-CNPi6dkK.js → file-code-corner-BYQ975Vf.js} +1 -1
- package/web-app/dist/assets/{file-plus-DAc0Sd1J.js → file-plus-C0_fKf6I.js} +1 -1
- package/web-app/dist/assets/{globe-DN0njo3S.js → globe-C7iJxA9K.js} +1 -1
- package/web-app/dist/assets/{hammer-CnpZO-SH.js → hammer-CuVGrR3Z.js} +1 -1
- package/web-app/dist/assets/{index-BHwx0KjF.js → index-DvGbCL2t.js} +3 -3
- package/web-app/dist/assets/{layers-_kP2XVgZ.js → layers-BWmxXnEV.js} +1 -1
- package/web-app/dist/assets/{loader-circle-CcupfVc5.js → loader-circle-BrsqCmNy.js} +1 -1
- package/web-app/dist/assets/{lock-D3I89F_A.js → lock-Dl3UsTMr.js} +1 -1
- package/web-app/dist/assets/{package-BMz7_qR6.js → package-CCiRYdmb.js} +1 -1
- package/web-app/dist/assets/{plus-3rKyjjc7.js → plus-d5BugnNw.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-DGI9P9uf.js → refresh-cw-DIkE6C0k.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-CEIZqe5z.js → rotate-ccw-DDhYD9MA.js} +1 -1
- package/web-app/dist/assets/{scroll-text-CBQ5ISFk.js → scroll-text-jAoSqO2O.js} +1 -1
- package/web-app/dist/assets/{server-DOr9ns7A.js → server-D16MyCdB.js} +1 -1
- package/web-app/dist/assets/{shield-alert-pcQbbyMb.js → shield-alert-C8W_Qcb5.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-Q7fwPWa9.js → thumbs-up-DdTbl2Vo.js} +1 -1
- package/web-app/dist/assets/{trash-2-D81689SS.js → trash-2-R-2Gvy6B.js} +1 -1
- package/web-app/dist/assets/{trending-down-8b0O5hb9.js → trending-down-Dk08-nlD.js} +1 -1
- package/web-app/dist/assets/{trending-up-CD0tv_w5.js → trending-up-DX8yONXb.js} +1 -1
- package/web-app/dist/assets/{upload-CphI5Pe_.js → upload-6oDG_uiK.js} +1 -1
- package/web-app/dist/assets/{usePolling-yhGOhxnY.js → usePolling-Co4817xB.js} +1 -1
- package/web-app/dist/assets/{user-CXM61B6o.js → user-CjbWWW1W.js} +1 -1
- package/web-app/dist/index.html +1 -1
|
@@ -10927,7 +10927,7 @@ var has = (rest, ...f) => rest.some((x) => f.includes(x)), withFlag = (rest, fla
|
|
|
10927
10927
|
const body = t.slice(at + header.length + 2).split(/^\[/m)[0];
|
|
10928
10928
|
const list = (k) => quoted(new RegExp(`^\\s*${k}\\s*=\\s*\\[([^\\]]*)\\]`, "m").exec(body)?.[1] ?? "");
|
|
10929
10929
|
return [...list("members"), ...list("exclude").map((x) => `!${x}`)];
|
|
10930
|
-
}, LOCK_RULES, PY_SKIP_DIR, PY_MANIFEST, depKey = (s) => s.toLowerCase().replace(/[-_.]+/g, "_"), OUTPUT_DIRS, MANIFEST_KEYS, SAFE_TEST_SCRIPTS, DEP_FIELDS, MAX_BASE_MANIFESTS = 200, EXPORT_OK, WORKSPACE_SPEC, REGEX_AFTER_WORD;
|
|
10930
|
+
}, globRe = (g) => new RegExp(`^${g.replace(/^\.\//, "").replace(/\/+$/, "").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "\x00").replace(/\*/g, "[^/]*").replace(/\0/g, ".*").replace(/\?/g, "[^/]")}$`), inWorkspace = (pats, rel) => pats.some((g) => !g.startsWith("!") && globRe(g).test(rel)) && !pats.some((g) => g.startsWith("!") && globRe(g.slice(1)).test(rel)), LOCK_RULES, PY_SKIP_DIR, PY_MANIFEST, depKey = (s) => s.toLowerCase().replace(/[-_.]+/g, "_"), OUTPUT_DIRS, MANIFEST_KEYS, SAFE_TEST_SCRIPTS, DEP_FIELDS, MAX_BASE_MANIFESTS = 200, EXPORT_OK, WORKSPACE_SPEC, REGEX_AFTER_WORD;
|
|
10931
10931
|
var init_lock_ecosystems = __esm(() => {
|
|
10932
10932
|
init_safe_git();
|
|
10933
10933
|
LOCK_RULES = [
|
|
@@ -12967,7 +12967,7 @@ var escRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), LARGE_NAMED_FILES =
|
|
|
12967
12967
|
return n3;
|
|
12968
12968
|
noteOnce("LOKI_E10_SMALL_MAX_CHARS", env.LOKI_E10_SMALL_MAX_CHARS, "is not a positive number; using 600");
|
|
12969
12969
|
return 600;
|
|
12970
|
-
}, HARD_NAMED_FILES = 4, WALL_TINY_MAX_CHARS = 300, WALL_TINY_BOUND = "Tiny task: write exactly one test file with at most 6 assertions unless more acceptance lines exist, then exactly one per acceptance line.", isTinyGreenfield = (size, task, tests) => size === "small" && task.length <= WALL_TINY_MAX_CHARS && !tests?.runners.length && !tests?.tests.length, smallTaskPath = (size, relevantTests) => size !== "large" && relevantTests ? "lean" : "wall", knob = (v, words) => words.includes((v ?? "").toLowerCase()), planMode = (env = process.env) => knob(env.LOKI_E10_PLAN, ["0", "off", "never", "false"]) ? "never" : knob(env.LOKI_E10_PLAN, ["1", "on", "always", "true"]) ? "always" : "auto", wallEnabled = (env = process.env) =>
|
|
12970
|
+
}, HARD_NAMED_FILES = 4, WALL_TINY_MAX_CHARS = 300, WALL_TINY_BOUND = "Tiny task: write exactly one test file with at most 6 assertions unless more acceptance lines exist, then exactly one per acceptance line.", isTinyGreenfield = (size, task, tests) => size === "small" && task.length <= WALL_TINY_MAX_CHARS && !tests?.runners.length && !tests?.tests.length, smallTaskPath = (size, relevantTests) => size !== "large" && relevantTests ? "lean" : "wall", knob = (v, words) => words.includes((v ?? "").toLowerCase()), planMode = (env = process.env) => knob(env.LOKI_E10_PLAN, ["0", "off", "never", "false"]) ? "never" : knob(env.LOKI_E10_PLAN, ["1", "on", "always", "true"]) ? "always" : "auto", wallEnabled = (env = process.env) => knob(env.LOKI_E10_WALL, ["1", "on", "true"]), wallLimitS = (size, env = process.env) => {
|
|
12971
12971
|
const raw2 = env.LOKI_E10_WALL_LIMIT_S, n3 = Number(raw2), dflt = size === "small" ? 90 : 180;
|
|
12972
12972
|
if (Number.isFinite(n3) && n3 > 0) {
|
|
12973
12973
|
if (n3 > 300)
|
|
@@ -13610,6 +13610,7 @@ __export(exports_repo_profile, {
|
|
|
13610
13610
|
profileFragment: () => profileFragment,
|
|
13611
13611
|
profileEnabled: () => profileEnabled,
|
|
13612
13612
|
profileBrief: () => profileBrief,
|
|
13613
|
+
manifestModel: () => manifestModel,
|
|
13613
13614
|
manifestHash: () => manifestHash,
|
|
13614
13615
|
loadProfile: () => loadProfile,
|
|
13615
13616
|
goPackagePath: () => goPackagePath,
|
|
@@ -13796,7 +13797,7 @@ function pkgManager(repoDir) {
|
|
|
13796
13797
|
return "yarn";
|
|
13797
13798
|
return "npm";
|
|
13798
13799
|
}
|
|
13799
|
-
function discoverCommands(repoDir) {
|
|
13800
|
+
function discoverCommands(repoDir, pmDir = repoDir) {
|
|
13800
13801
|
const out2 = [];
|
|
13801
13802
|
const pj = read(join45(repoDir, "package.json"));
|
|
13802
13803
|
if (pj) {
|
|
@@ -13806,7 +13807,7 @@ function discoverCommands(repoDir) {
|
|
|
13806
13807
|
scripts = j.scripts ?? {};
|
|
13807
13808
|
hasTs = !!(j.dependencies?.typescript ?? j.devDependencies?.typescript);
|
|
13808
13809
|
} catch {}
|
|
13809
|
-
const pm = pkgManager(
|
|
13810
|
+
const pm = pkgManager(pmDir), run2 = (n3) => n3 === "test" ? `${pm} test` : `${pm} run ${n3}`;
|
|
13810
13811
|
const has2 = (n3) => typeof scripts[n3] === "string" && !(n3 === "test" && NO_TEST.test(String(scripts[n3])));
|
|
13811
13812
|
const pick = (kind, names) => {
|
|
13812
13813
|
const n3 = names.find(has2);
|
|
@@ -13834,7 +13835,8 @@ function discoverCommands(repoDir) {
|
|
|
13834
13835
|
pick("build", ["build", "all"]);
|
|
13835
13836
|
}
|
|
13836
13837
|
const pyTxt = ["pyproject.toml", "pytest.ini", "tox.ini", "setup.cfg"].map((f) => [f, read(join45(repoDir, f))]).filter(([, t]) => t);
|
|
13837
|
-
const
|
|
13838
|
+
const pyDeclares = ["tests", "test"].some((d) => existsSync26(join45(repoDir, d))) ? [...pyTxt, ["requirements.txt", read(join45(repoDir, "requirements.txt"))]].find(([, t]) => /^\s*pytest\b|["']pytest\b/m.test(t)) : undefined;
|
|
13839
|
+
const pyPytest = pyTxt.find(([f, t]) => f === "pytest.ini" || /\[tool\.pytest|\[tool:pytest\]|\[pytest\]/.test(t)) ?? (existsSync26(join45(repoDir, "conftest.py")) ? ["conftest.py", ""] : undefined) ?? pyDeclares;
|
|
13838
13840
|
if (pyTxt.length || pyPytest) {
|
|
13839
13841
|
const py = [".venv", "venv"].map((d) => join45(d, "bin", "python")).find((p) => existsSync26(join45(repoDir, p))) ?? "python3";
|
|
13840
13842
|
if (pyPytest)
|
|
@@ -13859,6 +13861,102 @@ function discoverCommands(repoDir) {
|
|
|
13859
13861
|
}
|
|
13860
13862
|
return out2;
|
|
13861
13863
|
}
|
|
13864
|
+
function fansOut(scripts) {
|
|
13865
|
+
let body = scripts["test"];
|
|
13866
|
+
for (let hop = 0;hop < 4 && typeof body === "string"; hop++) {
|
|
13867
|
+
if (ORCHESTRATOR.test(body))
|
|
13868
|
+
return true;
|
|
13869
|
+
const next = /^\s*(?:pnpm|npm|yarn|bun)(?:\s+run)?\s+([\w:.-]+)\s*$/.exec(body)?.[1];
|
|
13870
|
+
body = next && next !== "test" ? scripts[next] : undefined;
|
|
13871
|
+
}
|
|
13872
|
+
return false;
|
|
13873
|
+
}
|
|
13874
|
+
function manifestModel(repoDir) {
|
|
13875
|
+
let tracked;
|
|
13876
|
+
try {
|
|
13877
|
+
tracked = safeGit(repoDir, ["ls-files", "-z"], { maxBuffer: 256 * 1024 * 1024 }).split("\x00").filter(Boolean);
|
|
13878
|
+
} catch {
|
|
13879
|
+
return null;
|
|
13880
|
+
}
|
|
13881
|
+
const trackedSet = new Set(tracked), at = (dir, f) => dir === "." ? f : `${dir}/${f}`;
|
|
13882
|
+
const json = (dir) => {
|
|
13883
|
+
try {
|
|
13884
|
+
const j = JSON.parse(read(join45(repoDir, dir, "package.json")));
|
|
13885
|
+
return j && typeof j === "object" && !Array.isArray(j) ? j : null;
|
|
13886
|
+
} catch {
|
|
13887
|
+
return null;
|
|
13888
|
+
}
|
|
13889
|
+
};
|
|
13890
|
+
const isFile = (rel) => trackedSet.has(rel) || (() => {
|
|
13891
|
+
try {
|
|
13892
|
+
return lstatSync9(join45(repoDir, rel)).isFile();
|
|
13893
|
+
} catch {
|
|
13894
|
+
return false;
|
|
13895
|
+
}
|
|
13896
|
+
})();
|
|
13897
|
+
const wsPats = [...pkgWorkspaces(repoDir), ...pnpmWorkspaces(repoDir)];
|
|
13898
|
+
const manifestDirs = [...new Set(tracked.filter((p) => PKG_MANIFESTS.includes(basename13(p))).map((p) => dirname13(p)))];
|
|
13899
|
+
const trackedDirs = new Set;
|
|
13900
|
+
for (const p of tracked)
|
|
13901
|
+
for (let d = dirname13(p);d !== "." && !trackedDirs.has(d); d = dirname13(d))
|
|
13902
|
+
trackedDirs.add(d);
|
|
13903
|
+
const members = wsPats.length === 0 ? [] : [...trackedDirs].filter((d) => inWorkspace(wsPats, d) && isFile(at(d, "package.json"))).sort();
|
|
13904
|
+
const others = manifestDirs.filter((d) => d !== "." && !members.includes(d) && !d.split("/").some((seg) => SKIP_PKG_DIR.test(seg)));
|
|
13905
|
+
const rootHas = MANIFESTS.some((f) => trackedSet.has(f)) || trackedSet.has("setup.py");
|
|
13906
|
+
const dirs = [...rootHas ? ["."] : [], ...members, ...others.sort()];
|
|
13907
|
+
if (dirs.length === 0 || dirs.length > MAX_MODEL_PACKAGES)
|
|
13908
|
+
return null;
|
|
13909
|
+
const rootLock = LOCK_INSTALLS.find(([f]) => f !== "go.mod" && trackedSet.has(f));
|
|
13910
|
+
const nameToRoot = new Map;
|
|
13911
|
+
for (const d of [".", ...members]) {
|
|
13912
|
+
const n3 = json(d)?.["name"];
|
|
13913
|
+
if (typeof n3 === "string" && n3)
|
|
13914
|
+
nameToRoot.set(n3, d);
|
|
13915
|
+
}
|
|
13916
|
+
const fingerprint = new Set(["pnpm-workspace.yaml"].filter((f) => trackedSet.has(f)));
|
|
13917
|
+
const packages = dirs.map((d) => {
|
|
13918
|
+
const isMember = members.includes(d), cmds = discoverCommands(join45(repoDir, d), isMember ? repoDir : join45(repoDir, d));
|
|
13919
|
+
const own = [...new Set([...PKG_MANIFESTS, ...MANIFESTS])].map((f) => at(d, f)).filter((f) => trackedSet.has(f) || isMember && f.endsWith("/package.json") && isFile(f));
|
|
13920
|
+
own.forEach((f) => fingerprint.add(f));
|
|
13921
|
+
const cmdOf = (kind) => {
|
|
13922
|
+
const c = cmds.find((e) => e.kind === kind);
|
|
13923
|
+
return c ? { cmd: c.cmd, cwd: d, cite: [at(d, c.source)] } : null;
|
|
13924
|
+
};
|
|
13925
|
+
const lock = LOCK_INSTALLS.find(([f]) => trackedSet.has(at(d, f)));
|
|
13926
|
+
if (lock)
|
|
13927
|
+
fingerprint.add(at(d, lock[0]));
|
|
13928
|
+
const install = lock ? { cmd: lock[1], cwd: d, cite: [at(d, lock[0])] } : isMember && rootLock ? { cmd: rootLock[1], cwd: ".", cite: [rootLock[0]] } : pyInstall(repoDir, d, trackedSet, at);
|
|
13929
|
+
const pj = json(d), deps = pj ? DEP_KEYS.flatMap((k) => Object.keys(pj[k] ?? {})) : [];
|
|
13930
|
+
const uiDep = deps.some((x) => UI_DEPS.includes(x)), scripts = pj?.["scripts"] ?? {}, pm = pkgManager(isMember ? repoDir : join45(repoDir, d));
|
|
13931
|
+
const boot = uiDep && typeof scripts["dev"] === "string" ? { cmd: `${pm} run dev`, cwd: d, cite: [at(d, "package.json")] } : uiDep && typeof scripts["start"] === "string" ? { cmd: `${pm} start`, cwd: d, cite: [at(d, "package.json")] } : null;
|
|
13932
|
+
const js = d === "." || isMember ? pj ? { dependsOn: [...new Set(deps.map((x) => nameToRoot.get(x)).filter((r) => r !== undefined && r !== d))] } : {} : {};
|
|
13933
|
+
return {
|
|
13934
|
+
name: typeof pj?.["name"] === "string" && pj["name"] ? pj["name"] : d === "." ? basename13(resolve13(repoDir)) : d,
|
|
13935
|
+
root: d,
|
|
13936
|
+
runner: null,
|
|
13937
|
+
cite: own.length ? own : [cmds[0] ? at(d, cmds[0].source) : at(d, "package.json")],
|
|
13938
|
+
commands: { test: cmdOf("test"), lint: cmdOf("lint"), build: cmdOf("build"), start: null },
|
|
13939
|
+
ui: { present: boot !== null, boot, cite: boot ? boot.cite : [] },
|
|
13940
|
+
install,
|
|
13941
|
+
...js
|
|
13942
|
+
};
|
|
13943
|
+
});
|
|
13944
|
+
if (!packages.some((p) => p.commands.test) || dirs.some((d) => fansOut(json(d)?.["scripts"] ?? {})))
|
|
13945
|
+
return null;
|
|
13946
|
+
const wsCite = trackedSet.has("pnpm-workspace.yaml") ? "pnpm-workspace.yaml" : packages[0].cite[0];
|
|
13947
|
+
return { workspaceKind: members.length ? "workspaces" : packages.length > 1 ? "multi-root" : "single", workspaceCite: [wsCite], fingerprintFiles: [...fingerprint].sort(), packages };
|
|
13948
|
+
}
|
|
13949
|
+
function pyInstall(repoDir, d, tracked, at) {
|
|
13950
|
+
const abs = join45(repoDir, d), py = [".venv", "venv"].map((v) => join45(v, "bin", "python")).find((p) => existsSync26(join45(abs, p))) ?? "python3";
|
|
13951
|
+
if (tracked.has(at(d, "requirements.txt")))
|
|
13952
|
+
return { cmd: `${py} -m pip install -r requirements.txt`, cwd: d, cite: [at(d, "requirements.txt")] };
|
|
13953
|
+
const pp = tracked.has(at(d, "pyproject.toml")) ? read(join45(abs, "pyproject.toml")) : "";
|
|
13954
|
+
if (!/^\[project\]/m.test(pp) && !tracked.has(at(d, "setup.py")))
|
|
13955
|
+
return null;
|
|
13956
|
+
const at0 = pp.search(/^\[project\.optional-dependencies\]/m), nl = at0 < 0 ? -1 : pp.indexOf(`
|
|
13957
|
+
`, at0), extras = nl < 0 ? "" : pp.slice(nl + 1).split(/^\[/m)[0], extra = ["test", "tests", "testing", "dev"].find((k) => new RegExp(`^\\s*${k}\\s*=`, "m").test(extras));
|
|
13958
|
+
return { cmd: `${py} -m pip install -e ${extra ? `'.[${extra}]'` : "."}`, cwd: d, cite: [at(d, /^\[project\]/m.test(pp) ? "pyproject.toml" : "setup.py")] };
|
|
13959
|
+
}
|
|
13862
13960
|
function detectFormatters(repoDir) {
|
|
13863
13961
|
const out2 = [];
|
|
13864
13962
|
const has2 = (...fs2) => fs2.some((f) => existsSync26(join45(repoDir, f)));
|
|
@@ -14221,7 +14319,7 @@ var PROFILE_SCHEMA_VERSION = 1, DEFAULT_TTL_SECONDS = 86400, DEFAULT_MAX_CHARS =
|
|
|
14221
14319
|
} catch {
|
|
14222
14320
|
return "";
|
|
14223
14321
|
}
|
|
14224
|
-
}, entry = (kind, cmd, source) => ({ kind, cmd, source, validated: null, exit_code: null, duration_s: null, failing_ids: [] }), shellRunner = (cmd, cwd, timeoutMs) => {
|
|
14322
|
+
}, entry = (kind, cmd, source) => ({ kind, cmd, source, validated: null, exit_code: null, duration_s: null, failing_ids: [] }), SKIP_PKG_DIR, PKG_MANIFESTS, LOCK_INSTALLS, UI_DEPS, MAX_MODEL_PACKAGES = 200, ORCHESTRATOR, DEP_KEYS, shellRunner = (cmd, cwd, timeoutMs) => {
|
|
14225
14323
|
const r = spawnSync3("sh", ["-c", cmd], { cwd, env: { ...plainTestEnv(), PYTHONDONTWRITEBYTECODE: "1", CI: "1" }, encoding: "utf8", timeout: timeoutMs, killSignal: "SIGKILL", maxBuffer: 8 * 1024 * 1024, stdio: ["ignore", "pipe", "pipe"] });
|
|
14226
14324
|
const timedOut = r.error?.code === "ETIMEDOUT" || r.status === null && r.signal === "SIGKILL";
|
|
14227
14325
|
return { code: r.status, timedOut, out: stripAnsi(`${r.stdout ?? ""}
|
|
@@ -14250,8 +14348,15 @@ var init_repo_profile = __esm(() => {
|
|
|
14250
14348
|
init_safe_git();
|
|
14251
14349
|
init_paths();
|
|
14252
14350
|
init_state();
|
|
14351
|
+
init_lock_ecosystems();
|
|
14253
14352
|
MANIFESTS = ["requirements.txt", "package.json", "Makefile", "makefile", "GNUmakefile", "pyproject.toml", "tox.ini", "pytest.ini", "setup.cfg", "go.mod", "Cargo.toml", "tsconfig.json"];
|
|
14254
14353
|
NO_TEST = /no test specified/i;
|
|
14354
|
+
SKIP_PKG_DIR = /^(node_modules|vendor|third_party|test-?data|.*fixtures?|__\w+__|examples?|samples?|templates?|docs?|tests?|e2e|benchmarks?|\..*)$/;
|
|
14355
|
+
PKG_MANIFESTS = ["package.json", "go.mod", "Cargo.toml", "pyproject.toml", "setup.py"];
|
|
14356
|
+
LOCK_INSTALLS = [["pnpm-lock.yaml", "pnpm install"], ["yarn.lock", "yarn install"], ["bun.lock", "bun install"], ["bun.lockb", "bun install"], ["package-lock.json", "npm install"], ["uv.lock", "uv sync"], ["poetry.lock", "poetry install"], ["Cargo.lock", "cargo fetch"], ["go.mod", "go mod download"]];
|
|
14357
|
+
UI_DEPS = ["react-dom", "vue", "svelte", "@angular/core", "next", "nuxt", "solid-js", "preact", "astro"];
|
|
14358
|
+
ORCHESTRATOR = /\b(nx|turbo|lerna|run-many|wsrun|ultra)\b|\bpnpm\b[^&|;]*\s(-r|--recursive|--filter|-F)\b|\byarn workspaces\b|\bnpm\b[^&|;]*\s(--workspaces|-ws)\b/;
|
|
14359
|
+
DEP_KEYS = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
14255
14360
|
STATIC_DIAG = {
|
|
14256
14361
|
ruff: /^(.+?):\d+:\d+: ([A-Z]+\d+) (?:\[\*\] )?(.*)$/,
|
|
14257
14362
|
shellcheck: /^(.+?):\d+:\d+: (?:error|warning|note|info|style): (.*) \[(SC\d+)\]$/,
|
|
@@ -14385,10 +14490,10 @@ var init_gather = __esm(() => {
|
|
|
14385
14490
|
GATHER_CAPS = {
|
|
14386
14491
|
maxListFiles: 20000,
|
|
14387
14492
|
maxDepth: 3,
|
|
14388
|
-
maxFileBytes:
|
|
14389
|
-
maxFiles:
|
|
14390
|
-
maxTotalBytes:
|
|
14391
|
-
maxTreeLines:
|
|
14493
|
+
maxFileBytes: 8 * 1024,
|
|
14494
|
+
maxFiles: 24,
|
|
14495
|
+
maxTotalBytes: 24 * 1024,
|
|
14496
|
+
maxTreeLines: 150,
|
|
14392
14497
|
maxHashBytes: 16 * 1024 * 1024
|
|
14393
14498
|
};
|
|
14394
14499
|
AGENT_RULE_FILES = ["AGENTS.md", "CLAUDE.md", "GEMINI.md", ".cursorrules", ".windsurfrules", ".github/copilot-instructions.md"];
|
|
@@ -14528,6 +14633,17 @@ async function discoverProjectModel(ctx, signal, opts = {}) {
|
|
|
14528
14633
|
return { model: unknownModel("", "single-directory repo"), cached: false, attempts: 0, owner: "harness" };
|
|
14529
14634
|
if (signalsResolve(opts.testmap, ctx.repoDir))
|
|
14530
14635
|
return { model: unknownModel("", "deterministic signals resolve the runner and units"), cached: false, attempts: 0, owner: "harness" };
|
|
14636
|
+
if (manifestModelEnabled()) {
|
|
14637
|
+
const raw2 = manifestModel(ctx.repoDir), v = raw2 ? validateAnswer(ctx.repoDir, raw2) : null;
|
|
14638
|
+
if (v?.ok) {
|
|
14639
|
+
const model2 = { ...v.model, key: computeKey(ctx.repoDir, v.model.fingerprintFiles, dirs) };
|
|
14640
|
+
try {
|
|
14641
|
+
save2(ctx.repoDir, model2);
|
|
14642
|
+
} catch {}
|
|
14643
|
+
recordRunShape(ctx.runDir, model2);
|
|
14644
|
+
return { model: model2, cached: false, attempts: 0, source: "manifests" };
|
|
14645
|
+
}
|
|
14646
|
+
}
|
|
14531
14647
|
const deadline = Date.now() + (opts.budgetS ?? Infinity) * 1000;
|
|
14532
14648
|
const g = gather(ctx.repoDir);
|
|
14533
14649
|
mkdirSync17(ctx.runDir, { recursive: true });
|
|
@@ -14562,6 +14678,8 @@ async function discoverProjectModel(ctx, signal, opts = {}) {
|
|
|
14562
14678
|
limitS,
|
|
14563
14679
|
signal: abort.signal,
|
|
14564
14680
|
cwd: ctx.repoDir,
|
|
14681
|
+
effort: "low",
|
|
14682
|
+
maxOutputTokens: DISCOVERY_MAX_OUTPUT_TOKENS,
|
|
14565
14683
|
...attemptModel ? { model: attemptModel } : {}
|
|
14566
14684
|
});
|
|
14567
14685
|
run2.catch(() => {
|
|
@@ -14606,13 +14724,13 @@ async function intakeProjectModel(ctx, signal, startedMs, testmap) {
|
|
|
14606
14724
|
return {};
|
|
14607
14725
|
try {
|
|
14608
14726
|
const budgetS = STAGE_BUDGETS.intake.limitS - (Date.now() - startedMs) / 1000 - KILL_GRACE_S - MARGIN_S;
|
|
14609
|
-
const { model, cached, attempts, owner, sessionModel } = await discoverProjectModel(ctx, signal, { budgetS, testmap });
|
|
14610
|
-
return { project_model: { status: model.status, key: model.key, cached, attempts, ...sessionModel ? { session_model: sessionModel } : {}, ref: PROJECT_FILE, ...owner ? { owner } : {}, ...model.reason ? { reason: model.reason } : {} } };
|
|
14727
|
+
const { model, cached, attempts, owner, sessionModel, source } = await discoverProjectModel(ctx, signal, { budgetS, testmap });
|
|
14728
|
+
return { project_model: { status: model.status, key: model.key, cached, attempts, ...source ? { source } : {}, ...sessionModel ? { session_model: sessionModel } : {}, ref: PROJECT_FILE, ...owner ? { owner } : {}, ...model.reason ? { reason: model.reason } : {} } };
|
|
14611
14729
|
} catch {
|
|
14612
14730
|
return {};
|
|
14613
14731
|
}
|
|
14614
14732
|
}
|
|
14615
|
-
var PROJECT_FILE = ".loki/project.json", UNKNOWN_TTL_MS, SESSION_LIMIT_S = 60, HARD_GRACE_MS = 5000, MIN_SESSION_S = 8, KILL_GRACE_S = 2, MARGIN_S = 3, sharedPath = (repoDir) => {
|
|
14733
|
+
var manifestModelEnabled = (env = process.env) => env["LOKI_E10_PM_MANIFESTS"] !== "0", PROJECT_FILE = ".loki/project.json", UNKNOWN_TTL_MS, SESSION_LIMIT_S = 60, HARD_GRACE_MS = 5000, MIN_SESSION_S = 8, KILL_GRACE_S = 2, MARGIN_S = 3, DISCOVERY_MAX_OUTPUT_TOKENS = 4096, sharedPath = (repoDir) => {
|
|
14616
14734
|
try {
|
|
14617
14735
|
const tree = safeGit(repoDir, ["rev-parse", "HEAD^{tree}"]).trim(), dir = process.env["LOKI_E10_PM_STORE"] || join48(defaultCacheRoot(), "project-models");
|
|
14618
14736
|
return /^[0-9a-f]{40,64}$/.test(tree) ? { path: join48(dir, `pm-${tree}.json`), dir } : null;
|
|
@@ -17942,6 +18060,20 @@ function baseJobs() {
|
|
|
17942
18060
|
const n3 = Number(process.env.LOKI_E10_BASE_JOBS);
|
|
17943
18061
|
return Number.isInteger(n3) && n3 >= 1 ? Math.min(n3, 16) : 1;
|
|
17944
18062
|
}
|
|
18063
|
+
function assertionFailure(runner, output) {
|
|
18064
|
+
const out2 = stripAnsi(output);
|
|
18065
|
+
if (runner === "pytest") {
|
|
18066
|
+
if (/^ERROR\s|errors? during collection/m.test(out2))
|
|
18067
|
+
return false;
|
|
18068
|
+
const f = [...out2.matchAll(/^FAILED\s+\S+(?:\s+-\s+(.*))?$/gm)].map((m) => m[1] ?? "");
|
|
18069
|
+
return f.length > 0 && f.every((r) => /^(?:assert\b|AssertionError\b)/.test(r.trim()));
|
|
18070
|
+
}
|
|
18071
|
+
if (runner === "vitest") {
|
|
18072
|
+
const e = [...out2.matchAll(/^\s*((?:[A-Za-z]*Error))(?:\s*\[[^\]]*\])?:/gm)].map((m) => m[1]);
|
|
18073
|
+
return e.length > 0 && e.every((k) => k === "AssertionError");
|
|
18074
|
+
}
|
|
18075
|
+
return false;
|
|
18076
|
+
}
|
|
17945
18077
|
async function mapPool(items, jobs, fn, stop = () => false) {
|
|
17946
18078
|
const out2 = new Array(items.length);
|
|
17947
18079
|
let next = 0;
|
|
@@ -21751,7 +21883,7 @@ function installOwned(repoDir, rec, env = process.env) {
|
|
|
21751
21883
|
}
|
|
21752
21884
|
})();
|
|
21753
21885
|
}
|
|
21754
|
-
var INSTALL_CAP_MS = 300000, memo2, TAIL_BYTES = 65536, STATUS_MAX_BUFFER, mergedEnv = (e) => Object.fromEntries(Object.entries({ ...process.env, ...e ?? {} }).filter((kv) => typeof kv[1] === "string")), git = (repoDir, env, args) => safeGit(repoDir, args, { env, maxBuffer: STATUS_MAX_BUFFER }),
|
|
21886
|
+
var INSTALL_CAP_MS = 300000, memo2, TAIL_BYTES = 65536, STATUS_MAX_BUFFER, mergedEnv = (e) => Object.fromEntries(Object.entries({ ...process.env, ...e ?? {} }).filter((kv) => typeof kv[1] === "string")), git = (repoDir, env, args) => safeGit(repoDir, args, { env, maxBuffer: STATUS_MAX_BUFFER }), excerpt = (tail2) => {
|
|
21755
21887
|
const l = tail2.split(`
|
|
21756
21888
|
`).map((x) => x.trim()).filter(Boolean).pop() ?? "";
|
|
21757
21889
|
return l.replace(/\s+/g, " ").slice(0, 160);
|
|
@@ -24933,6 +25065,7 @@ var init_pr_body = __esm(() => {
|
|
|
24933
25065
|
});
|
|
24934
25066
|
|
|
24935
25067
|
// ../../loki-ts/src/util/mutation_proof.ts
|
|
25068
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
24936
25069
|
import { existsSync as existsSync49, mkdirSync as mkdirSync32, mkdtempSync as mkdtempSync9, readFileSync as readFileSync66, rmSync as rmSync17, symlinkSync, writeFileSync as writeFileSync33 } from "fs";
|
|
24937
25070
|
import { tmpdir as tmpdir13 } from "os";
|
|
24938
25071
|
import { dirname as dirname27, isAbsolute as isAbsolute12, join as join80, relative as relative13 } from "path";
|
|
@@ -24964,21 +25097,10 @@ async function mutationProof(i) {
|
|
|
24964
25097
|
return false;
|
|
24965
25098
|
for (const [rel, src] of srcs) {
|
|
24966
25099
|
mkdirSync32(dirname27(join80(wt, rel)), { recursive: true });
|
|
24967
|
-
writeFileSync33(join80(wt, rel), readFileSync66(src));
|
|
25100
|
+
writeFileSync33(join80(wt, rel), typeof src === "string" ? readFileSync66(src) : src);
|
|
24968
25101
|
}
|
|
24969
25102
|
return true;
|
|
24970
25103
|
};
|
|
24971
|
-
for (const rel of rels) {
|
|
24972
|
-
const sealed = sealedWallCopy(i.runDir, rel);
|
|
24973
|
-
if (!existsSync49(sealed) && existsSync49(sealedWallDir(i.runDir)))
|
|
24974
|
-
return np(`sealed Wall copy missing: ${rel}`);
|
|
24975
|
-
const src = existsSync49(sealed) ? sealed : join80(i.repoDir, rel);
|
|
24976
|
-
if (!existsSync49(src))
|
|
24977
|
-
return np(`Wall file missing: ${rel}`);
|
|
24978
|
-
mkdirSync32(dirname27(join80(wt, rel)), { recursive: true });
|
|
24979
|
-
writeFileSync33(join80(wt, rel), readFileSync66(src));
|
|
24980
|
-
srcs.push([rel, src]);
|
|
24981
|
-
}
|
|
24982
25104
|
for (const rel of rels) {
|
|
24983
25105
|
const parts = rel.split("/").slice(0, -1);
|
|
24984
25106
|
for (let n3 = 0;n3 <= parts.length; n3++) {
|
|
@@ -24993,16 +25115,55 @@ async function mutationProof(i) {
|
|
|
24993
25115
|
}
|
|
24994
25116
|
}
|
|
24995
25117
|
}
|
|
25118
|
+
let active = tests;
|
|
25119
|
+
const bmp = new Set(i.baseMustPass ?? []);
|
|
25120
|
+
if (bmp.size > 0) {
|
|
25121
|
+
const pre = active.filter((t) => bmp.has(t.path));
|
|
25122
|
+
if (pre.length > 0) {
|
|
25123
|
+
if (remaining() <= 0)
|
|
25124
|
+
return np("timeout");
|
|
25125
|
+
const pr = pre.map((t) => remaining() <= 0 ? null : (typeof i.runner === "function" ? i.runner(remaining()) : i.runner).run(wt, [t]));
|
|
25126
|
+
if (pr.some((r) => !r))
|
|
25127
|
+
return np("timeout");
|
|
25128
|
+
const red = new Set(pre.filter((_, k) => !(pr[k].pass > 0 && pr[k].fail === 0 && (pr[k].not_run ?? 0) === 0)).map((t) => t.path));
|
|
25129
|
+
active = active.filter((t) => !red.has(t.path));
|
|
25130
|
+
if (active.length === 0)
|
|
25131
|
+
return np("the base version of each edited test file is not green on the base");
|
|
25132
|
+
}
|
|
25133
|
+
}
|
|
25134
|
+
for (const rel of rels) {
|
|
25135
|
+
if (i.headSha) {
|
|
25136
|
+
try {
|
|
25137
|
+
const buf = execFileSync6("git", ["-C", i.repoDir, "show", `${i.headSha}:${rel}`], { maxBuffer: 16 << 20, timeout: 20000 });
|
|
25138
|
+
mkdirSync32(dirname27(join80(wt, rel)), { recursive: true });
|
|
25139
|
+
writeFileSync33(join80(wt, rel), buf);
|
|
25140
|
+
srcs.push([rel, buf]);
|
|
25141
|
+
continue;
|
|
25142
|
+
} catch {
|
|
25143
|
+
return np(`could not read ${rel} at the head commit`);
|
|
25144
|
+
}
|
|
25145
|
+
}
|
|
25146
|
+
const sealed = sealedWallCopy(i.runDir, rel);
|
|
25147
|
+
if (!existsSync49(sealed) && existsSync49(sealedWallDir(i.runDir)))
|
|
25148
|
+
return np(`sealed Wall copy missing: ${rel}`);
|
|
25149
|
+
const src = existsSync49(sealed) ? sealed : join80(i.repoDir, rel);
|
|
25150
|
+
if (!existsSync49(src))
|
|
25151
|
+
return np(`Wall file missing: ${rel}`);
|
|
25152
|
+
mkdirSync32(dirname27(join80(wt, rel)), { recursive: true });
|
|
25153
|
+
writeFileSync33(join80(wt, rel), readFileSync66(src));
|
|
25154
|
+
srcs.push([rel, src]);
|
|
25155
|
+
}
|
|
24996
25156
|
let pass = 0, fail = 0, notRun = 0;
|
|
24997
25157
|
if (remaining() <= 0)
|
|
24998
25158
|
return np("timeout");
|
|
24999
25159
|
const mk2 = () => typeof i.runner === "function" ? i.runner(remaining()) : i.runner, jobs = envJobs((i.env ?? process.env)["LOKI_MUTATION_PROOF_JOBS"]), first = mk2();
|
|
25000
|
-
const par = jobs > 1 &&
|
|
25001
|
-
const rs = par ? await first.runEach(wt,
|
|
25160
|
+
const par = jobs > 1 && active.length > 1 && first.runEach !== undefined;
|
|
25161
|
+
const rs = par ? await first.runEach(wt, active, jobs, false, remaining) : active.map((t) => remaining() <= 0 ? null : mk2().run(wt, [t]));
|
|
25002
25162
|
if (rs.some((r) => !r))
|
|
25003
25163
|
return np("timeout");
|
|
25004
25164
|
if (par && remaining() <= 0)
|
|
25005
25165
|
return np("timeout");
|
|
25166
|
+
let sure = rs.length;
|
|
25006
25167
|
if (par) {
|
|
25007
25168
|
for (let k = 0;k < rs.length; k++)
|
|
25008
25169
|
if (rs[k].fail > 0) {
|
|
@@ -25010,9 +25171,11 @@ async function mutationProof(i) {
|
|
|
25010
25171
|
return np("timeout");
|
|
25011
25172
|
if (!reset())
|
|
25012
25173
|
return np("could not reset the base worktree");
|
|
25013
|
-
rs[k] = mk2().run(wt, [
|
|
25014
|
-
if (rs[k].fail > 0)
|
|
25174
|
+
rs[k] = mk2().run(wt, [active[k]]);
|
|
25175
|
+
if (rs[k].fail > 0) {
|
|
25176
|
+
sure = k + 1;
|
|
25015
25177
|
break;
|
|
25178
|
+
}
|
|
25016
25179
|
}
|
|
25017
25180
|
}
|
|
25018
25181
|
for (const r of rs) {
|
|
@@ -25022,8 +25185,9 @@ async function mutationProof(i) {
|
|
|
25022
25185
|
}
|
|
25023
25186
|
if (remaining() <= 0 && fail === 0)
|
|
25024
25187
|
return np("timeout");
|
|
25188
|
+
const failed2 = active.filter((_, k) => k < sure && rs[k].fail > 0 && (!i.requireAssertion || (rs[k].assertFail ?? 0) > 0)).map((t) => t.path);
|
|
25025
25189
|
if (fail > 0)
|
|
25026
|
-
return { outcome: "yes", line: `${LABEL}yes
|
|
25190
|
+
return { outcome: "yes", line: `${LABEL}yes`, failed: failed2 };
|
|
25027
25191
|
if (pass > 0 && notRun === 0)
|
|
25028
25192
|
return { outcome: "no", line: `${LABEL}no (warning: the Wall tests also pass on the old code)` };
|
|
25029
25193
|
return np("the Wall command did not execute to a result");
|
|
@@ -27234,38 +27398,42 @@ class RealBaseTestRunner {
|
|
|
27234
27398
|
api;
|
|
27235
27399
|
timeoutMs;
|
|
27236
27400
|
extraEnv;
|
|
27401
|
+
trustSystem;
|
|
27237
27402
|
lastNotRunFiles = [];
|
|
27238
|
-
constructor(api, timeoutMs = BASE_RUN_TIMEOUT_MS, extraEnv = {}) {
|
|
27403
|
+
constructor(api, timeoutMs = BASE_RUN_TIMEOUT_MS, extraEnv = {}, trustSystem = false) {
|
|
27239
27404
|
this.api = api;
|
|
27240
27405
|
this.timeoutMs = timeoutMs;
|
|
27241
27406
|
this.extraEnv = extraEnv;
|
|
27407
|
+
this.trustSystem = trustSystem;
|
|
27242
27408
|
}
|
|
27243
27409
|
run(repoDir, files) {
|
|
27244
27410
|
this.lastNotRunFiles = [];
|
|
27245
|
-
let pass = 0, fail = 0, not_run = 0;
|
|
27411
|
+
let pass = 0, fail = 0, not_run = 0, assertFail = 0;
|
|
27246
27412
|
const not_run_files = [];
|
|
27247
27413
|
const api = this.api === undefined ? loadProjectApi(repoDir) : this.api;
|
|
27248
27414
|
for (const f of files) {
|
|
27249
27415
|
const { cmd, args, interpreter, cwd } = commandFor(f, repoDir, api);
|
|
27250
27416
|
const r = spawnGroupSync(cmd, f.runner === "pytest" ? [...args, "-rfE"] : args, { cwd, timeoutMs: Math.max(1000, this.timeoutMs), env: { ...plainTestEnv(), ...this.extraEnv } });
|
|
27251
|
-
const status = r.status, out2 = stripAnsi(r.output), base = classify(f, status, out2, repoDir, interpreter);
|
|
27417
|
+
const status = r.status, out2 = stripAnsi(r.output), base = classify(f, status, out2, repoDir, this.trustSystem ? undefined : interpreter);
|
|
27252
27418
|
const result = base === "not_run" && status === 0 && f.runner === "go" && interpreter !== "system" && corroborateGoPassSync(classifyCheck({ kind: "test", ok: true, out: out2, ...goRunner(cmd, args) }), out2, cmd, args.filter((a, k) => a !== "-run" && args[k - 1] !== "-run"), { cwd, env: plainTestEnv() }).result === "pass" ? "pass" : base;
|
|
27253
27419
|
if (result === "pass")
|
|
27254
27420
|
pass++;
|
|
27255
|
-
else if (result === "fail")
|
|
27421
|
+
else if (result === "fail") {
|
|
27256
27422
|
fail++;
|
|
27257
|
-
|
|
27423
|
+
if (assertionFailure(f.runner, out2))
|
|
27424
|
+
assertFail++;
|
|
27425
|
+
} else {
|
|
27258
27426
|
not_run++;
|
|
27259
27427
|
not_run_files.push({ file: f.path, reason: notRunReason(status, interpreter), ...interpreter === "system" ? { interpreter } : {} });
|
|
27260
27428
|
}
|
|
27261
27429
|
}
|
|
27262
27430
|
this.lastNotRunFiles = not_run_files;
|
|
27263
|
-
return { pass, fail, not_run };
|
|
27431
|
+
return { pass, fail, not_run, assertFail };
|
|
27264
27432
|
}
|
|
27265
27433
|
async runEach(repoDir, files, jobs, corroborate = false, remaining) {
|
|
27266
27434
|
const api = this.api === undefined ? loadProjectApi(repoDir) : this.api;
|
|
27267
27435
|
return mapPool(files, jobs, async (f) => {
|
|
27268
|
-
const { cmd, args, interpreter, cwd } = commandFor(f, repoDir, api), r = await spawnCollect(cmd, f.runner === "pytest" ? [...args, "-rfE"] : args, { cwd, env: plainTestEnv(), timeoutMs: Math.max(1000, Math.min(this.timeoutMs, remaining?.() ?? this.timeoutMs)) }), out2 = stripAnsi(r.output), base = classify(f, r.status, out2, repoDir, interpreter), result = corroborate && base === "not_run" && r.status === 0 && f.runner === "go" && interpreter !== "system" && (await corroboratePass(classifyCheck({ kind: "test", ok: true, out: out2, ...goRunner(cmd, args) }), out2, cmd, args.filter((a, k) => a !== "-run" && args[k - 1] !== "-run"), { cwd, env: plainTestEnv() })).result === "pass" ? "pass" : base;
|
|
27436
|
+
const { cmd, args, interpreter, cwd } = commandFor(f, repoDir, api), r = await spawnCollect(cmd, f.runner === "pytest" ? [...args, "-rfE"] : args, { cwd, env: plainTestEnv(), timeoutMs: Math.max(1000, Math.min(this.timeoutMs, remaining?.() ?? this.timeoutMs)) }), out2 = stripAnsi(r.output), base = classify(f, r.status, out2, repoDir, this.trustSystem ? undefined : interpreter), result = corroborate && base === "not_run" && r.status === 0 && f.runner === "go" && interpreter !== "system" && (await corroboratePass(classifyCheck({ kind: "test", ok: true, out: out2, ...goRunner(cmd, args) }), out2, cmd, args.filter((a, k) => a !== "-run" && args[k - 1] !== "-run"), { cwd, env: plainTestEnv() })).result === "pass" ? "pass" : base;
|
|
27269
27437
|
return { pass: +(result === "pass"), fail: +(result === "fail"), not_run: +(result === "not_run"), notRunFiles: result === "not_run" ? [{ file: f.path, reason: notRunReason(r.status, interpreter), ...interpreter === "system" ? { interpreter } : {} }] : [] };
|
|
27270
27438
|
}, () => remaining !== undefined && remaining() <= 0);
|
|
27271
27439
|
}
|
|
@@ -27324,7 +27492,7 @@ async function wallAuthor(ctx, signal, retry) {
|
|
|
27324
27492
|
if (signal.aborted)
|
|
27325
27493
|
return done({ status: "failed", data: {}, reason: "aborted before wall started" });
|
|
27326
27494
|
if (!wallEnabled())
|
|
27327
|
-
return done({ status: "skipped", data: {}, reason: "LOKI_E10_WALL=
|
|
27495
|
+
return done({ status: "skipped", data: {}, reason: "Wall session off (default; LOKI_E10_WALL=1 turns it on)" });
|
|
27328
27496
|
const prior = ctx.outputs();
|
|
27329
27497
|
const task = loadTaskText(ctx, prior.intake?.task);
|
|
27330
27498
|
const repomapRef = prior.intake?.repomap_ref;
|
|
@@ -31268,6 +31436,7 @@ __export(exports_seal, {
|
|
|
31268
31436
|
WALL_GREEN_ON_BASE_REASON: () => WALL_GREEN_ON_BASE_REASON,
|
|
31269
31437
|
UNEXERCISED_PUBLIC: () => UNEXERCISED_PUBLIC,
|
|
31270
31438
|
SIGNING_UNAVAILABLE: () => SIGNING_UNAVAILABLE,
|
|
31439
|
+
NO_FAIL_THEN_PASS: () => NO_FAIL_THEN_PASS,
|
|
31271
31440
|
LEAN_NO_SYMBOL: () => LEAN_NO_SYMBOL,
|
|
31272
31441
|
EXTERNAL_NO_WALL: () => EXTERNAL_NO_WALL,
|
|
31273
31442
|
EXTERNAL_MODEL_LABEL: () => EXTERNAL_MODEL_LABEL,
|
|
@@ -31275,9 +31444,48 @@ __export(exports_seal, {
|
|
|
31275
31444
|
AGENT_ONLY_REASON: () => AGENT_ONLY_REASON
|
|
31276
31445
|
});
|
|
31277
31446
|
import { createHash as createHash30 } from "crypto";
|
|
31447
|
+
import { execFileSync as execFileSync8 } from "child_process";
|
|
31278
31448
|
import { existsSync as existsSync63, readdirSync as readdirSync34, mkdirSync as mkdirSync44, readFileSync as readFileSync84 } from "fs";
|
|
31279
31449
|
import { basename as basename28, isAbsolute as isAbsolute16, join as join98, relative as relative19 } from "path";
|
|
31280
|
-
async function
|
|
31450
|
+
async function codeSymbols(ctx, rawDiff, head) {
|
|
31451
|
+
const code = [];
|
|
31452
|
+
for (let i = 0;i + 1 < rawDiff.length; i += 2) {
|
|
31453
|
+
const st = rawDiff[i].trim().split(" ").pop() ?? "", f = rawDiff[i + 1];
|
|
31454
|
+
if (st !== "D" && CODE_FILE_EXT.test(f) && !isTestFile(f))
|
|
31455
|
+
code.push(f);
|
|
31456
|
+
}
|
|
31457
|
+
const onBase = new Set;
|
|
31458
|
+
if (code.length === 0)
|
|
31459
|
+
return { all: [], onBase };
|
|
31460
|
+
for (let i = 0;i + 1 < rawDiff.length; i += 2) {
|
|
31461
|
+
const f = rawDiff[i + 1];
|
|
31462
|
+
if (code.includes(f) && (rawDiff[i].trim().split(" ").pop() ?? "") !== "A") {
|
|
31463
|
+
const b = await safeGitRun(ctx.repoDir, ["show", `${ctx.baseSha}:${f}`], { timeoutMs: 20000 });
|
|
31464
|
+
if (b.exitCode === 0)
|
|
31465
|
+
for (const id of identifierSet(b.stdout))
|
|
31466
|
+
onBase.add(id);
|
|
31467
|
+
}
|
|
31468
|
+
}
|
|
31469
|
+
const d = await safeGitRun(ctx.repoDir, ["diff", "-U0", "--no-color", "--no-ext-diff", "--no-textconv", "--no-renames", ctx.baseSha, head, "--", ...code], { timeoutMs: 20000 });
|
|
31470
|
+
return { all: d.exitCode === 0 ? changedSymbols(d.stdout) : [], onBase };
|
|
31471
|
+
}
|
|
31472
|
+
async function failThenPass(ctx, vraw, pctx, head, cs, task) {
|
|
31473
|
+
const files = [...new Set(vraw.filter((c) => isExecutedProof(c) && checkProvenance(String(c.name ?? ""), pctx) === "agent_authored").map((c) => String(c.name).slice(String(c.name).indexOf(":") + 1)))];
|
|
31474
|
+
if (files.length === 0)
|
|
31475
|
+
return { ok: false, line: "", files: [] };
|
|
31476
|
+
const mp = await mutationProof({ repoDir: ctx.repoDir, baseSha: ctx.baseSha, runDir: ctx.runDir, wallFiles: files.map((path) => ({ path })), checks: vraw, runner: (ms) => new RealBaseTestRunner(undefined, ms, {}, !declaresPythonEnv(ctx.repoDir, head)), headSha: head, requireAssertion: true, baseMustPass: files.filter((f) => pctx.modifiedFiles?.includes(f)) });
|
|
31477
|
+
const symbols = cs.all.filter((s) => cs.onBase.has(s) || new RegExp(`(?<![\\w$])${s.replace(/[$]/g, "\\$")}(?![\\w$])`).test(task));
|
|
31478
|
+
const read3 = (p) => {
|
|
31479
|
+
try {
|
|
31480
|
+
return execFileSync8("git", ["-C", ctx.repoDir, "show", `${head}:${p}`], { encoding: "utf8", maxBuffer: 16 << 20, timeout: 20000 });
|
|
31481
|
+
} catch {
|
|
31482
|
+
return "";
|
|
31483
|
+
}
|
|
31484
|
+
};
|
|
31485
|
+
const failed2 = (mp.outcome === "yes" ? mp.failed ?? [] : []).filter((f) => symbolGap(symbols, [read3(f)]).length === 0);
|
|
31486
|
+
return { ok: failed2.length > 0, line: failed2.length > 0 ? `${mp.line} (${failed2.join(", ")})` : mp.line, files: failed2 };
|
|
31487
|
+
}
|
|
31488
|
+
async function symbolGaps(ctx, o, rawDiff, head, vraw, wallOff = null) {
|
|
31281
31489
|
const none = { lean: [], pub: [] };
|
|
31282
31490
|
if (externalRun(o) || o.intake?.already_satisfied === true || o.implement?.exit === "already_done")
|
|
31283
31491
|
return none;
|
|
@@ -31303,13 +31511,15 @@ async function symbolGaps(ctx, o, rawDiff, head, vraw) {
|
|
|
31303
31511
|
const n3 = String(c.name ?? ""), p = n3.slice(n3.indexOf(":") + 1);
|
|
31304
31512
|
return n3.includes(":") && !n3.startsWith("full suite:") && isTestFile(p) ? p : null;
|
|
31305
31513
|
};
|
|
31306
|
-
const allSources = executed.map(testOf).filter((p) => p !== null).map(read3);
|
|
31514
|
+
const allSources = (wallOff ? executed.filter((c) => checkProvenance(String(c.name ?? ""), wallOff.pctx) !== "agent_authored") : executed).map(testOf).filter((p) => p !== null).map(read3);
|
|
31307
31515
|
const ranWall = Array.isArray(o.wall?.files) && o.wall.files.length > 0, leanFiles = code.filter((f) => CODE_FILE_EXT.test(f));
|
|
31308
31516
|
let lean = [];
|
|
31309
31517
|
if (!ranWall && leanFiles.length) {
|
|
31310
31518
|
const d = await safeGitRun(ctx.repoDir, ["diff", "-U0", "--no-color", "--no-ext-diff", "--no-textconv", "--no-renames", ctx.baseSha, head, "--", ...leanFiles], { timeoutMs: 20000 });
|
|
31311
31519
|
if (d.exitCode === 0)
|
|
31312
31520
|
lean = symbolGap(changedSymbols(d.stdout), allSources);
|
|
31521
|
+
if (lean.length > 0 && wallOff && await wallOff.ftp())
|
|
31522
|
+
lean = [];
|
|
31313
31523
|
}
|
|
31314
31524
|
if (process.env["LOKI_E10_PUBLIC_GAP"] !== "1")
|
|
31315
31525
|
return { lean, pub: [] };
|
|
@@ -31419,7 +31629,7 @@ function renderReceiptMd(r) {
|
|
|
31419
31629
|
].join(`
|
|
31420
31630
|
`);
|
|
31421
31631
|
}
|
|
31422
|
-
var SYSTEM_INTERP = "tests ran on the system interpreter", SYSTEM_INTERP_SUFFIX = " (the repo declares no Python dependencies, so this is its interpreter; informational, does not cap)", SIGNING_UNAVAILABLE = "receipt signing unavailable (no usable signing key: invalid key or unwritable ~/.loki/keys)", AGENT_ONLY_REASON = "only agent-authored tests executed (no agent-independent proof)", WALL_GREEN_ON_BASE_REASON = "Wall green on base: no Wall test discriminates the change", EXCLUDE_LOKI = ":(exclude).loki", sha2562 = (s) => createHash30("sha256").update(s).digest("hex"), str3 = (v) => typeof v === "string" && v !== "" ? v : null, EXTERNAL_MODEL_LABEL = "external (no Loki implement session)", EXTERNAL_DIFF_NOT_ISOLATED = "Wall author not filesystem-isolated from the external diff", EXTERNAL_NO_WALL = "external diff sealed with no Wall file that ran; the only checks are the repo's existing tests", externalRun = (o) => o.implement?.exit === "external", LEAN_NO_SYMBOL = "no passing check references a changed symbol and no Wall file ran", UNEXERCISED_PUBLIC = "no agent-independent passing test calls these added public functions", CALLER_SCAN = 3000, CALLER_MAX_BYTES = 200000, strs2 = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string" && x !== "") : [], g = (ctx) => (a) => git5(ctx, a), receiptRel = (ctx) => {
|
|
31632
|
+
var SYSTEM_INTERP = "tests ran on the system interpreter", SYSTEM_INTERP_SUFFIX = " (the repo declares no Python dependencies, so this is its interpreter; informational, does not cap)", SIGNING_UNAVAILABLE = "receipt signing unavailable (no usable signing key: invalid key or unwritable ~/.loki/keys)", AGENT_ONLY_REASON = "only agent-authored tests executed (no agent-independent proof)", WALL_GREEN_ON_BASE_REASON = "Wall green on base: no Wall test discriminates the change", EXCLUDE_LOKI = ":(exclude).loki", sha2562 = (s) => createHash30("sha256").update(s).digest("hex"), str3 = (v) => typeof v === "string" && v !== "" ? v : null, EXTERNAL_MODEL_LABEL = "external (no Loki implement session)", EXTERNAL_DIFF_NOT_ISOLATED = "Wall author not filesystem-isolated from the external diff", EXTERNAL_NO_WALL = "external diff sealed with no Wall file that ran; the only checks are the repo's existing tests", externalRun = (o) => o.implement?.exit === "external", LEAN_NO_SYMBOL = "no passing check references a changed symbol and no Wall file ran", NO_FAIL_THEN_PASS = "no test shown to fail on the base commit and pass on the change", UNEXERCISED_PUBLIC = "no agent-independent passing test calls these added public functions", CALLER_SCAN = 3000, CALLER_MAX_BYTES = 200000, strs2 = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string" && x !== "") : [], g = (ctx) => (a) => git5(ctx, a), receiptRel = (ctx) => {
|
|
31423
31633
|
const r = relative19(ctx.repoDir, join98(ctx.runDir, "receipt.json"));
|
|
31424
31634
|
return r.startsWith("..") || isAbsolute16(r) ? `.loki/runs/${ctx.runId}/receipt.json` : r;
|
|
31425
31635
|
}, commitStage, wallGreenOnBaseOf = (o) => {
|
|
@@ -31533,15 +31743,20 @@ var init_seal = __esm(() => {
|
|
|
31533
31743
|
const disclosedSet = new Set(decl.disclosed), capRc = rcNotes.filter((n3) => !disclosedSet.has(n3)), capVerify = verifyNotProven.filter((n3) => !disclosedSet.has(n3) && n3 !== sysInfo);
|
|
31534
31744
|
const DECLARED_SUFFIX = " (declared by the plan or required by the passing Wall; disclosed, does not cap)";
|
|
31535
31745
|
const grp = sealGroup(ctx.runDir, receiptSha256);
|
|
31536
|
-
const executed = hasExecutedProof(vraw),
|
|
31746
|
+
const executed = hasExecutedProof(vraw), strictProof = process.env["LOKI_EXOGENOUS_PROOF"] !== "0", noWall = !(Array.isArray(o.wall?.files) && o.wall.files.length > 0);
|
|
31747
|
+
const ftpGate = strictProof && noWall && diffOk && !externalRun(o) && o.intake?.already_satisfied !== true && o.implement?.exit !== "already_done" && weakTests.length === 0 && !checks.some((c) => c.result === "fail") && mutationEnabled();
|
|
31748
|
+
let ftpMemo = null;
|
|
31749
|
+
const ftp = () => ftpMemo ??= codeSymbols(ctx, rawDiff, head).then((cs) => failThenPass(ctx, vraw, pctx, head, cs, loadTaskText(ctx, str3(o.intake?.task) ?? undefined)));
|
|
31750
|
+
const exoProof = hasExogenousProof(vraw, pctx), proof = !strictProof ? executed : !noWall ? exoProof : exoProof || ftpGate && (await ftp()).ok;
|
|
31537
31751
|
const uncoveredAfterLimit = o.implement?.exit === "killed" ? strs2(o.verify?.uncovered_changed) : [];
|
|
31538
|
-
const { lean: leanGap, pub: pubGap } = diffOk ? await symbolGaps(ctx, o, rawDiff, head, vraw) : { lean: [], pub: [] };
|
|
31752
|
+
const { lean: leanGap, pub: pubGap } = diffOk ? await symbolGaps(ctx, o, rawDiff, head, vraw, strictProof && noWall ? { pctx, ftp: async () => ftpGate && (await ftp()).ok } : null) : { lean: [], pub: [] };
|
|
31539
31753
|
const wpAll = publishableWall(ctx.repoDir, ctx.runDir, o, process.env, loadTaskText(ctx, str3(o.intake?.task) ?? undefined));
|
|
31540
31754
|
const verdict0 = capGroupVerdict(verdictOf2(o, checks.filter((c) => !(c.result === "fail" && preRedChecks.includes(c.name)) && c.repo_skipped !== true), !diffOk || diff.stdout === "", capVerify.length > 0 || weakTests.length > 0 || capRc.length > 0, wallGreenOnBase, proof, targetProofOf(o.verify), uncoveredAfterLimit, [...leanGap, ...pubGap], wpAll.notes, wpAll.clauseGap), grp);
|
|
31541
31755
|
const supply = await supplyGuard(ctx.repoDir, rawDiff.filter((_, i) => i % 2 === 1), readDeclared(ctx.repoDir), process.env);
|
|
31542
31756
|
const verdict1 = supplyVerdict(verdict0, supply);
|
|
31543
31757
|
const xr = await crossReview(ctx, verdict1, head, signal), verdict2 = minVerdict(verdict1, xr);
|
|
31544
|
-
const
|
|
31758
|
+
const mp0 = verdict2 === "VERIFIED" && mutationEnabled() ? await mutationProof({ repoDir: ctx.repoDir, baseSha: ctx.baseSha, runDir: ctx.runDir, wallFiles: Array.isArray(o.wall?.files) ? o.wall.files : [], checks: Array.isArray(o.verify?.checks) ? o.verify.checks : [], runner: (ms) => new RealBaseTestRunner(undefined, ms) }) : null;
|
|
31759
|
+
const ftpRes = await ftpMemo, mp = ftpRes?.ok && verdict2 === "VERIFIED" && noWall ? { outcome: "yes", line: ftpRes.line } : mp0;
|
|
31545
31760
|
const arbCap = Array.isArray(o.wall?.arbitrated) && o.wall.arbitrated.length > 0 && (verdict2 === "VERIFIED" || verdict2 === "ALREADY_SATISFIED"), mutCap = mp?.outcome === "no" && mutationStrict() && o.plan?.behavior_change === true, verdict3 = mutCap || arbCap ? "PARTIAL" : verdict2;
|
|
31546
31761
|
const deepG = deepGaps(o.verify?.risk, vraw, Array.isArray(o.deep?.checks) ? o.deep.checks : [], modelReviewRan(xr)), notProven = new Set([...deepG.notProven, ...supply.notProven, ...grp.notProven, ...xr?.notes ?? [], ...reviewReceipt(ctx.provider, xr).notProven]);
|
|
31547
31762
|
const wp = verdict3 === "VERIFIED" ? wpAll : { files: [], notes: wpAll.notes };
|
|
@@ -31570,6 +31785,8 @@ var init_seal = __esm(() => {
|
|
|
31570
31785
|
const vc = vraw;
|
|
31571
31786
|
notProven.add(executed ? AGENT_ONLY_REASON : vc.length > 0 && vc.every((c) => c.n !== 0 && String(c.reason ?? "").startsWith(UNMEASURED_REASON)) ? UNMEASURED_REASON : vc.length > 0 && vc.every((c) => c.n !== 0 && String(c.reason ?? "").startsWith(UNCONFIRMED_REASON)) ? UNCONFIRMED_REASON : NO_TESTS_REASON);
|
|
31572
31787
|
}
|
|
31788
|
+
if (ftpRes && !ftpRes.ok && verdict === "PARTIAL")
|
|
31789
|
+
notProven.add(`${NO_FAIL_THEN_PASS}${ftpRes.line ? `: ${ftpRes.line}` : ""}`);
|
|
31573
31790
|
if (wallNotRun > 0)
|
|
31574
31791
|
notProven.add(`wall base run not_run: ${wallNotRun}`);
|
|
31575
31792
|
for (const n3 of strs2(o.wall?.not_proven))
|
|
@@ -34463,7 +34680,7 @@ var init_github_token = __esm(() => {
|
|
|
34463
34680
|
});
|
|
34464
34681
|
|
|
34465
34682
|
// ../../loki-ts/src/engine10/fetch_issue.ts
|
|
34466
|
-
import { execFileSync as
|
|
34683
|
+
import { execFileSync as execFileSync9 } from "child_process";
|
|
34467
34684
|
import { writeFileSync as writeFileSync52 } from "fs";
|
|
34468
34685
|
import { join as join109 } from "path";
|
|
34469
34686
|
function isTrustedGithubComment(c) {
|
|
@@ -34510,7 +34727,7 @@ ${parts.join(`
|
|
|
34510
34727
|
}
|
|
34511
34728
|
function defaultExec(cmd, args) {
|
|
34512
34729
|
const ms = Number(process.env.LOKI_FETCH_ISSUE_TIMEOUT_MS) || 60000;
|
|
34513
|
-
return
|
|
34730
|
+
return execFileSync9(cmd, args, { encoding: "utf8", env: process.env, timeout: ms, killSignal: "SIGKILL" });
|
|
34514
34731
|
}
|
|
34515
34732
|
function fetchIssue(ref, execer = defaultExec) {
|
|
34516
34733
|
const raw2 = execer("bash", ["-c", `source "${ISSUE_PROVIDERS_SH}" && fetch_issue "$1"`, "--", ref]);
|
|
@@ -34991,8 +35208,8 @@ var init_registry = __esm(() => {
|
|
|
34991
35208
|
sub("bundle", "Write a self-verifying receipt bundle", { positionals: [runId] })
|
|
34992
35209
|
]
|
|
34993
35210
|
}),
|
|
34994
|
-
cmd("wiki", "
|
|
34995
|
-
migrate: "
|
|
35211
|
+
cmd("wiki", "FOLD", "both", "Cited codebase wiki and Q&A", "Bun-native knowledge feature", {
|
|
35212
|
+
migrate: "loki chat",
|
|
34996
35213
|
subcommands: [
|
|
34997
35214
|
sub("generate", "Generate the wiki"),
|
|
34998
35215
|
sub("show", "Show a section", { positionals: [{ name: "section", type: "string" }] }),
|
|
@@ -35008,8 +35225,8 @@ var init_registry = __esm(() => {
|
|
|
35008
35225
|
sub("status", "Show control plane reachability", { flags: [bool("--json", "Print one JSON object")] })
|
|
35009
35226
|
]
|
|
35010
35227
|
}),
|
|
35011
|
-
cmd("runs", "
|
|
35012
|
-
cmd("intent", "
|
|
35228
|
+
cmd("runs", "FOLD", "bun", "List runs across registered projects", "R100-008: one list over the loki projects registry", { migrate: "loki status", flags: [json] }),
|
|
35229
|
+
cmd("intent", "FOLD", "bun", "Show a past run's intent card", "Read-only intent view", { migrate: "loki status <run>", subcommands: [sub("show", "Print the intent card and answer", { positionals: [runId] })] }),
|
|
35013
35230
|
cmd("kpis", "HIDE", "bun", "KPI snapshot (alias of report kpis)", "Bun-native KPI report", { flags: [json, str4("--since", "<Nd|YYYY-MM-DD>", "Limit iteration totals to a window")] }),
|
|
35014
35231
|
cmd("report", "HIDE", "both", "Reporting: kpis, session, metrics, cost, export, share, dogfood, release-notes", "Mixed route; only kpis is Bun", {
|
|
35015
35232
|
subcommands: [
|
|
@@ -35051,7 +35268,7 @@ var init_registry = __esm(() => {
|
|
|
35051
35268
|
cmd("help", "HIDE", "bash", "Show help", "Core", { aliases: ["--help", "-h"], positionals: [{ name: "command", type: "string" }] }),
|
|
35052
35269
|
cmd("chat", "KEEP", "bash", "Interactive chat with the active provider", "Provider-neutral conversational verb", { positionals: [{ name: "message", type: "string" }] }),
|
|
35053
35270
|
cmd("edit", "FOLD", "bash", "Make one small scoped edit", "Provider-neutral single-edit verb", { migrate: 'loki "<change>" --no-pr', positionals: [{ name: "task", type: "string" }] }),
|
|
35054
|
-
cmd("diff", "
|
|
35271
|
+
cmd("diff", "FOLD", "bash", "Show what the last run changed", "Passes extra args to git diff", { migrate: "loki status <run>" }),
|
|
35055
35272
|
cmd("models", "FOLD", "bash", "Show per-provider model routes", "Provider-neutral model tiers", { migrate: "loki config list" }),
|
|
35056
35273
|
cmd("setup", "FOLD", "bash", "Guided first-run setup wizard", "Onboarding gate", { migrate: "loki doctor --fix" }),
|
|
35057
35274
|
cmd("quick", "FOLD", "bash", "One small task", "Routes to the v10 lean path by default", { migrate: 'loki "<task>" --no-pr', positionals: [{ name: "task", type: "string" }] }),
|
|
@@ -35066,12 +35283,12 @@ var init_registry = __esm(() => {
|
|
|
35066
35283
|
cmd("mcp", "HIDE", "bash", "Launch the MCP server (stdio)", "Engine-neutral", { subcommands: [sub("install", "Register loki-mode in an MCP client config", { flags: [str4("--client", "<name>", "claude, cursor, vscode or windsurf"), bool("--project", "Project-level config"), bool("--global", "User-level config"), bool("--print", "Print, write nothing")] })] }),
|
|
35067
35284
|
cmd("acp", "HIDE", "bash", "Run Loki as an ACP agent", "Engine-neutral"),
|
|
35068
35285
|
cmd("stop", "KEEP", "bash", "Stop execution immediately", "Session control"),
|
|
35069
|
-
cmd("pause", "
|
|
35286
|
+
cmd("pause", "FOLD", "both", "Pause after the current session", "Session control; Bun writes the Loki 10 run request, bash keeps the legacy PAUSE file", { migrate: "loki stop --graceful" }),
|
|
35070
35287
|
cmd("resume", "FOLD", "both", "Resume a paused or interrupted run", "Session control; Bun clears a Loki 10 pause, bash keeps the legacy resume", { migrate: "loki start" }),
|
|
35071
|
-
cmd("cancel", "
|
|
35288
|
+
cmd("cancel", "FOLD", "both", "Cancel the active Loki 10 run at the next stage boundary", "Session control; Loki 10 only", { migrate: "loki stop --graceful" }),
|
|
35072
35289
|
cmd("why", "FOLD", "bash", "Explain how the last run ended", "Outcome explainer", { migrate: "loki status" }),
|
|
35073
|
-
cmd("next", "
|
|
35074
|
-
cmd("logs", "
|
|
35290
|
+
cmd("next", "FOLD", "bash", "Run the right next step", "Guided flow", { migrate: "loki status" }),
|
|
35291
|
+
cmd("logs", "FOLD", "bash", "Tail recent log output", "Engine-neutral", { migrate: "loki status" }),
|
|
35075
35292
|
cmd("ship", "REMOVED", "bash", "Ship the verified result", "Delivery", { migrate: "Use: loki deploy" }),
|
|
35076
35293
|
cmd("deploy", "KEEP", "bash", "Deploy the built product", "Delivery"),
|
|
35077
35294
|
cmd("import", "REMOVED", "bash", "Import issues or specs", "Spec intake", { migrate: "Use: loki start <ref or file>" }),
|
|
@@ -35079,49 +35296,49 @@ var init_registry = __esm(() => {
|
|
|
35079
35296
|
cmd("issue", "REMOVED", "bash", "Work an issue", "Issue-mode", { migrate: "Use: loki start owner/repo#N", positionals: [{ name: "ref", type: "dynamic", dynamic: "issues" }] }),
|
|
35080
35297
|
cmd("ci", "HIDE", "bash", "CI helpers", "Engine-neutral"),
|
|
35081
35298
|
cmd("modernize", "HIDE", "both", "Code modernization", "Routed to engine10 modernize"),
|
|
35082
|
-
cmd("share", "
|
|
35299
|
+
cmd("share", "FOLD", "bash", "Share a run", "Engine-neutral", { migrate: "loki receipt share" }),
|
|
35083
35300
|
cmd("assets", "REMOVED", "bash", "Export team assets", "Engine-neutral", { migrate: "Use: loki chat", subcommands: [sub("export", "Export shareable assets", { positionals: [{ name: "file", type: "path" }] })] }),
|
|
35084
|
-
cmd("export", "
|
|
35085
|
-
cmd("notify", "
|
|
35301
|
+
cmd("export", "FOLD", "bash", "Export session data", "Duplicates report export", { migrate: "loki verify <run> --sarif", flags: [bool("--sarif", "Write findings.sarif for a run (SARIF 2.1.0)")] }),
|
|
35302
|
+
cmd("notify", "FOLD", "bash", "Notifications", "Engine-neutral", { migrate: "loki status", subcommands: [sub("desktop", "Send a desktop notification (macOS or Linux notify-send)", { positionals: [{ name: "message", type: "string" }] })] }),
|
|
35086
35303
|
cmd("tour", "FOLD", "bash", "See a sample result", "Onboarding", { migrate: "loki start outside a repo" }),
|
|
35087
35304
|
cmd("wow", "FOLD", "bash", "Tiny real task, or the offline sample", "Onboarding: loki tour --live", { migrate: "loki start outside a repo" }),
|
|
35088
35305
|
cmd("try", "REMOVED", "bash", "Try Loki on a public repo in a temp clone, keep only the receipt", "Onboarding: never touches your checkout", { migrate: "Use: loki start <repo url> --no-pr from a fresh clone", flags: [bool("--dry-run", "Clone, print the clone path, task and estimate, no model call"), str4("--provider", "<name>", "claude or opencode"), str4("--max-cost", "<usd>", "Hard per-run cap in USD (default 2)")], positionals: [{ name: "url", type: "string" }] }),
|
|
35089
35306
|
cmd("factory", "FOLD", "bash", "loki start with the autonomy policy printed", "propose, execute, operate unchanged", { migrate: "loki start -v" }),
|
|
35090
|
-
cmd("welcome", "
|
|
35091
|
-
cmd("onboard", "
|
|
35092
|
-
cmd("setup-skill", "
|
|
35307
|
+
cmd("welcome", "FOLD", "bash", "First-run opener", "Onboarding", { migrate: "loki doctor" }),
|
|
35308
|
+
cmd("onboard", "FOLD", "bash", "Onboard to a codebase", "Overlaps wiki", { migrate: "loki chat" }),
|
|
35309
|
+
cmd("setup-skill", "FOLD", "bash", "Install the skill symlinks", "Setup", { migrate: "loki doctor --fix" }),
|
|
35093
35310
|
cmd("self-update", "HIDE", "bash", "Update Loki", "Maintenance", { aliases: ["self_update", "update"] }),
|
|
35094
35311
|
cmd("remote", "REMOVED", "bash", "Remote session", "Engine-neutral", { migrate: "Use: loki status", aliases: ["rc"] }),
|
|
35095
|
-
cmd("cockpit", "
|
|
35312
|
+
cmd("cockpit", "FOLD", "bash", "Live multi-repo cockpit", "Engine-neutral", { migrate: "loki control serve" }),
|
|
35096
35313
|
cmd("code", "REMOVED", "bash", "Code intelligence", "Overlaps wiki", { migrate: "Use: loki chat" }),
|
|
35097
35314
|
cmd("context", "REMOVED", "bash", "Cross-project context", "Engine-neutral", { migrate: "Use: loki chat", aliases: ["ctx"] }),
|
|
35098
35315
|
cmd("secrets", "HIDE", "bash", "Secrets handling", "Security"),
|
|
35099
|
-
cmd("api", "
|
|
35316
|
+
cmd("api", "FOLD", "bash", "Dashboard HTTP API", "Engine-neutral", { migrate: "loki control serve" }),
|
|
35100
35317
|
cmd("sandbox", "HIDE", "bash", "Docker sandbox", "Isolation"),
|
|
35101
35318
|
cmd("docker", "HIDE", "bash", "Docker helpers", "Isolation"),
|
|
35102
35319
|
cmd("web", "HIDE", "bash", "Web UI", "Overlaps Control Plane UI"),
|
|
35103
|
-
cmd("preview", "
|
|
35104
|
-
cmd("telemetry", "
|
|
35320
|
+
cmd("preview", "FOLD", "bash", "Preview the built app", "Delivery", { migrate: "loki deploy" }),
|
|
35321
|
+
cmd("telemetry", "FOLD", "bash", "Telemetry controls", "Privacy surface", { migrate: "loki config set telemetry off", aliases: ["otel"] }),
|
|
35105
35322
|
cmd("syslog", "HIDE", "bash", "System log forwarding", "Legacy log paths"),
|
|
35106
|
-
cmd("explain", "
|
|
35323
|
+
cmd("explain", "FOLD", "bash", "Explain code", "Knowledge", { migrate: "loki chat" }),
|
|
35107
35324
|
cmd("docs", "FOLD", "bash", "Open docs", "Core", { migrate: "loki help" }),
|
|
35108
35325
|
cmd("test", "HIDE", "bash", "Run project tests", "Legacy runner"),
|
|
35109
35326
|
cmd("bench", "HIDE", "bash", "Benchmarks", "Engine-neutral"),
|
|
35110
35327
|
cmd("voice", "REMOVED", "bash", "Voice input", "Experimental", { migrate: "Use: loki start" }),
|
|
35111
|
-
cmd("own", "
|
|
35328
|
+
cmd("own", "FOLD", "bash", "Hand off ownership", "Legacy handoff", { migrate: "loki chat", aliases: ["handoff"] }),
|
|
35112
35329
|
cmd("secure", "REMOVED", "bash", "Security scan", "Security", { migrate: "Use: loki doctor" }),
|
|
35113
35330
|
cmd("compliance", "HIDE", "bash", "Compliance reports", "Enterprise"),
|
|
35114
35331
|
cmd("enterprise", "HIDE", "bash", "Enterprise features", "Enterprise"),
|
|
35115
|
-
cmd("projects", "
|
|
35332
|
+
cmd("projects", "FOLD", "bash", "Project registry", "Engine-neutral", { migrate: "loki control serve" }),
|
|
35116
35333
|
cmd("audit", "HIDE", "bash", "Audit log", "Enterprise"),
|
|
35117
|
-
cmd("cost", "
|
|
35334
|
+
cmd("cost", "FOLD", "bash", "Cost report", "Duplicates report cost", { migrate: "loki start --dry-run" }),
|
|
35118
35335
|
cmd("metrics", "HIDE", "bash", "Metrics", "Duplicates report metrics"),
|
|
35119
|
-
cmd("sentrux", "
|
|
35336
|
+
cmd("sentrux", "FOLD", "bash", "Architecture sensor", "Legacy gate input", { migrate: "loki start" }),
|
|
35120
35337
|
cmd("magic", "HIDE", "bash", "Magic modules", "Legacy UI generator"),
|
|
35121
35338
|
cmd("estimate", "FOLD", "bash", "Cost estimate for a PRD", "Estimates the legacy PRD flow", { migrate: "loki start <PRD> --dry-run" }),
|
|
35122
35339
|
cmd("plan", "FOLD", "bash", "Dry-run PRD analysis", "Legacy PRD flow", { migrate: "loki start <PRD> --dry-run" }),
|
|
35123
|
-
cmd("grill", "
|
|
35124
|
-
cmd("spec", "
|
|
35340
|
+
cmd("grill", "FOLD", "bash", "Spec interrogation", "Legacy PRD flow", { migrate: "loki start <PRD> --dry-run" }),
|
|
35341
|
+
cmd("spec", "FOLD", "bash", "Living-spec drift", "Legacy PRD flow", { migrate: "loki start <PRD> --dry-run" }),
|
|
35125
35342
|
cmd("backlog", "FOLD", "bash", "Run matching issues in parallel", "Drives legacy RARV per issue", { migrate: "loki start owner/repo --label L --parallel K" }),
|
|
35126
35343
|
cmd("workspace", "HIDE", "bash", "Multi-repo workspace runs", "Control Plane spawns workspace run; users get it via start --workspace"),
|
|
35127
35344
|
cmd("council", "REMOVED", "bash", "Completion council", "Legacy RARV gate", { migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
@@ -35133,25 +35350,25 @@ var init_registry = __esm(() => {
|
|
|
35133
35350
|
cmd("watch", "REMOVED", "bash", "Rerun on PRD change", "PRD flow", { migrate: "Rerun with: loki start <PRD>" }),
|
|
35134
35351
|
cmd("watchdog", "REMOVED", "bash", "Legacy run watchdog", "Legacy engine", { migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
35135
35352
|
cmd("cleanup", "REMOVED", "bash", "Kill orphaned processes", "Legacy run.sh orphans", { migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
35136
|
-
cmd("state", "
|
|
35137
|
-
cmd("agent", "
|
|
35353
|
+
cmd("state", "FOLD", "bash", "Legacy state store", "Legacy engine", { migrate: 'loki start "<goal>"' }),
|
|
35354
|
+
cmd("agent", "FOLD", "bash", "Legacy agent types", "Legacy engine", { migrate: 'loki start "<goal>"' }),
|
|
35138
35355
|
cmd("agents", "HIDE", "bash", "User-configurable child agents (.loki/agents)", "Custom child agents are still read by reviewers"),
|
|
35139
35356
|
cmd("trigger", "HIDE", "bash", "Event triggers", "Event automation server (FR03 extends it)"),
|
|
35140
|
-
cmd("failover", "
|
|
35357
|
+
cmd("failover", "FOLD", "bash", "Provider failover", "Legacy engine", { migrate: 'loki start "<goal>"' }),
|
|
35141
35358
|
cmd("reset", "REMOVED", "bash", "Reset legacy state", "Legacy engine", { migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
35142
35359
|
cmd("merge", "HIDE", "bash", "Gated PR merge queue (pr, watch, run); also merges parallel worktrees", "Control Plane merge list and run"),
|
|
35143
35360
|
cmd("heal", "HIDE", "bash", "Legacy healing", "Referenced by docs; no engine10 consumer verified"),
|
|
35144
|
-
cmd("migrate", "
|
|
35361
|
+
cmd("migrate", "FOLD", "bash", "Legacy migration", "Superseded by modernize", { migrate: 'loki "modernize <what> to <target>"' }),
|
|
35145
35362
|
cmd("dogfood", "REMOVED", "bash", "Dogfood run", "Legacy engine", { migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
35146
35363
|
cmd("steer", "FOLD", "bash", "Nudge a running build", "Session control", { migrate: "loki chat --attach" }),
|
|
35147
35364
|
cmd("outcomes", "REMOVED", "bash", "Outcome analytics", "Legacy outcome store", { migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
35148
35365
|
cmd("worktree", "REMOVED", "bash", "Worktree management", "Legacy parallel mode", { aliases: ["wt"], migrate: 'It drove the removed legacy loop; use: loki start "<goal>"' }),
|
|
35149
|
-
cmd("checkpoint", "
|
|
35150
|
-
cmd("analyze", "
|
|
35366
|
+
cmd("checkpoint", "FOLD", "bash", "Legacy checkpoints", "Legacy engine", { aliases: ["cp"], migrate: "loki undo" }),
|
|
35367
|
+
cmd("analyze", "FOLD", "bash", "Codebase analysis", "Legacy analyze flow", { migrate: 'loki start "<goal>"' }),
|
|
35151
35368
|
cmd("demo", "FOLD", "bash", "Build the sample todo app", "Legacy engine demo", { migrate: "loki start outside a repo" }),
|
|
35152
35369
|
cmd("run", "FOLD", "bash", "Deprecated alias of start", "Alias; use start", { migrate: "loki start" }),
|
|
35153
35370
|
cmd("trust-metrics", "REMOVED", "bash", "Deprecated alias of trust detail", "Alias; use trust detail", { migrate: "Use: loki status --json" }),
|
|
35154
|
-
cmd("serve", "
|
|
35371
|
+
cmd("serve", "FOLD", "bash", "Deprecated alias of api start", "Alias; use api start", { migrate: "loki control serve" }),
|
|
35155
35372
|
cmd("open", "REMOVED", "bash", "Deprecated alias of dashboard open", "Alias; use dashboard open", { migrate: "Use: loki control serve" })
|
|
35156
35373
|
];
|
|
35157
35374
|
CORE_ORDER = ["start", "chat", "status", "verify", "receipt", "stop", "undo", "deploy", "doctor", "config", "control"];
|
|
@@ -47251,7 +47468,7 @@ __export(exports_base_guard, {
|
|
|
47251
47468
|
baseDepsLinker: () => baseDepsLinker,
|
|
47252
47469
|
addedSymlinkNotes: () => addedSymlinkNotes
|
|
47253
47470
|
});
|
|
47254
|
-
import { execFileSync as
|
|
47471
|
+
import { execFileSync as execFileSync11 } from "child_process";
|
|
47255
47472
|
import { createHash as createHash39 } from "crypto";
|
|
47256
47473
|
import { existsSync as existsSync98, mkdirSync as mkdirSync74, mkdtempSync as mkdtempSync19, readdirSync as readdirSync46, readFileSync as readFileSync125, readlinkSync as readlinkSync7, realpathSync as realpathSync34, rmSync as rmSync38, statSync as statSync40, symlinkSync as symlinkSync4, utimesSync, writeFileSync as writeFileSync72 } from "fs";
|
|
47257
47474
|
import { tmpdir as tmpdir25 } from "os";
|
|
@@ -47500,10 +47717,10 @@ function envChangedSince(repoDir, pkgDir, sinceMs, ignored, deps) {
|
|
|
47500
47717
|
writeFileSync72(stamp2, "");
|
|
47501
47718
|
utimesSync(stamp2, sinceMs / 1000, sinceMs / 1000);
|
|
47502
47719
|
const prune = RUNNER_CACHE_DIRS.flatMap((n3, i) => [...i ? ["-o"] : [], "-name", n3]);
|
|
47503
|
-
const out2 =
|
|
47720
|
+
const out2 = execFileSync11("find", ["-P", ...new Set(roots), "(", ...prune, ")", "-prune", "-o", "(", "-type", "f", "-o", "-type", "l", ")", "-cnewer", stamp2, "-print", "-quit"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 120000 });
|
|
47504
47721
|
if (out2.trim() !== "")
|
|
47505
47722
|
return true;
|
|
47506
|
-
const dirs =
|
|
47723
|
+
const dirs = execFileSync11("find", ["-P", ...new Set(roots), "(", ...prune, ")", "-prune", "-o", "-type", "d", "-cnewer", stamp2, "-print"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 120000, maxBuffer: 64 * 1024 * 1024 }).split(`
|
|
47507
47724
|
`).filter(Boolean);
|
|
47508
47725
|
return dirs.some((d) => !(roots.includes(d) || /(?:^|\/)site-packages$/.test(d) || RUNNER_CACHE_DIRS.concat("__pycache__").some((c) => existsSync98(join145(d, c)))));
|
|
47509
47726
|
} catch {
|
|
@@ -90487,7 +90704,7 @@ var init_session_resume = __esm(() => {
|
|
|
90487
90704
|
|
|
90488
90705
|
// ../../loki-ts/src/util/conflict_resume.ts
|
|
90489
90706
|
import { createHash as createHash40 } from "crypto";
|
|
90490
|
-
import { execFileSync as
|
|
90707
|
+
import { execFileSync as execFileSync12 } from "child_process";
|
|
90491
90708
|
import { chmodSync as chmodSync8, existsSync as existsSync105, mkdirSync as mkdirSync81, mkdtempSync as mkdtempSync21, readFileSync as readFileSync132, rmSync as rmSync42, statSync as statSync43, symlinkSync as symlinkSync5, writeFileSync as writeFileSync76 } from "fs";
|
|
90492
90709
|
import { tmpdir as tmpdir27 } from "os";
|
|
90493
90710
|
import { basename as basename41, dirname as dirname61, isAbsolute as isAbsolute25, join as join152, relative as relative32 } from "path";
|
|
@@ -90566,7 +90783,7 @@ function defaultBaseTree(ctx) {
|
|
|
90566
90783
|
const g10 = safeGitSpawn(ctx.repoDir, ["archive", ctx.baseSha], { maxBuffer: 512 * 1024 * 1024 });
|
|
90567
90784
|
if (g10.status !== 0)
|
|
90568
90785
|
throw new Error("git archive failed");
|
|
90569
|
-
|
|
90786
|
+
execFileSync12("tar", ["-x", "-C", dir], { input: g10.stdout, stdio: ["pipe", "ignore", "ignore"], env: tokenFreeEnv() });
|
|
90570
90787
|
for (const v of [".venv", "venv"]) {
|
|
90571
90788
|
const src = join152(ctx.repoDir, v);
|
|
90572
90789
|
if (existsSync105(src) && !existsSync105(join152(dir, v)))
|