workspace-conformance 1.6.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2,6 +2,14 @@ import { ConfigFileOptions, LayoutConfig, RankSkipOptions, Section } from "@exad
2
2
  import { IViolation } from "dependency-cruiser";
3
3
  import { z } from "zod";
4
4
  import { CompilerOptions } from "ts-morph";
5
+ //#region src/errors.d.ts
6
+ /**
7
+ * A problem with how the tool was used or configured rather than a finding about the workspace: an unknown or disabled check, a missing or invalid section, a layout that cannot be resolved, a repository that is not a git checkout. The command line reports it and exits 2.
8
+ */
9
+ export declare class ConformanceError extends Error {
10
+ constructor(message: string, options?: ErrorOptions);
11
+ }
12
+ //#endregion
5
13
  //#region src/github.d.ts
6
14
  /**
7
15
  * A repository on GitHub.
@@ -39,7 +47,13 @@ interface BranchRules {
39
47
  }[];
40
48
  }
41
49
  /**
42
- * What the settings checks need from GitHub, so a test or another host can supply it without a network. The real implementation is {@link createGitHubClient}. Both methods reject when the repository or branch cannot be read.
50
+ * GitHub's refusal to read a branch's rules because the repository's plan does not offer rulesets, as for a private repository on a plan without them: no ruleset applies to its branches, so a check that requires one cannot be met. The message is GitHub's own. A {@link GitHubClient} rejects `branchRules` with it, and with any other error for every other refusal.
51
+ */
52
+ export declare class RulesetsUnavailableError extends ConformanceError {
53
+ constructor(message: string, options?: ErrorOptions);
54
+ }
55
+ /**
56
+ * What the settings checks need from GitHub, so a test or another host can supply it without a network. The real implementation is {@link createGitHubClient}. Both methods reject when the repository or branch cannot be read, `branchRules` with {@link RulesetsUnavailableError} when the repository's plan has no rulesets.
43
57
  */
44
58
  interface GitHubClient {
45
59
  readonly repository: (slug: RepositorySlug) => Promise<RepositorySettings>;
@@ -95,14 +109,18 @@ interface Violation {
95
109
  */
96
110
  interface CheckContext<Options> {
97
111
  /**
98
- * The directory the checks run in; every path option is relative to it.
112
+ * The directory the checks run in, absolute or relative to the working directory of the process; every path option is relative to it.
99
113
  */
100
114
  readonly cwd: string;
101
115
  readonly options: Options;
102
116
  /**
103
- * How config files that a check evaluates itself (the commitlint and release configs of `commit-types`) are loaded. Only `alias` and `fsCache` apply to evaluating a file; `trust` and `merge` are for `extends`. No transpile cache is written when omitted.
117
+ * How config files that a check evaluates itself (the commitlint and release configs of `commit-types`) are loaded. Only `alias` and `fsCache` apply to evaluating a file; `trust` and the per-shape `unified` and `standalone` layer options are for `extends`. No transpile cache is written when omitted.
104
118
  */
105
119
  readonly configFiles?: ConfigFileOptions;
120
+ /**
121
+ * Receives what the check reports beside its violations: a line about what it did, such as how many files it linted, so a clean result can be told apart from one that looked at little. Nothing is reported when omitted.
122
+ */
123
+ readonly note?: (text: string) => void;
106
124
  }
107
125
  /**
108
126
  * What a check that reads the workspace layout receives.
@@ -524,6 +542,15 @@ interface CommitTypesOptions {
524
542
  */
525
543
  readonly release?: string;
526
544
  }
545
+ /**
546
+ * Options of the `engines-floor` check: the `engines.node` range of a package is a subset of the `engines.node` range of each of its installed dependencies.
547
+ */
548
+ interface EnginesFloorOptions {
549
+ /**
550
+ * Globs of the package directories to judge, in the form of the `packages` list of `pnpm-workspace.yaml` (a `!` pattern excludes), relative to the directory the checks run in; `.` is the root package. The root package and the `packages` of `pnpm-workspace.yaml`, when that file exists, when omitted.
551
+ */
552
+ readonly packages?: readonly string[];
553
+ }
527
554
  /**
528
555
  * Options of the `dockerfile-package-manager` check: a package manager version pinned in a Dockerfile is the one `packageManager` names.
529
556
  */
@@ -790,6 +817,7 @@ interface CheckOptionsByName {
790
817
  readonly "instruction-symlinks": InstructionSymlinksOptions;
791
818
  readonly "single-storybook": SingleStorybookOptions;
792
819
  readonly "commit-types": CommitTypesOptions;
820
+ readonly "engines-floor": EnginesFloorOptions;
793
821
  readonly "dockerfile-package-manager": DockerfilePackageManagerOptions;
794
822
  readonly "migrations-directory": MigrationsDirectoryOptions;
795
823
  readonly eslint: EslintOptions;
@@ -872,6 +900,18 @@ export declare const derivedTypes: CheckFunction<DerivedTypesOptions>;
872
900
  */
873
901
  export declare const dockerfilePackageManager: CheckFunction<DockerfilePackageManagerOptions>;
874
902
  //#endregion
903
+ //#region src/checks/engines-floor.d.ts
904
+ /**
905
+ * The `engines.node` range of each package is a subset of the `engines.node` range of each dependency and optional dependency it lists, and of each peer dependency whose range admits a single version, as installed in `node_modules`, so the package admits no Node version that something it needs at run time rejects. A package that declares no range admits every version, so it is reported for each dependency that declares one. A dependency that declares no range constrains nothing and is ignored.
906
+ *
907
+ * The comparison is `semver.subset(package, dependency)`: every version the package's range admits satisfies the dependency's range. A floor alone is not enough, because a range of several lines (`^20.19.0 || ^22.13.0 || >=24`) also rejects the versions between them, which `>=20.19.0` admits. semver compares a range of several comparator sets set by set, so each set of the package's range must lie within one set of the dependency's; a set that only two adjacent dependency sets cover together (`>=22` against `^22.0.0 || >=23`) is reported, and splitting it the same way (`^22.0.0 || >=23`) satisfies the check.
908
+ *
909
+ * A peer dependency is judged only when its range admits a single version (`1.2.3` or `=1.2.3`), and then by the copy installed, which must be that version. The consumer chooses which admitted version to install, so the package's range holds when each Node version in it is accepted by some admitted version; one installed copy that rejects a Node version does not show that every admitted version does, and the others are not on disk.
910
+ *
911
+ * A dependency that is not installed fails the run: its range cannot be read, and passing it unjudged would read as a pass. An optional dependency and a peer dependency marked optional in `peerDependenciesMeta` may be absent and are then skipped.
912
+ */
913
+ export declare const enginesFloor: CheckFunction<EnginesFloorOptions>;
914
+ //#endregion
875
915
  //#region src/checks/eslint.d.ts
876
916
  /**
877
917
  * Proves the repository's own ESLint is applied, which no check that runs inside ESLint can notice: a config that dropped a shared preset, switched its rules off or narrowed `ignores` until nothing is linted still passes its own lint.
@@ -888,7 +928,7 @@ export declare const eslint: CheckFunction<EslintOptions>;
888
928
  */
889
929
  interface DiscoveredPackage {
890
930
  /**
891
- * Relative to the workspace root, with `/` separators.
931
+ * Relative to the workspace root, with `/` separators; {@link ROOT_PACKAGE_DIR} for the package at the root.
892
932
  */
893
933
  readonly dir: string;
894
934
  /**
@@ -916,7 +956,7 @@ interface WorkspacePackage extends DiscoveredPackage {
916
956
  /**
917
957
  * Classify discovered packages by the layout: group, rank and slice. Pure.
918
958
  *
919
- * A package no group owns is a configuration error, because every check would otherwise skip it without saying so. Nested package directories are one too: the checks attribute a file to the package whose directory is its prefix, which is ambiguous for a package inside another. A `namePrefix` slice takes the longest slice value that a `segment` group produced and that prefixes the package's unscoped name; a package without a name has no such slice.
959
+ * A package no group owns is a configuration error, because every check would otherwise skip it without saying so. Nested package directories are one too: the checks attribute a file to the package whose directory is its prefix, which is ambiguous for a package inside another. The root package holds every other directory, so it is a package only in a single-package repository. A `namePrefix` slice takes the longest slice value that a `segment` group produced and that prefixes the package's unscoped name; a package without a name has no such slice.
920
960
  */
921
961
  export declare function classifyPackages(discovered: readonly DiscoveredPackage[], layout: LayoutConfig): readonly WorkspacePackage[];
922
962
  //#endregion
@@ -938,7 +978,7 @@ interface ImportRule {
938
978
  };
939
979
  }
940
980
  /**
941
- * A regular expression, as source text, matching every file inside any of the packages. The trailing `/` keeps `packages/a` from matching `packages/ab`.
981
+ * A regular expression, as source text, matching every file inside any of the packages: the path starts with one's {@link packagePathPrefix}.
942
982
  */
943
983
  export declare function packagesPattern(packages: readonly WorkspacePackage[]): string;
944
984
  /**
@@ -1026,7 +1066,7 @@ export declare const importUphill: LayoutCheckFunction<ImportGraphOptions>;
1026
1066
  //#endregion
1027
1067
  //#region src/checks/instruction-symlinks.d.ts
1028
1068
  /**
1029
- * Each agent instruction file is tracked by git as a symbolic link (mode 120000) whose target is the README beside it, so the two cannot diverge. The link may be written in any form that resolves there (`./README.md`), and may lead through other tracked links, as in `CLAUDE.md` to `AGENTS.md` to `README.md`. It reads the index, not the working tree, so a checkout with `core.symlinks` false, where a link is written out as a plain file, is judged by what is committed.
1069
+ * Each agent instruction file is tracked by git as a symbolic link (mode 120000) whose target is the README beside it, so the two cannot diverge. A directory without a tracked README has nothing to link to, so a missing instruction file there is not reported; one that exists is still judged. The link may be written in any form that resolves there (`./README.md`), and may lead through other tracked links, as in `CLAUDE.md` to `AGENTS.md` to `README.md`. It reads the index, not the working tree, so a checkout with `core.symlinks` false, where a link is written out as a plain file, is judged by what is committed.
1030
1070
  */
1031
1071
  export declare const instructionSymlinks: CheckFunction<InstructionSymlinksOptions>;
1032
1072
  //#endregion
@@ -1042,6 +1082,8 @@ export declare const migrationsDirectory: CheckFunction<MigrationsDirectoryOptio
1042
1082
  /**
1043
1083
  * Only one merge method is available for a pull request into the branch, `rebase` unless the options say otherwise. A method is available when the repository allows it and no `pull_request` rule that applies to the branch leaves it out of its allowed methods.
1044
1084
  *
1085
+ * When the repository's plan has no rulesets, no rule applies to the branch and the repository settings alone decide.
1086
+ *
1045
1087
  * Limits: it reads the repository settings and the rules of rulesets that apply to the branch; classic branch protection and a merge queue's own merge method are not read, so a repository whose queue owns the strategy is judged by what it still allows for a direct merge.
1046
1088
  */
1047
1089
  export declare const settingsMergeMethods: GitHubCheckFunction<SettingsMergeMethodsOptions>;
@@ -1050,7 +1092,7 @@ export declare const settingsMergeMethods: GitHubCheckFunction<SettingsMergeMeth
1050
1092
  /**
1051
1093
  * The branch requires the check of every junction job of the workflows, and requires branches to be up to date before merging (strict mode). The check name of a job is its `name`, else its id.
1052
1094
  *
1053
- * The junction job is the one that reports for the whole workflow, so requiring it requires everything it needs, including jobs a path filter may skip. Codes: `no-required-checks` (no `required_status_checks` rule applies), `required-check-missing` (a junction job's check is not among the required ones), `not-strict` (no rule sets the strict policy) and `no-junction-job` (no workflow has a job with an id from `junctionJobs`).
1095
+ * The junction job is the one that reports for the whole workflow, so requiring it requires everything it needs, including jobs a path filter may skip. Codes: `no-required-checks` (no `required_status_checks` rule applies), `required-check-missing` (a junction job's check is not among the required ones), `not-strict` (no rule sets the strict policy), `no-junction-job` (no workflow has a job with an id from `junctionJobs`) and `rules-unavailable` (the repository's plan has no rulesets, so no check can be required; reported alone, with GitHub's message).
1054
1096
  *
1055
1097
  * Limits: it reads the rules of rulesets that apply to the branch; classic branch protection is not read, so a repository that uses it is reported as having no required checks. A junction job in a reusable workflow, or a name that is an expression, is not resolved.
1056
1098
  */
@@ -1060,6 +1102,8 @@ export declare const settingsRequiredChecks: GitHubCheckFunction<SettingsRequire
1060
1102
  /**
1061
1103
  * A pull request cannot merge while a review conversation is unresolved: a `pull_request` rule that applies to the branch sets `required_review_thread_resolution`.
1062
1104
  *
1105
+ * When the repository's plan has no rulesets it reports `rules-unavailable` with GitHub's message, since nothing can require it.
1106
+ *
1063
1107
  * Limits: it reads the rules of rulesets; classic branch protection is not read.
1064
1108
  */
1065
1109
  export declare const settingsReviewThreadResolution: GitHubCheckFunction<SettingsReviewThreadResolutionOptions>;
@@ -1180,14 +1224,6 @@ export declare const conformanceSchema: z.ZodType<ConformanceConfig, Conformance
1180
1224
  */
1181
1225
  export declare const conformanceSection: Section<"conformance", z.ZodType<ConformanceConfig, ConformanceConfig>>;
1182
1226
  //#endregion
1183
- //#region src/errors.d.ts
1184
- /**
1185
- * A problem with how the tool was used or configured rather than a finding about the workspace: an unknown or disabled check, a missing or invalid section, a layout that cannot be resolved, a repository that is not a git checkout. The command line reports it and exits 2.
1186
- */
1187
- export declare class ConformanceError extends Error {
1188
- constructor(message: string, options?: ErrorOptions);
1189
- }
1190
- //#endregion
1191
1227
  //#region src/registry.d.ts
1192
1228
  /**
1193
1229
  * What a check needs to run once the configuration is loaded.
@@ -1201,6 +1237,10 @@ interface RunInput {
1201
1237
  * The client the settings checks read through; `undefined` when the run is offline.
1202
1238
  */
1203
1239
  readonly github: GitHubClient | undefined;
1240
+ /**
1241
+ * Receives the check's notes, what it reports beside its violations.
1242
+ */
1243
+ readonly note: (text: string) => void;
1204
1244
  }
1205
1245
  /**
1206
1246
  * What every registered check has, whichever way it runs.
@@ -1267,7 +1307,7 @@ export declare const EXIT_CODES: {
1267
1307
  */
1268
1308
  interface RunChecksOptions {
1269
1309
  /**
1270
- * The directory that holds the config files and that every path option is relative to.
1310
+ * The directory that holds the config files and that every path option is relative to. A relative path is resolved against the working directory of the process, once, before any check runs.
1271
1311
  */
1272
1312
  readonly cwd: string;
1273
1313
  /**
@@ -1297,6 +1337,10 @@ interface RunChecksOptions {
1297
1337
  interface CheckResult {
1298
1338
  readonly check: CheckName;
1299
1339
  readonly violations: readonly Violation[];
1340
+ /**
1341
+ * What the check reported beside its violations, such as how many files it linted, in the order it reported them.
1342
+ */
1343
+ readonly notes: readonly string[];
1300
1344
  }
1301
1345
  /**
1302
1346
  * The outcome of running checks.
@@ -1320,7 +1364,7 @@ interface RunResult {
1320
1364
  *
1321
1365
  * Violations do not throw. It throws `ConformanceError` when the checks cannot run (nothing enabled, a requested check disabled, a section missing) and `ConfigValidationError` when a section fails its schema, whether it was loaded from `cwd` or passed in.
1322
1366
  */
1323
- export declare function runChecks(options: RunChecksOptions): Promise<RunResult>;
1367
+ export declare function runChecks(given: RunChecksOptions): Promise<RunResult>;
1324
1368
  //#endregion
1325
1369
  //#region src/type-level.d.ts
1326
1370
  /**
@@ -1386,4 +1430,4 @@ export declare function proveExhaustive(input: {
1386
1430
  readonly compilerOptions?: CompilerOptions;
1387
1431
  }): ExhaustivenessProof;
1388
1432
  //#endregion
1389
- export type { AggregateMappersOptions, BranchRules, CaseRemoval, CheckContext, CheckFunction, CheckName, CheckOptionsByName, CheckResult, ChecksConfig, CodecPairsOptions, CommandTypesOptions, CommitTypesOptions, ConformanceConfig, DeployDirectory, DeploySelector, DeployToolAdapter, DeployToolName, DerivedTypesOptions, DerivedTypesPair, DiscoveredPackage, DockerfilePackageManagerOptions, EslintOptions, EslintRequiredSeverity, EslintSample, ExhaustivenessProof, GeneratorAdapter, GeneratorName, GitHubCheckContext, GitHubCheckFunction, GitHubClient, GitHubClientOptions, ImportGraphOptions, InstructionSymlinksOptions, Job, LayoutCheckContext, LayoutCheckFunction, MigrationsDirectoryOptions, PermissionAccess, Permissions, PinningLevel, RegisteredCheck, RepositorySettings, RepositorySlug, RunChecksOptions, RunResult, RunsOn, SettingsMergeMethodsOptions, SettingsOptions, SettingsRequiredChecksOptions, SettingsReviewThreadResolutionOptions, SingleStorybookOptions, SourceLocation, Step, TypeErrorReport, UsesReference, Violation, Workflow, WorkflowActionPinningOptions, WorkflowCredentialsOptions, WorkflowJobOrderingOptions, WorkflowMergeGroupOptions, WorkflowReleaseJobOptions, WorkflowRepositoryDispatchOptions, WorkflowRunnerResolutionOptions, WorkflowSelection, WorkflowSkippableJobsOptions, WorkflowUpdateBotCooldownOptions, WorkflowVersionSingleSourceOptions, WorkspacePackage };
1433
+ export type { AggregateMappersOptions, BranchRules, CaseRemoval, CheckContext, CheckFunction, CheckName, CheckOptionsByName, CheckResult, ChecksConfig, CodecPairsOptions, CommandTypesOptions, CommitTypesOptions, ConformanceConfig, DeployDirectory, DeploySelector, DeployToolAdapter, DeployToolName, DerivedTypesOptions, DerivedTypesPair, DiscoveredPackage, DockerfilePackageManagerOptions, EnginesFloorOptions, EslintOptions, EslintRequiredSeverity, EslintSample, ExhaustivenessProof, GeneratorAdapter, GeneratorName, GitHubCheckContext, GitHubCheckFunction, GitHubClient, GitHubClientOptions, ImportGraphOptions, InstructionSymlinksOptions, Job, LayoutCheckContext, LayoutCheckFunction, MigrationsDirectoryOptions, PermissionAccess, Permissions, PinningLevel, RegisteredCheck, RepositorySettings, RepositorySlug, RunChecksOptions, RunResult, RunsOn, SettingsMergeMethodsOptions, SettingsOptions, SettingsRequiredChecksOptions, SettingsReviewThreadResolutionOptions, SingleStorybookOptions, SourceLocation, Step, TypeErrorReport, UsesReference, Violation, Workflow, WorkflowActionPinningOptions, WorkflowCredentialsOptions, WorkflowJobOrderingOptions, WorkflowMergeGroupOptions, WorkflowReleaseJobOptions, WorkflowRepositoryDispatchOptions, WorkflowRunnerResolutionOptions, WorkflowSelection, WorkflowSkippableJobsOptions, WorkflowUpdateBotCooldownOptions, WorkflowVersionSingleSourceOptions, WorkspacePackage };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,15 @@
1
1
  import { CompilerOptions } from "ts-morph";
2
- import { ConfigFileOptions, LayoutConfig, RankSkipOptions, Section } from "@exadev/config";
3
2
  import { z } from "zod";
3
+ import { ConfigFileOptions, LayoutConfig, RankSkipOptions, Section } from "@exadev/config";
4
4
  import { IViolation } from "dependency-cruiser";
5
+ //#region src/errors.d.ts
6
+ /**
7
+ * A problem with how the tool was used or configured rather than a finding about the workspace: an unknown or disabled check, a missing or invalid section, a layout that cannot be resolved, a repository that is not a git checkout. The command line reports it and exits 2.
8
+ */
9
+ export declare class ConformanceError extends Error {
10
+ constructor(message: string, options?: ErrorOptions);
11
+ }
12
+ //#endregion
5
13
  //#region src/github.d.ts
6
14
  /**
7
15
  * A repository on GitHub.
@@ -39,7 +47,13 @@ interface BranchRules {
39
47
  }[];
40
48
  }
41
49
  /**
42
- * What the settings checks need from GitHub, so a test or another host can supply it without a network. The real implementation is {@link createGitHubClient}. Both methods reject when the repository or branch cannot be read.
50
+ * GitHub's refusal to read a branch's rules because the repository's plan does not offer rulesets, as for a private repository on a plan without them: no ruleset applies to its branches, so a check that requires one cannot be met. The message is GitHub's own. A {@link GitHubClient} rejects `branchRules` with it, and with any other error for every other refusal.
51
+ */
52
+ export declare class RulesetsUnavailableError extends ConformanceError {
53
+ constructor(message: string, options?: ErrorOptions);
54
+ }
55
+ /**
56
+ * What the settings checks need from GitHub, so a test or another host can supply it without a network. The real implementation is {@link createGitHubClient}. Both methods reject when the repository or branch cannot be read, `branchRules` with {@link RulesetsUnavailableError} when the repository's plan has no rulesets.
43
57
  */
44
58
  interface GitHubClient {
45
59
  readonly repository: (slug: RepositorySlug) => Promise<RepositorySettings>;
@@ -95,14 +109,18 @@ interface Violation {
95
109
  */
96
110
  interface CheckContext<Options> {
97
111
  /**
98
- * The directory the checks run in; every path option is relative to it.
112
+ * The directory the checks run in, absolute or relative to the working directory of the process; every path option is relative to it.
99
113
  */
100
114
  readonly cwd: string;
101
115
  readonly options: Options;
102
116
  /**
103
- * How config files that a check evaluates itself (the commitlint and release configs of `commit-types`) are loaded. Only `alias` and `fsCache` apply to evaluating a file; `trust` and `merge` are for `extends`. No transpile cache is written when omitted.
117
+ * How config files that a check evaluates itself (the commitlint and release configs of `commit-types`) are loaded. Only `alias` and `fsCache` apply to evaluating a file; `trust` and the per-shape `unified` and `standalone` layer options are for `extends`. No transpile cache is written when omitted.
104
118
  */
105
119
  readonly configFiles?: ConfigFileOptions;
120
+ /**
121
+ * Receives what the check reports beside its violations: a line about what it did, such as how many files it linted, so a clean result can be told apart from one that looked at little. Nothing is reported when omitted.
122
+ */
123
+ readonly note?: (text: string) => void;
106
124
  }
107
125
  /**
108
126
  * What a check that reads the workspace layout receives.
@@ -524,6 +542,15 @@ interface CommitTypesOptions {
524
542
  */
525
543
  readonly release?: string;
526
544
  }
545
+ /**
546
+ * Options of the `engines-floor` check: the `engines.node` range of a package is a subset of the `engines.node` range of each of its installed dependencies.
547
+ */
548
+ interface EnginesFloorOptions {
549
+ /**
550
+ * Globs of the package directories to judge, in the form of the `packages` list of `pnpm-workspace.yaml` (a `!` pattern excludes), relative to the directory the checks run in; `.` is the root package. The root package and the `packages` of `pnpm-workspace.yaml`, when that file exists, when omitted.
551
+ */
552
+ readonly packages?: readonly string[];
553
+ }
527
554
  /**
528
555
  * Options of the `dockerfile-package-manager` check: a package manager version pinned in a Dockerfile is the one `packageManager` names.
529
556
  */
@@ -790,6 +817,7 @@ interface CheckOptionsByName {
790
817
  readonly "instruction-symlinks": InstructionSymlinksOptions;
791
818
  readonly "single-storybook": SingleStorybookOptions;
792
819
  readonly "commit-types": CommitTypesOptions;
820
+ readonly "engines-floor": EnginesFloorOptions;
793
821
  readonly "dockerfile-package-manager": DockerfilePackageManagerOptions;
794
822
  readonly "migrations-directory": MigrationsDirectoryOptions;
795
823
  readonly eslint: EslintOptions;
@@ -872,6 +900,18 @@ export declare const derivedTypes: CheckFunction<DerivedTypesOptions>;
872
900
  */
873
901
  export declare const dockerfilePackageManager: CheckFunction<DockerfilePackageManagerOptions>;
874
902
  //#endregion
903
+ //#region src/checks/engines-floor.d.ts
904
+ /**
905
+ * The `engines.node` range of each package is a subset of the `engines.node` range of each dependency and optional dependency it lists, and of each peer dependency whose range admits a single version, as installed in `node_modules`, so the package admits no Node version that something it needs at run time rejects. A package that declares no range admits every version, so it is reported for each dependency that declares one. A dependency that declares no range constrains nothing and is ignored.
906
+ *
907
+ * The comparison is `semver.subset(package, dependency)`: every version the package's range admits satisfies the dependency's range. A floor alone is not enough, because a range of several lines (`^20.19.0 || ^22.13.0 || >=24`) also rejects the versions between them, which `>=20.19.0` admits. semver compares a range of several comparator sets set by set, so each set of the package's range must lie within one set of the dependency's; a set that only two adjacent dependency sets cover together (`>=22` against `^22.0.0 || >=23`) is reported, and splitting it the same way (`^22.0.0 || >=23`) satisfies the check.
908
+ *
909
+ * A peer dependency is judged only when its range admits a single version (`1.2.3` or `=1.2.3`), and then by the copy installed, which must be that version. The consumer chooses which admitted version to install, so the package's range holds when each Node version in it is accepted by some admitted version; one installed copy that rejects a Node version does not show that every admitted version does, and the others are not on disk.
910
+ *
911
+ * A dependency that is not installed fails the run: its range cannot be read, and passing it unjudged would read as a pass. An optional dependency and a peer dependency marked optional in `peerDependenciesMeta` may be absent and are then skipped.
912
+ */
913
+ export declare const enginesFloor: CheckFunction<EnginesFloorOptions>;
914
+ //#endregion
875
915
  //#region src/checks/eslint.d.ts
876
916
  /**
877
917
  * Proves the repository's own ESLint is applied, which no check that runs inside ESLint can notice: a config that dropped a shared preset, switched its rules off or narrowed `ignores` until nothing is linted still passes its own lint.
@@ -888,7 +928,7 @@ export declare const eslint: CheckFunction<EslintOptions>;
888
928
  */
889
929
  interface DiscoveredPackage {
890
930
  /**
891
- * Relative to the workspace root, with `/` separators.
931
+ * Relative to the workspace root, with `/` separators; {@link ROOT_PACKAGE_DIR} for the package at the root.
892
932
  */
893
933
  readonly dir: string;
894
934
  /**
@@ -916,7 +956,7 @@ interface WorkspacePackage extends DiscoveredPackage {
916
956
  /**
917
957
  * Classify discovered packages by the layout: group, rank and slice. Pure.
918
958
  *
919
- * A package no group owns is a configuration error, because every check would otherwise skip it without saying so. Nested package directories are one too: the checks attribute a file to the package whose directory is its prefix, which is ambiguous for a package inside another. A `namePrefix` slice takes the longest slice value that a `segment` group produced and that prefixes the package's unscoped name; a package without a name has no such slice.
959
+ * A package no group owns is a configuration error, because every check would otherwise skip it without saying so. Nested package directories are one too: the checks attribute a file to the package whose directory is its prefix, which is ambiguous for a package inside another. The root package holds every other directory, so it is a package only in a single-package repository. A `namePrefix` slice takes the longest slice value that a `segment` group produced and that prefixes the package's unscoped name; a package without a name has no such slice.
920
960
  */
921
961
  export declare function classifyPackages(discovered: readonly DiscoveredPackage[], layout: LayoutConfig): readonly WorkspacePackage[];
922
962
  //#endregion
@@ -938,7 +978,7 @@ interface ImportRule {
938
978
  };
939
979
  }
940
980
  /**
941
- * A regular expression, as source text, matching every file inside any of the packages. The trailing `/` keeps `packages/a` from matching `packages/ab`.
981
+ * A regular expression, as source text, matching every file inside any of the packages: the path starts with one's {@link packagePathPrefix}.
942
982
  */
943
983
  export declare function packagesPattern(packages: readonly WorkspacePackage[]): string;
944
984
  /**
@@ -1026,7 +1066,7 @@ export declare const importUphill: LayoutCheckFunction<ImportGraphOptions>;
1026
1066
  //#endregion
1027
1067
  //#region src/checks/instruction-symlinks.d.ts
1028
1068
  /**
1029
- * Each agent instruction file is tracked by git as a symbolic link (mode 120000) whose target is the README beside it, so the two cannot diverge. The link may be written in any form that resolves there (`./README.md`), and may lead through other tracked links, as in `CLAUDE.md` to `AGENTS.md` to `README.md`. It reads the index, not the working tree, so a checkout with `core.symlinks` false, where a link is written out as a plain file, is judged by what is committed.
1069
+ * Each agent instruction file is tracked by git as a symbolic link (mode 120000) whose target is the README beside it, so the two cannot diverge. A directory without a tracked README has nothing to link to, so a missing instruction file there is not reported; one that exists is still judged. The link may be written in any form that resolves there (`./README.md`), and may lead through other tracked links, as in `CLAUDE.md` to `AGENTS.md` to `README.md`. It reads the index, not the working tree, so a checkout with `core.symlinks` false, where a link is written out as a plain file, is judged by what is committed.
1030
1070
  */
1031
1071
  export declare const instructionSymlinks: CheckFunction<InstructionSymlinksOptions>;
1032
1072
  //#endregion
@@ -1042,6 +1082,8 @@ export declare const migrationsDirectory: CheckFunction<MigrationsDirectoryOptio
1042
1082
  /**
1043
1083
  * Only one merge method is available for a pull request into the branch, `rebase` unless the options say otherwise. A method is available when the repository allows it and no `pull_request` rule that applies to the branch leaves it out of its allowed methods.
1044
1084
  *
1085
+ * When the repository's plan has no rulesets, no rule applies to the branch and the repository settings alone decide.
1086
+ *
1045
1087
  * Limits: it reads the repository settings and the rules of rulesets that apply to the branch; classic branch protection and a merge queue's own merge method are not read, so a repository whose queue owns the strategy is judged by what it still allows for a direct merge.
1046
1088
  */
1047
1089
  export declare const settingsMergeMethods: GitHubCheckFunction<SettingsMergeMethodsOptions>;
@@ -1050,7 +1092,7 @@ export declare const settingsMergeMethods: GitHubCheckFunction<SettingsMergeMeth
1050
1092
  /**
1051
1093
  * The branch requires the check of every junction job of the workflows, and requires branches to be up to date before merging (strict mode). The check name of a job is its `name`, else its id.
1052
1094
  *
1053
- * The junction job is the one that reports for the whole workflow, so requiring it requires everything it needs, including jobs a path filter may skip. Codes: `no-required-checks` (no `required_status_checks` rule applies), `required-check-missing` (a junction job's check is not among the required ones), `not-strict` (no rule sets the strict policy) and `no-junction-job` (no workflow has a job with an id from `junctionJobs`).
1095
+ * The junction job is the one that reports for the whole workflow, so requiring it requires everything it needs, including jobs a path filter may skip. Codes: `no-required-checks` (no `required_status_checks` rule applies), `required-check-missing` (a junction job's check is not among the required ones), `not-strict` (no rule sets the strict policy), `no-junction-job` (no workflow has a job with an id from `junctionJobs`) and `rules-unavailable` (the repository's plan has no rulesets, so no check can be required; reported alone, with GitHub's message).
1054
1096
  *
1055
1097
  * Limits: it reads the rules of rulesets that apply to the branch; classic branch protection is not read, so a repository that uses it is reported as having no required checks. A junction job in a reusable workflow, or a name that is an expression, is not resolved.
1056
1098
  */
@@ -1060,6 +1102,8 @@ export declare const settingsRequiredChecks: GitHubCheckFunction<SettingsRequire
1060
1102
  /**
1061
1103
  * A pull request cannot merge while a review conversation is unresolved: a `pull_request` rule that applies to the branch sets `required_review_thread_resolution`.
1062
1104
  *
1105
+ * When the repository's plan has no rulesets it reports `rules-unavailable` with GitHub's message, since nothing can require it.
1106
+ *
1063
1107
  * Limits: it reads the rules of rulesets; classic branch protection is not read.
1064
1108
  */
1065
1109
  export declare const settingsReviewThreadResolution: GitHubCheckFunction<SettingsReviewThreadResolutionOptions>;
@@ -1180,14 +1224,6 @@ export declare const conformanceSchema: z.ZodType<ConformanceConfig, Conformance
1180
1224
  */
1181
1225
  export declare const conformanceSection: Section<"conformance", z.ZodType<ConformanceConfig, ConformanceConfig>>;
1182
1226
  //#endregion
1183
- //#region src/errors.d.ts
1184
- /**
1185
- * A problem with how the tool was used or configured rather than a finding about the workspace: an unknown or disabled check, a missing or invalid section, a layout that cannot be resolved, a repository that is not a git checkout. The command line reports it and exits 2.
1186
- */
1187
- export declare class ConformanceError extends Error {
1188
- constructor(message: string, options?: ErrorOptions);
1189
- }
1190
- //#endregion
1191
1227
  //#region src/registry.d.ts
1192
1228
  /**
1193
1229
  * What a check needs to run once the configuration is loaded.
@@ -1201,6 +1237,10 @@ interface RunInput {
1201
1237
  * The client the settings checks read through; `undefined` when the run is offline.
1202
1238
  */
1203
1239
  readonly github: GitHubClient | undefined;
1240
+ /**
1241
+ * Receives the check's notes, what it reports beside its violations.
1242
+ */
1243
+ readonly note: (text: string) => void;
1204
1244
  }
1205
1245
  /**
1206
1246
  * What every registered check has, whichever way it runs.
@@ -1267,7 +1307,7 @@ export declare const EXIT_CODES: {
1267
1307
  */
1268
1308
  interface RunChecksOptions {
1269
1309
  /**
1270
- * The directory that holds the config files and that every path option is relative to.
1310
+ * The directory that holds the config files and that every path option is relative to. A relative path is resolved against the working directory of the process, once, before any check runs.
1271
1311
  */
1272
1312
  readonly cwd: string;
1273
1313
  /**
@@ -1297,6 +1337,10 @@ interface RunChecksOptions {
1297
1337
  interface CheckResult {
1298
1338
  readonly check: CheckName;
1299
1339
  readonly violations: readonly Violation[];
1340
+ /**
1341
+ * What the check reported beside its violations, such as how many files it linted, in the order it reported them.
1342
+ */
1343
+ readonly notes: readonly string[];
1300
1344
  }
1301
1345
  /**
1302
1346
  * The outcome of running checks.
@@ -1320,7 +1364,7 @@ interface RunResult {
1320
1364
  *
1321
1365
  * Violations do not throw. It throws `ConformanceError` when the checks cannot run (nothing enabled, a requested check disabled, a section missing) and `ConfigValidationError` when a section fails its schema, whether it was loaded from `cwd` or passed in.
1322
1366
  */
1323
- export declare function runChecks(options: RunChecksOptions): Promise<RunResult>;
1367
+ export declare function runChecks(given: RunChecksOptions): Promise<RunResult>;
1324
1368
  //#endregion
1325
1369
  //#region src/type-level.d.ts
1326
1370
  /**
@@ -1386,4 +1430,4 @@ export declare function proveExhaustive(input: {
1386
1430
  readonly compilerOptions?: CompilerOptions;
1387
1431
  }): ExhaustivenessProof;
1388
1432
  //#endregion
1389
- export type { AggregateMappersOptions, BranchRules, CaseRemoval, CheckContext, CheckFunction, CheckName, CheckOptionsByName, CheckResult, ChecksConfig, CodecPairsOptions, CommandTypesOptions, CommitTypesOptions, ConformanceConfig, DeployDirectory, DeploySelector, DeployToolAdapter, DeployToolName, DerivedTypesOptions, DerivedTypesPair, DiscoveredPackage, DockerfilePackageManagerOptions, EslintOptions, EslintRequiredSeverity, EslintSample, ExhaustivenessProof, GeneratorAdapter, GeneratorName, GitHubCheckContext, GitHubCheckFunction, GitHubClient, GitHubClientOptions, ImportGraphOptions, InstructionSymlinksOptions, Job, LayoutCheckContext, LayoutCheckFunction, MigrationsDirectoryOptions, PermissionAccess, Permissions, PinningLevel, RegisteredCheck, RepositorySettings, RepositorySlug, RunChecksOptions, RunResult, RunsOn, SettingsMergeMethodsOptions, SettingsOptions, SettingsRequiredChecksOptions, SettingsReviewThreadResolutionOptions, SingleStorybookOptions, SourceLocation, Step, TypeErrorReport, UsesReference, Violation, Workflow, WorkflowActionPinningOptions, WorkflowCredentialsOptions, WorkflowJobOrderingOptions, WorkflowMergeGroupOptions, WorkflowReleaseJobOptions, WorkflowRepositoryDispatchOptions, WorkflowRunnerResolutionOptions, WorkflowSelection, WorkflowSkippableJobsOptions, WorkflowUpdateBotCooldownOptions, WorkflowVersionSingleSourceOptions, WorkspacePackage };
1433
+ export type { AggregateMappersOptions, BranchRules, CaseRemoval, CheckContext, CheckFunction, CheckName, CheckOptionsByName, CheckResult, ChecksConfig, CodecPairsOptions, CommandTypesOptions, CommitTypesOptions, ConformanceConfig, DeployDirectory, DeploySelector, DeployToolAdapter, DeployToolName, DerivedTypesOptions, DerivedTypesPair, DiscoveredPackage, DockerfilePackageManagerOptions, EnginesFloorOptions, EslintOptions, EslintRequiredSeverity, EslintSample, ExhaustivenessProof, GeneratorAdapter, GeneratorName, GitHubCheckContext, GitHubCheckFunction, GitHubClient, GitHubClientOptions, ImportGraphOptions, InstructionSymlinksOptions, Job, LayoutCheckContext, LayoutCheckFunction, MigrationsDirectoryOptions, PermissionAccess, Permissions, PinningLevel, RegisteredCheck, RepositorySettings, RepositorySlug, RunChecksOptions, RunResult, RunsOn, SettingsMergeMethodsOptions, SettingsOptions, SettingsRequiredChecksOptions, SettingsReviewThreadResolutionOptions, SingleStorybookOptions, SourceLocation, Step, TypeErrorReport, UsesReference, Violation, Workflow, WorkflowActionPinningOptions, WorkflowCredentialsOptions, WorkflowJobOrderingOptions, WorkflowMergeGroupOptions, WorkflowReleaseJobOptions, WorkflowRepositoryDispatchOptions, WorkflowRunnerResolutionOptions, WorkflowSelection, WorkflowSkippableJobsOptions, WorkflowUpdateBotCooldownOptions, WorkflowVersionSingleSourceOptions, WorkspacePackage };