@hailstails/hone 0.1.0-pre.7 → 0.1.0-pre.8
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 +25 -9
- package/CHANGELOG.md +130 -0
- package/MIGRATING.md +55 -16
- package/README.md +8 -7
- package/api/testing.js +1 -1
- package/chunks/{chunk-3LCKBX5T.js → chunk-XXLMIBLS.js} +43 -5
- package/core/check/tool-command.js +38 -17
- package/docs/extending.md +2 -0
- package/docs/output-contract.md +4 -4
- package/mechanisms/audit/CD-19/import-boundaries.js +1 -1
- package/mechanisms/audit/runner/README.md +2 -2
- package/package.json +2 -1
- package/rules/CD-10/CHECKS.md +2 -2
- package/rules/CD-14/CHECKS.md +2 -2
- package/rules/CD-15/CHECKS.md +2 -2
- package/rules/CD-17/CHECKS.md +2 -2
- package/rules/CD-19/CHECKS.md +2 -2
- package/rules/CD-2/CHECKS.md +2 -2
- package/rules/CD-23/CHECKS.md +2 -2
- package/rules/CD-25/CHECKS.md +2 -2
- package/rules/CD-26/CHECKS.md +2 -2
- package/rules/CD-27/CHECKS.md +2 -2
- package/rules/CD-3/CHECKS.md +2 -2
- package/rules/CD-40/CHECKS.md +2 -2
- package/rules/CD-41/CHECKS.md +2 -2
- package/rules/CD-42/CHECKS.md +2 -2
- package/rules/CD-43/CHECKS.md +2 -2
- package/rules/CD-44/CHECKS.md +2 -2
- package/rules/CD-47/CHECKS.md +2 -2
- package/rules/CD-5/CHECKS.md +2 -2
- package/rules/CD-6/CHECKS.md +2 -2
- package/rules/CD-7/CHECKS.md +2 -2
- package/rules/CD-7a/CHECKS.md +2 -2
- package/rules/CD-8/CHECKS.md +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
ASSESSMENT_FILE_NAME,
|
|
4
|
+
UNLINKED,
|
|
4
5
|
UNMEASURED_EXCEPTION_BASELINE,
|
|
5
6
|
WAIVED_CLAUSES_REPLACEMENT,
|
|
6
7
|
allOk,
|
|
@@ -11,6 +12,7 @@ import {
|
|
|
11
12
|
installRootOf,
|
|
12
13
|
loadFailureText,
|
|
13
14
|
loadInputs,
|
|
15
|
+
packageLinkOf,
|
|
14
16
|
projectMechanism,
|
|
15
17
|
readRunSettings,
|
|
16
18
|
recordImportOf,
|
|
@@ -21,7 +23,7 @@ import {
|
|
|
21
23
|
runCheck,
|
|
22
24
|
runnerFailed,
|
|
23
25
|
shownFailureOf
|
|
24
|
-
} from "../../chunks/chunk-
|
|
26
|
+
} from "../../chunks/chunk-XXLMIBLS.js";
|
|
25
27
|
import "../../chunks/chunk-MYX7GAVM.js";
|
|
26
28
|
import {
|
|
27
29
|
parsedJson
|
|
@@ -467,6 +469,7 @@ var argumentsInvalid = (request) => ({
|
|
|
467
469
|
// core/check/command-arguments.ts
|
|
468
470
|
var FLAG_MARKER = "-";
|
|
469
471
|
var JOINED_VALUE_MARKER = "=";
|
|
472
|
+
var END_OF_OPTIONS = "--";
|
|
470
473
|
var REMOVED_OPTIONS = /* @__PURE__ */ new Map([["--waived-clauses", WAIVED_CLAUSES_REPLACEMENT]]);
|
|
471
474
|
var failedWith = (request) => argumentsInvalid(request);
|
|
472
475
|
var optionNamed = (request) => COMMANDS[request.subcommand].options.find((option) => option.name === request.given);
|
|
@@ -499,12 +502,27 @@ var optionValuesFrom = (request) => {
|
|
|
499
502
|
}
|
|
500
503
|
return optionValuesFrom({ ...request, remaining: rest, given: new Map([...request.given, [option.name, given]]) });
|
|
501
504
|
};
|
|
505
|
+
var withoutEndOfOptions = (request) => {
|
|
506
|
+
const [name, ...rest] = request.remaining;
|
|
507
|
+
if (name === void 0) {
|
|
508
|
+
return [];
|
|
509
|
+
}
|
|
510
|
+
if (name === END_OF_OPTIONS) {
|
|
511
|
+
return withoutEndOfOptions({ remaining: rest });
|
|
512
|
+
}
|
|
513
|
+
const [given, ...beyond] = rest;
|
|
514
|
+
return given === void 0 ? [name] : [name, given, ...withoutEndOfOptions({ remaining: beyond })];
|
|
515
|
+
};
|
|
502
516
|
var givenOptionValues = (request) => {
|
|
503
517
|
const removed = removedOptionProblem(request);
|
|
504
518
|
if (removed !== void 0) {
|
|
505
519
|
return failedWith({ problem: removed });
|
|
506
520
|
}
|
|
507
|
-
return optionValuesFrom({
|
|
521
|
+
return optionValuesFrom({
|
|
522
|
+
subcommand: request.subcommand,
|
|
523
|
+
remaining: withoutEndOfOptions({ remaining: request.arguments }),
|
|
524
|
+
given: /* @__PURE__ */ new Map()
|
|
525
|
+
});
|
|
508
526
|
};
|
|
509
527
|
var requiredRepo = (request) => {
|
|
510
528
|
const repo = request.values.get(REPO_OPTION.name);
|
|
@@ -553,7 +571,7 @@ var parseProjectArguments = (request) => {
|
|
|
553
571
|
const repo = requiredRepo({ subcommand: "project", values: values.value });
|
|
554
572
|
return repo.outcome === "failed" ? repo : { outcome: "ok", value: { repo: repo.value } };
|
|
555
573
|
};
|
|
556
|
-
var optionNamePositions = (request) => request.arguments.filter((_, position) => position % 2 === 0);
|
|
574
|
+
var optionNamePositions = (request) => withoutEndOfOptions({ remaining: request.arguments }).filter((_, position) => position % 2 === 0);
|
|
557
575
|
var asksForHelp = (request) => optionNamePositions(request).some((argument) => HELP_FLAGS.includes(argument)) ? "help" : "no-help";
|
|
558
576
|
var toolFlagOf = (request) => {
|
|
559
577
|
if (request.given !== void 0 && HELP_FLAGS.includes(request.given)) {
|
|
@@ -970,7 +988,7 @@ var versionAt = (request) => {
|
|
|
970
988
|
};
|
|
971
989
|
var installedVersionOf = (request) => {
|
|
972
990
|
const version = versionAt(request);
|
|
973
|
-
return version.outcome === "failed" ? { outcome: "failed", error: shownFailureOf({ failure: version.error, path: request.path, repoRoot: void 0 }) } : version;
|
|
991
|
+
return version.outcome === "failed" ? { outcome: "failed", error: shownFailureOf({ failure: version.error, path: request.path, repoRoot: void 0, link: UNLINKED }) } : version;
|
|
974
992
|
};
|
|
975
993
|
|
|
976
994
|
// core/check/project-command.ts
|
|
@@ -1003,7 +1021,11 @@ var repoRootOf = (request) => {
|
|
|
1003
1021
|
const selection = request.path.join({ segments: [resolved.value, SELECTION_FILE_NAME] });
|
|
1004
1022
|
return request.fileText.exists({ path: selection }) === "absent" ? { outcome: "failed", error: { kind: "selection-absent", repo: request.repo } } : resolved;
|
|
1005
1023
|
};
|
|
1006
|
-
var
|
|
1024
|
+
var installLinkOf = (request) => request.installRoot.outcome === "failed" ? UNLINKED : packageLinkOf({ ...request, installRoot: request.installRoot.value });
|
|
1025
|
+
var withShownPaths = (request) => request.run.outcome === "failed" ? {
|
|
1026
|
+
outcome: "failed",
|
|
1027
|
+
error: shownFailureOf({ failure: request.run.error, path: request.path, repoRoot: request.repoRoot, link: installLinkOf(request) })
|
|
1028
|
+
} : request.run;
|
|
1007
1029
|
var printOutcome = (request) => {
|
|
1008
1030
|
request.process.writeOut({ text: request.outcome.text });
|
|
1009
1031
|
request.process.exitWith({ code: request.outcome.code });
|
|
@@ -1013,10 +1035,6 @@ var checkRunOf = (request) => request.report.outcome === "failed" ? request.repo
|
|
|
1013
1035
|
value: { report: request.report.value, output: request.output, projectCommand: request.projectCommand }
|
|
1014
1036
|
};
|
|
1015
1037
|
var checkRunIn = async (request) => {
|
|
1016
|
-
const installRoot = installRootOf({ path: request.path, moduleUrl: request.moduleUrl });
|
|
1017
|
-
if (installRoot.outcome === "failed") {
|
|
1018
|
-
return installRoot;
|
|
1019
|
-
}
|
|
1020
1038
|
const projectCommand = projectCommandOf({ path: request.path, moduleUrl: request.moduleUrl, repoRoot: request.repoRoot });
|
|
1021
1039
|
if (projectCommand.outcome === "failed") {
|
|
1022
1040
|
return projectCommand;
|
|
@@ -1031,7 +1049,7 @@ var checkRunIn = async (request) => {
|
|
|
1031
1049
|
});
|
|
1032
1050
|
const report = await runCheck({
|
|
1033
1051
|
repoRoot: request.repoRoot,
|
|
1034
|
-
installRoot: installRoot
|
|
1052
|
+
installRoot: request.installRoot,
|
|
1035
1053
|
moduleExtension: moduleExtensionOf({ moduleUrl: request.moduleUrl }),
|
|
1036
1054
|
baseRevision: request.arguments.baseRevision,
|
|
1037
1055
|
assessment,
|
|
@@ -1055,10 +1073,13 @@ var checkRunFor = async (request) => {
|
|
|
1055
1073
|
if (repoRoot.outcome === "failed") {
|
|
1056
1074
|
return repoRoot;
|
|
1057
1075
|
}
|
|
1076
|
+
const installRoot = installRootOf({ path: request.path, moduleUrl: request.moduleUrl });
|
|
1058
1077
|
return withShownPaths({
|
|
1059
1078
|
path: request.path,
|
|
1079
|
+
fileText: request.fileText,
|
|
1060
1080
|
repoRoot: repoRoot.value,
|
|
1061
|
-
|
|
1081
|
+
installRoot,
|
|
1082
|
+
run: installRoot.outcome === "failed" ? installRoot : await checkRunIn({ ...request, arguments: parsed.value, repoRoot: repoRoot.value, installRoot: installRoot.value })
|
|
1062
1083
|
});
|
|
1063
1084
|
};
|
|
1064
1085
|
var runCheckCommand = (request) => checkRunFor(request).then(
|
|
@@ -1101,13 +1122,12 @@ var runProject = async (request) => {
|
|
|
1101
1122
|
|
|
1102
1123
|
// core/check/run-project-command.ts
|
|
1103
1124
|
var projectionsIn = (request) => {
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
return Promise.resolve(installRoot);
|
|
1125
|
+
if (request.installRoot.outcome === "failed") {
|
|
1126
|
+
return Promise.resolve(request.installRoot);
|
|
1107
1127
|
}
|
|
1108
1128
|
return runProject({
|
|
1109
1129
|
repoRoot: request.repoRoot,
|
|
1110
|
-
installRoot: installRoot.value,
|
|
1130
|
+
installRoot: request.installRoot.value,
|
|
1111
1131
|
moduleExtension: moduleExtensionOf({ moduleUrl: request.moduleUrl }),
|
|
1112
1132
|
fileText: request.fileText,
|
|
1113
1133
|
modules: request.modules,
|
|
@@ -1124,8 +1144,9 @@ var projectResult = (request) => {
|
|
|
1124
1144
|
if (repoRoot.outcome === "failed") {
|
|
1125
1145
|
return Promise.resolve(repoRoot);
|
|
1126
1146
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1147
|
+
const installRoot = installRootOf({ path: request.path, moduleUrl: request.moduleUrl });
|
|
1148
|
+
return projectionsIn({ ...request, repoRoot: repoRoot.value, installRoot }).then(
|
|
1149
|
+
(run) => withShownPaths({ path: request.path, fileText: request.fileText, repoRoot: repoRoot.value, installRoot, run })
|
|
1129
1150
|
);
|
|
1130
1151
|
};
|
|
1131
1152
|
var runProjectCommand = (request) => projectResult(request).then(
|
package/docs/extending.md
CHANGED
|
@@ -218,6 +218,8 @@ export const check: WalkerPiece = {
|
|
|
218
218
|
- `prepare` runs once with the selected clauses, the repository's file list and TypeScript's syntax API. `prepareFile` runs once per tracked file and returns `skipped`, `complete` with its hits, or `syntax` with observers that walk the file's syntax tree. `finish` returns hits that need the whole repository.
|
|
219
219
|
- A hit passes back the clause's `address` unchanged, a 1-based line and 0-based column, and a short snippet.
|
|
220
220
|
- When the piece cannot run, for example on settings it does not accept, return a failed result whose error is a `PieceFailure`: `kind` `piece-invalid`, the clause's `pieceRoot` and a `detail`. `hone check` then stops with a load failure naming the piece folder.
|
|
221
|
+
- When the piece cannot parse a file, return a failed result whose error is `kind` `file-unparseable`, the `file` and a `detail`. `hone check` then stops with `load failure: runner-failed audit file-unparseable <file> <detail>`.
|
|
222
|
+
- To read JSON with comments, such as a `tsconfig.json`, call TypeScript's own parser on the syntax API: `syntaxApi.parseConfigFileTextToJson(file, text)` returns the parsed value as `config` and sets `error` when it cannot parse the text. A piece does not import a JSON parser of its own; see [What is stable](#what-is-stable).
|
|
221
223
|
|
|
222
224
|
### Settings a repository can change
|
|
223
225
|
|
package/docs/output-contract.md
CHANGED
|
@@ -10,8 +10,8 @@ Hone prints everything to standard output: the report, the help, the version, `h
|
|
|
10
10
|
|
|
11
11
|
The exit code is the signal a hook should act on:
|
|
12
12
|
|
|
13
|
-
- `0`: `hone check` printed `verdict: pass`, `hone project` wrote or confirmed every projection, or help or the version was printed;
|
|
14
|
-
- `1`: `hone check` printed `verdict: fail` as its last line. Exit `1` always comes with
|
|
13
|
+
- `0`: `hone check` printed `verdict: pass` or `verdict: pass (partial assessment)`, `hone project` wrote or confirmed every projection, or help or the version was printed;
|
|
14
|
+
- `1`: `hone check` printed `verdict: fail` or `verdict: fail (partial assessment)` as its last line. Exit `1` always comes with one of those lines, and with nothing else;
|
|
15
15
|
- `2`: Hone could not decide. It printed exactly one line, starting with `load failure: `, and no verdict. That covers a command typed wrongly, an input that could not be loaded, a mechanism that failed, and an error Hone did not expect, which prints as `unexpected-error`.
|
|
16
16
|
|
|
17
17
|
A 1.0 hook can rely on this: run `hone check`, block on any non-zero exit, and show standard output as it came.
|
|
@@ -62,7 +62,7 @@ In the tables below, a word in angle brackets, such as `<clause>`, stands for a
|
|
|
62
62
|
| `<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 |
|
|
63
63
|
| `<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 |
|
|
64
64
|
|
|
65
|
-
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 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.
|
|
65
|
+
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.
|
|
66
66
|
|
|
67
67
|
## Commands
|
|
68
68
|
|
|
@@ -73,7 +73,7 @@ hone --help
|
|
|
73
73
|
hone --version
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
Each option is followed by its value as the next argument; a value that starts with `-` is read as a missing value. `--help` or `-h` after a command prints that command's help instead of running it, and `hone --help <command>` prints the same. `hone --help` and `hone --version` take nothing else after them.
|
|
76
|
+
Each option is followed by its value as the next argument; a value that starts with `-` is read as a missing value. A bare `--` where an option is expected is skipped and the options after it are still read, so `pnpm run <script> -- <options>` works whether or not the package manager passes the `--` on; a `--` where a value is expected is a missing value, like any value that starts with `-`. `--help` or `-h` after a command prints that command's help instead of running it, and `hone --help <command>` prints the same. `hone --help` and `hone --version` take nothing else after them.
|
|
77
77
|
|
|
78
78
|
`hone --help` prints:
|
|
79
79
|
|
|
@@ -68,7 +68,7 @@ var check = {
|
|
|
68
68
|
const record = (specifier) => {
|
|
69
69
|
if (specifier === void 0 || !syntaxApi.isStringLiteralLike(specifier) || !specifier.text.startsWith("node:")) return;
|
|
70
70
|
const anchor = anchorAt({ position: specifier.getStart(sourceFile) });
|
|
71
|
-
const snippet = `bare node: stdlib import -
|
|
71
|
+
const snippet = `bare node: stdlib import - confined; only a wrapping file this repository records as an authorised location may import it: ${specifier.text}`;
|
|
72
72
|
nodeHits.push(...clauses.map((clause) => ({ clause: clause.address, anchor, snippet })));
|
|
73
73
|
};
|
|
74
74
|
return {
|
|
@@ -19,7 +19,7 @@ The audit runner is Hone's standalone mechanism for checks that read a project's
|
|
|
19
19
|
- `observe-walker-file.ts` offers one file to every prepared piece, parses it once if any piece asks for syntax, walks it, and collects the hits.
|
|
20
20
|
- `create-walker-runner.ts` builds the runner from its ports: file text, module loading, paths and parsing.
|
|
21
21
|
- `typescript-parse.ts` binds the parse port to TypeScript. It parses with parent pointers set, so a piece can walk a node's ancestors through `node.parent`.
|
|
22
|
-
- `jsonc-parse.ts` parses JSON with comments
|
|
22
|
+
- `jsonc-parse.ts` parses JSON with comments for Hone's own pieces, such as the one that reads `tsconfig.json`. It is not one of the package's public entries. A team's piece reads such a file with TypeScript's own parser on the syntax API `prepare` hands it, `syntaxApi.parseConfigFileTextToJson(file, text)`, which returns the parsed value as `config` and sets `error` when it cannot parse the text.
|
|
23
23
|
- `runner.ts` is the runner core loads, wired to the default ports.
|
|
24
24
|
- `piece-type-packages.json` lists the packages a piece may import types from. It is not the runtime list above.
|
|
25
25
|
|
|
@@ -37,4 +37,4 @@ After every file, the prepared check's `finish` may return repository-wide hits,
|
|
|
37
37
|
|
|
38
38
|
`conform` runs each case of a clause's `discipline.json` as a one-file repository holding only that case.
|
|
39
39
|
|
|
40
|
-
A piece that throws, or returns a value outside its schema, makes the run fail as `piece-invalid`.
|
|
40
|
+
A piece that throws, or returns a value outside its schema, makes the run fail as `piece-invalid`. A piece that cannot parse a file returns a failed result whose error is `{ kind: "file-unparseable", file, detail }`, and the check stops with `load failure: runner-failed audit file-unparseable <file> <detail>`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hailstails/hone",
|
|
3
|
-
"version": "0.1.0-pre.
|
|
3
|
+
"version": "0.1.0-pre.8",
|
|
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",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"ADOPTING.md",
|
|
57
|
+
"CHANGELOG.md",
|
|
57
58
|
"LICENSE",
|
|
58
59
|
"MIGRATING.md",
|
|
59
60
|
"README.md",
|
package/rules/CD-10/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-14/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-15/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-17/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-19/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-2/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-23/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-25/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-26/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-27/CHECKS.md
CHANGED
|
@@ -34,7 +34,7 @@ expect(ids).toEqual(["a1", "b2"]);
|
|
|
34
34
|
Write the expected value out. A method call in the act step is flagged too, so move such logic into the unit under test.
|
|
35
35
|
|
|
36
36
|
## Exceptions
|
|
37
|
-
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
|
|
37
|
+
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).
|
|
38
38
|
|
|
39
39
|
```json
|
|
40
40
|
{ "version": 1, "exceptions": [
|
|
@@ -42,4 +42,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
42
42
|
] }
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
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.
|
package/rules/CD-3/CHECKS.md
CHANGED
|
@@ -31,7 +31,7 @@ Read [the rule and its spirit](README.md) first. This page is the mechanics: how
|
|
|
31
31
|
Put the flags in a shared base file that is not named `tsconfig.json`, and leave them out of every `tsconfig.json`. That the base file turns them on is left to review.
|
|
32
32
|
|
|
33
33
|
## Exceptions
|
|
34
|
-
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
|
|
34
|
+
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).
|
|
35
35
|
|
|
36
36
|
```json
|
|
37
37
|
{ "version": 1, "exceptions": [
|
|
@@ -39,4 +39,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
39
39
|
] }
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
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.
|
package/rules/CD-40/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-41/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-42/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-43/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-44/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-47/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-5/CHECKS.md
CHANGED
|
@@ -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
|
|
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).
|
|
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
|
-
|
|
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.
|
package/rules/CD-6/CHECKS.md
CHANGED
|
@@ -40,7 +40,7 @@ const account = await loadAccount(id);
|
|
|
40
40
|
Name the value for what it is in the domain.
|
|
41
41
|
|
|
42
42
|
## Exceptions
|
|
43
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep a name fixed by an external contract. Use `file-carve-out` for debt in one file: it
|
|
43
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a file must keep a name 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. See [discipline-exceptions.json](../../README.md#discipline-exceptionsjson).
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
{ "version": 1, "exceptions": [
|
|
@@ -48,4 +48,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
48
48
|
] }
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
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.
|
package/rules/CD-7/CHECKS.md
CHANGED
|
@@ -35,7 +35,7 @@ src/price-formatting.ts
|
|
|
35
35
|
Rename the file or folder for what it contains, or split it into files that each hold one thing.
|
|
36
36
|
|
|
37
37
|
## Exceptions
|
|
38
|
-
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a path name is fixed by a framework or external convention. Use `file-carve-out` for debt in one file: it
|
|
38
|
+
Add an entry to `discipline-exceptions.json` at the repository root. Use `authorised-location` when a path name is fixed by a framework or external convention. 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).
|
|
39
39
|
|
|
40
40
|
```json
|
|
41
41
|
{ "version": 1, "exceptions": [
|
|
@@ -43,4 +43,4 @@ Add an entry to `discipline-exceptions.json` at the repository root. Use `author
|
|
|
43
43
|
] }
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
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.
|