@r_masseater/msch 0.85.0 → 0.86.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
@@ -499,12 +499,12 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
499
499
  // src/features/check-overrides/model/git-subpath.ts
500
500
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
501
501
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
502
- const RULE$68 = "git-subpath-dependency";
502
+ const RULE$69 = "git-subpath-dependency";
503
503
  const WHOLE_MATCH$4 = 0;
504
504
  const problemAt$6 = ({ file }, source) => (found) => ({
505
505
  file,
506
506
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
507
- rule: RULE$68,
507
+ rule: RULE$69,
508
508
  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])}\`.`
509
509
  });
510
510
  const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$6(entry, source)));
@@ -515,13 +515,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
515
515
  return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$23);
516
516
  });
517
517
  // src/features/check-overrides/model/restricted-rules.ts
518
- const RULE$67 = "unnamed-restriction";
518
+ const RULE$68 = "unnamed-restriction";
519
519
  const WHOLE_MATCH$3 = 0;
520
520
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
521
521
  const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
522
522
  file: entry.file,
523
523
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
524
- rule: RULE$67,
524
+ rule: RULE$68,
525
525
  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.`
526
526
  })));
527
527
  /** @internal */
@@ -530,13 +530,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
530
530
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$22);
531
531
  });
532
532
  // src/features/check-overrides/model/type-exemptions.ts
533
- const RULE$66 = "named-type-exemption";
533
+ const RULE$67 = "named-type-exemption";
534
534
  const WHOLE_MATCH$2 = 0;
535
535
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
536
536
  const problemsIn$21 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
537
537
  file: entry.file,
538
538
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
539
- rule: RULE$66,
539
+ rule: RULE$67,
540
540
  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."
541
541
  })));
542
542
  /** @internal */
@@ -545,7 +545,7 @@ const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkType
545
545
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$21);
546
546
  });
547
547
  // src/features/check-overrides/model/package-registry.ts
548
- const RULE$65 = "package-registry";
548
+ const RULE$66 = "package-registry";
549
549
  const REGISTRY = "https://npm.flatt.tech/";
550
550
  const TRAILING_SLASH = /\/$/u;
551
551
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
@@ -562,7 +562,7 @@ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ inde
562
562
  const workspaceProblem = (file, source, registry) => ({
563
563
  file,
564
564
  ...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
565
- rule: RULE$65,
565
+ rule: RULE$66,
566
566
  message: Option.match(registry, {
567
567
  onNone: () => `${REASON} Set \`registry: ${REGISTRY}\` in ${WORKSPACE_FILE$5}.`,
568
568
  onSome: (value) => `${REASON} \`registry\` is ${value}. Set it to ${REGISTRY}.`
@@ -571,7 +571,7 @@ const workspaceProblem = (file, source, registry) => ({
571
571
  const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isGuarded)), Array$1.map((found) => ({
572
572
  file: entry.file,
573
573
  ...positionOf(source)(found.index ?? START$28),
574
- rule: RULE$65,
574
+ rule: RULE$66,
575
575
  message: `${REASON} This .npmrc overrides it with \`${String$1.trim(found[START$28])}\`. Remove the line.`
576
576
  })));
577
577
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
@@ -2698,7 +2698,7 @@ const matcher = (patterns) => {
2698
2698
  String$1.startsWith(NEGATION$2);
2699
2699
  String$1.slice(1);
2700
2700
  // src/features/check-placement/model/colocated-git-patterns.ts
2701
- const RULE$64 = "colocated-git-patterns";
2701
+ const RULE$65 = "colocated-git-patterns";
2702
2702
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
2703
2703
  const ROOT$3 = ".";
2704
2704
  const NEGATION$1 = "!";
@@ -2745,7 +2745,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
2745
2745
  const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
2746
2746
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
2747
2747
  });
2748
- const patternProblem = (entry, message) => problemAtPosition(RULE$64)(entry.file, {
2748
+ const patternProblem = (entry, message) => problemAtPosition(RULE$65)(entry.file, {
2749
2749
  line: entry.line,
2750
2750
  column: FIRST$23
2751
2751
  }, message);
@@ -2827,7 +2827,7 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
2827
2827
  })), Option.getOrElse(() => [])));
2828
2828
  });
2829
2829
  // src/features/check-placement/model/colocated-tests.ts
2830
- const RULE$63 = "colocated-test";
2830
+ const RULE$64 = "colocated-test";
2831
2831
  const FIRST$22 = 1;
2832
2832
  const READ_CONCURRENCY$33 = 64;
2833
2833
  const ROOT_SUBPATH$1 = ".";
@@ -2850,7 +2850,7 @@ const problemFor$9 = (test, message) => ({
2850
2850
  file: test.file,
2851
2851
  line: FIRST$22,
2852
2852
  column: FIRST$22,
2853
- rule: RULE$63,
2853
+ rule: RULE$64,
2854
2854
  message: `${test.base} ${message}`
2855
2855
  });
2856
2856
  const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
@@ -2933,7 +2933,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
2933
2933
  // src/features/check-placement/model/agent-docs-length.ts
2934
2934
  const RECOMMENDED_LINES = 200;
2935
2935
  const FIRST$21 = 1;
2936
- const RULE$62 = "agent-docs-length";
2936
+ const RULE$63 = "agent-docs-length";
2937
2937
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
2938
2938
  const problemFor$8 = (file) => (lines) => {
2939
2939
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -2941,19 +2941,19 @@ const problemFor$8 = (file) => (lines) => {
2941
2941
  file,
2942
2942
  line: 201,
2943
2943
  column: FIRST$21,
2944
- rule: RULE$62,
2944
+ rule: RULE$63,
2945
2945
  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.`
2946
2946
  });
2947
2947
  };
2948
2948
  /** @internal */
2949
2949
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$8(file)(lineCount(source)));
2950
2950
  // src/features/check-placement/model/claude-link.ts
2951
- const RULE$61 = "claude-md-link";
2951
+ const RULE$62 = "claude-md-link";
2952
2952
  const CLAUDE = "CLAUDE.md";
2953
2953
  const AGENTS = "AGENTS.md";
2954
2954
  const FIRST$20 = 1;
2955
2955
  const READ_CONCURRENCY$31 = 16;
2956
- const MESSAGE$18 = "CLAUDE.md must be a symbolic link to AGENTS.md";
2956
+ const MESSAGE$19 = "CLAUDE.md must be a symbolic link to AGENTS.md";
2957
2957
  /** @internal */
2958
2958
  const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
2959
2959
  const files = yield* RepositoryFiles;
@@ -2967,8 +2967,8 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
2967
2967
  file: path,
2968
2968
  line: FIRST$20,
2969
2969
  column: FIRST$20,
2970
- rule: RULE$61,
2971
- message: MESSAGE$18
2970
+ rule: RULE$62,
2971
+ message: MESSAGE$19
2972
2972
  })));
2973
2973
  });
2974
2974
  const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
@@ -2976,7 +2976,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
2976
2976
  return Array$1.getSomes(found);
2977
2977
  });
2978
2978
  // src/features/check-placement/model/dangling-links.ts
2979
- const RULE$60 = "dangling-link";
2979
+ const RULE$61 = "dangling-link";
2980
2980
  const SEPARATOR$21 = "/";
2981
2981
  const FIRST$19 = 1;
2982
2982
  const READ_CONCURRENCY$30 = 16;
@@ -2992,7 +2992,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
2992
2992
  file,
2993
2993
  line: FIRST$19,
2994
2994
  column: FIRST$19,
2995
- rule: RULE$60,
2995
+ rule: RULE$61,
2996
2996
  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.`
2997
2997
  })));
2998
2998
  });
@@ -3050,7 +3050,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
3050
3050
  }));
3051
3051
  });
3052
3052
  // src/features/check-placement/model/deployed-readme.ts
3053
- const RULE$59 = "deployed-readme";
3053
+ const RULE$60 = "deployed-readme";
3054
3054
  const ROOT_DIRECTORY$4 = "";
3055
3055
  const READ_CONCURRENCY$29 = 16;
3056
3056
  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.";
@@ -3090,14 +3090,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
3090
3090
  const readme = yield* readReadme({
3091
3091
  root,
3092
3092
  directory,
3093
- rule: RULE$59,
3093
+ rule: RULE$60,
3094
3094
  missingMessage: MISSING_MESSAGE$2
3095
3095
  });
3096
3096
  return Result.match(readme, {
3097
3097
  onFailure: Option.some,
3098
3098
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
3099
3099
  file,
3100
- rule: RULE$59,
3100
+ rule: RULE$60,
3101
3101
  message: NO_URL_MESSAGE
3102
3102
  })))
3103
3103
  });
@@ -3114,7 +3114,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
3114
3114
  return Array$1.getSomes(found);
3115
3115
  });
3116
3116
  // src/features/check-placement/model/nested-docs.ts
3117
- const RULE$58 = "nested-docs";
3117
+ const RULE$59 = "nested-docs";
3118
3118
  const CONFIG_FILE$7 = "vite.config.ts";
3119
3119
  const SEPARATOR$19 = "/";
3120
3120
  const READ_CONCURRENCY$28 = 64;
@@ -3127,7 +3127,7 @@ const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Sc
3127
3127
  const taggedError$6 = Schema.TaggedError;
3128
3128
  var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
3129
3129
  const isNested = (name) => String$1.includes(SEPARATOR$19)(name);
3130
- const problemFor$7 = problemInFile(RULE$58);
3130
+ const problemFor$7 = problemInFile(RULE$59);
3131
3131
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
3132
3132
  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.";
3133
3133
  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.";
@@ -3184,15 +3184,15 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
3184
3184
  return [...Array$1.getSomes(found), ...missing];
3185
3185
  });
3186
3186
  // src/features/check-placement/model/published-readme.ts
3187
- const RULE$57 = "published-readme";
3187
+ const RULE$58 = "published-readme";
3188
3188
  const READ_CONCURRENCY$27 = 16;
3189
- const MESSAGE$17 = "contains Japanese. This package is published to npm, so write its README in English.";
3189
+ const MESSAGE$18 = "contains Japanese. This package is published to npm, so write its README in English.";
3190
3190
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
3191
3191
  const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
3192
3192
  const readme = yield* readReadme({
3193
3193
  root,
3194
3194
  directory,
3195
- rule: RULE$57,
3195
+ rule: RULE$58,
3196
3196
  missingMessage: MISSING_MESSAGE
3197
3197
  });
3198
3198
  return Result.match(readme, {
@@ -3203,8 +3203,8 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3203
3203
  file,
3204
3204
  line,
3205
3205
  column,
3206
- rule: RULE$57,
3207
- message: MESSAGE$17
3206
+ rule: RULE$58,
3207
+ message: MESSAGE$18
3208
3208
  };
3209
3209
  }))
3210
3210
  });
@@ -3216,10 +3216,10 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
3216
3216
  return Array$1.getSomes(found);
3217
3217
  });
3218
3218
  // src/features/check-placement/model/published-tests.ts
3219
- const RULE$56 = "published-tests";
3219
+ const RULE$57 = "published-tests";
3220
3220
  const FILE_START = 1;
3221
3221
  const TEST_FILE$1 = /\.test\.[cm]?[jt]sx?$/u;
3222
- const MESSAGE$16 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
3222
+ const MESSAGE$17 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
3223
3223
  const testedIn = (listed) => (prefix) => pipe(listed, Array$1.some((file) => String$1.startsWith(prefix)(file) && TEST_FILE$1.test(file)));
3224
3224
  const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed, { directory }) {
3225
3225
  const files = yield* RepositoryFiles;
@@ -3230,8 +3230,8 @@ const problemFor$6 = Effect.fn("problemFor")(function* problemFor(root, listed,
3230
3230
  file: files.join(absolute, PACKAGE_JSON_FILE),
3231
3231
  line: FILE_START,
3232
3232
  column: FILE_START,
3233
- rule: RULE$56,
3234
- message: MESSAGE$16
3233
+ rule: RULE$57,
3234
+ message: MESSAGE$17
3235
3235
  });
3236
3236
  });
3237
3237
  /** @internal */
@@ -3244,12 +3244,12 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
3244
3244
  return Array$1.getSomes(found);
3245
3245
  });
3246
3246
  // src/features/check-placement/model/root-docs.ts
3247
- const RULE$55 = "root-docs";
3247
+ const RULE$56 = "root-docs";
3248
3248
  const SEPARATOR$18 = "/";
3249
3249
  const FIRST$17 = 1;
3250
3250
  const MARKDOWN$2 = /\.(?:md|mdx|markdown)$/iu;
3251
3251
  const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
3252
- const MESSAGE$15 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
3252
+ const MESSAGE$16 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
3253
3253
  const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$18)(name) && MARKDOWN$2.test(name) && !ALLOWED.test(name);
3254
3254
  /** @internal */
3255
3255
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
@@ -3259,12 +3259,12 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3259
3259
  file: files.join(root, name),
3260
3260
  line: FIRST$17,
3261
3261
  column: FIRST$17,
3262
- rule: RULE$55,
3263
- message: `${name} ${MESSAGE$15}`
3262
+ rule: RULE$56,
3263
+ message: `${name} ${MESSAGE$16}`
3264
3264
  })));
3265
3265
  });
3266
3266
  // src/features/check-placement/model/root-readme.ts
3267
- const RULE$54 = "root-readme";
3267
+ const RULE$55 = "root-readme";
3268
3268
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
3269
3269
  const READ_CONCURRENCY$26 = 16;
3270
3270
  const START$27 = 0;
@@ -3308,7 +3308,7 @@ const problemsIn$20 = (file, source, plugins) => (workspace) => {
3308
3308
  const message = messageFor$2(workspace.directory);
3309
3309
  const at = positionOf(source);
3310
3310
  const pattern = patternFor(plugins)(workspace);
3311
- return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$54)(file, at(found.index ?? START$27), message)));
3311
+ return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$55)(file, at(found.index ?? START$27), message)));
3312
3312
  };
3313
3313
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
3314
3314
  const text = yield* (yield* RepositoryFiles).readFile(file);
@@ -3345,7 +3345,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
3345
3345
  return Array$1.flatten(found);
3346
3346
  });
3347
3347
  // src/features/check-placement/model/docs-mirror.ts
3348
- const RULE$53 = "docs-mirror";
3348
+ const RULE$54 = "docs-mirror";
3349
3349
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
3350
3350
  const MIRROR_LIMIT = 3;
3351
3351
  const READ_CONCURRENCY$25 = 16;
@@ -3370,7 +3370,7 @@ const problemFor$5 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
3370
3370
  file,
3371
3371
  line,
3372
3372
  column,
3373
- rule: RULE$53,
3373
+ rule: RULE$54,
3374
3374
  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.`
3375
3375
  };
3376
3376
  }), Option.toArray);
@@ -3402,10 +3402,10 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
3402
3402
  return Array$1.flatten(found);
3403
3403
  });
3404
3404
  // src/features/check-placement/model/ignored-sources.ts
3405
- const RULE$52 = "ignored-sources";
3405
+ const RULE$53 = "ignored-sources";
3406
3406
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
3407
3407
  const FIRST$16 = 1;
3408
- const MESSAGE$14 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
3408
+ const MESSAGE$15 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
3409
3409
  /** @internal */
3410
3410
  const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
3411
3411
  const files = yield* RepositoryFiles;
@@ -3414,8 +3414,8 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
3414
3414
  file: files.join(root, file),
3415
3415
  line: FIRST$16,
3416
3416
  column: FIRST$16,
3417
- rule: RULE$52,
3418
- message: MESSAGE$14
3417
+ rule: RULE$53,
3418
+ message: MESSAGE$15
3419
3419
  })));
3420
3420
  });
3421
3421
  // src/features/check-placement/model/public-entries.ts
@@ -12137,13 +12137,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
12137
12137
  return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
12138
12138
  });
12139
12139
  // src/features/check-placement/model/shadcn-ui-alias.ts
12140
- const RULE$51 = "shadcn-ui-alias";
12140
+ const RULE$52 = "shadcn-ui-alias";
12141
12141
  const FIRST$15 = 1;
12142
12142
  const problemOf$10 = (directory, { file, alias }) => ({
12143
12143
  file,
12144
12144
  line: FIRST$15,
12145
12145
  column: FIRST$15,
12146
- rule: RULE$51,
12146
+ rule: RULE$52,
12147
12147
  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/*".`
12148
12148
  });
12149
12149
  /** @internal */
@@ -12419,7 +12419,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
12419
12419
  ])));
12420
12420
  });
12421
12421
  // src/features/check-repository-layout/model/config-paths.ts
12422
- const RULE$50 = "config-path";
12422
+ const RULE$51 = "config-path";
12423
12423
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
12424
12424
  const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
12425
12425
  const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
@@ -12438,7 +12438,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
12438
12438
  const problemOf$9 = (file, source) => (mention) => ({
12439
12439
  file,
12440
12440
  ...positionOf(source)(mention.index),
12441
- rule: RULE$50,
12441
+ rule: RULE$51,
12442
12442
  message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
12443
12443
  });
12444
12444
  const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
@@ -12463,7 +12463,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
12463
12463
  return pipe(patterns, Array$1.map((pattern) => ({
12464
12464
  file,
12465
12465
  ...positionOf(source.value)(indexOfText(source.value)(pattern)),
12466
- rule: RULE$50,
12466
+ rule: RULE$51,
12467
12467
  message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
12468
12468
  })));
12469
12469
  });
@@ -12475,7 +12475,7 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
12475
12475
  return [...Array$1.flatten(found), ...patterns];
12476
12476
  });
12477
12477
  // src/features/check-repository-layout/model/crates.ts
12478
- const RULE$49 = "unverified-crate";
12478
+ const RULE$50 = "unverified-crate";
12479
12479
  const VERSION_RULE = "release-version";
12480
12480
  const APP_DIRECTORIES = ["", "src-tauri"];
12481
12481
  const CARGO_FILE$1 = "Cargo.toml";
@@ -12487,7 +12487,7 @@ const problemFor$4 = (crate, message) => ({
12487
12487
  file: crate.manifest,
12488
12488
  line: FIRST$12,
12489
12489
  column: FIRST$12,
12490
- rule: RULE$49,
12490
+ rule: RULE$50,
12491
12491
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
12492
12492
  });
12493
12493
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -12523,7 +12523,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
12523
12523
  return Array$1.getSomes(Array$1.flatten(found));
12524
12524
  });
12525
12525
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
12526
- const RULE$48 = "deploy-entry-pattern";
12526
+ const RULE$49 = "deploy-entry-pattern";
12527
12527
  const FALLOW_KEYS = [
12528
12528
  "entry",
12529
12529
  "entryPoints",
@@ -12542,7 +12542,7 @@ const ROOT_WORKSPACE = ".";
12542
12542
  const WRAP_OFFSET$1 = 1;
12543
12543
  const NO_OFFSET = 0;
12544
12544
  const READ_CONCURRENCY$20 = 8;
12545
- const MESSAGE$13 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
12545
+ const MESSAGE$14 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
12546
12546
  const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
12547
12547
  const FALLOW = {
12548
12548
  keys: FALLOW_KEYS,
@@ -12594,8 +12594,8 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(request) {
12594
12594
  return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
12595
12595
  file: path,
12596
12596
  ...positionOf(text.value)(start - kind.offset),
12597
- rule: RULE$48,
12598
- message: `${pattern} ${MESSAGE$13}`
12597
+ rule: RULE$49,
12598
+ message: `${pattern} ${MESSAGE$14}`
12599
12599
  })));
12600
12600
  });
12601
12601
  /** @internal */
@@ -12627,7 +12627,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
12627
12627
  return Array$1.flatten(found);
12628
12628
  });
12629
12629
  // src/features/check-repository-layout/model/fallow-entries.ts
12630
- const RULE$47 = "listed-entry";
12630
+ const RULE$48 = "listed-entry";
12631
12631
  const ENTRY_KEYS = [
12632
12632
  "entry",
12633
12633
  "entryPoints",
@@ -12657,7 +12657,7 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
12657
12657
  return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
12658
12658
  file: path,
12659
12659
  ...positionOf(text.value)(start),
12660
- rule: RULE$47,
12660
+ rule: RULE$48,
12661
12661
  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.`
12662
12662
  })));
12663
12663
  });
@@ -12669,7 +12669,7 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
12669
12669
  return Array$1.flatten(found);
12670
12670
  });
12671
12671
  // src/features/check-repository-layout/model/root-workspace-paths.ts
12672
- const RULE$46 = "root-workspace-path";
12672
+ const RULE$47 = "root-workspace-path";
12673
12673
  const CONFIG_FILE$5 = "vite.config.ts";
12674
12674
  const PATH_CHARACTER = /[\w.@/-]/u;
12675
12675
  const NAME_CHARACTER = /[\w.@-]/u;
@@ -12688,7 +12688,7 @@ const mentions = (directory) => (text) => {
12688
12688
  const problemsIn$15 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
12689
12689
  file,
12690
12690
  ...positionOf(source)(found.start),
12691
- rule: RULE$46,
12691
+ rule: RULE$47,
12692
12692
  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.`
12693
12693
  })));
12694
12694
  /** @internal */
@@ -12702,7 +12702,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
12702
12702
  return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$15(file, source.value, directories)));
12703
12703
  });
12704
12704
  // src/features/check-repository-layout/model/hidden-verify.ts
12705
- const RULE$45 = "hidden-verify";
12705
+ const RULE$46 = "hidden-verify";
12706
12706
  const CONFIG_FILE$4 = "vite.config.ts";
12707
12707
  const FIRST$10 = 1;
12708
12708
  const READ_CONCURRENCY$18 = 8;
@@ -12716,7 +12716,7 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
12716
12716
  file,
12717
12717
  line: FIRST$10,
12718
12718
  column: FIRST$10,
12719
- rule: RULE$45,
12719
+ rule: RULE$46,
12720
12720
  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}.`
12721
12721
  }).pipe(Option.filter(() => verified));
12722
12722
  });
@@ -12727,7 +12727,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
12727
12727
  return Array$1.getSomes(found);
12728
12728
  });
12729
12729
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
12730
- const RULE$44 = "shared-uncached-task";
12730
+ const RULE$45 = "shared-uncached-task";
12731
12731
  const READ_CONCURRENCY$17 = 8;
12732
12732
  const SHARED = 2;
12733
12733
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -12770,7 +12770,7 @@ const problemsOf$3 = (definitions) => {
12770
12770
  return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
12771
12771
  file,
12772
12772
  ...position,
12773
- rule: RULE$44,
12773
+ rule: RULE$45,
12774
12774
  message: `The uncached task ${name} (${command}) is written the same way in ${Array$1.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.`
12775
12775
  })));
12776
12776
  };
@@ -12781,7 +12781,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
12781
12781
  return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
12782
12782
  });
12783
12783
  // src/features/check-repository-layout/model/unlocked-tasks.ts
12784
- const RULE$43 = "unlocked-task";
12784
+ const RULE$44 = "unlocked-task";
12785
12785
  const READ_CONCURRENCY$16 = 8;
12786
12786
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
12787
12787
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -12793,7 +12793,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
12793
12793
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
12794
12794
  file,
12795
12795
  ...positionOf(source)(task.start),
12796
- rule: RULE$43,
12796
+ rule: RULE$44,
12797
12797
  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.`
12798
12798
  })), Option.toArray)));
12799
12799
  /** @internal */
@@ -12948,7 +12948,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
12948
12948
  /** @internal */
12949
12949
  const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array$1.flatMap(outputPathsOf));
12950
12950
  // src/features/check-repository-layout/model/workflow-paths.ts
12951
- const RULE$42 = "workflow-path";
12951
+ const RULE$43 = "workflow-path";
12952
12952
  const WORKFLOW_DIRECTORY = ".github/workflows/";
12953
12953
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
12954
12954
  const READ_CONCURRENCY$15 = 8;
@@ -12992,7 +12992,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
12992
12992
  const problemOf$8 = (file, source) => (found) => ({
12993
12993
  file,
12994
12994
  ...positionOf(source)(found.offset),
12995
- rule: RULE$42,
12995
+ rule: RULE$43,
12996
12996
  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.`
12997
12997
  });
12998
12998
  const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
@@ -13394,7 +13394,7 @@ const checkPublishedPackages = Effect.fn("checkPublishedPackages")(function* che
13394
13394
  return Array$1.flatten(found);
13395
13395
  });
13396
13396
  // src/features/check-migration-order/model/migration-order.ts
13397
- const RULE$41 = "migration-order";
13397
+ const RULE$42 = "migration-order";
13398
13398
  const SNAPSHOT = "snapshot.json";
13399
13399
  const MIGRATION = "migration.sql";
13400
13400
  const SNAPSHOTS = [`*/${SNAPSHOT}`];
@@ -13428,7 +13428,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
13428
13428
  file: join(root, file),
13429
13429
  line: FIRST$9,
13430
13430
  column: FIRST$9,
13431
- rule: RULE$41,
13431
+ rule: RULE$42,
13432
13432
  message: `${folder} is new, but it sorts before ${latest.folder}, which ${base} already has. A database that has applied ${latest.folder} rejects an earlier migration, so delete ${folder} and generate it again after ${latest.folder}.`
13433
13433
  })))), Option.getOrElse(() => []));
13434
13434
  /** @internal */
@@ -13572,7 +13572,7 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
13572
13572
  });
13573
13573
  const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
13574
13574
  // src/features/check-tree-shaking/model/optional-peers.ts
13575
- const RULE$40 = "optional-peer";
13575
+ const RULE$41 = "optional-peer";
13576
13576
  const REQUIRED_RULE = "required-peer";
13577
13577
  const START$22 = 0;
13578
13578
  const SINGLE = 1;
@@ -13588,7 +13588,7 @@ const positionIn = (located, key, name) => {
13588
13588
  const problemFor$3 = (located, name, importers) => ({
13589
13589
  file: located.file,
13590
13590
  ...positionIn(located, DEPENDENCIES_KEY, name),
13591
- rule: RULE$40,
13591
+ rule: RULE$41,
13592
13592
  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.`
13593
13593
  });
13594
13594
  const requiredPeerAdvice = (fromStack) => {
@@ -13624,7 +13624,7 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
13624
13624
  }));
13625
13625
  };
13626
13626
  // src/features/check-tree-shaking/model/side-effects.ts
13627
- const RULE$39 = "side-effects";
13627
+ const RULE$40 = "side-effects";
13628
13628
  const BUNDLE_CONCURRENCY$2 = 4;
13629
13629
  const START$21 = 0;
13630
13630
  const FIRST$8 = 1;
@@ -13676,11 +13676,11 @@ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source),
13676
13676
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
13677
13677
  file,
13678
13678
  ...positionOf(source)(keyIndex$1(source)),
13679
- rule: RULE$39,
13679
+ rule: RULE$40,
13680
13680
  message: messageOf$4(worst, excesses.length)
13681
13681
  })), Option.toArray);
13682
13682
  // src/features/check-tree-shaking/model/top-level-effects.ts
13683
- const RULE$38 = "top-level-effect";
13683
+ const RULE$39 = "top-level-effect";
13684
13684
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
13685
13685
  const READ_CONCURRENCY$12 = 16;
13686
13686
  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.";
@@ -13696,7 +13696,7 @@ const messageOf$3 = (statement) => {
13696
13696
  const problemsIn$13 = (api) => (file) => (source) => {
13697
13697
  const retained = api.createSourceFile(file, source);
13698
13698
  const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$7({
13699
- rule: RULE$38,
13699
+ rule: RULE$39,
13700
13700
  message: messageOf$3(statement)
13701
13701
  })(statement)));
13702
13702
  retained.dispose();
@@ -13864,7 +13864,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
13864
13864
  return Array$1.flatten(found);
13865
13865
  });
13866
13866
  // src/features/check-typescript-generation/model/typescript-generation.ts
13867
- const RULE$37 = "legacy-typescript";
13867
+ const RULE$38 = "legacy-typescript";
13868
13868
  const LOCKFILE = "pnpm-lock.yaml";
13869
13869
  const COMPILER = "typescript";
13870
13870
  const CURRENT_MAJOR = 7;
@@ -13895,12 +13895,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
13895
13895
  file,
13896
13896
  line: lineOf$2(source)(legacy.id),
13897
13897
  column: FIRST$7,
13898
- rule: RULE$37,
13898
+ rule: RULE$38,
13899
13899
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
13900
13900
  })));
13901
13901
  });
13902
13902
  // src/features/check-worker-bundles/model/worker-bundles.ts
13903
- const RULE$36 = "worker-bundle";
13903
+ const RULE$37 = "worker-bundle";
13904
13904
  const BUNDLE_CONCURRENCY = 4;
13905
13905
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
13906
13906
  const CONDITIONS = [
@@ -13911,7 +13911,7 @@ const CONDITIONS = [
13911
13911
  "module",
13912
13912
  "default"
13913
13913
  ];
13914
- const problemFor$2 = problemInFile(RULE$36);
13914
+ const problemFor$2 = problemInFile(RULE$37);
13915
13915
  const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
13916
13916
  const bundleProblem = (file) => Effect.gen(function* bundle() {
13917
13917
  const built = yield* Effect.tryPromise({
@@ -14036,7 +14036,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
14036
14036
  imports: importedFilesOf(checker)(sourceFile)
14037
14037
  })), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
14038
14038
  // src/features/check-value-owners/model/name-lists.ts
14039
- const RULE$35 = "hand-written-names";
14039
+ const RULE$36 = "hand-written-names";
14040
14040
  const TEST_FILE = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
14041
14041
  const nameListOf = (site) => {
14042
14042
  if (TEST_FILE.test(site.file) || site.values.length < 2) return Option.none();
@@ -14051,7 +14051,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
14051
14051
  file,
14052
14052
  line,
14053
14053
  column,
14054
- rule: RULE$35,
14054
+ rule: RULE$36,
14055
14055
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
14056
14056
  });
14057
14057
  const problemOf$6 = ({ list, reason }) => listedProblem({
@@ -14847,7 +14847,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
14847
14847
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
14848
14848
  }, Effect.scoped);
14849
14849
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
14850
- const RULE$34 = "namespace-destructuring";
14850
+ const RULE$35 = "namespace-destructuring";
14851
14851
  const LOCAL = /^[.#/]/u;
14852
14852
  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.`;
14853
14853
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
@@ -14863,7 +14863,7 @@ const destructuredName = (declaration) => {
14863
14863
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
14864
14864
  };
14865
14865
  const problemOf$5 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
14866
- rule: RULE$34,
14866
+ rule: RULE$35,
14867
14867
  message: messageOf$1(name)
14868
14868
  })), Option.map((report) => report(declaration)));
14869
14869
  const namespaceDestructuringIn = () => (sourceFile) => {
@@ -14871,7 +14871,7 @@ const namespaceDestructuringIn = () => (sourceFile) => {
14871
14871
  return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$5(names)), Array$1.getSomes);
14872
14872
  };
14873
14873
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
14874
- const RULE$33 = "pass-through-wrapper";
14874
+ const RULE$34 = "pass-through-wrapper";
14875
14875
  const SINGLE_STATEMENT = 1;
14876
14876
  const SINGLE_DECLARATION = 1;
14877
14877
  const THIS_PARAMETER = "this";
@@ -14968,7 +14968,7 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
14968
14968
  const problemOf$4 = (checker) => (candidate) => {
14969
14969
  if (changesTheCall(candidate.wrapper)) return Option.none();
14970
14970
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
14971
- rule: RULE$33,
14971
+ rule: RULE$34,
14972
14972
  message: messageOf(forward.callee.getText())
14973
14973
  })(candidate.name)));
14974
14974
  };
@@ -14994,7 +14994,7 @@ var plugins = [{
14994
14994
  "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."
14995
14995
  }];
14996
14996
  // src/features/check-agent-settings/model/known-plugins.ts
14997
- const RULE$32 = "known-plugins";
14997
+ const RULE$33 = "known-plugins";
14998
14998
  const SETTINGS_FILE$2 = ".claude/settings.json";
14999
14999
  const GITHUB$2 = "github";
15000
15000
  const Source$1 = Schema.Struct({
@@ -15012,7 +15012,7 @@ const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settin
15012
15012
  const REPOSITORY_NAME = "masseater/masseater.dev";
15013
15013
  const MARKETPLACE = name;
15014
15014
  const PLUGINS = pipe(plugins, Array$1.map(({ name }) => `${name}@${MARKETPLACE}`));
15015
- const problem$1 = problemInFile(RULE$32);
15015
+ const problem$1 = problemInFile(RULE$33);
15016
15016
  const fromGithub = ({ source }) => source.source === GITHUB$2 && source.repo === REPOSITORY_NAME;
15017
15017
  const marketplaceKnown = (settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(MARKETPLACE)), Option.exists(fromGithub));
15018
15018
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
@@ -15033,7 +15033,7 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
15033
15033
  return [...marketplaceProblems(file, settings), ...pluginProblems(file, settings)];
15034
15034
  });
15035
15035
  // src/features/check-agent-settings/model/missing-hooks.ts
15036
- const RULE$31 = "missing-hook";
15036
+ const RULE$32 = "missing-hook";
15037
15037
  const SETTINGS_FILE$1 = /^\.claude\/settings\.json$/u;
15038
15038
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
15039
15039
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
@@ -15058,7 +15058,7 @@ const problemsIn$12 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
15058
15058
  return pipe(missing, Array$1.map(({ path, index }) => ({
15059
15059
  file,
15060
15060
  ...positionOf(source)(index),
15061
- rule: RULE$31,
15061
+ rule: RULE$32,
15062
15062
  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.`
15063
15063
  })));
15064
15064
  });
@@ -15111,7 +15111,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
15111
15111
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
15112
15112
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
15113
15113
  // src/features/check-documented-commands/model/commands.ts
15114
- const RULE$30 = "documented-commands";
15114
+ const RULE$31 = "documented-commands";
15115
15115
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
15116
15116
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
15117
15117
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -15189,7 +15189,7 @@ const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph,
15189
15189
  const problemsIn$11 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
15190
15190
  file: absolute(file),
15191
15191
  ...positionOf(text)(match.index ?? START$18),
15192
- rule: RULE$30,
15192
+ rule: RULE$31,
15193
15193
  message: `${match[START$18]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
15194
15194
  })), Option.toArray)));
15195
15195
  const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$4), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
@@ -15214,14 +15214,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
15214
15214
  file: absolute(Array$1.headNonEmpty(commanded).file),
15215
15215
  line: ONE$1,
15216
15216
  column: ONE$1,
15217
- rule: RULE$30,
15217
+ rule: RULE$31,
15218
15218
  message: "msch could not list the tasks with `vp run --json`"
15219
15219
  }],
15220
15220
  onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$11(found, absolute, document)))
15221
15221
  });
15222
15222
  });
15223
15223
  // src/features/check-legacy-web/model/legacy-web.ts
15224
- const RULE$29 = "legacy-web";
15224
+ const RULE$30 = "legacy-web";
15225
15225
  const FIRST_COLUMN$3 = 1;
15226
15226
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
15227
15227
  const Finding = Schema.Struct({
@@ -15260,7 +15260,7 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
15260
15260
  file: files.join(root, file),
15261
15261
  line,
15262
15262
  column: FIRST_COLUMN$3,
15263
- rule: RULE$29,
15263
+ rule: RULE$30,
15264
15264
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
15265
15265
  });
15266
15266
  return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
@@ -15331,8 +15331,8 @@ const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|
15331
15331
  const EXTENSION = /\.[^./]+$/u;
15332
15332
  const SETTINGS_FILE = ".claude/settings.json";
15333
15333
  const READ_CONCURRENCY$10 = 64;
15334
- const RULE$28 = "shell-script";
15335
- const MESSAGE$12 = "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.";
15334
+ const RULE$29 = "shell-script";
15335
+ const MESSAGE$13 = "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.";
15336
15336
  const HookSchema = Schema.Struct({
15337
15337
  command: Schema.optional(Schema.String),
15338
15338
  args: Schema.String.pipe(Schema.Array, Schema.optional)
@@ -15364,7 +15364,7 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
15364
15364
  };
15365
15365
  const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
15366
15366
  const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$10 });
15367
- return pipe(shell, Array$1.map((name) => problemInFile(RULE$28)(files.join(root, name), MESSAGE$12)));
15367
+ return pipe(shell, Array$1.map((name) => problemInFile(RULE$29)(files.join(root, name), MESSAGE$13)));
15368
15368
  });
15369
15369
  // src/shared/lib/workflow-files.ts
15370
15370
  const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
@@ -15399,9 +15399,9 @@ const runScriptsOf = (source) => {
15399
15399
  const COMMAND_CHAIN = /&&|\|\||;|\|/u;
15400
15400
  const QUOTED$1 = /\$\{\{.*?\}\}|"(?:[^"\\]|\\.)*"|'[^']*'/gu;
15401
15401
  const COMMENT = "#";
15402
- const RULE$27 = "workflow-script";
15402
+ const RULE$28 = "workflow-script";
15403
15403
  const ONE_COMMAND = 1;
15404
- const MESSAGE$11 = "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.";
15404
+ const MESSAGE$12 = "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.";
15405
15405
  const isCommand = (line) => String$1.isNonEmpty(line) && !String$1.startsWith(COMMENT)(line);
15406
15406
  const chainsCommands = (line) => COMMAND_CHAIN.test(String$1.replaceAll(QUOTED$1, "")(line));
15407
15407
  const runsMoreThanOneCommand = ({ text }) => {
@@ -15410,7 +15410,7 @@ const runsMoreThanOneCommand = ({ text }) => {
15410
15410
  };
15411
15411
  const problemsIn$10 = (file) => (source) => {
15412
15412
  const at = positionOf(source);
15413
- return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$27)(file, at(start), MESSAGE$11)));
15413
+ return pipe(runScriptsOf(source), Array$1.filter(runsMoreThanOneCommand), Array$1.map(({ start }) => problemAtPosition(RULE$28)(file, at(start), MESSAGE$12)));
15414
15414
  };
15415
15415
  /** @internal */
15416
15416
  const checkWorkflows = Effect.fn("checkWorkflows")(function* checkWorkflows(root) {
@@ -15645,7 +15645,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
15645
15645
  return Array$1.flatten(found);
15646
15646
  });
15647
15647
  // src/features/check-vite-plus/model/package-scripts.ts
15648
- const RULE$26 = "package-script";
15648
+ const RULE$27 = "package-script";
15649
15649
  const LIFECYCLE = [
15650
15650
  "preinstall",
15651
15651
  "install",
@@ -15668,26 +15668,26 @@ const LIFECYCLE = [
15668
15668
  const problemOf$3 = ({ file, position, name }) => ({
15669
15669
  file,
15670
15670
  ...position,
15671
- rule: RULE$26,
15671
+ rule: RULE$27,
15672
15672
  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.`
15673
15673
  });
15674
15674
  const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$3));
15675
15675
  // src/features/check-vite-plus/model/vite-plus-block.ts
15676
- const RULE$25 = "vite-plus-block";
15676
+ const RULE$26 = "vite-plus-block";
15677
15677
  const MARKER = Array$1.join([
15678
15678
  "<!--",
15679
15679
  "VITE PLUS START",
15680
15680
  "-->"
15681
15681
  ], "");
15682
- const MESSAGE$10 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
15682
+ const MESSAGE$11 = "holds the Vite+ block that `vp create --agent` and `vp migrate --agent` write, and every `vp config` rewrites it. Delete the block with its markers. The vite-plus skill reads the same guidance from node_modules/vite-plus/AGENTS.md.";
15683
15683
  const problemIn = (file) => (source) => {
15684
15684
  const index = String$1.indexOf(MARKER)(source);
15685
15685
  if (Option.isNone(index)) return Option.none();
15686
15686
  return Option.some({
15687
15687
  file,
15688
15688
  ...positionOf(source)(index.value),
15689
- rule: RULE$25,
15690
- message: MESSAGE$10
15689
+ rule: RULE$26,
15690
+ message: MESSAGE$11
15691
15691
  });
15692
15692
  };
15693
15693
  /** @internal */
@@ -15729,6 +15729,12 @@ const workflowCheck = ({ rule, message, offsetsOf }) => Effect.fn(rule)(function
15729
15729
  }));
15730
15730
  });
15731
15731
  const scalarKeyOffsets = ({ name, matches }) => (source) => pipe(pairsNamed(name)(source), Array$1.filter(({ value }) => isScalar(value) && matches(String(value.value))), Array$1.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.flatMap((scalar) => Option.fromNullishOr(scalar.range)), Option.map(([start]) => start), Option.toArray)));
15732
+ const triggersOf = (node) => {
15733
+ if (isScalar(node)) return [String(node.value)];
15734
+ if (isSeq(node)) return pipe(node.items, Array$1.filter(isScalar), Array$1.map((item) => String(item.value)));
15735
+ if (isMap(node)) return pipe(node.items, Array$1.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.map((scalar) => String(scalar.value)), Option.toArray)));
15736
+ return [];
15737
+ };
15732
15738
  // src/features/check-workflows/model/full-history-checkout.ts
15733
15739
  const DEPTH_KEY = "fetch-depth";
15734
15740
  const WHOLE_HISTORY = "0";
@@ -15758,39 +15764,33 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
15758
15764
  return pipe(drifts, Array$1.map(problemOf$2));
15759
15765
  });
15760
15766
  // src/features/check-workflows/model/publish-trigger.ts
15761
- const RULE$23 = "publish-trigger";
15767
+ const RULE$24 = "publish-trigger";
15762
15768
  const PUBLISH = /\bmsch-publish\s+(?:plan|npm|release)\b/u;
15763
15769
  const MANUAL = "workflow_dispatch";
15764
- const TRIGGER_KEY = "on";
15765
- const MESSAGE$8 = "publishes with `msch-publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch-publish dispatch`.";
15766
- const triggersOf = (node) => {
15767
- if (isScalar(node)) return [String(node.value)];
15768
- if (isSeq(node)) return pipe(node.items, Array$1.filter(isScalar), Array$1.map((item) => String(item.value)));
15769
- if (isMap(node)) return pipe(node.items, Array$1.flatMap(({ key }) => pipe(Option.liftPredicate(key, isScalar), Option.map((scalar) => String(scalar.value)), Option.toArray)));
15770
- return [];
15771
- };
15770
+ const TRIGGER_KEY$1 = "on";
15771
+ const MESSAGE$9 = "publishes with `msch-publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch-publish dispatch`.";
15772
15772
  const publishTriggerOffsetsOf = (source) => {
15773
15773
  if (!pipe(runScriptsOf(source), Array$1.some(({ text }) => PUBLISH.test(text)))) return [];
15774
15774
  const { contents } = parseDocument(source);
15775
- const triggers = pipe(pairIn(TRIGGER_KEY)(contents), Option.map(({ value }) => triggersOf(value)), Option.getOrElse(() => []));
15775
+ const triggers = pipe(pairIn(TRIGGER_KEY$1)(contents), Option.map(({ value }) => triggersOf(value)), Option.getOrElse(() => []));
15776
15776
  if (pipe(triggers, Array$1.every((trigger) => trigger === MANUAL))) return [];
15777
- return Option.toArray(keyOffsetIn(TRIGGER_KEY)(contents));
15777
+ return Option.toArray(keyOffsetIn(TRIGGER_KEY$1)(contents));
15778
15778
  };
15779
15779
  /** @internal */
15780
15780
  const checkPublishTrigger = workflowCheck({
15781
- rule: RULE$23,
15782
- message: MESSAGE$8,
15781
+ rule: RULE$24,
15782
+ message: MESSAGE$9,
15783
15783
  offsetsOf: publishTriggerOffsetsOf
15784
15784
  });
15785
15785
  // src/features/check-workflows/model/release-please.ts
15786
- const RULE$22 = "release-please";
15786
+ const RULE$23 = "release-please";
15787
15787
  const RELEASE_PLEASE = /^googleapis\/release-please-action(?:@|$)/u;
15788
15788
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
15789
15789
  const FIRST$4 = 1;
15790
- const MESSAGE$7 = "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.";
15790
+ const MESSAGE$8 = "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.";
15791
15791
  const checkReleasePleaseSteps = workflowCheck({
15792
- rule: RULE$22,
15793
- message: MESSAGE$7,
15792
+ rule: RULE$23,
15793
+ message: MESSAGE$8,
15794
15794
  offsetsOf: scalarKeyOffsets({
15795
15795
  name: "uses",
15796
15796
  matches: (value) => RELEASE_PLEASE.test(value)
@@ -15803,8 +15803,8 @@ const checkReleasePleaseFiles = Effect.fn("checkReleasePleaseFiles")(function* c
15803
15803
  file: files.join(root, name),
15804
15804
  line: FIRST$4,
15805
15805
  column: FIRST$4,
15806
- rule: RULE$22,
15807
- message: MESSAGE$7
15806
+ rule: RULE$23,
15807
+ message: MESSAGE$8
15808
15808
  })));
15809
15809
  });
15810
15810
  /** @internal */
@@ -15812,6 +15812,26 @@ const checkReleasePlease = Effect.fn("checkReleasePlease")(function* checkReleas
15812
15812
  const found = yield* Effect.all([checkReleasePleaseSteps(root), checkReleasePleaseFiles(root)], { concurrency: "unbounded" });
15813
15813
  return Array$1.flatten(found);
15814
15814
  });
15815
+ // src/features/check-workflows/model/workflow-cancel.ts
15816
+ const RULE$22 = "workflow-cancel";
15817
+ const PUSH = "push";
15818
+ const TRIGGER_KEY = "on";
15819
+ const CONCURRENCY_KEY$1 = "concurrency";
15820
+ const CANCEL_KEY = "cancel-in-progress";
15821
+ const TRUE = "true";
15822
+ const MESSAGE$7 = "cancels in progress for the whole workflow that a push starts. A newer push then stops a deploy that is running and leaves it half done. Put `cancel-in-progress: true` on the `concurrency` of the jobs that a later push redoes, and leave the deploy and release jobs on the default.";
15823
+ const cancelsOnPush = (contents) => pipe(pairIn(TRIGGER_KEY)(contents), Option.map(({ value }) => triggersOf(value)), Option.exists(Array$1.contains(PUSH)));
15824
+ const cancelOffsetsOf = (source) => {
15825
+ const { contents } = parseDocument(source);
15826
+ if (!cancelsOnPush(contents)) return [];
15827
+ return pipe(pairIn(CONCURRENCY_KEY$1)(contents), Option.flatMap((concurrency) => pipe(pairIn(CANCEL_KEY)(concurrency.value), Option.filter(({ value }) => isScalar(value) && String(value.value) === TRUE), Option.flatMap(() => keyOffsetIn(CANCEL_KEY)(concurrency.value)))), Option.toArray);
15828
+ };
15829
+ /** @internal */
15830
+ const checkWorkflowCancel = workflowCheck({
15831
+ rule: RULE$22,
15832
+ message: MESSAGE$7,
15833
+ offsetsOf: cancelOffsetsOf
15834
+ });
15815
15835
  // src/features/check-workflows/model/workflow-queue.ts
15816
15836
  const CONCURRENCY_KEY = "concurrency";
15817
15837
  const QUEUE_KEY = "queue";
@@ -15855,6 +15875,7 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
15855
15875
  checkKnownPlugins(root),
15856
15876
  checkScripts(root),
15857
15877
  checkWorkflowQueues(root),
15878
+ checkWorkflowCancel(root),
15858
15879
  checkWorkflowCommits(root),
15859
15880
  checkCiDrift(root),
15860
15881
  checkFullHistoryCheckout(root),