@hailstails/hone 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/ADOPTING.md +8 -8
  2. package/CHANGELOG.md +36 -0
  3. package/MIGRATING.md +40 -0
  4. package/README.md +28 -7
  5. package/api/audit.d.ts +1 -1
  6. package/api/testing.js +3 -3
  7. package/chunks/{chunk-H4V72FCW.js → chunk-2O46EB4E.js} +15 -1
  8. package/chunks/chunk-335ITLPO.js +7 -0
  9. package/chunks/{chunk-YSN46EB3.js → chunk-5U4VTFD5.js} +347 -664
  10. package/chunks/{chunk-PL2PNPAR.js → chunk-E6VR3VRV.js} +1 -6
  11. package/chunks/chunk-WF3PPYRR.js +27 -0
  12. package/core/check/tool-command.js +1120 -105
  13. package/core/mechanism-port/runner-result-types.d.ts +10 -0
  14. package/docs/adding-a-discipline-or-mechanism.md +5 -3
  15. package/docs/extending.md +2 -0
  16. package/docs/output-contract.md +64 -11
  17. package/mechanisms/audit/CD-27/test-body-logic.js +397 -46
  18. package/mechanisms/audit/runner/runner.js +5 -3
  19. package/mechanisms/audit/runner/typescript-parse.d.ts +2 -0
  20. package/mechanisms/audit/runner/walker-piece.d.ts +2 -1
  21. package/mechanisms/eslint/CD-1/cd1/cd1.eslint-plugin.js +7 -4
  22. package/mechanisms/eslint/CD-10/cd10/cd10.eslint-plugin.js +21 -11
  23. package/mechanisms/eslint/CD-14/cd14/cd14.eslint-plugin.js +15 -5
  24. package/mechanisms/eslint/CD-27/cd27/cd27.eslint-plugin.js +7 -3
  25. package/mechanisms/eslint/CD-41/README.md +1 -1
  26. package/mechanisms/eslint/CD-41/cd41/cd41.eslint-plugin.js +100 -28
  27. package/mechanisms/eslint/CD-42/cd42/cd42.eslint-plugin.js +8 -4
  28. package/mechanisms/eslint/CD-7/cd7/cd7.eslint-plugin.js +8 -4
  29. package/mechanisms/eslint/runner/README.md +9 -2
  30. package/mechanisms/eslint/runner/runner.js +1410 -1384
  31. package/methods/assessment-template.md +2 -2
  32. package/methods/lenses/clean-architecture.md +7 -8
  33. package/methods/lenses/defended-on-intent.md +2 -2
  34. package/methods/lenses/di-discipline.md +14 -18
  35. package/methods/lenses/function-first.md +16 -18
  36. package/methods/lenses/test-discipline.md +1 -1
  37. package/package.json +1 -1
  38. package/rules/CD-1/CHECKS.md +6 -2
  39. package/rules/CD-1/README.md +6 -19
  40. package/rules/CD-10/CHECKS.md +5 -3
  41. package/rules/CD-10/README.md +6 -18
  42. package/rules/CD-11/CHECKS.md +4 -2
  43. package/rules/CD-11/README.md +6 -16
  44. package/rules/CD-12/CHECKS.md +4 -2
  45. package/rules/CD-12/README.md +6 -16
  46. package/rules/CD-13/CHECKS.md +4 -2
  47. package/rules/CD-13/README.md +6 -16
  48. package/rules/CD-14/CHECKS.md +3 -1
  49. package/rules/CD-14/README.md +6 -19
  50. package/rules/CD-15/CHECKS.md +5 -1
  51. package/rules/CD-15/README.md +5 -20
  52. package/rules/CD-16/CHECKS.md +3 -1
  53. package/rules/CD-16/README.md +6 -6
  54. package/rules/CD-17/CHECKS.md +3 -1
  55. package/rules/CD-17/README.md +6 -19
  56. package/rules/CD-18/CHECKS.md +4 -2
  57. package/rules/CD-18/README.md +6 -16
  58. package/rules/CD-19/CHECKS.md +8 -6
  59. package/rules/CD-19/README.md +6 -20
  60. package/rules/CD-2/CHECKS.md +7 -3
  61. package/rules/CD-2/README.md +6 -21
  62. package/rules/CD-20/CHECKS.md +3 -1
  63. package/rules/CD-20/README.md +6 -6
  64. package/rules/CD-21/CHECKS.md +4 -2
  65. package/rules/CD-21/README.md +6 -15
  66. package/rules/CD-22/CHECKS.md +4 -2
  67. package/rules/CD-22/README.md +6 -15
  68. package/rules/CD-23/CHECKS.md +5 -3
  69. package/rules/CD-23/README.md +6 -17
  70. package/rules/CD-24/CHECKS.md +3 -1
  71. package/rules/CD-24/README.md +6 -6
  72. package/rules/CD-25/CHECKS.md +5 -3
  73. package/rules/CD-25/README.md +5 -21
  74. package/rules/CD-26/CHECKS.md +5 -3
  75. package/rules/CD-26/README.md +6 -20
  76. package/rules/CD-27/CHECKS.md +394 -9
  77. package/rules/CD-27/README.md +6 -20
  78. package/rules/CD-27/discipline.json +130 -0
  79. package/rules/CD-28/CHECKS.md +4 -2
  80. package/rules/CD-28/README.md +6 -16
  81. package/rules/CD-29/CHECKS.md +4 -2
  82. package/rules/CD-29/README.md +6 -14
  83. package/rules/CD-3/CHECKS.md +3 -1
  84. package/rules/CD-3/README.md +6 -17
  85. package/rules/CD-30/CHECKS.md +4 -2
  86. package/rules/CD-30/README.md +6 -15
  87. package/rules/CD-31/CHECKS.md +4 -2
  88. package/rules/CD-31/README.md +6 -14
  89. package/rules/CD-32/CHECKS.md +3 -1
  90. package/rules/CD-32/README.md +2 -0
  91. package/rules/CD-33/CHECKS.md +3 -1
  92. package/rules/CD-33/README.md +2 -0
  93. package/rules/CD-34/CHECKS.md +3 -1
  94. package/rules/CD-34/README.md +2 -0
  95. package/rules/CD-39/CHECKS.md +3 -1
  96. package/rules/CD-39/README.md +2 -0
  97. package/rules/CD-4/CHECKS.md +4 -2
  98. package/rules/CD-4/README.md +6 -17
  99. package/rules/CD-40/CHECKS.md +3 -1
  100. package/rules/CD-40/README.md +6 -20
  101. package/rules/CD-41/CHECKS.md +14 -2
  102. package/rules/CD-41/README.md +6 -20
  103. package/rules/CD-41/discipline.json +14 -0
  104. package/rules/CD-42/CHECKS.md +3 -1
  105. package/rules/CD-42/README.md +6 -16
  106. package/rules/CD-43/CHECKS.md +3 -1
  107. package/rules/CD-43/README.md +6 -18
  108. package/rules/CD-44/CHECKS.md +3 -1
  109. package/rules/CD-44/README.md +6 -17
  110. package/rules/CD-45/CHECKS.md +4 -2
  111. package/rules/CD-45/README.md +6 -16
  112. package/rules/CD-46/CHECKS.md +3 -1
  113. package/rules/CD-46/README.md +2 -0
  114. package/rules/CD-47/CHECKS.md +4 -2
  115. package/rules/CD-47/README.md +4 -20
  116. package/rules/CD-5/CHECKS.md +4 -2
  117. package/rules/CD-5/README.md +6 -19
  118. package/rules/CD-6/CHECKS.md +3 -1
  119. package/rules/CD-6/README.md +6 -19
  120. package/rules/CD-7/CHECKS.md +3 -1
  121. package/rules/CD-7/README.md +6 -20
  122. package/rules/CD-7a/CHECKS.md +3 -1
  123. package/rules/CD-7a/README.md +6 -17
  124. package/rules/CD-8/CHECKS.md +3 -1
  125. package/rules/CD-8/README.md +6 -17
  126. package/rules/CD-9/CHECKS.md +4 -2
  127. package/rules/CD-9/README.md +6 -17
  128. package/rules/README.md +71 -54
  129. package/rules/SPIRIT.md +3 -3
  130. package/rules/cases.md +94 -0
  131. package/rules/numbers.md +155 -0
  132. package/rules/principles.md +89 -0
  133. package/rules/records.md +150 -0
  134. package/rules/rules.md +149 -0
  135. package/rules/sources.md +142 -0
  136. package/rules/typescript/checks.md +219 -0
  137. package/rules/typescript/recipes.md +361 -0
  138. package/rules/typescript/symptoms.json +1005 -0
  139. package/rules/typescript/symptoms.md +612 -0
  140. package/chunks/chunk-YLZ73C7O.js +0 -0
@@ -1,6 +1,6 @@
1
1
  # Disciplines assessment
2
2
 
3
- What this repository's checks are telling us, and where the code is going. Each clause section sharpens that rule's Spirit section for this codebase; it does not repeat the rule. Read a clause's section before changing code to make its check pass.
3
+ What this repository's checks are telling us, and where the code is going. Each clause section sharpens what the symptoms page says for this codebase; it does not repeat the rule. Read a clause's section before changing code to make its check pass.
4
4
 
5
5
  ## Rules adopted
6
6
 
@@ -26,7 +26,7 @@ Applied in review with the lens each rule page names.
26
26
 
27
27
  ## <clause address>
28
28
 
29
- - **Cause here:** <a cause from the rule's Spirit list, named as the rule names it>. <How it shows in this codebase.>
29
+ - **Cause here:** <a case or breach site from the symptom's "May indicate" or "Breach usually sits", named as the symptoms page names it>. <How it shows in this codebase.>
30
30
  - **Sites:** <count> at <commit>, in <folders or files>. For example <file:line>, <file:line>.
31
31
  - **Forward goal:** <the cleaner design, in this codebase's terms>.
32
32
  - **Steps:** 1. <the step that unlocks the rest> 2. <the next step>
@@ -70,9 +70,9 @@ outer layer?*
70
70
  - **Inner code importing a storage/driver primitive.** Inner layers (domain,
71
71
  application) importing a database driver, a filesystem module, or any raw
72
72
  storage primitive is a finding against the repository-port rule: the inner code
73
- reached around the port. The correct shape is a port type declared with the
74
- domain, a default factory wired at boot, and an adapter file that composes the
75
- driver behind the port.
73
+ reached around the port. The correct shape is a port declared in the domain,
74
+ in a module of its own, an adapter that fulfils it, and one entry-point module
75
+ that builds the adapter and passes it in.
76
76
  - **Type-only does not escape.** A type-only import still couples the consumer to
77
77
  the outer world's type shape; if the rules say type-only follows the same rule,
78
78
  read it the same way as a runtime import.
@@ -147,11 +147,10 @@ re-tagging the rule another lens owns):
147
147
  the boundary observation rather than inventing a layering rule that doesn't carry
148
148
  this lens tag. The wrapping-factory file *is* the permitted seam; the boundary
149
149
  violation is only the import that skips it.
150
- - **Default-factory siblings.** A permitted wrapping/adapter site should also ship
151
- the default factory its DI rules require; the *internal shape* of the port
152
- (capability naming, factory presence, generic binding) is the DI lens's lane.
153
- Note a missing default-factory export as a sibling observation, not as a
154
- clean-architecture finding of its own.
150
+ - **Adapter built outside the root.** One entry-point module builds every
151
+ adapter and passes each one in; the *internal shape* of the port (capability
152
+ naming, generic binding) is the DI lens's lane. Note an adapter built anywhere
153
+ else as a sibling observation, not as a clean-architecture finding of its own.
155
154
 
156
155
  Vague phrasings ("this coupling feels wrong", "might leak data") are the lens's own
157
156
  failure mode — every finding names the specific boundary and the rule that draws it.
@@ -132,8 +132,8 @@ principle (e.g. "every dependency outside the unit boundary is replaced by a tes
132
132
  dependency injection, never reached around") — is "no substitution outside DI". The
133
133
  unlisted mechanism *is* substitution outside DI; it passes the letter and fails the
134
134
  intent. The structural reframing: the unit consumes the dependency as an
135
- injected port through its argument seam, production wires the real
136
- implementation in the wrapping-factory file, the test injects a test double directly;
135
+ injected port through its argument seam, production builds the real
136
+ implementation at the entry point and passes it in, the test injects a test double directly;
137
137
  the PASS retracts and becomes a DI/testing VIOLATION on the owning lens.
138
138
 
139
139
  The three properties that make a finding sound — and that an author can
@@ -15,9 +15,9 @@ the code: every technical binding a unit needs — wall-clock time, process and
15
15
  signal lifecycle, standard-library capabilities (filesystem, crypto, path, net),
16
16
  and third-party services — arrives through a named port the unit receives as a
17
17
  constructor parameter or function argument, never reached for through a global,
18
- an ambient import, or the module system. Each port ships a default factory in
19
- its own module so production wires the real implementation once at the
20
- composition root and tests inject a test double of the same shape. The test face is the
18
+ an ambient import, or the module system. The port's interface is declared in
19
+ the domain, in a module of its own; one entry-point module builds every
20
+ adapter and passes each one in, and tests inject a test double of the same shape. The test face is the
21
21
  mirror image: a unit test replaces *everything* outside the unit's boundary with a
22
22
  test double, and it delivers those doubles the same way production delivers the
23
23
  real ones — through the
@@ -72,18 +72,15 @@ reached for through the module system). Walk the diff for both.
72
72
  violation-in-waiting even if it currently delegates to a helper that itself
73
73
  holds the raw call. The composition pathway must terminate at an injected port,
74
74
  not at a buried global.
75
- - **Missing default factory.** For every port type added or changed in the diff,
76
- confirm a sibling default-factory function exists in the same module (the
77
- production implementation). A port shipped without its default forces every
78
- consumer to hand-roll the wiring and predicts test-side module-mocking
79
- downstream — flag the absence preemptively. Conversely, consumers that
80
- construct an ad-hoc object literal matching the port shape outside test code,
81
- instead of importing the default factory, are reaching around the port.
75
+ - **Adapter built outside the root.** One entry-point module builds every
76
+ adapter and passes each one in. A call to an adapter's factory anywhere but
77
+ the entry point is a finding: the calling unit builds what it should be
78
+ passed. No port is declared in an adapter's module or in its consumer's.
82
79
  - **Composition-root threading.** The boot path (the service-run entrypoint, the
83
- app start module, the kernel composition) must call each default factory and
80
+ app start module, the kernel composition) must build each adapter and
84
81
  pass the port into the unit that declared it. A unit that *declares* a port
85
82
  parameter but is never wired to one in the boot path is a threading violation;
86
- a boot path that constructs a port inline instead of importing its factory is
83
+ a unit outside the boot path that builds an adapter itself is
87
84
  the same gap from the other end.
88
85
  - **Type-level context constraint.** Where the rules require context-consuming
89
86
  middleware (or any generic that reads kernel-shipped context fields) to bind
@@ -117,10 +114,9 @@ reached for through the module system). Walk the diff for both.
117
114
  attached to**: a DI-delivered test double (permitted) or an imported binding
118
115
  (violation).
119
116
  - **Test doubles through the seam are not module interception.** A test that
120
- constructs a stub or spy as an object literal, a factory-built stub, a shared
121
- in-memory fake of a port, or a recording spy function, and delivers it through
122
- the unit's constructor or argument, is the exact pattern the discipline
123
- channels toward — not a finding. In common speech "mock" covers both a double
117
+ constructs a stub or spy as an object literal, a factory-built stub, or a
118
+ recording spy function, and delivers it through the unit's constructor or
119
+ argument, is the exact pattern the discipline channels toward — not a finding. In common speech "mock" covers both a double
124
120
  passed through the seam and module interception. In the taxonomy a mock is only
125
121
  a double that verifies expectations set on it, and module interception is not a
126
122
  double at all: the rules permit doubles through the seam and forbid
@@ -149,7 +145,7 @@ raw global call on a "convenience" path; a default factory present but the boot
149
145
  path constructing the port inline beside it; a middleware generic that compiles
150
146
  because its context happens to carry the field, yet is unbound so a different
151
147
  pipeline would crash; a spy that looks like clean observation but is attached to
152
- an imported module; an in-memory fake that is actually wired through module
148
+ an imported module; a stub that is actually wired through module
153
149
  interception rather than the seam. A finding here must explain *how the code reads
154
150
  DI-clean yet the dependency is still reached for ambiently*, grounded in the
155
151
  specific loaded rule. Vague phrasings ("tight coupling", "hard to test") are the
@@ -158,7 +154,7 @@ lens's own failure mode.
158
154
  ## Output shape
159
155
 
160
156
  Report **two-sided** counts the review asks for: a production-side
161
- block (ambient-binding violations by capability, missing default factories,
157
+ block (ambient-binding violations by capability, adapters built outside the root,
162
158
  threading gaps, unbound context generics) and a test-side block
163
159
  (module-interception violations by mechanism, spy classifications, structural
164
160
  boundary gaps). Every finding is
@@ -31,13 +31,11 @@ Four facets of the same stance:
31
31
  the transformation as data. Counted loops name a counter where the operation
32
32
  is what matters. Side-effect-only iteration is the one place an imperative
33
33
  shape survives, and even then under a `void`-returning callback.
34
- - **Third-party imports confined to wrapping factories.** A library is an
35
- external dependency the domain should not see directly. Each library is
36
- imported in exactly one wrapping-factory file (runtime *and* type-only); every
37
- other module consumes the kernel-supplied factory output. The wrapping factory
38
- *is* the function-first boundary for the library — it is where the unavoidable
39
- `new X(...)` and the raw import are quarantined behind a function-shaped
40
- surface.
34
+ - **Outside dependencies confined to their adapter.** An outside dependency or
35
+ runtime module is imported only in the adapter file for the party it reaches
36
+ (runtime *and* type-only). That adapter fulfils a port and returns our types.
37
+ Nothing re-exports the outside dependency. A library's class is built only in
38
+ its adapter.
41
39
  - **Single-object-argument functions.** Every authored function takes exactly
42
40
  one parameter; multiple values pass as named fields on an object. Positional
43
41
  multi-argument signatures are forbidden except for callbacks whose signature is
@@ -73,9 +71,9 @@ per-declaration not per-export — is suspect until classified. For each, decide
73
71
  one of three buckets:
74
72
 
75
73
  - **justified.** The declaration is the single permitted authored class at its
76
- named site, OR it is a `new X(...)` for an external-library class whose
77
- wrapping-factory file the rules name AND the instance is held inside the
78
- closure and never re-exported as a class. Cite the carve-out; no replacement.
74
+ named site, OR it is a `new X(...)` for an external-library class in
75
+ the adapter for the party it reaches, with a boundary record, AND the instance
76
+ is held inside the closure and never re-exported as a class. Cite the carve-out; no replacement.
79
77
  - **closure-candidate.** The class carries genuine instance state that is
80
78
  *mutated* across method calls (counters, caches, accumulating buffers,
81
79
  subscription registries, in-flight tracking). Replacement: a factory closing
@@ -135,15 +133,15 @@ counter-shaped `for`, not a direction. An async-iterator loop has no source-side
135
133
  carve-out unless the rules grant one — lift it into a Promise-reduce pipeline or
136
134
  an event `forEach` handler by shape.
137
135
 
138
- ### Wrapping-factory pass
136
+ ### Adapter pass
139
137
 
140
- Every raw third-party import (runtime *or* type-only) and every `new X(...)` for
141
- an external-library class is a candidate. For each: is the importing/instantiating
142
- file on the rules' closed list of wrapping-factory files for that library? If
143
- yes → justified. If the library is on the list but the file is not, the import is
144
- in the wrong place — a function-first finding with a DI/port cross-reference (the
145
- raw import escaping its wrapping factory is both a structural and a
146
- boundary-discipline defect; name the boundary lens as the cross-reference). A
138
+ Every raw outside-dependency import (runtime *or* type-only) and every `new X(...)`
139
+ for an external-library class is a candidate. For each: is the importing or
140
+ instantiating file the adapter for the party it reaches, with a boundary record?
141
+ If yes → justified. If not, the import is in the wrong place — a function-first
142
+ finding with a DI/port cross-reference (the raw import escaping its adapter is
143
+ both a structural and a boundary-discipline defect; name the boundary lens as the
144
+ cross-reference). A
147
145
  `new X(...)` for a class the codebase itself authored is a finding twice over —
148
146
  the class should not have been authored, and the instantiation is the symptom.
149
147
 
@@ -20,7 +20,7 @@ recur across codebases under different names:
20
20
  threshold.
21
21
  - **Zero-everything tests.** A test body is a straight line: arrange → act →
22
22
  assert. No control flow, no loops, no branches, no mutated capture, no
23
- unpredictability. N cases means N tests. Uniform cases, such as the rows of a table, are one parameterised test over the rows (the framework's `each`), never a loop inside a test body, and never one hand-written test per row. Variability is supplied by injected test doubles (stubs with canned answers, or a fake clock that the test advances), never computed inside the test.
23
+ unpredictability. N cases means N tests. Uniform cases, such as the rows of a table, are one parameterised test over the rows (the framework's `each`), never a loop inside a test body, and never one hand-written test per row. Variability is supplied by injected test doubles (stubs with canned answers), never computed inside the test.
24
24
  - **Assert only the unit's own responsibility.** A test inspects what its unit
25
25
  produces and how it calls its collaborators — never the internal logic of a
26
26
  delegate reached transitively.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hailstails/hone",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
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",
@@ -1,6 +1,8 @@
1
1
  # CD-1 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: what each check flags and misses, how to fix a flagged site, and how to record an exception.
3
+ Symptoms: [Claimed type](../typescript/symptoms.md#claimed-type) and [Untyped value](../typescript/symptoms.md#untyped-value).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: what each check flags and misses, how to fix a flagged site, and how to record an exception.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -31,7 +33,9 @@ const parsed = JSON.parse(text) as any;
31
33
  ```ts
32
34
  const order = orderSchema.parse(JSON.parse(text));
33
35
  ```
34
- Give it a concrete type where it enters: parse it with a schema or a type guard at the boundary, checked at runtime.
36
+ Give it a concrete type where it enters: parse it once with a schema in the adapter for whoever produced it, checked at runtime.
37
+
38
+ In a test file, edition 2 of `CD-27#test-body-logic` flags `JSON.parse`; edition 1, the default, does not.
35
39
 
36
40
  ## Exceptions
37
41
  CD-1 is exempted like any other discipline: record an `authorised-location`, a `file-carve-out` for existing debt, or a clause-wide carve-out in `discipline-exceptions.json`. A carved or authorised file keeps its existing `any`; an `any` anywhere else still fails. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
@@ -2,27 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- `any` is the absence of a type: it tells the compiler to stop checking, and that hole propagates silently through every call site that consumes the value. The whole reason a type system exists — catching shape errors before runtime — is forfeited at each `any`. Give the value a concrete type where it enters, checked at runtime, or a precise union. Every `any` is a violation regardless of stated reason: no code form or setting permits one. Debt a repository carries while adopting the rule is held only in exception records.
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ, and [Every CD](../numbers.md) maps each number to its names.
6
6
 
7
- Review lens: [type-soundness](../../methods/lenses/type-soundness.md). The lens reviews the whole rule, including what no check flags. What each check flags, how to fix a flagged site, and how to record an exception: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
8
-
9
- ## Spirit
7
+ **Verdict.** Symptom of [Declared, not asserted](../rules.md#declared-not-asserted).
10
8
 
11
- **What the friction is for.** A value with no type switches off checking for everything it touches. The friction makes "this value has a known shape" the cheapest thing to write, so the compiler keeps doing the work at every use instead of a reader doing it in their head.
9
+ **Read.** [Declared, not asserted](../rules.md#declared-not-asserted).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Input never typed where it entered.* A request, file, parse or database row crossed in and nobody said what it is. Give it a concrete type at that boundary, checked at runtime.
15
- - *A shape nobody named.* The value has a shape that was never declared. Declare it as a type or a union.
16
- - *A library kept at arm's length.* The vendor's types were awkward, so they were dropped. Wrap the library once and hand the rest of the code your own type.
17
- - *One function serving many shapes.* It takes anything because its callers differ. Split it, or make the variants an explicit union.
18
-
19
- **Where to go.** Every value inside the codebase has a known type. Unknown data becomes concrete where it arrives, not somewhere further in. A high count is usually one or two boundaries that were never built; build those first and most sites go with them.
11
+ Review lens: [type-soundness](../../methods/lenses/type-soundness.md). The lens reviews the whole rule, including what no check flags. What each check flags, how to fix a flagged site, and how to record an exception: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
20
12
 
21
- **Reactions to distrust.**
22
- - "It's just tests." A test that needs an untyped value builds its input the wrong way. Build the real type.
23
- - "The library forces it." It forces it at one call. One wrapping file holds that.
24
- - "Swap it for unknown." Unknown carried inward is the same debt, deferred. Very few values should stay unknown past the boundary.
13
+ ## Spirit
25
14
 
26
- **Principles behind it.**
27
- - *Parse, don't validate* (Alexis King). Turn untyped input into a typed value once, where it arrives, so everything after it can rely on the type.
28
- - *Make illegal states unrepresentable* (Yaron Minsky). A precise type or union rules out shapes the code cannot handle; an untyped value rules out nothing.
15
+ Start from the symptom a finding names: [Claimed type](../typescript/symptoms.md#claimed-type) and [Untyped value](../typescript/symptoms.md#untyped-value). Each symptom names the cases it may indicate and the rules they point at. The why is on [The type checker proves it](../principles.md#the-type-checker-proves-it).
@@ -1,6 +1,8 @@
1
1
  # CD-10 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
3
+ Symptoms: [Throw or catch in a test](../typescript/symptoms.md#throw-or-catch-in-a-test) and [Thrown non-error](../typescript/symptoms.md#thrown-non-error).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -38,11 +40,11 @@ it("loads the account", () => {
38
40
  Assert on the whole result. Branching in tests is also reported by CD-27.
39
41
 
40
42
  ## 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 is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
43
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. The form accepts an `authorised-location` for this clause, as for any; in spirit [Throw or catch in a test](../typescript/symptoms.md#throw-or-catch-in-a-test) has no correct use, and a reviewer refuses one. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
42
44
 
43
45
  ```json
44
46
  { "version": 1, "exceptions": [
45
- { "kind": "authorised-location", "clause": "CD-10#throws-in-tests", "file": "src/legacy/harness.test.ts", "reason": "..." }
47
+ { "kind": "file-carve-out", "clause": "CD-10#throws-in-tests", "file": "src/legacy/charge.test.ts" }
46
48
  ] }
47
49
  ```
48
50
 
@@ -2,26 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Throwing is confined to a closed, named set of contexts: a startup-invariant check that fails at boot, and a branch made unreachable by exhaustive type narrowing. Defensive throws — "this should never happen", "guard against impossible state" — are forbidden: if you can name the state, you can model it as a result variant. A library that throws is caught at the boundary and converted to a result. Tests carry no exemption; they surface failures through assertions, not by throwing.
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ, and [Every CD](../numbers.md) maps each number to its names.
6
6
 
7
- Review lens: [errors-as-data](../../methods/lenses/errors-as-data.md). The lens reviews the whole rule, including what no check flags. What each check flags, how to fix a flagged site, and how to record an exception: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
8
-
9
- ## Spirit
7
+ **Verdict.** Splits: Failures are values; Straight-through tests; throw-only-error a check.
10
8
 
11
- **What the friction is for.** A throw is a failure the type does not mention. The friction makes returning the failure as a value the easy path, so every caller sees what can go wrong and must decide what to do.
9
+ **Read.** [Failures are values](../rules.md#failures-are-values), [Straight-through tests](../rules.md#straight-through-tests), [Failure asserted as a value](../typescript/recipes.md#failure-asserted-as-a-value) and [Failure mapping at the adapter](../typescript/recipes.md#failure-mapping-at-the-adapter).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *A defensive "can't happen".* A throw guards a state the code believes impossible. If you can name the state, model it as a result variant or rule it out with a type.
15
- - *A library that throws, caught too late.* Exceptions escape into the core. Catch at the wrapping boundary and return a result.
16
- - *Tests that throw to fail.* A test throws instead of asserting. Assert on the result; the assertion is the failure.
17
- - *Failure modes nobody listed.* Errors are thrown because no error type exists yet. List the ways the operation fails.
18
-
19
- **Where to go.** Throws exist only for a failed startup invariant and a branch the types prove unreachable. Everything else returns its failure.
11
+ Review lens: [errors-as-data](../../methods/lenses/errors-as-data.md). The lens reviews the whole rule, including what no check flags. What each check flags, how to fix a flagged site, and how to record an exception: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
20
12
 
21
- **Reactions to distrust.**
22
- - "It really can't happen." Then the type can say so, and the throw is unnecessary.
23
- - "Results are verbose." They are the failure paths written down. A throw hides the same paths.
13
+ ## Spirit
24
14
 
25
- **Principles behind it.**
26
- - *Railway oriented programming* (Scott Wlaschin). Success and failure travel as two tracks of one value, so failure is handled, not escaped.
27
- - *Fail fast.* A broken startup invariant stops the program at once; that is the one place a throw is the clearest signal.
15
+ Start from the symptom a finding names: [Throw or catch in a test](../typescript/symptoms.md#throw-or-catch-in-a-test) and [Thrown non-error](../typescript/symptoms.md#thrown-non-error). Each symptom names the cases it may indicate and the rules they point at. The why is on [The type checker proves it](../principles.md#the-type-checker-proves-it) and [Tests are ours](../principles.md#tests-are-ours).
@@ -1,6 +1,8 @@
1
1
  # CD-11 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
3
+ Recipe: [Result union](../typescript/recipes.md#result-union). The outcome it protects is seen by [Failure shaped as success](../typescript/symptoms.md#failure-shaped-as-success).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -10,4 +12,4 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
10
12
 
11
13
  ## How it is checked
12
14
 
13
- 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](README.md) with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
15
+ 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 named rules](README.md) with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -2,24 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Operational error envelopes are plain, tagged data — constructed by a factory, inspected by a type guard, dispatched by an exhaustive switch on the tag — never authored classes extending the runtime's error type. Data-shaped errors compose, narrow, and serialise; class hierarchies for operational failure do not. The only authored error class is the single startup-invariant one the throw rule permits.
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ, and [Every CD](../numbers.md) maps each number to its names.
6
6
 
7
- Review lens: [errors-as-data](../../methods/lenses/errors-as-data.md). The lens reviews the whole rule, including what no check flags. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
8
-
9
- ## Spirit
7
+ **Verdict.** Recipe for [Failures are values](../rules.md#failures-are-values).
10
8
 
11
- **What the friction is for.** Errors are values the code passes, narrows and serialises. The friction makes plain tagged data the easy shape, so errors compose like any other data.
9
+ **Read.** [Failures are values](../rules.md#failures-are-values) and [Result union](../typescript/recipes.md#result-union).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Error hierarchies built by inheritance.* Error kinds are subclasses. Make them variants of one tagged union.
15
- - *Errors carrying behaviour.* Error objects have methods. Move the behaviour into functions that take the error.
16
- - *Errors that cannot cross a boundary.* Class instances lose their type when serialised. Plain data survives.
17
-
18
- **Where to go.** Each error is plain data with a tag, built by a factory and dispatched by an exhaustive switch.
11
+ Review lens: [errors-as-data](../../methods/lenses/errors-as-data.md). The lens reviews the whole rule, including what no check flags. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
19
12
 
20
- **Reactions to distrust.**
21
- - "Stack traces need the error class." Operational failures are expected outcomes, not bugs; they need context, not a trace.
13
+ ## Spirit
22
14
 
23
- **Principles behind it.**
24
- - *Make illegal states unrepresentable* (Yaron Minsky). A closed union lists exactly the failures that exist; an open class hierarchy admits any subclass.
25
- - *Algebraic data types.* A tagged union of error variants is checked for exhaustiveness wherever it is handled.
15
+ Start from the symptom a finding names: [Failure shaped as success](../typescript/symptoms.md#failure-shaped-as-success) and [Catch-all failure kind](../typescript/symptoms.md#catch-all-failure-kind). Each symptom names the cases it may indicate and the rules they point at. The why is on [The type checker proves it](../principles.md#the-type-checker-proves-it).
@@ -1,6 +1,8 @@
1
1
  # CD-12 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
3
+ Recipe: [Port in the domain](../typescript/recipes.md#port-in-the-domain). The outcome it protects is seen by [Port outside the domain](../typescript/symptoms.md#port-outside-the-domain).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -10,4 +12,4 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
10
12
 
11
13
  ## How it is checked
12
14
 
13
- 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](README.md) with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
15
+ 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 named rules](README.md) with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -2,24 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Storage sits behind a repository port. Domain code talks to the port; an adapter composes the raw storage-driver primitives behind it. The domain never imports the storage driver or a filesystem primitive directly — so the storage technology can change without the domain knowing.
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ, and [Every CD](../numbers.md) maps each number to its names.
6
6
 
7
- Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
8
-
9
- ## Spirit
7
+ **Verdict.** Recipe for [Ports declared inside](../rules.md#ports-declared-inside).
10
8
 
11
- **What the friction is for.** Storage technology changes more often than the domain. The friction keeps the domain talking to a repository port, so storage can change without the domain knowing.
9
+ **Read.** [Ports declared inside](../rules.md#ports-declared-inside) and [Port in the domain](../typescript/recipes.md#port-in-the-domain).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Queries written in domain code.* Domain functions call the driver directly. Move the query behind a repository method named for what the domain needs.
15
- - *A repository that leaks its driver.* The port returns driver rows or types. Return domain shapes.
16
- - *Files used as storage directly.* Filesystem calls sit in domain logic. Put them behind a repository too.
17
-
18
- **Where to go.** The domain depends on repository ports. Adapters compose the driver behind them.
11
+ Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
19
12
 
20
- **Reactions to distrust.**
21
- - "We'll never change the database." The port is also what lets tests use an in-memory fake of storage.
13
+ ## Spirit
22
14
 
23
- **Principles behind it.**
24
- - *Repository* (Martin Fowler, *Patterns of Enterprise Application Architecture*). A collection-like interface between the domain and data mapping.
25
- - *Dependency Inversion Principle* (Robert C. Martin, SOLID). The domain defines what it needs; storage implements it.
15
+ Start from the symptom a finding names: [Port outside the domain](../typescript/symptoms.md#port-outside-the-domain). Each symptom names the cases it may indicate and the rules they point at. The why is on [External behaviour sits at a boundary](../principles.md#external-behaviour-sits-at-a-boundary).
@@ -1,6 +1,8 @@
1
1
  # CD-13 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
3
+ Symptom: [Inner layer imports outer](../typescript/symptoms.md#inner-layer-imports-outer).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: how the rule is checked, and how to record an exception where the rule allows one.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -10,4 +12,4 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
10
12
 
11
13
  ## How it is checked
12
14
 
13
- 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](README.md) with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
15
+ 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 named rules](README.md) with its review lens, as [ADOPTING.md](../../ADOPTING.md#9-apply-the-judgement-rules) describes. Selecting no clause of this discipline leaves nothing uncovered.
@@ -2,24 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Dependencies point inward and only inward: the domain depends on nothing, the application layer orchestrates the domain, adapters implement the ports the inner layers declare, and transports are leaves at the edge. An inner layer importing an outer one is the violation — it is what inverts the dependency direction the architecture exists to protect.
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ, and [Every CD](../numbers.md) maps each number to its names.
6
6
 
7
- Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
8
-
9
- ## Spirit
7
+ **Verdict.** Keeps: [Ports declared inside](../rules.md#ports-declared-inside).
10
8
 
11
- **What the friction is for.** When inner code depends on outer code, a change at the edge breaks the core. The friction keeps dependencies pointing inward, so the core can be understood, tested and kept without its delivery details.
9
+ **Read.** [Ports declared inside](../rules.md#ports-declared-inside) and [Port in the domain](../typescript/recipes.md#port-in-the-domain).
12
10
 
13
- **What a finding points at.** Match the imports against these causes.
14
- - *The domain reaching for infrastructure.* Domain code imports an adapter or transport. Declare a port in the inner layer and implement it outside.
15
- - *Layers not named.* Code is not sorted into layers, so direction cannot be seen. Name the layers and place each module.
16
- - *Shared types living outside.* Inner code imports outer code only for a type. Move the type inward.
17
-
18
- **Where to go.** The domain depends on nothing. The application orchestrates the domain. Adapters implement inner ports. Transports sit at the edge.
11
+ Review lens: [clean-architecture](../../methods/lenses/clean-architecture.md). The lens reviews the whole rule, including what no check flags. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
19
12
 
20
- **Reactions to distrust.**
21
- - "It's just one import." It is the direction that matters; one import is how it reverses.
13
+ ## Spirit
22
14
 
23
- **Principles behind it.**
24
- - *The Dependency Rule* (Robert C. Martin, *Clean Architecture*). Source dependencies point only inward.
25
- - *Ports and adapters* (Alistair Cockburn, hexagonal architecture). The core declares ports; the outside implements them.
15
+ Start from the symptom a finding names: [Inner layer imports outer](../typescript/symptoms.md#inner-layer-imports-outer). Each symptom names the cases it may indicate and the rules they point at. The why is on [External behaviour sits at a boundary](../principles.md#external-behaviour-sits-at-a-boundary).
@@ -1,6 +1,8 @@
1
1
  # CD-14 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: what each check flags and misses, how to fix a flagged site, and how to record an exception.
3
+ Symptoms: [Authored class or this](../typescript/symptoms.md#authored-class-or-this) and [Library class built in place](../typescript/symptoms.md#library-class-built-in-place).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: what each check flags and misses, how to fix a flagged site, and how to record an exception.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -2,27 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Behaviour is composed from functions and closures, not authored classes — state lives in a factory that closes over it. A class appears only where an external library's API demands `new` at the call site; that instance is created inside the wrapping factory and held internally, never re-exported as a class. The rule is per-declaration, not per-export: even a non-exported authored class is a violation.
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ, and [Every CD](../numbers.md) maps each number to its names.
6
6
 
7
- Review lens: [function-first](../../methods/lenses/function-first.md). The lens reviews the whole rule, including what no check flags. What each check flags, how to fix a flagged site, and how to record an exception: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
8
-
9
- ## Spirit
7
+ **Verdict.** Splits: no-class recipe; Outside dependencies stay at boundaries; state a case.
10
8
 
11
- **What the friction is for.** A class bundles state, behaviour and identity, and invites inheritance as a way to share code. The friction makes a factory closing over its state the easy shape, so state is private by construction and behaviour is plain functions.
9
+ **Read.** [Closure factory](../typescript/recipes.md#closure-factory), [Outside dependencies stay at boundaries](../rules.md#outside-dependencies-stay-at-boundaries) and Keeps state or settings across calls ([cases](../cases.md#no-hidden-effects)).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *State that changes between calls.* The class holds counters, caches or buffers. Replace it with a factory that keeps them in private bindings and returns functions.
15
- - *A namespace with a constructor.* The methods only read configuration, or the members are all static. Make them plain functions that take that configuration as an argument.
16
- - *Inheritance used for reuse.* A base class shares behaviour. Compose functions instead.
17
- - *A library class spreading.* A library's class is built in many places or handed out. Build it once inside its wrapping factory and expose functions.
18
-
19
- **Where to go.** No authored classes. A library class is built only in its wrapping factory and never leaves it as a class.
11
+ Review lens: [function-first](../../methods/lenses/function-first.md). The lens reviews the whole rule, including what no check flags. What each check flags, how to fix a flagged site, and how to record an exception: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
20
12
 
21
- **Reactions to distrust.**
22
- - "Classes are just syntax." The concern is state hidden behind a shared reference and reuse by inheritance, not the keyword.
23
- - "The library needs `new`." The rule allows that, inside the wrapping factory.
24
- - "Errors need classes." Operational failures are plain data returned as results (CD-9, CD-11).
13
+ ## Spirit
25
14
 
26
- **Principles behind it.**
27
- - *Favour composition over inheritance* (Gamma, Helm, Johnson and Vlissides, *Design Patterns*). Behaviour assembled from parts changes more safely than behaviour inherited from a base.
28
- - *Ports and adapters* (Alistair Cockburn, hexagonal architecture). A library's class belongs inside its adapter, behind your own functions.
15
+ Start from the symptom a finding names: [Authored class or this](../typescript/symptoms.md#authored-class-or-this) and [Library class built in place](../typescript/symptoms.md#library-class-built-in-place). Each symptom names the cases it may indicate and the rules they point at. The why is on [No hidden effects](../principles.md#no-hidden-effects) and [External behaviour sits at a boundary](../principles.md#external-behaviour-sits-at-a-boundary).
@@ -1,6 +1,8 @@
1
1
  # CD-15 checks
2
2
 
3
- Read [the rule and its spirit](README.md) first. This page is the mechanics: what each check flags and misses, how to fix a flagged site, and how to record an exception.
3
+ Symptom: [Loop keyword](../typescript/symptoms.md#loop-keyword).
4
+
5
+ Read [the verdict and the named pages it points at](README.md) first. This page is the mechanics: what each check flags and misses, how to fix a flagged site, and how to record an exception.
4
6
 
5
7
  ## Clauses
6
8
 
@@ -28,6 +30,8 @@ const totals = orders.map((order) => order.total);
28
30
  ```
29
31
  Replace a counted loop with `Array.from({ length }, (_, position) => ...)`.
30
32
 
33
+ In a test file, `CD-27#test-body-logic` flags `map` at either edition, and its edition 2 flags `Array.from`: write the values out instead, as [CD-27's allowed forms](../CD-27/CHECKS.md#allowed-forms-in-a-test) show.
34
+
31
35
  ## Exceptions
32
36
  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 no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
33
37