@mark1russell7/conventions 0.34.0 → 0.36.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
@@ -27,6 +27,7 @@ Each break shows the file, the line, the rule and the fix. In GitHub Actions, th
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
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
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.
30
+ - `security-one-job`: a job that uses the shared workflow `reusable-security.yml`, with its summary job `Security OK`. The fix writes one job `Security OK` that runs the action `security-scan`, with the same inputs and time limit. The pin is the first commit of the template with the action, and Renovate moves it. Another summary job, another job that needs the scans or an input of more than one line needs a person.
30
31
  - `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.
31
32
  - `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.
32
33
  - `trust-policy`: the settings `trustPolicy`, `trustPolicyIgnoreAfter` and `trustPolicyExclude` of `pnpm-workspace.yaml`. The fix makes the file when the repository has none.
@@ -52,6 +53,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
52
53
  | `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`. |
53
54
  | `release-files` | A pull request changes `.github/workflows/release.yml` or `scripts/release/` only with a line `Release-Edit: <reason>` in a commit message or in the body of the pull request. The commits of the release bot (the sync of the template) need no reason. | coeval `no-release-edit`, `no-release-edits`. crawler `no-release-edit`, `no-release-edits`. headroom `no-release-edits`, `release-files-frozen`. |
54
55
  | `unreleased-change` | A change does not set a version that npm has: the release skips such a version. The rule compares the version of the head of the change with the version of its merge base, so a version that only the base branch changed does not count. A repository where each pull request sets its version sets the option `versionEachChange`. Then a change of the shipped files also raises the version, when npm has that version already. The files that ship are the files of the folder of the package, without the tests, the fixtures, the Markdown files and the configs (the option `unshipped`). When git tracks each entry of the field `files`, only those entries ship. A change of `package.json` ships when a field of the option `fields` changes, for example `exports`, but not the dependencies. On a push to the default branch, a version that the push sets breaks only when npm had it before the push. The release of the same push can publish it. An error of the registry makes the rule show `skip`. A repository with `.changeset/config.json`, a private package and a version `0.0.0` or `0.0.0-<stage>` are not examined. | rigor #18 and #20 (2026-11-02): two pull requests set the same version, and the second change did not get to npm. crawler, coeval, template `release.yml`. |
56
+ | `version-title` | A merge whose title names a version sets a version in a `package.json`. A title names a version in parentheses at its end, for example `(0.3.3)` before the `(#212)` of a squash, or after `Release` at its start. On a push to the default branch, the rule examines each commit of the first-parent line against its first parent. On a pull request, it reads the title of the event file and examines the merge commit against the base. A title with no version passes. A title that names an other version than the version that the merge sets also passes, because the change gets a release. | template #212 (`5933b34`) and #215 (`e077054`), 2026-11-06: both set `site-pages` 0.3.3, so the squash of #215 changed no `package.json`, and no release started. Template #162 and #164 (2026-11-04) did the same with 0.2.5. crawler, coeval `release.yml`. |
55
57
  | `published-minor` | A consumer does not stay behind the newest published minor of a package that the option `packages` names. The rule compares each range, and each version of `pnpm-lock.yaml`, with the tag `latest` of npm. A caret range of a `0.x` version cannot reach the next minor. With no `packages`, the rule does not start. | a consumer that stayed behind a published minor |
56
58
  | `changelog-version` | The top version section of the changelog of a package (`CHANGELOG.md` in its folder) is not above the version of its `package.json`. A section "Unreleased" does not count. With the option `everyVersion`, the top section is the same version. On 2026-11-03 a pull request added the section 0.5.0 with two breaking changes and left `package.json` at 0.4.1. A change of a dependency range then made the train plan the PATCH 0.4.2. | packing #249 and #253, release-train (2026-11-03). |
57
59
  | `typed-scripts` | Git keeps no JavaScript source (`.js`, `.mjs`, `.cjs`, `.jsx`, or a file with a `#!` line of `node`) and no shell script (`.sh`, `.bash`, `.zsh`, `.ps1`, or a `#!` line of a shell) of more than one line of code. Each script is TypeScript, which Node 22.18 and later starts directly. A file that must stay (generated output, vendored code, a configuration that a tool reads only as JavaScript) goes in `ignore` with its reason, so the list of exceptions can only get shorter. | private `typed-everything` (STRATEGY.md, direction 15). |
@@ -65,6 +67,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
65
67
  | `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". |
66
68
  | `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. |
67
69
  | `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. |
70
+ | `security-one-job` | The security scans run in one job, the check `Security OK`, with the action `security-scan` of the template. The shared workflow `reusable-security.yml` gives three scan jobs, and its caller adds a summary job. Each job asks for its own runner, so in a full queue a run waits for four runners. On 2026-11-06 each scan job of one repository waited 23 to 40 minutes. |
68
71
  | `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). |
69
72
  | `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). |
70
73
  | `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-Bn3XU7rh.js";
2
+ import { c as runCli } from "./run-D3xtuVA_.js";
3
3
  // src/cli.ts
4
4
  try {
5
5
  process.exitCode = runCli(process.argv.slice(2), {
package/build/index.d.ts CHANGED
@@ -182,6 +182,30 @@ export declare function convertGate(text: string, file: string, commit?: string)
182
182
  reason: string;
183
183
  };
184
184
  export declare const gateTrigger: Rule;
185
+ /** The first commit of the template with the action `security-scan` (pull request 206). Renovate and the template sync move the pin after the fix. */
186
+ export declare const SECURITY_SCAN_COMMIT: string;
187
+ /** The inputs of the action `security-scan`. The shared workflow has the same inputs and also `timeout-minutes`. */
188
+ export declare const SECURITY_SCAN_INPUTS: readonly string[];
189
+ /** The time limit of the job when the caller gives none: the default of `timeout-minutes` of the shared workflow. */
190
+ export declare const SECURITY_TIMEOUT_MINUTES = 30;
191
+ /** A job of the shared workflow in a workflow file: the line of its key (from 0), and its id. */
192
+ interface SecurityCaller {
193
+ readonly line: number;
194
+ readonly id: string;
195
+ }
196
+ /** This function gives the jobs of a workflow that use the shared workflow `reusable-security.yml`. */
197
+ export declare function securityCallers(text: string): SecurityCaller[];
198
+ /**
199
+ * This function puts one job in place of the job of the shared workflow and its summary job. If it cannot, it gives the
200
+ * reason that a person must change the file. The new job keeps the id of the summary job and the name `Security OK`, which the ruleset
201
+ * needs. It gives the inputs of the caller to the action, and `timeout-minutes` to the job.
202
+ */
203
+ export declare function withOneJob(text: string, commit?: string): {
204
+ text: string;
205
+ } | {
206
+ reason: string;
207
+ };
208
+ export declare const securityOneJob: Rule;
185
209
  /** The state of a home: on npm, in a repository but not on npm, only on a roadmap, or with no package. */
186
210
  type HomeState = "published" | "unpublished" | "planned" | "none";
187
211
  /** One area of code and its home. */
@@ -382,6 +406,11 @@ export declare const TRAIN_SCOPES: readonly ["@mark1russell7/*", "@procedures/*"
382
406
  /** 7 days, in minutes. */
383
407
  export declare const IGNORE_AFTER = 10080;
384
408
  export declare const trustPolicy: Rule;
409
+ /** This function gives the versions that a title names, in their order, each one time. */
410
+ export declare function namedVersions(title: string): string[];
411
+ /** This function gives the versions that the change from `from` to `to` sets: each `package.json` whose version changes. */
412
+ export declare function setVersions(context: RuleContext, from: string, to: string): string[] | undefined;
413
+ export declare const versionTitle: Rule;
385
414
  /** A file that GitHub reads as YAML: a workflow, or the file `action.yml` of an action of the repository. */
386
415
  export declare const GITHUB_YAML: RegExp;
387
416
  /** A fault of the YAML of a file: its line and column (from 1), and the first line of the message of the parser. */
@@ -558,5 +587,5 @@ export declare function workspaceGlobs(root: string): string[] | undefined;
558
587
  * The result has absolute paths, in the order of the code units.
559
588
  */
560
589
  export declare function packageFolders(root: string, globs?: readonly string[] | undefined): string[];
561
- export type { AuditSource, Break, CheckOptions, CheckResult, CliIo, ConventionsConfig, Edit, FixResult, Home, HomeAnswer, HomeFetch, HomeState, Manifest, Minor, OptionSpec, OptionValue, Options, PackageInfo, PagesCall, PathFilter, RegistryAnswer, RegistryLookup, Rule, RuleConfig, RuleContext, RuleOutcome, RuleResult, Workflow, WorkflowInput, WorkflowJob, WorkflowStep, YamlFault };
590
+ export type { AuditSource, Break, CheckOptions, CheckResult, CliIo, ConventionsConfig, Edit, FixResult, Home, HomeAnswer, HomeFetch, HomeState, Manifest, Minor, OptionSpec, OptionValue, Options, PackageInfo, PagesCall, PathFilter, RegistryAnswer, RegistryLookup, Rule, RuleConfig, RuleContext, RuleOutcome, RuleResult, SecurityCaller, Workflow, WorkflowInput, WorkflowJob, WorkflowStep, YamlFault };
562
591
  //# sourceMappingURL=index.d.ts.map
@@ -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-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/workflow-parses.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;;WAE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Ae,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/rules/security-one-job.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/version-title.ts","../src/rules/workflow-parses.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;;;q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runGit, A as blockHash, At as mergeHomes, B as publishedMinorRule, Bt as STRICT_OPTIONS, C as testsRequired, Ct as repoOf, D as pathsOf, Dt as findHomes, E as isSourcePath, Et as MAP_RULE, F as requiredScripts, Ft as gateTrigger, G as npmLookup, Gt as hasFile, H as NPM_REGISTRY, Ht as DEPENDENCY_FIELDS, I as releaseFiles, It as prPathFilters, J as pipeFails, Jt as lineOf, K as unreleasedChange, Kt as inFolder, L as lockedVersions, Lt as summaryName, M as sharedDocsRule, Mt as HOME_EXPORTS, N as roadmapOfLine, Nt as ACTIONS_COMMIT, O as sourceMain, Ot as mapMarkdown, P as roadmapParses, Pt as convertGate, Q as pagesAfterRelease, Qt as replaceLine, R as minorOf, Rt as gateAfterCancel, S as typedFiles, St as messageOf, T as tsconfigTest, Tt as HOMES, U as SHIPPED_FIELDS, Ut as cleanPath, V as reachOf, Vt as cuePreset, W as UNSHIPPED_FILES, Wt as codePackages, X as isPinned, Xt as parseJsonc, Y as isGitSpecifier, Yt as matchesAny, Z as pinnedGitDeps, Zt as readJsonc, _ as TRAIN_SCOPES, _t as licenseFileOf, a as listRules, an as defaultOptions, at as pagesSite, b as configsOfScript, bt as declaredName, c as runCli, ct as HOME_PATTERNS, d as RULES, dt as REAL_COMPARE, en as specifiersOf, et as runnerBudget, f as workspaceProtocol, ft as hasImportMetaMain, g as IGNORE_AFTER, gt as licenseFile, h as yamlFaults, ht as authorOf, i as formatResult, in as workspaceGlobs, it as pagesCalls, j as githubFetch, jt as readOverlay, k as HOME_TIMEOUT_MS, kt as mapText, l as runFix, lt as noLocalPaths, m as workflowParses, mt as LICENSE_TEXTS, n as annotations, nn as globToRegExp, nt as pushMainOnly, o as readConfig, on as parseConfig, ot as apiReportScript, p as GITHUB_YAML, pt as mainCheck, q as unreleasedChangeRule, qt as keyLine, r as createContext, rn as packageFolders, rt as PAGES_WORKFLOWS, s as runChecks, st as DEFAULT_ALLOWED, t as USAGE, tn as globFolders, tt as scheduleMinute, u as summaryMarkdown, ut as noBuildOutput, v as trustPolicy, vt as mitText, w as hasTests, wt as signaturesOf, x as scriptsOf, xt as homePackage, y as typedScripts, yt as repositoryIsPublic, z as publishedMinor, zt as readWorkflow } from "./run-Bn3XU7rh.js";
1
+ import { $ as isPinned, $t as codePackages, A as pathsOf, At as findHomes, B as lockedVersions, Bt as securityOneJob, C as configsOfScript, Ct as declaredName, D as hasTests, Dt as signaturesOf, E as testsRequired, Et as repoOf, F as sharedDocsRule, Ft as HOME_EXPORTS, G as NPM_REGISTRY, Gt as prPathFilters, H as publishedMinor, Ht as ACTIONS_COMMIT, I as roadmapOfLine, It as SECURITY_SCAN_COMMIT, J as npmLookup, Jt as readWorkflow, K as SHIPPED_FIELDS, Kt as summaryName, L as roadmapParses, Lt as SECURITY_SCAN_INPUTS, M as HOME_TIMEOUT_MS, Mt as mapText, N as blockHash, Nt as mergeHomes, O as tsconfigTest, Ot as HOMES, P as githubFetch, Pt as readOverlay, Q as isGitSpecifier, Qt as cleanPath, R as requiredScripts, Rt as SECURITY_TIMEOUT_MINUTES, S as typedScripts, St as repositoryIsPublic, T as typedFiles, Tt as messageOf, U as publishedMinorRule, Ut as convertGate, V as minorOf, Vt as withOneJob, W as reachOf, Wt as gateTrigger, X as unreleasedChangeRule, Xt as cuePreset, Y as unreleasedChange, Yt as STRICT_OPTIONS, Z as pipeFails, Zt as DEPENDENCY_FIELDS, _ as setVersions, _t as LICENSE_TEXTS, a as listRules, an as parseJsonc, at as pushMainOnly, b as TRAIN_SCOPES, bt as licenseFileOf, c as runCli, cn as runGit, ct as pagesSite, d as RULES, dn as globToRegExp, dt as HOME_PATTERNS, en as hasFile, et as pinnedGitDeps, f as workspaceProtocol, fn as packageFolders, ft as noLocalPaths, g as namedVersions, gt as mainCheck, h as yamlFaults, hn as parseConfig, ht as hasImportMetaMain, i as formatResult, in as matchesAny, it as scheduleMinute, j as sourceMain, jt as mapMarkdown, k as isSourcePath, kt as MAP_RULE, l as runFix, ln as specifiersOf, lt as apiReportScript, m as workflowParses, mn as defaultOptions, mt as REAL_COMPARE, n as annotations, nn as keyLine, nt as repositoryOfRemote, o as readConfig, on as readJsonc, ot as PAGES_WORKFLOWS, p as GITHUB_YAML, pn as workspaceGlobs, pt as noBuildOutput, q as UNSHIPPED_FILES, qt as gateAfterCancel, r as createContext, rn as lineOf, rt as runnerBudget, s as runChecks, sn as replaceLine, st as pagesCalls, t as USAGE, tn as inFolder, tt as pagesAfterRelease, u as summaryMarkdown, un as globFolders, ut as DEFAULT_ALLOWED, v as versionTitle, vt as authorOf, w as scriptsOf, wt as homePackage, x as trustPolicy, xt as mitText, y as IGNORE_AFTER, yt as licenseFile, z as releaseFiles, zt as securityCallers } from "./run-D3xtuVA_.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, GITHUB_YAML, 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, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
67
+ export { ACTIONS_COMMIT, DEFAULT_ALLOWED, DEPENDENCY_FIELDS, GITHUB_YAML, HOMES, HOME_EXPORTS, HOME_PATTERNS, HOME_TIMEOUT_MS, IGNORE_AFTER, LICENSE_TEXTS, MAP_RULE, MAX_NOTES, NPM_REGISTRY, PAGES_WORKFLOWS, REAL_COMPARE, RULES, SECURITY_SCAN_COMMIT, SECURITY_SCAN_INPUTS, SECURITY_TIMEOUT_MINUTES, 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, namedVersions, 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, securityCallers, securityOneJob, setVersions, sharedDocsRule, signaturesOf, sourceMain, specifiersOf, summaryMarkdown, summaryName, tagName, testsRequired, trustPolicy, tsconfigTest, typedFiles, typedScripts, unreleasedChange, unreleasedChangeRule, versionTitle, withOneJob, workflowParses, workspaceGlobs, workspaceProtocol, yamlFaults };
68
68
 
69
69
  //# sourceMappingURL=index.js.map
@@ -311,10 +311,10 @@ function codePackages(context) {
311
311
  return context.packages.length > 0 ? context.packages : [context.rootPackage];
312
312
  }
313
313
  // ../site-pages/src/data/versions.ts
314
- const SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
314
+ const SEMVER$1 = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
315
315
  /** This function gives the parts of a version, or null when the text is not a SemVer version. */
316
316
  function parseVersion(version) {
317
- const match = SEMVER.exec(version);
317
+ const match = SEMVER$1.exec(version);
318
318
  if (!match) return null;
319
319
  return {
320
320
  major: Number(match[1]),
@@ -2018,6 +2018,194 @@ const gateTrigger = {
2018
2018
  return breaks;
2019
2019
  }
2020
2020
  };
2021
+ // src/rules/security-one-job.ts
2022
+ /**
2023
+ * The rule `security-one-job`: the security scans of a repository run in one job, with the action `security-scan` of the
2024
+ * template. The deprecated shared workflow `reusable-security.yml` gives three scan jobs, and the caller adds the summary
2025
+ * job `Security OK`. Each job asks for its own runner, so a run waits in the queue for four runners in place of one.
2026
+ */
2027
+ /** The first commit of the template with the action `security-scan` (pull request 206). Renovate and the template sync move the pin after the fix. */
2028
+ const SECURITY_SCAN_COMMIT = "8a01259f04dce1d6a2fa351b758c6d283e9f7fc9";
2029
+ /** The inputs of the action `security-scan`. The shared workflow has the same inputs and also `timeout-minutes`. */
2030
+ const SECURITY_SCAN_INPUTS = [
2031
+ "fail-on-severity",
2032
+ "dependency-review",
2033
+ "dependency-review-scopes",
2034
+ "osv",
2035
+ "osv-lockfile",
2036
+ "codeql",
2037
+ "codeql-languages",
2038
+ "codeql-build-mode"
2039
+ ];
2040
+ /** The time limit of the job when the caller gives none: the default of `timeout-minutes` of the shared workflow. */
2041
+ const SECURITY_TIMEOUT_MINUTES = 30;
2042
+ const REUSABLE = /(^|\/)\.github\/workflows\/reusable-security\.ya?ml(@|$)/;
2043
+ /** The keys that a job of the shared workflow can have, and that the fix can replace. */
2044
+ const CALLER_KEYS = /* @__PURE__ */ new Set([
2045
+ "uses",
2046
+ "permissions",
2047
+ "with",
2048
+ "name"
2049
+ ]);
2050
+ /** This function gives the lines from `start` to the last line of the block that is not empty. */
2051
+ function trimmedEnd(lines, start) {
2052
+ let end = blockEnd(lines, start);
2053
+ while (end > start + 1 && (lines[end - 1] ?? "").trim() === "") end -= 1;
2054
+ return end;
2055
+ }
2056
+ /** This function gives the id of the job of the line `at`. */
2057
+ const idOf = (line) => {
2058
+ const text = line.trim();
2059
+ const colon = text.indexOf(":");
2060
+ return (colon < 0 ? text : text.slice(0, colon)).replace(/^["']|["']$/g, "");
2061
+ };
2062
+ /** This function gives the jobs of a workflow that use the shared workflow `reusable-security.yml`. */
2063
+ function securityCallers(text) {
2064
+ const lines = workflowLines(text);
2065
+ const jobs = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0);
2066
+ if (jobs < 0) return [];
2067
+ const found = [];
2068
+ for (const job of childKeys(lines, jobs)) {
2069
+ const uses = childKeys(lines, job).map((at) => keyValue(lines[at] ?? "", "uses")).find((value) => value !== void 0);
2070
+ if (uses !== void 0 && REUSABLE.test(uses)) found.push({
2071
+ line: job,
2072
+ id: idOf(lines[job] ?? "")
2073
+ });
2074
+ }
2075
+ return found;
2076
+ }
2077
+ /** This function gives the ids of the jobs in `needs` of the job of the line `job`. */
2078
+ function needsOf(lines, job) {
2079
+ for (const at of childKeys(lines, job)) {
2080
+ const value = keyValue(lines[at] ?? "", "needs");
2081
+ if (value === void 0) continue;
2082
+ if (value !== "" && !value.startsWith("[")) return [value];
2083
+ return listItems(lines, at, value)?.items ?? [];
2084
+ }
2085
+ return [];
2086
+ }
2087
+ /**
2088
+ * This function puts one job in place of the job of the shared workflow and its summary job. If it cannot, it gives the
2089
+ * reason that a person must change the file. The new job keeps the id of the summary job and the name `Security OK`, which the ruleset
2090
+ * needs. It gives the inputs of the caller to the action, and `timeout-minutes` to the job.
2091
+ */
2092
+ function withOneJob(text, commit = SECURITY_SCAN_COMMIT) {
2093
+ const lines = workflowLines(text);
2094
+ const callers = securityCallers(text);
2095
+ if (callers.length !== 1) return { reason: `the file has ${String(callers.length)} jobs that use reusable-security.yml, and the fix changes only one` };
2096
+ const caller = callers[0];
2097
+ if (caller === void 0) return { reason: "no job uses reusable-security.yml" };
2098
+ const dependents = childKeys(lines, lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0)).filter((job) => needsOf(lines, job).includes(caller.id));
2099
+ if (dependents.length !== 1) return { reason: `${String(dependents.length)} jobs need the job ${caller.id}, and the fix needs exactly one summary job` };
2100
+ const summary = dependents[0];
2101
+ if (summary === void 0) return { reason: "no summary job" };
2102
+ const summaryNeeds = needsOf(lines, summary);
2103
+ if (summaryNeeds.length !== 1) return { reason: `the summary job needs ${summaryNeeds.join(", ")}, and the fix replaces only a summary job of the scans` };
2104
+ const summaryName = childKeys(lines, summary).map((at) => keyValue(lines[at] ?? "", "name")).find((value) => value !== void 0);
2105
+ if (summaryName !== "Security OK") return { reason: `the summary job has the name ${summaryName ?? "(none)"}, not Security OK, which the ruleset needs` };
2106
+ const inputs = [];
2107
+ let timeout = String(30);
2108
+ for (const at of childKeys(lines, caller.line)) {
2109
+ const key = idOf(lines[at] ?? "");
2110
+ if (!CALLER_KEYS.has(key)) return { reason: `the job ${caller.id} has the key ${key}, and the fix cannot keep it` };
2111
+ if (key !== "with") continue;
2112
+ for (const input of childKeys(lines, at)) {
2113
+ const name = idOf(lines[input] ?? "");
2114
+ const value = keyValue(lines[input] ?? "", name) ?? "";
2115
+ if (value === "" || value.startsWith("|") || value.startsWith(">") || trimmedEnd(lines, input) > input + 1) return { reason: `the input ${name} has a value of more than one line` };
2116
+ if (name === "timeout-minutes") timeout = value;
2117
+ else if (SECURITY_SCAN_INPUTS.includes(name)) inputs.push(name);
2118
+ else return { reason: `the action security-scan has no input ${name}` };
2119
+ }
2120
+ }
2121
+ const raw = text.split(/\r?\n/);
2122
+ const pad = " ".repeat(indentOf$1(raw[caller.line] ?? ""));
2123
+ const withLines = childKeys(lines, caller.line).find((at) => idOf(lines[at] ?? "") === "with");
2124
+ const inputLines = withLines === void 0 ? [] : childKeys(lines, withLines).filter((at) => inputs.includes(idOf(lines[at] ?? ""))).map((at) => `${pad} ${(raw[at] ?? "").trim()}`);
2125
+ const job = [
2126
+ `${pad}${idOf(lines[summary] ?? "")}:`,
2127
+ `${pad} name: Security OK`,
2128
+ `${pad} runs-on: ubuntu-latest`,
2129
+ `${pad} timeout-minutes: ${timeout}`,
2130
+ `${pad} permissions:`,
2131
+ `${pad} contents: read`,
2132
+ `${pad} security-events: write`,
2133
+ `${pad} actions: read`,
2134
+ `${pad} steps:`,
2135
+ `${pad} - uses: mark1russell7/template/.github/actions/security-scan@${commit} # main`,
2136
+ ...inputLines.length > 0 ? [`${pad} with:`, ...inputLines] : []
2137
+ ];
2138
+ const splices = [{
2139
+ at: caller.line,
2140
+ remove: trimmedEnd(lines, caller.line) - caller.line,
2141
+ insert: job
2142
+ }];
2143
+ const blank = (at) => at >= 0 && at < raw.length - 1 && (raw[at] ?? "").trim() === "";
2144
+ const start = blank(summary - 1) ? summary - 1 : summary;
2145
+ const end = trimmedEnd(lines, summary) + (start === summary && blank(trimmedEnd(lines, summary)) ? 1 : 0);
2146
+ splices.push({
2147
+ at: start,
2148
+ remove: end - start,
2149
+ insert: []
2150
+ });
2151
+ return { text: applySplices(text, splices) };
2152
+ }
2153
+ const securityOneJob = {
2154
+ id: "security-one-job",
2155
+ title: "The security scans run in one job: the action `security-scan`, not the shared workflow `reusable-security.yml`.",
2156
+ reason: "Each job of a run asks for its own runner. reusable-security.yml gives three scan jobs, and the caller adds the summary job Security OK, so each run waits in the queue for four runners, and the summary job waits again after the scans. On 2026-11-06, in a full queue, the scan jobs of systems waited 23 to 40 minutes each. The action security-scan runs the same scans with the same inputs in one job, which is the check Security OK.",
2157
+ fix: "Replace the job that uses reusable-security.yml and its summary job with one job Security OK that runs the action security-scan (CI.md, Security). Give the inputs to the action, and timeout-minutes to the job.",
2158
+ sources: [
2159
+ {
2160
+ repo: "template",
2161
+ rule: "security",
2162
+ doc: "pull request 206 (2026-11-05): the action security-scan, and reusable-security.yml deprecated"
2163
+ },
2164
+ {
2165
+ repo: "template",
2166
+ rule: "ci",
2167
+ doc: "CI.md, Security: the job of a caller of security-scan, and the change from the old workflow"
2168
+ },
2169
+ {
2170
+ repo: "optional",
2171
+ rule: "security",
2172
+ doc: ".github/workflows/security.yml (2026-11-06): the job security of reusable-security.yml and the summary job Security OK, the form that the fix changes"
2173
+ },
2174
+ {
2175
+ repo: "systems",
2176
+ rule: "ci",
2177
+ doc: "Security runs 42159170199 to 42172625422 (2026-11-06): three scan jobs, each waited 5.7 to 40.7 minutes for a runner"
2178
+ }
2179
+ ],
2180
+ options: {},
2181
+ check(context) {
2182
+ const files = context.gitFiles();
2183
+ if (files === void 0) return { skipped: "the root is not in a git repository" };
2184
+ const breaks = [];
2185
+ for (const file of files.filter((path) => WORKFLOW$1.test(path)).sort(byCode)) {
2186
+ let text;
2187
+ try {
2188
+ text = readFileSync(join(context.root, file), "utf8");
2189
+ } catch {
2190
+ continue;
2191
+ }
2192
+ const callers = securityCallers(text);
2193
+ if (callers.length === 0) continue;
2194
+ const after = withOneJob(text);
2195
+ for (const caller of callers) breaks.push({
2196
+ file,
2197
+ line: caller.line + 1,
2198
+ message: `The job ${caller.id} of ${file} uses reusable-security.yml: its scans ask for three runners and its summary job for a fourth.`,
2199
+ ..."text" in after ? { edits: [{
2200
+ file,
2201
+ before: text,
2202
+ after: after.text
2203
+ }] } : { fix: `A person must change it, because ${after.reason}. ${securityOneJob.fix}` }
2204
+ });
2205
+ }
2206
+ return breaks;
2207
+ }
2208
+ };
2021
2209
  // src/change.ts
2022
2210
  /**
2023
2211
  * The change that a check examines: the option `--base`, the merge commit of a pull request, or a push to the default
@@ -8059,7 +8247,7 @@ const HOMES = [
8059
8247
  {
8060
8248
  area: "optional",
8061
8249
  title: "Optional values",
8062
- covers: "a value that is present or absent, with the functor and monad laws",
8250
+ covers: "a value that is present or absent, and Result, a value or an error (1.2.0), with the functor and monad laws",
8063
8251
  packages: ["@mark1russell7/optional"],
8064
8252
  repo: "mark1russell7/optional",
8065
8253
  state: "published",
@@ -8069,7 +8257,10 @@ const HOMES = [
8069
8257
  "some",
8070
8258
  "none",
8071
8259
  "monad",
8072
- "functor"
8260
+ "functor",
8261
+ "result",
8262
+ "either",
8263
+ "error"
8073
8264
  ],
8074
8265
  note: "@mark1russell7/render-optional is a second copy. It moves to @mark1russell7/optional."
8075
8266
  },
@@ -12361,6 +12552,151 @@ const trustPolicy = {
12361
12552
  return breaks;
12362
12553
  }
12363
12554
  };
12555
+ // src/rules/version-title.ts
12556
+ /**
12557
+ * The rule `version-title`: a merge whose title names a version sets that version in a `package.json`.
12558
+ */
12559
+ /** A version of SemVer, with an optional pre-release. */
12560
+ const SEMVER = String.raw`\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?`;
12561
+ /**
12562
+ * The places of a version in a title. The first place is in parentheses at the end, before the number of a squash, for
12563
+ * example `feat: a rule (0.3.3) (#212)`. The second place is after "Release" at the start, for example `Release 0.23.0`.
12564
+ */
12565
+ const NAMED = [new RegExp(String.raw`\((${SEMVER})\)(?:\s*\(#\d+\))?\s*$`), new RegExp(String.raw`^(?:[a-z]+(?:\([^)]*\))?!?:\s*)?release v?(${SEMVER})\b`, "i")];
12566
+ /** This function gives the versions that a title names, in their order, each one time. */
12567
+ function namedVersions(title) {
12568
+ const found = [];
12569
+ for (const pattern of NAMED) {
12570
+ const version = pattern.exec(title)?.[1];
12571
+ if (version !== void 0 && !found.includes(version)) found.push(version);
12572
+ }
12573
+ return found;
12574
+ }
12575
+ /** This function gives the version of a `package.json` at a commit, or undefined. */
12576
+ function versionAt(context, commit, file) {
12577
+ const text = context.git(["show", `${commit}:${file}`]);
12578
+ if (text === void 0) return void 0;
12579
+ try {
12580
+ const value = JSON.parse(text).version;
12581
+ return typeof value === "string" ? value : void 0;
12582
+ } catch {
12583
+ return;
12584
+ }
12585
+ }
12586
+ /** This function gives the versions that the change from `from` to `to` sets: each `package.json` whose version changes. */
12587
+ function setVersions(context, from, to) {
12588
+ const out = context.git([
12589
+ "diff",
12590
+ "--name-only",
12591
+ "--no-renames",
12592
+ from,
12593
+ to,
12594
+ "--",
12595
+ "package.json",
12596
+ "**/package.json"
12597
+ ]);
12598
+ if (out === void 0) return void 0;
12599
+ const versions = [];
12600
+ for (const file of out.split(/\r?\n/).filter((line) => line !== "")) {
12601
+ const after = versionAt(context, to, file);
12602
+ if (after !== void 0 && after !== versionAt(context, from, file) && !versions.includes(after)) versions.push(after);
12603
+ }
12604
+ return versions;
12605
+ }
12606
+ /** This function gives the title of the pull request of the event file, or undefined. */
12607
+ function pullRequestTitle(context) {
12608
+ const file = context.env["GITHUB_EVENT_PATH"];
12609
+ if (file === void 0 || file === "" || !existsSync(file)) return void 0;
12610
+ try {
12611
+ const title = JSON.parse(readFileSync(file, "utf8")).pull_request?.title;
12612
+ return typeof title === "string" ? title : void 0;
12613
+ } catch {
12614
+ return;
12615
+ }
12616
+ }
12617
+ /**
12618
+ * This function gives the break of a title that names a version when the change sets no version, or undefined. A change
12619
+ * that sets an other version than its title gets a release, so it does not break.
12620
+ */
12621
+ function breakOf(title, set, file, where) {
12622
+ const named = namedVersions(title);
12623
+ if (named.length === 0 || set.length > 0) return void 0;
12624
+ return {
12625
+ file,
12626
+ message: `${where} has the title "${title}", which names ${named.join(", ")}, but it sets no version. The release workflow starts only on a change of a version, so the change gets no release.`
12627
+ };
12628
+ }
12629
+ const versionTitle = {
12630
+ id: "version-title",
12631
+ title: "A merge whose title names a version, for example `(0.3.3)` or `Release 0.23.0`, sets a version in a `package.json`.",
12632
+ reason: "When two pull requests set the same version line, the second one merges with no conflict and changes no version. The release workflow starts only on a change of a version, so the change gets no release. Template #164 merged so on 2026-11-04, and #215 on 2026-11-06.",
12633
+ fix: "Set the next free version (SemVer) in a pull request, and correct the title. On a pull request, merge the base branch in first: the version that the title names is then the version that the merge sets.",
12634
+ sources: [
12635
+ {
12636
+ repo: "template",
12637
+ rule: "version-title",
12638
+ doc: "#212 (5933b34) and #215 (e077054), 2026-11-06: both set site-pages 0.3.3, and e077054 changed no package.json"
12639
+ },
12640
+ {
12641
+ repo: "template",
12642
+ rule: "version-title",
12643
+ doc: "#162 (9392d6e) and #164 (5b6d568), 2026-11-04: both set site-pages 0.2.5, and #166 released the change of #164 as 0.2.6"
12644
+ },
12645
+ {
12646
+ repo: "rigor",
12647
+ rule: "unreleased-change",
12648
+ doc: "pull requests #18 and #20 (2026-11-02): two pull requests set the same version"
12649
+ },
12650
+ ...["crawler", "coeval"].map((repo) => ({
12651
+ repo,
12652
+ rule: "version-title",
12653
+ doc: ".github/workflows/release.yml (it starts on a push to main that changes a package.json)"
12654
+ }))
12655
+ ],
12656
+ options: {},
12657
+ check(context) {
12658
+ const event = context.env["GITHUB_EVENT_NAME"];
12659
+ if (context.base === void 0 && (event === "pull_request" || event === "pull_request_target")) {
12660
+ const title = pullRequestTitle(context);
12661
+ if (title === void 0) return { skipped: "the event file has no title of the pull request" };
12662
+ const range = rangeOf(context);
12663
+ if ("skipped" in range) return range;
12664
+ const set = setVersions(context, range.ends[0], "HEAD");
12665
+ if (set === void 0) return { skipped: "git cannot give the changed files of the pull request" };
12666
+ const found = breakOf(title, set, "package.json", "The pull request");
12667
+ return found === void 0 ? [] : [found];
12668
+ }
12669
+ const range = rangeOf(context, { push: true });
12670
+ if ("skipped" in range) return range;
12671
+ const out = context.git([
12672
+ "rev-list",
12673
+ "--first-parent",
12674
+ ...range.log
12675
+ ]);
12676
+ if (out === void 0) return { skipped: "git cannot give the commits of the change" };
12677
+ const breaks = [];
12678
+ for (const commit of out.split(/\r?\n/).filter((line) => line !== "")) {
12679
+ const title = context.git([
12680
+ "log",
12681
+ "-1",
12682
+ "--format=%s",
12683
+ commit
12684
+ ])?.trim();
12685
+ if (title === void 0 || namedVersions(title).length === 0) continue;
12686
+ if (context.git([
12687
+ "rev-parse",
12688
+ "--verify",
12689
+ "--quiet",
12690
+ `${commit}^1^{commit}`
12691
+ ]) === void 0) continue;
12692
+ const set = setVersions(context, `${commit}^1`, commit);
12693
+ if (set === void 0) continue;
12694
+ const found = breakOf(title, set, "package.json", `The commit ${commit.slice(0, 7)}`);
12695
+ if (found !== void 0) breaks.push(found);
12696
+ }
12697
+ return breaks;
12698
+ }
12699
+ };
12364
12700
  // src/rules/workflow-parses.ts
12365
12701
  /**
12366
12702
  * The rule `workflow-parses`: each workflow file and each action file of `.github` parses as YAML.
@@ -12505,6 +12841,7 @@ const RULES = [
12505
12841
  apiReportScript,
12506
12842
  releaseFiles,
12507
12843
  unreleasedChange,
12844
+ versionTitle,
12508
12845
  publishedMinor,
12509
12846
  changelogVersion,
12510
12847
  typedScripts,
@@ -12519,6 +12856,7 @@ const RULES = [
12519
12856
  pipeFails,
12520
12857
  gateAfterCancel,
12521
12858
  gateTrigger,
12859
+ securityOneJob,
12522
12860
  homePackage,
12523
12861
  licenseFile,
12524
12862
  pagesSite,
@@ -12955,6 +13293,6 @@ function runMap(args, io) {
12955
13293
  else io.stdout(mapText(found));
12956
13294
  return 0;
12957
13295
  }
12958
- export { repositoryOfRemote as $, runGit as $t, blockHash as A, mergeHomes as At, publishedMinorRule as B, STRICT_OPTIONS as Bt, testsRequired as C, repoOf as Ct, pathsOf as D, findHomes as Dt, isSourcePath as E, MAP_RULE as Et, requiredScripts as F, gateTrigger as Ft, npmLookup as G, hasFile as Gt, NPM_REGISTRY as H, DEPENDENCY_FIELDS as Ht, releaseFiles as I, prPathFilters as It, pipeFails as J, lineOf as Jt, unreleasedChange as K, inFolder as Kt, lockedVersions as L, summaryName as Lt, sharedDocsRule as M, HOME_EXPORTS as Mt, roadmapOfLine as N, ACTIONS_COMMIT as Nt, sourceMain as O, mapMarkdown as Ot, roadmapParses as P, convertGate as Pt, pagesAfterRelease as Q, replaceLine as Qt, minorOf as R, gateAfterCancel as Rt, typedFiles as S, messageOf as St, tsconfigTest as T, HOMES as Tt, SHIPPED_FIELDS as U, cleanPath as Ut, reachOf as V, cuePreset as Vt, UNSHIPPED_FILES as W, codePackages as Wt, isPinned as X, parseJsonc as Xt, isGitSpecifier as Y, matchesAny as Yt, pinnedGitDeps as Z, readJsonc as Zt, TRAIN_SCOPES as _, licenseFileOf as _t, listRules as a, defaultOptions as an, pagesSite as at, configsOfScript as b, declaredName as bt, runCli as c, HOME_PATTERNS as ct, RULES as d, REAL_COMPARE as dt, specifiersOf as en, runnerBudget as et, workspaceProtocol as f, hasImportMetaMain as ft, IGNORE_AFTER as g, licenseFile as gt, yamlFaults as h, authorOf as ht, formatResult as i, workspaceGlobs as in, pagesCalls as it, githubFetch as j, readOverlay as jt, HOME_TIMEOUT_MS as k, mapText as kt, runFix as l, noLocalPaths as lt, workflowParses as m, LICENSE_TEXTS as mt, annotations as n, globToRegExp as nn, pushMainOnly as nt, readConfig as o, parseConfig as on, apiReportScript as ot, GITHUB_YAML as p, mainCheck as pt, unreleasedChangeRule as q, keyLine as qt, createContext as r, packageFolders as rn, PAGES_WORKFLOWS as rt, runChecks as s, DEFAULT_ALLOWED as st, USAGE as t, globFolders as tn, scheduleMinute as tt, summaryMarkdown as u, noBuildOutput as ut, trustPolicy as v, mitText as vt, hasTests as w, signaturesOf as wt, scriptsOf as x, homePackage as xt, typedScripts as y, repositoryIsPublic as yt, publishedMinor as z, readWorkflow as zt };
13296
+ export { isPinned as $, codePackages as $t, pathsOf as A, findHomes as At, lockedVersions as B, securityOneJob as Bt, configsOfScript as C, declaredName as Ct, hasTests as D, signaturesOf as Dt, testsRequired as E, repoOf as Et, sharedDocsRule as F, HOME_EXPORTS as Ft, NPM_REGISTRY as G, prPathFilters as Gt, publishedMinor as H, ACTIONS_COMMIT as Ht, roadmapOfLine as I, SECURITY_SCAN_COMMIT as It, npmLookup as J, readWorkflow as Jt, SHIPPED_FIELDS as K, summaryName as Kt, roadmapParses as L, SECURITY_SCAN_INPUTS as Lt, HOME_TIMEOUT_MS as M, mapText as Mt, blockHash as N, mergeHomes as Nt, tsconfigTest as O, HOMES as Ot, githubFetch as P, readOverlay as Pt, isGitSpecifier as Q, cleanPath as Qt, requiredScripts as R, SECURITY_TIMEOUT_MINUTES as Rt, typedScripts as S, repositoryIsPublic as St, typedFiles as T, messageOf as Tt, publishedMinorRule as U, convertGate as Ut, minorOf as V, withOneJob as Vt, reachOf as W, gateTrigger as Wt, unreleasedChangeRule as X, cuePreset as Xt, unreleasedChange as Y, STRICT_OPTIONS as Yt, pipeFails as Z, DEPENDENCY_FIELDS as Zt, setVersions as _, LICENSE_TEXTS as _t, listRules as a, parseJsonc as an, pushMainOnly as at, TRAIN_SCOPES as b, licenseFileOf as bt, runCli as c, runGit as cn, pagesSite as ct, RULES as d, globToRegExp as dn, HOME_PATTERNS as dt, hasFile as en, pinnedGitDeps as et, workspaceProtocol as f, packageFolders as fn, noLocalPaths as ft, namedVersions as g, mainCheck as gt, yamlFaults as h, parseConfig as hn, hasImportMetaMain as ht, formatResult as i, matchesAny as in, scheduleMinute as it, sourceMain as j, mapMarkdown as jt, isSourcePath as k, MAP_RULE as kt, runFix as l, specifiersOf as ln, apiReportScript as lt, workflowParses as m, defaultOptions as mn, REAL_COMPARE as mt, annotations as n, keyLine as nn, repositoryOfRemote as nt, readConfig as o, readJsonc as on, PAGES_WORKFLOWS as ot, GITHUB_YAML as p, workspaceGlobs as pn, noBuildOutput as pt, UNSHIPPED_FILES as q, gateAfterCancel as qt, createContext as r, lineOf as rn, runnerBudget as rt, runChecks as s, replaceLine as sn, pagesCalls as st, USAGE as t, inFolder as tn, pagesAfterRelease as tt, summaryMarkdown as u, globFolders as un, DEFAULT_ALLOWED as ut, versionTitle as v, authorOf as vt, scriptsOf as w, homePackage as wt, trustPolicy as x, mitText as xt, IGNORE_AFTER as y, licenseFile as yt, releaseFiles as z, securityCallers as zt };
12959
13297
 
12960
- //# sourceMappingURL=run-Bn3XU7rh.js.map
13298
+ //# sourceMappingURL=run-D3xtuVA_.js.map