@hailstails/hone 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/ADOPTING.md +8 -8
  2. package/CHANGELOG.md +14 -0
  3. package/MIGRATING.md +17 -0
  4. package/README.md +10 -10
  5. package/api/testing.js +2 -2
  6. package/chunks/{chunk-FEWCJU7H.js → chunk-2O46EB4E.js} +6 -0
  7. package/chunks/{chunk-6SM3HKWO.js → chunk-5U4VTFD5.js} +88 -51
  8. package/core/check/tool-command.js +379 -56
  9. package/core/mechanism-port/runner-result-types.d.ts +4 -0
  10. package/docs/adding-a-discipline-or-mechanism.md +2 -0
  11. package/docs/extending.md +1 -0
  12. package/docs/output-contract.md +17 -6
  13. package/mechanisms/audit/CD-27/test-body-logic.js +5 -2
  14. package/mechanisms/audit/runner/runner.js +5 -3
  15. package/mechanisms/eslint/runner/runner.js +7 -3
  16. package/methods/assessment-template.md +2 -2
  17. package/methods/lenses/clean-architecture.md +7 -8
  18. package/methods/lenses/defended-on-intent.md +2 -2
  19. package/methods/lenses/di-discipline.md +10 -13
  20. package/methods/lenses/function-first.md +16 -18
  21. package/package.json +1 -1
  22. package/rules/CD-1/CHECKS.md +4 -2
  23. package/rules/CD-1/README.md +6 -19
  24. package/rules/CD-10/CHECKS.md +5 -3
  25. package/rules/CD-10/README.md +6 -18
  26. package/rules/CD-11/CHECKS.md +4 -2
  27. package/rules/CD-11/README.md +6 -16
  28. package/rules/CD-12/CHECKS.md +4 -2
  29. package/rules/CD-12/README.md +6 -16
  30. package/rules/CD-13/CHECKS.md +4 -2
  31. package/rules/CD-13/README.md +6 -16
  32. package/rules/CD-14/CHECKS.md +3 -1
  33. package/rules/CD-14/README.md +6 -19
  34. package/rules/CD-15/CHECKS.md +3 -1
  35. package/rules/CD-15/README.md +5 -20
  36. package/rules/CD-16/CHECKS.md +3 -1
  37. package/rules/CD-16/README.md +6 -6
  38. package/rules/CD-17/CHECKS.md +3 -1
  39. package/rules/CD-17/README.md +6 -19
  40. package/rules/CD-18/CHECKS.md +4 -2
  41. package/rules/CD-18/README.md +6 -16
  42. package/rules/CD-19/CHECKS.md +8 -6
  43. package/rules/CD-19/README.md +6 -20
  44. package/rules/CD-2/CHECKS.md +5 -3
  45. package/rules/CD-2/README.md +6 -21
  46. package/rules/CD-20/CHECKS.md +3 -1
  47. package/rules/CD-20/README.md +6 -6
  48. package/rules/CD-21/CHECKS.md +4 -2
  49. package/rules/CD-21/README.md +6 -15
  50. package/rules/CD-22/CHECKS.md +4 -2
  51. package/rules/CD-22/README.md +6 -15
  52. package/rules/CD-23/CHECKS.md +5 -3
  53. package/rules/CD-23/README.md +6 -17
  54. package/rules/CD-24/CHECKS.md +3 -1
  55. package/rules/CD-24/README.md +6 -6
  56. package/rules/CD-25/CHECKS.md +3 -1
  57. package/rules/CD-25/README.md +5 -21
  58. package/rules/CD-26/CHECKS.md +5 -3
  59. package/rules/CD-26/README.md +6 -20
  60. package/rules/CD-27/CHECKS.md +16 -7
  61. package/rules/CD-27/README.md +6 -20
  62. package/rules/CD-28/CHECKS.md +4 -2
  63. package/rules/CD-28/README.md +6 -16
  64. package/rules/CD-29/CHECKS.md +4 -2
  65. package/rules/CD-29/README.md +6 -14
  66. package/rules/CD-3/CHECKS.md +3 -1
  67. package/rules/CD-3/README.md +6 -17
  68. package/rules/CD-30/CHECKS.md +4 -2
  69. package/rules/CD-30/README.md +6 -15
  70. package/rules/CD-31/CHECKS.md +4 -2
  71. package/rules/CD-31/README.md +6 -14
  72. package/rules/CD-32/CHECKS.md +3 -1
  73. package/rules/CD-32/README.md +2 -0
  74. package/rules/CD-33/CHECKS.md +3 -1
  75. package/rules/CD-33/README.md +2 -0
  76. package/rules/CD-34/CHECKS.md +3 -1
  77. package/rules/CD-34/README.md +2 -0
  78. package/rules/CD-39/CHECKS.md +3 -1
  79. package/rules/CD-39/README.md +2 -0
  80. package/rules/CD-4/CHECKS.md +4 -2
  81. package/rules/CD-4/README.md +6 -17
  82. package/rules/CD-40/CHECKS.md +3 -1
  83. package/rules/CD-40/README.md +6 -20
  84. package/rules/CD-41/CHECKS.md +4 -2
  85. package/rules/CD-41/README.md +6 -22
  86. package/rules/CD-42/CHECKS.md +3 -1
  87. package/rules/CD-42/README.md +6 -16
  88. package/rules/CD-43/CHECKS.md +3 -1
  89. package/rules/CD-43/README.md +6 -18
  90. package/rules/CD-44/CHECKS.md +3 -1
  91. package/rules/CD-44/README.md +6 -17
  92. package/rules/CD-45/CHECKS.md +4 -2
  93. package/rules/CD-45/README.md +6 -16
  94. package/rules/CD-46/CHECKS.md +3 -1
  95. package/rules/CD-46/README.md +2 -0
  96. package/rules/CD-47/CHECKS.md +4 -2
  97. package/rules/CD-47/README.md +4 -20
  98. package/rules/CD-5/CHECKS.md +4 -2
  99. package/rules/CD-5/README.md +6 -19
  100. package/rules/CD-6/CHECKS.md +3 -1
  101. package/rules/CD-6/README.md +6 -19
  102. package/rules/CD-7/CHECKS.md +3 -1
  103. package/rules/CD-7/README.md +6 -20
  104. package/rules/CD-7a/CHECKS.md +3 -1
  105. package/rules/CD-7a/README.md +6 -17
  106. package/rules/CD-8/CHECKS.md +3 -1
  107. package/rules/CD-8/README.md +6 -17
  108. package/rules/CD-9/CHECKS.md +4 -2
  109. package/rules/CD-9/README.md +6 -17
  110. package/rules/README.md +71 -54
  111. package/rules/SPIRIT.md +3 -3
  112. package/rules/cases.md +94 -0
  113. package/rules/numbers.md +155 -0
  114. package/rules/principles.md +89 -0
  115. package/rules/records.md +150 -0
  116. package/rules/rules.md +149 -0
  117. package/rules/sources.md +142 -0
  118. package/rules/typescript/checks.md +219 -0
  119. package/rules/typescript/recipes.md +361 -0
  120. package/rules/typescript/symptoms.json +1005 -0
  121. package/rules/typescript/symptoms.md +612 -0
package/ADOPTING.md CHANGED
@@ -90,7 +90,7 @@ Commit `package.json`, the lockfile and the tarball if it is a file in the repos
90
90
 
91
91
  ## 3. Read what each discipline means
92
92
 
93
- [rules/README.md](rules/README.md) lists every discipline. Each discipline has two pages. `rules/<ID>/README.md` quotes the rule, names its review lens, and gives its spirit: what the friction is for, what a finding usually points at, the direction to go, and the principles behind it. `rules/<ID>/CHECKS.md` holds the mechanics: the Clauses table, exactly what each check flags, a violation and its fix, and how to record an exception. Read the rule page first; [the spirit of the rules](rules/SPIRIT.md) explains the approach for the whole set. A discipline's clause addresses are in its CHECKS.md Clauses table, for example `CD-14#class-syntax`, with the mechanism that checks each clause. A clause whose mechanism is `review` is a judgement clause: it is applied in review, not by a check, with the review lens the rule page names (step 9).
93
+ [rules/numbers.md](rules/numbers.md#every-numbered-discipline) lists every discipline, and [rules/README.md](rules/README.md) explains how the named pages read. Rules are referred to by name; a number is only a clause address. Each numbered discipline has two pages. `rules/<ID>/README.md` gives its verdict, the named rules, recipes and symptoms to read, and its review lens. `rules/<ID>/CHECKS.md` holds the mechanics: the Clauses table, exactly what each check flags, a violation and its fix, and how to record an exception. Read the named pages first; [the spirit of the rules](rules/SPIRIT.md) explains the approach for the whole set. A discipline's clause addresses are in its CHECKS.md Clauses table, for example `CD-14#class-syntax`, with the mechanism that checks each clause. A clause whose mechanism is `review` is a judgement clause: it is applied in review, not by a check, with the review lens the rule page names (step 9).
94
94
 
95
95
  A check covers only what its CHECKS.md says it flags. Read the whole rule, not only the Clauses table: where a rule asks for more than its check can see, CHECKS.md says which part is left to review, and the rule's review lens covers that part.
96
96
 
@@ -267,13 +267,13 @@ A team that assesses decay in CI leaves `assessment` unset and runs `npm run --s
267
267
 
268
268
  The trade: a push that bypasses the hook, for example with `git push --no-verify`, leaves no later gate, so carve-out debt can stop decaying unnoticed. Every run that leaves decay to another run says so in its report (step 6). With `eslint` clauses, the repository's own `eslint` run also reports them in the editor, from the projection.
269
269
 
270
- Tell any coding agent working in the repository, in its project instructions: "Read the rule pages under `node_modules/@hailstails/hone/rules/` for the disciplines in `disciplines.json` before editing. When a check fails, read the section for the failing clause in `disciplines.assessment.md` and the Spirit section of the clause's rule page before changing anything; do not add an exception, exclusion or setting to make it pass. Before handing off, run the repository's validation command, report its exit code and findings, and apply the judgement rules listed in `disciplines.assessment.md` with their review lenses." Copying the rule pages does not make an agent read them; the instruction does. Step 5a writes `disciplines.assessment.md`.
270
+ Tell any coding agent working in the repository, in its project instructions: "Read the rule pages under `node_modules/@hailstails/hone/rules/` for the disciplines in `disciplines.json` before editing. When a check fails, read the section for the failing clause in `disciplines.assessment.md` and, in node_modules/@hailstails/hone/rules/typescript/symptoms.md, the "May indicate" and "Breach usually sits" lines of each symptom the clause's rule page names, before changing anything; do not add an exception, exclusion or setting to make it pass. Before handing off, run the repository's validation command, report its exit code and findings, and apply the judgement rules listed in `disciplines.assessment.md` with their review lenses." Copying the rule pages does not make an agent read them; the instruction does. Step 5a writes `disciplines.assessment.md`.
271
271
 
272
272
  ### 5a. Write the assessment
273
273
 
274
274
  The first run on an existing codebase usually fails, often with many findings. Each finding is a signal about the design: a missing boundary, an earlier choice that forces the workaround, a port wider than its use. Before fixing or recording anything, write down what the signals mean in this codebase, in `<repo>/disciplines.assessment.md`. Whoever later hits a red check then has more to go on than the assumption that the friction is unnecessary: the file says what that clause points at here and where the code is going.
275
275
 
276
- Each rule page's Spirit section lists the usual causes behind its findings. The assessment does not repeat them. It says which cause applies here, where, the forward goal in this codebase's terms, and the steps toward it.
276
+ Each symptom on [the symptoms page](rules/typescript/symptoms.md) lists the cases it may indicate and where the breach usually sits. The assessment does not repeat them. It says which cause applies here, where, the forward goal in this codebase's terms, and the steps toward it.
277
277
 
278
278
  Start from the template the package ships:
279
279
 
@@ -293,8 +293,8 @@ Draft disciplines.assessment.md from node_modules/@hailstails/hone/methods/asses
293
293
  For each clause in the report's findings section whose findings will not all be fixed in this change:
294
294
  1. Measure. Count its findings and group them by folder, by the value, library or dependency involved, and by the shape of the code.
295
295
  2. Read the code at several sites in each group, not only the report lines.
296
- 3. Read the clause's rule page, node_modules/@hailstails/hone/rules/<ID>/README.md, in full, and its Spirit section closely.
297
- 4. Match each group against the causes listed under "What a finding points at". Name the cause exactly as the rule names it. If no listed cause fits, say so and describe what the sites show; do not pick the closest.
296
+ 3. Read the clause's rule page, node_modules/@hailstails/hone/rules/<ID>/README.md, and, in node_modules/@hailstails/hone/rules/typescript/symptoms.md, each symptom it names, closely.
297
+ 4. Match each group against the symptom's "May indicate" and "Breach usually sits" lines. Name the cause exactly as the symptoms page names it. If no listed cause fits, say so and describe what the sites show; do not pick the closest.
298
298
  5. Write the clause's section from the template: the cause, the count and example sites as file:line, the forward goal in this codebase's terms, and the steps that change the code toward it, starting with the step that unlocks the others.
299
299
 
300
300
  Exclusions, exceptions, settings and not adopting a clause are never a cause, a goal or a step. The Debt line says how existing debt is held while the steps are taken; write it last, after the rest of the section. A section that gives only counts, or whose steps are about recording exceptions, is not done.
@@ -337,7 +337,7 @@ CD-15#loops audit src/basket.ts:15:0 for (const line of this.lines) {
337
337
  | `exempted` | findings an exception covers; informational |
338
338
  | `unrecorded` | a native exception no record holds, as `<clause> <mechanism> <kind> <detail>`: remove it, or record it where step 7 allows. An inline disable, `<clause> eslint inline-disable <file>:<line> <comment>`, and a TypeScript directive, `CD-2#cast-expressions audit inline-disable <file>:<line> <comment>`, are held only by an `authorised-location` or `file-carve-out` on that clause and file. An `eslint-disable` naming no rule escapes every selected clause, needs a record for each, and its lines end ` names no rule and escapes every selected clause: naming the rule is the cheap fix`. A lint-script option, `<clause> eslint command-line-option <package.json> <script> <option> weakens the script's whole run, so no record can cover it: remove it from the script`, cannot be recorded. Where another command comes before `eslint` in its script, as in `tsc && eslint -c eslint.config.mjs .`, the line instead reads `<clause> eslint command-line-option <package.json> <script> <option>: <command> is not the first command of its script, so Hone cannot tell what the option does to the files under check; give <command> a script of its own, such as "<invocation>"`: move that command to a script of its own. Where something before `eslint` in its own command is neither a package runner nor a `NAME=value` setting, as `env` in `env --chdir=src eslint --ignore-pattern dist .` or `-y` in `npx -y eslint --ignore-pattern dist .`, it reads `<clause> eslint command-line-option <package.json> <script> <option>: "<wrapper>" comes before <command> and is neither a package runner nor a NAME=value setting, so Hone cannot tell what the option does to the files under check; put only package runners and NAME=value settings before <command>`. `cross-env` followed only by `NAME=value` settings counts as a setting |
339
339
  | `uncovered` | a mechanical clause of an adopted discipline is not listed: add it to `disciplines.json` with a mechanism, `"not-run"` or `"not-adopted"` |
340
- | `stale` | an exception that no longer exempts anything. A `file-carve-out` whose file no longer exists is removed by the `hone prune-debt` command the last `readFirst` line names; run it, then `npm run --silent hone:project`. Delete every other stale record by hand, including a `file-carve-out` on a file that still exists, then run `hone:project` again ([README.md](README.md#pruning-paid-debt)). Right after a move from an older route, first check that its settings were carried over ([MIGRATING.md](MIGRATING.md#2a-carry-over-the-old-routes-settings) step 2a) |
340
+ | `stale` | an exception that no longer exempts anything. A `file-carve-out` whose debt is paid is removed by the `hone prune-debt` command the last `readFirst` line names; run it, then `npm run --silent hone:project`. Delete every other stale record by hand, including a `file-carve-out` on a file its mechanism did not measure, then run `hone:project` again ([README.md](README.md#pruning-paid-debt)). Right after a move from an older route, first check that its settings were carried over ([MIGRATING.md](MIGRATING.md#2a-carry-over-the-old-routes-settings) step 2a) |
341
341
  | `forfeited` | a file carve-out whose file changed since `--base-revision`: fix the file and delete the carve-out |
342
342
  | `invalidRecords` | an exception entry that cannot be accepted, with the reason, for example `clause-not-run` or `clause-not-adopted` for an entry on a clause listed as `"not-run"` or `"not-adopted"`: correct or delete it |
343
343
  | `doublyHeld` | a file both authorised and carved out for one clause: keep one |
@@ -350,7 +350,7 @@ To print less, set `"reportOutput"` in `disciplines.json` for the repository, or
350
350
 
351
351
  ## 7. Record exceptions
352
352
 
353
- Before recording anything, take the chain in [the spirit of the rules](rules/SPIRIT.md#when-the-check-is-red): measure the sites for each failing clause, ask what each group points at using the rule page's Spirit section and the clause's section in `disciplines.assessment.md` (step 5a), then decide. Fix the cause where you can; exceptions are not the first move. Where a file legitimately needs what a clause forbids, record it in `<repo>/discipline-exceptions.json`:
353
+ Before recording anything, take the chain in [the spirit of the rules](rules/SPIRIT.md#when-the-check-is-red): measure the sites for each failing clause, ask what each group points at using the "May indicate" and "Breach usually sits" lines of each symptom on [the symptoms page](rules/typescript/symptoms.md) and the clause's section in `disciplines.assessment.md` (step 5a), then decide. Fix the cause where you can; exceptions are not the first move. Where a file legitimately needs what a clause forbids, record it in `<repo>/discipline-exceptions.json`:
354
354
 
355
355
  - `authorised-location`: the clause does not apply to this one file, for example the single adapter that reads the real clock.
356
356
  - `file-carve-out`: known debt in one file. It is forfeited, and fails the run, as soon as that file changes since `--base-revision`. An `eslint-disable` comment or a `@ts-expect-error`, `@ts-ignore` or `@ts-nocheck` directive already in a file is debt of this kind on the clause it escapes; a new one in a file with no record is `unrecorded`.
@@ -402,7 +402,7 @@ A repository with existing code usually has more findings than the change that a
402
402
 
403
403
  The records are the same as any other `file-carve-out`: each is forfeited once its file changes, which is how the debt is paid down. A file with no earlier revision gets no record, because it has no debt to inherit. The command is for adoption, but it does not refuse to run again: forfeiture already stops it turning new findings into carve-outs, since a record written for a file just changed is forfeited by the next check that assesses decay. That holds only where decay is assessed. With `"assessment": { "forfeiture": "elsewhere" }` (step 5), it is assessed only by the run that the repository leaves it to, such as the pre-push hook, so a push that bypasses that run lets such a record through until a later run assesses it.
404
404
 
405
- Running it again only adds records for pairs that have none; it never removes or rewrites one. A record whose debt is paid is reported `stale`, or `forfeited` with no finding left on its file. `hone prune-debt` removes it when its file no longer exists; otherwise delete it by hand ([README.md](README.md#pruning-paid-debt)).
405
+ Running it again only adds records for pairs that have none; it never removes or rewrites one. A record whose debt is paid is reported `stale`, or `forfeited` with no finding left on its file that only debt answers. `hone prune-debt` removes it when its file no longer exists or its mechanism measured its clause on that file, every finding still there is answered by an `authorised-location` in force, and no native suppression, such as an inline disable or a config override, recorded or not, sits on its clause and file. An imported `authorised-location`, or one with a legacy why-chain, answers nothing on a run whose records at the base revision could not be read. Otherwise delete it by hand ([README.md](README.md#pruning-paid-debt)).
406
406
 
407
407
  ## 8. Prove one failure and correction
408
408
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  Every release of Hone, newest first. `pnpm run release-pull-request` writes each new section from the commits merged to `main` since the previous release tag, whose subjects are the squash-merged pull request titles; README.md's Compatibility section says what each kind of release may change. The sections below were written by hand from the merged pull requests when the changelog started.
4
4
 
5
+ ## 1.5.0
6
+
7
+ ### Features
8
+
9
+ - add the TypeScript symptom catalogue and its typed reader (#199)
10
+ - prune-debt removes paid debt on a file that still exists (#203)
11
+ - a finding names its symptom (#202)
12
+
13
+ ### Other changes
14
+
15
+ - pages for principles, cases, rules, records and the TypeScript layer (#197)
16
+ - numbered rule pages point at the named pages (#201)
17
+ - the install-proof plan test holds no debt (#208)
18
+
5
19
  ## 1.4.0
6
20
 
7
21
  ### Features
package/MIGRATING.md CHANGED
@@ -374,3 +374,20 @@ Earlier releases never listed an `eslint` file record as `stale`. The off-switch
374
374
 
375
375
  `hone prune-debt` prints `<clause> removed <file>` for each record it removed. Commit the exception records and `disciplines.eslint.mjs`, and each package slice `hone project` writes. The check passes.
376
376
  5. **Look for a team override that surfaces.** An off-switch your own config places after the projection, for a rule and file a removed record held, was hidden behind the record. It is now listed under `unrecorded` as a `config-override`; [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with it.
377
+
378
+ ## 18. Rules by name
379
+
380
+ Rules, principles, cases, recipes and symptoms are now referred to by name, not by number. [rules/README.md](rules/README.md) explains how the named pages read.
381
+
382
+ Nothing must be migrated. Selections, exception records and findings still use the numbered clause addresses, such as `CD-14#class-syntax`, and load and print as before. Each numbered `rules/<ID>/README.md` now gives its verdict and the named pages to read; its `CHECKS.md` still holds the check mechanics.
383
+
384
+ [Every CD](rules/numbers.md) maps each number to its new names.
385
+
386
+ ## 19. Pruning paid debt on files that still exist
387
+
388
+ `hone prune-debt` used to remove a `file-carve-out` only when its file no longer existed. Each mechanism now reports which clause it measured on which file, and the command also removes a stale or forfeited `file-carve-out` whose clause its mechanism measured on its file, when no finding or native exception still holds it. A finding an `authorised-location` in force exempts no longer holds it, since that finding is answered; a finding only debt exempts, and any native exception on the pair, recorded or not, still do. A file the mechanism skipped, a file outside the checked set and a run that did not happen are not measured, so their records stay.
389
+
390
+ 1. **Refresh Hone** as [ADOPTING.md](ADOPTING.md#10-update-and-remove) step 10 says, and run the check. A record whose debt is paid on a file that still exists now brings the `prune-debt` line to the end of `readFirst`.
391
+ 2. **Run the command it names,** then `npm run --silent hone:project` when any clause is `eslint`, and commit what they change.
392
+ 3. **Runners written outside Hone** may return `measured`, a list of `{ clause, file }` pairs, beside what they return now; [the mechanism guide](docs/adding-a-discipline-or-mechanism.md) says what a pair means. A runner that returns none has measured nothing, and its records on files that still exist stay for a person, as before.
393
+ 4. **Audit pieces written outside Hone** must answer `skipped` from `prepareFile` for a file they do not judge. Any other answer now says the piece's clauses were measured on that file, so `prune-debt` may remove a record on it; [the audit piece guide](docs/extending.md#an-audit-piece) says so.
package/README.md CHANGED
@@ -17,7 +17,7 @@ npm install --save-dev --save-exact @hailstails/hone@<version>
17
17
 
18
18
  With pnpm the second command is `pnpm add -D --save-exact @hailstails/hone@<version>`. Stable releases are published to npm under the dist-tag `latest` and pre-releases under `next`; the badge above shows the version `latest` installs. Pin the exact version rather than installing by tag: a major release can remove or rename a clause address, config key or flag, and an install by tag can record a range. The alternative is the tarball attached to each [GitHub release](https://github.com/HailsTails/hone/releases), installed with `npm install --save-dev <path-to-tarball>`. A repository on the package's old name, `honed`, moves with [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone). [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps, and the alternative of building the tarball from a pinned commit.
19
19
 
20
- Two 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).
20
+ Two mechanisms ship: `audit`, a standalone TypeScript syntax walker, and `eslint`, which runs the clause as an ESLint rule inside the team's own ESLint setup. Rules are referred to by name; a number is only a clause address. [rules/numbers.md](rules/numbers.md#every-numbered-discipline) lists every shared discipline with its clauses, and [rules/README.md](rules/README.md) explains how the named pages read: the audit mechanism checks 20 disciplines, and ESLint pieces check clauses of CD-1, CD-6, CD-7, CD-10, CD-14, CD-27, CD-40, CD-41, CD-42 and CD-44. The rest are judgement rules, applied in review with the review methods in [methods/](methods/README.md).
21
21
 
22
22
  To adopt Hone in another repository, follow [ADOPTING.md](ADOPTING.md) step by step. A repository already using the older standalone route, or a copy of Hone's source, follows [MIGRATING.md](MIGRATING.md) instead.
23
23
 
@@ -25,7 +25,7 @@ A team adds its own disciplines as a rule set in its own repository, with ESLint
25
25
 
26
26
  ## Commands
27
27
 
28
- The package ships one command, `hone`, with five subcommands. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of files that no longer exist; `split-records` runs once, when a repository moves its records to [the split layout](#the-split-layout):
28
+ The package ships one command, `hone`, with five subcommands. `check` and `project` run through a `package.json` script as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) shows; `record-debt` runs once, when a repository adopts Hone; `prune-debt` runs when the check names it, to remove the records of debt that is paid; `split-records` runs once, when a repository moves its records to [the split layout](#the-split-layout):
29
29
 
30
30
  ```text
31
31
  hone check --repo <dir> [--base-revision <revision>] [--report-output <full|failures-only|counts|verdict-only>] [--forfeiture <this-run|elsewhere>]
@@ -43,7 +43,7 @@ hone --version
43
43
 
44
44
  `hone check` loads the repository's selection, exceptions, rule sets and pieces; works out which files changed since `--base-revision`; runs each selected mechanism once over the repository's tracked `.ts`, `.tsx`, `.mts` and `.cts` files; applies the exceptions; and prints a plain-text report ending in `verdict: pass` or `verdict: fail`, followed by ` (partial assessment)` when the run left part of the assessment to another run. It exits `0` when the verdict is `pass`, `1` when it is `fail`, and `2` on a load failure, which prints one line, `load failure: <kind> <fields>`. `hone project`, `hone record-debt`, `hone prune-debt` and `hone split-records` exit `0` or `2`.
45
45
 
46
- The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, the edition each clause with more than one edition ran, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings and the command that removes the records of files that no longer exist, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, editions, exempted findings, assessment and where to read first is empty.
46
+ The report lists the excluded paths, the clauses not adopted, the clauses adopted with their mechanism not run, the edition each clause with more than one edition ran, findings, exempted findings, uncovered clauses, stale, forfeited, unrecorded and doubly-held exceptions, invalid exception records, unmeasured checks, projection problems, any part of the assessment left to another run and, last, where to read first for each clause with findings and the command that removes the records of paid debt, each with its count. The verdict is `pass` only when every list except the excluded paths, clauses not adopted, clauses not run, editions, exempted findings, assessment and where to read first is empty.
47
47
 
48
48
  An `unrecorded` line is `<clause> <mechanism> <kind> <detail>`. Two kinds end with a note:
49
49
 
@@ -59,7 +59,7 @@ An `unrecorded` line is `<clause> <mechanism> <kind> <detail>`. Two kinds end wi
59
59
 
60
60
  `readFirst` comes last, just before the verdict, so a reader who looks only at the end of a failing report lands on it. It has one line per clause with findings, not one per finding, in the order the findings first name the clauses. Each line points at the Spirit section of the clause's rule page, `rules/<ID>/README.md` in the clause's rule set, and, where the repository has written one, at the clause's own section in `disciplines.assessment.md` at the repository root first. That file is where a repository records its own causes, forward goal and steps for a clause; [ADOPTING step 5a](ADOPTING.md#5a-write-the-assessment) says how to write it. Paths are printed with forward slashes, relative to the `--repo` folder; a page on another drive is printed as its absolute path.
61
61
 
62
- When `disciplines.assessment.md` is not written yet, or cannot be read, one note line comes first and says so, naming ADOPTING step 5a; each clause line then names its rule page only. The note counts as an entry, so a report with two failing clauses and no assessment file prints `readFirst (3)`. A clause line names the clause's section when the file has one, and says `disciplines.assessment.md does not assess this clause` when the file is there without it. When the check finds a `stale` or `forfeited` `file-carve-out` on a file that no longer exists, one more line comes last and names the exact `hone prune-debt` command for this repository, as [Pruning paid debt](#pruning-paid-debt) shows. [The output contract](docs/output-contract.md#report-lines) lists every `readFirst` line exactly.
62
+ When `disciplines.assessment.md` is not written yet, or cannot be read, one note line comes first and says so, naming ADOPTING step 5a; each clause line then names its rule page only. The note counts as an entry, so a report with two failing clauses and no assessment file prints `readFirst (3)`. A clause line names the clause's section when the file has one, and says `disciplines.assessment.md does not assess this clause` when the file is there without it. When the check finds a `stale` or `forfeited` `file-carve-out` whose debt is paid, one more line comes last and names the exact `hone prune-debt` command for this repository, as [Pruning paid debt](#pruning-paid-debt) shows. [The output contract](docs/output-contract.md#report-lines) lists every `readFirst` line exactly.
63
63
 
64
64
  A file that does not assess a clause is normal: the assessment covers the clauses the repository chose to describe, and the rule page's Spirit is the read for the rest.
65
65
 
@@ -117,27 +117,27 @@ It never writes anything wider than one clause in one file: no `authorised-locat
117
117
 
118
118
  Other native exceptions under `unrecorded`, such as a `config-override` or a lint-script option, are not recorded: [ADOPTING.md](ADOPTING.md#6-read-the-report) step 6 says what to do with each.
119
119
 
120
- It adds the new entries after the last one and leaves every entry already in the file as written. It stages and commits nothing: the diff of the exception records is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again adds records only for pairs that still have none. A record on a file that no longer exists is removed by `hone prune-debt`, below. Run `hone project` after it when any clause is `eslint`, so the projection carries the new records.
120
+ It adds the new entries after the last one and leaves every entry already in the file as written. It stages and commits nothing: the diff of the exception records is the review, and nothing takes effect until a person commits it. It never removes or rewrites a record, so running it again adds records only for pairs that still have none. A record whose debt is paid is removed by `hone prune-debt`, below. Run `hone project` after it when any clause is `eslint`, so the projection carries the new records.
121
121
 
122
122
  The command does not refuse to run again later, and has no flag for it. Forfeiture is what stops it turning new findings into carve-outs: a file carve-out is forfeited once its file changes since `--base-revision`, so a record written for a file someone has just changed fails the next check that assesses forfeiture, and a file that is new since the base gets no record at all. That holds only where forfeiture is assessed. In an arrangement that leaves it elsewhere, such as `"assessment": { "forfeiture": "elsewhere" }` with the pre-push hook that assesses it bypassed, such a record is not caught until a run that does assess it.
123
123
 
124
124
  ### Pruning paid debt
125
125
 
126
- A `file-carve-out` is debt, and once the debt is paid the record should go. `hone prune-debt` removes the records whose file no longer exists: each `file-carve-out` under `stale` or `forfeited` whose file is gone from the repository, unless the report still lists a finding or a native exception on its clause and file.
126
+ A `file-carve-out` is debt, and once the debt is paid the record should go. `hone prune-debt` removes the records whose debt is paid: each `file-carve-out` under `stale` or `forfeited` whose file is gone from the repository, or whose clause its mechanism measured on its file, unless its clause and file still hold a finding no record answers, a finding only debt exempts, or any native exception. A finding an `authorised-location` in force exempts is answered, so a forfeited `file-carve-out` beside it goes, unless the location is imported or carries a legacy why-chain and the records at the base revision could not be read; while the `file-carve-out` is still in force, the two are `doublyHeld` and the command removes neither. Only the mechanism knows what it measured. A file it was handed and skipped, a file outside the checked set and a run that did not happen are not measured, so their records stay.
127
127
 
128
128
  Every other record stays for a person:
129
129
 
130
- - **A `stale` `file-carve-out` on a file that still exists:** the command does not remove it. Delete it by hand, then run `hone project` when its clause is `eslint`.
131
- - **A `forfeited` record on a file that still exists:** fix the file and delete the record, as for any forfeited record. While the file still breaks its clause, the record keeps failing the run.
130
+ - **A `stale` `file-carve-out` on a file its mechanism did not measure,** such as a file the mechanism skips: the command does not remove it. Delete it by hand, then run `hone project` when its clause is `eslint`.
131
+ - **A `forfeited` record on a file that still breaks its clause:** fix the file, then run the command, which removes the record once its mechanism measures the clause there with nothing left. While the file still breaks its clause, the record keeps failing the run.
132
132
  - **An `authorised-location` or `clause-wide-carve-out` under `stale`:** it carries a person's judgement, so delete it by hand.
133
133
 
134
- The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given. A check that finds a `file-carve-out` on a file that no longer exists names the command exactly in its last `readFirst` line, just above the verdict, with `hone project` after it when any of the records is for an `eslint` clause:
134
+ The command runs the check with the `--base-revision` and `--forfeiture` it is given, so give it what the check was given. A check that finds a `file-carve-out` whose debt is paid names the command exactly in its last `readFirst` line, just above the verdict, with `hone project` after it when any of the records is for an `eslint` clause:
135
135
 
136
136
  ```text
137
137
  prune-debt: 3 file carve-outs under stale or forfeited still record debt that is paid; run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js prune-debt --repo /work/shop --base-revision origin/main to remove what is paid, then run node /work/shop/node_modules/@hailstails/hone/core/check/tool-command.js project --repo /work/shop and commit the exception records with every disciplines.eslint.mjs it writes
138
138
  ```
139
139
 
140
- It prints `<clause> removed <file>` for each record it removed, ordered by file and then by clause, and nothing when it removed none. Like `hone record-debt`, it writes the exception records in whichever layout the repository keeps them, keeps every other record's text byte for byte, stages and commits nothing, and does not write the projection: run `hone project` after it when any clause is `eslint`, so the projection drops the records' off-switches. When it removes the last record from a file, it follows the layout: in [the split layout](#the-split-layout) it deletes that rule's file, as `hone split-records` writes a file only for a rule that holds records; a single `discipline-exceptions.json` is left holding an empty list. It has no dry run, as no other Hone command has: the `stale` and `forfeited` lines naming a file that no longer exists name what it removes, and the diff of the records is the review.
140
+ It prints `<clause> removed <file>` for each record it removed, ordered by file and then by clause, and nothing when it removed none. Like `hone record-debt`, it writes the exception records in whichever layout the repository keeps them, keeps every other record's text byte for byte, stages and commits nothing, and does not write the projection: run `hone project` after it when any clause is `eslint`, so the projection drops the records' off-switches. When it removes the last record from a file, it follows the layout: in [the split layout](#the-split-layout) it deletes that rule's file, as `hone split-records` writes a file only for a rule that holds records; a single `discipline-exceptions.json` is left holding an empty list. It has no dry run, as no other Hone command has: the `prune-debt` line counts what it removes, and the diff of the records is the review.
141
141
 
142
142
  For an `eslint` clause, the off-switch the projection writes for a record is Hone's own. The check does not list it as a `config-override`, so it never counts as a native exception the record holds, and a record whose file no longer breaks its clause is `stale` like any other. A `config-override` on a clause and file no record holds is reported as before. While a record holds a file, the team's own off-switch for that rule and file cannot be told from the projection's, and the record holds the file either way. Once the record is removed, a team off-switch placed after the projection is listed under `unrecorded` as a `config-override`, and one placed before it never takes effect, since the projection turns the rule on after it, so ESLint and the check both flag the file. A team block placed after the projection that sets a recorded file's rule to `"warn"` or `"error"` leaves the projection out of effect, and the check says `not-included`, as before.
143
143
 
package/api/testing.js CHANGED
@@ -5,11 +5,11 @@ import {
5
5
  loadRunner,
6
6
  rejectedCall,
7
7
  runnerInvalidOutput
8
- } from "../chunks/chunk-6SM3HKWO.js";
8
+ } from "../chunks/chunk-5U4VTFD5.js";
9
9
  import {
10
10
  caseVerdictSchema,
11
11
  runnerResultSchema
12
- } from "../chunks/chunk-FEWCJU7H.js";
12
+ } from "../chunks/chunk-2O46EB4E.js";
13
13
  import {
14
14
  readDisciplineFile,
15
15
  readPieceFile
@@ -63,6 +63,11 @@ var hitSchema = z3.object({
63
63
  snippet: snippetSchema,
64
64
  remedy: remedySchema.optional()
65
65
  }).readonly();
66
+ var measuredPairSchema = z3.object({
67
+ clause: clauseAddressObjectSchema,
68
+ file: repoPathSchema
69
+ }).readonly();
70
+ var measuredSchema = z3.array(measuredPairSchema).readonly().optional();
66
71
  var caseVerdictSchema = z3.object({
67
72
  caseName: z3.string(),
68
73
  flaggedLines: z3.array(z3.number().int().min(1)).readonly()
@@ -79,6 +84,7 @@ var runnerResultSchema = (request) => z3.union([
79
84
  export {
80
85
  nativeExceptionKindSchema,
81
86
  hitSchema,
87
+ measuredSchema,
82
88
  caseVerdictSchema,
83
89
  projectionWriteSchema,
84
90
  runnerResultSchema
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  hitSchema,
3
+ measuredSchema,
3
4
  nativeExceptionKindSchema,
4
5
  projectionWriteSchema,
5
6
  runnerResultSchema
6
- } from "./chunk-FEWCJU7H.js";
7
+ } from "./chunk-2O46EB4E.js";
7
8
  import {
8
9
  JSON_KIND_NAMES,
9
10
  jsonKindOf,
@@ -539,11 +540,15 @@ var importRefused = (request) => ({
539
540
  outcome: "failed",
540
541
  error: { kind: "import-unverified", detail: `${request.detail}: ${IMPORT_WAY_OUT[request.kind]}` }
541
542
  });
542
- var verifiedImport = (request) => {
543
- const { baseline } = request;
544
- if (baseline.measured === "no") {
545
- return { outcome: "ok", value: request.record };
543
+ var evidenceJudgedBy = (request) => (request.evidence.whyChain === void 0 ? request.evidence.provenance === void 0 : whyChainFormOf({ chain: request.evidence.whyChain }) === "causal") ? "itself" : "the-base";
544
+ var judgedAtBase = (request) => {
545
+ if (evidenceJudgedBy(request) === "itself") {
546
+ return request.inFull();
546
547
  }
548
+ return request.baseline.measured === "no" ? request.unjudged() : request.againstBase(request.baseline);
549
+ };
550
+ var importAgainstBase = (request) => {
551
+ const { baseline } = request;
547
552
  if (baseline.entriesAtBase.some((baseEntry) => sameEntry({ left: baseEntry, right: request.entry }) === "same")) {
548
553
  return { outcome: "ok", value: request.record };
549
554
  }
@@ -557,17 +562,18 @@ var verifiedImport = (request) => {
557
562
  detail: `the record is new since the base revision, and its provenance source ${request.provenance.source} is not an entry at the base revision listing ${request.identity.file} under ${LEGACY_DIRECTORY_OF[request.provenance.kind]}/${request.discipline.toLowerCase()}.json`
558
563
  });
559
564
  };
565
+ var verifiedImport = (request) => judgedAtBase({
566
+ evidence: { provenance: request.provenance },
567
+ baseline: request.baseline,
568
+ inFull: () => ({ outcome: "ok", value: request.record }),
569
+ unjudged: () => ({ outcome: "ok", value: request.record }),
570
+ againstBase: (base) => importAgainstBase({ ...request, baseline: base })
571
+ });
560
572
  var recordedFile = (request) => {
561
573
  const parsed = repoPathSchema.safeParse(request.file);
562
574
  return parsed.success ? { outcome: "ok", value: parsed.data } : { outcome: "failed", error: { kind: "file-not-repo-path", file: request.file } };
563
575
  };
564
576
  var LEGACY_CHAIN_NEW_OR_EDITED = `a new or edited entry's whyChain follows the causal contract (docs/why-chain-contract.md in the ${TOOL_IDENTITY.packageName} package); a chain without rootCheck and readback is accepted only while --base-revision holds its entry unchanged`;
565
- var legacyChainStanding = (request) => {
566
- if (request.baseline.measured === "no") {
567
- return "base-unmeasured";
568
- }
569
- return request.baseline.entriesAtBase.some((baseEntry) => sameEntry({ left: baseEntry, right: request.entry }) === "same") ? "unchanged-since-base" : "new-or-edited";
570
- };
571
577
  var chainRefused = (request) => ({
572
578
  outcome: "failed",
573
579
  error: { kind: "why-chain-refused", detail: request.detail }
@@ -580,18 +586,20 @@ var legacyChainOf = (request) => {
580
586
  const parsed = legacyWhyChainSchema.safeParse(request.whyChain);
581
587
  return parsed.success ? { outcome: "ok", value: parsed.data } : chainRefused({ detail: z2.prettifyError(parsed.error) });
582
588
  };
583
- var judgedWhyChain = (request) => {
584
- if (whyChainFormOf({ chain: request.whyChain }) === "causal") {
585
- return causalChainOf({ whyChain: request.whyChain, preface: [] });
586
- }
587
- switch (legacyChainStanding(request)) {
588
- case "unchanged-since-base":
589
- case "base-unmeasured":
590
- return legacyChainOf(request);
591
- case "new-or-edited":
592
- return causalChainOf({ whyChain: request.whyChain, preface: [LEGACY_CHAIN_NEW_OR_EDITED] });
593
- }
594
- };
589
+ var judgedWhyChain = (request) => judgedAtBase({
590
+ evidence: { whyChain: request.whyChain },
591
+ baseline: request.baseline,
592
+ inFull: () => causalChainOf({ whyChain: request.whyChain, preface: [] }),
593
+ unjudged: () => legacyChainOf(request),
594
+ againstBase: (base) => base.entriesAtBase.some((baseEntry) => sameEntry({ left: baseEntry, right: request.entry }) === "same") ? legacyChainOf(request) : causalChainOf({ whyChain: request.whyChain, preface: [LEGACY_CHAIN_NEW_OR_EDITED] })
595
+ });
596
+ var authorisationStandingOf = (request) => judgedAtBase({
597
+ evidence: request.record,
598
+ baseline: request.baseline,
599
+ inFull: () => "established",
600
+ unjudged: () => "provisional",
601
+ againstBase: () => "established"
602
+ });
595
603
  var unselectedKindOf = (request) => [
596
604
  ["clause-not-adopted", request.selection.notAdopted],
597
605
  ["clause-not-run", request.selection.notRun]
@@ -1035,6 +1043,9 @@ import { z as z8 } from "zod";
1035
1043
 
1036
1044
  // core/exception-records/paid-debt.ts
1037
1045
  var PRUNE_DEBT_SUBCOMMAND = "prune-debt";
1046
+ var answeredByAuthorisedLocation = (request) => request.exempted.by.some(
1047
+ (record) => record.kind === "authorised-location" && authorisationStandingOf({ record, baseline: request.baseline }) === "established"
1048
+ ) ? "answered" : "still-debt";
1038
1049
  var nativeFileOf = (request) => {
1039
1050
  switch (request.exception.kind) {
1040
1051
  case "command-line-option":
@@ -1049,18 +1060,23 @@ var nativeFileOf = (request) => {
1049
1060
  };
1050
1061
  var heldPairKeys = (request) => /* @__PURE__ */ new Set([
1051
1062
  ...request.findings.map((finding) => debtPairKey(finding)),
1052
- ...request.exempted.map((exempted) => debtPairKey(exempted.finding)),
1053
- ...request.unrecorded.flatMap((exception) => {
1063
+ ...request.exempted.flatMap(
1064
+ (exempted) => answeredByAuthorisedLocation({ exempted, baseline: request.baseline }) === "answered" ? [] : [debtPairKey(exempted.finding)]
1065
+ ),
1066
+ ...request.nativeExceptions.flatMap((exception) => {
1054
1067
  const file = nativeFileOf({ exception });
1055
1068
  return file === void 0 ? [] : [debtPairKey({ clause: exception.clause, file })];
1056
1069
  })
1057
1070
  ]);
1058
- var goneFileCarveOutPairs = (request) => [...request.stale, ...request.forfeited].flatMap(
1059
- (record) => record.kind === "file-carve-out" && request.absent.includes(record.file) ? [{ clause: record.clause, file: record.file }] : []
1060
- );
1071
+ var settledCarveOutPairs = (request) => {
1072
+ const measured = new Set(request.measured.map((pair) => debtPairKey(pair)));
1073
+ return [...request.stale, ...request.forfeited].flatMap(
1074
+ (record) => record.kind === "file-carve-out" && (request.absent.includes(record.file) || measured.has(debtPairKey(record))) ? [{ clause: record.clause, file: record.file }] : []
1075
+ );
1076
+ };
1061
1077
  var paidDebtOf = (request) => {
1062
1078
  const held = heldPairKeys(request);
1063
- return distinctDebtPairs({ pairs: goneFileCarveOutPairs(request).filter((pair) => !held.has(debtPairKey(pair))) });
1079
+ return distinctDebtPairs({ pairs: settledCarveOutPairs(request).filter((pair) => !held.has(debtPairKey(pair))) });
1064
1080
  };
1065
1081
 
1066
1082
  // core/governance/governance.ts
@@ -1450,7 +1466,8 @@ var embeddedRunReportSchema = z5.object({
1450
1466
  nativeExceptions: z5.array(nativeExceptionSchema).readonly(),
1451
1467
  projection: z5.enum(["current", "out-of-date", "missing", "not-included"]),
1452
1468
  slices: z5.array(sliceProblemSchema).readonly().default([]),
1453
- unprojectedFolders: z5.array(unprojectedFolderSchema).readonly().default([])
1469
+ unprojectedFolders: z5.array(unprojectedFolderSchema).readonly().default([]),
1470
+ measured: measuredSchema
1454
1471
  }).readonly();
1455
1472
 
1456
1473
  // core/mechanism-port/runner-failure.ts
@@ -1467,19 +1484,25 @@ var STANDALONE_RUN_SHAPE_MESSAGE = "a standalone run's value is { hits, nativeEx
1467
1484
  var standaloneRunReportSchema = z6.object(
1468
1485
  {
1469
1486
  hits: z6.array(hitSchema).readonly(),
1470
- nativeExceptions: z6.array(inlineDisableSchema).readonly()
1487
+ nativeExceptions: z6.array(inlineDisableSchema).readonly(),
1488
+ measured: measuredSchema
1471
1489
  },
1472
1490
  { error: STANDALONE_RUN_SHAPE_MESSAGE }
1473
1491
  ).readonly();
1474
1492
 
1475
1493
  // core/check/mechanism-dispatch.ts
1476
1494
  var STANDALONE_COVERABLE_KINDS = ["inline-disable"];
1495
+ var NOTHING_MEASURED = [];
1477
1496
  var standaloneResultSchema = runnerResultSchema({ value: standaloneRunReportSchema });
1478
- var unrequestedHit = (request) => request.hits.find(
1479
- (hit) => !request.checkedFiles.includes(hit.file) || !request.run.clauses.some(
1480
- (clause) => sameClauseAddress({ left: clause.address, right: hit.clause }) === "same"
1497
+ var unrequestedEntry = (request) => request.entries.find(
1498
+ (entry) => !request.checkedFiles.includes(entry.file) || !request.run.clauses.some(
1499
+ (clause) => sameClauseAddress({ left: clause.address, right: entry.clause }) === "same"
1481
1500
  )
1482
1501
  );
1502
+ var firstUnrequestedDetail = (request) => request.groups.flatMap((group) => {
1503
+ const unrequested = unrequestedEntry({ entries: group.entries, run: request.run, checkedFiles: request.checkedFiles });
1504
+ return unrequested === void 0 ? [] : [`${group.noun} names ${clauseAddressText({ address: unrequested.clause })} in ${unrequested.file}, which the request did not hold`];
1505
+ })[0];
1483
1506
  var okOutcomeSchema = z7.object({ outcome: z7.literal("ok") });
1484
1507
  var okStandaloneSchema = z7.object({ outcome: z7.literal("ok"), value: standaloneRunReportSchema });
1485
1508
  var invalidStandaloneDetail = (request) => {
@@ -1498,17 +1521,17 @@ var standaloneRun = (request) => {
1498
1521
  return parsed.data;
1499
1522
  }
1500
1523
  const report = parsed.data.value;
1501
- const unrequested = unrequestedHit({ hits: report.hits, run: request.run, checkedFiles: request.run.trackedPaths });
1524
+ const unrequested = firstUnrequestedDetail({
1525
+ groups: [
1526
+ { noun: "a hit", entries: report.hits },
1527
+ { noun: "a native exception", entries: report.nativeExceptions },
1528
+ { noun: "a measured pair", entries: report.measured ?? NOTHING_MEASURED }
1529
+ ],
1530
+ run: request.run,
1531
+ checkedFiles: request.run.trackedPaths
1532
+ });
1502
1533
  if (unrequested !== void 0) {
1503
- return runnerInvalidOutput({
1504
- detail: `a hit names ${clauseAddressText({ address: unrequested.clause })} in ${unrequested.file}, which the request did not hold`
1505
- });
1506
- }
1507
- const unrequestedInline = unrequestedHit({ hits: report.nativeExceptions, run: request.run, checkedFiles: request.run.trackedPaths });
1508
- if (unrequestedInline !== void 0) {
1509
- return runnerInvalidOutput({
1510
- detail: `a native exception names ${clauseAddressText({ address: unrequestedInline.clause })} in ${unrequestedInline.file}, which the request did not hold`
1511
- });
1534
+ return runnerInvalidOutput({ detail: unrequested });
1512
1535
  }
1513
1536
  return {
1514
1537
  outcome: "ok",
@@ -1519,7 +1542,8 @@ var standaloneRun = (request) => {
1519
1542
  coverableKinds: STANDALONE_COVERABLE_KINDS,
1520
1543
  projection: "none",
1521
1544
  slices: [],
1522
- unprojectedFolders: []
1545
+ unprojectedFolders: [],
1546
+ measured: report.measured ?? NOTHING_MEASURED
1523
1547
  }
1524
1548
  };
1525
1549
  };
@@ -1539,11 +1563,16 @@ var embeddedRun = (request) => {
1539
1563
  return parsed.data;
1540
1564
  }
1541
1565
  const report = parsed.data.value;
1542
- const unrequested = unrequestedHit({ hits: report.hits, run: request.run, checkedFiles: request.run.files });
1566
+ const unrequested = firstUnrequestedDetail({
1567
+ groups: [
1568
+ { noun: "a hit", entries: report.hits },
1569
+ { noun: "a measured pair", entries: report.measured ?? NOTHING_MEASURED }
1570
+ ],
1571
+ run: request.run,
1572
+ checkedFiles: request.run.files
1573
+ });
1543
1574
  if (unrequested !== void 0) {
1544
- return runnerInvalidOutput({
1545
- detail: `a hit names ${clauseAddressText({ address: unrequested.clause })} in ${unrequested.file}, which the request did not hold`
1546
- });
1575
+ return runnerInvalidOutput({ detail: unrequested });
1547
1576
  }
1548
1577
  const unrequestedNative = unrequestedNativeException({
1549
1578
  nativeExceptions: report.nativeExceptions,
@@ -1563,7 +1592,8 @@ var embeddedRun = (request) => {
1563
1592
  coverableKinds: request.projectedKinds,
1564
1593
  projection: report.projection,
1565
1594
  slices: report.slices,
1566
- unprojectedFolders: report.unprojectedFolders
1595
+ unprojectedFolders: report.unprojectedFolders,
1596
+ measured: report.measured ?? NOTHING_MEASURED
1567
1597
  }
1568
1598
  };
1569
1599
  };
@@ -1818,7 +1848,13 @@ var checkReportOf = (request) => {
1818
1848
  runs: request.runs
1819
1849
  });
1820
1850
  const projections = request.runs.map((run) => projectionOutcome({ run }));
1821
- const paidDebt = paidDebtOf({ ...governed, absent: absentFilesOf({ check: request.check, governed }) });
1851
+ const paidDebt = paidDebtOf({
1852
+ ...governed,
1853
+ absent: absentFilesOf({ check: request.check, governed }),
1854
+ nativeExceptions: request.runs.flatMap((run) => run.nativeExceptions.map((exception) => ({ ...exception, mechanism: run.mechanism }))),
1855
+ measured: request.runs.flatMap((run) => run.measured),
1856
+ baseline: request.inputs.exceptionBaseline
1857
+ });
1822
1858
  const report = {
1823
1859
  excluded: request.inputs.excluded,
1824
1860
  notAdopted: request.inputs.selection.notAdopted,
@@ -1894,6 +1930,7 @@ export {
1894
1930
  installRootOfApiEntry,
1895
1931
  UNLINKED,
1896
1932
  packageLinkOf,
1933
+ shownPathOf,
1897
1934
  shownFailureOf,
1898
1935
  clauseSettingsSchema,
1899
1936
  defaultClauseSettings,