@hailstails/hone 2.0.0-pre.3 → 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.
- package/ADOPTING.md +9 -20
- package/CHANGELOG.md +104 -0
- package/MIGRATING.md +18 -9
- package/README.md +15 -17
- package/chunks/chunk-3CWFUD5B.js +38 -0
- package/chunks/chunk-4AJQHZ7I.js +191 -0
- package/chunks/chunk-5AKHEW6V.js +15 -0
- package/chunks/{chunk-L7BGRC6D.js → chunk-6LTJRJOE.js} +1 -1
- package/chunks/chunk-75XWZYNN.js +64 -0
- package/chunks/{chunk-ASUN4AVC.js → chunk-BISP2JOL.js} +73 -9
- package/chunks/chunk-COQMPHWZ.js +37 -0
- package/chunks/chunk-D6645WPB.js +6 -0
- package/chunks/chunk-DJMF6JIM.js +42 -0
- package/chunks/chunk-EBX57Z3V.js +8 -0
- package/chunks/chunk-EFUWHLZK.js +426 -0
- package/chunks/chunk-FHVNKG5Q.js +19 -0
- package/chunks/{chunk-NRIQD3PI.js → chunk-FRE5IA3C.js} +3 -5
- package/chunks/{chunk-OKLYWD2Z.js → chunk-GMLT3MHO.js} +262 -257
- package/chunks/{chunk-QP5TLOBY.js → chunk-HVZVKZPW.js} +12 -9
- package/chunks/chunk-LEFM7OPS.js +41 -0
- package/chunks/chunk-LNMDMRGQ.js +51 -0
- package/chunks/chunk-M4VSJ27S.js +139 -0
- package/chunks/{chunk-RGSHTPLA.js → chunk-MBEDAFVC.js} +3 -11
- package/chunks/chunk-ND3EOGDK.js +2350 -0
- package/chunks/chunk-ONDBACCR.js +14332 -0
- package/chunks/chunk-OO5KV7KN.js +17 -0
- package/chunks/chunk-SKDQ3QJD.js +75 -0
- package/chunks/chunk-U6W65ZOF.js +86 -0
- package/chunks/chunk-W5OIAUDW.js +18 -0
- package/chunks/{chunk-GNOMK7CR.js → chunk-WPEOCLTP.js} +495 -52
- package/chunks/chunk-X73RZUPO.js +63 -0
- package/chunks/chunk-XE2KKWYH.js +45 -0
- package/chunks/chunk-XNIXPQQ5.js +179 -0
- package/chunks/chunk-YONPKP3C.js +15 -0
- package/docs/adding-a-discipline-or-mechanism.md +1 -1
- package/docs/extending.md +7 -388
- package/methods/lenses/function-first.md +2 -2
- package/package.json +7 -6
- package/rules/README.md +7 -5
- package/rules/SPIRIT.md +1 -1
- package/rules/numbers.md +4 -4
- package/rules/principles/no-leak-across-a-boundary.md +1 -1
- package/rules/principles.md +1 -1
- package/rules/record-kinds/authorised-location.md +1 -1
- package/rules/records.md +11 -19
- package/rules/rules.md +5 -5
- package/rules/sources.md +6 -7
- package/rules/typescript/checks.md +280 -394
- package/rules/typescript/recipes/adapter-per-outside-party.md +10 -5
- package/rules/typescript/recipes/assert-to-narrow.md +114 -4
- package/rules/typescript/recipes/closure-factory.md +5 -5
- package/rules/typescript/recipes/companion-test-file.md +5 -3
- package/rules/typescript/recipes/composed-orchestrator.md +6 -4
- package/rules/typescript/recipes/composition-root.md +5 -3
- package/rules/typescript/recipes/{bounded-context-generic.md → constrained-context-generic.md} +6 -4
- package/rules/typescript/recipes/copy-never-write-in.md +6 -4
- package/rules/typescript/recipes/declared-not-bundled.md +5 -3
- package/rules/typescript/recipes/dependency-record.md +5 -3
- package/rules/typescript/recipes/domain-vocabulary-list.md +5 -3
- package/rules/typescript/recipes/entity-module.md +8 -5
- package/rules/typescript/recipes/exact-pins-and-a-lock-file.md +5 -3
- package/rules/typescript/recipes/extension-outside-the-vendored-code.md +5 -3
- package/rules/typescript/recipes/failure-asserted-as-a-value.md +44 -4
- package/rules/typescript/recipes/failure-mapping-at-the-adapter.md +8 -5
- package/rules/typescript/recipes/fix-the-declaration-not-the-value.md +5 -3
- package/rules/typescript/recipes/functional-iteration.md +8 -3
- package/rules/typescript/recipes/guard-clauses.md +5 -3
- package/rules/typescript/recipes/integration-test-owns-its-scratch.md +5 -3
- package/rules/typescript/recipes/integration-test-suffix.md +5 -3
- package/rules/typescript/recipes/it-each-over-typed-rows.md +117 -0
- package/rules/typescript/recipes/map-out-at-the-adapter.md +36 -4
- package/rules/typescript/recipes/meaning-in-names-not-comments.md +5 -5
- package/rules/typescript/recipes/named-exported-type.md +5 -3
- package/rules/typescript/recipes/narrow-ports.md +5 -3
- package/rules/typescript/recipes/one-argument-object.md +8 -3
- package/rules/typescript/recipes/{port-in-the-domain.md → port-in-a-module-of-its-own.md} +7 -5
- package/rules/typescript/recipes/ports-in-the-argument.md +5 -3
- package/rules/typescript/recipes/repo-scripts-only.md +5 -3
- package/rules/typescript/recipes/result-union.md +5 -5
- package/rules/typescript/recipes/screaming-folders.md +5 -5
- package/rules/typescript/recipes/shared-strict-base-config.md +5 -5
- package/rules/typescript/recipes/stub-with-vi-fn.md +130 -0
- package/rules/typescript/recipes/tagged-union-and-exhaustive-switch.md +5 -3
- package/rules/typescript/recipes/whole-words.md +5 -3
- package/rules/typescript/recipes/whole-written-out-expectation.md +284 -4
- package/rules/typescript/recipes/world-values-through-a-port.md +5 -3
- package/rules/typescript/recipes/zod-at-the-producers-adapter.md +8 -3
- package/rules/typescript/recipes.md +567 -21
- package/rules/typescript/symptoms/ambient-randomness/random-call.md +10 -0
- package/rules/typescript/symptoms/ambient-randomness.md +1 -1
- package/rules/typescript/symptoms/answer-set-in-a-hook/hook-answer.md +10 -0
- package/rules/typescript/symptoms/answer-set-in-a-hook.md +1 -1
- package/rules/typescript/symptoms/assertion-outside-a-test-body/assertion-site.md +10 -0
- package/rules/typescript/symptoms/assertion-outside-a-test-body.md +25 -0
- package/rules/typescript/symptoms/branch-in-a-test/test-body.md +10 -184
- package/rules/typescript/symptoms/branch-in-a-test.md +11 -1
- package/rules/typescript/symptoms/built-unit-called-in-place/call-of-a-call.md +10 -0
- package/rules/typescript/symptoms/built-unit-called-in-place.md +25 -0
- package/rules/typescript/symptoms/claimed-type/non-null-assertions.md +1 -1
- package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md +10 -0
- package/rules/typescript/symptoms/code-or-prose-read-as-text-in-a-test.md +31 -0
- package/rules/typescript/symptoms/computed-value-in-a-test/test-body.md +26 -117
- package/rules/typescript/symptoms/computed-value-in-a-test.md +1 -1
- package/rules/typescript/symptoms/date-used-directly.md +1 -1
- package/rules/typescript/symptoms/default-for-a-required-value.md +1 -1
- package/rules/typescript/symptoms/double-with-a-body/logic-in-a-passed-function.md +2 -19
- package/rules/typescript/symptoms/double-with-a-body/stub-implementation.md +2 -2
- package/rules/typescript/symptoms/double-with-a-body.md +1 -1
- package/rules/typescript/symptoms/export-from-a-test/test-file-export.md +10 -0
- package/rules/typescript/symptoms/export-from-a-test.md +33 -0
- package/rules/typescript/symptoms/failure-shaped-as-success/empty-catch.md +10 -0
- package/rules/typescript/symptoms/failure-shaped-as-success.md +1 -1
- package/rules/typescript/symptoms/floating-version/version-selector.md +10 -0
- package/rules/typescript/symptoms/inherited-environment-in-a-subprocess/git-spawn-environment.md +2 -2
- package/rules/typescript/symptoms/inner-layer-imports-outer.md +1 -1
- package/rules/typescript/symptoms/library-class-built-in-place.md +1 -1
- package/rules/typescript/symptoms/loop-keyword/loop-statement.md +1 -1
- package/rules/typescript/symptoms/many-spellings-of-one-concept/test-call-aliases.md +10 -0
- package/rules/typescript/symptoms/many-spellings-of-one-concept.md +3 -2
- package/rules/typescript/symptoms/module-or-global-patched/module-mock-call.md +4 -4
- package/rules/typescript/symptoms/no-lock-file/committed-lock-file.md +12 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary/import-or-require.md +1 -0
- package/rules/typescript/symptoms/outside-import-past-a-boundary.md +5 -4
- package/rules/typescript/symptoms/outside-type-in-a-signature.md +2 -2
- package/rules/typescript/symptoms/{port-outside-the-domain.md → port-beside-its-adapter.md} +2 -2
- package/rules/typescript/symptoms/port-named-for-a-mechanism.md +1 -1
- package/rules/typescript/symptoms/process-global-used-in-place/debugger-statement.md +10 -0
- package/rules/typescript/symptoms/process-global-used-in-place/direct-global-use.md +14 -0
- package/rules/typescript/symptoms/process-global-used-in-place.md +2 -2
- package/rules/typescript/symptoms/prose-in-code/comment-prose.md +12 -0
- package/rules/typescript/symptoms/rebinding/test-body.md +1 -18
- package/rules/typescript/symptoms/rebinding.md +11 -1
- package/rules/typescript/symptoms/schema-past-its-adapter.md +2 -2
- package/rules/typescript/symptoms/test-switched-off/skipped-tests.md +3 -6
- package/rules/typescript/symptoms/test-switched-off.md +1 -1
- package/rules/typescript/symptoms/text-past-its-reader/test-body.md +2 -17
- package/rules/typescript/symptoms/text-past-its-reader.md +1 -1
- package/rules/typescript/symptoms/throw-between-our-units/throw-statement.md +10 -0
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/throw-statement.md +1 -1
- package/rules/typescript/symptoms/throw-or-catch-in-a-test/try-block.md +1 -25
- package/rules/typescript/symptoms/tool-fetched-at-run-time/fetch-command.md +10 -0
- package/rules/typescript/symptoms/type-declared-in-a-test/test-type-declaration.md +10 -0
- package/rules/typescript/symptoms/type-declared-in-a-test.md +33 -0
- package/rules/typescript/symptoms/unasserted-call.md +1 -1
- package/rules/typescript/symptoms/unit-without-a-running-test/companion-test-file.md +2 -2
- package/rules/typescript/symptoms/wide-input/unread-parameter.md +10 -0
- package/rules/typescript/symptoms/wide-input.md +3 -2
- package/rules/typescript/symptoms.md +210 -148
- package/src/application/conformance/conformance-testing-types.d.ts +13 -16
- package/src/domain/language-layer/authored-item-types.d.ts +66 -0
- package/src/domain/language-layer/catalogue-name.d.ts +5 -0
- package/src/domain/language-layer/check-address-text.d.ts +12 -0
- package/src/domain/rule-set/authored-rule-set-types.d.ts +31 -32
- package/src/domain/rule-set/clause-address-types.d.ts +4 -3
- package/src/domain/rule-set/rule-set-name-of.d.ts +10 -0
- package/src/domain/runner/check-binding.d.ts +18 -0
- package/src/domain/runner/check-observations.d.ts +39 -0
- package/src/domain/runner/conformance-types.d.ts +8 -2
- package/src/domain/runner/runner-result-types.d.ts +1 -2
- package/src/domain/settings/test-files.d.ts +7 -0
- package/src/eslint-plugin.js +45 -39
- package/src/hone.js +16 -13716
- package/src/infrastructure/disciplines-file/version-one-names.json +4 -5
- package/src/infrastructure/engines/eslint/authored-class-or-this/static-members-only/piece.json +0 -6
- package/src/infrastructure/engines/eslint/long-function/function-length/piece.json +0 -6
- package/src/infrastructure/engines/eslint/runner/pieces/eslint-piece-settings-types.d.ts +2 -0
- package/src/infrastructure/engines/eslint/runner/runner.js +1001 -1234
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/README.md +0 -3
- package/src/infrastructure/engines/eslint/test-switched-off/focused-tests/eslint-plugin.js +33 -21
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/piece.json +11 -4
- package/src/infrastructure/engines/eslint/test-switched-off/skipped-tests/skipped-tests.examples.json +28 -0
- package/src/infrastructure/engines/eslint/untyped-value/implicit-any-let/piece.json +0 -2
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/eslint-plugin.js +94 -0
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/piece.json +11 -0
- package/src/infrastructure/engines/eslint/wide-input/unread-parameter/unread-parameter.examples.json +48 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/ambient-randomness.js +109 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/ambient-randomness/random-call/random-call.examples.json +48 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answer.examples.json +42 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/hook-answers.js +72 -0
- package/src/infrastructure/engines/walker/answer-set-in-a-hook/hook-answer/piece.json +9 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.examples.json +30 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/assertion-site.js +123 -0
- package/src/infrastructure/engines/walker/assertion-outside-a-test-body/assertion-site/piece.json +9 -0
- package/src/infrastructure/engines/walker/authored-class-or-this/class-keyword/class-syntax.js +3 -3
- package/src/infrastructure/engines/walker/boolean-in-a-signature/boolean-annotation/boolean-signatures.js +7 -5
- package/src/infrastructure/engines/walker/branch-in-a-test/test-body/test-body-logic.js +192 -147
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.examples.json +24 -0
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/call-of-a-call.js +34 -0
- package/src/infrastructure/engines/walker/built-unit-called-in-place/call-of-a-call/piece.json +9 -0
- package/src/infrastructure/engines/walker/claimed-type/cast-to-any/any-cast.js +6 -4
- package/src/infrastructure/engines/walker/claimed-type/unlisted-cast-site/cast-expressions.js +6 -4
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/piece.json +9 -0
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.examples.json +30 -0
- package/src/infrastructure/engines/walker/code-or-prose-read-as-text-in-a-test/raw-read/raw-read.js +166 -0
- package/src/infrastructure/engines/walker/computed-value-in-a-test/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/date-used-directly/clock-sources/clock-sources.js +4 -4
- package/src/infrastructure/engines/walker/default-on-a-closed-union/default-arm/switch-defaults.js +8 -6
- package/src/infrastructure/engines/walker/double-with-a-body/logic-in-a-passed-function/piece.json +0 -10
- package/src/infrastructure/engines/walker/double-with-a-body/stub-implementation/dependency-isolation.js +9 -14
- package/src/infrastructure/engines/walker/drawer-path/drawer-names/categorical-paths.js +4 -4
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/piece.json +9 -0
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.examples.json +30 -0
- package/src/infrastructure/engines/walker/export-from-a-test/test-file-export/test-file-export.js +31 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.examples.json +18 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/empty-catch.js +32 -0
- package/src/infrastructure/engines/walker/failure-shaped-as-success/empty-catch/piece.json +9 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/piece.json +9 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.examples.json +54 -0
- package/src/infrastructure/engines/walker/floating-version/version-selector/version-selector.js +75 -0
- package/src/infrastructure/engines/walker/inherited-environment-in-a-subprocess/git-spawn-environment/hermetic-git-spawns.js +8 -17
- package/src/infrastructure/engines/walker/loop-keyword/loop-statement/loops.js +8 -6
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/piece.json +9 -0
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.examples.json +36 -0
- package/src/infrastructure/engines/walker/many-spellings-of-one-concept/test-call-aliases/test-call-aliases.js +67 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mock-call.examples.json +34 -0
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/module-mocking.js +64 -16
- package/src/infrastructure/engines/walker/module-or-global-patched/module-mock-call/piece.json +5 -1
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.examples.json +24 -0
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/committed-lock-file.js +41 -0
- package/src/infrastructure/engines/walker/no-lock-file/committed-lock-file/piece.json +9 -0
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/import-boundaries.js +18 -16
- package/src/infrastructure/engines/walker/outside-import-past-a-boundary/import-or-require/piece.json +1 -1
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.examples.json +18 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/debugger-statement.js +17 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/debugger-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/direct-global-use.examples.json +63 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/piece.json +13 -0
- package/src/infrastructure/engines/walker/process-global-used-in-place/direct-global-use/process-global-used-in-place.js +126 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/comment-prose.examples.json +42 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/piece.json +16 -0
- package/src/infrastructure/engines/walker/prose-in-code/comment-prose/prose-in-code.js +90 -0
- package/src/infrastructure/engines/walker/rebinding/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/runner/pieces/walker-piece.d.ts +7 -5
- package/src/infrastructure/engines/walker/runner/runner.js +268 -79
- package/src/infrastructure/engines/walker/runner/toolchain/typescript-parse.d.ts +3 -0
- package/src/infrastructure/engines/walker/shorthand-name/identifier-names/identifier-names.js +12 -7
- package/src/infrastructure/engines/walker/strictness-weakened/exact-optional-property-types/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-fallthrough-cases-in-switch/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-implicit-override/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-property-access-from-index-signature/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/no-unchecked-indexed-access/piece.json +0 -10
- package/src/infrastructure/engines/walker/strictness-weakened/strict/compiler-overrides.js +30 -52
- package/src/infrastructure/engines/walker/strictness-weakened/use-unknown-in-catch-variables/piece.json +0 -10
- package/src/infrastructure/engines/walker/text-past-its-reader/test-body/piece.json +0 -10
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/piece.json +9 -0
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throw-statement.examples.json +36 -0
- package/src/infrastructure/engines/walker/throw-between-our-units/throw-statement/throws-in-production.js +12 -0
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throw-statement.examples.json +6 -6
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/throw-statement/throws-in-tests.js +5 -44
- package/src/infrastructure/engines/walker/throw-or-catch-in-a-test/try-block/piece.json +0 -10
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.examples.json +42 -0
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/fetch-command.js +152 -0
- package/src/infrastructure/engines/walker/tool-fetched-at-run-time/fetch-command/piece.json +9 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/piece.json +9 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.examples.json +36 -0
- package/src/infrastructure/engines/walker/type-declared-in-a-test/test-type-declaration/test-type-declaration.js +141 -0
- package/src/infrastructure/engines/walker/type-derived-from-code/factory-return-types/factory-return-types.js +8 -6
- package/src/infrastructure/engines/walker/unit-without-a-running-test/companion-test-file/export-test-sibling.js +16 -10
- package/src/infrastructure/engines/walker/untracked-escape/directive-pointers/comments-directives.js +18 -64
- package/src/infrastructure/engines/walker/write-into-a-parameter/parameter-mutation/parameter-mutation.js +7 -5
- package/src/measure-engines.process.js +80 -0
- package/src/rule-set.d.ts +2 -1
- package/src/testing.d.ts +2 -4
- package/src/testing.js +173 -314
- package/src/{audit.d.ts → walker.d.ts} +13 -8
- package/src/walker.js +28 -0
- package/chunks/chunk-5HRMJ4O2.js +0 -608
- package/chunks/chunk-IX2VZTBO.js +0 -887
- package/chunks/chunk-K2W3D3NB.js +0 -17
- package/chunks/chunk-M6SOGWT7.js +0 -82
- package/chunks/chunk-Q62Y25WS.js +0 -843
- package/chunks/chunk-R75QELTA.js +0 -481
- package/chunks/chunk-RANAKCTW.js +0 -31
- package/chunks/chunk-TNY2PASL.js +0 -38
- package/chunks/chunk-UJONWHA4.js +0 -22
- package/docs/output-contract.md +0 -1155
- package/rules/record-kinds/boundary-record.md +0 -9
- package/rules/typescript/recipes/iteach-over-typed-rows.md +0 -18
- package/rules/typescript/recipes/stub-with-vifn.md +0 -20
- package/src/audit.js +0 -18
- package/src/domain/runner/runner-module-types.d.ts +0 -15
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
```json
|
|
4
4
|
{
|
|
5
5
|
"group": "Unit shape",
|
|
6
|
-
"seen": "A parameter
|
|
6
|
+
"seen": "A parameter, or a field of one, the unit never reads.",
|
|
7
7
|
"mayIndicate": [
|
|
8
8
|
{
|
|
9
9
|
"case": "does-one-job",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
],
|
|
25
25
|
"breachUsuallySits": "in the unit's declared input",
|
|
26
26
|
"seenBy": [
|
|
27
|
-
"types"
|
|
27
|
+
"types",
|
|
28
|
+
"syntax"
|
|
28
29
|
],
|
|
29
30
|
"reports": "seen-to-breach",
|
|
30
31
|
"recipes": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
- **Seen by:** types.
|
|
50
50
|
- **Reports:** seen.
|
|
51
51
|
- **Check today:** review.
|
|
52
|
-
- **Recipes:** [
|
|
52
|
+
- **Recipes:** [Constrained context generic](recipes.md#constrained-context-generic); [Zod at the producer's adapter](recipes.md#zod-at-the-producers-adapter).
|
|
53
53
|
|
|
54
54
|
### Default on a closed union
|
|
55
55
|
|
|
@@ -128,18 +128,9 @@
|
|
|
128
128
|
- **Seen by:** app.
|
|
129
129
|
- **Reports:** seen.
|
|
130
130
|
- **Check today:** review.
|
|
131
|
-
- **Recipes:** [Port in
|
|
131
|
+
- **Recipes:** [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
|
|
132
132
|
|
|
133
|
-
### Port
|
|
134
|
-
|
|
135
|
-
- **Seen:** A port named for a technology (`HttpClient`, `Fs`, `Sqlite`) rather than a capability.
|
|
136
|
-
- **May indicate:** Uses a system or service outside the program → Ports declared inside; Names something → One word everywhere.
|
|
137
|
-
- **Breach usually sits:** in the port.
|
|
138
|
-
- **Seen by:** person.
|
|
139
|
-
- **Check today:** only review.
|
|
140
|
-
- **Recipes:** [Port in the domain](recipes.md#port-in-the-domain).
|
|
141
|
-
|
|
142
|
-
### Port outside the domain
|
|
133
|
+
### Port beside its adapter
|
|
143
134
|
|
|
144
135
|
- **Seen:** A port interface declared in an adapter's module, or beside its default adapter.
|
|
145
136
|
- **May indicate:** Uses a system or service outside the program → Ports declared inside ("the port is domain and to be kept separate to the concrete implementation or use").
|
|
@@ -147,7 +138,16 @@
|
|
|
147
138
|
- **Seen by:** graph.
|
|
148
139
|
- **Reports:** seen.
|
|
149
140
|
- **Check today:** review.
|
|
150
|
-
- **Recipes:** [Port in
|
|
141
|
+
- **Recipes:** [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
|
|
142
|
+
|
|
143
|
+
### Port named for a mechanism
|
|
144
|
+
|
|
145
|
+
- **Seen:** A port named for a technology (`HttpClient`, `Fs`, `Sqlite`) rather than a capability.
|
|
146
|
+
- **May indicate:** Uses a system or service outside the program → Ports declared inside; Names something → One word everywhere.
|
|
147
|
+
- **Breach usually sits:** in the port.
|
|
148
|
+
- **Seen by:** person.
|
|
149
|
+
- **Check today:** only review.
|
|
150
|
+
- **Recipes:** [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
|
|
151
151
|
|
|
152
152
|
## The outside world reached directly
|
|
153
153
|
|
|
@@ -156,10 +156,11 @@
|
|
|
156
156
|
- **Seen:** `Math.random()`, `crypto.randomUUID()` or `crypto.getRandomValues()` outside their adapter.
|
|
157
157
|
- **May indicate:** Needs the current time, a random value, a new id or an outside ordering → Ports declared inside, Written-out answers.
|
|
158
158
|
- **Breach usually sits:** in the unit that should be passed the value, often a doer doing two jobs.
|
|
159
|
-
- **Covered by a record:** correct use:
|
|
159
|
+
- **Covered by a record:** correct use: an authorised location on the adapter for random values or new ids.
|
|
160
160
|
- **Seen by:** syntax.
|
|
161
161
|
- **Reports:** seen.
|
|
162
|
-
- **Check today:**
|
|
162
|
+
- **Check today:** partial.
|
|
163
|
+
- **Checks:** [random-call](symptoms/ambient-randomness/random-call.md).
|
|
163
164
|
- **Recipes:** [World values through a port](recipes.md#world-values-through-a-port).
|
|
164
165
|
|
|
165
166
|
### Date used directly
|
|
@@ -167,7 +168,7 @@
|
|
|
167
168
|
- **Seen:** Any use of `Date` (`Date.now()`, `new Date()`, `new Date(value)`, `Date.parse`) or `performance.now()` outside the places that handle dates.
|
|
168
169
|
- **May indicate:** Needs the current time, a random value, a new id or an outside ordering → Ports declared inside, Written-out answers; Does one job → Doer or orchestrator ("Dating and numbering an order is not the same job as charging it").
|
|
169
170
|
- **Breach usually sits:** in the unit that should be passed the time, often a doer doing two jobs.
|
|
170
|
-
- **Covered by a record:** correct use:
|
|
171
|
+
- **Covered by a record:** correct use: an authorised location on the clock adapter.
|
|
171
172
|
- **Seen by:** syntax.
|
|
172
173
|
- **Reports:** seen.
|
|
173
174
|
- **To name the breach, a check needs:** person.
|
|
@@ -180,7 +181,7 @@
|
|
|
180
181
|
- **Seen:** `new` on a class from an outside dependency, outside that dependency's adapter.
|
|
181
182
|
- **May indicate:** Takes an outside dependency → Outside dependencies stay at boundaries; Keeps state or settings across calls → No hidden effects.
|
|
182
183
|
- **Breach usually sits:** at a missing adapter.
|
|
183
|
-
- **Covered by a record:** correct use:
|
|
184
|
+
- **Covered by a record:** correct use: an authorised location on that dependency's adapter.
|
|
184
185
|
- **Seen by:** types.
|
|
185
186
|
- **Reports:** seen.
|
|
186
187
|
- **Check today:** review.
|
|
@@ -188,22 +189,22 @@
|
|
|
188
189
|
|
|
189
190
|
### Outside import past a boundary
|
|
190
191
|
|
|
191
|
-
- **Seen:** An import, `import()` or `require` of an outside dependency or runtime module (`node:*`) in a file with no
|
|
192
|
+
- **Seen:** An import, `import()` or `require` of an outside dependency or runtime module (`node:*`) in a file with no authorised location for that outside party.
|
|
192
193
|
- **May indicate:** Uses a system or service outside the program → Outside dependencies stay at boundaries, Ports declared inside; Takes an outside dependency → Outside dependencies stay at boundaries.
|
|
193
194
|
- **Breach usually sits:** at a missing adapter and port.
|
|
194
|
-
- **Covered by a record:** correct use:
|
|
195
|
+
- **Covered by a record:** correct use: an authorised location on the adapter for that outside party.
|
|
195
196
|
- **Seen by:** graph.
|
|
196
197
|
- **Reports:** seen.
|
|
197
198
|
- **Check today:** partial.
|
|
198
199
|
- **Checks:** [import-or-require](symptoms/outside-import-past-a-boundary/import-or-require.md).
|
|
199
|
-
- **Recipes:** [Adapter per outside party](recipes.md#adapter-per-outside-party); [Port in
|
|
200
|
+
- **Recipes:** [Adapter per outside party](recipes.md#adapter-per-outside-party); [Port in a module of its own](recipes.md#port-in-a-module-of-its-own).
|
|
200
201
|
|
|
201
202
|
### Outside type in a signature
|
|
202
203
|
|
|
203
204
|
- **Seen:** A type from an outside dependency or runtime library in a business-logic parameter, field or return, imported or inferred.
|
|
204
205
|
- **May indicate:** Uses a system or service outside the program → Outside dependencies stay at boundaries, No leak across a boundary.
|
|
205
206
|
- **Breach usually sits:** in the adapter that hands the outside type inward.
|
|
206
|
-
- **Covered by a record:** correct use:
|
|
207
|
+
- **Covered by a record:** correct use: an authorised location on the adapter, or beyond it with a why-chain naming the outside model adopted as ours.
|
|
207
208
|
- **Seen by:** types.
|
|
208
209
|
- **Reports:** seen → breach.
|
|
209
210
|
- **The breach a check could name:** the adapter that returns it, by types.
|
|
@@ -212,13 +213,14 @@
|
|
|
212
213
|
|
|
213
214
|
### Process global used in place
|
|
214
215
|
|
|
215
|
-
- **Seen:** `process.env`, `process.argv`, `process.exit`, `process.on`, `console
|
|
216
|
+
- **Seen:** `process.env`, `process.argv`, `process.exit`, `process.on`, `console.*`, `globalThis`, `alert`, `confirm`, `prompt` or a `debugger` statement outside an adapter.
|
|
216
217
|
- **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Causes an effect (writes, logs, sends, exits) → Ports declared inside; Builds the real implementations → Ports declared inside.
|
|
217
218
|
- **Breach usually sits:** at a missing port, or at an adapter not built at the entry point.
|
|
218
|
-
- **Covered by a record:** correct use:
|
|
219
|
+
- **Covered by a record:** correct use: an authorised location on the adapter that wraps the process.
|
|
219
220
|
- **Seen by:** syntax.
|
|
220
221
|
- **Reports:** seen.
|
|
221
|
-
- **Check today:**
|
|
222
|
+
- **Check today:** partial.
|
|
223
|
+
- **Checks:** [debugger-statement](symptoms/process-global-used-in-place/debugger-statement.md), [direct-global-use](symptoms/process-global-used-in-place/direct-global-use.md).
|
|
222
224
|
- **Recipes:** [Adapter per outside party](recipes.md#adapter-per-outside-party); [Composition root](recipes.md#composition-root); [World values through a port](recipes.md#world-values-through-a-port).
|
|
223
225
|
|
|
224
226
|
"Process env reader is just an external world being wrapped."
|
|
@@ -232,11 +234,22 @@
|
|
|
232
234
|
- **Breach usually sits:** in a double or a value shared across tests at file or suite scope, or in state held in the unit's module.
|
|
233
235
|
- **Seen by:** syntax.
|
|
234
236
|
- **Reports:** seen.
|
|
235
|
-
- **Check today:**
|
|
237
|
+
- **Check today:** partial.
|
|
238
|
+
- **Checks:** [hook-answer](symptoms/answer-set-in-a-hook/hook-answer.md).
|
|
236
239
|
- **Recipes:** [Stub with vi.fn](recipes.md#stub-with-vifn).
|
|
237
240
|
|
|
238
241
|
"Nothing wrong with a reset in after each. But something wrong with a remock in after each. Implies the suite knows the input needed for each test." Sharing alone is not the breach: "I have no issue with shared boilerplate or even mock builders when it doesn't hide minimal interfaces issues and doesn't hide assumptions or coupling between tests. But it often does when not done with care."
|
|
239
242
|
|
|
243
|
+
### Assertion outside a test body
|
|
244
|
+
|
|
245
|
+
- **Seen:** An assertion outside a function passed to an it or test call.
|
|
246
|
+
- **May indicate:** States what the unit gives back, for one case or several → Straight-through tests.
|
|
247
|
+
- **Breach usually sits:** in a suite body, hook, or helper that asserts outside the test case.
|
|
248
|
+
- **Seen by:** syntax.
|
|
249
|
+
- **Reports:** seen.
|
|
250
|
+
- **Check today:** partial.
|
|
251
|
+
- **Checks:** [assertion-site](symptoms/assertion-outside-a-test-body/assertion-site.md).
|
|
252
|
+
|
|
240
253
|
### Behaviour tested away from its owner
|
|
241
254
|
|
|
242
255
|
- **Seen:** A unit test that asserts what a collaborator does, or an integration test that pins a rule a unit owns.
|
|
@@ -249,7 +262,7 @@
|
|
|
249
262
|
### Branch in a test
|
|
250
263
|
|
|
251
264
|
- **Seen:** `if`, a ternary, `&&`, `||`, `??`, `?.` or `switch` in a test file.
|
|
252
|
-
- **May indicate:** Checks a value that may be one of several outcomes → Straight-through tests; A value is one of several kinds or states: the unit's output → Kinds are named; An operation can fail: the unit's output → Failures are values.
|
|
265
|
+
- **May indicate:** Checks a value that may be one of several outcomes → Straight-through tests; A value is one of several kinds or states: the unit's output → Kinds are named; An operation can fail: the unit's output → Failures are values; Uses what a collaborator gives back: reads a double's recorded calls or results → Written-out answers.
|
|
253
266
|
- **Breach usually sits:** in the unit's output type, where optional or loose shapes force the test to branch.
|
|
254
267
|
- **Seen by:** syntax.
|
|
255
268
|
- **Reports:** seen → breach.
|
|
@@ -257,7 +270,18 @@
|
|
|
257
270
|
- **To name the breach, a check needs:** types: the declaring type of the member read.
|
|
258
271
|
- **Check today:** reuse.
|
|
259
272
|
- **Checks:** [test-body](symptoms/branch-in-a-test/test-body.md).
|
|
260
|
-
- **Recipes:** [Assert to narrow](recipes.md#assert-to-narrow); [it.each over typed rows](recipes.md#iteach-over-typed-rows).
|
|
273
|
+
- **Recipes:** [Assert to narrow](recipes.md#assert-to-narrow); [it.each over typed rows](recipes.md#iteach-over-typed-rows); [Stub with vi.fn](recipes.md#stub-with-vifn).
|
|
274
|
+
|
|
275
|
+
### Code or prose read as text in a test
|
|
276
|
+
|
|
277
|
+
- **Seen:** A test reads TypeScript or Markdown source through a file read, a raw import, or a raw glob.
|
|
278
|
+
- **May indicate:** States what the unit gives back, for one case or several → Tests are ours.
|
|
279
|
+
- **Breach usually sits:** in a test that checks the words in a file instead of the code behaviour.
|
|
280
|
+
- **Covered by a record:** parsing source to verify its syntax or toolchain compatibility: an authorised location at the test that owns that proof.
|
|
281
|
+
- **Seen by:** syntax.
|
|
282
|
+
- **Reports:** seen.
|
|
283
|
+
- **Check today:** partial.
|
|
284
|
+
- **Checks:** [raw-read](symptoms/code-or-prose-read-as-text-in-a-test/raw-read.md).
|
|
261
285
|
|
|
262
286
|
### Computed value in a test
|
|
263
287
|
|
|
@@ -296,6 +320,16 @@
|
|
|
296
320
|
|
|
297
321
|
"Exact returns can use mockreturn or mockresolve".
|
|
298
322
|
|
|
323
|
+
### Export from a test
|
|
324
|
+
|
|
325
|
+
- **Seen:** An export declaration, assignment or modifier in a test file, including a type export.
|
|
326
|
+
- **May indicate:** States what the unit gives back, for one case or several → Straight-through tests; Gives each unit its test → Tested where it's owned.
|
|
327
|
+
- **Breach usually sits:** in a test file that exposes code for another file to use.
|
|
328
|
+
- **Seen by:** syntax.
|
|
329
|
+
- **Reports:** seen.
|
|
330
|
+
- **Check today:** partial.
|
|
331
|
+
- **Checks:** [test-file-export](symptoms/export-from-a-test/test-file-export.md).
|
|
332
|
+
|
|
299
333
|
### Inherited environment in a subprocess
|
|
300
334
|
|
|
301
335
|
- **Seen:** A process spawned in a test with no explicit environment, or one built from `process.env`.
|
|
@@ -365,7 +399,7 @@
|
|
|
365
399
|
|
|
366
400
|
### Test switched off
|
|
367
401
|
|
|
368
|
-
- **Seen:** `.only`, `.skip`, `fit` or
|
|
402
|
+
- **Seen:** `.only`, `.skip`, `fit`, `xit`, `.todo`, `.skipIf` or `.runIf`.
|
|
369
403
|
- **May indicate:** Gives each unit its test → Tested where it's owned.
|
|
370
404
|
- **Breach usually sits:** in the test file.
|
|
371
405
|
- **Seen by:** syntax.
|
|
@@ -384,6 +418,16 @@
|
|
|
384
418
|
- **Checks:** [throw-statement](symptoms/throw-or-catch-in-a-test/throw-statement.md), [try-block](symptoms/throw-or-catch-in-a-test/try-block.md).
|
|
385
419
|
- **Recipes:** [Failure asserted as a value](recipes.md#failure-asserted-as-a-value).
|
|
386
420
|
|
|
421
|
+
### Type declared in a test
|
|
422
|
+
|
|
423
|
+
- **Seen:** A type alias, interface or enum declared in a test file.
|
|
424
|
+
- **May indicate:** Puts code in a file or folder → One reason per module; Gives a value its type (declares it, or needs it narrower) → Declared, not asserted.
|
|
425
|
+
- **Breach usually sits:** in the unit whose contract the test repeats or cannot import.
|
|
426
|
+
- **Seen by:** syntax.
|
|
427
|
+
- **Reports:** seen.
|
|
428
|
+
- **Check today:** partial.
|
|
429
|
+
- **Checks:** [test-type-declaration](symptoms/type-declared-in-a-test/test-type-declaration.md).
|
|
430
|
+
|
|
387
431
|
### Unasserted call
|
|
388
432
|
|
|
389
433
|
- **Seen:** A stub or spy passed to the unit whose calls the test never asserts.
|
|
@@ -444,13 +488,13 @@
|
|
|
444
488
|
### Rebinding
|
|
445
489
|
|
|
446
490
|
- **Seen:** A `let` assigned again, or a parameter reassigned, incremented or destructured into.
|
|
447
|
-
- **May indicate:** Makes a new value from what it has → No hidden effects; Does one job → Doer or orchestrator.
|
|
491
|
+
- **May indicate:** Makes a new value from what it has → No hidden effects; Does one job → Doer or orchestrator; Uses what a collaborator gives back: in a test → Written-out answers.
|
|
448
492
|
- **Breach usually sits:** in the unit: no caller sees it, so on its own it shows no hidden effect, but it is suspect for work done inline in steps.
|
|
449
493
|
- **Seen by:** syntax.
|
|
450
494
|
- **Reports:** seen.
|
|
451
495
|
- **Check today:** partial.
|
|
452
496
|
- **Checks:** [parameter-reassignment](symptoms/rebinding/parameter-reassignment.md), [test-body](symptoms/rebinding/test-body.md).
|
|
453
|
-
- **Recipes:** [Copy, never write in](recipes.md#copy-never-write-in); [Functional iteration](recipes.md#functional-iteration).
|
|
497
|
+
- **Recipes:** [Copy, never write in](recipes.md#copy-never-write-in); [Functional iteration](recipes.md#functional-iteration); [Stub with vi.fn](recipes.md#stub-with-vifn).
|
|
454
498
|
|
|
455
499
|
### Write into a parameter
|
|
456
500
|
|
|
@@ -465,119 +509,17 @@
|
|
|
465
509
|
- **Checks:** [parameter-mutation](symptoms/write-into-a-parameter/parameter-mutation.md).
|
|
466
510
|
- **Recipes:** [Copy, never write in](recipes.md#copy-never-write-in).
|
|
467
511
|
|
|
468
|
-
##
|
|
469
|
-
|
|
470
|
-
### Bundled dependency
|
|
471
|
-
|
|
472
|
-
- **Seen:** Published build output that holds a dependency's code that the package manifest does not declare.
|
|
473
|
-
- **May indicate:** Ships code for others → Shipped risk declared.
|
|
474
|
-
- **Breach usually sits:** in the build config.
|
|
475
|
-
- **Seen by:** files.
|
|
476
|
-
- **Reports:** seen.
|
|
477
|
-
- **How it is seen:** files (build output).
|
|
478
|
-
- **Check today:** new.
|
|
479
|
-
- **Recipes:** [Declared, not bundled](recipes.md#declared-not-bundled).
|
|
480
|
-
|
|
481
|
-
### Dependency without a record
|
|
482
|
-
|
|
483
|
-
- **Seen:** A direct dependency, tools included, with no record of the native way weighed.
|
|
484
|
-
- **May indicate:** Takes an outside dependency → Outside dependencies justified.
|
|
485
|
-
- **Breach usually sits:** in the missing record.
|
|
486
|
-
- **Covered by a record:** correct use: a dependency record naming the native way weighed and why it fell short.
|
|
487
|
-
- **Seen by:** files.
|
|
488
|
-
- **Reports:** seen.
|
|
489
|
-
- **Check today:** new.
|
|
490
|
-
- **Recipes:** [Dependency record](recipes.md#dependency-record).
|
|
491
|
-
|
|
492
|
-
### Edit inside vendored code
|
|
493
|
-
|
|
494
|
-
- **Seen:** A change to a file inside a vendored folder.
|
|
495
|
-
- **May indicate:** Takes an outside dependency → Upstream stays untouched.
|
|
496
|
-
- **Breach usually sits:** in the change.
|
|
497
|
-
- **Covered by a record:** drift, an edit impossible to apply as an extension: an authorised location stating when to drop it.
|
|
498
|
-
- **Seen by:** history.
|
|
499
|
-
- **Reports:** seen.
|
|
500
|
-
- **Check today:** new.
|
|
501
|
-
- **Recipes:** [Extension outside the vendored code](recipes.md#extension-outside-the-vendored-code).
|
|
502
|
-
|
|
503
|
-
### Floating version
|
|
504
|
-
|
|
505
|
-
- **Seen:** A range (`^`, `~`, `*`, `x`) or a tag (`latest`, `lts`) for an outside dependency, a runtime or a CI action.
|
|
506
|
-
- **May indicate:** Takes an outside dependency → Fixed versions.
|
|
507
|
-
- **Breach usually sits:** in the manifest or workflow.
|
|
508
|
-
- **Seen by:** files.
|
|
509
|
-
- **Reports:** seen.
|
|
510
|
-
- **Check today:** new.
|
|
511
|
-
- **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
|
|
512
|
-
|
|
513
|
-
### No lock file
|
|
514
|
-
|
|
515
|
-
- **Seen:** A repository with dependencies and no committed lock file.
|
|
516
|
-
- **May indicate:** Takes an outside dependency → Fixed versions.
|
|
517
|
-
- **Breach usually sits:** in the repository.
|
|
518
|
-
- **Seen by:** files.
|
|
519
|
-
- **Reports:** seen.
|
|
520
|
-
- **Check today:** new.
|
|
521
|
-
- **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
|
|
522
|
-
|
|
523
|
-
### Tool fetched at run time
|
|
524
|
-
|
|
525
|
-
- **Seen:** `npx`, `dlx`, `bunx` or a download-and-run in a script, CI step or doc.
|
|
526
|
-
- **May indicate:** Takes an outside dependency → Tools live in the repo.
|
|
527
|
-
- **Breach usually sits:** in the script.
|
|
528
|
-
- **Seen by:** files.
|
|
529
|
-
- **Reports:** seen.
|
|
530
|
-
- **Check today:** new.
|
|
531
|
-
- **Recipes:** [Repo scripts only](recipes.md#repo-scripts-only).
|
|
532
|
-
|
|
533
|
-
## Failures
|
|
534
|
-
|
|
535
|
-
### Catch-all failure kind
|
|
536
|
-
|
|
537
|
-
- **Seen:** A failure variant such as `unknown`, `other` or a bare message string, carrying no named cause.
|
|
538
|
-
- **May indicate:** An operation can fail → Failures are values; A value is one of several kinds or states → Kinds are named.
|
|
539
|
-
- **Breach usually sits:** in the adapter, which did not name the outside failure.
|
|
540
|
-
- **Seen by:** types, person.
|
|
541
|
-
- **Reports:** seen.
|
|
542
|
-
- **Check today:** review.
|
|
543
|
-
- **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
|
|
544
|
-
|
|
545
|
-
### Failure shaped as success
|
|
546
|
-
|
|
547
|
-
- **Seen:** A failed path that returns `null`, `false`, `[]`, `undefined` or a default, or a `catch` that returns one.
|
|
548
|
-
- **May indicate:** An operation can fail → Failures are values.
|
|
549
|
-
- **Breach usually sits:** in the unit's return type.
|
|
550
|
-
- **Seen by:** person, syntax.
|
|
551
|
-
- **How it is seen:** syntax for a `catch` that returns.
|
|
552
|
-
- **Check today:** only review.
|
|
553
|
-
- **Recipes:** [Result union](recipes.md#result-union).
|
|
554
|
-
|
|
555
|
-
### Throw between our units
|
|
556
|
-
|
|
557
|
-
- **Seen:** `throw` outside an adapter whose caller's contract is exceptions.
|
|
558
|
-
- **May indicate:** An operation can fail → Failures are values; Sends data out of the program → No leak across a boundary.
|
|
559
|
-
- **Breach usually sits:** in the unit, or at a missing mapping in the adapter.
|
|
560
|
-
- **Covered by a record:** correct use: an authorised location at an adapter whose caller's contract is exceptions.
|
|
561
|
-
- **Seen by:** syntax, graph.
|
|
562
|
-
- **Reports:** seen.
|
|
563
|
-
- **How it is seen:** graph for adapters.
|
|
564
|
-
- **Check today:** review.
|
|
565
|
-
- **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
|
|
512
|
+
## Names, prose and files
|
|
566
513
|
|
|
567
|
-
|
|
514
|
+
### Built unit called in place
|
|
568
515
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
- **
|
|
572
|
-
- **May indicate:** Sends data out of the program → No leak across a boundary.
|
|
573
|
-
- **Breach usually sits:** at the throw site.
|
|
516
|
+
- **Seen:** A call whose callee is a call with an object literal argument.
|
|
517
|
+
- **May indicate:** Names something → One word everywhere.
|
|
518
|
+
- **Breach usually sits:** where a configured unit is called before it is named.
|
|
574
519
|
- **Seen by:** syntax.
|
|
575
520
|
- **Reports:** seen.
|
|
576
|
-
- **Check today:**
|
|
577
|
-
- **Checks:** [
|
|
578
|
-
- **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter).
|
|
579
|
-
|
|
580
|
-
## Names, prose and files
|
|
521
|
+
- **Check today:** partial.
|
|
522
|
+
- **Checks:** [call-of-a-call](symptoms/built-unit-called-in-place/call-of-a-call.md).
|
|
581
523
|
|
|
582
524
|
### Change spread across modules
|
|
583
525
|
|
|
@@ -613,13 +555,14 @@
|
|
|
613
555
|
|
|
614
556
|
### Many spellings of one concept
|
|
615
557
|
|
|
616
|
-
- **Seen:** One
|
|
558
|
+
- **Seen:** One concept named two or more ways across the code or the wire.
|
|
617
559
|
- **May indicate:** Names something → One word everywhere ("I don't want to propogate 3 duplicates").
|
|
618
560
|
- **Breach usually sits:** in the vocabulary.
|
|
619
|
-
- **Seen by:** person.
|
|
561
|
+
- **Seen by:** person, syntax.
|
|
620
562
|
- **Reports:** seen.
|
|
621
563
|
- **How it is seen:** the vocabulary list makes it checkable.
|
|
622
|
-
- **Check today:**
|
|
564
|
+
- **Check today:** partial.
|
|
565
|
+
- **Checks:** [test-call-aliases](symptoms/many-spellings-of-one-concept/test-call-aliases.md).
|
|
623
566
|
- **Recipes:** [Domain vocabulary list](recipes.md#domain-vocabulary-list).
|
|
624
567
|
|
|
625
568
|
### Name off its casing
|
|
@@ -649,7 +592,8 @@
|
|
|
649
592
|
- **Breach usually sits:** in a name or type that does not carry the meaning.
|
|
650
593
|
- **Seen by:** syntax.
|
|
651
594
|
- **Reports:** seen.
|
|
652
|
-
- **Check today:**
|
|
595
|
+
- **Check today:** partial.
|
|
596
|
+
- **Checks:** [comment-prose](symptoms/prose-in-code/comment-prose.md).
|
|
653
597
|
- **Recipes:** [Meaning in names, not comments](recipes.md#meaning-in-names-not-comments).
|
|
654
598
|
|
|
655
599
|
### Shorthand name
|
|
@@ -686,6 +630,123 @@
|
|
|
686
630
|
- **Checks:** [directive-pointers](symptoms/untracked-escape/directive-pointers.md).
|
|
687
631
|
- **Recipes:** [Meaning in names, not comments](recipes.md#meaning-in-names-not-comments).
|
|
688
632
|
|
|
633
|
+
## Dependencies and versions
|
|
634
|
+
|
|
635
|
+
### Bundled dependency
|
|
636
|
+
|
|
637
|
+
- **Seen:** Published build output that holds a dependency's code that the package manifest does not declare.
|
|
638
|
+
- **May indicate:** Ships code for others → Shipped risk declared.
|
|
639
|
+
- **Breach usually sits:** in the build config.
|
|
640
|
+
- **Seen by:** files.
|
|
641
|
+
- **Reports:** seen.
|
|
642
|
+
- **How it is seen:** files (build output).
|
|
643
|
+
- **Check today:** new.
|
|
644
|
+
- **Recipes:** [Declared, not bundled](recipes.md#declared-not-bundled).
|
|
645
|
+
|
|
646
|
+
### Dependency without a record
|
|
647
|
+
|
|
648
|
+
- **Seen:** A direct dependency, tools included, with no record of the native way weighed.
|
|
649
|
+
- **May indicate:** Takes an outside dependency → Outside dependencies justified.
|
|
650
|
+
- **Breach usually sits:** in the missing record.
|
|
651
|
+
- **Covered by a record:** correct use: a dependency record naming the native way weighed and why it fell short.
|
|
652
|
+
- **Seen by:** files.
|
|
653
|
+
- **Reports:** seen.
|
|
654
|
+
- **Check today:** new.
|
|
655
|
+
- **Recipes:** [Dependency record](recipes.md#dependency-record).
|
|
656
|
+
|
|
657
|
+
### Edit inside vendored code
|
|
658
|
+
|
|
659
|
+
- **Seen:** A change to a file inside a vendored folder.
|
|
660
|
+
- **May indicate:** Takes an outside dependency → Upstream stays untouched.
|
|
661
|
+
- **Breach usually sits:** in the change.
|
|
662
|
+
- **Covered by a record:** drift, an edit impossible to apply as an extension: an authorised location stating when to drop it.
|
|
663
|
+
- **Seen by:** history.
|
|
664
|
+
- **Reports:** seen.
|
|
665
|
+
- **Check today:** new.
|
|
666
|
+
- **Recipes:** [Extension outside the vendored code](recipes.md#extension-outside-the-vendored-code).
|
|
667
|
+
|
|
668
|
+
### Floating version
|
|
669
|
+
|
|
670
|
+
- **Seen:** A range (`^`, `~`, `*`, `x`) or a tag (`latest`, `lts`) for an outside dependency, a runtime or a CI action.
|
|
671
|
+
- **May indicate:** Takes an outside dependency → Fixed versions.
|
|
672
|
+
- **Breach usually sits:** in the manifest or workflow.
|
|
673
|
+
- **Seen by:** files.
|
|
674
|
+
- **Reports:** seen.
|
|
675
|
+
- **Check today:** partial.
|
|
676
|
+
- **Checks:** [version-selector](symptoms/floating-version/version-selector.md).
|
|
677
|
+
- **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
|
|
678
|
+
|
|
679
|
+
### No lock file
|
|
680
|
+
|
|
681
|
+
- **Seen:** A repository with dependencies and no committed lock file.
|
|
682
|
+
- **May indicate:** Takes an outside dependency → Fixed versions.
|
|
683
|
+
- **Breach usually sits:** in the repository.
|
|
684
|
+
- **Seen by:** files.
|
|
685
|
+
- **Reports:** seen.
|
|
686
|
+
- **Check today:** partial.
|
|
687
|
+
- **Checks:** [committed-lock-file](symptoms/no-lock-file/committed-lock-file.md).
|
|
688
|
+
- **Recipes:** [Exact pins and a lock file](recipes.md#exact-pins-and-a-lock-file).
|
|
689
|
+
|
|
690
|
+
### Tool fetched at run time
|
|
691
|
+
|
|
692
|
+
- **Seen:** `npx`, `dlx`, `bunx` or a download-and-run in a script, CI step or doc.
|
|
693
|
+
- **May indicate:** Takes an outside dependency → Tools live in the repo.
|
|
694
|
+
- **Breach usually sits:** in the script.
|
|
695
|
+
- **Seen by:** files.
|
|
696
|
+
- **Reports:** seen.
|
|
697
|
+
- **Check today:** partial.
|
|
698
|
+
- **Checks:** [fetch-command](symptoms/tool-fetched-at-run-time/fetch-command.md).
|
|
699
|
+
- **Recipes:** [Repo scripts only](recipes.md#repo-scripts-only).
|
|
700
|
+
|
|
701
|
+
## Failures
|
|
702
|
+
|
|
703
|
+
### Catch-all failure kind
|
|
704
|
+
|
|
705
|
+
- **Seen:** A failure variant such as `unknown`, `other` or a bare message string, carrying no named cause.
|
|
706
|
+
- **May indicate:** An operation can fail → Failures are values; A value is one of several kinds or states → Kinds are named.
|
|
707
|
+
- **Breach usually sits:** in the adapter, which did not name the outside failure.
|
|
708
|
+
- **Seen by:** types, person.
|
|
709
|
+
- **Reports:** seen.
|
|
710
|
+
- **Check today:** review.
|
|
711
|
+
- **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
|
|
712
|
+
|
|
713
|
+
### Failure shaped as success
|
|
714
|
+
|
|
715
|
+
- **Seen:** A failed path that returns `null`, `false`, `[]`, `undefined` or a default, or a `catch` that returns one.
|
|
716
|
+
- **May indicate:** An operation can fail → Failures are values.
|
|
717
|
+
- **Breach usually sits:** in the unit's return type.
|
|
718
|
+
- **Seen by:** person, syntax.
|
|
719
|
+
- **How it is seen:** syntax for an empty `catch` block or promise rejection handler.
|
|
720
|
+
- **Check today:** partial.
|
|
721
|
+
- **Checks:** [empty-catch](symptoms/failure-shaped-as-success/empty-catch.md).
|
|
722
|
+
- **Recipes:** [Result union](recipes.md#result-union).
|
|
723
|
+
|
|
724
|
+
### Throw between our units
|
|
725
|
+
|
|
726
|
+
- **Seen:** `throw` outside an adapter whose caller's contract is exceptions.
|
|
727
|
+
- **May indicate:** An operation can fail → Failures are values; Sends data out of the program → No leak across a boundary.
|
|
728
|
+
- **Breach usually sits:** in the unit, or at a missing mapping in the adapter.
|
|
729
|
+
- **Covered by a record:** correct use: an authorised location at an adapter whose caller's contract is exceptions.
|
|
730
|
+
- **Seen by:** syntax, graph.
|
|
731
|
+
- **Reports:** seen.
|
|
732
|
+
- **How it is seen:** graph for adapters.
|
|
733
|
+
- **Check today:** partial.
|
|
734
|
+
- **Checks:** [throw-statement](symptoms/throw-between-our-units/throw-statement.md).
|
|
735
|
+
- **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter); [Result union](recipes.md#result-union).
|
|
736
|
+
|
|
737
|
+
"Throwing in specific places allowed is just authorised locations as prose."
|
|
738
|
+
|
|
739
|
+
### Thrown non-error
|
|
740
|
+
|
|
741
|
+
- **Seen:** `throw` of a literal, an object or a template.
|
|
742
|
+
- **May indicate:** Sends data out of the program → No leak across a boundary.
|
|
743
|
+
- **Breach usually sits:** at the throw site.
|
|
744
|
+
- **Seen by:** syntax.
|
|
745
|
+
- **Reports:** seen.
|
|
746
|
+
- **Check today:** reuse.
|
|
747
|
+
- **Checks:** [throw-only-error](symptoms/thrown-non-error/throw-only-error.md).
|
|
748
|
+
- **Recipes:** [Failure mapping at the adapter](recipes.md#failure-mapping-at-the-adapter).
|
|
749
|
+
|
|
689
750
|
## Unit shape
|
|
690
751
|
|
|
691
752
|
### Doer calling our own unit
|
|
@@ -758,13 +819,14 @@
|
|
|
758
819
|
|
|
759
820
|
### Wide input
|
|
760
821
|
|
|
761
|
-
- **Seen:** A parameter
|
|
822
|
+
- **Seen:** A parameter, or a field of one, the unit never reads.
|
|
762
823
|
- **May indicate:** Does one job → Handed what it uses; Gives a value its type (declares it, or needs it narrower) → Handed what it uses.
|
|
763
824
|
- **Breach usually sits:** in the unit's declared input.
|
|
764
|
-
- **Seen by:** types.
|
|
825
|
+
- **Seen by:** types, syntax.
|
|
765
826
|
- **Reports:** seen → breach.
|
|
766
827
|
- **The breach a check could name:** the input's declaration.
|
|
767
|
-
- **Check today:**
|
|
828
|
+
- **Check today:** partial.
|
|
829
|
+
- **Checks:** [unread-parameter](symptoms/wide-input/unread-parameter.md).
|
|
768
830
|
- **Recipes:** [Entity module](recipes.md#entity-module); [One argument object](recipes.md#one-argument-object).
|
|
769
831
|
|
|
770
832
|
### Wide port
|
|
@@ -797,7 +859,7 @@
|
|
|
797
859
|
- **Seen:** A schema, a `.parse` call or a `z.infer` type outside the producer's adapter, or the same value parsed twice.
|
|
798
860
|
- **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Gives a value its type (declares it, or needs it narrower) → Declared, not asserted.
|
|
799
861
|
- **Breach usually sits:** in the adapter, which hands the wire type inward instead of mapping it.
|
|
800
|
-
- **Covered by a record:** an outside model adopted as ours:
|
|
862
|
+
- **Covered by a record:** an outside model adopted as ours: an authorised location with a why-chain naming the outside model adopted as ours.
|
|
801
863
|
- **Seen by:** graph.
|
|
802
864
|
- **Reports:** seen.
|
|
803
865
|
- **Check today:** review.
|
|
@@ -808,7 +870,7 @@
|
|
|
808
870
|
- **Seen:** `JSON.parse`, `JSON.stringify` or a YAML parse or dump outside the adapter for whoever produced or receives the text, tests included.
|
|
809
871
|
- **May indicate:** Reads data from outside (request, file, environment, stored row, response) → No leak across a boundary; Sends data out of the program → No leak across a boundary; Uses a system or service outside the program → External behaviour sits at a boundary; States what the unit gives back, for one case or several → Straight-through tests.
|
|
810
872
|
- **Breach usually sits:** in a port that takes or gives text where it should carry objects.
|
|
811
|
-
- **Covered by a record:** correct use:
|
|
873
|
+
- **Covered by a record:** correct use: an authorised location on the adapter for whoever produced or receives the text; a use at one test site: an authorised location for this symptom alone.
|
|
812
874
|
- **Seen by:** syntax, types.
|
|
813
875
|
- **Reports:** seen → breach.
|
|
814
876
|
- **How it is seen:** types to trace the port.
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
import type { CheckAddressText } from "../../domain/language-layer/check-address-text.js";
|
|
1
2
|
import type { RepoPath } from "../../domain/repository/repo-path-types.js";
|
|
2
3
|
import type { Result } from "../../domain/result.js";
|
|
4
|
+
import type { ToolRuleSet } from "../../domain/rule-set/clause-address-types.js";
|
|
3
5
|
import type { Edition } from "../../domain/rule-set/edition-types.js";
|
|
4
6
|
import type { EngineId } from "../../domain/rule-set/identifier-types.js";
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
export type
|
|
7
|
+
import type { CheckConformanceFailure } from "../../domain/runner/conformance-types.js";
|
|
8
|
+
export type { CheckConformanceFailure } from "../../domain/runner/conformance-types.js";
|
|
9
|
+
export type TeamRuleSetUnderTest = {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly root: string;
|
|
12
|
+
};
|
|
13
|
+
export type RuleSetUnderTest = ToolRuleSet | TeamRuleSetUnderTest;
|
|
8
14
|
export type CheckRequest = {
|
|
9
|
-
readonly
|
|
15
|
+
readonly ruleSet: RuleSetUnderTest;
|
|
16
|
+
readonly check: CheckAddressText;
|
|
10
17
|
readonly engine: EngineId;
|
|
11
18
|
};
|
|
12
|
-
export type
|
|
13
|
-
readonly ruleSetRoot: string;
|
|
14
|
-
readonly clause: string;
|
|
15
|
-
};
|
|
16
|
-
export type ConformanceSetupFailureKind = "address-invalid" | "file-invalid" | "rule-set-unloadable" | "clause-not-mechanical" | "runner-unloadable" | "runner-refused";
|
|
19
|
+
export type ConformanceSetupFailureKind = "address-invalid" | "check-missing" | "file-invalid" | "rule-set-invalid" | "rule-set-unloadable" | "runner-unloadable" | "runner-refused";
|
|
17
20
|
export type ConformanceSetupFailure = {
|
|
18
21
|
readonly kind: ConformanceSetupFailureKind;
|
|
19
22
|
readonly detail: string;
|
|
@@ -27,13 +30,7 @@ export type CaseUnderTest = {
|
|
|
27
30
|
export type CheckUnderTest = CheckRequest & {
|
|
28
31
|
readonly examples: readonly CaseUnderTest[];
|
|
29
32
|
};
|
|
30
|
-
export type
|
|
31
|
-
readonly clause: RunnerClause;
|
|
32
|
-
readonly cases: readonly CaseUnderTest[];
|
|
33
|
-
};
|
|
34
|
-
export type ClauseConformanceOf = (request: ClauseRequest) => Promise<Result<readonly ConformanceFailure[], ConformanceSetupFailure>>;
|
|
35
|
-
export type ClauseUnderTestOf = (request: ClauseRequest) => Result<ClauseUnderTest, ConformanceSetupFailure>;
|
|
36
|
-
export type CheckConformanceOf = (request: CheckRequest) => Promise<Result<readonly ConformanceFailure[], ConformanceSetupFailure>>;
|
|
33
|
+
export type CheckConformanceOf = (request: CheckRequest) => Promise<Result<readonly CheckConformanceFailure[], ConformanceSetupFailure>>;
|
|
37
34
|
export type CheckUnderTestOf = (request: CheckRequest) => Result<CheckUnderTest, ConformanceSetupFailure>;
|
|
38
35
|
export type RepoPathOf = (request: {
|
|
39
36
|
readonly file: string;
|