@mark1russell7/conventions 0.42.4 → 0.42.6

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,10 +27,11 @@ 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
+ - `security-one-job`: a job that uses the shared workflow `reusable-security.yml`, with or without 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. With no summary job, the new job gets the id `security-ok`. The pin is the first commit of the template with the action, and Renovate moves it. Another summary job, a second job that needs the scans, another job `security-ok` or an input of more than one line needs a person.
31
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.
32
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.
33
33
  - `trust-policy`: the settings `trustPolicy`, `trustPolicyIgnoreAfter` and `trustPolicyExclude` of `pnpm-workspace.yaml`. The fix makes the file when the repository has none.
34
+ - `security-overrides`: the line of a shared override in `overrides` of `pnpm-workspace.yaml`, with a comment that names its advisories. The fix also removes a line whose parent is not in the lockfile. After the fix, start `pnpm install` and commit the lockfile.
34
35
  - `main-check`: a compare of `process.argv[1]` with the path of the script. The fix writes `import.meta.main` when each Node version of `engines.node` has it (`^22.18`, `>=24.2`). Else it writes a compare of the two real paths, and it adds the imports. It removes the imports that only the old compare used.
35
36
  - `gate-trigger`: a path filter on the pull request trigger of a gate. The fix removes the filter and adds a job `changes` with the same patterns. Each other job needs it and has an `if` on its match. A summary job `<Name> OK` with the action `gate-summary` needs each job. A job with its own `if`, and each job that needs such a job, can be skipped (`allow-skip`). Some workflows need a person, because the fix cannot convert them with certainty. Examples are a trigger in the flow form, an `if` of more than one line, and a job `changes` that already exists.
36
37
 
@@ -45,6 +46,7 @@ The rules come from the invariants audit of 2026-10-26 (strategy item s38). The
45
46
  | `pinned-git-deps` | A dependency from git (`github:`, `git+https:`, `owner/repo`) names a full commit SHA. The rule also examines `overrides`, `resolutions` and `pnpm.overrides`. | coeval `pinned-deps`, `unpublished-dep-pinned`. headroom `non-npm-deps-pinned`, `pinned-github-specifier`. private `github-dep-full-sha`, `github-dep-pinned`. client `general-npm-version`. |
46
47
  | `workspace-protocol` | A dependency on a package of the workspace uses `workspace:`. The rule does not examine peer dependencies. | client `workspace-protocol`, `workspace-deps`. coeval `pinned-deps`. headroom `non-npm-deps-pinned`. crawler `mcp-workspace-dep`. |
47
48
  | `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. | private `trust-policy` (STRATEGY.md, 2026-11-01). |
49
+ | `security-overrides` | A lockfile with a bad path of a shared override has the override of pnpm in `pnpm-workspace.yaml`. The overrides are data (`SHARED_OVERRIDES`). Each one has a parent, a child, a range, the first fixed version of the child and its advisories. A bad path is a version of the child under the parent below the fixed version. The rule reads the lockfile, so an override with another range passes when the lockfile has a fixed version. An override ends when the lockfile has no version of its parent. Then the rule asks for its removal. The first override is `archiver-utils>glob` at `^14.0.3` (GHSA-3g3m-2fjr-6pw4 and GHSA-g3hv-75wg-m249). The rule fails from 2026-11-30. | netdiag #37 and systems #557 (2026-11-15): the same override, written by hand, with no end. A private repository has the bad path and no override. |
48
50
  | `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`. private `new-package-main-index`, `source-package-main`. headroom `source-package-main`. |
49
51
  | `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`. |
50
52
  | `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`. private `cue-preset-strict`, `strict-preset`, `new-package-via-cli`. coeval, crawler, headroom, Vex `package-scaffold`. |
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as runCli } from "./run-CzyBID2h.js";
2
+ import { c as runCli } from "./run-DQnTpiNz.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  // src/cli.ts
5
5
  try {
package/build/index.d.ts CHANGED
@@ -225,9 +225,10 @@ interface SecurityCaller {
225
225
  /** This function gives the jobs of a workflow that use the shared workflow `reusable-security.yml`. */
226
226
  export declare function securityCallers(text: string): SecurityCaller[];
227
227
  /**
228
- * This function puts one job in place of the job of the shared workflow and its summary job. If it cannot, it gives the
229
- * 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
230
- * needs. It gives the inputs of the caller to the action, and `timeout-minutes` to the job.
228
+ * This function puts one job in place of the job of the shared workflow and its summary job, if the file has a summary job.
229
+ * If it cannot, it gives the reason that a person must change the file. The new job has the name `Security OK`, which the
230
+ * ruleset needs. It keeps the id of the summary job, or with no summary job, it gets the id `security-ok`. It gives the
231
+ * inputs of the caller to the action, and `timeout-minutes` to the job.
231
232
  */
232
233
  export declare function withOneJob(text: string, commit?: string): {
233
234
  text: string;
@@ -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/rules/security-one-job.ts","../src/rules/setup-cue.ts","../src/rules/shared-ci.ts","../src/rules/service-run-main.ts","../src/map.ts","../src/rules/home-module.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/coverage-provider.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/private-names.ts","../src/rules/no-local-paths.ts","../src/rules/pack-no-buildinfo.ts","../src/rules/exports-require.ts","../src/rules/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/site-check-in-ci.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/run.ts","../src/pre-push.ts","../src/home-exports.ts","../src/workflow.ts","../src/release-text.ts"],"mappings":";;;;;;;;;;;;;;;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AS,eAAe;;UA4DjC;;WAEN;;WAEA;;WAEA,QAAQ;;;;;;;wBAWH,OAAO,SAAS,eAAe;;wBAyC/B,aAAa,QAAQ;;wBA0BrB,gBAAgB,QAAQ;;;;;wBAyBxB,YAAY,QAAQ;;wBAYpB,UAAU,QAAQ,+BAA+B,iBAAgB;;UAkBhE;WACN;WACA,KAAK,SAAS;WACd,SAAS;WACT,SAAS;;WAET;;;qBAIE;;wBAoEG,OAAO,yBAAyB,IAAI;;qBC5VvC;;UAGI;;WAEN;;;;;WAKA;;WAEA;WACA,KAAK,SAAS;;WAEd;;WAEA,MAAM;;WAEN,YAAY;;;;;;;wBAqMP,QAAQ,SAAS,gBAAgB,IAAI,KAAK;;qBA2E7C;;;;;;;;qBAgCA;;UAgBI;;WAEN;WACA,KAAK,SAAS;;WAEd,MAAM;;;;;;;wBAWD,YAAY,SAAS,aAAa,IAAI,KAAK;;qBCzX9C,cAAc,SAAS;WAA0B;WAA0B;;UC6EvE;WACN;WACA;WACA;;WAEA;WACA;;;UAIM;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;WACA,gBAAgB;;;UAIV;;WAEN;;WAEA;;WAEA;;WAEA;WACA,iBAAiB;WACjB,eAAe;;;wBAgGV,aAAa,cAAc,eAAe;;;;;;;wBAmD1C,WAAW,cAAc,eAAe;;;;;;;;qBChQ3C;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB"}
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/rules/setup-cue.ts","../src/rules/shared-ci.ts","../src/rules/service-run-main.ts","../src/map.ts","../src/rules/home-module.ts","../src/rules/home-package.ts","../src/rules/license-file.ts","../src/rules/coverage-provider.ts","../src/rules/main-check.ts","../src/rules/no-build-output.ts","../src/private-names.ts","../src/rules/no-local-paths.ts","../src/rules/pack-no-buildinfo.ts","../src/rules/exports-require.ts","../src/rules/api-report-script.ts","../src/rules/pages-after-release.ts","../src/rules/pages-site.ts","../src/rules/site-check-in-ci.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/run.ts","../src/pre-push.ts","../src/home-exports.ts","../src/workflow.ts","../src/release-text.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;;;qBAG3C;;UAGI;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA,kBAAkB;;WAElB,SAAS,SAAS,eAAe;;;;;WAKjC;;;;;;;WAOA;EACT,MAAM,SAAS,aAAa,SAAS,UAAU;;;qBAIpC;;wBAGG,aAAa,UAAU,UAAU;;wBAOjC,OAAO,cAAc,gBAAgB;;wB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6EvE;WACN;WACA;WACA;;WAEA;WACA;;;UAIM;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;WACA,gBAAgB;;;UAIV;;WAEN;;WAEA;;WAEA;;WAEA;WACA,iBAAiB;WACjB,eAAe;;;wBAgGV,aAAa,cAAc,eAAe;;;;;;;wBAmD1C,WAAW,cAAc,eAAe;;;;;;;;qBChQ3C;;wBAGG,QAAQ,cAAc,iBAAiB;;;;;;;;wBAavC,iBAAiB,kBAAkB,iBAAiB;;wBA+BpD,OAAO,cAAc;;;;;wBAQrB,aAAa,cAAc,iBAAiB"}
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as unreleasedChangeRule, $n as specifiersOf, $t as messageOf, A as typedFiles, An as ACTIONS_COMMIT, At as lineNameHit, B as roadmapParses, Bn as DEPENDENCY_FIELDS, Bt as apiReportScript, C as versionTitle, Cn as setupCue, Ct as privatePatterns, D as typedScripts, Dn as securityCallers, Dt as firstNameMatch, E as trustPolicy, En as SECURITY_TIMEOUT_MINUTES, Et as PrivateNameListError, F as HOME_TIMEOUT_MS, Fn as gateAfterCancel, Ft as noBuildOutput, G as publishedMinor, Gn as inFolder, Gt as mitText, H as releaseFiles, Hn as cleanPath, Ht as authorOf, I as blockHash, In as readAction, It as REAL_COMPARE, J as NPM_REGISTRY, Jn as matchesAny, Jt as moduleMessage, K as publishedMinorRule, Kn as keyLine, Kt as repositoryIsPublic, L as githubFetch, Ln as readWorkflow, Lt as hasImportMetaMain, M as isSourcePath, Mn as gateTrigger, Mt as nameMatches, N as pathsOf, Nn as prPathFilters, Nt as parsePrivateNames, O as configsOfScript, On as securityOneJob, Ot as isAllowedHit, P as sourceMain, Pn as summaryName, Pt as pathNameHit, Q as unreleasedChange, Qn as runGit, Qt as homePackage, R as sharedDocsRule, Rn as STRICT_OPTIONS, Rt as mainCheck, S as setVersions, Sn as sharedCi, St as privateNamesFile, T as TRAIN_SCOPES, Tn as SECURITY_SCAN_INPUTS, Tt as PRIVATE_NAME_LIST, U as lockedVersions, Un as codePackages, Ut as licenseFile, V as requiredScripts, Vn as RULE_WARN_DAYS, Vt as LICENSE_TEXTS, W as minorOf, Wn as hasFile, Wt as licenseFileOf, X as UNSHIPPED_FILES, Xn as readJsonc, Xt as modulesOf, Y as SHIPPED_FIELDS, Yn as parseJsonc, Yt as moduleUses, Z as npmLookup, Zn as replaceLine, Zt as declaredName, _ as workspaceProtocol, _n as tsconfigTest, _t as PRIVATE_NAMES_FILE_CONFIG, a as listRules, an as MAP_RULE, at as pagesAfterRelease, b as yamlFaults, bn as SHARED_WORKFLOWS, bt as invalidPatternBreaks, c as runCli, cn as mapText, ct as scheduleMinute, d as HOOK_MARKER, dn as npmNames, dt as pagesCalls, en as repoOf, er as defaultOptions, et as pipeFails, f as NO_READ_LINE, fn as readOverlay, ft as pagesSite, g as RULES, gn as hasTests, gt as HOME_PATTERNS, h as prePush, hn as serviceRunMain, ht as DEFAULT_ALLOWED, i as formatResult, in as HOMES, it as siteCheckInCi, j as testsRequired, jn as convertGate, jt as lineNameHits, k as scriptsOf, kn as withOneJob, kt as isCommonUse, l as runFix, ln as mergeHomes, lt as pushMainOnly, m as installHook, mn as runCalls, mt as packNoBuildinfo, n as annotations, nn as signaturesOf, nt as isPinned, o as readConfig, on as findHomes, ot as repositoryOfRemote, p as PRE_PUSH_HOOK, pn as SERVICE_PACKAGE, pt as exportsRequire, q as reachOf, qn as lineOf, qt as homeModule, r as createContext, rn as HOME_EXPORTS, rt as pinnedGitDeps, s as runChecks, sn as mapMarkdown, st as runnerBudget, t as USAGE, tn as reposOf, tr as parseConfig, tt as isGitSpecifier, u as summaryMarkdown, un as npmDrift, ut as PAGES_WORKFLOWS, v as GITHUB_YAML, vn as SHARED_ACTIONS, vt as PRIVATE_NAMES_FILE_VARIABLE, w as IGNORE_AFTER, wn as SECURITY_SCAN_COMMIT, wt as privateTextBreaks, x as namedVersions, xn as callsSharedCi, xt as noLocalPaths, y as workflowParses, yn as SHARED_CI, yt as PRIVATE_PATTERNS_VARIABLE, z as roadmapOfLine, zn as cuePreset, zt as coverageProvider } from "./run-CzyBID2h.js";
1
+ import { $ as unreleasedChangeRule, $n as specifiersOf, $t as messageOf, A as typedFiles, An as ACTIONS_COMMIT, At as lineNameHit, B as roadmapParses, Bn as DEPENDENCY_FIELDS, Bt as apiReportScript, C as versionTitle, Cn as setupCue, Ct as privatePatterns, D as typedScripts, Dn as securityCallers, Dt as firstNameMatch, E as trustPolicy, En as SECURITY_TIMEOUT_MINUTES, Et as PrivateNameListError, F as HOME_TIMEOUT_MS, Fn as gateAfterCancel, Ft as noBuildOutput, G as publishedMinor, Gn as inFolder, Gt as mitText, H as releaseFiles, Hn as cleanPath, Ht as authorOf, I as blockHash, In as readAction, It as REAL_COMPARE, J as NPM_REGISTRY, Jn as matchesAny, Jt as moduleMessage, K as publishedMinorRule, Kn as keyLine, Kt as repositoryIsPublic, L as githubFetch, Ln as readWorkflow, Lt as hasImportMetaMain, M as isSourcePath, Mn as gateTrigger, Mt as nameMatches, N as pathsOf, Nn as prPathFilters, Nt as parsePrivateNames, O as configsOfScript, On as securityOneJob, Ot as isAllowedHit, P as sourceMain, Pn as summaryName, Pt as pathNameHit, Q as unreleasedChange, Qn as runGit, Qt as homePackage, R as sharedDocsRule, Rn as STRICT_OPTIONS, Rt as mainCheck, S as setVersions, Sn as sharedCi, St as privateNamesFile, T as TRAIN_SCOPES, Tn as SECURITY_SCAN_INPUTS, Tt as PRIVATE_NAME_LIST, U as lockedVersions, Un as codePackages, Ut as licenseFile, V as requiredScripts, Vn as RULE_WARN_DAYS, Vt as LICENSE_TEXTS, W as minorOf, Wn as hasFile, Wt as licenseFileOf, X as UNSHIPPED_FILES, Xn as readJsonc, Xt as modulesOf, Y as SHIPPED_FIELDS, Yn as parseJsonc, Yt as moduleUses, Z as npmLookup, Zn as replaceLine, Zt as declaredName, _ as workspaceProtocol, _n as tsconfigTest, _t as PRIVATE_NAMES_FILE_CONFIG, a as listRules, an as MAP_RULE, at as pagesAfterRelease, b as yamlFaults, bn as SHARED_WORKFLOWS, bt as invalidPatternBreaks, c as runCli, cn as mapText, ct as scheduleMinute, d as HOOK_MARKER, dn as npmNames, dt as pagesCalls, en as repoOf, er as defaultOptions, et as pipeFails, f as NO_READ_LINE, fn as readOverlay, ft as pagesSite, g as RULES, gn as hasTests, gt as HOME_PATTERNS, h as prePush, hn as serviceRunMain, ht as DEFAULT_ALLOWED, i as formatResult, in as HOMES, it as siteCheckInCi, j as testsRequired, jn as convertGate, jt as lineNameHits, k as scriptsOf, kn as withOneJob, kt as isCommonUse, l as runFix, ln as mergeHomes, lt as pushMainOnly, m as installHook, mn as runCalls, mt as packNoBuildinfo, n as annotations, nn as signaturesOf, nt as isPinned, o as readConfig, on as findHomes, ot as repositoryOfRemote, p as PRE_PUSH_HOOK, pn as SERVICE_PACKAGE, pt as exportsRequire, q as reachOf, qn as lineOf, qt as homeModule, r as createContext, rn as HOME_EXPORTS, rt as pinnedGitDeps, s as runChecks, sn as mapMarkdown, st as runnerBudget, t as USAGE, tn as reposOf, tr as parseConfig, tt as isGitSpecifier, u as summaryMarkdown, un as npmDrift, ut as PAGES_WORKFLOWS, v as GITHUB_YAML, vn as SHARED_ACTIONS, vt as PRIVATE_NAMES_FILE_VARIABLE, w as IGNORE_AFTER, wn as SECURITY_SCAN_COMMIT, wt as privateTextBreaks, x as namedVersions, xn as callsSharedCi, xt as noLocalPaths, y as workflowParses, yn as SHARED_CI, yt as PRIVATE_PATTERNS_VARIABLE, z as roadmapOfLine, zn as cuePreset, zt as coverageProvider } from "./run-DQnTpiNz.js";
2
2
  import { i as packageFolders, n as globFolders, r as globToRegExp, s as workspaceGlobs } from "./workspace-Cx7p7bWn.js";
3
3
  // src/release-text.ts
4
4
  /**
@@ -1966,6 +1966,8 @@ const SECURITY_SCAN_INPUTS = [
1966
1966
  /** The time limit of the job when the caller gives none: the default of `timeout-minutes` of the shared workflow. */
1967
1967
  const SECURITY_TIMEOUT_MINUTES = 30;
1968
1968
  const REUSABLE = /(^|\/)\.github\/workflows\/reusable-security\.ya?ml(@|$)/;
1969
+ /** The id of the one job when the file has no summary job of the scans. */
1970
+ const ONE_JOB_ID = "security-ok";
1969
1971
  /** The keys that a job of the shared workflow can have, and that the fix can replace. */
1970
1972
  const CALLER_KEYS = /* @__PURE__ */ new Set([
1971
1973
  "uses",
@@ -2011,9 +2013,10 @@ function needsOf(lines, job) {
2011
2013
  return [];
2012
2014
  }
2013
2015
  /**
2014
- * This function puts one job in place of the job of the shared workflow and its summary job. If it cannot, it gives the
2015
- * 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
2016
- * needs. It gives the inputs of the caller to the action, and `timeout-minutes` to the job.
2016
+ * This function puts one job in place of the job of the shared workflow and its summary job, if the file has a summary job.
2017
+ * If it cannot, it gives the reason that a person must change the file. The new job has the name `Security OK`, which the
2018
+ * ruleset needs. It keeps the id of the summary job, or with no summary job, it gets the id `security-ok`. It gives the
2019
+ * inputs of the caller to the action, and `timeout-minutes` to the job.
2017
2020
  */
2018
2021
  function withOneJob(text, commit = SECURITY_SCAN_COMMIT) {
2019
2022
  const lines = workflowLines(text);
@@ -2021,14 +2024,20 @@ function withOneJob(text, commit = SECURITY_SCAN_COMMIT) {
2021
2024
  if (callers.length !== 1) return { reason: `the file has ${String(callers.length)} jobs that use reusable-security.yml, and the fix changes only one` };
2022
2025
  const caller = callers[0];
2023
2026
  if (caller === void 0) return { reason: "no job uses reusable-security.yml" };
2024
- const dependents = childKeys(lines, lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0)).filter((job) => needsOf(lines, job).includes(caller.id));
2025
- if (dependents.length !== 1) return { reason: `${String(dependents.length)} jobs need the job ${caller.id}, and the fix needs exactly one summary job` };
2027
+ const jobs = lines.findIndex((line) => indentOf$1(line) === 0 && keyValue(line, "jobs") !== void 0);
2028
+ const dependents = childKeys(lines, jobs).filter((job) => needsOf(lines, job).includes(caller.id));
2029
+ if (dependents.length > 1) return { reason: `${String(dependents.length)} jobs need the job ${caller.id}, and the fix replaces one summary job or none` };
2026
2030
  const summary = dependents[0];
2027
- if (summary === void 0) return { reason: "no summary job" };
2028
- const summaryNeeds = needsOf(lines, summary);
2029
- if (summaryNeeds.length !== 1) return { reason: `the summary job needs ${summaryNeeds.join(", ")}, and the fix replaces only a summary job of the scans` };
2030
- const summaryName = childKeys(lines, summary).map((at) => keyValue(lines[at] ?? "", "name")).find((value) => value !== void 0);
2031
- if (summaryName !== "Security OK") return { reason: `the summary job has the name ${summaryName ?? "(none)"}, not Security OK, which the ruleset needs` };
2031
+ let id = ONE_JOB_ID;
2032
+ if (summary === void 0) {
2033
+ if (childKeys(lines, jobs).some((job) => job !== caller.line && idOf(lines[job] ?? "") === ONE_JOB_ID)) return { reason: `the file has a job ${ONE_JOB_ID} that does not need the job ${caller.id}, and the fix does not merge two jobs` };
2034
+ } else {
2035
+ const summaryNeeds = needsOf(lines, summary);
2036
+ if (summaryNeeds.length !== 1) return { reason: `the summary job needs ${summaryNeeds.join(", ")}, and the fix replaces only a summary job of the scans` };
2037
+ const summaryName = childKeys(lines, summary).map((at) => keyValue(lines[at] ?? "", "name")).find((value) => value !== void 0);
2038
+ if (summaryName !== "Security OK") return { reason: `the summary job has the name ${summaryName ?? "(none)"}, not Security OK, which the ruleset needs` };
2039
+ id = idOf(lines[summary] ?? "");
2040
+ }
2032
2041
  const inputs = [];
2033
2042
  let timeout = String(30);
2034
2043
  for (const at of childKeys(lines, caller.line)) {
@@ -2049,7 +2058,7 @@ function withOneJob(text, commit = SECURITY_SCAN_COMMIT) {
2049
2058
  const withLines = childKeys(lines, caller.line).find((at) => idOf(lines[at] ?? "") === "with");
2050
2059
  const inputLines = withLines === void 0 ? [] : childKeys(lines, withLines).filter((at) => inputs.includes(idOf(lines[at] ?? ""))).map((at) => `${pad} ${(raw[at] ?? "").trim()}`);
2051
2060
  const job = [
2052
- `${pad}${idOf(lines[summary] ?? "")}:`,
2061
+ `${pad}${id}:`,
2053
2062
  `${pad} name: Security OK`,
2054
2063
  `${pad} runs-on: ubuntu-latest`,
2055
2064
  `${pad} timeout-minutes: ${timeout}`,
@@ -2066,21 +2075,23 @@ function withOneJob(text, commit = SECURITY_SCAN_COMMIT) {
2066
2075
  remove: trimmedEnd(lines, caller.line) - caller.line,
2067
2076
  insert: job
2068
2077
  }];
2069
- const blank = (at) => at >= 0 && at < raw.length - 1 && (raw[at] ?? "").trim() === "";
2070
- const start = blank(summary - 1) ? summary - 1 : summary;
2071
- const end = trimmedEnd(lines, summary) + (start === summary && blank(trimmedEnd(lines, summary)) ? 1 : 0);
2072
- splices.push({
2073
- at: start,
2074
- remove: end - start,
2075
- insert: []
2076
- });
2078
+ if (summary !== void 0) {
2079
+ const blank = (at) => at >= 0 && at < raw.length - 1 && (raw[at] ?? "").trim() === "";
2080
+ const start = blank(summary - 1) ? summary - 1 : summary;
2081
+ const end = trimmedEnd(lines, summary) + (start === summary && blank(trimmedEnd(lines, summary)) ? 1 : 0);
2082
+ splices.push({
2083
+ at: start,
2084
+ remove: end - start,
2085
+ insert: []
2086
+ });
2087
+ }
2077
2088
  return { text: applySplices(text, splices) };
2078
2089
  }
2079
2090
  const securityOneJob = {
2080
2091
  id: "security-one-job",
2081
2092
  title: "The security scans run in one job: the action `security-scan`, not the shared workflow `reusable-security.yml`.",
2082
2093
  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.",
2083
- 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.",
2094
+ fix: "Replace the job that uses reusable-security.yml and its summary job, if it has one, 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.",
2084
2095
  sources: [
2085
2096
  {
2086
2097
  repo: "template",
@@ -15148,7 +15159,7 @@ function isPinned(spec, fullSha) {
15148
15159
  return path !== void 0 && path.split(/[/.]/).some((part) => sha.test(part));
15149
15160
  }
15150
15161
  /** This function gives the specifiers of the fields of overrides, also the field `overrides` of `pnpm`. */
15151
- function overridesOf(manifest) {
15162
+ function overridesOf$1(manifest) {
15152
15163
  const out = [];
15153
15164
  for (const field of OVERRIDE_FIELDS) for (const [name, spec] of specifiersOf(manifest, field)) out.push([
15154
15165
  field,
@@ -15220,7 +15231,7 @@ const pinnedGitDeps = {
15220
15231
  name,
15221
15232
  spec
15222
15233
  ]);
15223
- found.push(...overridesOf(info.manifest));
15234
+ found.push(...overridesOf$1(info.manifest));
15224
15235
  for (const [field, name, spec] of found) {
15225
15236
  if (!isGitSpecifier(spec) || isPinned(spec, fullSha)) continue;
15226
15237
  const line = keyLine(info.text, field, name);
@@ -17185,7 +17196,7 @@ const typedScripts = {
17185
17196
  * The rule `trust-policy`: a pnpm repository sets `trustPolicy: no-downgrade` in `pnpm-workspace.yaml`. It checks each
17186
17197
  * version for 7 days after its publish (`trustPolicyIgnoreAfter`). It excludes the scopes of the release train.
17187
17198
  */
17188
- const WORKSPACE = "pnpm-workspace.yaml";
17199
+ const WORKSPACE$1 = "pnpm-workspace.yaml";
17189
17200
  /** The scopes that the release train updates. The train checks the provenance of their versions itself. */
17190
17201
  const TRAIN_SCOPES = ["@mark1russell7/*", "@procedures/*"];
17191
17202
  /** 7 days, in minutes. */
@@ -17271,11 +17282,11 @@ const trustPolicy = {
17271
17282
  if (!hasFile(context.root, "pnpm-lock.yaml")) return { skipped: "the repository has no pnpm-lock.yaml" };
17272
17283
  const exclude = Array.isArray(options["exclude"]) ? options["exclude"] : TRAIN_SCOPES;
17273
17284
  const ignoreAfter = typeof options["ignoreAfter"] === "number" ? options["ignoreAfter"] : IGNORE_AFTER;
17274
- const exists = hasFile(context.root, WORKSPACE);
17275
- const text = exists ? readFileSync(join(context.root, WORKSPACE), "utf8") : "";
17285
+ const exists = hasFile(context.root, WORKSPACE$1);
17286
+ const text = exists ? readFileSync(join(context.root, WORKSPACE$1), "utf8") : "";
17276
17287
  const lines = text.split(/\r?\n/);
17277
17288
  const edit = (after) => after === text ? [] : [{
17278
- file: WORKSPACE,
17289
+ file: WORKSPACE$1,
17279
17290
  before: text,
17280
17291
  after
17281
17292
  }];
@@ -17283,9 +17294,9 @@ const trustPolicy = {
17283
17294
  const breaks = [];
17284
17295
  const policy = valueOf(lines, "trustPolicy");
17285
17296
  if (policy?.value !== "no-downgrade") breaks.push({
17286
- file: WORKSPACE,
17297
+ file: WORKSPACE$1,
17287
17298
  ...at(policy?.index),
17288
- message: policy === void 0 ? `${exists ? WORKSPACE : "The repository"} does not set trustPolicy.` : `trustPolicy is "${policy.value}", not "no-downgrade".`,
17299
+ message: policy === void 0 ? `${exists ? WORKSPACE$1 : "The repository"} does not set trustPolicy.` : `trustPolicy is "${policy.value}", not "no-downgrade".`,
17289
17300
  edits: edit(policy === void 0 ? insert(text, -1, [...POLICY_COMMENT, "trustPolicy: no-downgrade"]) : setValue(text, policy.index, "trustPolicy", "no-downgrade"))
17290
17301
  });
17291
17302
  const ignore = valueOf(lines, "trustPolicyIgnoreAfter");
@@ -17293,9 +17304,9 @@ const trustPolicy = {
17293
17304
  if (minutes === void 0 || !Number.isInteger(minutes) || minutes < ignoreAfter) {
17294
17305
  const after = ignore !== void 0 ? setValue(text, ignore.index, "trustPolicyIgnoreAfter", String(ignoreAfter)) : policy !== void 0 ? insert(text, policy.index, [...IGNORE_COMMENT, `trustPolicyIgnoreAfter: ${String(ignoreAfter)}`]) : text;
17295
17306
  breaks.push({
17296
- file: WORKSPACE,
17307
+ file: WORKSPACE$1,
17297
17308
  ...at(ignore?.index),
17298
- message: ignore === void 0 ? `${WORKSPACE} does not set trustPolicyIgnoreAfter, so pnpm also refuses old versions that have less evidence for other reasons.` : `trustPolicyIgnoreAfter is ${ignore.value}, not a whole number of at least ${String(ignoreAfter)} minutes.`,
17309
+ message: ignore === void 0 ? `${WORKSPACE$1} does not set trustPolicyIgnoreAfter, so pnpm also refuses old versions that have less evidence for other reasons.` : `trustPolicyIgnoreAfter is ${ignore.value}, not a whole number of at least ${String(ignoreAfter)} minutes.`,
17299
17310
  edits: edit(after)
17300
17311
  });
17301
17312
  }
@@ -17315,7 +17326,7 @@ const trustPolicy = {
17315
17326
  ...items
17316
17327
  ]);
17317
17328
  breaks.push({
17318
- file: WORKSPACE,
17329
+ file: WORKSPACE$1,
17319
17330
  ...at(start >= 0 ? start : void 0),
17320
17331
  message: `trustPolicyExclude does not have ${missing.join(", ")}.`,
17321
17332
  edits: edit(after)
@@ -17324,6 +17335,200 @@ const trustPolicy = {
17324
17335
  return breaks;
17325
17336
  }
17326
17337
  };
17338
+ // src/rules/security-overrides.ts
17339
+ /**
17340
+ * The rule `security-overrides`: a repository whose lockfile has a bad path of `SHARED_OVERRIDES` sets the override of
17341
+ * pnpm for it. When the lockfile has no version of the parent of an override, the override ends, and the rule removes it.
17342
+ */
17343
+ const WORKSPACE = "pnpm-workspace.yaml";
17344
+ const LOCKFILE = "pnpm-lock.yaml";
17345
+ /**
17346
+ * The shared overrides. The package glob 10 under archiver-utils 5 has GHSA-3g3m-2fjr-6pw4. Its minimatch 9 has
17347
+ * GHSA-g3hv-75wg-m249. The version glob 14.0.2 fixes glob. The version 14.0.3 is the first that asks for a fixed
17348
+ * minimatch (`^11.0.2`).
17349
+ */
17350
+ const SHARED_OVERRIDES = [{
17351
+ parent: "archiver-utils",
17352
+ child: "glob",
17353
+ range: "^14.0.3",
17354
+ fixed: "14.0.3",
17355
+ advisories: ["GHSA-3g3m-2fjr-6pw4", "GHSA-g3hv-75wg-m249"],
17356
+ end: "archiver 8 has no archiver-utils, so the override ends when testcontainers accepts archiver 8"
17357
+ }];
17358
+ /** This function gives the selector of an override: `parent>child`. */
17359
+ const selectorOf = (override) => `${override.parent}>${override.child}`;
17360
+ /** This function removes the quotes around a key or a value of YAML. */
17361
+ const unquoted = (text) => text.trim().replace(/^(['"])(.*)\1$/, "$2");
17362
+ /** This function gives the parts of a release version, or undefined for other text. It cuts the peer suffix `(...)`. */
17363
+ function partsOf(version) {
17364
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:$|\()/.exec(version.trim());
17365
+ return match === null ? void 0 : [
17366
+ Number(match[1]),
17367
+ Number(match[2]),
17368
+ Number(match[3])
17369
+ ];
17370
+ }
17371
+ /** This function tells if the release version `version` is below the version `fixed`. It gives false for other text. */
17372
+ function isBelow(version, fixed) {
17373
+ const have = partsOf(version);
17374
+ const want = partsOf(fixed);
17375
+ if (have === void 0 || want === void 0) return false;
17376
+ for (let index = 0; index < 3; index++) if ((have[index] ?? 0) !== (want[index] ?? 0)) return (have[index] ?? 0) < (want[index] ?? 0);
17377
+ return false;
17378
+ }
17379
+ /**
17380
+ * This function reads the `snapshots` of each document of the text of a `pnpm-lock.yaml` file. It gives the count of
17381
+ * the snapshots of `parent`, and the version of `child` in the dependencies of each of them.
17382
+ */
17383
+ function childVersions(text, parent, child) {
17384
+ const versions = [];
17385
+ let parents = 0;
17386
+ let inside = false;
17387
+ let inParent = false;
17388
+ let inDependencies = false;
17389
+ for (const line of text.split(/\r?\n/)) {
17390
+ if (/^\S/.test(line)) {
17391
+ inside = line.trimEnd() === "snapshots:";
17392
+ inParent = false;
17393
+ continue;
17394
+ }
17395
+ if (!inside) continue;
17396
+ const entry = yamlEntry(line);
17397
+ if (entry === void 0) continue;
17398
+ const key = unquoted(entry.key);
17399
+ if (entry.indent === 2) {
17400
+ inParent = key.startsWith(`${parent}@`) && /^\d/.test(key.slice(parent.length + 1));
17401
+ inDependencies = false;
17402
+ if (inParent) parents++;
17403
+ } else if (entry.indent === 4) inDependencies = key === "dependencies" || key === "optionalDependencies";
17404
+ else if (entry.indent === 6 && inParent && inDependencies && key === child) versions.push(unquoted(entry.value));
17405
+ }
17406
+ return {
17407
+ parents,
17408
+ versions
17409
+ };
17410
+ }
17411
+ /** This function gives the block `overrides` of the lines of `pnpm-workspace.yaml`, or undefined when it has none. */
17412
+ function overridesOf(lines) {
17413
+ const key = lines.findIndex((line) => /^overrides:(\s|$)/.test(line));
17414
+ if (key < 0) return void 0;
17415
+ const rest = (lines[key] ?? "").slice(10).replace(/\s+#.*$/, "").trim();
17416
+ const entries = /* @__PURE__ */ new Map();
17417
+ let last = key;
17418
+ for (let index = key + 1; index < lines.length; index++) {
17419
+ const line = lines[index] ?? "";
17420
+ if (line.trim() === "" || line.trimStart().startsWith("#")) continue;
17421
+ if (/^\S/.test(line)) break;
17422
+ const entry = yamlEntry(line);
17423
+ if (entry !== void 0) entries.set(unquoted(entry.key), {
17424
+ index,
17425
+ value: unquoted(entry.value.replace(/\s+#.*$/, ""))
17426
+ });
17427
+ last = index;
17428
+ }
17429
+ return {
17430
+ key,
17431
+ last,
17432
+ inline: rest !== "",
17433
+ entries
17434
+ };
17435
+ }
17436
+ /** This function gives the comment and the line of an override, with the indent `indent`. */
17437
+ const overrideLines = (override, indent) => [`${indent}# ${override.advisories.join(" and ")}. The rule security-overrides of conventions removes this line at its end.`, `${indent}"${selectorOf(override)}": "${override.range}"`];
17438
+ /** This function tells if a line is the comment that `overrideLines` writes. */
17439
+ const isOwnComment = (line) => line.trimStart().startsWith("#") && line.includes("The rule security-overrides of conventions");
17440
+ const securityOverrides = {
17441
+ id: "security-overrides",
17442
+ title: "A lockfile with a bad path of a shared override has the override of pnpm, and an override with no parent in the lockfile goes.",
17443
+ reason: "An advisory deep in the tree, for example glob 10 under archiver-utils, waits for each package on its path to release. The override of pnpm closes it in one line. Each repository wrote that line by hand, and no line said when it ends. A data list keeps one range for each repository, and the lockfile tells when the override ends.",
17444
+ fix: "Add the override of `SHARED_OVERRIDES` to `overrides` in `pnpm-workspace.yaml`, then start `pnpm install` and commit the lockfile. Remove an override whose parent is not in the lockfile. `conventions fix` edits `pnpm-workspace.yaml`.",
17445
+ sources: [
17446
+ {
17447
+ repo: "netdiag",
17448
+ rule: "security-overrides",
17449
+ doc: "netdiag #37 (2026-11-15): the override archiver-utils>glob for GHSA-3g3m-2fjr-6pw4 and GHSA-g3hv-75wg-m249"
17450
+ },
17451
+ {
17452
+ repo: "systems",
17453
+ rule: "security-overrides",
17454
+ doc: "systems #557 (2026-11-15): the same override, written by hand"
17455
+ },
17456
+ {
17457
+ repo: "private",
17458
+ rule: "security-overrides",
17459
+ doc: "a private repository (2026-11-16): glob 10.5.0 under archiver-utils 5.0.2 in its lockfile, with no override"
17460
+ }
17461
+ ],
17462
+ options: {},
17463
+ failsFrom: "2026-11-30",
17464
+ check(context) {
17465
+ if (!hasFile(context.root, LOCKFILE)) return { skipped: "the repository has no pnpm-lock.yaml" };
17466
+ const lock = readFileSync(join(context.root, LOCKFILE), "utf8");
17467
+ const format = /^lockfileVersion:\s*['"]?(\d+)/m.exec(lock);
17468
+ if (format === null || Number(format[1]) < 9) return { skipped: "pnpm-lock.yaml is not a lockfile of version 9 or later" };
17469
+ const text = hasFile(context.root, WORKSPACE) ? readFileSync(join(context.root, WORKSPACE), "utf8") : "";
17470
+ const eol = text.includes("\r\n") ? "\r\n" : "\n";
17471
+ const lines = text.split(/\r?\n/);
17472
+ const block = overridesOf(lines);
17473
+ const breaks = [];
17474
+ for (const override of SHARED_OVERRIDES) {
17475
+ const selector = selectorOf(override);
17476
+ const found = childVersions(lock, override.parent, override.child);
17477
+ const bad = found.versions.filter((version) => isBelow(version, override.fixed));
17478
+ const own = block?.entries.get(selector);
17479
+ if (bad.length > 0 && own === void 0) {
17480
+ const message = `${LOCKFILE} has ${override.child} ${[...new Set(bad)].join(", ")} under ${override.parent} (${override.advisories.join(", ")}). Add the override "${selector}": "${override.range}" to ${WORKSPACE}, then start pnpm install.`;
17481
+ if (block?.inline === true) {
17482
+ breaks.push({
17483
+ file: WORKSPACE,
17484
+ line: block.key + 1,
17485
+ message: `${message} The key overrides has an inline value, so a person writes the line.`
17486
+ });
17487
+ continue;
17488
+ }
17489
+ const after = [...lines];
17490
+ if (block === void 0) {
17491
+ while (after.length > 0 && after[after.length - 1] === "") after.pop();
17492
+ after.push(...after.length > 0 ? [""] : [], "overrides:", ...overrideLines(override, " "), "");
17493
+ } else {
17494
+ const first = [...block.entries.values()][0];
17495
+ const indent = first === void 0 ? " " : (lines[first.index] ?? "").slice(0, (lines[first.index] ?? "").length - (lines[first.index] ?? "").trimStart().length);
17496
+ after.splice(block.last + 1, 0, ...overrideLines(override, indent));
17497
+ }
17498
+ breaks.push({
17499
+ file: WORKSPACE,
17500
+ ...block === void 0 ? {} : { line: block.key + 1 },
17501
+ message,
17502
+ edits: [{
17503
+ file: WORKSPACE,
17504
+ before: text,
17505
+ after: after.join(eol)
17506
+ }]
17507
+ });
17508
+ } else if (found.parents === 0 && own !== void 0 && block !== void 0) {
17509
+ const after = [...lines];
17510
+ let start = own.index;
17511
+ while (start > 0 && isOwnComment(after[start - 1] ?? "")) start--;
17512
+ after.splice(start, own.index - start + 1);
17513
+ if (block.entries.size === 1 && !block.inline) {
17514
+ after.splice(block.key, 1);
17515
+ if (block.key > 0 && after[block.key - 1] === "" && (after[block.key] ?? "") === "") after.splice(block.key, 1);
17516
+ }
17517
+ breaks.push({
17518
+ file: WORKSPACE,
17519
+ line: own.index + 1,
17520
+ message: `The override "${selector}" ends: ${LOCKFILE} has no ${override.parent}. Remove it (${override.end}).`,
17521
+ edits: [{
17522
+ file: WORKSPACE,
17523
+ before: text,
17524
+ after: after.join(eol)
17525
+ }]
17526
+ });
17527
+ }
17528
+ }
17529
+ return breaks;
17530
+ }
17531
+ };
17327
17532
  // src/rules/version-title.ts
17328
17533
  /**
17329
17534
  * The rule `version-title`: a merge whose title names a version sets that version in a `package.json`.
@@ -17630,6 +17835,7 @@ const RULES = [
17630
17835
  pinnedGitDeps,
17631
17836
  workspaceProtocol,
17632
17837
  trustPolicy,
17838
+ securityOverrides,
17633
17839
  sourceMain,
17634
17840
  serviceRunMain,
17635
17841
  tsconfigTest,
@@ -18566,4 +18772,4 @@ function runHook(args, io) {
18566
18772
  }
18567
18773
  export { unreleasedChangeRule as $, specifiersOf as $n, messageOf as $t, typedFiles as A, ACTIONS_COMMIT as An, lineNameHit as At, roadmapParses as B, DEPENDENCY_FIELDS as Bn, apiReportScript as Bt, versionTitle as C, setupCue as Cn, privatePatterns as Ct, typedScripts as D, securityCallers as Dn, firstNameMatch as Dt, trustPolicy as E, SECURITY_TIMEOUT_MINUTES as En, PrivateNameListError as Et, HOME_TIMEOUT_MS as F, gateAfterCancel as Fn, noBuildOutput as Ft, publishedMinor as G, inFolder as Gn, mitText as Gt, releaseFiles as H, cleanPath as Hn, authorOf as Ht, blockHash as I, readAction as In, REAL_COMPARE as It, NPM_REGISTRY as J, matchesAny as Jn, moduleMessage as Jt, publishedMinorRule as K, keyLine as Kn, repositoryIsPublic as Kt, githubFetch as L, readWorkflow as Ln, hasImportMetaMain as Lt, isSourcePath as M, gateTrigger as Mn, nameMatches as Mt, pathsOf as N, prPathFilters as Nn, parsePrivateNames as Nt, configsOfScript as O, securityOneJob as On, isAllowedHit as Ot, sourceMain as P, summaryName as Pn, pathNameHit as Pt, unreleasedChange as Q, runGit as Qn, homePackage as Qt, sharedDocsRule as R, STRICT_OPTIONS as Rn, mainCheck as Rt, setVersions as S, sharedCi as Sn, privateNamesFile as St, TRAIN_SCOPES as T, SECURITY_SCAN_INPUTS as Tn, PRIVATE_NAME_LIST as Tt, lockedVersions as U, codePackages as Un, licenseFile as Ut, requiredScripts as V, RULE_WARN_DAYS as Vn, LICENSE_TEXTS as Vt, minorOf as W, hasFile as Wn, licenseFileOf as Wt, UNSHIPPED_FILES as X, readJsonc as Xn, modulesOf as Xt, SHIPPED_FIELDS as Y, parseJsonc as Yn, moduleUses as Yt, npmLookup as Z, replaceLine as Zn, declaredName as Zt, workspaceProtocol as _, tsconfigTest as _n, PRIVATE_NAMES_FILE_CONFIG as _t, listRules as a, MAP_RULE as an, pagesAfterRelease as at, yamlFaults as b, SHARED_WORKFLOWS as bn, invalidPatternBreaks as bt, runCli as c, mapText as cn, scheduleMinute as ct, HOOK_MARKER as d, npmNames as dn, pagesCalls as dt, repoOf as en, defaultOptions as er, pipeFails as et, NO_READ_LINE as f, readOverlay as fn, pagesSite as ft, RULES as g, hasTests as gn, HOME_PATTERNS as gt, prePush as h, serviceRunMain as hn, DEFAULT_ALLOWED as ht, formatResult as i, HOMES as in, siteCheckInCi as it, testsRequired as j, convertGate as jn, lineNameHits as jt, scriptsOf as k, withOneJob as kn, isCommonUse as kt, runFix as l, mergeHomes as ln, pushMainOnly as lt, installHook as m, runCalls as mn, packNoBuildinfo as mt, annotations as n, signaturesOf as nn, isPinned as nt, readConfig as o, findHomes as on, repositoryOfRemote as ot, PRE_PUSH_HOOK as p, SERVICE_PACKAGE as pn, exportsRequire as pt, reachOf as q, lineOf as qn, homeModule as qt, createContext as r, HOME_EXPORTS as rn, pinnedGitDeps as rt, runChecks as s, mapMarkdown as sn, runnerBudget as st, USAGE as t, reposOf as tn, parseConfig as tr, isGitSpecifier as tt, summaryMarkdown as u, npmDrift as un, PAGES_WORKFLOWS as ut, GITHUB_YAML as v, SHARED_ACTIONS as vn, PRIVATE_NAMES_FILE_VARIABLE as vt, IGNORE_AFTER as w, SECURITY_SCAN_COMMIT as wn, privateTextBreaks as wt, namedVersions as x, callsSharedCi as xn, noLocalPaths as xt, workflowParses as y, SHARED_CI as yn, PRIVATE_PATTERNS_VARIABLE as yt, roadmapOfLine as z, cuePreset as zn, coverageProvider as zt };
18568
18774
 
18569
- //# sourceMappingURL=run-CzyBID2h.js.map
18775
+ //# sourceMappingURL=run-DQnTpiNz.js.map