@hailstails/hone 2.0.0-pre.1 → 2.0.0-pre.2

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
@@ -17,7 +17,7 @@ npm install --save-dev --save-exact @hailstails/hone@<version>
17
17
 
18
18
  With pnpm the second command is `pnpm add -D --save-exact @hailstails/hone@<version>`. Stable releases are published to npm under the dist-tag `latest` and pre-releases under `next`; the badge above shows the version `latest` installs. Pin the exact version rather than installing by tag: a major release can remove or rename a clause address, config key or flag, and an install by tag can record a range. The alternative is the tarball attached to each [GitHub release](https://github.com/HailsTails/hone/releases), installed with `npm install --save-dev <path-to-tarball>`. A repository on the package's old name, `honed`, moves with [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone). [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps, and the alternative of building the tarball from a pinned commit.
19
19
 
20
- Two engines ship: `walker`, a standalone TypeScript syntax walker that version 1 called `audit`, and `eslint`, which runs the check as an ESLint rule inside the team's own ESLint setup. Rules are referred to by name; a number is only a clause address. [rules/numbers.md](rules/numbers.md#every-numbered-discipline) lists every shared discipline with its clauses, and [rules/README.md](rules/README.md) explains how the named pages read: the walker checks 20 disciplines, and ESLint pieces check eleven symptoms: [Untyped value](rules/typescript/symptoms.md#untyped-value), [Claimed type](rules/typescript/symptoms.md#claimed-type), [Name off its casing](rules/typescript/symptoms.md#name-off-its-casing), [Thrown non-error](rules/typescript/symptoms.md#thrown-non-error), [Authored class or this](rules/typescript/symptoms.md#authored-class-or-this), [Test switched off](rules/typescript/symptoms.md#test-switched-off), [Positional parameters](rules/typescript/symptoms.md#positional-parameters), [Tangled function](rules/typescript/symptoms.md#tangled-function), [Long function](rules/typescript/symptoms.md#long-function), [Work inside a condition](rules/typescript/symptoms.md#work-inside-a-condition) and [Rebinding](rules/typescript/symptoms.md#rebinding). The rest are judgement rules, applied in review with the review methods in [methods/](methods/README.md).
20
+ Two engines ship: `walker`, a standalone TypeScript syntax walker, and `eslint`, which runs the check as an ESLint rule inside the team's own ESLint setup. Rules are referred to by name; a number is only a clause address. [rules/README.md](rules/README.md) explains how the named pages read, and [the checks page](rules/typescript/checks.md) lists every check; a check that needs ESLint says so on its page. The rest are judgement rules, applied in review with the review methods in [methods/](methods/README.md).
21
21
 
22
22
  To adopt Hone in another repository, follow [ADOPTING.md](ADOPTING.md) step by step. A repository already using the older standalone route, or a copy of Hone's source, follows [MIGRATING.md](MIGRATING.md) instead.
23
23
 
@@ -25,70 +25,15 @@ A team adds its own disciplines as a rule set in its own repository, with ESLint
25
25
 
26
26
  ## Commands
27
27
 
28
- The package ships one command, `hone`, with six subcommands for a version 2 repository, and a seventh, `hone split-records`, which belongs to version 1 and prints `load failure: not-ready-yet` on a version 2 repository. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of debt that is paid; `authorise` writes one authorised location; `upgrade` runs once, to move a version 1 repository to version 2, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 shows:
29
-
30
- ```text
31
- hone check --repo <dir> [--base-revision <revision>] [--report-output <full|actionable|counts|verdict-only>] [--forfeiture <this-run|elsewhere>]
32
- hone project --repo <dir>
33
- hone record-debt --repo <dir> --base-revision <revision> [--leave <path>]...
34
- hone prune-debt --repo <dir> [--base-revision <revision>] [--forfeiture <this-run|elsewhere>]
35
- hone authorise --repo <dir> --answers <address> --file <path> --case <case> --owes <principle> --why <question>... --because <answer>... --evidence <evidence>... --root-cause <text> --root-evidence <text> --readback <text> --owner <owner>
36
- hone upgrade --repo <dir>
37
- hone --help
38
- hone --version
39
- ```
40
-
41
- `--repo` is the folder that holds `hone.config.json`, usually the repository root; for `hone upgrade` it is the folder that holds `disciplines.json`. `hone --help` lists the commands, `hone check --help`, `hone project --help`, `hone record-debt --help`, `hone prune-debt --help`, `hone authorise --help` and `hone upgrade --help` list each one's options and exit codes, and `hone --version` prints the installed version. `hone --help` always prints this version's help. A command's `--help` prints the 1.x help only when it is given a `--repo` folder that holds `disciplines.json`, and `hone split-records --help` always prints it. A command typed wrongly is a load failure `arguments-invalid` that says what was wrong, a `--repo` folder with neither `hone.config.json` nor `disciplines.json` is the load failure `config-absent`, saying it holds no `hone.config.json`, from every command, and an error Hone did not expect is the load failure `unexpected-error`; each exits `2`. Everything Hone prints goes to standard output, so exit `1` always comes with `verdict: fail`. From a source checkout the same command is `node core/check/tool-command.ts check --repo <dir>`.
42
-
43
- [docs/output-contract.md](docs/output-contract.md) lists every line `hone` prints, exactly as it prints it, with the exit codes and which parts are stable for hooks, CI and agents to rely on. A test renders every kind of line and checks it against that page, both ways.
44
-
45
- `hone check` loads the repository's `hone.config.json`, the symptom catalogue and the records in `hone-records`; works out which files changed since `--base-revision`; runs each engine its listed checks name once over the repository's tracked files, the ESLint engine over its `.ts`, `.tsx`, `.mts` and `.cts` files; answers each finding by the records; and prints a plain-text report ending in `verdict: pass` or `verdict: fail`, followed by ` (partial assessment)` when the run left part of the assessment to another run. It exits `0` when the verdict is `pass`, `1` when it is `fail`, and `2` on a load failure, which prints one line, `load failure: <kind> <fields>`. `hone project`, `hone record-debt`, `hone prune-debt` and `hone authorise` exit `0` or `2`.
46
-
47
- The report lists the excluded paths, the checks not adopted, the checks adopted with their engine not run, the edition each check with more than one edition ran, findings, answered findings, the checks available to list, stale and forfeited records, unrecorded native exceptions, misnamed inline disables, paid debt, refused records, what the run could not measure, projection problems, any part of the assessment left to another run, the notes on the settings and on records, the records carried from version 1 and, last, one note for each symptom the findings name, each with its count. The verdict is `pass` only when no failing section has an entry: the findings, stale and forfeited records, unrecorded native exceptions, misnamed inline disables, refused records, unmeasured checks and projection problems. Paid debt, answered findings, checks available to list, carried records, notes, the assessment and the symptom notes never fail a run; [the output contract](docs/output-contract.md#the-version-2-report) gives every section's role.
48
-
49
- An `unrecorded` line is `<check> <engine> <kind> <detail>`. Two kinds end with a note:
50
-
51
- | Kind | Line |
52
- | --- | --- |
53
- | `inline-disable` naming no rule | `<check> eslint inline-disable <file>:<line> <comment> names no rule and escapes every selected check: naming the rule is the cheap fix` |
54
- | `command-line-option` that weakens the run | `<check> eslint command-line-option <package.json> <script> <option> weakens the script's whole run, so no record can cover it: remove it from the script` |
55
- | `command-line-option` Hone cannot judge, because another command comes before `eslint` in its script | `<check> eslint command-line-option <package.json> <script> <option>: <command> is not the first command of its script, so Hone cannot tell what the option does to the files under check; give <command> a script of its own, such as <invocation>` |
56
- | `command-line-option` Hone cannot judge, because something before `eslint` in its own command is not a package runner or a `NAME=value` setting | `<check> eslint command-line-option <package.json> <script> <option>: <wrapper> comes before <command> and is neither a package runner nor a NAME=value setting, so Hone cannot tell what the option does to the files under check; put only package runners and NAME=value settings before <command>` |
57
- | `command-line-option` Hone cannot judge, because a quote in a script naming `eslint` has no partner; the whole script stands in for the option | `<check> eslint command-line-option <package.json> <script> <script text>: a quote in the script has no partner, so Hone cannot read what the script passes to <command> or tell what that does to the files under check; pair every quote in the script` |
58
-
59
- `<command>` is the `eslint` call as the script writes it, `<invocation>` is its whole command with its settings and options, from the same script, and `<wrapper>` is the first token before it that Hone does not read, such as `env` or a runner flag like `-y` or `-C`. `cross-env` followed only by `NAME=value` settings counts as a setting. Once only package runners and settings come first, Hone judges the option: `-c` naming the config ESLint already finds, and `--ignore-pattern` that ignores no checked file, are then not reported.
60
-
61
- The `symptoms` section comes last, just before the verdict, so a reader who looks only at the end of a failing report lands on it. It has one note for each symptom a finding names, in the order the findings first name them, each printed once however many findings name it: what the symptom may indicate, where the breach usually sits, the recipes that answer it, the situations that are correct uses of it and where to record each, and the page that explains it. A finding that names its check also says what that check may indicate and, where the check has one, what to write instead and the page that says so. A finding of a clause the symptom catalogue gives no check, such as one in a team's rule set, prints its clause address and its mechanism and no note. A run with no findings prints no `symptoms` section. When the check finds debt that is paid, the `paid` section names the exact `hone prune-debt` command for this repository, as [Pruning paid debt](#pruning-paid-debt) shows.
28
+ The package ships one command, `hone`. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of debt that is paid; `authorise` writes one authorised location; `upgrade` runs once, to move a version 1 repository to version 2, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 shows. `hone --help` lists the commands, and `hone <command> --help` gives each one's options and exit codes.
62
29
 
63
- `--report-output` sets how much of the report is printed for one run, overriding `reportOutput` in `hone.config.json`; with neither, the output is `full`. `full` prints every non-empty section, `actionable` leaves out the informational sections and keeps the failing, next-step and guidance sections, `counts` prints each section's heading line only, with `informational`, `next-step` or `guidance` after the sections that never fail the run, and `verdict-only` prints the verdict line alone; [the output contract](docs/output-contract.md#the-version-2-report) shows each.
30
+ [docs/output-contract.md](docs/output-contract.md) lists every line `hone` prints, the exit codes, the report's sections and which parts are stable for hooks, CI and agents to rely on.
64
31
 
65
- The output changes only what is printed: the verdict and exit code always come from the whole report. An unknown `--report-output` value is a load failure `arguments-invalid`; an unknown `reportOutput` value is a load failure in `hone.config.json`, even when `--report-output` is given. Load failures print the same in every output.
32
+ `hone check` loads the repository's `hone.config.json`, the symptom catalogue and the records in `hone-records`; works out which files changed since `--base-revision`; runs each engine its listed checks name once over the repository's tracked files; answers each finding by the records; and prints one report ending in its verdict. The verdict and exit code always come from the whole report, whatever `--report-output` or `reportOutput` print.
66
33
 
67
- Without `--base-revision`, Hone cannot tell which files were touched, so debt cannot be forfeited; if any debt exists the report lists `forfeiture-unmeasured` and the run fails. For the same reason it cannot compare a record carried from version 1 against the base; if one exists the report lists `import-unmeasured` and the run fails, unless forfeiture is left elsewhere, below. Each line says what Hone needs:
34
+ Without `--base-revision`, Hone cannot tell which files were touched, so debt cannot be forfeited and records carried from version 1 cannot be compared with the base; the report says so and the run fails. `--forfeiture elsewhere`, or `"forfeiture": "elsewhere"` in `hone.config.json`, leaves debt forfeiture to another run, such as a pre-push hook given a base revision; that run's report says what it left, and its verdict is a partial assessment.
68
35
 
69
- ```text
70
- forfeiture-unmeasured no-base-revision: no --base-revision was given, so debt cannot be checked for forfeiture; pass --base-revision with the branch's base, such as origin/main, or leave forfeiture to another run with "forfeiture": "elsewhere" in hone.config.json or --forfeiture elsewhere
71
- import-unmeasured no-base-revision: no --base-revision was given, so carried records cannot be checked against it; pass --base-revision with the branch's base, such as origin/main
72
- ```
73
-
74
- A `--base-revision` that git cannot use gives the same kinds as `base-git-failed`, naming the revision in double quotes, escaped as in JSON, with git's own message:
75
-
76
- ```text
77
- forfeiture-unmeasured base-git-failed "origin/main": git could not list the files changed since that revision and said "<git's message>"; Hone needs that revision and the history back to where this branch left it, or leave forfeiture to another run with "forfeiture": "elsewhere" in hone.config.json or --forfeiture elsewhere
78
- import-unmeasured base-git-failed "origin/main": git could not read hone-records at that revision and said "<git's message>"; Hone needs hone-records as it was at that revision
79
- ```
80
-
81
- `--forfeiture elsewhere` makes a run leave debt forfeiture to another run, such as a pre-push hook given a base revision, overriding `forfeiture` in `hone.config.json`; `--forfeiture this-run`, the default, assesses it in this run. A run with forfeiture elsewhere asks git for no change set for debt, forfeits no debt and never reports `forfeiture-unmeasured`, with or without `--base-revision`. It adds an `assessment` section to its report, printed whenever the run assesses less than the default, and marks its verdict line in every output:
82
-
83
- ```text
84
- assessment (1)
85
- forfeiture elsewhere: 37 debt records not checked for forfeiture in this run
86
- verdict: pass (partial assessment)
87
- ```
88
-
89
- The `assessment` section is informational and the marker does not change the exit code. Records carried from version 1 follow the same setting, as [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) says: with forfeiture elsewhere, a run given no base leaves them to the run that has one and prints `carried standing elsewhere` with how many; a run given a base judges them against it; and if no run is ever given a base they are never judged. A base that is given but cannot be read prints `import-unmeasured base-git-failed` and fails under either setting.
90
-
91
- `hone project` writes the native configuration each engine that runs a listed check through one needs, and prints `<path> <effect>` per file: `written` or `unchanged`. For the ESLint engine the files are `hone.eslint.mjs` and, beside it, `hone.eslint.d.mts`, which types the projection. The walker is standalone and writes nothing, so with only the walker listed the command prints nothing and exits `0`.
36
+ `hone project` writes the native configuration each engine that runs a listed check through one needs. The walker is standalone and needs none.
92
37
 
93
38
  ### Recording inherited debt
94
39
 
@@ -96,15 +41,15 @@ The `assessment` section is informational and the marker does not change the exi
96
41
 
97
42
  Give it the base that the run assessing forfeiture is given, such as `origin/main` for a branch: a record for a file changed since that base is forfeited by that run, so the command writes none for such a file and says so, and a check against a later revision, such as `HEAD`, would not show it.
98
43
 
99
- It never writes anything that needs an owner's reason: no authorised location, no boundary record, no deviation, no dependency record and no setting. It prints one line per finding and per native exception under `unrecorded`, `recorded` for each record it added, and writes nothing for:
44
+ It never writes anything that needs an owner's reason: no authorised location, no boundary record, no deviation, no dependency record and no setting. It prints one line per finding and per native exception under `unrecorded`, and writes nothing for:
100
45
 
101
- - a symptom and file that already hold debt (`already-recorded`), which the check explains by saying why it does not answer;
102
- - a file under a `--leave` path (`left`). `--leave` takes an exact file or folder, as `exclude` does, and may be given once for each path. It names the deliberate, permanent exceptions, which a person records as an authorised location with its own reason;
103
- - a file this change created or changed, when the run assesses forfeiture (`touched`), since a finding there is the change's own breach: fix it there, or for an inline disable or directive, fix what the comment hides and remove the comment. With `forfeiture` set to `elsewhere` the check forfeits nothing, so the command writes debt on such a file like any other;
104
- - a finding the catalogue gives no symptom or check to record against, such as one of a team rule set's clauses (`unrecordable`);
105
- - a native exception no debt record can hold (`unrecordable`). A `config-override` is never recorded, since debt holds what is owed and an override on a clean file owes nothing: a file under it that breaks the check gets its debt from the finding, because Hone's own run does not read the override, so remove the override or narrow it. An `ignore` and a `suppression-entry` hide nothing from Hone's run, which has already recorded what it finds in the file, so remove them; a generated or vendored file under an `ignore` can instead be listed in `exclude`, which Hone's run then honours too, so no `ignore` line is printed for it. An inline rule configuration changes what the rule checks: remove the comment. A lint-script option gets the advice for why Hone could not judge it, the same as its `unrecorded` line.
46
+ - a symptom and file that already hold debt;
47
+ - a file under a `--leave` path. `--leave` takes an exact file or folder, as `exclude` does, and may be given once for each path. It names the deliberate, permanent exceptions, which a person records as an authorised location with its own reason;
48
+ - a file this change created or changed, when the run assesses forfeiture, since a finding there is the change's own breach: fix it there. With `forfeiture` set to `elsewhere` the check forfeits nothing, so the command writes debt on such a file like any other;
49
+ - a finding the catalogue gives no symptom or check to record against, such as one of a team rule set's clauses;
50
+ - a native exception no debt record can hold. A `config-override` is never recorded, since debt holds what is owed and an override on a clean file owes nothing: a file under it that breaks the check gets its debt from the finding, because Hone's own run does not read the override, so remove the override or narrow it. An `ignore` and a `suppression-entry` hide nothing from Hone's run, which has already recorded what it finds in the file, so remove them; a generated or vendored file under an `ignore` can instead be listed in `exclude`, which Hone's run then honours too, so no `ignore` line is printed for it. An inline rule configuration changes what the rule checks: remove the comment. A lint-script option gets the advice for why Hone could not judge it, the same as its `unrecorded` line.
106
51
 
107
- When it recorded anything, a last line, `run <project command> to put the recorded debt into effect`, names the command that writes the projection those records need. [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with each `unrecorded` line.
52
+ Each line it prints says what to do next.
108
53
 
109
54
  It adds each record to its symptom's file, writing the file when there is none yet, and leaves every record already there as written. It stages and commits nothing: the diff of `hone-records` is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again writes nothing the second time. A record whose debt is paid is removed by `hone prune-debt`, below. Run `hone project` after it when any listed check runs on `eslint`, so the projection carries the new records.
110
55
 
@@ -116,20 +61,13 @@ Debt is a record that a finding is owed, and once the debt is paid the record sh
116
61
 
117
62
  Every other record stays for a person, such as a `stale` authorised location whose finding is gone: it carries a person's judgement, so delete it by hand.
118
63
 
119
- The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given. A check that finds debt that is paid names the command exactly in the `paid` section:
120
-
121
- ```text
122
- paid (1)
123
- claimed-type debt src/a.ts answered by authorised-location; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js prune-debt --repo /work/shop --base-revision origin/main to remove the paid debt
124
- ```
125
-
126
- It prints `<symptom> removed <file>: <why>` for each record it removed, where `<why>` is `paid`, `stale` (followed by `, its file is no longer in the repository` or `, its file is excluded by the settings` when that is why) or `forfeited`, and nothing when it removed none. Like `hone record-debt`, it writes `hone-records`, keeps every other record's text as written, stages and commits nothing, and does not write the projection: run `hone project` after it when any check runs on `eslint`, so the projection drops the records' off-switches. When it removes the last record from a file, it deletes the file. It has no dry run, as no other Hone command has: the `prune-debt` lines name what it removes, and the diff of `hone-records` is the review.
64
+ The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given; a check that finds paid debt names the exact command. Like `hone record-debt`, it writes `hone-records`, keeps every other record's text as written, stages and commits nothing, and does not write the projection: run `hone project` after it when any check runs on `eslint`. It has no dry run: the diff of `hone-records` is the review.
127
65
 
128
66
  For an `eslint` check, the off-switch the projection writes for a record is Hone's own. The check does not list it as a `config-override`, so it never counts as a native exception the record holds. A `config-override` on a check and file no record holds is reported under `unrecorded`, and `hone record-debt` never records it: remove the override or narrow it. Once a record is removed, a team off-switch placed after the projection is listed under `unrecorded` as a `config-override`, and one placed before it never takes effect, since the projection turns the rule on after it, so ESLint and the check both flag the file. A team block placed after the projection that sets a recorded file's rule to `"warn"` or `"error"` leaves the projection out of effect, and the check says `not-included`.
129
67
 
130
68
  ## Adopting the ESLint mechanism
131
69
 
132
- With any check listed for `eslint`, run `hone project`. It writes `hone.eslint.mjs` at the repository root: one block enabling the listed checks' rules at `"error"` on `**/*.{ts,tsx,mts,cts}`, then one block for each group of files whose records answer the same checks, turning the rules of those checks `"off"` there. Beside it, it writes `hone.eslint.d.mts`, which types the projection's default export as ESLint's `Linter.Config[]`. Commit both, and spread the default export of the projection last in the repository's flat config:
70
+ With any check listed for `eslint`, run `hone project`. It writes `hone.eslint.mjs` at the repository root, which turns the listed checks' rules on and off where records answer them, and `hone.eslint.d.mts`, which types it. Commit both, and spread the default export of the projection last in the repository's flat config:
133
71
 
134
72
  ```js
135
73
  import hone from "./hone.eslint.mjs";
@@ -140,15 +78,7 @@ export default [
140
78
  ];
141
79
  ```
142
80
 
143
- This is the only supported way to adopt the checks. On every run, Hone reads the team's resolved configuration for each checked file and fails the run if the projection is missing, not in effect, or differs from what `hone project` would write now, with the line that says what to do:
144
-
145
- ```text
146
- engine-not-run eslint missing: hone.eslint.mjs is not written; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every file it writes
147
- engine-not-run eslint not-included: the eslint configuration leaves the projection out of effect for a file under check; spread the default export of hone.eslint.mjs, or of a package's own hone.eslint.mjs in that package, last in the configuration that file loads, after every other block (an import placed last without the spread applies nothing), or, where a tool such as sku generates the configuration, last in the configuration the tool takes
148
- eslint out-of-date: hone.eslint.mjs differs from what hone project writes now; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every file it writes
149
- ```
150
-
151
- The command on these lines runs the entry file of the Hone that ran the check with `node`, with the repository the check measured, both as absolute paths with forward slashes, so it runs as printed from any directory; the lines above show an install at `/work/shop`. Re-run `hone project` after changing the checks or the records.
81
+ This is the only supported way to adopt the checks. On every run, Hone reads the team's resolved configuration for each checked file and fails the run if the projection is missing, not in effect, or differs from what `hone project` would write now, with a line that says what to run. Re-run `hone project` after changing the checks or the records.
152
82
 
153
83
  ### Package slices
154
84
 
@@ -160,17 +90,11 @@ import hone from "./hone.eslint.mjs";
160
90
  export default [{ files: ["**/*.{ts,tsx,mts,cts}"] }, ...hone];
161
91
  ```
162
92
 
163
- A package with no `eslint.config.*` of its own is linted by the nearest config above it, so its records stay in that config's slice. A file is governed by the deepest config root that contains it. A folder holding its own `hone.config.json` is a nested Hone configuration, which is not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)): when the ESLint engine would check a file under it, `check` and `project` stop before anything is checked or written, while a run that lists only walker checks does not stop, as `load failure: not-ready-yet eslint-config-roots: this release does not run a repository that holds other version 2 repositories yet; folders holding hone.config.json: <folders>; move them out of this repository, and run each on its own with --repo`. A folder holding one and no file the run would check gets no slice, and nor does anything under it. Either fix works today: run the folder on its own with `--repo`, as the line says, or govern it from this repository by removing its `hone.config.json` and keeping its records here, after which `hone project` writes its slice.
93
+ A package with no `eslint.config.*` of its own is linted by the nearest config above it, so its records stay in that config's slice. A file is governed by the deepest config root that contains it. A folder holding its own `hone.config.json` is a nested Hone configuration, which is not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)): when the ESLint engine would check a file under it, `check` and `project` stop before anything is checked or written, while a run that lists only walker checks does not stop. A folder holding one and no file the run would check gets no slice, and nor does anything under it. Either fix works today: run the folder on its own with `--repo`, as the line says, or govern it from this repository by removing its `hone.config.json` and keeping its records here, after which `hone project` writes its slice.
164
94
 
165
95
  A config root keeps its slice even where a config above it ignores its folder: a lint run from that folder loads its own config and never reads the ignores above it, so `hone project` writes the same slices from the same inputs every time. A repository with only a root config gets exactly the projection it had before.
166
96
 
167
- The check reports each package slice under the engine, naming the slice, whether it is the projection or its `hone.eslint.d.mts` that is out of date or missing. A package whose config spreads the root projection or nothing instead of its slice has its records out of effect, so the check reports `engine-not-run eslint not-included` rather than trusting a finding it could not have measured. A package that spreads the root projection is reported only once a record answers a file in it, since until then both projections give that package the same rules; one that spreads nothing is reported at once. A folder listed under `eslintConfigRoots` with no `eslint.config.*` on disk is unconfigured: nothing there can load its slice, so Hone would otherwise say nothing about that package; generate its config before the check runs, as a tool such as sku does on any of its commands:
168
-
169
- ```text
170
- eslint out-of-date packages/a/hone.eslint.mjs: that slice differs from what hone project writes now; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every file it writes
171
- eslint missing packages/a/hone.eslint.mjs: that slice is not written; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit every file it writes
172
- eslint unconfigured packages/a/hone.eslint.mjs: packages/a has no eslint configuration file on disk, so nothing loads that slice; run the tool that generates it (for sku, sku configure) before the check
173
- ```
97
+ The check reports each package slice that is missing, out of date or not in effect. A package that spreads the root projection is reported only once a record answers a file in it, since until then both projections give that package the same rules; one that spreads nothing is reported at once. A folder listed under `eslintConfigRoots` with no `eslint.config.*` on disk is reported too: generate its config before the check runs, as a tool such as sku does on any of its commands.
174
98
 
175
99
  A debt record stays in the projection after it is forfeited, so the team's own ESLint run keeps ignoring that file; Hone's check is what fails it, as `forfeited`.
176
100
 
@@ -195,13 +119,13 @@ At the repository root. It lists the checks the repository runs and the engine t
195
119
  - `ruleSets` names the repository's own rule sets, each a folder relative to the repository root, or `"."` for the root. The name `hone` is reserved for the rule set shipped with the tool; `hone/authored-class-or-this#class-keyword` and `authored-class-or-this#class-keyword` are the same address. A rule-set name may not start with `hone-`, and no declared name may be another declared name plus `-<suffix>`.
196
120
  - `checks` maps a check address to an engine id, to `"not-run"` or to `"not-adopted"`. An address is `[<ruleSet>/]<symptom>#<check>`; no prefix means the `hone` rule set. The engine must be one the check lists.
197
121
  - Listing a check adopts it, and only a listed check runs. A check of a symptom that a listed check sees, listed nowhere, is offered under `available`; it never fails the run, so a new check in a later Hone never turns a run red by itself.
198
- - `"not-run"` states that the check is adopted and binds the repository, but its engine is not run: the check is not a true measure of the rule's intent here, or cannot work here. The rule is enforced by review. `"not-adopted"` states that the check does not apply to the repository. Either way the check is never run and never projected, and its engine is not loaded unless another check uses it. The report lists it under `not-run`, as `<check> adopted, engine not run: enforced by review`, or under `not-adopted`; both are informational, and the run is still a whole assessment. No engine may be named `not-run` or `not-adopted`.
122
+ - `"not-run"` states that the check is adopted and binds the repository, but its engine is not run: the check is not a true measure of the rule's intent here, or cannot work here. The rule is enforced by review. `"not-adopted"` states that the check does not apply to the repository. Either way the check is never run and never projected, and its engine is not loaded unless another check uses it. The report lists it under `not-run` or `not-adopted`; both are informational, and the run is still a whole assessment. No engine may be named `not-run` or `not-adopted`.
199
123
  - `eslintConfigLookup`, optional, is `"nearest-to-file"` or `"repository-root"` and says which `eslint.config.*` the team's own ESLint run applies to a file; see [Runtime](#runtime). Leave it out to let Hone detect it.
200
- - `eslintConfigRoots`, optional, lists repository folders that get their own projection slice under either lookup although they track no `eslint.config.*`, such as a package whose config a tool generates and ignores; see [Package slices](#package-slices). Globs are refused. Each entry must be a folder git tracks files under outside every `exclude` path, spelled exactly as git spells it; any other entry stops the run before anything is checked or written, as `load failure: config-root-untracked <folder>:` with what to fix.
124
+ - `eslintConfigRoots`, optional, lists repository folders that get their own projection slice under either lookup although they track no `eslint.config.*`, such as a package whose config a tool generates and ignores; see [Package slices](#package-slices). Globs are refused. Each entry must be a folder git tracks files under outside every `exclude` path, spelled exactly as git spells it; any other entry stops the run before anything is checked or written.
201
125
  - `forfeiture`, optional, is `"this-run"` (the default) or `"elsewhere"`, and says which run assesses whether debt is forfeited; `--forfeiture` overrides it for one run; see [Commands](#commands).
202
126
  - `reportOutput`, optional, is `"full"` (the default), `"actionable"`, `"counts"` or `"verdict-only"`: the repository's default for how much of the report the check prints. `--report-output` overrides it for one run; see [Commands](#commands).
203
127
  - `checkEditions`, optional, is `"pinned"` (the default) or `"latest"`. A check that has been tightened has more than one edition, listed on its check page. `"pinned"` runs each check's default edition, which changes only in a major release; `"latest"` runs the newest edition the installed Hone has for every listed check, so a minor release can add findings. `"edition"` in a check's `checkSettings` holds that one check to the edition it names over either. The report lists the edition each such check ran under `editions`.
204
- - `checkSettings`, optional, maps a listed check address to an object of that check's settings, for a check whose page lists settings. Each key must be one the check's piece declares, and its value must be the same JSON kind as the declared default and, where the piece lists choices, one of them; the value replaces the default. Anything else makes `hone.config.json` malformed, naming the check, the key and what is accepted; `confinedPackages` is refused there, as the setting is now `confinedOutsideDependencies`.
128
+ - `checkSettings`, optional, maps a listed check address to an object of that check's settings, for a check whose page lists settings. Each key must be one the check's piece declares, and its value must be the same JSON kind as the declared default and, where the piece lists choices, one of them; the value replaces the default. Anything else makes `hone.config.json` malformed, naming the check, the key and what is accepted.
205
129
  - `exclude`, optional, lists repository folders or exact files that no engine checks. A folder entry covers everything under it. Globs are refused: an entry containing `*` makes `hone.config.json` malformed. The report lists the active entries under `excluded`. Exclude Hone's own install when it is vendored inside the repository.
206
130
  - `generated` and `layers`, optional, are declared for checks that will read them; no check reads either yet, and the report says so under `settings-notes`.
207
131
 
@@ -209,30 +133,7 @@ The keys version 1's `disciplines.json` used under other names are refused, each
209
133
 
210
134
  ## hone-records
211
135
 
212
- A folder at the repository root; without it, no record answers any finding. It holds the records that answer findings, one file for each kind and symptom or recipe, each a document `{ "version": 2, "records": [...] }`:
213
-
214
- ```text
215
- hone-records/
216
- debt/
217
- claimed-type.json
218
- authorised-locations/
219
- claimed-type.json
220
- deviations/
221
- adapter-per-outside-party.json
222
- boundary-records.json
223
- dependency-records.json
224
- ```
225
-
226
- A file in the wrong folder or under a name that is not a catalogue name is still read, and its records are refused as `misplaced` or `not-a-records-name`, naming where each belongs. Each record answers the findings it reaches, and names what it reaches by the symptom's name, or by `<symptom>#<check>` to reach one check of it.
227
-
228
- ```json
229
- {
230
- "version": 2,
231
- "records": [
232
- { "answers": "claimed-type#cast-expressions", "file": "src/legacy.ts", "note": "..." }
233
- ]
234
- }
235
- ```
136
+ A folder at the repository root; without it, no record answers any finding. It holds the records that answer findings, one file for each kind and symptom or recipe, each a document `{ "version": 2, "records": [...] }`. A file in the wrong folder or under a name that is not a catalogue name is refused, naming where each record belongs. Each record names what it reaches by the symptom's name, or by `<symptom>#<check>` to reach one check of it. [rules/records.md](rules/records.md) says what each kind is for.
236
137
 
237
138
  - **Debt** is in `hone-records/debt/<symptom>.json`: `answers`, `file` and an optional `note`, a note to future developers on what the debt signals, which nothing reads. It says a finding in one file is owed. It needs no case and no why-chain; forfeiture is what holds it: it is forfeited once its file is touched.
238
139
  - **An authorised location** is in `hone-records/authorised-locations/<symptom>.json`: `answers`, `file`, `case` and `owes`, naming the case the file is and the principle it owes, and a `whyChain`. It says the symptom is correct in that file. [`hone authorise`](#commands) writes one from the arguments it is given.
@@ -240,23 +141,7 @@ A file in the wrong folder or under a name that is not a catalogue name is still
240
141
  - **A boundary record** is in `hone-records/boundary-records.json`: `module`, `outsideParty` (a runtime facility such as `runtime:clock`, or an outside module's specifier), the `ports` the module declares and an optional `conformist`. It says the module is where an outside party is met.
241
142
  - **A dependency record** is in `hone-records/dependency-records.json`: `dependency`, `nativeWay`, `whyNotEnough` and an optional `peerRisk`. It says why a package is used where the platform's own way exists.
242
143
 
243
- An `authorised-location` follows the [why-chain contract](docs/why-chain-contract.md): exactly five `{ "why", "because", "evidence" }` steps chained cause to cause, then `rootCause`, `rootEvidence`, `readback` and `owner`. The contract lists what Hone refuses and what review still judges:
244
-
245
- ```json
246
- "whyChain": {
247
- "whys": [
248
- { "why": "...", "because": "...", "evidence": "..." },
249
- { "why": "...", "because": "...", "evidence": "..." },
250
- { "why": "...", "because": "...", "evidence": "..." },
251
- { "why": "...", "because": "...", "evidence": "..." },
252
- { "why": "...", "because": "...", "evidence": "..." }
253
- ],
254
- "rootCause": "...",
255
- "rootEvidence": "...",
256
- "readback": "...",
257
- "owner": "..."
258
- }
259
- ```
144
+ An authorised location's `whyChain` follows the [why-chain contract](docs/why-chain-contract.md), which gives its shape, what Hone refuses and what review still judges.
260
145
 
261
146
  - A record that `hone upgrade` moved from version 1 keeps its old entry word for word under a `carried` key, in place of the keys version 1 did not hold. The check lists it under `carried`, with what it lacks, and judges it against `--base-revision`: it is `established` when the base held it unchanged and `unjudged` when the run could not compare it; a carried record changed since the base is refused as `carried-changed-since-base`. [MIGRATING.md](MIGRATING.md#20-moving-from-version-1-to-version-2) section 20 describes them.
262
147
  - A record the catalogue does not recognise, or whose form is wrong, is refused with its records file and index, and the run fails. A record that names a case or an `owes` the catalogue does not list is kept, with a note under `record-notes`.
@@ -266,7 +151,7 @@ An `authorised-location` follows the [why-chain contract](docs/why-chain-contrac
266
151
 
267
152
  ## Installing
268
153
 
269
- Hone installs as one npm package, `@hailstails/hone`, installed from npm at an exact version, `@hailstails/hone@<version>` with `--save-exact`, downloaded as the tarball `hailstails-hone-<version>.tgz` attached to a GitHub release, or built by `pnpm run pack-package` into `artefacts/hailstails-hone-<version>.tgz`, the file name `npm pack` gives the scoped package, and added to the repository root as a development dependency; [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps. The package is plain JavaScript holding only Hone's own code. It declares `zod`, `jsonc-parser` and `@eslint/plugin-kit` as `dependencies`, each as a caret range starting at the version `pnpm-lock.yaml` locks, so the package manager installs them from the registry, and the repository's own audit tools see them as it does any other dependency. Which release inside each range is installed is decided by the repository's own lockfile and overrides, so a patched release can be taken without waiting for a new Hone. It declares the toolchain as `peerDependencies`, `typescript` required and the ESLint packages optional, and exposes one command, `hone`, whose six subcommands are described under [Commands](#commands). It ships the rule data and pages, both mechanisms, the review methods and the why-chain contract, and no TypeScript source, only the declaration files of the public type entries below.
154
+ Hone installs as one npm package, `@hailstails/hone`, installed from npm at an exact version, `@hailstails/hone@<version>` with `--save-exact`, downloaded as the tarball `hailstails-hone-<version>.tgz` attached to a GitHub release, or built by `pnpm run pack-package` into `artefacts/hailstails-hone-<version>.tgz`, the file name `npm pack` gives the scoped package, and added to the repository root as a development dependency; [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps. The package is plain JavaScript holding only Hone's own code. It declares its own `dependencies` as caret ranges starting at the version `pnpm-lock.yaml` locks, so the package manager installs them from the registry, and the repository's own audit tools see them as it does any other dependency. Which release inside each range is installed is decided by the repository's own lockfile and overrides, so a patched release can be taken without waiting for a new Hone. It declares the toolchain as `peerDependencies`, `typescript` required and the ESLint packages optional, and exposes one command, `hone`, described under [Commands](#commands). It ships the rule data and pages, both mechanisms, the review methods and the why-chain contract, and no TypeScript source, only the declaration files of the public type entries below.
270
155
 
271
156
  With the ESLint mechanism selected, a packaged install's projection imports one plugin, `@hailstails/hone/eslint-plugin`, registered under the namespace `hone`, so the repository's ESLint must resolve the package from the repository root. Hone compares the committed projection `hone.eslint.mjs` and its declaration `hone.eslint.d.mts` byte for byte with what `hone project` would write now.
272
157
 
@@ -285,16 +170,16 @@ Each resolves with `moduleResolution` `"nodenext"` or `"bundler"`. `install-proo
285
170
  ## Runtime
286
171
 
287
172
  - Windows, Linux, macOS or WSL. Hone keeps absolute paths in the platform's own form and repository paths in POSIX form, as git reports them. CI proves Windows and Linux; macOS is not proven in CI.
288
- - The package: Node `^22.18.0 || >=24` (its `engines.node`). It is plain JavaScript, so Node never strips types from it, and from 22.18.0 Node strips types from a rule set's `.ts` piece modules, within the limits [ADOPTING.md](ADOPTING.md#1-check-the-prerequisites) lists.
173
+ - The package: the Node versions its `engines.node` declares. It is plain JavaScript, so Node never strips types from it, and Node strips types from a rule set's `.ts` piece modules, within the limits [ADOPTING.md](ADOPTING.md#1-check-the-prerequisites) lists.
289
174
  - git 2.24 or later. Older git rejects `--end-of-options`, so the changed-file query fails and forfeiture is reported unmeasured.
290
- - Hone's own packages, `zod`, `jsonc-parser` and `@eslint/plugin-kit`, declared in `dependencies` as caret ranges whose floor is the version `pnpm-lock.yaml` locks, which is the version Hone is tested on. A caret range keeps to one major version, and for a `0.x` package to one minor. The repository's package manager installs a release inside each range, and the packages it depends on, where Hone resolves it; the repository's lockfile, and any override it sets, decides which release. They are implementation details: nothing of theirs crosses into the repository's code or configuration. A repository that uses `zod` itself may share one copy with Hone when its version is inside Hone's range, as package managers do for compatible versions, and otherwise keeps its own copy beside Hone's.
291
- - The repository's own toolchain, declared as `peerDependencies`: `typescript` `>=4.8.4 <7.0.0`, a required peer because every audit clause needs it, and for the ESLint mechanism the optional peers `eslint` `^9.39.5 || ^10.15.0`, `@typescript-eslint/parser` `^8.73.0` and `@typescript-eslint/eslint-plugin` `^8.73.0`. npm 7 and later install a missing required peer on their own, so declare `typescript` at the root at the version the repository uses. Hone supports the latest release of each supported major, ESLint 9.39.5 and 10.15.0 and typescript-eslint 8.73.0, and raises those floors deliberately as new releases land. TypeScript 4.8 is the oldest whose syntax API the audit uses (`getModifiers`). TypeScript stops below 7 because TypeScript 7's compiler API is a different one. Yarn Plug'n'Play is not supported.
175
+ - Hone's own packages, declared in `dependencies` as caret ranges whose floor is the version `pnpm-lock.yaml` locks, which is the version Hone is tested on. The repository's lockfile, and any override it sets, decides which release inside each range is installed. They are implementation details: nothing of theirs crosses into the repository's code or configuration.
176
+ - The repository's own toolchain, declared as `peerDependencies`: `typescript` required, because every walker check needs it, and the ESLint packages optional, for the ESLint mechanism. Declare `typescript` at the root at the version the repository uses. TypeScript stops below 7 because TypeScript 7's compiler API is a different one. Yarn Plug'n'Play is not supported.
292
177
 
293
- Hone loads the toolchain by Node's own resolution, upward from the install directory, which is the same resolution the pieces' plugin modules get when the team's ESLint loads the projection. Hone's query of the team's configuration, its governance run and the pieces therefore all use one copy, the repository's. Keep the toolchain resolvable from the repository root: declare it in the root `package.json` (in a pnpm workspace, `pnpm add -Dw`). A package may install a different ESLint for its own lint script; Hone's verdict still comes from the root's, its governance behaviour is the same on either supported line, and the pieces that wrap native rules wrap the root's copies there too. Hone's tests run the governance path and every piece's shared cases on two ESLint lines, 9.39.5 and 10.15.0, with typescript-eslint 8.73.0, and the audit pieces' shared cases on TypeScript 4.8.4 and 6.0.3; the in-process consumer fixtures run on ESLint 10.15.0, and `install-proof` runs real consumers on each supported ESLint major.
178
+ Hone loads the toolchain by Node's own resolution, upward from the install directory, which is the same resolution the pieces' plugin modules get when the team's ESLint loads the projection. Hone's query of the team's configuration, its governance run and the pieces therefore all use one copy, the repository's. Keep the toolchain resolvable from the repository root: declare it in the root `package.json` (in a pnpm workspace, `pnpm add -Dw`). A package may install a different ESLint for its own lint script; Hone's verdict still comes from the root's, its governance behaviour is the same on either supported line, and the pieces that wrap native rules wrap the root's copies there too.
294
179
 
295
- A peer that is missing, cannot load, or is outside its range stops the engine before any piece loads, with one line such as `load failure: engine-failed eslint toolchain-unavailable eslint found not installed, supported ^9.39.5 || ^10.15.0: add a supported version to the devDependencies of the repository root`. The line names every peer of that mechanism that is unavailable, separated by `; `, and then asks for a supported version of each, so one install fixes them all. A `typescript` that is not installed at all is reported the same way, with the line saying that `typescript` is a required peer of `@hailstails/hone` and the install is incomplete, since a supported install always has it; one that is installed but out of range or unloadable gets the plain line. A peer that resolves from inside the installed package, such as an `eslint` left in `node_modules/@hailstails/hone/node_modules`, stops it as `toolchain-shadowed`, naming where it resolved and the folder to delete before reinstalling core. A source checkout of Hone is its own development install, so its development toolchain in its own `node_modules` is not a shadow.
180
+ A peer that is missing, cannot load, or is outside its range stops the engine before any piece loads, with one line naming every such peer and what to install. A peer that resolves from inside the installed package stops it too, naming the folder to delete before reinstalling.
296
181
 
297
- A repository can hold one `eslint.config.*` at its root or one per package. Hone resolves the team's configuration the way the team's own ESLint run does. ESLint 10, and ESLint 9 started with `--flag v10_config_lookup_from_file` (or `unstable_config_lookup_from_file`), use the `eslint.config.*` nearest each checked file. Plain ESLint 9 uses only the one in the directory it runs from, so for a repository whose `eslint` resolves to 9.x at `node_modules/eslint` and whose lint scripts carry no such flag, Hone reads the root `eslint.config.*` for every file, and fails the run as `team-config-unloadable` if there is none. When Hone cannot read an installed `eslint` at the repository root it assumes the nearest-to-file lookup. Each config that applies to a file must spread its projection: the root config the root projection, each package config its own slice; see [Package slices](#package-slices). A config that fails to load stops the run as `team-config-unloadable`, naming the config, the checked file it applies to and ESLint's message, then the next step: fix that config. Only if its folder holds nothing Hone should check, add it to `exclude` in `hone.config.json` instead. A broken config in a folder that the repository's own ESLint never enters does not stop the run. Before failing, Hone asks the config that governs that folder, and each config above it up to the root, whether it really ignores both that folder and the file; a file that no `files` block matches is not taken for an ignored one. If one does, the file is treated like any other file the team's ESLint ignores and reported as an `ignore` native exception. Hone asks about a folder through a file inside it, so one gap remains: an ignore that matches every entry directly inside the folder but not the folder itself, such as `gen/*`, counts as ignoring `gen`, and Hone reports its files as ignored where the team's `eslint .` still loads the broken `gen/eslint.config.*` and fails. A file that no `eslint.config.*` applies to stops the run the same way, and the next step is to create one at the repository root that spreads the projection, as [ADOPTING.md](ADOPTING.md) step 4a shows. Detection cannot see how a task runner starts ESLint, so `hone.config.json` can state the lookup: `"eslintConfigLookup": "nearest-to-file"` or `"repository-root"`, which overrides detection. Both lookups are tested against monorepo fixtures with a config per package.
182
+ A repository can hold one `eslint.config.*` at its root or one per package. Hone resolves the team's configuration the way the team's own ESLint run does. ESLint 10, and ESLint 9 started with `--flag v10_config_lookup_from_file` (or `unstable_config_lookup_from_file`), use the `eslint.config.*` nearest each checked file. Plain ESLint 9 uses only the one in the directory it runs from, so for a repository whose `eslint` resolves to 9.x at `node_modules/eslint` and whose lint scripts carry no such flag, Hone reads the root `eslint.config.*` for every file, and fails the run if there is none. When Hone cannot read an installed `eslint` at the repository root it assumes the nearest-to-file lookup. Each config that applies to a file must spread its projection: the root config the root projection, each package config its own slice; see [Package slices](#package-slices). A config that fails to load stops the run, naming the config, the checked file it applies to and ESLint's message: fix that config. Only if its folder holds nothing Hone should check, add it to `exclude` in `hone.config.json` instead. A broken config in a folder that the repository's own ESLint never enters does not stop the run. Before failing, Hone asks the config that governs that folder, and each config above it up to the root, whether it really ignores both that folder and the file; a file that no `files` block matches is not taken for an ignored one. If one does, the file is treated like any other file the team's ESLint ignores and reported as an `ignore` native exception. Hone asks about a folder through a file inside it, so one gap remains: an ignore that matches every entry directly inside the folder but not the folder itself, such as `gen/*`, counts as ignoring `gen`, and Hone reports its files as ignored where the team's `eslint .` still loads the broken `gen/eslint.config.*` and fails. A file that no `eslint.config.*` applies to stops the run the same way, and the next step is to create one at the repository root that spreads the projection, as [ADOPTING.md](ADOPTING.md) step 4a shows. Detection cannot see how a task runner starts ESLint, so `hone.config.json` can state the lookup: `"eslintConfigLookup": "nearest-to-file"` or `"repository-root"`, which overrides detection. Both lookups are tested against monorepo fixtures with a config per package.
298
183
 
299
184
  ## Compatibility
300
185
 
@@ -345,19 +230,19 @@ This repository is self-contained: it holds its own configuration and its own lo
345
230
  | `format` | oxfmt with `.oxfmtrc.json`, writing the formatted files |
346
231
  | `test` | Vitest with `vitest.config.ts` |
347
232
  | `check` | typecheck, the oxfmt check and the tests in that order |
348
- | `build-package` | `node scripts/build-package.ts`: compiles Hone's own code with esbuild into `dist/`, leaving each declared peer and dependency to be imported by name, and adds the published `package.json`, which declares the dependencies at the ranges `package.json` declares, and the shipped documents and data. It fails if a dependency is not declared as a caret range of one release, if that range's floor is not the version the lock's root importer holds, or if the lock does not hold it, if an output imports anything but a `node:` builtin, a declared peer or a declared dependency, if an output carries an installed package's code, if a command or runner is not emitted at its own path with its own code, or if a shipped page links to a file the package does not ship. The tool's name, package name, command name, shipped rule-set name, reserved ESLint namespace, description, GitHub repository and the unrelated npm name to warn against live in `core/values/tool-identity.ts`, which the build, the install proof, the release text, the command's usage line and the ESLint runner all read. The reserved namespace is its own field, independent of the package name |
349
- | `pack-package` | `node scripts/pack-package.ts`: builds `dist/` and packs it with `npm pack` into `artefacts/hailstails-hone-<version>.tgz`, named by the `version` in `package.json` |
350
- | `package-determinism` | `node scripts/check-package-determinism.ts`: builds and packs twice into separate temporary roots and fails naming any file that differs, or when the two packed tarballs differ |
351
- | `self-check` | `node scripts/self-check.ts check --repo .`: runs Hone's own check on this repository with `disciplines.json` and the exception records in its `discipline-exceptions` folder; pass `--base-revision <rev>` after the script name. See [Core's check on itself](#hones-check-on-itself) |
352
- | `install-proof` | `node scripts/install-proof.ts`: packs the package once into a temporary tarball, or, given `--tarball <path>` after the script name, copies that already packed tarball there instead, and installs it with pnpm into six CommonJS consumers in an OS temporary directory outside the working tree, each copied from its folder under `tests/test-fixtures/consumer-proof/`, which holds only what that consumer's action needs. Each consumer exists for one thing only an installed package shows. The audit consumer, on TypeScript 4.8.4, runs `check` through the installed bin and expects its finding. The ESLint 9.39.5 and 10.15.0 consumers run `project`, expect a projection importing the piece by package name, and expect its finding from `check`. The consumer without `eslint` expects `toolchain-unavailable`. These four run with type stripping off. The team consumer is the example [docs/extending.md](docs/extending.md) follows. On TypeScript 4.8.4 it type-checks a wrong team piece, rule set and ESLint piece settings with its own `tsc`, as described under Public type entries, and expects the three errors. On the development versions, TypeScript 6.0.3, ESLint 10.15.0 and typescript-eslint 8.73.0, it also type-checks its rule set under `nodenext` and `bundler` and a CommonJS file, then runs both commands with type stripping on: its `.ts` pieces load through the installed package and give one finding from each mechanism under the team's `acme/` prefix. Its root says `"type": "commonjs"`, the hard case, so its rule set carries its own `"type": "module"` `package.json`. Each consumer declares its toolchain at exact pins in its own `devDependencies`, as an adopter does: TypeScript 4.8.4 alone for the audit consumer, the consumer without `eslint` and the team consumer on 4.8.4; ESLint 9.39.5 with typescript-eslint 8.73.0 and TypeScript 4.8.4 for the ESLint 9 consumer; ESLint 10.15.0 with typescript-eslint 8.73.0 and the development TypeScript for the ESLint 10 consumer and the workspace; and the development versions for the team consumer. It declares the tarball beside them, pins the pnpm version this repository's `package.json` pins, and waits this repository's `minimumReleaseAge`. pnpm's store shares each toolchain package between consumers. The proof prints where pnpm put the installed package, checks that each of Hone's dependencies is installed beside it at a release inside its published range, and expects the report to name its pages through the consumer's `node_modules/@hailstails/hone` instead, and it runs `check` through the package script with its options after `--`, as an adopter's pre-push hook does. A pass once a violation is removed, rule-set naming, plugin namespaces, settings overrides and per-package ESLint configs are proven by unit and in-process tests instead. The temporary directory is removed afterwards |
353
- | `pull-request-title` | `node scripts/pull-request-title-command.ts <title>`: passes a title shaped as a Conventional Commits subject, `type(scope)!: description`, and fails any other with the expected form. See [Versions and releases](#versions-and-releases) |
354
- | `release-pull-request` | `node scripts/release-pull-request-command.ts [pre-release\|stable]`: writes the next release's section into `CHANGELOG.md` and its version into `package.json`, in the working tree only. See [Versions and releases](#versions-and-releases) |
233
+ | `build-package` | Builds the published package into `dist/`, and fails on anything the package must not ship, such as an undeclared import, a bundled dependency or a page linking to a file the package does not ship |
234
+ | `pack-package` | Builds `dist/` and packs it with `npm pack` into `artefacts/hailstails-hone-<version>.tgz`, named by the `version` in `package.json` |
235
+ | `package-determinism` | Builds and packs twice into separate temporary roots and fails naming any file that differs, or when the two packed tarballs differ |
236
+ | `self-check` | Runs Hone's own check on this repository; pass `--base-revision <rev>` after the script name. See [Hone's check on itself](#hones-check-on-itself) |
237
+ | `install-proof` | Packs the package, or takes `--tarball <path>`, and installs it into the consumers under `delivery/install-proof/consumer-proof/` in a temporary directory, each proving one thing only an installed package shows |
238
+ | `pull-request-title` | Passes a title shaped as a Conventional Commits subject, `type(scope)!: description`, and fails any other with the expected form. See [Versions and releases](#versions-and-releases) |
239
+ | `release-pull-request` | Writes the next release's section into `CHANGELOG.md` and its version into `package.json`, in the working tree only. See [Versions and releases](#versions-and-releases) |
355
240
 
356
241
  ### Hone's check on itself
357
242
 
358
- `disciplines.json` selects every mechanical clause Hone ships, through the mechanism it names, confines the `eslint` package under `confinedPackages`, the setting of `outside-import-past-a-boundary#import-or-require` (clause `CD-19#import-boundaries`), and excludes `tests/test-fixtures/consumer-proof`: those folders are package-test content, the files of other repositories that `install-proof` copies out and checks with their own Hone run. `eslint.config.mjs` spreads the committed `disciplines.eslint.mjs` projection, which `node scripts/self-check.ts project --repo .` regenerates. Hone keeps its exception records in [the split layout](MIGRATING.md#16-moving-to-the-split-layout): `discipline-exceptions/authorised-locations/cd-19.json` holds eight `authorised-location` records for `CD-19#import-boundaries`, each the single file that binds a runtime or third-party surface; seven are imported, with `existing-authorisation` provenance, from the earlier records kept in `.constitution-authorised-locations/cd-19.json`, and the eighth, for `mechanisms/eslint/runner/native-rules.ts`, carries its own why-chain. Strictness lives in `tsconfig.base.json`, which `tsconfig.json` extends; `tsconfig.json` leaves the same consumer folders out, since their files compile against the installed package.
243
+ Hone checks itself with its own `hone.config.json` and the records in `hone-records/`. The consumer folders `install-proof` copies out are excluded, since they are other repositories checked by their own Hone run.
359
244
 
360
- `self-check` prints Hone's full report on itself, then one `self-check:` line. It fails when the run cannot load, or when any of `uncovered`, `stale`, `forfeited`, `doublyHeld`, `invalidRecords`, `unmeasured` or `projectionProblems` holds an entry: that is, when the selection, the exception records or the projection are not sound. It does not fail on `findings` or `unrecorded`. Those are printed in full and counted in the `self-check:` line, but they do not gate a change yet: the test fixtures hold deliberate violations, and some of Hone's own code does not meet every selected clause. CI runs `self-check` on every change with the pull request's base, or the previous `main`, as the base revision.
245
+ `self-check` prints Hone's full report on itself, then one `self-check:` line. It fails when the selection, the records or the projection are not sound, and not on findings, which it prints and counts. CI runs it on every change with the pull request's base, or the previous `main`, as the base revision.
361
246
 
362
247
  Continuous integration runs on every pull request, drafts included, and on every push to `main`, from `pnpm-lock.yaml` alone, in two jobs, both required checks. They run side by side on the oldest claimed Node. Linux runs `check`, `self-check` and `package-determinism`, packs as the release does, and proves the tarball installs on a newer Node. Windows packs and proves its own tarball. A third job fails when the two tarballs differ. macOS is not proven in CI. A separate workflow, `pull-request-title.yml`, runs `pull-request-title` on each pull request's title whenever the pull request is opened, edited, reopened, marked ready or pushed to.
363
248
 
@@ -592,7 +592,7 @@ When version 2 is in place but a version 1 file could not be removed, it prints
592
592
  | `upgrade` | `<check> has no engine on the <mechanism> mechanism. This is a fault in hone, not in your repository. Report it at <issues page>, with this output.` |
593
593
  | `upgrade` | `<check> could run on <engines> through the <mechanism> mechanism; the upgrade cannot choose. This is a fault in hone, not in your repository. Report it at <issues page>, with this output.` |
594
594
  | `upgrade` | `the file carve-out for <clause> in <file> answers no finding. Remove it, or fix the file it names, then run the upgrade again.` |
595
- | `upgrade` | `the file carve-out for <clause> in <file> answers only a suppression. Remove it, or fix the file it names, then run the upgrade again.` |
595
+ | `upgrade` | `the file carve-out for <clause> in <file> answers only a suppression no version 2 record can hold. Remove it, or fix the file it names, then run the upgrade again.` |
596
596
  | `upgrade` | `<name> is not a name version 2 can file records under. This is a fault in hone, not in your repository. Report it at <issues page>, with this output.` |
597
597
  | `upgrade` | `version 2's projection could not be made (<detail>). Fix what it names, then run the upgrade again.` |
598
598
  | `upgrade` | `version 2 cannot run this repository yet (<detail>). Do what it names, or stay on version 1 until version 2 runs it, then run the upgrade again.` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hailstails/hone",
3
- "version": "2.0.0-pre.1",
3
+ "version": "2.0.0-pre.2",
4
4
  "description": "Checks a repository against the disciplines it selects, applies its recorded exceptions and prints one verdict.",
5
5
  "keywords": [
6
6
  "code-quality",