@hailstails/hone 2.0.0-pre.1 → 2.0.0-pre.3
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/ADOPTING.md +24 -190
- package/CHANGELOG.md +17 -0
- package/MIGRATING.md +5 -43
- package/README.md +39 -154
- package/chunks/{chunk-MWLBA4B3.js → chunk-Q62Y25WS.js} +44 -50
- package/docs/output-contract.md +1 -1
- package/package.json +1 -1
- package/src/hone.js +570 -232
- package/src/infrastructure/engines/eslint/runner/runner.js +30 -23
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +61 -45
- package/src/testing.js +1 -1
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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`,
|
|
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
|
|
102
|
-
- a file under a `--leave` path
|
|
103
|
-
- a file this change created or changed, when the run assesses forfeiture
|
|
104
|
-
- a finding the catalogue gives no symptom or check to record against, such as one of a team rule set's clauses
|
|
105
|
-
- a native exception no debt record can hold
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
291
|
-
- The repository's own toolchain, declared as `peerDependencies`: `typescript`
|
|
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.
|
|
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
|
|
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
|
|
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` |
|
|
349
|
-
| `pack-package` |
|
|
350
|
-
| `package-determinism` |
|
|
351
|
-
| `self-check` |
|
|
352
|
-
| `install-proof` |
|
|
353
|
-
| `pull-request-title` |
|
|
354
|
-
| `release-pull-request` |
|
|
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
|
-
|
|
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
|
|
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
|
|
|
@@ -213,25 +213,42 @@ var standaloneRunReportSchema = z3.object(
|
|
|
213
213
|
{ error: STANDALONE_RUN_SHAPE_MESSAGE }
|
|
214
214
|
).readonly();
|
|
215
215
|
|
|
216
|
+
// src/infrastructure/engines/protocol/engine-run/unrequested-entries.ts
|
|
217
|
+
var requestHeldOf = (request) => ({
|
|
218
|
+
files: new Set(request.files),
|
|
219
|
+
clauses: new Set(request.clauses.map((address) => clauseAddressText({ address })))
|
|
220
|
+
});
|
|
221
|
+
var clauseHeld = (request) => request.held.clauses.has(clauseAddressText({ address: request.clause })) ? "held" : "not-held";
|
|
222
|
+
var unrequestedDetailOf = (request) => {
|
|
223
|
+
const entry = request.entries.find(
|
|
224
|
+
(candidate) => !request.held.files.has(candidate.file) || clauseHeld({ held: request.held, clause: candidate.clause }) === "not-held"
|
|
225
|
+
);
|
|
226
|
+
return entry === void 0 ? [] : [
|
|
227
|
+
`${request.noun} names ${clauseAddressText({ address: entry.clause })} in ${entry.file}, which the request did not hold`
|
|
228
|
+
];
|
|
229
|
+
};
|
|
230
|
+
var unrequestedClauseDetailOf = (request) => {
|
|
231
|
+
const entry = request.entries.find(
|
|
232
|
+
(candidate) => clauseHeld({ held: request.held, clause: candidate.clause }) === "not-held"
|
|
233
|
+
);
|
|
234
|
+
return entry === void 0 ? [] : [
|
|
235
|
+
`${request.noun} names ${clauseAddressText({ address: entry.clause })}, which the request did not hold`
|
|
236
|
+
];
|
|
237
|
+
};
|
|
238
|
+
|
|
216
239
|
// src/infrastructure/engines/protocol/engine-run/standalone-mechanism-dispatch.ts
|
|
217
240
|
var STANDALONE_COVERABLE_KINDS = ["inline-disable"];
|
|
218
241
|
var NOTHING_MEASURED = [];
|
|
219
242
|
var standaloneResultSchema = runnerResultSchema({ value: standaloneRunReportSchema });
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
);
|
|
225
|
-
var firstUnrequestedDetail = (request) => request.groups.flatMap((group) => {
|
|
226
|
-
const unrequested = unrequestedEntry({
|
|
227
|
-
entries: group.entries,
|
|
228
|
-
run: request.run,
|
|
229
|
-
checkedFiles: request.checkedFiles
|
|
243
|
+
var firstUnrequestedDetail = (request) => {
|
|
244
|
+
const held = requestHeldOf({
|
|
245
|
+
files: request.checkedFiles,
|
|
246
|
+
clauses: request.run.clauses.map((clause) => clause.address)
|
|
230
247
|
});
|
|
231
|
-
return
|
|
232
|
-
|
|
233
|
-
];
|
|
234
|
-
}
|
|
248
|
+
return request.groups.flatMap(
|
|
249
|
+
(group) => unrequestedDetailOf({ noun: group.noun, entries: group.entries, held })
|
|
250
|
+
)[0];
|
|
251
|
+
};
|
|
235
252
|
var okOutcomeSchema = z4.object({ outcome: z4.literal("ok") });
|
|
236
253
|
var okStandaloneSchema = z4.object({ outcome: z4.literal("ok"), value: standaloneRunReportSchema });
|
|
237
254
|
var invalidStandaloneDetail = (request) => {
|
|
@@ -546,44 +563,21 @@ var standaloneRunOf = async (request) => {
|
|
|
546
563
|
});
|
|
547
564
|
return ran.outcome === "failed" ? runnerFailed({ mechanism: request.mechanism, failure: ran.error }) : { outcome: "ok", value: { ...ran.value, slices: [], misnamedRuleIds: [] } };
|
|
548
565
|
};
|
|
549
|
-
var unrequestedDetail = (request) => {
|
|
550
|
-
const entry = request.entries.find(
|
|
551
|
-
(candidate) => !request.files.includes(candidate.file) || !request.clauses.some(
|
|
552
|
-
(clause) => sameClauseAddress({ left: clause, right: candidate.clause }) === "same"
|
|
553
|
-
)
|
|
554
|
-
);
|
|
555
|
-
return entry === void 0 ? [] : [
|
|
556
|
-
`${request.noun} names ${clauseAddressText({ address: entry.clause })} in ${entry.file}, which the request did not hold`
|
|
557
|
-
];
|
|
558
|
-
};
|
|
559
|
-
var unrequestedNativeDetail = (request) => {
|
|
560
|
-
const entry = request.report.nativeExceptions.find(
|
|
561
|
-
(native) => !request.clauses.some(
|
|
562
|
-
(clause) => sameClauseAddress({ left: clause, right: native.clause }) === "same"
|
|
563
|
-
)
|
|
564
|
-
);
|
|
565
|
-
return entry === void 0 ? [] : [
|
|
566
|
-
`a native exception names ${clauseAddressText({ address: entry.clause })}, which the request did not hold`
|
|
567
|
-
];
|
|
568
|
-
};
|
|
569
566
|
var invalidReport = (request) => {
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
|
|
567
|
+
const held = requestHeldOf({
|
|
568
|
+
files: request.run.files,
|
|
569
|
+
clauses: clausesOf({ request: request.run, mechanism: request.mechanism }).map(
|
|
570
|
+
(clause) => clause.address
|
|
571
|
+
)
|
|
572
|
+
});
|
|
573
573
|
return [
|
|
574
|
-
...
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
noun: "a measured pair",
|
|
582
|
-
entries: request.report.measured,
|
|
583
|
-
files: request.run.files,
|
|
584
|
-
clauses
|
|
585
|
-
}),
|
|
586
|
-
...unrequestedNativeDetail({ report: request.report, clauses })
|
|
574
|
+
...unrequestedDetailOf({ noun: "a hit", entries: request.report.hits, held }),
|
|
575
|
+
...unrequestedDetailOf({ noun: "a measured pair", entries: request.report.measured, held }),
|
|
576
|
+
...unrequestedClauseDetailOf({
|
|
577
|
+
noun: "a native exception",
|
|
578
|
+
entries: request.report.nativeExceptions,
|
|
579
|
+
held
|
|
580
|
+
})
|
|
587
581
|
];
|
|
588
582
|
};
|
|
589
583
|
var engineRunOfReport = (request) => {
|
package/docs/output-contract.md
CHANGED
|
@@ -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