@hailstails/hone 0.1.0-pre.8 → 0.1.0-pre.9

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 (54) hide show
  1. package/ADOPTING.md +2 -2
  2. package/CHANGELOG.md +6 -0
  3. package/MIGRATING.md +1 -1
  4. package/README.md +4 -4
  5. package/api/audit.js +0 -1
  6. package/api/testing.js +8 -9
  7. package/chunks/chunk-5X2BR42Y.js +117 -0
  8. package/chunks/{chunk-NRXSM7BY.js → chunk-LHVFZMXD.js} +10 -7
  9. package/chunks/{chunk-5LCLBXP7.js → chunk-NILRE23T.js} +1 -1
  10. package/chunks/{chunk-P3NLETF5.js → chunk-OKQHVZLO.js} +1 -1
  11. package/chunks/{chunk-POZL7G62.js → chunk-OVEQ37JQ.js} +40 -37
  12. package/chunks/chunk-RNXPEK2U.js +77 -0
  13. package/chunks/{chunk-XXLMIBLS.js → chunk-XE6RNNZB.js} +162 -143
  14. package/chunks/{chunk-WPRR2MPJ.js → chunk-YL6WR3QW.js} +5 -5
  15. package/core/check/tool-command.js +20 -20
  16. package/mechanisms/audit/CD-1/any-cast.js +0 -1
  17. package/mechanisms/audit/CD-10/throws-in-tests.js +0 -1
  18. package/mechanisms/audit/CD-14/class-syntax.js +0 -1
  19. package/mechanisms/audit/CD-15/loops.js +0 -1
  20. package/mechanisms/audit/CD-17/clock-sources.js +0 -1
  21. package/mechanisms/audit/CD-19/import-boundaries.js +2 -3
  22. package/mechanisms/audit/CD-2/cast-expressions.js +0 -1
  23. package/mechanisms/audit/CD-23/export-test-sibling.js +0 -1
  24. package/mechanisms/audit/CD-25/dependency-isolation.js +0 -1
  25. package/mechanisms/audit/CD-26/module-mocking.js +0 -1
  26. package/mechanisms/audit/CD-27/test-body-logic.js +0 -1
  27. package/mechanisms/audit/CD-3/compiler-overrides.js +2 -861
  28. package/mechanisms/audit/CD-43/boolean-signatures.js +0 -1
  29. package/mechanisms/audit/CD-44/parameter-mutation.js +0 -1
  30. package/mechanisms/audit/CD-47/hermetic-git-spawns.js +0 -1
  31. package/mechanisms/audit/CD-5/comments-directives.js +3 -4
  32. package/mechanisms/audit/CD-6/identifier-names.js +0 -1
  33. package/mechanisms/audit/CD-7/categorical-paths.js +0 -1
  34. package/mechanisms/audit/CD-7a/factory-return-types.js +0 -1
  35. package/mechanisms/audit/CD-8/switch-defaults.js +0 -1
  36. package/mechanisms/audit/runner/runner.js +31 -27
  37. package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +0 -1
  38. package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +0 -2
  39. package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +0 -1
  40. package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -1
  41. package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +0 -2
  42. package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -1
  43. package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +0 -2
  44. package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +0 -2
  45. package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -1
  46. package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -1
  47. package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +0 -2
  48. package/mechanisms/eslint/runner/README.md +1 -1
  49. package/mechanisms/eslint/runner/runner.js +58 -2532
  50. package/package.json +6 -2
  51. package/THIRD-PARTY-NOTICES.md +0 -354
  52. package/chunks/chunk-MYX7GAVM.js +0 -73
  53. package/chunks/chunk-NCDYOPHG.js +0 -19832
  54. package/chunks/chunk-NZLE2WMY.js +0 -35
package/ADOPTING.md CHANGED
@@ -14,7 +14,7 @@ It must print `v22.18.0` or a later 22.x, or `v24.0.0` or later. A rule set of y
14
14
 
15
15
  ## 2. Install the Hone package
16
16
 
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.
17
+ Hone ships as one npm package tarball of built JavaScript, so it needs no TypeScript support from Node. It has three dependencies of its own, `zod`, `jsonc-parser` and `@eslint/plugin-kit`, each declared as a caret range starting at the version Hone is tested on, which the package manager installs from the registry. Your repository's lockfile, and any override you set, decides which release inside each range is installed, so you can take a patched release of one of them without waiting for a new Hone.
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
 
@@ -34,7 +34,7 @@ pnpm add -D --save-exact @hailstails/hone@<version>
34
34
 
35
35
  Pin the exact version. Commands, flags and files may change between pre-releases, 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 pre-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. `next` can trail the newest GitHub release for a while; [README.md](README.md#developing-hone) says how a version reaches npm.
36
36
 
37
- 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.
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
 
39
39
  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>`:
40
40
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
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
+ ## 0.1.0-pre.9
6
+
7
+ ### Fixes
8
+
9
+ - publish zod, jsonc-parser and @eslint/plugin-kit as caret-range dependencies instead of bundling them (#125)
10
+
5
11
  ## 0.1.0-pre.8
6
12
 
7
13
  ### Fixes
package/MIGRATING.md CHANGED
@@ -223,7 +223,7 @@ To move:
223
223
  3. **Repoint every command.** In scripts, CI and the pre-push hook, replace `node tools/discipline-core/core/check/check-command.ts --repo .` with `npm run --silent hone:check`, and `project-command.ts` with `npm run --silent hone:project`. Pass options after `--` with npm, as in `npm run --silent hone:check -- --base-revision origin/main`, and straight after the script name with pnpm, as in `pnpm run --silent hone:check --base-revision origin/main`. A hook or gate that reads the verdict line needs the warning in [ADOPTING.md](ADOPTING.md#5-run-the-check) step 5. Point agent instructions at `node_modules/@hailstails/hone/rules/`.
224
224
  4. **Repoint your own pieces and tests.** Nothing outside the package's public entries can be imported now:
225
225
  - A piece that imported types or `folderScope` from the copy, such as from `walker-piece.ts` or `source-scope.ts`, imports them from `@hailstails/hone/audit`.
226
- - A piece that read JSON with comments through the copy's `jsonc-parse.ts` calls TypeScript's own parser on the syntax API that `prepare` hands it: `syntaxApi.parseConfigFileTextToJson(file, text)` returns the parsed value as `config`, and sets `error` when it cannot parse the text. Do not import `jsonc-parser`: it is bundled inside Hone, not a package a piece can import, and a piece imports only what [docs/extending.md](docs/extending.md#what-is-stable) lists.
226
+ - A piece that read JSON with comments through the copy's `jsonc-parse.ts` calls TypeScript's own parser on the syntax API that `prepare` hands it: `syntaxApi.parseConfigFileTextToJson(file, text)` returns the parsed value as `config`, and sets `error` when it cannot parse the text. Do not import `jsonc-parser`: it is Hone's own dependency, not one the repository declares, so a strict package manager such as pnpm does not resolve it from a piece, and a piece imports only what [docs/extending.md](docs/extending.md#what-is-stable) lists.
227
227
  - For a file it cannot parse, a piece returns `{ outcome: "failed", error: { kind: "file-unparseable", file, detail } }`. The check then stops with `load failure: runner-failed audit file-unparseable <file> <detail>` and exit `2`.
228
228
  - Case tests use `clauseConformanceOf` from `@hailstails/hone/testing`, as [docs/extending.md](docs/extending.md#test-a-piece) shows.
229
229
  - A test that called the copy's check or governance functions directly, such as `runCheck` or `applyGovernance`, has no entry to call: run the `hone check` command against a repository the test sets up, and assert on its report and exit code.
package/README.md CHANGED
@@ -227,7 +227,7 @@ At the repository root; absent means no exceptions. Each entry names a selected
227
227
 
228
228
  ## Installing
229
229
 
230
- 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 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.
230
+ 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.
231
231
 
232
232
  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.
233
233
 
@@ -248,7 +248,7 @@ Each resolves with `moduleResolution` `"nodenext"` or `"bundler"`. `install-proo
248
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.
249
249
  - 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
250
  - git 2.24 or later. Older git rejects `--end-of-options`, so the changed-file query fails and forfeiture is reported unmeasured.
251
- - 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.
251
+ - 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.
252
252
  - 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.28.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.28.0 the first 9.x with every bulk-suppressions option a carve-out kept in `eslint-suppressions.json` relies on (`--pass-on-unpruned-suppressions` came last), 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.
253
253
 
254
254
  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.28.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.
@@ -306,11 +306,11 @@ This repository is self-contained: it holds its own configuration and its own lo
306
306
  | `lint` | Biome with `lint.biome.json` |
307
307
  | `test` | Vitest with `vitest.config.ts` |
308
308
  | `check` | all three in that order |
309
- | `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 |
309
+ | `build-package` | `node scripts/build-package.ts`: compiles Hone's own code with esbuild into `dist/`, leaving each declared peer and dependency to be imported by name, and adds the published `package.json`, which declares the dependencies at the ranges `package.json` declares, and the shipped documents and data. It fails if a dependency is not declared as a caret range of one release, if that range's floor is not the version the lock's root importer holds, or if the lock does not hold it, if an output imports anything but a `node:` builtin, a declared peer or a declared dependency, if an output carries an installed package's code, if a command or runner is not emitted at its own path with its own code, or if a shipped page links to a file the package does not ship. The tool's name, package name, command name, shipped rule-set name, reserved ESLint namespace, description, GitHub repository and the unrelated npm name to warn against live in `core/values/tool-identity.ts`, which the build, the install proof, the release text, the command's usage line and the ESLint runner all read. The reserved namespace is its own field, independent of the package name |
310
310
  | `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` |
311
311
  | `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 |
312
312
  | `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) |
313
- | `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 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
+ | `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 |
314
314
  | `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) |
315
315
  | `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) |
316
316
 
package/api/audit.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  folderScope
3
3
  } from "../chunks/chunk-QWA6OVLC.js";
4
- import "../chunks/chunk-NZLE2WMY.js";
5
4
 
6
5
  // api/audit.ts
7
6
  var folderScope2 = folderScope;
package/api/testing.js CHANGED
@@ -5,28 +5,26 @@ import {
5
5
  loadRunner,
6
6
  rejectedCall,
7
7
  runnerInvalidOutput
8
- } from "../chunks/chunk-XXLMIBLS.js";
8
+ } from "../chunks/chunk-XE6RNNZB.js";
9
9
  import {
10
10
  caseVerdictSchema,
11
11
  runnerResultSchema
12
- } from "../chunks/chunk-MYX7GAVM.js";
12
+ } from "../chunks/chunk-RNXPEK2U.js";
13
13
  import {
14
14
  readDisciplineFile,
15
15
  readPieceFile
16
- } from "../chunks/chunk-POZL7G62.js";
16
+ } from "../chunks/chunk-OVEQ37JQ.js";
17
17
  import {
18
18
  createDefaultFileTextPort,
19
19
  createDefaultModuleLoaderPort,
20
20
  createDefaultPathPort,
21
21
  moduleExtensionOf,
22
22
  repoPathSchema
23
- } from "../chunks/chunk-NRXSM7BY.js";
23
+ } from "../chunks/chunk-LHVFZMXD.js";
24
24
  import {
25
25
  clauseAddressSchema,
26
- external_exports,
27
26
  mechanismIdSchema
28
- } from "../chunks/chunk-NCDYOPHG.js";
29
- import "../chunks/chunk-NZLE2WMY.js";
27
+ } from "../chunks/chunk-5X2BR42Y.js";
30
28
 
31
29
  // core/conformance/clause-under-test.ts
32
30
  var setupFailed = (error) => ({ outcome: "failed", error });
@@ -95,8 +93,9 @@ var repoPathOf = (request) => {
95
93
  };
96
94
 
97
95
  // core/conformance/conformance.ts
96
+ import { z } from "zod";
98
97
  var caseVerdictsResultSchema = runnerResultSchema({
99
- value: external_exports.array(caseVerdictSchema).readonly()
98
+ value: z.array(caseVerdictSchema).readonly()
100
99
  });
101
100
  var lineSet = (request) => [...new Set(request.lines)].toSorted((left, right) => left - right);
102
101
  var verdictsNaming = (request) => request.verdicts.filter((verdict) => verdict.caseName === request.caseName);
@@ -128,7 +127,7 @@ var caseConformance = (request) => {
128
127
  var conformanceOf = (request) => {
129
128
  const parsed = caseVerdictsResultSchema.safeParse(request.returned);
130
129
  if (!parsed.success) {
131
- return runnerInvalidOutput({ detail: external_exports.prettifyError(parsed.error) });
130
+ return runnerInvalidOutput({ detail: z.prettifyError(parsed.error) });
132
131
  }
133
132
  if (parsed.data.outcome === "failed") {
134
133
  return parsed.data;
@@ -0,0 +1,117 @@
1
+ // core/values/identifiers.ts
2
+ import { z as z2 } from "zod";
3
+
4
+ // core/values/branded-schema.ts
5
+ import { z } from "zod";
6
+ var brandedTextSchema = (request) => request.text.transform((text, context) => {
7
+ if (request.isBranded(text)) {
8
+ return text;
9
+ }
10
+ context.addIssue({ code: "custom", message: request.refusal });
11
+ return z.NEVER;
12
+ });
13
+
14
+ // core/values/identifiers.ts
15
+ var RULE_SET_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
16
+ var DISCIPLINE_ID_PATTERN = /^[A-Z]{2,4}-[0-9]+[a-z]?$/;
17
+ var CLAUSE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
18
+ var MECHANISM_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
19
+ var NOT_AN_IDENTIFIER = "not an identifier of its kind";
20
+ var NOT_RUN = "not-run";
21
+ var NOT_ADOPTED = "not-adopted";
22
+ var RESERVED_CLAUSE_STATES = /* @__PURE__ */ new Map([
23
+ [NOT_RUN, "a clause adopted with its mechanism not run"],
24
+ [NOT_ADOPTED, "a clause a repository does not adopt"]
25
+ ]);
26
+ var isRuleSetName = (text) => RULE_SET_NAME_PATTERN.test(text);
27
+ var isDisciplineId = (text) => DISCIPLINE_ID_PATTERN.test(text);
28
+ var isClauseId = (text) => CLAUSE_ID_PATTERN.test(text);
29
+ var isMechanismId = (text) => MECHANISM_ID_PATTERN.test(text) && !RESERVED_CLAUSE_STATES.has(text);
30
+ var ruleSetNameSchema = brandedTextSchema({
31
+ text: z2.string().regex(RULE_SET_NAME_PATTERN),
32
+ isBranded: isRuleSetName,
33
+ refusal: NOT_AN_IDENTIFIER
34
+ });
35
+ var disciplineIdSchema = brandedTextSchema({
36
+ text: z2.string().regex(DISCIPLINE_ID_PATTERN),
37
+ isBranded: isDisciplineId,
38
+ refusal: NOT_AN_IDENTIFIER
39
+ });
40
+ var clauseIdSchema = brandedTextSchema({
41
+ text: z2.string().regex(CLAUSE_ID_PATTERN),
42
+ isBranded: isClauseId,
43
+ refusal: NOT_AN_IDENTIFIER
44
+ });
45
+ var mechanismIdSchema = brandedTextSchema({
46
+ text: z2.string().regex(MECHANISM_ID_PATTERN).superRefine((text, context) => {
47
+ const reservedFor = RESERVED_CLAUSE_STATES.get(text);
48
+ if (reservedFor !== void 0) {
49
+ context.addIssue({ code: "custom", message: `"${text}" is reserved for ${reservedFor}, so it cannot name a mechanism` });
50
+ }
51
+ }),
52
+ isBranded: isMechanismId,
53
+ refusal: NOT_AN_IDENTIFIER
54
+ });
55
+
56
+ // core/values/clause-address.ts
57
+ import { z as z3 } from "zod";
58
+
59
+ // core/values/tool-identity.ts
60
+ var identified = (identity) => identity;
61
+ var TOOL_IDENTITY = identified({
62
+ name: "Hone",
63
+ packageName: "@hailstails/hone",
64
+ command: "hone",
65
+ ownRuleSet: "hone",
66
+ reservedEslintNamespace: "hone-core",
67
+ description: "Checks a repository against the disciplines it selects, applies its recorded exceptions and prints one verdict.",
68
+ repository: "https://github.com/HailsTails/hone",
69
+ unrelatedNpmPackage: "hone"
70
+ });
71
+
72
+ // core/values/clause-address.ts
73
+ var TOOL_RULE_SET = TOOL_IDENTITY.ownRuleSet;
74
+ var CLAUSE_ADDRESS_TEXT = /^(?:(?<ruleSet>[^/#]+)\/)?(?<discipline>[^/#]+)#(?<clause>[^/#]+)$/;
75
+ var clauseAddressObjectSchema = z3.object({
76
+ ruleSet: z3.union([
77
+ z3.literal(TOOL_RULE_SET),
78
+ z3.object({
79
+ name: ruleSetNameSchema.refine((name) => name !== TOOL_RULE_SET)
80
+ })
81
+ ]),
82
+ discipline: disciplineIdSchema,
83
+ clause: clauseIdSchema
84
+ });
85
+ var clauseAddressSchema = z3.string().transform((text, context) => {
86
+ const parts = CLAUSE_ADDRESS_TEXT.exec(text)?.groups;
87
+ if (parts === void 0) {
88
+ context.addIssue({
89
+ code: "custom",
90
+ message: "is not a clause address of the form [<ruleSet>/]<discipline>#<clause>"
91
+ });
92
+ return z3.NEVER;
93
+ }
94
+ return {
95
+ ruleSet: parts.ruleSet === void 0 || parts.ruleSet === TOOL_RULE_SET ? TOOL_RULE_SET : { name: parts.ruleSet },
96
+ discipline: parts.discipline,
97
+ clause: parts.clause
98
+ };
99
+ }).pipe(clauseAddressObjectSchema);
100
+ 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}`;
101
+ var sameClauseAddress = (request) => clauseAddressText({ address: request.left }) === clauseAddressText({ address: request.right }) ? "same" : "different";
102
+
103
+ export {
104
+ brandedTextSchema,
105
+ NOT_RUN,
106
+ NOT_ADOPTED,
107
+ ruleSetNameSchema,
108
+ disciplineIdSchema,
109
+ clauseIdSchema,
110
+ mechanismIdSchema,
111
+ TOOL_IDENTITY,
112
+ TOOL_RULE_SET,
113
+ clauseAddressObjectSchema,
114
+ clauseAddressSchema,
115
+ clauseAddressText,
116
+ sameClauseAddress
117
+ };
@@ -1,7 +1,6 @@
1
1
  import {
2
- brandedTextSchema,
3
- external_exports
4
- } from "./chunk-NCDYOPHG.js";
2
+ brandedTextSchema
3
+ } from "./chunk-5X2BR42Y.js";
5
4
 
6
5
  // core/platform-ports/file-system-port.ts
7
6
  import { accessSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
@@ -100,10 +99,11 @@ import platformPath, { posix, win32 } from "node:path";
100
99
  import { fileURLToPath } from "node:url";
101
100
 
102
101
  // core/values/absolute-path.ts
102
+ import { z } from "zod";
103
103
  var POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT = /^(?:\/|[A-Za-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+[\\/])/;
104
104
  var isAbsolutePath = (text) => POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT.test(text);
105
105
  var absolutePathSchema = brandedTextSchema({
106
- text: external_exports.string().regex(POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT),
106
+ text: z.string().regex(POSIX_ROOT_DRIVE_ROOT_OR_SHARE_ROOT),
107
107
  isBranded: isAbsolutePath,
108
108
  refusal: "not an absolute path"
109
109
  });
@@ -270,13 +270,14 @@ var MODULE_EXTENSIONS = [SOURCE_MODULE_EXTENSION, BUILT_MODULE_EXTENSION];
270
270
  var moduleFileForm = (request) => MODULE_EXTENSIONS.some((extension) => request.text.endsWith(extension)) ? "module-file" : "not-module-file";
271
271
 
272
272
  // core/values/repo-path.ts
273
+ import { z as z2 } from "zod";
273
274
  var UNWALKABLE_SEGMENTS = ["", ".", ".."];
274
275
  var LEADING_DRIVE_LETTER = /^[A-Za-z]:/;
275
276
  var LINE_BREAK_OR_NUL = /[\n\r\0]/;
276
277
  var NOT_A_REPO_PATH = "not a repo-relative path";
277
278
  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";
278
279
  var isRepoPath = (text) => isRepoPathText({ text }) === "repo-path";
279
- var repoPathTextSchema = external_exports.string().superRefine((text, context) => {
280
+ var repoPathTextSchema = z2.string().superRefine((text, context) => {
280
281
  if (isRepoPathText({ text }) === "not-repo-path") {
281
282
  context.addIssue({ code: "custom", message: NOT_A_REPO_PATH });
282
283
  }
@@ -285,11 +286,12 @@ var brandedRepoPathSchema = (request) => brandedTextSchema({ text: request.text,
285
286
  var repoPathSchema = brandedRepoPathSchema({ text: repoPathTextSchema });
286
287
 
287
288
  // core/mechanism-port/toolchain-requirement.ts
289
+ import { z as z3 } from "zod";
288
290
  var RELEASE_PATTERN = /^(\d+)\.(\d+)\.(\d+)$/;
289
291
  var NOT_INSTALLED = "not installed";
290
292
  var MODULE_NOT_FOUND = "ERR_MODULE_NOT_FOUND";
291
293
  var BACKSLASH = /\\/g;
292
- var moduleErrorSchema = external_exports.object({ code: external_exports.string(), message: external_exports.string() });
294
+ var moduleErrorSchema = z3.object({ code: z3.string(), message: z3.string() });
293
295
  var releaseParts = (request) => {
294
296
  const match = RELEASE_PATTERN.exec(request.version);
295
297
  return match === null ? void 0 : [Number(match[1]), Number(match[2]), Number(match[3])];
@@ -388,10 +390,11 @@ var loadedPeer = (request) => Promise.resolve().then(() => request.location.loca
388
390
  );
389
391
 
390
392
  // core/values/snippet.ts
393
+ import { z as z4 } from "zod";
391
394
  var SNIPPET_LIMIT = 200;
392
395
  var CUT_MARK = "\u2026";
393
396
  var cutToLimit = (request) => `${request.characters.slice(0, SNIPPET_LIMIT).join("")}${CUT_MARK}`;
394
- var snippetSchema = external_exports.string().transform((text) => {
397
+ var snippetSchema = z4.string().transform((text) => {
395
398
  const characters = Array.from(text);
396
399
  return characters.length > SNIPPET_LIMIT ? cutToLimit({ characters }) : text;
397
400
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sameClauseAddress
3
- } from "./chunk-NCDYOPHG.js";
3
+ } from "./chunk-5X2BR42Y.js";
4
4
 
5
5
  // mechanisms/audit/runner/type-directives.ts
6
6
  var TYPE_DIRECTIVES = ["@ts-expect-error", "@ts-ignore", "@ts-nocheck"];
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createDefaultPathPort,
3
3
  installRootAboveEntry
4
- } from "./chunk-NRXSM7BY.js";
4
+ } from "./chunk-LHVFZMXD.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) });
@@ -1,12 +1,11 @@
1
1
  import {
2
2
  repoPathSchema
3
- } from "./chunk-NRXSM7BY.js";
3
+ } from "./chunk-LHVFZMXD.js";
4
4
  import {
5
5
  clauseIdSchema,
6
6
  disciplineIdSchema,
7
- external_exports,
8
7
  mechanismIdSchema
9
- } from "./chunk-NCDYOPHG.js";
8
+ } from "./chunk-5X2BR42Y.js";
10
9
 
11
10
  // core/values/parsed-json.ts
12
11
  var parsedJson = (request) => {
@@ -21,6 +20,9 @@ var parsedJson = (request) => {
21
20
  }
22
21
  };
23
22
 
23
+ // core/rule-set-reader/rule-set-reader.ts
24
+ import { z } from "zod";
25
+
24
26
  // core/values/json-kind.ts
25
27
  var JSON_KIND_NAMES = {
26
28
  string: "a string",
@@ -78,11 +80,11 @@ var readVersionOneJson = (request) => {
78
80
  };
79
81
  var entryCount = (entries) => entries.length > 0 ? "some" : "empty";
80
82
  var textDistinctness = (texts) => new Set(texts).size === texts.length ? "distinct" : "repeated";
81
- var sourceCaseSchema = external_exports.object({
82
- name: external_exports.string(),
83
+ var sourceCaseSchema = z.object({
84
+ name: z.string(),
83
85
  fileName: repoPathSchema,
84
- source: external_exports.string(),
85
- expectedLines: external_exports.array(external_exports.number())
86
+ source: z.string(),
87
+ expectedLines: z.array(z.number())
86
88
  });
87
89
  var flagCaseSchema = sourceCaseSchema.refine(
88
90
  (sourceCase) => entryCount(sourceCase.expectedLines) === "some",
@@ -92,40 +94,40 @@ var allowCaseSchema = sourceCaseSchema.refine(
92
94
  (sourceCase) => entryCount(sourceCase.expectedLines) === "empty",
93
95
  { error: "an allow case names expected lines" }
94
96
  );
95
- var anchorKindSchema = external_exports.discriminatedUnion("kind", [
96
- external_exports.object({ kind: external_exports.literal("keyword"), keyword: external_exports.string() }),
97
- external_exports.object({ kind: external_exports.literal("file") })
97
+ var anchorKindSchema = z.discriminatedUnion("kind", [
98
+ z.object({ kind: z.literal("keyword"), keyword: z.string() }),
99
+ z.object({ kind: z.literal("file") })
98
100
  ]);
99
- var clauseDefinitionSchema = external_exports.discriminatedUnion("kind", [
100
- external_exports.object({
101
- kind: external_exports.literal("mechanical"),
101
+ var clauseDefinitionSchema = z.discriminatedUnion("kind", [
102
+ z.object({
103
+ kind: z.literal("mechanical"),
102
104
  id: clauseIdSchema,
103
- summary: external_exports.string(),
104
- mechanisms: external_exports.array(mechanismIdSchema).refine((entries) => entryCount(entries) === "some", { error: "a mechanical clause names no mechanism" }),
105
+ summary: z.string(),
106
+ mechanisms: z.array(mechanismIdSchema).refine((entries) => entryCount(entries) === "some", { error: "a mechanical clause names no mechanism" }),
105
107
  anchor: anchorKindSchema,
106
- exceptions: external_exports.enum(["allowed", "refused"]).default("allowed"),
107
- cases: external_exports.object({
108
- flag: external_exports.array(flagCaseSchema).refine((entries) => entryCount(entries) === "some", { error: "a mechanical clause has no flag case" }),
109
- allow: external_exports.array(allowCaseSchema).refine((entries) => entryCount(entries) === "some", { error: "a mechanical clause has no allow case" })
108
+ exceptions: z.enum(["allowed", "refused"]).default("allowed"),
109
+ cases: z.object({
110
+ flag: z.array(flagCaseSchema).refine((entries) => entryCount(entries) === "some", { error: "a mechanical clause has no flag case" }),
111
+ allow: z.array(allowCaseSchema).refine((entries) => entryCount(entries) === "some", { error: "a mechanical clause has no allow case" })
110
112
  })
111
113
  }),
112
- external_exports.object({
113
- kind: external_exports.literal("judgement"),
114
+ z.object({
115
+ kind: z.literal("judgement"),
114
116
  id: clauseIdSchema,
115
- summary: external_exports.string(),
116
- enforcedBy: external_exports.literal("review")
117
+ summary: z.string(),
118
+ enforcedBy: z.literal("review")
117
119
  })
118
120
  ]);
119
- var disciplineFileSchema = external_exports.object({
120
- version: external_exports.literal(SUPPORTED_VERSION),
121
+ var disciplineFileSchema = z.object({
122
+ version: z.literal(SUPPORTED_VERSION),
121
123
  id: disciplineIdSchema,
122
- clauses: external_exports.array(clauseDefinitionSchema).refine((clauses) => textDistinctness(clauses.map((clause) => clause.id)) === "distinct", {
124
+ clauses: z.array(clauseDefinitionSchema).refine((clauses) => textDistinctness(clauses.map((clause) => clause.id)) === "distinct", {
123
125
  error: "two clauses share an id"
124
126
  })
125
127
  });
126
- var clauseSettingDeclarationSchema = external_exports.strictObject({
127
- default: external_exports.json(),
128
- choices: external_exports.array(external_exports.json()).min(1).optional()
128
+ var clauseSettingDeclarationSchema = z.strictObject({
129
+ default: z.json(),
130
+ choices: z.array(z.json()).min(1).optional()
129
131
  }).superRefine((declaration, context) => {
130
132
  if (declaration.choices === void 0) return;
131
133
  const defaultKind = jsonKindOf({ value: declaration.default });
@@ -136,15 +138,15 @@ var clauseSettingDeclarationSchema = external_exports.strictObject({
136
138
  context.addIssue({ code: "custom", path: ["default"], message: "the default must be one of the choices" });
137
139
  }
138
140
  });
139
- var pieceFileSchema = external_exports.object({
140
- version: external_exports.literal(SUPPORTED_VERSION),
141
+ var pieceFileSchema = z.object({
142
+ version: z.literal(SUPPORTED_VERSION),
141
143
  discipline: disciplineIdSchema,
142
144
  mechanism: mechanismIdSchema,
143
- clauses: external_exports.array(
144
- external_exports.object({
145
+ clauses: z.array(
146
+ z.object({
145
147
  clause: clauseIdSchema,
146
- settings: external_exports.unknown(),
147
- clauseSettings: external_exports.record(external_exports.string().min(1), clauseSettingDeclarationSchema).default({})
148
+ settings: z.unknown(),
149
+ clauseSettings: z.record(z.string().min(1), clauseSettingDeclarationSchema).default({})
148
150
  })
149
151
  ).refine((entries) => textDistinctness(entries.map((entry) => entry.clause)) === "distinct", {
150
152
  error: "two entries name the same clause"
@@ -152,7 +154,7 @@ var pieceFileSchema = external_exports.object({
152
154
  });
153
155
  var isContentRefusal = (issue) => issue.code === "custom";
154
156
  var schemaRefusal = (request) => {
155
- const detail = external_exports.prettifyError(request.error);
157
+ const detail = z.prettifyError(request.error);
156
158
  return request.error.issues.every(isContentRefusal) ? { kind: "rule-set-invalid", path: request.path, detail } : { kind: "file-malformed", path: request.path, detail };
157
159
  };
158
160
  var ruleSetInvalid = (request) => ({
@@ -229,7 +231,8 @@ var readPieceFile = (request) => {
229
231
  };
230
232
 
231
233
  // core/values/eslint-config-lookup.ts
232
- var eslintConfigLookupSchema = external_exports.enum(["nearest-to-file", "repository-root"]);
234
+ import { z as z2 } from "zod";
235
+ var eslintConfigLookupSchema = z2.enum(["nearest-to-file", "repository-root"]);
233
236
 
234
237
  export {
235
238
  JSON_KIND_NAMES,
@@ -0,0 +1,77 @@
1
+ import {
2
+ repoPathSchema,
3
+ snippetSchema
4
+ } from "./chunk-LHVFZMXD.js";
5
+ import {
6
+ clauseAddressObjectSchema
7
+ } from "./chunk-5X2BR42Y.js";
8
+
9
+ // core/mechanism-port/runner-result-schema.ts
10
+ import { z as z3 } from "zod";
11
+
12
+ // core/values/anchor-schema.ts
13
+ import { z } from "zod";
14
+ var anchorSchema = z.object({
15
+ line: z.number().int().min(1),
16
+ column: z.number().int().min(0)
17
+ }).readonly();
18
+
19
+ // core/mechanism-port/runner-failure-schema.ts
20
+ import { z as z2 } from "zod";
21
+ var peerKindSchema = z2.enum(["required", "optional"]);
22
+ var unavailablePeerSchema = z2.object({ packageName: z2.string(), peer: peerKindSchema, supported: z2.string(), found: z2.string() }).readonly();
23
+ var runnerFailureSchema = z2.discriminatedUnion("kind", [
24
+ z2.object({ kind: z2.literal("piece-invalid"), pieceRoot: z2.string(), detail: z2.string() }).readonly(),
25
+ z2.object({ kind: z2.literal("tool-failed"), detail: z2.string() }).readonly(),
26
+ z2.object({ kind: z2.literal("file-unreadable"), file: repoPathSchema, detail: z2.string() }).readonly(),
27
+ z2.object({ kind: z2.literal("plugin-conflict"), detail: z2.string() }).readonly(),
28
+ z2.object({ kind: z2.literal("team-config-unloadable"), detail: z2.string() }).readonly(),
29
+ z2.object({ kind: z2.literal("runner-invalid-output"), detail: z2.string() }).readonly(),
30
+ z2.object({ kind: z2.literal("file-unparseable"), file: repoPathSchema, detail: z2.string() }).readonly(),
31
+ z2.object({
32
+ kind: z2.literal("toolchain-unavailable"),
33
+ peers: z2.tuple([unavailablePeerSchema], unavailablePeerSchema).readonly()
34
+ }).readonly(),
35
+ z2.object({
36
+ kind: z2.literal("toolchain-shadowed"),
37
+ packageName: z2.string(),
38
+ location: z2.string(),
39
+ installRoot: z2.string()
40
+ }).readonly()
41
+ ]);
42
+
43
+ // core/mechanism-port/runner-result-schema.ts
44
+ var nativeExceptionKindSchema = z3.enum([
45
+ "ignore",
46
+ "config-override",
47
+ "suppression-entry",
48
+ "inline-disable",
49
+ "inline-rule-config",
50
+ "command-line-option"
51
+ ]);
52
+ var hitSchema = z3.object({
53
+ clause: clauseAddressObjectSchema,
54
+ file: repoPathSchema,
55
+ anchor: anchorSchema,
56
+ snippet: snippetSchema
57
+ }).readonly();
58
+ var caseVerdictSchema = z3.object({
59
+ caseName: z3.string(),
60
+ flaggedLines: z3.array(z3.number().int().min(1)).readonly()
61
+ }).readonly();
62
+ var projectionWriteSchema = z3.object({
63
+ path: repoPathSchema,
64
+ effect: z3.enum(["written", "unchanged", "removed", "left-in-place"])
65
+ }).readonly();
66
+ var runnerResultSchema = (request) => z3.union([
67
+ z3.object({ outcome: z3.literal("ok"), value: request.value }).readonly(),
68
+ z3.object({ outcome: z3.literal("failed"), error: runnerFailureSchema }).readonly()
69
+ ]);
70
+
71
+ export {
72
+ nativeExceptionKindSchema,
73
+ hitSchema,
74
+ caseVerdictSchema,
75
+ projectionWriteSchema,
76
+ runnerResultSchema
77
+ };