@hailstails/hone 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADOPTING.md +33 -7
- package/CHANGELOG.md +19 -0
- package/MIGRATING.md +31 -6
- package/README.md +64 -17
- package/api/audit.d.ts +7 -1
- package/api/audit.js +9 -1
- package/api/testing.js +36 -8
- package/chunks/{chunk-XE6RNNZB.js → chunk-5VXHQC4A.js} +1395 -1339
- package/chunks/{chunk-5X2BR42Y.js → chunk-FR4FASVM.js} +15 -24
- package/chunks/{chunk-RNXPEK2U.js → chunk-H4V72FCW.js} +2 -2
- package/chunks/chunk-MXSIQPCV.js +13 -0
- package/chunks/chunk-NA5L6PUE.js +15 -0
- package/chunks/{chunk-OVEQ37JQ.js → chunk-PL2PNPAR.js} +42 -17
- package/chunks/chunk-RWQ4UNKY.js +24 -0
- package/chunks/{chunk-OKQHVZLO.js → chunk-T32FOWZA.js} +1 -1
- package/chunks/{chunk-LHVFZMXD.js → chunk-Y2KPZDDV.js} +80 -20
- package/chunks/{chunk-YL6WR3QW.js → chunk-Y4SMWOD2.js} +1 -1
- package/chunks/chunk-YLZ73C7O.js +0 -0
- package/chunks/{chunk-NILRE23T.js → chunk-Z4UBS7WI.js} +1 -1
- package/core/check/tool-command.js +702 -22
- package/core/conformance/conformance-testing-types.d.ts +2 -0
- package/core/mechanism-port/runner-module-types.d.ts +2 -0
- package/core/rule-set-reader/authored-rule-set-types.d.ts +2 -0
- package/core/values/edition-types.d.ts +16 -0
- package/docs/extending.md +32 -10
- package/docs/output-contract.md +101 -15
- package/mechanisms/audit/CD-19/import-boundaries.js +3 -2
- package/mechanisms/audit/CD-27/piece.json +5 -1
- package/mechanisms/audit/CD-27/test-body-logic.js +55 -4
- package/mechanisms/audit/CD-3/compiler-overrides.js +193 -29
- package/mechanisms/audit/CD-3/piece.json +35 -7
- package/mechanisms/audit/CD-5/comments-directives.js +4 -3
- package/mechanisms/audit/runner/README.md +3 -2
- package/mechanisms/audit/runner/runner.js +45 -8
- package/mechanisms/audit/runner/walker-piece.d.ts +12 -0
- package/mechanisms/eslint/runner/runner.js +8 -4
- package/package.json +1 -1
- package/rules/CD-27/CHECKS.md +31 -1
- package/rules/CD-27/discipline.json +74 -0
- package/rules/CD-3/CHECKS.md +33 -9
- package/rules/CD-3/discipline.json +278 -0
package/ADOPTING.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This page takes a TypeScript repository from nothing to a checked, passing run. Do the steps in order. Every command is run from the root of the repository being checked, which this page calls `<repo>`. Nothing here needs AIDLC or any agent harness. A repository that adopted the disciplines through the older standalone copy route follows [MIGRATING.md](MIGRATING.md), which uses these steps.
|
|
4
4
|
|
|
5
|
-
Hone reads `disciplines.json` in `<repo>`, runs the selected disciplines' checks over every git-tracked file, applies the exceptions in `discipline-exceptions.json`, and prints one report ending in `verdict: pass` or `verdict: fail`.
|
|
5
|
+
Hone reads `disciplines.json` in `<repo>`, runs the selected disciplines' checks over every git-tracked file, applies the exceptions recorded in `discipline-exceptions.json`, or split by rule in the `discipline-exceptions` folder, and prints one report ending in `verdict: pass` or `verdict: fail`.
|
|
6
6
|
|
|
7
7
|
## 1. Check the prerequisites
|
|
8
8
|
|
|
@@ -18,9 +18,9 @@ Hone ships as one npm package tarball of built JavaScript, so it needs no TypeSc
|
|
|
18
18
|
|
|
19
19
|
**The npm package is named `@hailstails/hone`.** The unscoped name `hone` on npm belongs to an unrelated package: never run `npm install hone`. The package `@hailstails/hone` installs one command, `hone`. Its tarball is named `hailstails-hone-<version>.tgz`, the file name `npm pack` gives a scoped package. Its first pre-release was released under the old name `honed`; [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone) says how to move from it.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Hone follows semantic versioning: only a major release removes or renames a clause address, config key or flag, or changes what one means ([README.md](README.md#compatibility)).
|
|
22
22
|
|
|
23
|
-
The main route is the npm registry.
|
|
23
|
+
The main route is the npm registry. Stable releases are published under the dist-tag `latest`, which names the newest stable release approved on npm; `npm view @hailstails/hone dist-tags.latest` prints its version. Pre-releases are published under `next`. Install that version exactly, with `<version>` in place:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npm install --save-dev --save-exact @hailstails/hone@<version>
|
|
@@ -32,7 +32,7 @@ With pnpm, add it as a development dependency, using `-Dw` in place of `-D` at t
|
|
|
32
32
|
pnpm add -D --save-exact @hailstails/hone@<version>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Pin the exact version.
|
|
35
|
+
Pin the exact version. A major release can remove or rename a clause address, config key or flag, and an install by tag can record a range in `package.json`, such as `^` and the version, which a later install without the lockfile, or an update, moves to a newer release that nobody chose. With an exact pin, the version changes only when you change it (step 10). Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. With Yarn, add `@hailstails/hone@<version>` exactly with its own `add -D` command at the workspace root. `latest` can trail the newest GitHub release for a while; [README.md](README.md#developing-hone) says how a version reaches npm.
|
|
36
36
|
|
|
37
37
|
The alternative is a tarball, copied into the repository so every teammate and CI runner installs the same Hone without the registry. Its three dependencies still come from the registry, or the mirror your package manager uses, at releases inside the ranges the tarball's `package.json` declares, and the repository's lockfile records which. This page writes its location as `<hone-tarball>`: a path such as `vendor/hailstails-hone/hailstails-hone-<version>.tgz`, or an `https://` URL your team serves it from. Download the tarball attached to the latest [GitHub release](https://github.com/HailsTails/hone/releases), or build it from a pinned commit as below.
|
|
38
38
|
|
|
@@ -126,6 +126,7 @@ Create `<repo>/disciplines.json`. Map every clause you adopt to the mechanism th
|
|
|
126
126
|
- Clause-wide carve-out: the rule binds and its check is sound, but the codebase has debt it cannot address right now. Keep the clause's mechanism, so the clause still runs, and record the debt against it as a `clause-wide-carve-out` with its why-chain and an owner who will pay it down (step 7).
|
|
127
127
|
- `exclude` lists folders or exact files that no mechanism checks, as repository paths with forward slashes; an entry containing `*` is refused, because globs are not supported. A folder entry excludes everything under it. It is the only way to narrow what Hone checks: there is no include list, and every tracked file outside `exclude` is checked, including any folder added later. Use it for generated or third-party code, and, to check only part of a repository, list every other folder. `node_modules`, `dist`, `build`, `coverage`, `.git` and a top-level `vendor` folder are skipped already.
|
|
128
128
|
- `clauseSettings` gives a clause the settings its CHECKS.md lists under Settings, keyed by clause address. CD-19, for example, flags only imports of the packages you list in its `confinedPackages`; CD-5's `trackerPatterns` narrows tracked references to your tracker's format. See [README.md](README.md#disciplinesjson).
|
|
129
|
+
- `checkEditions` stays out, or `"pinned"`, unless you want stricter checks as soon as they ship. When Hone tightens a check, the stricter check arrives as a new edition of its clause, listed on the clause's CHECKS.md, and becomes the default only in a major release. `"latest"` runs the newest edition of every selected clause, so a minor upgrade can add findings. To take one clause's newer edition only, give it `"edition"` in `clauseSettings`, for example `"CD-27#test-body-logic": { "edition": "2" }`. The report lists the edition each such clause ran under `editions`.
|
|
129
130
|
- `ruleSets` stays `{}` unless you write disciplines of your own; see [docs/extending.md](docs/extending.md).
|
|
130
131
|
|
|
131
132
|
Every clause address Hone ships:
|
|
@@ -324,13 +325,14 @@ The report prints only the sections that have entries, each with its count, then
|
|
|
324
325
|
CD-15#loops audit src/basket.ts:15:0 for (const line of this.lines) {
|
|
325
326
|
```
|
|
326
327
|
|
|
327
|
-
[docs/output-contract.md](docs/output-contract.md) lists every line the report can print, exactly as printed, and which parts are stable. Lines are 1-based and columns 0-based. The run passes only when every section except `excluded`, `notAdopted`, `notRun`, `exempted`, `assessment` and `readFirst` is empty. The sections are:
|
|
328
|
+
[docs/output-contract.md](docs/output-contract.md) lists every line the report can print, exactly as printed, and which parts are stable. Lines are 1-based and columns 0-based. The run passes only when every section except `excluded`, `notAdopted`, `notRun`, `editions`, `exempted`, `assessment` and `readFirst` is empty. The sections are:
|
|
328
329
|
|
|
329
330
|
| Section | Meaning and what to do |
|
|
330
331
|
| --- | --- |
|
|
331
332
|
| `excluded` | the `exclude` entries from `disciplines.json` that were left out of the run; informational, check it is what you meant |
|
|
332
333
|
| `notAdopted` | the clauses `disciplines.json` lists as `"not-adopted"`; informational, they were neither run nor projected |
|
|
333
334
|
| `notRun` | the clauses `disciplines.json` lists as `"not-run"`, each as `<clause> adopted, mechanism not run: enforced by review`; informational, they were neither run nor projected, and the rule is still owed through review |
|
|
335
|
+
| `editions` | each clause whose check has more than one edition, with the edition that ran and the latest, as `<clause> <mechanism> edition <edition> of <latest>`; informational, see `checkEditions` in [step 4](#4-write-disciplinesjson) |
|
|
334
336
|
| `findings` | violations: fix the code, or record an exception (step 7) |
|
|
335
337
|
| `exempted` | findings an exception covers; informational |
|
|
336
338
|
| `unrecorded` | a native exception no record holds, as `<clause> <mechanism> <kind> <detail>`: remove it, or record it where step 7 allows. An inline disable, `<clause> eslint inline-disable <file>:<line> <comment>`, and a TypeScript directive, `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>`, are held only by an `authorised-location` or `file-carve-out` on that clause and file. An `eslint-disable` naming no rule escapes every selected clause, needs a record for each, and its lines end ` names no rule and escapes every selected clause: naming the rule is the cheap fix`. A lint-script option, `<clause> 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`, cannot be recorded. Where another command comes before `eslint` in its script, as in `tsc && eslint -c eslint.config.mjs .`, the line instead reads `<clause> 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>"`: move that command to a script of its own. Where something before `eslint` in its own command is neither a package runner nor a `NAME=value` setting, as `env` in `env --chdir=src eslint --ignore-pattern dist .` or `-y` in `npx -y eslint --ignore-pattern dist .`, it reads `<clause> 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>`. `cross-env` followed only by `NAME=value` settings counts as a setting |
|
|
@@ -344,7 +346,7 @@ CD-15#loops audit src/basket.ts:15:0 for (const line of this.lines) {
|
|
|
344
346
|
| `assessment` | a concern this run left to another run, for example `forfeiture elsewhere: 37 file carve-outs not checked for decay in this run`; informational, and the verdict line then reads `verdict: pass (partial assessment)` or `verdict: fail (partial assessment)` |
|
|
345
347
|
| `readFirst` | printed last, one line per clause with findings: where to read before changing code, the clause's section in `disciplines.assessment.md` (step 5a) and then the Spirit section of its rule page, for example `CD-15#loops: read the "## CD-15#loops" section of disciplines.assessment.md, then node_modules/@hailstails/hone/rules/CD-15/README.md#spirit`; before the file is written, one note line comes first, counted in the section, and each clause line names its rule page only, as in the walkthrough below; guidance, it never fails the run |
|
|
346
348
|
|
|
347
|
-
To print less, set `"reportOutput"` in `disciplines.json` for the repository, or pass `--report-output <output>` for one run, which wins over the file. `full` is the default and prints the report above; `failures-only` leaves out `excluded`, `notAdopted`, `notRun`, `exempted` and `assessment`, and keeps `readFirst`; `counts` prints only each section's heading and count, adding `informational` after `excluded`, `notAdopted`, `notRun`, `exempted` and `assessment` and `guidance` after `readFirst` so every other line names a section that failed the run; `verdict-only` prints only the verdict line. Every output ends in the verdict line, and the exit code is the same whichever output you choose. An unknown value fails the run with exit `2`, as `arguments-invalid` for the option or `file-malformed` for the file.
|
|
349
|
+
To print less, set `"reportOutput"` in `disciplines.json` for the repository, or pass `--report-output <output>` for one run, which wins over the file. `full` is the default and prints the report above; `failures-only` leaves out `excluded`, `notAdopted`, `notRun`, `editions`, `exempted` and `assessment`, and keeps `readFirst`; `counts` prints only each section's heading and count, adding `informational` after `excluded`, `notAdopted`, `notRun`, `editions`, `exempted` and `assessment` and `guidance` after `readFirst` so every other line names a section that failed the run; `verdict-only` prints only the verdict line. Every output ends in the verdict line, and the exit code is the same whichever output you choose. An unknown value fails the run with exit `2`, as `arguments-invalid` for the option or `file-malformed` for the file.
|
|
348
350
|
|
|
349
351
|
## 7. Record exceptions
|
|
350
352
|
|
|
@@ -376,7 +378,31 @@ The chain runs cause to cause: each why asks why the answer before it is true, e
|
|
|
376
378
|
|
|
377
379
|
Debt or authorisations already recorded by an earlier system, for example the old standalone route's `.constitution-carve-outs/`, can be imported with `provenance` instead of a `whyChain`, as [MIGRATING.md](MIGRATING.md#3-convert-the-old-records-into-exceptions) step 3 shows. Imported entries are checked against `--base-revision`: by default, any entry you write or change yourself needs the full `whyChain`.
|
|
378
380
|
|
|
379
|
-
|
|
381
|
+
The records live in `discipline-exceptions.json` by default. To keep one file for each rule and kind instead, so the name of a changed file says which rule and which kind a change touches, move to the split layout with `hone split-records`, as [MIGRATING.md](MIGRATING.md#16-moving-to-the-split-layout) section 16 shows; [README.md](README.md#the-split-layout) describes the layout. Everything that reads or writes records works the same in either.
|
|
382
|
+
|
|
383
|
+
To record existing debt without a chain on every entry, set `"fileExceptionWhyChains": "optional"` in `disciplines.json`; step 7a writes those records for you. An `authorised-location` or `file-carve-out` entry may then give only its `reason`, so write the reason as why the exception exists; a blank reason is refused. A run with any file carve-out still needs `--base-revision`, or it reports `forfeiture-unmeasured` and fails. A `clause-wide-carve-out` still needs its `whyChain`, and a `whyChain` or `provenance` you give anyway is still checked. [README.md](README.md#discipline-exceptionsjson) has the details.
|
|
384
|
+
|
|
385
|
+
### 7a. Record the debt you inherit
|
|
386
|
+
|
|
387
|
+
A repository with existing code usually has more findings than the change that adopts Hone can fix. `hone record-debt` writes a `file-carve-out` for each clause and file the check finds broken, so the first passing run does not wait on hundreds of records written by hand. Do this after the assessment (step 5a), and after fixing what you are going to fix in this change.
|
|
388
|
+
|
|
389
|
+
1. **Decide the permanent exceptions first.** List each file or folder that breaks a clause on purpose and always will, such as the one adapter that reads the real clock. Those are not debt. They get an `authorised-location` with their own reason, written by a person, so keep them out of the generated records with `--leave`.
|
|
390
|
+
2. **Accept reason-only records.** Set `"fileExceptionWhyChains": "optional"` in `disciplines.json`. Without it the command writes nothing and stops with `load failure: why-chains-required`.
|
|
391
|
+
3. **Finish every source file this change edits.** Decay is assessed against the branch's base, the revision your pre-push hook and CI pass to the check (step 5), such as `origin/main`, not against the commit you run from. A file the adopting change edits has changed since that base, so a record for it is forfeited there, even after you commit the edit. In each file this change edits, fix every finding of each clause, or take the edit out of this change and make it later in a change that fixes the file. A file this change adds has no record to lose: point 4 reports it `new-file`.
|
|
392
|
+
4. **Run it once, with the branch's base as `--base-revision`**, one `--leave` for each path from point 1. Fetch the base first, so the revision is current:
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
git fetch origin
|
|
396
|
+
node_modules/.bin/hone record-debt --repo . --base-revision origin/main --leave src/clock.ts --leave src/adapters
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
It prints one line per clause and file. `recorded` lines are records it added to the exception records. `left` lines are files under a `--leave` path: write their `authorised-location` records now, each with its own reason. `new-file` lines are files the base revision does not hold, so nothing in them was inherited: fix them, or record them yourself with a reason of your own. `already-recorded` and `refused` lines say why nothing was written; [README.md](README.md#recording-inherited-debt) has the details.
|
|
400
|
+
5. **Re-project and check against the same base.** With any `eslint` clause, run `npm run --silent hone:project`. Then run `npm run --silent hone:check -- --forfeiture this-run --base-revision origin/main` (with pnpm, `pnpm run --silent hone:check --forfeiture this-run --base-revision origin/main`). `--forfeiture this-run` makes this run assess decay whatever `assessment.forfeiture` says, as the run that assesses it for your repository does: the pre-push hook with `"forfeiture": "elsewhere"` (step 5), or CI without it. A `forfeited` line names a file this change edits: go back to point 3 for it. A check against `HEAD` hides those lines, because nothing has changed since `HEAD`, and the hook or CI then fails where this run passed. The generated records leave only what point 4 did not record, such as `config-override` or lint-script options under `unrecorded`, which step 6 says how to clear.
|
|
401
|
+
6. **Review the diff.** Nothing takes effect until you commit it. Each generated record says it is inherited debt that nobody has reviewed, and the reviewer of the adopting change reads them as that. Note them in each clause's Debt line in `disciplines.assessment.md`.
|
|
402
|
+
|
|
403
|
+
The records are the same as any other `file-carve-out`: each is forfeited once its file changes, which is how the debt is paid down. A file with no earlier revision gets no record, because it has no debt to inherit. The command is for adoption, but it does not refuse to run again: forfeiture already stops it turning new findings into carve-outs, since a record written for a file just changed is forfeited by the next check that assesses decay. That holds only where decay is assessed. With `"assessment": { "forfeiture": "elsewhere" }` (step 5), it is assessed only by the run that the repository leaves it to, such as the pre-push hook, so a push that bypasses that run lets such a record through until a later run assesses it.
|
|
404
|
+
|
|
405
|
+
Running it again only adds records for pairs that have none; it never removes or rewrites one. A record whose finding has gone is reported `stale` by the check: delete it.
|
|
380
406
|
|
|
381
407
|
## 8. Prove one failure and correction
|
|
382
408
|
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of Hone, newest first. `pnpm run release-pull-request` writes each new section from the commits merged to `main` since the previous release tag, whose subjects are the squash-merged pull request titles; README.md's Compatibility section says what each kind of release may change. The sections below were written by hand from the merged pull requests when the changelog started.
|
|
4
4
|
|
|
5
|
+
## 1.2.0
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- add CD-3 edition 2, judging the options a tsconfig.json resolves to through extends, and a required disk on the experimental audit WalkerRepository (#136)
|
|
10
|
+
|
|
11
|
+
## 1.1.0
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- add hone record-debt, which writes an adopting repository's existing findings as reason-only file carve-outs (#132)
|
|
16
|
+
- ship a tightened check as a clause edition, with CD-27 test-body-logic edition 2 behind checkEditions (#133)
|
|
17
|
+
- keep exception records in a file per rule and kind, with hone split-records to migrate (#134)
|
|
18
|
+
|
|
19
|
+
### Other changes
|
|
20
|
+
|
|
21
|
+
- point the README badges and install text at the latest dist-tag (#129)
|
|
22
|
+
- build the package once on the release's environment and prove that tarball on Windows and Linux (#130)
|
|
23
|
+
|
|
5
24
|
## 1.0.0
|
|
6
25
|
|
|
7
26
|
### Other changes
|
package/MIGRATING.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This page moves a repository from the older standalone route, which copied rule files into a harness folder and wired selected linter rules by hand, to Hone. Follow the steps in order. Every command is run from the repository root. Stop at any "stop and ask" line and hand the question to the human; do not guess past it.
|
|
4
4
|
|
|
5
|
-
A repository already on Hone, or on discipline Hone before the rename, whose exceptions predate causal why-chains needs only [section 8](#8-moving-to-causal-why-chains).
|
|
5
|
+
A repository already on Hone, or on discipline Hone before the rename, whose exceptions predate causal why-chains needs only [section 8](#8-moving-to-causal-why-chains). One that wants its records kept in a file for each rule and kind needs only [section 16](#16-moving-to-the-split-layout).
|
|
6
6
|
|
|
7
7
|
## 1. Detect the old install
|
|
8
8
|
|
|
@@ -45,7 +45,7 @@ Map each chosen discipline to its clauses with this table. A discipline is adopt
|
|
|
45
45
|
|
|
46
46
|
Clauses whose mechanism is `review` are judgement clauses: do not put them in `disciplines.json`; list them in the agent instructions instead (step 6).
|
|
47
47
|
|
|
48
|
-
Stop and ask the human if a chosen CD is one of CD-35 to CD-38, or if selecting a whole discipline adds clauses the old route never checked and the first run shows findings for them: they decide whether to fix those findings, carve them out (step 3), or not adopt that discipline yet.
|
|
48
|
+
Stop and ask the human if a chosen CD is one of CD-35 to CD-38, or if selecting a whole discipline adds clauses the old route never checked and the first run shows findings for them: they decide whether to fix those findings, carve them out (step 3, where `hone record-debt` can write the records), or not adopt that discipline yet.
|
|
49
49
|
|
|
50
50
|
### 2a. Carry over the old route's settings
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ Do this before step 3, and before you delete any record Hone lists as `stale`. T
|
|
|
55
55
|
| --- | --- | --- |
|
|
56
56
|
| Packages confined to wrapping files | a list in the tool's code or its config. Rin's walker holds it as `BANNED_THIRD_PARTY_IMPORTS`: search its tools folder for that name, since an installed copy keeps it in `constitution-audit/audit-constitution.runtime.js`, and its `audit-constitution.ts` only re-exports that file | `confinedPackages` for `CD-19#import-boundaries` under `clauseSettings` in `disciplines.json`. Hone confines no package by default, so until you list them CD-19 flags only `node:` imports. A package covers its subpaths, as [rules/CD-19/CHECKS.md](rules/CD-19/CHECKS.md#what-the-check-flags) says, where the old walker matched each listed name exactly, so Hone can flag a subpath import the old list did not name. |
|
|
57
57
|
| Scope | `constitution.include` and `constitution.exclude` in `harness.config.json` | `exclude` in `disciplines.json`, as [ADOPTING.md](ADOPTING.md#4-write-disciplinesjson) step 4 says. Hone has no include list and no globs: list each folder or file outside the old scope as an exact path. |
|
|
58
|
-
| Rules relaxed by folder | `scriptGlobs`, `uiGlobs` or similar in `harness.config.json` | nothing. Hone has one selection for the whole repository. What those folders fail under the full rules is existing debt: fix it or record it in step 3. Do not exclude the folders to hide it. |
|
|
58
|
+
| Rules relaxed by folder | `scriptGlobs`, `uiGlobs` or similar in `harness.config.json` | nothing. Hone has one selection for the whole repository. What those folders fail under the full rules is existing debt: fix it or record it in step 3. There is no old record to import it from, so once the human approves recording it, `hone record-debt` writes the records (step 3). Do not exclude the folders to hide it. |
|
|
59
59
|
| Files the tool skipped in its own code | a list such as `SELF_AUDIT_EXCLUDED_FILENAMES` | an `exclude` entry or an exception record for each file. Stop and ask the human which, and why. |
|
|
60
60
|
|
|
61
61
|
A `stale` record on `CD-19#import-boundaries` right after the move usually means the confined list was not carried over. Fix `confinedPackages` and run the check again before deleting anything.
|
|
@@ -107,6 +107,14 @@ Each converted record is imported: give it `provenance` naming the old record in
|
|
|
107
107
|
|
|
108
108
|
An imported `file-carve-out` needs a `decision`: copy the old entry's. If the old entry has none, stop and ask the human who accepted the debt. An imported `authorised-location` needs no `decision`: copy the old entry's if it has one, otherwise give `kind` and `source` only. Never write a placeholder or a root cause that only says the check was failing: Hone refuses those as `invalidRecords`.
|
|
109
109
|
|
|
110
|
+
Once the old records are converted, what is left is debt no old record covers: findings in a folder whose relaxed rule set was not carried over (step 2a), clauses the old route never checked, and inline disables or `@ts-expect-error` directives the old tool accepted ([section 14](#14-moving-to-recorded-inline-exceptions)). When the human approves recording it, set `"fileExceptionWhyChains": "optional"` in `disciplines.json` and run, with one `--leave` for each file the human decided is a permanent exception:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
node_modules/.bin/hone record-debt --repo . --base-revision origin/main --leave <path>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Give it the branch's base, `origin/main`, not `HEAD` as this migration's other checks do: after step 6 the pre-push hook and CI assess decay against that base, so a record for a file this branch edits passes a check against `HEAD` and is forfeited there. Finish each file the migration edits, as [ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a point 3 says, and confirm with `npm run --silent hone:check -- --forfeiture this-run --base-revision origin/main`, which assesses decay in that run whatever `assessment.forfeiture` says. It adds a reason-only `file-carve-out` for each clause and file that no converted record holds, and leaves the converted records as they are. A converted record still holds its pair, so the command reports it `already-recorded` only if the check does not accept it; fix that record rather than adding another. [ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a says how to read its output and review the result.
|
|
117
|
+
|
|
110
118
|
## 4. Replace the hand-written linter rules
|
|
111
119
|
|
|
112
120
|
The ESLint projection from step 2 now carries every `eslint` clause. Remove only the rules the old route added for the disciplines; keep every other rule the repository uses:
|
|
@@ -161,7 +169,7 @@ With pnpm, run the check as `pnpm run --silent hone:check --base-revision HEAD`.
|
|
|
161
169
|
|
|
162
170
|
It must print a `CD-15#loops audit` finding and a `CD-1#explicit-any eslint` finding, then `verdict: fail`, and exit `1`. Use a selected clause in place of either if the repository did not adopt CD-15 or CD-1. Then remove both files (`git rm -f src/discipline-probe-loop.ts src/discipline-probe-any.ts`) and run the check again: it must print `verdict: pass` and exit `0`.
|
|
163
171
|
|
|
164
|
-
To see debt decay, change one line in a carved file, stage it and run the check: the record moves to `forfeited` and the run fails. Restore the file afterwards (`git restore --staged --worktree <file>`).
|
|
172
|
+
To see debt decay, change one line in a carved file, stage it and run the check: the record moves to `forfeited` and the run fails. Restore the file afterwards (`git restore --staged --worktree <file>`). Records `hone record-debt` wrote decay the same way as converted ones.
|
|
165
173
|
|
|
166
174
|
Stop here, do not remove anything, and ask the human if the check does not pass.
|
|
167
175
|
|
|
@@ -171,7 +179,7 @@ Only after step 5 passes:
|
|
|
171
179
|
|
|
172
180
|
1. Delete the copied rule files and guides from step 1's harness folder (`.cursor/knowledge/aidlc-shared/code-discipline/` or its `.claude`/`.codex` equivalent).
|
|
173
181
|
2. Delete the copied tools tree and `harness.config.json`, unless anything else in the repository uses them. A repository that also runs the rin AIDLC plugin keeps `harness.config.json`, and in this same change sets `"constitution": { "engine": "hone", "baseRevision": "origin/main" }` in it. Otherwise rin's stage gate, sensors and review lenses keep running the old walker over the old records, and they refuse what this check passes. A rin plugin from before the rename refuses `"hone"` and takes `"discipline-core"`. Set `baseRevision` whenever a file carve-out or an imported entry exists.
|
|
174
|
-
3. Delete the old record files, `.constitution-carve-outs/cd-<id>.json` and `.constitution-authorised-locations/cd-<id>.json`: their content now lives in `discipline-exceptions.json`. Leave any other file in those folders, and the folder that holds it: another tool, such as a hook, may read it.
|
|
182
|
+
3. Delete the old record files, `.constitution-carve-outs/cd-<id>.json` and `.constitution-authorised-locations/cd-<id>.json`: their content now lives in `discipline-exceptions.json`. To keep a file for each rule and kind, as those folders did, move to the split layout in a later change, as section 16 says. Leave any other file in those folders, and the folder that holds it: another tool, such as a hook, may read it.
|
|
175
183
|
4. In `package.json` scripts, CI and the pre-push hook, replace the old tool commands with the Hone check, as [ADOPTING.md](ADOPTING.md#5-run-the-check) step 5 shows. Every run needs `--base-revision` while a file carve-out exists, unless it leaves forfeiture to another run as [ADOPTING.md](ADOPTING.md#5-run-the-check) step 5 shows, and a run with imported records needs it in any case: in local scripts and the pre-push hook use the branch's base (`origin/main`, or `HEAD` to measure only uncommitted changes); in CI use the pull request's base commit. A run that leaves forfeiture to another run ends `verdict: pass (partial assessment)` or `verdict: fail (partial assessment)`, so a hook or gate that matches `verdict: pass` or `verdict: fail` at the end of the line reads neither; see the warning in [ADOPTING.md](ADOPTING.md#5-run-the-check) step 5.
|
|
176
184
|
5. Rewrite the agent instructions to point at `node_modules/@hailstails/hone/rules/` and the judgement rules, as ADOPTING step 5 and step 9 say, and remove any instruction to read the old copied files.
|
|
177
185
|
6. Run the check and the repository's own validation command again, then commit everything in one change.
|
|
@@ -305,7 +313,7 @@ Earlier releases reported an `eslint-disable` comment naming a selected rule as
|
|
|
305
313
|
|
|
306
314
|
1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check. Each `@ts-expect-error`, `@ts-ignore` and `@ts-nocheck` in a `.ts` or `.tsx` file is listed under `unrecorded` as `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>`, test files included, and each `eslint-disable` as before.
|
|
307
315
|
2. **Remove what you can.** A directive or disable that hides nothing is cheaper to delete than to record.
|
|
308
|
-
3. **Record the rest per clause and file.** Add a `file-carve-out` for debt, or an `authorised-location` where the clause truly does not apply to that file, on the clause the line names and that file. One record holds every inline exception of that clause in the file. A `clause-wide-carve-out` does not hold them, and a tracked reference on the comment (CD-5) does not stand in for the record. Editing a carved file forfeits the carve-out, and each inline exception it held is listed again.
|
|
316
|
+
3. **Record the rest per clause and file.** Add a `file-carve-out` for debt, or an `authorised-location` where the clause truly does not apply to that file, on the clause the line names and that file. For a repository that accepts reason-only records, `hone record-debt` writes the debt records ([ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a). One record holds every inline exception of that clause in the file. A `clause-wide-carve-out` does not hold them, and a tracked reference on the comment (CD-5) does not stand in for the record. Editing a carved file forfeits the carve-out, and each inline exception it held is listed again.
|
|
309
317
|
4. **Name the rule in a bare disable.** An `eslint-disable` naming no rule escapes every selected ESLint clause and needs a record for each. Its lines end `names no rule and escapes every selected clause: naming the rule is the cheap fix`.
|
|
310
318
|
5. **Fix lint-script options.** A `command-line-option` line that ends `weakens the script's whole run, so no record can cover it: remove it from the script` names an option to remove. One that ends `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>"` names a script such as `tsc && eslint -c eslint.config.mjs .`: move the quoted command to a script of its own, then run the check again. One that ends `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>` quotes the first token Hone does not read, such as `env` or a runner flag like `-y`: rewrite the command so only package runners and `NAME=value` settings, including `cross-env NAME=value`, come before `eslint`. `-c` naming the config ESLint already finds, and `--ignore-pattern` that ignores no checked file, are not reported once `eslint` runs plainly.
|
|
311
319
|
6. **Stale records may clear.** A record that holds a native exception it can cover now counts as used. An `authorised-location` or `file-carve-out` that held only a `config-override`, and was listed `stale` while dropping it left the override unrecorded, is no longer stale.
|
|
@@ -326,3 +334,20 @@ Choose one state for it, as [ADOPTING.md](ADOPTING.md#4-write-disciplinesjson) s
|
|
|
326
334
|
3. **The rule does not apply to this codebase.** A tech lead says so in the open, and the clause is listed as `"not-adopted"`. The report lists it under `notAdopted`.
|
|
327
335
|
|
|
328
336
|
Neither `"not-run"` nor `"not-adopted"` takes an exception record. Stop and ask the human before choosing `"not-adopted"`, or before recording carve-outs for existing `!` sites.
|
|
337
|
+
|
|
338
|
+
## 16. Moving to the split layout
|
|
339
|
+
|
|
340
|
+
`discipline-exceptions.json` holds every record in one file. The split layout keeps the same records in the `discipline-exceptions` folder, one file for each record kind and discipline, as `.constitution-carve-outs/cd-<id>.json` and `.constitution-authorised-locations/cd-<id>.json` did: [README.md](README.md#the-split-layout) describes it. Moving is optional, and a repository that does nothing keeps the single file.
|
|
341
|
+
|
|
342
|
+
1. **Start a branch from the base your hook and CI pass to the check**, such as `origin/main`, with no other change to the records in it. Fetch the base first, so it is current.
|
|
343
|
+
2. **Split the records:**
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
node_modules/.bin/hone split-records --repo .
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
It prints `<path> written` for each file and `discipline-exceptions.json removed`. Within each file the records keep the order they had. It refuses a record whose clause names no discipline, naming its index: fix the clause or remove the record, then run it again. It also refuses a `discipline-exceptions.json` holding keys other than `version` and `exceptions`, such as `$schema` or `notes`, naming them, since no split file keeps them: remove them, or keep what they say elsewhere, then run it again.
|
|
350
|
+
3. **Re-project and check against the same base.** With any `eslint` clause, run `npm run --silent hone:project`; it prints `unchanged`, since the projection does not depend on where a record is kept. Then run `npm run --silent hone:check -- --forfeiture this-run --base-revision origin/main` (with pnpm, `pnpm run --silent hone:check --forfeiture this-run --base-revision origin/main`). The base still holds `discipline-exceptions.json`, and Hone reads the base in whichever layout it holds, so imported and legacy-chain records are still verified against it. `--forfeiture this-run` makes this run assess decay whatever `assessment.forfeiture` says. The report is the one the check printed before the split, except that a section listing records, such as `stale`, lists them in the order of the new files.
|
|
351
|
+
4. **Commit the removal and the new files in one change.** A tree that holds both `discipline-exceptions.json` and the folder fails every run with `records-in-both-layouts`. Point any code owners or review rules at the new files, such as `discipline-exceptions/file-carve-outs/cd-19.json`.
|
|
352
|
+
|
|
353
|
+
From then on, `hone record-debt` adds each record to its discipline's file, and a record a person writes goes in the file of its kind and discipline: one in any other file fails the load as `file-malformed`, naming the file it belongs in.
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Hone
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@hailstails/hone)
|
|
4
4
|
[](https://github.com/HailsTails/hone/actions/workflows/ci.yml?query=branch%3Amain)
|
|
5
|
-
[](https://www.npmjs.com/package/@hailstails/hone)
|
|
6
|
+
[](https://www.npmjs.com/package/@hailstails/hone)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
9
|
Hone checks a repository against the disciplines it has chosen to adopt. It is a tool, not a framework: it reads what the repository selected, hands each selected clause to the mechanism that checks it, applies the repository's recorded exceptions, and prints one verdict. Its core enforces nothing and names no discipline and no mechanism. A discipline (for example CD-14, no authored classes) is data under `rules/`, and a mechanism is a runner under `mechanisms/`; the core reaches both only through files and one module contract.
|
|
@@ -15,7 +15,7 @@ npm view @hailstails/hone dist-tags
|
|
|
15
15
|
npm install --save-dev --save-exact @hailstails/hone@<version>
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
With pnpm the second command is `pnpm add -D --save-exact @hailstails/hone@<version>`.
|
|
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
20
|
Two mechanisms ship: `audit`, a standalone TypeScript syntax walker, and `eslint`, which runs the clause as an ESLint rule inside the team's own ESLint setup. [rules/README.md](rules/README.md) lists every shared discipline with its clauses: the audit mechanism checks 20 disciplines, and ESLint pieces check clauses of CD-1, CD-6, CD-7, CD-10, CD-14, CD-27, CD-40, CD-41, CD-42 and CD-44. The rest are judgement rules, applied in review with the review methods in [methods/](methods/README.md).
|
|
21
21
|
|
|
@@ -25,22 +25,24 @@ 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
|
|
28
|
+
The package ships one command, `hone`, with four subcommands. `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; `split-records` runs once, when a repository moves its records to [the split layout](#the-split-layout):
|
|
29
29
|
|
|
30
30
|
```text
|
|
31
31
|
hone check --repo <dir> [--base-revision <revision>] [--report-output <full|failures-only|counts|verdict-only>] [--forfeiture <this-run|elsewhere>]
|
|
32
32
|
hone project --repo <dir>
|
|
33
|
+
hone record-debt --repo <dir> --base-revision <revision> [--leave <path>]...
|
|
34
|
+
hone split-records --repo <dir>
|
|
33
35
|
hone --help
|
|
34
36
|
hone --version
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
`--repo` is the folder that holds `disciplines.json`, usually the repository root. `hone --help` lists the commands, `hone check --help` and `hone
|
|
39
|
+
`--repo` is the folder that holds `disciplines.json`, usually the repository root. `hone --help` lists the commands, `hone check --help`, `hone project --help`, `hone record-debt --help` and `hone split-records --help` list each one's options and exit codes, and `hone --version` prints the installed version. A command typed wrongly is a load failure `arguments-invalid` that says what was wrong, a `--repo` folder with no `disciplines.json` is the load failure `selection-absent`, 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>`.
|
|
38
40
|
|
|
39
41
|
[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.
|
|
40
42
|
|
|
41
|
-
`hone check` loads the repository's selection, exceptions, rule sets and pieces; works out which files changed since `--base-revision`; runs each selected mechanism once over the repository's tracked `.ts`, `.tsx`, `.mts` and `.cts` files; applies the exceptions; 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`
|
|
43
|
+
`hone check` loads the repository's selection, exceptions, rule sets and pieces; works out which files changed since `--base-revision`; runs each selected mechanism once over the repository's tracked `.ts`, `.tsx`, `.mts` and `.cts` files; applies the exceptions; 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` and `hone split-records` exit `0` or `2`.
|
|
42
44
|
|
|
43
|
-
The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, exempted findings, assessment and where to read first is empty.
|
|
45
|
+
The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, the edition each clause with more than one edition ran, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, editions, exempted findings, assessment and where to read first is empty.
|
|
44
46
|
|
|
45
47
|
An `unrecorded` line is `<clause> <mechanism> <kind> <detail>`. Two kinds end with a note:
|
|
46
48
|
|
|
@@ -95,6 +97,25 @@ The `assessment` section is informational and the marker does not change the exi
|
|
|
95
97
|
|
|
96
98
|
`hone project` writes the native configuration each embedded mechanism needs, and prints `<path> <effect>` per file: `written`, `unchanged`, `removed` for a package slice Hone wrote whose folder is no longer a config root, or `left-in-place` for such a file whose bytes are not what Hone would write there. The audit mechanism is standalone and writes nothing, so with only the walker selected the command prints nothing and exits `0`.
|
|
97
99
|
|
|
100
|
+
### Recording inherited debt
|
|
101
|
+
|
|
102
|
+
`hone record-debt` gives a repository that adopts Hone with existing code a file record for each debt it cannot fix on day one. [ADOPTING.md](ADOPTING.md#7a-record-the-debt-you-inherit) step 7a is the procedure. The command runs the check with the `--base-revision` it is given, then adds one `file-carve-out` to the exception records, `discipline-exceptions.json` or the discipline's file in [the split layout](#the-split-layout), for each clause and file that has a finding, or an inline disable or TypeScript directive under `unrecorded`. Each is the record a person would write, so nothing downstream treats it differently. It gives only a `reason`, which says the debt was inherited and that nobody has reviewed it, so `disciplines.json` must set `"fileExceptionWhyChains": "optional"`. Without that setting the command writes nothing and stops with the load failure `why-chains-required`. It never sets the key itself.
|
|
103
|
+
|
|
104
|
+
Give it the base that the run assessing decay is given, such as `origin/main` for a branch: a record for a file changed since that base is forfeited by that run, and a check against a later revision, such as `HEAD`, does not show it.
|
|
105
|
+
|
|
106
|
+
It never writes anything wider than one clause in one file: no `authorised-location`, no `clause-wide-carve-out`, no `exclude` entry and no setting. It prints one line per clause and file, `recorded` for each record it added, and writes nothing for:
|
|
107
|
+
|
|
108
|
+
- a pair that already has an `authorised-location` or `file-carve-out`, such as one the check forfeits (`already-recorded`);
|
|
109
|
+
- 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;
|
|
110
|
+
- a file the base revision does not hold, since nothing in it was inherited (`new-file`);
|
|
111
|
+
- a clause whose discipline refuses exceptions (`refused`).
|
|
112
|
+
|
|
113
|
+
Other native exceptions under `unrecorded`, such as a `config-override` or a lint-script option, are not recorded: [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with each.
|
|
114
|
+
|
|
115
|
+
It adds the new entries after the last one and leaves every entry already in the file as written. It stages and commits nothing: the diff of the exception records is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again adds records only for pairs that still have none. A record whose finding is gone is reported `stale` by the check as before, for a person to delete. Run `hone project` after it when any clause is `eslint`, so the projection carries the new records.
|
|
116
|
+
|
|
117
|
+
The command does not refuse to run again later, and has no flag for it. Forfeiture is what stops it turning new findings into carve-outs: a file carve-out is forfeited once its file changes since `--base-revision`, so a record written for a file someone has just changed fails the next check that assesses forfeiture, and a file that is new since the base gets no record at all. That holds only where forfeiture is assessed. In an arrangement that leaves it elsewhere, such as `"assessment": { "forfeiture": "elsewhere" }` with the pre-push hook that assesses it bypassed, such a record is not caught until a run that does assess it.
|
|
118
|
+
|
|
98
119
|
## Adopting the ESLint mechanism
|
|
99
120
|
|
|
100
121
|
With any clause selected for `eslint`, run `hone project`. It writes `disciplines.eslint.mjs` at the repository root: one block per piece enabling its selected rules at `"error"` on `**/*.{ts,tsx,mts,cts}`, then one block per set of clauses that files are excepted from, listing those files and turning the rules `"off"` for them, and one block per clause-wide carve-out turning its rules `"off"` everywhere. Commit it, and spread its default export last in the repository's flat config:
|
|
@@ -176,15 +197,16 @@ At the repository root. It selects clauses and the mechanism that checks each on
|
|
|
176
197
|
- A judgement clause cannot be selected; it is enforced by review.
|
|
177
198
|
- `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.
|
|
178
199
|
- `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.
|
|
179
|
-
- `fileExceptionWhyChains`, optional, is `"required"` (the default) or `"optional"`. `"optional"` lets an `authorised-location` or `file-carve-out` entry give only its `reason`; see [discipline-exceptions.json](#discipline-exceptionsjson).
|
|
200
|
+
- `fileExceptionWhyChains`, optional, is `"required"` (the default) or `"optional"`. `"optional"` lets an `authorised-location` or `file-carve-out` entry give only its `reason`; see [discipline-exceptions.json](#discipline-exceptionsjson). `hone record-debt` writes such entries, so it needs `"optional"`.
|
|
180
201
|
- `reportOutput`, optional, is `"full"` (the default), `"failures-only"`, `"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).
|
|
202
|
+
- `checkEditions`, optional, is `"pinned"` (the default) or `"latest"`. A clause whose check has been tightened has more than one edition, listed on its CHECKS.md. `"pinned"` runs each clause's default edition, which changes only in a major release; `"latest"` runs the newest edition the installed Hone has for every selected clause, so a minor release can add findings. `"edition"` in a clause's `clauseSettings` holds that one clause to the edition it names over either. The report lists the edition each such clause ran under `editions`.
|
|
181
203
|
- `clauseSettings`, optional, maps a selected clause address to an object of that clause's settings, for a clause whose CHECKS.md lists settings. Each key must be one the clause'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 `disciplines.json` malformed, naming the clause, the key and what is accepted: settings for a clause the file does not select or names twice, for a clause that takes none, under an undeclared key, or of the wrong kind or choice.
|
|
182
204
|
- `assessment`, optional, says which run assesses each concern. Its one key, `forfeiture`, is `"this-run"` (the default) or `"elsewhere"`; `--forfeiture` overrides it for one run; see [Commands](#commands). `waivedClauses`, which earlier releases accepted, is removed: it makes `disciplines.json` `file-malformed`, naming the clause states that replace it; see [MIGRATING.md](MIGRATING.md#12-moving-off-waivedclauses). Any other key makes it `file-malformed`, naming the key as not available in this version.
|
|
183
205
|
- `exclude`, optional, lists repository folders or exact files that no mechanism checks. A folder entry covers everything under it. Globs are refused: an entry containing `*` makes `disciplines.json` malformed. The report lists the active entries under `excluded`. Exclude Hone's own install when it is vendored inside the repository.
|
|
184
206
|
|
|
185
207
|
## discipline-exceptions.json
|
|
186
208
|
|
|
187
|
-
At the repository root;
|
|
209
|
+
At the repository root, or split by rule into the `discipline-exceptions` folder as [the split layout](#the-split-layout) describes; neither means no exceptions. Each entry names a selected clause, and applies to the mechanism that clause is selected for.
|
|
188
210
|
|
|
189
211
|
```json
|
|
190
212
|
{
|
|
@@ -225,6 +247,31 @@ At the repository root; absent means no exceptions. Each entry names a selected
|
|
|
225
247
|
- Files are exact repository paths, never globs.
|
|
226
248
|
- An entry that exempts nothing is stale, a file both authorised and carved for one clause is doubly held, and an entry that cannot be parsed is invalid. Each fails the run.
|
|
227
249
|
|
|
250
|
+
### The split layout
|
|
251
|
+
|
|
252
|
+
A repository can keep the same records in a `discipline-exceptions` folder instead of `discipline-exceptions.json`: a folder for each record kind, and in it one file for each discipline. The name of a changed file then says which rule and which kind a change touches, and a code owner can own one rule's exceptions.
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
discipline-exceptions/
|
|
256
|
+
authorised-locations/
|
|
257
|
+
cd-19.json
|
|
258
|
+
file-carve-outs/
|
|
259
|
+
cd-19.json
|
|
260
|
+
cd-27.json
|
|
261
|
+
clause-wide-carve-outs/
|
|
262
|
+
team/
|
|
263
|
+
tm-1.json
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
- Each file has the format above, `{ "version": 1, "exceptions": [...] }`, and holds only records of its folder's kind on its discipline. The file is named for the discipline ID in lower case, such as `cd-7a.json`, inside a folder named for the rule set when the clause is in a team's rule set rather than Hone's own. Each record keeps its `kind` and `clause`, so a record reads the same in either layout.
|
|
267
|
+
- A record in another discipline's or kind's file, or any other file or folder under `discipline-exceptions`, makes the load fail as `file-malformed`, naming the file; for a misplaced record it names the file it belongs in.
|
|
268
|
+
- Hone reads whichever layout is present. `discipline-exceptions.json` stays the default, and nothing changes for a repository that keeps it. A repository holding both is refused with `records-in-both-layouts` rather than merged.
|
|
269
|
+
- An `invalidRecords` line names the file that holds the record and its index there. `hone record-debt` adds each record to its discipline's `file-carve-outs` file, writing the file when there is none yet.
|
|
270
|
+
- The `--base-revision` may hold either layout, so the change that moves a repository to the split layout is checked against `discipline-exceptions.json` at its base: imported and legacy-chain records are still verified.
|
|
271
|
+
- Records are read in path order: the kind folders in the order of their names, then the files in the order of their paths. A section that lists records, such as `stale`, lists them in that order, not in the order `discipline-exceptions.json` had.
|
|
272
|
+
|
|
273
|
+
`hone split-records --repo .` moves a repository to the split layout. It writes each file, with its records in the order they had in `discipline-exceptions.json`, then removes that file, and prints `<path> written` for each file and `discipline-exceptions.json removed`. Each file is written as `JSON.stringify` writes it with two-space indentation, with each record's fields in the order `kind`, `clause`, `file`, `reason`, `whyChain`, `provenance`. A record already in that form, as `hone record-debt` writes it, keeps its text byte for byte. Any other record keeps its values but not its text: one with its fields in another order is rewritten in that order, and a `\u` escape of a character that needs none is written as the character. It writes nothing and changes nothing for a repository already split or without records. It refuses with a load failure, writing nothing, a repository holding both layouts, a record whose clause names no discipline, and a `discipline-exceptions.json` holding keys other than `version` and `exceptions`, such as `$schema`, since no split file keeps them. [MIGRATING.md](MIGRATING.md#16-moving-to-the-split-layout) section 16 is the procedure.
|
|
274
|
+
|
|
228
275
|
## Installing
|
|
229
276
|
|
|
230
277
|
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 subcommands `hone check` and `hone project` are described under 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.
|
|
@@ -233,19 +280,19 @@ With the ESLint mechanism selected, a packaged install's projection imports each
|
|
|
233
280
|
|
|
234
281
|
## Public type entries
|
|
235
282
|
|
|
236
|
-
The package has three public entries for TypeScript. `@hailstails/hone/rule-set` holds types only, so importing it adds no code to a build; import it with `import type`. `@hailstails/hone/audit` adds
|
|
283
|
+
The package has three public entries for TypeScript. `@hailstails/hone/rule-set` holds types only, so importing it adds no code to a build; import it with `import type`. `@hailstails/hone/audit` adds three values to its types, and `@hailstails/hone/testing` is for a team's own tests.
|
|
237
284
|
|
|
238
285
|
| Entry | Status | What it is for |
|
|
239
286
|
| --- | --- | --- |
|
|
240
287
|
| `@hailstails/hone/rule-set` | Stable | The shapes of `discipline.json`, `piece.json` and an ESLint piece's `settings`, for a team writing its own rule set. Identifiers and paths are plain strings: Hone checks them when it reads the files. |
|
|
241
|
-
| `@hailstails/hone/audit` | Experimental | The types for writing an audit walker piece, `WalkerPiece` and what it needs, including `PieceFailure`, the failures a piece may return. Clause addresses and file paths reach a piece from Hone, already checked, and a piece passes them back unchanged. Its
|
|
288
|
+
| `@hailstails/hone/audit` | Experimental | The types for writing an audit walker piece, `WalkerPiece` and what it needs, including `PieceFailure`, the failures a piece may return. Clause addresses and file paths reach a piece from Hone, already checked, and a piece passes them back unchanged. Its three values are `folderScope`, which tells a piece whether a file sits in a generated folder; `isEdition`, which narrows a text such as `"2"` to an `Edition`; and `editionReaches`, which tells a piece whether the edition that runs covers something introduced in a given edition. It may change in a minor release. |
|
|
242
289
|
| `@hailstails/hone/testing` | Experimental | Runs a team audit clause's `cases` through its piece with the installed audit runner (`clauseConformanceOf`), and hands a test the clause bound as `hone check` binds it (`clauseUnderTestOf`) and a checked file path (`repoPathOf`). Hone does not run these tests itself. It may change in a minor release. |
|
|
243
290
|
|
|
244
291
|
Each resolves with `moduleResolution` `"nodenext"` or `"bundler"`. `install-proof` type-checks a team piece and rule set against them, and checks that a wrongly typed field fails: on TypeScript 4.8.4 from an ES module with `"nodenext"` (4.8 has no `"bundler"`), and on 6.0.3 from an ES module with both and from a CommonJS file. A CommonJS file (`.cts`, or `.ts` in a package that is not `"type": "module"`) can import these types on TypeScript 5.8 or later with `module` `"nodenext"`. With `module` `"node16"`, and on TypeScript 5.3 to 5.7, the import needs `with { "resolution-mode": "import" }`, and older versions reject it. These CommonJS figures were checked once by hand, on 5.8.2, 5.3.3 and 6.0.3 with `"node16"`; `install-proof` checks only the 6.0.3 CommonJS case with `"nodenext"`. `@hailstails/hone/audit` names TypeScript's own syntax types, so it needs the `typescript` the repository already installs as a peer. No other path in the package is a public TypeScript entry.
|
|
245
292
|
|
|
246
293
|
## Runtime
|
|
247
294
|
|
|
248
|
-
- 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.
|
|
295
|
+
- 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.
|
|
249
296
|
- 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.
|
|
250
297
|
- git 2.24 or later. Older git rejects `--end-of-options`, so the changed-file query fails and forfeiture is reported unmeasured.
|
|
251
298
|
- 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.
|
|
@@ -261,7 +308,7 @@ A repository can hold one `eslint.config.*` at its root or one per package. Hone
|
|
|
261
308
|
|
|
262
309
|
Hone's version numbers follow semantic versioning under these rules:
|
|
263
310
|
|
|
264
|
-
- A new or tightened check ships off by default in a minor release and becomes a default only in a major release.
|
|
311
|
+
- A new or tightened check ships off by default in a minor release and becomes a default only in a major release. A new check arrives as a new clause, which a repository adopts by selecting it. A tightened check arrives as a new edition of its clause, which runs only for a repository that sets `checkEditions` to `"latest"` or names the edition in the clause's `clauseSettings`; a major release makes it the default edition and may retire older ones.
|
|
265
312
|
- A change to the ESLint config that `hone project` generates, which an adopter must regenerate, is a minor release, with a clear message telling the adopter to regenerate: its changelog entry says to run `hone project` and commit the result, and until then the check reports the projection `out-of-date`.
|
|
266
313
|
- Renaming or removing a clause address, a config key in `disciplines.json` or `discipline-exceptions.json`, or a CLI flag, or changing what one means, is a major release. Adding one with a safe default is not.
|
|
267
314
|
- A change to what [the output contract](docs/output-contract.md) says a tool can parse is a major release: the command and option names, the exit codes and streams, the report's sections, outputs and verdict lines, the load failure kinds, and each line's leading fields up to its first value that may hold a space. What it marks not stable, such as the help text, the wording of `arguments-invalid` and `readFirst` lines and the repair text after a load failure's values, may change in a minor release, and a minor release may add a section, a kind of line or an option.
|
|
@@ -293,7 +340,7 @@ This is the first release. Its tests cover each supported platform's ordinary pa
|
|
|
293
340
|
- Lint scripts are read with a simple shell tokenizer, so unusual quoting or a `cd` before `eslint` is not interpreted.
|
|
294
341
|
- Detection reads an ESLint 9 run started from inside a package, or given the lookup flag through the environment or a task runner, as a root-only run; set `eslintConfigLookup` in `disciplines.json` for those repositories.
|
|
295
342
|
- Team ESLint configs that imitate projection block names, register a second copy of the plugin, or use processors are not exercised.
|
|
296
|
-
- A byte-order mark at the start of `disciplines.json
|
|
343
|
+
- A byte-order mark at the start of `disciplines.json`, `discipline-exceptions.json` or a file of the split layout; save them without one.
|
|
297
344
|
|
|
298
345
|
## Developing Hone
|
|
299
346
|
|
|
@@ -309,7 +356,7 @@ This repository is self-contained: it holds its own configuration and its own lo
|
|
|
309
356
|
| `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` |
|
|
310
357
|
| `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 |
|
|
311
358
|
| `self-check` | `node scripts/self-check.ts check --repo .`: runs Hone's own check on this repository with `disciplines.json` and `discipline-exceptions.json`; pass `--base-revision <rev>` after the script name. See [Core's check on itself](#hones-check-on-itself) |
|
|
312
|
-
| `install-proof` | `node scripts/install-proof.ts`: packs the package once into a temporary tarball 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.28.0 and 10.0.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.11.0 and typescript-eslint 8.71.2, 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.28.0 or 10.0.0 with typescript-eslint 8.56.0 and TypeScript 4.8.4 for the two ESLint consumers; 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 |
|
|
359
|
+
| `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.28.0 and 10.0.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.11.0 and typescript-eslint 8.71.2, 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.28.0 or 10.0.0 with typescript-eslint 8.56.0 and TypeScript 4.8.4 for the two ESLint consumers; 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 |
|
|
313
360
|
| `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) |
|
|
314
361
|
| `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) |
|
|
315
362
|
|
|
@@ -319,7 +366,7 @@ This repository is self-contained: it holds its own configuration and its own lo
|
|
|
319
366
|
|
|
320
367
|
`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.
|
|
321
368
|
|
|
322
|
-
Continuous integration runs
|
|
369
|
+
Continuous integration runs on every pull request, drafts included, and on every push to `main`, from `pnpm-lock.yaml` alone, in two jobs, and both are required checks. `Discipline core on Windows` runs where the release packs, on Windows with Node 22.18.0, the oldest Node the package claims. It runs `check`, `self-check` and `package-determinism`, packs the tarball once with `pack-package`, runs `install-proof --tarball` on that tarball, and keeps it for the second job. `Discipline core on Linux` starts once the first passes, on Linux with Node 24, and runs the test suite and `install-proof --tarball` on the tarball the first job packed. Both jobs prove the one tarball `pack-package` wrote: the tests and the installed package on Windows on the oldest claimed Node, and on Linux on Node 24. The typecheck, lint, `self-check` and `package-determinism` run once, on Windows. 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.
|
|
323
370
|
|
|
324
371
|
### Versions and releases
|
|
325
372
|
|
package/api/audit.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { PieceFailure } from "../core/mechanism-port/piece-failure-types.js";
|
|
2
2
|
export type { ClauseSettingValues, RunnerClause } from "../core/mechanism-port/runner-module-types.js";
|
|
3
3
|
export type { ReadonlyJsonValue } from "../core/values/json-value.js";
|
|
4
|
+
export type { Edition, EditionReach } from "../core/values/edition-types.js";
|
|
4
5
|
export type { Hit } from "../core/mechanism-port/runner-result-types.js";
|
|
5
6
|
export type { Anchor, AnchorKind } from "../core/values/anchor.js";
|
|
6
7
|
export type { ClauseAddress, ToolRuleSet } from "../core/values/clause-address-types.js";
|
|
@@ -8,7 +9,12 @@ export type { ClauseId, DisciplineId, RuleSetName } from "../core/values/identif
|
|
|
8
9
|
export type { RepoPath } from "../core/values/repo-path-types.js";
|
|
9
10
|
export type { Result } from "../core/values/result.js";
|
|
10
11
|
export type { CommentRange, SyntaxApi, SyntaxNode, SyntaxTree } from "../mechanisms/audit/runner/typescript-parse.js";
|
|
11
|
-
export type { PieceHit, PreparedFileCheck, PreparedWalkerCheck, SourceObservers, WalkerFile, WalkerPiece, WalkerRepository } from "../mechanisms/audit/runner/walker-piece.js";
|
|
12
|
+
export type { PieceHit, PreparedFileCheck, PreparedWalkerCheck, SourceObservers, WalkerDisk, WalkerFile, WalkerPiece, WalkerRepository } from "../mechanisms/audit/runner/walker-piece.js";
|
|
12
13
|
export declare const folderScope: (request: {
|
|
13
14
|
readonly file: string;
|
|
14
15
|
}) => "generated" | "authored";
|
|
16
|
+
export declare const editionReaches: (request: {
|
|
17
|
+
readonly edition: import("./audit.js").Edition;
|
|
18
|
+
readonly introducedIn: import("./audit.js").Edition;
|
|
19
|
+
}) => import("./audit.js").EditionReach;
|
|
20
|
+
export declare const isEdition: (text: string) => text is import("./audit.js").Edition;
|
package/api/audit.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
editionReaches,
|
|
3
|
+
isEdition
|
|
4
|
+
} from "../chunks/chunk-NA5L6PUE.js";
|
|
1
5
|
import {
|
|
2
6
|
folderScope
|
|
3
7
|
} from "../chunks/chunk-QWA6OVLC.js";
|
|
4
8
|
|
|
5
9
|
// api/audit.ts
|
|
6
10
|
var folderScope2 = folderScope;
|
|
11
|
+
var editionReaches2 = editionReaches;
|
|
12
|
+
var isEdition2 = isEdition;
|
|
7
13
|
export {
|
|
8
|
-
|
|
14
|
+
editionReaches2 as editionReaches,
|
|
15
|
+
folderScope2 as folderScope,
|
|
16
|
+
isEdition2 as isEdition
|
|
9
17
|
};
|