@mark1russell7/conventions 0.21.0 → 0.23.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/README.md CHANGED
@@ -23,6 +23,7 @@ Each break shows the file, the line, the rule and the fix. In GitHub Actions, th
23
23
  `conventions fix` writes the fixes that the rules know, and checks again. It continues until no fix applies. Each fix is an exact change of a file, and the fix writes it only when the file did not change after the check. These breaks have a fix:
24
24
 
25
25
  - `runner-budget`: the minute of a schedule, a `max-parallel` of a matrix, and a concurrency group at the top of a workflow. A new run of a pull request stops the old run. A run of another event waits for the old run.
26
+ - `main-runs-finish`: a `cancel-in-progress: true` in a workflow that starts on `push`. The fix writes `${{ github.event_name == 'pull_request' }}`.
26
27
  - `tests-required`: the option `passWithNoTests` in a config or a script, in a package with test files. A package with no tests needs a person, who removes its test script.
27
28
  - `typed-files`: a config file at the root of a package (`vitest.config.ts`). The fix adds `*.config.ts` and `rootDir: "."` to the `tsconfig.test.json` of the package, when that file has no comments.
28
29
  - `trust-policy`: the settings `trustPolicy`, `trustPolicyIgnoreAfter` and `trustPolicyExclude` of `pnpm-workspace.yaml`. The fix makes the file when the repository has none.
@@ -42,7 +43,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
42
43
  | `trust-policy` | A repository with a `pnpm-lock.yaml` sets `trustPolicy: no-downgrade` in `pnpm-workspace.yaml`: pnpm refuses a version with less trust evidence than an earlier version, for example one with no provenance after versions from a trusted publisher. `trustPolicyIgnoreAfter` is 10080 or more, so the check examines the versions of the last 7 days. A stolen-token version is new, and older versions can have less evidence for other reasons. `trustPolicyExclude` has the scopes of the release train, which checks the provenance of their versions itself. | fleet `trust-policy` (STRATEGY.md, 2026-11-01). |
43
44
  | `source-main` | The `main` of each workspace package is `src/index.ts` (a package with only a `bin` has no `main`, and a private package with no entry is an app). A public package that has a source entry has the same field in `publishConfig`, and that field points at the build. | coeval `package-main-source`, `source-package-main`. crawler `pkg-source-main`, `source-package-main`, `publish-config-build`. Graph `new-package-main-index`, `source-package-main`. headroom `source-package-main`. |
44
45
  | `tsconfig-test` | Each package with a `tsconfig.json` has a `tsconfig.test.json`, and its `typecheck` script names it. | coeval, crawler, Vex `package-tsconfig-test` or `pkg-tsconfig-test`, and `tsconfig-test`. headroom `tsconfig-test`, `tsconfig-test-per-package`. |
45
- | `cue-preset` | The `tsconfig.json` of each package extends a preset of `@mark1russell7/cue`. No config of a package turns off a strict option that its preset turns on. | client `cue-config`, `no-manual-tsconfig`. Graph `cue-preset-strict`, `strict-preset`, `new-package-via-cli`. coeval, crawler, headroom, Vex `package-scaffold`. |
46
+ | `cue-preset` | The `tsconfig.json` of each package extends a preset of `@mark1russell7/cue`. No config of a package turns off a strict option that its preset turns on. `erasableSyntaxOnly` is one of these options, because `node` cannot strip the other syntax. | client `cue-config`, `no-manual-tsconfig`. Graph `cue-preset-strict`, `strict-preset`, `new-package-via-cli`. coeval, crawler, headroom, Vex `package-scaffold`. |
46
47
  | `required-scripts` | The root `package.json` has the script `typecheck`. It also has `lint:ste` when the repository uses `ste-lint`: a dependency on `@mark1russell7/ste-lint`, or a `ste.config.json` at the root. The shared CI skips a missing script, so a removed script turns its check off with no sign. | client, coeval, crawler, Graph, headroom, Vex `ste-prose`. systems `lint-ste-in-ci`. coeval, crawler, headroom, Vex `tsconfig-test`. |
47
48
  | `no-build-output` | Git keeps no file in a folder named `dist` or `build`. | client `no-build-output`, `no-dist`, `no-dist-commit`. Only one repository of the audit tells this rule. The `.gitignore` of the template has it for each repository. |
48
49
  | `no-local-paths` | No tracked file has the home folder of a user: `C:\Users\<name>`, `/Users/<name>` or `/home/<name>`. A CI user (`runner`), a name of one character and a placeholder (`<you>`) are not a break. | client `I12`. systems `no-identifying-names`, `no-private-identifiers`, `no-private-names`. coeval `no-private-names`. |
@@ -55,6 +56,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
55
56
  | `tests-required` | No test runner passes when it finds no test: no `passWithNoTests: true` in a config of vitest, vite, jest or Playwright, and no `--passWithNoTests` in `package.json`. With the option, a broken include pattern turns the test gate green with no test run. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
56
57
  | `roadmap-parses` | Each call of the Pages workflow of the template (`reusable-pages.yml`) gives a `roadmap`, or `site-pages: false`. Without it, the Status page shows no item of the plan. Each roadmap that a workflow gives to the Status page (a `roadmap:` key) parses as `@mark1russell7/site-pages` reads it. The rule uses the parser of site-pages. Thus a pull request finds a bad row, and the Pages job on `main` does not stop on it. | fleet `fail-closed` (STRATEGY.md, 2026-10-30). |
57
58
  | `runner-budget` | All repositories of the account share 40 runners. Each `strategy` with a `matrix` has a `max-parallel` of 3 or less. Each workflow has a concurrency group at the top or in each job. A job that calls a shared workflow of the option `grouped` gets its group from that workflow, and each job of that workflow has a group. The minute of each `cron` comes from a hash of the repository and the file (1 to 59), so the schedules of the repositories do not start together. The repository comes from `GITHUB_REPOSITORY` or from the remote `origin`. | fleet `runner-slots` (STRATEGY.md, 2026-10-30). |
59
+ | `main-runs-finish` | A workflow that starts on `push` does not cancel a run in progress. A newer push cancels only the run of a pull request: `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`. A newer run of `main` waits, and GitHub keeps only the newest run that waits. On 2026-11-03 the next merge cancelled the CI run of a commit on `main`, so the main check of that commit had no result. A bench run on `main` was cancelled too, and its claim had no measurement. | fleet `main-runs-finish` (STRATEGY.md, 2026-11-03). |
58
60
  | `gate-trigger` | No workflow has `paths` or `paths-ignore` on `on.pull_request` or `on.pull_request_target`. The ruleset needs the summary check `<Name> OK` of each gate, and a workflow with a path filter does not start on each pull request. Then its check is not there, the ruleset cannot ask for it, and a pull request can merge before the gate ends. A gate uses the actions `changes` and `gate-summary` of the template (`CI.md`, "A gate with paths"). | fleet `gate-trigger` (STRATEGY.md, 2026-11-02). |
59
61
  | `license-file` | Each public package has a license field, and a license file with the same license in its own folder. A public repository, or a repository with a public package, has a license file at its root. In a GitHub Actions run, the event file tells if the repository is public, and the option `license` (MIT by default) is the license of a root with no public package. npm packs only the license file of the folder of the package, and GitHub reads only the one of the root: on 2026-11-02 five public repositories showed no license on GitHub while npm said MIT. `conventions fix` writes the missing files. | fleet strategy (2026-11-02). |
60
62
  | `home-package` | A change does not add a function with a signature name of another home of the map (for example `median`, `mulberry32` or `writeFileAtomic`). A local copy drifts from the home and splits the fixes. On 2026-11-02 the fleet had 68 local statistics functions in 14 repositories. The rule examines only the lines that the change adds, so the copies that exist do not break. | fleet direction 18 (STRATEGY.md, 2026-11-02). |
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as runCli } from "./run-sEUuSlqi.js";
2
+ import { c as runCli } from "./run-BDESgKjd.js";
3
3
  // src/cli.ts
4
4
  try {
5
5
  process.exitCode = runCli(process.argv.slice(2), {
package/build/index.d.ts CHANGED
@@ -150,7 +150,7 @@ export declare function defaultOptions(rule: Rule): Options;
150
150
  */
151
151
  export declare function parseConfig(value: unknown, rules: readonly Rule[]): ConventionsConfig;
152
152
  /** The compiler options that make the type check strict. A package does not turn them off. */
153
- export declare const STRICT_OPTIONS: readonly ["strict", "noImplicitAny", "strictNullChecks", "strictFunctionTypes", "strictBindCallApply", "strictPropertyInitialization", "strictBuiltinIteratorReturn", "noImplicitThis", "useUnknownInCatchVariables", "alwaysStrict", "noUncheckedIndexedAccess", "exactOptionalPropertyTypes", "noImplicitOverride", "noImplicitReturns", "noFallthroughCasesInSwitch", "noPropertyAccessFromIndexSignature"];
153
+ export declare const STRICT_OPTIONS: readonly ["strict", "noImplicitAny", "strictNullChecks", "strictFunctionTypes", "strictBindCallApply", "strictPropertyInitialization", "strictBuiltinIteratorReturn", "noImplicitThis", "useUnknownInCatchVariables", "alwaysStrict", "noUncheckedIndexedAccess", "exactOptionalPropertyTypes", "noImplicitOverride", "noImplicitReturns", "noFallthroughCasesInSwitch", "noPropertyAccessFromIndexSignature", "erasableSyntaxOnly"];
154
154
  export declare const cuePreset: Rule;
155
155
  /** A path filter of a pull request trigger: the line (from 1), the trigger and the key. */
156
156
  interface PathFilter {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/shared-docs.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/unreleased-change.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,IAAI;;;KAIM,uBAAuB;WAAqB;;;UAGvC;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;EAC1C,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAG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AQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6BG,OAAO,yBAAyB,IAAI;;;;;;wBC1RpC,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/rule.ts","../src/config.ts","../src/rules/cue-preset.ts","../src/rules/gate-trigger.ts","../src/map.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/rules/no-local-paths.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/release-files.ts","../src/rules/required-scripts.ts","../src/rules/roadmap-parses.ts","../src/rules/runner-budget.ts","../src/rules/shared-docs.ts","../src/rules/source-main.ts","../src/rules/tests-required.ts","../src/rules/tsconfig-test.ts","../src/rules/typed-files.ts","../src/rules/typed-scripts.ts","../src/rules/trust-policy.ts","../src/rules/unreleased-change.ts","../src/rules/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/workspace.ts"],"mappings":";UASiB;WACN;WACA;WACA;;;UAIM;;WAEN;;WAEA;WACA;;WAEA;;WAEA,iBAAiB;;;;;;UAOX;;WAEN;;WAEA;;WAEA;;;wBAIK,YAAY,cAAc,cAAc;;KAQ5C;;KAGA,UAAU,SAAS,eAAe;;UAG7B;WACN;WACA,SAAS;WACT;;;KAIC,WAAW,SAAS;;UAGf;;WAEN;;WAEA;;WAEA;;WAEA;WACA,UAAU;;;UAIJ;;WAEN;;WAEA,aAAa;;WAEb,mBAAmB;;WAEnB,KAAK,SAAS;;WAEd;;EAET;;EAEA,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;;WAEA;WACA,iBAAiB;;WAEjB;;WAEA;;;UAIM;WACN,gBAAgB;;WAEhB;;;UAIM;;WAEN;;WAEA;;WAEA;WACA,MAAM,SAAS;;WAEf,iBAAiB;;;wBAaZ,WAAW,cAAc,iBAAgB,SAAiB;;wBAO1D,cAAc,cAAc,QAAQ,mBAAmB,UAAS,KAAK,gCAAqC;;wBAwB1G,UAAU,SAAS,eAAe;;UA2CjC;;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;wBAsBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;;qBAIP;;wBA6BG,OAAO,yBAAyB,IAAI;;;;;;wBC1RpC,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
package/build/index.js CHANGED
@@ -1 +1 @@
1
- export { xt as ACTIONS_COMMIT, Y as DEFAULT_ALLOWED, kt as DEPENDENCY_FIELDS, pt as HOMES, bt as HOME_EXPORTS, X as HOME_PATTERNS, M as HOME_TIMEOUT_MS, y as IGNORE_AFTER, nt as LICENSE_TEXTS, mt as MAP_RULE, p as NPM_REGISTRY, K as PAGES_WORKFLOWS, $ as REAL_COMPARE, d as RULES, m as SHIPPED_FIELDS, Dt as STRICT_OPTIONS, b as TRAIN_SCOPES, h as UNSHIPPED_FILES, t as USAGE, n as annotations, rt as authorOf, N as blockHash, At as cleanPath, jt as codePackages, C as configsOfScript, St as convertGate, r as createContext, Ot as cuePreset, ct as declaredName, Kt as defaultOptions, ht as findHomes, i as formatResult, Ct as gateTrigger, P as githubFetch, Ht as globFolders, Ut as globToRegExp, Mt as hasFile, et as hasImportMetaMain, D as hasTests, lt as homePackage, Nt as inFolder, U as isGitSpecifier, W as isPinned, k as isSourcePath, Pt as keyLine, it as licenseFile, at as licenseFileOf, Ft as lineOf, a as listRules, tt as mainCheck, gt as mapMarkdown, _t as mapText, It as matchesAny, vt as mergeHomes, ut as messageOf, ot as mitText, Q as noBuildOutput, Z as noLocalPaths, g as npmLookup, Wt as packageFolders, q as pagesCalls, J as pagesSite, qt as parseConfig, Lt as parseJsonc, A as pathsOf, G as pinnedGitDeps, wt as prPathFilters, o as readConfig, Rt as readJsonc, yt as readOverlay, Et as readWorkflow, H as releaseFiles, zt as replaceLine, dt as repoOf, st as repositoryIsPublic, I as repositoryOfRemote, V as requiredScripts, z as roadmapOfLine, B as roadmapParses, s as runChecks, c as runCli, l as runFix, Bt as runGit, L as runnerBudget, R as scheduleMinute, w as scriptsOf, F as sharedDocsRule, ft as signaturesOf, j as sourceMain, Vt as specifiersOf, u as summaryMarkdown, Tt as summaryName, E as testsRequired, x as trustPolicy, O as tsconfigTest, T as typedFiles, S as typedScripts, _ as unreleasedChange, v as unreleasedChangeRule, Gt as workspaceGlobs, f as workspaceProtocol } from "./run-sEUuSlqi.js";
1
+ export { xt as ACTIONS_COMMIT, Y as DEFAULT_ALLOWED, kt as DEPENDENCY_FIELDS, pt as HOMES, bt as HOME_EXPORTS, X as HOME_PATTERNS, M as HOME_TIMEOUT_MS, y as IGNORE_AFTER, nt as LICENSE_TEXTS, mt as MAP_RULE, p as NPM_REGISTRY, K as PAGES_WORKFLOWS, $ as REAL_COMPARE, d as RULES, m as SHIPPED_FIELDS, Dt as STRICT_OPTIONS, b as TRAIN_SCOPES, h as UNSHIPPED_FILES, t as USAGE, n as annotations, rt as authorOf, N as blockHash, At as cleanPath, jt as codePackages, C as configsOfScript, St as convertGate, r as createContext, Ot as cuePreset, ct as declaredName, Kt as defaultOptions, ht as findHomes, i as formatResult, Ct as gateTrigger, P as githubFetch, Ht as globFolders, Ut as globToRegExp, Mt as hasFile, et as hasImportMetaMain, D as hasTests, lt as homePackage, Nt as inFolder, U as isGitSpecifier, W as isPinned, k as isSourcePath, Pt as keyLine, it as licenseFile, at as licenseFileOf, Ft as lineOf, a as listRules, tt as mainCheck, gt as mapMarkdown, _t as mapText, It as matchesAny, vt as mergeHomes, ut as messageOf, ot as mitText, Q as noBuildOutput, Z as noLocalPaths, g as npmLookup, Wt as packageFolders, q as pagesCalls, J as pagesSite, qt as parseConfig, Lt as parseJsonc, A as pathsOf, G as pinnedGitDeps, wt as prPathFilters, o as readConfig, Rt as readJsonc, yt as readOverlay, Et as readWorkflow, H as releaseFiles, zt as replaceLine, dt as repoOf, st as repositoryIsPublic, I as repositoryOfRemote, V as requiredScripts, z as roadmapOfLine, B as roadmapParses, s as runChecks, c as runCli, l as runFix, Bt as runGit, L as runnerBudget, R as scheduleMinute, w as scriptsOf, F as sharedDocsRule, ft as signaturesOf, j as sourceMain, Vt as specifiersOf, u as summaryMarkdown, Tt as summaryName, E as testsRequired, x as trustPolicy, O as tsconfigTest, T as typedFiles, S as typedScripts, _ as unreleasedChange, v as unreleasedChangeRule, Gt as workspaceGlobs, f as workspaceProtocol } from "./run-BDESgKjd.js";
@@ -1124,7 +1124,8 @@ const STRICT_OPTIONS = [
1124
1124
  "noImplicitOverride",
1125
1125
  "noImplicitReturns",
1126
1126
  "noFallthroughCasesInSwitch",
1127
- "noPropertyAccessFromIndexSignature"
1127
+ "noPropertyAccessFromIndexSignature",
1128
+ "erasableSyntaxOnly"
1128
1129
  ];
1129
1130
  /** The options that `strict` turns on when a config does not set them. */
1130
1131
  const STRICT_FAMILY = /* @__PURE__ */ new Set([
@@ -1488,6 +1489,75 @@ function readWorkflow(file, text) {
1488
1489
  jobs
1489
1490
  };
1490
1491
  }
1492
+ // src/rules/main-runs-finish.ts
1493
+ /**
1494
+ * The rule `main-runs-finish`: a workflow that starts on `push` does not cancel a run in progress. Only the run of a pull
1495
+ * request is cancelled by a newer push.
1496
+ */
1497
+ /** The value of `cancel-in-progress` that cancels only the run of a pull request. */
1498
+ const PULL_REQUEST_ONLY = "${{ github.event_name == 'pull_request' }}";
1499
+ /** This function tells if the workflow starts on `push`: `on: push`, `on: [push, ...]` or a key `push` under `on`. */
1500
+ function startsOnPush(lines) {
1501
+ const on = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "on") !== void 0);
1502
+ if (on < 0) return false;
1503
+ const value = keyValue(lines[on] ?? "", "on") ?? "";
1504
+ if (value !== "") return /(^|[\s[,])push([\s\],]|$)/.test(value);
1505
+ return childKeys(lines, on).some((index) => {
1506
+ const key = (lines[index] ?? "").trim().replace(/^- /, "");
1507
+ return key === "push" || key.startsWith("push:");
1508
+ });
1509
+ }
1510
+ const mainRunsFinish = {
1511
+ id: "main-runs-finish",
1512
+ title: "A workflow that starts on push does not cancel a run in progress. A newer push cancels only the run of a pull request.",
1513
+ reason: "On 2026-11-03 the next merge cancelled the CI run of a commit on main, so the main check of that commit had no result. A shared concurrency group also cancelled a bench run on main, and its claim had no measurement. The CI workflow of the template had `cancel-in-progress: true`, and each repository copied it.",
1514
+ fix: `Set \`cancel-in-progress: ${PULL_REQUEST_ONLY}\`. A newer run of main then waits for the older run, and GitHub keeps only the newest run that waits.`,
1515
+ sources: [{
1516
+ repo: "fleet",
1517
+ rule: "main-runs-finish",
1518
+ doc: "docs/STRATEGY.md (2026-11-03, a run of main ends)"
1519
+ }, {
1520
+ repo: "algebra",
1521
+ rule: "main-check",
1522
+ doc: "the A2 and A5 results (2026-11-03): a cancelled main run, and a cancelled bench run"
1523
+ }],
1524
+ options: {},
1525
+ check(context) {
1526
+ const files = context.gitFiles();
1527
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
1528
+ const workflows = files.filter((path) => WORKFLOW$1.test(path)).sort(byCode);
1529
+ const breaks = [];
1530
+ let pushed = 0;
1531
+ for (const file of workflows) {
1532
+ let text;
1533
+ try {
1534
+ text = readFileSync(join(context.root, file), "utf8");
1535
+ } catch {
1536
+ continue;
1537
+ }
1538
+ const lines = workflowLines(text);
1539
+ if (!startsOnPush(lines)) continue;
1540
+ pushed += 1;
1541
+ lines.forEach((line, index) => {
1542
+ if (keyValue(line, "cancel-in-progress") !== "true") return;
1543
+ const original = text.split(/\r?\n/)[index] ?? line;
1544
+ const after = replaceLine(text, index + 1, [original.replace(/cancel-in-progress:\s*["']?true["']?/, () => `cancel-in-progress: ${PULL_REQUEST_ONLY}`)]);
1545
+ breaks.push({
1546
+ file,
1547
+ line: index + 1,
1548
+ message: `${file} starts on push and has \`cancel-in-progress: true\`. A newer push cancels the run of main in progress, and that commit gets no result.`,
1549
+ edits: [{
1550
+ file,
1551
+ before: text,
1552
+ after
1553
+ }]
1554
+ });
1555
+ });
1556
+ }
1557
+ if (pushed === 0) return { skipped: "no workflow starts on push" };
1558
+ return breaks;
1559
+ }
1560
+ };
1491
1561
  // src/rules/gate-trigger.ts
1492
1562
  /**
1493
1563
  * The rule `gate-trigger`: a workflow that runs on pull requests starts on each pull request, with no path filter. The
@@ -1682,7 +1752,7 @@ function convertGate(text, file, commit = ACTIONS_COMMIT) {
1682
1752
  const group = (id) => grouped ? [] : [
1683
1753
  `${job}concurrency:`,
1684
1754
  `${job}${unit}group: \${{ github.workflow }}-${id}-\${{ github.ref }}`,
1685
- `${job}${unit}cancel-in-progress: true`
1755
+ `${job}${unit}cancel-in-progress: ${PULL_REQUEST_ONLY}`
1686
1756
  ];
1687
1757
  const changes = [
1688
1758
  `${jobIndent}changes:`,
@@ -8756,7 +8826,7 @@ const runnerBudget = {
8756
8826
  id: "runner-budget",
8757
8827
  title: "Each matrix has a max-parallel of 3 or less, each workflow has a concurrency group, and each schedule starts at the minute that the repository and the file give.",
8758
8828
  reason: "All repositories of the account share 40 runners, and heavy work keeps at most 28 of them. On 2026-10-30, a matrix with no max-parallel and the sync pull requests of about 20 repositories filled 39 of the 40 runners, with 88 jobs in the queue. Each repository copied the weekly scan at `23 5 * * 1`, so all scans started at the same minute. A workflow with no concurrency group starts a new run on each push, and the old runs keep their runners.",
8759
- fix: "Add `max-parallel: 3` (or less) under `strategy`. Add a concurrency group at the top of the workflow (`concurrency: { group: <name>-${{ github.ref }}, cancel-in-progress: true }`), or in each job. Change the minute of each `cron` to the minute that the message gives; the hour and the days stay.",
8829
+ fix: "Add `max-parallel: 3` (or less) under `strategy`. Add a concurrency group at the top of the workflow (`concurrency: { group: <name>-${{ github.ref }}, cancel-in-progress: ${{ github.event_name == 'pull_request' }} }`), or in each job. Change the minute of each `cron` to the minute that the message gives; the hour and the days stay.",
8760
8830
  sources: [{
8761
8831
  repo: "fleet",
8762
8832
  rule: "runner-slots",
@@ -10393,6 +10463,7 @@ const RULES = [
10393
10463
  testsRequired,
10394
10464
  roadmapParses,
10395
10465
  runnerBudget,
10466
+ mainRunsFinish,
10396
10467
  gateTrigger,
10397
10468
  homePackage,
10398
10469
  licenseFile,
@@ -10795,4 +10866,4 @@ function runMap(args, io) {
10795
10866
  }
10796
10867
  export { REAL_COMPARE as $, pathsOf as A, cleanPath as At, roadmapParses as B, runGit as Bt, configsOfScript as C, gateTrigger as Ct, hasTests as D, STRICT_OPTIONS as Dt, testsRequired as E, readWorkflow as Et, sharedDocsRule as F, lineOf as Ft, pinnedGitDeps as G, workspaceGlobs as Gt, releaseFiles as H, globFolders as Ht, repositoryOfRemote as I, matchesAny as It, pagesSite as J, PAGES_WORKFLOWS as K, defaultOptions as Kt, runnerBudget as L, parseJsonc as Lt, HOME_TIMEOUT_MS as M, hasFile as Mt, blockHash as N, inFolder as Nt, tsconfigTest as O, cuePreset as Ot, githubFetch as P, keyLine as Pt, noBuildOutput as Q, scheduleMinute as R, readJsonc as Rt, typedScripts as S, convertGate as St, typedFiles as T, summaryName as Tt, isGitSpecifier as U, globToRegExp as Ut, requiredScripts as V, specifiersOf as Vt, isPinned as W, packageFolders as Wt, HOME_PATTERNS as X, DEFAULT_ALLOWED as Y, noLocalPaths as Z, unreleasedChange as _, mapText as _t, listRules as a, licenseFileOf as at, TRAIN_SCOPES as b, HOME_EXPORTS as bt, runCli as c, declaredName as ct, RULES as d, repoOf as dt, hasImportMetaMain as et, workspaceProtocol as f, signaturesOf as ft, npmLookup as g, mapMarkdown as gt, UNSHIPPED_FILES as h, findHomes as ht, formatResult as i, licenseFile as it, sourceMain as j, codePackages as jt, isSourcePath as k, DEPENDENCY_FIELDS as kt, runFix as l, homePackage as lt, SHIPPED_FIELDS as m, MAP_RULE as mt, annotations as n, LICENSE_TEXTS as nt, readConfig as o, mitText as ot, NPM_REGISTRY as p, HOMES as pt, pagesCalls as q, parseConfig as qt, createContext as r, authorOf as rt, runChecks as s, repositoryIsPublic as st, USAGE as t, mainCheck as tt, summaryMarkdown as u, messageOf as ut, unreleasedChangeRule as v, mergeHomes as vt, scriptsOf as w, prPathFilters as wt, trustPolicy as x, ACTIONS_COMMIT as xt, IGNORE_AFTER as y, readOverlay as yt, roadmapOfLine as z, replaceLine as zt };
10797
10868
 
10798
- //# sourceMappingURL=run-sEUuSlqi.js.map
10869
+ //# sourceMappingURL=run-BDESgKjd.js.map