@hailstails/hone 1.2.0 → 1.3.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.
@@ -61,7 +61,7 @@ In the tables below, a word in angle brackets, such as `<clause>`, stands for a
61
61
  | `<dir>` | the `--repo` value as typed | may hold a space |
62
62
  | `<url>` | the module URL Hone could not resolve, as given | may hold a space |
63
63
  | `<snippet>` | the source text at a finding: at most 200 characters, or the first 200 followed by `…` when it is longer | may hold a space |
64
- | `<comment>`, `<script>`, `<option>`, `<source>` | the native exception's comment, the `package.json` script name and the option in it, or where an imported record came from | may hold a space |
64
+ | `<comment>`, `<script>`, `<option>`, `<source>` | the native exception's comment, the `package.json` script name and the option in it (or the whole script, when a quote in it has no partner), or where an imported record came from | may hold a space |
65
65
  | `<detail>`, `<given>`, `<values>`, `<rule set>`, `<other rule set>`, `<clause with its rule set>`, `<version found>`, `<other package>`, `<range>` | text from the input, a tool or the command as typed | may hold a space |
66
66
 
67
67
  Paths are printed with forward slashes. A path inside the `--repo` folder is printed relative to it, in the report and in load failures alike. A path outside it is printed absolute, such as `C:/Users/me/shared/rule.json` on Windows. A load failure from before `--repo` is resolved names the folder as typed (`<dir>`). A path into Hone's own package, such as a `<rule page>`, the `<adoption guide>`, a `<piece folder>` or the `<install folder>`, is printed through the repository's `node_modules/@hailstails/hone` when that folder holds the same `package.json` as the package that is running, as it does under pnpm, which runs the package from its store under `node_modules/.pnpm`. When the repository root has no such folder, as when the package is installed only in a workspace package, installed globally or run from a source checkout, the path is printed where the running package is, by the rules above. A load failure reading the installed package's own `package.json`, which only `hone --version` reads, prints its absolute path. A path inside a `<detail>` is printed however the tool that wrote the detail printed it.
@@ -89,7 +89,7 @@ Checks a repository against the disciplines it selects, applies its recorded exc
89
89
  commands:
90
90
  check check the repository against the disciplines it selects and print the report, ending in its verdict
91
91
  project write the native configuration each selected embedded mechanism needs, printing each file as written or unchanged
92
- record-debt add a reason-only file carve-out to the exception records for each clause and file the check finds broken, as inherited debt, printing each pair and what was done
92
+ record-debt add a file carve-out naming only its clause and file to the exception records for each clause and file the check finds broken, as inherited debt, printing each pair and what was done
93
93
  split-records move the exception records from discipline-exceptions.json into the discipline-exceptions folder, one file for each record kind and discipline, printing each file as written or removed
94
94
 
95
95
  options:
@@ -147,7 +147,7 @@ exit codes:
147
147
  ```text
148
148
  usage: hone record-debt --repo <dir> --base-revision <revision> [--leave <path>]...
149
149
 
150
- add a reason-only file carve-out to the exception records for each clause and file the check finds broken, as inherited debt, printing each pair and what was done
150
+ add a file carve-out naming only its clause and file to the exception records for each clause and file the check finds broken, as inherited debt, printing each pair and what was done
151
151
 
152
152
  options:
153
153
  --repo <dir>
@@ -261,6 +261,7 @@ Each section's entries take one of these shapes. An exempted finding repeats ` e
261
261
  | `unrecorded` | `<clause> <mechanism> command-line-option <package file> <script> <option> weakens the script's whole run, so no record can cover it: remove it from the script` |
262
262
  | `unrecorded` | `<clause> <mechanism> command-line-option <package file> <script> <option>: <command> is not the first command of its script, so Hone cannot tell what the option does to the files under check; give <command> a script of its own, such as <invocation>` |
263
263
  | `unrecorded` | `<clause> <mechanism> command-line-option <package file> <script> <option>: <wrapper> comes before <command> and is neither a package runner nor a NAME=value setting, so Hone cannot tell what the option does to the files under check; put only package runners and NAME=value settings before <command>` |
264
+ | `unrecorded` | `<clause> <mechanism> command-line-option <package file> <script> <option>: a quote in the script has no partner, so Hone cannot read what the script passes to <command> or tell what that does to the files under check; pair every quote in the script` |
264
265
  | `doublyHeld` | `<clause> <mechanism> doubly-held <file>` |
265
266
  | `invalidRecords` | `exceptions[<index>] clause-unparseable <detail>` |
266
267
  | `invalidRecords` | `exceptions[<index>] clause-not-selected <clause>` |
@@ -317,6 +318,8 @@ Each section's entries take one of these shapes. An exempted finding repeats ` e
317
318
 
318
319
  A run that cannot decide prints one line and exits `2`. It prints the same line in every output. The line starts with `load failure: ` and its kind; the values follow in the order shown, and any text after the values is not stable.
319
320
 
321
+ `hone record-debt` no longer prints `why-chains-required`: a file carve-out is debt and needs no `whyChain`, so it writes its records whatever `fileExceptionWhyChains` says. The kind keeps its line below until a major release removes it, so a tool that matches it keeps working.
322
+
320
323
  | Kind | Line |
321
324
  | --- | --- |
322
325
  | `arguments-invalid` | `load failure: arguments-invalid <detail>` |
@@ -390,7 +393,7 @@ An `arguments-invalid` line says what was wrong with the command as typed. Its w
390
393
 
391
394
  ## hone record-debt
392
395
 
393
- `hone record-debt` runs the check, then prints one line for each clause and file that has a finding, or an inline disable or TypeScript directive under `unrecorded`, ordered by file and then by clause. A `recorded` line is a `file-carve-out` it added to the exception records, in whichever [layout](../README.md#the-split-layout) the repository keeps them; every other line names a pair it wrote nothing for. It prints nothing when the check finds nothing to record. The `<path>` on a `left` line is the `--leave` value that covers the file.
396
+ `hone record-debt` runs the check, then prints one line for each clause and file that has a finding, or an inline disable or TypeScript directive under `unrecorded`, ordered by file and then by clause. A `recorded` line is a `file-carve-out` it added to the exception records, in whichever [layout](../README.md#the-split-layout) the repository keeps them; every other line names a pair it wrote nothing for. It prints nothing when the check finds nothing to record. The `<path>` on a `left` line is the `--leave` value that covers the file. A `nested-configuration` line names a pair whose clause runs on an embedded mechanism, such as ESLint, in a file that loads the configuration in `<config folder>`, at or under the outermost `<folder>` that holds its own `disciplines.json`. The projection never reaches that configuration, so a record there would leave the projection out of effect and fail the next check.
394
397
 
395
398
  | Output | Line |
396
399
  | --- | --- |
@@ -399,6 +402,7 @@ An `arguments-invalid` line says what was wrong with the command as typed. Its w
399
402
  | `record-debt` | `<clause> left <file>: under --leave <path>; record it as an authorised-location with its own reason, or fix it` |
400
403
  | `record-debt` | `<clause> new-file <file>: the base revision does not hold this file, so its debt was not inherited; fix it, or record it with its own reason` |
401
404
  | `record-debt` | `<clause> refused <file>: the clause's discipline refuses exceptions; fix it` |
405
+ | `record-debt` | `<clause> nested-configuration <file>: the file loads the <mechanism> configuration in <config folder>, and <folder> holds its own disciplines.json; nested Hone configurations are not supported yet (https://github.com/HailsTails/hone/issues/72), so the <mechanism> projection cannot put a record on this file into effect; fix it, or govern <folder> from this repository by removing <folder>/disciplines.json, then run record-debt again` |
402
406
 
403
407
  ## hone split-records
404
408
 
@@ -6,7 +6,7 @@ The native channels, the exception kind each maps to, and how the projection is
6
6
 
7
7
  The check compares the committed projection byte for byte with what the runner would write now. Built core is the installed package: the runner reads the package's `package.json` for its name, and the projection imports each piece inside it by package name, `<name>/mechanisms/eslint/...`, which resolves wherever the package is installed. A `package.json` that cannot be read or names no package is a `tool-failed` failure. Core run from source, as in its own tests, imports each piece by its path relative to the folder the slice is written in. A piece outside the install, in the repository's own rule set, is always imported by relative path, and a piece on another drive from a slice's folder fails as `piece-invalid`.
8
8
 
9
- The config roots are the repository root, every folder holding a tracked `eslint.config.*` when the team's lookup is nearest-to-file, and every folder core passes as a declared config root, less any folder at or under a folder with a tracked `disciplines.json`, because nested Hone configurations are not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)). Under the nearest-to-file lookup, when the projection is not in effect, `run` names each outermost such folder holding files under check whose own config leaves a record of this repository out of effect, or the selected rule off, as a `nested-configuration` slice; core names the folder on the `mechanism-not-run` entry it explains, not as a projection problem. Core reads and validates `eslintConfigRoots` from `disciplines.json` and passes the folders in the request as `declaredConfigRoots`; the runner never reads them itself. Each root's slice is `disciplines.eslint.mjs` in that folder. The root slice holds every record; a package slice holds the records for files under its folder, re-pathed relative to it and glob-escaped as in the root, and every clause-wide carve-out. A file belongs to the deepest root containing it. `project` writes every slice, then, for each tracked `disciplines.eslint.mjs` in a folder that is no longer a root, regenerates the slice that folder would get and removes the file only when its bytes match that text, so it never deletes a file it did not write; otherwise it reports `left-in-place`. `project` renders and reads every slice and orphan before it writes or removes anything, so a failure part-way changes nothing. `run` reports each package slice that is `missing` or `out-of-date`, each declared root with no `eslint.config.*` on disk as `unconfigured`, and, under the nearest-to-file lookup when the projection is not in effect, each package root whose own recorded files under check are not excepted as `not-applied`, grouping the checked files by their governing root once. Every config root gets and keeps its slice whatever a config above it ignores: a lint run from that folder loads its own config and never reads the ignores of the configs above it, so `project` writes the same slices from the same inputs every time. `not-applied` judges each recorded file through the same per-file query as every other judgement, which resolves the file from its nearest config, the one a lint run from its package loads. A root-only repository's projection is unchanged.
9
+ The config roots are the repository root, every folder holding a tracked `eslint.config.*` when the team's lookup is nearest-to-file, and every folder core passes as a declared config root, less any folder at or under a folder with a tracked `disciplines.json`, because nested Hone configurations are not supported yet ([#72](https://github.com/HailsTails/hone/issues/72)). Under the nearest-to-file lookup, `run` returns as `unprojectedFolders` each outermost folder, at or under such a folder and holding a file under check, that holds its own tracked `eslint.config.*`, with the outermost folder holding a `disciplines.json` that holds it as `selectionFolder`: a file there loads that config, which gets no slice, so `hone record-debt` writes no record for it. A folder holding its own `disciplines.json` but no config of its own is not one, since its files load the config above it. When the projection is not in effect, `run` also names each outermost such folder holding files under check whose own config leaves a record of this repository out of effect, or the selected rule off, as a `nested-configuration` slice; core names the folder on the `mechanism-not-run` entry it explains, not as a projection problem. Core reads and validates `eslintConfigRoots` from `disciplines.json` and passes the folders in the request as `declaredConfigRoots`; the runner never reads them itself. Each root's slice is `disciplines.eslint.mjs` in that folder. The root slice holds every record; a package slice holds the records for files under its folder, re-pathed relative to it and glob-escaped as in the root, and every clause-wide carve-out. A file belongs to the deepest root containing it. `project` writes every slice, then, for each tracked `disciplines.eslint.mjs` in a folder that is no longer a root, regenerates the slice that folder would get and removes the file only when its bytes match that text, so it never deletes a file it did not write; otherwise it reports `left-in-place`. `project` renders and reads every slice and orphan before it writes or removes anything, so a failure part-way changes nothing. `run` reports each package slice that is `missing` or `out-of-date`, each declared root with no `eslint.config.*` on disk as `unconfigured`, and, under the nearest-to-file lookup when the projection is not in effect, each package root whose own recorded files under check are not excepted as `not-applied`, grouping the checked files by their governing root once. Every config root gets and keeps its slice whatever a config above it ignores: a lint run from that folder loads its own config and never reads the ignores of the configs above it, so `project` writes the same slices from the same inputs every time. `not-applied` judges each recorded file through the same per-file query as every other judgement, which resolves the file from its nearest config, the one a lint run from its package loads. A root-only repository's projection is unchanged.
10
10
 
11
11
  ## Runtime
12
12
 
@@ -598,6 +598,7 @@ var selectionLookupSchema = z6.looseObject({ eslintConfigLookup: eslintConfigLoo
598
598
  import { z as z7 } from "zod";
599
599
  var SCRIPT_PIECES = /(?<single>'[^']*')|(?<double>"[^"]*")|(?<operator>&&|\|\||[;|])|(?<space>\s+)|(?<text>[^'"\s;|&]+|&)|(?<stray>['"])/g;
600
600
  var ESLINT_TOKEN = "eslint";
601
+ var UNREADABLE_SCRIPT_BREAKS = /[\s'";|&()]+/;
601
602
  var ESLINT_VERSIONED_PREFIX = "eslint@";
602
603
  var ESLINT_PATH_SUFFIXES = ["/eslint", "/eslint.js"];
603
604
  var FORWARDED_OPTIONS_SEPARATOR = "--";
@@ -901,7 +902,7 @@ var locatedScan = (request) => {
901
902
  return {
902
903
  outcome: "ok",
903
904
  value: {
904
- scriptOptions: request.scan.value.scriptOptions,
905
+ ...request.scan.value,
905
906
  suppressionsLocations: [
906
907
  ...request.scan.value.suppressionsLocations,
907
908
  { location: location.value, script: request.script }
@@ -909,16 +910,34 @@ var locatedScan = (request) => {
909
910
  }
910
911
  };
911
912
  };
913
+ var EMPTY_SCAN = { scriptOptions: [], suppressionsLocations: [], unreadableScripts: [] };
914
+ var unreadableScan = (request) => {
915
+ const command = request.scriptText.split(UNREADABLE_SCRIPT_BREAKS).find((piece) => eslintNamingOf({ token: piece }) === "names-eslint");
916
+ if (command === void 0) {
917
+ return EMPTY_SCAN;
918
+ }
919
+ return {
920
+ ...EMPTY_SCAN,
921
+ unreadableScripts: [
922
+ {
923
+ command,
924
+ exceptions: request.selectedRules.map(
925
+ (rule) => ({
926
+ kind: "command-line-option",
927
+ clause: rule.clause,
928
+ location: request.path,
929
+ script: request.script,
930
+ option: request.scriptText
931
+ })
932
+ )
933
+ }
934
+ ]
935
+ };
936
+ };
912
937
  var scriptScan = (request) => {
913
938
  const commands = shellCommandsOf({ script: request.scriptText });
914
939
  if (commands.outcome === "failed") {
915
- return {
916
- outcome: "failed",
917
- error: {
918
- kind: "tool-failed",
919
- detail: `script "${request.script}" in ${request.path} has an unterminated quote`
920
- }
921
- };
940
+ return { outcome: "ok", value: unreadableScan(request) };
922
941
  }
923
942
  const invocations = settledInvocationsOf({ commands: commands.value });
924
943
  const baseSegments = request.path.split("/").slice(0, -1);
@@ -926,10 +945,7 @@ var scriptScan = (request) => {
926
945
  (scan, locationText) => locatedScan({ scan, locationText, baseSegments, path: request.path, script: request.script }),
927
946
  {
928
947
  outcome: "ok",
929
- value: {
930
- scriptOptions: scriptOptionsOf({ ...request, invocations }),
931
- suppressionsLocations: []
932
- }
948
+ value: { ...EMPTY_SCAN, scriptOptions: scriptOptionsOf({ ...request, invocations }) }
933
949
  }
934
950
  );
935
951
  };
@@ -953,7 +969,8 @@ var mergedScriptScan = (request) => {
953
969
  suppressionsLocations: [
954
970
  ...request.scan.value.suppressionsLocations,
955
971
  ...scanned.value.suppressionsLocations
956
- ]
972
+ ],
973
+ unreadableScripts: [...request.scan.value.unreadableScripts, ...scanned.value.unreadableScripts]
957
974
  }
958
975
  };
959
976
  };
@@ -971,7 +988,7 @@ var scanPackageJson = (request) => {
971
988
  }
972
989
  return Object.entries(packageJson.data.scripts ?? {}).reduce(
973
990
  (scan, [script, scriptText]) => mergedScriptScan({ scan, script, scriptText, path: request.path, selectedRules: request.selectedRules }),
974
- { outcome: "ok", value: { scriptOptions: [], suppressionsLocations: [] } }
991
+ { outcome: "ok", value: EMPTY_SCAN }
975
992
  );
976
993
  };
977
994
 
@@ -1313,6 +1330,17 @@ var outermostOf = (request) => request.nested.filter(
1313
1330
  );
1314
1331
  var holdingOf = (request) => request.paths.some((path) => within({ path, directory: request.folder }) === "within") ? "holds" : "holds-none";
1315
1332
  var nestedConfigurationFoldersOf = (request) => outermostOf({ nested: nestedRepositories(request) }).filter((folder) => holdingOf({ paths: request.files, folder }) === "holds").sort(codeUnitOrder2).map((folder) => repoPathSchema.parse(folder));
1333
+ var unprojectedFoldersOf = (request) => {
1334
+ const nested = nestedRepositories(request);
1335
+ const outermostNested = outermostOf({ nested });
1336
+ const ownConfigured = configuredDirectories({ ...request, declared: [] }).filter(
1337
+ (directory) => directory !== "" && insideNestedRepository({ directory, nested }) === "nested"
1338
+ );
1339
+ return outermostOf({ nested: ownConfigured }).filter((folder) => holdingOf({ paths: request.files, folder }) === "holds").sort(codeUnitOrder2).flatMap((folder) => {
1340
+ const selectionFolder = outermostNested.find((candidate) => within({ path: folder, directory: candidate }) === "within");
1341
+ return selectionFolder === void 0 ? [] : [{ folder: repoPathSchema.parse(folder), selectionFolder: repoPathSchema.parse(selectionFolder) }];
1342
+ });
1343
+ };
1316
1344
  var orphanedSliceDirectoriesOf = (request) => {
1317
1345
  const nested = nestedRepositories(request);
1318
1346
  const rooted = new Set(request.roots.flatMap((root) => root.placement === "package" ? [root.directory] : []));
@@ -2044,10 +2072,14 @@ var weakeningExceptions = (request) => request.judge({ option: request.option })
2044
2072
  var judgedScriptExceptions = (request) => Promise.all(request.scan.scriptOptions.map((option) => weakeningExceptions({ option, judge: request.judge }))).then(
2045
2073
  (outcomes) => gatheredOutcomes({ outcomes })
2046
2074
  );
2075
+ var unreadableScriptExceptions = (request) => request.scan.unreadableScripts.flatMap(
2076
+ (unreadable) => unreadable.exceptions.map((exception) => ({ ...exception, cause: { kind: "unreadable", command: unreadable.command } }))
2077
+ );
2047
2078
  var scannedPackageExceptions = (request) => judgedScriptExceptions(request).then(
2048
2079
  (scriptExceptions) => gatheredOutcomes({
2049
2080
  outcomes: [
2050
2081
  scriptExceptions,
2082
+ { outcome: "ok", value: unreadableScriptExceptions({ scan: request.scan }) },
2051
2083
  ...request.scan.suppressionsLocations.map(
2052
2084
  (scripted) => scriptSuppressionEntries({
2053
2085
  fileText: request.fileText,
@@ -2288,18 +2320,23 @@ var selectedRun = (request) => {
2288
2320
  roots,
2289
2321
  fileText: request.ports.fileText
2290
2322
  });
2291
- return status.outcome === "failed" ? Promise.resolve(status) : governedRun({
2323
+ if (status.outcome === "failed") {
2324
+ return Promise.resolve(status);
2325
+ }
2326
+ const unprojectedFolders = unprojectedFoldersOf({
2327
+ trackedPaths: request.run.trackedPaths,
2328
+ files: request.run.files,
2329
+ lookup: lookup.value.kind
2330
+ });
2331
+ return governedRun({
2292
2332
  ...request,
2293
2333
  status: {
2294
2334
  ...status.value,
2295
- slices: [
2296
- ...status.value.slices,
2297
- ...unconfiguredSlicesOf({ ports: request.ports, run: request.run, roots })
2298
- ]
2335
+ slices: [...status.value.slices, ...unconfiguredSlicesOf({ ports: request.ports, run: request.run, roots })]
2299
2336
  },
2300
2337
  roots,
2301
2338
  lookup: lookup.value
2302
- });
2339
+ }).then((report) => report.outcome === "failed" ? report : { outcome: "ok", value: { ...report.value, unprojectedFolders } });
2303
2340
  };
2304
2341
  var lintedSourceCases = (request) => {
2305
2342
  if (request.selected.outcome === "failed") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hailstails/hone",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Checks a repository against the disciplines it selects, applies its recorded exceptions and prints one verdict.",
5
5
  "keywords": [
6
6
  "disciplines",
@@ -38,7 +38,7 @@ it("loads the account", () => {
38
38
  Assert on the whole result. Branching in tests is also reported by CD-27.
39
39
 
40
40
  ## Exceptions
41
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs a throw, such as a shared test harness. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
41
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs a throw, such as a shared test harness. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
42
42
 
43
43
  ```json
44
44
  { "version": 1, "exceptions": [
@@ -46,4 +46,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
46
46
  ] }
47
47
  ```
48
48
 
49
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
49
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -38,7 +38,7 @@ export const createCounter = () => {
38
38
  Return an object of functions from a factory that closes over its state.
39
39
 
40
40
  ## Exceptions
41
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a class is required, such as an adapter extending a library base class. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
41
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a class is required, such as an adapter extending a library base class. 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).
42
42
 
43
43
  ```json
44
44
  { "version": 1, "exceptions": [
@@ -46,4 +46,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
46
46
  ] }
47
47
  ```
48
48
 
49
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
49
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -29,7 +29,7 @@ const totals = orders.map((order) => order.total);
29
29
  Replace a counted loop with `Array.from({ length }, (_, position) => ...)`.
30
30
 
31
31
  ## Exceptions
32
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file drains an async stream and cannot use a functional form. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
32
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file drains an async stream and cannot use a functional form. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
33
33
 
34
34
  ```json
35
35
  { "version": 1, "exceptions": [
@@ -37,4 +37,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
37
37
  ] }
38
38
  ```
39
39
 
40
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
40
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -26,7 +26,7 @@ const startedAt = clock.now();
26
26
  Accept a clock as a dependency and read time only through it. The one real implementation lives in an adapter.
27
27
 
28
28
  ## Exceptions
29
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the single real clock implementation. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
29
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the single real clock implementation. 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).
30
30
 
31
31
  ```json
32
32
  { "version": 1, "exceptions": [
@@ -34,4 +34,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
34
34
  ] }
35
35
  ```
36
36
 
37
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
37
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -38,7 +38,7 @@ import { createIdGenerator } from "./id-generator.ts";
38
38
  Import your own port. Only the wrapping file imports the library.
39
39
 
40
40
  ## Exceptions
41
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the wrapping boundary for that dependency. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
41
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` for the file that is the wrapping boundary for that dependency. 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).
42
42
 
43
43
  ```json
44
44
  { "version": 1, "exceptions": [
@@ -46,4 +46,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
46
46
  ] }
47
47
  ```
48
48
 
49
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
49
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -43,7 +43,7 @@ Parse or narrow the value so the type follows from a check rather than from an a
43
43
  When handing a value across a boundary truly forces a cast, such as a library that types its schemas loosely or a database driver that returns unparsed rows, put the cast in the one adapter file at that boundary and record that file as an `authorised-location` with a why-chain. With clean boundaries that is one file and one record; casts scattered across many files are the sign the boundary is missing.
44
44
 
45
45
  ## Exceptions
46
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file sits on an external boundary that forces an assertion, such as an adapter. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
46
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file sits on an external boundary that forces an assertion, such as an adapter. 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).
47
47
 
48
48
  ```json
49
49
  { "version": 1, "exceptions": [
@@ -53,4 +53,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
53
53
 
54
54
  Records on `CD-2#non-null-assertions` take the same kinds. Existing `!` debt is usually a `file-carve-out` per file, or one `clause-wide-carve-out` while an assessment's steps pay it down. An `eslint-disable` naming `hone-cd2/no-restricted-syntax`, or naming no rule, is held only by an `authorised-location` or `file-carve-out` on this clause and its file; a `clause-wide-carve-out` does not hold it. The projection carries every record for it, so run `hone project` after recording one.
55
55
 
56
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
56
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -24,7 +24,7 @@ This is `src/price.ts` with no `src/price.test.ts` beside it.
24
24
  Add `src/price.test.ts` next to the file, with at least one test of its behaviour.
25
25
 
26
26
  ## Exceptions
27
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file only wires exports together and has no behaviour of its own to test. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
27
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file only wires exports together and has no behaviour of its own to test. 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).
28
28
 
29
29
  ```json
30
30
  { "version": 1, "exceptions": [
@@ -32,4 +32,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
32
32
  ] }
33
33
  ```
34
34
 
35
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
35
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -27,7 +27,7 @@ const clock = { now: vi.fn().mockReturnValue(1) };
27
27
  Return a canned value: that double is a stub. If the double needs logic, the seam is probably too wide, or the double is a fake that belongs in a shared in-memory implementation of the port with its own tests.
28
28
 
29
29
  ## Exceptions
30
- A double that legitimately needs behaviour is a fake: write it once as an in-memory implementation of the port, in its own module with its own tests, and pass it in. That is the home for the behaviour, not an exception for a test file. For debt in one file, add a `file-carve-out` entry to `discipline-exceptions.json` at the repository root: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
30
+ A double that legitimately needs behaviour is a fake: write it once as an in-memory implementation of the port, in its own module with its own tests, and pass it in. That is the home for the behaviour, not an exception for a test file. For debt in one file, add a `file-carve-out` entry to `discipline-exceptions.json` at the repository root: it is forfeited once the file is touched, and needs no `whyChain`. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
31
31
 
32
32
  ```json
33
33
  { "version": 1, "exceptions": [
@@ -35,4 +35,4 @@ A double that legitimately needs behaviour is a fake: write it once as an in-mem
35
35
  ] }
36
36
  ```
37
37
 
38
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
38
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -25,7 +25,7 @@ const subject = createSubject({ store: storeStub });
25
25
  Pass the collaborator in as a dependency and hand the test a stub.
26
26
 
27
27
  ## Exceptions
28
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs to intercept a module. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
28
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs to intercept a module. 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).
29
29
 
30
30
  ```json
31
31
  { "version": 1, "exceptions": [
@@ -33,4 +33,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
33
33
  ] }
34
34
  ```
35
35
 
36
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
36
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -64,7 +64,7 @@ expect(given).toBe(1);
64
64
  ```
65
65
 
66
66
  ## Exceptions
67
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs logic. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
67
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a test file legitimately needs logic. 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).
68
68
 
69
69
  ```json
70
70
  { "version": 1, "exceptions": [
@@ -72,4 +72,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
72
72
  ] }
73
73
  ```
74
74
 
75
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
75
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -55,7 +55,7 @@ Put the flags in a shared base file that is not named `tsconfig.json`, and leave
55
55
  ```
56
56
 
57
57
  ## Exceptions
58
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a package must set the flag itself. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
58
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a package must set the flag itself. 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).
59
59
 
60
60
  ```json
61
61
  { "version": 1, "exceptions": [
@@ -63,4 +63,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
63
63
  ] }
64
64
  ```
65
65
 
66
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
66
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -28,7 +28,7 @@ const createOrder = ({ customerId, items, currency }: OrderRequest) => ({ custom
28
28
  Take one object with named fields so each call site reads as a labelled contract.
29
29
 
30
30
  ## Exceptions
31
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must implement a callback signature fixed by an external library. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
31
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must implement a callback signature fixed by an external library. Use `file-carve-out` for debt in one file: it 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).
32
32
 
33
33
  ```json
34
34
  { "version": 1, "exceptions": [
@@ -36,4 +36,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
36
36
  ] }
37
37
  ```
38
38
 
39
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
39
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -43,7 +43,7 @@ const settle = (orders: Order[]) => orders.filter(isPaid).forEach(refundEligible
43
43
  Move each branch into a named helper so the orchestrator only composes calls.
44
44
 
45
45
  ## Exceptions
46
- 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 a `whyChain` as below. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
46
+ 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).
47
47
 
48
48
  ```json
49
49
  { "version": 1, "exceptions": [
@@ -51,4 +51,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
51
51
  ] }
52
52
  ```
53
53
 
54
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
54
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -36,7 +36,7 @@ const label = (order: Order) => {
36
36
  Handle the unhappy path first with an early return and leave the happy path as the final return.
37
37
 
38
38
  ## Exceptions
39
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep an else for an external reason. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. Judgement clauses cannot be selected and need no exception record. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
39
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep an else for an external reason. 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).
40
40
 
41
41
  ```json
42
42
  { "version": 1, "exceptions": [
@@ -44,4 +44,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
44
44
  ] }
45
45
  ```
46
46
 
47
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
47
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -26,7 +26,7 @@ const render = (mode: "compact" | "full"): string => "";
26
26
  Name each state in the type.
27
27
 
28
28
  ## Exceptions
29
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must follow an external interface that uses a boolean. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
29
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must follow an external interface that uses a boolean. 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).
30
30
 
31
31
  ```json
32
32
  { "version": 1, "exceptions": [
@@ -34,4 +34,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
34
34
  ] }
35
35
  ```
36
36
 
37
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
37
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -37,7 +37,7 @@ const withTotal = (order: Order): Order => ({ ...order, total: 10 });
37
37
  Copy before sorting or reversing: `[...items].sort()`.
38
38
 
39
39
  ## Exceptions
40
- Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must fill an output object supplied by an external API. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
40
+ Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must fill an output object supplied by an external API. 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).
41
41
 
42
42
  ```json
43
43
  { "version": 1, "exceptions": [
@@ -45,4 +45,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
45
45
  ] }
46
46
  ```
47
47
 
48
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
48
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -26,7 +26,7 @@ spawnSync("git", ["init"], { cwd: directory, env: hermeticGitEnvironment() });
26
26
  Build the environment without inherited git variables or the user's configuration, and run in a temporary directory.
27
27
 
28
28
  ## Exceptions
29
- Record exemptions only in `discipline-exceptions.json` at the repository root; core reads no other allowance file. Use `authorised-location` when a test file legitimately builds its environment another way. Use `file-carve-out` for debt in one file: it is forfeited once the file is touched, and needs a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
29
+ Record exemptions only in `discipline-exceptions.json` at the repository root; core reads no other allowance file. Use `authorised-location` when a test file legitimately builds its environment another way. 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).
30
30
 
31
31
  ```json
32
32
  { "version": 1, "exceptions": [
@@ -34,4 +34,4 @@ Record exemptions only in `discipline-exceptions.json` at the repository root; c
34
34
  ] }
35
35
  ```
36
36
 
37
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
37
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
@@ -41,7 +41,7 @@ const first = items[0];
41
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.
42
42
 
43
43
  ## Exceptions
44
- 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 a `whyChain` as below. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
44
+ 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).
45
45
 
46
46
  ```json
47
47
  { "version": 1, "exceptions": [
@@ -49,4 +49,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
49
49
  ] }
50
50
  ```
51
51
 
52
- By default every record, `authorised-location` included, also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` or `file-carve-out` may give only its `reason`; a `clause-wide-carve-out` still needs its `whyChain`. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.
52
+ An `authorised-location` or `clause-wide-carve-out` also needs a `whyChain` that follows the [why-chain contract](../../docs/why-chain-contract.md): five whys chained cause to cause, a `rootCause`, its `rootCheck`, a `readback` and an `owner`. A record imported from an earlier system carries `provenance` instead. A `file-carve-out` is debt and needs only its `kind`, `clause` and `file`; its `reason` is an optional note, and a `whyChain` or `provenance` it gives anyway is still judged. With `"fileExceptionWhyChains": "optional"` in `disciplines.json`, an `authorised-location` may give only its `reason`, which will be refused in the next major release. [The exceptions format](../../README.md#discipline-exceptionsjson) gives each shape.