@hailstails/hone 2.0.0-pre.4 → 2.0.0-pre.6

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 (135) hide show
  1. package/ADOPTING.md +10 -19
  2. package/CHANGELOG.md +46 -0
  3. package/MIGRATING.md +25 -14
  4. package/README.md +3 -4
  5. package/chunks/chunk-2U5EKYGS.js +14348 -0
  6. package/chunks/{chunk-FPIP7JEC.js → chunk-4AJQHZ7I.js} +1 -1
  7. package/chunks/chunk-4PHKVNM3.js +2377 -0
  8. package/chunks/{chunk-CXM5KBZX.js → chunk-6LTJRJOE.js} +1 -1
  9. package/chunks/{chunk-PVSC4SE3.js → chunk-BISP2JOL.js} +4 -6
  10. package/chunks/{chunk-BRANVR7K.js → chunk-FRE5IA3C.js} +1 -1
  11. package/chunks/{chunk-E4D5WDRX.js → chunk-GMLT3MHO.js} +252 -254
  12. package/chunks/chunk-M4VSJ27S.js +139 -0
  13. package/chunks/{chunk-YGMO5Z6U.js → chunk-P2VHWLK4.js} +182 -193
  14. package/chunks/{chunk-LD766VWU.js → chunk-U6W65ZOF.js} +31 -2
  15. package/chunks/{chunk-BKQ3K766.js → chunk-WPEOCLTP.js} +39 -33
  16. package/chunks/{chunk-A3RL4O5V.js → chunk-XNIXPQQ5.js} +35 -2
  17. package/docs/extending.md +2 -2
  18. package/methods/lenses/function-first.md +2 -2
  19. package/package.json +1 -1
  20. package/rules/README.md +5 -3
  21. package/rules/SPIRIT.md +1 -1
  22. package/rules/numbers.md +4 -4
  23. package/rules/principles/no-leak-across-a-boundary.md +1 -1
  24. package/rules/principles.md +1 -1
  25. package/rules/record-kinds/authorised-location.md +1 -1
  26. package/rules/records.md +11 -19
  27. package/rules/rules.md +5 -5
  28. package/rules/sources.md +6 -7
  29. package/rules/typescript/checks.md +55 -387
  30. package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
  31. package/rules/typescript/recipes/assert-to-narrow.md +114 -4
  32. package/rules/typescript/recipes/closure-factory.md +5 -5
  33. package/rules/typescript/recipes/companion-test-file.md +5 -3
  34. package/rules/typescript/recipes/composed-orchestrator.md +6 -4
  35. package/rules/typescript/recipes/composition-root.md +5 -3
  36. package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
  37. package/rules/typescript/recipes/copy-never-write-in.md +6 -4
  38. package/rules/typescript/recipes/declared-not-bundled.md +5 -3
  39. package/rules/typescript/recipes/dependency-record.md +5 -3
  40. package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
  41. package/rules/typescript/recipes/entity-module.md +8 -5
  42. package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
  43. package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
  44. package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
  45. package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
  46. package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
  47. package/rules/typescript/recipes/functional-iteration.md +8 -3
  48. package/rules/typescript/recipes/guard-clauses.md +5 -3
  49. package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
  50. package/rules/typescript/recipes/integration-test-suffix.md +5 -3
  51. package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
  52. package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
  53. package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
  54. package/rules/typescript/recipes/named-exported-type.md +5 -3
  55. package/rules/typescript/recipes/narrow-ports.md +5 -3
  56. package/rules/typescript/recipes/one-argument-object.md +8 -3
  57. package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
  58. package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
  59. package/rules/typescript/recipes/repo-scripts-only.md +5 -3
  60. package/rules/typescript/recipes/result-union.md +5 -5
  61. package/rules/typescript/recipes/screaming-folders.md +5 -5
  62. package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
  63. package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
  64. package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
  65. package/rules/typescript/recipes/whole-words.md +5 -3
  66. package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
  67. package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
  68. package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
  69. package/rules/typescript/recipes.md +567 -21
  70. package/rules/typescript/symptoms/ambient-randomness.md +1 -1
  71. package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
  72. package/rules/typescript/symptoms/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site.md +1 -1
  73. package/rules/typescript/symptoms/{assertion-outside-a-test.md → assertion-outside-a-test-body.md} +1 -1
  74. package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
  75. package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
  76. package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
  77. package/rules/typescript/symptoms/{code-or-prose-read-as-text.md → code-or-prose-read-as-text-in-a-test.md} +2 -2
  78. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
  79. package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
  80. package/rules/typescript/symptoms/date-used-directly.md +1 -1
  81. package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
  82. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +1 -18
  83. package/rules/typescript/symptoms/double-with-a-body.md +1 -1
  84. package/rules/typescript/symptoms/{export-from-a-test-file.md → export-from-a-test.md} +1 -1
  85. package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
  86. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +1 -1
  87. package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
  88. package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
  89. package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
  90. package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
  91. package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
  92. package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
  93. package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
  94. package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
  95. package/rules/typescript/symptoms/process-global-used-in-place.md +1 -1
  96. package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
  97. package/rules/typescript/symptoms/rebinding.md +11 -1
  98. package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
  99. package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
  100. package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
  101. package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
  102. package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +1 -1
  103. package/rules/typescript/symptoms/unasserted-call.md +1 -1
  104. package/rules/typescript/symptoms.md +35 -35
  105. package/src/application/conformance/conformance-testing-types.d.ts +2 -0
  106. package/src/domain/language-layer/authored-item-types.d.ts +21 -5
  107. package/src/domain/runner/runner-result-types.d.ts +1 -2
  108. package/src/eslint-plugin.js +40 -38
  109. package/src/hone.js +15 -13638
  110. package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
  111. package/src/infrastructure/engines/eslint/runner/runner.js +56 -70
  112. package/src/infrastructure/engines/walker/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site/assertion-site.js +1 -1
  113. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +39 -65
  114. package/src/infrastructure/engines/walker/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read/raw-read.js +1 -1
  115. package/src/infrastructure/engines/walker/{export-from-a-test-file → export-from-a-test}/test-file-export/test-file-export.js +1 -1
  116. package/src/infrastructure/engines/walker/runner/runner.js +10 -10
  117. package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +3 -3
  118. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +15 -3
  119. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +118 -4
  120. package/src/measure-engines.process.js +80 -0
  121. package/src/testing.d.ts +1 -0
  122. package/src/testing.js +111 -26
  123. package/chunks/chunk-7FVSZ2VL.js +0 -1304
  124. package/chunks/chunk-BIDD2YWP.js +0 -398
  125. package/rules/record-kinds/boundary-record.md +0 -9
  126. package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
  127. package/rules/typescript/recipes/stub-with-vifn.md +0 -20
  128. /package/rules/typescript/symptoms/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read.md +0 -0
  129. /package/rules/typescript/symptoms/{export-from-a-test-file → export-from-a-test}/test-file-export.md +0 -0
  130. /package/src/infrastructure/engines/walker/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site/assertion-site.examples.json +0 -0
  131. /package/src/infrastructure/engines/walker/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site/piece.json +0 -0
  132. /package/src/infrastructure/engines/walker/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read/piece.json +0 -0
  133. /package/src/infrastructure/engines/walker/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read/raw-read.examples.json +0 -0
  134. /package/src/infrastructure/engines/walker/{export-from-a-test-file → export-from-a-test}/test-file-export/piece.json +0 -0
  135. /package/src/infrastructure/engines/walker/{export-from-a-test-file → export-from-a-test}/test-file-export/test-file-export.examples.json +0 -0
@@ -27,7 +27,7 @@
27
27
  "person"
28
28
  ],
29
29
  "recipes": [
30
- "port-in-the-domain"
30
+ "port-in-a-module-of-its-own"
31
31
  ],
32
32
  "correctUses": []
33
33
  }
@@ -43,7 +43,7 @@
43
43
  "correctUses": [
44
44
  {
45
45
  "situation": "correct use",
46
- "kind": "boundary-record",
46
+ "kind": "authorised-location",
47
47
  "at": "on the adapter that wraps the process"
48
48
  }
49
49
  ]
@@ -10,23 +10,6 @@
10
10
  `let` declarations in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
11
11
 
12
12
  ## Flags
13
- Edition 1:
14
- - `let` declarations.
15
-
16
- ## Allowed forms in a test
17
13
 
18
14
  ### A let
19
- ```ts
20
- declare const record: (store: { readonly save: (text: string) => void }) => void;
21
- let saved = "";
22
- record({ save: (text) => { saved = text; } });
23
- expect(saved).toBe("a");
24
- ```
25
- Record the calls with `vi.fn` and assert them:
26
-
27
- ```ts
28
- declare const record: (store: { readonly save: (text: string) => void }) => void;
29
- const save = vi.fn<(text: string) => void>();
30
- record({ save });
31
- expect(save).toHaveBeenCalledWith("a");
32
- ```
15
+ A `let` declaration. Edition 1.
@@ -20,6 +20,15 @@
20
20
  "rule": "doer-or-orchestrator"
21
21
  }
22
22
  ]
23
+ },
24
+ {
25
+ "case": "uses-what-a-collaborator-gives-back",
26
+ "situation": "in a test",
27
+ "points": [
28
+ {
29
+ "rule": "written-out-answers"
30
+ }
31
+ ]
23
32
  }
24
33
  ],
25
34
  "breachUsuallySits": "in the unit: no caller sees it, so on its own it shows no hidden effect, but it is suspect for work done inline in steps",
@@ -29,7 +38,8 @@
29
38
  "reports": "seen",
30
39
  "recipes": [
31
40
  "copy-never-write-in",
32
- "functional-iteration"
41
+ "functional-iteration",
42
+ "stub-with-vi-fn"
33
43
  ],
34
44
  "correctUses": []
35
45
  }
@@ -33,8 +33,8 @@
33
33
  "correctUses": [
34
34
  {
35
35
  "situation": "an outside model adopted as ours",
36
- "kind": "boundary-record",
37
- "at": "with a Conformist statement"
36
+ "kind": "authorised-location",
37
+ "at": "with a why-chain naming the outside model adopted as ours"
38
38
  }
39
39
  ]
40
40
  }
@@ -7,24 +7,9 @@
7
7
  }
8
8
  ```
9
9
 
10
- Edition 2: `JSON.stringify` and `JSON.parse` in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
10
+ JSON text made or read in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
11
11
 
12
12
  ## Flags
13
- Edition 2:
14
- - `JSON.stringify` and `JSON.parse`. A finding names [Serialising or parsing JSON](#serialising-or-parsing-json).
15
-
16
- ## Allowed forms in a test
17
13
 
18
14
  ### Serialising or parsing JSON
19
- ```ts
20
- declare const render: (row: { readonly id: string }) => string;
21
- expect(JSON.parse(render({ id: "a" }))).toEqual({ id: "a" });
22
- ```
23
- A finding on `JSON.stringify` or `JSON.parse` names this section. Assert the object the unit gives back, written out:
24
-
25
- ```ts
26
- declare const rowOf: (row: { readonly id: string }) => { readonly id: string };
27
- expect(rowOf({ id: "a" })).toEqual({ id: "a" });
28
- ```
29
-
30
- A unit that gives back only text should hand over an object, leaving the text to the adapter at its edge.
15
+ `JSON.stringify` or `JSON.parse`. Edition 2 adds it.
@@ -53,7 +53,7 @@
53
53
  "correctUses": [
54
54
  {
55
55
  "situation": "correct use",
56
- "kind": "boundary-record",
56
+ "kind": "authorised-location",
57
57
  "at": "on the adapter for whoever produced or receives the text"
58
58
  },
59
59
  {
@@ -10,30 +10,6 @@
10
10
  `try` statements in a test file. These run with the other [test-body checks](../../../README.md#checks-the-test-body-checks), which share their scope, editions and settings.
11
11
 
12
12
  ## Flags
13
- Edition 1:
14
- - `try` statements.
15
-
16
- ## Allowed forms in a test
17
13
 
18
14
  ### A try block
19
- ```ts
20
- declare const load: (path: string) => string;
21
- try {
22
- load("missing.json");
23
- } catch (error) {
24
- expect(error).toBeInstanceOf(Error);
25
- }
26
- ```
27
- Assert the throw:
28
-
29
- ```ts
30
- declare const load: (path: string) => string;
31
- expect(() => load("missing.json")).toThrow(Error);
32
- ```
33
-
34
- ```ts
35
- declare const loadLater: (path: string) => Promise<string>;
36
- it("refuses a missing file", async () => {
37
- await expect(loadLater("missing.json")).rejects.toThrow(Error);
38
- });
39
- ```
15
+ A `try` statement. Edition 1.
@@ -7,4 +7,4 @@
7
7
  }
8
8
  ```
9
9
 
10
- A test declares a type, interface or enum of its own. Import the contract owned by the unit or its boundary so the test and the unit rely on the same type. Module and global augmentations are allowed.
10
+ A test declares a type, interface or enum of its own. Import the contract owned by the unit or its boundary so the test and the unit rely on the same type. Module and global augmentations are allowed. So is a top-level `type`, not exported, used only as the `it.each` or `describe.each` row type: one flat object or tuple, readonly or not, whose members are primitives, types imported by name, or readonly lists of imported types.
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "reports": "seen",
24
24
  "recipes": [
25
- "stub-with-vifn"
25
+ "stub-with-vi-fn"
26
26
  ],
27
27
  "correctUses": []
28
28
  }
@@ -49,7 +49,7 @@
49
49
  - **Seen by:** types.
50
50
  - **Reports:** seen.
51
51
  - **Check today:** review.
52
- - **Recipes:** [Bounded context generic](recipes.md#bounded-context-generic); [Zod at the producer's adapter](recipes.md#zod-at-the-producers-adapter).
52
+ - **Recipes:** [Constrained context generic](recipes.md#constrained-context-generic); [Zod at the producer's adapter](recipes.md#zod-at-the-producers-adapter).
53
53
 
54
54
  ### Default on a closed union
55
55
 
@@ -128,18 +128,9 @@
128
128
  - **Seen by:** app.
129
129
  - **Reports:** seen.
130
130
  - **Check today:** review.
131
- - **Recipes:** [Port in the domain](recipes.md#port-in-the-domain).
131
+ - **Recipes:** [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
132
132
 
133
- ### Port named for a mechanism
134
-
135
- - **Seen:** A port named for a technology (`HttpClient`, `Fs`, `Sqlite`) rather than a capability.
136
- - **May indicate:** Uses a system or service outside the program → Ports declared inside; Names something → One word everywhere.
137
- - **Breach usually sits:** in the port.
138
- - **Seen by:** person.
139
- - **Check today:** only review.
140
- - **Recipes:** [Port in the domain](recipes.md#port-in-the-domain).
141
-
142
- ### Port outside the domain
133
+ ### Port beside its adapter
143
134
 
144
135
  - **Seen:** A port interface declared in an adapter's module, or beside its default adapter.
145
136
  - **May indicate:** Uses a system or service outside the program → Ports declared inside ("the port is domain and to be kept separate to the concrete implementation or use").
@@ -147,7 +138,16 @@
147
138
  - **Seen by:** graph.
148
139
  - **Reports:** seen.
149
140
  - **Check today:** review.
150
- - **Recipes:** [Port in the domain](recipes.md#port-in-the-domain).
141
+ - **Recipes:** [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
142
+
143
+ ### Port named for a mechanism
144
+
145
+ - **Seen:** A port named for a technology (`HttpClient`, `Fs`, `Sqlite`) rather than a capability.
146
+ - **May indicate:** Uses a system or service outside the program → Ports declared inside; Names something → One word everywhere.
147
+ - **Breach usually sits:** in the port.
148
+ - **Seen by:** person.
149
+ - **Check today:** only review.
150
+ - **Recipes:** [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
151
151
 
152
152
  ## The outside world reached directly
153
153
 
@@ -156,7 +156,7 @@
156
156
  - **Seen:** `Math.random()`, `crypto.randomUUID()` or `crypto.getRandomValues()` outside their adapter.
157
157
  - **May indicate:** Needs the current time, a random value, a new id or an outside ordering → Ports declared inside, Written-out answers.
158
158
  - **Breach usually sits:** in the unit that should be passed the value, often a doer doing two jobs.
159
- - **Covered by a record:** correct use: a boundary record on the adapter for random values or new ids.
159
+ - **Covered by a record:** correct use: an authorised location on the adapter for random values or new ids.
160
160
  - **Seen by:** syntax.
161
161
  - **Reports:** seen.
162
162
  - **Check today:** partial.
@@ -168,7 +168,7 @@
168
168
  - **Seen:** Any use of `Date` (`Date.now()`, `new Date()`, `new Date(value)`, `Date.parse`) or `performance.now()` outside the places that handle dates.
169
169
  - **May indicate:** Needs the current time, a random value, a new id or an outside ordering → Ports declared inside, Written-out answers; Does one job → Doer or orchestrator ("Dating and numbering an order is not the same job as charging it").
170
170
  - **Breach usually sits:** in the unit that should be passed the time, often a doer doing two jobs.
171
- - **Covered by a record:** correct use: a boundary record on the clock adapter.
171
+ - **Covered by a record:** correct use: an authorised location on the clock adapter.
172
172
  - **Seen by:** syntax.
173
173
  - **Reports:** seen.
174
174
  - **To name the breach, a check needs:** person.
@@ -181,7 +181,7 @@
181
181
  - **Seen:** `new` on a class from an outside dependency, outside that dependency's adapter.
182
182
  - **May indicate:** Takes an outside dependency → Outside dependencies stay at boundaries; Keeps state or settings across calls → No hidden effects.
183
183
  - **Breach usually sits:** at a missing adapter.
184
- - **Covered by a record:** correct use: a boundary record on that dependency's adapter.
184
+ - **Covered by a record:** correct use: an authorised location on that dependency's adapter.
185
185
  - **Seen by:** types.
186
186
  - **Reports:** seen.
187
187
  - **Check today:** review.
@@ -189,22 +189,22 @@
189
189
 
190
190
  ### Outside import past a boundary
191
191
 
192
- - **Seen:** An import, `import()` or `require` of an outside dependency or runtime module (`node:*`) in a file with no boundary record.
192
+ - **Seen:** An import, `import()` or `require` of an outside dependency or runtime module (`node:*`) in a file with no authorised location for that outside party.
193
193
  - **May indicate:** Uses a system or service outside the program → Outside dependencies stay at boundaries, Ports declared inside; Takes an outside dependency → Outside dependencies stay at boundaries.
194
194
  - **Breach usually sits:** at a missing adapter and port.
195
- - **Covered by a record:** correct use: a boundary record on the adapter for that outside party.
195
+ - **Covered by a record:** correct use: an authorised location on the adapter for that outside party.
196
196
  - **Seen by:** graph.
197
197
  - **Reports:** seen.
198
198
  - **Check today:** partial.
199
199
  - **Checks:** [import-or-require](symptoms/outside-import-past-a-boundary/import-or-require.md).
200
- - **Recipes:** [Adapter per outside party](recipes.md#adapter-per-outside-party); [Port in the domain](recipes.md#port-in-the-domain).
200
+ - **Recipes:** [Adapter per outside party](recipes.md#adapter-per-outside-party); [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
201
201
 
202
202
  ### Outside type in a signature
203
203
 
204
204
  - **Seen:** A type from an outside dependency or runtime library in a business-logic parameter, field or return, imported or inferred.
205
205
  - **May indicate:** Uses a system or service outside the program → Outside dependencies stay at boundaries, No leak across a boundary.
206
206
  - **Breach usually sits:** in the adapter that hands the outside type inward.
207
- - **Covered by a record:** correct use: a boundary record on the adapter, or beyond it with a Conformist statement for an outside model adopted as ours.
207
+ - **Covered by a record:** correct use: an authorised location on the adapter, or beyond it with a why-chain naming the outside model adopted as ours.
208
208
  - **Seen by:** types.
209
209
  - **Reports:** seen → breach.
210
210
  - **The breach a check could name:** the adapter that returns it, by types.
@@ -216,7 +216,7 @@
216
216
  - **Seen:** `process.env`, `process.argv`, `process.exit`, `process.on`, `console.*`, `globalThis`, `alert`, `confirm`, `prompt` or a `debugger` statement outside an adapter.
217
217
  - **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Causes an effect (writes, logs, sends, exits) → Ports declared inside; Builds the real implementations → Ports declared inside.
218
218
  - **Breach usually sits:** at a missing port, or at an adapter not built at the entry point.
219
- - **Covered by a record:** correct use: a boundary record on the adapter that wraps the process.
219
+ - **Covered by a record:** correct use: an authorised location on the adapter that wraps the process.
220
220
  - **Seen by:** syntax.
221
221
  - **Reports:** seen.
222
222
  - **Check today:** partial.
@@ -240,7 +240,7 @@
240
240
 
241
241
  "Nothing wrong with a reset in after each. But something wrong with a remock in after each. Implies the suite knows the input needed for each test." Sharing alone is not the breach: "I have no issue with shared boilerplate or even mock builders when it doesn't hide minimal interfaces issues and doesn't hide assumptions or coupling between tests. But it often does when not done with care."
242
242
 
243
- ### Assertion outside a test
243
+ ### Assertion outside a test body
244
244
 
245
245
  - **Seen:** An assertion outside a function passed to an it or test call.
246
246
  - **May indicate:** States what the unit gives back, for one case or several → Straight-through tests.
@@ -248,7 +248,7 @@
248
248
  - **Seen by:** syntax.
249
249
  - **Reports:** seen.
250
250
  - **Check today:** partial.
251
- - **Checks:** [assertion-site](symptoms/assertion-outside-a-test/assertion-site.md).
251
+ - **Checks:** [assertion-site](symptoms/assertion-outside-a-test-body/assertion-site.md).
252
252
 
253
253
  ### Behaviour tested away from its owner
254
254
 
@@ -262,7 +262,7 @@
262
262
  ### Branch in a test
263
263
 
264
264
  - **Seen:** `if`, a ternary, `&&`, `||`, `??`, `?.` or `switch` in a test file.
265
- - **May indicate:** Checks a value that may be one of several outcomes → Straight-through tests; A value is one of several kinds or states: the unit's output → Kinds are named; An operation can fail: the unit's output → Failures are values.
265
+ - **May indicate:** Checks a value that may be one of several outcomes → Straight-through tests; A value is one of several kinds or states: the unit's output → Kinds are named; An operation can fail: the unit's output → Failures are values; Uses what a collaborator gives back: reads a double's recorded calls or results → Written-out answers.
266
266
  - **Breach usually sits:** in the unit's output type, where optional or loose shapes force the test to branch.
267
267
  - **Seen by:** syntax.
268
268
  - **Reports:** seen → breach.
@@ -270,18 +270,18 @@
270
270
  - **To name the breach, a check needs:** types: the declaring type of the member read.
271
271
  - **Check today:** reuse.
272
272
  - **Checks:** [test-body](symptoms/branch-in-a-test/test-body.md).
273
- - **Recipes:** [Assert to narrow](recipes.md#assert-to-narrow); [it.each over typed rows](recipes.md#iteach-over-typed-rows).
273
+ - **Recipes:** [Assert to narrow](recipes.md#assert-to-narrow); [it.each over typed rows](recipes.md#iteach-over-typed-rows); [Stub with vi.fn](recipes.md#stub-with-vifn).
274
274
 
275
- ### Code or prose read as text
275
+ ### Code or prose read as text in a test
276
276
 
277
277
  - **Seen:** A test reads TypeScript or Markdown source through a file read, a raw import, or a raw glob.
278
278
  - **May indicate:** States what the unit gives back, for one case or several → Tests are ours.
279
- - **Breach usually sits:** in a test that checks the words in a file instead of the code behavior.
279
+ - **Breach usually sits:** in a test that checks the words in a file instead of the code behaviour.
280
280
  - **Covered by a record:** parsing source to verify its syntax or toolchain compatibility: an authorised location at the test that owns that proof.
281
281
  - **Seen by:** syntax.
282
282
  - **Reports:** seen.
283
283
  - **Check today:** partial.
284
- - **Checks:** [raw-read](symptoms/code-or-prose-read-as-text/raw-read.md).
284
+ - **Checks:** [raw-read](symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md).
285
285
 
286
286
  ### Computed value in a test
287
287
 
@@ -320,7 +320,7 @@
320
320
 
321
321
  "Exact returns can use mockreturn or mockresolve".
322
322
 
323
- ### Export from a test file
323
+ ### Export from a test
324
324
 
325
325
  - **Seen:** An export declaration, assignment or modifier in a test file, including a type export.
326
326
  - **May indicate:** States what the unit gives back, for one case or several → Straight-through tests; Gives each unit its test → Tested where it's owned.
@@ -328,7 +328,7 @@
328
328
  - **Seen by:** syntax.
329
329
  - **Reports:** seen.
330
330
  - **Check today:** partial.
331
- - **Checks:** [test-file-export](symptoms/export-from-a-test-file/test-file-export.md).
331
+ - **Checks:** [test-file-export](symptoms/export-from-a-test/test-file-export.md).
332
332
 
333
333
  ### Inherited environment in a subprocess
334
334
 
@@ -488,13 +488,13 @@
488
488
  ### Rebinding
489
489
 
490
490
  - **Seen:** A `let` assigned again, or a parameter reassigned, incremented or destructured into.
491
- - **May indicate:** Makes a new value from what it has → No hidden effects; Does one job → Doer or orchestrator.
491
+ - **May indicate:** Makes a new value from what it has → No hidden effects; Does one job → Doer or orchestrator; Uses what a collaborator gives back: in a test → Written-out answers.
492
492
  - **Breach usually sits:** in the unit: no caller sees it, so on its own it shows no hidden effect, but it is suspect for work done inline in steps.
493
493
  - **Seen by:** syntax.
494
494
  - **Reports:** seen.
495
495
  - **Check today:** partial.
496
496
  - **Checks:** [parameter-reassignment](symptoms/rebinding/parameter-reassignment.md), [test-body](symptoms/rebinding/test-body.md).
497
- - **Recipes:** [Copy, never write in](recipes.md#copy-never-write-in); [Functional iteration](recipes.md#functional-iteration).
497
+ - **Recipes:** [Copy, never write in](recipes.md#copy-never-write-in); [Functional iteration](recipes.md#functional-iteration); [Stub with vi.fn](recipes.md#stub-with-vifn).
498
498
 
499
499
  ### Write into a parameter
500
500
 
@@ -716,7 +716,7 @@
716
716
  - **May indicate:** An operation can fail → Failures are values.
717
717
  - **Breach usually sits:** in the unit's return type.
718
718
  - **Seen by:** person, syntax.
719
- - **How it is seen:** syntax for a `catch` that returns.
719
+ - **How it is seen:** syntax for an empty `catch` block or promise rejection handler.
720
720
  - **Check today:** partial.
721
721
  - **Checks:** [empty-catch](symptoms/failure-shaped-as-success/empty-catch.md).
722
722
  - **Recipes:** [Result union](recipes.md#result-union).
@@ -859,7 +859,7 @@
859
859
  - **Seen:** A schema, a `.parse` call or a `z.infer` type outside the producer's adapter, or the same value parsed twice.
860
860
  - **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Gives a value its type (declares it, or needs it narrower) → Declared, not asserted.
861
861
  - **Breach usually sits:** in the adapter, which hands the wire type inward instead of mapping it.
862
- - **Covered by a record:** an outside model adopted as ours: a boundary record with a Conformist statement.
862
+ - **Covered by a record:** an outside model adopted as ours: an authorised location with a why-chain naming the outside model adopted as ours.
863
863
  - **Seen by:** graph.
864
864
  - **Reports:** seen.
865
865
  - **Check today:** review.
@@ -870,7 +870,7 @@
870
870
  - **Seen:** `JSON.parse`, `JSON.stringify` or a YAML parse or dump outside the adapter for whoever produced or receives the text, tests included.
871
871
  - **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Sends data out of the program → No leak across a boundary; Uses a system or service outside the program → External behaviour sits at a boundary; States what the unit gives back, for one case or several → Straight-through tests.
872
872
  - **Breach usually sits:** in a port that takes or gives text where it should carry objects.
873
- - **Covered by a record:** correct use: a boundary record on the adapter for whoever produced or receives the text; a use at one test site: an authorised location for this symptom alone.
873
+ - **Covered by a record:** correct use: an authorised location on the adapter for whoever produced or receives the text; a use at one test site: an authorised location for this symptom alone.
874
874
  - **Seen by:** syntax, types.
875
875
  - **Reports:** seen → breach.
876
876
  - **How it is seen:** types to trace the port.
@@ -4,6 +4,7 @@ import type { Result } from "../../domain/result.js";
4
4
  import type { ToolRuleSet } from "../../domain/rule-set/clause-address-types.js";
5
5
  import type { Edition } from "../../domain/rule-set/edition-types.js";
6
6
  import type { EngineId } from "../../domain/rule-set/identifier-types.js";
7
+ import type { CheckBinding } from "../../domain/runner/check-binding.js";
7
8
  import type { CheckConformanceFailure } from "../../domain/runner/conformance-types.js";
8
9
  export type { CheckConformanceFailure } from "../../domain/runner/conformance-types.js";
9
10
  export type TeamRuleSetUnderTest = {
@@ -28,6 +29,7 @@ export type CaseUnderTest = {
28
29
  readonly edition: Edition;
29
30
  };
30
31
  export type CheckUnderTest = CheckRequest & {
32
+ readonly binding: CheckBinding;
31
33
  readonly examples: readonly CaseUnderTest[];
32
34
  };
33
35
  export type CheckConformanceOf = (request: CheckRequest) => Promise<Result<readonly CheckConformanceFailure[], ConformanceSetupFailure>>;
@@ -1,5 +1,6 @@
1
1
  export type Standing = "accepted" | "proposed";
2
- export type RecordKindName = "authorised-location" | "deviation" | "debt" | "boundary-record" | "dependency-record";
2
+ export type RecordKindName = "authorised-location" | "deviation" | "debt" | "dependency-record";
3
+ export type Specific = "outside-party";
3
4
  export type SeenBy = "syntax" | "types" | "graph" | "app" | "files" | "history" | "person";
4
5
  export type AuthoredPointed = {
5
6
  readonly rule: string;
@@ -10,13 +11,22 @@ export type CaseItem = {
10
11
  readonly standing: Standing;
11
12
  readonly owes: readonly AuthoredPointed[];
12
13
  };
14
+ export type AuthoredAnswer = {
15
+ readonly check: string;
16
+ readonly form: string;
17
+ };
18
+ export type AuthoredRecipeExample = {
19
+ readonly anchor: string;
20
+ readonly answers: readonly AuthoredAnswer[];
21
+ };
13
22
  export type RecipeItem = {
14
- readonly serves: AuthoredPointed;
23
+ readonly serves: readonly AuthoredPointed[];
15
24
  readonly standing: Standing;
16
25
  readonly reason: {
17
26
  readonly text: string;
18
27
  readonly standing: Standing;
19
28
  };
29
+ readonly examples?: readonly AuthoredRecipeExample[] | undefined;
20
30
  };
21
31
  export type RecordKindItem = {
22
32
  readonly phrase: string;
@@ -34,16 +44,22 @@ export type SymptomItem = {
34
44
  readonly seenBy: readonly SeenBy[];
35
45
  readonly reports?: "seen" | "seen-to-breach" | undefined;
36
46
  readonly recipes: readonly string[];
37
- readonly correctUses: readonly {
47
+ readonly correctUses: readonly ({
38
48
  readonly situation: string;
39
- readonly kind: RecordKindName;
49
+ readonly kind: "authorised-location";
40
50
  readonly at?: string | undefined;
41
- }[];
51
+ readonly binds?: readonly Specific[] | undefined;
52
+ } | {
53
+ readonly situation: string;
54
+ readonly kind: Exclude<RecordKindName, "authorised-location">;
55
+ readonly at?: string | undefined;
56
+ })[];
42
57
  readonly howItIsSeen?: string | undefined;
43
58
  readonly breachACheckCouldName?: string | undefined;
44
59
  readonly toNameTheBreach?: string | undefined;
45
60
  };
46
61
  export type CheckItem = {
62
+ readonly findingSpecifics?: readonly Specific[] | undefined;
47
63
  readonly flagsBeyondTheSymptom?: string | undefined;
48
64
  readonly misses?: string | undefined;
49
65
  readonly settingsTracedTo?: string | undefined;
@@ -3,8 +3,7 @@ import type { RepoPath } from "../repository/repo-path-types.js";
3
3
  import type { ClauseAddress } from "../rule-set/clause-address-types.js";
4
4
  export type Remedy = {
5
5
  readonly fix: string;
6
- readonly page: string;
7
- readonly section: string;
6
+ readonly form: string;
8
7
  };
9
8
  export type MeasuredPair = {
10
9
  readonly clause: ClauseAddress;
@@ -1,68 +1,70 @@
1
- import {
2
- SYMPTOM_CATALOGUE_SEGMENTS,
3
- readBoundCatalogue
4
- } from "../chunks/chunk-7FVSZ2VL.js";
5
- import {
6
- installRootOfApiEntry,
7
- loadFailureText
8
- } from "../chunks/chunk-A3RL4O5V.js";
9
1
  import {
10
2
  honePluginAt,
11
3
  honePluginFailureText,
12
4
  installedEslintBoundary
13
- } from "../chunks/chunk-E4D5WDRX.js";
14
- import "../chunks/chunk-LD766VWU.js";
15
- import "../chunks/chunk-FPIP7JEC.js";
16
- import "../chunks/chunk-BRANVR7K.js";
17
- import "../chunks/chunk-CXM5KBZX.js";
5
+ } from "../chunks/chunk-GMLT3MHO.js";
6
+ import "../chunks/chunk-6LTJRJOE.js";
7
+ import {
8
+ createBoundCatalogueOf,
9
+ mapCataloguesToEngineChecks,
10
+ runLoadFailureLine,
11
+ toolCatalogueOf
12
+ } from "../chunks/chunk-4PHKVNM3.js";
13
+ import {
14
+ installRootOfApiEntry,
15
+ loadFailureText
16
+ } from "../chunks/chunk-XNIXPQQ5.js";
17
+ import "../chunks/chunk-U6W65ZOF.js";
18
+ import "../chunks/chunk-4AJQHZ7I.js";
19
+ import "../chunks/chunk-FRE5IA3C.js";
18
20
  import {
19
21
  TOOL_IDENTITY,
20
- TOOL_RULE_SET,
21
22
  createDefaultDirectoryPort,
22
23
  createDefaultFileTextPort,
23
24
  createDefaultModuleLoaderPort,
24
25
  createDefaultPathPort
25
- } from "../chunks/chunk-BKQ3K766.js";
26
+ } from "../chunks/chunk-WPEOCLTP.js";
26
27
  import "../chunks/chunk-YONPKP3C.js";
27
28
  import "../chunks/chunk-OO5KV7KN.js";
28
29
  import "../chunks/chunk-RANIXNWY.js";
29
30
  import "../chunks/chunk-DGOLOS5A.js";
30
31
 
32
+ // src/application/run/engines/tool-engine-checks.ts
33
+ var mapToolCatalogueToEngineChecks = (request) => {
34
+ const catalogue = toolCatalogueOf(request);
35
+ return catalogue.outcome === "failed" ? catalogue : mapCataloguesToEngineChecks({ catalogues: [catalogue.value] });
36
+ };
37
+
38
+ // src/infrastructure/engines/eslint/runner/hone-plugin/plugin-build.ts
39
+ var createPluginAt = async (request) => {
40
+ const boundary = await installedEslintBoundary();
41
+ if (boundary.outcome === "failed") {
42
+ return boundary;
43
+ }
44
+ const plugin2 = await honePluginAt({ ...request, boundary: boundary.value });
45
+ return plugin2.outcome === "failed" ? { outcome: "failed", error: honePluginFailureText({ failure: plugin2.error }) } : plugin2;
46
+ };
47
+
31
48
  // src/eslint-plugin.ts
32
49
  var path = createDefaultPathPort({});
33
50
  var fileText = createDefaultFileTextPort({});
34
51
  var pluginAt = async (request) => {
35
- const catalogue = readBoundCatalogue({
52
+ const checks = mapToolCatalogueToEngineChecks({
36
53
  fileText,
37
- directory: createDefaultDirectoryPort({}),
38
54
  path,
39
- ruleSetRoot: request.installRoot,
40
- ruleSet: TOOL_RULE_SET,
41
55
  installRoot: request.installRoot,
42
- inheritedRecordKinds: []
56
+ boundCatalogueOf: createBoundCatalogueOf({ directory: createDefaultDirectoryPort({}) })
43
57
  });
44
- if (catalogue.outcome === "failed") {
45
- return { outcome: "failed", error: loadFailureText({ failure: catalogue.error }) };
46
- }
47
- if (catalogue.value.held === "none") {
48
- return {
49
- outcome: "failed",
50
- error: `this install holds no ${SYMPTOM_CATALOGUE_SEGMENTS.join("/")} under ${request.installRoot}`
51
- };
52
- }
53
- const boundary = await installedEslintBoundary();
54
- if (boundary.outcome === "failed") {
55
- return boundary;
56
- }
57
- const plugin2 = await honePluginAt({
58
- checks: catalogue.value.catalogue.checks,
58
+ return checks.outcome === "failed" ? {
59
+ outcome: "failed",
60
+ error: runLoadFailureLine({ failure: checks.error, upgradeCommand: void 0 })
61
+ } : createPluginAt({
62
+ checks: checks.value,
59
63
  installRoot: request.installRoot,
60
64
  fileText,
61
65
  path,
62
- modules: createDefaultModuleLoaderPort({}),
63
- boundary: boundary.value
66
+ modules: createDefaultModuleLoaderPort({})
64
67
  });
65
- return plugin2.outcome === "failed" ? { outcome: "failed", error: honePluginFailureText({ failure: plugin2.error }) } : plugin2;
66
68
  };
67
69
  var installRoot = installRootOfApiEntry({ path, moduleUrl: import.meta.url });
68
70
  var built = installRoot.outcome === "failed" ? { outcome: "failed", error: loadFailureText({ failure: installRoot.error }) } : await pluginAt({ installRoot: installRoot.value });