@hailstails/hone 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/ADOPTING.md +8 -8
  2. package/CHANGELOG.md +14 -0
  3. package/MIGRATING.md +17 -0
  4. package/README.md +10 -10
  5. package/api/testing.js +2 -2
  6. package/chunks/{chunk-FEWCJU7H.js → chunk-2O46EB4E.js} +6 -0
  7. package/chunks/{chunk-6SM3HKWO.js → chunk-5U4VTFD5.js} +88 -51
  8. package/core/check/tool-command.js +379 -56
  9. package/core/mechanism-port/runner-result-types.d.ts +4 -0
  10. package/docs/adding-a-discipline-or-mechanism.md +2 -0
  11. package/docs/extending.md +1 -0
  12. package/docs/output-contract.md +17 -6
  13. package/mechanisms/audit/CD-27/test-body-logic.js +5 -2
  14. package/mechanisms/audit/runner/runner.js +5 -3
  15. package/mechanisms/eslint/runner/runner.js +7 -3
  16. package/methods/assessment-template.md +2 -2
  17. package/methods/lenses/clean-architecture.md +7 -8
  18. package/methods/lenses/defended-on-intent.md +2 -2
  19. package/methods/lenses/di-discipline.md +10 -13
  20. package/methods/lenses/function-first.md +16 -18
  21. package/package.json +1 -1
  22. package/rules/CD-1/CHECKS.md +4 -2
  23. package/rules/CD-1/README.md +6 -19
  24. package/rules/CD-10/CHECKS.md +5 -3
  25. package/rules/CD-10/README.md +6 -18
  26. package/rules/CD-11/CHECKS.md +4 -2
  27. package/rules/CD-11/README.md +6 -16
  28. package/rules/CD-12/CHECKS.md +4 -2
  29. package/rules/CD-12/README.md +6 -16
  30. package/rules/CD-13/CHECKS.md +4 -2
  31. package/rules/CD-13/README.md +6 -16
  32. package/rules/CD-14/CHECKS.md +3 -1
  33. package/rules/CD-14/README.md +6 -19
  34. package/rules/CD-15/CHECKS.md +3 -1
  35. package/rules/CD-15/README.md +5 -20
  36. package/rules/CD-16/CHECKS.md +3 -1
  37. package/rules/CD-16/README.md +6 -6
  38. package/rules/CD-17/CHECKS.md +3 -1
  39. package/rules/CD-17/README.md +6 -19
  40. package/rules/CD-18/CHECKS.md +4 -2
  41. package/rules/CD-18/README.md +6 -16
  42. package/rules/CD-19/CHECKS.md +8 -6
  43. package/rules/CD-19/README.md +6 -20
  44. package/rules/CD-2/CHECKS.md +5 -3
  45. package/rules/CD-2/README.md +6 -21
  46. package/rules/CD-20/CHECKS.md +3 -1
  47. package/rules/CD-20/README.md +6 -6
  48. package/rules/CD-21/CHECKS.md +4 -2
  49. package/rules/CD-21/README.md +6 -15
  50. package/rules/CD-22/CHECKS.md +4 -2
  51. package/rules/CD-22/README.md +6 -15
  52. package/rules/CD-23/CHECKS.md +5 -3
  53. package/rules/CD-23/README.md +6 -17
  54. package/rules/CD-24/CHECKS.md +3 -1
  55. package/rules/CD-24/README.md +6 -6
  56. package/rules/CD-25/CHECKS.md +3 -1
  57. package/rules/CD-25/README.md +5 -21
  58. package/rules/CD-26/CHECKS.md +5 -3
  59. package/rules/CD-26/README.md +6 -20
  60. package/rules/CD-27/CHECKS.md +16 -7
  61. package/rules/CD-27/README.md +6 -20
  62. package/rules/CD-28/CHECKS.md +4 -2
  63. package/rules/CD-28/README.md +6 -16
  64. package/rules/CD-29/CHECKS.md +4 -2
  65. package/rules/CD-29/README.md +6 -14
  66. package/rules/CD-3/CHECKS.md +3 -1
  67. package/rules/CD-3/README.md +6 -17
  68. package/rules/CD-30/CHECKS.md +4 -2
  69. package/rules/CD-30/README.md +6 -15
  70. package/rules/CD-31/CHECKS.md +4 -2
  71. package/rules/CD-31/README.md +6 -14
  72. package/rules/CD-32/CHECKS.md +3 -1
  73. package/rules/CD-32/README.md +2 -0
  74. package/rules/CD-33/CHECKS.md +3 -1
  75. package/rules/CD-33/README.md +2 -0
  76. package/rules/CD-34/CHECKS.md +3 -1
  77. package/rules/CD-34/README.md +2 -0
  78. package/rules/CD-39/CHECKS.md +3 -1
  79. package/rules/CD-39/README.md +2 -0
  80. package/rules/CD-4/CHECKS.md +4 -2
  81. package/rules/CD-4/README.md +6 -17
  82. package/rules/CD-40/CHECKS.md +3 -1
  83. package/rules/CD-40/README.md +6 -20
  84. package/rules/CD-41/CHECKS.md +4 -2
  85. package/rules/CD-41/README.md +6 -22
  86. package/rules/CD-42/CHECKS.md +3 -1
  87. package/rules/CD-42/README.md +6 -16
  88. package/rules/CD-43/CHECKS.md +3 -1
  89. package/rules/CD-43/README.md +6 -18
  90. package/rules/CD-44/CHECKS.md +3 -1
  91. package/rules/CD-44/README.md +6 -17
  92. package/rules/CD-45/CHECKS.md +4 -2
  93. package/rules/CD-45/README.md +6 -16
  94. package/rules/CD-46/CHECKS.md +3 -1
  95. package/rules/CD-46/README.md +2 -0
  96. package/rules/CD-47/CHECKS.md +4 -2
  97. package/rules/CD-47/README.md +4 -20
  98. package/rules/CD-5/CHECKS.md +4 -2
  99. package/rules/CD-5/README.md +6 -19
  100. package/rules/CD-6/CHECKS.md +3 -1
  101. package/rules/CD-6/README.md +6 -19
  102. package/rules/CD-7/CHECKS.md +3 -1
  103. package/rules/CD-7/README.md +6 -20
  104. package/rules/CD-7a/CHECKS.md +3 -1
  105. package/rules/CD-7a/README.md +6 -17
  106. package/rules/CD-8/CHECKS.md +3 -1
  107. package/rules/CD-8/README.md +6 -17
  108. package/rules/CD-9/CHECKS.md +4 -2
  109. package/rules/CD-9/README.md +6 -17
  110. package/rules/README.md +71 -54
  111. package/rules/SPIRIT.md +3 -3
  112. package/rules/cases.md +94 -0
  113. package/rules/numbers.md +155 -0
  114. package/rules/principles.md +89 -0
  115. package/rules/records.md +150 -0
  116. package/rules/rules.md +149 -0
  117. package/rules/sources.md +142 -0
  118. package/rules/typescript/checks.md +219 -0
  119. package/rules/typescript/recipes.md +361 -0
  120. package/rules/typescript/symptoms.json +1005 -0
  121. package/rules/typescript/symptoms.md +612 -0
@@ -1,6 +1,8 @@
1
1
  # CD-33 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
+ Outside the cases: no symptom. [Every CD](../numbers.md) says where each number went.
4
+
5
+ Read [the rule and its spirit](README.md) first; the [named pages](../README.md) govern where they differ. 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
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Rule
4
4
 
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) says where each number went.
6
+
5
7
  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
8
 
7
9
  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).
@@ -1,6 +1,8 @@
1
1
  # CD-34 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
+ Outside the cases: no symptom. [Every CD](../numbers.md) says where each number went.
4
+
5
+ Read [the rule and its spirit](README.md) first; the [named pages](../README.md) govern where they differ. 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
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Rule
4
4
 
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) says where each number went.
6
+
5
7
  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
8
 
7
9
  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).
@@ -1,6 +1,8 @@
1
1
  # CD-39 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
+ Outside the cases: no symptom. [Every CD](../numbers.md) says where each number went.
4
+
5
+ Read [the rule and its spirit](README.md) first; the [named pages](../README.md) govern where they differ. 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
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Rule
4
4
 
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ. Rules are referred to by name; a clause address is still how a check is cited today, as [Every CD](../numbers.md) says.
6
+
5
7
  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
8
 
7
9
  Review lens: none. A reviewer applies the rule text directly. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
@@ -1,6 +1,8 @@
1
1
  # CD-4 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: [Zod at the producer's adapter](../typescript/recipes.md#zod-at-the-producers-adapter). The outcome it protects is seen by [Schema past its adapter](../typescript/symptoms.md#schema-past-its-adapter).
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,25 +2,14 @@
2
2
 
3
3
  ## Rule
4
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.
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: [zod-boundary](../../methods/lenses/zod-boundary.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 the No leak case: [Zod at the producer's adapter](../typescript/recipes.md#zod-at-the-producers-adapter).
10
8
 
11
- **What the friction is for.** The boundary is the one place the program does not know the shape of what it receives. The friction makes checking it there the easy path, so everything inside can trust its types.
9
+ **Read.** [Zod at the producer's adapter](../typescript/recipes.md#zod-at-the-producers-adapter) and Reads data from outside ([cases](../cases.md#no-leak-across-a-boundary)).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Input trusted on arrival.* A request, file, environment value, or database row is used as if typed. Parse it with a schema at the seam.
15
- - *No clear seam.* Outside data enters in many places. Gather each source behind one adapter that parses it.
16
- - *Checks scattered inward.* Inner code tests fields for presence. That means nothing parsed at the edge; move the check there.
17
-
18
- **Where to go.** Every outside source has one seam that parses it into plain typed data. Nothing inside checks shape again.
11
+ Review lens: [zod-boundary](../../methods/lenses/zod-boundary.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 our own database." It is still outside the type system. Rows can be anything the schema has ever allowed.
22
- - "The client already validates." The server cannot rely on code it does not run.
13
+ ## Spirit
23
14
 
24
- **Principles behind it.**
25
- - *Parse, don't validate* (Alexis King). Parsing produces a typed value once; validation leaves the raw value to be checked again.
26
- - *Ports and adapters* (Alistair Cockburn, hexagonal architecture). Each outside system enters through one adapter, which is where its data is translated.
15
+ Start from the symptom a finding names: [Schema past its adapter](../typescript/symptoms.md#schema-past-its-adapter). Each symptom names the cases it may indicate and the rules they point at. The why is on [No leak across a boundary](../principles.md#no-leak-across-a-boundary).
@@ -1,6 +1,8 @@
1
1
  # CD-40 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: [Positional parameters](../typescript/symptoms.md#positional-parameters).
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,28 +2,14 @@
2
2
 
3
3
  ## Rule
4
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.
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.** Cases of One word everywhere, Handed what it uses.
10
8
 
11
- **What the friction is for.** Positional arguments make meaning depend on order, and nothing checks the order. The friction makes a labelled call the easy one, and turns what each function needs into a named shape a reader can see.
9
+ **Read.** [One word everywhere](../rules.md#one-word-everywhere), [Handed what it uses](../rules.md#handed-what-it-uses) and [One argument object](../typescript/recipes.md#one-argument-object).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Values that travel together without a name.* The same group of arguments passes through several functions. Name the group as one type.
15
- - *A function with several jobs.* It has many parameters because it serves many concerns. Split it.
16
- - *Flags steering behaviour.* An argument switches between modes. Split the function, or make the mode a named union.
17
- - *Asking for more than it uses.* Converting to one object invites passing a whole record. Take only the fields the function reads; tests then build only those.
18
-
19
- **Where to go.** Every function takes one object whose fields are named and minimal. Adding a field breaks no caller.
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
- - "Two parameters is fine." The rule asks for one named object. Two positional values already have an order to get wrong.
23
- - "The library dictates this callback." Then the callback is the boundary. Hand off to a single-object function on its first line.
24
- - "An object is more typing." It is a few characters at the call site, against every reader guessing the order.
13
+ ## Spirit
25
14
 
26
- **Principles behind it.**
27
- - *Function arguments* (Robert C. Martin, *Clean Code*). Each extra argument is something the reader must hold in mind and the caller can get wrong.
28
- - *Introduce Parameter Object* (Martin Fowler, *Refactoring*). The refactoring that names a group of values that travel together.
29
- - *Interface Segregation Principle* (Robert C. Martin, SOLID). The object asks for exactly the fields used, no more.
15
+ Start from the symptom a finding names: [Positional parameters](../typescript/symptoms.md#positional-parameters). Each symptom names the cases it may indicate and the rules they point at. The why is on [Our code reads in the common language](../principles.md#our-code-reads-in-the-common-language) and [One place decides](../principles.md#one-place-decides).
@@ -1,6 +1,8 @@
1
1
  # CD-41 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: [Long function](../typescript/symptoms.md#long-function), [Tangled function](../typescript/symptoms.md#tangled-function) and [Orchestrator that computes](../typescript/symptoms.md#orchestrator-that-computes).
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
 
@@ -50,7 +52,7 @@ const settle = (orders: Order[]) => {
50
52
  ```ts
51
53
  const settle = (orders: Order[]) => orders.filter(isPaid).forEach(refundEligibleLines);
52
54
  ```
53
- Move each branch into a named helper so the orchestrator only composes calls.
55
+ Move any computing or branching between calls into a named doer, so the orchestrator only composes calls.
54
56
 
55
57
  ## Exceptions
56
58
  Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file holds a function whose shape is fixed by an external contract. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
@@ -2,30 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- An orchestrator's body composes helper calls and assembles their results — nothing else. Inline branching or computation inside an orchestrator mixes two altitudes: the coordination it owns and the logic that belongs in a named helper. Keep orchestrators pure coordination so each level reads at one altitude.
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: [decomposition](../../methods/lenses/decomposition.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
10
-
11
- **What the friction is for.** A function that coordinates and computes at once has to be read at two levels of detail at once. The friction makes small named steps the easy shape, so each level reads as one idea.
7
+ **Verdict.** Keeps: [Doer or orchestrator](../rules.md#doer-or-orchestrator).
12
8
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Logic that never got a name.* A block of branching or computation sits inside a coordinator. Extract it into a named helper; the name says what it decides.
15
- - *One function with several jobs.* It validates, decides and performs, so it grows long and tangled. Split it by job.
16
- - *Failures checked inline.* Nesting deepens because each failure is handled in place. Return early on failure, or let helpers return results the coordinator only routes.
17
- - *Shapes that do not meet.* The coordinator reshapes data between calls because its helpers disagree. Align the helpers' inputs and outputs.
9
+ **Read.** [Doer or orchestrator](../rules.md#doer-or-orchestrator) and [Composed orchestrator](../typescript/recipes.md#composed-orchestrator).
18
10
 
19
- **What a finding does not point at.** A test suite's `describe` body is a list of cases, not a coordinator, so its length is not a finding. Splitting a suite only to shorten it adds nothing. The tests and helpers inside it are still functions, and each is judged on its own.
20
-
21
- **Where to go.** Coordinators read as a short list of named steps. Each helper does one thing at one level of detail.
11
+ Review lens: [decomposition](../../methods/lenses/decomposition.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).
22
12
 
23
- **Reactions to distrust.**
24
- - "It's only a little logic." A little logic in a coordinator is still a second level of detail to read. Give it a name.
25
- - "Splitting makes it harder to follow." Named steps read faster than inline logic once the names are honest.
26
- - "This branch is just plumbing." If it decides anything, it is logic. Name what it decides.
13
+ ## Spirit
27
14
 
28
- **Principles behind it.**
29
- - *Composed Method* (Kent Beck, *Smalltalk Best Practice Patterns*). A method is a sequence of calls to other methods, all at the same level of abstraction.
30
- - *One level of abstraction per function* (Robert C. Martin, *Clean Code*). Mixing coordination with detail forces the reader to switch levels mid-function.
31
- - *Functions should do one thing* (Robert C. Martin, *Clean Code*). A coordinator's one thing is coordinating; computing is a second thing.
15
+ Start from the symptom a finding names: [Long function](../typescript/symptoms.md#long-function), [Tangled function](../typescript/symptoms.md#tangled-function) and [Orchestrator that computes](../typescript/symptoms.md#orchestrator-that-computes). Each symptom names the cases it may indicate and the rules they point at. The why is on [One place decides](../principles.md#one-place-decides).
@@ -1,6 +1,8 @@
1
1
  # CD-42 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: [Work inside a condition](../typescript/symptoms.md#work-inside-a-condition).
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
 
@@ -2,24 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Unhappy paths are handled first as guard clauses that return early; the happy path is the final, un-nested return at the bottom. There is no `else` after an early return. Guarding first keeps the main path flat and readable, instead of burying it inside nested conditionals.
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: [decomposition](../../methods/lenses/decomposition.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.** Keeps: [Guard first](../rules.md#guard-first).
10
8
 
11
- **What the friction is for.** Nested conditions bury the main path. The friction makes "handle the failures first, then do the work" the easy shape, so the main path reads flat at the bottom.
9
+ **Read.** [Guard first](../rules.md#guard-first) and [Guard clauses](../typescript/recipes.md#guard-clauses).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *Failures handled after success.* The happy path sits inside an if and the failure in the else. Invert it: return early on failure.
15
- - *Several checks nested inside each other.* Each guard adds a level. Make each a separate early return.
16
- - *A function with two jobs.* Both branches do real work. Split it into two functions.
17
-
18
- **Where to go.** Guards at the top, each returning early. The final return is the happy path, with no else.
11
+ Review lens: [decomposition](../../methods/lenses/decomposition.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).
19
12
 
20
- **Reactions to distrust.**
21
- - "Single exit is cleaner." It forces nesting and a variable to carry the answer. Early returns keep each case in one place.
22
- - "The else makes it explicit." After a return, the else adds only indentation.
13
+ ## Spirit
23
14
 
24
- **Principles behind it.**
25
- - *Replace Nested Conditional with Guard Clauses* (Martin Fowler, *Refactoring*). Unusual cases leave early; the normal case reads straight down.
15
+ Start from the symptom a finding names: [Work inside a condition](../typescript/symptoms.md#work-inside-a-condition). Each symptom names the cases it may indicate and the rules they point at. The why is on [One place decides](../principles.md#one-place-decides).
@@ -1,6 +1,8 @@
1
1
  # CD-43 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: [Boolean in a signature](../typescript/symptoms.md#boolean-in-a-signature).
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
 
@@ -2,26 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- A boolean parameter, field, or return is an evaluative predicate the reader must decode at every call site — `true` for what? Prefer a string-literal or discriminated union that states the meaning in the value itself. Booleans that name a state or mode hide that meaning behind a bare truth value.
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.** Keeps: [Kinds are named](../rules.md#kinds-are-named).
10
8
 
11
- **What the friction is for.** A bare true or false says nothing about what it means. The friction makes naming the state the easy path, so a call site reads as what it does.
9
+ **Read.** [Kinds are named](../rules.md#kinds-are-named) and [Tagged union and exhaustive switch](../typescript/recipes.md#tagged-union-and-exhaustive-switch).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *A mode passed as a flag.* A parameter switches the function between behaviours. Split the function, or name the modes as a union.
15
- - *A state that will grow.* Today it is on or off; tomorrow there is a third case and a second flag. Name the states now.
16
- - *Two flags that cannot both be true.* Pairs of booleans allow combinations that make no sense. One union rules them out.
17
- - *An outcome as a boolean.* A result says success or not, and the reason is lost. Return a tagged outcome.
18
-
19
- **Where to go.** States and modes are named values. A reader learns the meaning from the value itself.
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 obviously a yes or no." Then name what yes means. If that is easy, the union is easy.
23
- - "The library returns a boolean." Read it at the boundary and turn it into your own named state there.
13
+ ## Spirit
24
14
 
25
- **Principles behind it.**
26
- - *Make illegal states unrepresentable* (Yaron Minsky). A union of named states rules out the combinations flags allow.
27
- - *Flag arguments* (Robert C. Martin, *Clean Code*). A boolean argument announces that the function does more than one thing.
15
+ Start from the symptom a finding names: [Boolean in a signature](../typescript/symptoms.md#boolean-in-a-signature). 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-44 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: [Write into a parameter](../typescript/symptoms.md#write-into-a-parameter) and [Rebinding](../typescript/symptoms.md#rebinding).
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
 
@@ -2,25 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- A function never mutates the fields of the parameters it receives — no assigning to a parameter's property, no pushing into a parameter's array, no sorting it in place. It returns new data instead. Mutating an input makes the function's effect invisible at the call site and couples the caller to an order of operations it cannot see.
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: [decomposition](../../methods/lenses/decomposition.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.** Cases of [No hidden effects](../principles.md#no-hidden-effects).
10
8
 
11
- **What the friction is for.** A function that changes its inputs has an effect the call site cannot see. The friction makes returning new data the easy path, so every change is visible where it is used.
9
+ **Read.** [No hidden effects](../principles.md#no-hidden-effects) and [Copy, never write in](../typescript/recipes.md#copy-never-write-in).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *A function that both answers and changes.* It returns something and also edits what it was given. Return the new value; leave the input alone.
15
- - *Ownership nobody decided.* Several functions edit one shared object in turn. Decide who builds the value, and pass results forward instead.
16
- - *In-place sorting or pushing for convenience.* A library call mutates by default. Use the copying form, or copy first.
17
- - *Accumulators passed in.* A collection is handed in to be filled. Return the items and let the caller combine them.
18
-
19
- **Where to go.** Inputs are read-only. Functions return new values, and the caller decides what to keep.
11
+ Review lens: [decomposition](../../methods/lenses/decomposition.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
- - "Copying is slow." Usually unmeasured, and the rule makes no performance carve-out.
23
- - "The caller wants the change." Then return it, and the caller can see it.
13
+ ## Spirit
24
14
 
25
- **Principles behind it.**
26
- - *Functional core, imperative shell* (Gary Bernhardt). The core takes values and returns values; changes happen at the edge.
15
+ Start from the symptom a finding names: [Write into a parameter](../typescript/symptoms.md#write-into-a-parameter) and [Rebinding](../typescript/symptoms.md#rebinding). 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).
@@ -1,6 +1,8 @@
1
1
  # CD-45 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: [Schema past its adapter](../typescript/symptoms.md#schema-past-its-adapter).
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
- Validation runs exactly once, at the boundary crossing, and yields a plain internal shape the rest of the code trusts by construction — it is never re-run deeper in, and the validation library's types never leak inward. Parse once at the seam, map to a domain shape, and let the inner layers depend on that shape, not on the validator.
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: [zod-boundary](../../methods/lenses/zod-boundary.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.** Cases of [No leak across a boundary](../principles.md#no-leak-across-a-boundary).
10
8
 
11
- **What the friction is for.** Checking the same data twice means nobody trusts the first check, and the validator's types spread inward. The friction makes parsing once and handing on a plain shape the easy path.
9
+ **Read.** [No leak across a boundary](../principles.md#no-leak-across-a-boundary), Reads data from outside ([cases](../cases.md#no-leak-across-a-boundary)) and [Zod at the producer's adapter](../typescript/recipes.md#zod-at-the-producers-adapter).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *A boundary that does not finish its job.* The seam parses but passes the raw or validator-typed value on. Map it to a plain domain shape there.
15
- - *Inner code that does not trust its inputs.* Inner functions parse again. Give them the parsed type so the check is unnecessary.
16
- - *Validator types used as domain types.* The validation library's types appear in inner signatures. Declare your own types; the boundary maps to them.
17
-
18
- **Where to go.** One parse per crossing, at the seam. Inner layers depend on your own types, never on the validator.
11
+ Review lens: [zod-boundary](../../methods/lenses/zod-boundary.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
- - "Parsing again is safer." It is a sign the types inside cannot be trusted. Fix that instead.
13
+ ## Spirit
22
14
 
23
- **Principles behind it.**
24
- - *Parse, don't validate* (Alexis King). After one parse the type carries the proof; checking again adds nothing.
25
- - *Dependency Inversion Principle* (Robert C. Martin, SOLID). Inner layers depend on their own types, not on a library's.
15
+ Start from the symptom a finding names: [Schema past its adapter](../typescript/symptoms.md#schema-past-its-adapter). Each symptom names the cases it may indicate and the rules they point at. The why is on [No leak across a boundary](../principles.md#no-leak-across-a-boundary).
@@ -1,6 +1,8 @@
1
1
  # CD-46 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
+ Record kind: [Debt](../records.md#debt).
4
+
5
+ Read [the rule and its spirit](README.md) first; the [named pages](../README.md) govern where they differ. 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
  ## How it is checked
6
8
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Rule
4
4
 
5
+ This numbered page is the earlier form of this rule. The [named pages](../README.md) govern where they differ: only [debt](../records.md#debt) is forfeited on touch.
6
+
5
7
  A suppression or exemption is inherited debt held at rest, not a standing licence: it buys "leave this file alone", nothing more. The moment a change edits an exempt file, that file forfeits its exemption — the change must bring the whole file into compliance for the exempted rule (the new lines and the pre-existing ones the exemption was masking) and remove the exemption entry, in the same change. There is no partial credit and no extracting the touched code into a clean helper while the exempt file stays dirty. If full compliance is out of scope, the move is to not touch the file. This rule governs how every other exemption decays and can never itself be exempted.
6
8
 
7
9
  Review lens: none. A reviewer applies the rule text directly. How it is checked: [CHECKS.md](CHECKS.md). The thinking behind every rule: [the spirit of the rules](../SPIRIT.md).
@@ -1,6 +1,8 @@
1
1
  # CD-47 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: [Inherited environment in a subprocess](../typescript/symptoms.md#inherited-environment-in-a-subprocess).
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
 
@@ -11,7 +13,7 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
11
13
  ## What the check flags
12
14
  - Test files: `*.test.ts`, `*.test.tsx`, `*.test.mjs`, `*.test.js`, `*.spec.ts`, `*.spec.mjs`. Generated folders (`node_modules`, `dist`, `build`, `coverage`, `.git`, root `vendor`) are skipped; any other folder can be left out with `exclude` in disciplines.json.
13
15
  - A line calling `spawnSync`, `spawn`, `execFileSync`, `execFile`, `execSync`, `exec`, `execa` or `execaSync` with `"git"` (or `'git'`, or a template literal) as the first argument.
14
- - Allowed when, within that line and the next seven, an `env:` names `hermeticGitEnvironment`, `withoutInheritedGitBindings` or `environment`, and no nearby `env:` uses `process.env`. The helper is yours to provide.
16
+ - Allowed when, within that line and the next seven, an `env:` names `hermeticGitEnvironment`, `withoutInheritedGitBindings` or `environment`, and no nearby `env:` uses `process.env`. The environment comes from a unit of ours with its own test, not a test helper.
15
17
  - Not detected: a command string such as `execSync("git status")`, a split call, or a non-literal command. Whether the spawn is warranted at all is left to review.
16
18
 
17
19
  ## Example violation
@@ -2,30 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- A test may not touch its environment or cause any real side effect on anything real. "Anything real" is everything the test did not itself create and does not itself dispose: the developer's repository, their user configuration and home directory, any network or live service, shared filesystem paths, the system clock, and the ambient process environment.
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
- A test replaces the real subsystem with a test double. Spawning it is permitted in exactly one closed case: the subsystem's own observable behaviour is the assertion's subject and no test double can stand in for it. Setup, realism and convenience never qualify; state which assertion cannot be written against a test double, and if that sentence cannot be written, the test does not qualify. A qualifying test brings its own instance in a location it created and removes it afterwards; it never borrows the machine's.
7
+ **Verdict.** Cases under [Tested where it's owned](../rules.md#tested-where-its-owned).
8
8
 
9
- Real git is the mechanically checked class: a test that spawns a real `git` subprocess passes an explicit hermetic environment at that call site, and never inherits the ambient one.
9
+ **Read.** [Tested where it's owned](../rules.md#tested-where-its-owned) and [Integration test owns its scratch](../typescript/recipes.md#integration-test-owns-its-scratch).
10
10
 
11
11
  Review lens: [test-discipline](../../methods/lenses/test-discipline.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).
12
12
 
13
13
  ## Spirit
14
14
 
15
- **What the friction is for.** A test that touches real things can damage them, and can pass or fail depending on the machine. The friction makes replacing the subsystem with a test double the easy path, so tests are safe to run anywhere and give the same answer every time.
16
-
17
- **What a finding points at.** Match the sites against these causes.
18
- - *A subsystem reached directly.* The code under test calls the real process, network, or filesystem. Inject a port and pass a test double.
19
- - *Environment inherited by accident.* A spawned process picks up the developer's settings. Pass an explicit, created environment, or replace the process with a test double.
20
- - *Setup that borrows the machine.* The test uses shared paths, home configuration, or the system clock. Create what it needs and remove it afterwards, or use a test double.
21
- - *A real call used for convenience.* Realism or setup speed is the reason. Those never qualify; use a test double.
22
-
23
- **Where to go.** Tests replace every real subsystem with a test double. The rare test whose subject is a subsystem's own behaviour brings its own instance and removes it.
24
-
25
- **Reactions to distrust.**
26
- - "It works on my machine." That is the problem: it depends on your machine.
27
- - "A test double is more work." Once per subsystem, against every developer's environment being at risk.
28
-
29
- **Principles behind it.**
30
- - *Hermetic tests.* A test depends only on what it creates, so its result is the same on every machine.
31
- - *Erratic Test* (a test smell in Gerard Meszaros, *xUnit Test Patterns*). Tests that share or leak real resources pass or fail by circumstance.
15
+ Start from the symptom a finding names: [Inherited environment in a subprocess](../typescript/symptoms.md#inherited-environment-in-a-subprocess) and [Machine touched in a unit test](../typescript/symptoms.md#machine-touched-in-a-unit-test). Each symptom names the cases it may indicate and the rules they point at. The why is on [Tests are ours](../principles.md#tests-are-ours).
@@ -1,6 +1,8 @@
1
1
  # CD-5 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: [Untracked escape](../typescript/symptoms.md#untracked-escape).
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
 
@@ -38,7 +40,7 @@ const first = items[0]!;
38
40
  ```ts
39
41
  const first = items[0];
40
42
  ```
41
- Remove the need for the directive. If it must stay, add a tracked reference to the work that removes it: `// biome-ignore lint/style/noNonNullAssertion: until items is typed as a non-empty tuple (#42)`. The reference satisfies this clause only. A directive that escapes a selected clause, such as an `eslint-disable` naming a selected rule or a `@ts-expect-error` under `CD-2#cast-expressions`, still needs a file record on that clause, and that record does not satisfy this clause.
43
+ Remove the need for the directive. If it must stay, add a tracked reference to the work that removes it: `// biome-ignore lint/style/noNonNullAssertion: until items is typed as non-empty (#42)`. The reference satisfies this clause only. A directive that escapes a selected clause, such as an `eslint-disable` naming a selected rule or a `@ts-expect-error` under `CD-2#cast-expressions`, still needs a file record on that clause, and that record does not satisfy this clause.
42
44
 
43
45
  ## Exceptions
44
46
  Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file legitimately carries untracked directives, such as generated code. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
@@ -2,27 +2,14 @@
2
2
 
3
3
  ## Rule
4
4
 
5
- Code is self-documenting: the names, types, and schemas carry the meaning. A prose comment is almost always there to excuse an unclear name or a convoluted expression — so the fix is to clarify the code, not annotate it. The only permitted annotations are machine-meaningful directives that carry a tracked reference; explanatory comments and doc-comments are not.
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: [naming](../../methods/lenses/naming.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: One word everywhere; Declared, not asserted; records.
10
8
 
11
- **What the friction is for.** Prose beside code drifts from the code, and nothing checks it. The friction makes a clear name the cheap fix, and makes every "the checker is wrong here" marker point at the work that removes it.
9
+ **Read.** [One word everywhere](../rules.md#one-word-everywhere), [Declared, not asserted](../rules.md#declared-not-asserted), [Meaning in names, not comments](../typescript/recipes.md#meaning-in-names-not-comments) and [records](../records.md).
12
10
 
13
- **What a finding points at.** Match the sites against these causes.
14
- - *A name that says too little.* The comment explains what the name should. Rename, or extract a named function.
15
- - *A rule the types do not hold.* The comment states an invariant. Move it into a type, a union or a schema, where it is checked.
16
- - *A suppression standing in for a fix.* The directive silences another rule. That rule's finding is the real one; read its Spirit section.
17
- - *A promise nobody holds.* An untracked TODO. Track it or do it.
18
-
19
- **Where to go.** Names, types and schemas carry the meaning, with no prose beside them. Each directive that remains carries a tracked reference to the work that retires it, so the count of directives falls over time rather than settling.
11
+ Review lens: [naming](../../methods/lenses/naming.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
- - "This needs explaining." Then the code is not yet clear. The explanation is the brief for a better name.
23
- - "Add a tracked reference and move on." A reference that excuses the escape instead of retiring it is the same hole with a label.
24
- - "It's generated." Then that file is a boundary. Authorise it, and keep hand-written code clean.
13
+ ## Spirit
25
14
 
26
- **Principles behind it.**
27
- - *Intention-revealing names* (Robert C. Martin, *Clean Code*). Clean Code treats a comment as compensating for code that failed to express its intent; the fix is in the code.
28
- - *Make illegal states unrepresentable* (Yaron Minsky). An invariant stated in a type is checked on every change; the same invariant in a comment is checked by nobody.
15
+ Start from the symptom a finding names: [Untracked escape](../typescript/symptoms.md#untracked-escape) and [Prose in code](../typescript/symptoms.md#prose-in-code). Each symptom names the cases it may indicate and the rules they point at. The why is on [Our code reads in the common language](../principles.md#our-code-reads-in-the-common-language).
@@ -1,6 +1,8 @@
1
1
  # CD-6 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: [Shorthand name](../typescript/symptoms.md#shorthand-name) and [Name off its casing](../typescript/symptoms.md#name-off-its-casing).
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