@r_masseater/msch 0.129.4 → 0.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -14,7 +14,7 @@ import { decodePackageJson, decodeVersionedPackageJson, readPackageJson, readRaw
14
14
  import { a as workspaceConfigs, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries$1, i as publishedWorkspaces, l as modDirectories, m as workspaceLinks, o as entryNameOf, r as packedWorkspaces, s as isBinEntry, u as INDEX_SKILL, v as shadcnUiOf } from "./published-BdMq0wXq.mjs";
15
15
  import { parse, resolveConfigFromFile } from "vite-plus";
16
16
  import { i as USAGE_SPOOL, n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-B3SYjao5.mjs";
17
- import { _ as existsAt, a as builtTextRuleNames, b as patternOf$1, c as GIT_HOOKS, d as meteredCommand, f as MDLCT_BIN, g as fu4Of, h as SUBJECT_SCRIPT, i as TEXT_IGNORES, l as MSCH_TASK_COMMANDS, m as COMMIT_LINT, n as STAGED$1, o as secretsOf, s as CI_TASKS, t as FORMAT, u as MSCH_VERIFY_COMMANDS, v as isIgnored, y as namedWorkspaces } from "./repository-config-Dq5OIwyx.mjs";
17
+ import { c as forgetBuilt, d as existsAt, g as patternOf$1, h as namedWorkspaces, i as GIT_HOOKS, l as lastBuilt, p as isIgnored, s as MDLCT_BIN, t as BUILT_ALLOWANCES } from "./repository-text-Dy8EkFIh.mjs";
18
18
  import { fileURLToPath, pathToFileURL } from "node:url";
19
19
  import treeSitter from "@vscode/tree-sitter-wasm";
20
20
  import { t as startedOnce } from "./started-once-BN_hLlmU.mjs";
@@ -23,11 +23,10 @@ import { rolldown } from "rolldown";
23
23
  import { stripVTControlCharacters } from "node:util";
24
24
  import { builtinModules, isBuiltin as isBuiltin$1 } from "node:module";
25
25
  import semver from "semver";
26
- import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, t as MARKDOWN_IGNORES, x as exempt } from "./define-lint-preset-PLWK5HYf.mjs";
26
+ import { g as decisionTestRules, p as lint$3, x as exempt } from "./define-lint-preset-PLWK5HYf.mjs";
27
27
  import { NO_PATH, describeReference, diagnosticDetail, linksIn as linksIn$1, lint, markdownPathspecs, referenceOf as referenceOf$2, y8Section } from "@r_masseater/y8";
28
28
  import { lint as lint$1, wismPathspecs, wismSection } from "@r_masseater/wism";
29
- import { Parser, isPair, isScalar, parse as parse$1, parseDocument, visit as visit$1 } from "yaml";
30
- import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
29
+ import { Parser, isMap, isNode, isPair, isScalar, isSeq, parse as parse$1, parseDocument, visit as visit$1 } from "yaml";
31
30
  import { fu4Section, lint as lint$2, workflowPathspecs } from "@r_masseater/fu4";
32
31
  import { isComment, isTag, isText } from "domhandler";
33
32
  import { DomUtils, parseDocument as parseDocument$1 } from "htmlparser2";
@@ -40,16 +39,18 @@ import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
40
39
  import { runMainWith } from "@r_masseater/masseater-utils/node-main";
41
40
  import { sdkAgentQuery } from "@r_masseater/masseater-utils/agent-query";
42
41
  import { dual } from "effect/Function";
42
+ import { readWorkspaceManifest as readWorkspaceManifest$1 } from "@pnpm/workspace.workspace-manifest-reader";
43
43
  import { judgeText } from "@r_masseater/oxlint-plugin-decision";
44
44
  import { finished, mustSucceed, outputOf, succeeds, writeOutputs } from "@r_masseater/masseater-utils/github-workflow";
45
45
  import { CALLS_METRIC, mergeTallies, talliesIn, usageMetricsOf } from "@r_masseater/masseater-utils/usage-meter/report";
46
46
  import { Base64 } from "effect/encoding";
47
47
  import { arch, platform } from "node:os";
48
+ import { VpToolsError, runVpa } from "@r_masseater/vite-plus-adopt";
48
49
  import { Buffer } from "node:buffer";
49
50
  import { createZstdDecompress } from "node:zlib";
50
51
  // package.json
51
52
  var name = "@r_masseater/msch";
52
- var version = "0.129.4";
53
+ var version = "0.131.0";
53
54
  var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
54
55
  var repository = {
55
56
  "type": "git",
@@ -65,9 +66,9 @@ const rootFlags = {
65
66
  ...hookFlags
66
67
  };
67
68
  // src/app/output.ts
68
- const taggedError$15 = Schema.TaggedError;
69
+ const taggedError$16 = Schema.TaggedError;
69
70
  const NO_PROBLEMS$2 = 0;
70
- var ProblemsFound = class extends taggedError$15()("ProblemsFound", { count: Schema.Finite }) {
71
+ var ProblemsFound = class extends taggedError$16()("ProblemsFound", { count: Schema.Finite }) {
71
72
  [Runtime.errorReported] = false;
72
73
  };
73
74
  /** @internal */
@@ -785,10 +786,10 @@ const namesSkill = (skill) => (text) => new RegExp(namePattern(skill), "u").test
785
786
  const SKILLS_START = "<!-- skills:generated -->";
786
787
  const SKILLS_END = "<!-- /skills:generated -->";
787
788
  // src/shared/lib/text-position.ts
788
- const START$35 = 0;
789
+ const START$37 = 0;
789
790
  const FIRST_COLUMN$8 = 1;
790
791
  const positionOf = (source) => (index) => {
791
- const before = pipe(source, String$1.slice(START$35, index), String$1.split("\n"));
792
+ const before = pipe(source, String$1.slice(START$37, index), String$1.split("\n"));
792
793
  return {
793
794
  line: before.length,
794
795
  column: pipe(Array$1.last(before), Option.match({
@@ -948,8 +949,8 @@ const RESOLUTION_FILES = [
948
949
  ];
949
950
  const RESOLUTION_CONCURRENCY = 2;
950
951
  const SUCCEEDED$1 = 0;
951
- const taggedError$14 = Schema.TaggedError;
952
- var OverrideResolutionFailed = class extends taggedError$14()("OverrideResolutionFailed", {
952
+ const taggedError$15 = Schema.TaggedError;
953
+ var OverrideResolutionFailed = class extends taggedError$15()("OverrideResolutionFailed", {
953
954
  override: Schema.String,
954
955
  output: Schema.String
955
956
  }) {};
@@ -1093,53 +1094,69 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
1093
1094
  }))), { concurrency: READ_CONCURRENCY$41 });
1094
1095
  return Array$1.flatten(found);
1095
1096
  });
1097
+ /** @internal */
1098
+ const problemsInFiles = Effect.fn("problemsInFiles")(function* problemsInFiles(root, names, problemsIn) {
1099
+ const files = yield* RepositoryFiles;
1100
+ const found = yield* Effect.forEach(names, (name) => {
1101
+ const file = files.join(root, name);
1102
+ return files.readFile(file).pipe(Effect.map(Option.match({
1103
+ onNone: () => [],
1104
+ onSome: (source) => problemsIn({
1105
+ file,
1106
+ name,
1107
+ source
1108
+ })
1109
+ })));
1110
+ }, { concurrency: READ_CONCURRENCY$41 });
1111
+ return Array$1.flatten(found);
1112
+ });
1096
1113
  // src/features/check-overrides/model/git-subpath.ts
1097
1114
  const DEPENDENCY_FILE = /(?:^|\/)(?:package\.json|pnpm-workspace\.ya?ml)$/u;
1098
1115
  const GIT_SUBPATH = /(?<![^\s"':])[^\s"'#]+#(?:[^\s"'&]*&)*path:[^\s"']*/gu;
1099
- const RULE$81 = "git-subpath-dependency";
1116
+ const RULE$83 = "git-subpath-dependency";
1100
1117
  const WHOLE_MATCH$4 = 0;
1101
1118
  const problemAt$5 = ({ file }, source) => (found) => ({
1102
1119
  file,
1103
1120
  ...positionOf(source)(found.index ?? WHOLE_MATCH$4),
1104
- rule: RULE$81,
1121
+ rule: RULE$83,
1105
1122
  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])}\`.`
1106
1123
  });
1107
- const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
1124
+ const problemsIn$25 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(GIT_SUBPATH)(source)), Array$1.map(problemAt$5(entry, source)));
1108
1125
  const isDependencyFile = ({ name }) => DEPENDENCY_FILE.test(name);
1109
1126
  /** @internal */
1110
1127
  const checkGitSubpath = Effect.fn("checkGitSubpath")(function* checkGitSubpath(root) {
1111
1128
  const listed = yield* listedFiles(root);
1112
- return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$24);
1129
+ return yield* scanText(pipe(listed, Array$1.filter(isDependencyFile)), problemsIn$25);
1113
1130
  });
1114
1131
  // src/features/check-overrides/model/restricted-rules.ts
1115
- const RULE$80 = "unnamed-restriction";
1132
+ const RULE$82 = "unnamed-restriction";
1116
1133
  const WHOLE_MATCH$3 = 0;
1117
1134
  const UNNAMED = new RegExp(`(?:[\\w@-]+/)?no-restricted-[a-z]+(?:-[a-z]+)*\\b`, "gu");
1118
- const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
1135
+ const problemsIn$24 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(UNNAMED)(source)), Array$1.map((found) => ({
1119
1136
  file: entry.file,
1120
1137
  ...positionOf(source)(found.index ?? WHOLE_MATCH$3),
1121
- rule: RULE$80,
1138
+ rule: RULE$82,
1122
1139
  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.`
1123
1140
  })));
1124
1141
  /** @internal */
1125
1142
  const checkRestrictedRules = Effect.fn("checkRestrictedRules")(function* checkRestrictedRules(root) {
1126
1143
  const listed = yield* listedFiles(root);
1127
- return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
1144
+ return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$24);
1128
1145
  });
1129
1146
  // src/features/check-overrides/model/type-exemptions.ts
1130
- const RULE$79 = "named-type-exemption";
1147
+ const RULE$81 = "named-type-exemption";
1131
1148
  const WHOLE_MATCH$2 = 0;
1132
1149
  const SPECIFIER = new RegExp(`["']?\\bfrom["']?\\s*:\\s*["'](?:file|lib|package)["']`, "gu");
1133
- const problemsIn$22 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
1150
+ const problemsIn$23 = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(SPECIFIER)(source)), Array$1.map((found) => ({
1134
1151
  file: entry.file,
1135
1152
  ...positionOf(source)(found.index ?? WHOLE_MATCH$2),
1136
- rule: RULE$79,
1153
+ rule: RULE$81,
1137
1154
  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."
1138
1155
  })));
1139
1156
  /** @internal */
1140
1157
  const checkTypeExemptions = Effect.fn("checkTypeExemptions")(function* checkTypeExemptions(root) {
1141
1158
  const listed = yield* listedFiles(root);
1142
- return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$22);
1159
+ return yield* scanText(pipe(listed, Array$1.filter(isScannedText)), problemsIn$23);
1143
1160
  });
1144
1161
  // src/shared/lib/registries.ts
1145
1162
  const TRAILING_SLASH$1 = /\/*$/u;
@@ -1149,37 +1166,37 @@ const INSTALL_REGISTRY = "https://npm.flatt.tech/";
1149
1166
  const withTrailingSlash = (url) => `${String$1.replace(TRAILING_SLASH$1, "")(url)}/`;
1150
1167
  const scopeOfName = (name) => pipe(Option.liftPredicate(name, String$1.startsWith("@")), Option.flatMap((scoped) => pipe(String$1.indexOf(SCOPE_SEPARATOR)(scoped), Option.map((end) => String$1.takeLeft(scoped, end + 1)))));
1151
1168
  // src/features/check-overrides/model/package-registry.ts
1152
- const RULE$78 = "package-registry";
1169
+ const RULE$80 = "package-registry";
1153
1170
  const WORKSPACE_FILE$6 = "pnpm-workspace.yaml";
1154
1171
  const NPMRC = /(?:^|\/)\.npmrc$/u;
1155
1172
  const WORKSPACE_REGISTRY = /^registry:/mu;
1156
1173
  const NPMRC_REGISTRY = /^[ \t]*registry[ \t]*=[ \t]*(?<value>\S*)/gmu;
1157
- const START$34 = 0;
1174
+ const START$36 = 0;
1158
1175
  const REASON$4 = `Installs go through Takumi Guard (${INSTALL_REGISTRY}), which blocks known-malicious packages before they are installed.`;
1159
1176
  const decodeRegistry = Schema.decodeUnknownOption(Schema.Struct({ registry: Schema.optional(Schema.String) }));
1160
1177
  const registryOf = (manifest) => pipe(decodeRegistry(manifest), Option.flatMap(({ registry }) => Option.fromUndefinedOr(registry)));
1161
- const isRequired = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
1162
- const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$34));
1178
+ const isRequired$1 = (found) => withTrailingSlash(found) === INSTALL_REGISTRY;
1179
+ const offsetIn$1 = (found) => pipe(Option.fromNullishOr(found), Option.map(({ index }) => index), Option.getOrElse(() => START$36));
1163
1180
  const workspaceProblem = ({ file, source }, registry) => ({
1164
1181
  file,
1165
1182
  ...positionOf(source)(offsetIn$1(WORKSPACE_REGISTRY.exec(source))),
1166
- rule: RULE$78,
1183
+ rule: RULE$80,
1167
1184
  message: Option.match(registry, {
1168
1185
  onNone: () => `${REASON$4} Set \`registry: ${INSTALL_REGISTRY}\` in ${WORKSPACE_FILE$6}.`,
1169
1186
  onSome: (value) => `${REASON$4} \`registry\` is ${value}. Set it to ${INSTALL_REGISTRY}.`
1170
1187
  })
1171
1188
  });
1172
- 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) => ({
1189
+ const npmrcProblems = (entry, source) => pipe(Array$1.fromIterable(String$1.matchAll(NPMRC_REGISTRY)(source)), Array$1.filter((found) => !Option.exists(groupOf("value")(found), isRequired$1)), Array$1.map((found) => ({
1173
1190
  file: entry.file,
1174
- ...positionOf(source)(found.index ?? START$34),
1175
- rule: RULE$78,
1176
- message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$34])}\`. Remove the line.`
1191
+ ...positionOf(source)(found.index ?? START$36),
1192
+ rule: RULE$80,
1193
+ message: `${REASON$4} This .npmrc overrides it with \`${String$1.trim(found[START$36])}\`. Remove the line.`
1177
1194
  })));
1178
1195
  const checkWorkspace = Effect.fn("checkWorkspace")(function* checkWorkspace(root) {
1179
1196
  const files = yield* RepositoryFiles;
1180
1197
  const manifest = yield* workspaceManifest(root);
1181
1198
  const registry = pipe(manifest, Option.flatMap(registryOf));
1182
- const guarded = registry.pipe(Option.getOrElse(() => PUBLIC_REGISTRY), isRequired);
1199
+ const guarded = registry.pipe(Option.getOrElse(() => PUBLIC_REGISTRY), isRequired$1);
1183
1200
  if (Option.isNone(manifest) || guarded) return [];
1184
1201
  const file = files.join(root, WORKSPACE_FILE$6);
1185
1202
  const read = yield* files.readFile(file);
@@ -1222,7 +1239,7 @@ const renovatePresetOf = Effect.fn("renovatePresetOf")(function* renovatePresetO
1222
1239
  // src/entities/package/model/stack-catalog.ts
1223
1240
  const STACK_CATALOG = "catalog:stack";
1224
1241
  // src/entities/package/model/specifiers.ts
1225
- const START$33 = 0;
1242
+ const START$35 = 0;
1226
1243
  const FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);
1227
1244
  const decodeFields$1 = Schema.decodeUnknownOption(FieldsSchema);
1228
1245
  const decodeString$1 = Schema.decodeUnknownOption(Schema.String);
@@ -1240,7 +1257,7 @@ const quoted$1 = (text) => String$1.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.ra
1240
1257
  /** @internal */
1241
1258
  const manifestPattern = ({ name, specifier }) => new RegExp(`"${quoted$1(name)}"\\s*:\\s*"${quoted$1(specifier)}"`, "u");
1242
1259
  /** @internal */
1243
- const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$33));
1260
+ const offsetIn = (source) => (pattern) => pipe(Option.fromNullishOr(pattern.exec(source)), Option.map(({ index }) => index), Option.getOrElse(() => START$35));
1244
1261
  const SECTIONS$1 = [
1245
1262
  "dependencies",
1246
1263
  "devDependencies",
@@ -1265,6 +1282,135 @@ const scanPublishedManifests = Effect.fn("scanPublishedManifests")(function* sca
1265
1282
  manifest
1266
1283
  })), Option.getOrElse(() => [])));
1267
1284
  });
1285
+ // renovate.json
1286
+ var renovate_default = {
1287
+ $schema: "https://docs.renovatebot.com/renovate-schema.json",
1288
+ "extends": [
1289
+ "config:recommended",
1290
+ "security:minimumReleaseAgeNpm",
1291
+ ":semanticCommits"
1292
+ ],
1293
+ timezone: "Asia/Tokyo",
1294
+ schedule: ["* 4 * * *"],
1295
+ minimumReleaseAge: "3 days",
1296
+ configMigration: true,
1297
+ rollbackPrs: false,
1298
+ separateMajorMinor: false,
1299
+ rangeStrategy: "pin",
1300
+ prHourlyLimit: 0,
1301
+ gitIgnoredAuthors: ["41898282+github-actions[bot]@users.noreply.github.com"],
1302
+ packageRules: [
1303
+ {
1304
+ "description": "msch の commitlint は件名に日本語の文字を 1 文字以上求める(subject-script)。Renovate の既定の件名(update all dependencies など)は英語だけなので、PR の up-to-date が落ちてマージキューに入らなかった。件名を「<対象>(<版>)を上げる」の形にする。グループと digest の更新では Renovate が commitMessageExtra を消すので、日本語は消されない commitMessageSuffix に置く。",
1305
+ "matchPackageNames": ["*"],
1306
+ "commitMessageAction": "",
1307
+ "commitMessageTopic": "{{{depName}}}",
1308
+ "commitMessageExtra": "({{{newVersion}}})",
1309
+ "commitMessageSuffix": "を上げる"
1310
+ },
1311
+ {
1312
+ "description": "依存の更新は 1 日 1 回、朝 4 時台にまとめて 1 つの PR で出す。更新ごとに PR を出すと、main への統合と verify が 1 日に何十回も走り、赤くなったときにどの更新が原因かを探す手間も増える。組で上げないと壊れるパッケージ(textlint、better-auth、effect と alchemy など)も、同じ PR に入るので組で上がる。待ち合わせが要る組(公開の時期がずれる組)だけは、この後ろの規則と、この preset の後ろに置く preset や各リポジトリの規則で別の PR に分ける。脆弱性の修正は Renovate の既定どおり、この時刻を待たずに別の PR で出る。",
1313
+ "matchPackageNames": ["*"],
1314
+ "groupName": "all dependencies",
1315
+ "groupSlug": "all"
1316
+ },
1317
+ {
1318
+ "description": "peerDependencies は利用側との互換の範囲を宣言するもので、版を選ばない。範囲のまま広げる。",
1319
+ "matchDepTypes": ["peerDependencies"],
1320
+ "rangeStrategy": "widen"
1321
+ },
1322
+ {
1323
+ "description": "overrides は推移的な依存の下限を強制するもので、範囲のまま置き換える。",
1324
+ "matchDepTypes": [
1325
+ "pnpm-workspace.overrides",
1326
+ "pnpm.overrides",
1327
+ "overrides"
1328
+ ],
1329
+ "rangeStrategy": "replace"
1330
+ },
1331
+ {
1332
+ "description": "msch は版が上がるたびに検査が増え、利用側は同じ変更で移行しないと main の verify が落ちる(msch 0.60.1 で利用側の main が赤になった)。msch の dependencies と peerDependencies にある同じスコープのパッケージもこの組に並べ、msch に足したらここにも足す。bump だけを自動マージしない。bump と移行を同じ PR で出す。 日次の全体の PR にも入れない。移行の要る msch の版上げで、ほかの更新が止まらないようにする。",
1333
+ "matchPackageNames": [
1334
+ "@r_masseater/msch",
1335
+ "@r_masseater/fu4",
1336
+ "@r_masseater/h56m",
1337
+ "@r_masseater/masseater-utils",
1338
+ "@r_masseater/oxlint-plugin-decision",
1339
+ "@r_masseater/oxlint-typed-rules",
1340
+ "@r_masseater/textlint-rule-preset-ja",
1341
+ "@r_masseater/vite-plus-adopt",
1342
+ "@r_masseater/wism",
1343
+ "@r_masseater/y8"
1344
+ ],
1345
+ "groupName": "msch",
1346
+ "automerge": false
1347
+ },
1348
+ {
1349
+ "description": "Effect と Alchemy は日々の更新に追従する前提で、公開後の待機期間を掛けない。pnpm 側は各リポジトリの minimumReleaseAgeExclude に同じ名前を置く。",
1350
+ "matchPackageNames": [
1351
+ "effect",
1352
+ "@effect/**",
1353
+ "alchemy",
1354
+ "@alchemy.run/**"
1355
+ ],
1356
+ "minimumReleaseAge": null
1357
+ },
1358
+ {
1359
+ "description": "TypeScript は 7 以降だけを使う。6 以前や dev 版に戻さない。",
1360
+ "matchPackageNames": ["typescript"],
1361
+ "matchDepNames": ["!typescript-wasm"],
1362
+ "allowedVersions": "/^(?:[7-9]|[1-9][0-9]+)\\.[0-9]+\\.[0-9]+(?:-(?:beta|rc)[0-9.]*)?$/"
1363
+ },
1364
+ {
1365
+ "description": "overrides の major は上流の範囲を越えて推移的な依存を動かす。上げない。",
1366
+ "matchDepTypes": ["pnpm-workspace.overrides"],
1367
+ "matchUpdateTypes": ["major"],
1368
+ "enabled": false
1369
+ },
1370
+ {
1371
+ "description": "patches/ の crate はルートの Cargo.lock で解決される。Renovate は写しの Cargo.toml と写し自身の Cargo.lock だけを上げ、ルートの Cargo.lock と食い違って cargo の --locked が落ちる (#1283, #1284, #1289)。更新しない。",
1372
+ "matchFileNames": ["patches/**"],
1373
+ "enabled": false
1374
+ },
1375
+ {
1376
+ "description": "テストの fixtures は外部ツールの出力と突き合わせる写しで、版を上げると記録した結果と食い違う (#1399, #1401, #1405, #1406)。更新しない。",
1377
+ "matchFileNames": ["**/fixtures/**"],
1378
+ "enabled": false
1379
+ },
1380
+ {
1381
+ "description": "vite-plus は oxlint と tsrs の版を固定し(tsrs はルートの devDependencies にも入れてあり、oxlint と同時に上げる)、@effect/tsgo は対応している版の oxlint と oxlint-tsgolint にしかパッチを当てられない。合わないと prepare が落ちて vp install が失敗する。vite-plus は vitest の版も固定し、@vitest/* だけが上がると vitest が 2 つ入って @effect/vitest のテストが suite を見つけられずに落ちる (#1479)。組で上げ、up-to-date の install が通ったときだけマージする。@effect/tsgo は tsrs や oxlint より後に対応版を出すので、日次の全体の PR に入れると、合う版がそろうまで全体が止まる。全体の PR から分ける。",
1382
+ "matchPackageNames": [
1383
+ "vite-plus",
1384
+ "oxlint",
1385
+ "@oxlint/plugins",
1386
+ "oxlint-tsgolint",
1387
+ "oxlint-plugin-eslint",
1388
+ "tsrs",
1389
+ "@effect/tsgo",
1390
+ "vitest",
1391
+ "@vitest/**"
1392
+ ],
1393
+ "groupName": "oxlint and effect-tsgo"
1394
+ },
1395
+ {
1396
+ "description": "公開日時の無い種類の更新は待機期間を判定できず、掛けると止まったままになるので外す。",
1397
+ "matchUpdateTypes": [
1398
+ "lockFileMaintenance",
1399
+ "replacement",
1400
+ "pin",
1401
+ "bump",
1402
+ "lockfileUpdate",
1403
+ "rollback"
1404
+ ],
1405
+ "minimumReleaseAge": null
1406
+ },
1407
+ {
1408
+ "description": "公開日時を返さないデータソースは待機期間を判定できず、掛けると止まったままになるので外す。",
1409
+ "matchDatasources": ["git-refs"],
1410
+ "minimumReleaseAge": null
1411
+ }
1412
+ ]
1413
+ };
1268
1414
  // src/shared/config/self.ts
1269
1415
  const GIT_PREFIX = /^git\+/u;
1270
1416
  const GIT_SUFFIX = /\.git$/u;
@@ -1272,9 +1418,12 @@ const GITHUB$5 = "https://github.com/";
1272
1418
  const SELF_NAME = name;
1273
1419
  const SELF_HOMEPAGE = homepage;
1274
1420
  const SELF_DIRECTORY = repository.directory;
1275
- const RENOVATE_PRESET = `github>${pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$5, ""))}//${SELF_DIRECTORY}/renovate`;
1421
+ const SELF_REPOSITORY = pipe(repository.url, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, ""), String$1.replace(GITHUB$5, ""));
1422
+ const RENOVATE_PRESET = `github>${SELF_REPOSITORY}//${SELF_DIRECTORY}/renovate`;
1423
+ /** @internal */
1424
+ const RENOVATE_PRESET_SETTINGS = renovate_default;
1276
1425
  // src/features/check-overrides/model/removed-peers.ts
1277
- const RULE$77 = "removed-peer";
1426
+ const RULE$79 = "removed-peer";
1278
1427
  const WORKSPACE_FILE$5 = "pnpm-workspace.yaml";
1279
1428
  const REMOVED = "-";
1280
1429
  const PARENT_SEPARATOR = ">";
@@ -1301,7 +1450,7 @@ const problemAt$4 = (file, { key, line, column }) => ({ peer, dependent }) => ({
1301
1450
  file,
1302
1451
  line,
1303
1452
  column,
1304
- rule: RULE$77,
1453
+ rule: RULE$79,
1305
1454
  message: `msch runs ${dependent}, which needs ${peer} as a peer, so removing ${peer} with the override ${key} breaks msch. Remove the override.`
1306
1455
  });
1307
1456
  const removalsIn = (overrides) => pipe(overrides, Record.filter(isRemoval));
@@ -3439,7 +3588,7 @@ const matcher = (patterns) => {
3439
3588
  String$1.startsWith(NEGATION$1);
3440
3589
  String$1.slice(1);
3441
3590
  // src/features/check-placement/model/colocated-git-patterns.ts
3442
- const RULE$76 = "colocated-git-patterns";
3591
+ const RULE$78 = "colocated-git-patterns";
3443
3592
  const PATTERN_FILES = [":(glob)**/.gitignore", ":(glob)**/.gitattributes"];
3444
3593
  const ROOT$3 = ".";
3445
3594
  const NEGATION = "!";
@@ -3449,7 +3598,7 @@ const FLOATING_PREFIX = `${ANY_DEPTH}/`;
3449
3598
  const LEADING_SLASHES = /^\/+/u;
3450
3599
  const TRAILING_SLASHES = /\/+$/u;
3451
3600
  const SPACES = /\s+/u;
3452
- const FIRST$26 = 1;
3601
+ const FIRST$28 = 1;
3453
3602
  const READ_CONCURRENCY$40 = 16;
3454
3603
  const withoutPrefix = (prefix, text) => {
3455
3604
  if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
@@ -3474,7 +3623,7 @@ const entryOf$2 = (file, kind, directory) => (line, index) => {
3474
3623
  file,
3475
3624
  kind,
3476
3625
  directory,
3477
- line: index + FIRST$26,
3626
+ line: index + FIRST$28,
3478
3627
  pattern,
3479
3628
  values: Array$1.join(values, " ")
3480
3629
  });
@@ -3486,12 +3635,12 @@ const entriesIn$2 = Effect.fn("entriesIn")(function* entriesIn(root, file) {
3486
3635
  const toEntry = entryOf$2(absolute, files.basename(file), files.dirname(file));
3487
3636
  return pipe(Option.getOrElse(text, () => ""), String$1.split("\n"), Array$1.map(toEntry), Array$1.getSomes);
3488
3637
  });
3489
- const patternProblem = (entry, message) => problemAtPosition(RULE$76)(entry.file, {
3638
+ const patternProblem = (entry, message) => problemAtPosition(RULE$78)(entry.file, {
3490
3639
  line: entry.line,
3491
- column: FIRST$26
3640
+ column: FIRST$28
3492
3641
  }, message);
3493
3642
  const misplacedMessage = (kind, workspaces) => {
3494
- if (workspaces.length === FIRST$26) {
3643
+ if (workspaces.length === FIRST$28) {
3495
3644
  const workspace = Array$1.join(workspaces, "");
3496
3645
  return `matches only paths inside the workspace ${workspace}. Move it to ${workspace}/${kind} and write it relative to that directory.`;
3497
3646
  }
@@ -3549,8 +3698,8 @@ const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(functio
3549
3698
  return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
3550
3699
  });
3551
3700
  // src/features/check-placement/model/colocated-tests.ts
3552
- const RULE$75 = "colocated-test";
3553
- const FIRST$25 = 1;
3701
+ const RULE$77 = "colocated-test";
3702
+ const FIRST$27 = 1;
3554
3703
  const READ_CONCURRENCY$39 = 64;
3555
3704
  const ROOT_SUBPATH$1 = ".";
3556
3705
  const NAME_GROUP$2 = "name";
@@ -3570,9 +3719,9 @@ const SIBLING_MESSAGE = "refers to nothing in its own directory. Move the test n
3570
3719
  const byLength$2 = Order.mapInput(Order.Number, (directory) => directory.length);
3571
3720
  const problemFor$11 = (test, message) => ({
3572
3721
  file: test.file,
3573
- line: FIRST$25,
3574
- column: FIRST$25,
3575
- rule: RULE$75,
3722
+ line: FIRST$27,
3723
+ column: FIRST$27,
3724
+ rule: RULE$77,
3576
3725
  message: `${test.base} ${message}`
3577
3726
  });
3578
3727
  const groupsOf$1 = (source, pattern, group) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((match) => pipe(Option.fromUndefinedOr(match.groups), Option.flatMap((groups) => Option.fromUndefinedOr(groups[group])))), Array$1.getSomes);
@@ -3654,26 +3803,26 @@ const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblem
3654
3803
  });
3655
3804
  // src/features/check-placement/model/agent-docs-length.ts
3656
3805
  const RECOMMENDED_LINES = 200;
3657
- const FIRST$24 = 1;
3658
- const RULE$74 = "agent-docs-length";
3806
+ const FIRST$26 = 1;
3807
+ const RULE$76 = "agent-docs-length";
3659
3808
  const lineCount = (source) => pipe(String$1.trimEnd(source), String$1.split("\n")).length;
3660
3809
  const problemFor$10 = (file) => (lines) => {
3661
3810
  if (lines <= RECOMMENDED_LINES) return Option.none();
3662
3811
  return Option.some({
3663
3812
  file,
3664
3813
  line: 201,
3665
- column: FIRST$24,
3666
- rule: RULE$74,
3814
+ column: FIRST$26,
3815
+ rule: RULE$76,
3667
3816
  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.`
3668
3817
  });
3669
3818
  };
3670
3819
  /** @internal */
3671
3820
  const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$10(file)(lineCount(source)));
3672
3821
  // src/features/check-placement/model/claude-link.ts
3673
- const RULE$73 = "claude-md-link";
3822
+ const RULE$75 = "claude-md-link";
3674
3823
  const CLAUDE = "CLAUDE.md";
3675
3824
  const AGENTS = "AGENTS.md";
3676
- const FIRST$23 = 1;
3825
+ const FIRST$25 = 1;
3677
3826
  const READ_CONCURRENCY$37 = 16;
3678
3827
  const MESSAGE$15 = "CLAUDE.md must be a symbolic link to AGENTS.md";
3679
3828
  /** @internal */
@@ -3687,9 +3836,9 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3687
3836
  const pointsElsewhere = pipe(target, Option.exists((value) => value !== AGENTS));
3688
3837
  return pipe(Option.liftPredicate(file, () => !isLink || pointsElsewhere), Option.map((path) => ({
3689
3838
  file: path,
3690
- line: FIRST$23,
3691
- column: FIRST$23,
3692
- rule: RULE$73,
3839
+ line: FIRST$25,
3840
+ column: FIRST$25,
3841
+ rule: RULE$75,
3693
3842
  message: MESSAGE$15
3694
3843
  })));
3695
3844
  });
@@ -3698,9 +3847,9 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
3698
3847
  return Array$1.getSomes(found);
3699
3848
  });
3700
3849
  // src/features/check-placement/model/dangling-links.ts
3701
- const RULE$72 = "dangling-link";
3850
+ const RULE$74 = "dangling-link";
3702
3851
  const SEPARATOR$26 = "/";
3703
- const FIRST$22 = 1;
3852
+ const FIRST$24 = 1;
3704
3853
  const READ_CONCURRENCY$36 = 16;
3705
3854
  const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$26}`)(name);
3706
3855
  /** @internal */
@@ -3712,9 +3861,9 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3712
3861
  const link = yield* files.readLink(file);
3713
3862
  return pipe(link, Option.map((target) => files.relative(root, files.resolve(files.dirname(file), target))), Option.filter((target) => !pipe(listed, Array$1.some(holds(target)))), Option.map((target) => ({
3714
3863
  file,
3715
- line: FIRST$22,
3716
- column: FIRST$22,
3717
- rule: RULE$72,
3864
+ line: FIRST$24,
3865
+ column: FIRST$24,
3866
+ rule: RULE$74,
3718
3867
  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.`
3719
3868
  })));
3720
3869
  });
@@ -3723,7 +3872,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
3723
3872
  });
3724
3873
  // src/features/check-placement/model/member-sources.ts
3725
3874
  const ROOT_WORKSPACE$1 = ".";
3726
- const FIRST$21 = 1;
3875
+ const FIRST$23 = 1;
3727
3876
  const SEPARATOR$25 = "/";
3728
3877
  const EXCLUDED$7 = [
3729
3878
  ":(exclude,attr:linguist-vendored)",
@@ -3744,8 +3893,8 @@ const memberSources = Effect.fn("memberSources")(function* memberSources(root) {
3744
3893
  const byLength$1 = Order.mapInput(Order.Number, (directory) => directory.length);
3745
3894
  const fileProblem$1 = ({ file, rule, message }) => ({
3746
3895
  file,
3747
- line: FIRST$21,
3748
- column: FIRST$21,
3896
+ line: FIRST$23,
3897
+ column: FIRST$23,
3749
3898
  rule,
3750
3899
  message
3751
3900
  });
@@ -3772,7 +3921,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
3772
3921
  }));
3773
3922
  });
3774
3923
  // src/features/check-placement/model/deployed-readme.ts
3775
- const RULE$71 = "deployed-readme";
3924
+ const RULE$73 = "deployed-readme";
3776
3925
  const ROOT_DIRECTORY$4 = "";
3777
3926
  const READ_CONCURRENCY$35 = 16;
3778
3927
  const MISSING_MESSAGE$3 = "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.";
@@ -3812,14 +3961,14 @@ const problemIn$7 = Effect.fn("problemIn")(function* problemIn(root, directory)
3812
3961
  const readme = yield* readReadme({
3813
3962
  root,
3814
3963
  directory,
3815
- rule: RULE$71,
3964
+ rule: RULE$73,
3816
3965
  missingMessage: MISSING_MESSAGE$3
3817
3966
  });
3818
3967
  return Result.match(readme, {
3819
3968
  onFailure: Option.some,
3820
3969
  onSuccess: ({ file, source }) => pipe(Option.liftPredicate(source, (text) => !URL_PATTERN.test(text)), Option.map(() => fileProblem$1({
3821
3970
  file,
3822
- rule: RULE$71,
3971
+ rule: RULE$73,
3823
3972
  message: NO_URL_MESSAGE
3824
3973
  })))
3825
3974
  });
@@ -3836,7 +3985,7 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
3836
3985
  return Array$1.getSomes(found);
3837
3986
  });
3838
3987
  // src/features/check-placement/model/nested-docs.ts
3839
- const RULE$70 = "nested-docs";
3988
+ const RULE$72 = "nested-docs";
3840
3989
  const CONFIG_FILE$9 = "vite.config.ts";
3841
3990
  const SEPARATOR$24 = "/";
3842
3991
  const READ_CONCURRENCY$34 = 64;
@@ -3846,10 +3995,10 @@ const README = /^README(?:\.[^/]+)?$/iu;
3846
3995
  const MANIFEST$4 = "package.json";
3847
3996
  const MISSING_RULE = "workspace-agents-md";
3848
3997
  const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
3849
- const taggedError$13 = Schema.TaggedError;
3850
- var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
3998
+ const taggedError$14 = Schema.TaggedError;
3999
+ var RootConfigUnreadable = class extends taggedError$14()("RootConfigUnreadable", { file: Schema.String }) {};
3851
4000
  const isNested = (name) => String$1.includes(SEPARATOR$24)(name);
3852
- const problemFor$9 = problemInFile(RULE$70);
4001
+ const problemFor$9 = problemInFile(RULE$72);
3853
4002
  const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
3854
4003
  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.";
3855
4004
  const MISSING_MESSAGE$2 = "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.";
@@ -3906,7 +4055,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
3906
4055
  return [...Array$1.getSomes(found), ...missing];
3907
4056
  });
3908
4057
  // src/features/check-placement/model/published-readme.ts
3909
- const RULE$69 = "published-readme";
4058
+ const RULE$71 = "published-readme";
3910
4059
  const READ_CONCURRENCY$33 = 16;
3911
4060
  const MESSAGE$14 = "contains Japanese. This package is published to npm, so write its README in English.";
3912
4061
  const MISSING_MESSAGE$1 = "is missing. This package is published to npm, so give it an English README.md.";
@@ -3914,7 +4063,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3914
4063
  const readme = yield* readReadme({
3915
4064
  root,
3916
4065
  directory,
3917
- rule: RULE$69,
4066
+ rule: RULE$71,
3918
4067
  missingMessage: MISSING_MESSAGE$1
3919
4068
  });
3920
4069
  return Result.match(readme, {
@@ -3925,7 +4074,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
3925
4074
  file,
3926
4075
  line,
3927
4076
  column,
3928
- rule: RULE$69,
4077
+ rule: RULE$71,
3929
4078
  message: MESSAGE$14
3930
4079
  };
3931
4080
  }))
@@ -3938,7 +4087,7 @@ const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPu
3938
4087
  return Array$1.getSomes(found);
3939
4088
  });
3940
4089
  // src/features/check-placement/model/published-tests.ts
3941
- const RULE$68 = "published-tests";
4090
+ const RULE$70 = "published-tests";
3942
4091
  const FILE_START = 1;
3943
4092
  const TEST_FILE$3 = /\.test\.[cm]?[jt]sx?$/u;
3944
4093
  const MESSAGE$13 = "belongs to a package published to npm that has no tests. Write tests for what the package offers before publishing it.";
@@ -3952,7 +4101,7 @@ const problemFor$8 = Effect.fn("problemFor")(function* problemFor(root, listed,
3952
4101
  file: files.join(absolute, PACKAGE_JSON_FILE),
3953
4102
  line: FILE_START,
3954
4103
  column: FILE_START,
3955
- rule: RULE$68,
4104
+ rule: RULE$70,
3956
4105
  message: MESSAGE$13
3957
4106
  });
3958
4107
  });
@@ -3966,30 +4115,30 @@ const checkPublishedTests = Effect.fn("checkPublishedTests")(function* checkPubl
3966
4115
  return Array$1.getSomes(found);
3967
4116
  });
3968
4117
  // src/features/check-placement/model/root-docs.ts
3969
- const RULE$67 = "root-docs";
4118
+ const RULE$69 = "root-docs";
3970
4119
  const SEPARATOR$23 = "/";
3971
- const FIRST$20 = 1;
3972
- const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
4120
+ const FIRST$22 = 1;
4121
+ const MARKDOWN$7 = /\.(?:md|mdx|markdown)$/iu;
3973
4122
  const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
3974
4123
  const MESSAGE$12 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
3975
- const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$23)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
4124
+ const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$23)(name) && MARKDOWN$7.test(name) && !ALLOWED$1.test(name);
3976
4125
  /** @internal */
3977
4126
  const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
3978
4127
  const files = yield* RepositoryFiles;
3979
4128
  const names = yield* files.listedFiles(root);
3980
4129
  return pipe(names, Array$1.filter(isStrayRootDoc), Array$1.map((name) => ({
3981
4130
  file: files.join(root, name),
3982
- line: FIRST$20,
3983
- column: FIRST$20,
3984
- rule: RULE$67,
4131
+ line: FIRST$22,
4132
+ column: FIRST$22,
4133
+ rule: RULE$69,
3985
4134
  message: `${name} ${MESSAGE$12}`
3986
4135
  })));
3987
4136
  });
3988
4137
  // src/features/check-placement/model/root-readme.ts
3989
- const RULE$66 = "root-readme";
4138
+ const RULE$68 = "root-readme";
3990
4139
  const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
3991
4140
  const READ_CONCURRENCY$32 = 16;
3992
- const START$32 = 0;
4141
+ const START$34 = 0;
3993
4142
  const MARKETPLACE = ".claude-plugin/marketplace.json";
3994
4143
  const RELATIVE$4 = /^\.\//u;
3995
4144
  const MarketplacePlugin = Schema.Struct({
@@ -4025,17 +4174,17 @@ const patternFor = (plugins) => ({ directory, names }) => Array$1.findFirst(plug
4025
4174
  onNone: () => ownNames(plugins, names),
4026
4175
  onSome: () => [directory]
4027
4176
  }), patternOf$1);
4028
- const problemsIn$21 = (file, source, plugins) => (workspace) => {
4177
+ const problemsIn$22 = (file, source, plugins) => (workspace) => {
4029
4178
  const message = messageFor$5(workspace.directory);
4030
4179
  const at = positionOf(source);
4031
4180
  const pattern = patternFor(plugins)(workspace);
4032
- return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$66)(file, at(found.index ?? START$32), message)));
4181
+ return pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.map((found) => problemAtPosition(RULE$68)(file, at(found.index ?? START$34), message)));
4033
4182
  };
4034
4183
  const problemsInReadme = Effect.fn("problemsInReadme")(function* problemsInReadme(file, workspaces, plugins) {
4035
4184
  const text = yield* (yield* RepositoryFiles).readFile(file);
4036
4185
  return pipe(text, Option.match({
4037
4186
  onNone: () => [],
4038
- onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$21(file, source, plugins)))
4187
+ onSome: (source) => pipe(workspaces, Array$1.flatMap(problemsIn$22(file, source, plugins)))
4039
4188
  }));
4040
4189
  });
4041
4190
  /** @internal */
@@ -4066,7 +4215,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
4066
4215
  return Array$1.flatten(found);
4067
4216
  });
4068
4217
  // src/features/check-placement/model/docs-mirror.ts
4069
- const RULE$65 = "docs-mirror";
4218
+ const RULE$67 = "docs-mirror";
4070
4219
  const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
4071
4220
  const MIRROR_LIMIT = 3;
4072
4221
  const READ_CONCURRENCY$31 = 16;
@@ -4091,7 +4240,7 @@ const problemFor$7 = (file, source, mentions) => pipe(Array$1.head(mentions), Op
4091
4240
  file,
4092
4241
  line,
4093
4242
  column,
4094
- rule: RULE$65,
4243
+ rule: RULE$67,
4095
4244
  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.`
4096
4245
  };
4097
4246
  }), Option.toArray);
@@ -4123,9 +4272,9 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
4123
4272
  return Array$1.flatten(found);
4124
4273
  });
4125
4274
  // src/features/check-placement/model/ignored-sources.ts
4126
- const RULE$64 = "ignored-sources";
4275
+ const RULE$66 = "ignored-sources";
4127
4276
  const SOURCES = [":(glob)**/src/**", ":(exclude,glob)**/node_modules/**"];
4128
- const FIRST$19 = 1;
4277
+ const FIRST$21 = 1;
4129
4278
  const MESSAGE$11 = "is under src/ but .gitignore ignores it, so verify passes here while the file never reaches the commit. Narrow the pattern in .gitignore.";
4130
4279
  /** @internal */
4131
4280
  const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgnoredSources(root) {
@@ -4133,9 +4282,9 @@ const checkIgnoredSources = Effect.fn("checkIgnoredSources")(function* checkIgno
4133
4282
  const ignored = yield* files.ignoredFiles(root, SOURCES);
4134
4283
  return pipe(ignored, Array$1.map((file) => ({
4135
4284
  file: files.join(root, file),
4136
- line: FIRST$19,
4137
- column: FIRST$19,
4138
- rule: RULE$64,
4285
+ line: FIRST$21,
4286
+ column: FIRST$21,
4287
+ rule: RULE$66,
4139
4288
  message: MESSAGE$11
4140
4289
  })));
4141
4290
  });
@@ -4165,8 +4314,8 @@ const checkPublicEntries = Effect.fn("checkPublicEntries")(function* checkPublic
4165
4314
  return Array$1.flatten(entries);
4166
4315
  });
4167
4316
  // src/shared/lib/tree-sitter.ts
4168
- const taggedError$12 = Schema.TaggedError;
4169
- var GrammarUnreadable = class extends taggedError$12()("GrammarUnreadable", {
4317
+ const taggedError$13 = Schema.TaggedError;
4318
+ var GrammarUnreadable = class extends taggedError$13()("GrammarUnreadable", {
4170
4319
  grammar: Schema.String,
4171
4320
  message: Schema.String
4172
4321
  }) {};
@@ -4261,7 +4410,7 @@ const kindOf$1 = (inner) => {
4261
4410
  const isSliceIndex = (modulePath) => modulePath.length === 2 && Option.exists(Array$1.head(modulePath), (layer) => Array$1.contains(SLICED_LAYERS, layer));
4262
4411
  // src/features/check-placement/model/rust-syntax.ts
4263
4412
  const IGNORED_ITEMS = ["line_comment", "block_comment"];
4264
- const NEXT$5 = 1;
4413
+ const NEXT$6 = 1;
4265
4414
  const ALLOCATOR = "global_allocator";
4266
4415
  const field = (node, name) => Option.fromNullishOr(node.childForFieldName(name));
4267
4416
  const namedChildren = (node) => pipe(node.namedChildren, Array$1.flatMap((child) => Option.toArray(Option.fromNullishOr(child))));
@@ -4270,8 +4419,8 @@ const itemOf = (node) => ({
4270
4419
  name: Option.map(field(node, "name"), (name) => name.text),
4271
4420
  inline: Option.isSome(field(node, "body")),
4272
4421
  visible: Array$1.some(namedChildren(node), (child) => child.type === "visibility_modifier"),
4273
- line: node.startPosition.row + NEXT$5,
4274
- column: node.startPosition.column + NEXT$5
4422
+ line: node.startPosition.row + NEXT$6,
4423
+ column: node.startPosition.column + NEXT$6
4275
4424
  });
4276
4425
  const replacesAllocator = (root) => pipe(root.descendantsOfType("attribute"), Array$1.flatMap((node) => Option.toArray(Option.fromNullishOr(node))), Array$1.some((attribute) => Option.exists(Array$1.head(namedChildren(attribute)), (name) => name.text === ALLOCATOR)));
4277
4426
  const readRustFile = (root) => ({
@@ -12717,7 +12866,7 @@ const SLICE_RULE$1 = "feature-slice-name";
12717
12866
  const ENTRY_RULE$2 = "deploy-entry-name";
12718
12867
  const SEGMENT_RULE = "slice-segment-name";
12719
12868
  const SEPARATOR$21 = "/";
12720
- const NEXT$4 = 1;
12869
+ const NEXT$5 = 1;
12721
12870
  const WORD_SEPARATOR$1 = "-";
12722
12871
  const MINIMUM_WORDS = 2;
12723
12872
  const FEATURES$1 = "src/features/";
@@ -12757,19 +12906,19 @@ const isInSliceLayer = (parts) => {
12757
12906
  };
12758
12907
  const indexedSlice = (owned) => {
12759
12908
  const parts = String$1.split(owned.inner, SEPARATOR$21);
12760
- const depth = parts.length - NEXT$4;
12909
+ const depth = parts.length - NEXT$5;
12761
12910
  return pipe(Option.liftPredicate(depth, () => isInSliceLayer(parts) && INDEX.test(owned.inner) && Array$1.contains(SLICE_DEPTHS, depth)), Option.map(() => `${owned.workspace}${SEPARATOR$21}${pathPrefix(parts, depth)}`));
12762
12911
  };
12763
12912
  const misnamedSegment = (slices) => ({ workspace, inner }) => {
12764
12913
  const parts = String$1.split(inner, SEPARATOR$21);
12765
12914
  const insideSlice = (depth) => slices.has(`${workspace}${SEPARATOR$21}${pathPrefix(parts, depth)}`);
12766
- const isSegmentFolder = (depth) => parts.length > depth + NEXT$4 && SCRIPT.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
12767
- return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$21}${pathPrefix(parts, depth + NEXT$4)}`));
12915
+ const isSegmentFolder = (depth) => parts.length > depth + NEXT$5 && SCRIPT.test(inner) && !SEGMENTS.has(parts[depth] ?? "");
12916
+ return pipe(SLICE_DEPTHS, Array$1.findFirst(insideSlice), Option.filter(isSegmentFolder), Option.map((depth) => `${workspace}${SEPARATOR$21}${pathPrefix(parts, depth + NEXT$5)}`));
12768
12917
  };
12769
12918
  const deployNamed = ({ workspace, inner }) => {
12770
12919
  if (!String$1.startsWith(SOURCE$2)(inner)) return Option.none();
12771
12920
  const segments = String$1.split(inner, SEPARATOR$21);
12772
- return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$21}${Array$1.join(Array$1.take(segments, index + NEXT$4), SEPARATOR$21)}`));
12921
+ return pipe(Array$1.findFirstIndex(segments, (segment) => DEPLOY_MARKER.test(segment)), Option.map((index) => `${workspace}${SEPARATOR$21}${Array$1.join(Array$1.take(segments, index + NEXT$5), SEPARATOR$21)}`));
12773
12922
  };
12774
12923
  /** @internal */
12775
12924
  const checkSourceNames = Effect.fn("checkSourceNames")(function* checkSourceNames(root) {
@@ -12892,13 +13041,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
12892
13041
  return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
12893
13042
  });
12894
13043
  // src/features/check-placement/model/shadcn-ui-alias.ts
12895
- const RULE$63 = "shadcn-ui-alias";
12896
- const FIRST$18 = 1;
13044
+ const RULE$65 = "shadcn-ui-alias";
13045
+ const FIRST$20 = 1;
12897
13046
  const problemOf$12 = (directory, { file, alias }) => ({
12898
13047
  file,
12899
- line: FIRST$18,
12900
- column: FIRST$18,
12901
- rule: RULE$63,
13048
+ line: FIRST$20,
13049
+ column: FIRST$20,
13050
+ rule: RULE$65,
12902
13051
  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/*".`
12903
13052
  });
12904
13053
  /** @internal */
@@ -12963,7 +13112,7 @@ const WORKFLOW_DIRECTORY = ".github/";
12963
13112
  const SEPARATOR$20 = "/";
12964
13113
  const CURRENT = "./";
12965
13114
  const READ_CONCURRENCY$29 = 8;
12966
- const FIRST$17 = 1;
13115
+ const FIRST$19 = 1;
12967
13116
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
12968
13117
  const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
12969
13118
  const COMMAND_FILE$1 = /^bin\/[^/]+$/u;
@@ -12978,7 +13127,7 @@ const runsIn = ({ text, start }) => pipe(Array$1.fromIterable(String$1.matchAll(
12978
13127
  start
12979
13128
  })), Option.toArray)));
12980
13129
  const targetPaths = (held) => pipe(targetsIn(held), Array$1.map(withoutCurrent));
12981
- const entriesOf$1 = (manifest) => {
13130
+ const entriesOf$2 = (manifest) => {
12982
13131
  const bins = targetPaths(manifest.bin);
12983
13132
  return {
12984
13133
  all: [
@@ -12992,7 +13141,7 @@ const entriesOf$1 = (manifest) => {
12992
13141
  const declaredEntries = Effect.fn("declaredEntries")(function* declaredEntries(root, directory) {
12993
13142
  const files = yield* RepositoryFiles;
12994
13143
  const manifest = yield* readManifest(files.join(root, directory));
12995
- return pipe(manifest, Option.map(entriesOf$1), Option.getOrElse(() => NO_ENTRIES));
13144
+ return pipe(manifest, Option.map(entriesOf$2), Option.getOrElse(() => NO_ENTRIES));
12996
13145
  });
12997
13146
  const isCommand = (path) => COMMAND$1.test(path) && !NOT_COMMAND.test(path);
12998
13147
  const commandFilesIn$1 = Effect.fn("commandFilesIn")(function* commandFilesIn(root, directory) {
@@ -13015,7 +13164,7 @@ const outsideProblems = ({ file, source, runs, entries }) => pipe(runs, Array$1.
13015
13164
  message: `A task runs ${path}. Put each file that a task runs at ${BIN}/<name>.ts, the one place where every workspace keeps its commands, so that fallow and the other tools find it without a list of files.`
13016
13165
  })));
13017
13166
  const runsOf = (program) => pipe(nestedValues(RUN_TASKS)(program), Array$1.flatMap(stringsIn), Array$1.flatMap(runsIn));
13018
- const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
13167
+ const problemsIn$21 = Effect.fn("problemsIn")(function* problemsIn(root, directory, workflows) {
13019
13168
  const files = yield* RepositoryFiles;
13020
13169
  const config = yield* workspaceConfigOf(root, directory);
13021
13170
  const entries = yield* declaredEntries(root, directory);
@@ -13031,8 +13180,8 @@ const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, directo
13031
13180
  const isRun = (path) => Array$1.contains(runPaths, path) || Array$1.contains(entries.bins, path) || String$1.includes(workspacePath(directory, path))(workflows);
13032
13181
  const unrun = pipe(commands, Array$1.filter((path) => !isRun(path)), Array$1.map((path) => ({
13033
13182
  file: files.join(root, directory, path),
13034
- line: FIRST$17,
13035
- column: FIRST$17,
13183
+ line: FIRST$19,
13184
+ column: FIRST$19,
13036
13185
  rule: UNRUN,
13037
13186
  message: `No task, package.json bin or workflow runs ${workspacePath(directory, path)}. Files in ${BIN}/ are entry points for fallow, so an unused one is never reported. Run it from a task or delete it.`
13038
13187
  })));
@@ -13044,8 +13193,8 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
13044
13193
  const isDirectory = yield* files.isDirectory(file);
13045
13194
  return pipe(isDirectory, Option.filter(Boolean), Option.map(() => ({
13046
13195
  file,
13047
- line: FIRST$17,
13048
- column: FIRST$17,
13196
+ line: FIRST$19,
13197
+ column: FIRST$19,
13049
13198
  rule: SCRIPTS,
13050
13199
  message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
13051
13200
  })));
@@ -13057,8 +13206,8 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
13057
13206
  const prefix = workspacePath(directory, `${BIN}${SEPARATOR$20}`);
13058
13207
  return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$20}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
13059
13208
  file: files.join(root, file),
13060
- line: FIRST$17,
13061
- column: FIRST$17,
13209
+ line: FIRST$19,
13210
+ column: FIRST$19,
13062
13211
  rule: CODE_IN_BIN,
13063
13212
  message: `${file} is in ${BIN}/ but is not a command. Put only commands at ${BIN}/<name>.ts and the code that they share in the package own source, in a slice under src/, so that fallow judges it as ordinary code instead of as an entry point that is never reported unused.`
13064
13213
  })));
@@ -13067,7 +13216,7 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
13067
13216
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
13068
13217
  const all = ["", ...yield* workspaceDirectories(root)];
13069
13218
  const workflows = yield* workflowText(root);
13070
- const found = yield* Effect.forEach(all, (directory) => problemsIn$20(root, directory, workflows), { concurrency: READ_CONCURRENCY$29 });
13219
+ const found = yield* Effect.forEach(all, (directory) => problemsIn$21(root, directory, workflows), { concurrency: READ_CONCURRENCY$29 });
13071
13220
  const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$29 });
13072
13221
  const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$29 });
13073
13222
  return [
@@ -13077,14 +13226,14 @@ const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkComm
13077
13226
  ];
13078
13227
  });
13079
13228
  // src/features/check-repository-layout/model/path-mention.ts
13080
- const START$31 = 0;
13229
+ const START$33 = 0;
13081
13230
  const QUOTES = ["\"", "'"];
13082
13231
  const firstIndex = (source, needles) => {
13083
13232
  const found = pipe(needles, Array$1.flatMap((needle) => Option.toArray(String$1.indexOf(needle)(source))));
13084
13233
  return Array$1.head(Array$1.sort(found, Order.Number));
13085
13234
  };
13086
13235
  const quoted = (text) => pipe(QUOTES, Array$1.map((quote) => `${quote}${text}${quote}`));
13087
- const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$31));
13236
+ const indexOfText = (source) => (text) => pipe(firstIndex(source, quoted(text)), Option.orElse(() => firstIndex(source, [text])), Option.getOrElse(() => START$33));
13088
13237
  // src/features/check-repository-layout/model/cargo-paths.ts
13089
13238
  const MEMBER_LISTS = [
13090
13239
  "members",
@@ -13100,14 +13249,14 @@ const WORKSPACE = "workspace";
13100
13249
  const PATCH = "patch";
13101
13250
  const PATCH_DEPTH = 2;
13102
13251
  const WORKSPACE_DEPTH = 1;
13103
- const START$30 = 0;
13252
+ const START$32 = 0;
13104
13253
  const WILDCARD$4 = /[*?[]/u;
13105
13254
  const KEY_SEPARATOR$1 = ".";
13106
13255
  const decodeTable = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Unknown));
13107
13256
  const decodeStrings = Schema.decodeUnknownOption(Schema.Array(Schema.String));
13108
13257
  const decodePath = Schema.decodeUnknownOption(Schema.Struct({ path: Schema.String }));
13109
- 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$30).pipe(Option.exists((name) => name === PATCH));
13110
- const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$30).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
13258
+ 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$32).pipe(Option.exists((name) => name === PATCH));
13259
+ const listsMembers = (trail, key) => trail.length === WORKSPACE_DEPTH && Array$1.get(trail, START$32).pipe(Option.exists((name) => name === WORKSPACE)) && Array$1.contains(MEMBER_LISTS, key);
13111
13260
  const namedPaths = (trail, key, value) => {
13112
13261
  const field = Array$1.join([...trail, key], KEY_SEPARATOR$1);
13113
13262
  if (listsMembers(trail, key)) return pipe(decodeStrings(value), Option.getOrElse(() => []), Array$1.filter((member) => !WILDCARD$4.test(member)), Array$1.map((member) => ({
@@ -13166,7 +13315,7 @@ const tsconfigMentions = Effect.fn("tsconfigMentions")(function* tsconfigMention
13166
13315
  ])));
13167
13316
  });
13168
13317
  // src/features/check-repository-layout/model/config-paths.ts
13169
- const RULE$62 = "config-path";
13318
+ const RULE$64 = "config-path";
13170
13319
  const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
13171
13320
  const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
13172
13321
  const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
@@ -13185,14 +13334,14 @@ const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
13185
13334
  const problemOf$11 = (file, source) => (mention) => ({
13186
13335
  file,
13187
13336
  ...positionOf(source)(mention.index),
13188
- rule: RULE$62,
13337
+ rule: RULE$64,
13189
13338
  message: `${mention.field} names ${mention.text}, which does not exist in this repository. Point it at a path that exists or remove the entry.`
13190
13339
  });
13191
13340
  const mentionsIn = Effect.fn("mentionsIn")(function* mentionsIn(file, source) {
13192
13341
  if (CARGO_MANIFEST.test(file)) return cargoMentions(source);
13193
13342
  return yield* tsconfigMentions(file, source);
13194
13343
  });
13195
- const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
13344
+ const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
13196
13345
  const files = yield* RepositoryFiles;
13197
13346
  const file = files.join(root, name);
13198
13347
  const source = yield* files.readFile(file);
@@ -13210,7 +13359,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
13210
13359
  return pipe(patterns, Array$1.map((pattern) => ({
13211
13360
  file,
13212
13361
  ...positionOf(source.value)(indexOfText(source.value)(pattern)),
13213
- rule: RULE$62,
13362
+ rule: RULE$64,
13214
13363
  message: `packages lists ${pattern}, which matches no workspace package. Point it at directories that have a package.json or remove the entry.`
13215
13364
  })));
13216
13365
  });
@@ -13218,23 +13367,23 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
13218
13367
  const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
13219
13368
  const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
13220
13369
  const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
13221
- const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$19(root, name), { concurrency: READ_CONCURRENCY$28 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
13370
+ const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$20(root, name), { concurrency: READ_CONCURRENCY$28 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
13222
13371
  return [...Array$1.flatten(found), ...patterns];
13223
13372
  });
13224
13373
  // src/features/check-repository-layout/model/crates.ts
13225
- const RULE$61 = "unverified-crate";
13374
+ const RULE$63 = "unverified-crate";
13226
13375
  const VERSION_RULE = "release-version";
13227
13376
  const APP_DIRECTORIES = ["", "src-tauri"];
13228
13377
  const CARGO_FILE$1 = "Cargo.toml";
13229
13378
  const CONFIG_FILE$8 = "vite.config.ts";
13230
13379
  const SEPARATOR$18 = "/";
13231
- const FIRST$16 = 1;
13380
+ const FIRST$18 = 1;
13232
13381
  const READ_CONCURRENCY$27 = 8;
13233
13382
  const problemFor$6 = (crate, message) => ({
13234
13383
  file: crate.manifest,
13235
- line: FIRST$16,
13236
- column: FIRST$16,
13237
- rule: RULE$61,
13384
+ line: FIRST$18,
13385
+ column: FIRST$18,
13386
+ rule: RULE$63,
13238
13387
  message: `crate ${crate.name} ${message}, so vp run verify never checks it.`
13239
13388
  });
13240
13389
  const problemIn$3 = Effect.fn("problemIn")(function* problemIn(root, directories, crate) {
@@ -13254,8 +13403,8 @@ const versionProblemIn = Effect.fn("versionProblemIn")(function* versionProblemI
13254
13403
  if (Option.isNone(version) || version.value === crate.version) return Option.none();
13255
13404
  return Option.some({
13256
13405
  file: crate.manifest,
13257
- line: FIRST$16,
13258
- column: FIRST$16,
13406
+ line: FIRST$18,
13407
+ column: FIRST$18,
13259
13408
  rule: VERSION_RULE,
13260
13409
  message: `crate ${crate.name} is version ${crate.version} but ${workspace.value}/${PACKAGE_JSON_FILE} is ${version.value}. msch publish releases the version in package.json, so bump both in the same PR.`
13261
13410
  });
@@ -13273,7 +13422,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
13273
13422
  return Array$1.getSomes(Array$1.flatten(found));
13274
13423
  });
13275
13424
  // src/features/check-repository-layout/model/deploy-entry-patterns.ts
13276
- const RULE$60 = "deploy-entry-pattern";
13425
+ const RULE$62 = "deploy-entry-pattern";
13277
13426
  const FALLOW_KEYS = [
13278
13427
  "entry",
13279
13428
  "entryPoints",
@@ -13328,7 +13477,7 @@ const patternsOf = Effect.fn("patternsOf")(function* patternsOf(file, text, kind
13328
13477
  const parsed = yield* Effect.promise(() => parse(`${file}.ts`, kind.sourceOf(text), { lang: "ts" }));
13329
13478
  return pipe(patternsIn(kind.keys)(parsed.program), Array$1.filter(({ text: pattern }) => !String$1.startsWith(NEGATED)(pattern)));
13330
13479
  });
13331
- const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
13480
+ const problemsIn$19 = Effect.fn("problemsIn")(function* problemsIn(request) {
13332
13481
  const { root, file, kind, workspaces, entries } = request;
13333
13482
  const files = yield* RepositoryFiles;
13334
13483
  const path = files.join(root, file);
@@ -13344,7 +13493,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(request) {
13344
13493
  return pipe(Array$1.getSomes(flagged), Array$1.map(({ text: pattern, start }) => ({
13345
13494
  file: path,
13346
13495
  ...positionOf(text.value)(start - kind.offset),
13347
- rule: RULE$60,
13496
+ rule: RULE$62,
13348
13497
  message: `${pattern} ${MESSAGE$10}`
13349
13498
  })));
13350
13499
  });
@@ -13367,7 +13516,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
13367
13516
  }];
13368
13517
  return [];
13369
13518
  }));
13370
- const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$18({
13519
+ const found = yield* Effect.forEach(configs, ({ file, kind }) => problemsIn$19({
13371
13520
  root,
13372
13521
  file,
13373
13522
  kind,
@@ -13377,7 +13526,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
13377
13526
  return Array$1.flatten(found);
13378
13527
  });
13379
13528
  // src/features/check-repository-layout/model/fallow-entries.ts
13380
- const RULE$59 = "listed-entry";
13529
+ const RULE$61 = "listed-entry";
13381
13530
  const ENTRY_KEYS = [
13382
13531
  "entry",
13383
13532
  "entryPoints",
@@ -13398,7 +13547,7 @@ const entryPatternsIn = (node) => {
13398
13547
  return pipe(childrenOf$4(node), Array$1.flatMap(entryPatternsIn));
13399
13548
  };
13400
13549
  const namesOneFile = (directories) => ({ text }) => pipe(directories, Array$1.some((directory) => String$1.startsWith(`${directory}${SEPARATOR$17}`)(text))) || String$1.includes(SEPARATOR$17)(text) && !WILDCARD$2.test(text);
13401
- const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
13550
+ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, directories) {
13402
13551
  const files = yield* RepositoryFiles;
13403
13552
  const path = files.join(root, file);
13404
13553
  const text = yield* files.readFile(path);
@@ -13407,7 +13556,7 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
13407
13556
  return pipe(entryPatternsIn(parsed.program), Array$1.filter(namesOneFile(directories)), Array$1.map(({ text: pattern, start }) => ({
13408
13557
  file: path,
13409
13558
  ...positionOf(text.value)(start),
13410
- rule: RULE$59,
13559
+ rule: RULE$61,
13411
13560
  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.`
13412
13561
  })));
13413
13562
  });
@@ -13415,30 +13564,30 @@ const problemsIn$17 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
13415
13564
  const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
13416
13565
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
13417
13566
  const directories = yield* workspaceDirectories(root);
13418
- const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$17(root, file, directories), { concurrency: READ_CONCURRENCY$25 });
13567
+ const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$18(root, file, directories), { concurrency: READ_CONCURRENCY$25 });
13419
13568
  return Array$1.flatten(found);
13420
13569
  });
13421
13570
  // src/features/check-repository-layout/model/root-workspace-paths.ts
13422
- const RULE$58 = "root-workspace-path";
13571
+ const RULE$60 = "root-workspace-path";
13423
13572
  const CONFIG_FILE$7 = "vite.config.ts";
13424
13573
  const PATH_CHARACTER = /[\w.@/-]/u;
13425
13574
  const NAME_CHARACTER = /[\w.@-]/u;
13426
- const FIRST$15 = 0;
13427
- const NEXT$3 = 1;
13575
+ const FIRST$17 = 0;
13576
+ const NEXT$4 = 1;
13428
13577
  const isBoundary = (character, allowed) => character === "" || !allowed.test(character);
13429
13578
  const mentions = (directory) => (text) => {
13430
13579
  const parts = String$1.split(text, directory);
13431
- return pipe(Array$1.drop(parts, NEXT$3), Array$1.some((after, index) => {
13580
+ return pipe(Array$1.drop(parts, NEXT$4), Array$1.some((after, index) => {
13432
13581
  const before = parts[index] ?? "";
13433
- const previous = String$1.slice(before.length - NEXT$3)(before);
13434
- const following = String$1.slice(FIRST$15, NEXT$3)(after);
13582
+ const previous = String$1.slice(before.length - NEXT$4)(before);
13583
+ const following = String$1.slice(FIRST$17, NEXT$4)(after);
13435
13584
  return isBoundary(previous, PATH_CHARACTER) && (following === "/" || isBoundary(following, NAME_CHARACTER));
13436
13585
  }));
13437
13586
  };
13438
- const problemsIn$16 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
13587
+ const problemsIn$17 = (file, source, directories) => (found) => pipe(directories, Array$1.filter((directory) => mentions(directory)(found.text)), Array$1.map((directory) => ({
13439
13588
  file,
13440
13589
  ...positionOf(source)(found.start),
13441
- rule: RULE$58,
13590
+ rule: RULE$60,
13442
13591
  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.`
13443
13592
  })));
13444
13593
  /** @internal */
@@ -13449,12 +13598,12 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
13449
13598
  if (Option.isNone(source)) return [];
13450
13599
  const directories = yield* workspaceDirectories(root);
13451
13600
  const parsed = yield* Effect.promise(() => parse(file, source.value, { lang: "ts" }));
13452
- return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$16(file, source.value, directories)));
13601
+ return pipe(stringsIn(parsed.program), Array$1.flatMap(problemsIn$17(file, source.value, directories)));
13453
13602
  });
13454
13603
  // src/features/check-repository-layout/model/hidden-verify.ts
13455
- const RULE$57 = "hidden-verify";
13604
+ const RULE$59 = "hidden-verify";
13456
13605
  const CONFIG_FILE$6 = "vite.config.ts";
13457
- const FIRST$14 = 1;
13606
+ const FIRST$16 = 1;
13458
13607
  const READ_CONCURRENCY$24 = 8;
13459
13608
  const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
13460
13609
  const config = yield* workspaceConfigOf(root, directory);
@@ -13464,9 +13613,9 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
13464
13613
  const verified = yield* hasVerifyTask(file);
13465
13614
  return Option.some({
13466
13615
  file,
13467
- line: FIRST$14,
13468
- column: FIRST$14,
13469
- rule: RULE$57,
13616
+ line: FIRST$16,
13617
+ column: FIRST$16,
13618
+ rule: RULE$59,
13470
13619
  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}.`
13471
13620
  }).pipe(Option.filter(() => verified));
13472
13621
  });
@@ -13477,7 +13626,7 @@ const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVe
13477
13626
  return Array$1.getSomes(found);
13478
13627
  });
13479
13628
  // src/features/check-repository-layout/model/shared-uncached-tasks.ts
13480
- const RULE$56 = "shared-uncached-task";
13629
+ const RULE$58 = "shared-uncached-task";
13481
13630
  const READ_CONCURRENCY$23 = 8;
13482
13631
  const SHARED = 2;
13483
13632
  const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
@@ -13520,7 +13669,7 @@ const problemsOf$3 = (definitions) => {
13520
13669
  return pipe(definitions, Array$1.map(({ file, position, name, command }) => ({
13521
13670
  file,
13522
13671
  ...position,
13523
- rule: RULE$56,
13672
+ rule: RULE$58,
13524
13673
  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.`
13525
13674
  })));
13526
13675
  };
@@ -13531,7 +13680,7 @@ const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function*
13531
13680
  return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
13532
13681
  });
13533
13682
  // src/features/check-repository-layout/model/tested-verify.ts
13534
- const RULE$55 = "tested-verify";
13683
+ const RULE$57 = "tested-verify";
13535
13684
  const READ_CONCURRENCY$22 = 8;
13536
13685
  const TESTS = new Set(TEST_TASK_NAMES);
13537
13686
  const RUNS_TESTS = /\b(?:vp|cargo) test\b/u;
@@ -13555,23 +13704,23 @@ const testedEdges = (tasks) => {
13555
13704
  const byName = new Map(pipe(tasks, Array$1.map(named$1)));
13556
13705
  return edgesFrom(byName, /* @__PURE__ */ new Set())(TASK_NAMES.verify);
13557
13706
  };
13558
- const problemsIn$15 = Effect.fn("problemsIn")(function* problemsIn(root, directory) {
13707
+ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, directory) {
13559
13708
  const config = yield* workspaceConfigOf(root, directory);
13560
13709
  return pipe(Option.toArray(config), Array$1.flatMap(({ file, source, program }) => pipe(testedEdges(runTasksIn(program)), Array$1.map(({ to, at }) => ({
13561
13710
  file,
13562
13711
  ...positionOf(source)(at.start),
13563
- rule: RULE$55,
13712
+ rule: RULE$57,
13564
13713
  message: `The verify task of ${directory} runs tests through ${to}. verify is what the pre-push hook runs, and tests run in CI through the root ci task, which runs the test and cargo-test tasks of every workspace. Move them into this workspace's test or cargo-test task, and take them out of verify.`
13565
13714
  })))));
13566
13715
  });
13567
13716
  /** @internal */
13568
13717
  const checkTestedVerify = Effect.fn("checkTestedVerify")(function* checkTestedVerify(root) {
13569
13718
  const directories = yield* workspaceDirectories(root);
13570
- const found = yield* Effect.forEach(directories, (directory) => problemsIn$15(root, directory), { concurrency: READ_CONCURRENCY$22 });
13719
+ const found = yield* Effect.forEach(directories, (directory) => problemsIn$16(root, directory), { concurrency: READ_CONCURRENCY$22 });
13571
13720
  return Array$1.flatten(found);
13572
13721
  });
13573
13722
  // src/features/check-repository-layout/model/unlocked-tasks.ts
13574
- const RULE$54 = "unlocked-task";
13723
+ const RULE$56 = "unlocked-task";
13575
13724
  const READ_CONCURRENCY$21 = 8;
13576
13725
  const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
13577
13726
  const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
@@ -13583,7 +13732,7 @@ const tracksLockfiles = (task) => pipe(propertyValue("cache")(task.value), Optio
13583
13732
  const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tracksLockfiles), Array$1.flatMap((task) => pipe(commandOf(task), Option.map((command) => ({
13584
13733
  file,
13585
13734
  ...positionOf(source)(task.start),
13586
- rule: RULE$54,
13735
+ rule: RULE$56,
13587
13736
  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.`
13588
13737
  })), Option.toArray)));
13589
13738
  /** @internal */
@@ -13717,7 +13866,7 @@ const packagesByEntry = Effect.fn("packagesByEntry")(function* packagesByEntry(a
13717
13866
  }).pipe(Effect.map((packages) => [entry, packages])), { concurrency: 1 });
13718
13867
  });
13719
13868
  // src/features/measure-install-size/model/installed-closure.ts
13720
- const EMPTY$4 = 0;
13869
+ const EMPTY$5 = 0;
13721
13870
  const installedNames = (manifest) => [...namesIn$1(manifest, ["dependencies", "optionalDependencies"]), ...pipe(namesIn$1(manifest, ["peerDependencies"]), Array$1.difference(optionalPeerNames(manifest)))];
13722
13871
  const childrenOf$2 = Effect.fn("childrenOf")(function* childrenOf(directory) {
13723
13872
  const files = yield* RepositoryFiles;
@@ -13760,7 +13909,7 @@ const directorySize = (directory) => Effect.gen(function* sizeOfDirectory() {
13760
13909
  const names = yield* files.readDirectory(directory);
13761
13910
  const entries = pipe(names, Array$1.filter((name) => name !== NODE_MODULES$2), Array$1.map((name) => files.join(directory, name)));
13762
13911
  const sizes = yield* Effect.forEach(entries, (entry) => files.isDirectory(entry).pipe(Effect.flatMap((kind) => {
13763
- if (Option.isNone(kind)) return Effect.succeed(EMPTY$4);
13912
+ if (Option.isNone(kind)) return Effect.succeed(EMPTY$5);
13764
13913
  if (kind.value) return directorySize(entry);
13765
13914
  return files.fileSize(entry);
13766
13915
  })), { concurrency: 1 });
@@ -13772,7 +13921,7 @@ const installedClosure = ({ provided, from, name }) => closureOf$2(provided, {
13772
13921
  });
13773
13922
  const installedSize = (directory) => {
13774
13923
  if (String$1.includes(`/node_modules/`)(directory)) return directorySize(directory);
13775
- return Effect.succeed(EMPTY$4);
13924
+ return Effect.succeed(EMPTY$5);
13776
13925
  };
13777
13926
  // src/features/measure-install-size/model/install-size.ts
13778
13927
  const INSTALL_SIZE = "install-size";
@@ -13783,11 +13932,11 @@ const LISTED_LARGEST = 5;
13783
13932
  const SIZE_CONCURRENCY = 32;
13784
13933
  const MEGABYTE = 1e6;
13785
13934
  const MEGABYTE_DIGITS = 1;
13786
- const START$29 = 0;
13935
+ const START$31 = 0;
13787
13936
  const SINGLE_ENTRY = 1;
13788
13937
  const megabytes = (bytes) => `${(bytes / MEGABYTE).toFixed(MEGABYTE_DIGITS)} MB`;
13789
13938
  const usageHint = (dependency, entryCount) => {
13790
- if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$29 && dependency.entries.length < entryCount)) return "";
13939
+ if (!(entryCount > SINGLE_ENTRY && dependency.entries.length > START$31 && dependency.entries.length < entryCount)) return "";
13791
13940
  return ` (imported only from ${Array$1.join(dependency.entries, ", ")})`;
13792
13941
  };
13793
13942
  const listed$1 = ({ largest, entryCount }) => pipe(largest, Array$1.map((dependency) => `${dependency.name} ${megabytes(dependency.size)}${usageHint(dependency, entryCount)}`), Array$1.join(", "));
@@ -13796,7 +13945,7 @@ const budgetProblem = Effect.fn("budgetProblem")(function* budgetProblem(overrun
13796
13945
  const { workspace, total } = overrun;
13797
13946
  const config = yield* files.readFile(workspace.configFile);
13798
13947
  const source = Option.getOrElse(config, () => "");
13799
- const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$29);
13948
+ const index = Option.getOrElse(String$1.indexOf(BUDGET_KEY)(source), () => START$31);
13800
13949
  return {
13801
13950
  file: workspace.configFile,
13802
13951
  ...positionOf(source)(index),
@@ -13813,7 +13962,7 @@ const measure = Effect.fn("measure")(function* measure({ workspace, provided },
13813
13962
  const everything = pipe(closures, Array$1.flatMap(([, packages]) => Array$1.fromIterable(packages)), HashSet.fromIterable);
13814
13963
  const measured = yield* Effect.forEach(everything, (found) => installedSize(found).pipe(Effect.map((size) => [found, size])), { concurrency: SIZE_CONCURRENCY });
13815
13964
  const sizes = HashMap.fromIterable(measured);
13816
- const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => sizes.pipe(HashMap.get(found), Option.getOrElse(() => START$29))), Number$1.sumAll);
13965
+ const sizeOf = (packages) => packages.pipe(Array$1.fromIterable, Array$1.map((found) => sizes.pipe(HashMap.get(found), Option.getOrElse(() => START$31))), Number$1.sumAll);
13817
13966
  return {
13818
13967
  closures,
13819
13968
  sizeOf,
@@ -13846,11 +13995,11 @@ const sizeProblems$1 = Effect.fn("sizeProblems")(function* sizeProblems(publishe
13846
13995
  })];
13847
13996
  });
13848
13997
  const stackProblems = (file, source, dependencies) => {
13849
- const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$29);
13998
+ const section = Option.getOrElse(String$1.indexOf(DEPENDENCIES_KEY$1)(source), () => START$31);
13850
13999
  const rest = String$1.slice(section)(source);
13851
14000
  return pipe(Record.toEntries(dependencies), Array$1.filter(([, specifier]) => specifier === STACK_CATALOG), Array$1.map(([name]) => ({
13852
14001
  file,
13853
- ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$29)),
14002
+ ...positionOf(source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$31)),
13854
14003
  rule: STACK_DEPENDENCY,
13855
14004
  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.`
13856
14005
  })));
@@ -13899,11 +14048,11 @@ const baseRevision = Effect.fn("baseRevision")(function* baseRevision(root) {
13899
14048
  return yield* files.mergeBase(root, base);
13900
14049
  });
13901
14050
  // src/features/check-migration-order/model/migration-order.ts
13902
- const RULE$53 = "migration-order";
14051
+ const RULE$55 = "migration-order";
13903
14052
  const SNAPSHOT = "snapshot.json";
13904
14053
  const MIGRATION = "migration.sql";
13905
14054
  const SNAPSHOTS = [`*/${SNAPSHOT}`];
13906
- const FIRST$13 = 1;
14055
+ const FIRST$15 = 1;
13907
14056
  const READ_CONCURRENCY$20 = 16;
13908
14057
  const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
13909
14058
  const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
@@ -13931,9 +14080,9 @@ const latestOf = (migrations) => pipe(migrations, Array$1.filter(({ applied }) =
13931
14080
  const isBefore = (later) => (migration) => !migration.applied && Order.isLessThan(String$1.Order)(migration.folder, later.folder);
13932
14081
  const outOfOrder = (root, base, join) => (migrations) => pipe(latestOf(migrations), Option.map((latest) => pipe(migrations, Array$1.filter(isBefore(latest)), Array$1.map(({ file, folder }) => ({
13933
14082
  file: join(root, file),
13934
- line: FIRST$13,
13935
- column: FIRST$13,
13936
- rule: RULE$53,
14083
+ line: FIRST$15,
14084
+ column: FIRST$15,
14085
+ rule: RULE$55,
13937
14086
  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}.`
13938
14087
  })))), Option.getOrElse(() => []));
13939
14088
  /** @internal */
@@ -14036,15 +14185,15 @@ const vendorFiles = Effect.fn("vendorFiles")(function* vendorFiles(request) {
14036
14185
  return pipe(output.output, Array$1.filter(isChunk$2), Array$1.map((chunk) => [chunk.fileName, chunk.code]), Record.fromEntries, Record.set(`${request.name}.d.ts`, `export * from "${request.name}";\n`));
14037
14186
  });
14038
14187
  // src/features/check-mod-vendor/model/mod-vendor.ts
14039
- const RULE$52 = "mod-vendor";
14188
+ const RULE$54 = "mod-vendor";
14040
14189
  const VENDOR = "vendor";
14041
14190
  const SOURCE_FILE$2 = /\.[cm]?[jt]sx?$/u;
14042
14191
  const RELATIVE$1 = /^\.\.?\//u;
14043
14192
  const FILE_LIMIT = 1048576;
14044
14193
  const TOTAL_LIMIT = 8388608;
14045
14194
  const CONCURRENCY$6 = 4;
14046
- const EMPTY$3 = "";
14047
- const problemFor$5 = problemInFile(RULE$52);
14195
+ const EMPTY$4 = "";
14196
+ const problemFor$5 = problemInFile(RULE$54);
14048
14197
  const isModSource = (directory) => (file) => String$1.startsWith(directory)(file) && !String$1.startsWith(`${directory}${VENDOR}/`)(file) && SOURCE_FILE$2.test(file);
14049
14198
  const sourcesOf$2 = (plugin, directory, join) => pipe(plugin.files, Array$1.filter(isModSource(directory)), Array$1.map((file) => join(plugin.directory, file)));
14050
14199
  const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
@@ -14060,7 +14209,7 @@ const modsOf = Effect.fn("modsOf")(function* modsOf(root, plugin) {
14060
14209
  });
14061
14210
  const wantedIn$1 = Effect.fn("wantedIn")(function* wantedIn(mod, file) {
14062
14211
  const files = yield* RepositoryFiles;
14063
- const declarations = (yield* files.readFile(file)).pipe(Option.getOrElse(() => EMPTY$3), importedNames$1);
14212
+ const declarations = (yield* files.readFile(file)).pipe(Option.getOrElse(() => EMPTY$4), importedNames$1);
14064
14213
  const directory = files.dirname(file);
14065
14214
  const packagesOf = (specifier) => vendorPackageOf(mod.vendor, files.join(directory, specifier));
14066
14215
  return pipe(declarations, Array$1.filter(({ specifier }) => RELATIVE$1.test(specifier)), Array$1.flatMap(({ specifier, names }) => pipe(packagesOf(specifier), Array$1.map((name) => [name, names]))));
@@ -14149,7 +14298,7 @@ const unresolvedFrom = (entries) => Effect.acquireUseRelease(Effect.tryPromise({
14149
14298
  catch: bundleErrorDetail
14150
14299
  }), (bundle) => Effect.promise(() => bundle.close())).pipe(Effect.map(({ output }) => unresolvedIn(pipe(output, Array$1.filter(isChunk$1)))));
14151
14300
  // src/features/check-plugin-dependencies/model/plugin-dependencies.ts
14152
- const RULE$51 = "plugin-dependencies";
14301
+ const RULE$53 = "plugin-dependencies";
14153
14302
  const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
14154
14303
  const LOCK_FILE = "bun.lock";
14155
14304
  const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
@@ -14158,7 +14307,7 @@ const SUCCESS$6 = 0;
14158
14307
  const NOT_STARTED = -1;
14159
14308
  const DETAIL_LINES = 3;
14160
14309
  const PLUGIN_CONCURRENCY = 2;
14161
- const problemFor$4 = problemInFile(RULE$51);
14310
+ const problemFor$4 = problemInFile(RULE$53);
14162
14311
  const hasDependencies = Effect.fn("hasDependencies")(function* hasDependencies(directory) {
14163
14312
  const files = yield* RepositoryFiles;
14164
14313
  const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));
@@ -14263,8 +14412,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
14263
14412
  const builtins = new Set(builtinModules);
14264
14413
  const always = () => true;
14265
14414
  const never = () => false;
14266
- const taggedError$11 = Schema.TaggedError;
14267
- var BundleFailed = class extends taggedError$11()("BundleFailed", { detail: Schema.String }) {};
14415
+ const taggedError$12 = Schema.TaggedError;
14416
+ var BundleFailed = class extends taggedError$12()("BundleFailed", { detail: Schema.String }) {};
14268
14417
  const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
14269
14418
  const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
14270
14419
  const isBuiltin = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
@@ -14387,9 +14536,9 @@ const bundleScopeOf = ({ manifest, workspace }) => ({
14387
14536
  });
14388
14537
  const stackPackagesOf = ({ devDependencies }) => pipe(Option.fromUndefinedOr(devDependencies), Option.map(Record.filter((specifier) => specifier === STACK_CATALOG)), Option.map(Record.keys), Option.getOrElse(() => []));
14389
14538
  // src/features/check-tree-shaking/model/optional-peers.ts
14390
- const RULE$50 = "optional-peer";
14539
+ const RULE$52 = "optional-peer";
14391
14540
  const REQUIRED_RULE = "required-peer";
14392
- const START$28 = 0;
14541
+ const START$30 = 0;
14393
14542
  const SINGLE$3 = 1;
14394
14543
  const DEPENDENCIES_KEY = "\"dependencies\"";
14395
14544
  const PEER_META_KEY = "\"peerDependenciesMeta\"";
@@ -14397,14 +14546,14 @@ const importsPackage = (name) => ({ packages }) => Array$1.contains(packages, na
14397
14546
  const loadsAtStartup = (name) => ({ startup }) => Array$1.contains(startup, name);
14398
14547
  const labelsOf$1 = (importers) => pipe(importers, Array$1.map(({ entry }) => `\`${entry.label}\``), Array$1.dedupe, Array$1.join(", "));
14399
14548
  const positionIn = (located, key, name) => {
14400
- const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$28);
14549
+ const section = Option.getOrElse(String$1.indexOf(key)(located.source), () => START$30);
14401
14550
  const rest = String$1.slice(section)(located.source);
14402
- return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$28));
14551
+ return positionOf(located.source)(section + Option.getOrElse(String$1.indexOf(`"${name}"`)(rest), () => START$30));
14403
14552
  };
14404
14553
  const problemFor$3 = (located, name, importers) => ({
14405
14554
  file: located.file,
14406
14555
  ...positionIn(located, DEPENDENCIES_KEY, name),
14407
- rule: RULE$50,
14556
+ rule: RULE$52,
14408
14557
  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.`
14409
14558
  });
14410
14559
  const requiredPeerAdvice = (fromStack) => {
@@ -14419,7 +14568,7 @@ const optionalPeerProblems = ({ located, manifest, used }) => {
14419
14568
  return pipe(Record.keys(manifest.dependencies ?? {}), Array$1.flatMap((name) => {
14420
14569
  const importers = pipe(libraries, Array$1.filter(importsPackage(name)));
14421
14570
  const neededByBin = pipe(bins, Array$1.some(importsPackage(name)));
14422
- if (!(importers.length > START$28 && importers.length < libraries.length) || neededByBin) return [];
14571
+ if (!(importers.length > START$30 && importers.length < libraries.length) || neededByBin) return [];
14423
14572
  return [problemFor$3(located, name, importers)];
14424
14573
  }));
14425
14574
  };
@@ -14440,10 +14589,10 @@ const requiredPeerProblems = ({ located, manifest, used }) => {
14440
14589
  }));
14441
14590
  };
14442
14591
  // src/features/check-tree-shaking/model/side-effects.ts
14443
- const RULE$49 = "side-effects";
14592
+ const RULE$51 = "side-effects";
14444
14593
  const BUNDLE_CONCURRENCY$2 = 4;
14445
- const START$27 = 0;
14446
- const FIRST$12 = 1;
14594
+ const START$29 = 0;
14595
+ const FIRST$14 = 1;
14447
14596
  const LISTED_PACKAGES = 4;
14448
14597
  const SIDE_EFFECTS_KEY = "\"sideEffects\"";
14449
14598
  const EXPORTS_KEY = "\"exports\"";
@@ -14466,7 +14615,7 @@ const memberExcess = Effect.fn("memberExcess")(function* memberExcess({ scope, e
14466
14615
  label: entry.label,
14467
14616
  member,
14468
14617
  ...extra
14469
- }, ({ modules }) => modules > START$27);
14618
+ }, ({ modules }) => modules > START$29);
14470
14619
  });
14471
14620
  const excessOf = Effect.fn("excessOf")(function* excessOf(subject) {
14472
14621
  const names = yield* exportNamesOf(subject.scope, subject.entry.source);
@@ -14483,20 +14632,20 @@ const importsOf$1 = (packages) => Array$1.match(packages, {
14483
14632
  onNonEmpty: (names) => ` and imports ${listed(names)}`
14484
14633
  });
14485
14634
  const othersOf = (total) => {
14486
- if (total <= FIRST$12) return "";
14487
- return ` The same happens for ${String(total - FIRST$12)} other exports.`;
14635
+ if (total <= FIRST$14) return "";
14636
+ return ` The same happens for ${String(total - FIRST$14)} other exports.`;
14488
14637
  };
14489
- const messageOf$5 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf$1(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.`;
14638
+ const messageOf$6 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf$1(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.`;
14490
14639
  const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
14491
- const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$27));
14640
+ const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$29));
14492
14641
  const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
14493
14642
  file,
14494
14643
  ...positionOf(source)(keyIndex$1(source)),
14495
- rule: RULE$49,
14496
- message: messageOf$5(worst, excesses.length)
14644
+ rule: RULE$51,
14645
+ message: messageOf$6(worst, excesses.length)
14497
14646
  })), Option.toArray);
14498
14647
  // src/features/check-tree-shaking/model/top-level-effects.ts
14499
- const RULE$48 = "top-level-effect";
14648
+ const RULE$50 = "top-level-effect";
14500
14649
  const CODE$1 = /\.[cm]?[jt]sx?$/u;
14501
14650
  const READ_CONCURRENCY$19 = 16;
14502
14651
  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.";
@@ -14505,15 +14654,15 @@ const isEffect = (statement) => {
14505
14654
  if (isExpressionStatement(statement)) return !isStringLiteral(statement.expression);
14506
14655
  return isImportDeclaration(statement) && Predicate$1.isUndefined(statement.importClause);
14507
14656
  };
14508
- const messageOf$4 = (statement) => {
14657
+ const messageOf$5 = (statement) => {
14509
14658
  if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
14510
14659
  return STATEMENT_MESSAGE;
14511
14660
  };
14512
- const problemsIn$14 = (api) => (file) => (source) => {
14661
+ const problemsIn$15 = (api) => (file) => (source) => {
14513
14662
  const retained = api.createSourceFile(file, source);
14514
14663
  const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$6({
14515
- rule: RULE$48,
14516
- message: messageOf$4(statement)
14664
+ rule: RULE$50,
14665
+ message: messageOf$5(statement)
14517
14666
  })(statement)));
14518
14667
  retained.dispose();
14519
14668
  return problems;
@@ -14525,11 +14674,11 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
14525
14674
  const names = yield* files.ownedFiles(root);
14526
14675
  const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
14527
14676
  const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE$1.test(file)));
14528
- const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$14(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$19 });
14677
+ const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$15(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$19 });
14529
14678
  return Array$1.flatten(found);
14530
14679
  }, Effect.scoped);
14531
14680
  const BUNDLED_RULE = "bundled-side-effects";
14532
- const START$26 = 0;
14681
+ const START$28 = 0;
14533
14682
  const NAME_KEY$2 = "\"name\"";
14534
14683
  const packageDirectoryOf = (manifests, files) => (module) => {
14535
14684
  const parent = files.dirname(module);
@@ -14546,7 +14695,7 @@ const undeclaredAt = Effect.fn("undeclaredAt")(function* undeclaredAt(directory)
14546
14695
  })));
14547
14696
  });
14548
14697
  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.`;
14549
- const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$26));
14698
+ const nameIndex$1 = (source) => pipe(String$1.indexOf(NAME_KEY$2)(source), Option.getOrElse(() => START$28));
14550
14699
  /** @internal */
14551
14700
  const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(function* bundledSideEffectProblems({ root, directory, located, used }) {
14552
14701
  const files = yield* RepositoryFiles;
@@ -14681,12 +14830,12 @@ const checkTreeShaking = Effect.fn("checkTreeShaking")(function* checkTreeShakin
14681
14830
  return Array$1.flatten(found);
14682
14831
  });
14683
14832
  // src/features/check-typescript-generation/model/typescript-generation.ts
14684
- const RULE$47 = "legacy-typescript";
14833
+ const RULE$49 = "legacy-typescript";
14685
14834
  const LOCKFILE = "pnpm-lock.yaml";
14686
14835
  const COMPILER = "typescript";
14687
14836
  const CURRENT_MAJOR = 7;
14688
14837
  const LEGACY_COMPILER_PACKAGE = /^@typescript\/typescript\d+$/u;
14689
- const FIRST$11 = 1;
14838
+ const FIRST$13 = 1;
14690
14839
  const legacyOf = (id) => {
14691
14840
  const { name, version } = parseDependencyPath(id);
14692
14841
  const isOldCompiler = name === COMPILER && pipe(Option.fromNullishOr(version), Option.flatMap((found) => Option.fromNullishOr(semver.coerce(found))), Option.exists((found) => found.major < CURRENT_MAJOR));
@@ -14697,10 +14846,10 @@ const legacyOf = (id) => {
14697
14846
  };
14698
14847
  const dependentsOf$1 = (nodes) => (id) => pipe(nodes, Array$1.filter(({ dependencies }) => Array$1.contains(dependencies, id)), Array$1.map((node) => `\`${node.id}\``));
14699
14848
  const lineOf$4 = (source) => (id) => pipe(String$1.split(source, "\n"), Array$1.findFirstIndex((line) => String$1.replaceAll("'", "")(String$1.trim(line)) === `${id}:`), Option.match({
14700
- onNone: () => FIRST$11,
14701
- onSome: (index) => index + FIRST$11
14849
+ onNone: () => FIRST$13,
14850
+ onSome: (index) => index + FIRST$13
14702
14851
  }));
14703
- const messageOf$3 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array$1.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
14852
+ const messageOf$4 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array$1.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
14704
14853
  /** @internal */
14705
14854
  const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(function* checkTypescriptGeneration(root) {
14706
14855
  const files = yield* RepositoryFiles;
@@ -14711,13 +14860,13 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
14711
14860
  return pipe(Option.getOrElse(nodes, () => []), Array$1.flatMap(({ id }) => Option.toArray(legacyOf(id))), Array$1.map((legacy) => ({
14712
14861
  file,
14713
14862
  line: lineOf$4(source)(legacy.id),
14714
- column: FIRST$11,
14715
- rule: RULE$47,
14716
- message: messageOf$3(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
14863
+ column: FIRST$13,
14864
+ rule: RULE$49,
14865
+ message: messageOf$4(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
14717
14866
  })));
14718
14867
  });
14719
14868
  // src/features/check-worker-bundles/model/worker-bundles.ts
14720
- const RULE$46 = "worker-bundle";
14869
+ const RULE$48 = "worker-bundle";
14721
14870
  const BUNDLE_CONCURRENCY = 4;
14722
14871
  const PLATFORM_MODULES = [/^cloudflare:/u, /^node:/u];
14723
14872
  const CONDITIONS = [
@@ -14728,7 +14877,7 @@ const CONDITIONS = [
14728
14877
  "module",
14729
14878
  "default"
14730
14879
  ];
14731
- const problemFor$2 = problemInFile(RULE$46);
14880
+ const problemFor$2 = problemInFile(RULE$48);
14732
14881
  const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
14733
14882
  const bundleProblem = (file) => Effect.gen(function* bundle() {
14734
14883
  const built = yield* Effect.tryPromise({
@@ -14763,6 +14912,20 @@ const OFF = [
14763
14912
  "allow",
14764
14913
  0
14765
14914
  ];
14915
+ const taggedError$11 = Schema.TaggedError;
14916
+ /** @internal */
14917
+ var DisabledRulesConfigUnreadable = class extends taggedError$11()("DisabledRulesConfigUnreadable", {
14918
+ file: Schema.String,
14919
+ reason: Schema.String
14920
+ }) {};
14921
+ /** @internal */
14922
+ const resolvedConfig = (file) => Effect.sync(forgetBuilt).pipe(Effect.andThen(Effect.tryPromise({
14923
+ try: () => resolveConfigFromFile(file),
14924
+ catch: (error) => DisabledRulesConfigUnreadable.make({
14925
+ file,
14926
+ reason: String(error)
14927
+ })
14928
+ })));
14766
14929
  const PrintedConfig = Schema.fromJsonString(Schema.Struct({ rules: Schema.Record(Schema.String, Schema.Unknown) }));
14767
14930
  const isList$1 = (value) => Array$1.isArray(value);
14768
14931
  const severityOf$1 = (value) => pipe(Option.some(value), Option.filter(isList$1), Option.flatMap(Array$1.head), Option.getOrElse(() => value));
@@ -14784,87 +14947,116 @@ const enabledRulesIn = Effect.fn("enabledRulesIn")(function* enabledRulesIn(root
14784
14947
  const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root) {
14785
14948
  return {
14786
14949
  enabledRules: yield* enabledRulesIn(root),
14787
- text: {
14788
- ignores: TEXT_IGNORES,
14789
- builtRuleNames: builtTextRuleNames
14790
- },
14791
- markdown: {
14792
- ignores: MARKDOWN_IGNORES,
14793
- rules: MARKDOWN_RULES
14794
- },
14795
- tasks: MSCH_TASK_COMMANDS,
14796
- verifyTasks: Record.keys(MSCH_VERIFY_COMMANDS),
14797
- ciTasks: CI_TASKS,
14798
- secrets: secretsOf(),
14799
- fixed: {
14800
- commitlint: COMMIT_LINT,
14801
- fu4: fu4Of(),
14802
- staged: STAGED$1,
14803
- fmt: FORMAT
14804
- },
14805
- gitHooks: GIT_HOOKS
14950
+ gitHooks: GIT_HOOKS,
14951
+ built: lastBuilt()
14806
14952
  };
14807
14953
  });
14808
14954
  // src/app/config-sections.ts
14809
14955
  const isList = (value) => Array$1.isArray(value);
14810
14956
  const isSection = (value) => Predicate$1.isObject(value) && !Array$1.isArray(value);
14811
- const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
14812
- const listOf$2 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
14813
- // src/app/section-weakenings.ts
14814
- const withoutOptedRules = (section, value) => {
14815
- if (section !== "commitlint") return value;
14816
- const commitlint = sectionOf(value);
14817
- const rules = Struct.omit(sectionOf(commitlint["rules"]), [SUBJECT_SCRIPT]);
14818
- if (Record.isEmptyRecord(rules)) return Struct.omit(commitlint, ["rules"]);
14819
- return {
14820
- ...commitlint,
14821
- rules
14822
- };
14823
- };
14824
- const fixedWeakenings = (config, expected) => pipe(Record.toEntries(expected.fixed), Array$1.filter(([section, built]) => !Equal.equals(withoutOptedRules(section, config[section]), built)), Array$1.map(([section]) => ({
14825
- anchor: section,
14826
- message: `${section} differs from what repositoryConfig builds, so msch's ${section} settings do not apply. Leave the ${section} section as repositoryConfig builds it.`
14827
- })));
14828
- const builtSections = [
14829
- "wism",
14957
+ const sectionOf$1 = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
14958
+ const listOf$3 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
14959
+ // src/app/built-weakenings.ts
14960
+ const WHOLE_SECTIONS = [
14961
+ "commitlint",
14830
14962
  "dependencyRules",
14831
- "test"
14963
+ "h56m",
14964
+ "wism",
14965
+ "textlint",
14966
+ "y8",
14967
+ "fu4",
14968
+ "staged",
14969
+ "fmt",
14970
+ "lint"
14832
14971
  ];
14833
- const missingSections = (config) => pipe(builtSections, Array$1.filter((section) => Predicate$1.isUndefined(config[section])), Array$1.map((section) => ({
14972
+ const NOT_BUILT = {
14834
14973
  anchor: "defineConfig",
14835
- message: `vite.config.ts has no ${section} section, so the checks msch builds into it do not run. Spread repositoryConfig from @r_masseater/msch/config into defineConfig.`
14974
+ message: "vite.config.ts does not call repositoryConfig from @r_masseater/msch/config, so msch cannot tell which of its settings the repository left out or changed. Spread repositoryConfig into defineConfig."
14975
+ };
14976
+ const withoutPlugins$1 = (project) => pipe(Option.some(project), Option.filter(Predicate$1.isObject), Option.map((found) => Struct.omit(sectionOf$1(found), ["plugins"])), Option.getOrElse(() => project));
14977
+ const IMPLEMENTED_PLUGINS = /* @__PURE__ */ new Set(["wism"]);
14978
+ const comparable = (section, value) => pipe(Option.some(value), Option.filter(() => IMPLEMENTED_PLUGINS.has(section)), Option.map(withoutPlugins$1), Option.getOrElse(() => value));
14979
+ const wholeWeakenings = (config, built) => pipe(WHOLE_SECTIONS, Array$1.filter((section) => {
14980
+ const expected = comparable(section, built[section]);
14981
+ return !Equal.equals(comparable(section, config[section]), expected);
14982
+ }), Array$1.map((section) => ({
14983
+ anchor: section,
14984
+ message: `${section} differs from what repositoryConfig builds from the options vite.config.ts gives it, so msch's ${section} settings do not all apply. Pass the change through repositoryConfig's options, or change msch.`
14836
14985
  })));
14986
+ const testNameOf = (project) => {
14987
+ const test = sectionOf$1(sectionOf$1(project)["test"]);
14988
+ return pipe(Option.some(test["name"]), Option.filter(Predicate$1.isString));
14989
+ };
14990
+ const projectName = (project) => pipe(Option.some(project), Option.filter(Predicate$1.isString), Option.orElse(() => testNameOf(project)), Option.getOrElse(() => "a project"));
14991
+ const testWeakenings = (config, built) => {
14992
+ const test = sectionOf$1(config.test);
14993
+ const builtTest = sectionOf$1(built.test);
14994
+ const projects = pipe(listOf$3(test["projects"]), Array$1.map(withoutPlugins$1));
14995
+ return [...pipe(listOf$3(builtTest["projects"]), Array$1.filter((project) => {
14996
+ const expected = withoutPlugins$1(project);
14997
+ return !pipe(projects, Array$1.some(Equal.equals(expected)));
14998
+ }), Array$1.map((project) => ({
14999
+ anchor: "test",
15000
+ message: `test.projects leaves out ${projectName(project)}, which repositoryConfig builds from the workspaces, so its tests never run. Keep every project repositoryConfig builds and add others after them.`
15001
+ }))), ...Array$1.filter([{
15002
+ anchor: "passWithNoTests",
15003
+ message: "test.passWithNoTests differs from what repositoryConfig builds. Leave it as repositoryConfig builds it."
15004
+ }], () => !Equal.equals(test["passWithNoTests"], builtTest["passWithNoTests"]))];
15005
+ };
15006
+ const cacheOf = (task) => pipe(Option.some(task["cache"]), Option.filter(Predicate$1.isObject), Option.map((cache) => Struct.omit(sectionOf$1(cache), ["untrackedEnv"])), Option.getOrElse(() => task["cache"]));
15007
+ const taskWeakenings = (tasks) => ([name, builtTask]) => {
15008
+ const task = sectionOf$1(tasks[name]);
15009
+ const expected = sectionOf$1(builtTask);
15010
+ const dependsOn = listOf$3(task["dependsOn"]);
15011
+ const changed = [
15012
+ ...Array$1.filter(["command"], () => !Equal.equals(task["command"], expected["command"])),
15013
+ ...Array$1.filter(["cache"], () => !Equal.equals(cacheOf(task), cacheOf(expected))),
15014
+ ...Array$1.filter(["dependsOn"], () => Array$1.some(listOf$3(expected["dependsOn"]), (needed) => !Array$1.contains(dependsOn, needed)))
15015
+ ];
15016
+ return pipe(changed, Array$1.map((part) => ({
15017
+ anchor: name,
15018
+ message: `The ${part} of the ${name} task differs from what repositoryConfig builds, so the task does not do or cache what msch set. Leave the task as repositoryConfig builds it; add work under another task name, or pass it in run.tasks.`
15019
+ })));
15020
+ };
15021
+ const runWeakenings = (config, built) => {
15022
+ const run = sectionOf$1(config.run);
15023
+ const builtRun = sectionOf$1(built.run);
15024
+ const builtTasks = Record.toEntries(sectionOf$1(builtRun["tasks"]));
15025
+ const tasks = sectionOf$1(run["tasks"]);
15026
+ return [...Array$1.filter([{
15027
+ anchor: "run",
15028
+ message: "run.cache differs from what repositoryConfig builds, so tasks do not cache or share their results as msch set. Pass the remote cache through run.remoteCache of repositoryConfig."
15029
+ }], () => !Equal.equals(run["cache"], builtRun["cache"])), ...pipe(builtTasks, Array$1.flatMap(taskWeakenings(tasks)))];
15030
+ };
15031
+ /** @internal */
15032
+ const builtWeakenings = (built) => (config) => Option.match(built, {
15033
+ onNone: () => [NOT_BUILT],
15034
+ onSome: (made) => [
15035
+ ...wholeWeakenings(config, made),
15036
+ ...testWeakenings(config, made),
15037
+ ...runWeakenings(config, made)
15038
+ ]
15039
+ });
15040
+ // src/app/section-weakenings.ts
14837
15041
  const RUN_PREFIX = "vp run ";
14838
15042
  const tasksRunBy = (tasks) => (command) => {
14839
15043
  const named = String$1.slice(7)(command);
14840
- const dependsOn = listOf$2(sectionOf(tasks[named])["dependsOn"]);
15044
+ const dependsOn = listOf$3(sectionOf$1(tasks[named])["dependsOn"]);
14841
15045
  return [named, ...pipe(dependsOn, Array$1.filter(Predicate$1.isString))];
14842
15046
  };
14843
15047
  const runCommandOf = (command) => pipe(String$1.lastIndexOf(RUN_PREFIX)(command), Option.map((index) => String$1.slice(index)(command)));
14844
15048
  const covers = (tasks) => (built) => (command) => Predicate$1.isString(command) && (String$1.endsWith(built)(command) || String$1.startsWith(RUN_PREFIX)(built) && pipe(runCommandOf(command), Option.exists((run) => Array$1.contains(tasksRunBy(tasks)(run), String$1.slice(7)(built)))));
14845
15049
  const hookWeakenings = (config, expected) => {
14846
- const hooks = sectionOf(config.gitHooks);
14847
- const tasks = sectionOf(sectionOf(config.run)["tasks"]);
14848
- return pipe(Record.toEntries(expected.gitHooks), Array$1.flatMap(([hook, commands]) => pipe(commands, Array$1.filter((built) => !Array$1.some(listOf$2(hooks[hook]), covers(tasks)(built))), Array$1.map((built) => ({
15050
+ const hooks = sectionOf$1(config.gitHooks);
15051
+ const tasks = sectionOf$1(sectionOf$1(config.run)["tasks"]);
15052
+ return pipe(Record.toEntries(expected.gitHooks), Array$1.flatMap(([hook, commands]) => pipe(commands, Array$1.filter((built) => !Array$1.some(listOf$3(hooks[hook]), covers(tasks)(built))), Array$1.map((built) => ({
14849
15053
  anchor: "gitHooks",
14850
15054
  message: `The ${hook} hook does not run \`${built}\`, which msch puts there. Add commands to a hook or wrap them, but keep the ones repositoryConfig builds.`
14851
15055
  })))));
14852
15056
  };
14853
15057
  /** @internal */
14854
- const sectionWeakenings = (config, expected) => [
14855
- ...fixedWeakenings(config, expected),
14856
- ...missingSections(config),
14857
- ...hookWeakenings(config, expected)
14858
- ];
15058
+ const sectionWeakenings = (config, expected) => [...hookWeakenings(config, expected)];
14859
15059
  // src/app/config-weakenings.ts
14860
- const PRESET_KEYS = [
14861
- "categories",
14862
- "plugins",
14863
- "jsPlugins",
14864
- "rules",
14865
- "options",
14866
- "settings"
14867
- ];
14868
15060
  const ENABLED = ["error", "deny"];
14869
15061
  const SEVERITY_ONLY = 1;
14870
15062
  const MSCH_RELAXATIONS = [
@@ -14872,20 +15064,9 @@ const MSCH_RELAXATIONS = [
14872
15064
  { "import/no-default-export": "off" },
14873
15065
  decisionTestRules
14874
15066
  ];
14875
- const severityOf = (value) => pipe(listOf$2(value), Array$1.head, Option.getOrElse(() => value));
14876
- const hasOptions = (value) => Array$1.length(listOf$2(value)) > SEVERITY_ONLY;
15067
+ const severityOf = (value) => pipe(listOf$3(value), Array$1.head, Option.getOrElse(() => value));
15068
+ const hasOptions = (value) => Array$1.length(listOf$3(value)) > SEVERITY_ONLY;
14877
15069
  const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
14878
- const whenPresent = (what, weakeningsIn) => (value) => Option.match(Option.fromUndefinedOr(value), {
14879
- onNone: () => [{
14880
- anchor: "defineConfig",
14881
- message: `vite.config.ts has no ${what}. Spread repositoryConfig from @r_masseater/msch/config into defineConfig.`
14882
- }],
14883
- onSome: (present) => weakeningsIn(sectionOf(present))
14884
- });
14885
- const presetDifferences = (lint) => pipe(PRESET_KEYS, Array$1.filter((key) => !Equal.equals(lint[key], lint$3[key])), Array$1.map((key) => ({
14886
- anchor: "lint",
14887
- 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.`
14888
- })));
14889
15070
  const isPresetOverride = (override) => pipe(lint$3.overrides, Array$1.some((built) => Equal.equals(built, override)));
14890
15071
  const isMschRelaxation = (override) => pipe(MSCH_RELAXATIONS, Array$1.some((rules) => Equal.equals(rules, override["rules"])));
14891
15072
  const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.contains(ENABLED, severityOf(value)), {
@@ -14896,121 +15077,85 @@ const ruleWeakening = (enabledRules) => ([name, value]) => [...unless(Array$1.co
14896
15077
  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.`
14897
15078
  })];
14898
15079
  const overrideWeakenings = (enabledRules) => (override) => {
14899
- const section = sectionOf(override);
15080
+ const section = sectionOf$1(override);
14900
15081
  const builtByMsch = isPresetOverride(override) || isMschRelaxation(section);
14901
- return pipe(Record.toEntries(sectionOf(section["rules"])), Array$1.filter(() => !builtByMsch), Array$1.flatMap(ruleWeakening(enabledRules)));
14902
- };
14903
- const lintWeakenings = (enabledRules) => whenPresent("lint section, so the msch preset does not run", (section) => [
14904
- ...presetDifferences(section),
14905
- ...unless(Equal.equals(section["ignorePatterns"], exempt), {
14906
- anchor: "ignorePatterns",
14907
- 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."
14908
- }),
14909
- ...pipe(listOf$2(section["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)))
14910
- ]);
14911
- const isOff = (value) => value === false || pipe(Record.values(sectionOf(value)), Array$1.some(isOff));
14912
- const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.builtRuleNames, Array$1.filter((name) => !Record.has(rules, name)), Array$1.map((name) => ({
14913
- anchor: "textlint",
14914
- message: `${owner} does not run ${name}, which msch sets. Leave the textlint section as repositoryConfig builds it.`
14915
- }))), ...pipe(Record.toEntries(rules), Array$1.filter(([, value]) => isOff(value)), Array$1.map(([name]) => ({
14916
- anchor: name,
14917
- 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.`
14918
- })))];
14919
- const checkedBySources = (section) => pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => listOf$2(sectionOf(source)["files"])));
14920
- const ignoredOutsideSources = (section) => {
14921
- const checked = checkedBySources(section);
14922
- return pipe(listOf$2(section["ignores"]), Array$1.filter((ignored) => !Array$1.contains(checked, ignored)));
14923
- };
14924
- const textWeakenings = (expected) => whenPresent("textlint section, so the Japanese text checks do not run", (section) => [
14925
- ...unless(Equal.equals(ignoredOutsideSources(section), expected.ignores), {
14926
- anchor: "ignores",
14927
- message: "textlint.ignores differs from the files msch exempts. Files are not taken out of the text checks in a repository that uses msch."
14928
- }),
14929
- ...textRuleWeakenings(expected)("textlint", sectionOf(section["rules"])),
14930
- ...pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => textRuleWeakenings(expected)("A textlint source", sectionOf(sectionOf(source)["rules"]))))
14931
- ]);
14932
- const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdown checks do not run", (section) => [...unless(Equal.equals(section["ignores"], expected.ignores), {
14933
- anchor: "ignores",
14934
- message: "y8.ignores differs from the files msch exempts. Files are not taken out of the Markdown checks in a repository that uses msch."
14935
- }), ...unless(Equal.equals(section["rules"], expected.rules), {
14936
- anchor: "y8",
14937
- message: "y8.rules differs from what markdownOf builds. Markdown rules are not turned off or changed in a repository that uses msch."
14938
- })]);
14939
- const missingDependencies$1 = (tasks, task) => (names) => {
14940
- const dependsOn = listOf$2(sectionOf(tasks[task])["dependsOn"]);
14941
- return pipe(names, Array$1.filter((name) => !Array$1.contains(dependsOn, name)), Array$1.map((name) => ({
14942
- anchor: task,
14943
- message: `${task} does not run the ${name} task. Leave ${task} as repositoryConfig builds it.`
14944
- })));
14945
- };
14946
- const taskWeakenings = (run, expected) => {
14947
- const tasks = sectionOf(sectionOf(run)["tasks"]);
14948
- const dependsOn = listOf$2(sectionOf(tasks[TASK_NAMES.verify])["dependsOn"]);
14949
- return [
14950
- ...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => {
14951
- const actual = sectionOf(tasks[name])["command"];
14952
- return !Equal.equals(actual, command) && !(Predicate$1.isString(command) && Equal.equals(actual, meteredCommand(command)));
14953
- }), Array$1.map(([name]) => ({
14954
- anchor: "run",
14955
- 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.`
14956
- }))),
14957
- ...missingDependencies$1(tasks, TASK_NAMES.verify)(expected.verifyTasks),
14958
- ...unless(!Array$1.contains(dependsOn, TASK_NAMES.test), {
14959
- anchor: TASK_NAMES.verify,
14960
- message: "verify runs the test task. Tests run in CI through the ci task, so verify, which the pre-push hook runs, leaves them out."
14961
- }),
14962
- ...missingDependencies$1(tasks, "ci")(expected.ciTasks)
14963
- ];
15082
+ return pipe(Record.toEntries(sectionOf$1(section["rules"])), Array$1.filter(() => !builtByMsch), Array$1.flatMap(ruleWeakening(enabledRules)));
15083
+ };
15084
+ const lintWeakenings = (enabledRules, lint) => pipe(listOf$3(sectionOf$1(lint)["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)));
15085
+ const testInVerify = (run) => {
15086
+ const tasks = sectionOf$1(sectionOf$1(run)["tasks"]);
15087
+ const dependsOn = listOf$3(sectionOf$1(tasks[TASK_NAMES.verify])["dependsOn"]);
15088
+ return unless(!Array$1.contains(dependsOn, TASK_NAMES.test), {
15089
+ anchor: TASK_NAMES.verify,
15090
+ message: "verify runs the test task. Tests run in CI through the ci task, so verify, which the pre-push hook runs, leaves them out."
15091
+ });
14964
15092
  };
14965
- const secretWeakenings = (h56m, expected) => unless(Equal.equals(h56m, expected), {
14966
- anchor: "h56m",
14967
- 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."
14968
- });
14969
15093
  /** @internal */
14970
15094
  const weakeningsOf = (expected) => (config) => [
14971
- ...lintWeakenings(expected.enabledRules)(config.lint),
14972
- ...textWeakenings(expected.text)(config.textlint),
14973
- ...markdownWeakenings(expected.markdown)(config.y8),
14974
- ...taskWeakenings(config.run, expected),
14975
- ...secretWeakenings(config.h56m, expected.secrets),
14976
- ...sectionWeakenings(config, expected)
15095
+ ...lintWeakenings(expected.enabledRules, config.lint),
15096
+ ...testInVerify(config.run),
15097
+ ...sectionWeakenings(config, expected),
15098
+ ...builtWeakenings(expected.built)(config)
14977
15099
  ];
15100
+ // src/app/unused-proper-nouns.ts
15101
+ const RULE$47 = "unused-proper-noun";
15102
+ const MARKDOWN$6 = "**/*.md";
15103
+ const START$27 = 0;
15104
+ const READ_CONCURRENCY$18 = 16;
15105
+ const properNounsOf = (textlint) => {
15106
+ const filters = sectionOf$1(sectionOf$1(textlint)["filters"]);
15107
+ const allowlist = sectionOf$1(filters["allowlist"]);
15108
+ return pipe(listOf$3(allowlist["allow"]), Array$1.filter(Predicate$1.isString), Array$1.filter((entry) => !Array$1.contains(BUILT_ALLOWANCES, entry)));
15109
+ };
15110
+ const checkedFiles = (textlint, listed) => {
15111
+ const section = sectionOf$1(textlint);
15112
+ const ignored = matcher(pipe(listOf$3(section["ignores"]), Array$1.filter(Predicate$1.isString)));
15113
+ const markdown = matcher([MARKDOWN$6]);
15114
+ const sources = matcher(pipe(listOf$3(section["sources"]), Array$1.flatMap((source) => listOf$3(sectionOf$1(source)["files"])), Array$1.filter(Predicate$1.isString)));
15115
+ return pipe(listed, Array$1.filter((name) => markdown(name) && !ignored(name) || sources(name)));
15116
+ };
15117
+ /** @internal */
15118
+ const unusedProperNouns = Effect.fn("unusedProperNouns")(function* unusedProperNouns({ root, file, source, config }) {
15119
+ const nouns = properNounsOf(config.textlint);
15120
+ if (Array$1.isReadonlyArrayEmpty(nouns)) return [];
15121
+ const files = yield* RepositoryFiles;
15122
+ const listed = yield* files.listedFiles(root);
15123
+ const texts = yield* Effect.forEach(checkedFiles(config.textlint, listed), (name) => files.readFile(files.join(root, name)), { concurrency: READ_CONCURRENCY$18 });
15124
+ const found = Array$1.getSomes(texts);
15125
+ const at = problemAtIndex(RULE$47)(file, source);
15126
+ return pipe(nouns, Array$1.filter((noun) => !pipe(found, Array$1.some(String$1.includes(noun)))), Array$1.map((noun) => at(pipe(source, String$1.indexOf(`"${noun}"`), Option.getOrElse(() => START$27)), `The proper noun "${noun}" is in textlint.properNouns, but no text the Japanese checks read contains it, so it lets nothing through. Remove it.`)));
15127
+ });
14978
15128
  // src/app/disabled-rules.ts
14979
- const RULE$45 = "disabled-rule";
15129
+ const RULE$46 = "disabled-rule";
14980
15130
  const CONFIG_FILE$5 = "vite.config.ts";
14981
- const START$25 = 0;
15131
+ const START$26 = 0;
14982
15132
  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;
14983
15133
  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.";
14984
- const taggedError$10 = Schema.TaggedError;
14985
- var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
14986
- file: Schema.String,
14987
- reason: Schema.String
14988
- }) {};
14989
15134
  const sideConfigs = Effect.fn("sideConfigs")(function* sideConfigs(root) {
14990
15135
  const files = yield* RepositoryFiles;
14991
15136
  const listed = yield* files.listedFiles(root);
14992
15137
  const isExempt = matcher(exempt);
14993
- return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$45)(files.join(root, name), "")(START$25, SIDE_CONFIG_MESSAGE)));
15138
+ return pipe(listed, Array$1.filter((name) => SIDE_CONFIG.test(name) && !isExempt(name)), Array$1.map((name) => problemAtIndex(RULE$46)(files.join(root, name), "")(START$26, SIDE_CONFIG_MESSAGE)));
14994
15139
  });
14995
15140
  const configWeakenings = Effect.fn("configWeakenings")(function* configWeakenings(root, source) {
14996
15141
  const file = (yield* RepositoryFiles).join(root, CONFIG_FILE$5);
14997
- const config = yield* Effect.tryPromise({
14998
- try: () => resolveConfigFromFile(file),
14999
- catch: (error) => DisabledRulesConfigUnreadable.make({
15000
- file,
15001
- reason: String(error)
15002
- })
15003
- });
15142
+ const config = yield* resolvedConfig(file);
15004
15143
  const expected = yield* expectationsIn(root);
15005
- const at = problemAtIndex(RULE$45)(file, source);
15006
- return pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$25), message)));
15144
+ const at = problemAtIndex(RULE$46)(file, source);
15145
+ const unused = yield* unusedProperNouns({
15146
+ root,
15147
+ file,
15148
+ source,
15149
+ config
15150
+ });
15151
+ return [...pipe(weakeningsOf(expected)(config), Array$1.map(({ anchor, message }) => at(Option.getOrElse(String$1.indexOf(anchor)(source), () => START$26), message))), ...unused];
15007
15152
  });
15008
15153
  /** @internal */
15009
15154
  const checkDisabledRules = Effect.fn("checkDisabledRules")(function* checkDisabledRules(root) {
15010
15155
  const files = yield* RepositoryFiles;
15011
15156
  const text = yield* files.readFile(files.join(root, CONFIG_FILE$5));
15012
15157
  if (Option.isNone(text)) return [];
15013
- return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$45)(file, "")(START$25, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
15158
+ return [...yield* configWeakenings(root, text.value).pipe(Effect.catchTag("DisabledRulesConfigUnreadable", ({ file, reason }) => Effect.succeed([problemAtIndex(RULE$46)(file, "")(START$26, `msch could not load this file: ${reason}`)]))), ...yield* sideConfigs(root)];
15014
15159
  });
15015
15160
  // src/app/build-checks.ts
15016
15161
  /** @internal */
@@ -15107,7 +15252,7 @@ const fileFactsIn = (checker) => (sourceFiles, excluded) => pipe(sourceFiles, Ar
15107
15252
  imports: importedFilesOf(checker)(sourceFile)
15108
15253
  })), Array$1.filter((facts) => Array$1.isReadonlyArrayNonEmpty(facts.values) || Array$1.isReadonlyArrayNonEmpty(facts.imports)));
15109
15254
  // src/features/check-value-owners/model/name-lists.ts
15110
- const RULE$44 = "hand-written-names";
15255
+ const RULE$45 = "hand-written-names";
15111
15256
  const TEST_FILE$1 = /\.test(?:\.[\w-]+)?\.[cm]?tsx?$/u;
15112
15257
  const nameListOf = (site) => {
15113
15258
  if (TEST_FILE$1.test(site.file) || site.values.length < 2) return Option.none();
@@ -15122,7 +15267,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
15122
15267
  file,
15123
15268
  line,
15124
15269
  column,
15125
- rule: RULE$44,
15270
+ rule: RULE$45,
15126
15271
  message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
15127
15272
  });
15128
15273
  const problemOf$9 = ({ list, reason }) => listedProblem({
@@ -15537,7 +15682,7 @@ const analyzeProject = ({ owners, sourceChecks }) => (project) => {
15537
15682
  // src/features/check-value-owners/model/cache.ts
15538
15683
  const CACHE_DIRECTORY = [...MSCH_CACHE, "value-owners"];
15539
15684
  const CACHE_SUFFIX = ".json";
15540
- const EMPTY$2 = "";
15685
+ const EMPTY$3 = "";
15541
15686
  const FIELD_SEPARATOR$1 = "\0";
15542
15687
  const LINE_SEPARATOR$1 = "\n";
15543
15688
  const ValueSchema = Schema.Union([Schema.String, Schema.Finite]);
@@ -15575,7 +15720,7 @@ const fileDigest = (hash) => {
15575
15720
  onSome: Effect.succeed,
15576
15721
  onNone: () => Effect.gen(function* readDigest() {
15577
15722
  const text = yield* (yield* RepositoryFiles).readFile(file);
15578
- const found = yield* hash(Option.getOrElse(text, () => EMPTY$2));
15723
+ const found = yield* hash(Option.getOrElse(text, () => EMPTY$3));
15579
15724
  digests.set(file, found);
15580
15725
  return found;
15581
15726
  })
@@ -15586,7 +15731,7 @@ const analysisCache = Effect.fn("analysisCache")(function* analysisCache(root, o
15586
15731
  const files = yield* RepositoryFiles;
15587
15732
  const hash = yield* hasher;
15588
15733
  const fingerprint = yield* implementationFingerprint(import.meta.dirname);
15589
- const salt = yield* hash(Array$1.join([fingerprint, String$1.replaceAll(root, EMPTY$2)(owners)], FIELD_SEPARATOR$1));
15734
+ const salt = yield* hash(Array$1.join([fingerprint, String$1.replaceAll(root, EMPTY$3)(owners)], FIELD_SEPARATOR$1));
15590
15735
  return {
15591
15736
  root,
15592
15737
  directory: files.join(root, ...CACHE_DIRECTORY),
@@ -15601,7 +15746,7 @@ const keyOf$1 = (cache) => (configPath, inputs) => Effect.gen(function* deriveKe
15601
15746
  const header = [
15602
15747
  cache.salt,
15603
15748
  files.relative(cache.root, configPath),
15604
- String$1.replaceAll(cache.root, EMPTY$2)(inputs.options)
15749
+ String$1.replaceAll(cache.root, EMPTY$3)(inputs.options)
15605
15750
  ];
15606
15751
  return yield* cache.hash(Array$1.join([
15607
15752
  ...header,
@@ -15913,9 +16058,9 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
15913
16058
  return sortProblems([...ownerScan.problems, ...repositoryProblems(repository)(analyses)]);
15914
16059
  }, Effect.scoped);
15915
16060
  // src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
15916
- const RULE$43 = "namespace-destructuring";
16061
+ const RULE$44 = "namespace-destructuring";
15917
16062
  const LOCAL = /^[.#/]/u;
15918
- const messageOf$2 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
16063
+ const messageOf$3 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
15919
16064
  const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
15920
16065
  const importedNames = (sourceFile) => {
15921
16066
  const bindings = pipe(sourceFile.statements, Array$1.filter(isImportDeclaration), Array$1.filter((declaration) => isPackage(declaration.moduleSpecifier)), Array$1.map((declaration) => Option.fromUndefinedOr(declaration.importClause)), Array$1.getSomes, Array$1.filter((clause) => clause.phaseModifier !== SyntaxKind.TypeKeyword), Array$1.map((clause) => Option.fromUndefinedOr(clause.namedBindings)), Array$1.getSomes);
@@ -15929,20 +16074,20 @@ const destructuredName = (declaration) => {
15929
16074
  return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
15930
16075
  };
15931
16076
  const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$6({
15932
- rule: RULE$43,
15933
- message: messageOf$2(name)
16077
+ rule: RULE$44,
16078
+ message: messageOf$3(name)
15934
16079
  })), Option.map((report) => report(declaration)));
15935
16080
  const namespaceDestructuringIn = () => (sourceFile) => {
15936
16081
  const names = importedNames(sourceFile);
15937
16082
  return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
15938
16083
  };
15939
16084
  // src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
15940
- const RULE$42 = "pass-through-wrapper";
16085
+ const RULE$43 = "pass-through-wrapper";
15941
16086
  const SINGLE_STATEMENT = 1;
15942
16087
  const SINGLE_DECLARATION = 1;
15943
16088
  const THIS_PARAMETER = "this";
15944
16089
  const NO_ARGUMENTS = [];
15945
- const messageOf$1 = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
16090
+ const messageOf$2 = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
15946
16091
  const unwrapped = (expression) => {
15947
16092
  if (isParenthesizedExpression(expression)) return unwrapped(expression.expression);
15948
16093
  return expression;
@@ -16034,8 +16179,8 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
16034
16179
  const problemOf$7 = (checker) => (candidate) => {
16035
16180
  if (changesTheCall(candidate.wrapper)) return Option.none();
16036
16181
  return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$6({
16037
- rule: RULE$42,
16038
- message: messageOf$1(forward.callee.getText())
16182
+ rule: RULE$43,
16183
+ message: messageOf$2(forward.callee.getText())
16039
16184
  })(candidate.name)));
16040
16185
  };
16041
16186
  const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$7(checker)), Array$1.getSomes);
@@ -16043,7 +16188,7 @@ const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(so
16043
16188
  /** @internal */
16044
16189
  const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
16045
16190
  // src/features/check-agent-settings/model/known-plugins.ts
16046
- const RULE$41 = "known-plugins";
16191
+ const RULE$42 = "known-plugins";
16047
16192
  const SETTINGS_FILE$3 = ".claude/settings.json";
16048
16193
  const MARKETPLACE_FILE$2 = ".claude-plugin/marketplace.json";
16049
16194
  const GITHUB$4 = "github";
@@ -16058,13 +16203,13 @@ const SettingsSchema$1 = Schema.Struct({
16058
16203
  extraKnownMarketplaces: Schema.optionalKey(Marketplaces),
16059
16204
  enabledPlugins: Schema.optionalKey(Plugins$1)
16060
16205
  });
16061
- const decodeSettings$2 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
16206
+ const decodeSettings$3 = Schema.decodeUnknownOption(Schema.fromJsonString(SettingsSchema$1));
16062
16207
  const MarketplaceSchema = Schema.Struct({
16063
16208
  name: Schema.String,
16064
16209
  plugins: Schema.Array(Schema.Struct({ name: Schema.String }))
16065
16210
  });
16066
16211
  const decodeMarketplace = Schema.decodeUnknownOption(Schema.fromJsonString(MarketplaceSchema));
16067
- const problem$6 = problemInFile(RULE$41);
16212
+ const problem$6 = problemInFile(RULE$42);
16068
16213
  const knownFrom = (repository, marketplace, settings) => pipe(Option.fromUndefinedOr(settings.extraKnownMarketplaces), Option.flatMap(Record.get(marketplace.name)), Option.exists(({ source }) => source.source === GITHUB$4 && source.repo === repository));
16069
16214
  const pluginEnabled = (settings) => (plugin) => pipe(Option.fromUndefinedOr(settings.enabledPlugins), Option.flatMap(Record.get(plugin)), Option.getOrElse(() => false));
16070
16215
  const pluginProblems = (marketplace, file, settings) => {
@@ -16078,7 +16223,7 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
16078
16223
  const manifest = yield* files.readFile(files.join(root, MARKETPLACE_FILE$2));
16079
16224
  const file = files.join(root, SETTINGS_FILE$3);
16080
16225
  const text = yield* files.readFile(file);
16081
- const settings = pipe(text, Option.flatMap(decodeSettings$2), Option.getOrElse(() => ({})));
16226
+ const settings = pipe(text, Option.flatMap(decodeSettings$3), Option.getOrElse(() => ({})));
16082
16227
  const marketplace = pipe(manifest, Option.flatMap(decodeMarketplace));
16083
16228
  return pipe(Option.all({
16084
16229
  origin,
@@ -16089,20 +16234,20 @@ const checkKnownPlugins = Effect.fn("checkKnownPlugins")(function* checkKnownPlu
16089
16234
  }));
16090
16235
  });
16091
16236
  // src/features/check-agent-settings/model/missing-hooks.ts
16092
- const RULE$40 = "missing-hook";
16237
+ const RULE$41 = "missing-hook";
16093
16238
  const SETTINGS_FILE$2 = /^\.claude\/settings\.json$/u;
16094
16239
  const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
16095
16240
  const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
16096
16241
  const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
16097
16242
  const PLUGIN_ROOT$1 = "..";
16098
- const READ_CONCURRENCY$18 = 16;
16099
- const START$24 = 0;
16243
+ const READ_CONCURRENCY$17 = 16;
16244
+ const START$25 = 0;
16100
16245
  const referenceOf = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
16101
16246
  path,
16102
- index: found.index ?? START$24
16247
+ index: found.index ?? START$25
16103
16248
  })), Option.toArray);
16104
16249
  const referencesIn = (pattern, source) => pipe(Array$1.fromIterable(String$1.matchAll(pattern)(source)), Array$1.flatMap(referenceOf));
16105
- const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
16250
+ const problemsIn$14 = Effect.fn("problemsIn")(function* problemsIn({ root, file, base, pattern }) {
16106
16251
  const files = yield* RepositoryFiles;
16107
16252
  const text = yield* files.readFile(file);
16108
16253
  if (Option.isNone(text)) return [];
@@ -16114,7 +16259,7 @@ const problemsIn$13 = Effect.fn("problemsIn")(function* problemsIn({ root, file,
16114
16259
  return pipe(missing, Array$1.map(({ path, index }) => ({
16115
16260
  file,
16116
16261
  ...positionOf(source)(index),
16117
- rule: RULE$40,
16262
+ rule: RULE$41,
16118
16263
  message: `runs ${path}, which does not exist. The hook fails every time it fires. Point it at a file that exists or remove the hook.`
16119
16264
  })));
16120
16265
  });
@@ -16138,11 +16283,11 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
16138
16283
  }];
16139
16284
  return [];
16140
16285
  }));
16141
- const found = yield* Effect.forEach(hookFiles, problemsIn$13, { concurrency: READ_CONCURRENCY$18 });
16286
+ const found = yield* Effect.forEach(hookFiles, problemsIn$14, { concurrency: READ_CONCURRENCY$17 });
16142
16287
  return Array$1.flatten(found);
16143
16288
  });
16144
16289
  // src/features/check-agent-settings/model/project-extensions.ts
16145
- const RULE$39 = "project-claude-extensions";
16290
+ const RULE$40 = "project-claude-extensions";
16146
16291
  const SETTINGS_FILE$1 = ".claude/settings.json";
16147
16292
  const SETUP_EVENT = "SessionStart";
16148
16293
  const EXTENSION_DIRECTORIES = [
@@ -16153,13 +16298,13 @@ const EXTENSION_DIRECTORIES = [
16153
16298
  ".claude/output-styles/"
16154
16299
  ];
16155
16300
  const REASON$3 = "A Claude Code hook, skill, agent, command, rule or output style kept in one repository is copied into the next repository that needs it, and the copies drift apart. Put it in a plugin, enable the plugin in .claude/settings.json, and keep only the settings and the SessionStart environment setup in the repository.";
16156
- const Settings = Schema.Struct({ hooks: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)) });
16157
- const decodeSettings$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Settings));
16158
- const hookProblems = (file, source) => pipe(decodeSettings$1(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.filter((event) => event !== SETUP_EVENT), Array$1.map((event) => {
16301
+ const Settings$1 = Schema.Struct({ hooks: Schema.optionalKey(Schema.Record(Schema.String, Schema.Unknown)) });
16302
+ const decodeSettings$2 = Schema.decodeUnknownOption(Schema.fromJsonString(Settings$1));
16303
+ const hookProblems = (file, source) => pipe(decodeSettings$2(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.map(Record.keys), Option.getOrElse(() => []), Array$1.filter((event) => event !== SETUP_EVENT), Array$1.map((event) => {
16159
16304
  const message = `runs a ${event} hook from the project settings. ${REASON$3}`;
16160
16305
  return pipe(source, String$1.indexOf(`"${event}"`), Option.match({
16161
- onNone: () => problemInFile(RULE$39)(file, message),
16162
- onSome: (index) => problemAtIndex(RULE$39)(file, source)(index, message)
16306
+ onNone: () => problemInFile(RULE$40)(file, message),
16307
+ onSome: (index) => problemAtIndex(RULE$40)(file, source)(index, message)
16163
16308
  }));
16164
16309
  }));
16165
16310
  const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* checkProjectExtensions(root) {
@@ -16167,7 +16312,7 @@ const checkProjectExtensions = Effect.fn("checkProjectExtensions")(function* che
16167
16312
  const settingsFile = files.join(root, SETTINGS_FILE$1);
16168
16313
  const settings = yield* files.readFile(settingsFile);
16169
16314
  const tracked = yield* files.trackedFiles(root, EXTENSION_DIRECTORIES);
16170
- const extensionProblems = pipe(tracked, Array$1.filter((name) => pipe(EXTENSION_DIRECTORIES, Array$1.some((directory) => String$1.startsWith(directory)(name)))), Array$1.map((name) => problemInFile(RULE$39)(files.join(root, name), `is a Claude Code extension in .claude. ${REASON$3}`)));
16315
+ const extensionProblems = pipe(tracked, Array$1.filter((name) => pipe(EXTENSION_DIRECTORIES, Array$1.some((directory) => String$1.startsWith(directory)(name)))), Array$1.map((name) => problemInFile(RULE$40)(files.join(root, name), `is a Claude Code extension in .claude. ${REASON$3}`)));
16171
16316
  return [...Option.match(settings, {
16172
16317
  onNone: () => [],
16173
16318
  onSome: (source) => hookProblems(settingsFile, source)
@@ -16199,7 +16344,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
16199
16344
  }, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
16200
16345
  const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
16201
16346
  // src/features/check-documented-commands/model/commands.ts
16202
- const RULE$38 = "documented-commands";
16347
+ const RULE$39 = "documented-commands";
16203
16348
  const DOCUMENTS = ["*AGENTS.md", "*CLAUDE.md"];
16204
16349
  const DOCUMENT_NAMES = /* @__PURE__ */ new Set(["AGENTS.md", "CLAUDE.md"]);
16205
16350
  const COMMAND = /`vp run (?<args>[^`]+)`/gu;
@@ -16218,7 +16363,7 @@ const FILTER_ASSIGNMENT = "--filter=";
16218
16363
  const RECURSIVE_FLAGS = /* @__PURE__ */ new Set(["-r", "--recursive"]);
16219
16364
  const ROOT_FLAGS = /* @__PURE__ */ new Set(["-w", "--workspace-root"]);
16220
16365
  const ONE$2 = 1;
16221
- const START$23 = 0;
16366
+ const START$24 = 0;
16222
16367
  const optionsOf = (args) => pipe(String$1.split(String$1.trim(args), WHITESPACE$1), Array$1.takeWhile((token) => token !== END_OF_OPTIONS));
16223
16368
  const filterOf = (tokens) => pipe(tokens, Array$1.findFirstIndex((token) => FILTER_FLAGS.has(token)), Option.flatMap((index) => Array$1.get(tokens, index + ONE$2)), Option.orElse(() => pipe(tokens, Array$1.findFirst(String$1.startsWith(FILTER_ASSIGNMENT)), Option.map(String$1.slice(9)))));
16224
16369
  const follows = (tokens) => (index) => pipe(Array$1.get(tokens, index - ONE$2), Option.exists((previous) => FILTER_FLAGS.has(previous)));
@@ -16274,11 +16419,11 @@ const whereOf = (scope, file) => {
16274
16419
  return `the package that holds ${file}`;
16275
16420
  };
16276
16421
  const isMissing = (graph, file) => ({ task, scope }) => !pipe(packagesOf(graph, file)(scope), Array$1.some(hasTask$1(graph, task)));
16277
- const problemsIn$12 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
16422
+ const problemsIn$13 = (graph, absolute, { file, text }) => pipe(Array$1.fromIterable(String$1.matchAll(COMMAND)(text)), Array$1.flatMap((match) => pipe(Option.fromNullishOr(match.groups), Option.flatMap(Record.get(ARGS)), Option.flatMap(parsed), Option.filter(isMissing(graph, file)), Option.map(({ task, scope }) => ({
16278
16423
  file: absolute(file),
16279
- ...positionOf(text)(match.index ?? START$23),
16280
- rule: RULE$38,
16281
- message: `${match[START$23]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
16424
+ ...positionOf(text)(match.index ?? START$24),
16425
+ rule: RULE$39,
16426
+ message: `${match[START$24]} runs task ${task}, but ${whereOf(scope, file)} has no such task. Fix the command or the task`
16282
16427
  })), Option.toArray)));
16283
16428
  const isDocument = (file) => pipe(String$1.split(file, SEPARATOR$12), Array$1.last, Option.exists((name) => DOCUMENT_NAMES.has(name)));
16284
16429
  /** @internal */
@@ -16302,14 +16447,14 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
16302
16447
  file: absolute(Array$1.headNonEmpty(commanded).file),
16303
16448
  line: ONE$2,
16304
16449
  column: ONE$2,
16305
- rule: RULE$38,
16450
+ rule: RULE$39,
16306
16451
  message: "msch could not list the tasks with `vp run --json`"
16307
16452
  }],
16308
- onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$12(found, absolute, document)))
16453
+ onSome: (found) => pipe(commanded, Array$1.flatMap((document) => problemsIn$13(found, absolute, document)))
16309
16454
  });
16310
16455
  });
16311
16456
  // src/features/check-legacy-web/model/legacy-web.ts
16312
- const RULE$37 = "legacy-web";
16457
+ const RULE$38 = "legacy-web";
16313
16458
  const FIRST_COLUMN$7 = 1;
16314
16459
  const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
16315
16460
  const Finding = Schema.Struct({
@@ -16348,16 +16493,16 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
16348
16493
  file: files.join(root, file),
16349
16494
  line,
16350
16495
  column: FIRST_COLUMN$7,
16351
- rule: RULE$37,
16496
+ rule: RULE$38,
16352
16497
  message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
16353
16498
  });
16354
16499
  return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
16355
16500
  });
16356
16501
  // src/shared/lib/section-check.ts
16357
- const taggedError$9 = Schema.TaggedError;
16358
- var SectionConfigUnreadable = class extends taggedError$9()("SectionConfigUnreadable", { file: Schema.String }) {};
16502
+ const taggedError$10 = Schema.TaggedError;
16503
+ var SectionConfigUnreadable = class extends taggedError$10()("SectionConfigUnreadable", { file: Schema.String }) {};
16359
16504
  const CONFIG_FILE$4 = "vite.config.ts";
16360
- const FIRST$10 = 1;
16505
+ const FIRST$12 = 1;
16361
16506
  const ONE$1 = 1;
16362
16507
  const diagnostics = Metric.counter("lint.diagnostics", { description: "Diagnostics that each lint rule reported, before msch keeps only the errors" });
16363
16508
  const countDiagnostics = (check, found) => Effect.forEach(found, (diagnostic) => diagnostics.pipe(Metric.withAttributes({
@@ -16398,7 +16543,7 @@ const checkSection = (check) => (root) => Effect.gen(function* runSection() {
16398
16543
  onSuccess: (found) => pipe(found, Array$1.filter(({ severity }) => severity === "error"), Array$1.map((diagnostic) => ({
16399
16544
  file: files.join(root, diagnostic.path),
16400
16545
  line: diagnostic.line,
16401
- column: diagnostic.column ?? FIRST$10,
16546
+ column: diagnostic.column ?? FIRST$12,
16402
16547
  rule: check.rule,
16403
16548
  message: `${diagnostic.rule} ${diagnostic.message}${check.detail(diagnostic)}`
16404
16549
  })))
@@ -16420,8 +16565,8 @@ const EXTENSION$1 = /\.[^./]+$/u;
16420
16565
  const SETTINGS_FILE = ".claude/settings.json";
16421
16566
  const PLUGIN_HOOKS = /(?:^|\/)hooks\/hooks\.json$/u;
16422
16567
  const PLUGIN_ROOT = /\$\{CLAUDE_PLUGIN_ROOT\}/gu;
16423
- const READ_CONCURRENCY$17 = 64;
16424
- const RULE$36 = "shell-script";
16568
+ const READ_CONCURRENCY$16 = 64;
16569
+ const RULE$37 = "shell-script";
16425
16570
  const MESSAGE$9 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only a SessionStart hook in .claude/settings.json, which installs the toolchain, and a script that a plugin's hooks/hooks.json runs to provide the plugin's dependencies before its TypeScript can load stay shell scripts.";
16426
16571
  const HookSchema = Schema.Struct({
16427
16572
  command: Schema.optional(Schema.String),
@@ -16430,14 +16575,14 @@ const HookSchema = Schema.Struct({
16430
16575
  const MatcherSchema = Schema.Struct({ hooks: Schema.Array(HookSchema) });
16431
16576
  const HooksSchema = Schema.Struct({ SessionStart: MatcherSchema.pipe(Schema.Array, Schema.optional) });
16432
16577
  const SettingsSchema = Schema.Struct({ hooks: Schema.optional(HooksSchema) });
16433
- const decodeSettings = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
16578
+ const decodeSettings$1 = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
16434
16579
  const PluginHooksSchema = Schema.Struct({ hooks: Schema.Record(Schema.String, Schema.Array(MatcherSchema)) });
16435
16580
  const decodePluginHooks = Schema.decodeOption(Schema.fromJsonString(PluginHooksSchema));
16436
16581
  const NO_TEXT = [];
16437
16582
  const commandText = ({ command, args }) => [...Option.toArray(Option.fromUndefinedOr(command)), ...pipe(Option.fromUndefinedOr(args), Option.getOrElse(() => NO_TEXT))];
16438
16583
  const matcherText = ({ hooks }) => pipe(hooks, Array$1.flatMap((hook) => commandText(hook)));
16439
16584
  const sessionStartCommands = (source) => {
16440
- const matchers = pipe(decodeSettings(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.flatMap(({ SessionStart }) => Option.fromUndefinedOr(SessionStart)));
16585
+ const matchers = pipe(decodeSettings$1(source), Option.flatMap(({ hooks }) => Option.fromUndefinedOr(hooks)), Option.flatMap(({ SessionStart }) => Option.fromUndefinedOr(SessionStart)));
16441
16586
  return pipe(matchers, Option.map(Array$1.flatMap((matcher) => matcherText(matcher))), Option.getOrElse(() => NO_TEXT));
16442
16587
  };
16443
16588
  const pluginRootOf = (hooksFile) => String$1.replace(PLUGIN_HOOKS, "")(hooksFile);
@@ -16449,7 +16594,7 @@ const pluginCommands = (hooksFile, source) => {
16449
16594
  const hasExtension = (name) => EXTENSION$1.test(baseName$1(name));
16450
16595
  const pluginSessionStarts = Effect.fn("pluginSessionStarts")(function* pluginSessionStarts(root, names) {
16451
16596
  const files = yield* RepositoryFiles;
16452
- const commands = yield* Effect.forEach(pipe(names, Array$1.filter((name) => PLUGIN_HOOKS.test(name))), (name) => files.readFile(files.join(root, name)).pipe(Effect.map((source) => pipe(source, Option.map((text) => pluginCommands(name, text)), Option.getOrElse(() => NO_TEXT)))), { concurrency: READ_CONCURRENCY$17 });
16597
+ const commands = yield* Effect.forEach(pipe(names, Array$1.filter((name) => PLUGIN_HOOKS.test(name))), (name) => files.readFile(files.join(root, name)).pipe(Effect.map((source) => pipe(source, Option.map((text) => pluginCommands(name, text)), Option.getOrElse(() => NO_TEXT)))), { concurrency: READ_CONCURRENCY$16 });
16453
16598
  return Array$1.flatten(commands);
16454
16599
  });
16455
16600
  /** @internal */
@@ -16467,8 +16612,8 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
16467
16612
  return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
16468
16613
  };
16469
16614
  const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
16470
- const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$17 });
16471
- return pipe(shell, Array$1.map((name) => problemInFile(RULE$36)(files.join(root, name), MESSAGE$9)));
16615
+ const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$16 });
16616
+ return pipe(shell, Array$1.map((name) => problemInFile(RULE$37)(files.join(root, name), MESSAGE$9)));
16472
16617
  });
16473
16618
  // src/features/check-structure/model/structure.ts
16474
16619
  const checkStructure = checkSection({
@@ -16544,14 +16689,14 @@ const problemsOf = (source) => pipe(simpleCommands(source.text), Array$1.flatMap
16544
16689
  const commandProblems$2 = (sources) => pipe(sources, Array$1.flatMap(problemsOf));
16545
16690
  // src/shared/lib/workflow-run.ts
16546
16691
  const RUN_KEY = "run";
16547
- const START$22 = 0;
16548
- const startOf$1 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$22));
16692
+ const START$23 = 0;
16693
+ const startOf$3 = (range) => pipe(Option.fromNullishOr(range), Option.map(([start]) => start), Option.getOrElse(() => START$23));
16549
16694
  const runScriptsOf = (source) => {
16550
16695
  const found = [];
16551
16696
  visit$1(parseDocument(source), { Pair: (_key, pair) => {
16552
16697
  if (isPair(pair) && isScalar(pair.key) && pair.key.value === RUN_KEY && isScalar(pair.value) && typeof pair.value.value === "string") found.push({
16553
16698
  text: pair.value.value,
16554
- start: startOf$1(pair.value.range)
16699
+ start: startOf$3(pair.value.range)
16555
16700
  });
16556
16701
  } });
16557
16702
  return found;
@@ -16601,16 +16746,16 @@ const AGENT_DOCS = [
16601
16746
  ":(glob)**/CLAUDE.md",
16602
16747
  ...EXCLUDED$5
16603
16748
  ];
16604
- const READ_CONCURRENCY$16 = 16;
16605
- const START$21 = 0;
16606
- const FIRST$9 = 1;
16749
+ const READ_CONCURRENCY$15 = 16;
16750
+ const START$22 = 0;
16751
+ const FIRST$11 = 1;
16607
16752
  const LINE = "\n";
16608
16753
  const CommandText = Schema.Union([Schema.String, Schema.Array(Schema.String)]);
16609
16754
  const decodeCommandText = Schema.decodeUnknownOption(CommandText);
16610
16755
  const decodeJson$1 = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown));
16611
16756
  const decodeArguments = Schema.decodeUnknownOption(Schema.Array(Schema.String));
16612
16757
  const NO_SOURCES = [];
16613
- const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$21));
16758
+ const offsetOf$2 = (source, text) => pipe(String$1.indexOf(text)(source), Option.getOrElse(() => START$22));
16614
16759
  const scriptSources = (file) => (source) => pipe(decodePackageJson(source), Option.flatMap(({ scripts }) => Option.fromUndefinedOr(scripts)), Option.map(Record.toEntries), Option.getOrElse(() => []), Array$1.map(([name, text]) => {
16615
16760
  const offset = offsetOf$2(source, `"${name}"`);
16616
16761
  return {
@@ -16632,8 +16777,8 @@ const hookSources = (file, name) => (source) => pipe(String$1.split(source, LINE
16632
16777
  kind: "hook",
16633
16778
  file,
16634
16779
  position: {
16635
- line: index + FIRST$9,
16636
- column: FIRST$9
16780
+ line: index + FIRST$11,
16781
+ column: FIRST$11
16637
16782
  },
16638
16783
  name,
16639
16784
  text
@@ -16670,7 +16815,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
16670
16815
  return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
16671
16816
  });
16672
16817
  const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
16673
- const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$16 });
16818
+ const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$15 });
16674
16819
  return Array$1.flatten(found);
16675
16820
  });
16676
16821
  const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
@@ -16682,7 +16827,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
16682
16827
  onSome: sourcesOf(file, name)
16683
16828
  });
16684
16829
  return files.readFile(file).pipe(Effect.map(sourcesIn));
16685
- }, { concurrency: READ_CONCURRENCY$16 });
16830
+ }, { concurrency: READ_CONCURRENCY$15 });
16686
16831
  return Array$1.flatten(found);
16687
16832
  });
16688
16833
  /** @internal */
@@ -16706,7 +16851,7 @@ const commandSources = Effect.fn("commandSources")(function* commandSources(root
16706
16851
  return Array$1.flatten(found);
16707
16852
  });
16708
16853
  // src/features/check-vite-plus/model/package-scripts.ts
16709
- const RULE$35 = "package-script";
16854
+ const RULE$36 = "package-script";
16710
16855
  const LIFECYCLE = [
16711
16856
  "preinstall",
16712
16857
  "install",
@@ -16729,12 +16874,12 @@ const LIFECYCLE = [
16729
16874
  const problemOf$6 = ({ file, position, name }) => ({
16730
16875
  file,
16731
16876
  ...position,
16732
- rule: RULE$35,
16877
+ rule: RULE$36,
16733
16878
  message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
16734
16879
  });
16735
16880
  const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
16736
16881
  // src/features/check-vite-plus/model/vite-plus-block.ts
16737
- const RULE$34 = "vite-plus-block";
16882
+ const RULE$35 = "vite-plus-block";
16738
16883
  const MARKER = Array$1.join([
16739
16884
  "<!--",
16740
16885
  "VITE PLUS START",
@@ -16747,7 +16892,7 @@ const problemIn = (file) => (source) => {
16747
16892
  return Option.some({
16748
16893
  file,
16749
16894
  ...positionOf(source)(index.value),
16750
- rule: RULE$34,
16895
+ rule: RULE$35,
16751
16896
  message: MESSAGE$8
16752
16897
  });
16753
16898
  };
@@ -16763,13 +16908,478 @@ const checkVitePlus = Effect.fn("checkVitePlus")(function* checkVitePlus(root) {
16763
16908
  ...blocks
16764
16909
  ];
16765
16910
  });
16911
+ // src/features/check-workflows/model/yaml-nodes.ts
16912
+ const EMPTY$2 = "";
16913
+ const ByStartDescending = Order.mapInput(Order.flip(Number$1.Order), ({ start }) => start);
16914
+ const NEWLINE$1 = "\n";
16915
+ const FIRST$10 = 0;
16916
+ const NEXT$3 = 1;
16917
+ const RANGE_END = 2;
16918
+ /** @internal */
16919
+ const scalarText = (node) => pipe(Option.liftPredicate(node, isScalar), Option.map(({ value }) => value), Option.filter(Predicate$1.isString), Option.getOrElse(() => EMPTY$2));
16920
+ /** @internal */
16921
+ const fieldOf$1 = (key) => (node) => pipe(Option.liftPredicate(node, isMap), Option.map((map) => scalarText(map.get(key, true))), Option.getOrElse(() => EMPTY$2));
16922
+ /** @internal */
16923
+ const usesOf = fieldOf$1("uses");
16924
+ /** @internal */
16925
+ const lineStart = ({ source, offset }) => pipe(source, String$1.slice(FIRST$10, offset), String$1.lastIndexOf(NEWLINE$1), Option.map((index) => index + NEXT$3), Option.getOrElse(() => FIRST$10));
16926
+ const rangeOf$4 = (node) => pipe(Option.liftPredicate(node, isMap), Option.flatMapNullishOr(({ range }) => range));
16927
+ /** @internal */
16928
+ const startOf$2 = (node) => pipe(rangeOf$4(node), Option.map(([start]) => start));
16929
+ /** @internal */
16930
+ const endOf = (node) => pipe(rangeOf$4(node), Option.map((range) => range[RANGE_END]));
16931
+ const insertAt = (text) => ({ start, end, text: insert }) => pipe(text, String$1.slice(FIRST$10, start)) + insert + pipe(text, String$1.slice(end));
16932
+ /** @internal */
16933
+ const applyEdits = ({ source, edits }) => pipe(Array$1.sort(edits, ByStartDescending), Array$1.match({
16934
+ onEmpty: () => source,
16935
+ onNonEmpty: ([edit, ...rest]) => applyEdits({
16936
+ source: insertAt(source)(edit),
16937
+ edits: rest
16938
+ })
16939
+ }));
16940
+ /** @internal */
16941
+ const itemsOf = (node) => pipe(Option.liftPredicate(node, isSeq), Option.map(({ items }) => items), Option.getOrElse(() => []));
16942
+ // src/features/check-workflows/model/apply-template.ts
16943
+ const LAST_NEWLINE = /\n?$/u;
16944
+ const NEWLINE = "\n";
16945
+ const rangeOf$3 = (node) => pipe(Option.liftPredicate(node, isNode), Option.flatMapNullishOr(({ range }) => range));
16946
+ const jobNamed = (source, name) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.flatMap(({ items }) => Array$1.findFirst(items, ({ key }) => scalarText(key) === name)));
16947
+ const pairSpan = (source, pair) => Option.all({
16948
+ start: Option.map(rangeOf$3(pair.key), ([offset]) => lineStart({
16949
+ source,
16950
+ offset
16951
+ })),
16952
+ end: Option.map(rangeOf$3(pair.value), ([, end]) => end)
16953
+ });
16954
+ const fieldOfJob = (source, job, field) => pipe(jobNamed(source, job), Option.flatMap(({ value }) => Option.liftPredicate(value, isMap)), Option.flatMap(({ items }) => Array$1.findFirst(items, ({ key }) => scalarText(key) === field)));
16955
+ const inputsSpan = (source, job) => pipe(fieldOfJob(source, job, "with"), Option.flatMap((pair) => pairSpan(source, pair)));
16956
+ const ownInputsEdit = (template, existing) => (job) => pipe(Option.all({
16957
+ into: inputsSpan(template, job),
16958
+ from: inputsSpan(existing, job)
16959
+ }), Option.map(({ into, from }) => ({
16960
+ start: into.start,
16961
+ end: into.end,
16962
+ text: pipe(existing, String$1.slice(from.start, from.end), String$1.replace(LAST_NEWLINE, NEWLINE))
16963
+ })));
16964
+ const applied = (template, existing) => {
16965
+ const edits = pipe(template.ownInputs, Array$1.map(ownInputsEdit(template.source, existing)), Array$1.getSomes);
16966
+ return applyEdits({
16967
+ source: template.source,
16968
+ edits
16969
+ });
16970
+ };
16971
+ /** @internal */
16972
+ const fromTemplate = ({ templates, name, source }) => pipe(templates, Array$1.findFirst((template) => template.name === name), Option.match({
16973
+ onNone: () => source,
16974
+ onSome: (template) => applied(template, source)
16975
+ }));
16976
+ // src/features/check-workflows/model/shared-actions.ts
16977
+ const ACTIONS_REF = "1f825b932e1a85233322991acd805c65b75dc358";
16978
+ const REPOSITORY = `${SELF_REPOSITORY}/.github`;
16979
+ const actionPath = (name) => `${REPOSITORY}/shared-actions/${name}`;
16980
+ const workflowPath = (file) => `${REPOSITORY}/workflows/${file}`;
16981
+ const SETUP_ACTION = actionPath("setup");
16982
+ const VERIFY_ACTION = actionPath("verify");
16983
+ const MAINTAIN_WORKFLOW_FILE = "maintain-caches.yml";
16984
+ const MAINTAIN_WORKFLOW = workflowPath(MAINTAIN_WORKFLOW_FILE);
16985
+ const KINDS = String.raw`${REPOSITORY}/(?:shared-actions|workflows)/`;
16986
+ const ACTIONS_USE = new RegExp(String.raw`^${KINDS}[^@]+@`, "u");
16987
+ const pinned = (path) => `${path}@${ACTIONS_REF}`;
16988
+ const CACHE_WORKFLOW = "cache.yml";
16989
+ const DEFAULT_BRANCH_ONLY = "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)";
16990
+ const REGISTRY_ACCESS = `\${{ secrets.TAKUMI_GUARD_TOKEN }}`;
16991
+ const CACHE_WORKFLOW_SOURCE = Array$1.join([
16992
+ "name: cache",
16993
+ "",
16994
+ "on:",
16995
+ " schedule:",
16996
+ " - cron: \"47 * * * *\"",
16997
+ " workflow_dispatch:",
16998
+ "",
16999
+ "permissions: {}",
17000
+ "",
17001
+ "jobs:",
17002
+ " caches:",
17003
+ ` if: ${DEFAULT_BRANCH_ONLY}`,
17004
+ " permissions:",
17005
+ " actions: write",
17006
+ " contents: read",
17007
+ ` uses: ${pinned(MAINTAIN_WORKFLOW)}`,
17008
+ " secrets:",
17009
+ ` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
17010
+ ""
17011
+ ], "\n");
17012
+ const PINNED_USE = new RegExp(String.raw`(?<use>${KINDS}[^@\s]+)@(?<ref>[0-9a-f]{40})`, "gu");
17013
+ const refsIn = (source) => pipe(source, String$1.matchAll(PINNED_USE), Array$1.fromIterable, Array$1.flatMap(({ groups }) => pipe(Option.fromNullishOr(groups), Option.flatMap(Record.get("ref")), Option.toArray)));
17014
+ const withoutRefs = (source) => pipe(source, String$1.replaceAll(PINNED_USE, "$<use>"));
17015
+ // src/features/check-workflows/model/cache-workflow.ts
17016
+ const INDENT$2 = " ";
17017
+ const CALL = "caches";
17018
+ const jobText = (jobs) => pipe([
17019
+ "",
17020
+ `${INDENT$2}${CALL}:`,
17021
+ `${INDENT$2}${INDENT$2}needs: [${pipe(jobs, Array$1.join(", "))}]`,
17022
+ `${INDENT$2}${INDENT$2}if: always() && ${DEFAULT_BRANCH_ONLY}`,
17023
+ `${INDENT$2}${INDENT$2}permissions:`,
17024
+ `${INDENT$2}${INDENT$2}${INDENT$2}actions: write`,
17025
+ `${INDENT$2}${INDENT$2}${INDENT$2}contents: read`,
17026
+ `${INDENT$2}${INDENT$2}uses: ${pinned(MAINTAIN_WORKFLOW)}`,
17027
+ `${INDENT$2}${INDENT$2}secrets:`,
17028
+ `${INDENT$2}${INDENT$2}${INDENT$2}TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`
17029
+ ], Array$1.map((line) => `${line}\n`), Array$1.join(""));
17030
+ /** @internal */
17031
+ const addMaintainJob = ({ source, jobs, telemetryNeeds }) => pipe(Option.liftPredicate(parseDocument(source).get("jobs", true), isMap), Option.flatMap(endOf), Option.match({
17032
+ onNone: () => source,
17033
+ onSome: (at) => applyEdits({
17034
+ source,
17035
+ edits: [{
17036
+ start: at,
17037
+ end: at,
17038
+ text: jobText(jobs)
17039
+ }, ...pipe(telemetryNeeds, Array$1.map((start) => ({
17040
+ start,
17041
+ end: start,
17042
+ text: `, ${CALL}`
17043
+ })))]
17044
+ })
17045
+ }));
17046
+ // src/features/check-workflows/model/drift.ts
17047
+ const SINGLE_REF = 1;
17048
+ /** @internal */
17049
+ const refDrift = (sources) => {
17050
+ const pinned = pipe(sources, Array$1.filter(({ source }) => !Array$1.isReadonlyArrayEmpty(refsIn(source))));
17051
+ if (new Set(pipe(pinned, Array$1.flatMap(({ source }) => refsIn(source)))).size <= SINGLE_REF) return [];
17052
+ return pipe(pinned, Array$1.map(({ file }) => ({
17053
+ file,
17054
+ reason: "ref"
17055
+ })));
17056
+ };
17057
+ /** @internal */
17058
+ const changeDrift = (changes) => pipe(changes, Array$1.flatMap(({ file, previous, setup, source }) => pipe([{
17059
+ reason: "setup",
17060
+ before: previous,
17061
+ after: setup
17062
+ }, {
17063
+ reason: "workflow",
17064
+ before: setup,
17065
+ after: source
17066
+ }], Array$1.filter(({ before, after }) => withoutRefs(before) !== withoutRefs(after)), Array$1.map(({ reason }) => ({
17067
+ file,
17068
+ reason
17069
+ })))));
17070
+ // src/features/check-workflows/model/rewrite-steps.ts
17071
+ const CACHE_USE = /^actions\/cache(?:\/(?:restore|save))?@/u;
17072
+ const SETUP_VP_USE = "voidzero-dev/setup-vp@";
17073
+ const CHECKOUT_USE = "actions/checkout@";
17074
+ const LOCAL_USE = /^(?:\$|\.)\/\.github\/actions\/(?<name>[^/@\s]+)$/u;
17075
+ const MANAGED_PATH = /\.cache\/pnpm|vpa\/tools|\.cache\/msch|store-path/u;
17076
+ const MANAGED_RUN = /npm\.flatt\.tech|vp install --frozen-lockfile|pnpm store (?:path|prune)|\.cache\/pnpm\/v/u;
17077
+ const VP_COMMAND = /(?:^|[\s;&|(])vpx?\s/u;
17078
+ const SETUP_INPUTS = [
17079
+ ["cache", "\"true\""],
17080
+ ["save", "\"false\""],
17081
+ ["session-path", "\"true\""]
17082
+ ];
17083
+ const INDENT$1 = " ";
17084
+ const FIRST$9 = 0;
17085
+ const runOf = fieldOf$1("run");
17086
+ const pathOf = (step) => pipe(Option.liftPredicate(step, isMap), Option.map((map) => scalarText(map.getIn(["with", "path"], true))), Option.getOrElse(() => ""));
17087
+ const isManaged = (step) => pipe(usesOf(step), String$1.startsWith(SETUP_VP_USE)) || CACHE_USE.test(usesOf(step)) && MANAGED_PATH.test(pathOf(step)) || MANAGED_RUN.test(runOf(step));
17088
+ const localAction = (step) => pipe(LOCAL_USE.exec(usesOf(step)), Option.fromNullishOr, Option.flatMapNullishOr(({ groups }) => groups), Option.flatMap(Record.get("name")));
17089
+ const isSetup = (localSetups) => (step) => pipe(usesOf(step), String$1.startsWith(`${SETUP_ACTION}@`)) || pipe(localAction(step), Option.exists((name) => localSetups.has(name)));
17090
+ const runsVp = (step) => pipe(usesOf(step), String$1.startsWith(`${VERIFY_ACTION}@`)) || VP_COMMAND.test(runOf(step));
17091
+ const valueOf$1 = (inputs, name, fallback) => {
17092
+ if (pipe(inputs, Array$1.contains(name))) return `\${{ inputs.${name} }}`;
17093
+ return fallback;
17094
+ };
17095
+ const inputLines = (inputs, pad) => [`${pad}with:`, ...pipe(SETUP_INPUTS, Array$1.map(([name, fallback]) => `${pad}${INDENT$1}${name}: ${valueOf$1(inputs, name, fallback)}`))];
17096
+ const prefixOf = (source, step) => pipe(startOf$2(step), Option.map((start) => pipe(source, String$1.slice(lineStart({
17097
+ source,
17098
+ offset: start
17099
+ }), start))), Option.getOrElse(() => ""));
17100
+ const setupText = ({ source, inputs }, sample) => {
17101
+ const prefix = prefixOf(source, sample);
17102
+ const pad = pipe(" ", String$1.repeat(prefix.length));
17103
+ return pipe([`${prefix}uses: ${pinned(SETUP_ACTION)}`, ...inputLines(inputs, pad)], Array$1.map((line) => `${line}\n`), Array$1.join(""));
17104
+ };
17105
+ const removal = (source, step) => Option.zipWith(startOf$2(step), endOf(step), (start, end) => ({
17106
+ start: lineStart({
17107
+ source,
17108
+ offset: start
17109
+ }),
17110
+ end,
17111
+ text: ""
17112
+ }));
17113
+ const replacement = (rewrite, step) => Option.map(removal(rewrite.source, step), (edit) => ({
17114
+ ...edit,
17115
+ text: setupText(rewrite, step)
17116
+ }));
17117
+ const insertion = (rewrite, items) => {
17118
+ const offset = pipe(items, Array$1.findFirst((step) => pipe(usesOf(step), String$1.startsWith(CHECKOUT_USE))), Option.flatMap(endOf), Option.orElse(() => pipe(Array$1.head(items), Option.flatMap(startOf$2), Option.map((start) => lineStart({
17119
+ source: rewrite.source,
17120
+ offset: start
17121
+ })))));
17122
+ return Option.zipWith(offset, Array$1.head(items), (at, head) => ({
17123
+ start: at,
17124
+ end: at,
17125
+ text: setupText(rewrite, head)
17126
+ }));
17127
+ };
17128
+ const managedEdits = (rewrite, items) => {
17129
+ const hasSetup = pipe(items, Array$1.some(isSetup(rewrite.localSetups)));
17130
+ return pipe(items, Array$1.filter(isManaged), Array$1.map((step, index) => {
17131
+ if (index === FIRST$9 && !hasSetup) return replacement(rewrite, step);
17132
+ return removal(rewrite.source, step);
17133
+ }), Array$1.getSomes);
17134
+ };
17135
+ /** @internal */
17136
+ const stepEdits = (rewrite) => {
17137
+ if (!isSeq(rewrite.steps)) return [];
17138
+ const items = rewrite.steps.items;
17139
+ if (pipe(items, Array$1.some(isManaged))) return managedEdits(rewrite, items);
17140
+ const needsSetup = pipe(items, Array$1.some(runsVp));
17141
+ const hasSetup = pipe(items, Array$1.some(isSetup(rewrite.localSetups)));
17142
+ if (needsSetup && !hasSetup) return pipe(insertion(rewrite, items), Option.toArray);
17143
+ return [];
17144
+ };
17145
+ // src/features/check-workflows/model/rewrite-document.ts
17146
+ const AFTER_REF = /@.*$/u;
17147
+ const CLOSING_BRACKET = 1;
17148
+ const TELEMETRY_USE = /\/ci-telemetry@/u;
17149
+ const pinEdits = (document, source) => {
17150
+ const found = [];
17151
+ visit$1(document, { Pair: (_key, pair) => {
17152
+ if (isPair(pair) && scalarText(pair.key) === "uses" && isScalar(pair.value) && ACTIONS_USE.test(scalarText(pair.value))) pipe(Option.fromNullishOr(pair.value.range), Option.map(([start, end]) => ({
17153
+ start,
17154
+ end,
17155
+ text: pipe(source, String$1.slice(start, end), String$1.replace(AFTER_REF, `@${ACTIONS_REF}`))
17156
+ })), Option.map((edit) => found.push(edit)));
17157
+ } });
17158
+ return found;
17159
+ };
17160
+ const tableAt = (document, path) => pipe(Option.liftPredicate(document.getIn(path, true), isMap), Option.map(({ items }) => pipe(items, Array$1.map(({ key, value }) => [scalarText(key), value]))), Option.getOrElse(() => []));
17161
+ const jobsOf = (document) => pipe(tableAt(document, ["jobs"]), Array$1.map(([, job]) => job), Array$1.filter(isMap));
17162
+ const stepsOf = (job) => pipe(Option.liftPredicate(job, isMap), Option.map((map) => itemsOf(map.get("steps", true))), Option.getOrElse(() => []));
17163
+ const actionSteps = (document) => {
17164
+ const steps = document.getIn(["runs", "steps"], true);
17165
+ return itemsOf(steps);
17166
+ };
17167
+ const allSteps = (document) => pipe(jobsOf(document), Array$1.flatMap(stepsOf), Array$1.appendAll(actionSteps(document)));
17168
+ const includesSetup = (document) => pipe(allSteps(document), Array$1.some((step) => pipe(usesOf(step), String$1.startsWith(`${SETUP_ACTION}@`))));
17169
+ const callsMaintain = (document) => pipe(jobsOf(document), Array$1.some((job) => pipe(usesOf(job), String$1.startsWith(`${MAINTAIN_WORKFLOW}@`))));
17170
+ const reportsTelemetry = (job) => pipe(stepsOf(job), Array$1.some((step) => TELEMETRY_USE.test(usesOf(step))));
17171
+ const telemetryNeedsAt = (document) => pipe(jobsOf(document), Array$1.filter(reportsTelemetry), Array$1.flatMap((job) => pipe(Option.liftPredicate(job.getIn(["needs"], true), isSeq), Option.filter(({ flow }) => flow === true), Option.flatMap(({ range }) => Option.fromNullishOr(range)), Option.map(([, valueEnd]) => valueEnd - CLOSING_BRACKET), Option.toArray)));
17172
+ const inputNames = (document) => pipe(tableAt(document, ["inputs"]), Array$1.map(([name]) => name));
17173
+ /** @internal */
17174
+ const rewriteDocument = ({ source, localSetups }) => {
17175
+ const document = parseDocument(source);
17176
+ const inputs = inputNames(document);
17177
+ const edits = pipe([...pipe(jobsOf(document), Array$1.map((job) => job.get("steps", true))), document.getIn(["runs", "steps"], true)], Array$1.flatMap((steps) => stepEdits({
17178
+ steps,
17179
+ source,
17180
+ localSetups,
17181
+ inputs
17182
+ })), Array$1.appendAll(pinEdits(document, source)));
17183
+ const rewritten = applyEdits({
17184
+ source,
17185
+ edits
17186
+ });
17187
+ const result = parseDocument(rewritten);
17188
+ return {
17189
+ source: rewritten,
17190
+ includesSetup: includesSetup(result),
17191
+ callsMaintain: callsMaintain(result),
17192
+ telemetryNeeds: telemetryNeedsAt(result),
17193
+ jobs: pipe(tableAt(result, ["jobs"]), Array$1.filter(([, job]) => !reportsTelemetry(job)), Array$1.map(([name]) => name))
17194
+ };
17195
+ };
17196
+ // src/features/check-workflows/model/template-workflows.ts
17197
+ const UP_TO_DATE_SOURCE = Array$1.join([
17198
+ "name: up-to-date",
17199
+ "",
17200
+ "on:",
17201
+ " pull_request:",
17202
+ " types: [opened, synchronize, reopened, ready_for_review, edited]",
17203
+ " workflow_dispatch:",
17204
+ "",
17205
+ "permissions: {}",
17206
+ "",
17207
+ "jobs:",
17208
+ " up-to-date:",
17209
+ " permissions:",
17210
+ " actions: write",
17211
+ " contents: read",
17212
+ " pull-requests: read",
17213
+ ` uses: ${pinned(workflowPath("up-to-date.yml"))}`,
17214
+ " with:",
17215
+ " full-check: false",
17216
+ " secrets:",
17217
+ ` TAKUMI_GUARD_TOKEN: ${REGISTRY_ACCESS}`,
17218
+ ""
17219
+ ], "\n");
17220
+ const UPDATE_BRANCHES_SOURCE = Array$1.join([
17221
+ "name: update-branches",
17222
+ "",
17223
+ "on:",
17224
+ " push:",
17225
+ " branches: [main]",
17226
+ " workflow_dispatch:",
17227
+ "",
17228
+ "permissions: {}",
17229
+ "",
17230
+ "jobs:",
17231
+ " update-branches:",
17232
+ " permissions:",
17233
+ " actions: read",
17234
+ " contents: read",
17235
+ " id-token: write",
17236
+ ` uses: ${pinned(workflowPath("update-branches.yml"))}`,
17237
+ ""
17238
+ ], "\n");
17239
+ /** @internal */
17240
+ const TEMPLATE_WORKFLOWS = [{
17241
+ name: "up-to-date.yml",
17242
+ source: UP_TO_DATE_SOURCE,
17243
+ ownInputs: ["up-to-date"]
17244
+ }, {
17245
+ name: "update-branches.yml",
17246
+ source: UPDATE_BRANCHES_SOURCE,
17247
+ ownInputs: []
17248
+ }];
17249
+ // src/features/check-workflows/model/sync-ci.ts
17250
+ const WORKFLOWS = ".github/workflows";
17251
+ const ACTIONS = ".github/actions";
17252
+ const YAML_FILE = /\.ya?ml$/u;
17253
+ const ACTION_FILES = ["action.yml", "action.yaml"];
17254
+ const SEQUENTIAL$3 = { concurrency: 1 };
17255
+ const entriesOf$1 = (directory) => FileSystem.FileSystem.pipe(Effect.flatMap((fs) => fs.readDirectory(directory)), Effect.map((entries) => Array$1.sort(entries, String$1.Order)), Effect.orElseSucceed(() => []));
17256
+ const readSource = (file, name) => FileSystem.FileSystem.pipe(Effect.flatMap((fs) => fs.readFileString(file)), Effect.map((source) => ({
17257
+ file,
17258
+ name,
17259
+ source
17260
+ })), Effect.orDie);
17261
+ const workflowSources = (root) => Effect.gen(function* readWorkflows() {
17262
+ const path = yield* Path.Path;
17263
+ const directory = path.join(root, WORKFLOWS);
17264
+ const entries = yield* entriesOf$1(directory);
17265
+ return yield* Effect.forEach(pipe(entries, Array$1.filter((entry) => YAML_FILE.test(entry))), (entry) => readSource(path.join(directory, entry), entry), SEQUENTIAL$3);
17266
+ });
17267
+ const actionFile = (directory, name) => Effect.gen(function* findActionFile() {
17268
+ const fs = yield* FileSystem.FileSystem;
17269
+ const path = yield* Path.Path;
17270
+ const found = yield* Effect.findFirst(pipe(ACTION_FILES, Array$1.map((file) => path.join(directory, name, file))), (candidate) => fs.exists(candidate).pipe(Effect.orElseSucceed(() => false)));
17271
+ return yield* Option.match(found, {
17272
+ onNone: () => Effect.succeedNone,
17273
+ onSome: (file) => readSource(file, name).pipe(Effect.asSome)
17274
+ });
17275
+ });
17276
+ const actionSources = (root) => Effect.gen(function* readActions() {
17277
+ const directory = (yield* Path.Path).join(root, ACTIONS);
17278
+ const names = yield* entriesOf$1(directory);
17279
+ const found = yield* Effect.forEach(names, (name) => actionFile(directory, name), SEQUENTIAL$3);
17280
+ return Array$1.getSomes(found);
17281
+ });
17282
+ const settle = (actions, known) => {
17283
+ const next = new Set(pipe(actions, Array$1.filter(({ source }) => rewriteDocument({
17284
+ source,
17285
+ localSetups: known
17286
+ }).includesSetup), Array$1.map(({ name }) => name)));
17287
+ if (next.size === known.size) return known;
17288
+ return settle(actions, next);
17289
+ };
17290
+ const rewriteAll = (sources, localSetups) => pipe(sources, Array$1.map((found) => ({
17291
+ ...found,
17292
+ rewritten: rewriteDocument({
17293
+ source: found.source,
17294
+ localSetups
17295
+ })
17296
+ })));
17297
+ const cacheWorkflow = ({ root, workflows, usesSetup }) => Effect.gen(function* planCacheWorkflow() {
17298
+ const path = yield* Path.Path;
17299
+ if (!usesSetup || pipe(workflows, Array$1.some(({ rewritten }) => rewritten.callsMaintain))) return [];
17300
+ return [pipe(workflows, Array$1.findFirst(({ name }) => name === CACHE_WORKFLOW), Option.match({
17301
+ onNone: () => ({
17302
+ file: path.join(root, WORKFLOWS, CACHE_WORKFLOW),
17303
+ previous: "",
17304
+ setup: CACHE_WORKFLOW_SOURCE,
17305
+ source: CACHE_WORKFLOW_SOURCE
17306
+ }),
17307
+ onSome: ({ file, rewritten, source }) => {
17308
+ const maintained = addMaintainJob({
17309
+ source: rewritten.source,
17310
+ jobs: rewritten.jobs,
17311
+ telemetryNeeds: rewritten.telemetryNeeds
17312
+ });
17313
+ return {
17314
+ file,
17315
+ previous: source,
17316
+ setup: maintained,
17317
+ source: maintained
17318
+ };
17319
+ }
17320
+ }))];
17321
+ });
17322
+ const write = (root, { file, source }) => Effect.gen(function* writeChanged() {
17323
+ const fs = yield* FileSystem.FileSystem;
17324
+ const path = yield* Path.Path;
17325
+ yield* fs.writeFileString(file, source);
17326
+ const stdio = yield* Stdio.Stdio;
17327
+ yield* Stream.make(`Updated ${path.relative(root, file)}\n`).pipe(Stream.run(stdio.stdout()), Effect.orDie);
17328
+ });
17329
+ const OWN_CI = {
17330
+ changes: [],
17331
+ sources: []
17332
+ };
17333
+ const isHost = (root) => Effect.gen(function* findMaintainWorkflow() {
17334
+ const fs = yield* FileSystem.FileSystem;
17335
+ const path = yield* Path.Path;
17336
+ return yield* fs.exists(path.join(root, WORKFLOWS, MAINTAIN_WORKFLOW_FILE)).pipe(Effect.orElseSucceed(() => false));
17337
+ });
17338
+ const planRewrites = (root, workflows, actions) => Effect.gen(function* planChanges() {
17339
+ const localSetups = settle(actions, /* @__PURE__ */ new Set());
17340
+ const rewrittenWorkflows = rewriteAll(workflows, localSetups);
17341
+ const rewrittenActions = rewriteAll(actions, localSetups);
17342
+ const usesSetup = pipe([...rewrittenActions, ...rewrittenWorkflows], Array$1.some(({ rewritten }) => rewritten.includesSetup));
17343
+ const created = yield* cacheWorkflow({
17344
+ root,
17345
+ workflows: rewrittenWorkflows,
17346
+ usesSetup
17347
+ });
17348
+ const templates = pipe(TEMPLATE_WORKFLOWS, Array$1.filter(() => usesSetup));
17349
+ return {
17350
+ changes: pipe([...rewrittenActions, ...rewrittenWorkflows], Array$1.map(({ file, name, rewritten, source }) => ({
17351
+ file,
17352
+ previous: source,
17353
+ setup: rewritten.source,
17354
+ source: fromTemplate({
17355
+ templates,
17356
+ name,
17357
+ source: rewritten.source
17358
+ })
17359
+ })), Array$1.filter(({ previous, source }) => previous !== source), Array$1.filter(({ file }) => !pipe(created, Array$1.some((change) => change.file === file))), Array$1.appendAll(created)),
17360
+ sources: [...actions, ...workflows]
17361
+ };
17362
+ });
17363
+ const planned = (root) => Effect.gen(function* plan() {
17364
+ if (yield* isHost(root)) return OWN_CI;
17365
+ const workflows = yield* workflowSources(root);
17366
+ const actions = yield* actionSources(root);
17367
+ return yield* planRewrites(root, workflows, actions);
17368
+ });
17369
+ /** @internal */
17370
+ const findCiDrift = (root) => planned(root).pipe(Effect.map(({ changes, sources }) => [...changeDrift(changes), ...refDrift(sources)]));
17371
+ /** @internal */
17372
+ const syncCi = (root) => planned(root).pipe(Effect.flatMap(({ changes }) => Effect.forEach(changes, (change) => write(root, change), {
17373
+ ...SEQUENTIAL$3,
17374
+ discard: true
17375
+ })));
16766
17376
  // src/features/check-workflows/model/ci-drift.ts
16767
17377
  const SETUP_RULE$1 = "ci-setup";
16768
17378
  const REF_RULE = "ci-template-ref";
16769
17379
  const WORKFLOW_RULE = "ci-template-workflow";
16770
- const SETUP_MESSAGE = "differs from what `vpa ci` writes. Run `vpa ci`: it puts the shared `setup` action where a job runs `vp`, removes the hand-written cache steps and keeps the cache workflow that cleans up old entries.";
16771
- const REF_MESSAGE = "pins a different commit of the template than the other workflows. Run `vpa ci` to pin them all to one.";
16772
- const WORKFLOW_MESSAGE = "differs from the template's workflow, which Renovate does not update because it only moves the pinned commits. Run `vpa ci`: it writes the template's triggers and jobs, such as the `wake` job that starts the merge queue, and keeps the jobs the repository owns.";
17380
+ const SETUP_MESSAGE = "differs from what `msch ci` writes. Run `msch ci`: it puts the shared `setup` action where a job runs `vp`, removes the hand-written cache steps and keeps the cache workflow that cleans up old entries.";
17381
+ const REF_MESSAGE = "pins a different commit of the template than the other workflows. Run `msch ci` to pin them all to one.";
17382
+ const WORKFLOW_MESSAGE = "differs from the template's workflow, which Renovate does not update because it only moves the pinned commits. Run `msch ci`: it writes the template's triggers and jobs, which call the shared queue workflows, and keeps the inputs the repository gives them.";
16773
17383
  const setupProblem$1 = problemInFile(SETUP_RULE$1);
16774
17384
  const refProblem = problemInFile(REF_RULE);
16775
17385
  const workflowProblem = problemInFile(WORKFLOW_RULE);
@@ -16779,6 +17389,56 @@ const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
16779
17389
  const drifts = yield* findCiDrift(root);
16780
17390
  return pipe(drifts, Array$1.map(problemOf$5));
16781
17391
  });
17392
+ // src/features/check-workflows/model/optional-inputs.ts
17393
+ const RULE$34 = "optional-input";
17394
+ const ACTION_FILE = /^\.github\/(?:.+\/)?action\.ya?ml$/u;
17395
+ const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
17396
+ const START$21 = 0;
17397
+ const pairsAt = (document, path) => pipe(Option.liftPredicate(document.getIn(path, true), isMap), Option.map(({ items }) => items), Option.getOrElse(() => []));
17398
+ const declaredIn$2 = (name, document) => {
17399
+ if (ACTION_FILE.test(name)) return pipe(pairsAt(document, ["inputs"]), Array$1.map((pair) => ({
17400
+ kind: "input",
17401
+ pair
17402
+ })));
17403
+ return [...pipe(pairsAt(document, [
17404
+ "on",
17405
+ "workflow_call",
17406
+ "inputs"
17407
+ ]), Array$1.map((pair) => ({
17408
+ kind: "input",
17409
+ pair
17410
+ }))), ...pipe(pairsAt(document, [
17411
+ "on",
17412
+ "workflow_call",
17413
+ "secrets"
17414
+ ]), Array$1.map((pair) => ({
17415
+ kind: "secret",
17416
+ pair
17417
+ })))];
17418
+ };
17419
+ const isRequired = ({ pair }) => pipe(Option.liftPredicate(pair.value, isMap), Option.map((map) => map.get("required", true)), Option.exists((required) => isScalar(required) && required.value === true));
17420
+ const startOf$1 = ({ pair }) => pipe(Option.liftPredicate(pair.key, isScalar), Option.flatMapNullishOr(({ range }) => range), Option.map(([start]) => start), Option.getOrElse(() => START$21));
17421
+ const messageOf$1 = ({ kind, pair }) => `declares the ${kind} \`${scalarText(pair.key)}\` without \`required: true\`. Actions and reusable workflows take no optional ${kind}s: make it required and have every caller pass it, or remove it when no caller needs it.`;
17422
+ const problemsIn$12 = (file, name, source) => {
17423
+ const at = problemAtIndex(RULE$34)(file, source);
17424
+ return pipe(declaredIn$2(name, parseDocument(source)), Array$1.filter((declared) => !isRequired(declared)), Array$1.map((declared) => at(startOf$1(declared), messageOf$1(declared))));
17425
+ };
17426
+ /** @internal */
17427
+ const checkOptionalInputs = Effect.fn("checkOptionalInputs")(function* checkOptionalInputs(root) {
17428
+ const listed = yield* (yield* RepositoryFiles).listedFiles(root);
17429
+ const names = pipe(listed, Array$1.filter((name) => ACTION_FILE.test(name) || WORKFLOW_FILE.test(name)));
17430
+ return yield* problemsInFiles(root, names, ({ file, name, source }) => problemsIn$12(file, name, source));
17431
+ });
17432
+ // src/features/check-workflows/model/installed-version.ts
17433
+ const RANGE_PREFIX = /^[\^~]/u;
17434
+ /** @internal */
17435
+ const staleProblem = ({ installed, declared }) => pipe(declared, Option.map(String$1.replace(RANGE_PREFIX, "")), Option.filter((exact) => exact !== installed), Option.map((exact) => `msch ${installed} is installed, but the repository declares ${exact}, so the files it writes would not match what the current checks expect. Run \`vp install\`, then run \`msch ci\` again.`));
17436
+ const declaredIn$1 = (root) => Effect.promise(() => readWorkspaceManifest$1(root)).pipe(Effect.map((workspace) => pipe(Option.fromNullishOr(workspace), Option.flatMapNullishOr(({ catalog }) => catalog), Option.flatMapNullishOr((catalog) => catalog[name]))));
17437
+ /** @internal */
17438
+ const installedVersionProblem = (root) => declaredIn$1(root).pipe(Effect.map((declared) => staleProblem({
17439
+ installed: version,
17440
+ declared
17441
+ })));
16782
17442
  // src/features/check-workflows/model/release-please.ts
16783
17443
  const RULE$33 = "release-please";
16784
17444
  const RELEASE_PLEASE_FILE = /(?:^|\/)(?:release-please-config|\.release-please-manifest)\.json$/u;
@@ -16815,6 +17475,7 @@ const checkToolUse = Effect.fn("checkToolUse")(function* checkToolUse(root) {
16815
17475
  checkProjectExtensions(root),
16816
17476
  checkShellScripts(root),
16817
17477
  checkCiDrift(root),
17478
+ checkOptionalInputs(root),
16818
17479
  checkReleasePlease(root),
16819
17480
  checkRestrictedRules(root),
16820
17481
  checkTypeExemptions(root),
@@ -16891,8 +17552,8 @@ const tomlSourceComments = (source) => pipe(parseTOML(source).comments, Array$1.
16891
17552
  text: String$1.slice(start, end)(source)
16892
17553
  })));
16893
17554
  // src/features/ban-comments/model/found-comment.ts
16894
- const taggedError$8 = Schema.TaggedError;
16895
- var CommentsUnreadable = class extends taggedError$8()("CommentsUnreadable", {
17555
+ const taggedError$9 = Schema.TaggedError;
17556
+ var CommentsUnreadable = class extends taggedError$9()("CommentsUnreadable", {
16896
17557
  reader: Schema.String,
16897
17558
  message: Schema.String
16898
17559
  }) {};
@@ -17085,7 +17746,7 @@ const RULE$32 = "comment";
17085
17746
  const SUPPRESSION_RULE = "suppression";
17086
17747
  const UNUSED_RULE = "unused-comment-allowance";
17087
17748
  const CONFIG_FILE$3 = "vite.config.ts";
17088
- const READ_CONCURRENCY$15 = 64;
17749
+ const READ_CONCURRENCY$14 = 64;
17089
17750
  const START$19 = 0;
17090
17751
  const SHEBANG = "#!";
17091
17752
  const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
@@ -17097,8 +17758,8 @@ const CommentSettings = Schema.Struct({ allow: Patterns });
17097
17758
  const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
17098
17759
  const RootConfig = Schema.Struct({ msch: Schema.optional(MschSettings) });
17099
17760
  const NO_SETTINGS = { allow: [] };
17100
- const taggedError$7 = Schema.TaggedError;
17101
- var CommentConfigUnreadable = class extends taggedError$7()("CommentConfigUnreadable", { file: Schema.String }) {};
17761
+ const taggedError$8 = Schema.TaggedError;
17762
+ var CommentConfigUnreadable = class extends taggedError$8()("CommentConfigUnreadable", { file: Schema.String }) {};
17102
17763
  const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
17103
17764
  const lineBefore = (source, index) => {
17104
17765
  const lines = pipe(source, String$1.slice(START$19, index), String$1.split("\n"));
@@ -17169,7 +17830,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
17169
17830
  const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
17170
17831
  onNone: () => Effect.succeed(NOTHING),
17171
17832
  onSome: (source) => scan(entry, source)
17172
- }))), { concurrency: READ_CONCURRENCY$15 });
17833
+ }))), { concurrency: READ_CONCURRENCY$14 });
17173
17834
  const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
17174
17835
  const unused = yield* unusedAllowances(root, settings, used);
17175
17836
  return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
@@ -17344,8 +18005,8 @@ const Source = Schema.Struct({
17344
18005
  });
17345
18006
  const SkillsConfig = Schema.Struct({ skills: Schema.Record(Schema.String, Source) });
17346
18007
  const decodeSkills = Schema.decodeUnknownOption(SkillsConfig);
17347
- const taggedError$6 = Schema.TaggedError;
17348
- var SkillsConfigUnreadable = class extends taggedError$6()("SkillsConfigUnreadable", { file: Schema.String }) {};
18008
+ const taggedError$7 = Schema.TaggedError;
18009
+ var SkillsConfigUnreadable = class extends taggedError$7()("SkillsConfigUnreadable", { file: Schema.String }) {};
17349
18010
  const problemAt$3 = (rule, file, text) => (anchor, message) => ({
17350
18011
  file,
17351
18012
  ...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$18))),
@@ -17441,7 +18102,7 @@ const FRAGMENT = /#.*$/u;
17441
18102
  const SEPARATOR$10 = "/";
17442
18103
  const START$17 = 0;
17443
18104
  const FIRST$7 = 1;
17444
- const READ_CONCURRENCY$14 = 16;
18105
+ const READ_CONCURRENCY$13 = 16;
17445
18106
  const Frontmatter = Schema.Struct({
17446
18107
  name: Schema.optional(Schema.String),
17447
18108
  license: Schema.optional(Schema.Unknown)
@@ -17507,7 +18168,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
17507
18168
  const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$10}`)));
17508
18169
  const text = yield* files.readFile(file);
17509
18170
  const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
17510
- const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$14 });
18171
+ const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$13 });
17511
18172
  const licenses = pipe(inside, Array$1.filter((entry) => files.dirname(entry) === directory), Array$1.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array$1.map((entry) => ({
17512
18173
  file: files.join(root, entry),
17513
18174
  line: FIRST$7,
@@ -17529,7 +18190,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
17529
18190
  const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
17530
18191
  const listed = yield* (yield* RepositoryFiles).listedFiles(root);
17531
18192
  const skills = pipe(listed, Array$1.filter((name) => SKILL_FILE$2.test(name) && !INSTALLED.test(name) && !FIXTURE$1.test(name)));
17532
- const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$14 });
18193
+ const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$13 });
17533
18194
  return Array$1.flatten(found);
17534
18195
  });
17535
18196
  // src/features/check-version-downgrades/model/version-entries.ts
@@ -17591,7 +18252,7 @@ const cargoEntries = (text) => {
17591
18252
  const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
17592
18253
  // src/features/check-version-downgrades/model/version-downgrade.ts
17593
18254
  const RULE$27 = "version-downgrade";
17594
- const READ_CONCURRENCY$13 = 16;
18255
+ const READ_CONCURRENCY$12 = 16;
17595
18256
  const READERS = [
17596
18257
  [/(?:^|\/)package\.json$/u, manifestEntries],
17597
18258
  [/^pnpm-workspace\.yaml$/u, workspaceEntries],
@@ -17635,7 +18296,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
17635
18296
  before: read(before),
17636
18297
  after: read(after)
17637
18298
  })), Option.getOrElse(() => []));
17638
- }), { concurrency: READ_CONCURRENCY$13 });
18299
+ }), { concurrency: READ_CONCURRENCY$12 });
17639
18300
  return Array$1.flatten(found);
17640
18301
  });
17641
18302
  // src/features/check-version-downgrades/model/renovate-settings.ts
@@ -17645,15 +18306,54 @@ const VERSION_CAP = /["']?allowedVersions["']?\s*:\s*["'](?<range>[^"']*<[^"']*)
17645
18306
  const AUTOMERGE_RULE = "renovate-platform-automerge";
17646
18307
  const CAP_RULE = "renovate-version-cap";
17647
18308
  const PRESET_RULE = "renovate-msch-preset";
18309
+ const OVERRIDE_RULE = "renovate-preset-override";
18310
+ const PACKAGE_RULES = "packageRules";
18311
+ const OPEN_KEYS = [
18312
+ "$schema",
18313
+ "description",
18314
+ "extends",
18315
+ PACKAGE_RULES
18316
+ ];
18317
+ const REPOSITORY_CHOICES = [
18318
+ "automerge",
18319
+ "enabled",
18320
+ "allowedVersions"
18321
+ ];
17648
18322
  const ADOPTER = "@r_masseater/vite-plus-adopt";
17649
18323
  const DEFAULT_FILE = "renovate.json";
17650
18324
  const START$16 = 0;
17651
- const READ_CONCURRENCY$12 = 16;
18325
+ const READ_CONCURRENCY$11 = 16;
17652
18326
  const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
17653
18327
  const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
17654
18328
  const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
17655
18329
  const MISSING_MESSAGE = `is missing, so Renovate does not run msch's preset \`${RENOVATE_PRESET}\` and dependencies stay on old versions. Add a Renovate config that extends it.`;
17656
18330
  const adopterMessage = (preset) => `does not extend \`${preset}\` after \`${RENOVATE_PRESET}\`, so Renovate never updates the commits and versions in the skills and tools sections of vite.config.ts, and the package groups it waits for go out apart. Add it to \`extends\` after msch's preset.`;
18331
+ const Settings = Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown));
18332
+ const decodeSettings = Schema.decodeUnknownOption(Settings);
18333
+ const sectionOf = (value) => pipe(Option.some(value), Option.filter(Predicate$1.isReadonlyObject), Option.filter((found) => !Array$1.isArray(found)), Option.getOrElse(() => ({})));
18334
+ const listOf$2 = (value) => pipe(Option.some(value), Option.filter((found) => Array$1.isArray(found)), Option.getOrElse(() => []));
18335
+ const isSetting = (key) => !Array$1.contains(OPEN_KEYS, key) && !Array$1.contains(REPOSITORY_CHOICES, key) && !String$1.startsWith("match")(key);
18336
+ const PRESET_RULES = pipe(listOf$2(RENOVATE_PRESET_SETTINGS[PACKAGE_RULES]), Array$1.map(sectionOf));
18337
+ const PRESET_KEYS = new Set(pipe([RENOVATE_PRESET_SETTINGS, ...PRESET_RULES], Array$1.flatMap(Record.keys), Array$1.filter(isSetting)));
18338
+ const setOver = (where) => (key) => ({
18339
+ key,
18340
+ message: `sets \`${key}\`${where}, which msch's preset \`${RENOVATE_PRESET}\` sets, so the preset's value no longer applies. Remove it, or change the preset in msch when its value is wrong.`
18341
+ });
18342
+ const overridesIn = (settings) => [
18343
+ ...pipe(Record.keys(settings), Array$1.filter((key) => PRESET_KEYS.has(key)), Array$1.map(setOver(""))),
18344
+ ...Array$1.filter([{
18345
+ key: "enabled",
18346
+ message: "sets `enabled: false`, so Renovate updates nothing and msch's preset never runs."
18347
+ }], () => settings["enabled"] === false),
18348
+ ...Array$1.filter([{
18349
+ key: "ignorePresets",
18350
+ message: `lists \`${RENOVATE_PRESET}\` in \`ignorePresets\`, so Renovate does not apply msch's preset. Remove it.`
18351
+ }], () => Array$1.contains(listOf$2(settings["ignorePresets"]), RENOVATE_PRESET)),
18352
+ ...pipe(listOf$2(settings[PACKAGE_RULES]), Array$1.map(sectionOf), Array$1.flatMap((rule) => [...pipe(Record.keys(rule), Array$1.filter((key) => PRESET_KEYS.has(key)), Array$1.map(setOver(" in a package rule"))), ...Array$1.filter([{
18353
+ key: "automerge",
18354
+ message: "sets `automerge: true` in a package rule, which can turn automerge back on for the msch group that msch's preset keeps out of automerge. Set automerge at the top level instead, where msch's package rules still apply after it."
18355
+ }], () => rule["automerge"] === true)]))
18356
+ ];
17657
18357
  const Presets = Schema.Unknown.pipe(Schema.Array, Schema.optional);
17658
18358
  const Extends = Schema.fromJsonString(Schema.Struct({ extends: Presets }));
17659
18359
  const decodeExtends = Schema.decodeUnknownOption(Extends);
@@ -17680,6 +18380,12 @@ const problemsIn$8 = (adopter) => (file, source) => {
17680
18380
  message
17681
18381
  })));
17682
18382
  return [
18383
+ ...pipe(decodeSettings(source), Option.map(overridesIn), Option.getOrElse(() => []), Array$1.map(({ key, message }) => ({
18384
+ file,
18385
+ ...at(pipe(source, String$1.indexOf(`"${key}"`), Option.getOrElse(() => START$16))),
18386
+ rule: OVERRIDE_RULE,
18387
+ message
18388
+ }))),
17683
18389
  ...found(AUTOMERGE_OFF, AUTOMERGE_RULE, AUTOMERGE_MESSAGE),
17684
18390
  ...found(VERSION_CAP, CAP_RULE, CAP_MESSAGE),
17685
18391
  ...pipe(presetsMissing(source, adopter), Array$1.map((message) => ({
@@ -17708,12 +18414,12 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
17708
18414
  onNone: () => [],
17709
18415
  onSome: (source) => problemsIn$8(adopter)(file, source)
17710
18416
  })));
17711
- }, { concurrency: READ_CONCURRENCY$12 });
18417
+ }, { concurrency: READ_CONCURRENCY$11 });
17712
18418
  return Array$1.flatten(found);
17713
18419
  });
17714
18420
  // src/shared/lib/manifest-texts.ts
17715
18421
  const MANIFEST$2 = /(?:^|\/)package\.json$/u;
17716
- const READ_CONCURRENCY$11 = 16;
18422
+ const READ_CONCURRENCY$10 = 16;
17717
18423
  /** @internal */
17718
18424
  const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
17719
18425
  const files = yield* RepositoryFiles;
@@ -17722,7 +18428,7 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
17722
18428
  const read = yield* Effect.forEach(names, (file) => Effect.map(files.readFile(files.join(root, file)), Option.map((text) => ({
17723
18429
  file,
17724
18430
  text
17725
- }))), { concurrency: READ_CONCURRENCY$11 });
18431
+ }))), { concurrency: READ_CONCURRENCY$10 });
17726
18432
  return Array$1.getSomes(read);
17727
18433
  });
17728
18434
  // src/features/check-version-downgrades/model/package-versions.ts
@@ -17731,7 +18437,7 @@ const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?
17731
18437
  const UNVERSIONED$5 = "0.0.0";
17732
18438
  const FIRST_LINE$3 = 1;
17733
18439
  const FIRST_COLUMN$4 = 1;
17734
- const READ_CONCURRENCY$10 = 16;
18440
+ const READ_CONCURRENCY$9 = 16;
17735
18441
  const LAST_SEGMENT$1 = /[^/]*$/u;
17736
18442
  const directoryOf$1 = (file) => String$1.replace(LAST_SEGMENT$1, "")(file);
17737
18443
  const packageAt$1 = (file, text) => pipe(decodeVersionedPackageJson(text), Option.filter(({ private: hidden, version }) => hidden !== true && version !== UNVERSIONED$5), Option.map((manifest) => ({
@@ -17804,7 +18510,7 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
17804
18510
  rule: RULE$26,
17805
18511
  message: message(pack, part, lowest)
17806
18512
  })), Option.toArray);
17807
- }), { concurrency: READ_CONCURRENCY$10 });
18513
+ }), { concurrency: READ_CONCURRENCY$9 });
17808
18514
  return Array$1.flatten(found);
17809
18515
  });
17810
18516
  // src/features/find-unneeded-files/model/applied-packages.ts
@@ -18275,7 +18981,6 @@ const NUL = "\0";
18275
18981
  const START$12 = 0;
18276
18982
  const HEX = 16;
18277
18983
  const CODE_POINT_WIDTH = 4;
18278
- const READ_CONCURRENCY$9 = 64;
18279
18984
  const RULE$20 = "hidden-unicode";
18280
18985
  const hexOf = (character) => pipe(String$1.codePointAt(START$12)(character), Option.getOrElse(() => START$12), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
18281
18986
  const problemOf$3 = (file, source) => (found) => {
@@ -18293,16 +18998,8 @@ const problemsIn$6 = (file, source) => {
18293
18998
  };
18294
18999
  /** @internal */
18295
19000
  const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
18296
- const files = yield* RepositoryFiles;
18297
- const names = yield* files.listedFiles(root);
18298
- const found = yield* Effect.forEach(names, (name) => {
18299
- const file = files.join(root, name);
18300
- return files.readFile(file).pipe(Effect.map(Option.match({
18301
- onNone: () => [],
18302
- onSome: (source) => problemsIn$6(file, source)
18303
- })));
18304
- }, { concurrency: READ_CONCURRENCY$9 });
18305
- return Array$1.flatten(found);
19001
+ const names = yield* (yield* RepositoryFiles).listedFiles(root);
19002
+ return yield* problemsInFiles(root, names, ({ file, source }) => problemsIn$6(file, source));
18306
19003
  });
18307
19004
  // src/app/document-checks.ts
18308
19005
  /** @internal */
@@ -18402,8 +19099,8 @@ const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Liter
18402
19099
  const isStrict = Schema.is(StrictPack);
18403
19100
  const PackConfig = Schema.Struct({ pack: Schema.optional(Schema.Unknown) });
18404
19101
  const decodePackConfig = Schema.decodeUnknownOption(PackConfig);
18405
- const taggedError$5 = Schema.TaggedError;
18406
- var PackConfigUnreadable = class extends taggedError$5()("PackConfigUnreadable", { file: Schema.String }) {};
19102
+ const taggedError$6 = Schema.TaggedError;
19103
+ var PackConfigUnreadable = class extends taggedError$6()("PackConfigUnreadable", { file: Schema.String }) {};
18407
19104
  const runsStrictPublint = (config) => pipe(decodePackConfig(config), Option.flatMap(({ pack }) => Option.fromUndefinedOr(pack)), Option.map((pack) => Array$1.ensure(pack)), Option.exists(Array$1.some(isStrict)));
18408
19105
  const problemFor = (file, source) => ({
18409
19106
  file,
@@ -20318,9 +21015,9 @@ const rebutPrompt = (input) => lines([
20318
21015
  ]);
20319
21016
  // src/features/check-with-agents/model/step.ts
20320
21017
  const ATTEMPTS = 3;
20321
- const taggedError$4 = Schema.TaggedError;
21018
+ const taggedError$5 = Schema.TaggedError;
20322
21019
  /** @internal */
20323
- var StepFailed = class extends taggedError$4()("StepFailed", { message: Schema.String }) {};
21020
+ var StepFailed = class extends taggedError$5()("StepFailed", { message: Schema.String }) {};
20324
21021
  const retryNote = (failures) => pipe(Array$1.last(failures), Option.match({
20325
21022
  onNone: () => "",
20326
21023
  onSome: (reason) => `\n\nYour previous answer was rejected: ${reason} Answer again and fix that.`
@@ -20841,6 +21538,18 @@ const changedCommand = Command.make("changed", {
20841
21538
  program: Argument.String("command").pipe(Argument.withDescription("The command to run, written after --")),
20842
21539
  rest: Argument.String("argument").pipe(Argument.withDescription("The arguments of the command"), Argument.variadic())
20843
21540
  }, changed).pipe(Command.withDescription("Runs a command with the paths of the workspaces whose inputs changed since it last passed"));
21541
+ // src/app/ci-command.ts
21542
+ const taggedError$4 = Schema.TaggedError;
21543
+ /** @internal */
21544
+ var StaleInstall = class extends taggedError$4()("StaleInstall", { message: Schema.String }) {};
21545
+ const ci = Effect.fn("ci")(function* ci() {
21546
+ const root = (yield* RepositoryFiles).resolve(".");
21547
+ const problem = yield* installedVersionProblem(root);
21548
+ if (Option.isSome(problem)) return yield* StaleInstall.make({ message: problem.value });
21549
+ return yield* syncCi(root);
21550
+ });
21551
+ /** @internal */
21552
+ const ciCommand = Command.make("ci", {}, ci).pipe(Command.withDescription("Puts the shared setup action into every job that runs vp, drops the hand-written Actions caches and writes the callers of the shared queue workflows"));
20844
21553
  // src/app/lookup-report.ts
20845
21554
  const NONE_FOUND = 0;
20846
21555
  const LINE_BREAK$1 = "\n";
@@ -23382,6 +24091,7 @@ const unbumped = Effect.fn("unbumped")(function* unbumped() {
23382
24091
  const SUBCOMMANDS = [
23383
24092
  agentsCommand,
23384
24093
  changedCommand,
24094
+ ciCommand,
23385
24095
  exitsCommand,
23386
24096
  judgeCommand,
23387
24097
  publishCommand,