@nielspeter/eess 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +94 -1
  2. package/dist/baseline-generator.d.ts +9 -0
  3. package/dist/baseline-generator.d.ts.map +1 -1
  4. package/dist/baseline-generator.js +9 -0
  5. package/dist/baseline-generator.js.map +1 -1
  6. package/dist/baseline.d.ts +1 -1
  7. package/dist/cardinality.d.ts.map +1 -1
  8. package/dist/cardinality.js +20 -5
  9. package/dist/cardinality.js.map +1 -1
  10. package/dist/cli-config.d.ts +106 -0
  11. package/dist/cli-config.d.ts.map +1 -0
  12. package/dist/cli-config.js +231 -0
  13. package/dist/cli-config.js.map +1 -0
  14. package/dist/collect-result.d.ts +94 -0
  15. package/dist/collect-result.d.ts.map +1 -0
  16. package/dist/collect-result.js +142 -0
  17. package/dist/collect-result.js.map +1 -0
  18. package/dist/combinators.d.ts +14 -0
  19. package/dist/combinators.d.ts.map +1 -1
  20. package/dist/combinators.js +53 -16
  21. package/dist/combinators.js.map +1 -1
  22. package/dist/condition.d.ts +37 -0
  23. package/dist/condition.d.ts.map +1 -1
  24. package/dist/condition.js +48 -1
  25. package/dist/condition.js.map +1 -1
  26. package/dist/correspondence.d.ts +30 -0
  27. package/dist/correspondence.d.ts.map +1 -1
  28. package/dist/correspondence.js +36 -1
  29. package/dist/correspondence.js.map +1 -1
  30. package/dist/dedupe-config-findings.d.ts.map +1 -1
  31. package/dist/dedupe-config-findings.js +27 -0
  32. package/dist/dedupe-config-findings.js.map +1 -1
  33. package/dist/diff-aware.d.ts +8 -9
  34. package/dist/diff-aware.d.ts.map +1 -1
  35. package/dist/diff-aware.js +38 -17
  36. package/dist/diff-aware.js.map +1 -1
  37. package/dist/emitter-findings.d.ts +167 -0
  38. package/dist/emitter-findings.d.ts.map +1 -0
  39. package/dist/emitter-findings.js +237 -0
  40. package/dist/emitter-findings.js.map +1 -0
  41. package/dist/errors.d.ts +48 -0
  42. package/dist/errors.d.ts.map +1 -1
  43. package/dist/errors.js +61 -0
  44. package/dist/errors.js.map +1 -1
  45. package/dist/exclusion-comments.d.ts +36 -1
  46. package/dist/exclusion-comments.d.ts.map +1 -1
  47. package/dist/exclusion-comments.js +185 -37
  48. package/dist/exclusion-comments.js.map +1 -1
  49. package/dist/execute-rule.d.ts +12 -3
  50. package/dist/execute-rule.d.ts.map +1 -1
  51. package/dist/execute-rule.js +184 -7
  52. package/dist/execute-rule.js.map +1 -1
  53. package/dist/file-walk.d.ts +22 -0
  54. package/dist/file-walk.d.ts.map +1 -0
  55. package/dist/file-walk.js +51 -0
  56. package/dist/file-walk.js.map +1 -0
  57. package/dist/format-json.d.ts +13 -0
  58. package/dist/format-json.d.ts.map +1 -1
  59. package/dist/format-json.js +24 -0
  60. package/dist/format-json.js.map +1 -1
  61. package/dist/index.d.ts +14 -46
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +13 -41
  64. package/dist/index.js.map +1 -1
  65. package/dist/internal.d.ts +55 -0
  66. package/dist/internal.d.ts.map +1 -0
  67. package/dist/internal.js +92 -0
  68. package/dist/internal.js.map +1 -0
  69. package/dist/mask-non-comment.d.ts +49 -0
  70. package/dist/mask-non-comment.d.ts.map +1 -0
  71. package/dist/mask-non-comment.js +261 -0
  72. package/dist/mask-non-comment.js.map +1 -0
  73. package/dist/owns-empty-discovery.d.ts.map +1 -1
  74. package/dist/owns-empty-discovery.js +12 -4
  75. package/dist/owns-empty-discovery.js.map +1 -1
  76. package/dist/path-suffix.d.ts +57 -0
  77. package/dist/path-suffix.d.ts.map +1 -0
  78. package/dist/path-suffix.js +73 -0
  79. package/dist/path-suffix.js.map +1 -0
  80. package/dist/predicate.d.ts +12 -0
  81. package/dist/predicate.d.ts.map +1 -1
  82. package/dist/predicate.js +20 -1
  83. package/dist/predicate.js.map +1 -1
  84. package/dist/preset-dispatch.d.ts +6 -34
  85. package/dist/preset-dispatch.d.ts.map +1 -1
  86. package/dist/preset-dispatch.js +30 -52
  87. package/dist/preset-dispatch.js.map +1 -1
  88. package/dist/report.d.ts +31 -7
  89. package/dist/report.d.ts.map +1 -1
  90. package/dist/report.js +174 -15
  91. package/dist/report.js.map +1 -1
  92. package/dist/rule-builder-like.d.ts +8 -2
  93. package/dist/rule-builder-like.d.ts.map +1 -1
  94. package/dist/rule-builder.d.ts +15 -0
  95. package/dist/rule-builder.d.ts.map +1 -1
  96. package/dist/rule-builder.js +41 -36
  97. package/dist/rule-builder.js.map +1 -1
  98. package/dist/rule-description.d.ts +50 -0
  99. package/dist/rule-description.d.ts.map +1 -1
  100. package/dist/rule-description.js +58 -0
  101. package/dist/rule-description.js.map +1 -1
  102. package/dist/selection-memo.d.ts +1 -3
  103. package/dist/selection-memo.d.ts.map +1 -1
  104. package/dist/selection-memo.js +1 -3
  105. package/dist/selection-memo.js.map +1 -1
  106. package/dist/silent-exclusion.d.ts +12 -0
  107. package/dist/silent-exclusion.d.ts.map +1 -1
  108. package/dist/silent-exclusion.js +22 -0
  109. package/dist/silent-exclusion.js.map +1 -1
  110. package/dist/terminal-builder.d.ts +29 -15
  111. package/dist/terminal-builder.d.ts.map +1 -1
  112. package/dist/terminal-builder.js +97 -51
  113. package/dist/terminal-builder.js.map +1 -1
  114. package/dist/vacuity-findings.d.ts +0 -6
  115. package/dist/vacuity-findings.d.ts.map +1 -1
  116. package/dist/vacuity-findings.js +27 -57
  117. package/dist/vacuity-findings.js.map +1 -1
  118. package/dist/violation.d.ts +22 -1
  119. package/dist/violation.d.ts.map +1 -1
  120. package/dist/violation.js.map +1 -1
  121. package/dist/watch.d.ts +71 -0
  122. package/dist/watch.d.ts.map +1 -0
  123. package/dist/watch.js +129 -0
  124. package/dist/watch.js.map +1 -0
  125. package/package.json +6 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Resolve a cited path against a set of repo-relative paths.
3
+ *
4
+ * Two dialects had written this independently — `eess-md`'s `uniqueSuffix()`
5
+ * for `path:line` code pointers, and `eess-crossvalidate`'s `resolveFeature`
6
+ * for `.feature` citations. Same algorithm, same three-way answer, and after
7
+ * bug 0254 the same remedy text; bug 0257 is that duplication.
8
+ *
9
+ * **Why the kernel.** It is pure string work over a list of paths: no
10
+ * `ArchProject`, no ts-morph, nothing dialect-shaped. That is exactly
11
+ * `path-universe.ts`'s argument for living here, and
12
+ * [ADR-013](../../../adr/013-the-kernel-takes-the-fact-not-the-project.md)'s
13
+ * test is satisfied — the kernel takes the *fact* (a list of paths), not the
14
+ * project that produced it. It is family plumbing rather than public API, so it
15
+ * is exported from `internal.ts` (ADR-011).
16
+ *
17
+ * **What it deliberately does not decide.** Whether a `none` is broken, whether
18
+ * an `ambiguous` fails or warns, whether to consult external roots, what the
19
+ * message says — all of that is the caller's policy and differs between the two
20
+ * dialects for good reasons. This answers one question: *which path did they
21
+ * mean?*
22
+ */
23
+ /** How a cited path resolves against a set of repo-relative paths. */
24
+ export type PathSuffixMatch =
25
+ /** The citation IS a repo-relative path. Wins outright, even if the same tail also matches elsewhere. */
26
+ {
27
+ readonly kind: 'exact';
28
+ readonly file: string;
29
+ }
30
+ /** Exactly one path ends with the citation on a `/` boundary. */
31
+ | {
32
+ readonly kind: 'unique';
33
+ readonly file: string;
34
+ }
35
+ /** Several do, so the citation names none of them. Candidates in index order. */
36
+ | {
37
+ readonly kind: 'ambiguous';
38
+ readonly files: readonly string[];
39
+ }
40
+ /** Nothing matches. */
41
+ | {
42
+ readonly kind: 'none';
43
+ };
44
+ /** A prepared path set. Build once, resolve many. Duplicate inputs collapse. */
45
+ export interface PathSuffixIndex {
46
+ resolve(wanted: string): PathSuffixMatch;
47
+ }
48
+ /**
49
+ * Prepare a path set for repeated suffix lookups.
50
+ *
51
+ * Indexed by last segment, because the corpora this runs over resolve hundreds
52
+ * of citations against thousands of paths and a linear scan per citation was
53
+ * measurable in `eess-md`. The index is the reason this takes the whole set up
54
+ * front rather than being a plain two-argument function.
55
+ */
56
+ export declare function pathSuffixIndex(paths: Iterable<string>): PathSuffixIndex;
57
+ //# sourceMappingURL=path-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-suffix.d.ts","sourceRoot":"","sources":["../src/path-suffix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sEAAsE;AACtE,MAAM,MAAM,eAAe;AACzB,yGAAyG;AACvG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACnD,iEAAiE;GAC/D;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACpD,iFAAiF;GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;AACnE,uBAAuB;GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7B,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAAA;CACzC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,eAAe,CAsCxE"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Resolve a cited path against a set of repo-relative paths.
3
+ *
4
+ * Two dialects had written this independently — `eess-md`'s `uniqueSuffix()`
5
+ * for `path:line` code pointers, and `eess-crossvalidate`'s `resolveFeature`
6
+ * for `.feature` citations. Same algorithm, same three-way answer, and after
7
+ * bug 0254 the same remedy text; bug 0257 is that duplication.
8
+ *
9
+ * **Why the kernel.** It is pure string work over a list of paths: no
10
+ * `ArchProject`, no ts-morph, nothing dialect-shaped. That is exactly
11
+ * `path-universe.ts`'s argument for living here, and
12
+ * [ADR-013](../../../adr/013-the-kernel-takes-the-fact-not-the-project.md)'s
13
+ * test is satisfied — the kernel takes the *fact* (a list of paths), not the
14
+ * project that produced it. It is family plumbing rather than public API, so it
15
+ * is exported from `internal.ts` (ADR-011).
16
+ *
17
+ * **What it deliberately does not decide.** Whether a `none` is broken, whether
18
+ * an `ambiguous` fails or warns, whether to consult external roots, what the
19
+ * message says — all of that is the caller's policy and differs between the two
20
+ * dialects for good reasons. This answers one question: *which path did they
21
+ * mean?*
22
+ */
23
+ /**
24
+ * Prepare a path set for repeated suffix lookups.
25
+ *
26
+ * Indexed by last segment, because the corpora this runs over resolve hundreds
27
+ * of citations against thousands of paths and a linear scan per citation was
28
+ * measurable in `eess-md`. The index is the reason this takes the whole set up
29
+ * front rather than being a plain two-argument function.
30
+ */
31
+ export function pathSuffixIndex(paths) {
32
+ // Deduplicated on entry, not assumed deduplicated. `all` was always a `Set`,
33
+ // but the per-segment lists used to push every element of the iterable — so a
34
+ // path appearing twice came back as `{ kind: 'ambiguous', files: [x, x] }`:
35
+ // one file reported as ambiguous with itself. Unreachable through today's two
36
+ // callers (both hand it a set or a filesystem walk), which is exactly why it
37
+ // would have waited for the third — the parameter is an `Iterable<string>`
38
+ // and nothing in the type says the caller must have deduplicated. Found by
39
+ // differential fuzzing across 20,000 cases; it was the only class of
40
+ // disagreement with the implementations this replaced.
41
+ const all = new Set(paths);
42
+ const byLastSegment = new Map();
43
+ for (const rel of all) {
44
+ const seg = rel.slice(rel.lastIndexOf('/') + 1);
45
+ const list = byLastSegment.get(seg);
46
+ if (list)
47
+ list.push(rel);
48
+ else
49
+ byLastSegment.set(seg, [rel]);
50
+ }
51
+ return {
52
+ resolve(wanted) {
53
+ // Exact first, and it wins outright. A citation that IS a real path is not
54
+ // ambiguous just because some longer path happens to end the same way —
55
+ // both dialects had this precedence already, and getting it backwards
56
+ // would turn correct citations into findings.
57
+ if (all.has(wanted))
58
+ return { kind: 'exact', file: wanted };
59
+ const seg = wanted.slice(wanted.lastIndexOf('/') + 1);
60
+ // Narrow by last segment, then confirm the FULL suffix on a `/` boundary:
61
+ // `x.ts` must not match `prefix-x.ts`, and `a/x.ts` must not match
62
+ // `b/aa/x.ts`.
63
+ const matches = (byLastSegment.get(seg) ?? []).filter((f) => f.endsWith('/' + wanted));
64
+ const only = matches[0];
65
+ if (matches.length === 1 && only !== undefined)
66
+ return { kind: 'unique', file: only };
67
+ if (matches.length > 1)
68
+ return { kind: 'ambiguous', files: matches };
69
+ return { kind: 'none' };
70
+ },
71
+ };
72
+ }
73
+ //# sourceMappingURL=path-suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-suffix.js","sourceRoot":"","sources":["../src/path-suffix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAkBH;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,KAAuB;IACrD,6EAA6E;IAC7E,8EAA8E;IAC9E,4EAA4E;IAC5E,8EAA8E;IAC9E,6EAA6E;IAC7E,2EAA2E;IAC3E,2EAA2E;IAC3E,qEAAqE;IACrE,uDAAuD;IACvD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAS,KAAK,CAAC,CAAA;IAClC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAoB,CAAA;IACjD,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QAC/C,MAAM,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;;YACnB,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IACpC,CAAC;IAED,OAAO;QACL,OAAO,CAAC,MAAc;YACpB,2EAA2E;YAC3E,wEAAwE;YACxE,sEAAsE;YACtE,8CAA8C;YAC9C,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;YAE3D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;YACrD,0EAA0E;YAC1E,mEAAmE;YACnE,eAAe;YACf,MAAM,OAAO,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAA;YACtF,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;YACvB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;YACrF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;YACpE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;QACzB,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -41,4 +41,16 @@ export interface Predicate<T> {
41
41
  */
42
42
  readonly originLabel?: string;
43
43
  }
44
+ /**
45
+ * Record a predicate on a builder, noting it if it arrived after `.should()`.
46
+ *
47
+ * A free function for the same reason as `recordExclusions` and
48
+ * `selectMatching`: the two builders sit in incompatible hierarchies, so there
49
+ * is no common base to hold a method. The copies were 94% similar and differed
50
+ * only in comment wording and braces — no behaviour.
51
+ *
52
+ * `phase` is read, never written: recording a misplaced predicate is a
53
+ * diagnosis, not a state change.
54
+ */
55
+ export declare function recordPredicate<T>(predicate: Predicate<T>, predicates: Predicate<T>[], misplaced: string[], phase: string): void;
44
56
  //# sourceMappingURL=predicate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAA;IACzB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;IAE9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B"}
1
+ {"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAA;IACzB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;IAE9B;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EACvB,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,EAC1B,SAAS,EAAE,MAAM,EAAE,EACnB,KAAK,EAAE,MAAM,GACZ,IAAI,CAON"}
package/dist/predicate.js CHANGED
@@ -1,2 +1,21 @@
1
- export {};
1
+ /**
2
+ * Record a predicate on a builder, noting it if it arrived after `.should()`.
3
+ *
4
+ * A free function for the same reason as `recordExclusions` and
5
+ * `selectMatching`: the two builders sit in incompatible hierarchies, so there
6
+ * is no common base to hold a method. The copies were 94% similar and differed
7
+ * only in comment wording and braces — no behaviour.
8
+ *
9
+ * `phase` is read, never written: recording a misplaced predicate is a
10
+ * diagnosis, not a state change.
11
+ */
12
+ export function recordPredicate(predicate, predicates, misplaced, phase) {
13
+ predicates.push(predicate);
14
+ // Bug 0155 state 2: a predicate-only method used after `.should()`. Dual-use
15
+ // methods dispatch to conditions in that phase and never reach here, so this is
16
+ // a filter written where an assertion was meant — the one state whose fix is
17
+ // "move it before .should()", not "add a condition".
18
+ if (phase === 'condition')
19
+ misplaced.push(predicate.description);
20
+ }
2
21
  //# sourceMappingURL=predicate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"predicate.js","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"predicate.js","sourceRoot":"","sources":["../src/predicate.ts"],"names":[],"mappings":"AA8CA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAuB,EACvB,UAA0B,EAC1B,SAAmB,EACnB,KAAa;IAEb,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1B,6EAA6E;IAC7E,gFAAgF;IAChF,6EAA6E;IAC7E,qDAAqD;IACrD,IAAI,KAAK,KAAK,WAAW;QAAE,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;AAClE,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ArchViolation } from './violation.js';
1
+ import { type CollectResult } from './collect-result.js';
2
2
  import type { RuleMetadata } from './rule-metadata.js';
3
3
  import { type PresetReportOptions } from './report.js';
4
4
  /** Per-rule severity within a preset. */
@@ -15,11 +15,11 @@ export interface PresetBaseOptions extends PresetReportOptions {
15
15
  * Anything with `.rule()` and `.violations()` — works with both
16
16
  * `RuleBuilder<T, P>` and `TerminalBuilder` hierarchies, across all dialects.
17
17
  */
18
- interface Dispatchable {
18
+ export interface Dispatchable {
19
19
  rule(m: RuleMetadata): {
20
- violations(): ArchViolation[];
20
+ violations(): CollectResult;
21
21
  };
22
- violations(): ArchViolation[];
22
+ violations(): CollectResult;
23
23
  }
24
24
  /**
25
25
  * Dispatch a single rule within a preset.
@@ -30,38 +30,10 @@ interface Dispatchable {
30
30
  */
31
31
  export declare function dispatchRule(builder: Dispatchable, rule: string | (RuleMetadata & {
32
32
  id: string;
33
- }), defaultSeverity: RuleSeverity, overrides: Record<string, RuleSeverity> | undefined): ArchViolation[];
33
+ }), defaultSeverity: RuleSeverity, overrides: Record<string, RuleSeverity> | undefined): CollectResult;
34
34
  /**
35
35
  * Validate override keys against known rule IDs. Warns for unrecognized keys
36
36
  * (likely typos).
37
37
  */
38
- export declare function validateOverrides(overrides: Record<string, RuleSeverity> | undefined, knownIds: string[]): void;
39
- /**
40
- * A configuration finding for a preset call that constructed **zero** rules —
41
- * every optional capability was left off, or a required discovery pattern
42
- * (a folder glob, a repositories glob) matched nothing, so the call checked
43
- * nothing and would otherwise pass silently. The vacuity matrix
44
- * (`scripts/vacuity-matrix.mjs`) is what proves a preset needs this: it
45
- * probes every published preset at its minimal type-correct call, and a
46
- * preset reaching `fail-open` there is exactly this shape.
47
- *
48
- * Unsuppressable (ADR-010) for the same reason a zero-examined rule is: the
49
- * caller's mistake is in how the preset was configured, not in the code the
50
- * preset would have checked, and `.excluding()`/a baseline/`--changed` all
51
- * aim at the latter.
52
- *
53
- * @param presetName - The preset's own name, e.g. `'agentGuardrails'`.
54
- * @param optionsHint - The option names that would enable a rule, for the
55
- * remedy — e.g. `'noGenericErrors, noStubs, noEmptyBodies'`.
56
- */
57
- export declare function presetConstructsNothingViolation(presetName: string, optionsHint: string): ArchViolation;
58
- /**
59
- * Emit (stderr text) and throw a single `ArchRuleError` with all aggregated
60
- * violations, if any. Kept for backward compatibility; it is now `finishPreset`
61
- * in the default `throw` mode. New presets take `PresetReportOptions` and call
62
- * `finishPreset` so a caller can opt into `report: 'return'` / `--format json`
63
- * (plan 0070).
64
- */
65
- export declare function throwIfViolations(violations: ArchViolation[]): void;
66
- export {};
38
+ export declare function validateOverrides(overrides: Partial<Record<string, RuleSeverity>> | undefined, knownIds: readonly string[]): void;
67
39
  //# sourceMappingURL=preset-dispatch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preset-dispatch.d.ts","sourceRoot":"","sources":["../src/preset-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAIpE,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;AAEnD;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACzC;AAED;;;GAGG;AACH,UAAU,YAAY;IACpB,IAAI,CAAC,CAAC,EAAE,YAAY,GAAG;QAAE,UAAU,IAAI,aAAa,EAAE,CAAA;KAAE,CAAA;IACxD,UAAU,IAAI,aAAa,EAAE,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,MAAM,GAAG,CAAC,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAC9C,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,GAClD,aAAa,EAAE,CAwBjB;AAED;;;GAGG;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2Cf;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAM/B,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,GAAG,SAAS,EAC5D,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,IAAI,CAWN"}
@@ -1,8 +1,7 @@
1
+ import { collectResult } from './collect-result.js';
1
2
  import { severityFor } from './violation.js';
2
3
  import { formatViolations } from './format.js';
3
- import { finishPreset } from './report.js';
4
4
  import { writeStderr } from './stderr.js';
5
- import { UNSUPPRESSABLE } from './unsuppressable.js';
6
5
  /**
7
6
  * Dispatch a single rule within a preset.
8
7
  *
@@ -17,19 +16,34 @@ export function dispatchRule(builder, rule, defaultSeverity, overrides) {
17
16
  // agent`, not just the id.
18
17
  const meta = typeof rule === 'string' ? { id: rule } : rule;
19
18
  const effective = overrides?.[meta.id] ?? defaultSeverity;
20
- if (effective === 'off')
21
- return [];
19
+ if (effective === 'off') {
20
+ // A real, measured zero — and deliberately NOT `declaredEmpty`.
21
+ //
22
+ // ADR-014 §3, amended 2026-09-05: a declaration is one a caller MADE over a
23
+ // live instrument, never one eess infers from a configuration.
24
+ // `overrides: { id: 'off' }` is an instruction, and it is byte-identical
25
+ // whether the author meant "I have scoped this out" or "I turned this off to
26
+ // stop a finding" — eess is not positioned to tell those apart, so by
27
+ // ADR-013's rule it must not decide. Marking it declared here would mint,
28
+ // on the author's behalf, exactly the declaration `declaredEmptyFindings`
29
+ // refuses to let them write ("'off' deleted the rule, so the declaration
30
+ // about it is dead").
31
+ //
32
+ // The consequence is deliberate: a preset with every rule off sums to zero
33
+ // examined with no declaration, and the emitter reports it (bug 0261).
34
+ return collectResult([], { examined: 0, notRun: true });
35
+ }
22
36
  const violations = builder.rule(meta).violations();
23
37
  if (effective === 'warn') {
24
38
  if (violations.length > 0) {
25
39
  writeStderr(formatViolations(violations));
26
40
  }
27
41
  // `bypassFilters` outranks a per-rule `overrides: { id: 'warn' }` — see
28
- // `severityFor`. A config finding like `presetConstructsNothingViolation`
29
- // is `UNSUPPRESSABLE` by its own text; silently dropping it here just
30
- // because its OWN rule was downgraded is exactly the suppression path
31
- // that text promises does not exist.
32
- return violations.filter((v) => severityFor(v, 'warn') === 'error');
42
+ // `severityFor`. A config finding — a zero-examined rule, or a preset that
43
+ // constructed nothing — is `UNSUPPRESSABLE` by its own text; silently
44
+ // dropping it here just because its OWN rule was downgraded is exactly the
45
+ // suppression path that text promises does not exist.
46
+ return collectResult(violations.filter((v) => severityFor(v, 'warn') === 'error'), { examined: violations.examined });
33
47
  }
34
48
  return violations;
35
49
  }
@@ -37,7 +51,13 @@ export function dispatchRule(builder, rule, defaultSeverity, overrides) {
37
51
  * Validate override keys against known rule IDs. Warns for unrecognized keys
38
52
  * (likely typos).
39
53
  */
40
- export function validateOverrides(overrides, knownIds) {
54
+ export function validateOverrides(
55
+ // `Partial<Record<...>>` and `readonly`, widened from the narrower shapes this
56
+ // signature had, so `eess-ts`'s byte-identical copy could be deleted rather
57
+ // than kept for its types. Both are strictly more permissive: `Partial` admits
58
+ // an explicit `undefined` value, `readonly` admits a frozen list. No caller
59
+ // loses anything.
60
+ overrides, knownIds) {
41
61
  if (!overrides)
42
62
  return;
43
63
  const knownSet = new Set(knownIds);
@@ -48,46 +68,4 @@ export function validateOverrides(overrides, knownIds) {
48
68
  }
49
69
  }
50
70
  }
51
- /**
52
- * A configuration finding for a preset call that constructed **zero** rules —
53
- * every optional capability was left off, or a required discovery pattern
54
- * (a folder glob, a repositories glob) matched nothing, so the call checked
55
- * nothing and would otherwise pass silently. The vacuity matrix
56
- * (`scripts/vacuity-matrix.mjs`) is what proves a preset needs this: it
57
- * probes every published preset at its minimal type-correct call, and a
58
- * preset reaching `fail-open` there is exactly this shape.
59
- *
60
- * Unsuppressable (ADR-010) for the same reason a zero-examined rule is: the
61
- * caller's mistake is in how the preset was configured, not in the code the
62
- * preset would have checked, and `.excluding()`/a baseline/`--changed` all
63
- * aim at the latter.
64
- *
65
- * @param presetName - The preset's own name, e.g. `'agentGuardrails'`.
66
- * @param optionsHint - The option names that would enable a rule, for the
67
- * remedy — e.g. `'noGenericErrors, noStubs, noEmptyBodies'`.
68
- */
69
- export function presetConstructsNothingViolation(presetName, optionsHint) {
70
- const message = `${presetName}(...) constructed zero rules at this call — no capability of this ` +
71
- `preset was enabled, or a discovery pattern matched nothing, so it checks nothing ` +
72
- `and passes silently. Enable at least one option (${optionsHint}), or remove the call.`;
73
- return {
74
- rule: presetName,
75
- element: presetName,
76
- file: '',
77
- line: 0,
78
- message,
79
- suggestion: `${message} ${UNSUPPRESSABLE}`,
80
- bypassFilters: true,
81
- };
82
- }
83
- /**
84
- * Emit (stderr text) and throw a single `ArchRuleError` with all aggregated
85
- * violations, if any. Kept for backward compatibility; it is now `finishPreset`
86
- * in the default `throw` mode. New presets take `PresetReportOptions` and call
87
- * `finishPreset` so a caller can opt into `report: 'return'` / `--format json`
88
- * (plan 0070).
89
- */
90
- export function throwIfViolations(violations) {
91
- finishPreset(violations, { report: 'throw' });
92
- }
93
71
  //# sourceMappingURL=preset-dispatch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"preset-dispatch.js","sourceRoot":"","sources":["../src/preset-dispatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAuBpD;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAqB,EACrB,IAA8C,EAC9C,eAA6B,EAC7B,SAAmD;IAEnD,8EAA8E;IAC9E,gFAAgF;IAChF,6EAA6E;IAC7E,2BAA2B;IAC3B,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,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B,GAAG,4CAA4C;gBACrE,oBAAoB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC5C,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
package/dist/report.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ArchViolation } from './violation.js';
1
+ import { type CollectResult } from './collect-result.js';
2
2
  import type { OutputFormat } from './check-options.js';
3
3
  /**
4
4
  * How a preset delivers its violations (plan 0070, ADR-008):
@@ -18,6 +18,30 @@ export interface ReportOptions {
18
18
  export interface PresetReportOptions extends ReportOptions {
19
19
  /** Delivery mode. Default `throw`. */
20
20
  readonly report?: ReportMode;
21
+ /**
22
+ * Declare that this preset's subject legitimately does not exist here —
23
+ * [ADR-010](../../../adr/010-a-pass-is-constructed-from-evidence.md) §3.
24
+ *
25
+ * **On the shared options type, not on six preset interfaces**, because
26
+ * ADR-010 §3's second clause is about presets as a class: "A preset user does
27
+ * not hold the builder; if a preset option cannot carry the user's
28
+ * empty-declaration to the mint, their only reachable remedy is disabling the
29
+ * option — deleting coverage permanently (ADR-009 rule 1's trained-suppression
30
+ * dynamic, reproduced by this ADR's own gate if unaddressed)." A preset that
31
+ * examines nothing and cannot be told so leaves its user exactly one exit, and
32
+ * it is the wrong one.
33
+ *
34
+ * **It expires**, which is the only reason it is admissible at all: declare
35
+ * this and then examine something, and the emitter reports
36
+ * `emitter/expired-declaration`. A claim nothing can contradict is not an
37
+ * assertion — the property ADR-014 §3's 2026-09-05 amendment turns on when it
38
+ * refuses to infer a declaration from `overrides: 'off'`.
39
+ *
40
+ * Use it for a corpus with no ER diagrams, a suite with no exemptions, a
41
+ * project that genuinely has none of this preset's subject. Do not use it to
42
+ * quiet a preset whose glob is wrong: the day the glob is fixed, this reddens.
43
+ */
44
+ readonly expectEmpty?: boolean;
21
45
  }
22
46
  /**
23
47
  * How many violations this module has actually WRITTEN, ever.
@@ -32,13 +56,13 @@ export interface PresetReportOptions extends ReportOptions {
32
56
  * exactly that case. Count emissions, not silences.
33
57
  */
34
58
  export declare function violationsEmittedCount(): number;
35
- export declare function reportViolations(violations: ArchViolation[], options?: ReportOptions): void;
59
+ export declare function reportViolations(violations: CollectResult, options?: ReportOptions): CollectResult;
36
60
  /**
37
61
  * Finish a preset: deliver its aggregated violations per the requested mode
38
- * (plan 0070). `throw` (default) emits then throws — backward-compatible with
39
- * `throwIfViolations`; `return` hands the violations back untouched (the caller
40
- * owns emission and control flow); `warn` emits without throwing. Always
41
- * returns the violations, so a caller can inspect them regardless of mode.
62
+ * (plan 0070). `throw` (default) emits then throws; `return` hands the
63
+ * violations back untouched (the caller owns emission and control flow);
64
+ * `warn` emits without throwing. Always returns the violations, so a caller can
65
+ * inspect them regardless of mode.
42
66
  */
43
- export declare function finishPreset(violations: ArchViolation[], options?: PresetReportOptions): ArchViolation[];
67
+ export declare function finishPreset(violations: CollectResult, options?: PresetReportOptions): CollectResult;
44
68
  //# sourceMappingURL=report.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMtD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEpD,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAA;IAC9B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,sEAAsE;AACtE,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,sCAAsC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAC7B;AAWD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;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