loki-mode 11.17.53 → 11.17.55

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.
Files changed (74) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/lib/proof_redact.py +3 -3
  4. package/autonomy/loki +13 -2
  5. package/bin/loki +15 -2
  6. package/completions/_loki +1 -0
  7. package/completions/loki.bash +1 -1
  8. package/dashboard/__init__.py +1 -1
  9. package/docs/CLI-REFERENCE.md +1 -1
  10. package/docs/INSTALLATION.md +1 -1
  11. package/docs/v10/BOARD.md +61 -31
  12. package/docs/v10/PROGRESS.md +6 -0
  13. package/loki-ts/dist/loki.js +1286 -1263
  14. package/mcp/__init__.py +1 -1
  15. package/package.json +2 -2
  16. package/packages/control-plane/dist/server.js +352 -93
  17. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  18. package/web-app/dist/assets/{AdminPage-B5S4tImz.js → AdminPage-CEzsx-2B.js} +1 -1
  19. package/web-app/dist/assets/{Avatar-DVT9cXf-.js → Avatar-CsAVQ-0g.js} +1 -1
  20. package/web-app/dist/assets/{Badge-D-n8nS0d.js → Badge-BT5F2jnq.js} +1 -1
  21. package/web-app/dist/assets/{Button-Dfgum0N6.js → Button-CQjmQOkX.js} +1 -1
  22. package/web-app/dist/assets/{CockpitPage-4xhSdrDM.js → CockpitPage-Cuo0FMGe.js} +1 -1
  23. package/web-app/dist/assets/{ComparePage-CPta-oKN.js → ComparePage-BcLSrBTG.js} +1 -1
  24. package/web-app/dist/assets/{ErrorBoundary-CR8B9oGo.js → ErrorBoundary-DzSPrICj.js} +1 -1
  25. package/web-app/dist/assets/{EvidenceReceiptPanel-CUhElwm7.js → EvidenceReceiptPanel-DV5kdGO5.js} +1 -1
  26. package/web-app/dist/assets/{GitHubIssuesPanel-xKI3dI1W.js → GitHubIssuesPanel-DWhH8uwF.js} +1 -1
  27. package/web-app/dist/assets/{GitHubPRsPanel-CJ16YJ9s.js → GitHubPRsPanel-DPZJL0Ad.js} +1 -1
  28. package/web-app/dist/assets/{HomePage-CzW6cDpa.js → HomePage-CLVmK1C4.js} +2 -2
  29. package/web-app/dist/assets/{LoginPage-CV6Tvhge.js → LoginPage-0qRTmghT.js} +1 -1
  30. package/web-app/dist/assets/{MagicPage-Dqq2v6Uu.js → MagicPage-jUDOyd8m.js} +1 -1
  31. package/web-app/dist/assets/{MetricsPage-w5e0DFyq.js → MetricsPage-Dm3PyXt8.js} +1 -1
  32. package/web-app/dist/assets/{NotFoundPage-CD15KPqA.js → NotFoundPage-Dyr5Iv-6.js} +1 -1
  33. package/web-app/dist/assets/{ProjectPage-CLOEGdOa.js → ProjectPage-CoX7FGHN.js} +3 -3
  34. package/web-app/dist/assets/{ProjectsPage-wVGxTUqN.js → ProjectsPage-CQh9mPvU.js} +1 -1
  35. package/web-app/dist/assets/{SettingsPage-tcZTOUCx.js → SettingsPage-C1bbN9RT.js} +1 -1
  36. package/web-app/dist/assets/{ShowcasePage-DhhFuJrY.js → ShowcasePage-P3Hw9Noe.js} +1 -1
  37. package/web-app/dist/assets/{SystemSettingsPage-DJTIpzRe.js → SystemSettingsPage-DuClc6j2.js} +1 -1
  38. package/web-app/dist/assets/{TeamsPage-D_G-ch7e.js → TeamsPage-DYWppMXo.js} +1 -1
  39. package/web-app/dist/assets/{TemplatesPage-Br8IjtsC.js → TemplatesPage-D2cQ8z97.js} +1 -1
  40. package/web-app/dist/assets/{TerminalOutput-CDpeKr1C.js → TerminalOutput-7SoZNJnN.js} +1 -1
  41. package/web-app/dist/assets/{activity-D3HHYtv7.js → activity-Btrwrman.js} +1 -1
  42. package/web-app/dist/assets/{bell-Cw_RiUI1.js → bell-DyKvtIyq.js} +1 -1
  43. package/web-app/dist/assets/{bot-CvSdbJCG.js → bot-CMCluK2w.js} +1 -1
  44. package/web-app/dist/assets/{check-BrdmdEjE.js → check-6Ps0J2A0.js} +1 -1
  45. package/web-app/dist/assets/{chevron-left-BNGgoAGR.js → chevron-left-UFVem1_Q.js} +1 -1
  46. package/web-app/dist/assets/{circle-alert-DbRWBNqr.js → circle-alert-DN06PnoW.js} +1 -1
  47. package/web-app/dist/assets/{clock-Be7jXWMi.js → clock-ZDdNRPqc.js} +1 -1
  48. package/web-app/dist/assets/{cloud-CRvIp-jH.js → cloud-BBQ_4PAO.js} +1 -1
  49. package/web-app/dist/assets/{code-xml-BzHwWlm3.js → code-xml-CeMIOys1.js} +1 -1
  50. package/web-app/dist/assets/{database-91AqM-FY.js → database-RPRkkycE.js} +1 -1
  51. package/web-app/dist/assets/{dollar-sign-BeNsKJBp.js → dollar-sign-CzMhGRnY.js} +1 -1
  52. package/web-app/dist/assets/{file-code-corner-BvNUefQ2.js → file-code-corner-Bjvy_1-6.js} +1 -1
  53. package/web-app/dist/assets/{file-plus-DSdhJlCE.js → file-plus-qfMa2QbU.js} +1 -1
  54. package/web-app/dist/assets/{globe-alpFSVbm.js → globe-TpJ3ospb.js} +1 -1
  55. package/web-app/dist/assets/{hammer-DceL_3zd.js → hammer-D_nw758T.js} +1 -1
  56. package/web-app/dist/assets/{index-BOfXC5KW.js → index-CtQLnUKu.js} +3 -3
  57. package/web-app/dist/assets/{layers-C2dORLkY.js → layers-qtTx1or7.js} +1 -1
  58. package/web-app/dist/assets/{loader-circle-CcbHAofe.js → loader-circle-B4ijaGyV.js} +1 -1
  59. package/web-app/dist/assets/{lock-yivPar99.js → lock-_HeSCV0H.js} +1 -1
  60. package/web-app/dist/assets/{package-BGe4JXNK.js → package-Dg6Qt1JC.js} +1 -1
  61. package/web-app/dist/assets/{plus-BpZ4ajEG.js → plus-D5fVALHH.js} +1 -1
  62. package/web-app/dist/assets/{refresh-cw-CqIBSjzI.js → refresh-cw-CZHZmoHM.js} +1 -1
  63. package/web-app/dist/assets/{rotate-ccw-C7s45N_R.js → rotate-ccw-BRNlH9dS.js} +1 -1
  64. package/web-app/dist/assets/{scroll-text-Ce9Kmot6.js → scroll-text-DylHv8rG.js} +1 -1
  65. package/web-app/dist/assets/{server-DyUYnlLz.js → server-C3UnfUWG.js} +1 -1
  66. package/web-app/dist/assets/{shield-alert-DT2LYxTG.js → shield-alert-B16YK1L7.js} +1 -1
  67. package/web-app/dist/assets/{thumbs-up-DJeSSzDq.js → thumbs-up-9vfN_rsT.js} +1 -1
  68. package/web-app/dist/assets/{trash-2-BfICAUqu.js → trash-2-BQ-nbCvC.js} +1 -1
  69. package/web-app/dist/assets/{trending-down-DzjhrhCE.js → trending-down-BML7JtUD.js} +1 -1
  70. package/web-app/dist/assets/{trending-up-qxrTgUwQ.js → trending-up-CfYZeeTt.js} +1 -1
  71. package/web-app/dist/assets/{upload-BRZGP_py.js → upload-Bx2AigKp.js} +1 -1
  72. package/web-app/dist/assets/{usePolling-V4nOdEIl.js → usePolling-C3xP585q.js} +1 -1
  73. package/web-app/dist/assets/{user-CHfDU18s.js → user-BAGG-wCv.js} +1 -1
  74. package/web-app/dist/index.html +1 -1
@@ -169,11 +169,13 @@ var init_redact = __esm(() => {
169
169
  [/\bdckr_pat_[A-Za-z0-9_-]{20,}/g, "[REDACTED:DOCKER_TOKEN]"],
170
170
  [/\bdop_v1_[a-f0-9]{64}\b/g, "[REDACTED:DIGITALOCEAN_TOKEN]"],
171
171
  [/\bya29\.[A-Za-z0-9_-]{20,}/g, "[REDACTED:GOOGLE_OAUTH_TOKEN]"],
172
- [/AI[a-zA-Z0-9_-]{30,}/g, "[REDACTED:GOOGLE_KEY]"],
172
+ [/AIza[A-Za-z0-9_-]{35}/g, "[REDACTED:GOOGLE_KEY]"],
173
173
  [/glpat-[A-Za-z0-9_-]{20,}/g, "[REDACTED:GITLAB_TOKEN]"],
174
174
  [/npm_[A-Za-z0-9]{36}/g, "[REDACTED:NPM_TOKEN]"],
175
175
  [/hf_[A-Za-z0-9]{30,}/g, "[REDACTED:HF_TOKEN]"],
176
- [/[sr]k_live_[A-Za-z0-9]{16,}/g, "[REDACTED:STRIPE_KEY]"],
176
+ [/(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}/g, "[REDACTED:STRIPE_KEY]"],
177
+ [/whsec_[A-Za-z0-9]{16,}/g, "[REDACTED:STRIPE_WEBHOOK_SECRET]"],
178
+ [/\bhooks\.slack\.com\/services\/[A-Z0-9]+\/[A-Z0-9]+\/[A-Za-z0-9]{16,}/g, "hooks.slack.com/services/[REDACTED:SLACK_WEBHOOK]"],
177
179
  [/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g, "[REDACTED:PRIVATE_KEY]"],
178
180
  [/sk-[A-Za-z0-9_-]{20,}/g, "[REDACTED:OPENAI_KEY]"],
179
181
  [/(Bearer\s+)[A-Za-z0-9._~+/=-]{20,}/g, "$1[REDACTED]"],
@@ -7792,6 +7794,11 @@ var init_price_table = __esm(() => {
7792
7794
  PRICE_TABLE = Object.freeze({
7793
7795
  "gpt-5.3-codex": { input: 1.75, output: 14, cachedInput: 0.175 },
7794
7796
  "gpt-5-codex": { input: 1.25, output: 10, cachedInput: 0.125 },
7797
+ "gpt-5-mini": { input: 0.25, output: 2, cachedInput: 0.025 },
7798
+ "gpt-5-nano": { input: 0.05, output: 0.4, cachedInput: 0.005 },
7799
+ "gpt-4.1-mini": { input: 0.4, output: 1.6, cachedInput: 0.1 },
7800
+ "gpt-4.1-nano": { input: 0.1, output: 0.4, cachedInput: 0.025 },
7801
+ "gpt-4o-mini": { input: 0.15, output: 0.6, cachedInput: 0.075 },
7795
7802
  "gpt-5": { input: 1.25, output: 10, cachedInput: 0.125 },
7796
7803
  "gpt-4.1": { input: 2, output: 8, cachedInput: 0.5 },
7797
7804
  "gpt-4o": { input: 2.5, output: 10, cachedInput: 1.25 },
@@ -7831,7 +7838,7 @@ function liveArchivedCosts(lokiRoot, ids, unmeteredMarker) {
7831
7838
  var ESTIMATED_PROVIDERS;
7832
7839
  var init_provider_cost = __esm(() => {
7833
7840
  init_price_table();
7834
- ESTIMATED_PROVIDERS = new Set(["codex", "cline", "aider"]);
7841
+ ESTIMATED_PROVIDERS = new Set(["codex", "cline", "aider", "opencode"]);
7835
7842
  });
7836
7843
 
7837
7844
  // ../../loki-ts/src/providers/model_routes.ts
@@ -8088,7 +8095,127 @@ function atomicWriteText(target, body, opts = {}) {
8088
8095
  }
8089
8096
  durableWriteThenRename(target, body);
8090
8097
  }
8091
- var _tmpCounter = 0, _appendChains;
8098
+ function lockFilePath(target) {
8099
+ return `${target}.lock`;
8100
+ }
8101
+ function isProcessAlive(pid) {
8102
+ if (!Number.isFinite(pid) || pid <= 0)
8103
+ return false;
8104
+ try {
8105
+ process.kill(pid, 0);
8106
+ return true;
8107
+ } catch (err) {
8108
+ const code = err?.code;
8109
+ return code === "EPERM";
8110
+ }
8111
+ }
8112
+ function tryAcquire(lockFile) {
8113
+ let fd = null;
8114
+ try {
8115
+ mkdirSync8(dirname8(lockFile), { recursive: true });
8116
+ fd = openSync5(lockFile, "wx");
8117
+ writeSync3(fd, `${process.pid}
8118
+ `);
8119
+ return fd;
8120
+ } catch (err) {
8121
+ if (fd !== null) {
8122
+ try {
8123
+ closeSync5(fd);
8124
+ } catch {}
8125
+ try {
8126
+ unlinkSync4(lockFile);
8127
+ } catch {}
8128
+ }
8129
+ if (err?.code === "EEXIST")
8130
+ return null;
8131
+ throw err;
8132
+ }
8133
+ }
8134
+ function reapStaleLock(lockFile, staleMs) {
8135
+ let lst;
8136
+ try {
8137
+ lst = lstatSync5(lockFile);
8138
+ } catch {
8139
+ return true;
8140
+ }
8141
+ if (lst.isSymbolicLink()) {
8142
+ try {
8143
+ unlinkSync4(lockFile);
8144
+ return true;
8145
+ } catch {
8146
+ return false;
8147
+ }
8148
+ }
8149
+ let fd;
8150
+ try {
8151
+ fd = openSync5(lockFile, "r");
8152
+ } catch {
8153
+ return true;
8154
+ }
8155
+ try {
8156
+ const fst = fstatSync4(fd);
8157
+ const age = Date.now() - fst.mtimeMs;
8158
+ if (age < staleMs)
8159
+ return false;
8160
+ let pid = NaN;
8161
+ try {
8162
+ const buf = Buffer.alloc(64);
8163
+ const bytes = readSync4(fd, buf, 0, 64, 0);
8164
+ pid = Number.parseInt(buf.subarray(0, bytes).toString("utf-8").trim(), 10);
8165
+ } catch {}
8166
+ if (Number.isFinite(pid) && isProcessAlive(pid))
8167
+ return false;
8168
+ try {
8169
+ const pathStat = statSync13(lockFile);
8170
+ if (pathStat.mtimeMs > fst.mtimeMs)
8171
+ return false;
8172
+ } catch {
8173
+ return true;
8174
+ }
8175
+ try {
8176
+ rmSync5(lockFile, { force: true });
8177
+ } catch {}
8178
+ return true;
8179
+ } finally {
8180
+ try {
8181
+ closeSync5(fd);
8182
+ } catch {}
8183
+ }
8184
+ }
8185
+ function withFileLockSync(target, fn, opts = {}) {
8186
+ const timeoutMs = opts.timeoutMs ?? 1e4;
8187
+ const pollMs = opts.pollMs ?? 25;
8188
+ const staleMs = opts.staleMs ?? 30000;
8189
+ const lockFile = lockFilePath(target);
8190
+ const deadline = Date.now() + timeoutMs;
8191
+ let fd = null;
8192
+ let attempt = 0;
8193
+ const sab = new Int32Array(new SharedArrayBuffer(4));
8194
+ while (fd === null) {
8195
+ fd = tryAcquire(lockFile);
8196
+ if (fd !== null)
8197
+ break;
8198
+ if (Date.now() > deadline) {
8199
+ throw new Error(`withFileLockSync: timed out after ${timeoutMs}ms acquiring ${lockFile}`);
8200
+ }
8201
+ if (reapStaleLock(lockFile, staleMs))
8202
+ continue;
8203
+ const wait = Math.min(pollMs * 2 ** Math.min(attempt, 4), BACKOFF_CAP_MS);
8204
+ attempt += 1;
8205
+ Atomics.wait(sab, 0, 0, wait);
8206
+ }
8207
+ try {
8208
+ return fn();
8209
+ } finally {
8210
+ try {
8211
+ closeSync5(fd);
8212
+ } catch {}
8213
+ try {
8214
+ rmSync5(lockFile, { force: true });
8215
+ } catch {}
8216
+ }
8217
+ }
8218
+ var _tmpCounter = 0, _appendChains, BACKOFF_CAP_MS = 50;
8092
8219
  var init_atomic = __esm(() => {
8093
8220
  _appendChains = new Map;
8094
8221
  });
@@ -8444,17 +8571,19 @@ function readRunHistory(key, cacheRoot) {
8444
8571
  }
8445
8572
  function appendRunOutcome(key, outcome, cacheRoot) {
8446
8573
  try {
8447
- const runs2 = [...readRunHistory(key, cacheRoot), outcome].slice(-HISTORY_CAP);
8448
8574
  mkdirSync10(repoCacheDir(key, cacheRoot), { recursive: true });
8449
8575
  const target = historyPath(key, cacheRoot);
8450
- const tmp = `${target}.${process.pid}.tmp`;
8451
- try {
8452
- writeFileSync13(tmp, JSON.stringify({ runs: runs2 }));
8453
- renameSync6(tmp, target);
8454
- } catch (e) {
8455
- rmSync6(tmp, { force: true, recursive: false });
8456
- throw e;
8457
- }
8576
+ withFileLockSync(target, () => {
8577
+ const runs2 = [...readRunHistory(key, cacheRoot), outcome].slice(-HISTORY_CAP);
8578
+ const tmp = `${target}.${process.pid}.tmp`;
8579
+ try {
8580
+ writeFileSync13(tmp, JSON.stringify({ runs: runs2 }));
8581
+ renameSync6(tmp, target);
8582
+ } catch (e) {
8583
+ rmSync6(tmp, { force: true, recursive: false });
8584
+ throw e;
8585
+ }
8586
+ });
8458
8587
  return true;
8459
8588
  } catch {
8460
8589
  return false;
@@ -8463,6 +8592,7 @@ function appendRunOutcome(key, outcome, cacheRoot) {
8463
8592
  var HISTORY_FILE = "router_history.json", HISTORY_CAP = 200, WALL_KIND = "total-v1", EXECUTORS, VERDICTS, OWNERS;
8464
8593
  var init_history_store = __esm(() => {
8465
8594
  init_cache();
8595
+ init_atomic();
8466
8596
  EXECUTORS = ["haiku", "sonnet"];
8467
8597
  VERDICTS = ["pass", "fail", "error", "not_proven"];
8468
8598
  OWNERS = ["code", "harness", "env", "provider"];
@@ -8922,7 +9052,7 @@ var init_test_file_text = __esm(() => {
8922
9052
 
8923
9053
  // ../../loki-ts/src/engine10/testmap.ts
8924
9054
  import { existsSync as existsSync22, lstatSync as lstatSync8, readdirSync as readdirSync13, readFileSync as readFileSync27, realpathSync as realpathSync15 } from "fs";
8925
- import { basename as basename11, extname, isAbsolute as isAbsolute2, join as join36, relative, sep as sep10 } from "path";
9055
+ import { basename as basename11, dirname as dirname12, extname, isAbsolute as isAbsolute2, join as join36, relative, sep as sep10 } from "path";
8926
9056
  function projectInterpreter(root) {
8927
9057
  const ve = process.env["VIRTUAL_ENV"], inRepo = (p) => {
8928
9058
  try {
@@ -8958,6 +9088,7 @@ var init_testmap = __esm(() => {
8958
9088
  });
8959
9089
 
8960
9090
  // ../../loki-ts/src/util/check_result.ts
9091
+ import { spawn as spawn7 } from "child_process";
8961
9092
  import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync28, realpathSync as realpathSync16, renameSync as renameSync7, writeFileSync as writeFileSync15 } from "fs";
8962
9093
  import { basename as basename12, isAbsolute as isAbsolute3, join as join37 } from "path";
8963
9094
  function plainTestEnv(base = process.env) {
@@ -9466,6 +9597,54 @@ function classify(f, status, output, repoDir, interpreter) {
9466
9597
  return parsedFailCount(f.runner, output) > 0 ? "fail" : "not_run";
9467
9598
  return f.runner === "node" && nodeIsRed(f, output) ? "fail" : "not_run";
9468
9599
  }
9600
+ function baseJobs() {
9601
+ const n2 = Number(process.env.LOKI_E10_BASE_JOBS);
9602
+ return Number.isInteger(n2) && n2 >= 1 ? Math.min(n2, 16) : 1;
9603
+ }
9604
+ async function mapPool(items, jobs, fn) {
9605
+ const out2 = new Array(items.length);
9606
+ let next = 0;
9607
+ await Promise.all(Array.from({ length: Math.min(Math.max(1, jobs), items.length) }, async () => {
9608
+ while (next < items.length) {
9609
+ const i = next++;
9610
+ out2[i] = await fn(items[i]);
9611
+ }
9612
+ }));
9613
+ return out2;
9614
+ }
9615
+ function spawnCollect(cmd, args, o) {
9616
+ return new Promise((resolve13) => {
9617
+ let out2 = "", err = "", error = false, done = false;
9618
+ const MAX = 1024 * 1024;
9619
+ const fin = (status) => {
9620
+ if (!done) {
9621
+ done = true;
9622
+ resolve13({ status: error ? null : status, output: `${out2}
9623
+ ${err}` });
9624
+ }
9625
+ };
9626
+ const c = spawn7(cmd, args, { cwd: o.cwd, env: o.env, timeout: o.timeoutMs, stdio: ["ignore", "pipe", "pipe"] });
9627
+ const over = () => {
9628
+ if (out2.length > MAX || err.length > MAX) {
9629
+ error = true;
9630
+ c.kill("SIGTERM");
9631
+ }
9632
+ };
9633
+ c.stdout?.on("data", (d) => {
9634
+ out2 += d;
9635
+ over();
9636
+ });
9637
+ c.stderr?.on("data", (d) => {
9638
+ err += d;
9639
+ over();
9640
+ });
9641
+ c.on("error", () => {
9642
+ error = true;
9643
+ fin(null);
9644
+ });
9645
+ c.on("close", (code, sig) => fin(sig ? null : code));
9646
+ });
9647
+ }
9469
9648
  var NO_TESTS_REASON = "no tests executed", GO_EXIT0_REASON = "test count could not be confirmed: go test output is produced by the code under test and cannot confirm execution (a Go exit 0 is never a pass)", UNCONFIRMED_REASON = "test count could not be confirmed", FAIL_EVIDENCE, GO_FAIL_EVIDENCE, UNMEASURED_REASON = "executed count unmeasured (Loki could not parse the runner summary, harness-owned)", stripAnsi = (s) => s.replace(/\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)/g, "").replace(/(?:\u001b\[|\u009b)[0-9;?]*[ -\/]*[@-~]/g, "").replace(/\r\n?/g, `
9470
9649
  `), tailLines = (out2) => out2.split(`
9471
9650
  `).filter((x) => x.trim()).slice(-12), GO_PKG_RE, isExecutedProof = (c) => c.result === "pass" && typeof c.n === "number" && c.n > 0, hasExecutedProof = (checks) => checks.some(isExecutedProof), LLM_JUDGES, NON_RUNNER, normPath = (p) => p.replace(/^(?:\.\/)+/, ""), hasExogenousProof = (checks, ctx) => checks.some((c) => isExecutedProof(c) && ((p) => p !== "agent_authored" && p !== "llm_judge")(checkProvenance(c.name ?? "", ctx))), SENSITIVE, API, TEST_CFG, RANK2, FILES_MEDIUM = 4, FILES_HIGH = 15, LINES_MEDIUM = 100, LINES_HIGH = 500, RAN_ALWAYS, PLAN, LOW_SKIPPED, deferredOf = (tier, selected, executed) => (tier === "low" ? LOW_SKIPPED : selected).filter((c) => !RAN_ALWAYS.includes(c) && !executed.includes(c)), MANIFEST_LOCKS, dirOf = (p) => p.includes("/") ? p.slice(0, p.lastIndexOf("/")) : "", PKG_DEP_KEYS, PYPROJECT_NONDEP, EXCERPT_GROUP_CAP = 1500, EXCERPT_TOTAL_CAP = 6144;
@@ -9512,7 +9691,7 @@ import { createHash as createHash8, randomBytes as randomBytes3, createPrivateKe
9512
9691
  import { chmodSync as chmodSync4, linkSync, mkdirSync as mkdirSync13, readdirSync as readdirSync14, readFileSync as readFileSync29, renameSync as renameSync8, statSync as statSync15, unlinkSync as unlinkSync5, writeFileSync as writeFileSync16 } from "fs";
9513
9692
  import { homedir as homedir8 } from "os";
9514
9693
  import { spawnSync as spawnSync2 } from "child_process";
9515
- import { dirname as dirname12, join as join38 } from "path";
9694
+ import { dirname as dirname13, join as join38 } from "path";
9516
9695
  function canonicalJson(x) {
9517
9696
  const walk = (v) => {
9518
9697
  if (Array.isArray(v))
@@ -9537,7 +9716,7 @@ function loadSigningKey(generate = true) {
9537
9716
  try {
9538
9717
  pem = readFileSync29(file);
9539
9718
  if (!given) {
9540
- for (const [f, m] of [[file, 384], [dirname12(file), 448]])
9719
+ for (const [f, m] of [[file, 384], [dirname13(file), 448]])
9541
9720
  if (statSync15(f).mode & 63)
9542
9721
  chmodSync4(f, m);
9543
9722
  }
@@ -9546,8 +9725,8 @@ function loadSigningKey(generate = true) {
9546
9725
  lastProblem = `signing key file unreadable (${e.code ?? "error"})`;
9547
9726
  if (e.code !== "ENOENT" || !generate)
9548
9727
  return null;
9549
- mkdirSync13(dirname12(dirname12(file)), { recursive: true, mode: 448 });
9550
- mkdirSync13(dirname12(file), { recursive: true, mode: 448 });
9728
+ mkdirSync13(dirname13(dirname13(file)), { recursive: true, mode: 448 });
9729
+ mkdirSync13(dirname13(file), { recursive: true, mode: 448 });
9551
9730
  const tmp = `${file}.${randomBytes3(6).toString("hex")}.tmp`;
9552
9731
  writeFileSync16(tmp, generateKeyPairSync("ed25519").privateKey.export({ type: "pkcs8", format: "pem" }), { flag: "wx", mode: 384 });
9553
9732
  try {
@@ -10999,10 +11178,11 @@ var init_run_outputs = __esm(() => {
10999
11178
  });
11000
11179
 
11001
11180
  // ../../loki-ts/src/util/run_control.ts
11002
- var ACTIONS2, PARENT_PID;
11181
+ var ACTIONS2, PARENT_PID, pauseTimeoutWarned;
11003
11182
  var init_run_control = __esm(() => {
11004
11183
  ACTIONS2 = new Set(["pause", "resume", "cancel"]);
11005
11184
  PARENT_PID = process.ppid;
11185
+ pauseTimeoutWarned = new Set;
11006
11186
  });
11007
11187
 
11008
11188
  // ../../loki-ts/src/cli/registry.ts
@@ -11434,7 +11614,7 @@ var init_run_cap = __esm(() => {
11434
11614
  // ../../loki-ts/src/util/mutation_proof.ts
11435
11615
  import { existsSync as existsSync27, mkdirSync as mkdirSync17, mkdtempSync as mkdtempSync3, readFileSync as readFileSync34, rmSync as rmSync10, symlinkSync, writeFileSync as writeFileSync20 } from "fs";
11436
11616
  import { tmpdir as tmpdir4 } from "os";
11437
- import { basename as basename15, dirname as dirname13, isAbsolute as isAbsolute6, join as join43, relative as relative3 } from "path";
11617
+ import { basename as basename15, dirname as dirname14, isAbsolute as isAbsolute6, join as join43, relative as relative3 } from "path";
11438
11618
  function mutationProof(i) {
11439
11619
  const rels = i.wallFiles.map((f) => isAbsolute6(f.path) ? relative3(i.repoDir, f.path) : f.path);
11440
11620
  if (rels.length === 0)
@@ -11462,7 +11642,7 @@ function mutationProof(i) {
11462
11642
  const sealed = join43(i.runDir, "wall", basename15(rel)), src = existsSync27(sealed) ? sealed : join43(i.repoDir, rel);
11463
11643
  if (!existsSync27(src))
11464
11644
  return np(`Wall file missing: ${rel}`);
11465
- mkdirSync17(dirname13(join43(wt, rel)), { recursive: true });
11645
+ mkdirSync17(dirname14(join43(wt, rel)), { recursive: true });
11466
11646
  writeFileSync20(join43(wt, rel), readFileSync34(src));
11467
11647
  }
11468
11648
  for (const rel of rels) {
@@ -11975,7 +12155,7 @@ var init_wall_manifest = __esm(() => {
11975
12155
 
11976
12156
  // ../../loki-ts/src/features/wall_manifest_wire.ts
11977
12157
  import { createHash as createHash12 } from "crypto";
11978
- import { basename as basename16, dirname as dirname14 } from "path";
12158
+ import { basename as basename16, dirname as dirname15 } from "path";
11979
12159
  function blobEntries(ls) {
11980
12160
  const out2 = [];
11981
12161
  for (const raw2 of ls.toString("latin1").split("\x00")) {
@@ -12005,7 +12185,7 @@ function wallManifestFor(repoDir, tree, task, env = process.env) {
12005
12185
  return null;
12006
12186
  const low = task.toLowerCase().replace(/\\/g, "/");
12007
12187
  const token = (n2) => new RegExp(`(?<![A-Za-z0-9_])${n2.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![A-Za-z0-9_])`).test(low);
12008
- const dirModule = (e) => /^(index|__init__|mod|main)\.[^.]+$/.test(basename16(e.path)) && e.path.includes("/") && token(dirname14(e.path));
12188
+ const dirModule = (e) => /^(index|__init__|mod|main)\.[^.]+$/.test(basename16(e.path)) && e.path.includes("/") && token(dirname15(e.path));
12009
12189
  const matched = all.filter((e) => SOURCE.test(e.path) && (token(basename16(e.path)) || token(e.path) || token(basename16(e.path).replace(/\.[^.]*$/, "")) || dirModule(e)));
12010
12190
  const spans = (p) => [...low.matchAll(new RegExp(`(?<![A-Za-z0-9_])${p.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![A-Za-z0-9_])`, "g"))].map((m) => [m.index, m.index + m[0].length]);
12011
12191
  const occ = new Map(matched.map((e) => [e, spans(e.path)]));
@@ -12144,7 +12324,7 @@ var init_holdout = () => {};
12144
12324
 
12145
12325
  // ../../loki-ts/src/features/runner_config.ts
12146
12326
  import { readFileSync as readFileSync37 } from "fs";
12147
- import { dirname as dirname15, join as join45, normalize as normalize2 } from "path";
12327
+ import { dirname as dirname16, join as join45, normalize as normalize2 } from "path";
12148
12328
  function tomlKey2(s, i = 0, eq2 = true) {
12149
12329
  const parts = [], ws = () => {
12150
12330
  while (/\s/.test(s[i] ?? "x"))
@@ -12419,7 +12599,7 @@ function referenced(cfg, text2) {
12419
12599
  if (v && !/[$*]/.test(v))
12420
12600
  raw2.push(v);
12421
12601
  }
12422
- const dir = dirname15(cfg), explicit = ROOT_DIR.exec(text2), roots = [dir];
12602
+ const dir = dirname16(cfg), explicit = ROOT_DIR.exec(text2), roots = [dir];
12423
12603
  if (explicit)
12424
12604
  roots.push("", ...explicit[1] ? [join45(dir, explicit[1])] : []);
12425
12605
  return [...raw2.flatMap((r) => r.startsWith("/") ? [normalize2(r.slice(1))] : roots.map((root) => normalize2(join45(root, r.replace(/^<rootDir>\/?/, ""))))), ...patchedTargets(cfg, text2).map((t) => normalize2(join45(dir, t)))];
@@ -12470,7 +12650,7 @@ function runnerConfigNotes(repoDir, baseSha, head, changed, signal) {
12470
12650
  bad = true;
12471
12651
  }
12472
12652
  if (bad) {
12473
- const dir = dirname15(cfg), loaded = [...ch].find((c) => c !== cfg && (dir === "." || c.startsWith(dir + "/")) && !NON_SOURCE.test(c));
12653
+ const dir = dirname16(cfg), loaded = [...ch].find((c) => c !== cfg && (dir === "." || c.startsWith(dir + "/")) && !NON_SOURCE.test(c));
12474
12654
  if (ch.has(cfg) || loaded)
12475
12655
  notes.add(`runner config unparseable, trust capped: ${cfg}${loaded ? ` (${loaded} changed and may be loaded by it)` : ""}`);
12476
12656
  }
@@ -13113,8 +13293,9 @@ app_runner_stop >/dev/null 2>&1
13113
13293
 
13114
13294
  // ../../loki-ts/src/util/secure_scan.ts
13115
13295
  import { existsSync as existsSync31, mkdirSync as mkdirSync20, mkdtempSync as mkdtempSync7, readFileSync as readFileSync40, realpathSync as realpathSync20, rmSync as rmSync15, statSync as statSync19, writeFileSync as writeFileSync23 } from "fs";
13296
+ import { randomBytes as randomBytes5 } from "crypto";
13116
13297
  import { tmpdir as tmpdir9 } from "os";
13117
- import { dirname as dirname16, join as join50, resolve as resolve15, sep as sep11 } from "path";
13298
+ import { basename as basename20, dirname as dirname17, join as join50, resolve as resolve15, sep as sep11 } from "path";
13118
13299
  function fail(error) {
13119
13300
  return { ok: false, findings: [], error };
13120
13301
  }
@@ -13286,11 +13467,23 @@ async function scanAddedLines(repoDir, opts = {}) {
13286
13467
  const untracked = git3(repoDir, ["ls-files", "--others", "--exclude-standard", "-z"]);
13287
13468
  if (untracked === null)
13288
13469
  return fail("secure-scan: git ls-files failed");
13470
+ const skipped2 = [];
13289
13471
  for (const p of untracked.split("\x00").filter(Boolean)) {
13290
13472
  try {
13291
13473
  const st = statSync19(join50(repoDir, p));
13292
- if (!st.isFile() || st.size > MAX_ADDED_FILE_BYTES)
13474
+ if (!st.isFile())
13475
+ continue;
13476
+ if (st.size > MAX_ADDED_FILE_BYTES) {
13477
+ skipped2.push({
13478
+ rule: SKIPPED_FILE_RULE,
13479
+ file: p,
13480
+ line: 0,
13481
+ severity: "MEDIUM",
13482
+ message: `${p} is ${st.size} bytes, over the ${MAX_ADDED_FILE_BYTES} byte scan cap, so it was NOT scanned for provider keys.`,
13483
+ fix: "Review the file for secrets by hand, split it, or keep it out of the change."
13484
+ });
13293
13485
  continue;
13486
+ }
13294
13487
  const lines2 = new Map;
13295
13488
  readFileSync40(join50(repoDir, p), "utf8").split(`
13296
13489
  `).forEach((t, i) => lines2.set(i + 1, t));
@@ -13298,32 +13491,74 @@ async function scanAddedLines(repoDir, opts = {}) {
13298
13491
  } catch {}
13299
13492
  }
13300
13493
  if (added.size === 0)
13301
- return { ok: true, findings: [] };
13494
+ return { ok: true, findings: skipped2 };
13302
13495
  const mirror = mkdtempSync7(join50(tmpdir9(), "loki-secure-added-"));
13303
13496
  try {
13304
13497
  const root = resolve15(mirror) + sep11;
13498
+ const chunkMap = new Map;
13499
+ const chunkRoot = `.loki-chunks-${randomBytes5(6).toString("hex")}`;
13500
+ let chunkSeq = 0;
13305
13501
  for (const [p, lines2] of added) {
13306
13502
  if (lines2.size === 0)
13307
13503
  continue;
13308
13504
  const dest = resolve15(mirror, p);
13309
13505
  if (!dest.startsWith(root))
13310
13506
  continue;
13311
- const max = Math.max(...lines2.keys());
13312
- const body = [];
13313
- for (let i = 1;i <= max; i++)
13314
- body.push(lines2.get(i) ?? "");
13315
- mkdirSync20(dirname16(dest), { recursive: true });
13316
- writeFileSync23(dest, body.join(`
13507
+ let max = 0;
13508
+ for (const k of lines2.keys())
13509
+ if (k > max)
13510
+ max = k;
13511
+ const chunks = [];
13512
+ let cur = { orig: [], body: [] };
13513
+ let bytes = 0;
13514
+ const push = (orig, t) => {
13515
+ const b = Buffer.byteLength(t, "utf8") + 1;
13516
+ if (cur.body.length > 0 && bytes + b > MIRROR_CHUNK_BYTES) {
13517
+ chunks.push(cur);
13518
+ cur = { orig: [], body: [] };
13519
+ bytes = 0;
13520
+ }
13521
+ cur.orig.push(orig);
13522
+ cur.body.push(t);
13523
+ bytes += b;
13524
+ };
13525
+ for (let ln = 1;ln <= max; ln++) {
13526
+ const t = lines2.get(ln) ?? "";
13527
+ if (t.length <= PIECE_CHARS) {
13528
+ push(ln, t);
13529
+ continue;
13530
+ }
13531
+ for (let i = 0;i < t.length; i += PIECE_CHARS - PIECE_OVERLAP) {
13532
+ push(ln, t.slice(i, i + PIECE_CHARS));
13533
+ if (i + PIECE_CHARS >= t.length)
13534
+ break;
13535
+ }
13536
+ }
13537
+ if (cur.body.length > 0)
13538
+ chunks.push(cur);
13539
+ const whole = chunks.length === 1;
13540
+ for (const c of chunks) {
13541
+ const rel = whole ? p : join50(chunkRoot, String(chunkSeq++), basename20(p));
13542
+ const out2 = whole ? dest : resolve15(mirror, rel);
13543
+ if (!out2.startsWith(root))
13544
+ break;
13545
+ chunkMap.set(rel, { file: p, lines: c.orig });
13546
+ mkdirSync20(dirname17(out2), { recursive: true });
13547
+ writeFileSync23(out2, c.body.join(`
13317
13548
  `) + `
13318
13549
  `);
13550
+ }
13319
13551
  }
13320
13552
  const r = await runSecureScan(mirror, { scriptPath: opts.scriptPath, timeoutMs: opts.timeoutMs, secretsEverywhere: true });
13321
13553
  if (!r.ok)
13322
13554
  return r;
13323
13555
  const byLine = new Map;
13324
- for (const f of r.findings) {
13556
+ for (let f of r.findings) {
13325
13557
  if (f.rule !== "secret-in-client-file")
13326
13558
  continue;
13559
+ const c = chunkMap.get(f.file.split(sep11).join("/"));
13560
+ if (c)
13561
+ f = { ...f, file: c.file, line: c.lines[f.line - 1] ?? f.line };
13327
13562
  const kind = /A live (\S+)/.exec(f.message)?.[1] ?? "provider key";
13328
13563
  const k = `${f.file}|${f.line}`;
13329
13564
  const prev = byLine.get(k);
@@ -13340,17 +13575,18 @@ async function scanAddedLines(repoDir, opts = {}) {
13340
13575
  fix: "Remove the key from the change, rotate it (assume it is compromised), and read it at runtime from an environment variable or secret manager."
13341
13576
  };
13342
13577
  });
13343
- return { ok: true, findings };
13578
+ return { ok: true, findings: [...findings, ...skipped2] };
13344
13579
  } finally {
13345
13580
  rmSync15(mirror, { recursive: true, force: true });
13346
13581
  }
13347
13582
  }
13348
- var ADDED_LINE_RULE = "provider-key-in-added-line", MAX_ADDED_FILE_BYTES = 1e6, DEFAULT_SECURE_SCAN_TIMEOUT_MS = 120000;
13583
+ var ADDED_LINE_RULE = "provider-key-in-added-line", MAX_ADDED_FILE_BYTES, MIRROR_CHUNK_BYTES = 1e6, PIECE_CHARS = 250000, PIECE_OVERLAP = 512, SKIPPED_FILE_RULE = "untracked-file-not-scanned", DEFAULT_SECURE_SCAN_TIMEOUT_MS = 120000;
13349
13584
  var init_secure_scan = __esm(() => {
13350
13585
  init_paths();
13351
13586
  init_python();
13352
13587
  init_safe_git();
13353
13588
  init_shell();
13589
+ MAX_ADDED_FILE_BYTES = 64 * 1024 * 1024;
13354
13590
  });
13355
13591
 
13356
13592
  // ../../loki-ts/src/runner/retry_class.ts
@@ -13450,11 +13686,11 @@ var init_route_block = __esm(() => {
13450
13686
  });
13451
13687
 
13452
13688
  // ../../loki-ts/src/features/visual_evidence.ts
13453
- import { spawn as spawn7 } from "child_process";
13454
- import { createHash as createHash14, randomBytes as randomBytes5 } from "crypto";
13689
+ import { spawn as spawn8 } from "child_process";
13690
+ import { createHash as createHash14, randomBytes as randomBytes6 } from "crypto";
13455
13691
  import { existsSync as existsSync32, lstatSync as lstatSync12, mkdirSync as mkdirSync21, readdirSync as readdirSync18, readFileSync as readFileSync41, writeFileSync as writeFileSync24 } from "fs";
13456
13692
  import { createServer } from "net";
13457
- import { dirname as dirname17, isAbsolute as isAbsolute8, join as join51, normalize as normalize3, relative as relative6, sep as sep12 } from "path";
13693
+ import { dirname as dirname18, isAbsolute as isAbsolute8, join as join51, normalize as normalize3, relative as relative6, sep as sep12 } from "path";
13458
13694
  function routeFor(file) {
13459
13695
  let r = file.replace(/^(?:.*?\/)?(?:app|pages|src|public)\//, "").replace(/^(?:routes|pages)\//, "");
13460
13696
  r = r.replace(/\.(?:html|jsx|tsx|vue|svelte)$/, "").replace(/\/?(?:page|index|\+page)$/, "");
@@ -13572,7 +13808,7 @@ function shoot(pw, args, cwd, ms, signal) {
13572
13808
  return new Promise((res) => {
13573
13809
  if (ms <= 0 || signal?.aborted)
13574
13810
  return res(false);
13575
- const c = spawn7(pw, args, { cwd, env: { ...process.env }, stdio: "ignore" });
13811
+ const c = spawn8(pw, args, { cwd, env: { ...process.env }, stdio: "ignore" });
13576
13812
  const done = (ok) => {
13577
13813
  clearTimeout(t);
13578
13814
  signal?.removeEventListener("abort", onAbort);
@@ -13672,7 +13908,7 @@ async function captureVisualEvidence(repoDir, runDir, changed, opts = {}) {
13672
13908
  const aborted = () => signal?.aborted === true;
13673
13909
  const port2 = await freePort(), base = `http://127.0.0.1:${port2}`;
13674
13910
  const [bc, ba] = boot ? ["bash", ["-c", boot.boot.cmd]] : ["npm", ["run", script, "--silent"]];
13675
- child = spawn7(bc, [...ba], { cwd: appDir, detached: true, env: { ...opts.env ?? process.env, PORT: String(port2), HOST: "127.0.0.1", BROWSER: "none" }, stdio: "ignore" });
13911
+ child = spawn8(bc, [...ba], { cwd: appDir, detached: true, env: { ...opts.env ?? process.env, PORT: String(port2), HOST: "127.0.0.1", BROWSER: "none" }, stdio: "ignore" });
13676
13912
  child.on("error", () => {
13677
13913
  return;
13678
13914
  });
@@ -13688,7 +13924,7 @@ async function captureVisualEvidence(repoDir, runDir, changed, opts = {}) {
13688
13924
  return skip("evidence dir is a symlink");
13689
13925
  mkdirSync21(evRoot, { recursive: true });
13690
13926
  if (pages.length > 0) {
13691
- const rel0 = join51("evidence", randomBytes5(6).toString("hex"));
13927
+ const rel0 = join51("evidence", randomBytes6(6).toString("hex"));
13692
13928
  mkdirSync21(join51(runDir, rel0));
13693
13929
  const rels = [];
13694
13930
  for (const route of [...new Set(pages.map(routeFor))].slice(0, opts.maxRoutes ?? MAX_ROUTES)) {
@@ -13721,7 +13957,7 @@ async function captureVisualEvidence(repoDir, runDir, changed, opts = {}) {
13721
13957
  }
13722
13958
  if (aborted())
13723
13959
  return skip("aborted");
13724
- const hdir = join51(evRoot, randomBytes5(6).toString("hex"));
13960
+ const hdir = join51(evRoot, randomBytes6(6).toString("hex"));
13725
13961
  mkdirSync21(hdir);
13726
13962
  writeFileSync24(join51(hdir, "http.json"), JSON.stringify(rows, null, 2) + `
13727
13963
  `);
@@ -13750,7 +13986,7 @@ async function sealEvidence(repoDir, runDir, o, notProven, signal, emit) {
13750
13986
  function receiptScreensProblem(receiptPath, receipt) {
13751
13987
  if (visualGateEnabled() && typeof receipt["evidence_failed"] === "string")
13752
13988
  return `visual evidence failed (LOKI_VISUAL_GATE=1): ${receipt["evidence_failed"]}`;
13753
- return receipt["evidence_screens"] === undefined ? null : checkScreens(dirname17(receiptPath), receipt["evidence_screens"]);
13989
+ return receipt["evidence_screens"] === undefined ? null : checkScreens(dirname18(receiptPath), receipt["evidence_screens"]);
13754
13990
  }
13755
13991
  var visualEvidenceEnabled = (env = process.env) => env["LOKI_VISUAL_EVIDENCE"] !== "0", visualGateEnabled = (env = process.env) => env["LOKI_VISUAL_GATE"] === "1", PAGE_RE, isPageFile = (p) => PAGE_RE.test(p), screenName = (route) => (route === "/" ? "index" : route.slice(1).replace(/[^A-Za-z0-9._-]+/g, "_")) || "index", sha256File = (p) => createHash14("sha256").update(readFileSync41(p)).digest("hex"), playwrightBin = (repoDir) => {
13756
13992
  const bin = join51(repoDir, "node_modules", ".bin", "playwright");
@@ -13824,7 +14060,7 @@ var init_pr = __esm(() => {
13824
14060
 
13825
14061
  // ../../loki-ts/src/util/pr_lessons.ts
13826
14062
  import { existsSync as existsSync33, mkdirSync as mkdirSync22, mkdtempSync as mkdtempSync8, readFileSync as readFileSync42, rmSync as rmSync16, writeFileSync as writeFileSync25 } from "fs";
13827
- import { dirname as dirname18, join as join53 } from "path";
14063
+ import { dirname as dirname19, join as join53 } from "path";
13828
14064
  import { createHash as createHash15 } from "crypto";
13829
14065
  function loadLessons(repoDir) {
13830
14066
  const p = lessonsPath(repoDir);
@@ -13839,7 +14075,7 @@ function loadLessons(repoDir) {
13839
14075
  }
13840
14076
  function save(repoDir, lessons) {
13841
14077
  const p = lessonsPath(repoDir);
13842
- mkdirSync22(dirname18(p), { recursive: true });
14078
+ mkdirSync22(dirname19(p), { recursive: true });
13843
14079
  atomicWriteJson(p, { version: 2, lessons });
13844
14080
  }
13845
14081
  function appendReceiptFact(repoDir, f, now2 = () => new Date) {
@@ -13900,7 +14136,7 @@ var init_mcp_config = () => {};
13900
14136
 
13901
14137
  // ../../loki-ts/src/providers/claude_flags.ts
13902
14138
  import { existsSync as existsSync34, readFileSync as readFileSync43 } from "fs";
13903
- import { resolve as resolvePath, dirname as dirname19 } from "path";
14139
+ import { resolve as resolvePath, dirname as dirname20 } from "path";
13904
14140
  import { fileURLToPath as fileURLToPath4 } from "url";
13905
14141
  function claudeFlagSupported(flag, helpText) {
13906
14142
  const txt = helpText ?? _claudeHelpCache;
@@ -13947,7 +14183,7 @@ function leanReviewerFlags(opts = {}) {
13947
14183
  }
13948
14184
  function designArchetypesText() {
13949
14185
  try {
13950
- const moduleDir = dirname19(fileURLToPath4(import.meta.url));
14186
+ const moduleDir = dirname20(fileURLToPath4(import.meta.url));
13951
14187
  for (const rel of [
13952
14188
  ["..", "..", "..", "references", "design-archetypes.md"],
13953
14189
  ["..", "..", "references", "design-archetypes.md"]
@@ -14003,10 +14239,11 @@ var init_sdk_stream_parser = __esm(() => {
14003
14239
  var init_trim = () => {};
14004
14240
 
14005
14241
  // ../../loki-ts/src/util/update_check.ts
14006
- var CACHE_TTL_MS;
14242
+ var CACHE_TTL_MS, NEGATIVE_TTL_MS;
14007
14243
  var init_update_check = __esm(() => {
14008
14244
  init_paths();
14009
14245
  CACHE_TTL_MS = 24 * 60 * 60 * 1000;
14246
+ NEGATIVE_TTL_MS = 15 * 60 * 1000;
14010
14247
  });
14011
14248
 
14012
14249
  // ../../loki-ts/src/runner/router/advisor_probe.ts
@@ -14230,7 +14467,7 @@ __export(exports_deep, {
14230
14467
  });
14231
14468
  import { copyFileSync as copyFileSync3, existsSync as existsSync36, lstatSync as lstatSync14, mkdirSync as mkdirSync24, mkdtempSync as mkdtempSync9, rmSync as rmSync17, writeFileSync as writeFileSync27 } from "fs";
14232
14469
  import { tmpdir as tmpdir10 } from "os";
14233
- import { dirname as dirname20, join as join56 } from "path";
14470
+ import { dirname as dirname21, join as join56 } from "path";
14234
14471
  function sessionCouncil(sessions) {
14235
14472
  return { async run(input, signal) {
14236
14473
  const cwd = mkdtempSync9(join56(tmpdir10(), "loki-deep-council-"));
@@ -14351,7 +14588,7 @@ async function secureScanChanged(repoDir, changed, opts) {
14351
14588
  try {
14352
14589
  for (const f of changed)
14353
14590
  if (existsSync36(join56(repoDir, f)) && lstatSync14(join56(repoDir, f)).isFile()) {
14354
- mkdirSync24(dirname20(join56(dir, f)), { recursive: true });
14591
+ mkdirSync24(dirname21(join56(dir, f)), { recursive: true });
14355
14592
  copyFileSync3(join56(repoDir, f), join56(dir, f));
14356
14593
  }
14357
14594
  return await runSecureScan(dir, { ...opts.secureScanPath ? { scriptPath: opts.secureScanPath } : {}, timeoutMs: 60000 });
@@ -14514,7 +14751,7 @@ var init_deep = __esm(() => {
14514
14751
  // ../../loki-ts/src/engine10/stages/verify.ts
14515
14752
  import { existsSync as existsSync37, mkdtempSync as mkdtempSync10, realpathSync as realpathSync21, rmSync as rmSync18 } from "fs";
14516
14753
  import { tmpdir as tmpdir11 } from "os";
14517
- import { dirname as dirname21, isAbsolute as isAbsolute9, join as join57, relative as relative7 } from "path";
14754
+ import { dirname as dirname22, isAbsolute as isAbsolute9, join as join57, relative as relative7 } from "path";
14518
14755
  function resolveTool(repoDir, bin, fallback, lastResort = fallback) {
14519
14756
  const inRepo = (p) => {
14520
14757
  try {
@@ -14545,7 +14782,7 @@ function runnerCmd(t, repoDir) {
14545
14782
  case "npm":
14546
14783
  return ["npm", ["test", "--silent"]];
14547
14784
  case "go":
14548
- return ["go", ["test", "-json", `./${dirname21(t.path)}`]];
14785
+ return ["go", ["test", "-json", `./${dirname22(t.path)}`]];
14549
14786
  case "cargo":
14550
14787
  return ["cargo", ["test"]];
14551
14788
  }
@@ -14721,7 +14958,10 @@ var CHECK_TIMEOUT_MS = 60000, excerpts, isHold = (c) => isHoldoutCheck(c.name),
14721
14958
  } catch {
14722
14959
  return null;
14723
14960
  }
14724
- } }), verifyStage;
14961
+ } }), verifyJobs = () => {
14962
+ const n2 = Number.parseInt(process.env["LOKI_E10_VERIFY_JOBS"] ?? "", 10);
14963
+ return Number.isFinite(n2) && n2 >= 1 ? Math.min(n2, 8) : 1;
14964
+ }, verifyStage;
14725
14965
  var init_verify = __esm(() => {
14726
14966
  init_scope();
14727
14967
  init_runner_config();
@@ -14784,12 +15024,16 @@ var init_verify = __esm(() => {
14784
15024
  const scopedOut = scopedOutOf(map);
14785
15025
  if (scopedOut.length)
14786
15026
  ctx.emit("test.scoped_out", "verify", { tests: scopedOut });
14787
- for (const t of tests) {
14788
- if (signal.aborted)
14789
- break;
14790
- const tc = commandFor(t, ctx.repoDir, api);
14791
- await runCheck(ctx, testCheckName(t), tc.cmd, tc.args, signal, checks, { ...tc.interpreter ? { interpreter: tc.interpreter } : {}, protect: [...wallTests, ...relevant2].includes(t), ...tc.pkgRoot !== "." ? { cwd: tc.cwd } : {} });
14792
- }
15027
+ const slots = tests.map(() => []);
15028
+ let next = 0;
15029
+ const work = async () => {
15030
+ while (next < tests.length && !signal.aborted) {
15031
+ const i = next++, t = tests[i], tc = commandFor(t, ctx.repoDir, api);
15032
+ await runCheck(ctx, testCheckName(t), tc.cmd, tc.args, signal, slots[i], { ...tc.interpreter ? { interpreter: tc.interpreter } : {}, protect: [...wallTests, ...relevant2].includes(t), ...tc.pkgRoot !== "." ? { cwd: tc.cwd } : {} });
15033
+ }
15034
+ };
15035
+ await Promise.all(Array.from({ length: Math.min(verifyJobs(), tests.length) }, work));
15036
+ checks.push(...slots.flat());
14793
15037
  const hold = wall.holdout_dir ? stageHoldout(wall.holdout_dir, ctx.repoDir) : null;
14794
15038
  try {
14795
15039
  for (const [i, h] of (hold?.tests ?? []).entries()) {
@@ -14884,7 +15128,7 @@ ${x}` : c.cmd };
14884
15128
 
14885
15129
  // ../../loki-ts/src/project_model/conventions.ts
14886
15130
  import { existsSync as existsSync38, readdirSync as readdirSync19, readFileSync as readFileSync45 } from "fs";
14887
- import { dirname as dirname22, join as join58 } from "path";
15131
+ import { dirname as dirname23, join as join58 } from "path";
14888
15132
  function parseJsonc(text2) {
14889
15133
  let out2 = "", i = 0;
14890
15134
  while (i < text2.length) {
@@ -14919,7 +15163,7 @@ function moduleOf(file, depth = 0) {
14919
15163
  const ext = typeof j.extends === "string" ? j.extends : null;
14920
15164
  if (!ext || !ext.startsWith("."))
14921
15165
  return null;
14922
- const next = join58(dirname22(file), ext.endsWith(".json") ? ext : `${ext}.json`);
15166
+ const next = join58(dirname23(file), ext.endsWith(".json") ? ext : `${ext}.json`);
14923
15167
  return existsSync38(next) ? moduleOf(next, depth + 1) : null;
14924
15168
  }
14925
15169
  function readPackageConventions(pkgDir, runner = null) {
@@ -14971,7 +15215,7 @@ var init_conventions = () => {};
14971
15215
  import { spawnSync as spawnSync7 } from "child_process";
14972
15216
  import { existsSync as existsSync39, mkdirSync as mkdirSync25, mkdtempSync as mkdtempSync11, readFileSync as readFileSync46, readdirSync as readdirSync20, rmSync as rmSync19, writeFileSync as writeFileSync28 } from "fs";
14973
15217
  import { tmpdir as tmpdir12 } from "os";
14974
- import { dirname as dirname23, join as join59, relative as relative8 } from "path";
15218
+ import { dirname as dirname24, join as join59, relative as relative8 } from "path";
14975
15219
 
14976
15220
  class RealBaseTestRunner {
14977
15221
  api;
@@ -15004,6 +15248,13 @@ ${r.stderr ?? ""}`), repoDir, interpreter);
15004
15248
  this.lastNotRunFiles = not_run_files;
15005
15249
  return { pass, fail: fail2, not_run };
15006
15250
  }
15251
+ async runEach(repoDir, files, jobs) {
15252
+ const api = this.api === undefined ? loadProjectApi(repoDir) : this.api;
15253
+ return mapPool(files, jobs, async (f) => {
15254
+ const { cmd: cmd2, args, interpreter, cwd } = commandFor(f, repoDir, api), r = await spawnCollect(cmd2, f.runner === "pytest" ? [...args, "-rfE"] : args, { cwd, env: plainTestEnv(), timeoutMs: Math.max(1000, this.timeoutMs) }), result = classify(f, r.status, stripAnsi(r.output), repoDir, interpreter);
15255
+ return { pass: +(result === "pass"), fail: +(result === "fail"), not_run: +(result === "not_run"), notRunFiles: result === "not_run" ? [{ file: f.path, reason: notRunReason(r.status, interpreter) }] : [] };
15256
+ });
15257
+ }
15007
15258
  }
15008
15259
  function buildWallBrief(task, repomapText = "", runners = [], hasManifest = false, conventions = "", acceptance = []) {
15009
15260
  return withStagePrefix([
@@ -15042,7 +15293,7 @@ function loadTaskText(ctx, fromPrior) {
15042
15293
  }
15043
15294
  function wallTargetDir(repoDir, existingTests) {
15044
15295
  const first = existingTests[0];
15045
- return first ? join59(repoDir, dirname23(first.path)) : join59(repoDir, "tests");
15296
+ return first ? join59(repoDir, dirname24(first.path)) : join59(repoDir, "tests");
15046
15297
  }
15047
15298
  function guessRunner(fileName, runners) {
15048
15299
  if (fileName.endsWith(".py"))
@@ -15113,12 +15364,19 @@ async function wallAuthor(ctx, signal, retry) {
15113
15364
  return { kind: "authored", model, iterationId, task, sizeName: sz.size, runners, targetDir, generated, contents, discarded, ...wm ? { manifestSha256: wm.sha256 } : {}, ...held ? { holdoutDir: held.dir } : {} };
15114
15365
  }
15115
15366
  function installWall(ctx, a, baseDir, opts = {}) {
15367
+ const g = installCore(ctx, a, baseDir, opts);
15368
+ g.next();
15369
+ return g.next(null).value;
15370
+ }
15371
+ async function installWallAsync(ctx, a, baseDir, opts = {}) {
15372
+ const g = installCore(ctx, a, baseDir, opts), y = g.next().value, jobs = baseJobs();
15373
+ return g.next(jobs > 1 && y.runner.runEach && y.tests.length > 1 ? await y.runner.runEach(baseDir, y.tests, jobs) : null).value;
15374
+ }
15375
+ function* installCore(ctx, a, baseDir, opts) {
15116
15376
  const { generated, contents, discarded, targetDir, runners } = a;
15117
15377
  if (generated.length > 0)
15118
15378
  mkdirSync25(targetDir, { recursive: true });
15119
- const sealedFiles = [];
15120
- const readOnlyFiles = [];
15121
- const wallTests = [];
15379
+ const sealedFiles = [], readOnlyFiles = [], wallTests = [];
15122
15380
  for (const name of generated) {
15123
15381
  const content = contents.get(name);
15124
15382
  if (content === undefined)
@@ -15133,12 +15391,13 @@ function installWall(ctx, a, baseDir, opts = {}) {
15133
15391
  ctx.wallSealed = true;
15134
15392
  ctx.emit("wall.sealed", "wall", { files: sealedFiles, ...a.manifestSha256 ? { manifest_sha256: a.manifestSha256 } : {} });
15135
15393
  const baseRunner = opts.baseRunner ?? new RealBaseTestRunner, baseRun = { pass: 0, fail: 0, not_run: discarded.length }, notRunFiles = [];
15136
- for (const t of wallTests) {
15137
- const r = baseRunner.run(baseDir, [t]), abs = join59(ctx.repoDir, t.path);
15394
+ const each = yield { runner: baseRunner, tests: wallTests };
15395
+ for (const [i, t] of wallTests.entries()) {
15396
+ const e = each?.[i], r = e ?? baseRunner.run(baseDir, [t]), abs = join59(ctx.repoDir, t.path);
15138
15397
  baseRun.pass += r.pass;
15139
15398
  baseRun.fail += r.fail;
15140
15399
  baseRun.not_run += r.not_run ?? 0;
15141
- notRunFiles.push(...baseRunner.lastNotRunFiles ?? []);
15400
+ notRunFiles.push(...e ? e.notRunFiles : baseRunner.lastNotRunFiles ?? []);
15142
15401
  if (r.pass + r.fail === 0) {
15143
15402
  rmSync19(abs, { force: true });
15144
15403
  for (const l of [sealedFiles, readOnlyFiles])
@@ -15163,7 +15422,7 @@ function installWall(ctx, a, baseDir, opts = {}) {
15163
15422
  }
15164
15423
  async function runWall(ctx, signal, opts = {}) {
15165
15424
  const t0 = Date.now(), a = await wallAuthor(ctx, signal);
15166
- const first = a.kind === "done" ? a.result : installWall(ctx, a, ctx.repoDir, opts);
15425
+ const first = a.kind === "done" ? a.result : await installWallAsync(ctx, a, ctx.repoDir, opts);
15167
15426
  const cheap = a.kind === "authored" ? a.model : first.data.model ?? "", killed = a.kind === "done" && first.killed === true, usable = a.kind === "authored" && first.status === "completed";
15168
15427
  const unusable = usable && (first.data.files ?? []).length === 0, green = usable && !unusable && (first.data.already_satisfied === true || wallGreenOnBaseOf({ wall: first.data }));
15169
15428
  const budgetLeft = WALL_STAGE_LIMIT_S * 1000 - (Date.now() - t0) >= WALL_RUNG_S * 1000;
@@ -15179,7 +15438,7 @@ async function runWall(ctx, signal, opts = {}) {
15179
15438
  }
15180
15439
  removeHoldout(ctx.runId, ctx.repoDir);
15181
15440
  ctx.emit("wall.reauthor", "wall", { from_model: cheap, to_model: wallModel(), reason: killed ? "first author session killed or timed out" : green ? "first author green on the base tree" : "no usable test from the first author" });
15182
- const b = await wallAuthor(ctx, signal, { model: wallModel(), suffix: "-r2" }), second = b.kind === "done" ? b.result : installWall(ctx, b, ctx.repoDir, opts);
15441
+ const b = await wallAuthor(ctx, signal, { model: wallModel(), suffix: "-r2" }), second = b.kind === "done" ? b.result : await installWallAsync(ctx, b, ctx.repoDir, opts);
15183
15442
  const ids = [...first.data.iteration_ids ?? [], ...second.data.iteration_ids ?? []];
15184
15443
  return { ...second, data: { ...second.data, iteration_ids: ids, reauthored: true } };
15185
15444
  }
@@ -15211,9 +15470,9 @@ var init_wall = __esm(() => {
15211
15470
 
15212
15471
  // ../../loki-ts/src/e10ext/discard.ts
15213
15472
  import { chmodSync as chmodSync5, closeSync as closeSync9, lstatSync as lstatSync15, mkdirSync as mkdirSync26, openSync as openSync9, readFileSync as readFileSync47, realpathSync as realpathSync23, rmdirSync, unlinkSync as unlinkSync7, writeFileSync as writeFileSync29 } from "fs";
15214
- import { dirname as dirname24, join as join60, relative as relative9, sep as sep13 } from "path";
15473
+ import { dirname as dirname25, join as join60, relative as relative9, sep as sep13 } from "path";
15215
15474
  function safeRestore(repoDir, f, want, mode) {
15216
- const root = realpathSync23(repoDir), fp = join60(root, f), rel = relative9(root, dirname24(fp));
15475
+ const root = realpathSync23(repoDir), fp = join60(root, f), rel = relative9(root, dirname25(fp));
15217
15476
  if (rel.startsWith(".."))
15218
15477
  throw new Error("outside repo");
15219
15478
  let cur = root;
@@ -15325,9 +15584,9 @@ var init_preexisting_dirty = __esm(() => {
15325
15584
  });
15326
15585
 
15327
15586
  // ../../loki-ts/src/e10ext/commit_filter.ts
15328
- import { dirname as dirname25 } from "path";
15587
+ import { dirname as dirname26 } from "path";
15329
15588
  function dropSet(repoDir, staged, preexistingDirty, env = process.env) {
15330
- return staged.concat(untouchedSinceIntake(repoDir, preexistingDirty, env).map((f) => ({ st: "L", f }))).filter(({ st, f }) => f.startsWith(".loki/") || st === "L" || /(^|\/)loki_wall_[^/]*$/.test(f) || st === "A" && !staged.some(({ f: m }) => /(^|\/)(package\.json|pyproject\.toml|requirements\.txt|Cargo\.toml|go\.mod)$/.test(m) && dirname25(m) === dirname25(f)) && /(^|\/)(package-lock\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|poetry\.lock|Cargo\.lock|go\.sum)$/.test(f));
15589
+ return staged.concat(untouchedSinceIntake(repoDir, preexistingDirty, env).map((f) => ({ st: "L", f }))).filter(({ st, f }) => f.startsWith(".loki/") || st === "L" || /(^|\/)loki_wall_[^/]*$/.test(f) || st === "A" && !staged.some(({ f: m }) => /(^|\/)(package\.json|pyproject\.toml|requirements\.txt|Cargo\.toml|go\.mod)$/.test(m) && dirname26(m) === dirname26(f)) && /(^|\/)(package-lock\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|poetry\.lock|Cargo\.lock|go\.sum)$/.test(f));
15331
15590
  }
15332
15591
  var parseStaged = (out2) => out2.split("\x00").reduce((a, t, i, all) => i % 2 === 0 && t ? [...a, { st: t, f: all[i + 1] }] : a, []), formatChanged = (repoDir, staged, dropped2, env = process.env) => runFormatters(repoDir, staged.filter(({ st, f }) => (st === "A" || st === "M") && !dropped2.has(f) && !f.startsWith(".loki/")).map(({ f }) => f), tokenFreeEnv(env));
15333
15592
  var init_commit_filter = __esm(() => {
@@ -15337,7 +15596,7 @@ var init_commit_filter = __esm(() => {
15337
15596
  });
15338
15597
 
15339
15598
  // ../../loki-ts/src/e10ext/scope.ts
15340
- import { basename as basename21, dirname as dirname26 } from "path";
15599
+ import { basename as basename22, dirname as dirname27 } from "path";
15341
15600
  function contractText(o) {
15342
15601
  const c = o.intake?.contract_snapshot?.contract;
15343
15602
  return Array.isArray(c?.criteria) ? c.criteria.map((x) => typeof x?.text === "string" ? x.text : "").join(`
@@ -15351,8 +15610,8 @@ function outsideScope(o, staged) {
15351
15610
  const text2 = `${plan}
15352
15611
  ${typeof o.intake?.task === "string" ? o.intake.task : ""}
15353
15612
  ${contractText(o)}`, pre = o.intake?.preexisting_dirty ?? {};
15354
- const toks = surfaceTokens(text2), plannedDirs = new Set(rel.map((r) => dirname26(r)).filter((d) => d !== "."));
15355
- return staged.filter(({ st, f }) => st !== "A" && !isTestFile(f) && !Object.hasOwn(pre, f) && !rel.includes(f) && !mentions(text2, f) && !mentions(text2, basename21(f)) && !plannedDirs.has(dirname26(f)) && !dirSegs(f).some((d) => toks.has(d))).map(({ f }) => f);
15613
+ const toks = surfaceTokens(text2), plannedDirs = new Set(rel.map((r) => dirname27(r)).filter((d) => d !== "."));
15614
+ return staged.filter(({ st, f }) => st !== "A" && !isTestFile(f) && !Object.hasOwn(pre, f) && !rel.includes(f) && !mentions(text2, f) && !mentions(text2, basename22(f)) && !plannedDirs.has(dirname27(f)) && !dirSegs(f).some((d) => toks.has(d))).map(({ f }) => f);
15356
15615
  }
15357
15616
  function flagOutsideScope(o, staged) {
15358
15617
  const unit = unitFlags(staged, process.env, o.intake?.preexisting_dirty ?? {});
@@ -15714,7 +15973,7 @@ See also: loki cost --detail (what a run ALREADY spent)
15714
15973
 
15715
15974
  // ../../loki-ts/src/features/contract.ts
15716
15975
  import { existsSync as existsSync43, lstatSync as lstatSync16, mkdirSync as mkdirSync29, readFileSync as readFileSync51, rmSync as rmSync20, writeFileSync as writeFileSync31 } from "fs";
15717
- import { dirname as dirname27, join as join65 } from "path";
15976
+ import { dirname as dirname28, join as join65 } from "path";
15718
15977
  import { createHash as createHash16 } from "crypto";
15719
15978
  function contractEnabled(env = process.env) {
15720
15979
  return env["LOKI_CONTRACT"] !== "0";
@@ -15838,7 +16097,7 @@ var init_contract = __esm(() => {
15838
16097
  // ../../loki-ts/src/features/speed/seal_group.ts
15839
16098
  import { createHash as createHash17 } from "crypto";
15840
16099
  import { existsSync as existsSync44, mkdirSync as mkdirSync30, readdirSync as readdirSync22, readFileSync as readFileSync52, renameSync as renameSync13, statSync as statSync21, writeFileSync as writeFileSync32 } from "fs";
15841
- import { dirname as dirname28, join as join66 } from "path";
16100
+ import { dirname as dirname29, join as join66 } from "path";
15842
16101
  function sealGroup(runDir, rh) {
15843
16102
  const manifestPath = join66(runDir, "group", "manifest.json");
15844
16103
  if (!existsSync44(manifestPath))
@@ -15905,7 +16164,7 @@ function capGroupVerdict(v, g) {
15905
16164
  return !g.allUnitsPass && (v === "VERIFIED" || v === "ALREADY_SATISFIED") ? "PARTIAL" : v;
15906
16165
  }
15907
16166
  async function verifyGroup(receiptPath, receipt, rh, verifyOne, deps = {}) {
15908
- const runDir = dirname28(receiptPath);
16167
+ const runDir = dirname29(receiptPath);
15909
16168
  const signed = isObj10(receipt["verification"]) && typeof receipt["verification"]["jwt"] === "string";
15910
16169
  const bad = (reason) => ({ verdict: "TAMPERED", reason: `group: ${reason}` });
15911
16170
  const g = receipt["group"];
@@ -15979,7 +16238,7 @@ var init_seal_group = __esm(() => {
15979
16238
 
15980
16239
  // ../../loki-ts/src/supply/supply_guard.ts
15981
16240
  import { existsSync as existsSync45, readFileSync as readFileSync53, statSync as statSync22 } from "fs";
15982
- import { basename as basename22, join as join67 } from "path";
16241
+ import { basename as basename23, join as join67 } from "path";
15983
16242
  function supplyEnabled(env) {
15984
16243
  return env["LOKI_SUPPLY_GUARD"] !== "0";
15985
16244
  }
@@ -15991,7 +16250,7 @@ function supplyVerdict(verdict, r) {
15991
16250
  return r.blocked && verdict === "VERIFIED" ? "FAILED" : verdict;
15992
16251
  }
15993
16252
  function isManifestPath(path) {
15994
- return MANIFESTS.test(basename22(path));
16253
+ return MANIFESTS.test(basename23(path));
15995
16254
  }
15996
16255
  function readDeclared(repoDir) {
15997
16256
  const p = join67(repoDir, ".loki", DECLARED_FILE);
@@ -16224,7 +16483,7 @@ var init_supply_guard = __esm(() => {
16224
16483
  // ../../loki-ts/src/engine10/stages/seal.ts
16225
16484
  import { createHash as createHash18 } from "crypto";
16226
16485
  import { existsSync as existsSync46, readdirSync as readdirSync23, mkdirSync as mkdirSync31, readFileSync as readFileSync54 } from "fs";
16227
- import { basename as basename23, isAbsolute as isAbsolute11, join as join68, relative as relative10 } from "path";
16486
+ import { basename as basename24, isAbsolute as isAbsolute11, join as join68, relative as relative10 } from "path";
16228
16487
  function sanitizeReason(s) {
16229
16488
  const collapsed = s.replace(/[\x00-\x1f\x7f]+/g, " ").trim();
16230
16489
  const capped = collapsed.length > 500 ? `${collapsed.slice(0, 500)}...` : collapsed;
@@ -16417,7 +16676,7 @@ var init_seal = __esm(() => {
16417
16676
  notProven.add(`Wall test not executed: ${wallNotRun} file(s), no reason recorded`);
16418
16677
  if (wallNotRun > 0) {
16419
16678
  try {
16420
- const kept = new Set((Array.isArray(o.wall?.files) ? o.wall.files : []).map((f) => basename23(String(f.path))));
16679
+ const kept = new Set((Array.isArray(o.wall?.files) ? o.wall.files : []).map((f) => basename24(String(f.path))));
16421
16680
  for (const n3 of readdirSync23(join68(ctx.runDir, "wall")).sort())
16422
16681
  if (!kept.has(n3))
16423
16682
  notProven.add(`wall test discarded: ${n3} (not_run)`);
@@ -16588,7 +16847,7 @@ var init_seal = __esm(() => {
16588
16847
 
16589
16848
  // ../../loki-ts/src/util/composite_seal.ts
16590
16849
  import { existsSync as existsSync47, readFileSync as readFileSync55 } from "fs";
16591
- import { basename as basename24, dirname as dirname30, join as join69 } from "path";
16850
+ import { basename as basename25, dirname as dirname31, join as join69 } from "path";
16592
16851
  function logProblem(runDir, integ) {
16593
16852
  if (typeof integ["log_sha256"] !== "string")
16594
16853
  return null;
@@ -16609,7 +16868,7 @@ function integrationProblem(integ) {
16609
16868
  return null;
16610
16869
  }
16611
16870
  async function verifyComposite(receiptPath, receipt, rh, verifyOne, deps = {}) {
16612
- const runDir = dirname30(receiptPath);
16871
+ const runDir = dirname31(receiptPath);
16613
16872
  const signed = isObj10(receipt["verification"]) && typeof receipt["verification"]["jwt"] === "string";
16614
16873
  const bad = (reason) => ({ problem: { verdict: "TAMPERED", reason: `composite: ${reason}` }, verdict: "FAILED" });
16615
16874
  const kids = receipt["children"];
@@ -16711,7 +16970,7 @@ var init_keys_cmd = __esm(() => {
16711
16970
 
16712
16971
  // ../../loki-ts/src/engine10/verify_cmd.ts
16713
16972
  import { existsSync as existsSync48, readFileSync as readFileSync56, renameSync as renameSync14, statSync as statSync24, writeFileSync as writeFileSync33 } from "fs";
16714
- import { basename as basename25, dirname as dirname31, join as join70 } from "path";
16973
+ import { basename as basename26, dirname as dirname32, join as join70 } from "path";
16715
16974
  import { createHash as createHash19, createPublicKey as createPublicKey4, verify as verify4 } from "crypto";
16716
16975
  function pubFor(kid, given) {
16717
16976
  if (given)
@@ -16763,7 +17022,7 @@ function checkEventLog(receiptPath, receipt) {
16763
17022
  const claims = st !== null && typeof st === "object" && Object.keys(st).length > 0;
16764
17023
  return claims ? "the receipt records stages but binds the empty-log hash, so no events.jsonl can back it (missing, empty or non-empty); the receipt is forged or was sealed without a log. Re-run the task to produce a fresh receipt" : null;
16765
17024
  }
16766
- const path = join70(dirname31(receiptPath), "events.jsonl");
17025
+ const path = join70(dirname32(receiptPath), "events.jsonl");
16767
17026
  if (!existsSync48(path))
16768
17027
  return "events.jsonl is missing";
16769
17028
  const raw2 = readFileSync56(path, "utf8"), events2 = readEvents(path), lines2 = raw2.split(`
@@ -16782,7 +17041,7 @@ function checkEventLog(receiptPath, receipt) {
16782
17041
  return h.digest("hex") === bound ? null : "events.jsonl does not match the hash recorded at seal";
16783
17042
  }
16784
17043
  function checkLogSeal(receiptPath, hash, kid, given) {
16785
- const path = join70(dirname31(receiptPath), "events.jsonl"), events2 = readEvents(path), done = events2.findIndex((e) => e.type === "run.completed");
17044
+ const path = join70(dirname32(receiptPath), "events.jsonl"), events2 = readEvents(path), done = events2.findIndex((e) => e.type === "run.completed");
16786
17045
  if (!events2.some((e) => e.type === "receipt.sealed" && e.data["receipt_sha256"] === hash))
16787
17046
  return { verdict: "TAMPERED", reason: "events.jsonl has no receipt.sealed event for this receipt" };
16788
17047
  if (done < 0)