@r_masseater/msch 0.95.0 → 0.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/{base-revision-uiUwYlbc.mjs → base-revision-Bl-4nxAd.mjs} +2 -2
  2. package/dist/{base-revision-uiUwYlbc.mjs.map → base-revision-Bl-4nxAd.mjs.map} +1 -1
  3. package/dist/cargo-inputs.mjs +2 -2
  4. package/dist/changed.mjs +5 -5
  5. package/dist/cli.mjs +380 -191
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/config-BBdsNPSO.mjs.map +1 -1
  8. package/dist/config.d.mts +19 -16
  9. package/dist/config.mjs +23 -161
  10. package/dist/config.mjs.map +1 -1
  11. package/dist/decision-rules.d.mts +1 -1
  12. package/dist/decision-rules.mjs +1 -1
  13. package/dist/{define-lint-preset-BjHY5WNt.mjs → define-lint-preset-B-hC9_df.mjs} +60 -45
  14. package/dist/define-lint-preset-B-hC9_df.mjs.map +1 -0
  15. package/dist/exits.mjs +4 -4
  16. package/dist/{ignored-directories-BRRODOoG.mjs → ignored-directories-D-7Rm_2X.mjs} +2 -2
  17. package/dist/{ignored-directories-BRRODOoG.mjs.map → ignored-directories-D-7Rm_2X.mjs.map} +1 -1
  18. package/dist/{index-Bw2kfEek.d.mts → index-CEazCJ_w.d.mts} +38 -11
  19. package/dist/{index-CMyIrsah.d.mts → index-Dm0Gg9wS.d.mts} +2 -2
  20. package/dist/judge.mjs +4 -4
  21. package/dist/lint-rules.mjs +23 -11
  22. package/dist/lint-rules.mjs.map +1 -1
  23. package/dist/lint.d.mts +2 -2
  24. package/dist/lint.mjs +1 -1
  25. package/dist/{lookup-report-BWiDFlSS.mjs → lookup-report-L5OLXRMf.mjs} +3 -3
  26. package/dist/{lookup-report-BWiDFlSS.mjs.map → lookup-report-L5OLXRMf.mjs.map} +1 -1
  27. package/dist/{manifest-texts-Bhlz2Z2_.mjs → manifest-texts-DPgsV8kj.mjs} +2 -2
  28. package/dist/{manifest-texts-Bhlz2Z2_.mjs.map → manifest-texts-DPgsV8kj.mjs.map} +1 -1
  29. package/dist/{output-B4GNchqH.mjs → output-DAvdel9H.mjs} +3 -3
  30. package/dist/{output-B4GNchqH.mjs.map → output-DAvdel9H.mjs.map} +1 -1
  31. package/dist/oxlint.mjs +2 -2
  32. package/dist/{package-routes-BdYpOLTv.mjs → package-routes-BQWX5ttU.mjs} +2 -2
  33. package/dist/{package-routes-BdYpOLTv.mjs.map → package-routes-BQWX5ttU.mjs.map} +1 -1
  34. package/dist/{package-versions-BLtKon6D.mjs → package-versions-sx15IGwA.mjs} +4 -4
  35. package/dist/{package-versions-BLtKon6D.mjs.map → package-versions-sx15IGwA.mjs.map} +1 -1
  36. package/dist/{pass-records-ljpQ--tm.mjs → pass-records-BcAAWgiQ.mjs} +4 -4
  37. package/dist/{pass-records-ljpQ--tm.mjs.map → pass-records-BcAAWgiQ.mjs.map} +1 -1
  38. package/dist/{problem-Bi4Kgg9b.mjs → problem-DbuTeNvL.mjs} +2 -2
  39. package/dist/{problem-Bi4Kgg9b.mjs.map → problem-DbuTeNvL.mjs.map} +1 -1
  40. package/dist/publish.mjs +1 -1
  41. package/dist/{published-BGur-Htr.mjs → published-3eokcs_D.mjs} +17 -3
  42. package/dist/published-3eokcs_D.mjs.map +1 -0
  43. package/dist/published.mjs +6 -6
  44. package/dist/refs.mjs +4 -5
  45. package/dist/refs.mjs.map +1 -1
  46. package/dist/{registry-releases-CaO-8xAO.mjs → registry-releases-BBtz4wGE.mjs} +2 -2
  47. package/dist/{registry-releases-CaO-8xAO.mjs.map → registry-releases-BBtz4wGE.mjs.map} +1 -1
  48. package/dist/{repository-files-hbJpQ1i0.mjs → repository-files-DSwKJnrj.mjs} +5 -4
  49. package/dist/repository-files-DSwKJnrj.mjs.map +1 -0
  50. package/dist/repository-text-DGfYd5Wq.mjs +178 -0
  51. package/dist/repository-text-DGfYd5Wq.mjs.map +1 -0
  52. package/dist/{runtime-BdEuIL6Z.mjs → runtime-Djm7zMwu.mjs} +2 -2
  53. package/dist/{runtime-BdEuIL6Z.mjs.map → runtime-Djm7zMwu.mjs.map} +1 -1
  54. package/dist/unbumped.mjs +5 -5
  55. package/dist/{upstream-exits-BC8ofnVa.mjs → upstream-exits-4bn4gblF.mjs} +5 -6
  56. package/dist/{upstream-exits-BC8ofnVa.mjs.map → upstream-exits-4bn4gblF.mjs.map} +1 -1
  57. package/dist/{upstream-record-I5ZgAwk-.mjs → upstream-record-DRNGym9S.mjs} +2 -3
  58. package/dist/{upstream-record-I5ZgAwk-.mjs.map → upstream-record-DRNGym9S.mjs.map} +1 -1
  59. package/dist/upstream.mjs +6 -6
  60. package/dist/{workspace-projects-DnWDM8G1.mjs → workspace-projects-MpL8K7Nz.mjs} +2 -2
  61. package/dist/{workspace-projects-DnWDM8G1.mjs.map → workspace-projects-MpL8K7Nz.mjs.map} +1 -1
  62. package/dist/workspace-settings.d.mts +1 -1
  63. package/dist/workspace-settings.mjs +50 -31
  64. package/dist/workspace-settings.mjs.map +1 -1
  65. package/package.json +8 -8
  66. package/skills/msch-repository-config/SKILL.md +19 -8
  67. package/skills/msch-workspace-settings/SKILL.md +8 -10
  68. package/src/app/vite.d.ts +3 -3
  69. package/dist/collections-CdEHfcEj.mjs +0 -6
  70. package/dist/collections-CdEHfcEj.mjs.map +0 -1
  71. package/dist/define-lint-preset-BjHY5WNt.mjs.map +0 -1
  72. package/dist/index-skill-Bf5Ish11.mjs +0 -19
  73. package/dist/index-skill-Bf5Ish11.mjs.map +0 -1
  74. package/dist/published-BGur-Htr.mjs.map +0 -1
  75. package/dist/repository-files-hbJpQ1i0.mjs.map +0 -1
package/dist/cli.mjs CHANGED
@@ -1,29 +1,29 @@
1
1
  #!/usr/bin/env node
2
- import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-ljpQ--tm.mjs";
3
- import { n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, t as MSCH_CACHE } from "./repository-files-hbJpQ1i0.mjs";
2
+ import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-BcAAWgiQ.mjs";
3
+ import { n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-DSwKJnrj.mjs";
4
4
  import { t as workspaceManifest } from "./workspace-manifest-BAVyPzbA.mjs";
5
- import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, 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-BC8ofnVa.mjs";
5
+ import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, 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-4bn4gblF.mjs";
6
6
  import { a as parent, i as join, n as isInside, t as baseName } from "./path-DUttmo2s.mjs";
7
- import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-DnWDM8G1.mjs";
8
- import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-Bi4Kgg9b.mjs";
9
- import { A as childrenOf$2, F as stringsIn, M as literalOf, N as nestedValues, O as workspaceConfigOf, P as propertyValue, _ as RUN_TASKS, a as workspaceConfigs, b as hasVerifyTask, c as publicEntriesOf, d as bundledEntries, f as deployEntries, i as publishedWorkspaces, j as keyName, k as KeySchema, m as shadcnUiOf, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as workspaceLinks, v as VERIFY_TASK, y as definesTask } from "./published-BGur-Htr.mjs";
7
+ import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-MpL8K7Nz.mjs";
8
+ import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-DbuTeNvL.mjs";
9
+ import { C as hasVerifyTask, F as literalOf, I as nestedValues, L as propertyValue, M as KeySchema, N as childrenOf$2, P as keyName, R as stringsIn, S as definesTask, _ as shadcnUiOf, a as workspaceConfigs, b as RUN_TASKS, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, j as workspaceConfigOf, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as VERIFY_TASK } from "./published-3eokcs_D.mjs";
10
10
  import { r as JAPANESE } from "./config-BBdsNPSO.mjs";
11
- import { d as RENOVATE_PRESET, f as SELF_NAME } from "./package-routes-BdYpOLTv.mjs";
11
+ import { d as RENOVATE_PRESET, f as SELF_NAME } from "./package-routes-BQWX5ttU.mjs";
12
12
  import { n as readTree, t as loadLanguage } from "./tree-sitter-BfzHNwTR.mjs";
13
- import { t as groupOf } from "./collections-CdEHfcEj.mjs";
14
- import { n as baseRevision, t as baseName$1 } from "./base-revision-uiUwYlbc.mjs";
15
- import { a as presentFiles, i as listedFiles, n as isScannedText, o as scanText, r as isToolVersions, t as upstreamRecords } from "./upstream-record-I5ZgAwk-.mjs";
13
+ import { n as baseRevision, t as baseName$1 } from "./base-revision-Bl-4nxAd.mjs";
14
+ import { S as exempt, f as lint$3, h as decisionTestRules, n as MARKDOWN_RULES, t as MARKDOWN_IGNORES } from "./define-lint-preset-B-hC9_df.mjs";
15
+ import { a as MSCH_TASK_COMMANDS, n as builtTextRuleNames, r as secretsOf, t as TEXT_IGNORES } from "./repository-text-DGfYd5Wq.mjs";
16
+ import { a as presentFiles, i as listedFiles, n as isScannedText, o as scanText, r as isToolVersions, t as upstreamRecords } from "./upstream-record-DRNGym9S.mjs";
16
17
  import { a as offsetIn$1, i as namedCatalogsOf, n as manifestPattern, o as quoted$1, r as manifestSpecifiers, s as specifiedIn, t as fieldsOf } from "./specifiers-BrCyPubD.mjs";
17
18
  import { i as withTrailingSlash, n as PUBLIC_REGISTRY, r as scopeOfName, t as INSTALL_REGISTRY } from "./registries-DePiYd3D.mjs";
18
- import { n as FRONTMATTER, r as splitFrontmatter, t as isIndexSkill } from "./index-skill-Bf5Ish11.mjs";
19
- import { t as checkPackageVersions } from "./package-versions-BLtKon6D.mjs";
20
- import { t as manifestTexts } from "./manifest-texts-Bhlz2Z2_.mjs";
21
- import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-B4GNchqH.mjs";
22
- import { t as runCli } from "./runtime-BdEuIL6Z.mjs";
19
+ import { t as checkPackageVersions } from "./package-versions-sx15IGwA.mjs";
20
+ import { t as manifestTexts } from "./manifest-texts-DPgsV8kj.mjs";
21
+ import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-DAvdel9H.mjs";
22
+ import { t as runCli } from "./runtime-Djm7zMwu.mjs";
23
23
  import "./cli-contract-D7btWrEu.mjs";
24
24
  import { builtinModules, isBuiltin } from "node:module";
25
25
  import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
26
- import { Array as Array$1, Boolean as Boolean$1, Context, Effect, FileSystem, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
26
+ import { Array as Array$1, Boolean as Boolean$1, Context, Effect, Equal, FileSystem, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
27
27
  import { lockedGraph, lockedPackageIds, parseDependencyPath, updateWorkspaceManifest } from "@r_masseater/masseater-utils/kestrion/pnpm";
28
28
  import { ChildProcess } from "effect/process";
29
29
  import { PACKAGE_JSON_FILE, RUNTIME_SECTIONS, binEntriesOf, namesIn, optionalPeerNames, runtimeDependencyNames, targetsIn } from "@r_masseater/masseater-utils/kestrion";
@@ -480,8 +480,8 @@ const RESOLUTION_FILES = [
480
480
  ];
481
481
  const RESOLUTION_CONCURRENCY = 2;
482
482
  const SUCCEEDED$1 = 0;
483
- const taggedError$7 = Schema.TaggedError;
484
- var OverrideResolutionFailed = class extends taggedError$7()("OverrideResolutionFailed", {
483
+ const taggedError$8 = Schema.TaggedError;
484
+ var OverrideResolutionFailed = class extends taggedError$8()("OverrideResolutionFailed", {
485
485
  override: Schema.String,
486
486
  output: Schema.String
487
487
  }) {};
@@ -598,12 +598,12 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
598
598
  // src/features/check-overrides/model/git-subpath.ts
599
599
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
600
600
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
601
- const RULE$78 = "git-subpath-dependency";
601
+ const RULE$79 = "git-subpath-dependency";
602
602
  const WHOLE_MATCH$4 = 0;
603
603
  const problemAt$6 = ({ file }, source) => (found) => ({
604
604
  file,
605
605
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
606
- rule: RULE$78,
606
+ rule: RULE$79,
607
607
  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])}\`.`
608
608
  });
609
609
  const problemsIn$25 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$6(entry, source)));
@@ -614,13 +614,13 @@ const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(r
614
614
  return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$25);
615
615
  });
616
616
  // src/features/check-overrides/model/restricted-rules.ts
617
- const RULE$77 = "unnamed-restriction";
617
+ const RULE$78 = "unnamed-restriction";
618
618
  const WHOLE_MATCH$3 = 0;
619
619
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-(?:imports|properties)\\b`, "gu");
620
620
  const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
621
621
  file: entry.file,
622
622
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
623
- rule: RULE$77,
623
+ rule: RULE$78,
624
624
  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.`
625
625
  })));
626
626
  /** @internal */
@@ -629,13 +629,13 @@ const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRe
629
629
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$24);
630
630
  });
631
631
  // src/features/check-overrides/model/type-exemptions.ts
632
- const RULE$76 = "named-type-exemption";
632
+ const RULE$77 = "named-type-exemption";
633
633
  const WHOLE_MATCH$2 = 0;
634
634
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
635
635
  const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
636
636
  file: entry.file,
637
637
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
638
- rule: RULE$76,
638
+ rule: RULE$77,
639
639
  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."
640
640
  })));
641
641
  /** @internal */
@@ -644,21 +644,21 @@ const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkType
644
644
  return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
645
645
  });
646
646
  // src/features/check-overrides/model/package-registry.ts
647
- const RULE$75 = "package-registry";
647
+ const RULE$76 = "package-registry";
648
648
  const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
649
649
  const NPMRC = /(?:^|\/)\.npmrc$/u;
650
650
  const WORKSPACE_REGISTRY = /^registry:/mu;
651
651
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
652
- const START$30 = 0;
652
+ const START$31 = 0;
653
653
  const REASON$1 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
654
654
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
655
655
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
656
656
  const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
657
- const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$30));
657
+ const offsetIn = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$31));
658
658
  const workspaceProblem = ({ file, source }, registry) => ({
659
659
  file,
660
660
  ...positionOf(source)(offsetIn(WORKSPACE_REGISTRY.exec(source))),
661
- rule: RULE$75,
661
+ rule: RULE$76,
662
662
  message: Option.match(registry, {
663
663
  onNone: () => `${REASON$1} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
664
664
  onSome: (value) => `${REASON$1} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
@@ -666,9 +666,9 @@ const workspaceProblem = ({ file, source }, registry) => ({
666
666
  });
667
667
  const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired)), Array$1.map((found) => ({
668
668
  file: entry.file,
669
- ...positionOf(source)(found.index ?? START$30),
670
- rule: RULE$75,
671
- message: `${REASON$1} This .npmrc overrides it with \`${String$1.trim(found[START$30])}\`. Remove the line.`
669
+ ...positionOf(source)(found.index ?? START$31),
670
+ rule: RULE$76,
671
+ message: `${REASON$1} This .npmrc overrides it with \`${String$1.trim(found[START$31])}\`. Remove the line.`
672
672
  })));
673
673
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
674
674
  const files = yield* RepositoryFiles;
@@ -2817,7 +2817,7 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
2817
2817
  })), Option.getOrElse(() => [])));
2818
2818
  });
2819
2819
  // src/features/check-overrides/model/removed-peers.ts
2820
- const RULE$74 = "removed-peer";
2820
+ const RULE$75 = "removed-peer";
2821
2821
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
2822
2822
  const REMOVED = "-";
2823
2823
  const PARENT_SEPARATOR = ">";
@@ -2844,7 +2844,7 @@ const problemAt$5 = (file, { key, line, column }) => ({ peer, dependent }) => ({
2844
2844
  file,
2845
2845
  line,
2846
2846
  column,
2847
- rule: RULE$74,
2847
+ rule: RULE$75,
2848
2848
  message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
2849
2849
  });
2850
2850
  const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
@@ -2878,7 +2878,7 @@ const checkRemovedPeers = Effect.fn("checkRemovedPeers")(function* checkRemovedP
2878
2878
  });
2879
2879
  });
2880
2880
  // src/features/check-placement/model/colocated-git-patterns.ts
2881
- const RULE$73 = "colocated-git-patterns";
2881
+ const RULE$74 = "colocated-git-patterns";
2882
2882
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
2883
2883
  const ROOT$3 = ".";
2884
2884
  const NEGATION$1 = "!";
@@ -2925,7 +2925,7 @@ const entriesIn$1 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
2925
2925
  const toEntry = entryOf$1(absolute, files.basename(file), files.dirname(file));
2926
2926
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
2927
2927
  });
2928
- const patternProblem = (entry, message) => problemAtPosition(RULE$73)(entry.file, {
2928
+ const patternProblem = (entry, message) => problemAtPosition(RULE$74)(entry.file, {
2929
2929
  line: entry.line,
2930
2930
  column: FIRST$25
2931
2931
  }, message);
@@ -2988,7 +2988,7 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
2988
2988
  return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
2989
2989
  });
2990
2990
  // src/features/check-placement/model/colocated-tests.ts
2991
- const RULE$72 = "colocated-test";
2991
+ const RULE$73 = "colocated-test";
2992
2992
  const FIRST$24 = 1;
2993
2993
  const READ_CONCURRENCY$32 = 64;
2994
2994
  const ROOT_SUBPATH$1 = ".";
@@ -3011,7 +3011,7 @@ const problemFor$10 = (test, message) => ({
3011
3011
  file: test.file,
3012
3012
  line: FIRST$24,
3013
3013
  column: FIRST$24,
3014
- rule: RULE$72,
3014
+ rule: RULE$73,
3015
3015
  message: `${test.base} ${message}`
3016
3016
  });
3017
3017
  const groupsOf$2 = (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);
@@ -3094,7 +3094,7 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
3094
3094
  // src/features/check-placement/model/agent-docs-length.ts
3095
3095
  const RECOMMENDED_LINES = 200;
3096
3096
  const FIRST$23 = 1;
3097
- const RULE$71 = "agent-docs-length";
3097
+ const RULE$72 = "agent-docs-length";
3098
3098
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
3099
3099
  const problemFor$9 = (file) => (lines) => {
3100
3100
  if (lines <= RECOMMENDED_LINES) return Option.none();
@@ -3102,14 +3102,14 @@ const problemFor$9 = (file) => (lines) => {
3102
3102
  file,
3103
3103
  line: 201,
3104
3104
  column: FIRST$23,
3105
- rule: RULE$71,
3105
+ rule: RULE$72,
3106
3106
  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.`
3107
3107
  });
3108
3108
  };
3109
3109
  /** @internal */
3110
3110
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
3111
3111
  // src/features/check-placement/model/claude-link.ts
3112
- const RULE$70 = "claude-md-link";
3112
+ const RULE$71 = "claude-md-link";
3113
3113
  const CLAUDE = "CLAUDE.md";
3114
3114
  const AGENTS = "AGENTS.md";
3115
3115
  const FIRST$22 = 1;
@@ -3128,7 +3128,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3128
3128
  file: path,
3129
3129
  line: FIRST$22,
3130
3130
  column: FIRST$22,
3131
- rule: RULE$70,
3131
+ rule: RULE$71,
3132
3132
  message: MESSAGE$19
3133
3133
  })));
3134
3134
  });
@@ -3137,7 +3137,7 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3137
3137
  return Array$1.getSomes(found);
3138
3138
  });
3139
3139
  // src/features/check-placement/model/dangling-links.ts
3140
- const RULE$69 = "dangling-link";
3140
+ const RULE$70 = "dangling-link";
3141
3141
  const SEPARATOR$23 = "/";
3142
3142
  const FIRST$21 = 1;
3143
3143
  const READ_CONCURRENCY$29 = 16;
@@ -3153,7 +3153,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3153
3153
  file,
3154
3154
  line: FIRST$21,
3155
3155
  column: FIRST$21,
3156
- rule: RULE$69,
3156
+ rule: RULE$70,
3157
3157
  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.`
3158
3158
  })));
3159
3159
  });
@@ -3211,7 +3211,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
3211
3211
  }));
3212
3212
  });
3213
3213
  // src/features/check-placement/model/deployed-readme.ts
3214
- const RULE$68 = "deployed-readme";
3214
+ const RULE$69 = "deployed-readme";
3215
3215
  const ROOT_DIRECTORY$4 = "";
3216
3216
  const READ_CONCURRENCY$28 = 16;
3217
3217
  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.";
@@ -3251,14 +3251,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
3251
3251
  const readme = yield* readReadme({
3252
3252
  root,
3253
3253
  directory,
3254
- rule: RULE$68,
3254
+ rule: RULE$69,
3255
3255
  missingMessage: MISSING_MESSAGE$2
3256
3256
  });
3257
3257
  return Result.match(readme, {
3258
3258
  onFailure: Option.some,
3259
3259
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
3260
3260
  file,
3261
- rule: RULE$68,
3261
+ rule: RULE$69,
3262
3262
  message: NO_URL_MESSAGE
3263
3263
  })))
3264
3264
  });
@@ -3275,8 +3275,8 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
3275
3275
  return Array$1.getSomes(found);
3276
3276
  });
3277
3277
  // src/features/check-placement/model/nested-docs.ts
3278
- const RULE$67 = "nested-docs";
3279
- const CONFIG_FILE$8 = "vite.config.ts";
3278
+ const RULE$68 = "nested-docs";
3279
+ const CONFIG_FILE$9 = "vite.config.ts";
3280
3280
  const SEPARATOR$21 = "/";
3281
3281
  const READ_CONCURRENCY$27 = 64;
3282
3282
  const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
@@ -3285,10 +3285,10 @@ const README = /^README(?:\.[^/]+)?$/iu;
3285
3285
  const MANIFEST$2 = "package.json";
3286
3286
  const MISSING_RULE = "workspace-agents-md";
3287
3287
  const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
3288
- const taggedError$6 = Schema.TaggedError;
3289
- var RootConfigUnreadable = class extends taggedError$6()("RootConfigUnreadable", { file: Schema.String }) {};
3288
+ const taggedError$7 = Schema.TaggedError;
3289
+ var RootConfigUnreadable = class extends taggedError$7()("RootConfigUnreadable", { file: Schema.String }) {};
3290
3290
  const isNested = (name) => String$1.includes(SEPARATOR$21)(name);
3291
- const problemFor$8 = problemInFile(RULE$67);
3291
+ const problemFor$8 = problemInFile(RULE$68);
3292
3292
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
3293
3293
  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.";
3294
3294
  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.";
@@ -3316,7 +3316,7 @@ const problemIn$6 = Effect.fn("problemIn")(function* problemIn(root, allowed, na
3316
3316
  });
3317
3317
  const allowsWorkspaceAgentDocs = Effect.fn("allowsWorkspaceAgentDocs")(function* allowsWorkspaceAgentDocs(root) {
3318
3318
  const files = yield* RepositoryFiles;
3319
- const file = files.join(root, CONFIG_FILE$8);
3319
+ const file = files.join(root, CONFIG_FILE$9);
3320
3320
  if (!(yield* files.exists(file))) return false;
3321
3321
  const config = yield* Effect.tryPromise({
3322
3322
  try: () => resolveConfigFromFile(file),
@@ -3345,7 +3345,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
3345
3345
  return [...Array$1.getSomes(found), ...missing];
3346
3346
  });
3347
3347
  // src/features/check-placement/model/published-readme.ts
3348
- const RULE$66 = "published-readme";
3348
+ const RULE$67 = "published-readme";
3349
3349
  const READ_CONCURRENCY$26 = 16;
3350
3350
  const MESSAGE$18 = "contains Japanese. This package is published to npm, so write its README in English.";
3351
3351
  const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
@@ -3353,7 +3353,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3353
3353
  const readme = yield* readReadme({
3354
3354
  root,
3355
3355
  directory,
3356
- rule: RULE$66,
3356
+ rule: RULE$67,
3357
3357
  missingMessage: MISSING_MESSAGE
3358
3358
  });
3359
3359
  return Result.match(readme, {
@@ -3364,7 +3364,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3364
3364
  file,
3365
3365
  line,
3366
3366
  column,
3367
- rule: RULE$66,
3367
+ rule: RULE$67,
3368
3368
  message: MESSAGE$18
3369
3369
  };
3370
3370
  }))
@@ -3377,7 +3377,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
3377
3377
  return Array$1.getSomes(found);
3378
3378
  });
3379
3379
  // src/features/check-placement/model/published-tests.ts
3380
- const RULE$65 = "published-tests";
3380
+ const RULE$66 = "published-tests";
3381
3381
  const FILE_START = 1;
3382
3382
  const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
3383
3383
  const MESSAGE$17 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
@@ -3391,7 +3391,7 @@ const problemFor$7 = Effect.fn("problemFor")(function* problemFor(root, listed,
3391
3391
  file: files.join(absolute, PACKAGE_JSON_FILE),
3392
3392
  line: FILE_START,
3393
3393
  column: FILE_START,
3394
- rule: RULE$65,
3394
+ rule: RULE$66,
3395
3395
  message: MESSAGE$17
3396
3396
  });
3397
3397
  });
@@ -3405,7 +3405,7 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
3405
3405
  return Array$1.getSomes(found);
3406
3406
  });
3407
3407
  // src/features/check-placement/model/root-docs.ts
3408
- const RULE$64 = "root-docs";
3408
+ const RULE$65 = "root-docs";
3409
3409
  const SEPARATOR$20 = "/";
3410
3410
  const FIRST$19 = 1;
3411
3411
  const MARKDOWN$5 = /\.(?:md|mdx|markdown)$/iu;
@@ -3420,15 +3420,15 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3420
3420
  file: files.join(root, name),
3421
3421
  line: FIRST$19,
3422
3422
  column: FIRST$19,
3423
- rule: RULE$64,
3423
+ rule: RULE$65,
3424
3424
  message: `${name} ${MESSAGE$16}`
3425
3425
  })));
3426
3426
  });
3427
3427
  // src/features/check-placement/model/root-readme.ts
3428
- const RULE$63 = "root-readme";
3428
+ const RULE$64 = "root-readme";
3429
3429
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
3430
3430
  const READ_CONCURRENCY$25 = 16;
3431
- const START$29 = 0;
3431
+ const START$30 = 0;
3432
3432
  const MARKETPLACE = ".claude-plugin/marketplace.json";
3433
3433
  const RELATIVE$2 = /^\.\//u;
3434
3434
  const MarketplacePlugin = Schema.Struct({
@@ -3468,7 +3468,7 @@ const problemsIn$22 = (file, source, plugins) => (workspace) => {
3468
3468
  const message = messageFor$3(workspace.directory);
3469
3469
  const at = positionOf(source);
3470
3470
  const pattern = patternFor(plugins)(workspace);
3471
- return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$63)(file, at(found.index ?? START$29), message)));
3471
+ return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$64)(file, at(found.index ?? START$30), message)));
3472
3472
  };
3473
3473
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
3474
3474
  const text = yield* (yield* RepositoryFiles).readFile(file);
@@ -3505,7 +3505,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
3505
3505
  return Array$1.flatten(found);
3506
3506
  });
3507
3507
  // src/features/check-placement/model/docs-mirror.ts
3508
- const RULE$62 = "docs-mirror";
3508
+ const RULE$63 = "docs-mirror";
3509
3509
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
3510
3510
  const MIRROR_LIMIT = 3;
3511
3511
  const READ_CONCURRENCY$24 = 16;
@@ -3530,7 +3530,7 @@ const problemFor$6 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
3530
3530
  file,
3531
3531
  line,
3532
3532
  column,
3533
- rule: RULE$62,
3533
+ rule: RULE$63,
3534
3534
  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.`
3535
3535
  };
3536
3536
  }), Option.toArray);
@@ -3562,7 +3562,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
3562
3562
  return Array$1.flatten(found);
3563
3563
  });
3564
3564
  // src/features/check-placement/model/ignored-sources.ts
3565
- const RULE$61 = "ignored-sources";
3565
+ const RULE$62 = "ignored-sources";
3566
3566
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
3567
3567
  const FIRST$18 = 1;
3568
3568
  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.";
@@ -3574,7 +3574,7 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
3574
3574
  file: files.join(root, file),
3575
3575
  line: FIRST$18,
3576
3576
  column: FIRST$18,
3577
- rule: RULE$61,
3577
+ rule: RULE$62,
3578
3578
  message: MESSAGE$15
3579
3579
  })));
3580
3580
  });
@@ -12297,13 +12297,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
12297
12297
  return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
12298
12298
  });
12299
12299
  // src/features/check-placement/model/shadcn-ui-alias.ts
12300
- const RULE$60 = "shadcn-ui-alias";
12300
+ const RULE$61 = "shadcn-ui-alias";
12301
12301
  const FIRST$17 = 1;
12302
12302
  const problemOf$10 = (directory, { file, alias }) => ({
12303
12303
  file,
12304
12304
  line: FIRST$17,
12305
12305
  column: FIRST$17,
12306
- rule: RULE$60,
12306
+ rule: RULE$61,
12307
12307
  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/*".`
12308
12308
  });
12309
12309
  /** @internal */
@@ -12482,14 +12482,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
12482
12482
  ];
12483
12483
  });
12484
12484
  // src/features/check-repository-layout/model/path-mention.ts
12485
- const START$28 = 0;
12485
+ const START$29 = 0;
12486
12486
  const QUOTES = ["\"", "'"];
12487
12487
  const firstIndex = (source, needles) => {
12488
12488
  const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
12489
12489
  return Array$1.head(Array$1.sort(found, Order.Number));
12490
12490
  };
12491
12491
  const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
12492
- const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$28));
12492
+ const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$29));
12493
12493
  // src/features/check-repository-layout/model/cargo-paths.ts
12494
12494
  const MEMBER_LISTS = [
12495
12495
  "members",
@@ -12505,14 +12505,14 @@ const WORKSPACE = "workspace";
12505
12505
  const PATCH = "patch";
12506
12506
  const PATCH_DEPTH = 2;
12507
12507
  const WORKSPACE_DEPTH = 1;
12508
- const START$27 = 0;
12508
+ const START$28 = 0;
12509
12509
  const WILDCARD$4 = /[*?[]/u;
12510
12510
  const KEY_SEPARATOR = ".";
12511
12511
  const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
12512
12512
  const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
12513
12513
  const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
12514
- const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$27).pipe(Option.exists((name) => name === PATCH));
12515
- const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$27).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
12514
+ const declaresPath = (trail) => pipe(Array$1.last(trail), Option.exists((name) => Array$1.contains(DEPENDENCY_TABLES, name))) || trail.length === PATCH_DEPTH && Array$1.get(trail, START$28).pipe(Option.exists((name) => name === PATCH));
12515
+ const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$28).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
12516
12516
  const namedPaths = (trail, key, value) => {
12517
12517
  const field = Array$1.join([...trail, key], KEY_SEPARATOR);
12518
12518
  if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
@@ -12599,7 +12599,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
12599
12599
  ])));
12600
12600
  });
12601
12601
  // src/features/check-repository-layout/model/config-paths.ts
12602
- const RULE$59 = "config-path";
12602
+ const RULE$60 = "config-path";
12603
12603
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
12604
12604
  const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
12605
12605
  const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
@@ -12618,7 +12618,7 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
12618
12618
  const problemOf$9 = (file, source) => (mention) => ({
12619
12619
  file,
12620
12620
  ...positionOf(source)(mention.index),
12621
- rule: RULE$59,
12621
+ rule: RULE$60,
12622
12622
  message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
12623
12623
  });
12624
12624
  const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
@@ -12643,7 +12643,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
12643
12643
  return pipe(patterns, Array$1.map((pattern) => ({
12644
12644
  file,
12645
12645
  ...positionOf(source.value)(indexOfText(source.value)(pattern)),
12646
- rule: RULE$59,
12646
+ rule: RULE$60,
12647
12647
  message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
12648
12648
  })));
12649
12649
  });
@@ -12655,11 +12655,11 @@ const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPath
12655
12655
  return [...Array$1.flatten(found), ...patterns];
12656
12656
  });
12657
12657
  // src/features/check-repository-layout/model/crates.ts
12658
- const RULE$58 = "unverified-crate";
12658
+ const RULE$59 = "unverified-crate";
12659
12659
  const VERSION_RULE = "release-version";
12660
12660
  const APP_DIRECTORIES = ["", "src-tauri"];
12661
12661
  const CARGO_FILE$1 = "Cargo.toml";
12662
- const CONFIG_FILE$7 = "vite.config.ts";
12662
+ const CONFIG_FILE$8 = "vite.config.ts";
12663
12663
  const SEPARATOR$14 = "/";
12664
12664
  const FIRST$14 = 1;
12665
12665
  const READ_CONCURRENCY$20 = 8;
@@ -12667,15 +12667,15 @@ const problemFor$5 = (crate, message) => ({
12667
12667
  file: crate.manifest,
12668
12668
  line: FIRST$14,
12669
12669
  column: FIRST$14,
12670
- rule: RULE$58,
12670
+ rule: RULE$59,
12671
12671
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
12672
12672
  });
12673
12673
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
12674
12674
  const files = yield* RepositoryFiles;
12675
12675
  const workspace = owningWorkspace(directories)(files.relative(root, files.dirname(crate.manifest)));
12676
12676
  if (Option.isNone(workspace)) return Option.some(problemFor$5(crate, "is outside every workspace package"));
12677
- if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$7))) return Option.none();
12678
- return Option.some(problemFor$5(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$7} has no verify task`));
12677
+ if (yield* hasVerifyTask(files.join(root, workspace.value, CONFIG_FILE$8))) return Option.none();
12678
+ return Option.some(problemFor$5(crate, `is in ${workspace.value}, whose ${CONFIG_FILE$8} has no verify task`));
12679
12679
  });
12680
12680
  const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemIn(root, directories, crate) {
12681
12681
  const files = yield* RepositoryFiles;
@@ -12703,7 +12703,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
12703
12703
  return Array$1.getSomes(Array$1.flatten(found));
12704
12704
  });
12705
12705
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
12706
- const RULE$57 = "deploy-entry-pattern";
12706
+ const RULE$58 = "deploy-entry-pattern";
12707
12707
  const FALLOW_KEYS = [
12708
12708
  "entry",
12709
12709
  "entryPoints",
@@ -12774,7 +12774,7 @@ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(request) {
12774
12774
  return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
12775
12775
  file: path,
12776
12776
  ...positionOf(text.value)(start - kind.offset),
12777
- rule: RULE$57,
12777
+ rule: RULE$58,
12778
12778
  message: `${pattern} ${MESSAGE$14}`
12779
12779
  })));
12780
12780
  });
@@ -12807,7 +12807,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
12807
12807
  return Array$1.flatten(found);
12808
12808
  });
12809
12809
  // src/features/check-repository-layout/model/fallow-entries.ts
12810
- const RULE$56 = "listed-entry";
12810
+ const RULE$57 = "listed-entry";
12811
12811
  const ENTRY_KEYS = [
12812
12812
  "entry",
12813
12813
  "entryPoints",
@@ -12837,7 +12837,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
12837
12837
  return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
12838
12838
  file: path,
12839
12839
  ...positionOf(text.value)(start),
12840
- rule: RULE$56,
12840
+ rule: RULE$57,
12841
12841
  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.`
12842
12842
  })));
12843
12843
  });
@@ -12849,8 +12849,8 @@ const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallow
12849
12849
  return Array$1.flatten(found);
12850
12850
  });
12851
12851
  // src/features/check-repository-layout/model/root-workspace-paths.ts
12852
- const RULE$55 = "root-workspace-path";
12853
- const CONFIG_FILE$6 = "vite.config.ts";
12852
+ const RULE$56 = "root-workspace-path";
12853
+ const CONFIG_FILE$7 = "vite.config.ts";
12854
12854
  const PATH_CHARACTER = /[\w.@/-]/u;
12855
12855
  const NAME_CHARACTER = /[\w.@-]/u;
12856
12856
  const FIRST$13 = 0;
@@ -12868,13 +12868,13 @@ const mentions = (directory) => (text) => {
12868
12868
  const problemsIn$17 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
12869
12869
  file,
12870
12870
  ...positionOf(source)(found.start),
12871
- rule: RULE$55,
12872
- message: `${directory} is a workspace. The root ${CONFIG_FILE$6} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$6}: msch.lint, msch.devDependencies or its verify task.`
12871
+ rule: RULE$56,
12872
+ message: `${directory} is a workspace. The root ${CONFIG_FILE$7} holds what applies to every workspace, so move what only ${directory} needs into ${directory}/${CONFIG_FILE$7}: msch.lint, msch.devDependencies or its verify task.`
12873
12873
  })));
12874
12874
  /** @internal */
12875
12875
  const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* checkRootWorkspacePaths(root) {
12876
12876
  const files = yield* RepositoryFiles;
12877
- const file = files.join(root, CONFIG_FILE$6);
12877
+ const file = files.join(root, CONFIG_FILE$7);
12878
12878
  const source = yield* files.readFile(file);
12879
12879
  if (Option.isNone(source)) return [];
12880
12880
  const directories = yield* workspaceDirectories(root);
@@ -12882,8 +12882,8 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
12882
12882
  return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$17(file, source.value, directories)));
12883
12883
  });
12884
12884
  // src/features/check-repository-layout/model/hidden-verify.ts
12885
- const RULE$54 = "hidden-verify";
12886
- const CONFIG_FILE$5 = "vite.config.ts";
12885
+ const RULE$55 = "hidden-verify";
12886
+ const CONFIG_FILE$6 = "vite.config.ts";
12887
12887
  const FIRST$12 = 1;
12888
12888
  const READ_CONCURRENCY$17 = 8;
12889
12889
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
@@ -12896,8 +12896,8 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
12896
12896
  file,
12897
12897
  line: FIRST$12,
12898
12898
  column: FIRST$12,
12899
- rule: RULE$54,
12900
- message: `${directory} gets its verify task from code outside ${CONFIG_FILE$5}. The root verify reads ${CONFIG_FILE$5} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$5}.`
12899
+ rule: RULE$55,
12900
+ message: `${directory} gets its verify task from code outside ${CONFIG_FILE$6}. The root verify reads ${CONFIG_FILE$6} without running it, so it never runs this verify. Write run.tasks.verify in ${directory}/${CONFIG_FILE$6}.`
12901
12901
  }).pipe(Option.filter(() => verified));
12902
12902
  });
12903
12903
  /** @internal */
@@ -12907,7 +12907,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
12907
12907
  return Array$1.getSomes(found);
12908
12908
  });
12909
12909
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
12910
- const RULE$53 = "shared-uncached-task";
12910
+ const RULE$54 = "shared-uncached-task";
12911
12911
  const READ_CONCURRENCY$16 = 8;
12912
12912
  const SHARED = 2;
12913
12913
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -12950,7 +12950,7 @@ const problemsOf$3 = (definitions) => {
12950
12950
  return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
12951
12951
  file,
12952
12952
  ...position,
12953
- rule: RULE$53,
12953
+ rule: RULE$54,
12954
12954
  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.`
12955
12955
  })));
12956
12956
  };
@@ -12961,7 +12961,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
12961
12961
  return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
12962
12962
  });
12963
12963
  // src/features/check-repository-layout/model/unlocked-tasks.ts
12964
- const RULE$52 = "unlocked-task";
12964
+ const RULE$53 = "unlocked-task";
12965
12965
  const READ_CONCURRENCY$15 = 8;
12966
12966
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
12967
12967
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -12973,7 +12973,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
12973
12973
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
12974
12974
  file,
12975
12975
  ...positionOf(source)(task.start),
12976
- rule: RULE$52,
12976
+ rule: RULE$53,
12977
12977
  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.`
12978
12978
  })), Option.toArray)));
12979
12979
  /** @internal */
@@ -13128,7 +13128,7 @@ const outputPathsOf = (step) => pipe(stringOf(pathInputOf(step)), Option.toArray
13128
13128
  /** @internal */
13129
13129
  const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job]) => itemsOf(childOf("steps")(job))), Array$1.flatMap(outputPathsOf));
13130
13130
  // src/features/check-repository-layout/model/workflow-paths.ts
13131
- const RULE$51 = "workflow-path";
13131
+ const RULE$52 = "workflow-path";
13132
13132
  const WORKFLOW_DIRECTORY = ".github/workflows/";
13133
13133
  const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
13134
13134
  const READ_CONCURRENCY$14 = 8;
@@ -13172,7 +13172,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
13172
13172
  const problemOf$8 = (file, source) => (found) => ({
13173
13173
  file,
13174
13174
  ...positionOf(source)(found.offset),
13175
- rule: RULE$51,
13175
+ rule: RULE$52,
13176
13176
  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.`
13177
13177
  });
13178
13178
  const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, workflow) {
@@ -13198,7 +13198,7 @@ const ACTION = /^\.github\/actions\/(?<name>[^/]+)\/action\.ya?ml$/u;
13198
13198
  const FILTER_KEYS = ["paths", "paths-ignore"];
13199
13199
  const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
13200
13200
  const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
13201
- const START$26 = 0;
13201
+ const START$27 = 0;
13202
13202
  const READ_CONCURRENCY$13 = 8;
13203
13203
  const SEPARATOR$10 = "/";
13204
13204
  const WORD_SEPARATORS = /[-_]/gu;
@@ -13229,7 +13229,7 @@ const namesIn$2 = (name, source) => {
13229
13229
  return [
13230
13230
  {
13231
13231
  text: name,
13232
- offset: START$26
13232
+ offset: START$27
13233
13233
  },
13234
13234
  ...Option.toArray(stringOf(childOf("name")(root))),
13235
13235
  ...keysOf(childOf("jobs")(root))
@@ -13464,11 +13464,11 @@ const LISTED_LARGEST = 5;
13464
13464
  const SIZE_CONCURRENCY = 32;
13465
13465
  const MEGABYTE = 1e6;
13466
13466
  const MEGABYTE_DIGITS = 1;
13467
- const START$25 = 0;
13467
+ const START$26 = 0;
13468
13468
  const SINGLE_ENTRY = 1;
13469
13469
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
13470
13470
  const usageHint = (dependency, entryCount) => {
13471
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$25 && dependency.entries.length < entryCount)) return "";
13471
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$26 && dependency.entries.length < entryCount)) return "";
13472
13472
  return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
13473
13473
  };
13474
13474
  const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
@@ -13477,7 +13477,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
13477
13477
  const { workspace, total } = overrun;
13478
13478
  const config = yield* files.readFile(workspace.configFile);
13479
13479
  const source = Option.getOrElse(config, () => "");
13480
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$25);
13480
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$26);
13481
13481
  return {
13482
13482
  file: workspace.configFile,
13483
13483
  ...positionOf(source)(index),
@@ -13494,7 +13494,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
13494
13494
  const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
13495
13495
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
13496
13496
  const sizes = HashMap.fromIterable(measured);
13497
- const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$25)), Number$1.sumAll);
13497
+ const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => Option.getOrElse(HashMap.get(sizes, found), () => START$26)), Number$1.sumAll);
13498
13498
  return {
13499
13499
  closures,
13500
13500
  sizeOf,
@@ -13527,11 +13527,11 @@ const sizeProblems = Effect.fn("sizeProblems")(function* sizeProblems(published,
13527
13527
  })];
13528
13528
  });
13529
13529
  const stackProblems = (file, source, dependencies) => {
13530
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$25);
13530
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$26);
13531
13531
  const rest = String$1.slice(section)(source);
13532
13532
  return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
13533
13533
  file,
13534
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$25)),
13534
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$26)),
13535
13535
  rule: STACK_DEPENDENCY,
13536
13536
  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.`
13537
13537
  })));
@@ -13570,7 +13570,7 @@ const checkPublishedPackages = Effect.fn("checkPublishedPackages")(function* che
13570
13570
  return Array$1.flatten(found);
13571
13571
  });
13572
13572
  // src/features/check-migration-order/model/migration-order.ts
13573
- const RULE$50 = "migration-order";
13573
+ const RULE$51 = "migration-order";
13574
13574
  const SNAPSHOT = "snapshot.json";
13575
13575
  const MIGRATION = "migration.sql";
13576
13576
  const SNAPSHOTS = [`*/${SNAPSHOT}`];
@@ -13604,7 +13604,7 @@ const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migration
13604
13604
  file: join(root, file),
13605
13605
  line: FIRST$11,
13606
13606
  column: FIRST$11,
13607
- rule: RULE$50,
13607
+ rule: RULE$51,
13608
13608
  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}.`
13609
13609
  })))), Option.getOrElse(() => []));
13610
13610
  /** @internal */
@@ -13655,7 +13655,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
13655
13655
  catch: bundleErrorDetail
13656
13656
  }), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
13657
13657
  // src/features/check-plugin-dependencies/model/plugin-dependencies.ts
13658
- const RULE$49 = "plugin-dependencies";
13658
+ const RULE$50 = "plugin-dependencies";
13659
13659
  const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
13660
13660
  const LOCK_FILE = "bun.lock";
13661
13661
  const SOURCE_FILE = /\.[cm]?[jt]sx?$/u;
@@ -13664,7 +13664,7 @@ const SUCCESS$1 = 0;
13664
13664
  const NOT_STARTED = -1;
13665
13665
  const DETAIL_LINES = 3;
13666
13666
  const PLUGIN_CONCURRENCY = 2;
13667
- const problemFor$4 = problemInFile(RULE$49);
13667
+ const problemFor$4 = problemInFile(RULE$50);
13668
13668
  const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
13669
13669
  const files = yield* RepositoryFiles;
13670
13670
  const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
@@ -13764,8 +13764,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
13764
13764
  const builtins = new Set(builtinModules);
13765
13765
  const always = () => true;
13766
13766
  const never = () => false;
13767
- const taggedError$5 = Schema.TaggedError;
13768
- var BundleFailed = class extends taggedError$5()("BundleFailed", { detail: Schema.String }) {};
13767
+ const taggedError$6 = Schema.TaggedError;
13768
+ var BundleFailed = class extends taggedError$6()("BundleFailed", { detail: Schema.String }) {};
13769
13769
  const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
13770
13770
  const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
13771
13771
  const isBuiltin$1 = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
@@ -13867,23 +13867,23 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
13867
13867
  });
13868
13868
  const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
13869
13869
  // src/features/check-tree-shaking/model/optional-peers.ts
13870
- const RULE$48 = "optional-peer";
13870
+ const RULE$49 = "optional-peer";
13871
13871
  const REQUIRED_RULE = "required-peer";
13872
- const START$24 = 0;
13872
+ const START$25 = 0;
13873
13873
  const SINGLE$1 = 1;
13874
13874
  const DEPENDENCIES_KEY = "\"dependencies\"";
13875
13875
  const PEER_META_KEY = "\"peerDependenciesMeta\"";
13876
13876
  const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, name);
13877
13877
  const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
13878
13878
  const positionIn = (located, key, name) => {
13879
- const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$24);
13879
+ const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$25);
13880
13880
  const rest = String$1.slice(section)(located.source);
13881
- return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$24));
13881
+ return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$25));
13882
13882
  };
13883
13883
  const problemFor$3 = (located, name, importers) => ({
13884
13884
  file: located.file,
13885
13885
  ...positionIn(located, DEPENDENCIES_KEY, name),
13886
- rule: RULE$48,
13886
+ rule: RULE$49,
13887
13887
  message: `${name} is imported only from ${labelsOf$1(importers)}, so installing the other entries must not require it. Move it to peerDependencies, mark it optional in peerDependenciesMeta and keep it in devDependencies.`
13888
13888
  });
13889
13889
  const requiredPeerAdvice = (fromStack) => {
@@ -13898,7 +13898,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
13898
13898
  return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
13899
13899
  const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
13900
13900
  const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
13901
- if (!(importers.length > START$24 && importers.length < libraries.length) || neededByBin) return [];
13901
+ if (!(importers.length > START$25 && importers.length < libraries.length) || neededByBin) return [];
13902
13902
  return [problemFor$3(located, name, importers)];
13903
13903
  }));
13904
13904
  };
@@ -13919,9 +13919,9 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
13919
13919
  }));
13920
13920
  };
13921
13921
  // src/features/check-tree-shaking/model/side-effects.ts
13922
- const RULE$47 = "side-effects";
13922
+ const RULE$48 = "side-effects";
13923
13923
  const BUNDLE_CONCURRENCY$2 = 4;
13924
- const START$23 = 0;
13924
+ const START$24 = 0;
13925
13925
  const FIRST$10 = 1;
13926
13926
  const LISTED_PACKAGES = 4;
13927
13927
  const SIDE_EFFECTS_KEY = "\"sideEffects\"";
@@ -13945,7 +13945,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
13945
13945
  label: entry.label,
13946
13946
  member,
13947
13947
  ...extra
13948
- }, ({ modules }) => modules > START$23);
13948
+ }, ({ modules }) => modules > START$24);
13949
13949
  });
13950
13950
  const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
13951
13951
  const names = yield* exportNamesOf(subject.scope, subject.entry.source);
@@ -13967,15 +13967,15 @@ const othersOf = (total) => {
13967
13967
  };
13968
13968
  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.`;
13969
13969
  const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
13970
- const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$23));
13970
+ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$24));
13971
13971
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
13972
13972
  file,
13973
13973
  ...positionOf(source)(keyIndex$1(source)),
13974
- rule: RULE$47,
13974
+ rule: RULE$48,
13975
13975
  message: messageOf$4(worst, excesses.length)
13976
13976
  })), Option.toArray);
13977
13977
  // src/features/check-tree-shaking/model/top-level-effects.ts
13978
- const RULE$46 = "top-level-effect";
13978
+ const RULE$47 = "top-level-effect";
13979
13979
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
13980
13980
  const READ_CONCURRENCY$11 = 16;
13981
13981
  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.";
@@ -13991,7 +13991,7 @@ const messageOf$3 = (statement) => {
13991
13991
  const problemsIn$15 = (api) => (file) => (source) => {
13992
13992
  const retained = api.createSourceFile(file, source);
13993
13993
  const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$7({
13994
- rule: RULE$46,
13994
+ rule: RULE$47,
13995
13995
  message: messageOf$3(statement)
13996
13996
  })(statement)));
13997
13997
  retained.dispose();
@@ -14008,7 +14008,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
14008
14008
  return Array$1.flatten(found);
14009
14009
  }, Effect.scoped);
14010
14010
  const BUNDLED_RULE = "bundled-side-effects";
14011
- const START$22 = 0;
14011
+ const START$23 = 0;
14012
14012
  const NAME_KEY$2 = "\"name\"";
14013
14013
  const packageDirectoryOf = (manifests, files) => (module) => {
14014
14014
  const parent = files.dirname(module);
@@ -14025,7 +14025,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
14025
14025
  })));
14026
14026
  });
14027
14027
  const undeclaredMessage = (files, root) => ({ directory, name }) => `bundles modules of \`${name}\`, whose package.json does not declare "sideEffects". A bundler reads that field from the package that owns each module, so it keeps every module that \`${name}\` re-exports, together with what those modules import, even when this package uses none of them. Declare "sideEffects": false in ${files.relative(root, files.join(directory, PACKAGE_JSON_FILE))}, and keep a module that must run for its effect out of that package.`;
14028
- const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$22));
14028
+ const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$23));
14029
14029
  /** @internal */
14030
14030
  const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
14031
14031
  const files = yield* RepositoryFiles;
@@ -14159,7 +14159,7 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
14159
14159
  return Array$1.flatten(found);
14160
14160
  });
14161
14161
  // src/features/check-typescript-generation/model/typescript-generation.ts
14162
- const RULE$45 = "legacy-typescript";
14162
+ const RULE$46 = "legacy-typescript";
14163
14163
  const LOCKFILE = "pnpm-lock.yaml";
14164
14164
  const COMPILER = "typescript";
14165
14165
  const CURRENT_MAJOR = 7;
@@ -14190,12 +14190,12 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
14190
14190
  file,
14191
14191
  line: lineOf$2(source)(legacy.id),
14192
14192
  column: FIRST$9,
14193
- rule: RULE$45,
14193
+ rule: RULE$46,
14194
14194
  message: messageOf$2(legacy, dependentsOf(Option.getOrElse(nodes, () => []))(legacy.id))
14195
14195
  })));
14196
14196
  });
14197
14197
  // src/features/check-worker-bundles/model/worker-bundles.ts
14198
- const RULE$44 = "worker-bundle";
14198
+ const RULE$45 = "worker-bundle";
14199
14199
  const BUNDLE_CONCURRENCY = 4;
14200
14200
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
14201
14201
  const CONDITIONS = [
@@ -14206,7 +14206,7 @@ const CONDITIONS = [
14206
14206
  "module",
14207
14207
  "default"
14208
14208
  ];
14209
- const problemFor$2 = problemInFile(RULE$44);
14209
+ const problemFor$2 = problemInFile(RULE$45);
14210
14210
  const problemOf$7 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
14211
14211
  const bundleProblem = (file) => Effect.gen(function* bundle() {
14212
14212
  const built = yield* Effect.tryPromise({
@@ -14235,6 +14235,185 @@ const checkWorkerBundles = Effect.fn("checkWorkerBundles")(function* checkWorker
14235
14235
  const found = yield* Effect.forEach(entries, (entry) => bundleProblem(files.join(root, entry)), { concurrency: BUNDLE_CONCURRENCY });
14236
14236
  return Array$1.getSomes(found);
14237
14237
  });
14238
+ // src/app/check-expectations.ts
14239
+ const OFF = [
14240
+ "off",
14241
+ "allow",
14242
+ 0
14243
+ ];
14244
+ const PrintedConfig = Schema.fromJsonString(Schema.Struct({ rules: Schema.Record(Schema.String, Schema.Unknown) }));
14245
+ const isList$1 = (value) => Array$1.isArray(value);
14246
+ const severityOf$1 = (value) => pipe(Option.some(value), Option.filter(isList$1), Option.flatMap(Array$1.head), Option.getOrElse(() => value));
14247
+ const printedConfig = Effect.fn("printedConfig")(function* printedConfig(root) {
14248
+ const handle = yield* ChildProcess.make("vp", ["lint", "--print-config"], {
14249
+ cwd: root,
14250
+ extendEnv: true,
14251
+ stdin: "ignore"
14252
+ });
14253
+ const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
14254
+ yield* handle.exitCode;
14255
+ return yield* Schema.decodeEffect(PrintedConfig)(text);
14256
+ }, Effect.scoped);
14257
+ const enabledRulesIn = Effect.fn("enabledRulesIn")(function* enabledRulesIn(root) {
14258
+ const printed = yield* printedConfig(root).pipe(Effect.option);
14259
+ return pipe(printed, Option.map(({ rules }) => pipe(Record.toEntries(rules), Array$1.filter(([, value]) => !Array$1.contains(OFF, severityOf$1(value))), Array$1.map(([name]) => name))), Option.getOrElse(() => []), (names) => new Set(names));
14260
+ });
14261
+ /** @internal */
14262
+ const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root) {
14263
+ return {
14264
+ enabledRules: yield* enabledRulesIn(root),
14265
+ text: {
14266
+ ignores: TEXT_IGNORES,
14267
+ builtRuleNames: builtTextRuleNames
14268
+ },
14269
+ markdown: {
14270
+ ignores: MARKDOWN_IGNORES,
14271
+ rules: MARKDOWN_RULES
14272
+ },
14273
+ tasks: MSCH_TASK_COMMANDS,
14274
+ verifyTasks: Record.keys(MSCH_TASK_COMMANDS),
14275
+ secrets: secretsOf()
14276
+ };
14277
+ });
14278
+ // src/app/config-weakenings.ts
14279
+ const PRESET_KEYS = [
14280
+ "categories",
14281
+ "plugins",
14282
+ "jsPlugins",
14283
+ "rules",
14284
+ "options",
14285
+ "settings"
14286
+ ];
14287
+ const ENABLED = ["error", "deny"];
14288
+ const SEVERITY_ONLY = 1;
14289
+ const MSCH_RELAXATIONS = [
14290
+ { "react/jsx-props-no-spreading": "off" },
14291
+ { "import/no-default-export": "off" },
14292
+ decisionTestRules
14293
+ ];
14294
+ const isList = (value) => Array$1.isArray(value);
14295
+ const isSection = (value) => Predicate.isObject(value) && !Array$1.isArray(value);
14296
+ const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
14297
+ const listOf = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
14298
+ const severityOf = (value) => pipe(listOf(value), Array$1.head, Option.getOrElse(() => value));
14299
+ const hasOptions = (value) => Array$1.length(listOf(value)) > SEVERITY_ONLY;
14300
+ const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
14301
+ const whenPresent = (what, weakeningsIn) => (value) => Option.match(Option.fromUndefinedOr(value), {
14302
+ onNone: () => [{
14303
+ anchor: "defineConfig",
14304
+ message: `vite.config.ts has no ${what}. Spread repositoryConfig from @r_masseater/msch/config into defineConfig.`
14305
+ }],
14306
+ onSome: (present) => weakeningsIn(sectionOf(present))
14307
+ });
14308
+ const presetDifferences = (lint) => pipe(PRESET_KEYS, Array$1.filter((key) => !Equal.equals(lint[key], lint$3[key])), Array$1.map((key) => ({
14309
+ anchor: "lint",
14310
+ message: `lint.${key} differs from the msch preset. Leave the lint section as repositoryConfig builds it; to add a rule, pass it in overrides or a workspace's msch.lint.overrides.`
14311
+ })));
14312
+ const isPresetOverride = (override) => pipe(lint$3.overrides, Array$1.some((built) => Equal.equals(built, override)));
14313
+ const isMschRelaxation = (override) => pipe(MSCH_RELAXATIONS, Array$1.some((rules) => Equal.equals(rules, override["rules"])));
14314
+ const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.contains(ENABLED, severityOf(value)), {
14315
+ anchor: name,
14316
+ message: `An override sets ${name} to ${String(severityOf(value))}. Rules are not turned off in a repository that uses msch: fix what the rule reports, or fix the rule in msch.`
14317
+ }), ...unless(!(hasOptions(value) && enabledRules.has(name)), {
14318
+ anchor: name,
14319
+ message: `An override changes the options of ${name}, which the msch preset already sets. Options of preset rules are not changed per file: fix what the rule reports, or change the rule in msch.`
14320
+ })];
14321
+ const overrideWeakenings = (enabledRules) => (override) => {
14322
+ const section = sectionOf(override);
14323
+ const builtByMsch = isPresetOverride(override) || isMschRelaxation(section);
14324
+ return pipe(Record.toEntries(sectionOf(section["rules"])), Array$1.filter(() => !builtByMsch), Array$1.flatMap(ruleWeakening(enabledRules)));
14325
+ };
14326
+ const lintWeakenings = (enabledRules) => whenPresent("lint section, so the msch preset does not run", (section) => [
14327
+ ...presetDifferences(section),
14328
+ ...unless(Equal.equals(section["ignorePatterns"], exempt), {
14329
+ anchor: "ignorePatterns",
14330
+ message: "lint.ignorePatterns differs from the files msch exempts (generated files, fixtures and upstream code). Files are not taken out of lint in a repository that uses msch."
14331
+ }),
14332
+ ...pipe(listOf(section["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)))
14333
+ ]);
14334
+ const isOff = (value) => value === false || pipe(Record.values(sectionOf(value)), Array$1.some(isOff));
14335
+ const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.builtRuleNames, Array$1.filter((name) => !Record.has(rules, name)), Array$1.map((name) => ({
14336
+ anchor: "textlint",
14337
+ message: `${owner} does not run ${name}, which msch sets. Leave the textlint section as repositoryConfig builds it.`
14338
+ }))), ...pipe(Record.toEntries(rules), Array$1.filter(([, value]) => isOff(value)), Array$1.map(([name]) => ({
14339
+ anchor: name,
14340
+ message: `${owner} turns off ${name} or one of its rules. Rules are not turned off in a repository that uses msch: rewrite the text, or fix the rule in msch.`
14341
+ })))];
14342
+ const textWeakenings = (expected) => whenPresent("textlint section, so the Japanese text checks do not run", (section) => [
14343
+ ...unless(Equal.equals(section["ignores"], expected.ignores), {
14344
+ anchor: "ignores",
14345
+ message: "textlint.ignores differs from the files msch exempts. Files are not taken out of the text checks in a repository that uses msch."
14346
+ }),
14347
+ ...textRuleWeakenings(expected)("textlint", sectionOf(section["rules"])),
14348
+ ...pipe(listOf(section["sources"]), Array$1.flatMap((source) => textRuleWeakenings(expected)("A textlint source", sectionOf(sectionOf(source)["rules"]))))
14349
+ ]);
14350
+ const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdown checks do not run", (section) => [...unless(Equal.equals(section["ignores"], expected.ignores), {
14351
+ anchor: "ignores",
14352
+ message: "y8.ignores differs from the files msch exempts. Files are not taken out of the Markdown checks in a repository that uses msch."
14353
+ }), ...unless(Equal.equals(section["rules"], expected.rules), {
14354
+ anchor: "y8",
14355
+ message: "y8.rules differs from what markdownOf builds. Markdown rules are not turned off or changed in a repository that uses msch."
14356
+ })]);
14357
+ const taskWeakenings = (run, expected) => {
14358
+ const tasks = sectionOf(sectionOf(run)["tasks"]);
14359
+ const dependsOn = listOf(sectionOf(tasks["verify"])["dependsOn"]);
14360
+ return [...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => !Equal.equals(sectionOf(tasks[name])["command"], command)), Array$1.map(([name]) => ({
14361
+ anchor: "run",
14362
+ message: `The ${name} task does not run what msch builds for it. Leave msch's tasks as repositoryConfig builds them; add other work under another task name.`
14363
+ }))), ...pipe(expected.verifyTasks, Array$1.filter((name) => !Array$1.contains(dependsOn, name)), Array$1.map((name) => ({
14364
+ anchor: "verify",
14365
+ message: `verify does not run the ${name} task. Leave verify as repositoryConfig builds it.`
14366
+ })))];
14367
+ };
14368
+ const secretWeakenings = (h56m, expected) => unless(Equal.equals(h56m, expected), {
14369
+ anchor: "h56m",
14370
+ message: "h56m differs from what secretsOf builds. Findings and files are not taken out of the secret scan in a repository that uses msch: remove the value, or fix the scan in msch when the value is public."
14371
+ });
14372
+ /** @internal */
14373
+ const weakeningsOf = (expected) => (config) => [
14374
+ ...lintWeakenings(expected.enabledRules)(config.lint),
14375
+ ...textWeakenings(expected.text)(config.textlint),
14376
+ ...markdownWeakenings(expected.markdown)(config.y8),
14377
+ ...taskWeakenings(config.run, expected),
14378
+ ...secretWeakenings(config.h56m, expected.secrets)
14379
+ ];
14380
+ // src/app/disabled-rules.ts
14381
+ const RULE$44 = "disabled-rule";
14382
+ const CONFIG_FILE$5 = "vite.config.ts";
14383
+ const START$22 = 0;
14384
+ const SIDE_CONFIG = /(?:^|\/)(?:\.oxlintrc(?:\.jsonc?)?|oxlint\.config\.[cm]?[jt]s|\.oxlintignore|\.eslintrc(?:\.\w+)?|eslint\.config\.[cm]?[jt]s|\.eslintignore|\.textlintrc(?:\.\w+)?|\.textlintignore|\.markdownlint(?:-cli2)?(?:\.\w+)?|\.markdownlintignore|\.prettierignore|\.oxfmtrc(?:\.jsonc?)?|knip\.jsonc?)$/u;
14385
+ const SIDE_CONFIG_MESSAGE = "This file configures a check outside vite.config.ts, where msch cannot see whether it turns rules off. Delete it; msch builds every check setting in vite.config.ts.";
14386
+ const taggedError$5 = Schema.TaggedError;
14387
+ var DisabledRulesConfigUnreadable = class extends taggedError$5()("DisabledRulesConfigUnreadable", {
14388
+ file: Schema.String,
14389
+ reason: Schema.String
14390
+ }) {};
14391
+ const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
14392
+ const files = yield* RepositoryFiles;
14393
+ const listed = yield* files.listedFiles(root);
14394
+ const isExempt = matcher(exempt);
14395
+ return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$44)(files.join(root, name), "")(START$22, SIDE_CONFIG_MESSAGE)));
14396
+ });
14397
+ const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
14398
+ const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
14399
+ const config = yield* Effect.tryPromise({
14400
+ try: () => resolveConfigFromFile(file),
14401
+ catch: (error) => DisabledRulesConfigUnreadable.make({
14402
+ file,
14403
+ reason: String(error)
14404
+ })
14405
+ });
14406
+ const expected = yield* expectationsIn(root);
14407
+ const at = problemAtIndex(RULE$44)(file, source);
14408
+ return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$22), message)));
14409
+ });
14410
+ /** @internal */
14411
+ const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
14412
+ const files = yield* RepositoryFiles;
14413
+ const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
14414
+ if (Option.isNone(text)) return [];
14415
+ return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$44)(file, "")(START$22, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
14416
+ });
14238
14417
  // src/app/build-checks.ts
14239
14418
  /** @internal */
14240
14419
  const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
@@ -14243,7 +14422,8 @@ const checkBuilds = Effect.fn("checkBuilds")(function* checkBuilds(root) {
14243
14422
  checkWorkerBundles(root),
14244
14423
  checkTreeShaking(root),
14245
14424
  checkMigrationOrder(root),
14246
- checkPluginDependencies(root)
14425
+ checkPluginDependencies(root),
14426
+ checkDisabledRules(root)
14247
14427
  ], { concurrency: "unbounded" });
14248
14428
  return Array$1.flatten(found);
14249
14429
  });
@@ -16184,18 +16364,48 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
16184
16364
  });
16185
16365
  // src/shared/lib/comment-directives.ts
16186
16366
  const COMMENT_DIRECTIVES = [
16187
- "oxlint-disable",
16188
- "textlint-disable",
16189
- "textlint-enable",
16190
16367
  String.raw`\* @internal \*?$`,
16191
16368
  String.raw`\* @msch \S+ \*?$`,
16192
16369
  String.raw`\* @stability (?:experimental|unstable) \*?$`,
16193
- String.raw`shellcheck \w`,
16194
- String.raw`zizmor: ignore\[`,
16370
+ String.raw`shellcheck (?:source|shell)=`,
16195
16371
  String.raw`exit: \S`,
16196
16372
  "> statement-breakpoint$",
16197
16373
  "/ <reference (?:types|path|lib)="
16198
16374
  ];
16375
+ const SUPPRESSION = pipe([
16376
+ String.raw`\b(?:${Array$1.join([
16377
+ "eslint",
16378
+ "oxlint",
16379
+ "textlint",
16380
+ "y8",
16381
+ "markdownlint",
16382
+ "biome",
16383
+ "prettier",
16384
+ "oxfmt",
16385
+ "stylelint",
16386
+ "fallow",
16387
+ "knip",
16388
+ "jscpd",
16389
+ "c8",
16390
+ "v8",
16391
+ "istanbul",
16392
+ "tsrs",
16393
+ "tsgolint",
16394
+ "deno-lint",
16395
+ "rustfmt",
16396
+ "clippy"
16397
+ ], "|")})[- ](?:disable|enable|ignore)\b`,
16398
+ String.raw`@ts-(?:ignore|expect-error|nocheck)\b`,
16399
+ String.raw`\b(?:gitleaks|betterleaks|h56m|trufflehog|detect-secrets)\s*:\s*allow`,
16400
+ String.raw`\bpragma:\s*allowlist`,
16401
+ String.raw`\bshellcheck\s+disable=`,
16402
+ String.raw`\bzizmor\s*:\s*ignore`,
16403
+ String.raw`\bactionlint\s*:\s*ignore`,
16404
+ String.raw`\bnosemgrep\b`,
16405
+ String.raw`\bnoqa\b`,
16406
+ String.raw`\btype:\s*ignore\b`
16407
+ ], Array$1.join("|"), (source) => new RegExp(source, "iu"));
16408
+ const SUPPRESSION_MESSAGE = "This comment turns a check off. Checks are not turned off in a repository that uses msch: fix what the check reports, or, when the check itself is wrong, fix the check in msch.";
16199
16409
  // src/features/ban-comments/model/found-comment.ts
16200
16410
  const taggedError$3 = Schema.TaggedError;
16201
16411
  var CommentsUnreadable = class extends taggedError$3()("CommentsUnreadable", {
@@ -16372,11 +16582,25 @@ const shebangReader = (source) => {
16372
16582
  return pipe(SHEBANG_READERS, Array$1.findFirst(([pattern]) => pattern.test(source)));
16373
16583
  };
16374
16584
  const readerOf = (name) => (source) => pipe(READERS$1, Array$1.findFirst(([pattern]) => pattern.test(name)), Option.orElse(() => shebangReader(source)), Option.map(([, reader]) => reader));
16585
+ // src/features/ban-comments/model/scanned-files.ts
16586
+ const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
16587
+ const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root) {
16588
+ const files = yield* RepositoryFiles;
16589
+ const listed = yield* files.listedFiles(root);
16590
+ const generated = yield* files.generatedFiles(root);
16591
+ const vendored = yield* files.matchingFiles(root, [VENDORED_PATHSPEC]);
16592
+ const isIgnored = matcher(exempt);
16593
+ const skipped = HashSet.fromIterable([...generated, ...pipe(vendored, Array$1.map((name) => files.join(root, name)))]);
16594
+ return pipe(listed, Array$1.filter((name) => !isIgnored(name)), Array$1.map((name) => ({
16595
+ name,
16596
+ file: files.join(root, name)
16597
+ })), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
16598
+ });
16375
16599
  // src/features/ban-comments/model/comments.ts
16376
16600
  const RULE$26 = "comment";
16601
+ const SUPPRESSION_RULE = "suppression";
16377
16602
  const UNUSED_RULE = "unused-comment-allowance";
16378
16603
  const CONFIG_FILE$3 = "vite.config.ts";
16379
- const VENDORED_PATHSPEC = ":(attr:linguist-vendored)";
16380
16604
  const READ_CONCURRENCY$6 = 64;
16381
16605
  const START$16 = 0;
16382
16606
  const SHEBANG = "#!";
@@ -16387,15 +16611,8 @@ const MESSAGE$4 = "Comments are not written in this repository. Say it with name
16387
16611
  const Patterns = Schema.Array(Schema.String);
16388
16612
  const CommentSettings = Schema.Struct({ allow: Patterns });
16389
16613
  const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
16390
- const LintSettings = Schema.Struct({ ignorePatterns: Schema.optional(Patterns) });
16391
- const RootConfig = Schema.Struct({
16392
- msch: Schema.optional(MschSettings),
16393
- lint: Schema.optional(LintSettings)
16394
- });
16395
- const NO_SETTINGS = {
16396
- allow: [],
16397
- ignorePatterns: []
16398
- };
16614
+ const RootConfig = Schema.Struct({ msch: Schema.optional(MschSettings) });
16615
+ const NO_SETTINGS = { allow: [] };
16399
16616
  const taggedError$2 = Schema.TaggedError;
16400
16617
  var CommentConfigUnreadable = class extends taggedError$2()("CommentConfigUnreadable", { file: Schema.String }) {};
16401
16618
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
@@ -16405,25 +16622,18 @@ const lineBefore = (source, index) => {
16405
16622
  };
16406
16623
  const isPinVersion = (source, { index, text }) => PIN.test(lineBefore(source, index)) && VERSION.test(valueOf(text));
16407
16624
  const isShebang = ({ index, text }) => index === START$16 && String$1.startsWith(SHEBANG)(text);
16408
- const isAllowed = (source, directives) => (comment) => isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment);
16625
+ const isSuppression = (comment) => SUPPRESSION.test(comment.text);
16626
+ const isAllowed = (source, directives) => (comment) => !isSuppression(comment) && (isShebang(comment) || directives.test(valueOf(comment.text)) || isPinVersion(source, comment));
16409
16627
  const NOTHING = {
16410
16628
  problems: [],
16411
16629
  used: []
16412
16630
  };
16413
16631
  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.`;
16414
- const problemOf$1 = (file, source) => ({ index }) => ({
16415
- file,
16416
- ...positionOf(source)(index),
16417
- rule: RULE$26,
16418
- message: MESSAGE$4
16419
- });
16420
- const settingsOf = ({ msch, lint }) => ({
16421
- allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
16422
- onNone: () => NO_SETTINGS.allow,
16423
- onSome: ({ allow }) => allow
16424
- })),
16425
- ignorePatterns: pipe(Option.fromUndefinedOr(lint), Option.flatMap(({ ignorePatterns }) => Option.fromUndefinedOr(ignorePatterns)), Option.getOrElse(() => NO_SETTINGS.ignorePatterns))
16426
- });
16632
+ const problemOf$1 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$26)(file, source)(comment.index, MESSAGE$4)));
16633
+ const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
16634
+ onNone: () => NO_SETTINGS.allow,
16635
+ onSome: ({ allow }) => allow
16636
+ })) });
16427
16637
  const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
16428
16638
  const files = yield* RepositoryFiles;
16429
16639
  const file = files.join(root, CONFIG_FILE$3);
@@ -16438,31 +16648,14 @@ const rootSettings = Effect.fn("rootSettings")(function* rootSettings(root) {
16438
16648
  }));
16439
16649
  });
16440
16650
  const directivePattern = (directives) => new RegExp(String.raw`^\s?(?:${Array$1.join(directives, "|")})`, "u");
16441
- const scannedFiles = Effect.fn("scannedFiles")(function* scannedFiles(root, settings) {
16442
- const files = yield* RepositoryFiles;
16443
- const listed = yield* files.listedFiles(root);
16444
- const generated = yield* files.generatedFiles(root);
16445
- const vendored = yield* files.matchingFiles(root, [VENDORED_PATHSPEC]);
16446
- const isIgnored = matcher(settings.ignorePatterns);
16447
- const skipped = HashSet.fromIterable([...generated, ...pipe(vendored, Array$1.map((name) => files.join(root, name)))]);
16448
- return pipe(listed, Array$1.filter((name) => !isIgnored(name)), Array$1.map((name) => ({
16449
- name,
16450
- file: files.join(root, name)
16451
- })), Array$1.filter(({ file }) => !HashSet.has(skipped, file)));
16452
- });
16453
- const usedAllowances = (allowances, found) => pipe(allowances, Array$1.map((pattern, index) => [pattern, index]), Array$1.filter(([pattern]) => pipe(found, Array$1.some((comment) => pattern.test(valueOf(comment.text))))), Array$1.map(([, index]) => index));
16651
+ const usedAllowances = (allowances, found) => pipe(allowances, Array$1.map((pattern, index) => [pattern, index]), Array$1.filter(([pattern]) => pipe(found, Array$1.some((comment) => !isSuppression(comment) && pattern.test(valueOf(comment.text))))), Array$1.map(([, index]) => index));
16454
16652
  const entryOffset = (source, entry) => pipe(String$1.indexOf(entry)(source), Option.getOrElse(() => START$16));
16455
16653
  const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowances(root, settings, used) {
16456
16654
  const files = yield* RepositoryFiles;
16457
16655
  const file = files.join(root, CONFIG_FILE$3);
16458
16656
  const text = yield* files.readFile(file);
16459
16657
  const source = Option.getOrElse(text, () => "");
16460
- return pipe(settings.allow, Array$1.filter((_entry, index) => !HashSet.has(used, index)), Array$1.map((entry) => ({
16461
- file,
16462
- ...positionOf(source)(entryOffset(source, entry)),
16463
- rule: UNUSED_RULE,
16464
- message: unusedMessage(entry)
16465
- })));
16658
+ return pipe(settings.allow, Array$1.filter((_entry, index) => !HashSet.has(used, index)), Array$1.map((entry) => problemAtIndex(UNUSED_RULE)(file, source)(entryOffset(source, entry), unusedMessage(entry))));
16466
16659
  });
16467
16660
  const scanFile = ({ directives, allowances, comments }) => ({ name, file }, source) => {
16468
16661
  const kept = Predicate.not(isAllowed(source, directives));
@@ -16473,7 +16666,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
16473
16666
  problems: pipe(found, Array$1.filter(kept), Array$1.map(toProblem)),
16474
16667
  used: usedAllowances(allowances, found)
16475
16668
  })), Effect.catchTag("CommentsUnreadable", ({ message }) => Effect.succeed({
16476
- problems: [problemInFile(RULE$26)(file, `msch could not read the comments in this file: ${message}`)],
16669
+ problems: [problemAtIndex(RULE$26)(file, source)(START$16, `msch could not read the comments in this file: ${message}`)],
16477
16670
  used: []
16478
16671
  })))
16479
16672
  });
@@ -16482,7 +16675,7 @@ const scanFile = ({ directives, allowances, comments }) => ({ name, file }, sour
16482
16675
  const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
16483
16676
  const files = yield* RepositoryFiles;
16484
16677
  const settings = yield* rootSettings(root);
16485
- const scanned = yield* scannedFiles(root, settings);
16678
+ const scanned = yield* scannedFiles(root);
16486
16679
  const grammars = yield* loadGrammars();
16487
16680
  const scan = scanFile({
16488
16681
  directives: directivePattern([...COMMENT_DIRECTIVES, ...settings.allow]),
@@ -17369,16 +17562,12 @@ const SKIPPED_DIRECTORIES = [
17369
17562
  "/upstream/"
17370
17563
  ];
17371
17564
  const SKIPPED_FILES = ["CHANGELOG.md", "CLAUDE.md"];
17372
- const DISABLE = /<!--\s*(?:y8|markdownlint|textlint)-disable(?:-next-line|-line|-file)?(?<rest>(?:\s[\s\S]*?)?)-->/giu;
17565
+ const DISABLE = /<!--\s*(?:y8|markdownlint|textlint)-(?:disable|enable|capture|restore|configure-file)(?:-next-line|-line|-file)?(?:\s[\s\S]*?)?-->/giu;
17373
17566
  const FENCE$1 = /^\s{0,3}(?:`{3,}|~{3,})/u;
17374
17567
  const BACKTICK = /`/gu;
17375
- const DESCRIPTION = / -- .*/u;
17376
- const SEPARATORS = /[\s,]+/u;
17377
- const MESSAGE$2 = "Name the rules this comment disables, as in `<!-- y8-disable MD033 -->`. A comment with no rule name stops every rule, so it also hides violations that are added later.";
17568
+ const MESSAGE$2 = "This comment turns a Markdown or text check off. Checks are not turned off in a repository that uses msch: fix what the check reports, or, when the check itself is wrong, fix the check in msch.";
17378
17569
  const fenceStep = (inside, line) => Match.value(FENCE$1.test(line)).pipe(Match.when(true, () => [!inside, true]), Match.orElse(() => [inside, inside]));
17379
17570
  const insideCodeSpan = (before) => Array$1.fromIterable(String$1.matchAll(BACKTICK)(before)).length % PAIR === ODD;
17380
- const namedRules = (rest) => pipe(rest, String$1.replace(DESCRIPTION, ""), String$1.split(SEPARATORS), Array$1.filter(String$1.isNonEmpty));
17381
- const restOf = (found) => pipe(Option.fromNullishOr(found.groups), Option.flatMap(Record.get("rest")), Option.getOrElse(() => ""));
17382
17571
  const problemsIn$7 = (file, source) => {
17383
17572
  const lines = String$1.split("\n")(source);
17384
17573
  const fenced = Array$1.mapAccum(lines, false, fenceStep)[SECOND];
@@ -17386,7 +17575,7 @@ const problemsIn$7 = (file, source) => {
17386
17575
  const { line, column } = positionOf(source)(index);
17387
17576
  return pipe(Array$1.get(fenced, line - SECOND), Option.getOrElse(() => false)) || pipe(Array$1.get(lines, line - SECOND), Option.map(String$1.slice(START$11, column - SECOND)), Option.exists(insideCodeSpan));
17388
17577
  };
17389
- return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => Array$1.isReadonlyArrayEmpty(namedRules(restOf(match)))), Array$1.filter((match) => !isCode(match.index ?? START$11)), Array$1.map((match) => problemAtIndex(RULE$18)(file, source)(match.index ?? START$11, MESSAGE$2)));
17578
+ return pipe(Array$1.fromIterable(String$1.matchAll(DISABLE)(source)), Array$1.filter((match) => !isCode(match.index ?? START$11)), Array$1.map((match) => problemAtIndex(RULE$18)(file, source)(match.index ?? START$11, MESSAGE$2)));
17390
17579
  };
17391
17580
  const isChecked = (name) => String$1.endsWith(MARKDOWN$3)(name) && !pipe(SKIPPED_DIRECTORIES, Array$1.some((directory) => String$1.includes(directory)(`/${name}`))) && !pipe(SKIPPED_FILES, Array$1.some((skipped) => name === skipped || String$1.endsWith(`/${skipped}`)(name)));
17392
17581
  /** @internal */