@hailstails/hone 0.1.0-pre.7 → 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.
- package/ADOPTING.md +27 -11
- package/CHANGELOG.md +136 -0
- package/MIGRATING.md +55 -16
- package/README.md +10 -9
- package/api/audit.js +0 -1
- package/api/testing.js +8 -9
- package/chunks/chunk-5X2BR42Y.js +117 -0
- package/chunks/{chunk-NRXSM7BY.js → chunk-LHVFZMXD.js} +10 -7
- package/chunks/{chunk-5LCLBXP7.js → chunk-NILRE23T.js} +1 -1
- package/chunks/{chunk-P3NLETF5.js → chunk-OKQHVZLO.js} +1 -1
- package/chunks/{chunk-POZL7G62.js → chunk-OVEQ37JQ.js} +40 -37
- package/chunks/chunk-RNXPEK2U.js +77 -0
- package/chunks/{chunk-3LCKBX5T.js → chunk-XE6RNNZB.js} +205 -148
- package/chunks/{chunk-WPRR2MPJ.js → chunk-YL6WR3QW.js} +5 -5
- package/core/check/tool-command.js +57 -36
- package/docs/extending.md +2 -0
- package/docs/output-contract.md +4 -4
- package/mechanisms/audit/CD-1/any-cast.js +0 -1
- package/mechanisms/audit/CD-10/throws-in-tests.js +0 -1
- package/mechanisms/audit/CD-14/class-syntax.js +0 -1
- package/mechanisms/audit/CD-15/loops.js +0 -1
- package/mechanisms/audit/CD-17/clock-sources.js +0 -1
- package/mechanisms/audit/CD-19/import-boundaries.js +3 -4
- package/mechanisms/audit/CD-2/cast-expressions.js +0 -1
- package/mechanisms/audit/CD-23/export-test-sibling.js +0 -1
- package/mechanisms/audit/CD-25/dependency-isolation.js +0 -1
- package/mechanisms/audit/CD-26/module-mocking.js +0 -1
- package/mechanisms/audit/CD-27/test-body-logic.js +0 -1
- package/mechanisms/audit/CD-3/compiler-overrides.js +2 -861
- package/mechanisms/audit/CD-43/boolean-signatures.js +0 -1
- package/mechanisms/audit/CD-44/parameter-mutation.js +0 -1
- package/mechanisms/audit/CD-47/hermetic-git-spawns.js +0 -1
- package/mechanisms/audit/CD-5/comments-directives.js +3 -4
- package/mechanisms/audit/CD-6/identifier-names.js +0 -1
- package/mechanisms/audit/CD-7/categorical-paths.js +0 -1
- package/mechanisms/audit/CD-7a/factory-return-types.js +0 -1
- package/mechanisms/audit/CD-8/switch-defaults.js +0 -1
- package/mechanisms/audit/runner/README.md +2 -2
- package/mechanisms/audit/runner/runner.js +31 -27
- package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-2/cd2/cd2.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +0 -2
- package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +0 -1
- package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +0 -2
- package/mechanisms/eslint/runner/README.md +1 -1
- package/mechanisms/eslint/runner/runner.js +58 -2532
- package/package.json +7 -2
- package/rules/CD-10/CHECKS.md +2 -2
- package/rules/CD-14/CHECKS.md +2 -2
- package/rules/CD-15/CHECKS.md +2 -2
- package/rules/CD-17/CHECKS.md +2 -2
- package/rules/CD-19/CHECKS.md +2 -2
- package/rules/CD-2/CHECKS.md +2 -2
- package/rules/CD-23/CHECKS.md +2 -2
- package/rules/CD-25/CHECKS.md +2 -2
- package/rules/CD-26/CHECKS.md +2 -2
- package/rules/CD-27/CHECKS.md +2 -2
- package/rules/CD-3/CHECKS.md +2 -2
- package/rules/CD-40/CHECKS.md +2 -2
- package/rules/CD-41/CHECKS.md +2 -2
- package/rules/CD-42/CHECKS.md +2 -2
- package/rules/CD-43/CHECKS.md +2 -2
- package/rules/CD-44/CHECKS.md +2 -2
- package/rules/CD-47/CHECKS.md +2 -2
- package/rules/CD-5/CHECKS.md +2 -2
- package/rules/CD-6/CHECKS.md +2 -2
- package/rules/CD-7/CHECKS.md +2 -2
- package/rules/CD-7a/CHECKS.md +2 -2
- package/rules/CD-8/CHECKS.md +2 -2
- package/THIRD-PARTY-NOTICES.md +0 -354
- package/chunks/chunk-MYX7GAVM.js +0 -73
- package/chunks/chunk-NCDYOPHG.js +0 -19832
- package/chunks/chunk-NZLE2WMY.js +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hailstails/hone",
|
|
3
|
-
"version": "0.1.0-pre.
|
|
3
|
+
"version": "0.1.0-pre.9",
|
|
4
4
|
"description": "Checks a repository against the disciplines it selects, applies its recorded exceptions and prints one verdict.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"disciplines",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"ADOPTING.md",
|
|
57
|
+
"CHANGELOG.md",
|
|
57
58
|
"LICENSE",
|
|
58
59
|
"MIGRATING.md",
|
|
59
60
|
"README.md",
|
|
60
|
-
"THIRD-PARTY-NOTICES.md",
|
|
61
61
|
"api",
|
|
62
62
|
"chunks",
|
|
63
63
|
"core",
|
|
@@ -69,6 +69,11 @@
|
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": "^22.18.0 || >=24"
|
|
71
71
|
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@eslint/plugin-kit": "^0.7.3",
|
|
74
|
+
"jsonc-parser": "^3.3.1",
|
|
75
|
+
"zod": "^4.6.6"
|
|
76
|
+
},
|
|
72
77
|
"peerDependencies": {
|
|
73
78
|
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
74
79
|
"@typescript-eslint/parser": "^8.56.0",
|
package/rules/CD-10/CHECKS.md
CHANGED
|
@@ -38,7 +38,7 @@ it("loads the account", () => {
|
|
|
38
38
|
Assert on the whole result. Branching in tests is also reported by CD-27.
|
|
39
39
|
|
|
40
40
|
## Exceptions
|
|
41
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs a throw, such as a shared test harness. Use `file-carve-out` for debt in one file: it
|
|
41
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs a throw, such as a shared test harness. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
42
42
|
|
|
43
43
|
```json
|
|
44
44
|
{ "version": 1, "exceptions": [
|
|
@@ -46,4 +46,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
46
46
|
] }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-14/CHECKS.md
CHANGED
|
@@ -38,7 +38,7 @@ export const createCounter = () => {
|
|
|
38
38
|
Return an object of functions from a factory that closes over its state.
|
|
39
39
|
|
|
40
40
|
## Exceptions
|
|
41
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a class is required, such as an adapter extending a library base class. Use `file-carve-out` for debt in one file: it
|
|
41
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a class is required, such as an adapter extending a library base class. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
42
42
|
|
|
43
43
|
```json
|
|
44
44
|
{ "version": 1, "exceptions": [
|
|
@@ -46,4 +46,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
46
46
|
] }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-15/CHECKS.md
CHANGED
|
@@ -29,7 +29,7 @@ const totals = orders.map((order) => order.total);
|
|
|
29
29
|
Replace a counted loop with `Array.from({ length }, (_, position) => ...)`.
|
|
30
30
|
|
|
31
31
|
## Exceptions
|
|
32
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file drains an async stream and cannot use a functional form. Use `file-carve-out` for debt in one file: it
|
|
32
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file drains an async stream and cannot use a functional form. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
33
33
|
|
|
34
34
|
```json
|
|
35
35
|
{ "version": 1, "exceptions": [
|
|
@@ -37,4 +37,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
37
37
|
] }
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-17/CHECKS.md
CHANGED
|
@@ -26,7 +26,7 @@ const startedAt = clock.now();
|
|
|
26
26
|
Accept a clock as a dependency and read time only through it. The one real implementation lives in an adapter.
|
|
27
27
|
|
|
28
28
|
## Exceptions
|
|
29
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the single real clock implementation. Use `file-carve-out` for debt in one file: it
|
|
29
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the single real clock implementation. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{ "version": 1, "exceptions": [
|
|
@@ -34,4 +34,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
34
34
|
] }
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-19/CHECKS.md
CHANGED
|
@@ -38,7 +38,7 @@ import { createIdGenerator } from "./id-generator.ts";
|
|
|
38
38
|
Import your own port. Only the wrapping file imports the library.
|
|
39
39
|
|
|
40
40
|
## Exceptions
|
|
41
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the wrapping boundary for that dependency. Use `file-carve-out` for debt in one file: it
|
|
41
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the wrapping boundary for that dependency. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
42
42
|
|
|
43
43
|
```json
|
|
44
44
|
{ "version": 1, "exceptions": [
|
|
@@ -46,4 +46,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
46
46
|
] }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-2/CHECKS.md
CHANGED
|
@@ -43,7 +43,7 @@ Parse or narrow the value so the type follows from a check rather than from an a
|
|
|
43
43
|
When handing a value across a boundary truly forces a cast, such as a library that types its schemas loosely or a database driver that returns unparsed rows, put the cast in the one adapter file at that boundary and record that file as an `authorised-location` with a why-chain. With clean boundaries that is one file and one record; casts scattered across many files are the sign the boundary is missing.
|
|
44
44
|
|
|
45
45
|
## Exceptions
|
|
46
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file sits on an external boundary that forces an assertion, such as an adapter. Use `file-carve-out` for debt in one file: it
|
|
46
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file sits on an external boundary that forces an assertion, such as an adapter. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
47
47
|
|
|
48
48
|
```json
|
|
49
49
|
{ "version": 1, "exceptions": [
|
|
@@ -53,4 +53,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
53
53
|
|
|
54
54
|
Records on `CD-2#non-null-assertions` take the same kinds. Existing `!` debt is usually a `file-carve-out` per file, or one `clause-wide-carve-out` while an assessment's steps pay it down. An `eslint-disable` naming `hone-cd2/no-restricted-syntax`, or naming no rule, is held only by an `authorised-location` or `file-carve-out` on this clause and its file; a `clause-wide-carve-out` does not hold it. The projection carries every record for it, so run `hone project` after recording one.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-23/CHECKS.md
CHANGED
|
@@ -24,7 +24,7 @@ This is `src/price.ts` with no `src/price.test.ts` beside it.
|
|
|
24
24
|
Add `src/price.test.ts` next to the file, with at least one test of its behaviour.
|
|
25
25
|
|
|
26
26
|
## Exceptions
|
|
27
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file only wires exports together and has no behaviour of its own to test. Use `file-carve-out` for debt in one file: it
|
|
27
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file only wires exports together and has no behaviour of its own to test. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
28
28
|
|
|
29
29
|
```json
|
|
30
30
|
{ "version": 1, "exceptions": [
|
|
@@ -32,4 +32,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
32
32
|
] }
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-25/CHECKS.md
CHANGED
|
@@ -27,7 +27,7 @@ const clock = { now: vi.fn().mockReturnValue(1) };
|
|
|
27
27
|
Return a canned value: that double is a stub. If the double needs logic, the seam is probably too wide, or the double is a fake that belongs in a shared in-memory implementation of the port with its own tests.
|
|
28
28
|
|
|
29
29
|
## Exceptions
|
|
30
|
-
A double that legitimately needs behaviour is a fake: write it once as an in-memory implementation of the port, in its own module with its own tests, and pass it in. That is the home for the behaviour, not an exception for a test file. For debt in one file, add a `file-carve-out` entry to `discipline-exceptions.json` at the repository root: it
|
|
30
|
+
A double that legitimately needs behaviour is a fake: write it once as an in-memory implementation of the port, in its own module with its own tests, and pass it in. That is the home for the behaviour, not an exception for a test file. For debt in one file, add a `file-carve-out` entry to `discipline-exceptions.json` at the repository root: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{ "version": 1, "exceptions": [
|
|
@@ -35,4 +35,4 @@ A double that legitimately needs behaviour is a fake: write it once as an in-mem
|
|
|
35
35
|
] }
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-26/CHECKS.md
CHANGED
|
@@ -25,7 +25,7 @@ const subject = createSubject({ store: storeStub });
|
|
|
25
25
|
Pass the collaborator in as a dependency and hand the test a stub.
|
|
26
26
|
|
|
27
27
|
## Exceptions
|
|
28
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs to intercept a module. Use `file-carve-out` for debt in one file: it
|
|
28
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs to intercept a module. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
29
29
|
|
|
30
30
|
```json
|
|
31
31
|
{ "version": 1, "exceptions": [
|
|
@@ -33,4 +33,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
33
33
|
] }
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-27/CHECKS.md
CHANGED
|
@@ -34,7 +34,7 @@ expect(ids).toEqual(["a1", "b2"]);
|
|
|
34
34
|
Write the expected value out. A method call in the act step is flagged too, so move such logic into the unit under test.
|
|
35
35
|
|
|
36
36
|
## Exceptions
|
|
37
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs logic. Use `file-carve-out` for debt in one file: it
|
|
37
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs logic. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
38
38
|
|
|
39
39
|
```json
|
|
40
40
|
{ "version": 1, "exceptions": [
|
|
@@ -42,4 +42,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
42
42
|
] }
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-3/CHECKS.md
CHANGED
|
@@ -31,7 +31,7 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
|
|
|
31
31
|
Put the flags in a shared base file that is not named `tsconfig.json`, and leave them out of every `tsconfig.json`. That the base file turns them on is left to review.
|
|
32
32
|
|
|
33
33
|
## Exceptions
|
|
34
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a package must set the flag itself. Use `file-carve-out` for debt in one file: it
|
|
34
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a package must set the flag itself. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
35
35
|
|
|
36
36
|
```json
|
|
37
37
|
{ "version": 1, "exceptions": [
|
|
@@ -39,4 +39,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
39
39
|
] }
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-40/CHECKS.md
CHANGED
|
@@ -28,7 +28,7 @@ const createOrder = ({ customerId, items, currency }: OrderRequest) => ({ custom
|
|
|
28
28
|
Take one object with named fields so each call site reads as a labelled contract.
|
|
29
29
|
|
|
30
30
|
## Exceptions
|
|
31
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must implement a callback signature fixed by an external library. Use `file-carve-out` for debt in one file: it
|
|
31
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must implement a callback signature fixed by an external library. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
32
32
|
|
|
33
33
|
```json
|
|
34
34
|
{ "version": 1, "exceptions": [
|
|
@@ -36,4 +36,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
36
36
|
] }
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-41/CHECKS.md
CHANGED
|
@@ -43,7 +43,7 @@ const settle = (orders: Order[]) => orders.filter(isPaid).forEach(refundEligible
|
|
|
43
43
|
Move each branch into a named helper so the orchestrator only composes calls.
|
|
44
44
|
|
|
45
45
|
## Exceptions
|
|
46
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file holds a function whose shape is fixed by an external contract. Use `file-carve-out` for debt in one file: it
|
|
46
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file holds a function whose shape is fixed by an external contract. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
47
47
|
|
|
48
48
|
```json
|
|
49
49
|
{ "version": 1, "exceptions": [
|
|
@@ -51,4 +51,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
51
51
|
] }
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-42/CHECKS.md
CHANGED
|
@@ -36,7 +36,7 @@ const label = (order: Order) => {
|
|
|
36
36
|
Handle the unhappy path first with an early return and leave the happy path as the final return.
|
|
37
37
|
|
|
38
38
|
## Exceptions
|
|
39
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep an else for an external reason. Use `file-carve-out` for debt in one file: it
|
|
39
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep an else for an external reason. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
40
40
|
|
|
41
41
|
```json
|
|
42
42
|
{ "version": 1, "exceptions": [
|
|
@@ -44,4 +44,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
44
44
|
] }
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-43/CHECKS.md
CHANGED
|
@@ -26,7 +26,7 @@ const render = (mode: "compact" | "full"): string => "";
|
|
|
26
26
|
Name each state in the type.
|
|
27
27
|
|
|
28
28
|
## Exceptions
|
|
29
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must follow an external interface that uses a boolean. Use `file-carve-out` for debt in one file: it
|
|
29
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must follow an external interface that uses a boolean. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{ "version": 1, "exceptions": [
|
|
@@ -34,4 +34,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
34
34
|
] }
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-44/CHECKS.md
CHANGED
|
@@ -37,7 +37,7 @@ const withTotal = (order: Order): Order => ({ ...order, total: 10 });
|
|
|
37
37
|
Copy before sorting or reversing: `[...items].sort()`.
|
|
38
38
|
|
|
39
39
|
## Exceptions
|
|
40
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must fill an output object supplied by an external API. Use `file-carve-out` for debt in one file: it
|
|
40
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must fill an output object supplied by an external API. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
41
41
|
|
|
42
42
|
```json
|
|
43
43
|
{ "version": 1, "exceptions": [
|
|
@@ -45,4 +45,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
45
45
|
] }
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-47/CHECKS.md
CHANGED
|
@@ -26,7 +26,7 @@ spawnSync("git", ["init"], { cwd: directory, env: hermeticGitEnvironment() });
|
|
|
26
26
|
Build the environment without inherited git variables or the user's configuration, and run in a temporary directory.
|
|
27
27
|
|
|
28
28
|
## Exceptions
|
|
29
|
-
Record exemptions only in `discipline-exceptions.json` at the repository root; core reads no other allowance file. Use `authorised-location` when a test file legitimately builds its environment another way. Use `file-carve-out` for debt in one file: it
|
|
29
|
+
Record exemptions only in `discipline-exceptions.json` at the repository root; core reads no other allowance file. Use `authorised-location` when a test file legitimately builds its environment another way. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{ "version": 1, "exceptions": [
|
|
@@ -34,4 +34,4 @@ Record exemptions only in `discipline-exceptions.json` at the repository root; c
|
|
|
34
34
|
] }
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-5/CHECKS.md
CHANGED
|
@@ -41,7 +41,7 @@ const first = items[0];
|
|
|
41
41
|
Remove the need for the directive. If it must stay, add a tracked reference to the work that removes it: `// biome-ignore lint/style/noNonNullAssertion: until items is typed as a non-empty tuple (#42)`. The reference satisfies this clause only. A directive that escapes a selected clause, such as an `eslint-disable` naming a selected rule or a `@ts-expect-error` under `CD-2#cast-expressions`, still needs a file record on that clause, and that record does not satisfy this clause.
|
|
42
42
|
|
|
43
43
|
## Exceptions
|
|
44
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file legitimately carries untracked directives, such as generated code. Use `file-carve-out` for debt in one file: it
|
|
44
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file legitimately carries untracked directives, such as generated code. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
45
45
|
|
|
46
46
|
```json
|
|
47
47
|
{ "version": 1, "exceptions": [
|
|
@@ -49,4 +49,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
49
49
|
] }
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-6/CHECKS.md
CHANGED
|
@@ -40,7 +40,7 @@ const account = await loadAccount(id);
|
|
|
40
40
|
Name the value for what it is in the domain.
|
|
41
41
|
|
|
42
42
|
## Exceptions
|
|
43
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep a name fixed by an external contract. Use `file-carve-out` for debt in one file: it
|
|
43
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep a name fixed by an external contract. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
{ "version": 1, "exceptions": [
|
|
@@ -48,4 +48,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
48
48
|
] }
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-7/CHECKS.md
CHANGED
|
@@ -35,7 +35,7 @@ src/price-formatting.ts
|
|
|
35
35
|
Rename the file or folder for what it contains, or split it into files that each hold one thing.
|
|
36
36
|
|
|
37
37
|
## Exceptions
|
|
38
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a path name is fixed by a framework or external convention. Use `file-carve-out` for debt in one file: it
|
|
38
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a path name is fixed by a framework or external convention. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
39
39
|
|
|
40
40
|
```json
|
|
41
41
|
{ "version": 1, "exceptions": [
|
|
@@ -43,4 +43,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
43
43
|
] }
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-7a/CHECKS.md
CHANGED
|
@@ -27,7 +27,7 @@ const createClient = (): Client => ({ send: () => undefined });
|
|
|
27
27
|
Declare and export the type, then annotate the factory with it.
|
|
28
28
|
|
|
29
29
|
## Exceptions
|
|
30
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when the type comes from a library whose package exports no named return type. Use `file-carve-out` for debt in one file: it
|
|
30
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when the type comes from a library whose package exports no named return type. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{ "version": 1, "exceptions": [
|
|
@@ -35,4 +35,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
35
35
|
] }
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|
package/rules/CD-8/CHECKS.md
CHANGED
|
@@ -31,7 +31,7 @@ switch (event.kind) {
|
|
|
31
31
|
Name each remaining variant so the compiler checks exhaustiveness.
|
|
32
32
|
|
|
33
33
|
## Exceptions
|
|
34
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a switch is over an open set of values and needs a fallback. Use `file-carve-out` for debt in one file: it
|
|
34
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a switch is over an open set of values and needs a fallback. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
35
35
|
|
|
36
36
|
```json
|
|
37
37
|
{ "version": 1, "exceptions": [
|
|
@@ -39,4 +39,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
39
39
|
] }
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
|