@mark1russell7/conventions 0.30.0 → 0.32.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
@@ -25,6 +25,8 @@ Each break shows the file, the line, the rule and the fix. In GitHub Actions, th
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
26
  - `main-runs-finish`: a `cancel-in-progress: true` or a concurrency group that ends with `${{ github.ref }}`, in a workflow that starts on `push` or on `workflow_call`. The fix writes `${{ github.event_name == 'pull_request' }}` and `${{ github.event_name == 'pull_request' && github.ref || github.sha }}`.
27
27
  - `push-main-only`: a workflow that starts on `push` and on `pull_request`, with no limit of `push` to the default branch or with no `workflow_dispatch`. The fix adds `branches` and `workflow_dispatch`, and keeps the comments and each other trigger. It keeps a tag run when the workflow reads the tag. It does not edit `release.yml`, and a person chooses the change for `branches-ignore` or for another named branch.
28
+ - `pipe-fails`: a step with a pipe and no `pipefail`. The fix adds `defaults: { run: { shell: bash } }` to the workflow. It does not write over another shell.
29
+ - `gate-after-cancel`: a summary job of a gate with `always()` in its condition. The fix writes `if: ${{ !cancelled() }}`. A condition with other parts needs a person.
28
30
  - `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.
29
31
  - `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.
30
32
  - `trust-policy`: the settings `trustPolicy`, `trustPolicyIgnoreAfter` and `trustPolicyExclude` of `pnpm-workspace.yaml`. The fix makes the file when the repository has none.
@@ -60,6 +62,8 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
60
62
  | `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`. | private `runner-slots` (STRATEGY.md, 2026-10-30). |
61
63
  | `main-runs-finish` | A workflow that starts on `push` or on `workflow_call` does not cancel a run in progress. A called workflow gets the event of its caller. A newer push cancels only the run of a pull request: `cancel-in-progress: ${{ github.event_name == 'pull_request' }}`. Each commit of `main` has its own concurrency group: `${{ github.event_name == 'pull_request' && github.ref || github.sha }}`. In one group, GitHub cancels a run that waits when a newer run comes, whatever `cancel-in-progress` says. On 2026-11-03 four waiting CI runs of `main` in client were cancelled, so its version commit had no result and no release. 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. | private `main-runs-finish` (STRATEGY.md, 2026-11-03). |
62
64
  | `push-main-only` | A workflow that starts on `push` and on `pull_request` limits `push` to the default branch with `branches`, and has `workflow_dispatch`. Without the limit, each commit of a pull request starts two runs. A `push` with only a tag filter, a `pull_request` with `types` that do not have `synchronize`, and `pull_request_target` are not breaks. `CI.md` tells each case in "One run for each commit". |
65
+ | `pipe-fails` | A failure on the left of a pipe fails its step. With no `shell` key, GitHub has no `pipefail`, so `tests \| tee out.txt` passes when the tests fail. The fix adds `shell: bash` as the default of the workflow. A step that then turns red had a failure that the pipe hid. |
66
+ | `gate-after-cancel` | A summary job of a gate has the condition `if: ${{ !cancelled() }}`, not `always()`. After a cancel, a job with `always()` asks for a runner, and the new run waits behind it. A job with `!cancelled()` concludes `cancelled` with no runner, and the pull request stays blocked. |
63
67
  | `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"). | private `gate-trigger` (STRATEGY.md, 2026-11-02). |
64
68
  | `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. | private strategy (2026-11-02). |
65
69
  | `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 repositories 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. | private 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-5nn4yBKi.js";
2
+ import { c as runCli } from "./run-D0rhX3d_.js";
3
3
  // src/cli.ts
4
4
  try {
5
5
  process.exitCode = runCli(process.argv.slice(2), {
package/build/index.d.ts CHANGED
@@ -157,6 +157,7 @@ export declare function parseConfig(value: unknown, rules: readonly Rule[]): Con
157
157
  /** The compiler options that make the type check strict. A package does not turn them off. */
158
158
  export declare const STRICT_OPTIONS: readonly ["strict", "noImplicitAny", "strictNullChecks", "strictFunctionTypes", "strictBindCallApply", "strictPropertyInitialization", "strictBuiltinIteratorReturn", "noImplicitThis", "useUnknownInCatchVariables", "alwaysStrict", "noUncheckedIndexedAccess", "exactOptionalPropertyTypes", "noImplicitOverride", "noImplicitReturns", "noFallthroughCasesInSwitch", "noPropertyAccessFromIndexSignature", "erasableSyntaxOnly"];
159
159
  export declare const cuePreset: Rule;
160
+ export declare const gateAfterCancel: Rule;
160
161
  /** A path filter of a pull request trigger: the line (from 1), the trigger and the key. */
161
162
  interface PathFilter {
162
163
  readonly line: number;
@@ -281,6 +282,7 @@ export declare function isGitSpecifier(spec: string): boolean;
281
282
  */
282
283
  export declare function isPinned(spec: string, fullSha: boolean): boolean;
283
284
  export declare const pinnedGitDeps: Rule;
285
+ export declare const pipeFails: Rule;
284
286
  export declare const pushMainOnly: Rule;
285
287
  /**
286
288
  * The answer of the registry for one package, or an error. The answer has each version that npm has or had (none for a
@@ -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/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/push-main-only.ts","../src/rules/unreleased-change.ts","../src/rules/published-minor.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/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/release-text.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,eAA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;WACN;WACA;WACA;WACA,gBAAgB;;;UAIV;;WAEN;;WAEA;;WAEA;WACA,iBAAiB;WACjB,eAAe;;;wBAgGV,aAAa,cAAc,eAAe;;UCrMzC;WACN;WACA;WACA;;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;;UAmDjC;;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;;wBA6CG,OAAO,yBAAyB,IAAI;;;;;;;;qBChUvC;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB;;;;;;wBCzC5C,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-after-cancel.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/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/pinned-git-deps.ts","../src/rules/pipe-fails.ts","../src/rules/push-main-only.ts","../src/rules/unreleased-change.ts","../src/rules/published-minor.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/workspace-protocol.ts","../src/rules/index.ts","../src/home-exports.ts","../src/workflow.ts","../src/run.ts","../src/release-text.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;;;;;WAKjC;EACT,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wBAOrC,QAAQ,cAAc,eAAe;;qBAMxC,WAAY,gBAAgB;;qBAG5B,YAAa;;wBAGV,WAAW,cAAc;;;;;;wBASzB,WAAW;;wBA2BX,UAAU;;wBAUV,OAAO,cAAc;;qBAOxB,UAAW,aAAa;;;;;wBAMrB,aAAa,SAAS,KAAK,oDAAoD;;UC1M9E;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;UAIH;;WAEN;;WAEA,OAAO,SAAS,eAAe;;;wBAW1B,eAAe,MAAM,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C;;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;;wBA6CG,OAAO,yBAAyB,IAAI;;;;;;;;qBChUvC;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB;;;;;;wBCzC5C,aAAa,eAAe;;;;;wBAsD5B,YAAY,cAAc;;;;;;wBA8B1B,eAAe;;;;;;;wBAwCf,eAAe,cAAc"}
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as PAGES_WORKFLOWS, $t as workspaceGlobs, A as roadmapOfLine, At as convertGate, B as SHIPPED_FIELDS, Bt as hasFile, C as isSourcePath, Ct as findHomes, D as blockHash, Dt as readOverlay, E as HOME_TIMEOUT_MS, Et as mergeHomes, F as minorOf, Ft as STRICT_OPTIONS, G as isGitSpecifier, Gt as parseJsonc, H as npmLookup, Ht as keyLine, I as publishedMinor, It as cuePreset, J as pagesAfterRelease, Jt as runGit, K as isPinned, Kt as readJsonc, L as publishedMinorRule, Lt as DEPENDENCY_FIELDS, M as requiredScripts, Mt as prPathFilters, N as releaseFiles, Nt as summaryName, O as githubFetch, Ot as HOME_EXPORTS, P as lockedVersions, Pt as readWorkflow, Q as pushMainOnly, Qt as packageFolders, R as reachOf, Rt as cleanPath, S as tsconfigTest, St as MAP_RULE, T as sourceMain, Tt as mapText, U as unreleasedChange, Ut as lineOf, V as UNSHIPPED_FILES, Vt as inFolder, W as unreleasedChangeRule, Wt as matchesAny, X as runnerBudget, Xt as globFolders, Y as repositoryOfRemote, Yt as specifiersOf, Z as scheduleMinute, Zt as globToRegExp, _ as configsOfScript, _t as homePackage, a as listRules, at as noLocalPaths, b as testsRequired, bt as signaturesOf, c as runCli, ct as hasImportMetaMain, d as RULES, dt as authorOf, en as defaultOptions, et as pagesCalls, f as workspaceProtocol, ft as licenseFile, g as typedScripts, gt as declaredName, h as trustPolicy, ht as repositoryIsPublic, i as formatResult, it as HOME_PATTERNS, j as roadmapParses, jt as gateTrigger, k as sharedDocsRule, kt as ACTIONS_COMMIT, l as runFix, lt as mainCheck, m as TRAIN_SCOPES, mt as mitText, n as annotations, nt as apiReportScript, o as readConfig, ot as noBuildOutput, p as IGNORE_AFTER, pt as licenseFileOf, q as pinnedGitDeps, qt as replaceLine, r as createContext, rt as DEFAULT_ALLOWED, s as runChecks, st as REAL_COMPARE, t as USAGE, tn as parseConfig, tt as pagesSite, u as summaryMarkdown, ut as LICENSE_TEXTS, v as scriptsOf, vt as messageOf, w as pathsOf, wt as mapMarkdown, x as hasTests, xt as HOMES, y as typedFiles, yt as repoOf, z as NPM_REGISTRY, zt as codePackages } from "./run-5nn4yBKi.js";
1
+ import { $ as pushMainOnly, $t as globToRegExp, A as roadmapOfLine, At as ACTIONS_COMMIT, B as SHIPPED_FIELDS, Bt as cleanPath, C as isSourcePath, Ct as MAP_RULE, D as blockHash, Dt as mergeHomes, E as HOME_TIMEOUT_MS, Et as mapText, F as minorOf, Ft as gateAfterCancel, G as pipeFails, Gt as lineOf, H as npmLookup, Ht as hasFile, I as publishedMinor, It as readWorkflow, J as pinnedGitDeps, Jt as readJsonc, K as isGitSpecifier, Kt as matchesAny, L as publishedMinorRule, Lt as STRICT_OPTIONS, M as requiredScripts, Mt as gateTrigger, N as releaseFiles, Nt as prPathFilters, O as githubFetch, Ot as readOverlay, P as lockedVersions, Pt as summaryName, Q as scheduleMinute, Qt as globFolders, R as reachOf, Rt as cuePreset, S as tsconfigTest, St as HOMES, T as sourceMain, Tt as mapMarkdown, U as unreleasedChange, Ut as inFolder, V as UNSHIPPED_FILES, Vt as codePackages, W as unreleasedChangeRule, Wt as keyLine, X as repositoryOfRemote, Xt as runGit, Y as pagesAfterRelease, Yt as replaceLine, Z as runnerBudget, Zt as specifiersOf, _ as configsOfScript, _t as declaredName, a as listRules, at as HOME_PATTERNS, b as testsRequired, bt as repoOf, c as runCli, ct as REAL_COMPARE, d as RULES, dt as LICENSE_TEXTS, en as packageFolders, et as PAGES_WORKFLOWS, f as workspaceProtocol, ft as authorOf, g as typedScripts, gt as repositoryIsPublic, h as trustPolicy, ht as mitText, i as formatResult, it as DEFAULT_ALLOWED, j as roadmapParses, jt as convertGate, k as sharedDocsRule, kt as HOME_EXPORTS, l as runFix, lt as hasImportMetaMain, m as TRAIN_SCOPES, mt as licenseFileOf, n as annotations, nn as defaultOptions, nt as pagesSite, o as readConfig, ot as noLocalPaths, p as IGNORE_AFTER, pt as licenseFile, q as isPinned, qt as parseJsonc, r as createContext, rn as parseConfig, rt as apiReportScript, s as runChecks, st as noBuildOutput, t as USAGE, tn as workspaceGlobs, tt as pagesCalls, u as summaryMarkdown, ut as mainCheck, v as scriptsOf, vt as homePackage, w as pathsOf, wt as findHomes, x as hasTests, xt as signaturesOf, y as typedFiles, yt as messageOf, z as NPM_REGISTRY, zt as DEPENDENCY_FIELDS } from "./run-D0rhX3d_.js";
2
2
  // src/release-text.ts
3
3
  /**
4
4
  * The rule for the git tag and the text of a GitHub release of a package version.
@@ -64,6 +64,6 @@ function releaseNotes(name, version, changelog) {
64
64
  if (section.length <= 1e5) return section;
65
65
  return `${section.slice(0, MAX_NOTES)}\n\n(The CHANGELOG.md of \`${name}\` has the full text.)`;
66
66
  }
67
- export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SHIPPED_FIELDS, STRICT_OPTIONS, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, formatResult, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, pathsOf, pinnedGitDeps, prPathFilters, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, workspaceGlobs, workspaceProtocol };
67
+ export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SHIPPED_FIELDS, STRICT_OPTIONS, TRAIN_SCOPES, UNSHIPPED_FILES, USAGE, annotations, apiReportScript, authorOf, blockHash, changelogSection, cleanPath, codePackages, configsOfScript, convertGate, createContext, cuePreset, declaredName, defaultOptions, findHomes, formatResult, gateAfterCancel, gateTrigger, githubFetch, globFolders, globToRegExp, hasFile, hasImportMetaMain, hasTests, homePackage, inFolder, isGitSpecifier, isPinned, isSourcePath, keyLine, licenseFile, licenseFileOf, lineOf, listRules, lockedVersions, mainCheck, mapMarkdown, mapText, matchesAny, mergeHomes, messageOf, minorOf, mitText, noBuildOutput, noLocalPaths, npmLookup, npmUrl, packageFolders, pagesAfterRelease, pagesCalls, pagesSite, parseConfig, parseJsonc, pathsOf, pinnedGitDeps, pipeFails, prPathFilters, publishedMinor, publishedMinorRule, pushMainOnly, reachOf, readConfig, readJsonc, readOverlay, readWorkflow, releaseFiles, releaseNotes, replaceLine, repoOf, repositoryIsPublic, repositoryOfRemote, requiredScripts, roadmapOfLine, roadmapParses, runChecks, runCli, runFix, runGit, runnerBudget, scheduleMinute, scriptsOf, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, workspaceGlobs, workspaceProtocol };
68
68
 
69
69
  //# sourceMappingURL=index.js.map
@@ -1528,6 +1528,97 @@ function readWorkflow(file, text) {
1528
1528
  jobs
1529
1529
  };
1530
1530
  }
1531
+ // src/rules/gate-after-cancel.ts
1532
+ /**
1533
+ * The rule `gate-after-cancel`: a summary job of a gate does not start after a cancel. A job with `if: always()` still
1534
+ * asks for a runner when its run is cancelled, and the new run of the pull request waits behind it. With `!cancelled()`, the
1535
+ * job concludes `cancelled` with no runner, and it still starts after a failure, a skip and a time limit.
1536
+ */
1537
+ /** The condition of a summary job. */
1538
+ const NOT_CANCELLED = "${{ !cancelled() }}";
1539
+ const ALWAYS_ONLY = /^(\$\{\{\s*)?always\(\)(\s*\}\})?$/;
1540
+ /** This function tells if a job is a summary job: its name ends with ` OK`, or a step uses the action `gate-summary`. */
1541
+ function isSummary(lines, job) {
1542
+ const end = lines.findIndex((line, at) => at > job && line.trim() !== "" && indentOf$1(line) <= indentOf$1(lines[job] ?? ""));
1543
+ const body = lines.slice(job + 1, end < 0 ? lines.length : end);
1544
+ return childKeys(lines, job).map((at) => keyValue(lines[at] ?? "", "name")).find((value) => value !== void 0)?.endsWith(" OK") === true || body.some((line) => (keyValue(line, "uses") ?? "").includes("/actions/gate-summary@"));
1545
+ }
1546
+ /** This function gives the summary jobs of a workflow with `always()` in the condition of the job. It does not read the condition of a step. */
1547
+ function alwaysGates(text) {
1548
+ const lines = workflowLines(text);
1549
+ const jobs = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0);
1550
+ if (jobs < 0) return [];
1551
+ const found = [];
1552
+ for (const job of childKeys(lines, jobs)) {
1553
+ if (!isSummary(lines, job)) continue;
1554
+ for (const at of childKeys(lines, job)) {
1555
+ const condition = keyValue(lines[at] ?? "", "if");
1556
+ if (condition === void 0 || !condition.includes("always()")) continue;
1557
+ found.push({
1558
+ line: at,
1559
+ only: ALWAYS_ONLY.test(condition)
1560
+ });
1561
+ }
1562
+ }
1563
+ return found;
1564
+ }
1565
+ /** This function gives the text with `!cancelled()` as the condition of each summary job that has only `always()`. It keeps the line endings and each other line. */
1566
+ function withNotCancelled(text) {
1567
+ const eol = text.includes("\r\n") ? "\r\n" : "\n";
1568
+ const lines = text.split(/\r?\n/);
1569
+ for (const gate of alwaysGates(text)) if (gate.only) lines[gate.line] = `${" ".repeat(indentOf$1(lines[gate.line] ?? ""))}if: ${NOT_CANCELLED}`;
1570
+ return lines.join(eol);
1571
+ }
1572
+ const gateAfterCancel = {
1573
+ id: "gate-after-cancel",
1574
+ title: "A summary job of a gate does not start after a cancel: its condition is `!cancelled()`, not `always()`.",
1575
+ reason: "A job with `if: always()` asks for a runner after a cancel, and the new run waits behind it. On 2026-11-05 a new run waited 22.6 of 23.4 minutes for such jobs of the run that it replaced. A test of each case showed that `!cancelled()` holds the gate: after a cancel the job concludes `cancelled` with no runner, and the pull request stays blocked. After a failure, a skip and a time limit the job starts and fails or passes as before.",
1576
+ fix: "Write `if: ${{ !cancelled() }}` in the summary job. Do not add other parts to this condition: a job that an `if` skips counts as a pass for a required check.",
1577
+ sources: [
1578
+ {
1579
+ repo: "highways",
1580
+ rule: "ci",
1581
+ doc: "runs 41971833871 and 41978983438 (2026-11-05): the new run waited behind the summary jobs of the cancelled run"
1582
+ },
1583
+ {
1584
+ repo: "client",
1585
+ rule: "ci",
1586
+ doc: "ci.yml (2026-11-05): the job CI OK has if: always(), and a new push of a pull request cancels the run before it"
1587
+ },
1588
+ {
1589
+ repo: "template",
1590
+ rule: "gate",
1591
+ doc: "pull request 189 (2026-11-05): the test of a cancel in the queue, a cancel in a job, a time limit, a failed need and a skipped need"
1592
+ }
1593
+ ],
1594
+ options: {},
1595
+ check(context) {
1596
+ const files = context.gitFiles();
1597
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
1598
+ const breaks = [];
1599
+ for (const file of files.filter((path) => WORKFLOW$1.test(path)).sort(byCode)) {
1600
+ let text;
1601
+ try {
1602
+ text = readFileSync(join(context.root, file), "utf8");
1603
+ } catch {
1604
+ continue;
1605
+ }
1606
+ const gates = alwaysGates(text);
1607
+ const after = withNotCancelled(text);
1608
+ for (const gate of gates) breaks.push({
1609
+ file,
1610
+ line: gate.line + 1,
1611
+ message: `A summary job of ${file} has \`always()\` in its condition. After a cancel it asks for a runner, and the new run waits behind it.`,
1612
+ ...gate.only ? { edits: [{
1613
+ file,
1614
+ before: text,
1615
+ after
1616
+ }] } : { fix: `A person must change it, because the condition has other parts. ${gateAfterCancel.fix}` }
1617
+ });
1618
+ }
1619
+ return breaks;
1620
+ }
1621
+ };
1531
1622
  // src/rules/main-runs-finish.ts
1532
1623
  /**
1533
1624
  * The rule `main-runs-finish`: a workflow that starts on `push` or on `workflow_call` does not cancel a run in progress.
@@ -1852,7 +1943,7 @@ function convertGate(text, file, commit = ACTIONS_COMMIT) {
1852
1943
  "",
1853
1944
  `${jobIndent}${summaryId}:`,
1854
1945
  `${job}name: ${name}`,
1855
- `${job}if: always()`,
1946
+ `${job}if: ${NOT_CANCELLED}`,
1856
1947
  `${job}needs: [${["changes", ...ids].join(", ")}]`,
1857
1948
  `${job}runs-on: ubuntu-latest`,
1858
1949
  `${job}timeout-minutes: 2`,
@@ -9909,6 +10000,187 @@ const pinnedGitDeps = {
9909
10000
  return breaks;
9910
10001
  }
9911
10002
  };
10003
+ // src/rules/pipe-fails.ts
10004
+ /**
10005
+ * The rule `pipe-fails`: a failure on the left of a pipe fails its step. With no `shell` key, GitHub starts a step with
10006
+ * `bash -e {0}`, which has no `pipefail`. So `tests | tee out.txt` gives the exit code of `tee`, and the step passes when the tests fail.
10007
+ * The key `shell: bash` starts it with `bash --noprofile --norc -eo pipefail {0}`.
10008
+ */
10009
+ /** This function gives the words that end the here-documents of a line of a script. */
10010
+ function hereWords(line) {
10011
+ return [...line.matchAll(/<<-?\s*["']?([A-Za-z_][A-Za-z0-9_]*)["']?/g)].map((match) => match[1] ?? "");
10012
+ }
10013
+ /**
10014
+ * This function tells if a script has a pipe. It does not read the text of quotes, of comments and of here-documents, and an `||` is not a pipe.
10015
+ * A `|` of a `case` pattern counts as a pipe. The fix for such a script is harmless.
10016
+ */
10017
+ function hasPipe(script) {
10018
+ let quote = "";
10019
+ let until = [];
10020
+ for (const line of script.split(/\r?\n/)) {
10021
+ if (until.length > 0) {
10022
+ if (line.trim() === until[0]) until = until.slice(1);
10023
+ continue;
10024
+ }
10025
+ for (let i = 0; i < line.length; i++) {
10026
+ const char = line.charAt(i);
10027
+ if (quote !== "") {
10028
+ if (char === "\\" && quote === "\"") i += 1;
10029
+ else if (char === quote) quote = "";
10030
+ } else if (char === "\\") i += 1;
10031
+ else if (char === "\"" || char === "'") quote = char;
10032
+ else if (char === "#" && (i === 0 || /\s/.test(line.charAt(i - 1)))) break;
10033
+ else if (char === "|") {
10034
+ if (line.charAt(i + 1) !== "|") return true;
10035
+ i += 1;
10036
+ }
10037
+ }
10038
+ if (quote === "") until = hereWords(line);
10039
+ }
10040
+ return false;
10041
+ }
10042
+ /** This function gives the value of `defaults.run.shell` in the block under the line `index`. The value `-1` reads the top of the file. */
10043
+ function defaultShell(lines, index) {
10044
+ const defaults = (index < 0 ? lines.flatMap((line, at) => line.trim() !== "" && indentOf$1(line) === 0 ? [at] : []) : childKeys(lines, index)).find((at) => keyValue(lines[at] ?? "", "defaults") !== void 0);
10045
+ if (defaults === void 0) return void 0;
10046
+ const run = childKeys(lines, defaults).find((at) => keyValue(lines[at] ?? "", "run") !== void 0);
10047
+ if (run === void 0) return void 0;
10048
+ for (const at of childKeys(lines, run)) {
10049
+ const value = keyValue(lines[at] ?? "", "shell");
10050
+ if (value !== void 0) return value;
10051
+ }
10052
+ }
10053
+ /** This function gives the steps with a `run` key. It reads only the steps of the jobs. */
10054
+ function runSteps(lines) {
10055
+ const jobs = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0);
10056
+ if (jobs < 0) return [];
10057
+ const found = [];
10058
+ const workflowShell = defaultShell(lines, -1);
10059
+ for (const job of childKeys(lines, jobs)) {
10060
+ const jobShell = defaultShell(lines, job);
10061
+ const steps = childKeys(lines, job).find((at) => keyValue(lines[at] ?? "", "steps") !== void 0);
10062
+ if (steps === void 0) continue;
10063
+ const dashes = stepStarts(lines, steps);
10064
+ dashes.forEach((dash, order) => {
10065
+ const end = dashes[order + 1] ?? blockAfter(lines, steps);
10066
+ const indent = indentOf$1(lines[dash] ?? "") + 2;
10067
+ let run;
10068
+ let shell;
10069
+ for (let at = dash; at < end; at++) {
10070
+ const line = lines[at] ?? "";
10071
+ if (!(at === dash || line.trim() !== "" && indentOf$1(line) === indent)) continue;
10072
+ if (keyValue(line, "run") !== void 0) run = at;
10073
+ shell = keyValue(line, "shell") ?? shell;
10074
+ }
10075
+ if (run === void 0) return;
10076
+ const value = keyValue(lines[run] ?? "", "run") ?? "";
10077
+ const scalar = /^[|>]/.test(value);
10078
+ const body = scalar ? [] : [value];
10079
+ if (scalar) for (let at = run + 1; at < end; at++) {
10080
+ const line = lines[at] ?? "";
10081
+ if (line.trim() !== "" && indentOf$1(line) <= indent) break;
10082
+ body.push(line);
10083
+ }
10084
+ found.push({
10085
+ line: run,
10086
+ script: body.join("\n"),
10087
+ shell: shell ?? jobShell ?? workflowShell
10088
+ });
10089
+ });
10090
+ }
10091
+ return found;
10092
+ }
10093
+ /** This function gives the end of the list of steps under the key at the line `steps`. A list can have the same indent as its key. */
10094
+ function blockAfter(lines, steps) {
10095
+ const indent = indentOf$1(lines[steps] ?? "");
10096
+ for (let at = steps + 1; at < lines.length; at++) {
10097
+ const line = lines[at] ?? "";
10098
+ if (line.trim() === "") continue;
10099
+ if (indentOf$1(line) < indent || indentOf$1(line) === indent && !line.trimStart().startsWith("- ")) return at;
10100
+ }
10101
+ return lines.length;
10102
+ }
10103
+ /** This function gives the lines of the items of the list of steps. */
10104
+ function stepStarts(lines, steps) {
10105
+ const end = blockAfter(lines, steps);
10106
+ let indent;
10107
+ const starts = [];
10108
+ for (let at = steps + 1; at < end; at++) {
10109
+ const line = lines[at] ?? "";
10110
+ if (line.trim() === "") continue;
10111
+ indent ??= indentOf$1(line);
10112
+ if (indentOf$1(line) === indent && line.trimStart().startsWith("- ")) starts.push(at);
10113
+ }
10114
+ return starts;
10115
+ }
10116
+ /** This function tells if a shell hides a failure on the left of a pipe. A shell that is not bash or sh has other rules, and the rule does not read it. */
10117
+ function hidesFailure(shell) {
10118
+ if (shell === void 0) return true;
10119
+ if (shell === "bash" || shell.includes("pipefail")) return false;
10120
+ return /^(bash|sh)(\s|$)/.test(shell);
10121
+ }
10122
+ /** This function gives the text with `defaults.run.shell` before its key `jobs`, or undefined when the file has its own `defaults`. */
10123
+ function withBashDefault(text) {
10124
+ const eol = text.includes("\r\n") ? "\r\n" : "\n";
10125
+ const lines = text.split(/\r?\n/);
10126
+ if (lines.some((line) => indentOf$1(line) === 0 && keyValue(line, "defaults") !== void 0)) return void 0;
10127
+ const jobs = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0);
10128
+ if (jobs < 0) return void 0;
10129
+ lines.splice(jobs, 0, "defaults:", " run:", " shell: bash", "");
10130
+ return lines.join(eol);
10131
+ }
10132
+ const pipeFails = {
10133
+ id: "pipe-fails",
10134
+ title: "A failure on the left of a pipe fails its step: each step with a pipe has `pipefail`.",
10135
+ reason: "With no `shell` key, GitHub has no `pipefail`, so `tests | tee out.txt` passes when the tests fail. On 2026-11-05 a read of 99 jobs of a merge gate found 8 failed tests in jobs that concluded success.",
10136
+ fix: "Add `defaults: { run: { shell: bash } }` to the workflow, or `shell: bash` to the step, or `set -o pipefail` to the script. Then read the next run: a step that turns red had a failure that the pipe hid.",
10137
+ sources: [
10138
+ {
10139
+ repo: "coeval",
10140
+ rule: "measure",
10141
+ doc: "K228 (2026-11-05): a merge gate with no pipefail concluded success on 8 of 99 jobs with a failed test"
10142
+ },
10143
+ {
10144
+ repo: "packing",
10145
+ rule: "predicates",
10146
+ doc: "run 41547266012 (2026-11-03): the join failed behind a pipe, and its job concluded success"
10147
+ },
10148
+ {
10149
+ repo: "systems",
10150
+ rule: "kind",
10151
+ doc: "kind.yml (2026-11-05): a failed command behind a pipe left a diagnostic of the borders with no line"
10152
+ }
10153
+ ],
10154
+ options: {},
10155
+ check(context) {
10156
+ const files = context.gitFiles();
10157
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
10158
+ const breaks = [];
10159
+ for (const file of files.filter((path) => WORKFLOW$1.test(path)).sort(byCode)) {
10160
+ let text;
10161
+ try {
10162
+ text = readFileSync(join(context.root, file), "utf8");
10163
+ } catch {
10164
+ continue;
10165
+ }
10166
+ const after = withBashDefault(text);
10167
+ for (const step of runSteps(workflowLines(text))) {
10168
+ if (!hidesFailure(step.shell) || !hasPipe(step.script) || step.script.includes("pipefail")) continue;
10169
+ breaks.push({
10170
+ file,
10171
+ line: step.line + 1,
10172
+ message: `A step of ${file} has a pipe and no \`pipefail\`. The step passes when a command on the left of the pipe fails.`,
10173
+ ...after === void 0 ? {} : { edits: [{
10174
+ file,
10175
+ before: text,
10176
+ after
10177
+ }] }
10178
+ });
10179
+ }
10180
+ }
10181
+ return breaks;
10182
+ }
10183
+ };
9912
10184
  // src/rules/unreleased-change.ts
9913
10185
  /**
9914
10186
  * The rule `unreleased-change`: a change does not set a version that npm has. With the option `versionEachChange`, a
@@ -12008,6 +12280,8 @@ const RULES = [
12008
12280
  runnerBudget,
12009
12281
  mainRunsFinish,
12010
12282
  pushMainOnly,
12283
+ pipeFails,
12284
+ gateAfterCancel,
12011
12285
  gateTrigger,
12012
12286
  homePackage,
12013
12287
  licenseFile,
@@ -12445,6 +12719,6 @@ function runMap(args, io) {
12445
12719
  else io.stdout(mapText(found));
12446
12720
  return 0;
12447
12721
  }
12448
- export { PAGES_WORKFLOWS as $, workspaceGlobs as $t, roadmapOfLine as A, convertGate as At, SHIPPED_FIELDS as B, hasFile as Bt, isSourcePath as C, findHomes as Ct, blockHash as D, readOverlay as Dt, HOME_TIMEOUT_MS as E, mergeHomes as Et, minorOf as F, STRICT_OPTIONS as Ft, isGitSpecifier as G, parseJsonc as Gt, npmLookup as H, keyLine as Ht, publishedMinor as I, cuePreset as It, pagesAfterRelease as J, runGit as Jt, isPinned as K, readJsonc as Kt, publishedMinorRule as L, DEPENDENCY_FIELDS as Lt, requiredScripts as M, prPathFilters as Mt, releaseFiles as N, summaryName as Nt, githubFetch as O, HOME_EXPORTS as Ot, lockedVersions as P, readWorkflow as Pt, pushMainOnly as Q, packageFolders as Qt, reachOf as R, cleanPath as Rt, tsconfigTest as S, MAP_RULE as St, sourceMain as T, mapText as Tt, unreleasedChange as U, lineOf as Ut, UNSHIPPED_FILES as V, inFolder as Vt, unreleasedChangeRule as W, matchesAny as Wt, runnerBudget as X, globFolders as Xt, repositoryOfRemote as Y, specifiersOf as Yt, scheduleMinute as Z, globToRegExp as Zt, configsOfScript as _, homePackage as _t, listRules as a, noLocalPaths as at, testsRequired as b, signaturesOf as bt, runCli as c, hasImportMetaMain as ct, RULES as d, authorOf as dt, defaultOptions as en, pagesCalls as et, workspaceProtocol as f, licenseFile as ft, typedScripts as g, declaredName as gt, trustPolicy as h, repositoryIsPublic as ht, formatResult as i, HOME_PATTERNS as it, roadmapParses as j, gateTrigger as jt, sharedDocsRule as k, ACTIONS_COMMIT as kt, runFix as l, mainCheck as lt, TRAIN_SCOPES as m, mitText as mt, annotations as n, apiReportScript as nt, readConfig as o, noBuildOutput as ot, IGNORE_AFTER as p, licenseFileOf as pt, pinnedGitDeps as q, replaceLine as qt, createContext as r, DEFAULT_ALLOWED as rt, runChecks as s, REAL_COMPARE as st, USAGE as t, parseConfig as tn, pagesSite as tt, summaryMarkdown as u, LICENSE_TEXTS as ut, scriptsOf as v, messageOf as vt, pathsOf as w, mapMarkdown as wt, hasTests as x, HOMES as xt, typedFiles as y, repoOf as yt, NPM_REGISTRY as z, codePackages as zt };
12722
+ export { pushMainOnly as $, globToRegExp as $t, roadmapOfLine as A, ACTIONS_COMMIT as At, SHIPPED_FIELDS as B, cleanPath as Bt, isSourcePath as C, MAP_RULE as Ct, blockHash as D, mergeHomes as Dt, HOME_TIMEOUT_MS as E, mapText as Et, minorOf as F, gateAfterCancel as Ft, pipeFails as G, lineOf as Gt, npmLookup as H, hasFile as Ht, publishedMinor as I, readWorkflow as It, pinnedGitDeps as J, readJsonc as Jt, isGitSpecifier as K, matchesAny as Kt, publishedMinorRule as L, STRICT_OPTIONS as Lt, requiredScripts as M, gateTrigger as Mt, releaseFiles as N, prPathFilters as Nt, githubFetch as O, readOverlay as Ot, lockedVersions as P, summaryName as Pt, scheduleMinute as Q, globFolders as Qt, reachOf as R, cuePreset as Rt, tsconfigTest as S, HOMES as St, sourceMain as T, mapMarkdown as Tt, unreleasedChange as U, inFolder as Ut, UNSHIPPED_FILES as V, codePackages as Vt, unreleasedChangeRule as W, keyLine as Wt, repositoryOfRemote as X, runGit as Xt, pagesAfterRelease as Y, replaceLine as Yt, runnerBudget as Z, specifiersOf as Zt, configsOfScript as _, declaredName as _t, listRules as a, HOME_PATTERNS as at, testsRequired as b, repoOf as bt, runCli as c, REAL_COMPARE as ct, RULES as d, LICENSE_TEXTS as dt, packageFolders as en, PAGES_WORKFLOWS as et, workspaceProtocol as f, authorOf as ft, typedScripts as g, repositoryIsPublic as gt, trustPolicy as h, mitText as ht, formatResult as i, DEFAULT_ALLOWED as it, roadmapParses as j, convertGate as jt, sharedDocsRule as k, HOME_EXPORTS as kt, runFix as l, hasImportMetaMain as lt, TRAIN_SCOPES as m, licenseFileOf as mt, annotations as n, defaultOptions as nn, pagesSite as nt, readConfig as o, noLocalPaths as ot, IGNORE_AFTER as p, licenseFile as pt, isPinned as q, parseJsonc as qt, createContext as r, parseConfig as rn, apiReportScript as rt, runChecks as s, noBuildOutput as st, USAGE as t, workspaceGlobs as tn, pagesCalls as tt, summaryMarkdown as u, mainCheck as ut, scriptsOf as v, homePackage as vt, pathsOf as w, findHomes as wt, hasTests as x, signaturesOf as xt, typedFiles as y, messageOf as yt, NPM_REGISTRY as z, DEPENDENCY_FIELDS as zt };
12449
12723
 
12450
- //# sourceMappingURL=run-5nn4yBKi.js.map
12724
+ //# sourceMappingURL=run-D0rhX3d_.js.map