@hailstails/hone 0.0.0-stage → 0.1.0-pre.3

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 (186) hide show
  1. package/ADOPTING.md +314 -0
  2. package/LICENSE +17 -0
  3. package/MIGRATING.md +238 -0
  4. package/README.md +219 -2
  5. package/THIRD-PARTY-NOTICES.md +354 -0
  6. package/chunks/chunk-233U4FBA.js +42 -0
  7. package/chunks/chunk-7ZJZZBSS.js +14909 -0
  8. package/chunks/chunk-HBY4ZWSP.js +79 -0
  9. package/chunks/chunk-HJA4CX7C.js +24 -0
  10. package/chunks/chunk-NZLE2WMY.js +35 -0
  11. package/chunks/chunk-QWA6OVLC.js +11 -0
  12. package/chunks/chunk-TRCB27ET.js +202 -0
  13. package/core/check/tool-command.js +2305 -0
  14. package/docs/adding-a-discipline-or-mechanism.md +195 -0
  15. package/docs/why-chain-contract.md +78 -0
  16. package/mechanisms/audit/CD-1/any-cast.js +81 -0
  17. package/mechanisms/audit/CD-1/piece.json +13 -0
  18. package/mechanisms/audit/CD-10/piece.json +13 -0
  19. package/mechanisms/audit/CD-10/throws-in-tests.js +49 -0
  20. package/mechanisms/audit/CD-14/class-syntax.js +70 -0
  21. package/mechanisms/audit/CD-14/piece.json +13 -0
  22. package/mechanisms/audit/CD-15/loops.js +40 -0
  23. package/mechanisms/audit/CD-15/piece.json +13 -0
  24. package/mechanisms/audit/CD-17/clock-sources.js +29 -0
  25. package/mechanisms/audit/CD-17/piece.json +13 -0
  26. package/mechanisms/audit/CD-19/import-boundaries.js +80 -0
  27. package/mechanisms/audit/CD-19/piece.json +13 -0
  28. package/mechanisms/audit/CD-2/cast-expressions.js +81 -0
  29. package/mechanisms/audit/CD-2/piece.json +13 -0
  30. package/mechanisms/audit/CD-23/export-test-sibling.js +56 -0
  31. package/mechanisms/audit/CD-23/piece.json +13 -0
  32. package/mechanisms/audit/CD-25/dependency-isolation.js +53 -0
  33. package/mechanisms/audit/CD-25/piece.json +13 -0
  34. package/mechanisms/audit/CD-26/module-mocking.js +51 -0
  35. package/mechanisms/audit/CD-26/piece.json +13 -0
  36. package/mechanisms/audit/CD-27/piece.json +13 -0
  37. package/mechanisms/audit/CD-27/test-body-logic.js +107 -0
  38. package/mechanisms/audit/CD-3/compiler-overrides.js +955 -0
  39. package/mechanisms/audit/CD-3/piece.json +49 -0
  40. package/mechanisms/audit/CD-43/boolean-signatures.js +55 -0
  41. package/mechanisms/audit/CD-43/piece.json +13 -0
  42. package/mechanisms/audit/CD-44/parameter-mutation.js +92 -0
  43. package/mechanisms/audit/CD-44/piece.json +13 -0
  44. package/mechanisms/audit/CD-47/hermetic-git-spawns.js +44 -0
  45. package/mechanisms/audit/CD-47/piece.json +13 -0
  46. package/mechanisms/audit/CD-5/comments-directives.js +73 -0
  47. package/mechanisms/audit/CD-5/piece.json +13 -0
  48. package/mechanisms/audit/CD-6/identifier-names.js +132 -0
  49. package/mechanisms/audit/CD-6/piece.json +13 -0
  50. package/mechanisms/audit/CD-7/categorical-paths.js +55 -0
  51. package/mechanisms/audit/CD-7/piece.json +13 -0
  52. package/mechanisms/audit/CD-7a/factory-return-types.js +42 -0
  53. package/mechanisms/audit/CD-7a/piece.json +13 -0
  54. package/mechanisms/audit/CD-8/piece.json +13 -0
  55. package/mechanisms/audit/CD-8/switch-defaults.js +43 -0
  56. package/mechanisms/audit/runner/README.md +38 -0
  57. package/mechanisms/audit/runner/runner.js +546 -0
  58. package/mechanisms/eslint/CD-1/README.md +12 -0
  59. package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +50 -0
  60. package/mechanisms/eslint/CD-1/piece.json +23 -0
  61. package/mechanisms/eslint/CD-10/README.md +9 -0
  62. package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +55 -0
  63. package/mechanisms/eslint/CD-10/piece.json +15 -0
  64. package/mechanisms/eslint/CD-14/README.md +11 -0
  65. package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +88 -0
  66. package/mechanisms/eslint/CD-14/piece.json +31 -0
  67. package/mechanisms/eslint/CD-27/README.md +12 -0
  68. package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +83 -0
  69. package/mechanisms/eslint/CD-27/piece.json +23 -0
  70. package/mechanisms/eslint/CD-40/README.md +7 -0
  71. package/mechanisms/eslint/CD-40/cd40/cd40.eslint-plugin.js +16 -0
  72. package/mechanisms/eslint/CD-40/piece.json +21 -0
  73. package/mechanisms/eslint/CD-41/README.md +12 -0
  74. package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +228 -0
  75. package/mechanisms/eslint/CD-41/piece.json +23 -0
  76. package/mechanisms/eslint/CD-42/README.md +9 -0
  77. package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +75 -0
  78. package/mechanisms/eslint/CD-42/piece.json +15 -0
  79. package/mechanisms/eslint/CD-44/README.md +7 -0
  80. package/mechanisms/eslint/CD-44/cd44/cd44.eslint-plugin.js +16 -0
  81. package/mechanisms/eslint/CD-44/piece.json +20 -0
  82. package/mechanisms/eslint/CD-6/README.md +9 -0
  83. package/mechanisms/eslint/CD-6/cd6/cd6.eslint-plugin.js +16 -0
  84. package/mechanisms/eslint/CD-6/piece.json +217 -0
  85. package/mechanisms/eslint/CD-7/README.md +9 -0
  86. package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +52 -0
  87. package/mechanisms/eslint/CD-7/piece.json +15 -0
  88. package/mechanisms/eslint/runner/README.md +43 -0
  89. package/mechanisms/eslint/runner/runner.js +4248 -0
  90. package/methods/README.md +18 -0
  91. package/methods/lenses/clean-architecture.md +167 -0
  92. package/methods/lenses/decomposition.md +159 -0
  93. package/methods/lenses/defended-on-intent.md +178 -0
  94. package/methods/lenses/di-discipline.md +156 -0
  95. package/methods/lenses/errors-as-data.md +88 -0
  96. package/methods/lenses/function-first.md +193 -0
  97. package/methods/lenses/naming.md +127 -0
  98. package/methods/lenses/test-discipline.md +166 -0
  99. package/methods/lenses/type-soundness.md +135 -0
  100. package/methods/lenses/zod-boundary.md +158 -0
  101. package/package.json +65 -4
  102. package/rules/CD-1/README.md +43 -0
  103. package/rules/CD-1/discipline.json +185 -0
  104. package/rules/CD-10/README.md +55 -0
  105. package/rules/CD-10/discipline.json +133 -0
  106. package/rules/CD-11/README.md +19 -0
  107. package/rules/CD-11/discipline.json +12 -0
  108. package/rules/CD-12/README.md +19 -0
  109. package/rules/CD-12/discipline.json +12 -0
  110. package/rules/CD-13/README.md +19 -0
  111. package/rules/CD-13/discipline.json +12 -0
  112. package/rules/CD-14/README.md +54 -0
  113. package/rules/CD-14/discipline.json +173 -0
  114. package/rules/CD-15/README.md +48 -0
  115. package/rules/CD-15/discipline.json +73 -0
  116. package/rules/CD-16/README.md +17 -0
  117. package/rules/CD-17/README.md +42 -0
  118. package/rules/CD-17/discipline.json +51 -0
  119. package/rules/CD-18/README.md +19 -0
  120. package/rules/CD-18/discipline.json +12 -0
  121. package/rules/CD-19/README.md +45 -0
  122. package/rules/CD-19/discipline.json +65 -0
  123. package/rules/CD-2/README.md +43 -0
  124. package/rules/CD-2/discipline.json +65 -0
  125. package/rules/CD-20/README.md +17 -0
  126. package/rules/CD-21/README.md +19 -0
  127. package/rules/CD-21/discipline.json +12 -0
  128. package/rules/CD-22/README.md +19 -0
  129. package/rules/CD-22/discipline.json +12 -0
  130. package/rules/CD-23/README.md +41 -0
  131. package/rules/CD-23/discipline.json +57 -0
  132. package/rules/CD-24/README.md +17 -0
  133. package/rules/CD-25/README.md +43 -0
  134. package/rules/CD-25/discipline.json +57 -0
  135. package/rules/CD-26/README.md +42 -0
  136. package/rules/CD-26/discipline.json +57 -0
  137. package/rules/CD-27/README.md +51 -0
  138. package/rules/CD-27/discipline.json +233 -0
  139. package/rules/CD-28/README.md +19 -0
  140. package/rules/CD-28/discipline.json +12 -0
  141. package/rules/CD-29/README.md +19 -0
  142. package/rules/CD-29/discipline.json +12 -0
  143. package/rules/CD-3/README.md +48 -0
  144. package/rules/CD-3/discipline.json +363 -0
  145. package/rules/CD-30/README.md +19 -0
  146. package/rules/CD-30/discipline.json +12 -0
  147. package/rules/CD-31/README.md +19 -0
  148. package/rules/CD-31/discipline.json +12 -0
  149. package/rules/CD-32/README.md +19 -0
  150. package/rules/CD-32/discipline.json +12 -0
  151. package/rules/CD-33/README.md +19 -0
  152. package/rules/CD-33/discipline.json +12 -0
  153. package/rules/CD-34/README.md +19 -0
  154. package/rules/CD-34/discipline.json +12 -0
  155. package/rules/CD-39/README.md +19 -0
  156. package/rules/CD-39/discipline.json +12 -0
  157. package/rules/CD-4/README.md +19 -0
  158. package/rules/CD-4/discipline.json +12 -0
  159. package/rules/CD-40/README.md +45 -0
  160. package/rules/CD-40/discipline.json +58 -0
  161. package/rules/CD-41/README.md +60 -0
  162. package/rules/CD-41/discipline.json +124 -0
  163. package/rules/CD-42/README.md +53 -0
  164. package/rules/CD-42/discipline.json +61 -0
  165. package/rules/CD-43/README.md +43 -0
  166. package/rules/CD-43/discipline.json +65 -0
  167. package/rules/CD-44/README.md +54 -0
  168. package/rules/CD-44/discipline.json +111 -0
  169. package/rules/CD-45/README.md +19 -0
  170. package/rules/CD-45/discipline.json +12 -0
  171. package/rules/CD-46/README.md +13 -0
  172. package/rules/CD-47/README.md +47 -0
  173. package/rules/CD-47/discipline.json +57 -0
  174. package/rules/CD-5/README.md +46 -0
  175. package/rules/CD-5/discipline.json +65 -0
  176. package/rules/CD-6/README.md +57 -0
  177. package/rules/CD-6/discipline.json +165 -0
  178. package/rules/CD-7/README.md +52 -0
  179. package/rules/CD-7/discipline.json +142 -0
  180. package/rules/CD-7a/README.md +44 -0
  181. package/rules/CD-7a/discipline.json +57 -0
  182. package/rules/CD-8/README.md +48 -0
  183. package/rules/CD-8/discipline.json +57 -0
  184. package/rules/CD-9/README.md +19 -0
  185. package/rules/CD-9/discipline.json +12 -0
  186. package/rules/README.md +52 -0
@@ -0,0 +1,363 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-3",
4
+ "clauses": [
5
+ {
6
+ "kind": "mechanical",
7
+ "id": "strict",
8
+ "summary": "Strict mode flags inherited, never overridden",
9
+ "mechanisms": [
10
+ "audit"
11
+ ],
12
+ "anchor": {
13
+ "kind": "file"
14
+ },
15
+ "cases": {
16
+ "flag": [
17
+ {
18
+ "name": "strict set to false",
19
+ "fileName": "packages/a/tsconfig.json",
20
+ "source": "{\n \"compilerOptions\": {\n \"strict\": false\n }\n}\n",
21
+ "expectedLines": [
22
+ 1
23
+ ]
24
+ },
25
+ {
26
+ "name": "strict restated as true",
27
+ "fileName": "tsconfig.json",
28
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"strict\": true } }\n",
29
+ "expectedLines": [
30
+ 1
31
+ ]
32
+ }
33
+ ],
34
+ "allow": [
35
+ {
36
+ "name": "inherits the shared base",
37
+ "fileName": "packages/a/tsconfig.json",
38
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
39
+ "expectedLines": []
40
+ },
41
+ {
42
+ "name": "only other options set",
43
+ "fileName": "packages/b/tsconfig.json",
44
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
45
+ "expectedLines": []
46
+ },
47
+ {
48
+ "name": "tsconfig.base.json is not read",
49
+ "fileName": "tsconfig.base.json",
50
+ "source": "{ \"compilerOptions\": { \"strict\": true } }\n",
51
+ "expectedLines": []
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "kind": "mechanical",
58
+ "id": "no-unchecked-indexed-access",
59
+ "summary": "Strict mode flags inherited, never overridden",
60
+ "mechanisms": [
61
+ "audit"
62
+ ],
63
+ "anchor": {
64
+ "kind": "file"
65
+ },
66
+ "cases": {
67
+ "flag": [
68
+ {
69
+ "name": "noUncheckedIndexedAccess set to false",
70
+ "fileName": "packages/a/tsconfig.json",
71
+ "source": "{\n \"compilerOptions\": {\n \"noUncheckedIndexedAccess\": false\n }\n}\n",
72
+ "expectedLines": [
73
+ 1
74
+ ]
75
+ },
76
+ {
77
+ "name": "noUncheckedIndexedAccess restated as true",
78
+ "fileName": "tsconfig.json",
79
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"noUncheckedIndexedAccess\": true } }\n",
80
+ "expectedLines": [
81
+ 1
82
+ ]
83
+ }
84
+ ],
85
+ "allow": [
86
+ {
87
+ "name": "inherits the shared base",
88
+ "fileName": "packages/a/tsconfig.json",
89
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
90
+ "expectedLines": []
91
+ },
92
+ {
93
+ "name": "only other options set",
94
+ "fileName": "packages/b/tsconfig.json",
95
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
96
+ "expectedLines": []
97
+ },
98
+ {
99
+ "name": "tsconfig.base.json is not read",
100
+ "fileName": "tsconfig.base.json",
101
+ "source": "{ \"compilerOptions\": { \"noUncheckedIndexedAccess\": true } }\n",
102
+ "expectedLines": []
103
+ }
104
+ ]
105
+ }
106
+ },
107
+ {
108
+ "kind": "mechanical",
109
+ "id": "exact-optional-property-types",
110
+ "summary": "Strict mode flags inherited, never overridden",
111
+ "mechanisms": [
112
+ "audit"
113
+ ],
114
+ "anchor": {
115
+ "kind": "file"
116
+ },
117
+ "cases": {
118
+ "flag": [
119
+ {
120
+ "name": "exactOptionalPropertyTypes set to false",
121
+ "fileName": "packages/a/tsconfig.json",
122
+ "source": "{\n \"compilerOptions\": {\n \"exactOptionalPropertyTypes\": false\n }\n}\n",
123
+ "expectedLines": [
124
+ 1
125
+ ]
126
+ },
127
+ {
128
+ "name": "exactOptionalPropertyTypes restated as true",
129
+ "fileName": "tsconfig.json",
130
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"exactOptionalPropertyTypes\": true } }\n",
131
+ "expectedLines": [
132
+ 1
133
+ ]
134
+ }
135
+ ],
136
+ "allow": [
137
+ {
138
+ "name": "inherits the shared base",
139
+ "fileName": "packages/a/tsconfig.json",
140
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
141
+ "expectedLines": []
142
+ },
143
+ {
144
+ "name": "only other options set",
145
+ "fileName": "packages/b/tsconfig.json",
146
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
147
+ "expectedLines": []
148
+ },
149
+ {
150
+ "name": "tsconfig.base.json is not read",
151
+ "fileName": "tsconfig.base.json",
152
+ "source": "{ \"compilerOptions\": { \"exactOptionalPropertyTypes\": true } }\n",
153
+ "expectedLines": []
154
+ }
155
+ ]
156
+ }
157
+ },
158
+ {
159
+ "kind": "mechanical",
160
+ "id": "no-implicit-override",
161
+ "summary": "Strict mode flags inherited, never overridden",
162
+ "mechanisms": [
163
+ "audit"
164
+ ],
165
+ "anchor": {
166
+ "kind": "file"
167
+ },
168
+ "cases": {
169
+ "flag": [
170
+ {
171
+ "name": "noImplicitOverride set to false",
172
+ "fileName": "packages/a/tsconfig.json",
173
+ "source": "{\n \"compilerOptions\": {\n \"noImplicitOverride\": false\n }\n}\n",
174
+ "expectedLines": [
175
+ 1
176
+ ]
177
+ },
178
+ {
179
+ "name": "noImplicitOverride restated as true",
180
+ "fileName": "tsconfig.json",
181
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"noImplicitOverride\": true } }\n",
182
+ "expectedLines": [
183
+ 1
184
+ ]
185
+ }
186
+ ],
187
+ "allow": [
188
+ {
189
+ "name": "inherits the shared base",
190
+ "fileName": "packages/a/tsconfig.json",
191
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
192
+ "expectedLines": []
193
+ },
194
+ {
195
+ "name": "only other options set",
196
+ "fileName": "packages/b/tsconfig.json",
197
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
198
+ "expectedLines": []
199
+ },
200
+ {
201
+ "name": "tsconfig.base.json is not read",
202
+ "fileName": "tsconfig.base.json",
203
+ "source": "{ \"compilerOptions\": { \"noImplicitOverride\": true } }\n",
204
+ "expectedLines": []
205
+ }
206
+ ]
207
+ }
208
+ },
209
+ {
210
+ "kind": "mechanical",
211
+ "id": "no-fallthrough-cases-in-switch",
212
+ "summary": "Strict mode flags inherited, never overridden",
213
+ "mechanisms": [
214
+ "audit"
215
+ ],
216
+ "anchor": {
217
+ "kind": "file"
218
+ },
219
+ "cases": {
220
+ "flag": [
221
+ {
222
+ "name": "noFallthroughCasesInSwitch set to false",
223
+ "fileName": "packages/a/tsconfig.json",
224
+ "source": "{\n \"compilerOptions\": {\n \"noFallthroughCasesInSwitch\": false\n }\n}\n",
225
+ "expectedLines": [
226
+ 1
227
+ ]
228
+ },
229
+ {
230
+ "name": "noFallthroughCasesInSwitch restated as true",
231
+ "fileName": "tsconfig.json",
232
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"noFallthroughCasesInSwitch\": true } }\n",
233
+ "expectedLines": [
234
+ 1
235
+ ]
236
+ }
237
+ ],
238
+ "allow": [
239
+ {
240
+ "name": "inherits the shared base",
241
+ "fileName": "packages/a/tsconfig.json",
242
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
243
+ "expectedLines": []
244
+ },
245
+ {
246
+ "name": "only other options set",
247
+ "fileName": "packages/b/tsconfig.json",
248
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
249
+ "expectedLines": []
250
+ },
251
+ {
252
+ "name": "tsconfig.base.json is not read",
253
+ "fileName": "tsconfig.base.json",
254
+ "source": "{ \"compilerOptions\": { \"noFallthroughCasesInSwitch\": true } }\n",
255
+ "expectedLines": []
256
+ }
257
+ ]
258
+ }
259
+ },
260
+ {
261
+ "kind": "mechanical",
262
+ "id": "no-property-access-from-index-signature",
263
+ "summary": "Strict mode flags inherited, never overridden",
264
+ "mechanisms": [
265
+ "audit"
266
+ ],
267
+ "anchor": {
268
+ "kind": "file"
269
+ },
270
+ "cases": {
271
+ "flag": [
272
+ {
273
+ "name": "noPropertyAccessFromIndexSignature set to false",
274
+ "fileName": "packages/a/tsconfig.json",
275
+ "source": "{\n \"compilerOptions\": {\n \"noPropertyAccessFromIndexSignature\": false\n }\n}\n",
276
+ "expectedLines": [
277
+ 1
278
+ ]
279
+ },
280
+ {
281
+ "name": "noPropertyAccessFromIndexSignature restated as true",
282
+ "fileName": "tsconfig.json",
283
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"noPropertyAccessFromIndexSignature\": true } }\n",
284
+ "expectedLines": [
285
+ 1
286
+ ]
287
+ }
288
+ ],
289
+ "allow": [
290
+ {
291
+ "name": "inherits the shared base",
292
+ "fileName": "packages/a/tsconfig.json",
293
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
294
+ "expectedLines": []
295
+ },
296
+ {
297
+ "name": "only other options set",
298
+ "fileName": "packages/b/tsconfig.json",
299
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
300
+ "expectedLines": []
301
+ },
302
+ {
303
+ "name": "tsconfig.base.json is not read",
304
+ "fileName": "tsconfig.base.json",
305
+ "source": "{ \"compilerOptions\": { \"noPropertyAccessFromIndexSignature\": true } }\n",
306
+ "expectedLines": []
307
+ }
308
+ ]
309
+ }
310
+ },
311
+ {
312
+ "kind": "mechanical",
313
+ "id": "use-unknown-in-catch-variables",
314
+ "summary": "Strict mode flags inherited, never overridden",
315
+ "mechanisms": [
316
+ "audit"
317
+ ],
318
+ "anchor": {
319
+ "kind": "file"
320
+ },
321
+ "cases": {
322
+ "flag": [
323
+ {
324
+ "name": "useUnknownInCatchVariables set to false",
325
+ "fileName": "packages/a/tsconfig.json",
326
+ "source": "{\n \"compilerOptions\": {\n \"useUnknownInCatchVariables\": false\n }\n}\n",
327
+ "expectedLines": [
328
+ 1
329
+ ]
330
+ },
331
+ {
332
+ "name": "useUnknownInCatchVariables restated as true",
333
+ "fileName": "tsconfig.json",
334
+ "source": "{ \"compilerOptions\": { \"target\": \"ESNext\", \"useUnknownInCatchVariables\": true } }\n",
335
+ "expectedLines": [
336
+ 1
337
+ ]
338
+ }
339
+ ],
340
+ "allow": [
341
+ {
342
+ "name": "inherits the shared base",
343
+ "fileName": "packages/a/tsconfig.json",
344
+ "source": "{ \"extends\": \"../../tsconfig.base.json\", \"compilerOptions\": { \"target\": \"ESNext\" } }\n",
345
+ "expectedLines": []
346
+ },
347
+ {
348
+ "name": "only other options set",
349
+ "fileName": "packages/b/tsconfig.json",
350
+ "source": "{ \"compilerOptions\": { \"outDir\": \"dist\", \"target\": \"ESNext\" } }\n",
351
+ "expectedLines": []
352
+ },
353
+ {
354
+ "name": "tsconfig.base.json is not read",
355
+ "fileName": "tsconfig.base.json",
356
+ "source": "{ \"compilerOptions\": { \"useUnknownInCatchVariables\": true } }\n",
357
+ "expectedLines": []
358
+ }
359
+ ]
360
+ }
361
+ }
362
+ ]
363
+ }
@@ -0,0 +1,19 @@
1
+ # CD-30: Integration tests catch composition bugs only
2
+
3
+ ## Rule
4
+
5
+ An integration test exists to catch composition bugs — wiring, contracts between units — not unit-level logic bugs. If an integration test is the first thing to fail on a logic error, the missing test is a unit test; add it at the base rather than diagnosing through the composed system.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-30#composition-only` | review | an integration test targets the wiring between units, not their logic |
14
+
15
+ Review lens: [test-discipline](../../methods/lenses/test-discipline.md). The lens reviews the whole rule, including what no check flags.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-30",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "composition-only",
8
+ "summary": "an integration test targets the wiring between units, not their logic",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ # CD-31: No coverage thresholds
2
+
3
+ ## Rule
4
+
5
+ Coverage is a diagnostic to read, not a gate to pass. A percentage threshold rewards tests written to move a number; the real floor is the every-file test sibling. Chasing a coverage figure produces assertion-free tests that raise the metric and protect nothing.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-31#no-coverage-thresholds` | review | no percentage coverage threshold gates a run |
14
+
15
+ Review lens: [test-discipline](../../methods/lenses/test-discipline.md). The lens reviews the whole rule, including what no check flags.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-31",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "no-coverage-thresholds",
8
+ "summary": "no percentage coverage threshold gates a run",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ # CD-32: PII strings redact-by-default in structured logs
2
+
3
+ ## Rule
4
+
5
+ Structured logs redact personally-identifying data by default; a field becomes loggable only by explicitly opting in as safe. Redaction is the default so a new field is never accidentally leaked into logs — safety is the resting state, exposure the deliberate exception.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-32#pii-redaction` | review | structured logs redact PII strings unless a field is explicitly opted in |
14
+
15
+ Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-32",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "pii-redaction",
8
+ "summary": "structured logs redact PII strings unless a field is explicitly opted in",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ # CD-33: Sensitive types brand-redact unconditionally
2
+
3
+ ## Rule
4
+
5
+ A value whose type is branded sensitive redacts unconditionally wherever it surfaces — logs, errors, serialisation — with no opt-out. Branding sensitivity into the type means the redaction travels with the value by construction, rather than depending on every call site remembering to hide it.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-33#sensitive-brands` | review | sensitive branded types redact everywhere, with no opt-out |
14
+
15
+ Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-33",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "sensitive-brands",
8
+ "summary": "sensitive branded types redact everywhere, with no opt-out",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ # CD-34: Secrets never enter the repo
2
+
3
+ ## Rule
4
+
5
+ Secrets live only in the environment or a secrets manager — never in source, never in logs, never in URL query parameters. A committed secret is compromised the moment it lands in history, whatever happens to it later; the repository is not a place a secret can safely exist.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-34#no-repo-secrets` | review | secrets never enter source, history, logs or URLs |
14
+
15
+ Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-34",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "no-repo-secrets",
8
+ "summary": "secrets never enter source, history, logs or URLs",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ # CD-39: Cite principles by Roman numeral and rules by ID
2
+
3
+ ## Rule
4
+
5
+ Reviews and rationale cite specific rules by their identifier, not vague appeals to "the standards". A citation anchors a finding to the named rule and its intent, so remediation is precise and the disagreement, if any, is about the rule rather than about taste.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-39#cite-by-id` | review | reviews and rationale cite principles and rules by identifier |
14
+
15
+ Review lens: none. A reviewer applies the rule text directly.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-39",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "cite-by-id",
8
+ "summary": "reviews and rationale cite principles and rules by identifier",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,19 @@
1
+ # CD-4: Zod at every external boundary
2
+
3
+ ## Rule
4
+
5
+ Every crossing from the untyped outside world — HTTP, environment, files, database rows, inter-process input — is validated by a schema at the seam and handed inward as plain typed data. The boundary is the one place the program does not yet know the shape of its input; parse it there, once, so everything deeper can trust its types.
6
+
7
+ The sections below describe how the rule is checked.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-4#boundary-validation` | review | every crossing from the untyped outside world is schema-validated at the seam |
14
+
15
+ Review lens: [zod-boundary](../../methods/lenses/zod-boundary.md). The lens reviews the whole rule, including what no check flags.
16
+
17
+ ## How it is checked
18
+
19
+ Every clause of this discipline is a judgement clause. It cannot be selected in `disciplines.json` and no mechanism checks it; a reviewer applies the rule above with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "id": "CD-4",
4
+ "clauses": [
5
+ {
6
+ "kind": "judgement",
7
+ "id": "boundary-validation",
8
+ "summary": "every crossing from the untyped outside world is schema-validated at the seam",
9
+ "enforcedBy": "review"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,45 @@
1
+ # CD-40: Single-object-argument functions
2
+
3
+ ## Rule
4
+
5
+ A function takes a single named-field object argument rather than a positional parameter list, so every call site reads as a labelled contract instead of a sequence of unlabelled values whose meaning depends on order. Named fields also make adding or reordering parameters a safe, non-breaking change.
6
+
7
+ The sections below describe what the ESLint check covers.
8
+
9
+ ## Clauses
10
+
11
+ | Clause | Mechanism | Checks |
12
+ | --- | --- | --- |
13
+ | `CD-40#parameter-count` | eslint | a function with more than two parameters |
14
+ | `CD-40#named-object-argument` | review | the single argument is an object with named fields, not a positional scalar |
15
+
16
+ Review lens: [function-first](../../methods/lenses/function-first.md). The lens reviews the whole rule, including what no check flags.
17
+
18
+ ## What the check flags
19
+ - The ESLint piece lints whatever files the team's ESLint run includes. It needs ESLint adopted through the projection; see [the ESLint piece](../../mechanisms/eslint/CD-40/README.md).
20
+ - Rule `hone-cd40/max-params`, which is typescript-eslint's `max-params` with `{ "max": 2, "countVoidThis": true }`.
21
+ - A function declaration, function expression, arrow function, method or constructor with more than two parameters. A `this` parameter counts.
22
+ - Allowed: functions with two or fewer parameters.
23
+ - `named-object-argument` is a judgement clause. It cannot be selected and is enforced by review.
24
+
25
+ ## Example violation
26
+ ```ts
27
+ const createOrder = (customerId: string, items: Item[], currency: string) => ({ customerId, items, currency });
28
+ ```
29
+
30
+ ## How to fix
31
+ ```ts
32
+ const createOrder = ({ customerId, items, currency }: OrderRequest) => ({ customerId, items, currency });
33
+ ```
34
+ Take one object with named fields so each call site reads as a labelled contract.
35
+
36
+ ## Exceptions
37
+ 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 needs a `whyChain` and is forfeited once the file is touched. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
38
+
39
+ ```json
40
+ { "version": 1, "exceptions": [
41
+ { "kind": "authorised-location", "clause": "CD-40#parameter-count", "file": "src/adapters/vendor-callback.ts", "reason": "..." }
42
+ ] }
43
+ ```
44
+
45
+ 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`. The one exception is a record imported from an earlier system, which carries `provenance` instead. [The exceptions format](../../README.md#discipline-exceptionsjson) gives both shapes.