@shrkcrft/boundaries 0.1.0-alpha.29 → 0.1.0-alpha.31
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/dist/baseline/compute-baseline.d.ts +8 -0
- package/dist/baseline/compute-baseline.d.ts.map +1 -1
- package/dist/baseline/compute-baseline.js +10 -8
- package/dist/baseline/diff-baseline.d.ts +28 -0
- package/dist/baseline/diff-baseline.d.ts.map +1 -1
- package/dist/baseline/diff-baseline.js +29 -0
- package/dist/evaluate/boundary-unit-finding.d.ts +10 -0
- package/dist/evaluate/boundary-unit-finding.d.ts.map +1 -0
- package/dist/evaluate/boundary-unit-finding.js +21 -0
- package/dist/evaluate/boundary-unit-kind.d.ts +7 -0
- package/dist/evaluate/boundary-unit-kind.d.ts.map +1 -0
- package/dist/evaluate/boundary-unit-kind.js +14 -0
- package/dist/evaluate/evaluate-boundaries.d.ts +230 -3
- package/dist/evaluate/evaluate-boundaries.d.ts.map +1 -1
- package/dist/evaluate/evaluate-boundaries.js +481 -53
- package/dist/evaluate/i-boundary-rule-settle-input.d.ts +27 -0
- package/dist/evaluate/i-boundary-rule-settle-input.d.ts.map +1 -0
- package/dist/evaluate/i-boundary-rule-settle-input.js +1 -0
- package/dist/evaluate/i-boundary-rule-settlement.d.ts +23 -0
- package/dist/evaluate/i-boundary-rule-settlement.d.ts.map +1 -0
- package/dist/evaluate/i-boundary-rule-settlement.js +1 -0
- package/dist/evaluate/i-boundary-unit-finding.d.ts +22 -0
- package/dist/evaluate/i-boundary-unit-finding.d.ts.map +1 -0
- package/dist/evaluate/i-boundary-unit-finding.js +1 -0
- package/dist/evaluate/settle-boundary-rule.d.ts +23 -0
- package/dist/evaluate/settle-boundary-rule.d.ts.map +1 -0
- package/dist/evaluate/settle-boundary-rule.js +73 -0
- package/dist/evaluate/with-boundary-rule-settlement.d.ts +11 -0
- package/dist/evaluate/with-boundary-rule-settlement.d.ts.map +1 -0
- package/dist/evaluate/with-boundary-rule-settlement.js +44 -0
- package/dist/extract/code-zones.d.ts +95 -3
- package/dist/extract/code-zones.d.ts.map +1 -1
- package/dist/extract/code-zones.js +313 -4
- package/dist/extract/extract-tokens.d.ts +49 -1
- package/dist/extract/extract-tokens.d.ts.map +1 -1
- package/dist/extract/extract-tokens.js +283 -25
- package/dist/extract/i-labeled-source.d.ts +12 -0
- package/dist/extract/i-labeled-source.d.ts.map +1 -0
- package/dist/extract/i-labeled-source.js +1 -0
- package/dist/extract/import-edges.d.ts +50 -0
- package/dist/extract/import-edges.d.ts.map +1 -0
- package/dist/extract/import-edges.js +170 -0
- package/dist/extract/inspect-source.d.ts +38 -3
- package/dist/extract/inspect-source.d.ts.map +1 -1
- package/dist/extract/inspect-source.js +56 -8
- package/dist/extract/parse-imports.d.ts +80 -0
- package/dist/extract/parse-imports.d.ts.map +1 -0
- package/dist/extract/parse-imports.js +254 -0
- package/dist/extract/scan-literals.d.ts +12 -1
- package/dist/extract/scan-literals.d.ts.map +1 -1
- package/dist/extract/scan-literals.js +15 -1
- package/dist/extract/source-liveness-request.d.ts +24 -0
- package/dist/extract/source-liveness-request.d.ts.map +1 -0
- package/dist/extract/source-liveness-request.js +45 -0
- package/dist/generated/check-provenance.d.ts +20 -2
- package/dist/generated/check-provenance.d.ts.map +1 -1
- package/dist/generated/check-provenance.js +27 -6
- package/dist/generated/read-regen-tree.d.ts +16 -0
- package/dist/generated/read-regen-tree.d.ts.map +1 -0
- package/dist/generated/read-regen-tree.js +61 -0
- package/dist/generated/scan-generated.d.ts +57 -3
- package/dist/generated/scan-generated.d.ts.map +1 -1
- package/dist/generated/scan-generated.js +111 -11
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -0
- package/dist/model/boundary-intended-empty-line.d.ts +10 -0
- package/dist/model/boundary-intended-empty-line.d.ts.map +1 -0
- package/dist/model/boundary-intended-empty-line.js +11 -0
- package/dist/model/boundary-markable-list.d.ts +15 -0
- package/dist/model/boundary-markable-list.d.ts.map +1 -0
- package/dist/model/boundary-markable-list.js +15 -0
- package/dist/model/boundary-rule-input-keys.d.ts +11 -0
- package/dist/model/boundary-rule-input-keys.d.ts.map +1 -0
- package/dist/model/boundary-rule-input-keys.js +29 -0
- package/dist/model/boundary-rule-input.d.ts +23 -0
- package/dist/model/boundary-rule-input.d.ts.map +1 -0
- package/dist/model/boundary-rule-input.js +1 -0
- package/dist/model/boundary-rule-key-problems.d.ts +11 -0
- package/dist/model/boundary-rule-key-problems.d.ts.map +1 -0
- package/dist/model/boundary-rule-key-problems.js +36 -0
- package/dist/model/boundary-rule-marker-problems.d.ts +26 -0
- package/dist/model/boundary-rule-marker-problems.d.ts.map +1 -0
- package/dist/model/boundary-rule-marker-problems.js +94 -0
- package/dist/model/boundary-rule-scope.d.ts +88 -0
- package/dist/model/boundary-rule-scope.d.ts.map +1 -0
- package/dist/model/boundary-rule-scope.js +175 -0
- package/dist/model/boundary-rule.d.ts +120 -5
- package/dist/model/boundary-rule.d.ts.map +1 -1
- package/dist/model/boundary-rule.js +148 -1
- package/dist/model/boundary-unit-problem-issue.d.ts +9 -0
- package/dist/model/boundary-unit-problem-issue.d.ts.map +1 -0
- package/dist/model/boundary-unit-problem-issue.js +16 -0
- package/dist/model/normalize-boundary-rule.d.ts +21 -0
- package/dist/model/normalize-boundary-rule.d.ts.map +1 -0
- package/dist/model/normalize-boundary-rule.js +62 -0
- package/dist/policy/evaluate-policy.d.ts +80 -3
- package/dist/policy/evaluate-policy.d.ts.map +1 -1
- package/dist/policy/evaluate-policy.js +152 -19
- package/dist/policy/i-policy-rule-liveness.d.ts +15 -0
- package/dist/policy/i-policy-rule-liveness.d.ts.map +1 -0
- package/dist/policy/i-policy-rule-liveness.js +1 -0
- package/dist/policy/run-policy.d.ts +1 -1
- package/dist/policy/run-policy.d.ts.map +1 -1
- package/dist/policy/run-policy.js +171 -21
- package/dist/registry/load-boundary-rules.d.ts +29 -1
- package/dist/registry/load-boundary-rules.d.ts.map +1 -1
- package/dist/registry/load-boundary-rules.js +38 -8
- package/dist/scan/glob.d.ts +90 -0
- package/dist/scan/glob.d.ts.map +1 -1
- package/dist/scan/glob.js +205 -0
- package/dist/scan/i-glob-unit-measure.d.ts +22 -0
- package/dist/scan/i-glob-unit-measure.d.ts.map +1 -0
- package/dist/scan/i-glob-unit-measure.js +1 -0
- package/dist/scan/import-pattern.d.ts +109 -0
- package/dist/scan/import-pattern.d.ts.map +1 -0
- package/dist/scan/import-pattern.js +191 -0
- package/dist/scan/node-builtin-package-names.d.ts +13 -0
- package/dist/scan/node-builtin-package-names.d.ts.map +1 -0
- package/dist/scan/node-builtin-package-names.js +25 -0
- package/dist/scan/scan-imports.d.ts +36 -3
- package/dist/scan/scan-imports.d.ts.map +1 -1
- package/dist/scan/scan-imports.js +114 -45
- package/dist/util/blank-run-hazard-finding.d.ts +34 -0
- package/dist/util/blank-run-hazard-finding.d.ts.map +1 -0
- package/dist/util/blank-run-hazard-finding.js +1 -0
- package/dist/util/blank-run-hazard.d.ts +29 -0
- package/dist/util/blank-run-hazard.d.ts.map +1 -0
- package/dist/util/blank-run-hazard.js +450 -0
- package/dist/util/dead-glob-units.d.ts +46 -0
- package/dist/util/dead-glob-units.d.ts.map +1 -0
- package/dist/util/dead-glob-units.js +116 -0
- package/dist/util/glob-list-liveness-input.d.ts +31 -0
- package/dist/util/glob-list-liveness-input.d.ts.map +1 -0
- package/dist/util/glob-list-liveness-input.js +65 -0
- package/dist/util/i-dead-glob-unit.d.ts +24 -0
- package/dist/util/i-dead-glob-unit.d.ts.map +1 -0
- package/dist/util/i-dead-glob-unit.js +1 -0
- package/dist/util/i-glob-list-units.d.ts +25 -0
- package/dist/util/i-glob-list-units.d.ts.map +1 -0
- package/dist/util/i-glob-list-units.js +1 -0
- package/dist/util/i-glob-liveness-list.d.ts +23 -0
- package/dist/util/i-glob-liveness-list.d.ts.map +1 -0
- package/dist/util/i-glob-liveness-list.js +1 -0
- package/dist/util/i-glob-liveness-request.d.ts +11 -0
- package/dist/util/i-glob-liveness-request.d.ts.map +1 -0
- package/dist/util/i-glob-liveness-request.js +1 -0
- package/dist/util/i-glob-negation.d.ts +13 -0
- package/dist/util/i-glob-negation.d.ts.map +1 -0
- package/dist/util/i-glob-negation.js +1 -0
- package/dist/util/matched-files.d.ts +22 -0
- package/dist/util/matched-files.d.ts.map +1 -0
- package/dist/util/matched-files.js +1 -0
- package/dist/util/negation-cause.d.ts +15 -0
- package/dist/util/negation-cause.d.ts.map +1 -0
- package/dist/util/negation-cause.js +21 -0
- package/dist/util/plane-scan-exclude-dirs.d.ts +17 -0
- package/dist/util/plane-scan-exclude-dirs.d.ts.map +1 -0
- package/dist/util/plane-scan-exclude-dirs.js +22 -0
- package/dist/util/read-glob-list-liveness.d.ts +20 -0
- package/dist/util/read-glob-list-liveness.d.ts.map +1 -0
- package/dist/util/read-glob-list-liveness.js +20 -0
- package/dist/util/read-scope-coverage.d.ts +90 -0
- package/dist/util/read-scope-coverage.d.ts.map +1 -0
- package/dist/util/read-scope-coverage.js +173 -0
- package/dist/util/read-scope.d.ts +14 -0
- package/dist/util/read-scope.d.ts.map +1 -0
- package/dist/util/read-scope.js +1 -0
- package/dist/util/read-selected-files.d.ts +16 -0
- package/dist/util/read-selected-files.d.ts.map +1 -0
- package/dist/util/read-selected-files.js +25 -0
- package/dist/util/settle-glob-lists.d.ts +12 -0
- package/dist/util/settle-glob-lists.d.ts.map +1 -0
- package/dist/util/settle-glob-lists.js +13 -0
- package/dist/util/unread-file-reason.d.ts +26 -0
- package/dist/util/unread-file-reason.d.ts.map +1 -0
- package/dist/util/unread-file-reason.js +26 -0
- package/dist/util/unread-file.d.ts +10 -0
- package/dist/util/unread-file.d.ts.map +1 -0
- package/dist/util/unread-file.js +1 -0
- package/dist/util/walk-files.d.ts +90 -7
- package/dist/util/walk-files.d.ts.map +1 -1
- package/dist/util/walk-files.js +206 -19
- package/dist/wiring/evaluate-wiring.d.ts +88 -7
- package/dist/wiring/evaluate-wiring.d.ts.map +1 -1
- package/dist/wiring/evaluate-wiring.js +276 -16
- package/dist/wiring/explain-wiring.d.ts +56 -14
- package/dist/wiring/explain-wiring.d.ts.map +1 -1
- package/dist/wiring/explain-wiring.js +136 -10
- package/dist/wiring/i-idiom-role-coverage.d.ts +24 -0
- package/dist/wiring/i-idiom-role-coverage.d.ts.map +1 -0
- package/dist/wiring/i-idiom-role-coverage.js +1 -0
- package/dist/wiring/i-registration-query-verdict.d.ts +38 -0
- package/dist/wiring/i-registration-query-verdict.d.ts.map +1 -0
- package/dist/wiring/i-registration-query-verdict.js +1 -0
- package/dist/wiring/i-registration-roles.d.ts +71 -0
- package/dist/wiring/i-registration-roles.d.ts.map +1 -0
- package/dist/wiring/i-registration-roles.js +1 -0
- package/dist/wiring/measure-idiom-role-coverage.d.ts +12 -0
- package/dist/wiring/measure-idiom-role-coverage.d.ts.map +1 -0
- package/dist/wiring/measure-idiom-role-coverage.js +20 -0
- package/dist/wiring/measure-registration-roles.d.ts +25 -0
- package/dist/wiring/measure-registration-roles.d.ts.map +1 -0
- package/dist/wiring/measure-registration-roles.js +124 -0
- package/dist/wiring/plan-wiring-fix.d.ts +16 -1
- package/dist/wiring/plan-wiring-fix.d.ts.map +1 -1
- package/dist/wiring/plan-wiring-fix.js +177 -4
- package/dist/wiring/registration-graph.d.ts +13 -1
- package/dist/wiring/registration-graph.d.ts.map +1 -1
- package/dist/wiring/registration-graph.js +22 -6
- package/dist/wiring/registration-query-verdict.d.ts +23 -0
- package/dist/wiring/registration-query-verdict.d.ts.map +1 -0
- package/dist/wiring/registration-query-verdict.js +118 -0
- package/dist/wiring/registry-query.d.ts +9 -1
- package/dist/wiring/registry-query.d.ts.map +1 -1
- package/dist/wiring/registry-query.js +17 -6
- package/dist/wiring/scan-wiring-files.d.ts +5 -3
- package/dist/wiring/scan-wiring-files.d.ts.map +1 -1
- package/dist/wiring/scan-wiring-files.js +55 -14
- package/dist/wiring/sink-imports.d.ts +95 -0
- package/dist/wiring/sink-imports.d.ts.map +1 -0
- package/dist/wiring/sink-imports.js +124 -0
- package/dist/wiring/trace-literal.d.ts +6 -0
- package/dist/wiring/trace-literal.d.ts.map +1 -1
- package/dist/wiring/trace-literal.js +5 -2
- package/dist/wiring/wiring-labeled-sources.d.ts +12 -0
- package/dist/wiring/wiring-labeled-sources.d.ts.map +1 -0
- package/dist/wiring/wiring-labeled-sources.js +20 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,24 +1,59 @@
|
|
|
1
1
|
export * from "./model/boundary-rule.js";
|
|
2
|
+
export * from "./model/boundary-rule-scope.js";
|
|
3
|
+
export * from "./scan/import-pattern.js";
|
|
4
|
+
export * from "./scan/node-builtin-package-names.js";
|
|
2
5
|
export * from "./registry/boundary-registry.js";
|
|
3
6
|
export * from "./registry/load-boundary-rules.js";
|
|
4
7
|
export * from "./scan/glob.js";
|
|
8
|
+
export * from "./scan/i-glob-unit-measure.js";
|
|
5
9
|
export * from "./scan/scan-imports.js";
|
|
6
10
|
export * from "./evaluate/evaluate-boundaries.js";
|
|
11
|
+
// Round 13 (lane B): the boundary expectEmpty vocabulary and the one boundary settle.
|
|
12
|
+
export * from "./model/boundary-markable-list.js";
|
|
13
|
+
export * from "./model/boundary-rule-input.js";
|
|
14
|
+
export * from "./model/boundary-rule-input-keys.js";
|
|
15
|
+
export * from "./model/boundary-rule-key-problems.js";
|
|
16
|
+
export * from "./model/boundary-rule-marker-problems.js";
|
|
17
|
+
export * from "./model/boundary-unit-problem-issue.js";
|
|
18
|
+
export * from "./model/normalize-boundary-rule.js";
|
|
19
|
+
export * from "./model/boundary-intended-empty-line.js";
|
|
20
|
+
export * from "./evaluate/i-boundary-rule-settle-input.js";
|
|
21
|
+
export * from "./evaluate/i-boundary-rule-settlement.js";
|
|
22
|
+
export * from "./evaluate/boundary-unit-kind.js";
|
|
23
|
+
export * from "./evaluate/i-boundary-unit-finding.js";
|
|
24
|
+
export * from "./evaluate/boundary-unit-finding.js";
|
|
25
|
+
export * from "./evaluate/settle-boundary-rule.js";
|
|
26
|
+
export * from "./evaluate/with-boundary-rule-settlement.js";
|
|
7
27
|
export * from "./scan/tsconfig-aliases.js";
|
|
8
28
|
export * from "./wiring/evaluate-wiring.js";
|
|
9
29
|
export * from "./wiring/scan-wiring-files.js";
|
|
10
30
|
export * from "./wiring/explain-wiring.js";
|
|
11
31
|
export * from "./wiring/registry-query.js";
|
|
12
32
|
export * from "./wiring/registration-graph.js";
|
|
33
|
+
export * from "./wiring/i-registration-query-verdict.js";
|
|
34
|
+
export * from "./wiring/registration-query-verdict.js";
|
|
35
|
+
export * from "./wiring/i-registration-roles.js";
|
|
36
|
+
export * from "./wiring/measure-registration-roles.js";
|
|
37
|
+
export * from "./wiring/i-idiom-role-coverage.js";
|
|
38
|
+
export * from "./wiring/measure-idiom-role-coverage.js";
|
|
39
|
+
export * from "./generated/read-regen-tree.js";
|
|
13
40
|
export * from "./wiring/trace-literal.js";
|
|
14
41
|
export * from "./wiring/plan-wiring-fix.js";
|
|
42
|
+
export * from "./wiring/sink-imports.js";
|
|
15
43
|
export * from "./policy/extract-templates.js";
|
|
16
44
|
export * from "./policy/evaluate-policy.js";
|
|
17
45
|
export * from "./policy/run-policy.js";
|
|
18
46
|
export * from "./extract/scan-literals.js";
|
|
19
47
|
export * from "./extract/extract-tokens.js";
|
|
48
|
+
export * from "./extract/parse-imports.js";
|
|
49
|
+
export * from "./extract/import-edges.js";
|
|
20
50
|
export * from "./extract/code-zones.js";
|
|
21
51
|
export * from "./extract/inspect-source.js";
|
|
52
|
+
// Round 13 (lane G): labelled sources and THE per-source liveness request.
|
|
53
|
+
export * from "./extract/i-labeled-source.js";
|
|
54
|
+
export * from "./extract/source-liveness-request.js";
|
|
55
|
+
export * from "./wiring/wiring-labeled-sources.js";
|
|
56
|
+
export * from "./policy/i-policy-rule-liveness.js";
|
|
22
57
|
export * from "./baseline/canonicalize.js";
|
|
23
58
|
export * from "./baseline/json-path-keys.js";
|
|
24
59
|
export * from "./baseline/diff-baseline.js";
|
|
@@ -27,4 +62,23 @@ export * from "./generated/check-provenance.js";
|
|
|
27
62
|
export * from "./generated/compare-trees.js";
|
|
28
63
|
export * from "./generated/scan-generated.js";
|
|
29
64
|
export * from "./util/safe-regex.js";
|
|
65
|
+
export * from "./util/blank-run-hazard.js";
|
|
66
|
+
export * from "./util/blank-run-hazard-finding.js";
|
|
30
67
|
export * from "./util/walk-files.js";
|
|
68
|
+
export * from "./util/unread-file-reason.js";
|
|
69
|
+
export * from "./util/unread-file.js";
|
|
70
|
+
export * from "./util/matched-files.js";
|
|
71
|
+
export * from "./util/read-scope.js";
|
|
72
|
+
export * from "./util/read-scope-coverage.js";
|
|
73
|
+
export * from "./util/read-selected-files.js";
|
|
74
|
+
export * from "./util/i-dead-glob-unit.js";
|
|
75
|
+
export * from "./util/i-glob-negation.js";
|
|
76
|
+
export * from "./util/i-glob-list-units.js";
|
|
77
|
+
export * from "./util/dead-glob-units.js";
|
|
78
|
+
// Round 13 (lane G): THE gate-plane glob liveness predicate and settle.
|
|
79
|
+
export * from "./util/i-glob-liveness-list.js";
|
|
80
|
+
export * from "./util/i-glob-liveness-request.js";
|
|
81
|
+
export * from "./util/glob-list-liveness-input.js";
|
|
82
|
+
export * from "./util/settle-glob-lists.js";
|
|
83
|
+
export * from "./util/read-glob-list-liveness.js";
|
|
84
|
+
export * from "./util/plane-scan-exclude-dirs.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IUnitMark } from '@shrkcrft/core';
|
|
2
|
+
/**
|
|
3
|
+
* THE line `boundaries explain` and MCP `get_boundary_rule` print for one
|
|
4
|
+
* `expectEmpty` marker of a rule (round 13), next to its redundant and shadowed
|
|
5
|
+
* notes: `<list> <unit> — <reason>` (+ the stamped pack). It states the
|
|
6
|
+
* assertion only — whether the target has appeared since (went live) is a
|
|
7
|
+
* run-time fact, which `shrk check boundaries` reports.
|
|
8
|
+
*/
|
|
9
|
+
export declare function boundaryIntendedEmptyLine(mark: IUnitMark): string;
|
|
10
|
+
//# sourceMappingURL=boundary-intended-empty-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-intended-empty-line.d.ts","sourceRoot":"","sources":["../../src/model/boundary-intended-empty-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAGjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE line `boundaries explain` and MCP `get_boundary_rule` print for one
|
|
3
|
+
* `expectEmpty` marker of a rule (round 13), next to its redundant and shadowed
|
|
4
|
+
* notes: `<list> <unit> — <reason>` (+ the stamped pack). It states the
|
|
5
|
+
* assertion only — whether the target has appeared since (went live) is a
|
|
6
|
+
* run-time fact, which `shrk check boundaries` reports.
|
|
7
|
+
*/
|
|
8
|
+
export function boundaryIntendedEmptyLine(mark) {
|
|
9
|
+
const pack = mark.packageName !== undefined ? ` [marker from pack ${mark.packageName}]` : '';
|
|
10
|
+
return `${mark.list} ${mark.unit} — ${mark.reason ?? 'no reason given'}${pack}`;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four boundary-rule lists an `expectEmpty` marker may sit in (round 13).
|
|
3
|
+
* Each value is the list's `listPath`: the `list` of every mark the loader
|
|
4
|
+
* records (`normalizeBoundaryRule`) and of every observation the evaluator
|
|
5
|
+
* settles, so a marker always meets the unit it marks. A `from` negation stays
|
|
6
|
+
* in `from` (its unit keeps its `!`); `exceptions[].target` is not markable — a
|
|
7
|
+
* stale exception is an error by design.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum BoundaryMarkableList {
|
|
10
|
+
From = "from",
|
|
11
|
+
ExemptFiles = "exemptFiles",
|
|
12
|
+
ForbiddenImports = "forbiddenImports",
|
|
13
|
+
AllowedImports = "allowedImports"
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=boundary-markable-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-markable-list.d.ts","sourceRoot":"","sources":["../../src/model/boundary-markable-list.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;CAClC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four boundary-rule lists an `expectEmpty` marker may sit in (round 13).
|
|
3
|
+
* Each value is the list's `listPath`: the `list` of every mark the loader
|
|
4
|
+
* records (`normalizeBoundaryRule`) and of every observation the evaluator
|
|
5
|
+
* settles, so a marker always meets the unit it marks. A `from` negation stays
|
|
6
|
+
* in `from` (its unit keeps its `!`); `exceptions[].target` is not markable — a
|
|
7
|
+
* stale exception is an error by design.
|
|
8
|
+
*/
|
|
9
|
+
export var BoundaryMarkableList;
|
|
10
|
+
(function (BoundaryMarkableList) {
|
|
11
|
+
BoundaryMarkableList["From"] = "from";
|
|
12
|
+
BoundaryMarkableList["ExemptFiles"] = "exemptFiles";
|
|
13
|
+
BoundaryMarkableList["ForbiddenImports"] = "forbiddenImports";
|
|
14
|
+
BoundaryMarkableList["AllowedImports"] = "allowedImports";
|
|
15
|
+
})(BoundaryMarkableList || (BoundaryMarkableList = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IBoundaryRuleInput } from './boundary-rule-input.js';
|
|
2
|
+
/**
|
|
3
|
+
* Every key an authored boundary rule may carry — derived from
|
|
4
|
+
* {@link IBoundaryRuleInput} by type: the Record must name each key of the
|
|
5
|
+
* interface and no other, so a rule field added without listing it here fails
|
|
6
|
+
* tsc. `validateBoundaryRule` refuses any other key (round 13): an unknown key
|
|
7
|
+
* used to load and be silently ignored — a guessed rule-level `expectEmpty`
|
|
8
|
+
* among them, which switched nothing off while reading as if it had.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BOUNDARY_RULE_INPUT_KEYS: Readonly<Record<keyof IBoundaryRuleInput, true>>;
|
|
11
|
+
//# sourceMappingURL=boundary-rule-input-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-rule-input-keys.d.ts","sourceRoot":"","sources":["../../src/model/boundary-rule-input-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,kBAAkB,EAAE,IAAI,CAAC,CAoBrF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every key an authored boundary rule may carry — derived from
|
|
3
|
+
* {@link IBoundaryRuleInput} by type: the Record must name each key of the
|
|
4
|
+
* interface and no other, so a rule field added without listing it here fails
|
|
5
|
+
* tsc. `validateBoundaryRule` refuses any other key (round 13): an unknown key
|
|
6
|
+
* used to load and be silently ignored — a guessed rule-level `expectEmpty`
|
|
7
|
+
* among them, which switched nothing off while reading as if it had.
|
|
8
|
+
*/
|
|
9
|
+
export const BOUNDARY_RULE_INPUT_KEYS = {
|
|
10
|
+
id: true,
|
|
11
|
+
title: true,
|
|
12
|
+
description: true,
|
|
13
|
+
severity: true,
|
|
14
|
+
from: true,
|
|
15
|
+
forbiddenImports: true,
|
|
16
|
+
forbiddenMatch: true,
|
|
17
|
+
allowedImports: true,
|
|
18
|
+
failOnEmpty: true,
|
|
19
|
+
exemptFiles: true,
|
|
20
|
+
excludeTests: true,
|
|
21
|
+
exceptions: true,
|
|
22
|
+
tags: true,
|
|
23
|
+
appliesWhen: true,
|
|
24
|
+
message: true,
|
|
25
|
+
suggestedFix: true,
|
|
26
|
+
relatedRules: true,
|
|
27
|
+
relatedPathConventions: true,
|
|
28
|
+
references: true,
|
|
29
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SelectorListEntry } from '@shrkcrft/core';
|
|
2
|
+
import type { IBoundaryRule } from './boundary-rule.js';
|
|
3
|
+
/**
|
|
4
|
+
* A boundary rule as AUTHORED (round 13). The four selector lists accept an
|
|
5
|
+
* `expectEmpty` marker beside plain strings — spec 13.1's own syntax:
|
|
6
|
+
*
|
|
7
|
+
* forbiddenImports: ['@scope/kernel-*', { pattern: '@scope/plugin-react', expectEmpty: true }]
|
|
8
|
+
*
|
|
9
|
+
* The loader validates it (`validateBoundaryRule`) and normalises it
|
|
10
|
+
* (`normalizeBoundaryRule`) into the LOADED {@link IBoundaryRule}: the plain
|
|
11
|
+
* string lists every reader already consumes, plus the `expectEmptyUnits`
|
|
12
|
+
* ledger — derived, never authored. Its keys are the only keys a rule may
|
|
13
|
+
* carry (`BOUNDARY_RULE_INPUT_KEYS`). `exceptions[].target` stays a string: a
|
|
14
|
+
* stale exception is an error by design.
|
|
15
|
+
*/
|
|
16
|
+
export interface IBoundaryRuleInput extends Omit<IBoundaryRule, 'from' | 'forbiddenImports' | 'allowedImports' | 'exemptFiles' | 'expectEmptyUnits'> {
|
|
17
|
+
/** Scope globs; an entry starting with `!` exempts. A marker: `{ pattern: 'packages/plugin-react/**', expectEmpty: true }`. */
|
|
18
|
+
from: readonly SelectorListEntry[];
|
|
19
|
+
forbiddenImports?: readonly SelectorListEntry[];
|
|
20
|
+
allowedImports?: readonly SelectorListEntry[];
|
|
21
|
+
exemptFiles?: readonly SelectorListEntry[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=boundary-rule-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-rule-input.d.ts","sourceRoot":"","sources":["../../src/model/boundary-rule-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,aAAa,GAAG,kBAAkB,CAAC;IAChH,+HAA+H;IAC/H,IAAI,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACnC,gBAAgB,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,cAAc,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC9C,WAAW,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IBoundaryRuleValidationIssue } from './boundary-rule.js';
|
|
2
|
+
/**
|
|
3
|
+
* One issue per key an authored boundary rule may not carry (round 13): a
|
|
4
|
+
* rule-level `expectEmpty` / `allowDead` / `intendedEmpty` (the marker is per
|
|
5
|
+
* pattern), the derived `expectEmptyUnits` ledger, or any other key that is
|
|
6
|
+
* not an {@link BOUNDARY_RULE_INPUT_KEYS} key — with a did-you-mean through
|
|
7
|
+
* the repo's ONE scorer (`nearestIds`, `@shrkcrft/core`). A misplaced key used to
|
|
8
|
+
* load and be silently ignored.
|
|
9
|
+
*/
|
|
10
|
+
export declare function boundaryRuleKeyProblems(rule: Readonly<Record<string, unknown>>): IBoundaryRuleValidationIssue[];
|
|
11
|
+
//# sourceMappingURL=boundary-rule-key-problems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-rule-key-problems.d.ts","sourceRoot":"","sources":["../../src/model/boundary-rule-key-problems.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAevE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,4BAA4B,EAAE,CAe/G"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { nearestIds } from '@shrkcrft/core';
|
|
2
|
+
import { BOUNDARY_RULE_INPUT_KEYS } from "./boundary-rule-input-keys.js";
|
|
3
|
+
/**
|
|
4
|
+
* Rule-level spellings of "this rule may match nothing" an author carries over
|
|
5
|
+
* from another plane (baselines' rule-level `expectEmpty`), or from a guess —
|
|
6
|
+
* plus the derived ledger, which no author may write.
|
|
7
|
+
*/
|
|
8
|
+
const RULE_LEVEL_MARKER_KEYS = new Set(['expectEmpty', 'allowDead', 'intendedEmpty', 'expectEmptyUnits']);
|
|
9
|
+
/** THE words for a rule-level marker (DECISIONS §4). */
|
|
10
|
+
const PER_PATTERN = 'expectEmpty is per pattern on a boundary rule: forbiddenImports: [{ pattern, expectEmpty: true }]';
|
|
11
|
+
const KNOWN_KEYS = Object.keys(BOUNDARY_RULE_INPUT_KEYS);
|
|
12
|
+
/**
|
|
13
|
+
* One issue per key an authored boundary rule may not carry (round 13): a
|
|
14
|
+
* rule-level `expectEmpty` / `allowDead` / `intendedEmpty` (the marker is per
|
|
15
|
+
* pattern), the derived `expectEmptyUnits` ledger, or any other key that is
|
|
16
|
+
* not an {@link BOUNDARY_RULE_INPUT_KEYS} key — with a did-you-mean through
|
|
17
|
+
* the repo's ONE scorer (`nearestIds`, `@shrkcrft/core`). A misplaced key used to
|
|
18
|
+
* load and be silently ignored.
|
|
19
|
+
*/
|
|
20
|
+
export function boundaryRuleKeyProblems(rule) {
|
|
21
|
+
const issues = [];
|
|
22
|
+
for (const key of Object.keys(rule)) {
|
|
23
|
+
if (Object.prototype.hasOwnProperty.call(BOUNDARY_RULE_INPUT_KEYS, key))
|
|
24
|
+
continue;
|
|
25
|
+
if (RULE_LEVEL_MARKER_KEYS.has(key)) {
|
|
26
|
+
issues.push({ field: key, message: PER_PATTERN });
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const near = nearestIds(key, KNOWN_KEYS, 1)[0];
|
|
30
|
+
issues.push({
|
|
31
|
+
field: key,
|
|
32
|
+
message: `unknown key '${key}' — not a boundary rule field, so it would be silently ignored${near !== undefined ? `; did you mean '${near.id}'?` : ''}`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return issues;
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type IUnitList } from '@shrkcrft/core';
|
|
2
|
+
import type { ForbiddenMatchMode, IBoundaryRuleValidationIssue } from './boundary-rule.js';
|
|
3
|
+
/**
|
|
4
|
+
* The marker refusals a boundary rule adds on top of core's marker shape
|
|
5
|
+
* (round 13, DECISIONS §4), over the NORMALISED lists:
|
|
6
|
+
*
|
|
7
|
+
* - a marker on a pattern dead by its SHAPE can never go live, so it could
|
|
8
|
+
* only ever silence a real problem: an `importPatternDefect`, a
|
|
9
|
+
* `forbiddenImports` entry a kept sibling already covers (redundant), or an
|
|
10
|
+
* `allowedImports` entry a forbidden one shadows. Each is proved from the
|
|
11
|
+
* rule alone, through the same authorities the evaluator and `boundaries
|
|
12
|
+
* explain` read (`importPatternDefect`, `boundaryPatternOverlaps`);
|
|
13
|
+
* - a marker on a pattern the dead-unit judge can NEVER call dead (a
|
|
14
|
+
* relative one, a leading `*`, one a runtime builtin matches —
|
|
15
|
+
* `importPatternNeverJudgedDead`) could only ever read went-live: refused
|
|
16
|
+
* with that explanation (K5);
|
|
17
|
+
* - `failOnEmpty: true` with EVERY `from` inclusion marked asserts both "an
|
|
18
|
+
* empty result is intended" and "an empty result fails" (core's one
|
|
19
|
+
* conflict rule, `markedListFailOnEmptyConflict`). Partial marking is legal.
|
|
20
|
+
*/
|
|
21
|
+
export declare function boundaryRuleMarkerProblems(lists: {
|
|
22
|
+
readonly from?: IUnitList;
|
|
23
|
+
readonly forbiddenImports?: IUnitList;
|
|
24
|
+
readonly allowedImports?: IUnitList;
|
|
25
|
+
}, mode: ForbiddenMatchMode, failOnEmpty: unknown): IBoundaryRuleValidationIssue[];
|
|
26
|
+
//# sourceMappingURL=boundary-rule-marker-problems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-rule-marker-problems.d.ts","sourceRoot":"","sources":["../../src/model/boundary-rule-marker-problems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAI3F;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE;IACL,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;CACrC,EACD,IAAI,EAAE,kBAAkB,EACxB,WAAW,EAAE,OAAO,GACnB,4BAA4B,EAAE,CAqFhC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { markedListFailOnEmptyConflict } from '@shrkcrft/core';
|
|
2
|
+
import { importPatternDefect, importPatternNeverJudgedDead } from "../scan/import-pattern.js";
|
|
3
|
+
import { boundaryPatternOverlaps } from "./boundary-rule-scope.js";
|
|
4
|
+
import { BoundaryMarkableList } from "./boundary-markable-list.js";
|
|
5
|
+
/**
|
|
6
|
+
* The marker refusals a boundary rule adds on top of core's marker shape
|
|
7
|
+
* (round 13, DECISIONS §4), over the NORMALISED lists:
|
|
8
|
+
*
|
|
9
|
+
* - a marker on a pattern dead by its SHAPE can never go live, so it could
|
|
10
|
+
* only ever silence a real problem: an `importPatternDefect`, a
|
|
11
|
+
* `forbiddenImports` entry a kept sibling already covers (redundant), or an
|
|
12
|
+
* `allowedImports` entry a forbidden one shadows. Each is proved from the
|
|
13
|
+
* rule alone, through the same authorities the evaluator and `boundaries
|
|
14
|
+
* explain` read (`importPatternDefect`, `boundaryPatternOverlaps`);
|
|
15
|
+
* - a marker on a pattern the dead-unit judge can NEVER call dead (a
|
|
16
|
+
* relative one, a leading `*`, one a runtime builtin matches —
|
|
17
|
+
* `importPatternNeverJudgedDead`) could only ever read went-live: refused
|
|
18
|
+
* with that explanation (K5);
|
|
19
|
+
* - `failOnEmpty: true` with EVERY `from` inclusion marked asserts both "an
|
|
20
|
+
* empty result is intended" and "an empty result fails" (core's one
|
|
21
|
+
* conflict rule, `markedListFailOnEmptyConflict`). Partial marking is legal.
|
|
22
|
+
*/
|
|
23
|
+
export function boundaryRuleMarkerProblems(lists, mode, failOnEmpty) {
|
|
24
|
+
const issues = [];
|
|
25
|
+
const markedIn = (list, listPath) => new Set((list?.marks ?? []).filter((m) => m.list === listPath).map((m) => m.unit));
|
|
26
|
+
const forbiddenMarked = markedIn(lists.forbiddenImports, BoundaryMarkableList.ForbiddenImports);
|
|
27
|
+
const allowedMarked = markedIn(lists.allowedImports, BoundaryMarkableList.AllowedImports);
|
|
28
|
+
const refuseDefects = (list, listPath, marked, listMode) => {
|
|
29
|
+
const reported = new Set();
|
|
30
|
+
list?.units.forEach((unit, i) => {
|
|
31
|
+
if (!marked.has(unit) || reported.has(unit) || importPatternDefect(unit, listMode) === undefined)
|
|
32
|
+
return;
|
|
33
|
+
reported.add(unit);
|
|
34
|
+
issues.push({
|
|
35
|
+
field: `${listPath}[${i}]`,
|
|
36
|
+
message: `'${unit}' is marked expectEmpty, but a defective pattern can never go live — fix the pattern; a marker cannot waive a defect`,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
refuseDefects(lists.forbiddenImports, BoundaryMarkableList.ForbiddenImports, forbiddenMarked, mode);
|
|
41
|
+
refuseDefects(lists.allowedImports, BoundaryMarkableList.AllowedImports, allowedMarked, 'exact');
|
|
42
|
+
// Round 13 (K5): a marker on a pattern the dead-unit judge can NEVER call
|
|
43
|
+
// dead — a relative one, a leading `*`, one a runtime builtin matches — can
|
|
44
|
+
// only ever read went-live, so it would print a stale-marker line from the
|
|
45
|
+
// moment it is written. The judge's own reach rules decide it
|
|
46
|
+
// (`importPatternNeverJudgedDead`).
|
|
47
|
+
const refuseUnjudgeable = (list, listPath, marked, listMode) => {
|
|
48
|
+
const reported = new Set();
|
|
49
|
+
list?.units.forEach((unit, i) => {
|
|
50
|
+
if (!marked.has(unit) || reported.has(unit))
|
|
51
|
+
return;
|
|
52
|
+
const never = importPatternNeverJudgedDead(unit, listMode);
|
|
53
|
+
if (never === undefined)
|
|
54
|
+
return;
|
|
55
|
+
reported.add(unit);
|
|
56
|
+
issues.push({
|
|
57
|
+
field: `${listPath}[${i}]`,
|
|
58
|
+
message: `'${unit}' is marked expectEmpty, but ${never} — a marker on it could only ever read went-live; write the plain pattern (it needs no expectEmpty)`,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
refuseUnjudgeable(lists.forbiddenImports, BoundaryMarkableList.ForbiddenImports, forbiddenMarked, mode);
|
|
63
|
+
refuseUnjudgeable(lists.allowedImports, BoundaryMarkableList.AllowedImports, allowedMarked, 'exact');
|
|
64
|
+
if (forbiddenMarked.size > 0 || allowedMarked.size > 0) {
|
|
65
|
+
const overlaps = boundaryPatternOverlaps({
|
|
66
|
+
forbiddenImports: lists.forbiddenImports?.units ?? [],
|
|
67
|
+
allowedImports: lists.allowedImports?.units ?? [],
|
|
68
|
+
forbiddenMatch: mode,
|
|
69
|
+
});
|
|
70
|
+
for (const o of overlaps.redundantForbidden) {
|
|
71
|
+
if (!forbiddenMarked.has(o.pattern))
|
|
72
|
+
continue;
|
|
73
|
+
issues.push({
|
|
74
|
+
field: `${BoundaryMarkableList.ForbiddenImports}[${o.index}]`,
|
|
75
|
+
message: `'${o.pattern}' is marked expectEmpty, but '${o.by}' already covers every import it could match — a redundant pattern can never decide a verdict, so it can never go live; delete it`,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
for (const o of overlaps.shadowedAllowed) {
|
|
79
|
+
if (!allowedMarked.has(o.pattern))
|
|
80
|
+
continue;
|
|
81
|
+
issues.push({
|
|
82
|
+
field: `${BoundaryMarkableList.AllowedImports}[${o.index}]`,
|
|
83
|
+
message: `'${o.pattern}' is marked expectEmpty, but forbidden '${o.by}' is checked first and covers it — it can never admit an import, so it can never go live; ` +
|
|
84
|
+
`carve the subpath out with exceptions[{ path, target, reason }]${mode === 'package' ? " or set forbiddenMatch: 'exact'" : ''}`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (lists.from !== undefined) {
|
|
89
|
+
const conflict = markedListFailOnEmptyConflict(lists.from, BoundaryMarkableList.From, typeof failOnEmpty === 'boolean' ? failOnEmpty : undefined);
|
|
90
|
+
if (conflict !== undefined)
|
|
91
|
+
issues.push({ field: 'failOnEmpty', message: conflict });
|
|
92
|
+
}
|
|
93
|
+
return issues;
|
|
94
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { IUnreadFile } from '../util/unread-file.js';
|
|
2
|
+
import type { BoundaryScopeDecision, BoundarySeverity, ForbiddenMatchMode, IBoundaryPatternOverlaps, IBoundaryRule, IBoundaryRuleScope } from './boundary-rule.js';
|
|
3
|
+
/**
|
|
4
|
+
* The ONE answer to "is file F in rule R's scope?" and "how severe is R?".
|
|
5
|
+
*
|
|
6
|
+
* Before round 11 four code paths each read `rule.from` on their own — the
|
|
7
|
+
* evaluator, `why-file`, the rule-graph bridge, the changes summary — and the
|
|
8
|
+
* CLI renderers each defaulted an unset severity to `'warning'` while the
|
|
9
|
+
* evaluator enforced it as `'error'` (an author inspecting a rule was told
|
|
10
|
+
* "warning" for a rule that blocks CI). With exemptions in the model, any
|
|
11
|
+
* reader that kept matching `from` alone would keep claiming a rule applies to
|
|
12
|
+
* an exempted file. So every reader calls these, and the evaluator itself
|
|
13
|
+
* decides scope through {@link boundaryScopeDecision}.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The test-file shorthand `excludeTests: true` expands to. Deliberately the
|
|
17
|
+
* common layouts only — a repo with another convention lists its own globs in
|
|
18
|
+
* `exemptFiles`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const TEST_FILE_GLOBS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* A rule's source-side scope: the globs that include files and the globs that
|
|
23
|
+
* exempt them.
|
|
24
|
+
*
|
|
25
|
+
* A `from` entry starting with `!` is normalised into an exemption — the syntax
|
|
26
|
+
* authors already type (`'!**\/*.spec.ts'`) used to compile to a literal `!`
|
|
27
|
+
* glob that matched nothing, silently, while the spec file stayed governed.
|
|
28
|
+
*
|
|
29
|
+
* `from` is split by core's ONE `!` parser (`parseGlobList`), the same one
|
|
30
|
+
* every gate plane selects through. The planes differ in what a negation DOES,
|
|
31
|
+
* never in what it is: here it EXEMPTS (the file is still scanned, its
|
|
32
|
+
* violations are marked suppressed and counted — the boundary counterpart of
|
|
33
|
+
* policy `exemptFiles`); on the gate planes it EXCLUDES (out of scope). Both
|
|
34
|
+
* share one liveness rule: a negation is alive iff it removes at least one
|
|
35
|
+
* file from its own positive set. A bare `!` is rejected at load
|
|
36
|
+
* (`globListProblem`), so the empty-glob guard below only meets an
|
|
37
|
+
* unvalidated rule.
|
|
38
|
+
*/
|
|
39
|
+
export declare function boundaryRuleScope(rule: IBoundaryRule): IBoundaryRuleScope;
|
|
40
|
+
/**
|
|
41
|
+
* Where `relPath` sits relative to a precomputed scope: `in` (governed),
|
|
42
|
+
* `exempt` (inside `from`, but exempted — still scanned, its violations are
|
|
43
|
+
* MARKED suppressed, never dropped), or `out`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function boundaryScopeDecision(scope: IBoundaryRuleScope, relPath: string): BoundaryScopeDecision;
|
|
46
|
+
/**
|
|
47
|
+
* {@link boundaryScopeDecision} for an UNREAD entry: a file the scan matched
|
|
48
|
+
* but could not read, or a directory it could not list. A file is governed
|
|
49
|
+
* exactly as a read one would be. A directory is governed when an include glob
|
|
50
|
+
* could match beneath it and no exemption covers ALL of it — through the one
|
|
51
|
+
* unread-entry test every plane uses (`unreadEntryMatches` /
|
|
52
|
+
* `unreadEntryWhollyMatches`).
|
|
53
|
+
*/
|
|
54
|
+
export declare function boundaryScopeCoversUnread(scope: IBoundaryRuleScope, u: IUnreadFile): boolean;
|
|
55
|
+
/** {@link boundaryScopeDecision} for one rule — the call every reader uses. */
|
|
56
|
+
export declare function boundaryRuleCovers(rule: IBoundaryRule, relPath: string): BoundaryScopeDecision;
|
|
57
|
+
/** The severity the evaluator ENFORCES: an unset severity is `error`. */
|
|
58
|
+
export declare function boundaryRuleSeverity(rule: Pick<IBoundaryRule, 'severity'>): BoundarySeverity;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a rule whose scope matched no scanned file is a FAILURE rather than a
|
|
61
|
+
* skip — the gate planes' `failOnEmpty` default: on for `error` rules. The
|
|
62
|
+
* boundary VIEW of the one failOnEmpty authority (`failsWhenEmpty`,
|
|
63
|
+
* `@shrkcrft/core`), never a second default: an `info` rule, like a `warning`
|
|
64
|
+
* one, defaults off.
|
|
65
|
+
*/
|
|
66
|
+
export declare function boundaryRuleFailsOnEmpty(rule: Pick<IBoundaryRule, 'severity' | 'failOnEmpty'>): boolean;
|
|
67
|
+
/** How the rule's `forbiddenImports` / `exceptions[].target` match: package semantics unless opted out. */
|
|
68
|
+
export declare function boundaryForbiddenMatch(rule: Pick<IBoundaryRule, 'forbiddenMatch'>): ForbiddenMatchMode;
|
|
69
|
+
/**
|
|
70
|
+
* The patterns of one rule that can never change its verdict (round 12,
|
|
71
|
+
* R12-5.3 / R12-5.6) — the ONE answer the evaluator (coverage `subsumedBy` /
|
|
72
|
+
* `shadowedBy`, the shadowed dead unit), `boundaries explain` and MCP
|
|
73
|
+
* `get_boundary_rule` read, through the one subsumption proof beside the
|
|
74
|
+
* matcher (`importPatternSubsumes`).
|
|
75
|
+
*
|
|
76
|
+
* - `redundantForbidden`: a `forbiddenImports` entry another KEPT entry
|
|
77
|
+
* already covers — `@scope/pkg/**` next to `@scope/pkg` under package
|
|
78
|
+
* semantics, the `pkg` + `pkg/**` helper consumers wrote while a bare
|
|
79
|
+
* pattern missed subpaths. Of two entries covering each other the FIRST is
|
|
80
|
+
* kept, and a coverer is always a kept entry, so deleting every redundant
|
|
81
|
+
* one never narrows the fence. INFO only.
|
|
82
|
+
* - `shadowedAllowed`: an `allowedImports` entry a forbidden entry covers.
|
|
83
|
+
* Forbidden is checked first and allowed never re-admits, so it can never
|
|
84
|
+
* admit an import — under package semantics a bare forbidden package
|
|
85
|
+
* shadows every allowed subpath of it (a carve-out alpha.30 honoured).
|
|
86
|
+
*/
|
|
87
|
+
export declare function boundaryPatternOverlaps(rule: Pick<IBoundaryRule, 'forbiddenImports' | 'allowedImports' | 'forbiddenMatch'>): IBoundaryPatternOverlaps;
|
|
88
|
+
//# sourceMappingURL=boundary-rule-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-rule-scope.d.ts","sourceRoot":"","sources":["../../src/model/boundary-rule-scope.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAElB,wBAAwB,EACxB,aAAa,EACb,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAK5C,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,kBAAkB,CAWzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAIvG;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,kBAAkB,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAG5F;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAE9F;AAED,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,GAAG,gBAAgB,CAE5F;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,aAAa,CAAC,GAAG,OAAO,CAKvG;AAED,2GAA2G;AAC3G,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,kBAAkB,CAEtG;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,GAClF,wBAAwB,CAyC1B"}
|