xovris 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,18 +1,18 @@
1
- import { F as guardStrip, G as leaveBy, J as reviewChange, K as forAgents, M as commandRunner, N as undoFixes, R as valueCopy, S as revertOne, W as handOff, X as readsForShape, Y as stackChain, Z as testsFirst, at as probeNames, ct as parseDiff, et as refreshDeprecations, it as assumptionsOf, nt as dirReader, ot as readingsOf, q as readsForReview, rt as workOut, st as newFileDiff, x as fixAll, z as applyGuarded } from "./src-CwHd09_C.js";
1
+ import { F as guardStrip, G as leaveBy, J as reviewChange, K as forAgents, M as commandRunner, N as undoFixes, R as valueCopy, S as revertOne, W as handOff, X as readsForShape, Y as stackChain, Z as testsFirst, at as notSource, ct as readingsOf, et as refreshDeprecations, it as diskReader, lt as newFileDiff, nt as dirReader, ot as assumptionsOf, q as readsForReview, rt as workOut, st as probeNames, ut as parseDiff, x as fixAll, z as applyGuarded } from "./src-rd6qFkYx.js";
2
2
  import { a as whoami, c as Cancelled, d as ApiFailure, f as CLI_AGENT, l as clackUi, n as login, o as writeFileAtomic, p as CLI_VERSION, r as logout, s as signIn, t as apiCommand, u as Api } from "./apicmd-jzeA2Hy4.js";
3
- import { a as gatedWriteFile, i as gatedWrite, n as gatedRun, t as MANIFEST_FILES } from "./gated-write-CyonzzSN.js";
4
- import { i as splitCommandLine, n as collectorAt, r as joinCollector, t as addExporter } from "./collector-join-CNyz1iZg.js";
5
- import { a as reviewSarif, i as reviewJson, n as progressLine, r as renderReview, s as styleFor, t as leftToFix } from "./review-ui-vvkzuC1G.js";
3
+ import { a as gatedWriteFile, i as gatedWrite, n as gatedRun, t as MANIFEST_FILES } from "./gated-write-CNydv7sO.js";
4
+ import { i as splitCommandLine, n as collectorAt, r as joinCollector, t as addExporter } from "./collector-join-BjZOhGDm.js";
5
+ import { a as reviewSarif, i as reviewJson, n as progressLine, r as renderReview, s as styleFor, t as leftToFix } from "./review-ui-C4CMb6hf.js";
6
6
  import { builtinModules } from "node:module";
7
7
  import { mkdir, mkdtemp, readFile, readdir, rm, stat, unlink, writeFile } from "node:fs/promises";
8
8
  import { homedir, tmpdir } from "node:os";
9
9
  import { basename, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
10
10
  import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
11
11
  import { createHash, createPublicKey, verify } from "node:crypto";
12
- import { createTwoFilesPatch } from "diff";
13
- import { pathToFileURL } from "node:url";
14
12
  import { resolveCname, resolveMx, resolveNs } from "node:dns/promises";
15
13
  import { spawn } from "node:child_process";
14
+ import { pathToFileURL } from "node:url";
15
+ import { createTwoFilesPatch } from "diff";
16
16
  import { parse } from "@babel/parser";
17
17
 
18
18
  //#region ../stacks/src/data/install-tests.ts
@@ -4564,27 +4564,18 @@ async function post(api, sys, path, body) {
4564
4564
  data: await res.json().catch(() => null)
4565
4565
  };
4566
4566
  }
4567
- const SKIP_DIRS = new Set([
4568
- "node_modules",
4569
- ".git",
4570
- "dist",
4571
- "build",
4572
- "out",
4573
- ".next",
4574
- ".xovris",
4575
- "coverage"
4576
- ]);
4577
4567
  /** Every file below cwd with this name, as forward-slash paths, nearest first. */
4578
4568
  async function filesNamed(cwd, name, depth = 6) {
4579
4569
  const { readdir: readdir$1 } = await import("node:fs/promises");
4580
4570
  const found = [];
4571
+ const skip = notSource(diskReader(cwd));
4581
4572
  let level = [""];
4582
4573
  for (let d = 0; d <= depth && level.length; d++) {
4583
4574
  const next = [];
4584
4575
  for (const rel of level) for (const e of await readdir$1(join(cwd, rel), { withFileTypes: true }).catch(() => [])) {
4585
4576
  const p = rel ? `${rel}/${e.name}` : e.name;
4586
4577
  if (e.isFile() && e.name === name) found.push(p);
4587
- else if (e.isDirectory() && !SKIP_DIRS.has(e.name)) next.push(p);
4578
+ else if (e.isDirectory() && !skip(rel, e.name)) next.push(p);
4588
4579
  }
4589
4580
  level = next.sort();
4590
4581
  }
@@ -6254,31 +6245,6 @@ const META_CODEMODS = {
6254
6245
 
6255
6246
  //#endregion
6256
6247
  //#region src/relocate.ts
6257
- /** Folders never searched: installed packages, build output and tool state hold no app of the person's own. */
6258
- const SKIP = new Set([
6259
- "node_modules",
6260
- ".git",
6261
- "bin",
6262
- "obj",
6263
- "dist",
6264
- "build",
6265
- "out",
6266
- "target",
6267
- "vendor",
6268
- "coverage",
6269
- ".next",
6270
- ".nuxt",
6271
- ".angular",
6272
- ".xovris",
6273
- ".venv",
6274
- "venv",
6275
- "__pycache__",
6276
- ".gradle",
6277
- ".idea",
6278
- ".vs",
6279
- "tmp",
6280
- "log"
6281
- ]);
6282
6248
  const has = (dir, p) => existsSync(join(dir, p));
6283
6249
  /** What makes a folder the app each refusal asked for - the same tests the wizard's own preflight applies. */
6284
6250
  const HOLDS = {
@@ -6304,6 +6270,7 @@ async function appFolders(cwd, kind, o = {}) {
6304
6270
  const depth = o.depth ?? 4;
6305
6271
  const limit = o.limit ?? 12;
6306
6272
  const found = [];
6273
+ const skip = notSource(diskReader(cwd));
6307
6274
  let level = [""];
6308
6275
  for (let d = 0; d <= depth && level.length && found.length < limit; d++) {
6309
6276
  const next = [];
@@ -6314,7 +6281,7 @@ async function appFolders(cwd, kind, o = {}) {
6314
6281
  found.push(rel);
6315
6282
  continue;
6316
6283
  }
6317
- for (const e of entries) if (e.isDirectory() && !SKIP.has(e.name) && !e.name.startsWith(".")) next.push(rel ? `${rel}/${e.name}` : e.name);
6284
+ for (const e of entries) if (e.isDirectory() && !skip(rel, e.name) && !e.name.startsWith(".")) next.push(rel ? `${rel}/${e.name}` : e.name);
6318
6285
  }
6319
6286
  level = next.sort();
6320
6287
  }
@@ -11840,7 +11807,7 @@ async function main(argv) {
11840
11807
  }, ui, sys, secrets, io), ui);
11841
11808
  case "logout": return logout(io);
11842
11809
  case "sourcemaps": {
11843
- const { sayUpload, uploadSourceMaps } = await import("./sourcemaps-BgD4TTSB.js");
11810
+ const { sayUpload, uploadSourceMaps } = await import("./sourcemaps-BzBFgNBd.js");
11844
11811
  const dir = positional[1] ?? "dist";
11845
11812
  let isDir$2 = false;
11846
11813
  try {
@@ -11956,7 +11923,7 @@ async function main(argv) {
11956
11923
  case "receipt": return guarded(() => receiptCommand(positional[1], positional[2], value("--key"), ui, sys), ui);
11957
11924
  case "verify": return guarded(() => verify$1(o, ui, sys, secrets, true), ui);
11958
11925
  case "secrets": {
11959
- const { secretsCommand } = await import("./secrets-scan-EX_yKKLG.js");
11926
+ const { secretsCommand } = await import("./secrets-scan-gM8VjxIz.js");
11960
11927
  return secretsCommand({
11961
11928
  cwd: o.cwd,
11962
11929
  installHook: flag("--install-hook"),
@@ -11994,7 +11961,7 @@ async function main(argv) {
11994
11961
  stack: flag("--stack")
11995
11962
  }, sys, io.out);
11996
11963
  case "merge": {
11997
- const { mergeCommand } = await import("./merge-JbPzZY-_.js");
11964
+ const { mergeCommand } = await import("./merge-COtybHO5.js");
11998
11965
  return mergeCommand({
11999
11966
  cwd: o.cwd,
12000
11967
  entries: positional.slice(1),
@@ -12007,7 +11974,7 @@ async function main(argv) {
12007
11974
  }
12008
11975
  case "tests":
12009
11976
  case "touches": {
12010
- const f = await import("./finishing-CumRayPn.js");
11977
+ const f = await import("./finishing-wrFCjXDY.js");
12011
11978
  const fo = {
12012
11979
  cwd: o.cwd,
12013
11980
  module: positional[1] ?? "",
@@ -12017,7 +11984,7 @@ async function main(argv) {
12017
11984
  };
12018
11985
  return command === "tests" ? f.testsCommand(fo, io.out) : f.touchesCommand(fo, io.out);
12019
11986
  }
12020
- case "resolve": return (await import("./finishing-CumRayPn.js")).resolveCommand({
11987
+ case "resolve": return (await import("./finishing-wrFCjXDY.js")).resolveCommand({
12021
11988
  cwd: o.cwd,
12022
11989
  module: "",
12023
11990
  files: positional.slice(1),
@@ -12026,7 +11993,7 @@ async function main(argv) {
12026
11993
  test: many("--test", "--test")
12027
11994
  }, io.out);
12028
11995
  case "hunt": {
12029
- const { huntCommand } = await import("./hunt-dH6Zd4Cr.js");
11996
+ const { huntCommand } = await import("./hunt-CYYHRwWv.js");
12030
11997
  return huntCommand({
12031
11998
  cwd: positional[1] ?? o.cwd,
12032
11999
  env: process.env,
@@ -12046,7 +12013,7 @@ async function main(argv) {
12046
12013
  }, sys, io);
12047
12014
  }
12048
12015
  case "findings": {
12049
- const { findingsCommand } = await import("./findings-C_FlMyHx.js");
12016
+ const { findingsCommand } = await import("./findings-BtzgYxvr.js");
12050
12017
  const read$1 = {
12051
12018
  severity: value("--severity"),
12052
12019
  category: value("--category"),
@@ -12071,7 +12038,7 @@ async function main(argv) {
12071
12038
  }, { api: o.api }, sys, secrets, io);
12072
12039
  }
12073
12040
  case "sbom": {
12074
- const { sbomCommand } = await import("./sbom-zzUYlMbe.js");
12041
+ const { sbomCommand } = await import("./sbom-CWicm679.js");
12075
12042
  return sbomCommand({
12076
12043
  cwd: positional[1] ?? o.cwd,
12077
12044
  ...value("--live") ? { live: value("--live") } : {},
@@ -12081,7 +12048,7 @@ async function main(argv) {
12081
12048
  });
12082
12049
  }
12083
12050
  case "languages": {
12084
- const { languagesCommand } = await import("./languages-DiBnBghs.js");
12051
+ const { languagesCommand } = await import("./languages-aTxaLh9R.js");
12085
12052
  return languagesCommand({
12086
12053
  gaps: flag("--gaps"),
12087
12054
  json: flag("--json"),
@@ -12089,7 +12056,7 @@ async function main(argv) {
12089
12056
  });
12090
12057
  }
12091
12058
  case "trace": {
12092
- const { traceCommand } = await import("./trace-BeldSC9Q.js");
12059
+ const { traceCommand } = await import("./trace-Cj7EipNd.js");
12093
12060
  return traceCommand({
12094
12061
  cwd: o.cwd,
12095
12062
  fix: flag("--fix"),
@@ -1,4 +1,4 @@
1
- import { r as gatedService } from "./gated-write-CyonzzSN.js";
1
+ import { r as gatedService } from "./gated-write-CNydv7sO.js";
2
2
  import { readFile, writeFile } from "node:fs/promises";
3
3
  import { isAbsolute, resolve } from "node:path";
4
4
  import { existsSync } from "node:fs";
@@ -1,4 +1,4 @@
1
- import { c as FACET_AXES, l as checkFacetQuery, lt as SEVERITIES, o as EFFORTS, s as EFFORT_UNMEASURED } from "./src-CwHd09_C.js";
1
+ import { c as FACET_AXES, dt as SEVERITIES, l as checkFacetQuery, o as EFFORTS, s as EFFORT_UNMEASURED } from "./src-rd6qFkYx.js";
2
2
  import { i as tokenFor, u as Api } from "./apicmd-jzeA2Hy4.js";
3
3
 
4
4
  //#region src/findings.ts
@@ -1,4 +1,4 @@
1
- import { B as jobRunner, I as writeProven, L as contentDigest, d as generateTests, f as proveResolution, p as touchesFor, u as applyTouches } from "./src-CwHd09_C.js";
1
+ import { B as jobRunner, I as writeProven, L as contentDigest, d as generateTests, f as proveResolution, p as touchesFor, u as applyTouches } from "./src-rd6qFkYx.js";
2
2
  import { isAbsolute, join, relative, resolve } from "node:path";
3
3
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
4
  import { execFileSync } from "node:child_process";
@@ -1,4 +1,4 @@
1
- import { I as writeProven, L as contentDigest, P as filesOf, R as valueCopy, z as applyGuarded } from "./src-CwHd09_C.js";
1
+ import { I as writeProven, L as contentDigest, P as filesOf, R as valueCopy, z as applyGuarded } from "./src-rd6qFkYx.js";
2
2
  import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { basename, dirname, join, relative, resolve, sep } from "node:path";
@@ -1,5 +1,5 @@
1
- import { n as HUNT_CLASSES, t as huntRepository } from "./src-CwHd09_C.js";
2
- import { o as stripAnsi, s as styleFor } from "./review-ui-vvkzuC1G.js";
1
+ import { n as HUNT_CLASSES, t as huntRepository } from "./src-rd6qFkYx.js";
2
+ import { o as stripAnsi, s as styleFor } from "./review-ui-C4CMb6hf.js";
3
3
  import { resolve } from "node:path";
4
4
  import { existsSync, statSync } from "node:fs";
5
5
 
@@ -12,7 +12,8 @@ function renderHunt(r, o) {
12
12
  for (const f of r.findings) by.set(f.class, [...by.get(f.class) ?? [], f]);
13
13
  const langs = r.languages.length ? r.languages.join(", ") : "no language the hunt reads";
14
14
  lines.push(r.findings.length ? `${paint(o.colour, "1;31", `${r.findings.length} ${r.findings.length === 1 ? "fault" : "faults"} found`)} in ${r.files} files (${langs}) - ${[...by].map(([c, fs]) => `${c.replace("_", " ")} ${fs.length}`).join(", ")} - ${r.ms} ms` : `${paint(o.colour, "1;32", "No fault found")} in ${r.files} files (${langs}) - ${r.ms} ms`);
15
- for (const c of HUNT_CLASSES) for (const f of by.get(c) ?? []) {
15
+ const written = HUNT_CLASSES;
16
+ for (const c of [...written, ...[...by.keys()].filter((k) => !written.includes(k))]) for (const f of by.get(c) ?? []) {
16
17
  lines.push("", `${paint(o.colour, "1", f.title)} ${paint(o.colour, "36", `${f.file}:${f.line}`)} ${paint(o.colour, "2", `${f.class} - ${f.language}`)}`);
17
18
  lines.push(` ${f.why}`, ` ${f.harm}`, ` To see it happen: ${f.reproduce}`);
18
19
  if (f.path.length > 1) lines.push(` Reached by: ${f.path.join(" <- ")}`);
@@ -33,15 +34,13 @@ async function huntCommand(o, out) {
33
34
  }
34
35
  const wanted = (o.classes ?? []).map((c) => c.trim()).filter(Boolean);
35
36
  const unknown = wanted.filter((c) => !HUNT_CLASSES.includes(c));
36
- if (unknown.length) {
37
- out(`${unknown.join(", ")} ${unknown.length === 1 ? "is not a class" : "are not classes"} the hunt reads, so nothing was read. The classes are: ${HUNT_CLASSES.join(", ")}.\n`);
38
- return 2;
39
- }
37
+ const known = wanted.filter((c) => !unknown.includes(c));
38
+ if (unknown.length) out(`${unknown.join(", ")} ${unknown.length === 1 ? "is" : "are"} read by Xovris's open hunt from your own words wherever a reader is attached (the hunt in the app, or through the API); this terminal's written rules read ${known.length ? known.join(", ") : "every class they hold"} now.\n`);
40
39
  let r;
41
40
  const servers = process.env["VITEST"] === void 0 ? {} : null;
42
41
  try {
43
42
  r = await huntRepository(root, {
44
- ...wanted.length ? { classes: wanted } : {},
43
+ ...known.length ? { classes: known } : {},
45
44
  ...o.env.XOVRIS_WORLD_GRAMMARS === "off" ? {} : { world: {} },
46
45
  servers
47
46
  });
@@ -1,4 +1,4 @@
1
- import { tt as census } from "./src-CwHd09_C.js";
1
+ import { tt as census } from "./src-rd6qFkYx.js";
2
2
 
3
3
  //#region src/languages.ts
4
4
  const TYPES = [
@@ -1,6 +1,6 @@
1
- import { a as runMergeQueue, i as queueOrder, nt as dirReader, r as gitQueueRepo, rt as workOut } from "./src-CwHd09_C.js";
2
- import "./gated-write-CyonzzSN.js";
3
- import { i as splitCommandLine } from "./collector-join-CNyz1iZg.js";
1
+ import { a as runMergeQueue, i as queueOrder, nt as dirReader, r as gitQueueRepo, rt as workOut } from "./src-rd6qFkYx.js";
2
+ import "./gated-write-CNydv7sO.js";
3
+ import { i as splitCommandLine } from "./collector-join-BjZOhGDm.js";
4
4
 
5
5
  //#region src/merge.ts
6
6
  async function mergeCommand(o, sys, out) {
@@ -1,4 +1,4 @@
1
- import { lt as SEVERITIES, ut as SEVERITY_LABEL } from "./src-CwHd09_C.js";
1
+ import { dt as SEVERITIES, ft as SEVERITY_LABEL } from "./src-rd6qFkYx.js";
2
2
 
3
3
  //#region src/review-ui.ts
4
4
  /** Colour only for a person at a terminal that asked for none of the plain modes (no-color.org; CI is never a terminal). */
@@ -1,4 +1,4 @@
1
- import { H as osvAdvisories, U as dependenciesIn, V as npmDependencies, _ as spdxOf, b as withLicences, g as sbomOf, h as lockOfBom, m as HOSTING_FILES, ot as readingsOf, v as spdxTagValue, y as lockfilesIn } from "./src-CwHd09_C.js";
1
+ import { H as osvAdvisories, U as dependenciesIn, V as npmDependencies, _ as spdxOf, b as withLicences, ct as readingsOf, g as sbomOf, h as lockOfBom, m as HOSTING_FILES, v as spdxTagValue, y as lockfilesIn } from "./src-rd6qFkYx.js";
2
2
  import { basename, dirname, join, relative, resolve } from "node:path";
3
3
  import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
4
4
 
@@ -1,4 +1,4 @@
1
- import { $ as secretFindings, Q as findSecrets, ct as parseDiff } from "./src-CwHd09_C.js";
1
+ import { $ as secretFindings, Q as findSecrets, ut as parseDiff } from "./src-rd6qFkYx.js";
2
2
  import { isAbsolute, join, relative, resolve } from "node:path";
3
3
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
4
4
  import { execFileSync } from "node:child_process";
@@ -1,5 +1,5 @@
1
- import "./src-CwHd09_C.js";
2
- import { i as gatedWrite } from "./gated-write-CyonzzSN.js";
1
+ import "./src-rd6qFkYx.js";
2
+ import { i as gatedWrite } from "./gated-write-CNydv7sO.js";
3
3
  import { basename, dirname, join, sep } from "node:path";
4
4
  import { readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
5
5
  import { createHash } from "node:crypto";
@@ -3,10 +3,10 @@ import { homedir, tmpdir } from "node:os";
3
3
  import { basename, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
4
4
  import { chmodSync, closeSync, cpSync, existsSync, fstatSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
5
5
  import { createHash, createPublicKey, randomUUID, verify } from "node:crypto";
6
- import { fileURLToPath, pathToFileURL } from "node:url";
7
6
  import { lookup } from "node:dns/promises";
8
7
  import { connect } from "node:tls";
9
8
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
9
+ import { fileURLToPath, pathToFileURL } from "node:url";
10
10
  import { AsyncLocalStorage } from "node:async_hooks";
11
11
  import { connect as connect$1, createServer } from "node:net";
12
12
  import { brotliDecompressSync, gunzipSync, inflateRawSync, inflateSync, zstdDecompressSync } from "node:zlib";
@@ -33378,6 +33378,152 @@ const LINGUIST = [
33378
33378
  }
33379
33379
  ];
33380
33380
 
33381
+ //#endregion
33382
+ //#region ../review/src/not-source.ts
33383
+ /** The former lists' union, kept for a repository with no ignore file of its own (OPEN, above) - every member still skipped there. */
33384
+ const NO_IGNORE_FILE = new Set([
33385
+ "node_modules",
33386
+ ".git",
33387
+ "bin",
33388
+ "obj",
33389
+ "dist",
33390
+ "build",
33391
+ "out",
33392
+ "target",
33393
+ "vendor",
33394
+ "third_party",
33395
+ "coverage",
33396
+ ".next",
33397
+ ".nuxt",
33398
+ ".angular",
33399
+ ".xovris",
33400
+ ".venv",
33401
+ "venv",
33402
+ "__pycache__",
33403
+ ".gradle",
33404
+ ".idea",
33405
+ ".vs",
33406
+ "tmp",
33407
+ "log"
33408
+ ]);
33409
+ const CACHE_SIGNATURE = "Signature: 8a477f597d28d172789f06886806bc55";
33410
+ /** A folder on this computer read as a repository: each path a file below it, or null. */
33411
+ const diskReader = (root) => ({ read: (p$1) => {
33412
+ try {
33413
+ return readFileSync(join(root, p$1), "utf8");
33414
+ } catch {
33415
+ return null;
33416
+ }
33417
+ } });
33418
+ const made = /* @__PURE__ */ new WeakMap();
33419
+ /** The one skip test of a reader, made once and kept with it. */
33420
+ const notSourceOf = (r) => {
33421
+ let s = made.get(r);
33422
+ if (!s) {
33423
+ s = notSource(r);
33424
+ made.set(r, s);
33425
+ }
33426
+ return s;
33427
+ };
33428
+ const escape$1 = (c) => c.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
33429
+ /** One line of an ignore file as git reads it (gitignore(5)): comments, `!` to take back, a slash anchoring it to its own folder, `*`, `?`,
33430
+ * `[...]` and `**`. Null for a line that names nothing. */
33431
+ function ignoreRule(line$1) {
33432
+ let s = line$1.replace(/\r$/, "").replace(/(?<!\\)\s+$/, "");
33433
+ if (!s || s.startsWith("#")) return null;
33434
+ const neg = s.startsWith("!");
33435
+ if (neg) s = s.slice(1);
33436
+ if (s.startsWith("\\")) s = s.slice(1);
33437
+ s = s.replace(/\/+$/, "");
33438
+ if (!s) return null;
33439
+ const anchored = s.includes("/");
33440
+ s = s.replace(/^\//, "");
33441
+ let re = "";
33442
+ for (let i = 0; i < s.length; i++) {
33443
+ const c = s[i];
33444
+ if (c === "*" && s[i + 1] === "*") if (s[i + 2] === "/") {
33445
+ re += "(?:.*/)?";
33446
+ i += 2;
33447
+ } else {
33448
+ re += ".*";
33449
+ i += 1;
33450
+ }
33451
+ else if (c === "*") re += "[^/]*";
33452
+ else if (c === "?") re += "[^/]";
33453
+ else if (c === "[") {
33454
+ const j = s.indexOf("]", i + 2);
33455
+ if (j < 0) re += "\\[";
33456
+ else {
33457
+ re += `[${s.slice(i + 1, j).replace(/^!/, "^").replace(/\\/g, "\\\\")}]`;
33458
+ i = j;
33459
+ }
33460
+ } else if (c === "\\" && i + 1 < s.length) {
33461
+ re += escape$1(s[i + 1]);
33462
+ i += 1;
33463
+ } else re += escape$1(c);
33464
+ }
33465
+ return {
33466
+ neg,
33467
+ re: /* @__PURE__ */ new RegExp(anchored ? `^${re}$` : `(?:^|/)${re}$`)
33468
+ };
33469
+ }
33470
+ /** The top folders a repository's own build files declare as their output - the TypeScript compiler's outDir and declarationDir, read from
33471
+ * tsconfig.json itself. A package manifest's main or types can name source (a workspace package's main is often src/index.ts), so it never
33472
+ * decides here. */
33473
+ function outputsDeclared(r) {
33474
+ const out = /* @__PURE__ */ new Set();
33475
+ const json$3 = (path$1) => {
33476
+ try {
33477
+ const t = r.read(path$1);
33478
+ return t === null ? null : JSON.parse(t.replace(/^\s*\/\/.*$/gm, ""));
33479
+ } catch {
33480
+ return null;
33481
+ }
33482
+ };
33483
+ const options = json$3("tsconfig.json")?.["compilerOptions"] ?? {};
33484
+ for (const k of ["outDir", "declarationDir"]) {
33485
+ const v = options[k];
33486
+ if (typeof v === "string") {
33487
+ const seg$1 = v.replace(/^\.\//, "").split("/")[0];
33488
+ if (seg$1 && seg$1 !== "." && seg$1 !== "..") out.add(seg$1);
33489
+ }
33490
+ }
33491
+ return out;
33492
+ }
33493
+ /** Whether a folder of the repository is not its source, and why - by the repository's own word. `dir` is the parent folder's path from the
33494
+ * root ('' for the root), `name` the folder's own name; null when it is source and is read. */
33495
+ function notSource(r) {
33496
+ const files = /* @__PURE__ */ new Map();
33497
+ let declared;
33498
+ const rulesAt = (folder) => {
33499
+ if (!files.has(folder)) {
33500
+ const text = r.read(folder ? `${folder}/.gitignore` : ".gitignore");
33501
+ files.set(folder, text === null ? null : text.split("\n").map(ignoreRule).filter((x) => x !== null));
33502
+ }
33503
+ return files.get(folder);
33504
+ };
33505
+ return (dir, name) => {
33506
+ if (name === ".git") return "git's own folder";
33507
+ const path$1 = dir ? `${dir}/${name}` : name;
33508
+ if ((r.read(`${path$1}/CACHEDIR.TAG`) ?? "").startsWith(CACHE_SIGNATURE)) return "it tags itself as a cache";
33509
+ if (r.read(`${path$1}/pyvenv.cfg`) !== null) return "it is a Python environment";
33510
+ if (rulesAt("") === null) {
33511
+ if (!dir && (declared ??= outputsDeclared(r)).has(name)) return "its own build files name it as their output";
33512
+ return NO_IGNORE_FILE.has(name) ? "third-party or built output, as the repository has no ignore file" : null;
33513
+ }
33514
+ let ignored = false;
33515
+ const parts$2 = dir ? dir.split("/") : [];
33516
+ for (let i = 0; i <= parts$2.length; i++) {
33517
+ const folder = parts$2.slice(0, i).join("/");
33518
+ const rules = rulesAt(folder);
33519
+ if (!rules) continue;
33520
+ const rel = folder ? path$1.slice(folder.length + 1) : path$1;
33521
+ for (const rule of rules) if (rule.re.test(rel)) ignored = !rule.neg;
33522
+ }
33523
+ return ignored ? "its own ignore file names it" : null;
33524
+ };
33525
+ }
33526
+
33381
33527
  //#endregion
33382
33528
  //#region ../review/src/method.ts
33383
33529
  const STEPS = [
@@ -33978,7 +34124,7 @@ function versionsOf(r, d = "") {
33978
34124
  const frameworks = /* @__PURE__ */ new Set();
33979
34125
  const walk$2 = (dir, left) => {
33980
34126
  for (const f of r.list(dir || ".")) {
33981
- if (SKIP$3.test(f) || f.startsWith(".")) continue;
34127
+ if (notSourceOf(r)(dir, f) || f.startsWith(".")) continue;
33982
34128
  const path$1 = p(dir, f);
33983
34129
  if (/\.(csproj|fsproj|vbproj)$/.test(f)) for (const m of (r.read(path$1) ?? "").matchAll(/<TargetFrameworks?>([^<]+)<\/TargetFrameworks?>/g)) for (const fw of m[1].split(";")) {
33984
34130
  const x = /^net(\d+)\.(\d+)/.exec(fw.trim());
@@ -34120,7 +34266,6 @@ function workOut(r, root = "", kept$2 = keptMethods()) {
34120
34266
  ...Object.keys(versions).length ? { versions } : {}
34121
34267
  };
34122
34268
  }
34123
- const SKIP$3 = /^(node_modules|vendor|dist|build|target|out|\.git|\.next|\.venv|venv|__pycache__|third_party|coverage)$/;
34124
34269
 
34125
34270
  //#endregion
34126
34271
  //#region ../review/src/languages.ts
@@ -37496,8 +37641,7 @@ function checkCriteria(body, files, prBody = "", said$1 = null) {
37496
37641
  //#endregion
37497
37642
  //#region ../review/src/shape.ts
37498
37643
  /** The files a door reads to know a repository's shape - manifests only, never its source. */
37499
- const readsForShape = (path$1) => /(^|\/)(package\.json|pnpm-workspace\.yaml|nx\.json|project\.json|turbo\.json|Cargo\.toml|go\.work|go\.mod|settings\.gradle(\.kts)?|build\.gradle(\.kts)?|pom\.xml|WORKSPACE(\.bazel)?|MODULE\.bazel|BUILD(\.bazel)?|\.gitmodules|\.yarnrc\.yml)$/.test(path$1) && !NEVER.test(path$1);
37500
- const SKIP$2 = /^(node_modules|vendor|dist|build|target|out|\.git|\.next|\.venv|venv|__pycache__|third_party|coverage)$/;
37644
+ const readsForShape = (path$1) => /(^|\/)(\.gitignore|CACHEDIR\.TAG|pyvenv\.cfg|package\.json|pnpm-workspace\.yaml|nx\.json|project\.json|turbo\.json|Cargo\.toml|go\.work|go\.mod|settings\.gradle(\.kts)?|build\.gradle(\.kts)?|pom\.xml|WORKSPACE(\.bazel)?|MODULE\.bazel|BUILD(\.bazel)?|\.gitmodules|\.yarnrc\.yml)$/.test(path$1) && !NEVER.test(path$1);
37501
37645
  const at$4 = (d, f) => d ? `${d}/${f}` : f;
37502
37646
  const isDir = (r, p$1) => r.read(p$1) === null && r.has(p$1);
37503
37647
  const json$1 = (text) => {
@@ -37522,7 +37666,7 @@ function folders(r, patterns, depth = 4) {
37522
37666
  const out = [];
37523
37667
  const walk$2 = (d, left) => {
37524
37668
  for (const f of r.list(d || ".")) {
37525
- if (SKIP$2.test(f) || f.startsWith(".")) continue;
37669
+ if (notSourceOf(r)(d, f) || f.startsWith(".")) continue;
37526
37670
  const c = at$4(d, f);
37527
37671
  if (!isDir(r, c)) continue;
37528
37672
  out.push(c);
@@ -37547,7 +37691,7 @@ function holding(r, names$4, depth = 5) {
37547
37691
  });
37548
37692
  if (left === 0) return;
37549
37693
  for (const f of here) {
37550
- if (SKIP$2.test(f) || f.startsWith(".")) continue;
37694
+ if (notSourceOf(r)(d, f) || f.startsWith(".")) continue;
37551
37695
  const c = at$4(d, f);
37552
37696
  if (isDir(r, c)) walk$2(c, left - 1);
37553
37697
  }
@@ -44332,6 +44476,27 @@ const REVERSIBLE_CONTROLS = {
44332
44476
  }
44333
44477
  };
44334
44478
 
44479
+ //#endregion
44480
+ //#region ../platform/src/incident-states.ts
44481
+ /** The states the record's column accepts from the alert engine; acknowledged and resolved are events, never this column. */
44482
+ const COLUMN_INCIDENT_STATES = [
44483
+ "detected",
44484
+ "investigating",
44485
+ "mitigation_running",
44486
+ "service_restored",
44487
+ "closed_unverified",
44488
+ "awaiting_access",
44489
+ "awaiting_decision",
44490
+ "verifying",
44491
+ "verification_failed",
44492
+ "help_required"
44493
+ ];
44494
+
44495
+ //#endregion
44496
+ //#region ../platform/src/incident-sink.ts
44497
+ /** The states the record's column accepts from the alert engine; acknowledged and resolved are events, never this column. */
44498
+ const COLUMN_STATES = new Set(COLUMN_INCIDENT_STATES);
44499
+
44335
44500
  //#endregion
44336
44501
  //#region ../catalogue/schema/action.meta.schema.json
44337
44502
  var required$1 = [
@@ -56447,15 +56612,15 @@ function valueCopy(standIn, initial, runtime = "process") {
56447
56612
  //#endregion
56448
56613
  //#region ../review/src/fix-rehearsal.ts
56449
56614
  const sha$3 = (s) => createHash("sha256").update(s).digest("hex");
56450
- const SKIP$1 = new Set([".git", "node_modules"]);
56615
+ const SKIP = new Set([".git", "node_modules"]);
56451
56616
  /** A sandboxed copy of the repository: everything but .git; node_modules linked, never copied - and unlinked first on removal. */
56452
56617
  function copyOfRepo(repo) {
56453
56618
  const dir = mkdtempSync(join(tmpdir(), "xovris-review-fix-"));
56454
- const made = [];
56619
+ const made$1 = [];
56455
56620
  const isLink = (at$6) => lstatSync(at$6, { throwIfNoEntry: false })?.isSymbolicLink() === true;
56456
56621
  const dispose = () => {
56457
- for (const at$6 of made) if (isLink(at$6)) unlinkSync(at$6);
56458
- if (made.every((at$6) => !isLink(at$6))) rmSync(dir, {
56622
+ for (const at$6 of made$1) if (isLink(at$6)) unlinkSync(at$6);
56623
+ if (made$1.every((at$6) => !isLink(at$6))) rmSync(dir, {
56459
56624
  recursive: true,
56460
56625
  force: true,
56461
56626
  maxRetries: 5,
@@ -56480,7 +56645,7 @@ function copyOfRepo(repo) {
56480
56645
  const at$6 = join(dir, relative(repo, src));
56481
56646
  mkdirSync(dirname(at$6), { recursive: true });
56482
56647
  symlinkSync(realpathSync(src), at$6, "junction");
56483
- made.push(at$6);
56648
+ made$1.push(at$6);
56484
56649
  }
56485
56650
  } catch (err) {
56486
56651
  dispose();
@@ -56496,7 +56661,7 @@ function treeOf(dir) {
56496
56661
  const out = /* @__PURE__ */ new Map();
56497
56662
  const walk$2 = (d) => {
56498
56663
  for (const e$1 of readdirSync(d, { withFileTypes: true })) {
56499
- if (SKIP$1.has(e$1.name) || e$1.isSymbolicLink()) continue;
56664
+ if (SKIP.has(e$1.name) || e$1.isSymbolicLink()) continue;
56500
56665
  const p$1 = join(d, e$1.name);
56501
56666
  if (e$1.isDirectory()) walk$2(p$1);
56502
56667
  else if (e$1.isFile()) out.set(relative(dir, p$1).split(sep).join("/"), sha$3(readFileSync(p$1)));
@@ -56827,7 +56992,7 @@ const pathInRepo = (path$1) => !!path$1 && !path$1.startsWith("/") && !path$1.in
56827
56992
  /** Named files of one branch on GitHub, read through the installation's own door and nothing else. */
56828
56993
  function githubBranch(gh, ref, paths, one = null) {
56829
56994
  const repo = `/repos/${ref.owner}/${ref.repo}`;
56830
- let made = false;
56995
+ let made$1 = false;
56831
56996
  let seen = /* @__PURE__ */ new Map();
56832
56997
  let kinds = /* @__PURE__ */ new Map();
56833
56998
  const read = async () => {
@@ -56885,11 +57050,11 @@ function githubBranch(gh, ref, paths, one = null) {
56885
57050
  sha: to
56886
57051
  }]
56887
57052
  });
56888
- const made$1 = tree.data?.sha;
56889
- if (tree.status !== 201 || !made$1) throw new Error(`GitHub refused the new pointer of ${path$1} (status ${tree.status})`);
57053
+ const made$2 = tree.data?.sha;
57054
+ if (tree.status !== 201 || !made$2) throw new Error(`GitHub refused the new pointer of ${path$1} (status ${tree.status})`);
56890
57055
  const c = await gh.request("POST", `${repo}/git/commits`, {
56891
57056
  message,
56892
- tree: made$1,
57057
+ tree: made$2,
56893
57058
  parents: [tip]
56894
57059
  });
56895
57060
  const at$6 = c.data?.sha;
@@ -56937,11 +57102,11 @@ function githubBranch(gh, ref, paths, one = null) {
56937
57102
  base_tree: base$1,
56938
57103
  tree
56939
57104
  });
56940
- const made$1 = t.data?.sha;
56941
- if (t.status !== 201 || !made$1) throw new Error(`GitHub refused the tree of the change (status ${t.status})`);
57105
+ const made$2 = t.data?.sha;
57106
+ if (t.status !== 201 || !made$2) throw new Error(`GitHub refused the tree of the change (status ${t.status})`);
56942
57107
  const c = await gh.request("POST", `${repo}/git/commits`, {
56943
57108
  message,
56944
- tree: made$1,
57109
+ tree: made$2,
56945
57110
  parents: one?.merge ? [tip, one.merge] : [tip]
56946
57111
  });
56947
57112
  const at$6 = c.data?.sha;
@@ -56981,7 +57146,7 @@ function githubBranch(gh, ref, paths, one = null) {
56981
57146
  };
56982
57147
  return {
56983
57148
  name: `the branch ${ref.branch}`,
56984
- made: () => made,
57149
+ made: () => made$1,
56985
57150
  backup: async () => {
56986
57151
  const s = await read();
56987
57152
  return {
@@ -57004,7 +57169,7 @@ function githubBranch(gh, ref, paths, one = null) {
57004
57169
  ref: `refs/heads/${ref.branch}`,
57005
57170
  sha: ref.from
57006
57171
  });
57007
- if (r.status === 201) made = true;
57172
+ if (r.status === 201) made$1 = true;
57008
57173
  else if (r.status === 422) await read();
57009
57174
  else throw new Error(`GitHub refused the fix branch (status ${r.status})`);
57010
57175
  }
@@ -57022,10 +57187,10 @@ function githubBranch(gh, ref, paths, one = null) {
57022
57187
  return;
57023
57188
  }
57024
57189
  const now = await read();
57025
- if (!s.exists && now.exists && made) {
57190
+ if (!s.exists && now.exists && made$1) {
57026
57191
  const r = await gh.request("DELETE", `${repo}/git/refs/heads/${enc(ref.branch)}`);
57027
57192
  if (r.status !== 204 && r.status !== 200) throw new Error(`GitHub refused to remove the branch ${ref.branch} (status ${r.status})`);
57028
- made = false;
57193
+ made$1 = false;
57029
57194
  return;
57030
57195
  }
57031
57196
  if (!now.exists) return;
@@ -57409,9 +57574,9 @@ const segs = (path$1) => path$1.split("/").map(e).join("/");
57409
57574
  /** A host's refusal. `made` says the branch itself was already made when it refused, so the way back has a branch to take away. */
57410
57575
  var Refused = class extends Error {
57411
57576
  made;
57412
- constructor(what, status, made = false) {
57577
+ constructor(what, status, made$1 = false) {
57413
57578
  super(status === null ? what : `${what} (status ${status})`);
57414
- this.made = made;
57579
+ this.made = made$1;
57415
57580
  }
57416
57581
  };
57417
57582
  const shown = (r, what) => {
@@ -57604,7 +57769,7 @@ function opsFor(p$1, ref, branch) {
57604
57769
  */
57605
57770
  function hostBranch(p$1, ref, branch, from, paths) {
57606
57771
  const ops$2 = opsFor(p$1, ref, branch);
57607
- let made = false;
57772
+ let made$1 = false;
57608
57773
  const read = async () => {
57609
57774
  const head = await ops$2.head();
57610
57775
  const files = /* @__PURE__ */ new Map();
@@ -57618,7 +57783,7 @@ function hostBranch(p$1, ref, branch, from, paths) {
57618
57783
  const addresses = (files) => [...files].map(([path$1, t]) => [path$1, t === null ? null : gitBlobSha(t)]);
57619
57784
  return {
57620
57785
  name: `the branch ${branch}`,
57621
- made: () => made,
57786
+ made: () => made$1,
57622
57787
  backup: async () => {
57623
57788
  const s = await read();
57624
57789
  return {
@@ -57643,17 +57808,17 @@ function hostBranch(p$1, ref, branch, from, paths) {
57643
57808
  was: (now.files.get(path$1) ?? null) !== null
57644
57809
  }))
57645
57810
  });
57646
- if (!now.exists) made = true;
57811
+ if (!now.exists) made$1 = true;
57647
57812
  } catch (err) {
57648
- if (!now.exists && err instanceof Refused && err.made) made = true;
57813
+ if (!now.exists && err instanceof Refused && err.made) made$1 = true;
57649
57814
  throw err;
57650
57815
  }
57651
57816
  },
57652
57817
  restore: async (s) => {
57653
57818
  const now = await read();
57654
- if (!s.exists && now.exists && made) {
57819
+ if (!s.exists && now.exists && made$1) {
57655
57820
  await ops$2.remove(now.head);
57656
- made = false;
57821
+ made$1 = false;
57657
57822
  return;
57658
57823
  }
57659
57824
  if (!now.exists) return;
@@ -58839,10 +59004,10 @@ async function openTraced(door, t, fix, base$1) {
58839
59004
  base: base$1.branch,
58840
59005
  body
58841
59006
  });
58842
- const made = pr.data;
59007
+ const made$1 = pr.data;
58843
59008
  return pr.status === 201 ? {
58844
59009
  ok: true,
58845
- url: made?.html_url ?? null,
59010
+ url: made$1?.html_url ?? null,
58846
59011
  branch
58847
59012
  } : {
58848
59013
  ok: false,
@@ -66010,6 +66175,42 @@ const ghRepo = (url) => {
66010
66175
  name: m[2]
66011
66176
  } : null;
66012
66177
  };
66178
+ const NVIM_PARSERS = "https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/main/lua/nvim-treesitter/parsers.lua";
66179
+ const LANGUAGE_PACK = "https://raw.githubusercontent.com/kreuzberg-dev/tree-sitter-language-pack/main/sources/language_definitions.json";
66180
+ const LUA_KEY = /^ {2}([A-Za-z0-9_]+) = \{\s*$/;
66181
+ const LUA_URL = /^\s*url = '([^']+)'/;
66182
+ const LINES = /\r?\n/;
66183
+ /**
66184
+ * G183.966.15: the repository of every grammar the maintained registries name, by each language's own key in them - nvim-treesitter's
66185
+ * parser list and the tree-sitter language pack, each read whole and kept a day - so a grammar npm does not carry is still found at its
66186
+ * source and built from it (601 of the 611 languages missed on 17 Nov had no source found at all). Never a list of grammars of ours.
66187
+ */
66188
+ async function registryRepos(d = {}) {
66189
+ const out = /* @__PURE__ */ new Map();
66190
+ const lua = await kept(d, "grammars/registry/nvim-parsers.lua", NVIM_PARSERS, DAY_MS).catch(() => null);
66191
+ let cur = null;
66192
+ for (const line$1 of (lua?.toString("utf8") ?? "").split(LINES)) {
66193
+ const k = LUA_KEY.exec(line$1);
66194
+ if (k) {
66195
+ cur = k[1].toLowerCase();
66196
+ continue;
66197
+ }
66198
+ const u = cur ? LUA_URL.exec(line$1) : null;
66199
+ const r = u ? ghRepo(u[1]) : null;
66200
+ if (cur && r) {
66201
+ if (!out.has(cur)) out.set(cur, r);
66202
+ cur = null;
66203
+ }
66204
+ }
66205
+ const pack = await kept(d, "grammars/registry/language-pack.json", LANGUAGE_PACK, DAY_MS).catch(() => null);
66206
+ try {
66207
+ for (const [k, v] of Object.entries(JSON.parse(pack?.toString("utf8") ?? "{}"))) {
66208
+ const r = ghRepo(v?.repo);
66209
+ if (r && !out.has(k.toLowerCase())) out.set(k.toLowerCase(), r);
66210
+ }
66211
+ } catch {}
66212
+ return out;
66213
+ }
66013
66214
  /** A tar archive unpacked under `dest`: files and folders, long names from pax headers, nothing written outside `dest`. */
66014
66215
  function untar(tar, dest) {
66015
66216
  let at$6 = 0, n$1 = 0, longName = null;
@@ -66068,19 +66269,39 @@ async function buildFromSource(repo, dir, f = fetch) {
66068
66269
  const at$6 = found$1.sort((a, b) => a.length - b.length)[0];
66069
66270
  if (!at$6) return null;
66070
66271
  const out = join(dir, `${repo.owner}-${repo.name}.wasm`);
66071
- await run$1(process.platform === "win32" ? "npx.cmd" : "npx", [
66272
+ const npx = process.platform === "win32" ? "npx.cmd" : "npx";
66273
+ const here = {
66274
+ cwd: at$6,
66275
+ timeout: 9e5,
66276
+ windowsHide: true,
66277
+ shell: process.platform === "win32"
66278
+ };
66279
+ if (!existsSync(join(at$6, "src", "parser.c"))) {
66280
+ const generate = () => run$1(npx, [
66281
+ "-y",
66282
+ "tree-sitter-cli",
66283
+ "generate"
66284
+ ], here);
66285
+ await generate().catch(async (e$1) => {
66286
+ if (!existsSync(join(at$6, "package.json"))) throw e$1;
66287
+ await run$1(process.platform === "win32" ? "npm.cmd" : "npm", [
66288
+ "install",
66289
+ "--ignore-scripts",
66290
+ "--no-audit",
66291
+ "--no-fund"
66292
+ ], here);
66293
+ await generate();
66294
+ });
66295
+ }
66296
+ await run$1(npx, [
66072
66297
  "-y",
66073
66298
  "tree-sitter-cli",
66074
66299
  "build",
66075
66300
  "--wasm",
66076
66301
  "-o",
66077
66302
  out,
66078
- at$6
66079
- ], {
66080
- timeout: 9e5,
66081
- windowsHide: true,
66082
- shell: process.platform === "win32"
66083
- });
66303
+ "."
66304
+ ], here);
66084
66305
  return existsSync(out) ? out : null;
66085
66306
  }
66086
66307
  /** The grammar of one language, found in the world and kept: the cache first, then npm, then the repository's release, then a build. */
@@ -66092,7 +66313,7 @@ async function findGrammar(language, aliases, d = {}) {
66092
66313
  const hit = index$2[language];
66093
66314
  if (hit && "wasm" in hit && existsSync(hit.wasm)) return hit;
66094
66315
  const building = d.build !== null;
66095
- const builder = building ? createHash("sha256").update(`${String(d.build ?? buildFromSource)}${String(untar)}`).digest("hex") : false;
66316
+ const builder = building ? createHash("sha256").update(`${String(d.build ?? buildFromSource)}${String(untar)}${String(registryRepos)}`).digest("hex") : false;
66096
66317
  if (hit && "missAt" in hit && Date.now() - hit.missAt < DAY_MS && (!building || hit.built === builder)) return { tried: hit.tried };
66097
66318
  const keep = (v) => {
66098
66319
  index$2[language] = v;
@@ -66121,6 +66342,13 @@ async function findGrammar(language, aliases, d = {}) {
66121
66342
  return found$1;
66122
66343
  }
66123
66344
  }
66345
+ const named = await registryRepos(d).catch(() => /* @__PURE__ */ new Map());
66346
+ for (const name of grammarNames(language, aliases)) {
66347
+ const r = named.get(name);
66348
+ if (!r || repos.some((x) => x.owner === r.owner && x.name === r.name)) continue;
66349
+ tried.push(`registry ${r.owner}/${r.name}`);
66350
+ repos.push(r);
66351
+ }
66124
66352
  for (const repo of repos) {
66125
66353
  tried.push(`release ${repo.owner}/${repo.name}`);
66126
66354
  const rel = await ask(f, `https://api.github.com/repos/${repo.owner}/${repo.name}/releases/latest`, "application/vnd.github+json").then((r) => r?.json()).catch(() => void 0);
@@ -66803,7 +67031,7 @@ async function proveFindings(root, findings, texts, p$1, skip = /* @__PURE__ */
66803
67031
  try {
66804
67032
  cpSync(root, copy, {
66805
67033
  recursive: true,
66806
- filter: (src) => !skip.has(src.split(sep).pop() ?? "")
67034
+ filter: (src) => typeof skip === "function" ? !skip(src) : !skip.has(src.split(sep).pop() ?? "")
66807
67035
  });
66808
67036
  for (const f of findings) {
66809
67037
  const t = await p$1.testFor(f, texts.get(f.file) ?? "").catch(() => null);
@@ -67204,23 +67432,6 @@ const EXT = {
67204
67432
  ".hs": "haskell",
67205
67433
  ".sol": "solidity"
67206
67434
  };
67207
- const SKIP = new Set([
67208
- "node_modules",
67209
- ".git",
67210
- "vendor",
67211
- "dist",
67212
- "build",
67213
- "target",
67214
- "bin",
67215
- "obj",
67216
- "__pycache__",
67217
- ".venv",
67218
- "venv",
67219
- ".next",
67220
- ".gradle",
67221
- ".idea",
67222
- "coverage"
67223
- ]);
67224
67435
  const MAX_FILE = 1e6;
67225
67436
  /** The ast-grep binary of this platform: the platform package @ast-grep/cli itself depends on. */
67226
67437
  function sgBinary() {
@@ -67246,14 +67457,16 @@ function sgBinary() {
67246
67457
  function walk(root) {
67247
67458
  const files = [];
67248
67459
  const unread = [];
67460
+ const skip = notSource(diskReader(root));
67249
67461
  const go = (dir) => {
67250
67462
  for (const e$1 of readdirSync(dir, { withFileTypes: true })) {
67251
67463
  const abs = join(dir, e$1.name);
67252
67464
  const rel = relative(root, abs).split(sep).join("/");
67253
67465
  if (e$1.isDirectory()) {
67254
- if (SKIP.has(e$1.name)) unread.push({
67466
+ const why = skip(rel.includes("/") ? rel.slice(0, rel.lastIndexOf("/")) : "", e$1.name);
67467
+ if (why) unread.push({
67255
67468
  file: `${rel}/`,
67256
- why: "third-party or built output"
67469
+ why
67257
67470
  });
67258
67471
  else go(abs);
67259
67472
  continue;
@@ -67811,6 +68024,12 @@ async function huntRepository(root, o = {}) {
67811
68024
  notes.push(`dependencies: ${deps.length} pinned, not checked - the advisory database did not answer (${String(e$1.message ?? e$1).slice(0, 120)}); Xovris checks them again on the next hunt`);
67812
68025
  }
67813
68026
  }
68027
+ const notSourceHere = notSource(diskReader(root));
68028
+ const leftOut = (src) => {
68029
+ const rel = relative(root, src).split(sep).join("/");
68030
+ const at$6 = rel.lastIndexOf("/");
68031
+ return !!rel && statSync(src).isDirectory() && notSourceHere(at$6 < 0 ? "" : rel.slice(0, at$6), rel.slice(at$6 + 1)) !== null;
68032
+ };
67814
68033
  if (o.beyond) {
67815
68034
  const claims = await o.beyond.name(files.map((f) => ({
67816
68035
  rel: f.rel,
@@ -67829,7 +68048,7 @@ async function huntRepository(root, o = {}) {
67829
68048
  try {
67830
68049
  if (copy) cpSync(root, copy, {
67831
68050
  recursive: true,
67832
- filter: (src) => !SKIP.has(src.split(sep).pop() ?? "")
68051
+ filter: (src) => !leftOut(src)
67833
68052
  });
67834
68053
  for (const c of claims) {
67835
68054
  const f = byRel.get(c.file);
@@ -67877,7 +68096,7 @@ async function huntRepository(root, o = {}) {
67877
68096
  }
67878
68097
  const prover = o.prove ?? o.beyond?.prover ?? null;
67879
68098
  if (prover) {
67880
- const proofs = await proveFindings(root, findings.filter((f) => f.class !== "named"), new Map(files.map((f) => [f.rel, f.text])), prover, SKIP).catch((e$1) => {
68099
+ const proofs = await proveFindings(root, findings.filter((f) => f.class !== "named"), new Map(files.map((f) => [f.rel, f.text])), prover, leftOut).catch((e$1) => {
67881
68100
  notes.push(`the findings were not run against their tests (${String(e$1?.message ?? e$1)}); Xovris runs them on the next hunt`);
67882
68101
  return /* @__PURE__ */ new Map();
67883
68102
  });
@@ -68071,4 +68290,4 @@ const RULE = objectShape("variant_rule", {
68071
68290
  });
68072
68291
 
68073
68292
  //#endregion
68074
- export { secretFindings as $, hostRest as A, jobRunner as B, fixTraced as C, parseError as D, openTraced as E, guardStrip as F, leaveBy as G, osvAdvisories as H, writeProven as I, reviewChange as J, forAgents as K, contentDigest as L, commandRunner as M, undoFixes as N, traceError as O, filesOf as P, findSecrets as Q, valueCopy as R, revertOne as S, locate as T, dependenciesIn as U, npmDependencies as V, handOff as W, readsForShape as X, stackChain as Y, testsFirst as Z, spdxOf as _, runMergeQueue as a, probeNames as at, withLicences as b, FACET_AXES as c, parseDiff as ct, generateTests as d, refreshDeprecations as et, proveResolution as f, sbomOf as g, lockOfBom as h, queueOrder as i, assumptionsOf as it, githubRest as j, hostAuth as k, checkFacetQuery as l, SEVERITIES as lt, HOSTING_FILES as m, HUNT_CLASSES as n, dirReader as nt, EFFORTS as o, readingsOf as ot, touchesFor as p, readsForReview as q, gitQueueRepo as r, workOut as rt, EFFORT_UNMEASURED as s, newFileDiff as st, huntRepository as t, census as tt, applyTouches as u, SEVERITY_LABEL as ut, spdxTagValue as v, followFix as w, fixAll as x, lockfilesIn as y, applyGuarded as z };
68293
+ export { secretFindings as $, hostRest as A, jobRunner as B, fixTraced as C, parseError as D, openTraced as E, guardStrip as F, leaveBy as G, osvAdvisories as H, writeProven as I, reviewChange as J, forAgents as K, contentDigest as L, commandRunner as M, undoFixes as N, traceError as O, filesOf as P, findSecrets as Q, valueCopy as R, revertOne as S, locate as T, dependenciesIn as U, npmDependencies as V, handOff as W, readsForShape as X, stackChain as Y, testsFirst as Z, spdxOf as _, runMergeQueue as a, notSource as at, withLicences as b, FACET_AXES as c, readingsOf as ct, generateTests as d, SEVERITIES as dt, refreshDeprecations as et, proveResolution as f, SEVERITY_LABEL as ft, sbomOf as g, lockOfBom as h, queueOrder as i, diskReader as it, githubRest as j, hostAuth as k, checkFacetQuery as l, newFileDiff as lt, HOSTING_FILES as m, HUNT_CLASSES as n, dirReader as nt, EFFORTS as o, assumptionsOf as ot, touchesFor as p, readsForReview as q, gitQueueRepo as r, workOut as rt, EFFORT_UNMEASURED as s, probeNames as st, huntRepository as t, census as tt, applyTouches as u, parseDiff as ut, spdxTagValue as v, followFix as w, fixAll as x, lockfilesIn as y, applyGuarded as z };
@@ -1,4 +1,4 @@
1
- import { A as hostRest, C as fixTraced, D as parseError, E as openTraced, F as guardStrip, G as leaveBy, O as traceError, T as locate, j as githubRest, k as hostAuth, w as followFix } from "./src-CwHd09_C.js";
1
+ import { A as hostRest, C as fixTraced, D as parseError, E as openTraced, F as guardStrip, G as leaveBy, O as traceError, T as locate, j as githubRest, k as hostAuth, w as followFix } from "./src-rd6qFkYx.js";
2
2
  import { join } from "node:path";
3
3
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
4
4
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "xovris",
3
- "gitHead": "1f42a3184050f2b875aa204ffa401462af2cfc81",
3
+ "gitHead": "e521172c2d5602c6c5d3c2f7a6dd092fe6954c48",
4
4
  "homepage": "https://xovris.ai",
5
- "version": "0.2.5",
5
+ "version": "0.2.7",
6
6
  "description": "npx xovris@latest init - detects your stack, signs you in through your browser, writes the configuration and verifies the first stored event. Nothing to copy or paste.",
7
7
  "license": "Apache-2.0",
8
8
  "type": "module",
@@ -32,10 +32,10 @@
32
32
  "@opentelemetry/sdk-node": "^0.222.0",
33
33
  "@opentelemetry/sdk-trace-base": "^2.12.0",
34
34
  "tsdown": "^0.15.12",
35
- "@xovris/mcp": "0.1.0",
36
35
  "@xovris/checks": "0.1.0",
37
- "@xovris/node": "0.1.5",
36
+ "@xovris/node": "0.1.7",
38
37
  "@xovris/review": "0.1.0",
38
+ "@xovris/mcp": "0.1.0",
39
39
  "@xovris/setup": "0.1.0",
40
40
  "@xovris/stacks": "0.1.0"
41
41
  },