@r_masseater/msch 0.62.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import { a as groupOf$2, n as RepositoryFiles, t as NODE_MODULES } from "./repos
6
6
  import { a as workspaceDeviations, c as tomlSourceComments, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-DitN-yYH.mjs";
7
7
  import { a as join, n as baseName, o as parent, r as isInside, t as matcher } from "./app-BwjhFdKD.mjs";
8
8
  import { a as problemAtPosition, i as problemAt$8, o as problemInFile, r as formatProblem, s as sortProblems, t as ProblemList } from "./problem-D2HKNIVq.mjs";
9
- import { n as JAPANESE, t as COMMENT_DIRECTIVES } from "./comment-directives-BD6WGsC7.mjs";
9
+ import { t as JAPANESE } from "./config-CvPuqi4L.mjs";
10
10
  import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
11
11
  import { $ as isPropertyAccessExpression, A as getNameOfDeclaration, B as isExportDeclaration, D as SyntaxKind, E as SymbolFlags, F as isBlock, G as isImportDeclaration, H as isFunctionDeclaration, I as isCallExpression, J as isModuleDeclaration, K as isInterfaceDeclaration, L as isClassDeclaration, M as isArrayLiteralExpression, N as isArrowFunction, O as getJSDocTags, P as isBinaryExpression, Q as isParenthesizedExpression, R as isElementAccessExpression, T as SignatureKind, U as isFunctionExpression, V as isExpressionStatement, W as isIdentifier, X as isNumericLiteral, Y as isNewExpression, Z as isObjectLiteralExpression, _ as referencedSymbols, a as declarationsOf, at as isSpreadElement, b as symbolAtLocation, c as importedModulesOf, ct as isTypeLiteralNode, d as isInsideAny, dt as isVariableDeclaration, et as isPropertyAssignment, f as isOutsideDeclaration, ft as isVariableDeclarationList, g as propertyNamesOf, h as packageOf$1, i as contains, it as isSourceFile, j as getTextOfJSDocComment, l as isExternalDeclaration, lt as isTypeReferenceNode, m as lineOf$3, n as childrenOf$2, nt as isSatisfiesExpression, o as declaresAType, ot as isStringLiteral, p as isTypeDeclaration, pt as isVariableStatement, q as isModuleBlock, r as columnOf, rt as isSignatureDeclaration, s as descendantsOf, st as isTypeAliasDeclaration, t as carriesTag, tt as isReturnStatement, u as isGenericDeclaration, ut as isUnionTypeNode, x as uniqueByReference, y as symbolAt, z as isEnumDeclaration } from "./syntax-C0ddqOHc.mjs";
12
12
  import { n as ProblemsFound, r as writeStdout, t as runCli } from "./runtime-A2p57njU.mjs";
@@ -361,10 +361,10 @@ const withBaselineProbe = (overrides) => ({
361
361
  [BASELINE_PROBE]: REMOVED_DEPENDENCY
362
362
  });
363
363
  // src/features/check-overrides/model/overrides.ts
364
- const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
364
+ const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
365
365
  const RESOLUTION_FILES = [
366
366
  "*package.json",
367
- WORKSPACE_FILE$6,
367
+ WORKSPACE_FILE$5,
368
368
  "pnpm-lock.yaml",
369
369
  ".npmrc",
370
370
  "patches/*"
@@ -466,7 +466,7 @@ const problemsFor$1 = Effect.fn("problemsFor")(function* problemsFor(workspace,
466
466
  const { root, overrides } = workspace;
467
467
  const baseline = yield* resolutionWith(workspace, BASELINE_PROBE, withBaselineProbe(overrides));
468
468
  const judgeAgainstBaseline = judge(baseline);
469
- const file = path.join(root, WORKSPACE_FILE$6);
469
+ const file = path.join(root, WORKSPACE_FILE$5);
470
470
  const problemOf = (located) => resolutionWith(workspace, located.key, withoutOverride(located.key)(overrides)).pipe(Effect.map((candidate) => overrideProblem({
471
471
  ...located,
472
472
  file
@@ -478,7 +478,7 @@ const problemsFor$1 = Effect.fn("problemsFor")(function* problemsFor(workspace,
478
478
  const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root) {
479
479
  const fs = yield* FileSystem.FileSystem;
480
480
  const path = yield* Path.Path;
481
- const source = yield* fs.readFileString(path.join(root, WORKSPACE_FILE$6)).pipe(Effect.option);
481
+ const source = yield* fs.readFileString(path.join(root, WORKSPACE_FILE$5)).pipe(Effect.option);
482
482
  const manifest = yield* workspaceManifest(root);
483
483
  const overrides = pipe(manifest, Option.flatMap((found) => Option.fromUndefinedOr(found.overrides)), Option.getOrElse(() => ({})));
484
484
  const keys = pipe(source, Option.map((text) => overrideKeysOf(text)(overrides)), Option.getOrElse(() => []));
@@ -523,87 +523,87 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, problemsIn) {
523
523
  // src/features/check-overrides/model/git-subpath.ts
524
524
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
525
525
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
526
- const RULE$64 = "git-subpath-dependency";
526
+ const RULE$63 = "git-subpath-dependency";
527
527
  const WHOLE_MATCH$4 = 0;
528
528
  const problemAt$7 = ({ file }, source) => (found) => ({
529
529
  file,
530
530
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
531
- rule: RULE$64,
531
+ rule: RULE$63,
532
532
  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$4])}\`.`
533
533
  });
534
- const problemsIn$23 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$7(entry, source)));
534
+ const problemsIn$22 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array.map(problemAt$7(entry, source)));
535
535
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
536
536
  /** @internal */
537
537
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
538
538
  const listed = yield* listedFiles(root);
539
- return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$23);
539
+ return yield* scanText(pipe(listed, Array.filter(isDependencyFile)), problemsIn$22);
540
540
  });
541
541
  // src/features/check-overrides/model/restricted-rules.ts
542
- const RULE$63 = "unnamed-restriction";
542
+ const RULE$62 = "unnamed-restriction";
543
543
  const WHOLE_MATCH$3 = 0;
544
544
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
545
- const problemsIn$22 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
545
+ const problemsIn$21 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(UNNAMED)(source)), Array.map((found) => ({
546
546
  file: entry.file,
547
547
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
548
- rule: RULE$63,
548
+ rule: RULE$62,
549
549
  message: `${found[WHOLE_MATCH$3]} 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.`
550
550
  })));
551
551
  /** @internal */
552
552
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
553
553
  const listed = yield* listedFiles(root);
554
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$22);
554
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$21);
555
555
  });
556
556
  // src/features/check-overrides/model/type-exemptions.ts
557
- const RULE$62 = "named-type-exemption";
557
+ const RULE$61 = "named-type-exemption";
558
558
  const WHOLE_MATCH$2 = 0;
559
559
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
560
- const problemsIn$21 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array.map((found) => ({
560
+ const problemsIn$20 = (entry, source) => pipe(Array.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array.map((found) => ({
561
561
  file: entry.file,
562
562
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
563
- rule: RULE$62,
563
+ rule: RULE$61,
564
564
  message: "exempts a type from a lint rule by its name. Such a list is written by hand for every dependency and only grows. msch-lint/readonly-parameters reads where each type is declared and exempts the types of packages and of the language by itself, so remove the entry. For another rule, add a rule to msch-lint that reads the declaration."
565
565
  })));
566
566
  /** @internal */
567
567
  const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkTypeExemptions(root) {
568
568
  const listed = yield* listedFiles(root);
569
- return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$21);
569
+ return yield* scanText(pipe(listed, Array.filter(isScannedText)), problemsIn$20);
570
570
  });
571
571
  // src/features/check-overrides/model/package-registry.ts
572
- const RULE$61 = "package-registry";
572
+ const RULE$60 = "package-registry";
573
573
  const REGISTRY = "https://npm.flatt.tech/";
574
574
  const TRAILING_SLASH = /\/$/u;
575
- const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
575
+ const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
576
576
  const NPMRC = /(?:^|\/)\.npmrc$/u;
577
577
  const WORKSPACE_REGISTRY = /^registry:/mu;
578
578
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
579
- const START$24 = 0;
579
+ const START$23 = 0;
580
580
  const REASON = `Installs go through Takumi Guard (${REGISTRY}), which blocks known-malicious packages before they are installed.`;
581
581
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
582
582
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
583
583
  const withoutSlash = String$1.replace(TRAILING_SLASH, "");
584
584
  const isGuarded = (registry) => withoutSlash(registry) === withoutSlash(REGISTRY);
585
- const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$24));
585
+ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$23));
586
586
  const workspaceProblem = (file, source, registry) => ({
587
587
  file,
588
588
  ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
589
- rule: RULE$61,
589
+ rule: RULE$60,
590
590
  message: Option.match(registry, {
591
- onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
591
+ onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$4}.`,
592
592
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
593
593
  })
594
594
  });
595
595
  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) => ({
596
596
  file: entry.file,
597
- ...positionOf(source)(found.index ?? START$24),
598
- rule: RULE$61,
599
- message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$24])}\`. Remove the line.`
597
+ ...positionOf(source)(found.index ?? START$23),
598
+ rule: RULE$60,
599
+ message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$23])}\`. Remove the line.`
600
600
  })));
601
601
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
602
602
  const files = yield* RepositoryFiles;
603
603
  const manifest = yield* workspaceManifest(root);
604
604
  if (Option.isNone(manifest) || Option.exists(registryOf(manifest.value), isGuarded)) return [];
605
605
  const registry = registryOf(manifest.value);
606
- const file = files.join(root, WORKSPACE_FILE$5);
606
+ const file = files.join(root, WORKSPACE_FILE$4);
607
607
  const read = yield* files.readFile(file);
608
608
  const source = Option.getOrElse(read, () => "");
609
609
  return [workspaceProblem(file, source, registry)];
@@ -615,7 +615,7 @@ const checkPackageRegistry = Effect.fn("checkPackageRegistry")(function* checkPa
615
615
  return [...yield* checkWorkspace(root), ...overrides];
616
616
  });
617
617
  // src/entities/package/model/specifiers.ts
618
- const START$23 = 0;
618
+ const START$22 = 0;
619
619
  const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
620
620
  const decodeFields = Schema.decodeUnknownOption(FieldsSchema);
621
621
  const decodeJson$2 = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));
@@ -636,7 +636,7 @@ const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.ra
636
636
  /** @internal */
637
637
  const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
638
638
  /** @internal */
639
- const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$23));
639
+ const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$22));
640
640
  const SECTIONS = [
641
641
  "dependencies",
642
642
  "devDependencies",
@@ -645,7 +645,7 @@ const SECTIONS = [
645
645
  /** @internal */
646
646
  const manifestSpecifiers = (source) => pipe(decodeJson$2(source), Option.map((manifest) => pipe(SECTIONS, Array.flatMap((section) => specifiedIn(manifest[section])))), Option.getOrElse(() => []));
647
647
  // src/features/check-placement/model/colocated-git-patterns.ts
648
- const RULE$60 = "colocated-git-patterns";
648
+ const RULE$59 = "colocated-git-patterns";
649
649
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
650
650
  const ROOT$3 = ".";
651
651
  const NEGATION$1 = "!";
@@ -692,7 +692,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
692
692
  const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
693
693
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array.map(toEntry), Array.getSomes);
694
694
  });
695
- const patternProblem = (entry, message) => problemAtPosition(RULE$60)(entry.file, {
695
+ const patternProblem = (entry, message) => problemAtPosition(RULE$59)(entry.file, {
696
696
  line: entry.line,
697
697
  column: FIRST$22
698
698
  }, message);
@@ -755,7 +755,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
755
755
  return Array.getSomes([...misplacedFound, ...repeatedFound]);
756
756
  });
757
757
  // src/features/check-placement/model/colocated-tests.ts
758
- const RULE$59 = "colocated-test";
758
+ const RULE$58 = "colocated-test";
759
759
  const FIRST$21 = 1;
760
760
  const READ_CONCURRENCY$31 = 64;
761
761
  const ROOT_SUBPATH = ".";
@@ -783,7 +783,7 @@ const problemFor$9 = (test, message) => ({
783
783
  file: test.file,
784
784
  line: FIRST$21,
785
785
  column: FIRST$21,
786
- rule: RULE$59,
786
+ rule: RULE$58,
787
787
  message: `${test.base} ${message}`
788
788
  });
789
789
  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);
@@ -866,7 +866,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
866
866
  // src/features/check-placement/model/agent-docs-length.ts
867
867
  const RECOMMENDED_LINES = 200;
868
868
  const FIRST$20 = 1;
869
- const RULE$58 = "agent-docs-length";
869
+ const RULE$57 = "agent-docs-length";
870
870
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
871
871
  const problemFor$8 = (file) => (lines) => {
872
872
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -874,14 +874,14 @@ const problemFor$8 = (file) => (lines) => {
874
874
  file,
875
875
  line: 201,
876
876
  column: FIRST$20,
877
- rule: RULE$58,
877
+ rule: RULE$57,
878
878
  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.`
879
879
  });
880
880
  };
881
881
  /** @internal */
882
882
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
883
883
  // src/features/check-placement/model/claude-link.ts
884
- const RULE$57 = "claude-md-link";
884
+ const RULE$56 = "claude-md-link";
885
885
  const CLAUDE = "CLAUDE.md";
886
886
  const AGENTS = "AGENTS.md";
887
887
  const FIRST$19 = 1;
@@ -900,7 +900,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
900
900
  file: path,
901
901
  line: FIRST$19,
902
902
  column: FIRST$19,
903
- rule: RULE$57,
903
+ rule: RULE$56,
904
904
  message: MESSAGE$17
905
905
  })));
906
906
  });
@@ -909,7 +909,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
909
909
  return Array.getSomes(found);
910
910
  });
911
911
  // src/features/check-placement/model/dangling-links.ts
912
- const RULE$56 = "dangling-link";
912
+ const RULE$55 = "dangling-link";
913
913
  const SEPARATOR$19 = "/";
914
914
  const FIRST$18 = 1;
915
915
  const READ_CONCURRENCY$28 = 16;
@@ -925,7 +925,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
925
925
  file,
926
926
  line: FIRST$18,
927
927
  column: FIRST$18,
928
- rule: RULE$56,
928
+ rule: RULE$55,
929
929
  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.`
930
930
  })));
931
931
  });
@@ -983,7 +983,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
983
983
  }));
984
984
  });
985
985
  // src/features/check-placement/model/deployed-readme.ts
986
- const RULE$55 = "deployed-readme";
986
+ const RULE$54 = "deployed-readme";
987
987
  const ROOT_DIRECTORY$3 = "";
988
988
  const READ_CONCURRENCY$27 = 16;
989
989
  const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
@@ -1023,14 +1023,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
1023
1023
  const readme = yield* readReadme({
1024
1024
  root,
1025
1025
  directory,
1026
- rule: RULE$55,
1026
+ rule: RULE$54,
1027
1027
  missingMessage: MISSING_MESSAGE$2
1028
1028
  });
1029
1029
  return Result.match(readme, {
1030
1030
  onFailure: Option.some,
1031
1031
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
1032
1032
  file,
1033
- rule: RULE$55,
1033
+ rule: RULE$54,
1034
1034
  message: NO_URL_MESSAGE
1035
1035
  })))
1036
1036
  });
@@ -1047,7 +1047,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
1047
1047
  return Array.getSomes(found);
1048
1048
  });
1049
1049
  // src/features/check-placement/model/nested-docs.ts
1050
- const RULE$54 = "nested-docs";
1050
+ const RULE$53 = "nested-docs";
1051
1051
  const CONFIG_FILE$7 = "vite.config.ts";
1052
1052
  const SEPARATOR$17 = "/";
1053
1053
  const READ_CONCURRENCY$26 = 64;
@@ -1060,7 +1060,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
1060
1060
  const taggedError$7 = Schema.TaggedError;
1061
1061
  var RootConfigUnreadable = class extends taggedError$7()("RootConfigUnreadable", { file: Schema.String }) {};
1062
1062
  const isNested = (name) => String$1.includes(SEPARATOR$17)(name);
1063
- const problemFor$7 = problemInFile(RULE$54);
1063
+ const problemFor$7 = problemInFile(RULE$53);
1064
1064
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
1065
1065
  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.";
1066
1066
  const MISSING_MESSAGE$1 = "has no AGENTS.md next to it. This repository sets msch.workspaceAgentsMd, so every workspace describes what it is for and the rules that apply only there in its own AGENTS.md.";
@@ -1117,7 +1117,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
1117
1117
  return [...Array.getSomes(found), ...missing];
1118
1118
  });
1119
1119
  // src/features/check-placement/model/published-readme.ts
1120
- const RULE$53 = "published-readme";
1120
+ const RULE$52 = "published-readme";
1121
1121
  const READ_CONCURRENCY$25 = 16;
1122
1122
  const MESSAGE$16 = "contains Japanese. This package is published to npm, so write its README in English.";
1123
1123
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
@@ -1125,7 +1125,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
1125
1125
  const readme = yield* readReadme({
1126
1126
  root,
1127
1127
  directory,
1128
- rule: RULE$53,
1128
+ rule: RULE$52,
1129
1129
  missingMessage: MISSING_MESSAGE
1130
1130
  });
1131
1131
  return Result.match(readme, {
@@ -1136,7 +1136,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
1136
1136
  file,
1137
1137
  line,
1138
1138
  column,
1139
- rule: RULE$53,
1139
+ rule: RULE$52,
1140
1140
  message: MESSAGE$16
1141
1141
  };
1142
1142
  }))
@@ -1149,7 +1149,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
1149
1149
  return Array.getSomes(found);
1150
1150
  });
1151
1151
  // src/features/check-placement/model/published-tests.ts
1152
- const RULE$52 = "published-tests";
1152
+ const RULE$51 = "published-tests";
1153
1153
  const MANIFEST_FILE$2 = "package.json";
1154
1154
  const FILE_START = 1;
1155
1155
  const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
@@ -1164,7 +1164,7 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
1164
1164
  file: files.join(absolute, MANIFEST_FILE$2),
1165
1165
  line: FILE_START,
1166
1166
  column: FILE_START,
1167
- rule: RULE$52,
1167
+ rule: RULE$51,
1168
1168
  message: MESSAGE$15
1169
1169
  });
1170
1170
  });
@@ -1178,7 +1178,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
1178
1178
  return Array.getSomes(found);
1179
1179
  });
1180
1180
  // src/features/check-placement/model/root-docs.ts
1181
- const RULE$51 = "root-docs";
1181
+ const RULE$50 = "root-docs";
1182
1182
  const SEPARATOR$16 = "/";
1183
1183
  const FIRST$16 = 1;
1184
1184
  const MARKDOWN$1 = /\.(?:md|mdx|markdown)$/iu;
@@ -1193,15 +1193,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
1193
1193
  file: files.join(root, name),
1194
1194
  line: FIRST$16,
1195
1195
  column: FIRST$16,
1196
- rule: RULE$51,
1196
+ rule: RULE$50,
1197
1197
  message: `${name} ${MESSAGE$14}`
1198
1198
  })));
1199
1199
  });
1200
1200
  // src/features/check-placement/model/root-readme.ts
1201
- const RULE$50 = "root-readme";
1201
+ const RULE$49 = "root-readme";
1202
1202
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
1203
1203
  const READ_CONCURRENCY$24 = 16;
1204
- const START$22 = 0;
1204
+ const START$21 = 0;
1205
1205
  const CHECK_POLICY = "@r_masseater/msch";
1206
1206
  const MARKETPLACE$1 = ".claude-plugin/marketplace.json";
1207
1207
  const RELATIVE$1 = /^\.\//u;
@@ -1238,17 +1238,17 @@ const patternFor = (plugins) => ({ directory, names }) => patternOf$1(Option.mat
1238
1238
  onNone: () => ownNames(plugins, names),
1239
1239
  onSome: () => [directory]
1240
1240
  }));
1241
- const problemsIn$20 = (file, source, plugins) => (workspace) => {
1241
+ const problemsIn$19 = (file, source, plugins) => (workspace) => {
1242
1242
  const message = messageFor(workspace.directory);
1243
1243
  const at = positionOf(source);
1244
1244
  const pattern = patternFor(plugins)(workspace);
1245
- return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => problemAtPosition(RULE$50)(file, at(found.index ?? START$22), message)));
1245
+ return pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.map((found) => problemAtPosition(RULE$49)(file, at(found.index ?? START$21), message)));
1246
1246
  };
1247
1247
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
1248
1248
  const text = yield* (yield* RepositoryFiles).readFile(file);
1249
1249
  return pipe(text, Option.match({
1250
1250
  onNone: () => [],
1251
- onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$20(file, source, plugins)))
1251
+ onSome: (source) => pipe(workspaces, Array.flatMap(problemsIn$19(file, source, plugins)))
1252
1252
  }));
1253
1253
  });
1254
1254
  /** @internal */
@@ -1279,7 +1279,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
1279
1279
  return Array.flatten(found);
1280
1280
  });
1281
1281
  // src/features/check-placement/model/docs-mirror.ts
1282
- const RULE$49 = "docs-mirror";
1282
+ const RULE$48 = "docs-mirror";
1283
1283
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
1284
1284
  const MIRROR_LIMIT = 3;
1285
1285
  const READ_CONCURRENCY$23 = 16;
@@ -1304,7 +1304,7 @@ const problemFor$5 = (file, source, mentions) => pipe(Array.head(mentions), Opti
1304
1304
  file,
1305
1305
  line,
1306
1306
  column,
1307
- rule: RULE$49,
1307
+ rule: RULE$48,
1308
1308
  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.`
1309
1309
  };
1310
1310
  }), Option.toArray);
@@ -1336,7 +1336,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
1336
1336
  return Array.flatten(found);
1337
1337
  });
1338
1338
  // src/features/check-placement/model/ignored-sources.ts
1339
- const RULE$48 = "ignored-sources";
1339
+ const RULE$47 = "ignored-sources";
1340
1340
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
1341
1341
  const FIRST$15 = 1;
1342
1342
  const MESSAGE$13 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
@@ -1348,7 +1348,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
1348
1348
  file: files.join(root, file),
1349
1349
  line: FIRST$15,
1350
1350
  column: FIRST$15,
1351
- rule: RULE$48,
1351
+ rule: RULE$47,
1352
1352
  message: MESSAGE$13
1353
1353
  })));
1354
1354
  });
@@ -10028,7 +10028,7 @@ const LAYER_ITEMS = [
10028
10028
  ];
10029
10029
  const READ_CONCURRENCY$22 = 64;
10030
10030
  const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
10031
- const NONE$2 = [];
10031
+ const NONE$1 = [];
10032
10032
  const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
10033
10033
  const LAYER_INDEX_MESSAGE = "defines code in a layer module. A layer module holds only mod declarations of its slices and use; put the code in a slice.";
10034
10034
  const ENTRY_MESSAGE = "makes an inner module of a slice public. Declare it with plain mod and re-export what other slices use with pub use from the slice module.";
@@ -10043,12 +10043,12 @@ const isRootItem = (inner) => (item) => {
10043
10043
  };
10044
10044
  const isLayerItem = (item) => Array.contains(LAYER_ITEMS, item.kind) || item.kind === "mod_item" && !item.inline;
10045
10045
  const entryProblems$1 = (file, modulePath, parsed) => {
10046
- if (!isSliceIndex(modulePath)) return NONE$2;
10046
+ if (!isSliceIndex(modulePath)) return NONE$1;
10047
10047
  return pipe(parsed.items, Array.filter((item) => item.kind === "mod_item" && item.visible), Array.map(itemProblem(file, ENTRY_RULE$1, ENTRY_MESSAGE)));
10048
10048
  };
10049
10049
  const moduleProblems = ({ source, parsed }) => entryProblems$1(source.file, modulePathOf(source.inner), parsed);
10050
10050
  const testProblems = ({ source, parsed }) => {
10051
- if (parsed.replacesAllocator) return NONE$2;
10051
+ if (parsed.replacesAllocator) return NONE$1;
10052
10052
  return [fileProblem$1({
10053
10053
  file: source.file,
10054
10054
  rule: TEST_RULE,
@@ -10061,8 +10061,8 @@ const PROBLEMS = {
10061
10061
  layer: (read) => strayItems(read, isLayerItem, LAYER_INDEX_MESSAGE),
10062
10062
  test: testProblems,
10063
10063
  module: moduleProblems,
10064
- skipped: () => NONE$2,
10065
- misplaced: () => NONE$2
10064
+ skipped: () => NONE$1,
10065
+ misplaced: () => NONE$1
10066
10066
  };
10067
10067
  const problemsOf$4 = (read) => PROBLEMS[kindOf$1(read.source.inner)](read);
10068
10068
  const misnamedSlice = ({ crate, inner }, root, join) => {
@@ -10099,20 +10099,20 @@ const rustSources = Effect.fn("rustSources")(function* rustSources(root) {
10099
10099
  const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModules(root) {
10100
10100
  const files = yield* RepositoryFiles;
10101
10101
  const sources = yield* rustSources(root);
10102
- if (!Array.isReadonlyArrayNonEmpty(sources)) return NONE$2;
10102
+ if (!Array.isReadonlyArrayNonEmpty(sources)) return NONE$1;
10103
10103
  const language = yield* loadLanguage(GRAMMAR).pipe(Effect.orDie);
10104
10104
  const parse = parsedWith(language);
10105
10105
  const read = yield* Effect.forEach(pipe(sources, Array.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$22 });
10106
10106
  return [...sliceNameProblems(root, files.join, sources), ...Array.flatMap(Array.getSomes(read), problemsOf$4)];
10107
10107
  });
10108
10108
  // src/features/check-placement/model/shadcn-ui-alias.ts
10109
- const RULE$47 = "shadcn-ui-alias";
10109
+ const RULE$46 = "shadcn-ui-alias";
10110
10110
  const FIRST$14 = 1;
10111
- const problemOf$9 = (directory, { file, alias }) => ({
10111
+ const problemOf$8 = (directory, { file, alias }) => ({
10112
10112
  file,
10113
10113
  line: FIRST$14,
10114
10114
  column: FIRST$14,
10115
- rule: RULE$47,
10115
+ rule: RULE$46,
10116
10116
  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/*".`
10117
10117
  });
10118
10118
  /** @internal */
@@ -10124,7 +10124,7 @@ const shadcnAliasProblems = Effect.fn("shadcnAliasProblems")(function* shadcnAli
10124
10124
  onNone: () => Effect.succeed(false),
10125
10125
  onSome: (target) => files.isDirectory(files.join(root, directory, target)).pipe(Effect.map(Option.getOrElse(() => false)))
10126
10126
  })) return Array.empty();
10127
- return [problemOf$9(directory, found.value)];
10127
+ return [problemOf$8(directory, found.value)];
10128
10128
  });
10129
10129
  // src/features/check-placement/model/source-aliases.ts
10130
10130
  const ALIAS_RULE = "source-alias";
@@ -10235,7 +10235,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array.fi
10235
10235
  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.`
10236
10236
  })));
10237
10237
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array.flatMap(stringsIn), Array.flatMap(runsIn));
10238
- const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
10238
+ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
10239
10239
  const files = yield* RepositoryFiles;
10240
10240
  const config = yield* workspaceConfigOf(root, directory);
10241
10241
  const entries = yield* declaredEntries(root, directory);
@@ -10274,12 +10274,12 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
10274
10274
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
10275
10275
  const all = ["", ...yield* workspaceDirectories(root)];
10276
10276
  const workflows = yield* workflowText(root);
10277
- const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$21 });
10277
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$18(root, directory, workflows), { concurrency: READ_CONCURRENCY$21 });
10278
10278
  const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$21 });
10279
10279
  return [...Array.flatten(found), ...Array.getSomes(scripts)];
10280
10280
  });
10281
10281
  // src/features/check-repository-layout/model/crates.ts
10282
- const RULE$46 = "unverified-crate";
10282
+ const RULE$45 = "unverified-crate";
10283
10283
  const VERSION_RULE = "release-version";
10284
10284
  const MANIFEST_FILE$1 = "package.json";
10285
10285
  const APP_DIRECTORIES = ["", "src-tauri"];
@@ -10293,7 +10293,7 @@ const problemFor$4 = (crate, message) => ({
10293
10293
  file: crate.manifest,
10294
10294
  line: FIRST$12,
10295
10295
  column: FIRST$12,
10296
- rule: RULE$46,
10296
+ rule: RULE$45,
10297
10297
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
10298
10298
  });
10299
10299
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -10329,7 +10329,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
10329
10329
  return Array.getSomes(Array.flatten(found));
10330
10330
  });
10331
10331
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
10332
- const RULE$45 = "deploy-entry-pattern";
10332
+ const RULE$44 = "deploy-entry-pattern";
10333
10333
  const FALLOW_KEYS = [
10334
10334
  "entry",
10335
10335
  "entryPoints",
@@ -10384,7 +10384,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
10384
10384
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
10385
10385
  return pipe(patternsIn(kind.keys)(parsed.program), Array.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
10386
10386
  });
10387
- const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
10387
+ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
10388
10388
  const { root, file, kind, workspaces, entries } = request;
10389
10389
  const files = yield* RepositoryFiles;
10390
10390
  const path = files.join(root, file);
@@ -10400,7 +10400,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
10400
10400
  return pipe(Array.getSomes(flagged), Array.map(({ text: pattern, start }) => ({
10401
10401
  file: path,
10402
10402
  ...positionOf(text.value)(start - kind.offset),
10403
- rule: RULE$45,
10403
+ rule: RULE$44,
10404
10404
  message: `${pattern} ${MESSAGE$12}`
10405
10405
  })));
10406
10406
  });
@@ -10423,7 +10423,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10423
10423
  }];
10424
10424
  return [];
10425
10425
  }));
10426
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$18({
10426
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$17({
10427
10427
  root,
10428
10428
  file,
10429
10429
  kind,
@@ -10433,7 +10433,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
10433
10433
  return Array.flatten(found);
10434
10434
  });
10435
10435
  // src/features/check-repository-layout/model/fallow-entries.ts
10436
- const RULE$44 = "listed-entry";
10436
+ const RULE$43 = "listed-entry";
10437
10437
  const ENTRY_KEYS = [
10438
10438
  "entry",
10439
10439
  "entryPoints",
@@ -10454,7 +10454,7 @@ const entryPatternsIn = (node) => {
10454
10454
  return pipe(childrenOf$1(node), Array.flatMap(entryPatternsIn));
10455
10455
  };
10456
10456
  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);
10457
- const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10457
+ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
10458
10458
  const files = yield* RepositoryFiles;
10459
10459
  const path = files.join(root, file);
10460
10460
  const text = yield* files.readFile(path);
@@ -10463,7 +10463,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10463
10463
  return pipe(entryPatternsIn(parsed.program), Array.filter(namesOneFile(directories)), Array.map(({ text: pattern, start }) => ({
10464
10464
  file: path,
10465
10465
  ...positionOf(text.value)(start),
10466
- rule: RULE$44,
10466
+ rule: RULE$43,
10467
10467
  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.`
10468
10468
  })));
10469
10469
  });
@@ -10471,11 +10471,11 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
10471
10471
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
10472
10472
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10473
10473
  const directories = yield* workspaceDirectories(root);
10474
- const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$18 });
10474
+ const found = yield* Effect.forEach(pipe(listed, Array.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$16(root, file, directories), { concurrency: READ_CONCURRENCY$18 });
10475
10475
  return Array.flatten(found);
10476
10476
  });
10477
10477
  // src/features/check-repository-layout/model/root-workspace-paths.ts
10478
- const RULE$43 = "root-workspace-path";
10478
+ const RULE$42 = "root-workspace-path";
10479
10479
  const CONFIG_FILE$5 = "vite.config.ts";
10480
10480
  const PATH_CHARACTER = /[\w.@/-]/u;
10481
10481
  const NAME_CHARACTER = /[\w.@-]/u;
@@ -10491,10 +10491,10 @@ const mentions = (directory) => (text) => {
10491
10491
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
10492
10492
  }));
10493
10493
  };
10494
- const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10494
+ const problemsIn$15 = (file, source, directories) => (found) => pipe(directories, Array.filter((directory) => mentions(directory)(found.text)), Array.map((directory) => ({
10495
10495
  file,
10496
10496
  ...positionOf(source)(found.start),
10497
- rule: RULE$43,
10497
+ rule: RULE$42,
10498
10498
  message: `${directory} is a workspace. The root ${CONFIG_FILE$5} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$5}: msch.lint, msch.devDependencies or its verify task.`
10499
10499
  })));
10500
10500
  /** @internal */
@@ -10505,10 +10505,10 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
10505
10505
  if (Option.isNone(source)) return [];
10506
10506
  const directories = yield* workspaceDirectories(root);
10507
10507
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
10508
- return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$16(file, source.value, directories)));
10508
+ return pipe(stringsIn(parsed.program), Array.flatMap(problemsIn$15(file, source.value, directories)));
10509
10509
  });
10510
10510
  // src/features/check-repository-layout/model/hidden-verify.ts
10511
- const RULE$42 = "hidden-verify";
10511
+ const RULE$41 = "hidden-verify";
10512
10512
  const CONFIG_FILE$4 = "vite.config.ts";
10513
10513
  const FIRST$10 = 1;
10514
10514
  const READ_CONCURRENCY$17 = 8;
@@ -10522,7 +10522,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
10522
10522
  file,
10523
10523
  line: FIRST$10,
10524
10524
  column: FIRST$10,
10525
- rule: RULE$42,
10525
+ rule: RULE$41,
10526
10526
  message: `${directory} gets its verify task from code outside ${CONFIG_FILE$4}. The root verify reads ${CONFIG_FILE$4} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$4}.`
10527
10527
  }).pipe(Option.filter(() => verified));
10528
10528
  });
@@ -10533,7 +10533,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
10533
10533
  return Array.getSomes(found);
10534
10534
  });
10535
10535
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
10536
- const RULE$41 = "shared-uncached-task";
10536
+ const RULE$40 = "shared-uncached-task";
10537
10537
  const READ_CONCURRENCY$16 = 8;
10538
10538
  const SHARED = 2;
10539
10539
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -10576,7 +10576,7 @@ const problemsOf$3 = (definitions) => {
10576
10576
  return pipe(definitions, Array.map(({ file, position, name, command }) => ({
10577
10577
  file,
10578
10578
  ...position,
10579
- rule: RULE$41,
10579
+ rule: RULE$40,
10580
10580
  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.`
10581
10581
  })));
10582
10582
  };
@@ -10587,7 +10587,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
10587
10587
  return pipe(Array.flatten(found), Array.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array.flatMap(problemsOf$3));
10588
10588
  });
10589
10589
  // src/features/check-repository-layout/model/unlocked-tasks.ts
10590
- const RULE$40 = "unlocked-task";
10590
+ const RULE$39 = "unlocked-task";
10591
10591
  const READ_CONCURRENCY$15 = 8;
10592
10592
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
10593
10593
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -10599,7 +10599,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
10599
10599
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array.filter(tracksLockfiles), Array.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
10600
10600
  file,
10601
10601
  ...positionOf(source)(task.start),
10602
- rule: RULE$40,
10602
+ rule: RULE$39,
10603
10603
  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.`
10604
10604
  })), Option.toArray)));
10605
10605
  /** @internal */
@@ -10754,7 +10754,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
10754
10754
  /** @internal */
10755
10755
  const producedPaths = (source) => pipe(jobsOf(source), Array.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array.flatMap(outputPathsOf));
10756
10756
  // src/features/check-repository-layout/model/workflow-paths.ts
10757
- const RULE$39 = "workflow-path";
10757
+ const RULE$38 = "workflow-path";
10758
10758
  const WORKFLOW_DIRECTORY = ".github/workflows/";
10759
10759
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
10760
10760
  const READ_CONCURRENCY$14 = 8;
@@ -10817,25 +10817,25 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
10817
10817
  if (yield* RESOLVERS[found.kind](root, found.path)) return false;
10818
10818
  return !(yield* isIgnored(root, found.path));
10819
10819
  });
10820
- const problemOf$8 = (file, source) => (found) => ({
10820
+ const problemOf$7 = (file, source) => (found) => ({
10821
10821
  file,
10822
10822
  ...positionOf(source)(found.offset),
10823
- rule: RULE$39,
10823
+ rule: RULE$38,
10824
10824
  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.`
10825
10825
  });
10826
- const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10826
+ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
10827
10827
  const files = yield* RepositoryFiles;
10828
10828
  const file = files.join(root, workflow);
10829
10829
  const source = yield* files.readFile(file);
10830
10830
  if (Option.isNone(source)) return [];
10831
10831
  const produced = producedPaths(source.value);
10832
10832
  const missing = yield* Effect.filter(workflowReferences(source.value), (found) => isMissing$1(root, produced, found));
10833
- return pipe(missing, Array.map(problemOf$8(file, source.value)));
10833
+ return pipe(missing, Array.map(problemOf$7(file, source.value)));
10834
10834
  });
10835
10835
  /** @internal */
10836
10836
  const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
10837
10837
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
10838
- const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$15(root, workflow), { concurrency: READ_CONCURRENCY$14 });
10838
+ const found = yield* Effect.forEach(pipe(listed, Array.filter(isWorkflow)), (workflow) => problemsIn$14(root, workflow), { concurrency: READ_CONCURRENCY$14 });
10839
10839
  return Array.flatten(found);
10840
10840
  });
10841
10841
  // src/features/check-repository-layout/model/workflow-scale.ts
@@ -10846,7 +10846,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
10846
10846
  const FILTER_KEYS = ["paths", "paths-ignore"];
10847
10847
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
10848
10848
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
10849
- const START$21 = 0;
10849
+ const START$20 = 0;
10850
10850
  const READ_CONCURRENCY$13 = 8;
10851
10851
  const SEPARATOR$8 = "/";
10852
10852
  const WORD_SEPARATORS = /[-_]/gu;
@@ -10877,7 +10877,7 @@ const namesIn$1 = (name, source) => {
10877
10877
  return [
10878
10878
  {
10879
10879
  text: name,
10880
- offset: START$21
10880
+ offset: START$20
10881
10881
  },
10882
10882
  ...Option.toArray(stringOf(childOf("name")(root))),
10883
10883
  ...keysOf$1(childOf("jobs")(root))
@@ -11134,11 +11134,11 @@ const LISTED_LARGEST = 5;
11134
11134
  const SIZE_CONCURRENCY = 32;
11135
11135
  const MEGABYTE = 1e6;
11136
11136
  const MEGABYTE_DIGITS = 1;
11137
- const START$20 = 0;
11137
+ const START$19 = 0;
11138
11138
  const SINGLE_ENTRY = 1;
11139
11139
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
11140
11140
  const usageHint = (dependency, entryCount) => {
11141
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$20 && dependency.entries.length < entryCount)) return "";
11141
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$19 && dependency.entries.length < entryCount)) return "";
11142
11142
  return ` (imported only from ${Array.join(dependency.entries, ", ")})`;
11143
11143
  };
11144
11144
  const listed$1 = ({ largest, entryCount }) => pipe(largest, Array.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array.join(", "));
@@ -11147,7 +11147,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
11147
11147
  const { workspace, total } = overrun;
11148
11148
  const config = yield* files.readFile(workspace.configFile);
11149
11149
  const source = Option.getOrElse(config, () => "");
11150
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$20);
11150
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$19);
11151
11151
  return {
11152
11152
  file: workspace.configFile,
11153
11153
  ...positionOf(source)(index),
@@ -11164,7 +11164,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
11164
11164
  const everything = pipe(closures, Array.flatMap(([, packages]) => Array.fromIterable(packages)), HashSet.fromIterable);
11165
11165
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
11166
11166
  const sizes = HashMap.fromIterable(measured);
11167
- const sizeOf = (packages) => packages.pipe(Array.fromIterable, Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$20)), Number$1.sumAll);
11167
+ const sizeOf = (packages) => packages.pipe(Array.fromIterable, Array.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$19)), Number$1.sumAll);
11168
11168
  return {
11169
11169
  closures,
11170
11170
  sizeOf,
@@ -11197,11 +11197,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
11197
11197
  })];
11198
11198
  });
11199
11199
  const stackProblems = (file, source, dependencies) => {
11200
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$20);
11200
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$19);
11201
11201
  const rest = String$1.slice(section)(source);
11202
11202
  return pipe(Record.toEntries(dependencies), Array.filter(([, specifier]) => specifier === STACK_CATALOG), Array.map(([name]) => ({
11203
11203
  file,
11204
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$20)),
11204
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$19)),
11205
11205
  rule: STACK_DEPENDENCY,
11206
11206
  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.`
11207
11207
  })));
@@ -11371,19 +11371,19 @@ const declaredBy$1 = ({ declared, locator }) => {
11371
11371
  };
11372
11372
  };
11373
11373
  // src/features/check-tree-shaking/model/optional-peers.ts
11374
- const RULE$38 = "optional-peer";
11375
- const START$19 = 0;
11374
+ const RULE$37 = "optional-peer";
11375
+ const START$18 = 0;
11376
11376
  const SINGLE = 1;
11377
11377
  const DEPENDENCIES_KEY = "\"dependencies\"";
11378
11378
  const importsPackage = (name) => ({ packages }) => Array.contains(packages, name);
11379
11379
  const labelsOf = (importers) => pipe(importers, Array.map(({ entry }) => `\`${entry.label}\``), Array.dedupe, Array.join(", "));
11380
11380
  const problemFor$3 = (located, name, importers) => {
11381
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(located.source), () => START$19);
11381
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY)(located.source), () => START$18);
11382
11382
  const rest = String$1.slice(section)(located.source);
11383
11383
  return {
11384
11384
  file: located.file,
11385
- ...positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$19)),
11386
- rule: RULE$38,
11385
+ ...positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$18)),
11386
+ rule: RULE$37,
11387
11387
  message: `${name} is imported only from ${labelsOf(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
11388
11388
  };
11389
11389
  };
@@ -11394,14 +11394,14 @@ const optionalPeerProblems = ({ located, dependencies, used }) => {
11394
11394
  return pipe(dependencies, Array.flatMap((name) => {
11395
11395
  const importers = pipe(libraries, Array.filter(importsPackage(name)));
11396
11396
  const neededByBin = pipe(bins, Array.some(importsPackage(name)));
11397
- if (!(importers.length > START$19 && importers.length < libraries.length) || neededByBin) return [];
11397
+ if (!(importers.length > START$18 && importers.length < libraries.length) || neededByBin) return [];
11398
11398
  return [problemFor$3(located, name, importers)];
11399
11399
  }));
11400
11400
  };
11401
11401
  // src/features/check-tree-shaking/model/side-effects.ts
11402
- const RULE$37 = "side-effects";
11402
+ const RULE$36 = "side-effects";
11403
11403
  const BUNDLE_CONCURRENCY$2 = 4;
11404
- const START$18 = 0;
11404
+ const START$17 = 0;
11405
11405
  const FIRST$8 = 1;
11406
11406
  const LISTED_PACKAGES = 4;
11407
11407
  const SIDE_EFFECTS_KEY = "\"sideEffects\"";
@@ -11425,7 +11425,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
11425
11425
  label: entry.label,
11426
11426
  member,
11427
11427
  ...extra
11428
- }, ({ modules }) => modules > START$18);
11428
+ }, ({ modules }) => modules > START$17);
11429
11429
  });
11430
11430
  const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
11431
11431
  const names = yield* exportNamesOf(subject.scope, subject.entry.source);
@@ -11447,15 +11447,15 @@ const othersOf = (total) => {
11447
11447
  };
11448
11448
  const messageOf$4 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
11449
11449
  const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
11450
- const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$18));
11450
+ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$17));
11451
11451
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array.sortBy(largest), Array.head, Option.map((worst) => ({
11452
11452
  file,
11453
11453
  ...positionOf(source)(keyIndex$1(source)),
11454
- rule: RULE$37,
11454
+ rule: RULE$36,
11455
11455
  message: messageOf$4(worst, excesses.length)
11456
11456
  })), Option.toArray);
11457
11457
  // src/features/check-tree-shaking/model/top-level-effects.ts
11458
- const RULE$36 = "top-level-effect";
11458
+ const RULE$35 = "top-level-effect";
11459
11459
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
11460
11460
  const READ_CONCURRENCY$12 = 16;
11461
11461
  const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
@@ -11468,10 +11468,10 @@ const messageOf$3 = (statement) => {
11468
11468
  if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
11469
11469
  return STATEMENT_MESSAGE;
11470
11470
  };
11471
- const problemsIn$14 = (api) => (file) => (source) => {
11471
+ const problemsIn$13 = (api) => (file) => (source) => {
11472
11472
  const retained = api.createSourceFile(file, source);
11473
11473
  const problems = pipe(retained.sourceFile.statements, Array.fromIterable, Array.filter(isEffect), Array.map((statement) => problemAt$8({
11474
- rule: RULE$36,
11474
+ rule: RULE$35,
11475
11475
  message: messageOf$3(statement)
11476
11476
  })(statement)));
11477
11477
  retained.dispose();
@@ -11484,7 +11484,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
11484
11484
  const names = yield* files.ownedFiles(root);
11485
11485
  const owned = new Set(pipe(names, Array.map((name) => files.join(root, name))));
11486
11486
  const sources = pipe(modules, Array.filter((file) => owned.has(file) && CODE$1.test(file)));
11487
- const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$12 });
11487
+ const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$13(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$12 });
11488
11488
  return Array.flatten(found);
11489
11489
  }, Effect.scoped);
11490
11490
  // src/features/check-tree-shaking/model/usage.ts
@@ -11595,7 +11595,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
11595
11595
  return Array.flatten(found);
11596
11596
  });
11597
11597
  // src/features/check-typescript-generation/model/typescript-generation.ts
11598
- const RULE$35 = "legacy-typescript";
11598
+ const RULE$34 = "legacy-typescript";
11599
11599
  const LOCKFILE = "pnpm-lock.yaml";
11600
11600
  const COMPILER = "typescript";
11601
11601
  const CURRENT_MAJOR = 7;
@@ -11626,12 +11626,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
11626
11626
  file,
11627
11627
  line: lineOf$2(source)(legacy.id),
11628
11628
  column: FIRST$7,
11629
- rule: RULE$35,
11629
+ rule: RULE$34,
11630
11630
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
11631
11631
  })));
11632
11632
  });
11633
11633
  // src/features/check-worker-bundles/model/worker-bundles.ts
11634
- const RULE$34 = "worker-bundle";
11634
+ const RULE$33 = "worker-bundle";
11635
11635
  const BUNDLE_CONCURRENCY = 4;
11636
11636
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
11637
11637
  const CONDITIONS = [
@@ -11642,8 +11642,8 @@ const CONDITIONS = [
11642
11642
  "module",
11643
11643
  "default"
11644
11644
  ];
11645
- const problemFor$2 = problemInFile(RULE$34);
11646
- const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
11645
+ const problemFor$2 = problemInFile(RULE$33);
11646
+ const problemOf$6 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
11647
11647
  const bundleProblem = (file) => Effect.gen(function* bundle() {
11648
11648
  const built = yield* Effect.tryPromise({
11649
11649
  try: () => rolldown({
@@ -11662,7 +11662,7 @@ const bundleProblem = (file) => Effect.gen(function* bundle() {
11662
11662
  yield* Effect.promise(() => built.close());
11663
11663
  }).pipe(Effect.match({
11664
11664
  onSuccess: () => Option.none(),
11665
- onFailure: (detail) => Option.some(problemOf$7(file, detail))
11665
+ onFailure: (detail) => Option.some(problemOf$6(file, detail))
11666
11666
  }));
11667
11667
  /** @internal */
11668
11668
  const checkWorkerBundles = Effect.fn("checkWorkerBundles")(function* checkWorkerBundles(root) {
@@ -11764,7 +11764,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
11764
11764
  imports: importedFilesOf(checker)(sourceFile)
11765
11765
  })), Array.filter((facts) => Array.isReadonlyArrayNonEmpty(facts.values) || Array.isReadonlyArrayNonEmpty(facts.imports)));
11766
11766
  // src/features/check-value-owners/model/name-lists.ts
11767
- const RULE$33 = "hand-written-names";
11767
+ const RULE$32 = "hand-written-names";
11768
11768
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
11769
11769
  const nameListOf = (site) => {
11770
11770
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -11779,10 +11779,10 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
11779
11779
  file,
11780
11780
  line,
11781
11781
  column,
11782
- rule: RULE$33,
11782
+ rule: RULE$32,
11783
11783
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
11784
11784
  });
11785
- const problemOf$6 = ({ list, reason }) => listedProblem({
11785
+ const problemOf$5 = ({ list, reason }) => listedProblem({
11786
11786
  file: list.site.file,
11787
11787
  line: list.site.line,
11788
11788
  column: list.site.column,
@@ -12384,7 +12384,7 @@ const declaredNameProblem = ({ literals, relative }) => {
12384
12384
  if (defined.length < mostNamesOf(list) || files.length < 2) return Option.none();
12385
12385
  const names = pipe(defined, Array.map(([name]) => name));
12386
12386
  const shown = pipe(files, Array.take(SHOWN_FILES), Array.map(relative), Array.join(", "));
12387
- return Option.some(problemOf$6({
12387
+ return Option.some(problemOf$5({
12388
12388
  list,
12389
12389
  reason: `${formatValues(names)} are each written in another module (${shown}). Type those values with this list, or build this list from them, so that adding one does not mean editing two places.`
12390
12390
  }));
@@ -12417,11 +12417,11 @@ const listedPathProblem = (repository) => (list) => {
12417
12417
  const paths = pipe(list.names, Array.map(namedPath(repository, list.site.file)), Array.getSomes);
12418
12418
  const packages = pipe(list.names, Array.filter((name) => HashSet.has(repository.packages, name)));
12419
12419
  const directory = enumeratedDirectory(repository)(paths);
12420
- if (Option.isSome(directory)) return Option.some(problemOf$6({
12420
+ if (Option.isSome(directory)) return Option.some(problemOf$5({
12421
12421
  list,
12422
12422
  reason: `they enumerate the entries of ${directoryLabel(directory.value)}. Find them with a glob or derive them from the declaration that names them.`
12423
12423
  }));
12424
- if (packages.length >= 2) return Option.some(problemOf$6({
12424
+ if (packages.length >= 2) return Option.some(problemOf$5({
12425
12425
  list,
12426
12426
  reason: `${formatValues(packages)} are workspace packages. Derive them from the workspace manifests or from a property that each package declares.`
12427
12427
  }));
@@ -12436,7 +12436,7 @@ const connected = (index) => (left, right) => left === right || imports(index)(l
12436
12436
  const isPartOf = (index, list) => (other) => other !== list && canImport(list.site.scope, other.site.scope) && connected(index)(list.site.file, other.site.file) && isSubsetOf(list.names, other.names) && list.names.length * SUBSET_SHARE >= other.names.length && !sameValues(list.names, other.names);
12437
12437
  const subsetListProblem = ({ lists, literals, relative }) => {
12438
12438
  const index = importIndexOf(literals);
12439
- return (list) => pipe(lists, Array.findFirst(isPartOf(index, list)), Option.map((other) => problemOf$6({
12439
+ return (list) => pipe(lists, Array.findFirst(isPartOf(index, list)), Option.map((other) => problemOf$5({
12440
12440
  list,
12441
12441
  reason: `they are a part of ${formatValues(other.names)} at ${relative(other.site.file)}:${String(other.site.line)}. Name that list once and select from it with Extract or Exclude.`
12442
12442
  })));
@@ -12580,7 +12580,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
12580
12580
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
12581
12581
  }, Effect.scoped);
12582
12582
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
12583
- const RULE$32 = "namespace-destructuring";
12583
+ const RULE$31 = "namespace-destructuring";
12584
12584
  const LOCAL = /^[.#/]/u;
12585
12585
  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.`;
12586
12586
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -12595,16 +12595,16 @@ const destructuredName = (declaration) => {
12595
12595
  if (declaration.name.kind !== SyntaxKind.ObjectBindingPattern) return Option.none();
12596
12596
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
12597
12597
  };
12598
- const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$8({
12599
- rule: RULE$32,
12598
+ const problemOf$4 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$8({
12599
+ rule: RULE$31,
12600
12600
  message: messageOf$1(name)
12601
12601
  })), Option.map((report) => report(declaration)));
12602
12602
  const namespaceDestructuringIn = () => (sourceFile) => {
12603
12603
  const names = importedNames(sourceFile);
12604
- return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$5(names)), Array.getSomes);
12604
+ return pipe(descendantsOf(sourceFile), Array.filter(isVariableDeclaration), Array.map(problemOf$4(names)), Array.getSomes);
12605
12605
  };
12606
12606
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
12607
- const RULE$31 = "pass-through-wrapper";
12607
+ const RULE$30 = "pass-through-wrapper";
12608
12608
  const SINGLE_STATEMENT = 1;
12609
12609
  const SINGLE_DECLARATION = 1;
12610
12610
  const THIS_PARAMETER = "this";
@@ -12698,14 +12698,14 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
12698
12698
  const restForwarded = pipe(wrapper.parameters, Array.some(isRest));
12699
12699
  return Option.exists(forwardedNames(wrapper, forward), (names) => callsAnotherFunction(candidate, forward, names)) && (restForwarded || calleeTakesExactly(checker)(forward, wrapper.parameters.length)) && keepsTheReturnType(checker)(wrapper, forward) && !isOverloaded(checker)(name);
12700
12700
  };
12701
- const problemOf$4 = (checker) => (candidate) => {
12701
+ const problemOf$3 = (checker) => (candidate) => {
12702
12702
  if (changesTheCall(candidate.wrapper)) return Option.none();
12703
12703
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$8({
12704
- rule: RULE$31,
12704
+ rule: RULE$30,
12705
12705
  message: messageOf(forward.callee.getText())
12706
12706
  })(candidate.name)));
12707
12707
  };
12708
- const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array.map(candidateOf), Array.getSomes, Array.map(problemOf$4(checker)), Array.getSomes);
12708
+ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array.map(candidateOf), Array.getSomes, Array.map(problemOf$3(checker)), Array.getSomes);
12709
12709
  // src/app/source-checks.ts
12710
12710
  /** @internal */
12711
12711
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
@@ -12727,7 +12727,7 @@ var plugins = [{
12727
12727
  "description": "CLI for watashi (watashi.masseater.dev). Sends Claude Code transcripts from a Stop hook after masking secrets locally with h56m, and manages login and API tokens."
12728
12728
  }];
12729
12729
  // src/features/check-agent-settings/model/known-plugins.ts
12730
- const RULE$30 = "known-plugins";
12730
+ const RULE$29 = "known-plugins";
12731
12731
  const SETTINGS_FILE$2 = ".claude/settings.json";
12732
12732
  const GITHUB$2 = "github";
12733
12733
  const Source$1 = Schema.Struct({
@@ -12745,7 +12745,7 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
12745
12745
  const REPOSITORY_NAME = "masseater/masseater.dev";
12746
12746
  const MARKETPLACE = name;
12747
12747
  const PLUGINS = pipe(plugins, Array.map(({ name }) => `${name}@${MARKETPLACE}`));
12748
- const problem$1 = problemInFile(RULE$30);
12748
+ const problem$1 = problemInFile(RULE$29);
12749
12749
  const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
12750
12750
  const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
12751
12751
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
@@ -12766,20 +12766,20 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
12766
12766
  return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
12767
12767
  });
12768
12768
  // src/features/check-agent-settings/model/missing-hooks.ts
12769
- const RULE$29 = "missing-hook";
12769
+ const RULE$28 = "missing-hook";
12770
12770
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
12771
12771
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
12772
12772
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12773
12773
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
12774
12774
  const PLUGIN_ROOT = "..";
12775
12775
  const READ_CONCURRENCY$11 = 16;
12776
- const START$17 = 0;
12776
+ const START$16 = 0;
12777
12777
  const referenceOf$1 = (found) => pipe(groupOf$2("path")(found), Option.filter(() => Option.isNone(groupOf$2("optional")(found))), Option.map((path) => ({
12778
12778
  path,
12779
- index: found.index ?? START$17
12779
+ index: found.index ?? START$16
12780
12780
  })), Option.toArray);
12781
12781
  const referencesIn$1 = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap(referenceOf$1));
12782
- const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12782
+ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
12783
12783
  const files = yield* RepositoryFiles;
12784
12784
  const text = yield* files.readFile(file);
12785
12785
  if (Option.isNone(text)) return [];
@@ -12791,7 +12791,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
12791
12791
  return pipe(missing, Array.map(({ path, index }) => ({
12792
12792
  file,
12793
12793
  ...positionOf(source)(index),
12794
- rule: RULE$29,
12794
+ rule: RULE$28,
12795
12795
  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.`
12796
12796
  })));
12797
12797
  });
@@ -12815,7 +12815,7 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
12815
12815
  }];
12816
12816
  return [];
12817
12817
  }));
12818
- const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$11 });
12818
+ const found = yield* Effect.forEach(hookFiles, problemsIn$12, { concurrency: READ_CONCURRENCY$11 });
12819
12819
  return Array.flatten(found);
12820
12820
  });
12821
12821
  // src/features/check-documented-commands/model/task-graph.ts
@@ -12844,7 +12844,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
12844
12844
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
12845
12845
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
12846
12846
  // src/features/check-documented-commands/model/commands.ts
12847
- const RULE$28 = "documented-commands";
12847
+ const RULE$27 = "documented-commands";
12848
12848
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
12849
12849
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
12850
12850
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -12863,7 +12863,7 @@ const FILTER_ASSIGNMENT = "--filter=";
12863
12863
  const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
12864
12864
  const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
12865
12865
  const ONE$1 = 1;
12866
- const START$16 = 0;
12866
+ const START$15 = 0;
12867
12867
  const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE), Array.takeWhile((token) => token !== END_OF_OPTIONS));
12868
12868
  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)))));
12869
12869
  const follows = (tokens) => (index) => pipe(Array.get(tokens, index - ONE$1), Option.exists((previous) => FILTER_FLAGS.has(previous)));
@@ -12919,11 +12919,11 @@ const whereOf = (scope, file) => {
12919
12919
  return `the package that holds ${file}`;
12920
12920
  };
12921
12921
  const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array.some(hasTask(graph, task)));
12922
- const problemsIn$12 = (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 }) => ({
12922
+ const problemsIn$11 = (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 }) => ({
12923
12923
  file: absolute(file),
12924
- ...positionOf(text)(match.index ?? START$16),
12925
- rule: RULE$28,
12926
- message: `${match[START$16]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
12924
+ ...positionOf(text)(match.index ?? START$15),
12925
+ rule: RULE$27,
12926
+ message: `${match[START$15]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
12927
12927
  })), Option.toArray)));
12928
12928
  const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$4), Array.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
12929
12929
  /** @internal */
@@ -12947,14 +12947,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
12947
12947
  file: absolute(Array.headNonEmpty(commanded).file),
12948
12948
  line: ONE$1,
12949
12949
  column: ONE$1,
12950
- rule: RULE$28,
12950
+ rule: RULE$27,
12951
12951
  message: "msch could not list the tasks with `vp run --json`"
12952
12952
  }],
12953
- onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$12(found, absolute, document)))
12953
+ onSome: (found) => pipe(commanded, Array.flatMap((document) => problemsIn$11(found, absolute, document)))
12954
12954
  });
12955
12955
  });
12956
12956
  // src/features/check-legacy-web/model/legacy-web.ts
12957
- const RULE$27 = "legacy-web";
12957
+ const RULE$26 = "legacy-web";
12958
12958
  const FIRST_COLUMN$3 = 1;
12959
12959
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
12960
12960
  const Finding = Schema.Struct({
@@ -12993,7 +12993,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
12993
12993
  file: files.join(root, file),
12994
12994
  line,
12995
12995
  column: FIRST_COLUMN$3,
12996
- rule: RULE$27,
12996
+ rule: RULE$26,
12997
12997
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
12998
12998
  });
12999
12999
  return pipe(scan.guides, Array.flatMap(({ guideId, rules }) => pipe(rules, Array.flatMap(({ ruleId, findings }) => pipe(findings, Array.map(problemOf(guideId, ruleId)))))));
@@ -13064,7 +13064,7 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
13064
13064
  const EXTENSION = /\.[^./]+$/u;
13065
13065
  const SETTINGS_FILE = ".claude/settings.json";
13066
13066
  const READ_CONCURRENCY$10 = 64;
13067
- const RULE$26 = "shell-script";
13067
+ const RULE$25 = "shell-script";
13068
13068
  const MESSAGE$11 = "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.";
13069
13069
  const HookSchema = Schema.Struct({
13070
13070
  command: Schema.optional(Schema.String),
@@ -13097,7 +13097,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
13097
13097
  };
13098
13098
  const candidates = pipe(names, Array.filter((name) => !isSessionStartHook(name)));
13099
13099
  const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$10 });
13100
- return pipe(shell, Array.map((name) => problemInFile(RULE$26)(files.join(root, name), MESSAGE$11)));
13100
+ return pipe(shell, Array.map((name) => problemInFile(RULE$25)(files.join(root, name), MESSAGE$11)));
13101
13101
  });
13102
13102
  // src/shared/lib/workflow-files.ts
13103
13103
  const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
@@ -13116,8 +13116,8 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
13116
13116
  });
13117
13117
  // src/shared/lib/workflow-run.ts
13118
13118
  const RUN_KEY = "run";
13119
- const START$15 = 0;
13120
- const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$15));
13119
+ const START$14 = 0;
13120
+ const startOf = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$14));
13121
13121
  const runScriptsOf = (source) => {
13122
13122
  const found = [];
13123
13123
  visit(parseDocument(source), { Pair: (_key, pair) => {
@@ -13132,7 +13132,7 @@ const runScriptsOf = (source) => {
13132
13132
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
13133
13133
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
13134
13134
  const COMMENT = "#";
13135
- const RULE$25 = "workflow-script";
13135
+ const RULE$24 = "workflow-script";
13136
13136
  const ONE_COMMAND = 1;
13137
13137
  const MESSAGE$10 = "runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.";
13138
13138
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
@@ -13141,14 +13141,14 @@ const runsMoreThanOneCommand = ({ text }) => {
13141
13141
  const lines = pipe(String$1.split("\n")(text), Array.map(String$1.trim), Array.filter(isCommand));
13142
13142
  return lines.length > ONE_COMMAND || pipe(lines, Array.some(chainsCommands));
13143
13143
  };
13144
- const problemsIn$11 = (file) => (source) => {
13144
+ const problemsIn$10 = (file) => (source) => {
13145
13145
  const at = positionOf(source);
13146
- return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => problemAtPosition(RULE$25)(file, at(start), MESSAGE$10)));
13146
+ return pipe(runScriptsOf(source), Array.filter(runsMoreThanOneCommand), Array.map(({ start }) => problemAtPosition(RULE$24)(file, at(start), MESSAGE$10)));
13147
13147
  };
13148
13148
  /** @internal */
13149
13149
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
13150
13150
  const workflows = yield* readWorkflows(root);
13151
- return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$11(file)(source)));
13151
+ return pipe(workflows, Array.flatMap(({ file, source }) => problemsIn$10(file)(source)));
13152
13152
  });
13153
13153
  // src/features/check-scripts/model/script-checks.ts
13154
13154
  /** @internal */
@@ -13278,7 +13278,7 @@ const AGENT_DOCS = [
13278
13278
  ...EXCLUDED$5
13279
13279
  ];
13280
13280
  const READ_CONCURRENCY$8 = 16;
13281
- const START$14 = 0;
13281
+ const START$13 = 0;
13282
13282
  const FIRST$5 = 1;
13283
13283
  const LINE = "\n";
13284
13284
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
@@ -13288,7 +13288,7 @@ const decodeScripts = Schema.decodeUnknownOption(Schema.fromJsonString(Scripts))
13288
13288
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
13289
13289
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
13290
13290
  const NO_SOURCES = [];
13291
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$14));
13291
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$13));
13292
13292
  const scriptSources = (file) => (source) => pipe(decodeScripts(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array.map(([name, text]) => {
13293
13293
  const offset = offsetOf$2(source, `"${name}"`);
13294
13294
  return {
@@ -13384,7 +13384,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
13384
13384
  return Array.flatten(found);
13385
13385
  });
13386
13386
  // src/features/check-vite-plus/model/package-scripts.ts
13387
- const RULE$24 = "package-script";
13387
+ const RULE$23 = "package-script";
13388
13388
  const LIFECYCLE = [
13389
13389
  "preinstall",
13390
13390
  "install",
@@ -13404,15 +13404,15 @@ const LIFECYCLE = [
13404
13404
  "dependencies",
13405
13405
  "pnpm:devPreinstall"
13406
13406
  ];
13407
- const problemOf$3 = ({ file, position, name }) => ({
13407
+ const problemOf$2 = ({ file, position, name }) => ({
13408
13408
  file,
13409
13409
  ...position,
13410
- rule: RULE$24,
13410
+ rule: RULE$23,
13411
13411
  message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
13412
13412
  });
13413
- const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$3));
13413
+ const packageScriptProblems = (sources) => pipe(sources, Array.filter(({ kind, name }) => kind === "script" && !Array.contains(LIFECYCLE, name)), Array.map(problemOf$2));
13414
13414
  // src/features/check-vite-plus/model/vite-plus-block.ts
13415
- const RULE$23 = "vite-plus-block";
13415
+ const RULE$22 = "vite-plus-block";
13416
13416
  const MARKER = Array.join([
13417
13417
  "<!--",
13418
13418
  "VITE PLUS START",
@@ -13425,7 +13425,7 @@ const problemIn = (file) => (source) => {
13425
13425
  return Option.some({
13426
13426
  file,
13427
13427
  ...positionOf(source)(index.value),
13428
- rule: RULE$23,
13428
+ rule: RULE$22,
13429
13429
  message: MESSAGE$9
13430
13430
  });
13431
13431
  };
@@ -13481,7 +13481,7 @@ const checkFullHistoryCheckout = workflowCheck({
13481
13481
  })
13482
13482
  });
13483
13483
  // src/features/check-workflows/model/publish-trigger.ts
13484
- const RULE$21 = "publish-trigger";
13484
+ const RULE$20 = "publish-trigger";
13485
13485
  const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
13486
13486
  const MANUAL = "workflow_dispatch";
13487
13487
  const TRIGGER_KEY = "on";
@@ -13501,18 +13501,18 @@ const publishTriggerOffsetsOf = (source) => {
13501
13501
  };
13502
13502
  /** @internal */
13503
13503
  const checkPublishTrigger = workflowCheck({
13504
- rule: RULE$21,
13504
+ rule: RULE$20,
13505
13505
  message: MESSAGE$7,
13506
13506
  offsetsOf: publishTriggerOffsetsOf
13507
13507
  });
13508
13508
  // src/features/check-workflows/model/release-please.ts
13509
- const RULE$20 = "release-please";
13509
+ const RULE$19 = "release-please";
13510
13510
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
13511
13511
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
13512
13512
  const FIRST$4 = 1;
13513
13513
  const MESSAGE$6 = "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.";
13514
13514
  const checkReleasePleaseSteps = workflowCheck({
13515
- rule: RULE$20,
13515
+ rule: RULE$19,
13516
13516
  message: MESSAGE$6,
13517
13517
  offsetsOf: scalarKeyOffsets({
13518
13518
  name: "uses",
@@ -13526,7 +13526,7 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
13526
13526
  file: files.join(root, name),
13527
13527
  line: FIRST$4,
13528
13528
  column: FIRST$4,
13529
- rule: RULE$20,
13529
+ rule: RULE$19,
13530
13530
  message: MESSAGE$6
13531
13531
  })));
13532
13532
  });
@@ -13538,17 +13538,17 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
13538
13538
  // src/features/check-workflows/model/workflow-queue.ts
13539
13539
  const CONCURRENCY_KEY = "concurrency";
13540
13540
  const QUEUE_KEY = "queue";
13541
- const RULE$19 = "workflow-queue";
13541
+ const RULE$18 = "workflow-queue";
13542
13542
  const MESSAGE$5 = "queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.";
13543
13543
  const queueOffsetsOf = (source) => pipe(pairsNamed(CONCURRENCY_KEY)(source), Array.flatMap((pair) => Option.toArray(keyOffsetIn(QUEUE_KEY)(pair.value))));
13544
13544
  /** @internal */
13545
13545
  const checkWorkflowQueues = workflowCheck({
13546
- rule: RULE$19,
13546
+ rule: RULE$18,
13547
13547
  message: MESSAGE$5,
13548
13548
  offsetsOf: queueOffsetsOf
13549
13549
  });
13550
13550
  // src/features/check-workflows/model/workflow-commits.ts
13551
- const RULE$18 = "workflow-commit";
13551
+ const RULE$17 = "workflow-commit";
13552
13552
  const GIT_WRITE = /\bgit\s+(?:-{1,2}\S+\s+(?:\S+\s+)?)*(?:commit|push)\b/u;
13553
13553
  const COMMIT_ACTION = /^[^@/]+\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;
13554
13554
  const MESSAGE$4 = "commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.";
@@ -13556,7 +13556,7 @@ const offsetsWhere = (name, pattern) => (source) => pipe(pairsNamed(name)(source
13556
13556
  const commitOffsetsOf = (source) => [...offsetsWhere("run", GIT_WRITE)(source), ...offsetsWhere("uses", COMMIT_ACTION)(source)];
13557
13557
  /** @internal */
13558
13558
  const checkWorkflowCommits = workflowCheck({
13559
- rule: RULE$18,
13559
+ rule: RULE$17,
13560
13560
  message: MESSAGE$4,
13561
13561
  offsetsOf: commitOffsetsOf
13562
13562
  });
@@ -13592,6 +13592,18 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
13592
13592
  ], { concurrency: "unbounded" });
13593
13593
  return Array.flatten(found);
13594
13594
  });
13595
+ // src/shared/lib/comment-directives.ts
13596
+ const COMMENT_DIRECTIVES = [
13597
+ "textlint-disable",
13598
+ "textlint-enable",
13599
+ String.raw`\* @internal \*?$`,
13600
+ String.raw`\* @msch \S+ \*?$`,
13601
+ String.raw`shellcheck \w`,
13602
+ String.raw`zizmor: ignore\[`,
13603
+ String.raw`exit: \S`,
13604
+ "> statement-breakpoint$",
13605
+ "/ <reference (?:types|path|lib)="
13606
+ ];
13595
13607
  // src/features/ban-comments/model/found-comment.ts
13596
13608
  const taggedError$3 = Schema.TaggedError;
13597
13609
  var CommentsUnreadable = class extends taggedError$3()("CommentsUnreadable", {
@@ -13641,12 +13653,8 @@ const GRAMMARS = [
13641
13653
  "c-sharp",
13642
13654
  "cpp",
13643
13655
  "css",
13644
- "go",
13645
- "java",
13646
13656
  "javascript",
13647
- "php",
13648
13657
  "powershell",
13649
- "ruby",
13650
13658
  "rust",
13651
13659
  "tsx",
13652
13660
  "typescript"
@@ -13657,9 +13665,9 @@ const COMMENT_NODES = [
13657
13665
  "block_comment",
13658
13666
  "multiline_comment"
13659
13667
  ];
13660
- const START$13 = 0;
13668
+ const START$12 = 0;
13661
13669
  const NEXT = 1;
13662
- const NONE$1 = [];
13670
+ const NONE = [];
13663
13671
  const loadGrammar = (grammar) => loadLanguage(grammar).pipe(Effect.mapBoth({
13664
13672
  onFailure: ({ message }) => unreadable(grammar)(message),
13665
13673
  onSuccess: (language) => [grammar, language]
@@ -13677,7 +13685,7 @@ const commentNodesIn = (language, source) => pipe(readTree({
13677
13685
  index: node.startIndex,
13678
13686
  text: node.text
13679
13687
  })))
13680
- }), Option.getOrElse(() => NONE$1));
13688
+ }), Option.getOrElse(() => NONE));
13681
13689
  const syntaxComments = (grammars, grammar) => (source) => Option.match(grammars(grammar), {
13682
13690
  onNone: () => Effect.fail(unreadable(grammar)("the grammar is not loaded")),
13683
13691
  onSome: (language) => commentsFrom(grammar)((text) => commentNodesIn(language, text))(source)
@@ -13700,21 +13708,21 @@ const shifted = (offset) => ({ index, text }) => ({
13700
13708
  text
13701
13709
  });
13702
13710
  const markupComment = (source) => (node) => {
13703
- if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE$1;
13711
+ if (!isComment(node) || node.startIndex === null || node.endIndex === null) return NONE;
13704
13712
  return [{
13705
13713
  index: node.startIndex,
13706
13714
  text: String$1.slice(node.startIndex, node.endIndex + NEXT)(source)
13707
13715
  }];
13708
13716
  };
13709
13717
  const textComments = (grammars, grammar) => (text) => {
13710
- const shift = shifted(text.startIndex ?? START$13);
13718
+ const shift = shifted(text.startIndex ?? START$12);
13711
13719
  return syntaxComments(grammars, grammar)(text.data).pipe(Effect.map(Array.map(shift)));
13712
13720
  };
13713
13721
  const embeddedComments = (grammars) => (node) => {
13714
- if (!isTag(node)) return Effect.succeed(NONE$1);
13722
+ if (!isTag(node)) return Effect.succeed(NONE);
13715
13723
  const texts = pipe(node.children, Array.filter(isText));
13716
13724
  return Option.match(embeddedGrammar(node), {
13717
- onNone: () => Effect.succeed(NONE$1),
13725
+ onNone: () => Effect.succeed(NONE),
13718
13726
  onSome: (grammar) => pipe(texts, (items) => Effect.forEach(items, textComments(grammars, grammar), { concurrency: 1 }), Effect.map(Array.flatten))
13719
13727
  });
13720
13728
  };
@@ -13742,12 +13750,8 @@ const commentsWith = (grammars) => (reader, source) => {
13742
13750
  dockerfile: dockerfileComments
13743
13751
  }[reader](source);
13744
13752
  };
13745
- // src/features/ban-comments/model/comments.ts
13746
- const RULE$17 = "comment";
13747
- const CONFIG_FILE$2 = "vite.config.ts";
13748
- const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
13749
- const READ_CONCURRENCY$7 = 64;
13750
- const START$12 = 0;
13753
+ // src/features/ban-comments/model/reader-of.ts
13754
+ const SHEBANG$1 = "#!";
13751
13755
  const READERS$1 = [
13752
13756
  [/\.(?:[cm]?jsx?)$/u, "javascript"],
13753
13757
  [/\.(?:[cm]?ts)$/u, "typescript"],
@@ -13757,10 +13761,6 @@ const READERS$1 = [
13757
13761
  [/\.(?:sh|bash|zsh|ksh)$/u, "bash"],
13758
13762
  [/(?:^|\/)\.(?:vite-hooks|husky|githooks)\/[^./][^/]*$/u, "bash"],
13759
13763
  [/\.(?:ps1|psm1|psd1)$/u, "powershell"],
13760
- [/\.go$/u, "go"],
13761
- [/\.(?:java|kt|kts)$/u, "java"],
13762
- [/\.(?:rb|rake)$/u, "ruby"],
13763
- [/\.php$/u, "php"],
13764
13764
  [/\.(?:c|h|cc|cpp|cxx|hpp|hh|m|mm|glsl|frag|vert|comp|wgsl|hlsl|metal)$/u, "cpp"],
13765
13765
  [/\.(?:css|pcss)$/u, "css"],
13766
13766
  [/\.(?:html?|vue|svelte|astro)$/u, "html"],
@@ -13775,6 +13775,18 @@ const SHEBANG_READERS = [
13775
13775
  [/^#!.*\b(?:node|bun|deno|tsx)\b/u, "javascript"],
13776
13776
  [/^#!.*\bpwsh\b/u, "powershell"]
13777
13777
  ];
13778
+ const shebangReader = (source) => {
13779
+ if (!String$1.startsWith(SHEBANG$1)(source)) return Option.none();
13780
+ return pipe(SHEBANG_READERS, Array.findFirst(([pattern]) => pattern.test(source)));
13781
+ };
13782
+ const readerOf = (name) => (source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
13783
+ // src/features/ban-comments/model/comments.ts
13784
+ const RULE$16 = "comment";
13785
+ const UNUSED_RULE$1 = "unused-comment-allowance";
13786
+ const CONFIG_FILE$2 = "vite.config.ts";
13787
+ const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
13788
+ const READ_CONCURRENCY$7 = 64;
13789
+ const START$11 = 0;
13778
13790
  const SHEBANG = "#!";
13779
13791
  const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
13780
13792
  const VERSION = /^\s?v?\d[\w.+-]*$/u;
@@ -13792,26 +13804,25 @@ const NO_SETTINGS = {
13792
13804
  allow: [],
13793
13805
  ignorePatterns: []
13794
13806
  };
13795
- const NONE = [];
13796
13807
  const taggedError$2 = Schema.TaggedError;
13797
13808
  var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
13798
- const shebangReader = (source) => {
13799
- if (!String$1.startsWith(SHEBANG)(source)) return Option.none();
13800
- return pipe(SHEBANG_READERS, Array.findFirst(([pattern]) => pattern.test(source)));
13801
- };
13802
- const readerOf = (name, source) => pipe(READERS$1, Array.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
13803
13809
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
13804
13810
  const lineBefore = (source, index) => {
13805
- const lines = pipe(source, String$1.slice(START$12, index), String$1.split("\n"));
13811
+ const lines = pipe(source, String$1.slice(START$11, index), String$1.split("\n"));
13806
13812
  return Option.getOrElse(Array.last(lines), () => "");
13807
13813
  };
13808
13814
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
13809
- const isShebang = ({ index, text }) => index === START$12 && String$1.startsWith(SHEBANG)(text);
13815
+ const isShebang = ({ index, text }) => index === START$11 && String$1.startsWith(SHEBANG)(text);
13810
13816
  const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
13811
- const problemOf$2 = (file, source) => ({ index }) => ({
13817
+ const NOTHING = {
13818
+ problems: [],
13819
+ used: []
13820
+ };
13821
+ const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but no comment in the repository matches it. Delete the entry and add it back when a comment needs it.`;
13822
+ const problemOf$1 = (file, source) => ({ index }) => ({
13812
13823
  file,
13813
13824
  ...positionOf(source)(index),
13814
- rule: RULE$17,
13825
+ rule: RULE$16,
13815
13826
  message: MESSAGE$3
13816
13827
  });
13817
13828
  const settingsOf = ({ msch, lint }) => ({
@@ -13847,27 +13858,52 @@ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root, sett
13847
13858
  file: files.join(root, name)
13848
13859
  })), Array.filter(({ file }) => !HashSet.has(skipped, file)));
13849
13860
  });
13861
+ const usedAllowances = (allowances, found) => pipe(allowances, Array.map((pattern, index) => [pattern, index]), Array.filter(([pattern]) => pipe(found, Array.some((comment) => pattern.test(valueOf(comment.text))))), Array.map(([, index]) => index));
13862
+ const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$11));
13863
+ const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
13864
+ const files = yield* RepositoryFiles;
13865
+ const file = files.join(root, CONFIG_FILE$2);
13866
+ const text = yield* files.readFile(file);
13867
+ const source = Option.getOrElse(text, () => "");
13868
+ return pipe(settings.allow, Array.filter((_entry, index) => !HashSet.has(used, index)), Array.map((entry) => ({
13869
+ file,
13870
+ ...positionOf(source)(entryOffset(source, entry)),
13871
+ rule: UNUSED_RULE$1,
13872
+ message: unusedMessage(entry)
13873
+ })));
13874
+ });
13875
+ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, source) => {
13876
+ const kept = Predicate.not(isAllowed(source, directives));
13877
+ const toProblem = problemOf$1(file, source);
13878
+ return Option.match(readerOf(name)(source), {
13879
+ onNone: () => Effect.succeed(NOTHING),
13880
+ onSome: (reader) => comments(reader, source).pipe(Effect.map((found) => ({
13881
+ problems: pipe(found, Array.filter(kept), Array.map(toProblem)),
13882
+ used: usedAllowances(allowances, found)
13883
+ })), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
13884
+ problems: [problemInFile(RULE$16)(file, `msch could not read the comments in this file: ${message}`)],
13885
+ used: []
13886
+ })))
13887
+ });
13888
+ };
13850
13889
  /** @internal */
13851
13890
  const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
13852
13891
  const files = yield* RepositoryFiles;
13853
13892
  const settings = yield* rootSettings(root);
13854
13893
  const scanned = yield* scannedFiles(root, settings);
13855
- const directives = directivePattern([...COMMENT_DIRECTIVES, ...settings.allow]);
13856
13894
  const grammars = yield* loadGrammars();
13857
- const comments = commentsWith(grammars);
13858
- const problemsIn = ({ name, file }, source) => {
13859
- const kept = Predicate.not(isAllowed(source, directives));
13860
- const toProblem = problemOf$2(file, source);
13861
- return Option.match(readerOf(name, source), {
13862
- onNone: () => Effect.succeed(NONE),
13863
- onSome: (reader) => comments(reader, source).pipe(Effect.map(Array.filter(kept)), Effect.map(Array.map(toProblem)), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed([problemInFile(RULE$17)(file, `msch could not read the comments in this file: ${message}`)])))
13864
- });
13865
- };
13895
+ const scan = scanFile({
13896
+ directives: directivePattern([...COMMENT_DIRECTIVES, ...settings.allow]),
13897
+ allowances: pipe(settings.allow, Array.map((entry) => directivePattern([entry]))),
13898
+ comments: commentsWith(grammars)
13899
+ });
13866
13900
  const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
13867
- onNone: () => Effect.succeed(NONE),
13868
- onSome: (source) => problemsIn(entry, source)
13901
+ onNone: () => Effect.succeed(NOTHING),
13902
+ onSome: (source) => scan(entry, source)
13869
13903
  }))), { concurrency: READ_CONCURRENCY$7 });
13870
- return Array.flatten(found);
13904
+ const used = HashSet.fromIterable(pipe(found, Array.flatMap(({ used: indexes }) => indexes)));
13905
+ const unused = yield* unusedAllowances(root, settings, used);
13906
+ return [...pipe(found, Array.flatMap(({ problems }) => problems)), ...unused];
13871
13907
  });
13872
13908
  // src/features/ban-tools/model/banned-tool.ts
13873
13909
  const PROGRAM_SOURCE = /\.(?:[cm]?[jt]sx?|rs|cs|go)$/u;
@@ -13958,7 +13994,7 @@ const PYTHON = {
13958
13994
  /** @internal */
13959
13995
  const checkPython = (root) => checkBannedTool(root, PYTHON);
13960
13996
  // src/features/check-catalog-entries/model/uncataloged-dependencies.ts
13961
- const RULE$16 = "uncataloged-dependency";
13997
+ const RULE$15 = "uncataloged-dependency";
13962
13998
  const OWNED_ELSEWHERE = [
13963
13999
  "catalog:",
13964
14000
  "workspace:",
@@ -13969,10 +14005,10 @@ const ROOT_DIRECTORY$1 = ".";
13969
14005
  const PLUGIN_MANIFEST$1 = ".claude-plugin/plugin.json";
13970
14006
  const MESSAGE$2 = "is a version written in this package.json. Add it to the catalog in pnpm-workspace.yaml and write `catalog:` here, so that one entry owns the version and every package that uses the dependency moves together.";
13971
14007
  const isOwnedElsewhere = ({ specifier }) => pipe(OWNED_ELSEWHERE, Array.some((protocol) => String$1.startsWith(protocol)(specifier)));
13972
- const problemsIn$10 = (entry, source) => pipe(manifestSpecifiers(source), Array.filter((found) => !isOwnedElsewhere(found)), Array.map((found) => ({
14008
+ const problemsIn$9 = (entry, source) => pipe(manifestSpecifiers(source), Array.filter((found) => !isOwnedElsewhere(found)), Array.map((found) => ({
13973
14009
  file: entry.file,
13974
14010
  ...positionOf(source)(offsetIn(source)(manifestPattern(found))),
13975
- rule: RULE$16,
14011
+ rule: RULE$15,
13976
14012
  message: `\`${found.name}\` \`${found.specifier}\` ${MESSAGE$2}`
13977
14013
  })));
13978
14014
  /** @internal */
@@ -13987,10 +14023,10 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
13987
14023
  file: files.join(root, name)
13988
14024
  };
13989
14025
  }));
13990
- return yield* scanText(listed, problemsIn$10);
14026
+ return yield* scanText(listed, problemsIn$9);
13991
14027
  });
13992
14028
  // src/features/check-catalog-entries/model/catalog-entries.ts
13993
- const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
14029
+ const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
13994
14030
  const MANIFEST$2 = /(?:^|\/)package\.json$/u;
13995
14031
  const CATALOG_PROTOCOL = "catalog:";
13996
14032
  const DEFAULT_CATALOG = "default";
@@ -14070,7 +14106,7 @@ const checkCatalogEntries = Effect.fn("checkCatalogEntries")(function* checkCata
14070
14106
  const manifest = yield* workspaceManifest(root);
14071
14107
  const catalogs = yield* Option.match(manifest, {
14072
14108
  onNone: () => Effect.succeed([]),
14073
- onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$4), fieldsOf(settings))
14109
+ onSome: (settings) => findingsIn(root, files.join(root, WORKSPACE_FILE$3), fieldsOf(settings))
14074
14110
  });
14075
14111
  const uncataloged = yield* Option.match(manifest, {
14076
14112
  onNone: () => Effect.succeed([]),
@@ -14085,7 +14121,7 @@ const CONFIG_FILE$1 = "vite.config.ts";
14085
14121
  const RENOVATE_FILE$1 = "renovate.json";
14086
14122
  const SOURCE = "masseater/skills";
14087
14123
  const PRESET$1 = "github>masseater/ecosystems//libs/vite-plus-adopt/renovate";
14088
- const START$11 = 0;
14124
+ const START$10 = 0;
14089
14125
  const LOCAL_PREFIX = "./";
14090
14126
  const REGEX_SPECIAL = /[.*+?^${}()|[\]\\/]/gu;
14091
14127
  const Source = Schema.Struct({
@@ -14098,7 +14134,7 @@ const taggedError$1 = Schema.TaggedError;
14098
14134
  var SkillsConfigUnreadable = class extends taggedError$1()("SkillsConfigUnreadable", { file: Schema.String }) {};
14099
14135
  const problemAt$4 = (rule, file, text) => (anchor, message) => ({
14100
14136
  file,
14101
- ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$11))),
14137
+ ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$10))),
14102
14138
  rule,
14103
14139
  message
14104
14140
  });
@@ -14145,14 +14181,14 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
14145
14181
  ];
14146
14182
  });
14147
14183
  // src/features/check-skills/model/published-skills.ts
14148
- const RULE$15 = "published-skills";
14184
+ const RULE$14 = "published-skills";
14149
14185
  const KEYWORD = "tanstack-intent";
14150
14186
  const SKILLS = "skills";
14151
14187
  const MANIFEST_FILE = "package.json";
14152
14188
  const SKILL_FILE$1 = "SKILL.md";
14153
14189
  const SUCCEEDED = 0;
14154
14190
  const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
14155
- const problemAt$3 = problemInFile(RULE$15);
14191
+ const problemAt$3 = problemInFile(RULE$14);
14156
14192
  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))));
14157
14193
  const isShipped = (listed) => (skill) => Array.contains(listed, SKILLS) || Array.contains(listed, skill);
14158
14194
  const packagingMessages = ({ keywords, files }, skills) => {
@@ -14173,7 +14209,7 @@ const validationOf = Effect.fn("validationOf")(function* validationOf(directory)
14173
14209
  const [output, status] = yield* Effect.all([handle.all.pipe(Stream.decodeText(), Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
14174
14210
  return Option.liftPredicate(String$1.trim(output), () => Number(status) !== SUCCEEDED);
14175
14211
  }, Effect.scoped);
14176
- const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
14212
+ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, project) {
14177
14213
  const files = yield* RepositoryFiles;
14178
14214
  const directory = files.join(root, project.directory);
14179
14215
  const manifest = files.join(directory, MANIFEST_FILE);
@@ -14185,11 +14221,11 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, project)
14185
14221
  /** @internal */
14186
14222
  const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPublishedSkills(root) {
14187
14223
  const projects = yield* publishedProjects(root);
14188
- const problems = yield* Effect.forEach(projects, (project) => problemsIn$9(root, project), { concurrency: 1 });
14224
+ const problems = yield* Effect.forEach(projects, (project) => problemsIn$8(root, project), { concurrency: 1 });
14189
14225
  return Array.flatten(problems);
14190
14226
  });
14191
14227
  // src/features/check-skills/model/skill-files.ts
14192
- const RULE$14 = "skill-file";
14228
+ const RULE$13 = "skill-file";
14193
14229
  const SKILL_FILE = /(?:^|\/)SKILL\.md$/u;
14194
14230
  const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
14195
14231
  const FIXTURE = /(?:^|\/)fixtures\//u;
@@ -14207,7 +14243,7 @@ const GITHUB = "https://github.com/";
14207
14243
  const COMMIT_LINK = /\/(?:blob|tree)\/[0-9a-f]{40}(?:\/|$)/u;
14208
14244
  const BLANK = /\s+/u;
14209
14245
  const SEPARATOR$2 = "/";
14210
- const START$10 = 0;
14246
+ const START$9 = 0;
14211
14247
  const FIRST$3 = 1;
14212
14248
  const READ_CONCURRENCY$5 = 16;
14213
14249
  const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
@@ -14217,9 +14253,9 @@ const Frontmatter = Schema.Struct({
14217
14253
  metadata: Schema.optional(Metadata)
14218
14254
  });
14219
14255
  const decodeFrontmatter = Schema.decodeUnknownOption(Frontmatter);
14220
- const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$10));
14256
+ const offsetOf$1 = (source, pattern) => pipe(String$1.search(pattern)(source), Option.getOrElse(() => START$9));
14221
14257
  const frontmatterOf = (source) => pipe(groupOf$2("yaml")(FRONTMATTER.exec(source)), Option.flatMap(Option.liftThrowable((yaml) => parse$2(yaml))), Option.flatMap(decodeFrontmatter));
14222
- const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$10].length), Option.getOrElse(() => START$10));
14258
+ const bodyStartOf = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.map((found) => found[START$9].length), Option.getOrElse(() => START$9));
14223
14259
  const headingText = (heading) => pipe(heading, Option.map((title) => `"# ${title}"`), Option.getOrElse(() => "missing"));
14224
14260
  const nameProblems = ({ source, directory }, name, folder) => {
14225
14261
  const bodyStart = bodyStartOf(source);
@@ -14247,16 +14283,16 @@ const frontmatterProblems = (skill, folder) => pipe(frontmatterOf(skill.source),
14247
14283
  ]), Option.getOrElse(() => []), Array.map(({ index, message }) => ({
14248
14284
  file: skill.file,
14249
14285
  ...positionOf(skill.source)(index),
14250
- rule: RULE$14,
14286
+ rule: RULE$13,
14251
14287
  message
14252
14288
  })));
14253
14289
  const linkOf = (found) => pipe(groupOf$2("target")(found), Option.filter((target) => !EXTERNAL.test(target)), Option.map((target) => String$1.replace(FRAGMENT, "")(target)), Option.filter(String$1.isNonEmpty), Option.map((target) => ({
14254
14290
  target,
14255
- index: found.index ?? START$10
14291
+ index: found.index ?? START$9
14256
14292
  })), Option.toArray);
14257
14293
  const rangeOf$1 = (found) => {
14258
- const start = found.index ?? START$10;
14259
- return [start, start + found[START$10].length];
14294
+ const start = found.index ?? START$9;
14295
+ return [start, start + found[START$9].length];
14260
14296
  };
14261
14297
  const isOutside = (ranges) => ({ index }) => !pipe(ranges, Array.some(([start, end]) => index >= start && index < end));
14262
14298
  const linksIn = (source) => {
@@ -14274,11 +14310,11 @@ const linkProblems = Effect.fn("linkProblems")(function* linkProblems(file) {
14274
14310
  return pipe(missing, Array.map(({ target, index }) => ({
14275
14311
  file,
14276
14312
  ...positionOf(source)(index),
14277
- rule: RULE$14,
14313
+ rule: RULE$13,
14278
14314
  message: `links to ${target}, which does not exist. Fix the path or remove the link.`
14279
14315
  })));
14280
14316
  });
14281
- const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
14317
+ const problemsIn$7 = Effect.fn("problemsIn")(function* problemsIn(root, listed, name) {
14282
14318
  const files = yield* RepositoryFiles;
14283
14319
  const file = files.join(root, name);
14284
14320
  const directory = files.dirname(name);
@@ -14290,7 +14326,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
14290
14326
  file: files.join(root, entry),
14291
14327
  line: FIRST$3,
14292
14328
  column: FIRST$3,
14293
- rule: RULE$14,
14329
+ rule: RULE$13,
14294
14330
  message: "is a license file inside a skill. Skills here carry neither a license field nor a LICENSE file. Delete it."
14295
14331
  })));
14296
14332
  return [
@@ -14307,7 +14343,7 @@ const problemsIn$8 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
14307
14343
  const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
14308
14344
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
14309
14345
  const skills = pipe(listed, Array.filter((name) => SKILL_FILE.test(name) && !INSTALLED.test(name) && !FIXTURE.test(name)));
14310
- const found = yield* Effect.forEach(skills, (name) => problemsIn$8(root, listed, name), { concurrency: READ_CONCURRENCY$5 });
14346
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$7(root, listed, name), { concurrency: READ_CONCURRENCY$5 });
14311
14347
  return Array.flatten(found);
14312
14348
  });
14313
14349
  // src/features/check-version-downgrades/model/version-entries.ts
@@ -14368,7 +14404,7 @@ const cargoEntries = (text) => {
14368
14404
  };
14369
14405
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
14370
14406
  // src/features/check-version-downgrades/model/version-downgrade.ts
14371
- const RULE$13 = "version-downgrade";
14407
+ const RULE$12 = "version-downgrade";
14372
14408
  const DEFAULT_BASE = "origin/main";
14373
14409
  const READ_CONCURRENCY$4 = 16;
14374
14410
  const READERS = [
@@ -14394,7 +14430,7 @@ const downgradesIn = ({ file, text, before, after }) => {
14394
14430
  file,
14395
14431
  line: lineOf(text, entry),
14396
14432
  column: FIRST_LINE$1,
14397
- rule: RULE$13,
14433
+ rule: RULE$12,
14398
14434
  message: message(old, entry)
14399
14435
  })), Option.toArray)));
14400
14436
  };
@@ -14431,13 +14467,13 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
14431
14467
  const CAP_RULE = "renovate-version-cap";
14432
14468
  const PRESET_RULE = "renovate-msch-preset";
14433
14469
  const PRESET = "github>masseater/ecosystems//libs/msch/renovate";
14434
- const START$9 = 0;
14470
+ const START$8 = 0;
14435
14471
  const READ_CONCURRENCY$3 = 16;
14436
14472
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
14437
14473
  const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
14438
14474
  const PRESET_MESSAGE = `does not extend \`${PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
14439
14475
  const offsetsOf = (pattern, source) => pipe(Array.fromIterable(String$1.matchAll(pattern)(source)), Array.flatMap((match) => Option.toArray(Option.fromUndefinedOr(match.index))));
14440
- const problemsIn$7 = (file, source) => {
14476
+ const problemsIn$6 = (file, source) => {
14441
14477
  const at = positionOf(source);
14442
14478
  const found = (pattern, rule, message) => pipe(offsetsOf(pattern, source), Array.map((offset) => ({
14443
14479
  file,
@@ -14450,7 +14486,7 @@ const problemsIn$7 = (file, source) => {
14450
14486
  ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
14451
14487
  ...pipe([{
14452
14488
  file,
14453
- ...at(START$9),
14489
+ ...at(START$8),
14454
14490
  rule: PRESET_RULE,
14455
14491
  message: PRESET_MESSAGE
14456
14492
  }], Array.filter(() => !String$1.includes(`"${PRESET}"`)(source)))
@@ -14464,7 +14500,7 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
14464
14500
  const file = files.join(root, name);
14465
14501
  return files.readFile(file).pipe(Effect.map(Option.match({
14466
14502
  onNone: () => [],
14467
- onSome: (source) => problemsIn$7(file, source)
14503
+ onSome: (source) => problemsIn$6(file, source)
14468
14504
  })));
14469
14505
  }, { concurrency: READ_CONCURRENCY$3 });
14470
14506
  return Array.flatten(found);
@@ -14472,24 +14508,24 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
14472
14508
  // src/features/find-invisible-characters/model/hidden-unicode.ts
14473
14509
  const HIDDEN = /[\u00AD\u180E\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]|(?<![\p{Extended_Pictographic}\p{Emoji_Modifier}\uFE0F])\u200D|\u200D(?!\p{Extended_Pictographic})|[\u{E0000}-\u{E007F}]/gu;
14474
14510
  const NUL = "\0";
14475
- const START$8 = 0;
14511
+ const START$7 = 0;
14476
14512
  const HEX = 16;
14477
14513
  const CODE_POINT_WIDTH = 4;
14478
14514
  const READ_CONCURRENCY$2 = 64;
14479
- const RULE$12 = "hidden-unicode";
14480
- const hexOf = (character) => pipe(String$1.codePointAt(START$8)(character), Option.getOrElse(() => START$8), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
14481
- const problemOf$1 = (file, source) => (found) => {
14482
- const hex = hexOf(found[START$8]);
14515
+ const RULE$11 = "hidden-unicode";
14516
+ const hexOf = (character) => pipe(String$1.codePointAt(START$7)(character), Option.getOrElse(() => START$7), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
14517
+ const problemOf = (file, source) => (found) => {
14518
+ const hex = hexOf(found[START$7]);
14483
14519
  return {
14484
14520
  file,
14485
- ...positionOf(source)(found.index ?? START$8),
14486
- rule: RULE$12,
14521
+ ...positionOf(source)(found.index ?? START$7),
14522
+ rule: RULE$11,
14487
14523
  message: `U+${hex} is invisible in editors and reviews and can change what the text means. Remove it, or write it as the escape \\u${hex}.`
14488
14524
  };
14489
14525
  };
14490
- const problemsIn$6 = (file, source) => {
14526
+ const problemsIn$5 = (file, source) => {
14491
14527
  if (String$1.includes(NUL)(source)) return [];
14492
- return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf$1(file, source)));
14528
+ return pipe(Array.fromIterable(String$1.matchAll(HIDDEN)(source)), Array.map(problemOf(file, source)));
14493
14529
  };
14494
14530
  /** @internal */
14495
14531
  const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
@@ -14499,36 +14535,11 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
14499
14535
  const file = files.join(root, name);
14500
14536
  return files.readFile(file).pipe(Effect.map(Option.match({
14501
14537
  onNone: () => [],
14502
- onSome: (source) => problemsIn$6(file, source)
14538
+ onSome: (source) => problemsIn$5(file, source)
14503
14539
  })));
14504
14540
  }, { concurrency: READ_CONCURRENCY$2 });
14505
14541
  return Array.flatten(found);
14506
14542
  });
14507
- // src/features/find-unneeded-files/model/alchemy-patch.ts
14508
- const RULE$11 = "alchemy-patch";
14509
- const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
14510
- const ALCHEMY$1 = /^(?:alchemy|@alchemy\.run\/[^@]+)(?:@.*)?$/u;
14511
- const START$7 = 0;
14512
- const problemOf = (file, position, name) => ({
14513
- file,
14514
- ...position,
14515
- rule: RULE$11,
14516
- message: `patches ${name}. A patch breaks on every Alchemy release. Define the missing setting as a custom resource in the stack and delete the patch.`
14517
- });
14518
- const problemsIn$5 = (file, patched) => (source) => {
14519
- const at = positionOf(source);
14520
- const offsetOf = (name) => pipe(String$1.indexOf(name)(source), Option.getOrElse(() => START$7));
14521
- return pipe(patched, Array.filter((name) => ALCHEMY$1.test(name)), Array.map((name) => problemOf(file, at(offsetOf(name)), name)));
14522
- };
14523
- /** @internal */
14524
- const checkAlchemyPatch = Effect.fn("checkAlchemyPatch")(function* checkAlchemyPatch(root) {
14525
- const files = yield* RepositoryFiles;
14526
- const file = files.join(root, WORKSPACE_FILE$3);
14527
- const text = yield* files.readFile(file);
14528
- const manifest = yield* workspaceManifest(root);
14529
- const patched = pipe(manifest, Option.flatMap(({ patchedDependencies }) => Option.fromUndefinedOr(patchedDependencies)), Option.map(Record.keys), Option.getOrElse(() => []));
14530
- return pipe(text, Option.map(problemsIn$5(file, patched)), Option.getOrElse(() => []));
14531
- });
14532
14543
  // src/features/find-unneeded-files/model/applied-packages.ts
14533
14544
  const MSCH = "@r_masseater/msch";
14534
14545
  const SCOPE$1 = "@r_masseater/";
@@ -14929,9 +14940,6 @@ const checkExactVersions = Effect.fn("checkExactVersions")(function* checkExactV
14929
14940
  });
14930
14941
  // src/features/check-pack-settings/model/pack-settings.ts
14931
14942
  const RULE$6 = "pack-publint";
14932
- const PREPUBLISH_RULE = "prepublish-script";
14933
- const PREPUBLISH_SCRIPT = "prepublishOnly";
14934
- const PREPUBLISH_COMMAND = "vp exec msch-publish prepublish .";
14935
14943
  const CONFIG_FILE = "vite.config.ts";
14936
14944
  const PACK_KEY = "pack:";
14937
14945
  const START$4 = 0;
@@ -14939,8 +14947,7 @@ const READ_CONCURRENCY$1 = 16;
14939
14947
  const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
14940
14948
  const Manifest$4 = Schema.Struct({
14941
14949
  private: Schema.optional(Schema.Boolean),
14942
- publishConfig: Schema.optional(Schema.Unknown),
14943
- scripts: Schema.optional(Schema.Record(Schema.String, Schema.String))
14950
+ publishConfig: Schema.optional(Schema.Unknown)
14944
14951
  });
14945
14952
  const decodeManifest$4 = Schema.decodeUnknownOption(Schema.fromJsonString(Manifest$4));
14946
14953
  const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Literal(true) }) });
@@ -14958,16 +14965,6 @@ const problemFor = (file, source) => ({
14958
14965
  message: "This package is published, so its pack must run publint with `publint: { strict: true }`. Without it, publishConfig can point at files vp pack never writes, and the published package fails to import."
14959
14966
  });
14960
14967
  const publishedManifest = (source) => pipe(source, Option.flatMap(decodeManifest$4), Option.filter(isPublished$2));
14961
- const prepublishProblems = (file, source, manifest) => {
14962
- const declared = pipe(Option.fromUndefinedOr(manifest.scripts), Option.flatMap(Record.get(PREPUBLISH_SCRIPT)));
14963
- if (Option.contains(declared, PREPUBLISH_COMMAND)) return [];
14964
- return [{
14965
- file,
14966
- ...positionOf(source)(Option.getOrElse(String$1.indexOf(`"${PREPUBLISH_SCRIPT}"`)(source), () => START$4)),
14967
- rule: PREPUBLISH_RULE,
14968
- message: `This package is published, so its ${PREPUBLISH_SCRIPT} script must be exactly \`${PREPUBLISH_COMMAND}\`. That one command refuses npm publish, which leaves catalog: in dependencies, and builds the package. Writing the guard in each package leaves some packages without it.`
14969
- }];
14970
- };
14971
14968
  const strictPublintIn = Effect.fn("strictPublintIn")(function* strictPublintIn(configFile) {
14972
14969
  const config = yield* Effect.tryPromise({
14973
14970
  try: () => resolveConfigFromFile(configFile),
@@ -14983,12 +14980,10 @@ const configProblems = Effect.fn("configProblems")(function* configProblems(conf
14983
14980
  });
14984
14981
  const problemsIn$3 = Effect.fn("problemsIn")(function* problemsIn(root, manifestName) {
14985
14982
  const files = yield* RepositoryFiles;
14986
- const manifestFile = files.join(root, manifestName);
14987
- const source = yield* files.readFile(manifestFile);
14983
+ const source = yield* files.readFile(files.join(root, manifestName));
14988
14984
  const manifest = publishedManifest(source);
14989
- if (Option.isNone(manifest) || Option.isNone(source)) return [];
14990
- const config = yield* configProblems(files.join(root, files.dirname(manifestName), CONFIG_FILE));
14991
- return [...prepublishProblems(manifestFile, source.value, manifest.value), ...config];
14985
+ if (Option.isNone(manifest)) return [];
14986
+ return yield* configProblems(files.join(root, files.dirname(manifestName), CONFIG_FILE));
14992
14987
  });
14993
14988
  /** @internal */
14994
14989
  const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSettings(root) {
@@ -15416,7 +15411,6 @@ const checkTrackedText = Effect.fn("checkTrackedText")(function* checkTrackedTex
15416
15411
  checkDocker(root),
15417
15412
  checkUnneededFiles(root),
15418
15413
  checkReplacedTools(root),
15419
- checkAlchemyPatch(root),
15420
15414
  checkManifests(root),
15421
15415
  checkSkillFiles(root),
15422
15416
  checkSkillEntry(root),