@r_masseater/msch 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { A as workspaceDependencies, D as MANIFEST_FILE, E as publicEntriesOf, O as dependencyEntries, S as stringsIn, T as publishedWorkspaces, _ as KeySchema, a as definesTask, b as literalOf, g as workspaceConfigOf, i as VERIFY_TASK, k as readManifest, o as hasVerifyTask, r as RUN_TASKS, t as namedWorkspaces, u as workspaceDirectories, v as childrenOf$2, x as nestedValues, y as keyName } from "./workspace-BJk4TcI8.mjs";
3
- import { $ as isPropertyAssignment, A as getNameOfDeclaration, B as isExportDeclaration, C as API, D as SyntaxKind, E as SignatureKind, F as isBlock, G as isInterfaceDeclaration, H as isFunctionExpression, I as isCallExpression, J as isNewExpression, K as isModuleBlock, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isPropertyAccessExpression, R as isElementAccessExpression, S as uniqueByReference, T as InternalSymbolName, U as isIdentifier, V as isFunctionDeclaration, W as isImportDeclaration, X as isObjectLiteralExpression, Y as isNumericLiteral, Z as isParenthesizedExpression, _ as lineOf, a as problemAt, at as isStringLiteral, b as resolvedSymbol, c as childrenOf$3, ct as isTypeReferenceNode, d as declarationsOf, dt as isVariableDeclarationList, et as isReturnStatement, f as descendantsOf, ft as isVariableStatement, g as isTypeDeclaration, h as isGenericDeclaration, i as formatProblem, it as isSpreadElement, j as getTextOfJSDocComment, k as getLeadingCommentRanges, l as columnOf, lt as isUnionTypeNode, m as isExternalDeclaration, n as ProblemList, nt as isSignatureDeclaration, o as sortProblems, ot as isTypeAliasDeclaration, p as importedModulesOf, q as isModuleDeclaration, rt as isSourceFile, s as NODE_MODULES_SEGMENT, st as isTypeLiteralNode, tt as isSatisfiesExpression, u as contains, ut as isVariableDeclaration, v as propertyNamesOf, w as IndexKind, x as symbolAt, y as referencedSymbols, z as isEnumDeclaration } from "./cli-contract-BeVYJPZW.mjs";
4
- import { i as nodeServicesLayer, n as RepositoryFiles, r as nodeRepositoryFiles, t as NODE_MODULES } from "./repository-files-BiKs7S7N.mjs";
2
+ import { A as dependencyEntries, C as propertyValue, D as publishedWorkspaces, M as workspaceDependencies, O as publicEntriesOf, S as nestedValues, _ as workspaceConfigOf, a as runTasksOf, b as keyName, c as VERIFY_TASK, i as workspaceDirectories, j as readManifest, k as MANIFEST_FILE, l as definesTask, s as RUN_TASKS, t as namedWorkspaces, u as hasVerifyTask, v as KeySchema, w as stringsIn, x as literalOf, y as childrenOf$2 } from "./workspace-CMPDXFWk.mjs";
3
+ import { $ as isPropertyAssignment, A as getNameOfDeclaration, B as isExportDeclaration, C as API, D as SyntaxKind, E as SignatureKind, F as isBlock, G as isInterfaceDeclaration, H as isFunctionExpression, I as isCallExpression, J as isNewExpression, K as isModuleBlock, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isPropertyAccessExpression, R as isElementAccessExpression, S as uniqueByReference, T as InternalSymbolName, U as isIdentifier, V as isFunctionDeclaration, W as isImportDeclaration, X as isObjectLiteralExpression, Y as isNumericLiteral, Z as isParenthesizedExpression, _ as lineOf, a as problemAt$2, at as isStringLiteral, b as resolvedSymbol, c as childrenOf$3, ct as isTypeReferenceNode, d as declarationsOf, dt as isVariableDeclarationList, et as isReturnStatement, f as descendantsOf, ft as isVariableStatement, g as isTypeDeclaration, h as isGenericDeclaration, i as formatProblem, it as isSpreadElement, j as getTextOfJSDocComment, k as getLeadingCommentRanges, l as columnOf, lt as isUnionTypeNode, m as isExternalDeclaration, n as ProblemList, nt as isSignatureDeclaration, o as sortProblems, ot as isTypeAliasDeclaration, p as importedModulesOf, q as isModuleDeclaration, rt as isSourceFile, s as NODE_MODULES_SEGMENT, st as isTypeLiteralNode, tt as isSatisfiesExpression, u as contains, ut as isVariableDeclaration, v as propertyNamesOf, w as IndexKind, x as symbolAt, y as referencedSymbols, z as isEnumDeclaration } from "./cli-contract-DZEnO-xY.mjs";
4
+ import { a as groupOf$1, i as nodeServicesLayer, n as RepositoryFiles, r as nodeRepositoryFiles, t as NODE_MODULES } from "./repository-files-B11FFAIk.mjs";
5
5
  import { t as COMMENT_DIRECTIVES } from "./comment-directives-WcDqvLwJ.mjs";
6
6
  import { Array, Cause, Effect, FileSystem, Function, HashMap, HashSet, Layer, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
7
7
  import { ChildProcess } from "effect/process";
@@ -316,7 +316,7 @@ const mentions$1 = (needle) => ({ api }) => (configPath) => Effect.gen(function*
316
316
  return pipe(texts, Array.some((text) => Option.exists(text, includesNeedle)));
317
317
  });
318
318
  // src/entities/project/model/inputs.ts
319
- const SEPARATOR$9 = "/";
319
+ const SEPARATOR$13 = "/";
320
320
  const SCOPE_PREFIX$2 = "@";
321
321
  const HIDDEN_PREFIX = ".";
322
322
  const encodeOptions = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
@@ -358,14 +358,14 @@ const closureOf$1 = Effect.fn("closureOf")(function* closureOf(root, configPath)
358
358
  const directories = yield* workspaceClosure(directory);
359
359
  return {
360
360
  directories,
361
- prefixes: pipe(directories, Array.map((found) => `${files.relative(root, found)}${SEPARATOR$9}`))
361
+ prefixes: pipe(directories, Array.map((found) => `${files.relative(root, found)}${SEPARATOR$13}`))
362
362
  };
363
363
  });
364
364
  const scopedNames = (modules) => (name) => Effect.gen(function* listScope() {
365
365
  const files = yield* RepositoryFiles;
366
366
  if (!String$1.startsWith(SCOPE_PREFIX$2)(name)) return [name];
367
367
  const scoped = yield* files.readDirectory(files.join(modules, name));
368
- return pipe(scoped, Array.map((entry) => `${name}${SEPARATOR$9}${entry}`));
368
+ return pipe(scoped, Array.map((entry) => `${name}${SEPARATOR$13}${entry}`));
369
369
  });
370
370
  const installedNames$1 = Effect.fn("installedNames")(function* installedNames(modules) {
371
371
  const listed = yield* (yield* RepositoryFiles).readDirectory(modules);
@@ -398,10 +398,10 @@ const projectInputs = ({ workspace: { compiler, root }, listed }) => (configPath
398
398
  });
399
399
  });
400
400
  // src/shared/lib/text-position.ts
401
- const START$7 = 0;
401
+ const START$14 = 0;
402
402
  const FIRST_COLUMN$3 = 1;
403
403
  const positionOf = (source) => (index) => {
404
- const before = pipe(source, String$1.slice(START$7, index), String$1.split("\n"));
404
+ const before = pipe(source, String$1.slice(START$14, index), String$1.split("\n"));
405
405
  return {
406
406
  line: before.length,
407
407
  column: pipe(Array.last(before), Option.match({
@@ -415,7 +415,7 @@ const RELATIVE = /^\.\.?(?:\/|$)/u;
415
415
  const SUBPATH_IMPORT = "#";
416
416
  const WILDCARD$2 = "*";
417
417
  const SCOPE = "@";
418
- const SEPARATOR$8 = "/";
418
+ const SEPARATOR$12 = "/";
419
419
  const SOURCE_SUFFIXES = [
420
420
  "",
421
421
  ".ts",
@@ -427,9 +427,9 @@ const PLAIN_SEGMENTS = 1;
427
427
  const ImportsField = Schema.Struct({ imports: Schema.optional(Schema.Record(Schema.String, Schema.String)) });
428
428
  const decodeImports = Schema.decodeOption(Schema.fromJsonString(ImportsField));
429
429
  const packageNameOf = (specifier) => {
430
- const segments = String$1.split(specifier, SEPARATOR$8);
431
- if (String$1.startsWith(SCOPE)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS$1), Array.join(SEPARATOR$8));
432
- return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$8));
430
+ const segments = String$1.split(specifier, SEPARATOR$12);
431
+ if (String$1.startsWith(SCOPE)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS$1), Array.join(SEPARATOR$12));
432
+ return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$12));
433
433
  };
434
434
  const literalText = (specifier) => pipe(Option.liftPredicate(specifier, isStringLiteral), Option.map((literal) => literal.text));
435
435
  const runtimeSpecifierOf = (statement) => {
@@ -466,18 +466,18 @@ const localFile = Effect.fn("localFile")(function* localFile({ directory, import
466
466
  if (Option.isNone(target)) return Option.none();
467
467
  return yield* existingSource(files.resolve(directory, target.value));
468
468
  });
469
- const referenceOf = (graph, from, specifier) => {
469
+ const referenceOf$1 = (graph, from, specifier) => {
470
470
  if (RELATIVE.test(specifier) || String$1.startsWith(SUBPATH_IMPORT)(specifier)) return localFile(graph, from, specifier).pipe(Effect.map(Option.map(Result.succeed)));
471
471
  const name = packageNameOf(specifier);
472
472
  return Effect.succeedSome(Result.fail(name));
473
473
  };
474
- const referencesIn = Effect.fn("referencesIn")(function* referencesIn(graph, file) {
474
+ const referencesIn$1 = Effect.fn("referencesIn")(function* referencesIn(graph, file) {
475
475
  const text = yield* (yield* RepositoryFiles).readFile(file);
476
476
  const specifiers = Option.match(text, {
477
477
  onNone: () => [],
478
478
  onSome: (source) => specifiersIn(graph.api, file, source)
479
479
  });
480
- const references = yield* pipe(specifiers, Effect.forEach((specifier) => referenceOf(graph, file, specifier)));
480
+ const references = yield* pipe(specifiers, Effect.forEach((specifier) => referenceOf$1(graph, file, specifier)));
481
481
  const found = Array.getSomes(references);
482
482
  return {
483
483
  packages: Array.getFailures(found),
@@ -491,7 +491,7 @@ const packagesFrom = (graph, walk) => Array.match(walk.pending, {
491
491
  ...walk,
492
492
  pending: rest
493
493
  });
494
- return referencesIn(graph, next).pipe(Effect.flatMap(({ packages, sources }) => packagesFrom(graph, {
494
+ return referencesIn$1(graph, next).pipe(Effect.flatMap(({ packages, sources }) => packagesFrom(graph, {
495
495
  pending: [...rest, ...sources],
496
496
  visited: HashSet.add(walk.visited, next),
497
497
  packages: HashSet.union(walk.packages, HashSet.fromIterable(packages))
@@ -524,18 +524,18 @@ const InstalledManifest = Schema.Struct({
524
524
  peerDependencies: DependencyMap,
525
525
  peerDependenciesMeta: PeerMeta
526
526
  });
527
- const decodeManifest$2 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
528
- const keysOf$1 = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
527
+ const decodeManifest$3 = Schema.decodeOption(Schema.fromJsonString(InstalledManifest));
528
+ const keysOf$2 = (map) => pipe(Option.fromUndefinedOr(map), Option.map(Record.keys), Option.getOrElse(() => []));
529
529
  const isOptionalPeer = (manifest, name) => pipe(Option.fromUndefinedOr(manifest.peerDependenciesMeta), Option.flatMap(Record.get(name)), Option.exists((meta) => meta.optional === true));
530
530
  const installedNames = (manifest) => [
531
- ...keysOf$1(manifest.dependencies),
532
- ...keysOf$1(manifest.optionalDependencies),
533
- ...pipe(keysOf$1(manifest.peerDependencies), Array.filter((name) => !isOptionalPeer(manifest, name)))
531
+ ...keysOf$2(manifest.dependencies),
532
+ ...keysOf$2(manifest.optionalDependencies),
533
+ ...pipe(keysOf$2(manifest.peerDependencies), Array.filter((name) => !isOptionalPeer(manifest, name)))
534
534
  ];
535
535
  const childrenOf$1 = Effect.fn("childrenOf")(function* childrenOf(directory) {
536
536
  const files = yield* RepositoryFiles;
537
537
  const text = yield* files.readFile(files.join(directory, MANIFEST_FILE));
538
- return pipe(text, Option.flatMap(decodeManifest$2), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
538
+ return pipe(text, Option.flatMap(decodeManifest$3), Option.map(installedNames), Option.getOrElse(() => []), Array.map((child) => [directory, child]));
539
539
  });
540
540
  const resolveFrom = (from, name) => Effect.gen(function* resolvePackage() {
541
541
  const files = yield* RepositoryFiles;
@@ -597,11 +597,11 @@ const LISTED_LARGEST = 5;
597
597
  const SIZE_CONCURRENCY = 32;
598
598
  const MEGABYTE = 1e6;
599
599
  const MEGABYTE_DIGITS = 1;
600
- const START$6 = 0;
600
+ const START$13 = 0;
601
601
  const SINGLE_ENTRY = 1;
602
602
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
603
603
  const usageHint = (dependency, entryCount) => {
604
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$6 && dependency.entries.length < entryCount)) return "";
604
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$13 && dependency.entries.length < entryCount)) return "";
605
605
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
606
606
  };
607
607
  const listed = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -610,7 +610,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
610
610
  const { workspace, total } = overrun;
611
611
  const config = yield* files.readFile(workspace.configFile);
612
612
  const source = Option.getOrElse(config, () => "");
613
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$6);
613
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$13);
614
614
  return {
615
615
  file: workspace.configFile,
616
616
  ...positionOf(source)(index),
@@ -627,7 +627,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
627
627
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
628
628
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
629
629
  const sizes = HashMap.fromIterable(measured);
630
- const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$6))));
630
+ const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$13))));
631
631
  return {
632
632
  closures,
633
633
  sizeOf,
@@ -660,11 +660,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
660
660
  })];
661
661
  });
662
662
  const stackProblems = (file, source, dependencies) => {
663
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$6);
663
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$13);
664
664
  const rest = String$1.slice(section)(source);
665
665
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
666
666
  file,
667
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$6)),
667
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$13)),
668
668
  rule: STACK_DEPENDENCY,
669
669
  message: `${name} comes from the stack catalog, so every project that installs this package already has it. Move it to peerDependencies and keep it in devDependencies, so the installing project shares one copy.`
670
670
  })));
@@ -676,7 +676,7 @@ const PublishedManifest = Schema.Struct({
676
676
  exports: Schema.optional(Schema.Unknown),
677
677
  bin: Schema.optional(Schema.Unknown)
678
678
  });
679
- const problemsOf$1 = Effect.fn("problemsOf")(function* problemsOf(workspace, file, source) {
679
+ const problemsOf$2 = Effect.fn("problemsOf")(function* problemsOf(workspace, file, source) {
680
680
  const files = yield* RepositoryFiles;
681
681
  const manifest = Schema.decodeOption(Schema.fromJsonString(PublishedManifest))(source);
682
682
  if (Option.isNone(manifest)) return [];
@@ -686,7 +686,7 @@ const problemsOf$1 = Effect.fn("problemsOf")(function* problemsOf(workspace, fil
686
686
  join: (target) => files.join(workspace.directory, target),
687
687
  packEntries: workspace.packEntries
688
688
  });
689
- const provided = HashSet.fromIterable(keysOf$1(manifest.value.peerDependencies));
689
+ const provided = HashSet.fromIterable(keysOf$2(manifest.value.peerDependencies));
690
690
  const sized = yield* sizeProblems({
691
691
  workspace,
692
692
  entries,
@@ -700,7 +700,7 @@ const workspaceProblems = Effect.fn("workspaceProblems")(function* workspaceProb
700
700
  const source = yield* files.readFile(file);
701
701
  return yield* Option.match(source, {
702
702
  onNone: () => Effect.succeed([]),
703
- onSome: (text) => problemsOf$1(workspace, file, text)
703
+ onSome: (text) => problemsOf$2(workspace, file, text)
704
704
  });
705
705
  });
706
706
  /** @internal */
@@ -808,14 +808,14 @@ const withoutPeerContext = (version) => Option.match(String$1.indexOf(PEER_CONTE
808
808
  onSome: (start) => String$1.slice(NAME_START, start)(version)
809
809
  });
810
810
  const packageOf$1 = (key) => Option.map(separatorOf(key), (separator) => [String$1.slice(NAME_START, separator)(key), withoutPeerContext(String$1.slice(separator + SEPARATOR_LENGTH)(key))]);
811
- const keysOf = (node) => {
811
+ const keysOf$1 = (node) => {
812
812
  if (!isMap(node)) return [];
813
813
  return pipe(node.items, Array.flatMap((pair) => {
814
814
  if (isScalar(pair.key)) return [String(pair.key.value)];
815
815
  return [];
816
816
  }));
817
817
  };
818
- const lockfileKeysOf = (lockfile, section) => pipe(parseAllDocuments(lockfile), Array.flatMap((document) => keysOf(document.get(section))));
818
+ const lockfileKeysOf = (lockfile, section) => pipe(parseAllDocuments(lockfile), Array.flatMap((document) => keysOf$1(document.get(section))));
819
819
  const resolutionOf = (findings) => (lockfile) => {
820
820
  const snapshots = lockfileKeysOf(lockfile, "snapshots");
821
821
  const packages = Array.getSomes(pipe([...lockfileKeysOf(lockfile, "packages"), ...snapshots], Array.map((key) => packageOf$1(key))));
@@ -889,11 +889,11 @@ const withBaselineProbe = (manifest) => {
889
889
  return document.toString();
890
890
  };
891
891
  // src/features/overrides/model/overrides.ts
892
- const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
892
+ const WORKSPACE_FILE$2 = "pnpm-workspace.yaml";
893
893
  const LOCKFILE$1 = "pnpm-lock.yaml";
894
894
  const RESOLUTION_FILES = [
895
895
  "*package.json",
896
- WORKSPACE_FILE$1,
896
+ WORKSPACE_FILE$2,
897
897
  LOCKFILE$1,
898
898
  ".npmrc",
899
899
  "patches/*"
@@ -964,7 +964,7 @@ const resolutionWith = Effect.fn("resolutionWith")(function* resolutionWith(work
964
964
  const path = yield* Path.Path;
965
965
  const directory = yield* fs.makeTempDirectoryScoped({ prefix: "msch-overrides-" });
966
966
  yield* copyFiles(workspace, directory);
967
- yield* fs.writeFileString(path.join(directory, WORKSPACE_FILE$1), manifest);
967
+ yield* fs.writeFileString(path.join(directory, WORKSPACE_FILE$2), manifest);
968
968
  const output = yield* resolveIn(directory, override);
969
969
  const lockfile = yield* fs.readFileString(path.join(directory, LOCKFILE$1));
970
970
  yield* Effect.annotateCurrentSpan({ "msch.override": override });
@@ -983,7 +983,7 @@ const problemsFor = Effect.fn("problemsFor")(function* problemsFor(root, manifes
983
983
  };
984
984
  const baseline = yield* resolutionWith(workspace, BASELINE_PROBE, withBaselineProbe(manifest));
985
985
  const judgeAgainstBaseline = judge(baseline);
986
- const file = path.join(root, WORKSPACE_FILE$1);
986
+ const file = path.join(root, WORKSPACE_FILE$2);
987
987
  const problemOf = (located) => resolutionWith(workspace, located.key, withoutOverride(located.key)(manifest)).pipe(Effect.map((candidate) => overrideProblem({
988
988
  ...located,
989
989
  file
@@ -995,7 +995,7 @@ const problemsFor = Effect.fn("problemsFor")(function* problemsFor(root, manifes
995
995
  const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root) {
996
996
  const fs = yield* FileSystem.FileSystem;
997
997
  const path = yield* Path.Path;
998
- const manifest = yield* fs.readFileString(path.join(root, WORKSPACE_FILE$1)).pipe(Effect.option);
998
+ const manifest = yield* fs.readFileString(path.join(root, WORKSPACE_FILE$2)).pipe(Effect.option);
999
999
  const keys = Option.match(manifest, {
1000
1000
  onNone: () => [],
1001
1001
  onSome: overrideKeysOf
@@ -1003,38 +1003,41 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
1003
1003
  if (Option.isNone(manifest) || !Array.isReadonlyArrayNonEmpty(keys)) return [];
1004
1004
  return yield* problemsFor(root, manifest.value, keys);
1005
1005
  });
1006
- // src/features/placement/model/agent-docs-length.ts
1006
+ // src/shared/lib/agent-docs.ts
1007
1007
  const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
1008
+ const READ_CONCURRENCY$19 = 16;
1009
+ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
1010
+ const files = yield* RepositoryFiles;
1011
+ const listed = yield* files.listedFiles(root);
1012
+ const docs = pipe(listed, Array.filter((name) => AGENT_DOC.test(name)));
1013
+ const found = yield* Effect.forEach(docs, (name) => {
1014
+ const file = files.join(root, name);
1015
+ const problemOf = Option.flatMap(problemIn(file));
1016
+ return files.readFile(file).pipe(Effect.map(problemOf));
1017
+ }, { concurrency: READ_CONCURRENCY$19 });
1018
+ return Array.getSomes(found);
1019
+ });
1020
+ // src/features/placement/model/agent-docs-length.ts
1008
1021
  const RECOMMENDED_LINES = 200;
1009
- const READ_CONCURRENCY$14 = 16;
1010
- const FIRST$9 = 1;
1011
- const RULE$16 = "agent-docs-length";
1022
+ const FIRST$13 = 1;
1023
+ const RULE$25 = "agent-docs-length";
1012
1024
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
1013
- const problemFor$4 = (file) => (lines) => {
1025
+ const problemFor$5 = (file) => (lines) => {
1014
1026
  if (lines <= RECOMMENDED_LINES) return Option.none();
1015
1027
  return Option.some({
1016
1028
  file,
1017
1029
  line: 201,
1018
- column: FIRST$9,
1019
- rule: RULE$16,
1030
+ column: FIRST$13,
1031
+ rule: RULE$25,
1020
1032
  message: `has ${String(lines)} lines. Claude Code recommends under ${String(RECOMMENDED_LINES)} lines per file: longer files cost context and are followed less reliably. Cut what the code already tells, and move rules shared across repositories into skills.`
1021
1033
  });
1022
1034
  };
1023
1035
  /** @internal */
1024
- const checkAgentDocsLength = Effect.fn("checkAgentDocsLength")(function* checkAgentDocsLength(root) {
1025
- const files = yield* RepositoryFiles;
1026
- const listed = yield* files.listedFiles(root);
1027
- const docs = pipe(listed, Array.filter((name) => AGENT_DOC.test(name)));
1028
- const found = yield* Effect.forEach(docs, (name) => {
1029
- const file = files.join(root, name);
1030
- return files.readFile(file).pipe(Effect.map(Option.flatMap((source) => problemFor$4(file)(lineCount(source)))));
1031
- }, { concurrency: READ_CONCURRENCY$14 });
1032
- return Array.getSomes(found);
1033
- });
1036
+ const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$5(file)(lineCount(source)));
1034
1037
  // src/features/placement/model/colocated-tests.ts
1035
- const RULE$15 = "colocated-test";
1036
- const FIRST$8 = 1;
1037
- const READ_CONCURRENCY$13 = 64;
1038
+ const RULE$24 = "colocated-test";
1039
+ const FIRST$12 = 1;
1040
+ const READ_CONCURRENCY$18 = 64;
1038
1041
  const ROOT_SUBPATH = ".";
1039
1042
  const NAME_GROUP = "name";
1040
1043
  const SPECIFIER_GROUP = "specifier";
@@ -1045,20 +1048,20 @@ const SEPARATE_TEST_DIRECTORY = /(?:^|\/)(?:__tests__|__mocks__|tests?|specs?)\/
1045
1048
  const RELATIVE_REFERENCE = /["'`]\.\/(?<name>[^/"'`]+)/gu;
1046
1049
  const DIRNAME_REFERENCE = /import\.meta\.dirname\s*,\s*["'](?<name>[^/"']+)["']/gu;
1047
1050
  const MODULE_SPECIFIER = /(?:\bfrom\s+|\bimport\s*\(\s*|\bimport\s+|\bvi\.mock\(\s*)["'](?<specifier>[^"'.#][^"']*)["']/gu;
1048
- const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
1051
+ const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
1049
1052
  const DIRECTORY_MESSAGE = "sits in a separate test directory. Put each test next to the module it tests, and test-only helpers next to the tests as <name>.test.support.ts.";
1050
1053
  const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test next to the module it tests and import that module, or a helper beside it, with ./<name>.";
1051
- const Manifest$1 = Schema.Struct({
1054
+ const Manifest$2 = Schema.Struct({
1052
1055
  name: Schema.optional(Schema.String),
1053
1056
  exports: Schema.optional(Schema.Unknown)
1054
1057
  });
1055
- const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
1058
+ const decodeManifest$2 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$2));
1056
1059
  const byLength = Order.mapInput(Order.Number, (directory) => directory.length);
1057
- const problemFor$3 = (test, message) => ({
1060
+ const problemFor$4 = (test, message) => ({
1058
1061
  file: test.file,
1059
- line: FIRST$8,
1060
- column: FIRST$8,
1061
- rule: RULE$15,
1062
+ line: FIRST$12,
1063
+ column: FIRST$12,
1064
+ rule: RULE$24,
1062
1065
  message: `${test.base} ${message}`
1063
1066
  });
1064
1067
  const groupsOf$1 = (source, pattern, group) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array.getSomes);
@@ -1078,7 +1081,7 @@ const ownSpecifiers = Effect.fn("ownSpecifiers")(function* ownSpecifiers(context
1078
1081
  if (Option.isNone(owner)) return [];
1079
1082
  const text = yield* files.readFile(files.join(context.root, owner.value, MANIFEST_FILE));
1080
1083
  const join = (target) => files.join(context.root, owner.value, target);
1081
- return pipe(text, Option.flatMap(decodeManifest$1), Option.map(specifiersBeside({
1084
+ return pipe(text, Option.flatMap(decodeManifest$2), Option.map(specifiersBeside({
1082
1085
  join,
1083
1086
  dirname: files.dirname,
1084
1087
  directory: test.directory
@@ -1096,16 +1099,16 @@ const refersIn = Effect.fn("refersIn")(function* refersIn(context, test) {
1096
1099
  if (Option.isNone(source)) return true;
1097
1100
  return yield* refersToOwnDirectory(context, test, source.value);
1098
1101
  });
1099
- const problemIn$3 = Effect.fn("problemIn")(function* problemIn(context, test) {
1100
- if (SEPARATE_TEST_DIRECTORY.test(test.name)) return Option.some(problemFor$3(test, DIRECTORY_MESSAGE));
1102
+ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(context, test) {
1103
+ if (SEPARATE_TEST_DIRECTORY.test(test.name)) return Option.some(problemFor$4(test, DIRECTORY_MESSAGE));
1101
1104
  if (!TEST_FILE.test(test.name)) return Option.none();
1102
1105
  if (yield* refersIn(context, test)) return Option.none();
1103
- return Option.some(problemFor$3(test, SIBLING_MESSAGE));
1106
+ return Option.some(problemFor$4(test, SIBLING_MESSAGE));
1104
1107
  });
1105
1108
  /** @internal */
1106
1109
  const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
1107
1110
  const files = yield* RepositoryFiles;
1108
- const listed = yield* files.matchingFiles(root, EXCLUDED);
1111
+ const listed = yield* files.matchingFiles(root, EXCLUDED$2);
1109
1112
  const names = pipe(listed, Array.filter(String$1.isNonEmpty));
1110
1113
  const context = {
1111
1114
  root,
@@ -1120,42 +1123,66 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
1120
1123
  directory: files.dirname(file)
1121
1124
  };
1122
1125
  }));
1123
- const found = yield* Effect.forEach(tests, (test) => problemIn$3(context, test), { concurrency: READ_CONCURRENCY$13 });
1126
+ const found = yield* Effect.forEach(tests, (test) => problemIn$5(context, test), { concurrency: READ_CONCURRENCY$18 });
1127
+ return Array.getSomes(found);
1128
+ });
1129
+ // src/features/placement/model/dangling-links.ts
1130
+ const RULE$23 = "dangling-link";
1131
+ const SEPARATOR$11 = "/";
1132
+ const FIRST$11 = 1;
1133
+ const READ_CONCURRENCY$17 = 16;
1134
+ const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$11}`)(name);
1135
+ /** @internal */
1136
+ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
1137
+ const files = yield* RepositoryFiles;
1138
+ const [links, listed] = yield* Effect.all([files.linkedFiles(root), files.listedFiles(root)], { concurrency: "unbounded" });
1139
+ const problemOf = Effect.fn("problemOf")(function* problemOf(name) {
1140
+ const file = files.join(root, name);
1141
+ const link = yield* files.readLink(file);
1142
+ return pipe(link, Option.map((target) => files.relative(root, files.resolve(files.dirname(file), target))), Option.filter((target) => !pipe(listed, Array.some(holds(target)))), Option.map((target) => ({
1143
+ file,
1144
+ line: FIRST$11,
1145
+ column: FIRST$11,
1146
+ rule: RULE$23,
1147
+ message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
1148
+ })));
1149
+ });
1150
+ const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$17 });
1124
1151
  return Array.getSomes(found);
1125
1152
  });
1126
1153
  // src/features/placement/model/nested-docs.ts
1127
- const RULE$14 = "nested-docs";
1154
+ const RULE$22 = "nested-docs";
1128
1155
  const CONFIG_FILE$4 = "vite.config.ts";
1129
- const SEPARATOR$7 = "/";
1130
- const FIRST$7 = 1;
1131
- const READ_CONCURRENCY$12 = 64;
1156
+ const SEPARATOR$10 = "/";
1157
+ const FIRST$10 = 1;
1158
+ const READ_CONCURRENCY$16 = 64;
1132
1159
  const AGENT_DOCS = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
1133
1160
  const WORKSPACE_AGENT_DOC = "AGENTS.md";
1134
1161
  const README = /^README(?:\.[^/]+)?$/iu;
1135
1162
  const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
1136
1163
  const taggedError$3 = Schema.TaggedError;
1137
1164
  var RootConfigUnreadable = class extends taggedError$3()("RootConfigUnreadable", { file: Schema.String }) {};
1138
- const isNested = (name) => String$1.includes(SEPARATOR$7)(name);
1139
- const problemFor$2 = (file, message) => ({
1165
+ const isNested = (name) => String$1.includes(SEPARATOR$10)(name);
1166
+ const problemFor$3 = (file, message) => ({
1140
1167
  file,
1141
- line: FIRST$7,
1142
- column: FIRST$7,
1143
- rule: RULE$14,
1168
+ line: FIRST$10,
1169
+ column: FIRST$10,
1170
+ rule: RULE$22,
1144
1171
  message
1145
1172
  });
1146
1173
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
1147
1174
  const WORKSPACE_AGENT_DOCS_MESSAGE = "belongs only at the repository root or as AGENTS.md directly in a workspace, the directory that holds its package.json. Move what agents need there and delete this file.";
1148
1175
  const README_MESSAGE = "is allowed below the root only in a workspace, the directory that holds its package.json. Move it into the workspace it describes.";
1149
1176
  const agentDocProblem = ({ file, base, directory }, allowed) => {
1150
- if (!allowed.workspaceAgentDocs) return Option.some(problemFor$2(file, `${base} ${AGENT_DOCS_MESSAGE}`));
1177
+ if (!allowed.workspaceAgentDocs) return Option.some(problemFor$3(file, `${base} ${AGENT_DOCS_MESSAGE}`));
1151
1178
  if (base === WORKSPACE_AGENT_DOC && HashSet.has(allowed.workspaces, directory)) return Option.none();
1152
- return Option.some(problemFor$2(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
1179
+ return Option.some(problemFor$3(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
1153
1180
  };
1154
1181
  const readmeProblem = ({ file, base, directory }, allowed) => {
1155
1182
  if (!README.test(base) || HashSet.has(allowed.workspaces, directory)) return Option.none();
1156
- return Option.some(problemFor$2(file, `${base} ${README_MESSAGE}`));
1183
+ return Option.some(problemFor$3(file, `${base} ${README_MESSAGE}`));
1157
1184
  };
1158
- const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
1185
+ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
1159
1186
  const files = yield* RepositoryFiles;
1160
1187
  const file = files.join(root, name);
1161
1188
  const doc = {
@@ -1186,44 +1213,44 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
1186
1213
  workspaces: pipe(nested, Array.filter((name) => files.basename(name) === MANIFEST_FILE), Array.map((name) => files.dirname(files.join(root, name))), HashSet.fromIterable),
1187
1214
  workspaceAgentDocs
1188
1215
  };
1189
- const found = yield* Effect.forEach(nested, (name) => problemIn$2(root, allowed, name), { concurrency: READ_CONCURRENCY$12 });
1216
+ const found = yield* Effect.forEach(nested, (name) => problemIn$4(root, allowed, name), { concurrency: READ_CONCURRENCY$16 });
1190
1217
  return Array.getSomes(found);
1191
1218
  });
1192
1219
  // src/features/placement/model/root-docs.ts
1193
- const RULE$13 = "root-docs";
1194
- const SEPARATOR$6 = "/";
1195
- const FIRST$6 = 1;
1196
- const MARKDOWN = /\.(?:md|mdx|markdown)$/iu;
1220
+ const RULE$21 = "root-docs";
1221
+ const SEPARATOR$9 = "/";
1222
+ const FIRST$9 = 1;
1223
+ const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
1197
1224
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
1198
- const MESSAGE$4 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
1199
- const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$6)(name) && MARKDOWN.test(name) && !ALLOWED.test(name);
1225
+ const MESSAGE$5 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
1226
+ const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$9)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
1200
1227
  /** @internal */
1201
1228
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
1202
1229
  const files = yield* RepositoryFiles;
1203
1230
  const names = yield* files.listedFiles(root);
1204
1231
  return pipe(names, Array.filter(isStrayRootDoc), Array.map((name) => ({
1205
1232
  file: files.join(root, name),
1206
- line: FIRST$6,
1207
- column: FIRST$6,
1208
- rule: RULE$13,
1209
- message: `${name} ${MESSAGE$4}`
1233
+ line: FIRST$9,
1234
+ column: FIRST$9,
1235
+ rule: RULE$21,
1236
+ message: `${name} ${MESSAGE$5}`
1210
1237
  })));
1211
1238
  });
1212
1239
  // src/features/placement/model/root-readme.ts
1213
- const RULE$12 = "root-readme";
1240
+ const RULE$20 = "root-readme";
1214
1241
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
1215
- const READ_CONCURRENCY$11 = 16;
1216
- const START$5 = 0;
1242
+ const READ_CONCURRENCY$15 = 16;
1243
+ const START$12 = 0;
1217
1244
  const CHECK_POLICY = "@r_masseater/msch";
1218
1245
  const isCheckPolicy = ({ packageName }) => Option.contains(packageName, CHECK_POLICY);
1219
1246
  const messageFor = (directory) => `names the workspace ${directory}. The root README, AGENTS.md and CLAUDE.md describe the repository as a whole. Write what belongs to the workspace in ${directory}/README.md, or for agents in ${directory}/AGENTS.md.`;
1220
- const problemsIn$6 = (file, source) => ({ directory, pattern }) => {
1247
+ const problemsIn$10 = (file, source) => ({ directory, pattern }) => {
1221
1248
  const message = messageFor(directory);
1222
1249
  const at = positionOf(source);
1223
1250
  return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
1224
1251
  file,
1225
- ...at(found.index ?? START$5),
1226
- rule: RULE$12,
1252
+ ...at(found.index ?? START$12),
1253
+ rule: RULE$20,
1227
1254
  message
1228
1255
  })));
1229
1256
  };
@@ -1231,7 +1258,7 @@ const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadm
1231
1258
  const text = yield* (yield* RepositoryFiles).readFile(file);
1232
1259
  return pipe(text, Option.match({
1233
1260
  onNone: () => [],
1234
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$6(file, source)))
1261
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$10(file, source)))
1235
1262
  }));
1236
1263
  });
1237
1264
  /** @internal */
@@ -1241,7 +1268,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
1241
1268
  const readmes = pipe(names, Array.filter((name) => ROOT_DOC.test(name)));
1242
1269
  const named = yield* namedWorkspaces(root);
1243
1270
  const workspaces = pipe(named, Array.filter((workspace) => !isCheckPolicy(workspace)));
1244
- const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces), { concurrency: READ_CONCURRENCY$11 });
1271
+ const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces), { concurrency: READ_CONCURRENCY$15 });
1245
1272
  return Array.flatten(found);
1246
1273
  });
1247
1274
  // src/features/placement/model/placement-checks.ts
@@ -1252,7 +1279,8 @@ const checkPlacement = Effect.fn("checkPlacement")(function* checkPlacement(root
1252
1279
  checkRootReadme(root),
1253
1280
  checkRootDocs(root),
1254
1281
  checkColocatedTests(root),
1255
- checkAgentDocsLength(root)
1282
+ checkAgentDocsLength(root),
1283
+ checkDanglingLinks(root)
1256
1284
  ], { concurrency: "unbounded" });
1257
1285
  return Array.flatten(found);
1258
1286
  });
@@ -1263,20 +1291,20 @@ const SCRIPTS = "scripts-directory";
1263
1291
  const BIN = "bin";
1264
1292
  const SCRIPTS_DIRECTORY = "scripts";
1265
1293
  const WORKFLOW_DIRECTORY$1 = ".github/";
1266
- const SEPARATOR$5 = "/";
1294
+ const SEPARATOR$8 = "/";
1267
1295
  const CURRENT = "./";
1268
- const READ_CONCURRENCY$10 = 8;
1269
- const FIRST$5 = 1;
1296
+ const READ_CONCURRENCY$14 = 8;
1297
+ const FIRST$8 = 1;
1270
1298
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
1271
1299
  const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
1272
1300
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
1273
- const Manifest = Schema.Struct({
1301
+ const Manifest$1 = Schema.Struct({
1274
1302
  bin: Schema.optional(Schema.Unknown),
1275
1303
  main: Schema.optional(Schema.Unknown),
1276
1304
  exports: Schema.optional(Schema.Unknown)
1277
1305
  });
1278
1306
  const TargetMap = Schema.Record(Schema.String, Schema.Unknown);
1279
- const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
1307
+ const decodeManifest$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$1));
1280
1308
  const decodeTarget = Schema.decodeUnknownOption(Schema.String);
1281
1309
  const decodeTargetMap = Schema.decodeUnknownOption(TargetMap);
1282
1310
  const NO_ENTRIES = {
@@ -1303,22 +1331,22 @@ const entriesOf$1 = (manifest) => {
1303
1331
  const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
1304
1332
  const files = yield* RepositoryFiles;
1305
1333
  const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE));
1306
- return pipe(text, Option.flatMap(decodeManifest), Option.map(entriesOf$1), Option.getOrElse(() => NO_ENTRIES));
1334
+ return pipe(text, Option.flatMap(decodeManifest$1), Option.map(entriesOf$1), Option.getOrElse(() => NO_ENTRIES));
1307
1335
  });
1308
1336
  const isCommand$1 = (path) => COMMAND.test(path) && !NOT_COMMAND.test(path);
1309
1337
  const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
1310
1338
  const files = yield* RepositoryFiles;
1311
1339
  const names = yield* files.readDirectory(files.join(root, directory, BIN));
1312
- return pipe(names, Array.map((name) => `${BIN}${SEPARATOR$5}${name}`), Array.filter(isCommand$1));
1340
+ return pipe(names, Array.map((name) => `${BIN}${SEPARATOR$8}${name}`), Array.filter(isCommand$1));
1313
1341
  });
1314
1342
  const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
1315
1343
  const files = yield* RepositoryFiles;
1316
1344
  const listed = yield* files.listedFiles(root);
1317
1345
  const workflows = pipe(listed, Array.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
1318
- const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$10 });
1346
+ const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$14 });
1319
1347
  return pipe(Array.getSomes(texts), Array.join("\n"));
1320
1348
  });
1321
- const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$5));
1349
+ const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$8));
1322
1350
  const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.filter(({ path }) => !COMMAND.test(path) && !Array.contains(entries.all, path)), Array.map(({ path, start }) => ({
1323
1351
  file,
1324
1352
  ...positionOf(source)(start),
@@ -1326,7 +1354,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
1326
1354
  message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
1327
1355
  })));
1328
1356
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
1329
- const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
1357
+ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
1330
1358
  const files = yield* RepositoryFiles;
1331
1359
  const config = yield* workspaceConfigOf(root, directory);
1332
1360
  const entries = yield* declaredEntries(root, directory);
@@ -1342,8 +1370,8 @@ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn(root, director
1342
1370
  const isRun = (path) => Array.contains(runPaths, path) || Array.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
1343
1371
  const unrun = pipe(commands, Array.filter((path) => !isRun(path)), Array.map((path) => ({
1344
1372
  file: files.join(root, directory, path),
1345
- line: FIRST$5,
1346
- column: FIRST$5,
1373
+ line: FIRST$8,
1374
+ column: FIRST$8,
1347
1375
  rule: UNRUN,
1348
1376
  message: `No task, package.json bin or workflow runs ${workspacePath(directory, path)}. Files in ${BIN}/ are entry points for fallow, so an unused one is never reported. Run it from a task or delete it.`
1349
1377
  })));
@@ -1355,8 +1383,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
1355
1383
  const isDirectory = yield* files.isDirectory(file);
1356
1384
  return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
1357
1385
  file,
1358
- line: FIRST$5,
1359
- column: FIRST$5,
1386
+ line: FIRST$8,
1387
+ column: FIRST$8,
1360
1388
  rule: SCRIPTS,
1361
1389
  message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
1362
1390
  })));
@@ -1365,17 +1393,17 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
1365
1393
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
1366
1394
  const all = ["", ...yield* workspaceDirectories(root)];
1367
1395
  const workflows = yield* workflowText(root);
1368
- const found = yield* Effect.forEach(all, (directory) => problemsIn$5(root, directory, workflows), { concurrency: READ_CONCURRENCY$10 });
1369
- const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$10 });
1396
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$9(root, directory, workflows), { concurrency: READ_CONCURRENCY$14 });
1397
+ const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$14 });
1370
1398
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
1371
1399
  });
1372
1400
  // src/features/repository-layout/model/crates.ts
1373
- const RULE$11 = "unverified-crate";
1401
+ const RULE$19 = "unverified-crate";
1374
1402
  const CARGO_FILE = "Cargo.toml";
1375
1403
  const CONFIG_FILE$3 = "vite.config.ts";
1376
- const SEPARATOR$4 = "/";
1377
- const FIRST$4 = 1;
1378
- const READ_CONCURRENCY$9 = 8;
1404
+ const SEPARATOR$7 = "/";
1405
+ const FIRST$7 = 1;
1406
+ const READ_CONCURRENCY$13 = 8;
1379
1407
  const CrateEntry = Schema.Struct({
1380
1408
  name: Schema.String,
1381
1409
  manifest_path: Schema.String
@@ -1401,22 +1429,22 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
1401
1429
  })));
1402
1430
  }, Effect.scoped);
1403
1431
  const owningWorkspace = (directories) => (directory) => {
1404
- const owners = pipe(directories, Array.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$4}`)(directory)));
1432
+ const owners = pipe(directories, Array.filter((workspace) => directory === workspace || String$1.startsWith(`${workspace}${SEPARATOR$7}`)(directory)));
1405
1433
  return Array.last(Array.sort(owners, String$1.Order));
1406
1434
  };
1407
- const problemFor$1 = (crate, message) => ({
1435
+ const problemFor$2 = (crate, message) => ({
1408
1436
  file: crate.manifest,
1409
- line: FIRST$4,
1410
- column: FIRST$4,
1411
- rule: RULE$11,
1437
+ line: FIRST$7,
1438
+ column: FIRST$7,
1439
+ rule: RULE$19,
1412
1440
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
1413
1441
  });
1414
- const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
1442
+ const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
1415
1443
  const files = yield* RepositoryFiles;
1416
1444
  const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
1417
- if (Option.isNone(workspace)) return Option.some(problemFor$1(crate, "is outside every workspace package"));
1445
+ if (Option.isNone(workspace)) return Option.some(problemFor$2(crate, "is outside every workspace package"));
1418
1446
  if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$3))) return Option.none();
1419
- return Option.some(problemFor$1(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$3} has no verify task`));
1447
+ return Option.some(problemFor$2(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$3} has no verify task`));
1420
1448
  });
1421
1449
  /** @internal */
1422
1450
  const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
@@ -1424,11 +1452,11 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
1424
1452
  if (!(yield* files.exists(files.join(root, CARGO_FILE)))) return [];
1425
1453
  const directories = yield* workspaceDirectories(root);
1426
1454
  const crates = yield* cratesIn(root);
1427
- const found = yield* Effect.forEach(crates, (crate) => problemIn$1(root, directories, crate), { concurrency: READ_CONCURRENCY$9 });
1455
+ const found = yield* Effect.forEach(crates, (crate) => problemIn$3(root, directories, crate), { concurrency: READ_CONCURRENCY$13 });
1428
1456
  return Array.getSomes(found);
1429
1457
  });
1430
1458
  // src/features/repository-layout/model/fallow-entries.ts
1431
- const RULE$10 = "listed-entry";
1459
+ const RULE$18 = "listed-entry";
1432
1460
  const ENTRY_KEYS = [
1433
1461
  "entry",
1434
1462
  "entryPoints",
@@ -1436,9 +1464,9 @@ const ENTRY_KEYS = [
1436
1464
  ];
1437
1465
  const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
1438
1466
  const WILDCARD$1 = /[*?{[]/u;
1439
- const SEPARATOR$3 = "/";
1467
+ const SEPARATOR$6 = "/";
1440
1468
  const WRAP_OFFSET = 1;
1441
- const READ_CONCURRENCY$8 = 8;
1469
+ const READ_CONCURRENCY$12 = 8;
1442
1470
  const decodeKey = Schema.decodeUnknownOption(KeySchema);
1443
1471
  const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array.contains(ENTRY_KEYS, keyName(key))));
1444
1472
  const entryPatternsIn = (node) => {
@@ -1448,8 +1476,8 @@ const entryPatternsIn = (node) => {
1448
1476
  })));
1449
1477
  return pipe(childrenOf$2(node), Array.flatMap(entryPatternsIn));
1450
1478
  };
1451
- const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$3}`)(text))) || String$1.includes(SEPARATOR$3)(text) && !WILDCARD$1.test(text);
1452
- const problemsIn$4 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
1479
+ const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$6}`)(text))) || String$1.includes(SEPARATOR$6)(text) && !WILDCARD$1.test(text);
1480
+ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
1453
1481
  const files = yield* RepositoryFiles;
1454
1482
  const path = files.join(root, file);
1455
1483
  const text = yield* files.readFile(path);
@@ -1458,7 +1486,7 @@ const problemsIn$4 = Effect.fn("problemsIn")(function* problemsIn(root, file, di
1458
1486
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
1459
1487
  file: path,
1460
1488
  ...positionOf(text.value)(start),
1461
- rule: RULE$10,
1489
+ rule: RULE$18,
1462
1490
  message: `${pattern} names files one by one. Give fallow a place that every workspace uses the same way, such as bin/*.ts or a tool's config file name, or make fallow find the file through package.json.`
1463
1491
  })));
1464
1492
  });
@@ -1466,15 +1494,15 @@ const problemsIn$4 = Effect.fn("problemsIn")(function* problemsIn(root, file, di
1466
1494
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
1467
1495
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
1468
1496
  const directories = yield* workspaceDirectories(root);
1469
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$4(root, file, directories), { concurrency: READ_CONCURRENCY$8 });
1497
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$8(root, file, directories), { concurrency: READ_CONCURRENCY$12 });
1470
1498
  return Array.flatten(found);
1471
1499
  });
1472
1500
  // src/features/repository-layout/model/hidden-verify.ts
1473
- const RULE$9 = "hidden-verify";
1501
+ const RULE$17 = "hidden-verify";
1474
1502
  const CONFIG_FILE$2 = "vite.config.ts";
1475
- const FIRST$3 = 1;
1476
- const READ_CONCURRENCY$7 = 8;
1477
- const problemIn = Effect.fn("problemIn")(function* problemIn(root, directory) {
1503
+ const FIRST$6 = 1;
1504
+ const READ_CONCURRENCY$11 = 8;
1505
+ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
1478
1506
  const config = yield* workspaceConfigOf(root, directory);
1479
1507
  if (Option.isNone(config)) return Option.none();
1480
1508
  const { file, program } = config.value;
@@ -1482,24 +1510,24 @@ const problemIn = Effect.fn("problemIn")(function* problemIn(root, directory) {
1482
1510
  const verified = yield* hasVerifyTask(file);
1483
1511
  return Option.some({
1484
1512
  file,
1485
- line: FIRST$3,
1486
- column: FIRST$3,
1487
- rule: RULE$9,
1513
+ line: FIRST$6,
1514
+ column: FIRST$6,
1515
+ rule: RULE$17,
1488
1516
  message: `${directory} gets its verify task from code outside ${CONFIG_FILE$2}. The root verify reads ${CONFIG_FILE$2} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$2}.`
1489
1517
  }).pipe(Option.filter(() => verified));
1490
1518
  });
1491
1519
  /** @internal */
1492
1520
  const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
1493
1521
  const directories = yield* workspaceDirectories(root);
1494
- const found = yield* Effect.forEach(directories, (directory) => problemIn(root, directory), { concurrency: READ_CONCURRENCY$7 });
1522
+ const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$11 });
1495
1523
  return Array.getSomes(found);
1496
1524
  });
1497
1525
  // src/features/repository-layout/model/root-workspace-paths.ts
1498
- const RULE$8 = "root-workspace-path";
1526
+ const RULE$16 = "root-workspace-path";
1499
1527
  const CONFIG_FILE$1 = "vite.config.ts";
1500
1528
  const PATH_CHARACTER = /[\w.@/-]/u;
1501
1529
  const NAME_CHARACTER = /[\w.@-]/u;
1502
- const FIRST$2 = 0;
1530
+ const FIRST$5 = 0;
1503
1531
  const NEXT$2 = 1;
1504
1532
  const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
1505
1533
  const mentions = (directory) => (text) => {
@@ -1507,14 +1535,14 @@ const mentions = (directory) => (text) => {
1507
1535
  return pipe(Array.drop(parts, NEXT$2), Array.some((after, index) => {
1508
1536
  const before = parts[index] ?? "";
1509
1537
  const previous = String$1.slice(before.length - NEXT$2)(before);
1510
- const following = String$1.slice(FIRST$2, NEXT$2)(after);
1538
+ const following = String$1.slice(FIRST$5, NEXT$2)(after);
1511
1539
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
1512
1540
  }));
1513
1541
  };
1514
- const problemsIn$3 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
1542
+ const problemsIn$7 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
1515
1543
  file,
1516
1544
  ...positionOf(source)(found.start),
1517
- rule: RULE$8,
1545
+ rule: RULE$16,
1518
1546
  message: `${directory} is a workspace. The root ${CONFIG_FILE$1} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$1}: msch.lint, msch.devDependencies or its verify task.`
1519
1547
  })));
1520
1548
  /** @internal */
@@ -1525,30 +1553,17 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
1525
1553
  if (Option.isNone(source)) return [];
1526
1554
  const directories = yield* workspaceDirectories(root);
1527
1555
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
1528
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$3(file, source.value, directories)));
1556
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$7(file, source.value, directories)));
1529
1557
  });
1530
1558
  // src/features/repository-layout/model/shared-uncached-tasks.ts
1531
- const RULE$7 = "shared-uncached-task";
1532
- const READ_CONCURRENCY$6 = 8;
1559
+ const RULE$15 = "shared-uncached-task";
1560
+ const READ_CONCURRENCY$10 = 8;
1533
1561
  const SHARED = 2;
1534
1562
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
1535
- const TaskProperty = Schema.Struct({
1536
- type: Schema.Literal("Property"),
1537
- computed: Schema.Literal(false),
1538
- key: KeySchema,
1539
- value: Schema.Unknown,
1540
- start: Schema.Finite
1541
- });
1542
- const TaskObject = Schema.Struct({
1543
- type: Schema.Literal("ObjectExpression"),
1544
- properties: Schema.Array(Schema.Unknown)
1545
- });
1546
1563
  const UncachedTask = Schema.Struct({
1547
1564
  cache: Schema.Literal(false),
1548
1565
  command: Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)])
1549
1566
  });
1550
- const decodeTaskProperty = Schema.decodeUnknownOption(TaskProperty);
1551
- const decodeTaskObject = Schema.decodeUnknownOption(TaskObject);
1552
1567
  const decodeUncachedTask = Schema.decodeUnknownOption(UncachedTask);
1553
1568
  const encodeDefinition = Schema.encodeOption(Schema.fromJsonString(Schema.Unknown));
1554
1569
  const commandText$1 = (command) => Array.join(Array.ensure(command), " && ");
@@ -1569,30 +1584,30 @@ const definitionOf = ({ directory, file, source }) => (task) => Option.gen(funct
1569
1584
  };
1570
1585
  });
1571
1586
  const definitionsIn = Effect.fn("definitionsIn")(function* definitionsIn(root, directory) {
1572
- const config = yield* workspaceConfigOf(root, directory);
1573
- if (Option.isNone(config)) return [];
1574
- const { file, source, program } = config.value;
1575
- return pipe(nestedValues(RUN_TASKS)(program), Array.flatMap((tasks) => pipe(decodeTaskObject(tasks), Option.map(({ properties }) => properties), Option.getOrElse(() => []))), Array.flatMap((property) => pipe(decodeTaskProperty(property), Option.flatMap(definitionOf({
1587
+ const found = yield* runTasksOf(root, directory);
1588
+ if (Option.isNone(found)) return [];
1589
+ const { file, source, tasks } = found.value;
1590
+ return pipe(tasks, Array.flatMap((task) => Option.toArray(definitionOf({
1576
1591
  directory,
1577
1592
  file,
1578
1593
  source
1579
- })), Option.toArray)));
1594
+ })(task))));
1580
1595
  });
1581
- const problemsOf = (definitions) => {
1596
+ const problemsOf$1 = (definitions) => {
1582
1597
  const directories = pipe(definitions, Array.map(({ directory }) => directory), Array.dedupe);
1583
1598
  if (directories.length < SHARED) return [];
1584
1599
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
1585
1600
  file,
1586
1601
  ...position,
1587
- rule: RULE$7,
1602
+ rule: RULE$15,
1588
1603
  message: `The uncached task ${name} (${command}) is written the same way in ${Array.join(directories, ", ")}. Write it once in a shared helper and spread it into each run.tasks, so that a change to it reaches every workspace.`
1589
1604
  })));
1590
1605
  };
1591
1606
  /** @internal */
1592
1607
  const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
1593
1608
  const directories = yield* workspaceDirectories(root);
1594
- const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$6 });
1595
- return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf));
1609
+ const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$10 });
1610
+ return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$1));
1596
1611
  });
1597
1612
  // src/features/repository-layout/model/workflow-nodes.ts
1598
1613
  const MISSING_OFFSET = 0;
@@ -1600,11 +1615,11 @@ const isRanged = (node) => isScalar(node) || isMap(node) || isSeq(node);
1600
1615
  /** @internal */
1601
1616
  const isText$1 = (node) => isScalar(node) && typeof node.value === "string";
1602
1617
  const isTextPair = (pair) => isPair(pair) && isText$1(pair.key);
1603
- const offsetOf = (node) => pipe(Option.liftPredicate(node, isRanged), Option.flatMap((ranged) => Option.fromNullishOr(ranged.range)), Option.map(([start]) => start), Option.getOrElse(() => MISSING_OFFSET));
1618
+ const offsetOf$3 = (node) => pipe(Option.liftPredicate(node, isRanged), Option.flatMap((ranged) => Option.fromNullishOr(ranged.range)), Option.map(([start]) => start), Option.getOrElse(() => MISSING_OFFSET));
1604
1619
  /** @internal */
1605
1620
  const stringOf = (node) => pipe(Option.liftPredicate(node, isText$1), Option.map((scalar) => ({
1606
1621
  text: scalar.value,
1607
- offset: offsetOf(scalar)
1622
+ offset: offsetOf$3(scalar)
1608
1623
  })));
1609
1624
  /** @internal */
1610
1625
  const childOf = (key) => (node) => pipe(Option.liftPredicate(node, isMap), Option.map((map) => map.get(key, true)), Option.getOrUndefined);
@@ -1630,8 +1645,8 @@ const scalarsIn = (source) => {
1630
1645
  const ROOT = ".";
1631
1646
  const LOCAL = "./";
1632
1647
  const NEGATION = "!";
1633
- const SEPARATOR$2 = "/";
1634
- const LINE = "\n";
1648
+ const SEPARATOR$5 = "/";
1649
+ const LINE$1 = "\n";
1635
1650
  const UNRESOLVED_MARKERS = [
1636
1651
  "${{",
1637
1652
  "$",
@@ -1640,9 +1655,9 @@ const UNRESOLVED_MARKERS = [
1640
1655
  const ABSOLUTE_MARKERS = ["/", "~"];
1641
1656
  const FILE_INPUT_SUFFIX = "-file";
1642
1657
  const DEPENDENCY_PATH_INPUT = "cache-dependency-path";
1643
- const FILTER_KEYS = ["paths", "paths-ignore"];
1658
+ const FILTER_KEYS$1 = ["paths", "paths-ignore"];
1644
1659
  const HASH_FILES = /hashFiles\((?<arguments>[^)]*)\)/gu;
1645
- const QUOTED$1 = /'(?<path>[^']*)'/gu;
1660
+ const QUOTED$2 = /'(?<path>[^']*)'/gu;
1646
1661
  const SCRIPT = /^[\w.@/-]+\.(?:ts|mts|cts|sh)$/u;
1647
1662
  const TOKEN_SEPARATOR = /[\s;&|()<>"'`=]+/u;
1648
1663
  /** @internal */
@@ -1657,7 +1672,7 @@ const withoutLocal = (path) => {
1657
1672
  const joinPath = (base, path) => {
1658
1673
  const relative = withoutLocal(String$1.trim(path));
1659
1674
  if (base === ROOT) return relative;
1660
- return `${base}${SEPARATOR$2}${relative}`;
1675
+ return `${base}${SEPARATOR$5}${relative}`;
1661
1676
  };
1662
1677
  const reference = (kind, field, base = ROOT) => ({ text, offset }) => {
1663
1678
  const path = String$1.trim(text);
@@ -1671,7 +1686,7 @@ const reference = (kind, field, base = ROOT) => ({ text, offset }) => {
1671
1686
  };
1672
1687
  const isPositive = ({ text }) => !String$1.startsWith(NEGATION)(String$1.trim(text));
1673
1688
  const globsIn = (field, node) => pipe(itemsOf(node), Array.flatMap((item) => Option.toArray(stringOf(item))), Array.filter(isPositive), Array.flatMap(reference("glob", field)));
1674
- const filtersOf = ([event, filters]) => pipe(FILTER_KEYS, Array.flatMap((key) => globsIn(`on.${event}.${key}`, childOf(key)(filters))));
1689
+ const filtersOf = ([event, filters]) => pipe(FILTER_KEYS$1, Array.flatMap((key) => globsIn(`on.${event}.${key}`, childOf(key)(filters))));
1675
1690
  const directoryOf$1 = (located, base) => pipe(located, Option.map(({ text }) => joinPath(ROOT, text)), Option.getOrElse(() => base));
1676
1691
  const located = (kind, field, base = ROOT) => (found) => pipe(found, Option.toArray, Array.flatMap(reference(kind, field, base)));
1677
1692
  const localUses = (node) => pipe(stringOf(childOf("uses")(node)), Option.filter(({ text }) => String$1.startsWith(LOCAL)(text)));
@@ -1680,7 +1695,7 @@ const scriptsIn = (field, base) => ({ text, offset }) => pipe(String$1.split(tex
1680
1695
  offset
1681
1696
  })));
1682
1697
  const isFileInput = ([key]) => String$1.endsWith(FILE_INPUT_SUFFIX)(key) || key === DEPENDENCY_PATH_INPUT;
1683
- const linesOf = ({ text, offset }) => pipe(String$1.split(text, LINE), Array.map((line) => ({
1698
+ const linesOf = ({ text, offset }) => pipe(String$1.split(text, LINE$1), Array.map((line) => ({
1684
1699
  text: line,
1685
1700
  offset
1686
1701
  })));
@@ -1711,7 +1726,7 @@ const groupsOf = (pattern, group) => ({ text, offset }) => pipe(Array.fromIterab
1711
1726
  text: value,
1712
1727
  offset
1713
1728
  })));
1714
- const hashFilesIn = (source) => pipe(scalarsIn(source), Array.flatMap(groupsOf(HASH_FILES, "arguments")), Array.flatMap(groupsOf(QUOTED$1, "path")), Array.filter(isPositive), Array.flatMap(reference("glob", "hashFiles")));
1729
+ const hashFilesIn = (source) => pipe(scalarsIn(source), Array.flatMap(groupsOf(HASH_FILES, "arguments")), Array.flatMap(groupsOf(QUOTED$2, "path")), Array.filter(isPositive), Array.flatMap(reference("glob", "hashFiles")));
1715
1730
  const jobsOf = (source) => entriesOf(childOf("jobs")(parseDocument(source).contents));
1716
1731
  /** @internal */
1717
1732
  const workflowReferences = (source) => {
@@ -1730,13 +1745,13 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
1730
1745
  /** @internal */
1731
1746
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
1732
1747
  // src/features/repository-layout/model/workflow-paths.ts
1733
- const RULE$6 = "workflow-path";
1748
+ const RULE$14 = "workflow-path";
1734
1749
  const WORKFLOW_DIRECTORY = ".github/workflows/";
1735
1750
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
1736
- const READ_CONCURRENCY$5 = 8;
1751
+ const READ_CONCURRENCY$9 = 8;
1737
1752
  const WILDCARD = /[*?[]/u;
1738
- const SEPARATOR$1 = "/";
1739
- const FIRST$1 = 0;
1753
+ const SEPARATOR$4 = "/";
1754
+ const FIRST$4 = 0;
1740
1755
  const EXPECTED = {
1741
1756
  action: "a directory with action.yml",
1742
1757
  directory: "a directory",
@@ -1760,10 +1775,10 @@ const isDirectoryAt = Effect.fn("isDirectoryAt")(function* isDirectoryAt(root, p
1760
1775
  return Option.getOrElse(directory, () => false);
1761
1776
  });
1762
1777
  const hasAction = Effect.fn("hasAction")(function* hasAction(root, path) {
1763
- const found = yield* pipe(ACTION_DEFINITIONS, Effect.forEach((name) => existsAt(root, `${path}${SEPARATOR$1}${name}`)));
1778
+ const found = yield* pipe(ACTION_DEFINITIONS, Effect.forEach((name) => existsAt(root, `${path}${SEPARATOR$4}${name}`)));
1764
1779
  return pipe(found, Array.some(Boolean));
1765
1780
  });
1766
- const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array.drop(index), Array.join(SEPARATOR$1))}`;
1781
+ const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array.drop(index), Array.join(SEPARATOR$4))}`;
1767
1782
  const RESOLVERS = {
1768
1783
  action: hasAction,
1769
1784
  directory: isDirectoryAt,
@@ -1771,13 +1786,13 @@ const RESOLVERS = {
1771
1786
  glob: matchesGlob,
1772
1787
  script: Effect.fn("findsScript")(function* findsScript(root, path) {
1773
1788
  if (yield* existsAt(root, path)) return true;
1774
- const segments = String$1.split(path, SEPARATOR$1);
1789
+ const segments = String$1.split(path, SEPARATOR$4);
1775
1790
  return yield* matchesAny(root, Array.makeBy(segments.length, suffixAt(segments)));
1776
1791
  })
1777
1792
  };
1778
1793
  const staticPrefix = (path) => {
1779
1794
  const prefix = Array.headNonEmpty(String$1.split(path, WILDCARD));
1780
- if (String$1.endsWith(SEPARATOR$1)(prefix)) return String$1.slice(FIRST$1, -1)(prefix);
1795
+ if (String$1.endsWith(SEPARATOR$4)(prefix)) return String$1.slice(FIRST$4, -1)(prefix);
1781
1796
  return prefix;
1782
1797
  };
1783
1798
  const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
@@ -1786,34 +1801,127 @@ const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
1786
1801
  const ignored = yield* (yield* RepositoryFiles).ignoredPaths(root, [prefix]);
1787
1802
  return Array.isReadonlyArrayNonEmpty(ignored);
1788
1803
  });
1789
- const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$1}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$1}`)(path);
1804
+ const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$4}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$4}`)(path);
1790
1805
  const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, found) {
1791
1806
  const prefix = staticPrefix(found.path);
1792
1807
  if (pipe(produced, Array.some(overlaps(prefix)))) return false;
1793
1808
  if (yield* RESOLVERS[found.kind](root, found.path)) return false;
1794
1809
  return !(yield* isIgnored$1(root, found.path));
1795
1810
  });
1796
- const problemOf$3 = (file, source) => (found) => ({
1811
+ const problemOf$5 = (file, source) => (found) => ({
1797
1812
  file,
1798
1813
  ...positionOf(source)(found.offset),
1799
- rule: RULE$6,
1814
+ rule: RULE$14,
1800
1815
  message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`
1801
1816
  });
1802
- const problemsIn$2 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
1817
+ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
1803
1818
  const files = yield* RepositoryFiles;
1804
1819
  const file = files.join(root, workflow);
1805
1820
  const source = yield* files.readFile(file);
1806
1821
  if (Option.isNone(source)) return [];
1807
1822
  const produced = producedPaths(source.value);
1808
1823
  const missing = yield* Effect.filter(workflowReferences(source.value), (found) => isMissing(root, produced, found));
1809
- return pipe(missing, Array.map(problemOf$3(file, source.value)));
1824
+ return pipe(missing, Array.map(problemOf$5(file, source.value)));
1810
1825
  });
1811
1826
  /** @internal */
1812
1827
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
1813
1828
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
1814
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$2(root, workflow), { concurrency: READ_CONCURRENCY$5 });
1829
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$6(root, workflow), { concurrency: READ_CONCURRENCY$9 });
1815
1830
  return Array.flatten(found);
1816
1831
  });
1832
+ // src/features/repository-layout/model/workflow-scale.ts
1833
+ const PATH_FILTER = "workflow-path-filter";
1834
+ const PACKAGE = "workflow-package";
1835
+ const WORKFLOW = /^\.github\/workflows\/(?<name>[^/]+)\.ya?ml$/u;
1836
+ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
1837
+ const FILTER_KEYS = ["paths", "paths-ignore"];
1838
+ const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
1839
+ const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
1840
+ const START$11 = 0;
1841
+ const READ_CONCURRENCY$8 = 8;
1842
+ const SEPARATOR$3 = "/";
1843
+ const WORD_SEPARATORS = /[-_]/gu;
1844
+ const SPACE = " ";
1845
+ const FILTER_MESSAGE = "A workflow that reacts to changes under listed paths needs a new entry for every package and drifts from the packages it is meant to cover. Run the generic pipeline on every push and let it decide from the workspace what changed.";
1846
+ const packageMessage = (what, directory) => `${what} names the workspace ${directory}. A workflow or job made for one package does not scale: give the package a vp task and let the generic pipeline (verify, deploy, release, daily, task) find it.`;
1847
+ const keysOf = (node) => pipe(Option.liftPredicate(node, isMap), Option.map((map) => map.items), Option.getOrElse(() => []), Array.filter(isPair), Array.flatMap(({ key }) => Option.toArray(stringOf(key))));
1848
+ const problemAt$1 = ({ file, source }, rule, message) => (offset) => ({
1849
+ file,
1850
+ ...positionOf(source)(offset),
1851
+ rule,
1852
+ message
1853
+ });
1854
+ const pathFiltersIn = (file, source) => {
1855
+ const root = parseDocument(source).contents;
1856
+ const triggers = pipe(entriesOf(childOf("on")(root)), Array.flatMap(([, trigger]) => keysOf(trigger)), Array.filter(({ text }) => Array.contains(FILTER_KEYS, text)));
1857
+ const actions = pipe(scalarsIn(source), Array.filter(({ text }) => PATHS_FILTER_ACTION.test(text)));
1858
+ return pipe([...triggers, ...actions], Array.map(({ offset }) => problemAt$1({
1859
+ file,
1860
+ source
1861
+ }, PATH_FILTER, FILTER_MESSAGE)(offset)));
1862
+ };
1863
+ const matching = (workspaces, text) => pipe(workspaces, Array.findFirst(({ pattern }) => Option.isSome(String$1.match(pattern)(text))), Option.map(({ directory }) => directory));
1864
+ const named = (workspaces, text) => Option.orElse(matching(workspaces, text), () => matching(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
1865
+ const containing = (workspaces, path) => pipe(workspaces, Array.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$3}`)(path)), Option.map(({ directory }) => directory));
1866
+ const namesIn = (name, source) => {
1867
+ const root = parseDocument(source).contents;
1868
+ return [
1869
+ {
1870
+ text: name,
1871
+ offset: START$11
1872
+ },
1873
+ ...Option.toArray(stringOf(childOf("name")(root))),
1874
+ ...keysOf(childOf("jobs")(root))
1875
+ ];
1876
+ };
1877
+ const filtersIn = (source) => pipe(scalarsIn(source), Array.flatMap(({ text, offset }) => pipe(Array.fromIterable(String$1.matchAll(PACKAGE_FILTER)(text)), Array.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap((groups) => Option.fromNullishOr(groups["value"])), Option.toArray)), Array.map((value) => ({
1878
+ text: value,
1879
+ offset
1880
+ })))));
1881
+ const reported = (where, offset, what) => (found) => pipe(found, Option.map((directory) => problemAt$1(where, PACKAGE, packageMessage(what, directory))(offset)), Option.toArray);
1882
+ const packagesIn = (workspaces, { file, name, source }) => {
1883
+ const where = {
1884
+ file,
1885
+ source
1886
+ };
1887
+ const fromNames = pipe(namesIn(name, source), Array.flatMap(({ text, offset }) => reported(where, offset, `"${text}"`)(named(workspaces, text))));
1888
+ const referenced = pipe(workflowReferences(source), Array.filter(({ field }) => !String$1.startsWith("on.")(field)), Array.flatMap(({ field, path, offset }) => reported(where, offset, field)(containing(workspaces, path))));
1889
+ const filtered = pipe(filtersIn(source), Array.flatMap(({ text, offset }) => reported(where, offset, `--filter ${text}`)(matching(workspaces, text))));
1890
+ return [
1891
+ ...fromNames,
1892
+ ...referenced,
1893
+ ...filtered
1894
+ ];
1895
+ };
1896
+ const actionProblems = (workspaces, file, name) => pipe(named(workspaces, name), Option.map((directory) => ({
1897
+ file,
1898
+ line: 1,
1899
+ column: 1,
1900
+ rule: PACKAGE,
1901
+ message: packageMessage(`The action ${name}`, directory)
1902
+ })), Option.toArray);
1903
+ const groupOf = (pattern, name) => pipe(String$1.match(pattern)(name), Option.flatMap((match) => Option.fromNullishOr(match.groups)), Option.flatMap((groups) => Option.fromNullishOr(groups["name"])));
1904
+ /** @internal */
1905
+ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkflowScale(root) {
1906
+ const files = yield* RepositoryFiles;
1907
+ const listed = yield* files.listedFiles(root);
1908
+ const workspaces = yield* namedWorkspaces(root);
1909
+ const workflows = pipe(listed, Array.flatMap((name) => pipe(groupOf(WORKFLOW, name), Option.map((stem) => ({
1910
+ name,
1911
+ stem
1912
+ })), Option.toArray)));
1913
+ const found = yield* Effect.forEach(workflows, ({ name, stem }) => Effect.gen(function* problemsOf() {
1914
+ const file = files.join(root, name);
1915
+ const source = yield* files.readFile(file);
1916
+ return pipe(source, Option.map((text) => [...pathFiltersIn(file, text), ...packagesIn(workspaces, {
1917
+ file,
1918
+ name: stem,
1919
+ source: text
1920
+ })]), Option.getOrElse(() => []));
1921
+ }), { concurrency: READ_CONCURRENCY$8 });
1922
+ const actions = pipe(listed, Array.flatMap((name) => pipe(groupOf(ACTION, name), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
1923
+ return [...Array.flatten(found), ...actions];
1924
+ });
1817
1925
  // src/features/repository-layout/model/workspace-checks.ts
1818
1926
  /** @internal */
1819
1927
  const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(root) {
@@ -1824,153 +1932,13 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
1824
1932
  checkHiddenVerify(root),
1825
1933
  checkRootWorkspacePaths(root),
1826
1934
  checkSharedUncachedTasks(root),
1827
- checkWorkflowPaths(root)
1935
+ checkWorkflowPaths(root),
1936
+ checkWorkflowScale(root)
1828
1937
  ], { concurrency: "unbounded" });
1829
1938
  return Array.flatten(found);
1830
1939
  });
1831
- // src/features/scripts/model/shell-scripts.ts
1832
- const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
1833
- const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
1834
- const EXTENSION = /\.[^./]+$/u;
1835
- const SETTINGS_FILE = ".claude/settings.json";
1836
- const READ_CONCURRENCY$4 = 64;
1837
- const FIRST = 1;
1838
- const RULE$5 = "shell-script";
1839
- const MESSAGE$3 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
1840
- const HookSchema = Schema.Struct({
1841
- command: Schema.optional(Schema.String),
1842
- args: Schema.optional(Schema.Array(Schema.String))
1843
- });
1844
- const MatcherSchema = Schema.Struct({ hooks: Schema.Array(HookSchema) });
1845
- const HooksSchema = Schema.Struct({ SessionStart: Schema.optional(Schema.Array(MatcherSchema)) });
1846
- const SettingsSchema = Schema.Struct({ hooks: Schema.optional(HooksSchema) });
1847
- const decodeSettings = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
1848
- const NO_TEXT = [];
1849
- const commandText = ({ command, args }) => [...Option.toArray(Option.fromUndefinedOr(command)), ...pipe(Option.fromUndefinedOr(args), Option.getOrElse(() => NO_TEXT))];
1850
- const matcherText = ({ hooks }) => pipe(hooks, Array.flatMap((hook) => commandText(hook)));
1851
- const sessionStartCommands = (source) => {
1852
- const matchers = pipe(decodeSettings(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.flatMap(({ SessionStart }) => Option.fromUndefinedOr(SessionStart)));
1853
- return pipe(matchers, Option.map(Array.flatMap((matcher) => matcherText(matcher))), Option.getOrElse(() => NO_TEXT));
1854
- };
1855
- const baseName = (name) => pipe(String$1.split("/")(name), Array.last, Option.getOrElse(() => name));
1856
- const hasExtension = (name) => EXTENSION.test(baseName(name));
1857
- const problemFor = (file) => ({
1858
- file,
1859
- line: FIRST,
1860
- column: FIRST,
1861
- rule: RULE$5,
1862
- message: MESSAGE$3
1863
- });
1864
- /** @internal */
1865
- const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScripts(root) {
1866
- const files = yield* RepositoryFiles;
1867
- const names = yield* files.listedFiles(root);
1868
- const settings = yield* files.readFile(files.join(root, SETTINGS_FILE));
1869
- const commands = pipe(settings, Option.map(sessionStartCommands), Option.getOrElse(() => NO_TEXT));
1870
- const isSessionStartHook = (name) => pipe(commands, Array.some(String$1.includes(name)));
1871
- const isShell = (name) => {
1872
- const file = files.join(root, name);
1873
- if (SHELL_FILE.test(name)) return files.exists(file);
1874
- if (hasExtension(name)) return Effect.succeed(false);
1875
- return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
1876
- };
1877
- const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
1878
- const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$4 });
1879
- return pipe(shell, Array.map((name) => problemFor(files.join(root, name))));
1880
- });
1881
- // src/shared/lib/workflow-files.ts
1882
- const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
1883
- const READ_CONCURRENCY$3 = 16;
1884
- const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
1885
- const files = yield* RepositoryFiles;
1886
- const names = yield* files.listedFiles(root);
1887
- const found = yield* Effect.forEach(pipe(names, Array.filter((name) => WORKFLOW_FILE.test(name))), (name) => {
1888
- const file = files.join(root, name);
1889
- return files.readFile(file).pipe(Effect.map(Option.map((source) => ({
1890
- file,
1891
- source
1892
- }))));
1893
- }, { concurrency: READ_CONCURRENCY$3 });
1894
- return Array.getSomes(found);
1895
- });
1896
- // src/features/scripts/model/workflows.ts
1897
- const COMMAND_CHAIN = /&&|\|\||;|\|/u;
1898
- const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
1899
- const COMMENT = "#";
1900
- const RUN_KEY = "run";
1901
- const RULE$4 = "workflow-script";
1902
- const START$4 = 0;
1903
- const ONE_COMMAND = 1;
1904
- const MESSAGE$2 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
1905
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$4));
1906
- const runScriptsOf = (source) => {
1907
- const found = [];
1908
- visit(parseDocument(source), { Pair: (_key, pair) => {
1909
- if (isPair(pair) && isScalar(pair.key) && pair.key.value === RUN_KEY && isScalar(pair.value) && typeof pair.value.value === "string") found.push({
1910
- text: pair.value.value,
1911
- start: startOf(pair.value.range)
1912
- });
1913
- } });
1914
- return found;
1915
- };
1916
- const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
1917
- const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED, "")(line));
1918
- const runsMoreThanOneCommand = ({ text }) => {
1919
- const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
1920
- return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
1921
- };
1922
- const problemsIn$1 = (file) => (source) => {
1923
- const at = positionOf(source);
1924
- return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
1925
- file,
1926
- ...at(start),
1927
- rule: RULE$4,
1928
- message: MESSAGE$2
1929
- })));
1930
- };
1931
- /** @internal */
1932
- const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
1933
- const workflows = yield* readWorkflows(root);
1934
- return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$1(file)(source)));
1935
- });
1936
- // src/features/scripts/model/script-checks.ts
1937
- /** @internal */
1938
- const checkScripts = Effect.fn("checkScripts")(function* checkScripts(root) {
1939
- const found = yield* Effect.all([checkShellScripts(root), checkWorkflows(root)], { concurrency: "unbounded" });
1940
- return Array.flatten(found);
1941
- });
1942
- // src/features/workflow-concurrency/model/workflow-queue.ts
1943
- const CONCURRENCY_KEY = "concurrency";
1944
- const QUEUE_KEY = "queue";
1945
- const RULE$3 = "workflow-queue";
1946
- const MESSAGE$1 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
1947
- const queueKeyOf = (node) => pipe(Option.liftPredicate(node, isMap), Option.flatMap((map) => Array.findFirst(map.items, (item) => isScalar(item.key) && item.key.value === QUEUE_KEY)), Option.flatMap(({ key }) => Option.liftPredicate(key, isScalar)), Option.flatMap((key) => Option.fromNullishOr(key.range)), Option.map(([start]) => start));
1948
- const queueOffsetsOf = (source) => {
1949
- const found = [];
1950
- visit(parseDocument(source), { Pair: (_key, pair) => {
1951
- if (isPair(pair) && isScalar(pair.key) && pair.key.value === CONCURRENCY_KEY) found.push(...Option.toArray(queueKeyOf(pair.value)));
1952
- } });
1953
- return found;
1954
- };
1955
- /** @internal */
1956
- const checkWorkflowQueues = Effect.fn("checkWorkflowQueues")(function* checkWorkflowQueues(root) {
1957
- const workflows = yield* readWorkflows(root);
1958
- return pipe(workflows, Array.flatMap(({ file, source }) => {
1959
- const at = positionOf(source);
1960
- return pipe(queueOffsetsOf(source), Array.map((offset) => {
1961
- const { line, column } = at(offset);
1962
- return {
1963
- file,
1964
- line,
1965
- column,
1966
- rule: RULE$3,
1967
- message: MESSAGE$1
1968
- };
1969
- }));
1970
- }));
1971
- });
1972
1940
  // src/features/pass-through-wrappers/model/pass-through-wrappers.ts
1973
- const RULE$2 = "pass-through-wrapper";
1941
+ const RULE$13 = "pass-through-wrapper";
1974
1942
  const SINGLE_STATEMENT = 1;
1975
1943
  const SINGLE_DECLARATION = 1;
1976
1944
  const THIS_PARAMETER = "this";
@@ -2064,14 +2032,14 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
2064
2032
  const restForwarded = pipe(wrapper.parameters, Array.some(isRest));
2065
2033
  return Option.exists(forwardedNames(wrapper, forward), (names) => callsAnotherFunction(candidate, forward, names)) && (restForwarded || calleeTakesExactly(checker)(forward, wrapper.parameters.length)) && keepsTheReturnType(checker)(wrapper, forward) && !isOverloaded(checker)(name);
2066
2034
  };
2067
- const problemOf$2 = (checker) => (candidate) => {
2035
+ const problemOf$4 = (checker) => (candidate) => {
2068
2036
  if (changesTheCall(candidate.wrapper)) return Option.none();
2069
- return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt({
2070
- rule: RULE$2,
2037
+ return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$2({
2038
+ rule: RULE$13,
2071
2039
  message: messageOf(forward.callee.getText())
2072
2040
  })(candidate.name)));
2073
2041
  };
2074
- const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array.map(candidateOf), Array.getSomes, Array.map(problemOf$2(checker)), Array.getSomes);
2042
+ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array.map(candidateOf), Array.getSomes, Array.map(problemOf$4(checker)), Array.getSomes);
2075
2043
  // src/features/value-owners/model/slots.ts
2076
2044
  const ANNOTATED_KINDS = /* @__PURE__ */ new Set([
2077
2045
  SyntaxKind.Parameter,
@@ -2168,7 +2136,7 @@ const ownerValuesOf = (checker) => (declaration) => {
2168
2136
  const type = checker.getTypeAtLocation(declaration.name);
2169
2137
  return finiteValuesOf(checker)(type).pipe(Option.orElse(() => objectValuesOf(checker)(type)));
2170
2138
  };
2171
- const annotationProblem = (message) => problemAt({
2139
+ const annotationProblem = (message) => problemAt$2({
2172
2140
  rule: "owner-annotation",
2173
2141
  message
2174
2142
  });
@@ -2293,7 +2261,7 @@ const shapeProblem = (site, matches) => {
2293
2261
  onNone: () => "Derive it from the library type, for example with Pick, instead of copying its properties.",
2294
2262
  onSome: () => "Use the library type instead of copying it."
2295
2263
  });
2296
- return problemAt({
2264
+ return problemAt$2({
2297
2265
  rule: "library-shape",
2298
2266
  message: `This shape copies ${shown}. ${advice}`
2299
2267
  })(site.node);
@@ -2387,7 +2355,7 @@ const derivedVerdict = (context) => (site) => {
2387
2355
  const added = pipe(site.values, Array.filter((value) => !isSubsetOf([value], held)));
2388
2356
  if (!Array.isReadonlyArrayNonEmpty(owners) || !Array.isReadonlyArrayNonEmpty(added)) return verdict([], []);
2389
2357
  const message = `This set adds ${formatValues(added)} to ${describeOwners(owners)}. Add the values to the owner, or register the wider set as its own concept.`;
2390
- return verdict([problemAt({
2358
+ return verdict([problemAt$2({
2391
2359
  rule: "owner-extension",
2392
2360
  message
2393
2361
  })(site.node)], []);
@@ -2409,7 +2377,7 @@ const originalVerdict = (context) => (site) => {
2409
2377
  const owners = pipe(context.owners, Array.filter((owner) => isSubsetOf(site.values, owner.values)));
2410
2378
  if (Array.isReadonlyArrayNonEmpty(owners)) {
2411
2379
  const message = `The values ${formatValues(site.values)} are owned by ${describeOwners(owners)}. Derive this set from the owner instead of restating it.`;
2412
- return verdict([problemAt({
2380
+ return verdict([problemAt$2({
2413
2381
  rule: "owner-value-set",
2414
2382
  message
2415
2383
  })(site.node)], []);
@@ -2417,7 +2385,7 @@ const originalVerdict = (context) => (site) => {
2417
2385
  const candidates = libraryCandidates(context)(site);
2418
2386
  if (Array.isReadonlyArrayNonEmpty(candidates)) {
2419
2387
  const message = `The values ${formatValues(site.values)} restate a dependency type: ${listCandidates(candidates)}. Derive this set from the library type.`;
2420
- return verdict([problemAt({
2388
+ return verdict([problemAt$2({
2421
2389
  rule: "library-value-set",
2422
2390
  message
2423
2391
  })(site.node)], []);
@@ -2448,7 +2416,7 @@ const isValuePosition = (node) => {
2448
2416
  const { parent } = node;
2449
2417
  return VALUE_PARENT_KINDS.has(parent.kind) || pipe(VALUE_SLOTS, Array.some((isSlot) => isSlot(node, parent)));
2450
2418
  };
2451
- const ownedLiteralProblem = (context) => (literal) => Option.fromUndefinedOr(context.checker.getContextualType(literal)).pipe(Option.filter((contextual) => vocabularyOf(context.checker)(contextual).pipe(Option.exists((vocabulary) => !vocabulary.admitsUnnamedValues))), Option.map(() => pipe(contextSymbolsOf(context.checker)(literal), Array.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array.map(String)))))), Option.filter((owners) => Array.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt({
2419
+ const ownedLiteralProblem = (context) => (literal) => Option.fromUndefinedOr(context.checker.getContextualType(literal)).pipe(Option.filter((contextual) => vocabularyOf(context.checker)(contextual).pipe(Option.exists((vocabulary) => !vocabulary.admitsUnnamedValues))), Option.map(() => pipe(contextSymbolsOf(context.checker)(literal), Array.flatMap((symbol) => ownersBehind(context)(symbol, [])), uniqueByReference, Array.filter((owner) => isSubsetOf([literal.text], pipe(owner.values, Array.map(String)))))), Option.filter((owners) => Array.isReadonlyArrayNonEmpty(owners)), Option.map((owners) => problemAt$2({
2452
2420
  rule: "owned-literal",
2453
2421
  message: `${literal.getText()} is a value of ${describeOwners(owners)}. Write it through the owner's binding instead of as a literal.`
2454
2422
  })(literal)));
@@ -2721,19 +2689,457 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
2721
2689
  // src/app/source-checks.ts
2722
2690
  /** @internal */
2723
2691
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn]);
2724
- // src/features/comments/model/found-comment.ts
2725
- const taggedError$2 = Schema.TaggedError;
2726
- var CommentsUnreadable = class extends taggedError$2()("CommentsUnreadable", {
2727
- reader: Schema.String,
2728
- message: Schema.String
2729
- }) {};
2730
- const unreadable = (reader) => (cause) => CommentsUnreadable.make({
2731
- reader,
2732
- message: String(cause)
2733
- });
2734
- const trimmed = ({ index, text }) => ({
2735
- index,
2736
- text: String$1.trimEnd(text)
2692
+ // src/features/agent-settings/model/missing-hooks.ts
2693
+ const RULE$12 = "missing-hook";
2694
+ const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
2695
+ const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
2696
+ const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
2697
+ const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
2698
+ const PLUGIN_ROOT = "..";
2699
+ const READ_CONCURRENCY$7 = 16;
2700
+ const START$10 = 0;
2701
+ const referenceOf = (found) => pipe(groupOf$1("path")(found), Option.filter(() => Option.isNone(groupOf$1("optional")(found))), Option.map((path) => ({
2702
+ path,
2703
+ index: found.index ?? START$10
2704
+ })), Option.toArray);
2705
+ const referencesIn = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf));
2706
+ const problemsIn$5 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
2707
+ const files = yield* RepositoryFiles;
2708
+ const text = yield* files.readFile(file);
2709
+ if (Option.isNone(text)) return [];
2710
+ const source = text.value;
2711
+ const absent = yield* Effect.filter(referencesIn(pattern, source), ({ path }) => files.exists(files.join(base, path)).pipe(Effect.map((exists) => !exists)));
2712
+ const targetOf = ({ path }) => files.join(base, path);
2713
+ const built = yield* files.ignoredPaths(root, pipe(absent, Array.map(targetOf)));
2714
+ const missing = pipe(absent, Array.filter((reference) => !Array.contains(built, targetOf(reference))));
2715
+ return pipe(missing, Array.map(({ path, index }) => ({
2716
+ file,
2717
+ ...positionOf(source)(index),
2718
+ rule: RULE$12,
2719
+ message: `runs ${path}, which does not exist. The hook fails every time it fires. Point it at a file that exists or remove the hook.`
2720
+ })));
2721
+ });
2722
+ /** @internal */
2723
+ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingHooks(root) {
2724
+ const files = yield* RepositoryFiles;
2725
+ const listed = yield* files.listedFiles(root);
2726
+ const hookFiles = pipe(listed, Array.flatMap((name) => {
2727
+ const file = files.join(root, name);
2728
+ if (SETTINGS_FILE$1.test(name)) return [{
2729
+ root,
2730
+ file,
2731
+ base: root,
2732
+ pattern: PROJECT_PATH
2733
+ }];
2734
+ if (PLUGIN_HOOKS_FILE.test(name)) return [{
2735
+ root,
2736
+ file,
2737
+ base: files.join(files.dirname(file), PLUGIN_ROOT),
2738
+ pattern: PLUGIN_PATH
2739
+ }];
2740
+ return [];
2741
+ }));
2742
+ const found = yield* Effect.forEach(hookFiles, problemsIn$5, { concurrency: READ_CONCURRENCY$7 });
2743
+ return Array.flatten(found);
2744
+ });
2745
+ // src/features/scripts/model/shell-scripts.ts
2746
+ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
2747
+ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
2748
+ const EXTENSION = /\.[^./]+$/u;
2749
+ const SETTINGS_FILE = ".claude/settings.json";
2750
+ const READ_CONCURRENCY$6 = 64;
2751
+ const FIRST$3 = 1;
2752
+ const RULE$11 = "shell-script";
2753
+ const MESSAGE$4 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
2754
+ const HookSchema = Schema.Struct({
2755
+ command: Schema.optional(Schema.String),
2756
+ args: Schema.optional(Schema.Array(Schema.String))
2757
+ });
2758
+ const MatcherSchema = Schema.Struct({ hooks: Schema.Array(HookSchema) });
2759
+ const HooksSchema = Schema.Struct({ SessionStart: Schema.optional(Schema.Array(MatcherSchema)) });
2760
+ const SettingsSchema = Schema.Struct({ hooks: Schema.optional(HooksSchema) });
2761
+ const decodeSettings = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
2762
+ const NO_TEXT = [];
2763
+ const commandText = ({ command, args }) => [...Option.toArray(Option.fromUndefinedOr(command)), ...pipe(Option.fromUndefinedOr(args), Option.getOrElse(() => NO_TEXT))];
2764
+ const matcherText = ({ hooks }) => pipe(hooks, Array.flatMap((hook) => commandText(hook)));
2765
+ const sessionStartCommands = (source) => {
2766
+ const matchers = pipe(decodeSettings(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.flatMap(({ SessionStart }) => Option.fromUndefinedOr(SessionStart)));
2767
+ return pipe(matchers, Option.map(Array.flatMap((matcher) => matcherText(matcher))), Option.getOrElse(() => NO_TEXT));
2768
+ };
2769
+ const baseName = (name) => pipe(String$1.split("/")(name), Array.last, Option.getOrElse(() => name));
2770
+ const hasExtension = (name) => EXTENSION.test(baseName(name));
2771
+ const problemFor$1 = (file) => ({
2772
+ file,
2773
+ line: FIRST$3,
2774
+ column: FIRST$3,
2775
+ rule: RULE$11,
2776
+ message: MESSAGE$4
2777
+ });
2778
+ /** @internal */
2779
+ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScripts(root) {
2780
+ const files = yield* RepositoryFiles;
2781
+ const names = yield* files.listedFiles(root);
2782
+ const settings = yield* files.readFile(files.join(root, SETTINGS_FILE));
2783
+ const commands = pipe(settings, Option.map(sessionStartCommands), Option.getOrElse(() => NO_TEXT));
2784
+ const isSessionStartHook = (name) => pipe(commands, Array.some(String$1.includes(name)));
2785
+ const isShell = (name) => {
2786
+ const file = files.join(root, name);
2787
+ if (SHELL_FILE.test(name)) return files.exists(file);
2788
+ if (hasExtension(name)) return Effect.succeed(false);
2789
+ return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
2790
+ };
2791
+ const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
2792
+ const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$6 });
2793
+ return pipe(shell, Array.map((name) => problemFor$1(files.join(root, name))));
2794
+ });
2795
+ // src/shared/lib/workflow-files.ts
2796
+ const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
2797
+ const READ_CONCURRENCY$5 = 16;
2798
+ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
2799
+ const files = yield* RepositoryFiles;
2800
+ const names = yield* files.listedFiles(root);
2801
+ const found = yield* Effect.forEach(pipe(names, Array.filter((name) => WORKFLOW_FILE.test(name))), (name) => {
2802
+ const file = files.join(root, name);
2803
+ return files.readFile(file).pipe(Effect.map(Option.map((source) => ({
2804
+ file,
2805
+ source
2806
+ }))));
2807
+ }, { concurrency: READ_CONCURRENCY$5 });
2808
+ return Array.getSomes(found);
2809
+ });
2810
+ // src/shared/lib/workflow-run.ts
2811
+ const RUN_KEY = "run";
2812
+ const START$9 = 0;
2813
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$9));
2814
+ const runScriptsOf = (source) => {
2815
+ const found = [];
2816
+ visit(parseDocument(source), { Pair: (_key, pair) => {
2817
+ if (isPair(pair) && isScalar(pair.key) && pair.key.value === RUN_KEY && isScalar(pair.value) && typeof pair.value.value === "string") found.push({
2818
+ text: pair.value.value,
2819
+ start: startOf(pair.value.range)
2820
+ });
2821
+ } });
2822
+ return found;
2823
+ };
2824
+ // src/features/scripts/model/workflows.ts
2825
+ const COMMAND_CHAIN = /&&|\|\||;|\|/u;
2826
+ const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
2827
+ const COMMENT = "#";
2828
+ const RULE$10 = "workflow-script";
2829
+ const ONE_COMMAND = 1;
2830
+ const MESSAGE$3 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
2831
+ const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
2832
+ const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
2833
+ const runsMoreThanOneCommand = ({ text }) => {
2834
+ const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
2835
+ return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
2836
+ };
2837
+ const problemsIn$4 = (file) => (source) => {
2838
+ const at = positionOf(source);
2839
+ return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => ({
2840
+ file,
2841
+ ...at(start),
2842
+ rule: RULE$10,
2843
+ message: MESSAGE$3
2844
+ })));
2845
+ };
2846
+ /** @internal */
2847
+ const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
2848
+ const workflows = yield* readWorkflows(root);
2849
+ return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$4(file)(source)));
2850
+ });
2851
+ // src/features/scripts/model/script-checks.ts
2852
+ /** @internal */
2853
+ const checkScripts = Effect.fn("checkScripts")(function* checkScripts(root) {
2854
+ const found = yield* Effect.all([checkShellScripts(root), checkWorkflows(root)], { concurrency: "unbounded" });
2855
+ return Array.flatten(found);
2856
+ });
2857
+ // src/features/vite-plus/model/command-words.ts
2858
+ const CONTINUATION = /\\\n/gu;
2859
+ const QUOTED = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
2860
+ const SEPARATOR$2 = /&&|\|\||[;|\n`]|\$\(/u;
2861
+ const BLANK$1 = /\s+/u;
2862
+ const ASSIGNMENT = /^[A-Za-z_][A-Za-z0-9_]*=/u;
2863
+ const QUOTE = "\"\"";
2864
+ const wordsOf = (segment) => pipe(String$1.split(String$1.trim(segment), BLANK$1), Array.filter(String$1.isNonEmpty), Array.dropWhile((word) => ASSIGNMENT.test(word)));
2865
+ const simpleCommands = (text) => pipe(text, String$1.replaceAll(CONTINUATION, " "), String$1.replaceAll(QUOTED, QUOTE), String$1.split(SEPARATOR$2), Array.map(wordsOf), Array.filter(Array.isReadonlyArrayNonEmpty));
2866
+ // src/features/vite-plus/model/command-problems.ts
2867
+ const PACKAGE_MANAGERS = [
2868
+ "pnpm",
2869
+ "pnpx",
2870
+ "npm",
2871
+ "npx",
2872
+ "yarn",
2873
+ "bun",
2874
+ "bunx"
2875
+ ];
2876
+ const VITE_PLUS = "vp";
2877
+ const RUN = "run";
2878
+ const GIT = "git";
2879
+ const GITHUB$1 = "gh";
2880
+ const MERGE = "merge";
2881
+ const SKIP_HOOKS = "--no-verify";
2882
+ const BYPASS_RULESET = "--admin";
2883
+ const FILTER = /^(?:--filter(?:=.*)?|-F)$/u;
2884
+ const TASK_KINDS = ["script", "task"];
2885
+ const SECOND = 1;
2886
+ const programOf = (words) => Array.headNonEmpty(words);
2887
+ const subcommandOf = (words) => Array.get(words, SECOND);
2888
+ const RULES = [
2889
+ {
2890
+ rule: "package-manager-command",
2891
+ applies: (_source, words) => Array.contains(PACKAGE_MANAGERS, programOf(words)),
2892
+ message: (command) => `\`${command}\` calls the package manager directly. Run it through vp (vp install, vp add, vp exec, vp dlx, vp run), so that hooks, CI and sessions all use the toolchain Vite+ pins.`
2893
+ },
2894
+ {
2895
+ rule: "skipped-gate",
2896
+ applies: (_source, words) => programOf(words) === GIT && Array.contains(words, SKIP_HOOKS) || programOf(words) === GITHUB$1 && Array.contains(words, MERGE) && Array.contains(words, BYPASS_RULESET),
2897
+ message: (command) => `\`${command}\` skips a gate: ${SKIP_HOOKS} skips the hooks that run verify, and ${BYPASS_RULESET} bypasses the ruleset. Remove the flag and fix what the gate reports.`
2898
+ },
2899
+ {
2900
+ rule: "filter-task",
2901
+ applies: (source, words) => Array.contains(TASK_KINDS, source.kind) && programOf(words) === VITE_PLUS && Option.contains(subcommandOf(words), RUN) && pipe(words, Array.some((word) => FILTER.test(word))),
2902
+ message: (command) => `\`${command}\` wraps one package's task in another task. Write <package>#<task> in dependsOn instead, so that Vite+ sees the dependency and caches it.`
2903
+ }
2904
+ ];
2905
+ const problemsOf = (source) => pipe(simpleCommands(source.text), Array.flatMap((words) => pipe(RULES, Array.filter(({ applies }) => applies(source, words)), Array.map(({ rule, message }) => ({
2906
+ file: source.file,
2907
+ ...source.position,
2908
+ rule,
2909
+ message: message(String$1.trim(Array.join(words, " ")))
2910
+ })))));
2911
+ const commandProblems$1 = (sources) => pipe(sources, Array.flatMap(problemsOf));
2912
+ // src/features/vite-plus/model/command-sources.ts
2913
+ const ROOT_DIRECTORY = ".";
2914
+ const COMMAND_KEY = "command";
2915
+ const ARGUMENTS_KEY = "args";
2916
+ const EXCLUDED$1 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
2917
+ const MANIFESTS = [`:(glob)**/${MANIFEST_FILE}`, ...EXCLUDED$1];
2918
+ const STEP_FILES = [
2919
+ ":(glob).github/workflows/*.yml",
2920
+ ":(glob).github/workflows/*.yaml",
2921
+ ":(glob)**/action.yml",
2922
+ ":(glob)**/action.yaml",
2923
+ ...EXCLUDED$1
2924
+ ];
2925
+ const HOOK_FILES = [":(glob).vite-hooks/*"];
2926
+ const AGENT_FILES = [".claude/settings.json", ".mcp.json"];
2927
+ const READ_CONCURRENCY$4 = 16;
2928
+ const START$8 = 0;
2929
+ const FIRST$2 = 1;
2930
+ const LINE = "\n";
2931
+ const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
2932
+ const decodeCommandText = Schema.decodeUnknownOption(CommandText);
2933
+ const Scripts = Schema.Struct({ scripts: Schema.optional(Schema.Record(Schema.String, Schema.String)) });
2934
+ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts));
2935
+ const decodeJson = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
2936
+ const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
2937
+ const NO_SOURCES = [];
2938
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$8));
2939
+ const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
2940
+ const offset = offsetOf$2(source, `"${name}"`);
2941
+ return {
2942
+ kind: "script",
2943
+ file,
2944
+ position: positionOf(source)(offset),
2945
+ name,
2946
+ text
2947
+ };
2948
+ }));
2949
+ const stepSources = (file) => (source) => pipe(runScriptsOf(source), Array.map(({ text, start }) => ({
2950
+ kind: "step",
2951
+ file,
2952
+ position: positionOf(source)(start),
2953
+ name: "run",
2954
+ text
2955
+ })));
2956
+ const hookSources = (file, name) => (source) => pipe(String$1.split(source, LINE), Array.map((text, index) => ({
2957
+ kind: "hook",
2958
+ file,
2959
+ position: {
2960
+ line: index + FIRST$2,
2961
+ column: FIRST$2
2962
+ },
2963
+ name,
2964
+ text
2965
+ })));
2966
+ const commandIn = (node) => {
2967
+ if (!Predicate.isReadonlyObject(node)) return Option.none();
2968
+ const record = node;
2969
+ return pipe(Option.fromUndefinedOr(record[COMMAND_KEY]), Option.filter(Predicate.isString), Option.map((command) => pipe(decodeArguments(record[ARGUMENTS_KEY]), Option.getOrElse(() => []), Array.prepend(command), Array.join(" "))));
2970
+ };
2971
+ const commandsIn = (node) => [...Option.toArray(commandIn(node)), ...pipe(childrenOf$2(node), Array.flatMap(commandsIn))];
2972
+ const agentSources = (file) => (source) => pipe(decodeJson(source), Option.map(commandsIn), Option.getOrElse(() => []), Array.map((text) => {
2973
+ const program = Array.headNonEmpty(String$1.split(text, " "));
2974
+ const offset = offsetOf$2(source, `"${program}"`);
2975
+ return {
2976
+ kind: "agent",
2977
+ file,
2978
+ position: positionOf(source)(offset),
2979
+ name: COMMAND_KEY,
2980
+ text
2981
+ };
2982
+ }));
2983
+ const taskCommand = (value) => pipe(propertyValue(COMMAND_KEY)(value), Option.orElse(() => Option.some(value)), Option.flatMap(literalOf), Option.flatMap(decodeCommandText), Option.map((command) => Array.join(Array.ensure(command), LINE)));
2984
+ const taskSource = (file, source) => (task) => pipe(taskCommand(task.value), Option.map((text) => ({
2985
+ kind: "task",
2986
+ file,
2987
+ position: positionOf(source)(task.start),
2988
+ name: keyName(task.key),
2989
+ text
2990
+ })));
2991
+ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directory) {
2992
+ const found = yield* runTasksOf(root, directory);
2993
+ if (Option.isNone(found)) return NO_SOURCES;
2994
+ const { file, source, tasks } = found.value;
2995
+ return pipe(tasks, Array.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
2996
+ });
2997
+ const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
2998
+ const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$4 });
2999
+ return Array.flatten(found);
3000
+ });
3001
+ const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
3002
+ const files = yield* RepositoryFiles;
3003
+ const found = yield* Effect.forEach(names, (name) => {
3004
+ const file = files.join(root, name);
3005
+ const sourcesIn = Option.match({
3006
+ onNone: () => NO_SOURCES,
3007
+ onSome: sourcesOf(file, name)
3008
+ });
3009
+ return files.readFile(file).pipe(Effect.map(sourcesIn));
3010
+ }, { concurrency: READ_CONCURRENCY$4 });
3011
+ return Array.flatten(found);
3012
+ });
3013
+ /** @internal */
3014
+ const commandSources = Effect.fn("commandSources")(function* commandSources(root) {
3015
+ const files = yield* RepositoryFiles;
3016
+ const [manifests, steps, hooks, workspaces] = yield* Effect.all([
3017
+ files.matchingFiles(root, MANIFESTS),
3018
+ files.matchingFiles(root, STEP_FILES),
3019
+ files.matchingFiles(root, HOOK_FILES),
3020
+ workspaceDirectories(root)
3021
+ ], { concurrency: "unbounded" });
3022
+ const found = yield* Effect.all([
3023
+ readSources(root, manifests, scriptSources),
3024
+ readSources(root, steps, stepSources),
3025
+ readSources(root, hooks, hookSources),
3026
+ readSources(root, AGENT_FILES, agentSources),
3027
+ workspaceTasks(root, Array.dedupe([ROOT_DIRECTORY, ...workspaces]))
3028
+ ], { concurrency: "unbounded" });
3029
+ return Array.flatten(found);
3030
+ });
3031
+ // src/features/vite-plus/model/package-scripts.ts
3032
+ const RULE$9 = "package-script";
3033
+ const LIFECYCLE = [
3034
+ "preinstall",
3035
+ "install",
3036
+ "postinstall",
3037
+ "preprepare",
3038
+ "prepare",
3039
+ "postprepare",
3040
+ "prepublish",
3041
+ "prepublishOnly",
3042
+ "prepack",
3043
+ "postpack",
3044
+ "publish",
3045
+ "postpublish",
3046
+ "preversion",
3047
+ "version",
3048
+ "postversion",
3049
+ "dependencies",
3050
+ "pnpm:devPreinstall"
3051
+ ];
3052
+ const problemOf$3 = ({ file, position, name }) => ({
3053
+ file,
3054
+ ...position,
3055
+ rule: RULE$9,
3056
+ message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
3057
+ });
3058
+ const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
3059
+ // src/features/vite-plus/model/vite-plus-block.ts
3060
+ const RULE$8 = "vite-plus-block";
3061
+ const MARKER = Array.join([
3062
+ "<!--",
3063
+ "VITE PLUS START",
3064
+ "-->"
3065
+ ], "");
3066
+ const MESSAGE$2 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
3067
+ const problemIn$1 = (file) => (source) => {
3068
+ const index = String$1.indexOf(MARKER)(source);
3069
+ if (Option.isNone(index)) return Option.none();
3070
+ return Option.some({
3071
+ file,
3072
+ ...positionOf(source)(index.value),
3073
+ rule: RULE$8,
3074
+ message: MESSAGE$2
3075
+ });
3076
+ };
3077
+ /** @internal */
3078
+ const checkVitePlusBlock = (root) => agentDocProblems(root, problemIn$1);
3079
+ // src/features/vite-plus/model/vite-plus-checks.ts
3080
+ /** @internal */
3081
+ const checkVitePlus = Effect.fn("checkVitePlus")(function* checkVitePlus(root) {
3082
+ const [sources, blocks] = yield* Effect.all([commandSources(root), checkVitePlusBlock(root)], { concurrency: "unbounded" });
3083
+ return [
3084
+ ...packageScriptProblems(sources),
3085
+ ...commandProblems$1(sources),
3086
+ ...blocks
3087
+ ];
3088
+ });
3089
+ // src/features/workflow-concurrency/model/workflow-queue.ts
3090
+ const CONCURRENCY_KEY = "concurrency";
3091
+ const QUEUE_KEY = "queue";
3092
+ const RULE$7 = "workflow-queue";
3093
+ const MESSAGE$1 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
3094
+ const queueKeyOf = (node) => pipe(Option.liftPredicate(node, isMap), Option.flatMap((map) => Array.findFirst(map.items, (item) => isScalar(item.key) && item.key.value === QUEUE_KEY)), Option.flatMap(({ key }) => Option.liftPredicate(key, isScalar)), Option.flatMap((key) => Option.fromNullishOr(key.range)), Option.map(([start]) => start));
3095
+ const queueOffsetsOf = (source) => {
3096
+ const found = [];
3097
+ visit(parseDocument(source), { Pair: (_key, pair) => {
3098
+ if (isPair(pair) && isScalar(pair.key) && pair.key.value === CONCURRENCY_KEY) found.push(...Option.toArray(queueKeyOf(pair.value)));
3099
+ } });
3100
+ return found;
3101
+ };
3102
+ /** @internal */
3103
+ const checkWorkflowQueues = Effect.fn("checkWorkflowQueues")(function* checkWorkflowQueues(root) {
3104
+ const workflows = yield* readWorkflows(root);
3105
+ return pipe(workflows, Array.flatMap(({ file, source }) => {
3106
+ const at = positionOf(source);
3107
+ return pipe(queueOffsetsOf(source), Array.map((offset) => {
3108
+ const { line, column } = at(offset);
3109
+ return {
3110
+ file,
3111
+ line,
3112
+ column,
3113
+ rule: RULE$7,
3114
+ message: MESSAGE$1
3115
+ };
3116
+ }));
3117
+ }));
3118
+ });
3119
+ // src/app/tool-use.ts
3120
+ /** @internal */
3121
+ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
3122
+ const found = yield* Effect.all([
3123
+ checkVitePlus(root),
3124
+ checkMissingHooks(root),
3125
+ checkScripts(root),
3126
+ checkWorkflowQueues(root)
3127
+ ], { concurrency: "unbounded" });
3128
+ return Array.flatten(found);
3129
+ });
3130
+ // src/features/comments/model/found-comment.ts
3131
+ const taggedError$2 = Schema.TaggedError;
3132
+ var CommentsUnreadable = class extends taggedError$2()("CommentsUnreadable", {
3133
+ reader: Schema.String,
3134
+ message: Schema.String
3135
+ }) {};
3136
+ const unreadable = (reader) => (cause) => CommentsUnreadable.make({
3137
+ reader,
3138
+ message: String(cause)
3139
+ });
3140
+ const trimmed = ({ index, text }) => ({
3141
+ index,
3142
+ text: String$1.trimEnd(text)
2737
3143
  });
2738
3144
  // src/features/comments/model/config-comments.ts
2739
3145
  const NEXT$1 = 1;
@@ -2811,7 +3217,7 @@ const COMMENT_NODES = [
2811
3217
  "block_comment",
2812
3218
  "multiline_comment"
2813
3219
  ];
2814
- const START$3 = 0;
3220
+ const START$7 = 0;
2815
3221
  const NEXT = 1;
2816
3222
  const NONE$1 = [];
2817
3223
  const grammarFile = (grammar) => fileURLToPath(import.meta.resolve(`@vscode/tree-sitter-wasm/wasm/tree-sitter-${grammar}.wasm`));
@@ -2874,7 +3280,7 @@ const markupComment = (source) => (node) => {
2874
3280
  }];
2875
3281
  };
2876
3282
  const textComments = (grammars, grammar) => (text) => {
2877
- const shift = shifted(text.startIndex ?? START$3);
3283
+ const shift = shifted(text.startIndex ?? START$7);
2878
3284
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
2879
3285
  };
2880
3286
  const embeddedComments = (grammars) => (node) => {
@@ -2910,11 +3316,11 @@ const commentsWith = (grammars) => (reader, source) => {
2910
3316
  }[reader](source);
2911
3317
  };
2912
3318
  // src/features/comments/model/comments.ts
2913
- const RULE$1 = "comment";
3319
+ const RULE$6 = "comment";
2914
3320
  const CONFIG_FILE = "vite.config.ts";
2915
3321
  const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
2916
- const READ_CONCURRENCY$2 = 64;
2917
- const START$2 = 0;
3322
+ const READ_CONCURRENCY$3 = 64;
3323
+ const START$6 = 0;
2918
3324
  const FIRST_LINE$2 = 1;
2919
3325
  const FIRST_COLUMN$2 = 1;
2920
3326
  const READERS = [
@@ -2971,23 +3377,23 @@ const shebangReader = (source) => {
2971
3377
  const readerOf = (name, source) => pipe(READERS, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
2972
3378
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
2973
3379
  const lineBefore = (source, index) => {
2974
- const lines = pipe(source, String$1.slice(START$2, index), String$1.split("\n"));
3380
+ const lines = pipe(source, String$1.slice(START$6, index), String$1.split("\n"));
2975
3381
  return Option.getOrElse(Array.last(lines), () => "");
2976
3382
  };
2977
3383
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
2978
- const isShebang = ({ index, text }) => index === START$2 && String$1.startsWith(SHEBANG)(text);
3384
+ const isShebang = ({ index, text }) => index === START$6 && String$1.startsWith(SHEBANG)(text);
2979
3385
  const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
2980
- const problemOf$1 = (file, source) => ({ index }) => ({
3386
+ const problemOf$2 = (file, source) => ({ index }) => ({
2981
3387
  file,
2982
3388
  ...positionOf(source)(index),
2983
- rule: RULE$1,
3389
+ rule: RULE$6,
2984
3390
  message: MESSAGE
2985
3391
  });
2986
3392
  const unreadableProblem = (file, message) => ({
2987
3393
  file,
2988
3394
  line: FIRST_LINE$2,
2989
3395
  column: FIRST_COLUMN$2,
2990
- rule: RULE$1,
3396
+ rule: RULE$6,
2991
3397
  message: `msch could not read the comments in this file: ${message}`
2992
3398
  });
2993
3399
  const settingsOf = ({ msch, lint }) => ({
@@ -3033,7 +3439,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
3033
3439
  const comments = commentsWith(grammars);
3034
3440
  const problemsIn = ({ name, file }, source) => {
3035
3441
  const kept = Predicate.not(isAllowed(source, directives));
3036
- const toProblem = problemOf$1(file, source);
3442
+ const toProblem = problemOf$2(file, source);
3037
3443
  return Option.match(readerOf(name, source), {
3038
3444
  onNone: () => Effect.succeed(NONE),
3039
3445
  onSome: (reader) => comments(reader, source).pipe(Effect.map(Array.filter(kept)), Effect.map(Array.map(toProblem)), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed([unreadableProblem(file, message)])))
@@ -3042,30 +3448,30 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
3042
3448
  const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
3043
3449
  onNone: () => Effect.succeed(NONE),
3044
3450
  onSome: (source) => problemsIn(entry, source)
3045
- }))), { concurrency: READ_CONCURRENCY$2 });
3451
+ }))), { concurrency: READ_CONCURRENCY$3 });
3046
3452
  return Array.flatten(found);
3047
3453
  });
3048
3454
  // src/features/invisible-characters/model/hidden-unicode.ts
3049
3455
  const HIDDEN = /[\u00AD\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|[\u{E0000}-\u{E007F}]/gu;
3050
3456
  const NUL = "\0";
3051
- const START$1 = 0;
3457
+ const START$5 = 0;
3052
3458
  const HEX = 16;
3053
3459
  const CODE_POINT_WIDTH = 4;
3054
- const READ_CONCURRENCY$1 = 64;
3055
- const RULE = "hidden-unicode";
3056
- const hexOf = (character) => pipe(String$1.codePointAt(START$1)(character), Option.getOrElse(() => START$1), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
3057
- const problemOf = (file, source) => (found) => {
3058
- const hex = hexOf(found[START$1]);
3460
+ const READ_CONCURRENCY$2 = 64;
3461
+ const RULE$5 = "hidden-unicode";
3462
+ const hexOf = (character) => pipe(String$1.codePointAt(START$5)(character), Option.getOrElse(() => START$5), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
3463
+ const problemOf$1 = (file, source) => (found) => {
3464
+ const hex = hexOf(found[START$5]);
3059
3465
  return {
3060
3466
  file,
3061
- ...positionOf(source)(found.index ?? START$1),
3062
- rule: RULE,
3467
+ ...positionOf(source)(found.index ?? START$5),
3468
+ rule: RULE$5,
3063
3469
  message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
3064
3470
  };
3065
3471
  };
3066
- const problemsIn = (file, source) => {
3472
+ const problemsIn$3 = (file, source) => {
3067
3473
  if (String$1.includes(NUL)(source)) return [];
3068
- return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf(file, source)));
3474
+ return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
3069
3475
  };
3070
3476
  /** @internal */
3071
3477
  const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
@@ -3075,16 +3481,16 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
3075
3481
  const file = files.join(root, name);
3076
3482
  return files.readFile(file).pipe(Effect.map(Option.match({
3077
3483
  onNone: () => [],
3078
- onSome: (source) => problemsIn(file, source)
3484
+ onSome: (source) => problemsIn$3(file, source)
3079
3485
  })));
3080
- }, { concurrency: READ_CONCURRENCY$1 });
3486
+ }, { concurrency: READ_CONCURRENCY$2 });
3081
3487
  return Array.flatten(found);
3082
3488
  });
3083
3489
  // src/shared/lib/scanned-files.ts
3084
3490
  const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:Dockerfile[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
3085
3491
  const LOCKFILE = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
3086
3492
  const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
3087
- const READ_CONCURRENCY = 64;
3493
+ const READ_CONCURRENCY$1 = 64;
3088
3494
  const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE.test(name);
3089
3495
  const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
3090
3496
  /** @internal */
@@ -3107,7 +3513,7 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
3107
3513
  const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
3108
3514
  onNone: () => [],
3109
3515
  onSome: (source) => problemsIn(entry, source)
3110
- }))), { concurrency: READ_CONCURRENCY });
3516
+ }))), { concurrency: READ_CONCURRENCY$1 });
3111
3517
  return Array.flatten(found);
3112
3518
  });
3113
3519
  // src/features/python/model/python.ts
@@ -3155,6 +3561,365 @@ const checkPython = Effect.fn("checkPython")(function* checkPython(root) {
3155
3561
  const present = yield* presentFiles(pipe(listed, Array.filter(isPython)));
3156
3562
  return [...pipe(present, Array.map(fileProblem)), ...scanned];
3157
3563
  });
3564
+ // src/features/runtime-version/model/node-version.ts
3565
+ const RULE$4 = "node-version";
3566
+ const MINIMUM = 26;
3567
+ const SUPPORTED = `Node.js ${String(MINIMUM)} or later is the only supported runtime.`;
3568
+ const MANIFEST = /(?:^|\/)package\.json$/u;
3569
+ const VERSION_FILE = /(?:^|\/)(?:\.node-version|\.nvmrc)$/u;
3570
+ const DOCKERFILE = /(?:^|\/)Dockerfile[^/]*$/u;
3571
+ const STEP_FILE = /^\.github\/.*\.ya?ml$|(?:^|\/)action\.ya?ml$/u;
3572
+ const PINNED_VERSION = /^\s*v?(?<major>\d+)/u;
3573
+ const BASE_IMAGE = /^FROM[ \t]+(?:--\S+[ \t]+)*(?:[\w.-]+(?::\d+)?\/)*node:(?<major>\d+)/gimu;
3574
+ const SETUP_INPUT = /\bnode-version:[ \t]*["']?v?(?<major>\d+)/gu;
3575
+ const TOOL_VERSION = /^[ \t]*["']?(?:node|nodejs)["']?[ \t]*(?:=[ \t]*["']?|[ \t]+)v?(?<major>\d+)/gmu;
3576
+ const RANGE_FLOOR = /^(?:>=|\^|~|=)?[ \t]*v?(?<major>\d+)/u;
3577
+ const ALTERNATIVE = "||";
3578
+ const ENGINES_KEY = "\"engines\"";
3579
+ const START$4 = 0;
3580
+ const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
3581
+ const Engines = Schema.Struct({ node: Schema.optional(Schema.String) });
3582
+ const Manifest = Schema.Struct({
3583
+ private: Schema.optional(Schema.Boolean),
3584
+ publishConfig: Schema.optional(Schema.Unknown),
3585
+ engines: Schema.optional(Engines)
3586
+ });
3587
+ const decodeManifest = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest));
3588
+ const majorOf = (found) => pipe(groupOf$1("major")(found), Option.map(Number));
3589
+ const isOld = (major) => major < MINIMUM;
3590
+ const floorOf = (alternative) => majorOf(RANGE_FLOOR.exec(String$1.trim(alternative)));
3591
+ const floorIsOld = (alternative) => pipe(floorOf(alternative), Option.match({
3592
+ onNone: () => true,
3593
+ onSome: isOld
3594
+ }));
3595
+ const admitsOld = (range) => pipe(String$1.split(range, ALTERNATIVE), Array.some(floorIsOld));
3596
+ const problemAt = ({ entry, source, index }, message) => ({
3597
+ file: entry.file,
3598
+ ...positionOf(source)(index),
3599
+ rule: RULE$4,
3600
+ message
3601
+ });
3602
+ const offsetOf$1 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$4));
3603
+ const unstatedProblem = (entry, source) => problemAt({
3604
+ entry,
3605
+ source,
3606
+ index: START$4
3607
+ }, `${SUPPORTED} This package is published without engines.node, so its users cannot tell. Set engines.node to ">=${String(MINIMUM)}".`);
3608
+ const rangeProblem = (entry, source) => (range) => problemAt({
3609
+ entry,
3610
+ source,
3611
+ index: offsetOf$1(source, ENGINES_KEY)
3612
+ }, `${SUPPORTED} engines.node is "${range}", which admits an older one. Set it to ">=${String(MINIMUM)}".`);
3613
+ const isPublished = (manifest) => manifest.private !== true && Predicate.isNotUndefined(manifest.publishConfig);
3614
+ const rangeOf$1 = (manifest) => pipe(Option.fromUndefinedOr(manifest.engines), Option.flatMap(({ node }) => Option.fromUndefinedOr(node)));
3615
+ const manifestProblems = (entry, source) => {
3616
+ const manifest = decodeManifest(source);
3617
+ if (Option.isNone(manifest)) return [];
3618
+ const range = rangeOf$1(manifest.value);
3619
+ if (Option.isNone(range) && isPublished(manifest.value)) return [unstatedProblem(entry, source)];
3620
+ return pipe(range, Option.filter(admitsOld), Option.map(rangeProblem(entry, source)), Option.toArray);
3621
+ };
3622
+ const pinnedProblems = (pattern) => (entry, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.filter((found) => Option.exists(majorOf(found), isOld)), Array.map((found) => problemAt({
3623
+ entry,
3624
+ source,
3625
+ index: found.index ?? START$4
3626
+ }, `${SUPPORTED} \`${String$1.trim(found[START$4])}\` pins an older one. Raise it to ${String(MINIMUM)} or later.`)));
3627
+ const versionFileProblems = (entry, source) => pipe(majorOf(PINNED_VERSION.exec(source)), Option.filter(isOld), Option.map((major) => problemAt({
3628
+ entry,
3629
+ source,
3630
+ index: START$4
3631
+ }, `${SUPPORTED} This file pins ${String(major)}. Raise it to ${String(MINIMUM)} or later.`)), Option.toArray);
3632
+ const problemsIn$2 = (entry, source) => {
3633
+ if (MANIFEST.test(entry.name)) return manifestProblems(entry, source);
3634
+ if (VERSION_FILE.test(entry.name)) return versionFileProblems(entry, source);
3635
+ if (DOCKERFILE.test(entry.name)) return pinnedProblems(BASE_IMAGE)(entry, source);
3636
+ if (isToolVersions(entry)) return pinnedProblems(TOOL_VERSION)(entry, source);
3637
+ return pinnedProblems(SETUP_INPUT)(entry, source);
3638
+ };
3639
+ const isVersionSource = (entry) => VERSION_FILE.test(entry.name) || DOCKERFILE.test(entry.name) || STEP_FILE.test(entry.name) || isToolVersions(entry);
3640
+ /** @internal */
3641
+ const checkNodeVersion = Effect.fn("checkNodeVersion")(function* checkNodeVersion(root) {
3642
+ const files = yield* RepositoryFiles;
3643
+ const listed = yield* listedFiles(root);
3644
+ const manifests = yield* files.matchingFiles(root, [`:(glob)**/${MANIFEST_FILE}`, ...EXCLUDED]);
3645
+ const sources = [...pipe(listed, Array.filter(isVersionSource)), ...pipe(manifests, Array.map((name) => ({
3646
+ name,
3647
+ file: files.join(root, name)
3648
+ })))];
3649
+ return yield* scanText(sources, problemsIn$2);
3650
+ });
3651
+ // src/features/skills/model/skill-entry.ts
3652
+ const RULE$3 = "unlocked-skill";
3653
+ const LOCK_FILE = "skills-lock.json";
3654
+ const SOURCE = "masseater/skills";
3655
+ const ENTRY = "masseater-ecosystem";
3656
+ const INSTALLED_ENTRY = `.agents/skills/${ENTRY}/SKILL.md`;
3657
+ const NAMED = /`(?<name>[a-z0-9]+(?:-[a-z0-9]+)*)`(?!\]\()/gu;
3658
+ const START$3 = 0;
3659
+ const Lock = Schema.Struct({ skills: Schema.Record(Schema.String, Schema.Struct({ source: Schema.String })) });
3660
+ const decodeLock = Schema.decodeUnknownOption(Schema.fromJsonString(Lock));
3661
+ const namedIn = (entry) => pipe(Array.fromIterable(String$1.matchAll(NAMED)(entry)), Array.flatMap((found) => Option.toArray(groupOf$1("name")(found))), Array.dedupe);
3662
+ const fixFor = (name) => `Run "vp exec skills add ${SOURCE} -s ${name} -y". The command drops ref from the ${SOURCE} entries, so write it back.`;
3663
+ const problemIn = ({ file, source }) => (anchor, message) => ({
3664
+ file,
3665
+ ...positionOf(source)(pipe(String$1.indexOf(anchor)(source), Option.getOrElse(() => START$3))),
3666
+ rule: RULE$3,
3667
+ message
3668
+ });
3669
+ const lockedSkills = Effect.fn("lockedSkills")(function* lockedSkills(root) {
3670
+ const files = yield* RepositoryFiles;
3671
+ const file = files.join(root, LOCK_FILE);
3672
+ const text = yield* files.readFile(file);
3673
+ return pipe(text, Option.flatMap((source) => pipe(decodeLock(source), Option.map((lock) => ({
3674
+ file,
3675
+ source,
3676
+ names: pipe(lock.skills, Record.filter((skill) => skill.source === SOURCE), Record.keys)
3677
+ })))), Option.filter(({ names }) => Array.isReadonlyArrayNonEmpty(names)));
3678
+ });
3679
+ /** @internal */
3680
+ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(root) {
3681
+ const files = yield* RepositoryFiles;
3682
+ const lock = yield* lockedSkills(root);
3683
+ if (Option.isNone(lock)) return [];
3684
+ const { names } = lock.value;
3685
+ const problemAt = problemIn(lock.value);
3686
+ if (!Array.contains(names, ENTRY)) return [problemAt(SOURCE, `installs skills from ${SOURCE} without ${ENTRY}, the skill that says which of them to read in which situation. ${fixFor(ENTRY)}`)];
3687
+ const entry = yield* files.readFile(files.join(root, INSTALLED_ENTRY));
3688
+ return pipe(entry, Option.map(namedIn), Option.getOrElse(() => []), Array.filter((name) => !Array.contains(names, name)), Array.map((name) => problemAt(`"${ENTRY}"`, `${ENTRY} tells agents to read ${name}, which this file does not install. ${fixFor(name)}`)));
3689
+ });
3690
+ // src/features/skills/model/skill-files.ts
3691
+ const RULE$2 = "skill-file";
3692
+ const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
3693
+ const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
3694
+ const MARKDOWN = ".md";
3695
+ const LICENSE_FILE = /^LICEN[CS]E(?:\.[^/]+)?$/iu;
3696
+ const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
3697
+ const HEADING = /^# (?<title>.+)$/mu;
3698
+ const NAME_KEY = /^name:/mu;
3699
+ const LICENSE_KEY = /^license:/mu;
3700
+ const CODE = /```[\s\S]*?```|`[^`\n]*`/gu;
3701
+ const LINK = /\]\((?<target>[^)\s]+)\)/gu;
3702
+ const EXTERNAL = /^(?:[a-z][a-z0-9+.-]*:|#|\/)|[<>{}]/iu;
3703
+ const FRAGMENT = /#.*$/u;
3704
+ const GITHUB = "https://github.com/";
3705
+ const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
3706
+ const BLANK = /\s+/u;
3707
+ const SEPARATOR$1 = "/";
3708
+ const START$2 = 0;
3709
+ const FIRST$1 = 1;
3710
+ const READ_CONCURRENCY = 16;
3711
+ const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
3712
+ const Frontmatter = Schema.Struct({
3713
+ name: Schema.optional(Schema.String),
3714
+ license: Schema.optional(Schema.Unknown),
3715
+ metadata: Schema.optional(Metadata)
3716
+ });
3717
+ const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
3718
+ const offsetOf = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$2));
3719
+ const frontmatterOf = (source) => pipe(groupOf$1("yaml")(FRONTMATTER.exec(source)), Option.flatMap((yaml) => decodeFrontmatter(parse$1(yaml))));
3720
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$2].length), Option.getOrElse(() => START$2));
3721
+ const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
3722
+ const nameProblems = ({ source, directory }, name, folder) => {
3723
+ const bodyStart = bodyStartOf(source);
3724
+ const body = String$1.slice(bodyStart)(source);
3725
+ const heading = groupOf$1("title")(HEADING.exec(body));
3726
+ return [...pipe(Option.liftPredicate(name, (found) => found !== folder), Option.map((found) => ({
3727
+ index: offsetOf(source, NAME_KEY),
3728
+ message: `The frontmatter name "${found}" differs from the directory ${directory}. Give the skill the name of its directory.`
3729
+ })), Option.toArray), ...pipe(Option.liftPredicate(heading, (found) => !Option.contains(found, name)), Option.map((found) => ({
3730
+ index: bodyStart + offsetOf(body, HEADING),
3731
+ message: `The first heading is ${headingText(found)}. Start the body with "# ${name}", the frontmatter name.`
3732
+ })), Option.toArray)];
3733
+ };
3734
+ const derivedProblems = (source, derived) => pipe(String$1.split(String$1.trim(derived), BLANK), Array.filter((url) => String$1.startsWith(GITHUB)(url) && !COMMIT_LINK.test(url)), Array.map((url) => ({
3735
+ index: offsetOf(source, url),
3736
+ message: `metadata.derived-from holds ${url}, which does not name a commit, so what it shows changes. Write a permalink: ${GITHUB}<owner>/<repo>/blob/<commit>/<path>.`
3737
+ })));
3738
+ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source), Option.map((frontmatter) => [
3739
+ ...pipe(Option.fromUndefinedOr(frontmatter.name), Option.map((name) => nameProblems(skill, name, folder)), Option.getOrElse(() => [])),
3740
+ ...pipe(Option.fromUndefinedOr(frontmatter.license), Option.map(() => ({
3741
+ index: offsetOf(skill.source, LICENSE_KEY),
3742
+ message: "The frontmatter has license. Skills here carry neither a license field nor a LICENSE file. Remove it."
3743
+ })), Option.toArray),
3744
+ ...pipe(Option.fromUndefinedOr(frontmatter.metadata), Option.flatMap((metadata) => Option.fromUndefinedOr(metadata["derived-from"])), Option.map((derived) => derivedProblems(skill.source, derived)), Option.getOrElse(() => []))
3745
+ ]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
3746
+ file: skill.file,
3747
+ ...positionOf(skill.source)(index),
3748
+ rule: RULE$2,
3749
+ message
3750
+ })));
3751
+ const linkOf = (found) => pipe(groupOf$1("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
3752
+ target,
3753
+ index: found.index ?? START$2
3754
+ })), Option.toArray);
3755
+ const rangeOf = (found) => {
3756
+ const start = found.index ?? START$2;
3757
+ return [start, start + found[START$2].length];
3758
+ };
3759
+ const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
3760
+ const linksIn = (source) => {
3761
+ const code = pipe(Array.fromIterable(String$1.matchAll(CODE)(source)), Array.map(rangeOf));
3762
+ return pipe(Array.fromIterable(String$1.matchAll(LINK)(source)), Array.flatMap(linkOf), Array.filter(isOutside(code)));
3763
+ };
3764
+ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
3765
+ const files = yield* RepositoryFiles;
3766
+ const text = yield* files.readFile(file);
3767
+ if (Option.isNone(text)) return [];
3768
+ const source = text.value;
3769
+ const directory = files.dirname(file);
3770
+ const isMissing = ({ target }) => files.exists(files.join(directory, target)).pipe(Effect.map((exists) => !exists));
3771
+ const missing = yield* Effect.filter(linksIn(source), isMissing);
3772
+ return pipe(missing, Array.map(({ target, index }) => ({
3773
+ file,
3774
+ ...positionOf(source)(index),
3775
+ rule: RULE$2,
3776
+ message: `links to ${target}, which does not exist. Fix the path or remove the link.`
3777
+ })));
3778
+ });
3779
+ const problemsIn$1 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
3780
+ const files = yield* RepositoryFiles;
3781
+ const file = files.join(root, name);
3782
+ const directory = files.dirname(name);
3783
+ const inside = pipe(listed, Array.filter(String$1.startsWith(`${directory}${SEPARATOR$1}`)));
3784
+ const text = yield* files.readFile(file);
3785
+ const documents = pipe(inside, Array.filter(String$1.endsWith(MARKDOWN)), Array.map((entry) => files.join(root, entry)));
3786
+ const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY });
3787
+ const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
3788
+ file: files.join(root, entry),
3789
+ line: FIRST$1,
3790
+ column: FIRST$1,
3791
+ rule: RULE$2,
3792
+ message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
3793
+ })));
3794
+ return [
3795
+ ...pipe(text, Option.map((source) => frontmatterProblems({
3796
+ file,
3797
+ directory,
3798
+ source
3799
+ }, files.basename(directory))), Option.getOrElse(() => [])),
3800
+ ...licenses,
3801
+ ...Array.flatten(links)
3802
+ ];
3803
+ });
3804
+ /** @internal */
3805
+ const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
3806
+ const listed = yield* (yield* RepositoryFiles).listedFiles(root);
3807
+ const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name)));
3808
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$1(root, listed, name), { concurrency: READ_CONCURRENCY });
3809
+ return Array.flatten(found);
3810
+ });
3811
+ // src/features/unneeded-files/model/alchemy-patch.ts
3812
+ const RULE$1 = "alchemy-patch";
3813
+ const WORKSPACE_FILE$1 = "pnpm-workspace.yaml";
3814
+ const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
3815
+ const START$1 = 0;
3816
+ const WorkspaceFile$1 = Schema.Struct({ patchedDependencies: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)) });
3817
+ const decodeWorkspaceFile$1 = Schema.decodeUnknownOption(WorkspaceFile$1);
3818
+ const patchedIn = (source) => pipe(decodeWorkspaceFile$1(parse$1(source)), Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
3819
+ const problemOf = (file, position, name) => ({
3820
+ file,
3821
+ ...position,
3822
+ rule: RULE$1,
3823
+ message: `patches ${name}. A patch breaks on every Alchemy release. Define the missing setting as a custom resource in the stack and delete the patch.`
3824
+ });
3825
+ const problemsIn = (file) => (source) => {
3826
+ const at = positionOf(source);
3827
+ const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$1));
3828
+ return pipe(patchedIn(source), Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
3829
+ };
3830
+ /** @internal */
3831
+ const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyPatch(root) {
3832
+ const files = yield* RepositoryFiles;
3833
+ const file = files.join(root, WORKSPACE_FILE$1);
3834
+ const text = yield* files.readFile(file);
3835
+ return pipe(text, Option.map(problemsIn(file)), Option.getOrElse(() => []));
3836
+ });
3837
+ // src/features/unneeded-files/model/replaced-tools.ts
3838
+ const RULE = "replaced-tool";
3839
+ const FIRST = 1;
3840
+ const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
3841
+ const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
3842
+ const ALCHEMY = "the Alchemy stack in alchemy.run.ts";
3843
+ const REPLACED = [
3844
+ {
3845
+ pattern: /(?:^|\/)turbo\.jsonc?$/u,
3846
+ tool: "Turborepo",
3847
+ replacement: TASKS
3848
+ },
3849
+ {
3850
+ pattern: /(?:^|\/)nx\.json$/u,
3851
+ tool: "Nx",
3852
+ replacement: TASKS
3853
+ },
3854
+ {
3855
+ pattern: /(?:^|\/)\.husky\//u,
3856
+ tool: "husky",
3857
+ replacement: HOOKS
3858
+ },
3859
+ {
3860
+ pattern: /(?:^|\/)(?:\.?lefthook(?:-local)?\.(?:ya?ml|toml|json)|\.lefthook\/)/u,
3861
+ tool: "lefthook",
3862
+ replacement: HOOKS
3863
+ },
3864
+ {
3865
+ pattern: /(?:^|\/)\.?knip\.(?:jsonc?|[cm]?[jt]s)$/u,
3866
+ tool: "knip",
3867
+ replacement: "fallow"
3868
+ },
3869
+ {
3870
+ pattern: /(?:^|\/)\.jscpd\.json$/u,
3871
+ tool: "jscpd",
3872
+ replacement: "fallow"
3873
+ },
3874
+ {
3875
+ pattern: /(?:^|\/)(?:\.eslintrc(?:\.\w+)?|\.eslintignore|eslint\.config\.[cm]?[jt]s)$/u,
3876
+ tool: "ESLint",
3877
+ replacement: "`lint` in vite.config.ts, run with `vp check`"
3878
+ },
3879
+ {
3880
+ pattern: /(?:^|\/)(?:\.prettierrc(?:\.\w+)?|\.prettierignore|prettier\.config\.[cm]?[jt]s)$/u,
3881
+ tool: "Prettier",
3882
+ replacement: "`fmt` in vite.config.ts, run with `vp check`"
3883
+ },
3884
+ {
3885
+ pattern: /(?:^|\/)jest\.config\.(?:json|[cm]?[jt]s)$/u,
3886
+ tool: "Jest",
3887
+ replacement: "`test` in vite.config.ts, run with `vp test`"
3888
+ },
3889
+ {
3890
+ pattern: /(?:^|\/)wrangler\.(?:toml|jsonc?)$/u,
3891
+ tool: "wrangler",
3892
+ replacement: ALCHEMY
3893
+ },
3894
+ {
3895
+ pattern: /(?:^|\/)Pulumi(?:\.[\w-]+)?\.ya?ml$/u,
3896
+ tool: "Pulumi",
3897
+ replacement: ALCHEMY
3898
+ },
3899
+ {
3900
+ pattern: /\.tf(?:vars)?$/u,
3901
+ tool: "Terraform",
3902
+ replacement: ALCHEMY
3903
+ },
3904
+ {
3905
+ pattern: /(?:^|\/)\.claude\/rules\//u,
3906
+ tool: ".claude/rules",
3907
+ replacement: "the root AGENTS.md and the skills in masseater/skills"
3908
+ }
3909
+ ];
3910
+ const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
3911
+ file,
3912
+ line: FIRST,
3913
+ column: FIRST,
3914
+ rule: RULE,
3915
+ message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
3916
+ })));
3917
+ /** @internal */
3918
+ const checkReplacedTools = Effect.fn("checkReplacedTools")(function* checkReplacedTools(root) {
3919
+ const listed = yield* listedFiles(root);
3920
+ const present = yield* presentFiles(pipe(listed, Array.filter((entry) => Option.isSome(problemFor(entry)))));
3921
+ return pipe(present, Array.flatMap((entry) => Option.toArray(problemFor(entry))));
3922
+ });
3158
3923
  // src/features/unneeded-files/model/unneeded-files.ts
3159
3924
  const WORKSPACE_FILE = "pnpm-workspace.yaml";
3160
3925
  const PNPM_DIRECTORY = ".pnpm/";
@@ -3288,6 +4053,11 @@ const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedTex
3288
4053
  checkHiddenUnicode(root),
3289
4054
  checkPython(root),
3290
4055
  checkUnneededFiles(root),
4056
+ checkReplacedTools(root),
4057
+ checkAlchemyPatch(root),
4058
+ checkNodeVersion(root),
4059
+ checkSkillFiles(root),
4060
+ checkSkillEntry(root),
3291
4061
  checkComments(root)
3292
4062
  ], { concurrency: "unbounded" });
3293
4063
  return Array.flatten(found);
@@ -3300,10 +4070,9 @@ const checkAll = Effect.fn("checkAll")(function* checkAll(root) {
3300
4070
  checkOverrides(root),
3301
4071
  checkTrackedText(root),
3302
4072
  checkPlacement(root),
3303
- checkScripts(root),
3304
4073
  checkPublishedPackages(root),
3305
4074
  checkWorkspaces(root),
3306
- checkWorkflowQueues(root)
4075
+ checkToolUse(root)
3307
4076
  ], { concurrency: "unbounded" });
3308
4077
  return Array.flatten(found);
3309
4078
  });