@hailstails/hone 0.1.0-pre.2 → 0.1.0-pre.4

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.
Files changed (31) hide show
  1. package/ADOPTING.md +17 -17
  2. package/MIGRATING.md +1 -1
  3. package/README.md +66 -17
  4. package/api/audit.d.ts +10 -0
  5. package/api/audit.js +1 -0
  6. package/api/rule-set.d.ts +6 -0
  7. package/api/rule-set.js +1 -0
  8. package/chunks/{chunk-TRCB27ET.js → chunk-BX6QHLSZ.js} +1 -13
  9. package/chunks/{chunk-233U4FBA.js → chunk-EYCRDEXX.js} +13 -2
  10. package/chunks/{chunk-7ZJZZBSS.js → chunk-FOAGAYXM.js} +73 -13
  11. package/chunks/{chunk-HBY4ZWSP.js → chunk-RZA3OVOO.js} +3 -11
  12. package/core/check/tool-command.js +74 -42
  13. package/core/mechanism-port/runner-failure-types.d.ts +38 -0
  14. package/core/mechanism-port/runner-module-types.d.ts +8 -0
  15. package/core/mechanism-port/runner-result-types.d.ts +9 -0
  16. package/core/rule-set-reader/rule-set-types.d.ts +41 -0
  17. package/core/values/anchor.d.ts +10 -0
  18. package/core/values/branded.d.ts +5 -0
  19. package/core/values/clause-address-types.d.ts +9 -0
  20. package/core/values/identifier-types.d.ts +5 -0
  21. package/core/values/json-value.d.ts +3 -0
  22. package/core/values/repo-path-types.d.ts +2 -0
  23. package/core/values/result.d.ts +7 -0
  24. package/docs/adding-a-discipline-or-mechanism.md +2 -2
  25. package/mechanisms/audit/CD-19/import-boundaries.js +14 -6
  26. package/mechanisms/audit/runner/runner.js +33 -31
  27. package/mechanisms/audit/runner/typescript-parse.d.ts +20 -0
  28. package/mechanisms/audit/runner/walker-piece.d.ts +60 -0
  29. package/mechanisms/eslint/runner/eslint-piece-settings-types.d.ts +8 -0
  30. package/mechanisms/eslint/runner/runner.js +58 -42
  31. package/package.json +19 -2
package/ADOPTING.md CHANGED
@@ -10,27 +10,35 @@ Hone reads `disciplines.json` in `<repo>`, runs the selected disciplines' checks
10
10
  node --version
11
11
  ```
12
12
 
13
- It must print `v22.13.0` or a later 22.x, or `v24.0.0` or later. A rule set of your own whose piece modules are `.ts` files needs Node 22.18.0 or later, because Hone loads those modules as they are. Also needed: git 2.24 or later and npm. `<repo>` must be a git repository, and the files to check must be committed or staged: untracked files are not checked.
13
+ It must print `v22.18.0` or a later 22.x, or `v24.0.0` or later. A rule set of your own may write its piece modules as `.ts` files, which Hone runs with Node's built-in type stripping, so they are limited to what [Node's TypeScript support](https://nodejs.org/docs/latest-v22.x/api/typescript.html) allows: only syntax that can be erased, so no enums, no namespaces that hold values and no parameter properties; relative imports that spell the `.ts` extension; and `import type` (or `type` on each name) for anything that is only a type. Node does not strip types from files under `node_modules`, so a rule set installed as a package must ship `.js`. Also needed: git 2.24 or later and npm. `<repo>` must be a git repository, and the files to check must be committed or staged: untracked files are not checked.
14
14
 
15
15
  ## 2. Install the Hone package
16
16
 
17
17
  Hone ships as one npm package tarball: built JavaScript with its own packages bundled in, so it has no dependencies of its own and needs no TypeScript support from Node.
18
18
 
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. Version `0.1.0-pre.1` was released under the old name `honed`; [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone) says how to move from it.
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
- The current version, `0.1.0-pre.2`, is a pre-release: its commands, flags and files may still change before `0.1.0`. This page writes the tarball's location as `<hone-tarball>`: a path such as `vendor/hailstails-hone/hailstails-hone-0.1.0-pre.2.tgz`, or an `https://` URL your team serves it from.
21
+ Releases are pre-releases until a stable release is published: until then, commands, flags and files may still change between releases.
22
22
 
23
- The main route is to download `hailstails-hone-0.1.0-pre.2.tgz` from the [`v0.1.0-pre.2` GitHub release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.2), which the release workflow creates, marked as a pre-release, when the tag `v0.1.0-pre.2` is pushed. Until that tag exists, build the tarball from a pinned commit as below; the earlier [`v0.1.0-pre.1` release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.1) holds the previous pre-release under the old name `honed`.
23
+ The main route is the npm registry. Pre-releases are published under the dist-tag `next`, so name it:
24
24
 
25
- The alternative is to build the tarball yourself from a pinned commit. Install [bun](https://bun.sh) and pick the commit to pin, such as the latest on [`main`](https://github.com/HailsTails/hone/commits/main). Then run, with that commit's SHA in place of `<pinned-sha>`:
25
+ ```bash
26
+ npm install --save-dev @hailstails/hone@next
27
+ ```
28
+
29
+ npm records it in `package.json`, and the exact version it installed in the lockfile. Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. With pnpm or Yarn, add `@hailstails/hone@next` with their own `add -D` command at the workspace root. `next` names the newest pre-release approved on npm, so it can trail the newest GitHub release for a while; [README.md](README.md#developing-hone) says how a version reaches npm.
30
+
31
+ The alternative is a tarball, copied into the repository so every teammate and CI runner installs the same bytes without the registry. 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.
32
+
33
+ To build the tarball yourself, use Node.js 22.18 or later with [corepack](https://nodejs.org/api/corepack.html) available, which provides the pnpm version `package.json` pins, and pick the commit to pin, such as the latest on [`main`](https://github.com/HailsTails/hone/commits/main). Then run, with that commit's SHA in place of `<pinned-sha>`:
26
34
 
27
35
  ```bash
28
36
  git clone -c core.longpaths=true https://github.com/HailsTails/hone.git /tmp/hone-source
29
37
  git -C /tmp/hone-source checkout <pinned-sha>
30
- cd /tmp/hone-source && bun install --frozen-lockfile && bun run pack-package && cd -
38
+ cd /tmp/hone-source && corepack pnpm install --frozen-lockfile && corepack pnpm run pack-package && cd -
31
39
  ```
32
40
 
33
- The last command prints `pack package: wrote <path>/artefacts/hailstails-hone-0.1.0-pre.2.tgz`. Copy the downloaded or built tarball into `<repo>/vendor/hailstails-hone/` and commit it with a message naming the release tag or the pinned SHA, so every teammate and CI runner installs the same bytes. The commands in this guide are POSIX shell; on Windows run them in Git Bash.
41
+ The last command prints `pack package: wrote <path>/artefacts/hailstails-hone-<version>.tgz`. Copy the downloaded or built tarball into `<repo>/vendor/hailstails-hone/` and commit it with a message naming the release tag or the pinned SHA. The commands in this guide are POSIX shell; on Windows run them in Git Bash.
34
42
 
35
43
  Install it as a development dependency of the repository root, beside the toolchain:
36
44
 
@@ -40,14 +48,6 @@ npm install --save-dev <hone-tarball>
40
48
 
41
49
  npm records it in `package.json` and the lockfile. With pnpm or Yarn, add the same tarball with their own `add -D` command at the workspace root.
42
50
 
43
- After the first registry publish of `@hailstails/hone`, the registry is a third route, with no tarball to copy or commit. Pre-releases are published under the dist-tag `next`, so name it:
44
-
45
- ```bash
46
- npm install --save-dev @hailstails/hone@next
47
- ```
48
-
49
- npm records the exact version it installed in the lockfile. Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. Until that first publish, npm answers this command with `404 Not Found`; use one of the tarball routes above.
50
-
51
51
  Add the two commands to the root `package.json` scripts:
52
52
 
53
53
  ```json
@@ -72,7 +72,7 @@ A repository that already has them in range needs nothing more. A package that i
72
72
 
73
73
  Hone finds these by Node's resolution upward from where the package is installed, so in a monorepo they must resolve from the repository root: declare them in the root `package.json` (with pnpm, `pnpm add -Dw` at the versions the packages already use), even where packages also declare their own. Yarn Plug'n'Play is not supported, because Hone resolves the toolchain through `node_modules`.
74
74
 
75
- Commit `package.json`, the lockfile and the tarball if it is a file in the repository. To update later, repeat this step with a newer tarball.
75
+ Commit `package.json`, the lockfile and the tarball if it is a file in the repository. To update later, run `npm install --save-dev @hailstails/hone@next` again, or repeat this step with a newer tarball.
76
76
 
77
77
  ## 3. Read what each discipline means
78
78
 
@@ -276,7 +276,7 @@ To use an agent, give it the lens file, the rule pages it names, the change and
276
276
 
277
277
  To update, repeat step 2 on a branch with a tarball built from a newer pinned SHA, compare the installed rule pages under `node_modules/@hailstails/hone/rules/` with the old ones, re-run `hone:project` if any clause is `eslint`, run the check, and commit with a message naming the new SHA. Rule text can change between pins, so read the changed pages. Before updating to a pin that has the causal why-chain contract, follow [MIGRATING.md section 8](MIGRATING.md#8-moving-to-causal-why-chains): pass `--base-revision` first, or the update's check reports `legacy-chain-unmeasured`.
278
278
 
279
- To remove, run `npm uninstall @hailstails/hone`, delete the two `hone:` scripts, the tarball, `disciplines.json`, `discipline-exceptions.json` and, with `eslint` clauses, `disciplines.eslint.mjs` and its spread in the flat config, and take the check out of the validation script.
279
+ To remove, run `npm uninstall @hailstails/hone`, delete the two `hone:` scripts, any vendored tarball, `disciplines.json`, `discipline-exceptions.json` and, with `eslint` clauses, `disciplines.eslint.mjs` and its spread in the flat config, and take the check out of the validation script.
280
280
 
281
281
  ## Worked example
282
282
 
package/MIGRATING.md CHANGED
@@ -231,7 +231,7 @@ Version `0.1.0-pre.1` was published as the GitHub release tarball `honed-0.1.0-p
231
231
  | governance rule `honed/inline-config` | `hone-core/inline-config` |
232
232
  | rule pages under `node_modules/honed/rules/` | `node_modules/@hailstails/hone/rules/` |
233
233
 
234
- 1. **Swap the package.** Run `npm uninstall honed`, then install `@hailstails/hone` as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 says: the tarball `hailstails-hone-0.1.0-pre.2.tgz` from the `v0.1.0-pre.2` release, or, after the first registry publish, `npm install --save-dev @hailstails/hone@next`. Replace the vendored `honed-0.1.0-pre.1.tgz` if the repository keeps one. `typescript` is now a required peer, where `honed` declared it optional: if the repository root does not already declare it, npm 7 and later install the newest supported release on their own, so add it to `devDependencies` at the version the repository uses.
234
+ 1. **Swap the package.** Run `npm uninstall honed`, then install `@hailstails/hone` as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 says: `npm install --save-dev @hailstails/hone@next`, or the tarball attached to the latest [GitHub release](https://github.com/HailsTails/hone/releases). Remove the vendored `honed-0.1.0-pre.1.tgz` if the repository keeps one, or replace it with the new tarball. `typescript` is now a required peer, where `honed` declared it optional: if the repository root does not already declare it, npm 7 and later install the newest supported release on their own, so add it to `devDependencies` at the version the repository uses.
235
235
  2. **Re-project straight away** if any clause is `eslint`, before the check, the linter or anything else runs: `npm run --silent hone:project`, then commit `disciplines.eslint.mjs`. Until then the committed projection still imports `honed/...`, which is no longer installed, so the repository's own ESLint cannot load its configuration and the check stops with `load failure: runner-failed eslint team-config-unloadable Cannot find package 'honed' imported from ...disciplines.eslint.mjs` and exit 2. `hone project` does not load the old projection, so it runs and repairs it. Its import specifiers change from `honed/...` to `@hailstails/hone/...`, and its block names from `honed/...` to `hone-core/...`, in that same re-projection. The disciplines' rule ids `hone/...` and `hone-cd<N>/...` stay, so an `eslint-disable` comment, team config entry or suppression needs renaming only if it names `honed/inline-config`, which is now `hone-core/inline-config`.
236
236
  3. **Keep the scripts.** `"hone:check": "hone check --repo ."` and `"hone:project": "hone project --repo ."` work unchanged, because the command is still `hone`.
237
237
  4. **Repoint agent instructions** from `node_modules/honed/rules/` to `node_modules/@hailstails/hone/rules/`.
package/README.md CHANGED
@@ -1,14 +1,20 @@
1
1
  # Hone
2
2
 
3
+ [![npm version on the next dist-tag](https://img.shields.io/npm/v/%40hailstails%2Fhone/next)](https://www.npmjs.com/package/@hailstails/hone)
4
+ [![CI on main](https://github.com/HailsTails/hone/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/HailsTails/hone/actions/workflows/ci.yml?query=branch%3Amain)
5
+ [![Unpacked size on the next dist-tag](https://img.shields.io/npm/unpacked-size/%40hailstails%2Fhone/next)](https://www.npmjs.com/package/@hailstails/hone)
6
+ [![Supported Node versions on the next dist-tag](https://img.shields.io/node/v/%40hailstails%2Fhone/next)](https://www.npmjs.com/package/@hailstails/hone)
7
+ [![Licence](https://img.shields.io/npm/l/%40hailstails%2Fhone)](LICENSE)
8
+
3
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.
4
10
 
5
11
  **Install the npm package `@hailstails/hone`.** The unscoped name `hone` on npm belongs to an unrelated package: never run `npm install hone`. `@hailstails/hone` installs one command, `hone`:
6
12
 
7
13
  ```bash
8
- npm install --save-dev ./vendor/hailstails-hone/hailstails-hone-0.1.0-pre.2.tgz
14
+ npm install --save-dev @hailstails/hone@next
9
15
  ```
10
16
 
11
- Version `0.1.0-pre.2` is a pre-release, downloaded as `hailstails-hone-0.1.0-pre.2.tgz` from the [`v0.1.0-pre.2` GitHub release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.2) once that tag is pushed. The earlier [`v0.1.0-pre.1` release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.1) holds the previous pre-release under the package's old name, `honed`; [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone) says how to move from it. After the first registry publish of `@hailstails/hone`, `npm install --save-dev @hailstails/hone@next` installs the latest pre-release from npm instead. [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.
17
+ Releases are pre-releases, published to npm under the dist-tag `next`, until a stable release is published under `latest`; the badge above shows the version `next` installs. 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.
12
18
 
13
19
  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).
14
20
 
@@ -90,8 +96,8 @@ At the repository root. It selects clauses and the mechanism that checks each on
90
96
  }
91
97
  ```
92
98
 
93
- - `ruleSets` names the repository's own rule sets, each a directory relative to the repository root. The name `shared` is reserved for the rule set shipped with core.
94
- - `clauses` maps a clause address to a mechanism id. An address is `[<ruleSet>/]<DisciplineId>#<clauseId>`; no prefix means the shared rule set. The mechanism must be one the clause lists.
99
+ - `ruleSets` names the repository's own rule sets, each a directory relative to the repository root. The name `hone` is reserved for the rule set shipped with the tool; `hone/CD-15#loops` and `CD-15#loops` are the same address. A rule-set name may not start with `hone-`, and no declared name may be another declared name plus `-<suffix>`.
100
+ - `clauses` maps a clause address to a mechanism id. An address is `[<ruleSet>/]<DisciplineId>#<clauseId>`; no prefix means the `hone` rule set. The mechanism must be one the clause lists.
95
101
  - Selecting a clause adopts its discipline. Mechanical clauses of an adopted discipline that are not selected are reported as uncovered, and fail the run.
96
102
  - A judgement clause cannot be selected; it is enforced by review.
97
103
  - `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.
@@ -143,16 +149,27 @@ At the repository root; absent means no exceptions. Each entry names a selected
143
149
 
144
150
  ## Installing
145
151
 
146
- Hone installs as one npm package, `@hailstails/hone`, downloaded as `hailstails-hone-0.1.0-pre.2.tgz` from the `v0.1.0-pre.2` GitHub release once that tag is pushed, installed after the first registry publish as `@hailstails/hone@next` from npm, or built by `bun run pack-package` into `artefacts/hailstails-hone-0.1.0-pre.2.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 with `zod`, `jsonc-parser` and `@eslint/plugin-kit` bundled in, so it has no `dependencies`; its licences are reproduced in `THIRD-PARTY-NOTICES.md` inside it. 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. Version `0.1.0-pre.2` is a pre-release.
152
+ Hone installs as one npm package, `@hailstails/hone`, installed as `@hailstails/hone@next` from npm, 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 with `zod`, `jsonc-parser` and `@eslint/plugin-kit` bundled in, so it has no `dependencies`; its licences are reproduced in `THIRD-PARTY-NOTICES.md` inside it. 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.
147
153
 
148
154
  With the ESLint mechanism selected, a packaged install's projection imports each piece by package name, `@hailstails/hone/mechanisms/eslint/<DisciplineId>/...`, so the repository's ESLint must resolve the package from the repository root. Hone compares the committed projection `disciplines.eslint.mjs` byte for byte with what `hone project` would write now.
149
155
 
156
+ ## Public type entries
157
+
158
+ The package has two public entries for TypeScript. Each holds types only, so importing one adds no code to a build; import them with `import type`.
159
+
160
+ | Entry | Status | What it is for |
161
+ | --- | --- | --- |
162
+ | `@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. |
163
+ | `@hailstails/hone/audit` | Experimental | The types for writing an audit walker piece, `WalkerPiece` and what it needs. It may change in a minor release. |
164
+
165
+ Both resolve with `moduleResolution` `"nodenext"` or `"bundler"`, and `install-proof` type-checks a team piece against them on TypeScript 4.8.4 (`"nodenext"`, since 4.8 has no `"bundler"`) and 6.0.3 (both). `@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.
166
+
150
167
  ## Runtime
151
168
 
152
169
  - 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.
153
- - The package: Node `^22.13.0 || >=24` (its `engines.node`). It is plain JavaScript, so Node never strips types from it.
170
+ - 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.
154
171
  - git 2.24 or later. Older git rejects `--end-of-options`, so the changed-file query fails and forfeiture is reported unmeasured.
155
- - Hone's own packages, `zod`, `jsonc-parser` and `@eslint/plugin-kit`, exact-pinned in `dependencies` and locked by `bun.lock`: bundled into the package. They are implementation details: nothing of theirs crosses into the repository's code or configuration.
172
+ - Hone's own packages, `zod`, `jsonc-parser` and `@eslint/plugin-kit`, exact-pinned in `dependencies` and locked by `pnpm-lock.yaml`: bundled into the package. They are implementation details: nothing of theirs crosses into the repository's code or configuration.
156
173
  - The repository's own toolchain, declared as `peerDependencies`: `typescript` `>=4.8.4 <7.0.0`, a required peer because every audit clause needs it, and for the ESLint mechanism the optional peers `eslint` `^9.12.0 || ^10.0.0`, `@typescript-eslint/parser` `^8.56.0` and `@typescript-eslint/eslint-plugin` `^8.56.0`. npm 7 and later install a missing required peer on their own, so declare `typescript` at the root at the version the repository uses. Each floor is the oldest release Hone is tested on: TypeScript 4.8 is the oldest whose syntax API the audit uses (`getModifiers`), ESLint 9.12.0 the first 9.x that can look up the configuration nearest each file, and typescript-eslint 8.56.0 the first whose peer range accepts ESLint 10. TypeScript stops below 7 because TypeScript 7's compiler API is a different one. Yarn Plug'n'Play is not supported.
157
174
 
158
175
  Hone loads the toolchain by Node's own resolution, upward from the install directory, which is the same resolution the pieces' plugin modules get when the team's ESLint loads the projection. Hone's query of the team's configuration, its governance run and the pieces therefore all use one copy, the repository's. Keep the toolchain resolvable from the repository root: declare it in the root `package.json` (in a pnpm workspace, `pnpm add -Dw`). A package may install a different ESLint for its own lint script; Hone's verdict still comes from the root's, its governance behaviour is the same on either supported line, and the pieces that wrap native rules wrap the root's copies there too. Hone's tests run the governance path and every piece's shared cases on four ESLint lines, 9.12.0 and 10.0.0 with typescript-eslint 8.56.0 and 9.39.5 and 10.11.0 with 8.71.2, and the audit pieces' shared cases on TypeScript 4.8.4 and 6.0.3; the in-process consumer fixtures run on ESLint 10.11.0, and `install-proof` runs real consumers on each floor.
@@ -161,6 +178,19 @@ A peer that is missing, cannot load, or is outside its range stops the mechanism
161
178
 
162
179
  A repository can hold one `eslint.config.*` at its root or one per package. Hone resolves the team's configuration the way the team's own ESLint run does. ESLint 10, and ESLint 9 started with `--flag v10_config_lookup_from_file` (or `unstable_config_lookup_from_file`), use the `eslint.config.*` nearest each checked file. Plain ESLint 9 uses only the one in the directory it runs from, so for a repository whose `eslint` resolves to 9.x at `node_modules/eslint` and whose lint scripts carry no such flag, Hone reads the root `eslint.config.*` for every file, and fails the run as `team-config-unloadable` if there is none. When Hone cannot read an installed `eslint` at the repository root it assumes the nearest-to-file lookup. Each config that applies to a file must spread the projection. Detection cannot see how a task runner starts ESLint, so `disciplines.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.
163
180
 
181
+ ## Compatibility
182
+
183
+ Hone's version numbers follow semantic versioning under these rules:
184
+
185
+ - A new or tightened check ships off by default in a minor release and becomes a default only in a major release.
186
+ - 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`.
187
+ - A change to a clause address, a config key in `disciplines.json` or `discipline-exceptions.json`, or a CLI flag is a major release.
188
+ - A breaking change to a type in `@hailstails/hone/rule-set` is a major release. `@hailstails/hone/audit` is experimental: its types may change in a minor release until it is marked stable.
189
+ - Before the first stable release, a change that would need a major release ships in a minor release instead.
190
+ - A pre-release previews the release it is numbered towards and is published under the `next` dist-tag. A change of any size can land between two pre-releases of the same release, and the changelog lists it.
191
+
192
+ Each release's changes are listed in [the changelog](https://github.com/HailsTails/hone/blob/main/CHANGELOG.md) in the repository.
193
+
164
194
  ## Known limits
165
195
 
166
196
  The ESLint pieces use the plugin namespace `hone` for CD-14 and `hone-cd<N>` for the others, so a rule id reads `hone/no-class-authoring`. The namespace `hone-core` is reserved for Hone's own machinery, never a discipline's rule: it names the projection's block names, such as `hone-core/piece/hone`, and the governance rule `hone-core/inline-config`, which reports inline configuration comments. No piece may use it.
@@ -184,7 +214,7 @@ This is the first release. Its tests cover each supported platform's ordinary pa
184
214
 
185
215
  ## Developing Hone
186
216
 
187
- This repository is self-contained: it holds its own configuration and its own lock. `package.json` declares the packages the code imports and the development tools, `bun.lock` locks both, `tsconfig.json` typechecks the code under `strict`, `lint.biome.json` configures the linter, and `vitest.config.ts` runs its tests. Install with `bun install --frozen-lockfile` in this directory, then run a script from it:
217
+ This repository is self-contained: it holds its own configuration and its own lock. `package.json` declares the packages the code imports and the development tools, `pnpm-lock.yaml` locks both, `tsconfig.json` typechecks the code under `strict`, `lint.biome.json` configures the linter, and `vitest.config.ts` runs its tests. `package.json` pins the pnpm version that locks and installs them, `pnpm-workspace.yaml` holds its settings, and pnpm resolves a dependency only to a release that is at least three days old when a dependency is added or updated; installing from the lock does not re-check it. Run `corepack enable` once so that Node provides that pnpm, install with `pnpm install --frozen-lockfile` in this directory, then run a script from it with `pnpm run <script>`:
188
218
 
189
219
  | Script | Runs |
190
220
  | --- | --- |
@@ -192,11 +222,13 @@ This repository is self-contained: it holds its own configuration and its own lo
192
222
  | `lint` | Biome with `lint.biome.json` |
193
223
  | `test` | Vitest with `vitest.config.ts` |
194
224
  | `check` | all three in that order |
195
- | `build-package` | `node scripts/build-package.ts`: bundles Hone with esbuild from its own installed packages into `dist/`, and adds the published `package.json`, the shipped documents and data, and `THIRD-PARTY-NOTICES.md`. It fails if an output imports anything but a `node:` builtin or a declared peer, if a command or runner is not emitted at its own path with its own code, if a bundled package's version is not the one the lock holds, or if a shipped page links to a file the package does not ship. The tool's name, package name, command name, reserved ESLint namespace, description, GitHub repository and the unrelated npm name to warn against live in `core/values/tool-identity.ts`, which the build, the install proof, the release text, the command's usage line and the ESLint runner all read. The reserved namespace is its own field, independent of the package name |
225
+ | `build-package` | `node scripts/build-package.ts`: bundles Hone with esbuild from its own installed packages into `dist/`, and adds the published `package.json`, the shipped documents and data, and `THIRD-PARTY-NOTICES.md`. It fails if an output imports anything but a `node:` builtin or a declared peer, if a command or runner is not emitted at its own path with its own code, if a bundled package's version is not the one the lock holds, or if a shipped page links to a file the package does not ship. The tool's name, package name, command name, shipped rule-set name, reserved ESLint namespace, description, GitHub repository and the unrelated npm name to warn against live in `core/values/tool-identity.ts`, which the build, the install proof, the release text, the command's usage line and the ESLint runner all read. The reserved namespace is its own field, independent of the package name |
196
226
  | `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` |
197
227
  | `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 |
198
- | `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>`. See [Core's check on itself](#hones-check-on-itself) |
228
+ | `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) |
199
229
  | `install-proof` | `node scripts/install-proof.ts`: packs the package once into a temporary tarball and installs it offline into four CommonJS consumers in an OS temporary directory outside the working tree: the audit on TypeScript 4.8.4, ESLint 9.12.0, ESLint 10.0.0, and one without `eslint`. It installs each toolchain once, at the peers' floors, in a folder the consumers sharing it sit inside: TypeScript 4.8.4 alone for the audit consumer and the consumer without `eslint`, and ESLint 9.12.0 or 10.0.0 with typescript-eslint 8.56.0 and TypeScript 4.8.4 for the two ESLint consumers. Each consumer declares the required peer `typescript` at its floor in its own `devDependencies`, as an adopter does, and the proof checks that `typescript` resolves there at 4.8.4, since npm would otherwise install the newest supported release beside it. Each consumer runs both commands through the installed bins with type stripping off, expecting a fail on a class, a pass once it is removed, a projection importing each piece by package name, and `toolchain-unavailable` for the consumer without `eslint`; the temporary directory is removed afterwards |
230
+ | `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) |
231
+ | `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) |
200
232
 
201
233
  ### Hone's check on itself
202
234
 
@@ -204,14 +236,31 @@ This repository is self-contained: it holds its own configuration and its own lo
204
236
 
205
237
  `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.
206
238
 
207
- Continuous integration runs `check`, `build-package`, `package-determinism` and `install-proof` on every pull request, drafts included, and on every push to `main`, from `bun.lock` alone. It runs the same steps on Windows and on Linux, and both pass.
239
+ Continuous integration runs `check`, `build-package`, `package-determinism` and `install-proof` on every pull request, drafts included, and on every push to `main`, from `pnpm-lock.yaml` alone. It runs the same steps on Windows and on Linux, and both pass. Two further jobs, `Package on Node <version> on <platform>`, are not required checks. One builds the package and runs `install-proof` on macOS with the oldest Node the package claims; the other does the same on Node 24 on Linux and also runs the test suite. The required jobs already prove the oldest claimed Node on Windows and Linux. The extra jobs show that the package installs and runs on the other platform and Node line, against the toolchain floors `install-proof` uses. 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.
240
+
241
+ ### Versions and releases
242
+
243
+ Pull requests are squash-merged, and the pull request's title becomes the commit's subject on `main`. The `pull-request-title` check requires that title to be a Conventional Commits subject: `type(scope)!: description`, where the scope is optional and lowercase, `!` marks a breaking change as [Compatibility](#compatibility) defines it, and the type is one of `feat`, `fix`, `perf`, `revert`, `docs`, `refactor`, `test`, `build`, `ci`, `chore` or `style`. Reverting behaviour that has been released is breaking, so its title is `revert!:`; `revert:` without `!` is for undoing a change that has not been released, and counts as a patch. A title that changes the ESLint projection says that adopters must run `hone project`, since the title becomes the changelog entry. `.github/dependabot.yml` leaves Dependabot's routine version updates off and gives its security pull requests a conventional title with the type `build` and a scope, such as `build(deps):`. It covers the GitHub Actions the workflows use and, through the `npm` ecosystem, which is how Dependabot names pnpm, the JavaScript dependencies in `pnpm-lock.yaml`. A security release published in the last three days can be held back by the minimum release age when pnpm resolves it.
244
+
245
+ To prepare a release, create a new branch at the tip of `main` and run `pnpm run release-pull-request` on it before anything is committed to it. It finds the highest release tag `v<version>` merged into `HEAD`, reads the full message of every commit after it, and works out the next version. It needs that history to be the straight line of squash-merged commits that `main` holds, so it refuses, changing nothing and naming the commits, when any of them is a merge commit, since a merge brings in changes whose subjects it cannot size. It works out the version like this:
246
+
247
+ - A subject with `!`, or a message with a `BREAKING CHANGE:` or `BREAKING-CHANGE:` footer line, is a major change, `feat` a minor change, and every other subject a patch. While the major version is 0, a major change counts as a minor one, so the script never picks the first stable release: the owner prepares that release by hand, setting the version in `package.json` and writing its changelog section, and only on her word.
248
+ - On a pre-release, a change no larger than the one the pre-release is numbered towards moves to the next pre-release number; a larger one starts the next version's first pre-release. On a stable release, the change increments the version.
249
+ - The release stays on the latest tag's channel. Pass `stable` to finish a pre-release as its stable version, or `pre-release` to start a pre-release line from a stable one.
250
+
251
+ It then writes a section for that version at the top of `CHANGELOG.md`, grouping the subjects under Breaking changes, Features, Fixes and Other changes, and sets `version` in `package.json`. It refuses, changing nothing, when no subject follows the tag, when a merge commit does, when `package.json` is not at the tag's version, or when the changelog already has the new version. A subject that is not a Conventional Commits subject is named on standard error and counted as a patch under Other changes, or as a major under Breaking changes when its message has a breaking footer, so check its place before opening the pull request. If writing the second file fails, it restores the first. The script only edits those two files: it never commits, tags, pushes or publishes. Open the release pull request with the title `chore(release): <version>`.
252
+
253
+ `CHANGELOG.md` names versions, so it stays in the repository and out of the package; the shipped pages link to it on GitHub.
254
+
255
+ Once the release pull request is on `main`, a release starts from a pushed tag `v<version>` that matches the `version` in `package.json`, pushed only on the owner's word. The release workflow runs `check`, `package-determinism` and `install-proof`, packs the tarball with `pack-package`, records the tarball's name and SHA-256 as outputs of the release job, and attaches it to a GitHub release for that tag. `gh release create` creates that release as a draft, uploads the tarball and only then publishes it, so with immutable releases on, the tarball is attached before the release's assets and tag become immutable. `scripts/release-text-command.ts` prints the release's title from the identity and the tag, its notes, which name the npm install command under its dist-tag and the attached tarball but no version, and its dist-tag: `next` when the version has a pre-release part such as `-pre.1` before any `+` build metadata, otherwise `latest`. The release is marked as a pre-release exactly when its dist-tag is `next`, and the step stops if any of the three cannot be printed. The release does not wait on npm.
208
256
 
209
- A release starts from a pushed tag `v<version>` that matches the `version` in `package.json`. The release workflow runs `check`, `package-determinism` and `install-proof`, packs the tarball with `pack-package`, records the tarball's name and SHA-256 as outputs of the release job, and attaches it to a GitHub release for that tag. `gh release create` creates that release as a draft, uploads the tarball and only then publishes it, so with immutable releases on, the tarball is attached before the release's assets and tag become immutable. `scripts/release-text-command.ts` prints the release's title and notes from the identity, and its dist-tag: `next` when the version has a pre-release part such as `-pre.1` before any `+` build metadata, otherwise `latest`. The release is marked as a pre-release exactly when its dist-tag is `next`, and the step stops if any of the three cannot be printed. The release does not wait on npm.
257
+ A version reaches npm in four steps:
210
258
 
211
- Once the GitHub release exists, a second job downloads that release's tarball, refuses it unless its SHA-256 equals the one the release job recorded in the same run, and publishes it with `npm publish` under the release job's dist-tag. The job runs in the GitHub environment `npm`, which accepts only `v*` tags. It authenticates by npm trusted publishing, so no npm token is stored, and npm adds provenance itself. The published `package.json` carries `repository`, `homepage` and `bugs` from the identity's repository, which trusted publishing matches against this repository, and `publishConfig.access` `public`, because npm otherwise publishes a scoped package as restricted. The job runs only when the repository variable `NPM_PUBLISH` is `enabled`; with any other value, or none, it is skipped and the release is unaffected. `build-package` fails if a shipped page names the tarball at a version other than the one in `package.json`.
259
+ 1. The pushed tag creates the GitHub release, as above.
260
+ 2. A second job downloads that release's tarball, refuses it unless its SHA-256 equals the one the release job recorded in the same run, and stages it with `npm stage publish` under the release job's dist-tag. A staged version is held by npm and cannot be installed. Its dist-tag is fixed when it is staged.
261
+ 3. The npm owner approves it, on npmjs.com under `@hailstails/hone`, Staged Packages, or with `npm stage approve <stage-id>`. Approval needs the owner's two-factor sign-in, so CI cannot approve.
262
+ 4. The version is published under its dist-tag and installable.
212
263
 
213
- Turning on npm publishing takes three steps, in this order:
264
+ The second job runs in the GitHub environment `npm`, which accepts only `v*` tags, and only when the repository variable `NPM_PUBLISH` is `enabled`; with any other value, or none, it is skipped and the release is unaffected. It authenticates by npm trusted publishing, so no npm token is stored. The trusted publisher is saved on npmjs.com under `@hailstails/hone`, Settings, Trusted publishing, GitHub Actions, as: user `HailsTails`, repository `hone`, workflow filename `release.yml`, environment `npm`, with both allowed actions, "npm publish" and "npm dist-tag", unticked, so CI can only stage. The published `package.json` carries `repository`, `homepage` and `bugs` from the identity's repository, which trusted publishing matches against this repository, and `publishConfig.access` `public`, because npm otherwise publishes a scoped package as restricted. `build-package` fails if a shipped page names a versioned tarball of the package, at any version, or the version in `package.json`, with or without a leading `v`, so a page cannot name the current version and go stale on the next release.
214
265
 
215
- 1. Push the tag `v0.1.0-pre.2` with `NPM_PUBLISH` unset, so the release workflow creates the release and skips npm. Then publish `@hailstails/hone` once by hand from that release's tarball: download it with `gh release download v0.1.0-pre.2 --repo HailsTails/hone --pattern 'hailstails-hone-*.tgz'`, sign in with `npm login` as the npm user `hailstails`, who owns the `@hailstails` scope (npm refuses a scoped publish from any other user), and run `npm publish ./hailstails-hone-0.1.0-pre.2.tgz --tag next --access public`. The earlier `v0.1.0-pre.1` release's tarball can never be published: it names the package `honed`, which npm refuses as too similar to existing packages.
216
- 2. Only just before pushing the tag after `v0.1.0-pre.2`, add the trusted publisher on npmjs.com, under `@hailstails/hone`, Settings, Trusted publishing, GitHub Actions: user `HailsTails`, repository `hone`, workflow filename `release.yml`, environment `npm`. Then set `NPM_PUBLISH` to `enabled`, under Settings, Secrets and variables, Actions, Variables, or with `gh variable set NPM_PUBLISH --body enabled --repo HailsTails/hone`. npm does not check the trusted publisher when it is saved, and one that has not completed a successful publish within 2 days of being added expires and can no longer be used or edited.
217
- 3. Push that next tag. Its release run is the only thing that publishes from CI: re-running an older release run tries to publish a version npm already has, so it cannot complete the trusted publisher's first publish.
266
+ npm does not check a trusted publisher when it is saved, and one that has not completed a successful publish within 2 days of being added expires and can no longer be used or edited. npm's documentation does not say whether a staged publish counts as that first publish, so save the trusted publisher only just before pushing a tag, and approve the staged version within the same 2 days. A re-run of an older release run stages a version npm already has, so it cannot complete that first publish.
package/api/audit.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export type { RunnerFailure, PeerKind } from "../core/mechanism-port/runner-failure-types.js";
2
+ export type { RunnerClause } from "../core/mechanism-port/runner-module-types.js";
3
+ export type { Hit } from "../core/mechanism-port/runner-result-types.js";
4
+ export type { Anchor, AnchorKind } from "../core/values/anchor.js";
5
+ export type { ClauseAddress, ToolRuleSet } from "../core/values/clause-address-types.js";
6
+ export type { ClauseId, DisciplineId, RuleSetName } from "../core/values/identifier-types.js";
7
+ export type { RepoPath } from "../core/values/repo-path-types.js";
8
+ export type { Result } from "../core/values/result.js";
9
+ export type { CommentRange, SyntaxApi, SyntaxNode, SyntaxTree } from "../mechanisms/audit/runner/typescript-parse.js";
10
+ export type { PieceHit, PreparedFileCheck, PreparedWalkerCheck, SourceObservers, WalkerFile, WalkerPiece, WalkerRepository } from "../mechanisms/audit/runner/walker-piece.js";
package/api/audit.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export type { ClauseDefinition, ClauseExceptions, DisciplineFile, PieceFile, SourceCase } from "../core/rule-set-reader/rule-set-types.js";
2
+ export type { AnchorKind } from "../core/values/anchor.js";
3
+ export type { ClauseId, DisciplineId, MechanismId } from "../core/values/identifier-types.js";
4
+ export type { JsonValue } from "../core/values/json-value.js";
5
+ export type { RepoPath } from "../core/values/repo-path-types.js";
6
+ export type { EslintPieceSettings, RuleOptions } from "../mechanisms/eslint/runner/eslint-piece-settings-types.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -4,18 +4,7 @@ import {
4
4
  external_exports,
5
5
  mechanismIdSchema,
6
6
  repoPathSchema
7
- } from "./chunk-7ZJZZBSS.js";
8
-
9
- // core/values/tool-identity.ts
10
- var TOOL_IDENTITY = {
11
- name: "Hone",
12
- packageName: "@hailstails/hone",
13
- command: "hone",
14
- reservedEslintNamespace: "hone-core",
15
- description: "Checks a repository against the disciplines it selects, applies its recorded exceptions and prints one verdict.",
16
- repository: "https://github.com/HailsTails/hone",
17
- unrelatedNpmPackage: "hone"
18
- };
7
+ } from "./chunk-FOAGAYXM.js";
19
8
 
20
9
  // core/rule-set-reader/rule-set-reader.ts
21
10
  var SUPPORTED_VERSION = 1;
@@ -191,7 +180,6 @@ var readPieceFile = (request) => {
191
180
  var eslintConfigLookupSchema = external_exports.enum(["nearest-to-file", "repository-root"]);
192
181
 
193
182
  export {
194
- TOOL_IDENTITY,
195
183
  parsedJson,
196
184
  readVersionOneJson,
197
185
  disciplineFilePath,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createDefaultPathPort,
3
3
  installRootAboveEntry
4
- } from "./chunk-7ZJZZBSS.js";
4
+ } from "./chunk-FOAGAYXM.js";
5
5
 
6
6
  // core/mechanism-port/toolchain-bound-runner.ts
7
7
  var builtOnce = (request) => request.toolchain.then((loaded) => loaded.outcome === "failed" ? loaded : { outcome: "ok", value: request.runnerOf(loaded.value) });
@@ -34,9 +34,20 @@ var createDefaultPackageLocationPort = (options) => ({
34
34
  locate: (request) => path.fromFileUrl({ url: import.meta.resolve(request.packageName) })
35
35
  });
36
36
 
37
+ // core/values/gathered-outcomes.ts
38
+ var gatheredOutcomes = (request) => {
39
+ const failed = request.outcomes.find((outcome) => outcome.outcome === "failed");
40
+ if (failed !== void 0) return failed;
41
+ return {
42
+ outcome: "ok",
43
+ value: request.outcomes.flatMap((outcome) => outcome.outcome === "ok" ? outcome.value : [])
44
+ };
45
+ };
46
+
37
47
  export {
38
48
  toolchainBoundStandaloneRunner,
39
49
  toolchainBoundEmbeddedRunner,
40
50
  installRootOfRunnerEntry,
41
- createDefaultPackageLocationPort
51
+ createDefaultPackageLocationPort,
52
+ gatheredOutcomes
42
53
  };
@@ -14593,9 +14593,23 @@ function date4(params) {
14593
14593
  // node_modules/zod/v4/classic/external.js
14594
14594
  config(en_default());
14595
14595
 
14596
+ // core/values/branded-schema.ts
14597
+ var brandedTextSchema = (request) => request.text.transform((text, context) => {
14598
+ if (request.isBranded(text)) {
14599
+ return text;
14600
+ }
14601
+ context.addIssue({ code: "custom", message: request.refusal });
14602
+ return external_exports.NEVER;
14603
+ });
14604
+
14596
14605
  // core/values/absolute-path.ts
14597
14606
  var POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT = /^(?:\/|[A-Za-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+[\\/])/;
14598
- var absolutePathSchema = external_exports.string().regex(POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT).brand();
14607
+ var isAbsolutePath = (text) => POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT.test(text);
14608
+ var absolutePathSchema = brandedTextSchema({
14609
+ text: external_exports.string().regex(POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT),
14610
+ isBranded: isAbsolutePath,
14611
+ refusal: "not an absolute path"
14612
+ });
14599
14613
 
14600
14614
  // core/platform-ports/path-port.ts
14601
14615
  var notAFileUrl = (request) => ({
@@ -14761,27 +14775,69 @@ var moduleFileForm = (request) => MODULE_EXTENSIONS.some((extension) => request.
14761
14775
  var UNWALKABLE_SEGMENTS = ["", ".", ".."];
14762
14776
  var LEADING_DRIVE_LETTER = /^[A-Za-z]:/;
14763
14777
  var LINE_BREAK_OR_NUL = /[\n\r\0]/;
14778
+ var NOT_A_REPO_PATH = "not a repo-relative path";
14764
14779
  var isRepoPathText = (request) => !request.text.startsWith("/") && !LEADING_DRIVE_LETTER.test(request.text) && !request.text.includes("\\") && !LINE_BREAK_OR_NUL.test(request.text) && request.text.split("/").every((segment) => !UNWALKABLE_SEGMENTS.includes(segment)) ? "repo-path" : "not-repo-path";
14765
- var repoPathSchema = external_exports.string().superRefine((text, context) => {
14780
+ var isRepoPath = (text) => isRepoPathText({ text }) === "repo-path";
14781
+ var repoPathTextSchema = external_exports.string().superRefine((text, context) => {
14766
14782
  if (isRepoPathText({ text }) === "not-repo-path") {
14767
- context.addIssue({ code: "custom", message: "not a repo-relative path" });
14783
+ context.addIssue({ code: "custom", message: NOT_A_REPO_PATH });
14768
14784
  }
14769
- }).brand();
14785
+ });
14786
+ var brandedRepoPathSchema = (request) => brandedTextSchema({ text: request.text, isBranded: isRepoPath, refusal: NOT_A_REPO_PATH });
14787
+ var repoPathSchema = brandedRepoPathSchema({ text: repoPathTextSchema });
14788
+
14789
+ // core/values/tool-identity.ts
14790
+ var identified = (identity) => identity;
14791
+ var TOOL_IDENTITY = identified({
14792
+ name: "Hone",
14793
+ packageName: "@hailstails/hone",
14794
+ command: "hone",
14795
+ ownRuleSet: "hone",
14796
+ reservedEslintNamespace: "hone-core",
14797
+ description: "Checks a repository against the disciplines it selects, applies its recorded exceptions and prints one verdict.",
14798
+ repository: "https://github.com/HailsTails/hone",
14799
+ unrelatedNpmPackage: "hone"
14800
+ });
14770
14801
 
14771
14802
  // core/values/identifiers.ts
14772
- var ruleSetNameSchema = external_exports.string().regex(/^[a-z][a-z0-9-]*$/).brand();
14773
- var disciplineIdSchema = external_exports.string().regex(/^[A-Z]{2,4}-[0-9]+[a-z]?$/).brand();
14774
- var clauseIdSchema = external_exports.string().regex(/^[a-z][a-z0-9-]*$/).brand();
14775
- var mechanismIdSchema = external_exports.string().regex(/^[a-z][a-z0-9-]*$/).brand();
14803
+ var RULE_SET_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
14804
+ var DISCIPLINE_ID_PATTERN = /^[A-Z]{2,4}-[0-9]+[a-z]?$/;
14805
+ var CLAUSE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
14806
+ var MECHANISM_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
14807
+ var NOT_AN_IDENTIFIER = "not an identifier of its kind";
14808
+ var isRuleSetName = (text) => RULE_SET_NAME_PATTERN.test(text);
14809
+ var isDisciplineId = (text) => DISCIPLINE_ID_PATTERN.test(text);
14810
+ var isClauseId = (text) => CLAUSE_ID_PATTERN.test(text);
14811
+ var isMechanismId = (text) => MECHANISM_ID_PATTERN.test(text);
14812
+ var ruleSetNameSchema = brandedTextSchema({
14813
+ text: external_exports.string().regex(RULE_SET_NAME_PATTERN),
14814
+ isBranded: isRuleSetName,
14815
+ refusal: NOT_AN_IDENTIFIER
14816
+ });
14817
+ var disciplineIdSchema = brandedTextSchema({
14818
+ text: external_exports.string().regex(DISCIPLINE_ID_PATTERN),
14819
+ isBranded: isDisciplineId,
14820
+ refusal: NOT_AN_IDENTIFIER
14821
+ });
14822
+ var clauseIdSchema = brandedTextSchema({
14823
+ text: external_exports.string().regex(CLAUSE_ID_PATTERN),
14824
+ isBranded: isClauseId,
14825
+ refusal: NOT_AN_IDENTIFIER
14826
+ });
14827
+ var mechanismIdSchema = brandedTextSchema({
14828
+ text: external_exports.string().regex(MECHANISM_ID_PATTERN),
14829
+ isBranded: isMechanismId,
14830
+ refusal: NOT_AN_IDENTIFIER
14831
+ });
14776
14832
 
14777
14833
  // core/values/clause-address.ts
14778
- var SHARED_RULE_SET = "shared";
14834
+ var TOOL_RULE_SET = TOOL_IDENTITY.ownRuleSet;
14779
14835
  var CLAUSE_ADDRESS_TEXT = /^(?:(?<ruleSet>[^/#]+)\/)?(?<discipline>[^/#]+)#(?<clause>[^/#]+)$/;
14780
14836
  var clauseAddressObjectSchema = external_exports.object({
14781
14837
  ruleSet: external_exports.union([
14782
- external_exports.literal(SHARED_RULE_SET),
14838
+ external_exports.literal(TOOL_RULE_SET),
14783
14839
  external_exports.object({
14784
- name: ruleSetNameSchema.refine((name) => name !== SHARED_RULE_SET)
14840
+ name: ruleSetNameSchema.refine((name) => name !== TOOL_RULE_SET)
14785
14841
  })
14786
14842
  ]),
14787
14843
  discipline: disciplineIdSchema,
@@ -14797,12 +14853,12 @@ var clauseAddressSchema = external_exports.string().transform((text, context) =>
14797
14853
  return external_exports.NEVER;
14798
14854
  }
14799
14855
  return {
14800
- ruleSet: parts.ruleSet === void 0 ? SHARED_RULE_SET : { name: parts.ruleSet },
14856
+ ruleSet: parts.ruleSet === void 0 || parts.ruleSet === TOOL_RULE_SET ? TOOL_RULE_SET : { name: parts.ruleSet },
14801
14857
  discipline: parts.discipline,
14802
14858
  clause: parts.clause
14803
14859
  };
14804
14860
  }).pipe(clauseAddressObjectSchema);
14805
- var clauseAddressText = (request) => request.address.ruleSet === SHARED_RULE_SET ? `${request.address.discipline}#${request.address.clause}` : `${request.address.ruleSet.name}/${request.address.discipline}#${request.address.clause}`;
14861
+ var clauseAddressText = (request) => request.address.ruleSet === TOOL_RULE_SET ? `${request.address.discipline}#${request.address.clause}` : `${request.address.ruleSet.name}/${request.address.discipline}#${request.address.clause}`;
14806
14862
  var sameClauseAddress = (request) => clauseAddressText({ address: request.left }) === clauseAddressText({ address: request.right }) ? "same" : "different";
14807
14863
 
14808
14864
  // core/mechanism-port/toolchain-requirement.ts
@@ -14886,14 +14942,18 @@ export {
14886
14942
  createDefaultFileTextPort,
14887
14943
  external_exports,
14888
14944
  isRepoPathText,
14945
+ repoPathTextSchema,
14946
+ brandedRepoPathSchema,
14889
14947
  repoPathSchema,
14890
14948
  createDefaultModuleLoaderPort,
14891
14949
  absolutePathSchema,
14892
14950
  createDefaultPathPort,
14951
+ TOOL_IDENTITY,
14893
14952
  ruleSetNameSchema,
14894
14953
  disciplineIdSchema,
14895
14954
  clauseIdSchema,
14896
14955
  mechanismIdSchema,
14956
+ TOOL_RULE_SET,
14897
14957
  clauseAddressObjectSchema,
14898
14958
  clauseAddressSchema,
14899
14959
  clauseAddressText,
@@ -2,15 +2,15 @@ import {
2
2
  clauseAddressObjectSchema,
3
3
  external_exports,
4
4
  repoPathSchema
5
- } from "./chunk-7ZJZZBSS.js";
5
+ } from "./chunk-FOAGAYXM.js";
6
6
 
7
- // core/values/anchor.ts
7
+ // core/values/anchor-schema.ts
8
8
  var anchorSchema = external_exports.object({
9
9
  line: external_exports.number().int().min(1),
10
10
  column: external_exports.number().int().min(0)
11
11
  }).readonly();
12
12
 
13
- // core/mechanism-port/runner-failure.ts
13
+ // core/mechanism-port/runner-failure-schema.ts
14
14
  var peerKindSchema = external_exports.enum(["required", "optional"]);
15
15
  var runnerFailureSchema = external_exports.discriminatedUnion("kind", [
16
16
  external_exports.object({ kind: external_exports.literal("piece-invalid"), pieceRoot: external_exports.string(), detail: external_exports.string() }).readonly(),
@@ -34,12 +34,6 @@ var runnerFailureSchema = external_exports.discriminatedUnion("kind", [
34
34
  installRoot: external_exports.string()
35
35
  }).readonly()
36
36
  ]);
37
- var runnerInvalidOutput = (request) => ({
38
- outcome: "failed",
39
- error: { kind: "runner-invalid-output", detail: request.detail }
40
- });
41
- var thrownMessage = (request) => request.thrown instanceof Error ? request.thrown.message : String(request.thrown);
42
- var rejectedCall = (request) => runnerInvalidOutput({ detail: `the runner call threw or rejected: ${thrownMessage(request)}` });
43
37
 
44
38
  // core/mechanism-port/runner-result-schema.ts
45
39
  var nativeExceptionKindSchema = external_exports.enum([
@@ -70,8 +64,6 @@ var runnerResultSchema = (request) => external_exports.union([
70
64
  ]);
71
65
 
72
66
  export {
73
- runnerInvalidOutput,
74
- rejectedCall,
75
67
  nativeExceptionKindSchema,
76
68
  hitSchema,
77
69
  projectionWriteSchema,