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

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 (133) hide show
  1. package/ADOPTING.md +4 -15
  2. package/CHANGELOG.md +34 -0
  3. package/MIGRATING.md +6 -6
  4. package/README.md +3 -4
  5. package/chunks/{chunk-FPIP7JEC.js → chunk-4AJQHZ7I.js} +1 -1
  6. package/chunks/{chunk-CXM5KBZX.js → chunk-6LTJRJOE.js} +1 -1
  7. package/chunks/{chunk-PVSC4SE3.js → chunk-BISP2JOL.js} +4 -6
  8. package/chunks/{chunk-YGMO5Z6U.js → chunk-EFUWHLZK.js} +187 -193
  9. package/chunks/{chunk-BRANVR7K.js → chunk-FRE5IA3C.js} +1 -1
  10. package/chunks/{chunk-E4D5WDRX.js → chunk-GMLT3MHO.js} +252 -254
  11. package/chunks/chunk-M4VSJ27S.js +139 -0
  12. package/chunks/chunk-ND3EOGDK.js +2350 -0
  13. package/chunks/chunk-ONDBACCR.js +14332 -0
  14. package/chunks/{chunk-LD766VWU.js → chunk-U6W65ZOF.js} +31 -2
  15. package/chunks/{chunk-BKQ3K766.js → chunk-WPEOCLTP.js} +39 -33
  16. package/chunks/{chunk-A3RL4O5V.js → chunk-XNIXPQQ5.js} +35 -2
  17. package/docs/extending.md +2 -2
  18. package/methods/lenses/function-first.md +2 -2
  19. package/package.json +1 -1
  20. package/rules/README.md +5 -3
  21. package/rules/SPIRIT.md +1 -1
  22. package/rules/numbers.md +4 -4
  23. package/rules/principles/no-leak-across-a-boundary.md +1 -1
  24. package/rules/principles.md +1 -1
  25. package/rules/record-kinds/authorised-location.md +1 -1
  26. package/rules/records.md +11 -19
  27. package/rules/rules.md +5 -5
  28. package/rules/sources.md +6 -7
  29. package/rules/typescript/checks.md +55 -387
  30. package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
  31. package/rules/typescript/recipes/assert-to-narrow.md +114 -4
  32. package/rules/typescript/recipes/closure-factory.md +5 -5
  33. package/rules/typescript/recipes/companion-test-file.md +5 -3
  34. package/rules/typescript/recipes/composed-orchestrator.md +6 -4
  35. package/rules/typescript/recipes/composition-root.md +5 -3
  36. package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
  37. package/rules/typescript/recipes/copy-never-write-in.md +6 -4
  38. package/rules/typescript/recipes/declared-not-bundled.md +5 -3
  39. package/rules/typescript/recipes/dependency-record.md +5 -3
  40. package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
  41. package/rules/typescript/recipes/entity-module.md +8 -5
  42. package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
  43. package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
  44. package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
  45. package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
  46. package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
  47. package/rules/typescript/recipes/functional-iteration.md +8 -3
  48. package/rules/typescript/recipes/guard-clauses.md +5 -3
  49. package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
  50. package/rules/typescript/recipes/integration-test-suffix.md +5 -3
  51. package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
  52. package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
  53. package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
  54. package/rules/typescript/recipes/named-exported-type.md +5 -3
  55. package/rules/typescript/recipes/narrow-ports.md +5 -3
  56. package/rules/typescript/recipes/one-argument-object.md +8 -3
  57. package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
  58. package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
  59. package/rules/typescript/recipes/repo-scripts-only.md +5 -3
  60. package/rules/typescript/recipes/result-union.md +5 -5
  61. package/rules/typescript/recipes/screaming-folders.md +5 -5
  62. package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
  63. package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
  64. package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
  65. package/rules/typescript/recipes/whole-words.md +5 -3
  66. package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
  67. package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
  68. package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
  69. package/rules/typescript/recipes.md +567 -21
  70. package/rules/typescript/symptoms/ambient-randomness.md +1 -1
  71. package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
  72. package/rules/typescript/symptoms/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site.md +1 -1
  73. package/rules/typescript/symptoms/{assertion-outside-a-test.md → assertion-outside-a-test-body.md} +1 -1
  74. package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
  75. package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
  76. package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
  77. package/rules/typescript/symptoms/{code-or-prose-read-as-text.md → code-or-prose-read-as-text-in-a-test.md} +2 -2
  78. package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
  79. package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
  80. package/rules/typescript/symptoms/date-used-directly.md +1 -1
  81. package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
  82. package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +1 -18
  83. package/rules/typescript/symptoms/double-with-a-body.md +1 -1
  84. package/rules/typescript/symptoms/{export-from-a-test-file.md → export-from-a-test.md} +1 -1
  85. package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
  86. package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +1 -1
  87. package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
  88. package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
  89. package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
  90. package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
  91. package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
  92. package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
  93. package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
  94. package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
  95. package/rules/typescript/symptoms/process-global-used-in-place.md +1 -1
  96. package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
  97. package/rules/typescript/symptoms/rebinding.md +11 -1
  98. package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
  99. package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
  100. package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
  101. package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
  102. package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +1 -1
  103. package/rules/typescript/symptoms/unasserted-call.md +1 -1
  104. package/rules/typescript/symptoms.md +35 -35
  105. package/src/domain/language-layer/authored-item-types.d.ts +21 -5
  106. package/src/domain/runner/runner-result-types.d.ts +1 -2
  107. package/src/eslint-plugin.js +40 -38
  108. package/src/hone.js +15 -13638
  109. package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
  110. package/src/infrastructure/engines/eslint/runner/runner.js +55 -45
  111. package/src/infrastructure/engines/walker/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site/assertion-site.js +1 -1
  112. package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +39 -65
  113. package/src/infrastructure/engines/walker/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read/raw-read.js +1 -1
  114. package/src/infrastructure/engines/walker/{export-from-a-test-file → export-from-a-test}/test-file-export/test-file-export.js +1 -1
  115. package/src/infrastructure/engines/walker/runner/runner.js +10 -10
  116. package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +3 -3
  117. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +15 -3
  118. package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +118 -4
  119. package/src/measure-engines.process.js +80 -0
  120. package/src/testing.js +81 -9
  121. package/chunks/chunk-7FVSZ2VL.js +0 -1304
  122. package/chunks/chunk-BIDD2YWP.js +0 -398
  123. package/rules/record-kinds/boundary-record.md +0 -9
  124. package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
  125. package/rules/typescript/recipes/stub-with-vifn.md +0 -20
  126. /package/rules/typescript/symptoms/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read.md +0 -0
  127. /package/rules/typescript/symptoms/{export-from-a-test-file → export-from-a-test}/test-file-export.md +0 -0
  128. /package/src/infrastructure/engines/walker/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site/assertion-site.examples.json +0 -0
  129. /package/src/infrastructure/engines/walker/{assertion-outside-a-test → assertion-outside-a-test-body}/assertion-site/piece.json +0 -0
  130. /package/src/infrastructure/engines/walker/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read/piece.json +0 -0
  131. /package/src/infrastructure/engines/walker/{code-or-prose-read-as-text → code-or-prose-read-as-text-in-a-test}/raw-read/raw-read.examples.json +0 -0
  132. /package/src/infrastructure/engines/walker/{export-from-a-test-file → export-from-a-test}/test-file-export/piece.json +0 -0
  133. /package/src/infrastructure/engines/walker/{export-from-a-test-file → export-from-a-test}/test-file-export/test-file-export.examples.json +0 -0
@@ -1,398 +0,0 @@
1
- import {
2
- ownedNameText,
3
- sameOwnedName
4
- } from "./chunk-FPIP7JEC.js";
5
- import {
6
- TOOL_RULE_SET,
7
- checkAddressTextOf
8
- } from "./chunk-BKQ3K766.js";
9
-
10
- // src/domain/settings/settings-file.ts
11
- var SETTINGS_FILE_NAME = "hone.config.json";
12
- var VERSION_ONE_SETTINGS_FILE_NAME = "disciplines.json";
13
- var RENAMED_SETTINGS = [
14
- { name: "confinedOutsideDependencies", pieceName: "confinedPackages" }
15
- ];
16
- var eslintConfigLookupOf = (request) => request.declared === void 0 ? { lookup: "detected" } : { lookup: "declared", value: request.declared };
17
-
18
- // src/domain/repository/exclusion.ts
19
- var exclusionOf = (request) => request.excluded.some(
20
- (excludedPath) => request.path === excludedPath || request.path.startsWith(`${excludedPath}/`)
21
- ) ? "excluded" : "checked";
22
-
23
- // src/domain/records/answering/outside-dependency.ts
24
- var NPM_PREFIX = "npm:";
25
- var SCOPE_MARK = "@";
26
- var VERSION_MARK = "@";
27
- var SCOPED_NAME_SEGMENTS = 2;
28
- var UNSCOPED_NAME_SEGMENTS = 1;
29
- var withoutNpmPrefix = (request) => request.specifier.startsWith(NPM_PREFIX) ? request.specifier.slice(NPM_PREFIX.length) : request.specifier;
30
- var withoutVersion = (request) => {
31
- const versionAt = request.segment.indexOf(VERSION_MARK);
32
- return versionAt === -1 ? request.segment : request.segment.slice(0, versionAt);
33
- };
34
- var dependencyOf = (request) => {
35
- const bare = withoutNpmPrefix(request);
36
- const nameSegments = bare.startsWith(SCOPE_MARK) ? SCOPED_NAME_SEGMENTS : UNSCOPED_NAME_SEGMENTS;
37
- const segments = bare.split("/");
38
- const scope = segments.slice(0, nameSegments - 1);
39
- const name = segments.slice(nameSegments - 1, nameSegments).map((segment) => withoutVersion({ segment }));
40
- return [...scope, ...name].join("/");
41
- };
42
- var banStandingOf = (request) => request.namedBans.some(
43
- (ban) => ban.outsideDependency.toLowerCase() === request.dependency.toLowerCase()
44
- ) ? "banned" : "not-banned";
45
-
46
- // src/domain/records/answering/record-reach.ts
47
- var FOLDER_SEPARATOR = "/";
48
- var IMPORTED_PARTY_SYMPTOMS = [
49
- "outside-import-past-a-boundary",
50
- "library-class-built-in-place",
51
- "outside-type-in-a-signature"
52
- ];
53
- var RUNTIME_REACH = {
54
- clock: ["date-used-directly"],
55
- random: ["ambient-randomness"],
56
- process: ["process-global-used-in-place"],
57
- json: ["text-past-its-reader"]
58
- };
59
- var everyHolds = (request) => request.holdings.every((holding) => holding === "holds") ? "holds" : "does-not-hold";
60
- var sameName = (request) => request.left === request.right ? "holds" : "does-not-hold";
61
- var namedIn = (request) => request.names.includes(request.name) ? "holds" : "does-not-hold";
62
- var toolSymptomNamedIn = (request) => request.symptom.ruleSet === TOOL_RULE_SET ? namedIn({ name: request.symptom.name, names: request.names }) : "does-not-hold";
63
- var sameSymptom = (request) => sameOwnedName(request) === "same" ? "holds" : "does-not-hold";
64
- var reachesCheck = (request) => {
65
- const { reach, check } = request;
66
- switch (reach.reaches) {
67
- case "whole-symptom":
68
- return "holds";
69
- case "one-check":
70
- return check.found === "check" ? sameName({ left: check.check.name, right: reach.check.name }) : "does-not-hold";
71
- case "unknown-check":
72
- return "does-not-hold";
73
- }
74
- };
75
- var reachesSymptom = (request) => everyHolds({
76
- holdings: [
77
- sameSymptom({ left: request.symptom, right: request.site.symptom }),
78
- reachesCheck({ reach: request.reach, check: request.site.check })
79
- ]
80
- });
81
- var clearOfOutsideParties = (request) => toolSymptomNamedIn({ symptom: request.symptom, names: IMPORTED_PARTY_SYMPTOMS }) === "holds" ? "does-not-hold" : "holds";
82
- var reachOf = (request) => {
83
- switch (request.party.kind) {
84
- case "package":
85
- case "scheme-module":
86
- return IMPORTED_PARTY_SYMPTOMS;
87
- case "runtime":
88
- return RUNTIME_REACH[request.party.facility];
89
- }
90
- };
91
- var moduleCovers = (request) => request.file === request.module || request.file.startsWith(`${request.module}${FOLDER_SEPARATOR}`) ? "holds" : "does-not-hold";
92
- var recipeOfSymptom = (request) => request.symptom.recipes.some(
93
- (recipe) => sameOwnedName({ left: recipe, right: request.record.recipe }) === "same"
94
- ) ? "holds" : "does-not-hold";
95
- var importedPartyClearOfBans = (request) => {
96
- switch (request.party.reported) {
97
- case "not-reported":
98
- return "does-not-hold";
99
- case "specifier":
100
- return banStandingOf({
101
- namedBans: request.catalogue.namedBans,
102
- dependency: dependencyOf({ specifier: request.party.specifier })
103
- }) === "banned" ? "does-not-hold" : "holds";
104
- }
105
- };
106
- var deviationClearOfBans = (request) => clearOfOutsideParties({ symptom: request.site.symptom }) === "holds" ? "holds" : importedPartyClearOfBans({ party: request.site.party, catalogue: request.catalogue });
107
- var reportedPartyIs = (request) => {
108
- switch (request.party.kind) {
109
- case "package":
110
- return sameName({
111
- left: dependencyOf({ specifier: request.specifier }),
112
- right: request.party.dependency
113
- });
114
- case "scheme-module":
115
- return sameName({ left: request.specifier, right: request.party.specifier });
116
- case "runtime":
117
- return "does-not-hold";
118
- }
119
- };
120
- var boundaryPartyNamed = (request) => {
121
- if (request.record.outsideParty.kind === "runtime") {
122
- return "holds";
123
- }
124
- switch (request.site.party.reported) {
125
- case "not-reported":
126
- return "does-not-hold";
127
- case "specifier":
128
- return reportedPartyIs({
129
- party: request.record.outsideParty,
130
- specifier: request.site.party.specifier
131
- });
132
- }
133
- };
134
- var checksReachedBy = (request) => {
135
- const { record, catalogue } = request;
136
- switch (record.kind) {
137
- case "debt":
138
- case "authorised-location":
139
- return catalogue.checks.filter(
140
- (check) => reachesSymptom({
141
- symptom: record.symptom,
142
- reach: record.reach,
143
- site: { symptom: check.symptom, check: { found: "check", check } }
144
- }) === "holds"
145
- );
146
- case "deviation":
147
- return catalogue.checks.filter(
148
- (check) => recipeOfSymptom({ record, symptom: check.symptom }) === "holds"
149
- );
150
- case "boundary-record":
151
- return catalogue.checks.filter(
152
- (check) => toolSymptomNamedIn({
153
- symptom: check.symptom,
154
- names: reachOf({ party: record.outsideParty })
155
- }) === "holds"
156
- );
157
- case "dependency-record":
158
- return [];
159
- }
160
- };
161
- var placeOf = (request) => {
162
- const { record } = request;
163
- switch (record.kind) {
164
- case "debt":
165
- case "authorised-location":
166
- case "deviation":
167
- return { at: "file", file: record.file };
168
- case "boundary-record":
169
- return { at: "module", module: record.module };
170
- case "dependency-record":
171
- return void 0;
172
- }
173
- };
174
- var placesReachedBy = (request) => {
175
- const place = placeOf(request);
176
- return place === void 0 ? [] : checksReachedBy(request).map((check) => ({ check, place }));
177
- };
178
- var sitedAt = (request) => {
179
- const { record, site } = request;
180
- switch (record.kind) {
181
- case "debt":
182
- case "authorised-location":
183
- return everyHolds({
184
- holdings: [
185
- reachesSymptom({ symptom: record.symptom, reach: record.reach, site }),
186
- sameName({ left: record.file, right: site.file })
187
- ]
188
- });
189
- case "deviation":
190
- return everyHolds({
191
- holdings: [
192
- sameName({ left: record.file, right: site.file }),
193
- recipeOfSymptom({ record, symptom: site.symptom })
194
- ]
195
- });
196
- case "boundary-record":
197
- return everyHolds({
198
- holdings: [
199
- moduleCovers({ module: record.module, file: site.file }),
200
- toolSymptomNamedIn({
201
- symptom: site.symptom,
202
- names: reachOf({ party: record.outsideParty })
203
- })
204
- ]
205
- });
206
- case "dependency-record":
207
- return "does-not-hold";
208
- }
209
- };
210
- var partyHolds = (request) => {
211
- const { record } = request;
212
- switch (record.kind) {
213
- case "debt":
214
- case "authorised-location":
215
- case "dependency-record":
216
- return "holds";
217
- case "deviation":
218
- return deviationClearOfBans(request);
219
- case "boundary-record":
220
- return boundaryPartyNamed({ record, site: request.site });
221
- }
222
- };
223
- var holdsAt = (request) => everyHolds({
224
- holdings: [sitedAt({ record: request.record, site: request.site }), partyHolds(request)]
225
- });
226
-
227
- // src/domain/records/answering/records-by-place.ts
228
- var FOLDER_SEPARATOR2 = "/";
229
- var symptomKey = (request) => `symptom:${ownedNameText(request.symptom)}`;
230
- var addressKey = (request) => `check:${ownedNameText(request.address)}`;
231
- var checkKey = (request) => addressKey({
232
- address: {
233
- ruleSet: request.symptom.ruleSet,
234
- name: checkAddressTextOf({ check: { name: request.check, symptom: request.symptom } })
235
- }
236
- });
237
- var answeredByPlaceOf = (request) => new Map(
238
- [...Map.groupBy(request.answered, ({ file }) => file)].map(([file, answers]) => [
239
- file,
240
- new Set(
241
- answers.map(
242
- ({ ruleSet, symptom, check }) => check === void 0 ? symptomKey({ symptom: { ruleSet, name: symptom } }) : checkKey({ symptom: { ruleSet, name: symptom }, check })
243
- )
244
- )
245
- ])
246
- );
247
- var answeredAt = (request) => {
248
- const answers = request.byPlace.get(request.file);
249
- const { ruleSet } = request;
250
- return answers !== void 0 && (answers.has(symptomKey({ symptom: { ruleSet, name: request.symptom } })) || answers.has(addressKey({ address: { ruleSet, name: request.address } })));
251
- };
252
- var recipeKey = (request) => `recipe:${ownedNameText(request.recipe)}`;
253
- var symptomReachKeysOf = (request) => {
254
- const { symptom, reach } = request;
255
- switch (reach.reaches) {
256
- case "whole-symptom":
257
- return [symptomKey({ symptom })];
258
- case "one-check":
259
- return [checkKey({ symptom, check: reach.check.name })];
260
- case "unknown-check":
261
- return [];
262
- }
263
- };
264
- var reachKeysOf = (request) => {
265
- const { record } = request;
266
- switch (record.kind) {
267
- case "debt":
268
- case "authorised-location":
269
- return symptomReachKeysOf({ symptom: record.symptom, reach: record.reach });
270
- case "deviation":
271
- return [recipeKey({ recipe: record.recipe })];
272
- case "boundary-record":
273
- return reachOf({ party: record.outsideParty }).map(
274
- (name) => symptomKey({ symptom: { ruleSet: TOOL_RULE_SET, name } })
275
- );
276
- case "dependency-record":
277
- return [];
278
- }
279
- };
280
- var keyedOf = (request) => reachKeysOf({ record: request.placed.record }).map((key) => ({
281
- placed: request.placed,
282
- rank: request.rank,
283
- path: request.path,
284
- key
285
- }));
286
- var byPathAndKey = (request) => new Map(
287
- [...Map.groupBy(request.keyed, ({ path }) => path)].map(([path, entries]) => [
288
- path,
289
- Map.groupBy(entries, ({ key }) => key)
290
- ])
291
- );
292
- var recordsByPlaceOf = (request) => {
293
- const inFile = request.records.flatMap((placed, rank) => {
294
- const { record } = placed;
295
- return record.kind === "debt" || record.kind === "authorised-location" || record.kind === "deviation" ? keyedOf({ placed, rank, path: record.file }) : [];
296
- });
297
- const inModule = request.records.flatMap(
298
- (placed, rank) => placed.record.kind === "boundary-record" ? keyedOf({ placed, rank, path: placed.record.module }) : []
299
- );
300
- return {
301
- ranks: new Map(request.records.map((placed, rank) => [placed, rank])),
302
- inFile: byPathAndKey({ keyed: inFile }),
303
- inModule: byPathAndKey({ keyed: inModule })
304
- };
305
- };
306
- var rankEntry = (request) => [
307
- request.placed,
308
- request.rank
309
- ];
310
- var inRankOrder = (request) => [...request.ranked].toSorted(([, left], [, right]) => left - right).map(([placed]) => placed);
311
- var placedInRecordOrder = (request) => inRankOrder({
312
- ranked: new Map(
313
- [...request.records].flatMap((placed) => {
314
- const rank = request.byPlace.ranks.get(placed);
315
- return rank === void 0 ? [] : [rankEntry({ placed, rank })];
316
- })
317
- )
318
- });
319
- var siteKeysOf = (request) => {
320
- const { symptom, check } = request.site;
321
- return [
322
- symptomKey({ symptom }),
323
- ...check.found === "check" ? [checkKey({ symptom, check: check.check.name })] : [],
324
- ...symptom.recipes.map((recipe) => recipeKey({ recipe }))
325
- ];
326
- };
327
- var modulesCovering = (request) => {
328
- const parts = request.file.split(FOLDER_SEPARATOR2);
329
- return [...parts.keys()].map((end) => parts.slice(0, end + 1).join(FOLDER_SEPARATOR2));
330
- };
331
- var rankedAt = (request) => request.paths.flatMap((path) => {
332
- const byKey = request.byPath.get(path);
333
- return byKey === void 0 ? [] : request.keys.flatMap((key) => byKey.get(key) ?? []);
334
- });
335
- var recordsReachingSites = (request) => inRankOrder({
336
- ranked: new Map(
337
- request.sites.flatMap((site) => {
338
- const keys = siteKeysOf({ site });
339
- return [
340
- ...rankedAt({ byPath: request.byPlace.inFile, paths: [site.file], keys }),
341
- ...rankedAt({
342
- byPath: request.byPlace.inModule,
343
- paths: modulesCovering({ file: site.file }),
344
- keys
345
- })
346
- ].map(rankEntry);
347
- })
348
- )
349
- });
350
-
351
- // src/domain/repository/repo-path-of.ts
352
- var brandedAsRepoPath = (text) => text;
353
- var repoPathOf = (text) => {
354
- const plain = text;
355
- return brandedAsRepoPath(plain);
356
- };
357
- var repoPathBeneath = (request) => brandedAsRepoPath(`${request.parent}/${request.segment}`);
358
-
359
- // src/domain/repository/projection-outputs.ts
360
- var projectionOutputsOf = (request) => ({
361
- configuration: `hone.${request.engineName}.mjs`,
362
- declaration: `hone.${request.engineName}.d.mts`
363
- });
364
-
365
- // src/domain/repository/absolute-within.ts
366
- var BACKSLASH = "\\";
367
- var BACKSLASH_FORM = /^(?:[A-Za-z]:\\|\\\\)/;
368
- var absoluteWithin = (request) => {
369
- const separator = BACKSLASH_FORM.test(request.root) ? BACKSLASH : "/";
370
- const root = request.root.endsWith(separator) ? request.root.slice(0, -1) : request.root;
371
- return `${root}${separator}${request.file.replaceAll("/", separator)}`;
372
- };
373
-
374
- // src/infrastructure/engines/eslint/eslint-config-lookup.ts
375
- import { z } from "zod";
376
- var eslintConfigLookupSchema = z.enum(["nearest-to-file", "repository-root"]);
377
-
378
- export {
379
- repoPathOf,
380
- repoPathBeneath,
381
- projectionOutputsOf,
382
- SETTINGS_FILE_NAME,
383
- VERSION_ONE_SETTINGS_FILE_NAME,
384
- RENAMED_SETTINGS,
385
- eslintConfigLookupOf,
386
- exclusionOf,
387
- dependencyOf,
388
- banStandingOf,
389
- placesReachedBy,
390
- holdsAt,
391
- answeredByPlaceOf,
392
- answeredAt,
393
- recordsByPlaceOf,
394
- placedInRecordOrder,
395
- recordsReachingSites,
396
- eslintConfigLookupSchema,
397
- absoluteWithin
398
- };
@@ -1,9 +0,0 @@
1
- # Boundary record
2
-
3
- ```json
4
- {
5
- "phrase": "a boundary record"
6
- }
7
- ```
8
-
9
- - **Recorded in:** **A boundary record** is in `hone-records/boundary-records.json`: `module`, `outsideParty` (a runtime facility such as `runtime:clock`, or an outside module's specifier), the `ports` the module declares and an optional `conformist`. It says the module is where an outside party is met.
@@ -1,18 +0,0 @@
1
- # it.each over typed rows
2
-
3
- ```json
4
- {
5
- "serves": {
6
- "rule": "straight-through-tests"
7
- },
8
- "standing": "accepted",
9
- "reason": {
10
- "text": "\"It's just boilerplate for cases being tested.\"",
11
- "standing": "accepted"
12
- }
13
- }
14
- ```
15
-
16
- - **Method:** Several cases of one behaviour are one `it.each<Row>([...])`. `Row` is a declared type. Each row writes out its input and its expected output.
17
- - **You can tell because:** Every row is a literal. No row is built, mapped or picked.
18
- - **Industry name:** Parameterized Test (Meszaros), with rows typed and written out.
@@ -1,20 +0,0 @@
1
- # Stub with vi.fn
2
-
3
- ```json
4
- {
5
- "serves": {
6
- "rule": "written-out-answers"
7
- },
8
- "standing": "accepted",
9
- "reason": {
10
- "text": "\"these should be vi.fn, with mockResolvedValue, not custom async functions\"; \"Agents take fake to mean whatever they want it to mean right now.\" The framework's double has no body of ours to hold logic.",
11
- "standing": "accepted"
12
- }
13
- }
14
- ```
15
-
16
- - **Method:** Each collaborator is a `vi.fn()` declared as a const inside the test that uses it. Shared boilerplate or a mock builder is allowed where it hides none of three things: a wide interface, an assumption a test rests on, or coupling between tests. A shared double is therefore a symptom, suspect by default, not a breach. Its answer is `mockReturnValue` or `mockResolvedValue` with a written-out value. Each call is checked with `toHaveBeenCalledWith` and a written-out argument.
17
- - **You can tell because:** No double has a body, a branch or a table. Every call the unit makes is asserted.
18
- - **Industry name:** stub and spy; Test Stub (Meszaros, *xUnit Test Patterns*).
19
-
20
- A fake is not a recipe. It is a [deviation record](../../record-kinds/deviation.md), and the bar it must meet is: "Moving a fake is only allowed if the test cannot be done with deterministic stubs or hardcoded things."