@r_masseater/msch 0.50.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cargo-inputs.mjs +1 -1
  2. package/dist/changed.mjs +2 -2
  3. package/dist/cli.mjs +453 -331
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +10 -6
  7. package/dist/config.mjs.map +1 -1
  8. package/dist/decision-rules.d.mts +1 -1
  9. package/dist/decision-rules.mjs +1 -1
  10. package/dist/{define-lint-preset-B1Xy1brk.mjs → define-lint-preset-CecEvjVf.mjs} +96 -1
  11. package/dist/define-lint-preset-CecEvjVf.mjs.map +1 -0
  12. package/dist/{dependencies-DbwLA4nT.mjs → dependencies-DCJv7YcW.mjs} +5 -2
  13. package/dist/dependencies-DCJv7YcW.mjs.map +1 -0
  14. package/dist/{index-DL7PSp7j.d.mts → index-B2X8WhBt.d.mts} +41 -2
  15. package/dist/{index-DdJXnW1q.d.mts → index-BZIBqvmt.d.mts} +18 -7
  16. package/dist/lint-rules.mjs +247 -6
  17. package/dist/lint-rules.mjs.map +1 -1
  18. package/dist/lint.d.mts +1 -1
  19. package/dist/lint.mjs +1 -1
  20. package/dist/oxlint.mjs +3 -7
  21. package/dist/oxlint.mjs.map +1 -1
  22. package/dist/{package-BKpgZyaV.mjs → package-LeBO9czg.mjs} +2 -2
  23. package/dist/{package-BKpgZyaV.mjs.map → package-LeBO9czg.mjs.map} +1 -1
  24. package/dist/{problem-D8mlJc3T.mjs → problem-CzOlOb5f.mjs} +10 -2
  25. package/dist/problem-CzOlOb5f.mjs.map +1 -0
  26. package/dist/{project-CR2jzkij.mjs → project-C4uzq7_4.mjs} +2 -2
  27. package/dist/{project-CR2jzkij.mjs.map → project-C4uzq7_4.mjs.map} +1 -1
  28. package/dist/started-once-muJbvD_I.mjs +8 -0
  29. package/dist/started-once-muJbvD_I.mjs.map +1 -0
  30. package/dist/workspace-settings.d.mts +2 -2
  31. package/dist/workspace-settings.mjs +83 -42
  32. package/dist/workspace-settings.mjs.map +1 -1
  33. package/package.json +3 -1
  34. package/skills/msch-checks/SKILL.md +1 -1
  35. package/skills/workspace-settings/SKILL.md +1 -0
  36. package/src/app/vite.d.ts +3 -2
  37. package/dist/define-lint-preset-B1Xy1brk.mjs.map +0 -1
  38. package/dist/dependencies-DbwLA4nT.mjs.map +0 -1
  39. package/dist/problem-D8mlJc3T.mjs.map +0 -1
  40. package/dist/started-once-CkTooI_o.mjs +0 -13
  41. package/dist/started-once-CkTooI_o.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { B as propertyValue, C as RUN_TASKS, D as hasVerifyTask, E as definesTask, F as KeySchema, I as childrenOf$1, L as keyName, P as workspaceConfigOf, R as literalOf, T as VERIFY_TASK, V as stringsIn, _ as publishedProjects, a as cratesIn, b as workspaceManifest, c as workspaceLinks, d as deployEntries, f as namedWorkspaces, h as shadcnUiOf, l as lockedGraph, o as owningWorkspace, p as patternOf$1, r as readManifest, t as MANIFEST_FILE$3, u as lockedPackages, v as workspaceDirectories, x as runTasksOf, y as workspaceProjects, z as nestedValues } from "./dependencies-DbwLA4nT.mjs";
3
- import { C as valueKey, S as schemaTypeOf, _ as formatValues, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as recordsIn, l as mentions$1, m as isObjectType, n as contentKey, o as projectInputs, p as describeLibraryType, r as keepOnly, t as implementationFingerprint, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./project-CR2jzkij.mjs";
2
+ import { B as propertyValue, C as RUN_TASKS, E as hasVerifyTask, F as KeySchema, I as childrenOf$1, L as keyName, P as workspaceConfigOf, R as literalOf, T as definesTask, V as stringsIn, _ as publishedProjects, a as cratesIn, b as workspaceManifest, c as workspaceLinks, d as deployEntries, f as namedWorkspaces, h as shadcnUiOf, l as lockedGraph, o as owningWorkspace, p as patternOf$1, r as readManifest, t as MANIFEST_FILE$3, u as lockedPackages, v as workspaceDirectories, w as VERIFY_TASK, x as runTasksOf, y as workspaceProjects, z as nestedValues } from "./dependencies-DCJv7YcW.mjs";
3
+ import { C as valueKey, S as schemaTypeOf, _ as formatValues, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as recordsIn, l as mentions$1, m as isObjectType, n as contentKey, o as projectInputs, p as describeLibraryType, r as keepOnly, t as implementationFingerprint, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./project-C4uzq7_4.mjs";
4
4
  import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repository-files-B5sRbxlz.mjs";
5
5
  import { a as isRecord, c as isScannedText, d as presentFiles, f as scanText, i as collectNodes, l as isToolVersions, n as checkUpstreamExits, o as tomlSourceComments, p as positionOf, s as yamlSourceComments, t as checkScatteredDeviations, u as listedFiles } from "./check-upstream-exits-DYxWDyHC.mjs";
6
- import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-BKpgZyaV.mjs";
6
+ import { a as publicEntriesOf, i as EntryManifestJson, r as publishedWorkspaces } from "./package-LeBO9czg.mjs";
7
+ import { a as problemInFile, i as problemAt$8, o as sortProblems, r as formatProblem, t as ProblemList } from "./problem-CzOlOb5f.mjs";
7
8
  import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-CXgB6xpE.mjs";
8
- import { t as startedOnce } from "./started-once-CkTooI_o.mjs";
9
+ import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
9
10
  import { $ as isSpreadElement, A as isBlock, B as isInterfaceDeclaration, C as getJSDocTags, D as isArrayLiteralExpression, E as getTextOfJSDocComment, F as isExportDeclaration, G as isObjectLiteralExpression, H as isModuleDeclaration, I as isFunctionDeclaration, J as isPropertyAssignment, K as isParenthesizedExpression, L as isFunctionExpression, M as isClassDeclaration, N as isElementAccessExpression, O as isArrowFunction, P as isEnumDeclaration, Q as isSourceFile, R as isIdentifier, S as SyntaxKind, T as getNameOfDeclaration, U as isNewExpression, V as isModuleBlock, W as isNumericLiteral, X as isSatisfiesExpression, Y as isReturnStatement, Z as isSignatureDeclaration, _ as uniqueByReference, a as descendantsOf, at as isVariableDeclaration, c as isGenericDeclaration, d as lineOf$3, et as isStringLiteral, f as packageOf$1, g as symbolAt, i as declarationsOf, it as isUnionTypeNode, j as isCallExpression, k as isBinaryExpression, l as isInsideAny, m as referencedSymbols, n as columnOf, nt as isTypeLiteralNode, o as importedModulesOf, ot as isVariableDeclarationList, p as propertyNamesOf, q as isPropertyAccessExpression, r as contains, rt as isTypeReferenceNode, s as isExternalDeclaration, st as isVariableStatement, t as childrenOf$2, tt as isTypeAliasDeclaration, u as isTypeDeclaration, x as SignatureKind, z as isImportDeclaration } from "./syntax-3AJkpCcs.mjs";
10
- import { a as sortProblems, i as problemAt$9, r as formatProblem, t as ProblemList } from "./problem-D8mlJc3T.mjs";
11
11
  import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-DFsdNYI0.mjs";
12
12
  import "./cli-contract-D7btWrEu.mjs";
13
13
  import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
14
- import { Array, Config, Effect, FileSystem, HashMap, HashSet, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
14
+ import { Array, Config, Context, Effect, FileSystem, HashMap, HashSet, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
15
15
  import { updateWorkspaceManifest } from "@pnpm/workspace.workspace-manifest-writer";
16
16
  import { ChildProcess } from "effect/process";
17
17
  import { parse, resolveConfigFromFile } from "vite-plus";
@@ -348,55 +348,55 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
348
348
  // src/features/check-overrides/model/git-subpath.ts
349
349
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
350
350
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
351
- const RULE$53 = "git-subpath-dependency";
351
+ const RULE$55 = "git-subpath-dependency";
352
352
  const WHOLE_MATCH$3 = 0;
353
- const problemAt$8 = ({ file }, source) => (found) => ({
353
+ const problemAt$7 = ({ file }, source) => (found) => ({
354
354
  file,
355
355
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
356
- rule: RULE$53,
356
+ rule: RULE$55,
357
357
  message: `Git subpath dependencies are banned. Publish the package to npm and depend on a released version instead of \`${String$1.trim(found[WHOLE_MATCH$3])}\`.`
358
358
  });
359
- const problemsIn$17 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$8(entry, source)));
359
+ const problemsIn$18 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$7(entry, source)));
360
360
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
361
361
  /** @internal */
362
362
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
363
363
  const listed = yield* listedFiles(root);
364
- return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$17);
364
+ return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$18);
365
365
  });
366
366
  // src/features/check-overrides/model/restricted-rules.ts
367
- const RULE$52 = "unnamed-restriction";
367
+ const RULE$54 = "unnamed-restriction";
368
368
  const WHOLE_MATCH$2 = 0;
369
369
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
370
- const problemsIn$16 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
370
+ const problemsIn$17 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
371
371
  file: entry.file,
372
372
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
373
- rule: RULE$52,
373
+ rule: RULE$54,
374
374
  message: `${found[WHOLE_MATCH$2]} is not used in this repository, because its name does not say what an entry protects. Ban a package in dependencyRules.banned, and write any other restriction as a rule in msch-lint whose name states the intent.`
375
375
  })));
376
376
  /** @internal */
377
377
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
378
378
  const listed = yield* listedFiles(root);
379
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$16);
379
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$17);
380
380
  });
381
381
  // src/features/check-overrides/model/package-registry.ts
382
- const RULE$51 = "package-registry";
382
+ const RULE$53 = "package-registry";
383
383
  const REGISTRY = "https://npm.flatt.tech/";
384
384
  const TRAILING_SLASH = /\/$/u;
385
385
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
386
386
  const NPMRC = /(?:^|\/)\.npmrc$/u;
387
387
  const WORKSPACE_REGISTRY = /^registry:/mu;
388
388
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
389
- const START$19 = 0;
389
+ const START$20 = 0;
390
390
  const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
391
391
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
392
392
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
393
393
  const withoutSlash = String$1.replace(TRAILING_SLASH, "");
394
394
  const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
395
- const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$19));
395
+ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$20));
396
396
  const workspaceProblem = (file, source, registry) => ({
397
397
  file,
398
398
  ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
399
- rule: RULE$51,
399
+ rule: RULE$53,
400
400
  message: Option.match(registry, {
401
401
  onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
402
402
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
@@ -404,9 +404,9 @@ const workspaceProblem = (file, source, registry) => ({
404
404
  });
405
405
  const npmrcProblems = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array.filter((found) => !Option.exists(groupOf$2("value")(found), isGuarded)), Array.map((found) => ({
406
406
  file: entry.file,
407
- ...positionOf(source)(found.index ?? START$19),
408
- rule: RULE$51,
409
- message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$19])}\`. Remove the line.`
407
+ ...positionOf(source)(found.index ?? START$20),
408
+ rule: RULE$53,
409
+ message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$20])}\`. Remove the line.`
410
410
  })));
411
411
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
412
412
  const files = yield* RepositoryFiles;
@@ -425,36 +425,36 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
425
425
  return [...yield* checkWorkspace(root), ...overrides];
426
426
  });
427
427
  // src/features/check-placement/model/colocated-git-patterns.ts
428
- const RULE$50 = "colocated-git-patterns";
428
+ const RULE$52 = "colocated-git-patterns";
429
429
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
430
- const ROOT$2 = ".";
431
- const SEPARATOR$21 = "/";
430
+ const ROOT$3 = ".";
431
+ const SEPARATOR$22 = "/";
432
432
  const NEGATION$1 = "!";
433
433
  const COMMENT$1 = "#";
434
434
  const ANY_DEPTH = "**";
435
- const FLOATING_PREFIX = `${ANY_DEPTH}${SEPARATOR$21}`;
435
+ const FLOATING_PREFIX = `${ANY_DEPTH}${SEPARATOR$22}`;
436
436
  const LEADING_SLASHES = /^\/+/u;
437
437
  const TRAILING_SLASHES = /\/+$/u;
438
438
  const SPACES = /\s+/u;
439
- const FIRST$27 = 1;
439
+ const FIRST$21 = 1;
440
440
  const READ_CONCURRENCY$29 = 16;
441
- const isInside = (directory) => (inner) => inner !== directory && (directory === ROOT$2 || String$1.startsWith(`${directory}${SEPARATOR$21}`)(inner));
441
+ const isInside = (directory) => (inner) => inner !== directory && (directory === ROOT$3 || String$1.startsWith(`${directory}${SEPARATOR$22}`)(inner));
442
442
  const withoutPrefix = (prefix, text) => {
443
443
  if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
444
444
  return text;
445
445
  };
446
446
  const isAnchored = (pattern) => {
447
447
  const body = withoutPrefix(NEGATION$1, pattern);
448
- return pipe(body, String$1.replace(TRAILING_SLASHES, ""), String$1.includes(SEPARATOR$21));
448
+ return pipe(body, String$1.replace(TRAILING_SLASHES, ""), String$1.includes(SEPARATOR$22));
449
449
  };
450
450
  const segmentsOf = ({ directory, pattern }) => {
451
451
  const body = withoutPrefix(NEGATION$1, pattern);
452
452
  const trimmed = pipe(body, String$1.replace(LEADING_SLASHES, ""), String$1.replace(TRAILING_SLASHES, ""));
453
- const own = String$1.split(SEPARATOR$21)(trimmed);
454
- if (directory === ROOT$2) return own;
455
- return [...String$1.split(SEPARATOR$21)(directory), ...own];
453
+ const own = String$1.split(SEPARATOR$22)(trimmed);
454
+ if (directory === ROOT$3) return own;
455
+ return [...String$1.split(SEPARATOR$22)(directory), ...own];
456
456
  };
457
- const depthOf = (directory) => String$1.split(SEPARATOR$21)(directory).length;
457
+ const depthOf = (directory) => String$1.split(SEPARATOR$22)(directory).length;
458
458
  const entryOf$1 = (file, kind, directory) => (line, index) => {
459
459
  const [pattern, ...values] = pipe(String$1.trim(line), String$1.split(SPACES));
460
460
  if (String$1.isEmpty(pattern) || String$1.startsWith(COMMENT$1)(pattern)) return Option.none();
@@ -462,7 +462,7 @@ const entryOf$1 = (file, kind, directory) => (line, index) => {
462
462
  file,
463
463
  kind,
464
464
  directory,
465
- line: index + FIRST$27,
465
+ line: index + FIRST$21,
466
466
  pattern,
467
467
  values: Array.join(values, " ")
468
468
  });
@@ -474,15 +474,15 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
474
474
  const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
475
475
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array.map(toEntry), Array.getSomes);
476
476
  });
477
- const problemAt$7 = (entry, message) => ({
477
+ const problemAt$6 = (entry, message) => ({
478
478
  file: entry.file,
479
479
  line: entry.line,
480
- column: FIRST$27,
481
- rule: RULE$50,
480
+ column: FIRST$21,
481
+ rule: RULE$52,
482
482
  message
483
483
  });
484
484
  const misplacedMessage = (kind, workspaces) => {
485
- if (workspaces.length === FIRST$27) {
485
+ if (workspaces.length === FIRST$21) {
486
486
  const workspace = Array.join(workspaces, "");
487
487
  return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
488
488
  }
@@ -492,7 +492,7 @@ const matchedAtDepth = Effect.fn("matchedAtDepth")(function* matchedAtDepth(root
492
492
  const files = yield* RepositoryFiles;
493
493
  const leading = Array.take(segments, depth);
494
494
  if (Array.contains(leading, ANY_DEPTH)) return [];
495
- const manifests = yield* files.matchingFiles(root, [`:(glob)${Array.join(leading, SEPARATOR$21)}${SEPARATOR$21}${MANIFEST_FILE$3}`]);
495
+ const manifests = yield* files.matchingFiles(root, [`:(glob)${Array.join(leading, SEPARATOR$22)}${SEPARATOR$22}${MANIFEST_FILE$3}`]);
496
496
  return pipe(manifests, Array.map((manifest) => files.dirname(manifest)));
497
497
  });
498
498
  const deepestOf = (inner) => pipe(inner, Array.filter((workspace) => !pipe(inner, Array.some(isInside(workspace)))));
@@ -508,26 +508,26 @@ const misplaced = Effect.fn("misplaced")(function* misplaced(root, workspaces, e
508
508
  if (!isAnchored(entry.pattern)) return Option.none();
509
509
  const deepest = yield* matchedWorkspaces(root, workspaces, entry);
510
510
  if (Array.isReadonlyArrayEmpty(deepest)) return Option.none();
511
- return Option.some(problemAt$7(entry, misplacedMessage(entry.kind, deepest)));
511
+ return Option.some(problemAt$6(entry, misplacedMessage(entry.kind, deepest)));
512
512
  });
513
513
  const isFloating = (pattern) => !String$1.startsWith(NEGATION$1)(pattern) && (!isAnchored(pattern) || String$1.startsWith(FLOATING_PREFIX)(pattern));
514
514
  const ownLevelName = (pattern) => {
515
515
  if (isFloating(pattern)) return Option.some(pattern);
516
- const name = withoutPrefix(SEPARATOR$21, pattern);
516
+ const name = withoutPrefix(SEPARATOR$22, pattern);
517
517
  return Option.liftPredicate(name, (own) => isFloating(own) && !isAnchored(own));
518
518
  };
519
519
  const sameName = (outer, name) => {
520
520
  if (outer === name) return true;
521
- return String$1.endsWith(SEPARATOR$21)(name) && `${outer}${SEPARATOR$21}` === name;
521
+ return String$1.endsWith(SEPARATOR$22)(name) && `${outer}${SEPARATOR$22}` === name;
522
522
  };
523
523
  const coveredBy = (entry, name) => (outer) => outer.kind === entry.kind && outer.values === entry.values && isFloating(outer.pattern) && isInside(outer.directory)(entry.directory) && sameName(outer.pattern, name);
524
524
  const outerName = ({ directory, kind }) => {
525
- if (directory === ROOT$2) return `the root ${kind}`;
525
+ if (directory === ROOT$3) return `the root ${kind}`;
526
526
  return `${directory}/${kind}`;
527
527
  };
528
528
  const repeated = (entries) => (entry) => {
529
529
  const outer = pipe(ownLevelName(entry.pattern), Option.flatMap((name) => pipe(entries, Array.findFirst(coveredBy(entry, name)))));
530
- return pipe(outer, Option.map((found) => problemAt$7(entry, `repeats ${found.pattern} from ${outerName(found)}, which already applies here. Delete it.`)));
530
+ return pipe(outer, Option.map((found) => problemAt$6(entry, `repeats ${found.pattern} from ${outerName(found)}, which already applies here. Delete it.`)));
531
531
  };
532
532
  /** @internal */
533
533
  const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
@@ -540,8 +540,8 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
540
540
  return Array.getSomes([...misplacedFound, ...repeatedFound]);
541
541
  });
542
542
  // src/features/check-placement/model/colocated-tests.ts
543
- const RULE$49 = "colocated-test";
544
- const FIRST$26 = 1;
543
+ const RULE$51 = "colocated-test";
544
+ const FIRST$20 = 1;
545
545
  const READ_CONCURRENCY$28 = 64;
546
546
  const ROOT_SUBPATH = ".";
547
547
  const NAME_GROUP = "name";
@@ -564,11 +564,11 @@ const Manifest$5 = Schema.Struct({
564
564
  });
565
565
  const decodeManifest$9 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$5));
566
566
  const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
567
- const problemFor$7 = (test, message) => ({
567
+ const problemFor$6 = (test, message) => ({
568
568
  file: test.file,
569
- line: FIRST$26,
570
- column: FIRST$26,
571
- rule: RULE$49,
569
+ line: FIRST$20,
570
+ column: FIRST$20,
571
+ rule: RULE$51,
572
572
  message: `${test.base} ${message}`
573
573
  });
574
574
  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);
@@ -608,10 +608,10 @@ const refersIn = Effect.fn("refersIn")(function* refersIn(context, test) {
608
608
  });
609
609
  const inSeparateTestDirectory = (name) => SEPARATE_TEST_DIRECTORY.test(name) || SPEC_DIRECTORY.test(name) && SPEC_FILE.test(name);
610
610
  const problemIn$6 = Effect.fn("problemIn")(function* problemIn(context, test) {
611
- if (inSeparateTestDirectory(test.name)) return Option.some(problemFor$7(test, DIRECTORY_MESSAGE));
611
+ if (inSeparateTestDirectory(test.name)) return Option.some(problemFor$6(test, DIRECTORY_MESSAGE));
612
612
  if (!TEST_FILE$2.test(test.name)) return Option.none();
613
613
  if (yield* refersIn(context, test)) return Option.none();
614
- return Option.some(problemFor$7(test, SIBLING_MESSAGE));
614
+ return Option.some(problemFor$6(test, SIBLING_MESSAGE));
615
615
  });
616
616
  /** @internal */
617
617
  const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColocatedTests(root) {
@@ -650,26 +650,26 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
650
650
  });
651
651
  // src/features/check-placement/model/agent-docs-length.ts
652
652
  const RECOMMENDED_LINES = 200;
653
- const FIRST$25 = 1;
654
- const RULE$48 = "agent-docs-length";
653
+ const FIRST$19 = 1;
654
+ const RULE$50 = "agent-docs-length";
655
655
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
656
- const problemFor$6 = (file) => (lines) => {
656
+ const problemFor$5 = (file) => (lines) => {
657
657
  if (lines <= RECOMMENDED_LINES) return Option.none();
658
658
  return Option.some({
659
659
  file,
660
660
  line: 201,
661
- column: FIRST$25,
662
- rule: RULE$48,
661
+ column: FIRST$19,
662
+ rule: RULE$50,
663
663
  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.`
664
664
  });
665
665
  };
666
666
  /** @internal */
667
- const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$6(file)(lineCount(source)));
667
+ const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$5(file)(lineCount(source)));
668
668
  // src/features/check-placement/model/claude-link.ts
669
- const RULE$47 = "claude-md-link";
669
+ const RULE$49 = "claude-md-link";
670
670
  const CLAUDE = "CLAUDE.md";
671
671
  const AGENTS = "AGENTS.md";
672
- const FIRST$24 = 1;
672
+ const FIRST$18 = 1;
673
673
  const READ_CONCURRENCY$26 = 16;
674
674
  const MESSAGE$16 = "CLAUDE.md must be a symbolic link to AGENTS.md";
675
675
  /** @internal */
@@ -683,9 +683,9 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
683
683
  const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
684
684
  return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
685
685
  file: path,
686
- line: FIRST$24,
687
- column: FIRST$24,
688
- rule: RULE$47,
686
+ line: FIRST$18,
687
+ column: FIRST$18,
688
+ rule: RULE$49,
689
689
  message: MESSAGE$16
690
690
  })));
691
691
  });
@@ -694,11 +694,11 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
694
694
  return Array.getSomes(found);
695
695
  });
696
696
  // src/features/check-placement/model/dangling-links.ts
697
- const RULE$46 = "dangling-link";
698
- const SEPARATOR$20 = "/";
699
- const FIRST$23 = 1;
697
+ const RULE$48 = "dangling-link";
698
+ const SEPARATOR$21 = "/";
699
+ const FIRST$17 = 1;
700
700
  const READ_CONCURRENCY$25 = 16;
701
- const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$20}`)(name);
701
+ const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$21}`)(name);
702
702
  /** @internal */
703
703
  const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
704
704
  const files = yield* RepositoryFiles;
@@ -708,9 +708,9 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
708
708
  const link = yield* files.readLink(file);
709
709
  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) => ({
710
710
  file,
711
- line: FIRST$23,
712
- column: FIRST$23,
713
- rule: RULE$46,
711
+ line: FIRST$17,
712
+ column: FIRST$17,
713
+ rule: RULE$48,
714
714
  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.`
715
715
  })));
716
716
  });
@@ -718,10 +718,9 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
718
718
  return Array.getSomes(found);
719
719
  });
720
720
  // src/features/check-placement/model/nested-docs.ts
721
- const RULE$45 = "nested-docs";
721
+ const RULE$47 = "nested-docs";
722
722
  const CONFIG_FILE$6 = "vite.config.ts";
723
- const SEPARATOR$19 = "/";
724
- const FIRST$22 = 1;
723
+ const SEPARATOR$20 = "/";
725
724
  const READ_CONCURRENCY$24 = 64;
726
725
  const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
727
726
  const WORKSPACE_AGENT_DOC = "AGENTS.md";
@@ -729,25 +728,19 @@ const README = /^README(?:\.[^/]+)?$/iu;
729
728
  const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
730
729
  const taggedError$5 = Schema.TaggedError;
731
730
  var RootConfigUnreadable = class extends taggedError$5()("RootConfigUnreadable", { file: Schema.String }) {};
732
- const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
733
- const problemFor$5 = (file, message) => ({
734
- file,
735
- line: FIRST$22,
736
- column: FIRST$22,
737
- rule: RULE$45,
738
- message
739
- });
731
+ const isNested = (name) => String$1.includes(SEPARATOR$20)(name);
732
+ const problemFor$4 = problemInFile(RULE$47);
740
733
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
741
734
  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.";
742
735
  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.";
743
736
  const agentDocProblem = ({ file, base, directory }, allowed) => {
744
- if (!allowed.workspaceAgentDocs) return Option.some(problemFor$5(file, `${base} ${AGENT_DOCS_MESSAGE}`));
737
+ if (!allowed.workspaceAgentDocs) return Option.some(problemFor$4(file, `${base} ${AGENT_DOCS_MESSAGE}`));
745
738
  if (base === WORKSPACE_AGENT_DOC && HashSet.has(allowed.workspaces, directory)) return Option.none();
746
- return Option.some(problemFor$5(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
739
+ return Option.some(problemFor$4(file, `${base} ${WORKSPACE_AGENT_DOCS_MESSAGE}`));
747
740
  };
748
741
  const readmeProblem = ({ file, base, directory }, allowed) => {
749
742
  if (!README.test(base) || HashSet.has(allowed.workspaces, directory)) return Option.none();
750
- return Option.some(problemFor$5(file, `${base} ${README_MESSAGE}`));
743
+ return Option.some(problemFor$4(file, `${base} ${README_MESSAGE}`));
751
744
  };
752
745
  const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, allowed, name) {
753
746
  const files = yield* RepositoryFiles;
@@ -785,7 +778,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
785
778
  return Array.getSomes(found);
786
779
  });
787
780
  // src/features/check-placement/model/published-readme.ts
788
- const RULE$44 = "published-readme";
781
+ const RULE$46 = "published-readme";
789
782
  const README_FILE = "README.md";
790
783
  const READ_CONCURRENCY$23 = 16;
791
784
  const MESSAGE$15 = "contains Japanese. This package is published to npm, so write its README in English.";
@@ -799,7 +792,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
799
792
  file,
800
793
  line: FILE_START$1,
801
794
  column: FILE_START$1,
802
- rule: RULE$44,
795
+ rule: RULE$46,
803
796
  message: MISSING_MESSAGE
804
797
  });
805
798
  return pipe(text, Option.flatMap((source) => pipe(Option.fromNullishOr(JAPANESE.exec(source)), Option.map((found) => {
@@ -808,7 +801,7 @@ const problemIn$4 = Effect.fn("problemIn")(function* problemIn(root, { directory
808
801
  file,
809
802
  line,
810
803
  column,
811
- rule: RULE$44,
804
+ rule: RULE$46,
812
805
  message: MESSAGE$15
813
806
  };
814
807
  }))));
@@ -820,13 +813,13 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
820
813
  return Array.getSomes(found);
821
814
  });
822
815
  // src/features/check-placement/model/published-tests.ts
823
- const RULE$43 = "published-tests";
816
+ const RULE$45 = "published-tests";
824
817
  const MANIFEST_FILE$2 = "package.json";
825
818
  const FILE_START = 1;
826
819
  const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
827
820
  const MESSAGE$14 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
828
821
  const testedIn = (listed) => (prefix) => pipe(listed, Array.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
829
- const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
822
+ const problemFor$3 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
830
823
  const files = yield* RepositoryFiles;
831
824
  const absolute = files.join(root, directory);
832
825
  const prefix = `${absolute}/`;
@@ -835,7 +828,7 @@ const problemFor$4 = Effect.fn("problemFor")(function* problemFor(root, listed,
835
828
  file: files.join(absolute, MANIFEST_FILE$2),
836
829
  line: FILE_START,
837
830
  column: FILE_START,
838
- rule: RULE$43,
831
+ rule: RULE$45,
839
832
  message: MESSAGE$14
840
833
  });
841
834
  });
@@ -845,38 +838,38 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
845
838
  const projects = yield* publishedProjects(root);
846
839
  const listed = yield* files.listedFiles(root);
847
840
  const absolute = pipe(listed, Array.map((file) => files.join(root, file)));
848
- const found = yield* Effect.forEach(projects, (project) => problemFor$4(root, absolute, project), { concurrency: 1 });
841
+ const found = yield* Effect.forEach(projects, (project) => problemFor$3(root, absolute, project), { concurrency: 1 });
849
842
  return Array.getSomes(found);
850
843
  });
851
844
  // src/features/check-placement/model/root-docs.ts
852
- const RULE$42 = "root-docs";
853
- const SEPARATOR$18 = "/";
854
- const FIRST$21 = 1;
845
+ const RULE$44 = "root-docs";
846
+ const SEPARATOR$19 = "/";
847
+ const FIRST$16 = 1;
855
848
  const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
856
849
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
857
850
  const MESSAGE$13 = "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.";
858
- const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
851
+ const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$19)(name) && MARKDOWN$1.test(name) && !ALLOWED.test(name);
859
852
  /** @internal */
860
853
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
861
854
  const files = yield* RepositoryFiles;
862
855
  const names = yield* files.listedFiles(root);
863
856
  return pipe(names, Array.filter(isStrayRootDoc), Array.map((name) => ({
864
857
  file: files.join(root, name),
865
- line: FIRST$21,
866
- column: FIRST$21,
867
- rule: RULE$42,
858
+ line: FIRST$16,
859
+ column: FIRST$16,
860
+ rule: RULE$44,
868
861
  message: `${name} ${MESSAGE$13}`
869
862
  })));
870
863
  });
871
864
  // src/features/check-placement/model/root-readme.ts
872
- const RULE$41 = "root-readme";
865
+ const RULE$43 = "root-readme";
873
866
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
874
867
  const READ_CONCURRENCY$22 = 16;
875
- const START$18 = 0;
868
+ const START$19 = 0;
876
869
  const CHECK_POLICY = "@r_masseater/msch";
877
870
  const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
878
871
  const RELATIVE$1 = /^\.\//u;
879
- const SEPARATOR$17 = "/";
872
+ const SEPARATOR$18 = "/";
880
873
  const MarketplacePlugin = Schema.Struct({
881
874
  name: Schema.optional(Schema.String),
882
875
  source: Schema.Unknown
@@ -888,7 +881,7 @@ const NO_PLUGINS = {
888
881
  };
889
882
  const isCheckPolicy = ({ packageName }) => Option.contains(packageName, CHECK_POLICY);
890
883
  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.`;
891
- const lastSegment = (directory) => pipe(String$1.split(SEPARATOR$17)(directory), Array.last, Option.getOrElse(() => directory));
884
+ const lastSegment = (directory) => pipe(String$1.split(SEPARATOR$18)(directory), Array.last, Option.getOrElse(() => directory));
892
885
  const pluginsOf = (plugins) => {
893
886
  const directories = pipe(plugins, Array.map(({ source }) => source), Array.filter(Predicate.isString), Array.map(String$1.replace(RELATIVE$1, "")));
894
887
  const segments = pipe(directories, Array.map(lastSegment));
@@ -911,14 +904,14 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
911
904
  onNone: () => ownNames(plugins, names),
912
905
  onSome: () => [directory]
913
906
  }));
914
- const problemsIn$15 = (file, source, plugins) => (workspace) => {
907
+ const problemsIn$16 = (file, source, plugins) => (workspace) => {
915
908
  const message = messageFor(workspace.directory);
916
909
  const at = positionOf(source);
917
910
  const pattern = patternFor(plugins)(workspace);
918
911
  return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => ({
919
912
  file,
920
- ...at(found.index ?? START$18),
921
- rule: RULE$41,
913
+ ...at(found.index ?? START$19),
914
+ rule: RULE$43,
922
915
  message
923
916
  })));
924
917
  };
@@ -926,7 +919,7 @@ const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadm
926
919
  const text = yield* (yield* RepositoryFiles).readFile(file);
927
920
  return pipe(text, Option.match({
928
921
  onNone: () => [],
929
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$15(file, source, plugins)))
922
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$16(file, source, plugins)))
930
923
  }));
931
924
  });
932
925
  /** @internal */
@@ -956,7 +949,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
956
949
  return Array.flatten(found);
957
950
  });
958
951
  // src/features/check-placement/model/docs-mirror.ts
959
- const RULE$40 = "docs-mirror";
952
+ const RULE$42 = "docs-mirror";
960
953
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
961
954
  const MIRROR_LIMIT = 3;
962
955
  const READ_CONCURRENCY$21 = 16;
@@ -975,20 +968,20 @@ const firstMention = (source, workspace) => {
975
968
  };
976
969
  const ownerOf$4 = (doc) => (workspace) => String$1.startsWith(`${workspace.directory}/`)(doc);
977
970
  const describe = (mentions) => pipe(mentions, Array.map(({ directory }) => `\`${directory}\``), Array.join(", "));
978
- const problemFor$3 = (file, source, mentions) => pipe(Array.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
971
+ const problemFor$2 = (file, source, mentions) => pipe(Array.head(mentions), Option.filter(() => mentions.length >= MIRROR_LIMIT), Option.map(({ offset }) => {
979
972
  const { line, column } = positionOf(source)(offset);
980
973
  return {
981
974
  file,
982
975
  line,
983
976
  column,
984
- rule: RULE$40,
977
+ rule: RULE$42,
985
978
  message: `names ${String(mentions.length)} other workspaces (${describe(mentions)}). The workspace list and each package.json already declare them, so this copy goes stale. Point at the declaration instead of listing it.`
986
979
  };
987
980
  }), Option.toArray);
988
981
  const othersIn = (doc, workspaces) => pipe(workspaces, Array.filter((workspace) => !ownerOf$4(doc)(workspace)));
989
982
  const problemIn$3 = (workspaces) => (doc, file, source) => {
990
983
  const mentions = pipe(othersIn(doc, workspaces), Array.flatMap((workspace) => Option.toArray(firstMention(source, workspace))));
991
- return problemFor$3(file, source, Array.sort(mentions, byOffset));
984
+ return problemFor$2(file, source, Array.sort(mentions, byOffset));
992
985
  };
993
986
  const workspacesOf = Effect.fn("workspacesOf")(function* workspacesOf(root) {
994
987
  const files = yield* RepositoryFiles;
@@ -1013,9 +1006,9 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
1013
1006
  return Array.flatten(found);
1014
1007
  });
1015
1008
  // src/features/check-placement/model/ignored-sources.ts
1016
- const RULE$39 = "ignored-sources";
1009
+ const RULE$41 = "ignored-sources";
1017
1010
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
1018
- const FIRST$20 = 1;
1011
+ const FIRST$15 = 1;
1019
1012
  const MESSAGE$12 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
1020
1013
  /** @internal */
1021
1014
  const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
@@ -1023,16 +1016,16 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
1023
1016
  const ignored = yield* files.ignoredFiles(root, SOURCES);
1024
1017
  return pipe(ignored, Array.map((file) => ({
1025
1018
  file: files.join(root, file),
1026
- line: FIRST$20,
1027
- column: FIRST$20,
1028
- rule: RULE$39,
1019
+ line: FIRST$15,
1020
+ column: FIRST$15,
1021
+ rule: RULE$41,
1029
1022
  message: MESSAGE$12
1030
1023
  })));
1031
1024
  });
1032
1025
  // src/features/check-placement/model/member-sources.ts
1033
1026
  const ROOT_WORKSPACE$1 = ".";
1034
- const FIRST$19 = 1;
1035
- const SEPARATOR$16 = "/";
1027
+ const FIRST$14 = 1;
1028
+ const SEPARATOR$17 = "/";
1036
1029
  const EXCLUDED$6 = [
1037
1030
  ":(exclude,attr:linguist-vendored)",
1038
1031
  ":(exclude,attr:linguist-generated)",
@@ -1052,12 +1045,12 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
1052
1045
  const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
1053
1046
  const fileProblem$1 = ({ file, rule, message }) => ({
1054
1047
  file,
1055
- line: FIRST$19,
1056
- column: FIRST$19,
1048
+ line: FIRST$14,
1049
+ column: FIRST$14,
1057
1050
  rule,
1058
1051
  message
1059
1052
  });
1060
- const ownerOf$3 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$16}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
1053
+ const ownerOf$3 = (workspaces) => (name) => pipe(workspaces, Array.filter((workspace) => String$1.startsWith(`${workspace}${SEPARATOR$17}`)(name)), (owners) => Array.last(Array.sort(owners, byLength$1)), Option.map((workspace) => ({
1061
1054
  workspace,
1062
1055
  inner: String$1.slice(workspace.length + 1)(name)
1063
1056
  })));
@@ -9638,7 +9631,7 @@ var english_verbs_default = [
9638
9631
  // src/features/check-placement/model/source-names.ts
9639
9632
  const SLICE_RULE$1 = "feature-slice-name";
9640
9633
  const ENTRY_RULE$2 = "deploy-entry-name";
9641
- const SEPARATOR$14 = "/";
9634
+ const SEPARATOR$15 = "/";
9642
9635
  const NEXT$3 = 1;
9643
9636
  const WORD_SEPARATOR$1 = "-";
9644
9637
  const MINIMUM_WORDS = 2;
@@ -9654,11 +9647,11 @@ const isVerbObjectBy = (separator) => (slice) => {
9654
9647
  return words.length >= MINIMUM_WORDS && Option.exists(Array.head(words), (word) => VERBS.has(word));
9655
9648
  };
9656
9649
  const isVerbObject = isVerbObjectBy(WORD_SEPARATOR$1);
9657
- const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT$1.test(path)), Option.flatMap((path) => Array.head(String$1.split(String$1.slice(13)(path), SEPARATOR$14))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$14}${FEATURES$1}${slice}`));
9650
+ const misnamedSlice$1 = ({ workspace, inner }) => pipe(Option.liftPredicate(inner, (path) => String$1.startsWith(FEATURES$1)(path) && SCRIPT$1.test(path)), Option.flatMap((path) => Array.head(String$1.split(String$1.slice(13)(path), SEPARATOR$15))), Option.filter((slice) => !isVerbObject(slice)), Option.map((slice) => `${workspace}${SEPARATOR$15}${FEATURES$1}${slice}`));
9658
9651
  const deployNamed = ({ workspace, inner }) => {
9659
9652
  if (!String$1.startsWith(SOURCE$1)(inner)) return Option.none();
9660
- const segments = String$1.split(inner, SEPARATOR$14);
9661
- return pipe(Array.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$14}${Array.join(Array.take(segments, index + NEXT$3), SEPARATOR$14)}`));
9653
+ const segments = String$1.split(inner, SEPARATOR$15);
9654
+ return pipe(Array.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$15}${Array.join(Array.take(segments, index + NEXT$3), SEPARATOR$15)}`));
9662
9655
  };
9663
9656
  /** @internal */
9664
9657
  const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
@@ -9779,13 +9772,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
9779
9772
  return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
9780
9773
  });
9781
9774
  // src/features/check-placement/model/shadcn-ui-alias.ts
9782
- const RULE$38 = "shadcn-ui-alias";
9783
- const FIRST$18 = 1;
9775
+ const RULE$40 = "shadcn-ui-alias";
9776
+ const FIRST$13 = 1;
9784
9777
  const problemOf$8 = (directory, { file, alias }) => ({
9785
9778
  file,
9786
- line: FIRST$18,
9787
- column: FIRST$18,
9788
- rule: RULE$38,
9779
+ line: FIRST$13,
9780
+ column: FIRST$13,
9781
+ rule: RULE$40,
9789
9782
  message: `aliases.ui "${alias}" in ${directory}/components.json does not resolve to a directory through the imports of ${directory}/package.json. shadcn lint and msch then cannot tell which files are the design-system components. Point the alias at a "#/" import, such as "#/shared/ui", and map "#/*" to "./src/*".`
9790
9783
  });
9791
9784
  /** @internal */
@@ -9801,20 +9794,12 @@ const shadcnAliasProblems = Effect.fn("shadcnAliasProblems")(function* shadcnAli
9801
9794
  });
9802
9795
  // src/features/check-placement/model/source-aliases.ts
9803
9796
  const ALIAS_RULE = "source-alias";
9804
- const FIRST$17 = 1;
9805
9797
  const SOURCE_ALIAS = "#/*";
9806
9798
  const SOURCE_TARGET = "./src/*";
9807
9799
  const SOURCE_PREFIX = /^\.\/src(?:\/|$)/u;
9808
9800
  const ALIAS_MESSAGE = `points into src/ under its own name. Import source through "${SOURCE_ALIAS}": "${SOURCE_TARGET}" only, so an import names the layer and slice it uses instead of a folder alias.`;
9809
9801
  const Manifest$4 = Schema.Struct({ imports: Schema.optional(Schema.Unknown) });
9810
9802
  const decodeManifest$8 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
9811
- const problemAt$6 = (file, rule, message) => ({
9812
- file,
9813
- line: FIRST$17,
9814
- column: FIRST$17,
9815
- rule,
9816
- message
9817
- });
9818
9803
  const targetsOf = (target) => {
9819
9804
  if (Predicate.isString(target)) return [target];
9820
9805
  if (Predicate.isObject(target)) return pipe(Record.values(target), Array.flatMap(targetsOf));
@@ -9825,7 +9810,7 @@ const aliasProblems = Effect.fn("aliasProblems")(function* aliasProblems(root, w
9825
9810
  const files = yield* RepositoryFiles;
9826
9811
  const manifest = files.join(root, workspace, MANIFEST_FILE$3);
9827
9812
  const text = yield* files.readFile(manifest);
9828
- return pipe(text, Option.flatMap(decodeManifest$8), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemAt$6(manifest, ALIAS_RULE, `"${key}" ${ALIAS_MESSAGE}`)));
9813
+ return pipe(text, Option.flatMap(decodeManifest$8), Option.flatMap(({ imports }) => Option.liftPredicate(imports, Predicate.isObject)), Option.map((imports) => Record.toEntries(imports)), Option.getOrElse(() => Array.empty()), Array.filter(intoSource), Array.map(([key]) => problemInFile(ALIAS_RULE)(manifest, `"${key}" ${ALIAS_MESSAGE}`)));
9829
9814
  });
9830
9815
  /** @internal */
9831
9816
  const checkSourceAliases = Effect.fn("checkSourceAliases")(function* checkSourceAliases(root) {
@@ -9856,12 +9841,12 @@ const SCRIPTS = "scripts-directory";
9856
9841
  const BIN = "bin";
9857
9842
  const SCRIPTS_DIRECTORY = "scripts";
9858
9843
  const WORKFLOW_DIRECTORY$1 = ".github/";
9859
- const SEPARATOR$13 = "/";
9844
+ const SEPARATOR$14 = "/";
9860
9845
  const CURRENT = "./";
9861
9846
  const READ_CONCURRENCY$19 = 8;
9862
- const FIRST$16 = 1;
9847
+ const FIRST$12 = 1;
9863
9848
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
9864
- const COMMAND = /^bin\/[^/]+\.[cm]?ts$/u;
9849
+ const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
9865
9850
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
9866
9851
  const Manifest$3 = Schema.Struct({
9867
9852
  bin: Schema.optional(Schema.Unknown),
@@ -9898,11 +9883,11 @@ const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(r
9898
9883
  const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE$3));
9899
9884
  return pipe(text, Option.flatMap(decodeManifest$7), Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
9900
9885
  });
9901
- const isCommand$1 = (path) => COMMAND.test(path) && !NOT_COMMAND.test(path);
9886
+ const isCommand$1 = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
9902
9887
  const commandFilesIn = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
9903
9888
  const files = yield* RepositoryFiles;
9904
9889
  const names = yield* files.readDirectory(files.join(root, directory, BIN));
9905
- return pipe(names, Array.map((name) => `${BIN}${SEPARATOR$13}${name}`), Array.filter(isCommand$1));
9890
+ return pipe(names, Array.map((name) => `${BIN}${SEPARATOR$14}${name}`), Array.filter(isCommand$1));
9906
9891
  });
9907
9892
  const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
9908
9893
  const files = yield* RepositoryFiles;
@@ -9911,15 +9896,15 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
9911
9896
  const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$19 });
9912
9897
  return pipe(Array.getSomes(texts), Array.join("\n"));
9913
9898
  });
9914
- const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$13));
9915
- const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.filter(({ path }) => !COMMAND.test(path) && !Array.contains(entries.all, path)), Array.map(({ path, start }) => ({
9899
+ const workspacePath = (directory, path) => pipe([directory, path], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$14));
9900
+ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.filter(({ path }) => !COMMAND$1.test(path) && !Array.contains(entries.all, path)), Array.map(({ path, start }) => ({
9916
9901
  file,
9917
9902
  ...positionOf(source)(start),
9918
9903
  rule: OUTSIDE_BIN,
9919
9904
  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.`
9920
9905
  })));
9921
9906
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
9922
- const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
9907
+ const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
9923
9908
  const files = yield* RepositoryFiles;
9924
9909
  const config = yield* workspaceConfigOf(root, directory);
9925
9910
  const entries = yield* declaredEntries(root, directory);
@@ -9935,8 +9920,8 @@ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, directo
9935
9920
  const isRun = (path) => Array.contains(runPaths, path) || Array.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
9936
9921
  const unrun = pipe(commands, Array.filter((path) => !isRun(path)), Array.map((path) => ({
9937
9922
  file: files.join(root, directory, path),
9938
- line: FIRST$16,
9939
- column: FIRST$16,
9923
+ line: FIRST$12,
9924
+ column: FIRST$12,
9940
9925
  rule: UNRUN,
9941
9926
  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.`
9942
9927
  })));
@@ -9948,8 +9933,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
9948
9933
  const isDirectory = yield* files.isDirectory(file);
9949
9934
  return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
9950
9935
  file,
9951
- line: FIRST$16,
9952
- column: FIRST$16,
9936
+ line: FIRST$12,
9937
+ column: FIRST$12,
9953
9938
  rule: SCRIPTS,
9954
9939
  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.`
9955
9940
  })));
@@ -9958,47 +9943,47 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
9958
9943
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
9959
9944
  const all = ["", ...yield* workspaceDirectories(root)];
9960
9945
  const workflows = yield* workflowText(root);
9961
- const found = yield* Effect.forEach(all, (directory) => problemsIn$14(root, directory, workflows), { concurrency: READ_CONCURRENCY$19 });
9946
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$15(root, directory, workflows), { concurrency: READ_CONCURRENCY$19 });
9962
9947
  const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$19 });
9963
9948
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
9964
9949
  });
9965
9950
  // src/features/check-repository-layout/model/crates.ts
9966
- const RULE$37 = "unverified-crate";
9951
+ const RULE$39 = "unverified-crate";
9967
9952
  const VERSION_RULE = "release-version";
9968
9953
  const MANIFEST_FILE$1 = "package.json";
9969
9954
  const APP_DIRECTORIES = ["", "src-tauri"];
9970
9955
  const CARGO_FILE$1 = "Cargo.toml";
9971
9956
  const CONFIG_FILE$5 = "vite.config.ts";
9972
- const SEPARATOR$12 = "/";
9973
- const FIRST$15 = 1;
9957
+ const SEPARATOR$13 = "/";
9958
+ const FIRST$11 = 1;
9974
9959
  const READ_CONCURRENCY$18 = 8;
9975
9960
  const PackageVersion = Schema.fromJsonString(Schema.Struct({ version: Schema.String }));
9976
- const problemFor$2 = (crate, message) => ({
9961
+ const problemFor$1 = (crate, message) => ({
9977
9962
  file: crate.manifest,
9978
- line: FIRST$15,
9979
- column: FIRST$15,
9980
- rule: RULE$37,
9963
+ line: FIRST$11,
9964
+ column: FIRST$11,
9965
+ rule: RULE$39,
9981
9966
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
9982
9967
  });
9983
9968
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
9984
9969
  const files = yield* RepositoryFiles;
9985
9970
  const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
9986
- if (Option.isNone(workspace)) return Option.some(problemFor$2(crate, "is outside every workspace package"));
9971
+ if (Option.isNone(workspace)) return Option.some(problemFor$1(crate, "is outside every workspace package"));
9987
9972
  if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$5))) return Option.none();
9988
- return Option.some(problemFor$2(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$5} has no verify task`));
9973
+ return Option.some(problemFor$1(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$5} has no verify task`));
9989
9974
  });
9990
9975
  const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
9991
9976
  const files = yield* RepositoryFiles;
9992
9977
  const directory = files.relative(root, files.dirname(crate.manifest));
9993
- const workspace = pipe(directories, Array.findFirst((candidate) => pipe(APP_DIRECTORIES, Array.map((inner) => pipe([candidate, inner], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$12))), Array.contains(directory))));
9978
+ const workspace = pipe(directories, Array.findFirst((candidate) => pipe(APP_DIRECTORIES, Array.map((inner) => pipe([candidate, inner], Array.filter(String$1.isNonEmpty), Array.join(SEPARATOR$13))), Array.contains(directory))));
9994
9979
  if (Option.isNone(workspace)) return Option.none();
9995
9980
  const text = yield* files.readFile(files.join(root, workspace.value, MANIFEST_FILE$1));
9996
9981
  const version = pipe(text, Option.flatMap(Schema.decodeOption(PackageVersion)), Option.map((manifest) => manifest.version));
9997
9982
  if (Option.isNone(version) || version.value === crate.version) return Option.none();
9998
9983
  return Option.some({
9999
9984
  file: crate.manifest,
10000
- line: FIRST$15,
10001
- column: FIRST$15,
9985
+ line: FIRST$11,
9986
+ column: FIRST$11,
10002
9987
  rule: VERSION_RULE,
10003
9988
  message: `crate ${crate.name} is version ${crate.version} but ${workspace.value}/${MANIFEST_FILE$1} is ${version.value}. msch-publish releases the version in package.json, so bump both in the same PR.`
10004
9989
  });
@@ -10013,7 +9998,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
10013
9998
  return Array.getSomes(Array.flatten(found));
10014
9999
  });
10015
10000
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
10016
- const RULE$36 = "deploy-entry-pattern";
10001
+ const RULE$38 = "deploy-entry-pattern";
10017
10002
  const FALLOW_KEYS = [
10018
10003
  "entry",
10019
10004
  "entryPoints",
@@ -10068,7 +10053,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
10068
10053
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
10069
10054
  return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
10070
10055
  });
10071
- const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(request) {
10056
+ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(request) {
10072
10057
  const { root, file, kind, workspaces, entries } = request;
10073
10058
  const files = yield* RepositoryFiles;
10074
10059
  const path = files.join(root, file);
@@ -10084,7 +10069,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(request) {
10084
10069
  return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
10085
10070
  file: path,
10086
10071
  ...positionOf(text.value)(start - kind.offset),
10087
- rule: RULE$36,
10072
+ rule: RULE$38,
10088
10073
  message: `${pattern} ${MESSAGE$11}`
10089
10074
  })));
10090
10075
  });
@@ -10107,7 +10092,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10107
10092
  }];
10108
10093
  return [];
10109
10094
  }));
10110
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$13({
10095
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$14({
10111
10096
  root,
10112
10097
  file,
10113
10098
  kind,
@@ -10117,7 +10102,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10117
10102
  return Array.flatten(found);
10118
10103
  });
10119
10104
  // src/features/check-repository-layout/model/fallow-entries.ts
10120
- const RULE$35 = "listed-entry";
10105
+ const RULE$37 = "listed-entry";
10121
10106
  const ENTRY_KEYS = [
10122
10107
  "entry",
10123
10108
  "entryPoints",
@@ -10125,7 +10110,7 @@ const ENTRY_KEYS = [
10125
10110
  ];
10126
10111
  const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?|\.fallow\/plugins\/[^/]+\.jsonc?)$/u;
10127
10112
  const WILDCARD$3 = /[*?{[]/u;
10128
- const SEPARATOR$11 = "/";
10113
+ const SEPARATOR$12 = "/";
10129
10114
  const WRAP_OFFSET = 1;
10130
10115
  const READ_CONCURRENCY$16 = 8;
10131
10116
  const decodeKey = Schema.decodeUnknownOption(KeySchema);
@@ -10137,8 +10122,8 @@ const entryPatternsIn = (node) => {
10137
10122
  })));
10138
10123
  return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
10139
10124
  };
10140
- const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$11}`)(text))) || String$1.includes(SEPARATOR$11)(text) && !WILDCARD$3.test(text);
10141
- const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10125
+ const namesOneFile = (directories) => ({ text }) => pipe(directories, Array.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$12}`)(text))) || String$1.includes(SEPARATOR$12)(text) && !WILDCARD$3.test(text);
10126
+ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10142
10127
  const files = yield* RepositoryFiles;
10143
10128
  const path = files.join(root, file);
10144
10129
  const text = yield* files.readFile(path);
@@ -10147,7 +10132,7 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10147
10132
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
10148
10133
  file: path,
10149
10134
  ...positionOf(text.value)(start),
10150
- rule: RULE$35,
10135
+ rule: RULE$37,
10151
10136
  message: `${pattern} names files one by one. Let fallow find the file through what declares it: package.json bin and exports, a tool's config file, or the main of the Alchemy resource that deploys it.`
10152
10137
  })));
10153
10138
  });
@@ -10155,15 +10140,15 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10155
10140
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
10156
10141
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10157
10142
  const directories = yield* workspaceDirectories(root);
10158
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$12(root, file, directories), { concurrency: READ_CONCURRENCY$16 });
10143
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$13(root, file, directories), { concurrency: READ_CONCURRENCY$16 });
10159
10144
  return Array.flatten(found);
10160
10145
  });
10161
10146
  // src/features/check-repository-layout/model/root-workspace-paths.ts
10162
- const RULE$34 = "root-workspace-path";
10147
+ const RULE$36 = "root-workspace-path";
10163
10148
  const CONFIG_FILE$4 = "vite.config.ts";
10164
10149
  const PATH_CHARACTER = /[\w.@/-]/u;
10165
10150
  const NAME_CHARACTER = /[\w.@-]/u;
10166
- const FIRST$14 = 0;
10151
+ const FIRST$10 = 0;
10167
10152
  const NEXT$2 = 1;
10168
10153
  const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
10169
10154
  const mentions = (directory) => (text) => {
@@ -10171,14 +10156,14 @@ const mentions = (directory) => (text) => {
10171
10156
  return pipe(Array.drop(parts, NEXT$2), Array.some((after, index) => {
10172
10157
  const before = parts[index] ?? "";
10173
10158
  const previous = String$1.slice(before.length - NEXT$2)(before);
10174
- const following = String$1.slice(FIRST$14, NEXT$2)(after);
10159
+ const following = String$1.slice(FIRST$10, NEXT$2)(after);
10175
10160
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
10176
10161
  }));
10177
10162
  };
10178
- const problemsIn$11 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10163
+ const problemsIn$12 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10179
10164
  file,
10180
10165
  ...positionOf(source)(found.start),
10181
- rule: RULE$34,
10166
+ rule: RULE$36,
10182
10167
  message: `${directory} is a workspace. The root ${CONFIG_FILE$4} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$4}: msch.lint, msch.devDependencies or its verify task.`
10183
10168
  })));
10184
10169
  /** @internal */
@@ -10189,12 +10174,12 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
10189
10174
  if (Option.isNone(source)) return [];
10190
10175
  const directories = yield* workspaceDirectories(root);
10191
10176
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
10192
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$11(file, source.value, directories)));
10177
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$12(file, source.value, directories)));
10193
10178
  });
10194
10179
  // src/features/check-repository-layout/model/hidden-verify.ts
10195
- const RULE$33 = "hidden-verify";
10180
+ const RULE$35 = "hidden-verify";
10196
10181
  const CONFIG_FILE$3 = "vite.config.ts";
10197
- const FIRST$13 = 1;
10182
+ const FIRST$9 = 1;
10198
10183
  const READ_CONCURRENCY$15 = 8;
10199
10184
  const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory) {
10200
10185
  const config = yield* workspaceConfigOf(root, directory);
@@ -10204,9 +10189,9 @@ const problemIn$1 = Effect.fn("problemIn")(function* problemIn(root, directory)
10204
10189
  const verified = yield* hasVerifyTask(file);
10205
10190
  return Option.some({
10206
10191
  file,
10207
- line: FIRST$13,
10208
- column: FIRST$13,
10209
- rule: RULE$33,
10192
+ line: FIRST$9,
10193
+ column: FIRST$9,
10194
+ rule: RULE$35,
10210
10195
  message: `${directory} gets its verify task from code outside ${CONFIG_FILE$3}. The root verify reads ${CONFIG_FILE$3} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$3}.`
10211
10196
  }).pipe(Option.filter(() => verified));
10212
10197
  });
@@ -10217,7 +10202,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
10217
10202
  return Array.getSomes(found);
10218
10203
  });
10219
10204
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
10220
- const RULE$32 = "shared-uncached-task";
10205
+ const RULE$34 = "shared-uncached-task";
10221
10206
  const READ_CONCURRENCY$14 = 8;
10222
10207
  const SHARED = 2;
10223
10208
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -10260,7 +10245,7 @@ const problemsOf$3 = (definitions) => {
10260
10245
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
10261
10246
  file,
10262
10247
  ...position,
10263
- rule: RULE$32,
10248
+ rule: RULE$34,
10264
10249
  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.`
10265
10250
  })));
10266
10251
  };
@@ -10271,7 +10256,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
10271
10256
  return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
10272
10257
  });
10273
10258
  // src/features/check-repository-layout/model/unlocked-tasks.ts
10274
- const RULE$31 = "unlocked-task";
10259
+ const RULE$33 = "unlocked-task";
10275
10260
  const READ_CONCURRENCY$13 = 8;
10276
10261
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
10277
10262
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -10283,7 +10268,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
10283
10268
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
10284
10269
  file,
10285
10270
  ...positionOf(source)(task.start),
10286
- rule: RULE$31,
10271
+ rule: RULE$33,
10287
10272
  message: `The task ${keyName(task.key)} runs ${command} with inputs written by hand. It then reruns after every lockfile change, and it does not rerun when a dependency of a dependency moves. Set cache to LOCKED from @r_masseater/msch/locked-inputs.`
10288
10273
  })), Option.toArray)));
10289
10274
  /** @internal */
@@ -10335,10 +10320,10 @@ const scalarsIn = (source) => {
10335
10320
  return found;
10336
10321
  };
10337
10322
  // src/features/check-repository-layout/model/workflow-references.ts
10338
- const ROOT$1 = ".";
10323
+ const ROOT$2 = ".";
10339
10324
  const LOCAL$1 = "./";
10340
10325
  const NEGATION = "!";
10341
- const SEPARATOR$10 = "/";
10326
+ const SEPARATOR$11 = "/";
10342
10327
  const LINE$1 = "\n";
10343
10328
  const UNRESOLVED_MARKERS = [
10344
10329
  "${{",
@@ -10364,10 +10349,10 @@ const withoutLocal = (path) => {
10364
10349
  };
10365
10350
  const joinPath = (base, path) => {
10366
10351
  const relative = withoutLocal(String$1.trim(path));
10367
- if (base === ROOT$1) return relative;
10368
- return `${base}${SEPARATOR$10}${relative}`;
10352
+ if (base === ROOT$2) return relative;
10353
+ return `${base}${SEPARATOR$11}${relative}`;
10369
10354
  };
10370
- const reference = (kind, field, base = ROOT$1) => ({ text, offset }) => {
10355
+ const reference = (kind, field, base = ROOT$2) => ({ text, offset }) => {
10371
10356
  const path = String$1.trim(text);
10372
10357
  if (!isLiteralPath(path) || !isLiteralPath(base)) return [];
10373
10358
  return [{
@@ -10380,8 +10365,8 @@ const reference = (kind, field, base = ROOT$1) => ({ text, offset }) => {
10380
10365
  const isPositive = ({ text }) => !String$1.startsWith(NEGATION)(String$1.trim(text));
10381
10366
  const globsIn = (field, node) => pipe(itemsOf(node), Array.flatMap((item) => Option.toArray(stringOf(item))), Array.filter(isPositive), Array.flatMap(reference("glob", field)));
10382
10367
  const filtersOf = ([event, filters]) => pipe(FILTER_KEYS$1, Array.flatMap((key) => globsIn(`on.${event}.${key}`, childOf(key)(filters))));
10383
- const directoryOf$1 = (located, base) => pipe(located, Option.map(({ text }) => joinPath(ROOT$1, text)), Option.getOrElse(() => base));
10384
- const located = (kind, field, base = ROOT$1) => (found) => pipe(found, Option.toArray, Array.flatMap(reference(kind, field, base)));
10368
+ const directoryOf$1 = (located, base) => pipe(located, Option.map(({ text }) => joinPath(ROOT$2, text)), Option.getOrElse(() => base));
10369
+ const located = (kind, field, base = ROOT$2) => (found) => pipe(found, Option.toArray, Array.flatMap(reference(kind, field, base)));
10385
10370
  const localUses = (node) => pipe(stringOf(childOf("uses")(node)), Option.filter(({ text }) => String$1.startsWith(LOCAL$1)(text)));
10386
10371
  const scriptsIn = (field, base) => ({ text, offset }) => pipe(String$1.split(text, TOKEN_SEPARATOR), Array.filter((token) => SCRIPT.test(token)), Array.dedupe, Array.flatMap((token) => reference("script", field, base)({
10387
10372
  text: token,
@@ -10425,7 +10410,7 @@ const jobsOf = (source) => entriesOf$1(childOf("jobs")(parseDocument(source).con
10425
10410
  const workflowReferences = (source) => {
10426
10411
  const root = parseDocument(source).contents;
10427
10412
  const workflowDefault = workingDirectoryOf(root);
10428
- const base = directoryOf$1(workflowDefault, ROOT$1);
10413
+ const base = directoryOf$1(workflowDefault, ROOT$2);
10429
10414
  return [
10430
10415
  ...pipe(entriesOf$1(childOf("on")(root)), Array.flatMap(filtersOf)),
10431
10416
  ...located("directory", "defaults.run.working-directory")(workflowDefault),
@@ -10434,17 +10419,17 @@ const workflowReferences = (source) => {
10434
10419
  ];
10435
10420
  };
10436
10421
  const pathInputOf = (step) => childOf("path")(childOf("with")(step));
10437
- const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray, Array.flatMap(linesOf), Array.map(({ text }) => joinPath(ROOT$1, text)), Array.filter(isLiteralPath));
10422
+ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray, Array.flatMap(linesOf), Array.map(({ text }) => joinPath(ROOT$2, text)), Array.filter(isLiteralPath));
10438
10423
  /** @internal */
10439
10424
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
10440
10425
  // src/features/check-repository-layout/model/workflow-paths.ts
10441
- const RULE$30 = "workflow-path";
10426
+ const RULE$32 = "workflow-path";
10442
10427
  const WORKFLOW_DIRECTORY = ".github/workflows/";
10443
10428
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
10444
10429
  const READ_CONCURRENCY$12 = 8;
10445
10430
  const WILDCARD$2 = /[*?[]/u;
10446
- const SEPARATOR$9 = "/";
10447
- const FIRST$12 = 0;
10431
+ const SEPARATOR$10 = "/";
10432
+ const FIRST$8 = 0;
10448
10433
  const EXPECTED = {
10449
10434
  action: "a directory with action.yml",
10450
10435
  directory: "a directory",
@@ -10468,10 +10453,10 @@ const isDirectoryAt = Effect.fn("isDirectoryAt")(function* isDirectoryAt(root, p
10468
10453
  return Option.getOrElse(directory, () => false);
10469
10454
  });
10470
10455
  const hasAction = Effect.fn("hasAction")(function* hasAction(root, path) {
10471
- const found = yield* Effect.forEach(ACTION_DEFINITIONS, (name) => existsAt(root, `${path}${SEPARATOR$9}${name}`), { concurrency: 1 });
10456
+ const found = yield* Effect.forEach(ACTION_DEFINITIONS, (name) => existsAt(root, `${path}${SEPARATOR$10}${name}`), { concurrency: 1 });
10472
10457
  return pipe(found, Array.some(Boolean));
10473
10458
  });
10474
- const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array.drop(index), Array.join(SEPARATOR$9))}`;
10459
+ const suffixAt = (segments) => (index) => `:(glob)**/${pipe(segments, Array.drop(index), Array.join(SEPARATOR$10))}`;
10475
10460
  const RESOLVERS = {
10476
10461
  action: hasAction,
10477
10462
  directory: isDirectoryAt,
@@ -10479,13 +10464,13 @@ const RESOLVERS = {
10479
10464
  glob: matchesGlob,
10480
10465
  script: Effect.fn("findsScript")(function* findsScript(root, path) {
10481
10466
  if (yield* existsAt(root, path)) return true;
10482
- const segments = String$1.split(path, SEPARATOR$9);
10467
+ const segments = String$1.split(path, SEPARATOR$10);
10483
10468
  return yield* matchesAny(root, Array.makeBy(segments.length, suffixAt(segments)));
10484
10469
  })
10485
10470
  };
10486
10471
  const staticPrefix = (path) => {
10487
10472
  const prefix = Array.headNonEmpty(String$1.split(path, WILDCARD$2));
10488
- if (String$1.endsWith(SEPARATOR$9)(prefix)) return String$1.slice(FIRST$12, -1)(prefix);
10473
+ if (String$1.endsWith(SEPARATOR$10)(prefix)) return String$1.slice(FIRST$8, -1)(prefix);
10489
10474
  return prefix;
10490
10475
  };
10491
10476
  const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
@@ -10494,8 +10479,8 @@ const isIgnored$1 = Effect.fn("isIgnored")(function* isIgnored(root, path) {
10494
10479
  const ignored = yield* (yield* RepositoryFiles).ignoredPaths(root, [prefix]);
10495
10480
  return Array.isReadonlyArrayNonEmpty(ignored);
10496
10481
  });
10497
- const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$9}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$9}`)(path);
10498
- const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, found) {
10482
+ const overlaps = (path) => (produced) => produced === path || String$1.startsWith(`${path}${SEPARATOR$10}`)(produced) || String$1.startsWith(`${produced}${SEPARATOR$10}`)(path);
10483
+ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, found) {
10499
10484
  const prefix = staticPrefix(found.path);
10500
10485
  if (pipe(produced, Array.some(overlaps(prefix)))) return false;
10501
10486
  if (yield* RESOLVERS[found.kind](root, found.path)) return false;
@@ -10504,22 +10489,22 @@ const isMissing = Effect.fn("isMissing")(function* isMissing(root, produced, fou
10504
10489
  const problemOf$7 = (file, source) => (found) => ({
10505
10490
  file,
10506
10491
  ...positionOf(source)(found.offset),
10507
- rule: RULE$30,
10492
+ rule: RULE$32,
10508
10493
  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.`
10509
10494
  });
10510
- const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10495
+ const problemsIn$11 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10511
10496
  const files = yield* RepositoryFiles;
10512
10497
  const file = files.join(root, workflow);
10513
10498
  const source = yield* files.readFile(file);
10514
10499
  if (Option.isNone(source)) return [];
10515
10500
  const produced = producedPaths(source.value);
10516
- const missing = yield* Effect.filter(workflowReferences(source.value), (found) => isMissing(root, produced, found));
10501
+ const missing = yield* Effect.filter(workflowReferences(source.value), (found) => isMissing$1(root, produced, found));
10517
10502
  return pipe(missing, Array.map(problemOf$7(file, source.value)));
10518
10503
  });
10519
10504
  /** @internal */
10520
10505
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
10521
10506
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10522
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$10(root, workflow), { concurrency: READ_CONCURRENCY$12 });
10507
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$11(root, workflow), { concurrency: READ_CONCURRENCY$12 });
10523
10508
  return Array.flatten(found);
10524
10509
  });
10525
10510
  // src/features/check-repository-layout/model/workflow-scale.ts
@@ -10530,9 +10515,9 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
10530
10515
  const FILTER_KEYS = ["paths", "paths-ignore"];
10531
10516
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
10532
10517
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
10533
- const START$17 = 0;
10518
+ const START$18 = 0;
10534
10519
  const READ_CONCURRENCY$11 = 8;
10535
- const SEPARATOR$8 = "/";
10520
+ const SEPARATOR$9 = "/";
10536
10521
  const WORD_SEPARATORS = /[-_]/gu;
10537
10522
  const SPACE = " ";
10538
10523
  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.";
@@ -10554,14 +10539,14 @@ const pathFiltersIn = (file, source) => {
10554
10539
  }, PATH_FILTER, FILTER_MESSAGE)(offset)));
10555
10540
  };
10556
10541
  const matching = (workspaces, text) => pipe(workspaces, Array.findFirst(({ names }) => Array.isReadonlyArrayNonEmpty(names) && Option.isSome(String$1.match(patternOf$1(names))(text))), Option.map(({ directory }) => directory));
10557
- const named = (workspaces, text) => Option.orElse(matching(workspaces, text), () => matching(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
10558
- const containing = (workspaces, path) => pipe(workspaces, Array.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$8}`)(path)), Option.map(({ directory }) => directory));
10542
+ const named$1 = (workspaces, text) => Option.orElse(matching(workspaces, text), () => matching(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
10543
+ const containing = (workspaces, path) => pipe(workspaces, Array.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$9}`)(path)), Option.map(({ directory }) => directory));
10559
10544
  const namesIn = (name, source) => {
10560
10545
  const root = parseDocument(source).contents;
10561
10546
  return [
10562
10547
  {
10563
10548
  text: name,
10564
- offset: START$17
10549
+ offset: START$18
10565
10550
  },
10566
10551
  ...Option.toArray(stringOf(childOf("name")(root))),
10567
10552
  ...keysOf$1(childOf("jobs")(root))
@@ -10577,7 +10562,7 @@ const packagesIn = (workspaces, { file, name, source }) => {
10577
10562
  file,
10578
10563
  source
10579
10564
  };
10580
- const fromNames = pipe(namesIn(name, source), Array.flatMap(({ text, offset }) => reported(where, offset, `"${text}"`)(named(workspaces, text))));
10565
+ const fromNames = pipe(namesIn(name, source), Array.flatMap(({ text, offset }) => reported(where, offset, `"${text}"`)(named$1(workspaces, text))));
10581
10566
  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))));
10582
10567
  const filtered = pipe(filtersIn(source), Array.flatMap(({ text, offset }) => reported(where, offset, `--filter ${text}`)(matching(workspaces, text))));
10583
10568
  return [
@@ -10586,7 +10571,7 @@ const packagesIn = (workspaces, { file, name, source }) => {
10586
10571
  ...filtered
10587
10572
  ];
10588
10573
  };
10589
- const actionProblems = (workspaces, file, name) => pipe(named(workspaces, name), Option.map((directory) => ({
10574
+ const actionProblems = (workspaces, file, name) => pipe(named$1(workspaces, name), Option.map((directory) => ({
10590
10575
  file,
10591
10576
  line: 1,
10592
10577
  column: 1,
@@ -10631,12 +10616,12 @@ const checkWorkspaces = Effect.fn("checkWorkspaces")(function* checkWorkspaces(r
10631
10616
  return Array.flatten(found);
10632
10617
  });
10633
10618
  // src/features/check-typescript-generation/model/typescript-generation.ts
10634
- const RULE$29 = "legacy-typescript";
10619
+ const RULE$31 = "legacy-typescript";
10635
10620
  const LOCKFILE = "pnpm-lock.yaml";
10636
10621
  const COMPILER = "typescript";
10637
10622
  const CURRENT_MAJOR = 7;
10638
10623
  const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
10639
- const FIRST$11 = 1;
10624
+ const FIRST$7 = 1;
10640
10625
  const legacyOf = (id) => {
10641
10626
  const { name, version } = parse$1(id);
10642
10627
  const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
@@ -10647,8 +10632,8 @@ const legacyOf = (id) => {
10647
10632
  };
10648
10633
  const dependentsOf = (nodes) => (id) => pipe(nodes, Array.filter(({ dependencies }) => Array.contains(dependencies, id)), Array.map((node) => `\`${node.id}\``));
10649
10634
  const lineOf$2 = (source) => (id) => pipe(String$1.split(source, "\n"), Array.findFirstIndex((line) => String$1.replaceAll("'", "")(String$1.trim(line)) === `${id}:`), Option.match({
10650
- onNone: () => FIRST$11,
10651
- onSome: (index) => index + FIRST$11
10635
+ onNone: () => FIRST$7,
10636
+ onSome: (index) => index + FIRST$7
10652
10637
  }));
10653
10638
  const messageOf$2 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
10654
10639
  /** @internal */
@@ -10661,8 +10646,8 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
10661
10646
  return pipe(Option.getOrElse(nodes, () => []), Array.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array.map((legacy) => ({
10662
10647
  file,
10663
10648
  line: lineOf$2(source)(legacy.id),
10664
- column: FIRST$11,
10665
- rule: RULE$29,
10649
+ column: FIRST$7,
10650
+ rule: RULE$31,
10666
10651
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
10667
10652
  })));
10668
10653
  });
@@ -10671,7 +10656,7 @@ const RELATIVE = /^\.\.?(?:\/|$)/u;
10671
10656
  const SUBPATH_IMPORT = "#";
10672
10657
  const WILDCARD$1 = "*";
10673
10658
  const SCOPE$2 = "@";
10674
- const SEPARATOR$7 = "/";
10659
+ const SEPARATOR$8 = "/";
10675
10660
  const SOURCE_SUFFIXES = [
10676
10661
  "",
10677
10662
  ".ts",
@@ -10683,9 +10668,9 @@ const PLAIN_SEGMENTS = 1;
10683
10668
  const ImportsField = Schema.Struct({ imports: Schema.optional(Schema.Record(Schema.String, Schema.String)) });
10684
10669
  const decodeImports = Schema.decodeOption(Schema.fromJsonString(ImportsField));
10685
10670
  const packageNameOf = (specifier) => {
10686
- const segments = String$1.split(specifier, SEPARATOR$7);
10687
- if (String$1.startsWith(SCOPE$2)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS), Array.join(SEPARATOR$7));
10688
- return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$7));
10671
+ const segments = String$1.split(specifier, SEPARATOR$8);
10672
+ if (String$1.startsWith(SCOPE$2)(specifier)) return pipe(segments, Array.take(SCOPED_SEGMENTS), Array.join(SEPARATOR$8));
10673
+ return pipe(segments, Array.take(PLAIN_SEGMENTS), Array.join(SEPARATOR$8));
10689
10674
  };
10690
10675
  const literalText = (specifier) => pipe(Option.liftPredicate(specifier, isStringLiteral), Option.map((literal) => literal.text));
10691
10676
  const runtimeSpecifierOf = (statement) => {
@@ -10853,11 +10838,11 @@ const LISTED_LARGEST = 5;
10853
10838
  const SIZE_CONCURRENCY = 32;
10854
10839
  const MEGABYTE = 1e6;
10855
10840
  const MEGABYTE_DIGITS = 1;
10856
- const START$16 = 0;
10841
+ const START$17 = 0;
10857
10842
  const SINGLE_ENTRY = 1;
10858
10843
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
10859
10844
  const usageHint = (dependency, entryCount) => {
10860
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$16 && dependency.entries.length < entryCount)) return "";
10845
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$17 && dependency.entries.length < entryCount)) return "";
10861
10846
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
10862
10847
  };
10863
10848
  const listed = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -10866,7 +10851,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
10866
10851
  const { workspace, total } = overrun;
10867
10852
  const config = yield* files.readFile(workspace.configFile);
10868
10853
  const source = Option.getOrElse(config, () => "");
10869
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$16);
10854
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$17);
10870
10855
  return {
10871
10856
  file: workspace.configFile,
10872
10857
  ...positionOf(source)(index),
@@ -10883,7 +10868,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
10883
10868
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
10884
10869
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
10885
10870
  const sizes = HashMap.fromIterable(measured);
10886
- const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$16))));
10871
+ const sizeOf = (packages) => Number$1.sumAll(pipe(Array.fromIterable(packages), Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$17))));
10887
10872
  return {
10888
10873
  closures,
10889
10874
  sizeOf,
@@ -10916,11 +10901,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
10916
10901
  })];
10917
10902
  });
10918
10903
  const stackProblems = (file, source, dependencies) => {
10919
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$16);
10904
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(source), () => START$17);
10920
10905
  const rest = String$1.slice(section)(source);
10921
10906
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
10922
10907
  file,
10923
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$16)),
10908
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$17)),
10924
10909
  rule: STACK_DEPENDENCY,
10925
10910
  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.`
10926
10911
  })));
@@ -11036,11 +11021,11 @@ const isDefinition = (node) => {
11036
11021
  return isModuleConstant(node);
11037
11022
  };
11038
11023
  const isTyped = (checker) => (node) => Option.fromUndefinedOr(checker.getContextualType(node)).pipe(Option.flatMap(finiteValuesOf(checker)), Option.isSome);
11039
- const specifierOf = (statement) => {
11024
+ const specifierOf$1 = (statement) => {
11040
11025
  if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) return Option.none();
11041
11026
  return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter(isStringLiteral));
11042
11027
  };
11043
- const importedFilesOf = (checker) => (sourceFile) => pipe(sourceFile.statements, Array.map(specifierOf), Array.getSomes, Array.flatMap((specifier) => pipe(Option.fromUndefinedOr(checker.getSymbolAtLocation(specifier)), Option.flatMap((symbol) => Array.head(declarationsOf(symbol))), Option.map((declaration) => declaration.getSourceFile().fileName), Option.toArray)), Array.dedupe);
11028
+ const importedFilesOf = (checker) => (sourceFile) => pipe(sourceFile.statements, Array.map(specifierOf$1), Array.getSomes, Array.flatMap((specifier) => pipe(Option.fromUndefinedOr(checker.getSymbolAtLocation(specifier)), Option.flatMap((symbol) => Array.head(declarationsOf(symbol))), Option.map((declaration) => declaration.getSourceFile().fileName), Option.toArray)), Array.dedupe);
11044
11029
  const freeLiteralsIn = (checker) => (sourceFile, excluded) => pipe(descendantsOf(sourceFile), Array.filter((node) => isStringLiteral(node)), Array.filter((node) => NAME.test(node.text)), Array.filter(isDefinition), Array.filter((node) => !isModuleSpecifier(node)), Array.filter((node) => !isInsideAny(excluded)(node) && !isTyped(checker)(node)), Array.map((node) => node.text), Array.dedupe);
11045
11030
  const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Array.map((sourceFile) => ({
11046
11031
  file: sourceFile.fileName,
@@ -11079,7 +11064,7 @@ const ownerValuesOf = (checker) => (declaration) => {
11079
11064
  const type = checker.getTypeAtLocation(declaration.name);
11080
11065
  return finiteValuesOf(checker)(type).pipe(Option.orElse(() => objectValuesOf(checker)(type)));
11081
11066
  };
11082
- const annotationProblem = (message) => problemAt$9({
11067
+ const annotationProblem = (message) => problemAt$8({
11083
11068
  rule: "owner-annotation",
11084
11069
  message
11085
11070
  });
@@ -11216,7 +11201,7 @@ const shapeProblem = (site, matches) => {
11216
11201
  onNone: () => "Derive it from the library type, for example with Pick, instead of copying its properties.",
11217
11202
  onSome: () => "Use the library type instead of copying it."
11218
11203
  });
11219
- return problemAt$9({
11204
+ return problemAt$8({
11220
11205
  rule: "library-shape",
11221
11206
  message: `This shape copies ${shown}. ${advice}`
11222
11207
  })(site.node);
@@ -11321,7 +11306,7 @@ const derivedVerdict = (context) => (site) => {
11321
11306
  const added = pipe(site.values, Array.filter((value) => !isSubsetOf([value], held)));
11322
11307
  if (!Array.isReadonlyArrayNonEmpty(owners) || !Array.isReadonlyArrayNonEmpty(added)) return verdict([], []);
11323
11308
  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.`;
11324
- return verdict([problemAt$9({
11309
+ return verdict([problemAt$8({
11325
11310
  rule: "owner-extension",
11326
11311
  message
11327
11312
  })(site.node)], []);
@@ -11343,7 +11328,7 @@ const originalVerdict = (context) => (site) => {
11343
11328
  const owners = pipe(context.owners, Array.filter((owner) => isSubsetOf(site.values, owner.values)));
11344
11329
  if (Array.isReadonlyArrayNonEmpty(owners)) {
11345
11330
  const message = `The values ${formatValues(site.values)} are owned by ${describeOwners(owners)}. Derive this set from the owner instead of restating it.`;
11346
- return verdict([problemAt$9({
11331
+ return verdict([problemAt$8({
11347
11332
  rule: "owner-value-set",
11348
11333
  message
11349
11334
  })(site.node)], []);
@@ -11351,7 +11336,7 @@ const originalVerdict = (context) => (site) => {
11351
11336
  const candidates = libraryCandidates(context)(site);
11352
11337
  if (Array.isReadonlyArrayNonEmpty(candidates)) {
11353
11338
  const message = `The values ${formatValues(site.values)} restate a dependency type: ${listCandidates(candidates)}. Derive this set from the library type.`;
11354
- return verdict([problemAt$9({
11339
+ return verdict([problemAt$8({
11355
11340
  rule: "library-value-set",
11356
11341
  message
11357
11342
  })(site.node)], []);
@@ -11382,7 +11367,7 @@ const isValuePosition = (node) => {
11382
11367
  const { parent } = node;
11383
11368
  return VALUE_PARENT_KINDS.has(parent.kind) || pipe(VALUE_SLOTS, Array.some((isSlot) => isSlot(node, parent)));
11384
11369
  };
11385
- 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$9({
11370
+ 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$8({
11386
11371
  rule: "owned-literal",
11387
11372
  message: `${literal.getText()} is a value of ${describeOwners(owners)}. Write it through the owner's binding instead of as a literal.`
11388
11373
  })(literal)));
@@ -11576,7 +11561,7 @@ const duplicateProblems = (relative) => (sites) => {
11576
11561
  }))));
11577
11562
  };
11578
11563
  // src/features/check-value-owners/model/name-lists.ts
11579
- const RULE$28 = "hand-written-names";
11564
+ const RULE$30 = "hand-written-names";
11580
11565
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
11581
11566
  const nameListOf = (site) => {
11582
11567
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -11591,7 +11576,7 @@ const problemOf$6 = ({ list, reason }) => ({
11591
11576
  file: list.site.file,
11592
11577
  line: list.site.line,
11593
11578
  column: list.site.column,
11594
- rule: RULE$28,
11579
+ rule: RULE$30,
11595
11580
  message: `The names ${formatValues(list.names)} are listed by hand, but ${reason}`
11596
11581
  });
11597
11582
  // src/features/check-value-owners/model/declared-names.ts
@@ -11632,8 +11617,8 @@ const declaredNameProblem = ({ literals, relative }) => {
11632
11617
  const PATH_PREFIX = /^(?:!|\.\/)+/u;
11633
11618
  const GLOB = /[*?{[]/u;
11634
11619
  const EXTENSION$1 = /\.[^./]+$/u;
11635
- const SEPARATOR$6 = "/";
11636
- const ROOT = ".";
11620
+ const SEPARATOR$7 = "/";
11621
+ const ROOT$1 = ".";
11637
11622
  const namedPath = (repository, file) => (name) => {
11638
11623
  const bare = pipe(name, String$1.replace(PATH_PREFIX, ""));
11639
11624
  if (GLOB.test(bare) || String$1.isEmpty(bare)) return Option.none();
@@ -11641,14 +11626,14 @@ const namedPath = (repository, file) => (name) => {
11641
11626
  return pipe([fromFile, bare], Array.findFirst((path) => HashSet.has(repository.paths, path)));
11642
11627
  };
11643
11628
  const kindOf = (repository) => (path) => {
11644
- if (HashSet.has(repository.directories, path)) return SEPARATOR$6;
11629
+ if (HashSet.has(repository.directories, path)) return SEPARATOR$7;
11645
11630
  return pipe(path, String$1.match(EXTENSION$1), Option.flatMap(Array.head), Option.getOrElse(() => path));
11646
11631
  };
11647
11632
  const siblingsOf = (repository) => (path) => pipe(Record.get(repository.entries, repository.dirname(path)), Option.getOrElse(() => []), Array.filter((entry) => kindOf(repository)(entry) === kindOf(repository)(path)));
11648
11633
  const coversDirectory = (repository) => (group) => pipe(Array.head(group), Option.exists((first) => group.length >= Math.max(2, siblingsOf(repository)(first).length - 1)));
11649
- const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$6}${kindOf(repository)(path)}`), Record.values, Array.findFirst(coversDirectory(repository)), Option.flatMap(Array.head), Option.map(repository.dirname));
11634
+ const enumeratedDirectory = (repository) => (paths) => pipe(paths, Array.groupBy((path) => `${repository.dirname(path)}${SEPARATOR$7}${kindOf(repository)(path)}`), Record.values, Array.findFirst(coversDirectory(repository)), Option.flatMap(Array.head), Option.map(repository.dirname));
11650
11635
  const directoryLabel = (directory) => {
11651
- if (directory === ROOT) return "the repository root";
11636
+ if (directory === ROOT$1) return "the repository root";
11652
11637
  return directory;
11653
11638
  };
11654
11639
  const listedPathProblem = (repository) => (list) => {
@@ -11697,13 +11682,13 @@ const handWrittenNameProblems = ({ repository, literals }) => (sites) => {
11697
11682
  };
11698
11683
  // src/features/check-value-owners/model/repository-names.ts
11699
11684
  const MANIFEST$2 = "package.json";
11700
- const SEPARATOR$5 = "/";
11685
+ const SEPARATOR$6 = "/";
11701
11686
  const FIRST_SEGMENT = 1;
11702
11687
  const ManifestJson = Schema.fromJsonString(Schema.Struct({ name: Schema.optionalKey(Schema.String) }));
11703
11688
  const decodeManifest$5 = Schema.decodeUnknownOption(ManifestJson);
11704
11689
  const prefixesOf = (file) => {
11705
- const segments = pipe(file, String$1.split(SEPARATOR$5));
11706
- return pipe(Array.range(FIRST_SEGMENT, segments.length), Array.map((count) => pipe(Array.take(segments, count), Array.join(SEPARATOR$5))));
11690
+ const segments = pipe(file, String$1.split(SEPARATOR$6));
11691
+ return pipe(Array.range(FIRST_SEGMENT, segments.length), Array.map((count) => pipe(Array.take(segments, count), Array.join(SEPARATOR$6))));
11707
11692
  };
11708
11693
  const directoriesOf$1 = (file) => pipe(prefixesOf(file), Array.dropRight(FIRST_SEGMENT));
11709
11694
  const nameOf = (text) => pipe(text, Option.flatMap(decodeManifest$5), Option.flatMap((parsed) => Option.fromUndefinedOr(parsed.name)));
@@ -11729,7 +11714,7 @@ const scanOwners = Effect.fn("scanOwners")(function* scanOwners(workspace, confi
11729
11714
  const scans = yield* Effect.forEach(ownerConfigs, (configPath) => withProject(workspace)(configPath)((project) => Effect.sync(() => ownersIn(project))), { concurrency: 1 });
11730
11715
  return combineOwnerScans(Array.getSomes(scans));
11731
11716
  });
11732
- const scopeOf = (project, configPath) => ({
11717
+ const scopeOf$1 = (project, configPath) => ({
11733
11718
  name: Option.getOrElse(project.packageName, () => configPath),
11734
11719
  dependencies: project.workspaceDependencies
11735
11720
  });
@@ -11738,7 +11723,7 @@ const freshAnalysis = ({ workspace, owners, sourceChecks }) => (configPath) => w
11738
11723
  owners,
11739
11724
  sourceChecks
11740
11725
  })(project);
11741
- const scope = scopeOf(project, configPath);
11726
+ const scope = scopeOf$1(project, configPath);
11742
11727
  return {
11743
11728
  problems: analysis.problems,
11744
11729
  unowned: pipe(analysis.unowned, Array.map(unownedSiteOf(scope))),
@@ -11818,7 +11803,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
11818
11803
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
11819
11804
  }, Effect.scoped);
11820
11805
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
11821
- const RULE$27 = "namespace-destructuring";
11806
+ const RULE$29 = "namespace-destructuring";
11822
11807
  const LOCAL = /^[.#/]/u;
11823
11808
  const messageOf$1 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
11824
11809
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -11833,8 +11818,8 @@ const destructuredName = (declaration) => {
11833
11818
  if (declaration.name.kind !== SyntaxKind.ObjectBindingPattern) return Option.none();
11834
11819
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
11835
11820
  };
11836
- const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$9({
11837
- rule: RULE$27,
11821
+ const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$8({
11822
+ rule: RULE$29,
11838
11823
  message: messageOf$1(name)
11839
11824
  })), Option.map((report) => report(declaration)));
11840
11825
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -11842,7 +11827,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
11842
11827
  return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
11843
11828
  };
11844
11829
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
11845
- const RULE$26 = "pass-through-wrapper";
11830
+ const RULE$28 = "pass-through-wrapper";
11846
11831
  const SINGLE_STATEMENT = 1;
11847
11832
  const SINGLE_DECLARATION = 1;
11848
11833
  const THIS_PARAMETER = "this";
@@ -11938,8 +11923,8 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
11938
11923
  };
11939
11924
  const problemOf$4 = (checker) => (candidate) => {
11940
11925
  if (changesTheCall(candidate.wrapper)) return Option.none();
11941
- return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$9({
11942
- rule: RULE$26,
11926
+ return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$8({
11927
+ rule: RULE$28,
11943
11928
  message: messageOf(forward.callee.getText())
11944
11929
  })(candidate.name)));
11945
11930
  };
@@ -11971,9 +11956,8 @@ var repository = {
11971
11956
  "directory": "libs/msch"
11972
11957
  };
11973
11958
  // src/features/check-agent-settings/model/known-plugins.ts
11974
- const RULE$25 = "known-plugins";
11959
+ const RULE$27 = "known-plugins";
11975
11960
  const SETTINGS_FILE$2 = ".claude/settings.json";
11976
- const FIRST$10 = 1;
11977
11961
  const GITHUB$2 = "github";
11978
11962
  const REPOSITORY = /github\.com\/(?<repository>[\w.-]+\/[\w.-]+?)(?:\.git)?$/u;
11979
11963
  const Source$1 = Schema.Struct({
@@ -11992,13 +11976,7 @@ const repositoryOf = (url) => pipe(String$1.match(REPOSITORY)(url), Option.flatM
11992
11976
  const REPOSITORY_NAME = repositoryOf(repository.url);
11993
11977
  const MARKETPLACE = name;
11994
11978
  const PLUGINS = pipe(plugins, Array.map(({ name }) => `${name}@${MARKETPLACE}`));
11995
- const problem$1 = (file, message) => ({
11996
- file,
11997
- line: FIRST$10,
11998
- column: FIRST$10,
11999
- rule: RULE$25,
12000
- message
12001
- });
11979
+ const problem$1 = problemInFile(RULE$27);
12002
11980
  const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
12003
11981
  const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
12004
11982
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
@@ -12019,20 +11997,20 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
12019
11997
  return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
12020
11998
  });
12021
11999
  // src/features/check-agent-settings/model/missing-hooks.ts
12022
- const RULE$24 = "missing-hook";
12000
+ const RULE$26 = "missing-hook";
12023
12001
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
12024
12002
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
12025
12003
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12026
12004
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12027
12005
  const PLUGIN_ROOT = "..";
12028
12006
  const READ_CONCURRENCY$10 = 16;
12029
- const START$15 = 0;
12007
+ const START$16 = 0;
12030
12008
  const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
12031
12009
  path,
12032
- index: found.index ?? START$15
12010
+ index: found.index ?? START$16
12033
12011
  })), Option.toArray);
12034
12012
  const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
12035
- const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12013
+ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12036
12014
  const files = yield* RepositoryFiles;
12037
12015
  const text = yield* files.readFile(file);
12038
12016
  if (Option.isNone(text)) return [];
@@ -12044,7 +12022,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
12044
12022
  return pipe(missing, Array.map(({ path, index }) => ({
12045
12023
  file,
12046
12024
  ...positionOf(source)(index),
12047
- rule: RULE$24,
12025
+ rule: RULE$26,
12048
12026
  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.`
12049
12027
  })));
12050
12028
  });
@@ -12068,14 +12046,194 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
12068
12046
  }];
12069
12047
  return [];
12070
12048
  }));
12071
- const found = yield* Effect.forEach(hookFiles, problemsIn$9, { concurrency: READ_CONCURRENCY$10 });
12049
+ const found = yield* Effect.forEach(hookFiles, problemsIn$10, { concurrency: READ_CONCURRENCY$10 });
12072
12050
  return Array.flatten(found);
12073
12051
  });
12052
+ // src/features/check-documented-commands/model/task-graph.ts
12053
+ const SUCCESS = 0;
12054
+ const PackageSchema = Schema.Struct({ name: Schema.optional(Schema.String) });
12055
+ const TaskSchema = Schema.Struct({
12056
+ package: Schema.String,
12057
+ name: Schema.String
12058
+ });
12059
+ const TaskGraphSchema = Schema.Struct({
12060
+ packages: Schema.Record(Schema.String, PackageSchema),
12061
+ tasks: Schema.Record(Schema.String, TaskSchema)
12062
+ });
12063
+ const decodeGraph = Schema.decodeUnknownOption(Schema.fromJsonString(TaskGraphSchema));
12064
+ /** @internal */
12065
+ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
12066
+ const handle = yield* ChildProcess.make("vp", ["run", "--json"], {
12067
+ cwd: root,
12068
+ extendEnv: true,
12069
+ stdin: "ignore",
12070
+ stderr: "ignore"
12071
+ });
12072
+ const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
12073
+ const code = yield* handle.exitCode;
12074
+ return pipe(Option.liftPredicate(text, () => Number(code) === SUCCESS), Option.flatMap(decodeGraph));
12075
+ }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
12076
+ const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
12077
+ // src/features/check-documented-commands/model/commands.ts
12078
+ const RULE$25 = "documented-commands";
12079
+ const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
12080
+ const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
12081
+ const COMMAND = /`vp run (?<args>[^`]+)`/gu;
12082
+ const COMMAND_START = "`vp run ";
12083
+ const ARGS = "args";
12084
+ const PLACEHOLDER = /[<>*{}$]/u;
12085
+ const WHITESPACE = /\s+/u;
12086
+ const ROOT = ".";
12087
+ const SEPARATOR$5 = "/";
12088
+ const END_OF_OPTIONS = "--";
12089
+ const FLAG = "-";
12090
+ const TASK_SEPARATOR$1 = "#";
12091
+ const LOCAL_PREFIX$1 = "./";
12092
+ const FILTER_FLAGS = /* @__PURE__ */ new Set(["--filter", "-F"]);
12093
+ const FILTER_ASSIGNMENT = "--filter=";
12094
+ const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
12095
+ const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
12096
+ const ONE$1 = 1;
12097
+ const START$15 = 0;
12098
+ const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array.takeWhile((token) => token !== END_OF_OPTIONS));
12099
+ const filterOf = (tokens) => pipe(tokens, Array.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array.get(tokens, index + ONE$1)), Option.orElse(() => pipe(tokens, Array.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
12100
+ const follows = (tokens) => (index) => pipe(Array.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
12101
+ const specifierOf = (tokens) => pipe(tokens, Array.findFirstIndex((token, index) => !String$1.startsWith(FLAG)(token) && !follows(tokens)(index)), Option.flatMap((index) => Array.get(tokens, index)));
12102
+ const hasAny = (flags) => (tokens) => pipe(tokens, Array.some((token) => flags.has(token)));
12103
+ const scopeOf = (tokens) => {
12104
+ const filter = filterOf(tokens);
12105
+ if (Option.isSome(filter)) return {
12106
+ kind: "package",
12107
+ name: filter.value
12108
+ };
12109
+ if (hasAny(RECURSIVE_FLAGS)(tokens)) return { kind: "anywhere" };
12110
+ if (hasAny(ROOT_FLAGS)(tokens)) return { kind: "root" };
12111
+ return { kind: "here" };
12112
+ };
12113
+ const invocationOf = (tokens) => (specifier) => {
12114
+ const [owner, ...rest] = String$1.split(specifier, TASK_SEPARATOR$1);
12115
+ return pipe(Array.head(rest), Option.match({
12116
+ onNone: () => ({
12117
+ task: specifier,
12118
+ scope: scopeOf(tokens)
12119
+ }),
12120
+ onSome: (task) => ({
12121
+ task,
12122
+ scope: {
12123
+ kind: "package",
12124
+ name: owner
12125
+ }
12126
+ })
12127
+ }));
12128
+ };
12129
+ const parsed = (args) => {
12130
+ const tokens = optionsOf(args);
12131
+ return pipe(specifierOf(tokens), Option.filter(() => !pipe(tokens, Array.some((token) => PLACEHOLDER.test(token)))), Option.map(invocationOf(tokens)));
12132
+ };
12133
+ const ancestorsOf$1 = (file) => {
12134
+ const parts = pipe(String$1.split(file, SEPARATOR$5), Array.dropRight(ONE$1));
12135
+ return [...Array.makeBy(parts.length, (index) => pipe(parts, Array.take(parts.length - index), Array.join(SEPARATOR$5))), ROOT];
12136
+ };
12137
+ const named = (graph, name) => (directory) => directory === String$1.replace(LOCAL_PREFIX$1, "")(name) || pipe(Record.get(graph.packages, directory), Option.exists((found) => found.name === name));
12138
+ const packagesOf = (graph, file) => (scope) => {
12139
+ const directories = Record.keys(graph.packages);
12140
+ if (scope.kind === "anywhere") return directories;
12141
+ if (scope.kind === "root") return [ROOT];
12142
+ if (scope.kind === "package") return pipe(directories, Array.filter(named(graph, scope.name)));
12143
+ return pipe(ancestorsOf$1(file), Array.findFirst((directory) => Record.has(graph.packages, directory)), Option.toArray);
12144
+ };
12145
+ const hasTask = (graph, task) => (directory) => pipe(Record.values(graph.tasks), Array.some((found) => found.package === directory && found.name === task));
12146
+ const whereOf = (scope, file) => {
12147
+ if (scope.kind === "anywhere") return "any package";
12148
+ if (scope.kind === "root") return "the workspace root";
12149
+ if (scope.kind === "package") return `package ${scope.name}`;
12150
+ return `the package that holds ${file}`;
12151
+ };
12152
+ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array.some(hasTask(graph, task)));
12153
+ const problemsIn$9 = (graph, absolute, { file, text }) => pipe(Array.fromIterable(String$1.matchAll(COMMAND)(text)), Array.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
12154
+ file: absolute(file),
12155
+ ...positionOf(text)(match.index ?? START$15),
12156
+ rule: RULE$25,
12157
+ message: `${match[START$15]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
12158
+ })), Option.toArray)));
12159
+ const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$5), Array.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
12160
+ /** @internal */
12161
+ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* checkDocumentedCommands(root) {
12162
+ const files = yield* RepositoryFiles;
12163
+ const listed = yield* files.trackedFiles(root, DOCUMENTS);
12164
+ const documents = yield* Effect.forEach(pipe(listed, Array.filter(isDocument)), (file) => files.readFile(files.join(root, file)).pipe(Effect.map(Option.map((text) => ({
12165
+ file,
12166
+ text
12167
+ })))), { concurrency: "unbounded" });
12168
+ const commanded = pipe(Array.getSomes(documents), Array.filter(({ text }) => String$1.includes(COMMAND_START)(text)));
12169
+ if (!Array.isReadonlyArrayNonEmpty(commanded)) return [];
12170
+ const given = yield* GivenTaskGraph;
12171
+ const graph = yield* Option.match(given, {
12172
+ onNone: () => listedTasks(root),
12173
+ onSome: Effect.succeedSome
12174
+ });
12175
+ const absolute = (file) => files.join(root, file);
12176
+ return Option.match(graph, {
12177
+ onNone: () => [{
12178
+ file: absolute(Array.headNonEmpty(commanded).file),
12179
+ line: ONE$1,
12180
+ column: ONE$1,
12181
+ rule: RULE$25,
12182
+ message: "msch could not list the tasks with `vp run --json`"
12183
+ }],
12184
+ onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$9(found, absolute, document)))
12185
+ });
12186
+ });
12187
+ // src/features/check-legacy-web/model/legacy-web.ts
12188
+ const RULE$24 = "legacy-web";
12189
+ const FIRST_COLUMN$3 = 1;
12190
+ const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
12191
+ const Finding = Schema.Struct({
12192
+ file: Schema.String,
12193
+ line: Schema.Int,
12194
+ message: Schema.String
12195
+ });
12196
+ const Rule = Schema.Struct({
12197
+ ruleId: Schema.String,
12198
+ findings: Schema.Array(Finding)
12199
+ });
12200
+ const Guide = Schema.Struct({
12201
+ guideId: Schema.String,
12202
+ rules: Schema.Array(Rule)
12203
+ });
12204
+ const Scan = Schema.fromJsonString(Schema.Struct({ guides: Schema.Array(Guide) }));
12205
+ const scanOutput = Effect.fn("scanOutput")(function* scanOutput(root) {
12206
+ return yield* (yield* ChildProcess.make("node", [
12207
+ SCANNER,
12208
+ "legacy-scan",
12209
+ ".",
12210
+ "--json"
12211
+ ], {
12212
+ cwd: root,
12213
+ extendEnv: true,
12214
+ env: { DISABLE_TELEMETRY: "1" },
12215
+ stdin: "ignore"
12216
+ })).stdout.pipe(Stream.decodeText(), Stream.mkString);
12217
+ }, Effect.scoped);
12218
+ /** @internal */
12219
+ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root) {
12220
+ const files = yield* RepositoryFiles;
12221
+ const output = yield* scanOutput(root).pipe(Effect.orDie);
12222
+ const scan = yield* Schema.decodeEffect(Scan)(output).pipe(Effect.orDie);
12223
+ const problemOf = (guideId, ruleId) => ({ file, line, message }) => ({
12224
+ file: files.join(root, file),
12225
+ line,
12226
+ column: FIRST_COLUMN$3,
12227
+ rule: RULE$24,
12228
+ message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
12229
+ });
12230
+ return pipe(scan.guides, Array.flatMap(({ guideId, rules }) => pipe(rules, Array.flatMap(({ ruleId, findings }) => pipe(findings, Array.map(problemOf(guideId, ruleId)))))));
12231
+ });
12074
12232
  // src/shared/lib/section-check.ts
12075
12233
  const taggedError$3 = Schema.TaggedError;
12076
12234
  var SectionConfigUnreadable = class extends taggedError$3()("SectionConfigUnreadable", { file: Schema.String }) {};
12077
12235
  const CONFIG_FILE$2 = "vite.config.ts";
12078
- const FIRST$9 = 1;
12236
+ const FIRST$6 = 1;
12079
12237
  const ONE = 1;
12080
12238
  const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
12081
12239
  const countDiagnostics = (check, found) => Effect.forEach(found, (diagnostic) => Metric.update(Metric.withAttributes(diagnostics, {
@@ -12094,13 +12252,6 @@ const sectionAt = (file, pick) => Effect.gen(function* readSection() {
12094
12252
  }).pipe(Effect.option);
12095
12253
  return pipe(config, Option.map(pick));
12096
12254
  });
12097
- const failureAt = (file, rule, message) => [{
12098
- file,
12099
- line: FIRST$9,
12100
- column: FIRST$9,
12101
- rule,
12102
- message
12103
- }];
12104
12255
  const checkSection = (check) => (root) => Effect.gen(function* runSection() {
12105
12256
  const files = yield* RepositoryFiles;
12106
12257
  const configFile = files.join(root, CONFIG_FILE$2);
@@ -12119,11 +12270,11 @@ const checkSection = (check) => (root) => Effect.gen(function* runSection() {
12119
12270
  onSuccess: (found) => countDiagnostics(check.name, found)
12120
12271
  });
12121
12272
  return Result.match(linted, {
12122
- onFailure: (failure) => failureAt(configFile, check.rule, failure.message),
12273
+ onFailure: (failure) => [problemInFile(check.rule)(configFile, failure.message)],
12123
12274
  onSuccess: (found) => pipe(found, Array.filter(({ severity }) => severity === "error"), Array.map((diagnostic) => ({
12124
12275
  file: files.join(root, diagnostic.path),
12125
12276
  line: diagnostic.line,
12126
- column: diagnostic.column ?? FIRST$9,
12277
+ column: diagnostic.column ?? FIRST$6,
12127
12278
  rule: check.rule,
12128
12279
  message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
12129
12280
  })))
@@ -12144,7 +12295,6 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
12144
12295
  const EXTENSION = /\.[^./]+$/u;
12145
12296
  const SETTINGS_FILE = ".claude/settings.json";
12146
12297
  const READ_CONCURRENCY$9 = 64;
12147
- const FIRST$8 = 1;
12148
12298
  const RULE$23 = "shell-script";
12149
12299
  const MESSAGE$10 = "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.";
12150
12300
  const HookSchema = Schema.Struct({
@@ -12164,13 +12314,6 @@ const sessionStartCommands = (source) => {
12164
12314
  };
12165
12315
  const baseName = (name) => pipe(String$1.split("/")(name), Array.last, Option.getOrElse(() => name));
12166
12316
  const hasExtension = (name) => EXTENSION.test(baseName(name));
12167
- const problemFor$1 = (file) => ({
12168
- file,
12169
- line: FIRST$8,
12170
- column: FIRST$8,
12171
- rule: RULE$23,
12172
- message: MESSAGE$10
12173
- });
12174
12317
  /** @internal */
12175
12318
  const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScripts(root) {
12176
12319
  const files = yield* RepositoryFiles;
@@ -12186,7 +12329,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
12186
12329
  };
12187
12330
  const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
12188
12331
  const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$9 });
12189
- return pipe(shell, Array.map((name) => problemFor$1(files.join(root, name))));
12332
+ return pipe(shell, Array.map((name) => problemInFile(RULE$23)(files.join(root, name), MESSAGE$10)));
12190
12333
  });
12191
12334
  // src/shared/lib/workflow-files.ts
12192
12335
  const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
@@ -12366,7 +12509,7 @@ const AGENT_DOCS = [
12366
12509
  ];
12367
12510
  const READ_CONCURRENCY$7 = 16;
12368
12511
  const START$13 = 0;
12369
- const FIRST$7 = 1;
12512
+ const FIRST$5 = 1;
12370
12513
  const LINE = "\n";
12371
12514
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
12372
12515
  const decodeCommandText = Schema.decodeUnknownOption(CommandText);
@@ -12397,8 +12540,8 @@ const hookSources = (file, name) => (source) => pipe(String$1.split(source, LINE
12397
12540
  kind: "hook",
12398
12541
  file,
12399
12542
  position: {
12400
- line: index + FIRST$7,
12401
- column: FIRST$7
12543
+ line: index + FIRST$5,
12544
+ column: FIRST$5
12402
12545
  },
12403
12546
  name,
12404
12547
  text
@@ -12596,7 +12739,7 @@ const checkPublishTrigger = workflowCheck({
12596
12739
  const RULE$17 = "release-please";
12597
12740
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
12598
12741
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
12599
- const FIRST$6 = 1;
12742
+ const FIRST$4 = 1;
12600
12743
  const MESSAGE$5 = "releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch-publish` for the workspace.";
12601
12744
  const checkReleasePleaseSteps = workflowCheck({
12602
12745
  rule: RULE$17,
@@ -12611,8 +12754,8 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
12611
12754
  const names = yield* files.listedFiles(root);
12612
12755
  return pipe(names, Array.filter((name) => RELEASE_PLEASE_FILE.test(name)), Array.map((name) => ({
12613
12756
  file: files.join(root, name),
12614
- line: FIRST$6,
12615
- column: FIRST$6,
12757
+ line: FIRST$4,
12758
+ column: FIRST$4,
12616
12759
  rule: RULE$17,
12617
12760
  message: MESSAGE$5
12618
12761
  })));
@@ -12671,6 +12814,8 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
12671
12814
  checkPublishTrigger(root),
12672
12815
  checkRestrictedRules(root),
12673
12816
  checkMarkdown(root),
12817
+ checkLegacyWeb(root),
12818
+ checkDocumentedCommands(root),
12674
12819
  checkStructure(root),
12675
12820
  checkWorkflowLint(root)
12676
12821
  ], { concurrency: "unbounded" });
@@ -12843,8 +12988,6 @@ const CONFIG_FILE$1 = "vite.config.ts";
12843
12988
  const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
12844
12989
  const READ_CONCURRENCY$6 = 64;
12845
12990
  const START$11 = 0;
12846
- const FIRST_LINE$4 = 1;
12847
- const FIRST_COLUMN$3 = 1;
12848
12991
  const READERS$1 = [
12849
12992
  [/\.(?:[cm]?jsx?)$/u, "javascript"],
12850
12993
  [/\.(?:[cm]?ts)$/u, "typescript"],
@@ -12911,13 +13054,6 @@ const problemOf$2 = (file, source) => ({ index }) => ({
12911
13054
  rule: RULE$14,
12912
13055
  message: MESSAGE$2
12913
13056
  });
12914
- const unreadableProblem = (file, message) => ({
12915
- file,
12916
- line: FIRST_LINE$4,
12917
- column: FIRST_COLUMN$3,
12918
- rule: RULE$14,
12919
- message: `msch could not read the comments in this file: ${message}`
12920
- });
12921
13057
  const settingsOf = ({ msch, lint }) => ({
12922
13058
  allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
12923
13059
  onNone: () => NO_SETTINGS.allow,
@@ -12964,7 +13100,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
12964
13100
  const toProblem = problemOf$2(file, source);
12965
13101
  return Option.match(readerOf(name, source), {
12966
13102
  onNone: () => Effect.succeed(NONE),
12967
- 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)])))
13103
+ onSome: (reader) => comments(reader, source).pipe(Effect.map(Array.filter(kept)), Effect.map(Array.map(toProblem)), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed([problemInFile(RULE$14)(file, `msch could not read the comments in this file: ${message}`)])))
12968
13104
  });
12969
13105
  };
12970
13106
  const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
@@ -13219,17 +13355,10 @@ const KEYWORD = "tanstack-intent";
13219
13355
  const SKILLS = "skills";
13220
13356
  const MANIFEST_FILE = "package.json";
13221
13357
  const SKILL_FILE$1 = "SKILL.md";
13222
- const FIRST$5 = 1;
13223
13358
  const SUCCEEDED = 0;
13224
13359
  const SYNC = "Run vp exec intent maintainer sync in the repository root.";
13225
13360
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
13226
- const problemAt$2 = (file, message) => ({
13227
- file,
13228
- line: FIRST$5,
13229
- column: FIRST$5,
13230
- rule: RULE$13,
13231
- message
13232
- });
13361
+ const problemAt$2 = problemInFile(RULE$13);
13233
13362
  const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array.filter((file) => files.basename(file) === SKILL_FILE$1), Array.map((file) => files.relative(directory, files.dirname(file))));
13234
13363
  const isShipped = (listed) => (skill) => Array.contains(listed, SKILLS) || Array.contains(listed, skill);
13235
13364
  const packagingMessages = ({ keywords, files }, skills) => {
@@ -13284,7 +13413,7 @@ const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
13284
13413
  const BLANK = /\s+/u;
13285
13414
  const SEPARATOR$3 = "/";
13286
13415
  const START$9 = 0;
13287
- const FIRST$4 = 1;
13416
+ const FIRST$3 = 1;
13288
13417
  const READ_CONCURRENCY$4 = 16;
13289
13418
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
13290
13419
  const Frontmatter = Schema.Struct({
@@ -13364,8 +13493,8 @@ const problemsIn$6 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
13364
13493
  const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$4 });
13365
13494
  const licenses = pipe(inside, Array.filter((entry) => files.dirname(entry) === directory), Array.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array.map((entry) => ({
13366
13495
  file: files.join(root, entry),
13367
- line: FIRST$4,
13368
- column: FIRST$4,
13496
+ line: FIRST$3,
13497
+ column: FIRST$3,
13369
13498
  rule: RULE$12,
13370
13499
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
13371
13500
  })));
@@ -13711,7 +13840,7 @@ const checkAppliedPackages = Effect.fn("checkAppliedPackages")(function* checkAp
13711
13840
  });
13712
13841
  // src/features/find-unneeded-files/model/replaced-tools.ts
13713
13842
  const RULE$7 = "replaced-tool";
13714
- const FIRST$3 = 1;
13843
+ const FIRST$2 = 1;
13715
13844
  const TASKS = "Vite+ tasks in run.tasks of vite.config.ts, run with `vp run`";
13716
13845
  const HOOKS = "the hooks in .vite-hooks/ that `vp config` installs";
13717
13846
  const ALCHEMY = "the Alchemy stack in alchemy.run.ts";
@@ -13789,8 +13918,8 @@ const REPLACED = [
13789
13918
  ];
13790
13919
  const problemFor = ({ name, file }) => pipe(REPLACED, Array.findFirst(({ pattern }) => pattern.test(name)), Option.map(({ tool, replacement }) => ({
13791
13920
  file,
13792
- line: FIRST$3,
13793
- column: FIRST$3,
13921
+ line: FIRST$2,
13922
+ column: FIRST$2,
13794
13923
  rule: RULE$7,
13795
13924
  message: `belongs to ${tool}, which this repository replaced with ${replacement}. Move what is still needed there and delete this file.`
13796
13925
  })));
@@ -14053,7 +14182,6 @@ const RULE$3 = "plugin-marketplace";
14053
14182
  const PLUGIN_DIRECTORY = ".claude-plugin";
14054
14183
  const PLUGIN_FILE = `${PLUGIN_DIRECTORY}/plugin.json`;
14055
14184
  const MARKETPLACE_FILE = `${PLUGIN_DIRECTORY}/marketplace.json`;
14056
- const FIRST$2 = 1;
14057
14185
  const INDENT = 2;
14058
14186
  const OwnerSchema = Schema.Struct({
14059
14187
  name: Schema.String,
@@ -14103,13 +14231,7 @@ const pluginIn = Effect.fn("pluginIn")(function* pluginIn(root, project) {
14103
14231
  description: Option.getOrElse(project.description, () => "")
14104
14232
  })));
14105
14233
  });
14106
- const problem = (file, message) => ({
14107
- file,
14108
- line: FIRST$2,
14109
- column: FIRST$2,
14110
- rule: RULE$3,
14111
- message
14112
- });
14234
+ const problem = problemInFile(RULE$3);
14113
14235
  const pluginsIn = Effect.fn("pluginsIn")(function* pluginsIn(root) {
14114
14236
  const projects = yield* workspaceProjects(root);
14115
14237
  const found = yield* Effect.forEach(projects, (project) => pluginIn(root, project), { concurrency: "unbounded" });