loki-mode 11.126.0 → 11.127.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.
Files changed (68) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/dashboard/__init__.py +1 -1
  4. package/docs/CLI-REFERENCE.md +1 -1
  5. package/docs/INSTALLATION.md +1 -1
  6. package/docs/v10/GUIDE.md +1 -0
  7. package/loki-ts/dist/loki.js +1503 -1501
  8. package/mcp/__init__.py +1 -1
  9. package/package.json +2 -2
  10. package/packages/control-plane/dist/server.js +250 -83
  11. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  12. package/web-app/dist/assets/{AdminPage-DDBMgxcL.js → AdminPage-BhYJuqnY.js} +1 -1
  13. package/web-app/dist/assets/{Avatar-mJrkUs20.js → Avatar-QBOiE61Q.js} +1 -1
  14. package/web-app/dist/assets/{Badge-Cd0q14Tx.js → Badge-D2KcyIC8.js} +1 -1
  15. package/web-app/dist/assets/{Button-De0cwHhp.js → Button-B2-mrb3C.js} +1 -1
  16. package/web-app/dist/assets/{CockpitPage-DkIliH82.js → CockpitPage-DVHDVtUX.js} +1 -1
  17. package/web-app/dist/assets/{ComparePage-B3Z1imUF.js → ComparePage-CM4RrgWg.js} +1 -1
  18. package/web-app/dist/assets/{ErrorBoundary-WPNWTDda.js → ErrorBoundary-BOKHLzbP.js} +1 -1
  19. package/web-app/dist/assets/{EvidenceReceiptPanel-BpUogZjj.js → EvidenceReceiptPanel-D1szQE8S.js} +1 -1
  20. package/web-app/dist/assets/{GitHubIssuesPanel-BPO7NpoK.js → GitHubIssuesPanel-Bd7_KCOB.js} +1 -1
  21. package/web-app/dist/assets/{GitHubPRsPanel-CrzOHZeD.js → GitHubPRsPanel-uiC7HaYo.js} +1 -1
  22. package/web-app/dist/assets/{HomePage-CJZFnNrm.js → HomePage-Cq9xHgPy.js} +2 -2
  23. package/web-app/dist/assets/{LoginPage-Bm7TB5IL.js → LoginPage-LcYUFhND.js} +1 -1
  24. package/web-app/dist/assets/{MagicPage-2HBvmIWK.js → MagicPage-CaPWLLbk.js} +1 -1
  25. package/web-app/dist/assets/{MetricsPage-CMTxP3Mq.js → MetricsPage-LGzejHhA.js} +1 -1
  26. package/web-app/dist/assets/{NotFoundPage-tkhoGa5F.js → NotFoundPage-C9aJWNec.js} +1 -1
  27. package/web-app/dist/assets/{ProjectPage-BfUUOuN-.js → ProjectPage-DIWDOTcy.js} +3 -3
  28. package/web-app/dist/assets/{ProjectsPage-Cvwt5kh3.js → ProjectsPage-DoYOYXdi.js} +1 -1
  29. package/web-app/dist/assets/{SettingsPage-r34FsWXC.js → SettingsPage-CLai0Lq3.js} +1 -1
  30. package/web-app/dist/assets/{ShowcasePage-DO6q5eTV.js → ShowcasePage-CCaah9Ny.js} +1 -1
  31. package/web-app/dist/assets/{SystemSettingsPage-D58nh5hN.js → SystemSettingsPage-MhXR2uEt.js} +1 -1
  32. package/web-app/dist/assets/{TeamsPage-DejDUOsj.js → TeamsPage-IkVC44NR.js} +1 -1
  33. package/web-app/dist/assets/{TemplatesPage-1ArtnwZt.js → TemplatesPage-5AMd6coY.js} +1 -1
  34. package/web-app/dist/assets/{TerminalOutput-_pQzGmQJ.js → TerminalOutput-zLHjQBUu.js} +1 -1
  35. package/web-app/dist/assets/{activity-ODBRZsDz.js → activity-DTaR8f_c.js} +1 -1
  36. package/web-app/dist/assets/{bell-UrC5_65i.js → bell-B3TiasQs.js} +1 -1
  37. package/web-app/dist/assets/{bot-DVCfLRBH.js → bot-DcYchzMp.js} +1 -1
  38. package/web-app/dist/assets/{check-CMPCaGv0.js → check-qAOmxxI-.js} +1 -1
  39. package/web-app/dist/assets/{chevron-left-Cn7sKH7C.js → chevron-left-Dnw3FUfv.js} +1 -1
  40. package/web-app/dist/assets/{circle-alert-DXsaYebi.js → circle-alert-0YuABQsp.js} +1 -1
  41. package/web-app/dist/assets/{clock-B0gNBb5l.js → clock-BfTPBqE_.js} +1 -1
  42. package/web-app/dist/assets/{cloud-TkXFDt8A.js → cloud-U5rcxyaM.js} +1 -1
  43. package/web-app/dist/assets/{code-xml-HMFisMdW.js → code-xml-CT7mnLo9.js} +1 -1
  44. package/web-app/dist/assets/{database-Bu8EJyem.js → database-DnFRHe25.js} +1 -1
  45. package/web-app/dist/assets/{dollar-sign-P7X2vJkS.js → dollar-sign-Cg8vSzut.js} +1 -1
  46. package/web-app/dist/assets/{file-code-corner-OhzUW8oS.js → file-code-corner-C9wJ5M9f.js} +1 -1
  47. package/web-app/dist/assets/{file-plus-wDtwLjEv.js → file-plus-DAGg8T5E.js} +1 -1
  48. package/web-app/dist/assets/{globe-BT-5dr9F.js → globe-SQIq4mlt.js} +1 -1
  49. package/web-app/dist/assets/{hammer-CcEf1pxn.js → hammer-BE_VAWqK.js} +1 -1
  50. package/web-app/dist/assets/{index-CMNzdcfg.js → index-Nrc84uca.js} +3 -3
  51. package/web-app/dist/assets/{layers-mJlRFADO.js → layers-CvPzIFLN.js} +1 -1
  52. package/web-app/dist/assets/{loader-circle-COmEDNcD.js → loader-circle-DrknPciC.js} +1 -1
  53. package/web-app/dist/assets/{lock-DEqvwNKw.js → lock-TPRS1m2Y.js} +1 -1
  54. package/web-app/dist/assets/{package-JC9bLTY_.js → package-0KxSELeP.js} +1 -1
  55. package/web-app/dist/assets/{plus-Iq126LTb.js → plus-D38LiOt0.js} +1 -1
  56. package/web-app/dist/assets/{refresh-cw-CApVFHP1.js → refresh-cw-Bq5kDx5g.js} +1 -1
  57. package/web-app/dist/assets/{rotate-ccw-Dp8vhPbJ.js → rotate-ccw-D-9KOiif.js} +1 -1
  58. package/web-app/dist/assets/{scroll-text-o-Km0MZS.js → scroll-text-Bz2BxifR.js} +1 -1
  59. package/web-app/dist/assets/{server-EZS71DhN.js → server-Bt7O7NPG.js} +1 -1
  60. package/web-app/dist/assets/{shield-alert-BEyq_3QV.js → shield-alert-C_x87oIm.js} +1 -1
  61. package/web-app/dist/assets/{thumbs-up-CgKCge6z.js → thumbs-up-3W29s5do.js} +1 -1
  62. package/web-app/dist/assets/{trash-2-CB0TeX_6.js → trash-2-Dk7t0nmx.js} +1 -1
  63. package/web-app/dist/assets/{trending-down-BdUdItAV.js → trending-down-Dfq93DOI.js} +1 -1
  64. package/web-app/dist/assets/{trending-up-CX3l_9Ht.js → trending-up-CfGRGEXJ.js} +1 -1
  65. package/web-app/dist/assets/{upload-BpIaloEk.js → upload-DJ3iWPcy.js} +1 -1
  66. package/web-app/dist/assets/{usePolling-CM3ppeqa.js → usePolling-BHg1_N-o.js} +1 -1
  67. package/web-app/dist/assets/{user-DQUTz__i.js → user-BxZEq1F9.js} +1 -1
  68. package/web-app/dist/index.html +1 -1
@@ -13358,6 +13358,97 @@ function failIds(raw2) {
13358
13358
  const c = failCount(output);
13359
13359
  return c && ids.length >= c ? ids : [];
13360
13360
  }
13361
+ function normError(line2) {
13362
+ const root = "(?:Users|private|var|tmp|home|opt|Volumes|mnt|root|workspace)", file = "[\\w.@-]+\\.(?:[cm]?[jt]sx?|json|py|go|rs|java|kt|cs|rb|php|vue|svelte|mdx?|ya?ml|toml|css|scss|html)(?![\\w])";
13363
+ const absPath = new RegExp(`(?<![\\w.@/-])/(?:${root}/(?:[\\w.@+-]+/)*[\\w.@+-]+|(?:[\\w.@+-]+/)*${file})(?::\\d+){0,2}`, "g"), rootPath = new RegExp(`(?<![\\w.@/-])/${root}/(?:[\\w.@+-]+/)*[\\w.@+-]+(?::\\d+){0,2}`, "g");
13364
+ const outside = (t) => t.replace(/\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?/g, "<ts>").replace(absPath, "<path>").replace(/\s\d+(?:\.\d+)?\s?ms\)?$/, " <dur>");
13365
+ return line2.split(/('[^']*'|"[^"]*"|`[^`]*`)/).map((part, n3) => n3 % 2 === 0 ? outside(part) : part.replace(rootPath, "<path>")).join("").replace(/\s+/g, " ").trim();
13366
+ }
13367
+ function errorsById(out2) {
13368
+ const norm2 = (l) => normError(l);
13369
+ const lines = stripAnsi(out2).split(`
13370
+ `).map((l) => l.trim()), m = new Map, add3 = (id, e) => {
13371
+ m.set(id, [...m.get(id) ?? [], e]);
13372
+ };
13373
+ const bun = lines.some((l) => /^Ran \d+ tests? across \d+ files?\./.test(l));
13374
+ let file = "", err = [];
13375
+ for (const [i, l] of lines.entries()) {
13376
+ if (bun) {
13377
+ const f = /^([\w./@-]+\.[cm]?[jt]sx?):$/.exec(l), m2 = /^(?:\(fail\)|\u2717)\s+(.+?)(?:\s+\[[\d.]+m?s\])?$/.exec(l);
13378
+ if (f) {
13379
+ file = f[1];
13380
+ err = [];
13381
+ } else if (/^error:/.test(l))
13382
+ err = [l];
13383
+ else if (err.length && /^(?:Expected|Received)\b/.test(l))
13384
+ err.push(l);
13385
+ else if (m2) {
13386
+ if (err.length)
13387
+ add3(`${file}::${m2[1].trim()}`, norm2(err.join(" | ")));
13388
+ err = [];
13389
+ } else if (/^\((?:pass|skip|todo)\)|^\u2713/.test(l))
13390
+ err = [];
13391
+ continue;
13392
+ }
13393
+ const py = /^FAILED (\S+::\S*) - (.+)$/.exec(l);
13394
+ if (py) {
13395
+ add3(py[1], norm2(py[2]));
13396
+ continue;
13397
+ }
13398
+ const g = /^(?:\u25cf\s+(?!Console|Test suite failed)(.+)|not ok \d+ - (.+?)(?:\s+#.*)?|\u2716\s+(?!failing tests:)(.+?)(?:\s+\([\d.]+ms\))?)$/.exec(l);
13399
+ if (g) {
13400
+ let e = "(no diagnostics)";
13401
+ for (const x of lines.slice(i + 1)) {
13402
+ if (x === "" || x === "---")
13403
+ continue;
13404
+ if (/^(?:not ok|ok) \d+|^\u25cf|^\u2716|^\u2714|^1\.\.\d+|^#/.test(x))
13405
+ break;
13406
+ e = x.replace(/^message:\s*/, "");
13407
+ break;
13408
+ }
13409
+ add3((g[1] ?? g[2] ?? g[3]).trim(), norm2(e));
13410
+ continue;
13411
+ }
13412
+ const v = /^FAIL\s+(.+)$/.exec(l);
13413
+ if (!v)
13414
+ continue;
13415
+ const next = lines.slice(i + 1).find((x) => x !== "" && !/^FAIL\s/.test(x));
13416
+ if (next !== undefined)
13417
+ add3(v[1].trim(), norm2(next));
13418
+ }
13419
+ for (const [k, e] of m)
13420
+ m.set(k, e.sort());
13421
+ return m;
13422
+ }
13423
+ function unhandledBlock(out2) {
13424
+ const lines = stripAnsi(out2).split(`
13425
+ `).map((l) => l.trim()), res = [];
13426
+ for (const [i, l] of lines.entries()) {
13427
+ if (/^[\u23af\-=\s]*Unhandled (?:Errors?|Rejections?|Exceptions?)\b/i.test(l) || /\bunhandled (?:promise )?(?:errors?|rejections?)\b/i.test(l) || /^Errors\s+\d+ errors?\b/.test(l)) {
13428
+ res.push(normError(l.replace(/^[\u23af\-=\s]+|[\u23af\-=\s]+$/g, "")));
13429
+ if (/Unhandled (?:Rejection|Exception|Error)\b/i.test(l) || /Unhandled (?:Errors?|Rejections?)\b/.test(l))
13430
+ for (const x of lines.slice(i + 1, i + 6)) {
13431
+ if (x === "" || /^[\u23af\-=]{3,}/.test(x))
13432
+ break;
13433
+ res.push(normError(x));
13434
+ }
13435
+ }
13436
+ }
13437
+ return [...new Set(res)].sort();
13438
+ }
13439
+ function sameErrors(head, base, ids) {
13440
+ const asMap = (x) => typeof x === "string" ? errorsById(x) : x instanceof Map ? x : new Map(Object.entries(x));
13441
+ const h = asMap(head), b = asMap(base), all = ids ?? [], eq2 = (x = [], y = []) => x.length === y.length && x.every((e, n3) => e === y[n3]);
13442
+ const keys = (i) => h.has(i) ? [i] : [...h.keys()].filter((k) => k.endsWith(` > ${i}`));
13443
+ return all.length > 0 && all.every((i) => {
13444
+ const ks = keys(i);
13445
+ return ks.length > 0 && ks.every((k) => eq2(b.get(k), h.get(k)));
13446
+ });
13447
+ }
13448
+ function comparableIds(ids) {
13449
+ const full = ids.filter((i) => /^[^>]*\.[cm]?[jt]sx? > /.test(i));
13450
+ return full.length ? full : [...ids];
13451
+ }
13361
13452
  var ID_LINE;
13362
13453
  var init_failures = __esm(() => {
13363
13454
  init_check_result();
@@ -13762,7 +13853,7 @@ function runOnce(repoDir, cmd, cwd, tmo, opts) {
13762
13853
  const ids = r.code !== 0 && !r.timedOut ? failIds(r.out).length ? failIds(r.out) : isExitCodedScript(cmd) && r.code !== null ? [exitCodedId(cmd, r.out, repoDir) ?? []].flat() : [] : [], missing = r.missing === true;
13763
13854
  const attributable = !r.timedOut && !missing && r.code !== null && (r.code === 0 || ids.length > 0);
13764
13855
  const reason = attributable ? undefined : r.timedOut ? "timed out" : missing ? "command not found" : "failing test ids not parseable, failures cannot be attributed";
13765
- return { b: { ran: true, command: cmd, exit_code: r.code, duration_s: dur, timed_out: r.timedOut, failing_ids: ids, attributable, ...reason ? { reason } : {}, zero_tests: r.code === 0 && emptyDiscovery(classifyCheck({ kind: "test", ok: true, out: r.out, ...goRunner(cmd) }), r.out) }, missing };
13856
+ return { b: { ran: true, command: cmd, exit_code: r.code, duration_s: dur, timed_out: r.timedOut, failing_ids: ids, attributable, ...reason ? { reason } : {}, ...ids.length ? { failing_errors: Object.fromEntries(errorsById(r.out)) } : {}, ...unhandledBlock(r.out).length ? { failing_unhandled: unhandledBlock(r.out) } : {}, zero_tests: r.code === 0 && emptyDiscovery(classifyCheck({ kind: "test", ok: true, out: r.out, ...goRunner(cmd) }), r.out) }, missing };
13766
13857
  }
13767
13858
  function runBaseline(repoDir, commands, opts = {}) {
13768
13859
  const t = commands.find((c) => c.kind === "test");
@@ -13790,7 +13881,7 @@ function baselineSuites(repoDir, specs, opts = {}) {
13790
13881
  const old = p.suites ?? [];
13791
13882
  p.suites = specs.filter((s) => s.cwd !== "." || normCmd(s.run) !== normCmd(p.baseline.command ?? "")).map((s) => {
13792
13883
  const prev = old.find((o) => o.command === s.cmd);
13793
- if (prev?.ran && !opts.rerun)
13884
+ if (prev?.ran && !opts.rerun && (prev.failing_ids.length === 0 || prev.failing_errors))
13794
13885
  return prev;
13795
13886
  const tmo = Math.min(opts.timeoutS ?? DEFAULT_TIMEOUT_S, Math.floor(left)), t0 = Date.now();
13796
13887
  if (tmo < 1)
@@ -13830,7 +13921,7 @@ function save(repoDir, p) {
13830
13921
  function ensureProfile(repoDir, opts = {}) {
13831
13922
  try {
13832
13923
  const hash = manifestHash(repoDir), rev = headOf(repoDir), old = loadProfile(repoDir);
13833
- if (old && old.manifest_hash === hash && old.revision === rev)
13924
+ if (old && old.manifest_hash === hash && old.revision === rev && (old.baseline.failing_ids.length === 0 || old.baseline.failing_errors))
13834
13925
  return { profile: old, reused: true };
13835
13926
  const commands = old && old.manifest_hash === hash ? old.commands.map((c) => ({ ...c, ...c.kind === "test" ? { validated: null, exit_code: null, duration_s: null, failing_ids: [] } : {} })) : discoverCommands(repoDir);
13836
13927
  const profile = { version: 1, revision: rev, manifest_hash: hash, created_at: (opts.now?.() ?? new Date).toISOString(), commands, baseline: runBaseline(repoDir, commands, opts) };
@@ -13842,14 +13933,20 @@ function ensureProfile(repoDir, opts = {}) {
13842
13933
  }
13843
13934
  function attribute(repoDir, baseSha, failing) {
13844
13935
  const p = loadProfile(repoDir), none = { preExistingChecks: [], preExistingIds: [], introducedChecks: failing.map((f) => f.name), line: null };
13845
- if (!p || p.revision !== baseSha || !p.baseline.attributable || p.baseline.failing_ids.length === 0 || failing.length === 0)
13936
+ if (!p || p.revision !== baseSha || failing.length === 0)
13937
+ return none;
13938
+ const root = p.baseline.attributable ? p.baseline.failing_ids : [], own = (name) => {
13939
+ const s = name ? p.suites?.find((x) => x.name === name && x.ran && x.attributable) : undefined;
13940
+ return s ? s.failing_ids : root;
13941
+ };
13942
+ const rows = failing.map((f) => ({ ...f, base: new Set(own(f.suite)) })), known = new Set(rows.flatMap((r) => [...r.base]));
13943
+ if (known.size === 0)
13846
13944
  return none;
13847
- const base = new Set(p.baseline.failing_ids);
13848
- return split(failing.map((f) => ({ ...f, base })), base.size);
13945
+ return split(rows, known.size);
13849
13946
  }
13850
13947
  function split(failing, known) {
13851
13948
  const unparsed = failing.filter((f) => !f.ids?.length && f.base.size > 0).length;
13852
- const pre = failing.filter((f) => f.eligible && f.ids?.length && f.ids.every((i) => f.base.has(i)));
13949
+ const pre = failing.filter((f) => f.eligible && f.ids?.length && comparableIds(f.ids).every((i) => f.base.has(i)));
13853
13950
  const introduced = failing.filter((f) => !pre.includes(f)).map((f) => f.name);
13854
13951
  if (pre.length === 0)
13855
13952
  return { preExistingChecks: [], preExistingIds: [], introducedChecks: introduced, line: `baseline: ${known} known failure(s) before this run; ${unparsed ? `head failure ids unparseable for ${unparsed} failing check(s), cannot compare` : "none of the failing checks match them"}, ${introduced.length} introduced (blocking)` };
@@ -13920,11 +14017,14 @@ function attributeFullSuite(repoDir, baseSha, full, blocked, changed) {
13920
14017
  }, miss = bad.find((c) => !of(c.cmd));
13921
14018
  if (miss)
13922
14019
  return { ...none, line: `baseline: ran ${runs2.map((b) => `"${b.command}"`).join(", ") || "nothing"}, not the full suite command "${miss.cmd}", ids not comparable, full suite failures not excused` };
13923
- const known = new Set(bad.flatMap((c) => ids(c.cmd))), block = new Set(blocked);
14020
+ const known = new Set(bad.flatMap((c) => ids(c.cmd))), block = new Set(blocked), sameAsBase = (c) => {
14021
+ const b = of(c.cmd), be = b?.failing_errors, hu = c.unhandled ?? [], bu = b?.failing_unhandled ?? [];
14022
+ return !!be && !!c.errors && hu.length === bu.length && hu.every((x, n3) => x === bu[n3]) && sameErrors(new Map(Object.entries(c.errors)), be, comparableIds(c.ids ?? []));
14023
+ };
13924
14024
  if (known.size === 0)
13925
14025
  return none;
13926
14026
  const unproven = [...new Set(bad.flatMap((c) => c.ids ?? []).filter((i) => !i.includes("::") && goIdTouched(repoDir, i, changed)))];
13927
- const res = split(bad.map((c) => ({ name: c.name, ...c.ids ? { ids: c.ids } : {}, eligible: !cargoTouched(changed) && (c.ids ?? []).every((i) => !block.has(i) && !changed.some((f) => i.includes(f)) && !goIdTouched(repoDir, i, changed)), base: new Set(ids(c.cmd)) })), known.size);
14027
+ const res = split(bad.map((c) => ({ name: c.name, ...c.ids ? { ids: c.ids } : {}, eligible: !cargoTouched(changed) && sameAsBase(c) && (c.ids ?? []).every((i) => !block.has(i) && !changed.some((f) => i.includes(f)) && !goIdTouched(repoDir, i, changed)), base: new Set(ids(c.cmd)) })), known.size);
13928
14028
  const rust = (cargoTouched(changed) ? bad : []).map((c) => `NOT PROVEN: ${c.name} may run cargo tests and the diff edits Rust source or a manifest; cargo test ids carry no crate path, so a failure cannot be shown pre-existing`);
13929
14029
  if (!unproven.length && !rust.length)
13930
14030
  return res;
@@ -20992,7 +21092,7 @@ ${r.stderr}`);
20992
21092
  notProven.add(`${NA_PREFIX}${name} (ran 0 tests on base and head; the Wall or a task-named check passed with executed tests)`);
20993
21093
  continue;
20994
21094
  }
20995
- checks.push({ name, cmd, result: cls.result, duration_s, ...cls.count ? { count: cls.count } : {}, ...cls.result === "fail" ? { ids: cls.count ? [exitCodedId(line2, out2, repoDir) ?? []].flat() : failIds(out2), first_error: firstError(out2), excerpt: failureExcerpt(out2, repoDir) } : {} });
21095
+ checks.push({ name, cmd, result: cls.result, duration_s, ...cls.count ? { count: cls.count } : {}, ...cls.result === "fail" ? { ids: cls.count ? [exitCodedId(line2, out2, repoDir) ?? []].flat() : failIds(out2), errors: Object.fromEntries(errorsById(out2)), ...unhandledBlock(out2).length ? { unhandled: unhandledBlock(out2) } : {}, first_error: firstError(out2), excerpt: failureExcerpt(out2, repoDir) } : {} });
20996
21096
  if (cls.result === "not_run")
20997
21097
  notProven.add(`not run: ${name} (${cls.reason ?? NO_TESTS_REASON})`);
20998
21098
  }
@@ -21635,22 +21735,22 @@ function relevant(shared, text3) {
21635
21735
  `);
21636
21736
  }
21637
21737
  function testConfigChanged(repoDir, baseSha, changed) {
21638
- return changed.filter((f) => {
21639
- const spec = RUNNER_CONFIGS.find((s) => s.re.test(f));
21640
- if (!spec)
21641
- return false;
21642
- if (!spec.shared)
21643
- return true;
21644
- const b = baseText(repoDir, baseSha, f), h = headText(repoDir, f);
21645
- if (b === h)
21646
- return false;
21647
- const e = typeof spec.shared === "string" && spec.shared !== "tsconfig" ? "" : "{}";
21648
- try {
21649
- return relevant(spec.shared, b || e) !== relevant(spec.shared, h || e);
21650
- } catch {
21651
- return true;
21652
- }
21653
- });
21738
+ return changed.filter((f) => steersRunner(f, baseText(repoDir, baseSha, f), headText(repoDir, f)));
21739
+ }
21740
+ function steersRunner(f, before, after) {
21741
+ const spec = RUNNER_CONFIGS.find((s) => s.re.test(f));
21742
+ if (!spec)
21743
+ return false;
21744
+ if (!spec.shared)
21745
+ return true;
21746
+ if (before === after)
21747
+ return false;
21748
+ const e = typeof spec.shared === "string" && spec.shared !== "tsconfig" ? "" : "{}";
21749
+ try {
21750
+ return relevant(spec.shared, before || e) !== relevant(spec.shared, after || e);
21751
+ } catch {
21752
+ return true;
21753
+ }
21654
21754
  }
21655
21755
  function patchedTargets(cfg, text3) {
21656
21756
  const out2 = [], unq = (v) => v.replace(/^["']|["']$/g, "");
@@ -21820,7 +21920,7 @@ function hiddenConfigChanged(repoDir, snap) {
21820
21920
  if (!snap || typeof snap !== "object")
21821
21921
  return Object.keys(now2).length ? ["untracked runner configs (no intake snapshot to compare)"] : [];
21822
21922
  const was = snap;
21823
- const d = [...new Set([...Object.keys(now2), ...Object.keys(was)])].filter((f) => now2[f] !== was[f]).sort();
21923
+ const d = [...new Set([...Object.keys(now2), ...Object.keys(was)])].filter((f) => now2[f] !== was[f] && (was[f] !== undefined || now2[f] === "!unreadable" || steersRunner(f, "", headText(repoDir, f)))).sort();
21824
21924
  return d.length > 5 ? [...d.slice(0, 5), `(+${d.length - 5} more)`] : d;
21825
21925
  }
21826
21926
  var PKG_KEYS, RAW_CONFIGS, RUNNER_CONFIGS, DEP_MAPS, RUNNER_DEP, LOCAL_SPEC, depGuard = (j) => DEP_MAPS.map((m) => Object.entries(j[m] ?? {}).filter(([k, v]) => RUNNER_DEP.test(k) || LOCAL_SPEC.test(String(v)))), KW2, lines = (t) => t.split(`
@@ -33256,6 +33356,13 @@ ${timeBudgetNote(limitS)}`;
33256
33356
  const fx = await runStage("fix", true);
33257
33357
  if (!fx || mustJump("fix", fx) || fatal)
33258
33358
  break;
33359
+ if (fx.status === "completed" && outputs.fix?.exit === "spec_conflict" && onlyCollateralRed(outputs.verify)) {
33360
+ const v2 = await runStage("verify", true);
33361
+ if (mustJump("verify", v2))
33362
+ break;
33363
+ if (!hasFailures(outputs.verify))
33364
+ break;
33365
+ }
33259
33366
  if (fx.status === "completed" && outputs.fix?.exit === "spec_conflict") {
33260
33367
  outputs.implement = { ...outputs.implement, exit: "spec_conflict", spec_conflict_reason: outputs.fix.spec_conflict_reason ?? null };
33261
33368
  break;
@@ -33308,6 +33415,9 @@ ${timeBudgetNote(limitS)}`;
33308
33415
  var FLOW, TAIL, harnessOnlyFail = (d) => {
33309
33416
  const f = (Array.isArray(d?.checks) ? d.checks : []).filter((c) => c?.result === "fail");
33310
33417
  return f.length > 0 && f.every((c) => c.owner === "harness");
33418
+ }, onlyCollateralRed = (d) => {
33419
+ const col = Array.isArray(d?.collateral_same_error) ? d.collateral_same_error.map(String) : [], b = Array.isArray(d?.blocking_checks) ? d.blocking_checks.map(String) : [];
33420
+ return col.length > 0 && b.length > 0 && b.every((n3) => col.includes(n3) || n3.startsWith("full suite"));
33311
33421
  }, hasFailures = (d) => Array.isArray(d?.failures_grouped) && d.failures_grouped.length > 0 && !harnessOnlyFail(d) || typeof d?.holdout_failed === "number" && d.holdout_failed > 0, earlyExit = (d) => d.already_satisfied === true, KILL_GRACE_MS3 = 2000, VERIFY_RESERVE_S, TREE_STAGES;
33312
33422
  var init_machine = __esm(() => {
33313
33423
  init_hooks();
@@ -39116,9 +39226,10 @@ function epicOutcome(rows, planUsd = [], env = process.env) {
39116
39226
  const failed2 = rows.find((r) => !isBudget(r) && !/^(VERIFIED|PARTIAL|SKIPPED)/.test(r.outcome)), budget = rows.find(isBudget);
39117
39227
  const outcome = failed2 ? "FAILED" : budget ? "BUDGET_STOP" : rows.some((r) => /^PARTIAL/.test(r.outcome)) ? "PARTIAL" : "VERIFIED";
39118
39228
  const why = failed2 ?? budget ?? rows.find((r) => /^PARTIAL/.test(r.outcome));
39229
+ const prs = rows.filter((r) => r.pr).length, kept = why && !why.pr && why.branch ? `; ${why.id}'s change is on branch ${why.branch}` : "", got = (outcome === "FAILED" || outcome === "BUDGET_STOP") && prs > 0 ? ` (${prs} of ${rows.length} slices opened a PR${kept})` : "";
39119
39230
  const lines2 = [
39120
39231
  `${labelCol("Outcome")}${outcome}`,
39121
- ...why && outcome !== "VERIFIED" ? [`${labelCol("Reason")}slice ${why.id}: ${oneLine3(why.outcome)}`] : [],
39232
+ ...why && outcome !== "VERIFIED" ? [`${labelCol("Reason")}slice ${why.id}: ${oneLine3(why.outcome)}${got}`] : [],
39122
39233
  ...rows.filter((r) => r.pr).map((r) => `${labelCol("PR")}${r.pr}`),
39123
39234
  `${labelCol("Cost")}${splitCostText(splitCost(rows, planUsd))}`
39124
39235
  ];
@@ -42161,7 +42272,7 @@ ${r.stderr}`), lr = r.exitCode === 0 ? undefined : await harnessLoadReason({ rep
42161
42272
  notProven.add(`${NA_PREFIX}${name} (ran 0 tests on base and head; the Wall or a task-named check passed with executed tests)`);
42162
42273
  continue;
42163
42274
  }
42164
- checks.push({ name, cmd: [spec.cmd, ...spec.args].join(" "), result: cls.result, duration_s: durationS, ...cls.result === "fail" ? { ids: failIds(out2), first_error: firstError(out2), excerpt: failureExcerpt(out2, ctx.repoDir) } : {} });
42275
+ checks.push({ name, cmd: [spec.cmd, ...spec.args].join(" "), result: cls.result, duration_s: durationS, ...cls.result === "fail" ? { ids: failIds(out2), errors: Object.fromEntries(errorsById(out2)), ...unhandledBlock(out2).length ? { unhandled: unhandledBlock(out2) } : {}, first_error: firstError(out2), excerpt: failureExcerpt(out2, ctx.repoDir) } : {} });
42165
42276
  if (cls.result === "not_run")
42166
42277
  notProven.add(`not run: ${name} (${cls.reason ?? NO_TESTS_REASON})`);
42167
42278
  }
@@ -46557,6 +46668,7 @@ __export(exports_base_guard, {
46557
46668
  finishDeferredRun: () => finishDeferredRun,
46558
46669
  envChangedSince: () => envChangedSince,
46559
46670
  depsSeeHead: () => depsSeeHead,
46671
+ depsListing: () => depsListing,
46560
46672
  deepPid: () => deepPid,
46561
46673
  deepAlive: () => deepAlive,
46562
46674
  baseLine: () => baseLine,
@@ -46729,17 +46841,58 @@ function depsSeeHead(pkgDir, repoDir) {
46729
46841
  function lazyZeroBaseline(repoDir) {
46730
46842
  const raw2 = git13(repoDir, ["ls-files", "-z", "--others", "--ignored", "--exclude-standard", "--directory"]);
46731
46843
  const ignored = raw2 === null ? null : raw2.split("\x00").map((p) => p.replace(/\/$/, "")).filter((p) => p !== "" && p !== ".loki" && !p.startsWith(".loki/"));
46732
- return { lazy: true, since_ms: Date.now(), ignored: ignored && ignored.length <= IGNORED_CAP ? ignored : null };
46844
+ const deps = {};
46845
+ for (const rel of ignored ?? [])
46846
+ if (/(?:^|\/)(?:node_modules|\.venv)$/.test(rel))
46847
+ deps[rel] = depsListing(join143(repoDir, rel));
46848
+ return { lazy: true, since_ms: Date.now(), ignored: ignored && ignored.length <= IGNORED_CAP ? ignored : null, deps };
46733
46849
  }
46734
46850
  function zeroGate(rec2) {
46735
46851
  const z = rec2 && typeof rec2 === "object" ? rec2 : {};
46736
46852
  const strs5 = (v) => Array.isArray(v) ? v.filter((s) => typeof s === "string") : [];
46737
46853
  if (z.lazy === true && typeof z.since_ms === "number")
46738
- return { has: () => true, sinceMs: z.since_ms, ignored: Array.isArray(z.ignored) ? strs5(z.ignored) : null };
46854
+ return { has: () => true, sinceMs: z.since_ms, ignored: Array.isArray(z.ignored) ? strs5(z.ignored) : null, ...z.deps && typeof z.deps === "object" ? { deps: z.deps } : {} };
46739
46855
  const names = new Set(strs5(z.zero));
46740
46856
  return { has: (n3) => names.has(n3) };
46741
46857
  }
46742
- function envChangedSince(repoDir, pkgDir, sinceMs, ignored) {
46858
+ function depsListing(root) {
46859
+ const out2 = [], skip = (n3) => RUNNER_CACHE_DIRS.includes(n3) || n3 === "__pycache__";
46860
+ const list = (dir, prefix) => {
46861
+ for (const e of readdirSync45(dir, { withFileTypes: true })) {
46862
+ if (skip(e.name))
46863
+ continue;
46864
+ if (e.name.startsWith("@") && (e.isDirectory() || e.isSymbolicLink())) {
46865
+ try {
46866
+ list(join143(dir, e.name), `${prefix}${e.name}/`);
46867
+ continue;
46868
+ } catch {}
46869
+ }
46870
+ out2.push(prefix + e.name);
46871
+ if (out2.length > 50000)
46872
+ throw new RangeError("bound");
46873
+ }
46874
+ };
46875
+ try {
46876
+ list(root, "");
46877
+ for (const lib of ["lib", "lib64", "Lib"]) {
46878
+ const l = join143(root, lib);
46879
+ if (!existsSync98(l))
46880
+ continue;
46881
+ if (lib === "Lib") {
46882
+ if (existsSync98(join143(l, "site-packages")))
46883
+ list(join143(l, "site-packages"), "py/");
46884
+ continue;
46885
+ }
46886
+ for (const py of readdirSync45(l))
46887
+ if (/^python/.test(py) && existsSync98(join143(l, py, "site-packages")))
46888
+ list(join143(l, py, "site-packages"), "py/");
46889
+ }
46890
+ } catch {
46891
+ return null;
46892
+ }
46893
+ return out2.sort();
46894
+ }
46895
+ function envChangedSince(repoDir, pkgDir, sinceMs, ignored, deps) {
46743
46896
  if (ignored === null)
46744
46897
  return true;
46745
46898
  let stampDir = "";
@@ -46752,9 +46905,18 @@ function envChangedSince(repoDir, pkgDir, sinceMs, ignored) {
46752
46905
  if (!st.isDirectory())
46753
46906
  roots.push(join143(repoDir, rel));
46754
46907
  }
46908
+ const depRoots = [];
46755
46909
  for (const d of ["node_modules", ".venv"])
46756
- if (existsSync98(join143(pkgDir, d)))
46910
+ if (existsSync98(join143(pkgDir, d))) {
46757
46911
  roots.push(join143(pkgDir, d));
46912
+ depRoots.push(join143(pkgDir, d));
46913
+ }
46914
+ if (deps)
46915
+ for (const r of depRoots) {
46916
+ const was = deps[relative28(repoDir, r)], now2 = depsListing(r);
46917
+ if (!was || !now2 || was.length !== now2.length || was.some((n3, i) => n3 !== now2[i]))
46918
+ return true;
46919
+ }
46758
46920
  if (roots.length === 0)
46759
46921
  return false;
46760
46922
  stampDir = mkdtempSync19(join143(tmpdir25(), "loki-zero-stamp-"));
@@ -46762,8 +46924,12 @@ function envChangedSince(repoDir, pkgDir, sinceMs, ignored) {
46762
46924
  writeFileSync71(stamp2, "");
46763
46925
  utimesSync(stamp2, sinceMs / 1000, sinceMs / 1000);
46764
46926
  const prune = RUNNER_CACHE_DIRS.flatMap((n3, i) => [...i ? ["-o"] : [], "-name", n3]);
46765
- const out2 = execFileSync9("find", ["-P", ...new Set(roots), "(", ...prune, ")", "-prune", "-o", "-cnewer", stamp2, "-print", "-quit"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 120000 });
46766
- return out2.trim() !== "";
46927
+ const out2 = execFileSync9("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 });
46928
+ if (out2.trim() !== "")
46929
+ return true;
46930
+ const dirs = execFileSync9("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(`
46931
+ `).filter(Boolean);
46932
+ return dirs.some((d) => !(roots.includes(d) || /(?:^|\/)site-packages$/.test(d) || RUNNER_CACHE_DIRS.concat("__pycache__").some((c) => existsSync98(join143(d, c)))));
46767
46933
  } catch {
46768
46934
  return true;
46769
46935
  } finally {
@@ -46788,7 +46954,7 @@ function baseDepsLinker(baseDir, repoDir, gate = {}) {
46788
46954
  return (cwd) => {
46789
46955
  const src = join143(repoDir, relative28(baseDir, cwd));
46790
46956
  if (!seen.has(src))
46791
- seen.set(src, !(depsSeeHead(src, repoDir) || gate.sinceMs !== undefined && envChangedSince(repoDir, src, gate.sinceMs, gate.ignored ?? null)));
46957
+ seen.set(src, !(depsSeeHead(src, repoDir) || gate.sinceMs !== undefined && envChangedSince(repoDir, src, gate.sinceMs, gate.ignored ?? null, gate.deps)));
46792
46958
  if (!seen.get(src))
46793
46959
  return false;
46794
46960
  for (const d of ["node_modules", ".venv"]) {
@@ -47065,7 +47231,7 @@ var init_base_guard = __esm(() => {
47065
47231
  init_test_file_text();
47066
47232
  init_stop_restore();
47067
47233
  REPO_LINK_FILE = /\.pth$|\.egg-link$|^direct_url\.json$|^__editable___.*_finder\.py$/;
47068
- RUNNER_CACHE_DIRS = [".vite", ".vitest", ".cache", "__pycache__", ".pytest_cache"];
47234
+ RUNNER_CACHE_DIRS = [".vite", ".vite-temp", ".vitest", ".vitest-cache", ".cache", "__pycache__", ".pytest_cache"];
47069
47235
  ADVISORY_PATH = /^(?:test configuration changed|runner config changed): (.+?)(?: \(.*\))?$|^symlink added by the change .*?\): (.+)$/;
47070
47236
  E10_BRANCH_RE = /^loki\/(e10-[A-Za-z0-9-]+)$/;
47071
47237
  RUN_TMP_WORKTREE_RE = /^(?:e10-base-|e10-loadown-|loki-mutproof-)/;
@@ -47095,9 +47261,11 @@ __export(exports_verify, {
47095
47261
  feedsFixRound: () => feedsFixRound,
47096
47262
  errorsById: () => errorsById,
47097
47263
  commandFor: () => commandFor,
47264
+ collateralTests: () => collateralTests,
47098
47265
  changedFiles: () => changedFiles,
47099
47266
  WALL_FAILURE_TAIL_FILE: () => WALL_FAILURE_TAIL_FILE,
47100
- WALL_FAILURE_TAIL_CAP: () => WALL_FAILURE_TAIL_CAP
47267
+ WALL_FAILURE_TAIL_CAP: () => WALL_FAILURE_TAIL_CAP,
47268
+ COLLATERAL_RED: () => COLLATERAL_RED
47101
47269
  });
47102
47270
  import { existsSync as existsSync99, mkdtempSync as mkdtempSync20, readFileSync as readFileSync125, realpathSync as realpathSync35, rmSync as rmSync38 } from "fs";
47103
47271
  import { tmpdir as tmpdir26 } from "os";
@@ -47123,6 +47291,13 @@ ${tail2(f.out)}
47123
47291
  return;
47124
47292
  }
47125
47293
  }
47294
+ function collateralTests(relevant2, named2) {
47295
+ const stems = new Set(named2.flatMap((f) => {
47296
+ const s = basename37(f).replace(/\.[^.]+$/, "");
47297
+ return /^(index|__init__|mod)$/.test(s) && f.includes("/") ? [s, basename37(f.slice(0, f.lastIndexOf("/")))] : [s];
47298
+ }));
47299
+ return relevant2.filter((t) => !named2.includes(t.path) && !stems.has(coveredStem(t.path)));
47300
+ }
47126
47301
  async function runOnce3(cmd2, args, cwd, signal, opts) {
47127
47302
  if (!Bun.which(cmd2, { PATH: opts.path ?? process.env["PATH"] ?? "" }))
47128
47303
  return { ok: false, missing: true, cut: false, out: "" };
@@ -47317,38 +47492,7 @@ function changedSymbolsFirst(ctx, tests, changed) {
47317
47492
  });
47318
47493
  return [...hits, ...tests.filter((t) => !hits.includes(t))];
47319
47494
  }
47320
- function errorsById(out2) {
47321
- const norm5 = (l) => l.replace(/\b\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?/g, "<ts>").replace(/\b\d{1,2}:\d{2}:\d{2}(?:\.\d+)?\b/g, "<ts>").replace(/(^|[\s(])\/(?:[\w.@-]+\/)*[\w.@-]+(?::\d+){0,2}/g, "$1<path>").replace(/\b\d+(?:\.\d+)?\s?(?:ms|s|us|\u00B5s|ns|min)\b/g, "<dur>").replace(/\s+/g, " ").trim();
47322
- const lines2 = stripAnsi(out2).split(`
47323
- `).map((l) => l.trim()), m = new Map, add3 = (id, e) => {
47324
- m.set(id, [...m.get(id) ?? [], e]);
47325
- };
47326
- for (const [i, l] of lines2.entries()) {
47327
- const py = /^FAILED (\S+::\S*) - (.+)$/.exec(l);
47328
- if (py) {
47329
- add3(py[1], norm5(py[2]));
47330
- continue;
47331
- }
47332
- const v = /^FAIL\s+(.+)$/.exec(l);
47333
- if (!v)
47334
- continue;
47335
- const next = lines2.slice(i + 1).find((x) => x !== "" && !/^FAIL\s/.test(x));
47336
- if (next !== undefined)
47337
- add3(v[1].trim(), norm5(next));
47338
- }
47339
- for (const [k, e] of m)
47340
- m.set(k, e.sort());
47341
- return m;
47342
- }
47343
- function sameErrors(head, base2, ids) {
47344
- const h = typeof head === "string" ? errorsById(head) : head, b = errorsById(base2), all = ids ?? [], eq2 = (x = [], y = []) => x.length === y.length && x.every((e, n3) => e === y[n3]);
47345
- const keys = (i) => h.has(i) ? [i] : [...h.keys()].filter((k) => k.endsWith(` > ${i}`));
47346
- return all.length > 0 && all.every((i) => {
47347
- const ks = keys(i);
47348
- return ks.length > 0 && ks.every((k) => eq2(b.get(k), h.get(k)));
47349
- });
47350
- }
47351
- async function subtractBase(ctx, api, checks, tests, changed, wall, rel, signal, zeroOk = true, zeroIntake = zeroGate(null), dep = new Set) {
47495
+ async function subtractBase(ctx, api, checks, tests, changed, wall, rel, signal, zeroOk = true, zeroIntake = zeroGate(null), dep = new Set, own = rel) {
47352
47496
  const out2 = { ids: [], names: [], knownRed: [], sameError: [], weak: [], zero: [], cnt: {} };
47353
47497
  const pairs = checks.flatMap((c) => {
47354
47498
  const t = tests.find((x) => testCheckName(x) === c.name);
@@ -47405,7 +47549,7 @@ async function subtractBase(ctx, api, checks, tests, changed, wall, rel, signal,
47405
47549
  const progress = checks.some((c) => wall.has(c.name) && c.result === "pass") || sus.some(({ c }) => !out2.weak.includes(c.name) && base2.get(c).red.length > 0 && (c.n ?? 0) >= base2.get(c).n);
47406
47550
  {
47407
47551
  for (const { c } of un) {
47408
- if (rel.has(c.name) || c.result !== "fail" || !c.ids?.length || !c.ids.every((i) => base2.get(c)?.red.includes(i)))
47552
+ if (own.has(c.name) || c.result !== "fail" || !c.ids?.length || !comparableIds(c.ids).every((i) => base2.get(c)?.red.includes(i)))
47409
47553
  continue;
47410
47554
  out2.knownRed.push(c.name);
47411
47555
  if (sameErrors(headErrors.get(c) ?? "", base2.get(c).out, c.ids))
@@ -47472,7 +47616,7 @@ async function runLintChecks(ctx, changed, signal, checks, opts = {}) {
47472
47616
  }
47473
47617
  return pre;
47474
47618
  }
47475
- var CHECK_TIMEOUT_MS = 60000, excerpts, suites, failTails, headErrors, WALL_FAILURE_TAIL_CAP = 16384, wallTailOf = (out2, repoDir) => redactSecrets(stripAnsi(out2).replace(/\r/g, "").split(repoDir.replace(/\/+$/, "") + "/").join("")).slice(-WALL_FAILURE_TAIL_CAP), isHold = (c) => isHoldoutCheck(c.name), pubHold = (c) => ({ name: "holdout", cmd: "holdout", result: c.result, duration_s: c.duration_s, ...c.n !== undefined ? { n: c.n } : {}, ...c.sk !== undefined ? { sk: c.sk } : {}, ...c.owner ? { owner: c.owner, reason: "holdout infrastructure failure" } : {} }), testCheckName = (t) => `${t.runner}:${t.path}`, dedupeTests = (tests) => [...new Map(tests.map((t) => [`${t.runner}:${t.path}`, t])).values()], verifyBatchOn = (env = process.env) => env["LOKI_E10_VERIFY_BATCH"] !== "0", BATCH_MIN = 2, UNHANDLED_RE, batchTimeoutMs = (files) => Math.max(CHECK_TIMEOUT_MS, Math.min(300000, files * 5000)), vitestFile = (t, c) => t.runner === "vitest" && c.cmd === "npx" && c.args.length === 4 && c.args[0] === "--no-install" && c.args[1] === "vitest" && c.args[2] === "run", feedsFixRound = (c, pre) => c.result === "fail" && !pre.names.includes(c.name) && !pre.sameError.includes(c.name) && !isHoldoutCheck(c.name), ESLINT_CONFIGS, excuseLint = (ctx, signal, c, tool, cmd2, prefix, cwd, rel, opts) => c.result !== "fail" || signal.aborted ? Promise.resolve(false) : staticPreExisting(tool, prefix, rel, { run: async (a, stdin) => {
47619
+ var CHECK_TIMEOUT_MS = 60000, excerpts, suites, failTails, headErrors, WALL_FAILURE_TAIL_CAP = 16384, wallTailOf = (out2, repoDir) => redactSecrets(stripAnsi(out2).replace(/\r/g, "").split(repoDir.replace(/\/+$/, "") + "/").join("")).slice(-WALL_FAILURE_TAIL_CAP), isHold = (c) => isHoldoutCheck(c.name), pubHold = (c) => ({ name: "holdout", cmd: "holdout", result: c.result, duration_s: c.duration_s, ...c.n !== undefined ? { n: c.n } : {}, ...c.sk !== undefined ? { sk: c.sk } : {}, ...c.owner ? { owner: c.owner, reason: "holdout infrastructure failure" } : {} }), testCheckName = (t) => `${t.runner}:${t.path}`, COLLATERAL_RED = "relevant test already failing on base, still failing the same tests (it imports a file the task names; capped, not blocking)", dedupeTests = (tests) => [...new Map(tests.map((t) => [`${t.runner}:${t.path}`, t])).values()], verifyBatchOn = (env = process.env) => env["LOKI_E10_VERIFY_BATCH"] !== "0", BATCH_MIN = 2, UNHANDLED_RE, batchTimeoutMs = (files) => Math.max(CHECK_TIMEOUT_MS, Math.min(300000, files * 5000)), vitestFile = (t, c) => t.runner === "vitest" && c.cmd === "npx" && c.args.length === 4 && c.args[0] === "--no-install" && c.args[1] === "vitest" && c.args[2] === "run", feedsFixRound = (c, pre) => c.result === "fail" && !pre.names.includes(c.name) && !pre.sameError.includes(c.name) && !isHoldoutCheck(c.name), ESLINT_CONFIGS, excuseLint = (ctx, signal, c, tool, cmd2, prefix, cwd, rel, opts) => c.result !== "fail" || signal.aborted ? Promise.resolve(false) : staticPreExisting(tool, prefix, rel, { run: async (a, stdin) => {
47476
47620
  if (signal.aborted)
47477
47621
  return null;
47478
47622
  const r = await runOnce3(cmd2, a, cwd, AbortSignal.any([signal, AbortSignal.timeout(opts.timeoutMs ?? CHECK_TIMEOUT_MS)]), { ...opts, ...stdin !== undefined ? { stdin } : {} });
@@ -47500,6 +47644,9 @@ var init_verify = __esm(() => {
47500
47644
  init_load_owner();
47501
47645
  init_sizing();
47502
47646
  init_testmap();
47647
+ init_test_file_text();
47648
+ init_failures();
47649
+ init_failures();
47503
47650
  init_check_result();
47504
47651
  init_wall_owned();
47505
47652
  init_holdout();
@@ -47557,7 +47704,7 @@ var init_verify = __esm(() => {
47557
47704
  const changedTestFiles = map.tests.filter((t) => changed.includes(t.path));
47558
47705
  const wall = ctx.outputs().wall ?? {};
47559
47706
  const wallPaths = new Set((wall.files ?? []).map((f) => isAbsolute21(f.path) ? relative29(ctx.repoDir, f.path) : f.path));
47560
- const intake = ctx.outputs().intake, repoMap = loadRepoMap(intake?.repomap_ref), relevant2 = ctx.tests.impacted(map, namedFiles(intake?.task ?? "", repoMap));
47707
+ const intake = ctx.outputs().intake, repoMap = loadRepoMap(intake?.repomap_ref), named2 = namedFiles(intake?.task ?? "", repoMap), relevant2 = ctx.tests.impacted(map, named2);
47561
47708
  const recorded = new Map((wall.files ?? []).flatMap((f) => f.runner ? [[isAbsolute21(f.path) ? relative29(ctx.repoDir, f.path) : f.path, f.runner]] : []));
47562
47709
  const wallTests = [...wallPaths].flatMap((p) => {
47563
47710
  const rec2 = recorded.get(p), found = map.tests.find((t) => t.path === p && (!rec2 || t.runner === rec2));
@@ -47613,8 +47760,8 @@ var init_verify = __esm(() => {
47613
47760
  if (!decisive)
47614
47761
  await runTests(split2.rest);
47615
47762
  const complete = !decisive;
47616
- const pg = (ctx.outputs().verify?.failures_grouped ?? []).map((g2) => g2.signature), fs2 = (x) => x.startsWith("full suite") || x.startsWith("lint:"), same = (a, b) => a.length === b.length && a.every((x, i) => x === b[i]);
47617
- const settle = decisive && pg.some((x) => x.startsWith("full suite")) && same(pg.filter((x) => !fs2(x)).sort(), checks.filter((c) => c.result === "fail" && !isHold(c)).map((c) => failureSignature(c)).sort());
47763
+ const pg = (ctx.outputs().verify?.failures_grouped ?? []).map((g2) => g2.signature), fs2 = (x) => x.startsWith("full suite") || x.startsWith("lint:"), failSigs = (l) => [...new Set(l.filter((c) => c.result === "fail" && !fs2(c.name) && !isHoldoutCheck(c.name)).map((c) => failureSignature(c)))].sort(), same = (a, b) => a.length === b.length && a.every((x, i) => x === b[i]);
47764
+ const settle = decisive && pg.some((x) => x.startsWith("full suite")) && same(failSigs(ctx.outputs().verify?.checks ?? []), failSigs(checks.filter((c) => !isHold(c))));
47618
47765
  const hold = wall.holdout_dir ? stageHoldout(wall.holdout_dir, ctx.repoDir) : null;
47619
47766
  if (hold && !hold.missing.length)
47620
47767
  holdN = hold.tests.length;
@@ -47638,8 +47785,19 @@ var init_verify = __esm(() => {
47638
47785
  }
47639
47786
  const targetNames = new Set([...[...wallTests, ...relevant2].map(testCheckName), ...checks.filter(isHold).map((c) => c.name)]);
47640
47787
  const cfgChanged = [...new Set([...testConfigChanged(ctx.repoDir, ctx.baseSha, changed), ...hiddenConfigChanged(ctx.repoDir, ctx.outputs().intake?.hidden_cfg)])];
47641
- const preRed = await subtractBase(ctx, api, checks, tests, changed, new Set(wallTests.map(testCheckName)), new Set(relevant2.map(testCheckName)), signal, cfgChanged.length === 0, zeroGate(ctx.outputs().intake?.zero_baseline), depNames);
47642
- const attr = attribute(ctx.repoDir, ctx.baseSha, checks.filter((c) => c.result === "fail" && !preRed.names.includes(c.name)).map((c) => ({ name: c.name, ids: c.ids, eligible: !targetNames.has(c.name) && !changed.includes(c.name.slice(c.name.indexOf(":") + 1)) })));
47788
+ const collateral = new Set(collateralTests(relevant2, named2).map(testCheckName)), ownRel = new Set([...relevant2.map(testCheckName)].filter((n3) => !collateral.has(n3)));
47789
+ const preRed = await subtractBase(ctx, api, checks, tests, changed, new Set(wallTests.map(testCheckName)), new Set(relevant2.map(testCheckName)), signal, cfgChanged.length === 0, zeroGate(ctx.outputs().intake?.zero_baseline), depNames, ownRel);
47790
+ const fixRounds = Number(ctx.outputs().fix?.round ?? 0) || 0, collateralSame = preRed.sameError.filter((n3) => collateral.has(n3) && !preRed.names.includes(n3));
47791
+ const collateralRed = fixRounds >= 1 ? collateralSame : [];
47792
+ if (collateralRed.length) {
47793
+ preRed.names.push(...collateralRed);
47794
+ preRed.ids.push(...checks.filter((c) => collateralRed.includes(c.name)).flatMap((c) => c.ids ?? []));
47795
+ }
47796
+ const suiteOf = (name) => {
47797
+ const t = tests.find((x) => testCheckName(x) === name), pkg = t ? api?.packageOf(t.path) : null;
47798
+ return pkg?.commands.test ? `full suite: ${pkg.name}` : undefined;
47799
+ };
47800
+ const attr = attribute(ctx.repoDir, ctx.baseSha, checks.filter((c) => c.result === "fail" && !preRed.names.includes(c.name)).map((c) => ({ name: c.name, ids: c.ids, eligible: !targetNames.has(c.name) && !changed.includes(c.name.slice(c.name.indexOf(":") + 1)), ...suiteOf(c.name) && preRed.sameError.includes(c.name) ? { suite: suiteOf(c.name) } : {} })));
47643
47801
  attr.introducedChecks = [...new Set(attr.introducedChecks.map((n3) => isHoldoutCheck(n3) ? "holdout" : n3))];
47644
47802
  preRed.names.push(...attr.preExistingChecks);
47645
47803
  preRed.ids.push(...attr.preExistingIds);
@@ -47683,7 +47841,7 @@ var init_verify = __esm(() => {
47683
47841
  }
47684
47842
  const known = new Set(checks.filter((c) => c.result === "fail" && (preRed.sameError.includes(c.name) || wallNames0.has(c.name))).flatMap((c) => c.ids ?? []));
47685
47843
  for (const c of full)
47686
- if (c.result === "fail" && c.ids?.length && c.ids.every((i) => known.has(i)) && !preRed.names.includes(c.name)) {
47844
+ if (c.result === "fail" && c.ids?.length && !c.unhandled?.length && comparableIds(c.ids).every((i) => known.has(i)) && !preRed.names.includes(c.name)) {
47687
47845
  preRed.knownRed.push(c.name);
47688
47846
  preRed.sameError.push(c.name);
47689
47847
  }
@@ -47706,7 +47864,7 @@ var init_verify = __esm(() => {
47706
47864
  const covered = (f) => ctx.tests.impacted(map, [f]).some((t) => checks.some((c) => c.name === testCheckName(t) && hasExecutedProof([c])));
47707
47865
  const uncoveredChanged = changed.filter((f) => CODE_FILE_EXT.test(f) && !isTestFile(f) && !wallPaths.has(f) && !cfgChanged.includes(f) && !covered(f));
47708
47866
  const flaky = checks.filter((c) => c.result === "flaky").map((c) => isHold(c) ? "holdout" : c.name);
47709
- const { groups: failuresGrouped, names: blockingNames } = briefGroups(checks.filter((c) => feedsFixRound(c, preRed)), (c) => excerpts.get(c) ?? "", (c) => suites.has(c), EXCERPT_TOTAL_CAP, qs && !complete ? { prev: ctx.outputs().verify, ran: new Set(checks.map((c) => c.name)) } : undefined);
47867
+ const { groups: failuresGrouped, names: blockingNames } = briefGroups(checks.filter((c) => feedsFixRound(c, preRed) || fixRounds === 0 && collateralSame.includes(c.name)), (c) => excerpts.get(c) ?? "", (c) => suites.has(c), EXCERPT_TOTAL_CAP, qs && !complete ? { prev: ctx.outputs().verify, ran: new Set(checks.map((c) => c.name)) } : undefined);
47710
47868
  const pub = checks.map((c) => isHold(c) ? pubHold(c) : c), holdoutFailed = checks.filter((c) => c.result === "fail" && isHold(c) && !preRed.names.includes(c.name)).length;
47711
47869
  const inBase = (f) => {
47712
47870
  try {
@@ -47723,12 +47881,12 @@ var init_verify = __esm(() => {
47723
47881
  testCounts[t.path] = k;
47724
47882
  return [`weakened test: ${t.path}`, ...assertDeltaNotes(ctx.repoDir, ctx.baseSha, null, t.path, intake?.task ?? "", k?.b, k?.h) ?? []];
47725
47883
  });
47726
- const weakened = [...modifiedRel, ...cfgChanged.map((f) => `test configuration changed: ${f}`), ...preRed.weak.map((n3) => `skipped or fewer tests than base: ${n3}`)];
47884
+ const weakened = [...modifiedRel, ...cfgChanged.map((f) => `test configuration changed: ${f}`), ...preRed.weak.map((n3) => `skipped or fewer tests than base: ${n3}`), ...collateralRed.map((n3) => `${COLLATERAL_RED}: ${n3}`)];
47727
47885
  const notProven = [...complete ? [] : [QUICK_ONLY_NOTE], ...weakened, ...hiddenEdits(ctx.repoDir), ...ignoreRuleChanges(ctx.repoDir, intake?.ignore_snapshot, ctx.baseSha), ...dependentNotes(dep), ...intake?.deps_not_proven ?? [], ...pub.filter((c) => c.name === "holdout" && c.result !== "pass").map((c) => c.result === "not_run" ? "holdout not executed" : "holdout check failed"), ...[...fullNotProven].filter((n3) => !naNote(n3)), ...pub.filter((c) => c.owner === "harness" && c.name !== "holdout").map((c) => `${c.reason} (${c.name}; harness-owned, no fix rounds)`), ...new Set(checks.filter((c) => c.interpreter === "system" && c.result !== "not_run").map((c) => c.name.startsWith("lint:") ? "lint ran on the system ruff" : "tests ran on the system interpreter"))];
47728
47886
  const wallDropped = [...wallPaths].filter((p) => !wallTests.some((t) => t.path === p));
47729
47887
  notProven.push(...wallDropped.map((p) => `Wall test not executed: ${p}: ${NO_RUNNER_REASON}`));
47730
47888
  const wallNames = new Set(wallTests.map(testCheckName)), wallRun = checks.filter((c) => wallNames.has(c.name) || isHold(c)), wallFailTail = writeWallFailureTail(ctx.runDir, checks.filter((c) => wallNames.has(c.name) && c.result === "fail" && !isHold(c) && !preRed.names.includes(c.name)).map((c) => ({ name: c.name, out: failTails.get(c) ?? "" }))), wallPassed = wallRun.some((c) => c.result === "fail") ? false : wallRun.length > 0 && wallDropped.length === 0 && wallRun.every((c) => c.result === "pass") ? true : undefined;
47731
- return { status: "completed", data: { checks: pub, flaky, verify_scope: complete ? "complete" : "quick", file_hashes: hashes, blocking_checks: blockingNames, ...wallFailTail ? { wall_failure_tail: wallFailTail } : {}, ...wallPassed === undefined ? {} : { wall_passed: wallPassed }, failures_grouped: failuresGrouped, holdout_failed: holdoutFailed, changed_files: changed, ...depNames.size ? { dependent_checks: [...depNames] } : {}, not_proven: notProven, ...fullNotProven.size ? { not_applicable: [...fullNotProven].filter(naNote).map(naText) } : {}, pre_red: preRed.ids, pre_red_checks: preRed.names, ...preRed.knownRed.length ? { known_red_checks: preRed.knownRed } : {}, ...preRed.sameError.length ? { known_red_same_error: preRed.sameError } : {}, skipped_on_base: preRed.zero, ...attr.line ? { baseline_line: attr.line, introduced_checks: attr.introducedChecks } : {}, test_counts: testCounts, uncovered_changed: uncoveredChanged, target_checks: checks.filter((c) => c.result === "pass" && targetNames.has(c.name)).map((c) => isHold(c) ? "holdout" : c.name), risk } };
47889
+ return { status: "completed", data: { checks: pub, flaky, verify_scope: complete ? "complete" : "quick", file_hashes: hashes, blocking_checks: blockingNames, ...wallFailTail ? { wall_failure_tail: wallFailTail } : {}, ...wallPassed === undefined ? {} : { wall_passed: wallPassed }, failures_grouped: failuresGrouped, holdout_failed: holdoutFailed, changed_files: changed, ...depNames.size ? { dependent_checks: [...depNames] } : {}, not_proven: notProven, ...fullNotProven.size ? { not_applicable: [...fullNotProven].filter(naNote).map(naText) } : {}, pre_red: preRed.ids, pre_red_checks: preRed.names, ...preRed.knownRed.length ? { known_red_checks: preRed.knownRed } : {}, ...preRed.sameError.length ? { known_red_same_error: preRed.sameError } : {}, skipped_on_base: preRed.zero, ...collateralSame.length && fixRounds === 0 ? { collateral_same_error: collateralSame } : {}, ...attr.line ? { baseline_line: attr.line, introduced_checks: attr.introducedChecks } : {}, test_counts: testCounts, uncovered_changed: uncoveredChanged, target_checks: checks.filter((c) => c.result === "pass" && targetNames.has(c.name)).map((c) => isHold(c) ? "holdout" : c.name), risk } };
47732
47890
  }
47733
47891
  };
47734
47892
  stage9 = verifyStage;
@@ -88689,6 +88847,7 @@ __export(exports_providers, {
88689
88847
  engine10StaticPrefix: () => engine10StaticPrefix,
88690
88848
  engine10CacheTtlEnv: () => engine10CacheTtlEnv,
88691
88849
  emitSdkDegradationEvent: () => emitSdkDegradationEvent,
88850
+ compactWindowSettings: () => compactWindowSettings,
88692
88851
  closeQueryOnResult: () => closeQueryOnResult,
88693
88852
  claudeTierToModel: () => claudeTierToModel,
88694
88853
  claudeProvider: () => claudeProvider,
@@ -88863,6 +89022,9 @@ function hostGuardSettingsJson() {
88863
89022
  }
88864
89023
  });
88865
89024
  }
89025
+ function compactWindowSettings(model, routed = false) {
89026
+ return isHaikuModel(model) || routed && !hasNoPriceCliff(model) ? { autoCompactWindow: ROUTER_AUTO_COMPACT_WINDOW } : undefined;
89027
+ }
88866
89028
  function bundledClaudeCodeVersion2() {
88867
89029
  return SDK_BUNDLED_CLAUDE_CODE;
88868
89030
  }
@@ -88899,7 +89061,7 @@ function planRouterSession(args) {
88899
89061
  .../sonnet/i.test(args.model) ? { effort: ROUTER_SONNET_ADVISOR_EFFORT } : {},
88900
89062
  settings: {
88901
89063
  advisorModel: ROUTER_ADVISOR_MODEL,
88902
- ...hasNoPriceCliff(args.model) ? {} : { autoCompactWindow: ROUTER_AUTO_COMPACT_WINDOW }
89064
+ ...compactWindowSettings(args.model, true)
88903
89065
  }
88904
89066
  };
88905
89067
  }
@@ -88940,6 +89102,8 @@ function claudeProvider() {
88940
89102
  claudeCodeVersion: await installedClaudeCodeVersion(cli)
88941
89103
  }) : null;
88942
89104
  const model = routed ? routed.model : baseModel;
89105
+ const window = compactWindowSettings(model);
89106
+ const sessionSettings = routed?.settings || window ? { ...window, ...routed?.settings } : undefined;
88943
89107
  const modelArgv = useProviderDefaultModel(call) ? [] : ["--model", model];
88944
89108
  await ensureClaudeHelpCache();
88945
89109
  const hostGuard2 = hostGuardRequired(call.cwd);
@@ -88968,7 +89132,7 @@ function claudeProvider() {
88968
89132
  ...modelArgv,
88969
89133
  ...autoFlags,
88970
89134
  ...sessionArgv,
88971
- ...hostGuard2 || routed?.settings || fence2 ? ["--settings", cliSettingsJson(hostGuard2, routed?.settings, fence2)] : [],
89135
+ ...hostGuard2 || sessionSettings || fence2 ? ["--settings", cliSettingsJson(hostGuard2, sessionSettings, fence2)] : [],
88972
89136
  "-p",
88973
89137
  call.prompt
88974
89138
  ];
@@ -89035,6 +89199,9 @@ function buildSdkLoopOptions(args) {
89035
89199
  if (router.settings)
89036
89200
  out2.settings = router.settings;
89037
89201
  }
89202
+ const window = compactWindowSettings(out2.model ?? args.model);
89203
+ if (window)
89204
+ out2.settings = { ...window, ...out2.settings };
89038
89205
  const fence2 = implementWriteFence();
89039
89206
  if (fence2)
89040
89207
  out2.settings = { ...out2.settings, ...fence2 };
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
3
  "name": "loki-mode",
4
4
  "displayName": "Loki Mode",
5
- "version": "11.126.0",
5
+ "version": "11.127.0",
6
6
  "description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
7
7
  "author": {
8
8
  "name": "Autonomi",