@nielspeter/eess-md 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @nielspeter/eess-md
2
2
 
3
- Architecture testing for a **Markdown corpus** — the Markdown dialect of the [eess](../../README.md) family. _Specifications you can run._
3
+ Architecture testing for a **Markdown corpus** — the Markdown dialect of the [eess](https://github.com/nielspeter/eess/blob/main/README.md) family. _Specifications you can run._
4
4
 
5
- A repo's markdown (docs, ADRs, plans) should stay honest: cross-links resolve, code pointers point at real lines, and — if you use them — ADRs declare how they're enforced. `eess-md` validates all of that on the shared [`@nielspeter/eess`](../core) kernel, so you write a declarative rules file, not a custom validator script.
5
+ A repo's markdown (docs, ADRs, plans) should stay honest: cross-links resolve, code pointers point at real lines, and — if you use them — ADRs declare how they're enforced. `eess-md` validates all of that on the shared [`@nielspeter/eess`](https://www.npmjs.com/package/@nielspeter/eess) kernel, so you write a declarative rules file, not a custom validator script.
6
6
 
7
7
  ## Install
8
8
 
@@ -47,8 +47,7 @@ selection into one side of a `correspondence()`. Bind a table to what it
47
47
  describes and drift in either direction fails the build:
48
48
 
49
49
  ```typescript
50
- import { corpus, rows } from '@nielspeter/eess-md'
51
- import { correspondence } from '@nielspeter/eess'
50
+ import { corpus, rows, correspondence } from '@nielspeter/eess-md'
52
51
 
53
52
  const c = corpus({ roots: ['README.md'] })
54
53
 
@@ -61,8 +60,15 @@ const packageRows = rows(c, {
61
60
  identify: (r) => ({ name: r.get('pkg'), file: r.doc.relPath, line: r.line }),
62
61
  })
63
62
 
64
- // `workspacePackages` is a plain Selection you build from the filesystem
65
- correspondence({ left: packageRows, right: workspacePackages, keyBy: (e) => e.name })
63
+ // `workspacePackages` is a plain Selection you build from the filesystem —
64
+ // keyBy omitted: it defaults to each side's own identify().name
65
+ const workspacePackages = {
66
+ elements: [] as { name: string }[],
67
+ label: 'workspace package',
68
+ identify: (p: { name: string }) => ({ name: p.name }),
69
+ }
70
+
71
+ correspondence({ left: packageRows, right: workspacePackages })
66
72
  .should()
67
73
  .beComplete({ direction: 'both' }) // every row has a package AND vice versa
68
74
  .because('the README package table must not drift from the workspace')
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export { corpus } from './corpus.js';
2
2
  export type { CorpusOptions, Corpus } from './corpus.js';
3
+ export type { Predicate, Condition, ConditionContext, ArchFix, PresetReportOptions, PresetBaseOptions, } from '@nielspeter/eess';
4
+ export { RuleBuilder, finishPreset, generateCodeFrame, not, dispatchRule, validateOverrides, } from '@nielspeter/eess';
5
+ export { correspondence, CorrespondenceBuilder } from '@nielspeter/eess';
3
6
  export type { MdDocument, MdSection, MdTable, MdCodeBlock } from './model/document.js';
4
7
  export type { MdRow, ColumnSpec, RowMatchOptions, RowMatchMode } from './model/rows.js';
5
8
  export { matchTableRows } from './model/rows.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGxD,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtF,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC5D,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,YAAY,EAAE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EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC7E,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGnG,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA"}
package/dist/index.js CHANGED
@@ -6,6 +6,16 @@
6
6
  // from `@nielspeter/eess-md/rules/adr`.
7
7
  // Corpus loader
8
8
  export { corpus } from './corpus.js';
9
+ export { RuleBuilder, finishPreset, generateCodeFrame, not, dispatchRule, validateOverrides, } from '@nielspeter/eess';
10
+ // `correspondence`/`CorrespondenceBuilder`: not touched by this package's
11
+ // OWN source (so the family.rules.ts code-import scan can't see this gap —
12
+ // review found it manually), but this README's own "Binding a spec table to
13
+ // code" example, and docs/markdown.md's equivalent, both teach
14
+ // `rows()` + `correspondence()` as the flagship way to bind a markdown table
15
+ // to code — without this re-export, that documented example does not
16
+ // compile against @nielspeter/eess-md alone, the exact second-install this
17
+ // plan exists to close.
18
+ export { correspondence, CorrespondenceBuilder } from '@nielspeter/eess';
9
19
  export { matchTableRows } from './model/rows.js';
10
20
  // Entry points
11
21
  export { docs, DocsRuleBuilder } from './builders/docs.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,iFAAiF;AACjF,gFAAgF;AAChF,gFAAgF;AAChF,wCAAwC;AAExC,gBAAgB;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAMpC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGhD,eA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IAAI,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG7E,oDAAoD;AACpD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA"}
@@ -19,6 +19,17 @@ import type { ArchViolation } from '../model/violation.js';
19
19
  * `collectTaskItems`), so a `- [ ]` in fenced code or a blockquote is excluded
20
20
  * for free — no hand-rolled stripping. `deferred: none` summaries and the
21
21
  * `State:` header token are unambiguous prose lines, scanned from the source.
22
+ *
23
+ * **Expressed through the builder DSL** (bug 0131, closed by plan 0101 Phase 1):
24
+ * previously this preset hand-iterated `corpus.documents()` directly, calling
25
+ * no `RuleBuilder`/`TerminalBuilder` at all — invisible to every kernel-level
26
+ * guarantee, including the ADR-010 evidence gate the fold (plan 0088) landed.
27
+ * `docs(corpus)` and `taskItems(corpus)` already existed and already
28
+ * `extends RuleBuilder<T, Corpus>` — the detection logic below is unchanged
29
+ * from the pre-fold version (same regexes, same `findState`/`isDoneItem`
30
+ * helpers, same messages), only its *iteration* now goes through the DSL, so
31
+ * this preset inherits the fold's fail-closed floor like every sibling
32
+ * builder-based rule already does.
22
33
  */
23
34
  export interface HonestyAtCloseOptions extends PresetReportOptions {
24
35
  /**
@@ -47,11 +58,108 @@ export interface HonestyAtCloseOptions extends PresetReportOptions {
47
58
  * whether or not they also appear in {@link states}.
48
59
  */
49
60
  readonly terminalStates?: readonly string[];
61
+ /**
62
+ * Declare that this corpus may legitimately hold zero non-board documents
63
+ * right now — a freshly-bootstrapped lane before its first real item is
64
+ * authored (e.g. a `kit/`-seeded `work/plans/` containing only
65
+ * `ROADMAP.md`). Default `false`: an empty non-board selection is treated
66
+ * as a dead selector (wrong glob, broken `boardFiles`) and reported.
67
+ *
68
+ * This is a genuine, caller-declared claim, not something `honestyAtClose`
69
+ * can infer — nothing else in the corpus distinguishes "nothing authored
70
+ * yet" from "the selector broke." Per ADR-010 it **expires**: the day a
71
+ * real document appears, `examined > 0` while this is still declared `true`
72
+ * is itself reported ("the declaration has expired"), so remove it once
73
+ * the lane has real content.
74
+ */
75
+ readonly expectEmptyHeaders?: boolean;
50
76
  }
51
77
  /**
52
78
  * Run the honesty-at-close gate over a corpus. Throws `ArchRuleError` on any
53
79
  * finding. Placement is checked on every item; ledger reconciliation only on
54
80
  * done-items (the inverse of the frozen-folder exemption).
81
+ *
82
+ * Three builder-based rules, merged: header state↔folder (`docs()`), silent
83
+ * open boxes (`taskItems()`, filtered to done-items), and the deferred-none
84
+ * lie (`docs()`, filtered to done-items carrying a deferred-disposed box).
85
+ *
86
+ * **Emptiness declarations, and why each is shaped the way it is** (bug 0131
87
+ * follow-up, six-persona review before this landed): `.expectEmpty()` is only
88
+ * a sound fail-closed gate when the thing that decides *whether* to declare
89
+ * it is independent of the predicate the declaration would otherwise let
90
+ * pass silently. Two designs were tried and rejected for this reason:
91
+ *
92
+ * 1. Peeking the exact same selection each rule gates (`.select()` on
93
+ * `openBoxesOnDoneItems`/`doneItemsWithDeferredBox` themselves) before
94
+ * conditionally declaring `.expectEmpty()`. This *reads* as a live check
95
+ * but is circular: the peek and the real run filter the identical
96
+ * elements through the identical predicates with nothing in between, so
97
+ * the declaration is always self-consistent and can never expire — it
98
+ * provides zero protection against exactly the corruption class ADR-010
99
+ * exists to catch, for either rule.
100
+ * 2. Gating on `terminalStates.length === 0` alone. Correct for the
101
+ * always-structurally-empty `proposals` lane, but too narrow: it doesn't
102
+ * cover a plan/bug lane's own test fixtures that legitimately have zero
103
+ * done-items in a given run (e.g. a single-document fixture testing an
104
+ * unrelated placement rule).
105
+ * 3. Gating both rules on one coarse "any done item exists in this corpus"
106
+ * signal. Independent of the right predicate, but the wrong *scope*: most
107
+ * done items carry zero open boxes and zero deferred boxes — that's the
108
+ * normal, healthy, permanent state for a reconciled item, not a corner
109
+ * case — so "a done item exists" routinely holds while the real selection
110
+ * (open boxes on it, or a deferred box on it) is legitimately empty. That
111
+ * false-positived on the project's own `fixed/green-bug-closed.md` fixture
112
+ * (a done item with one already-checked box, no open boxes at all).
113
+ *
114
+ * The fix: peek `openTaskItems` once (`taskItems(corpus).that().areOpen()`,
115
+ * a purely structural filter, no done-item check), then derive each rule's
116
+ * own emptiness signal from *that*, narrowed to what the rule actually
117
+ * selects, while staying independent of the specific predicate/function
118
+ * being protected:
119
+ *
120
+ * - `silentOpenBoxViolations` is gated by `belongsToADoneItem`. Its peek
121
+ * (`anyOpenBoxOnADoneItem`) calls `isDoneItem` on `openTaskItems` directly
122
+ * — not through `belongsToADoneItem` — so a corruption of that predicate
123
+ * specifically doesn't also blind the peek.
124
+ * - `deferredLieViolations`'s selection adds `hasDeferredDisposedBox` (which
125
+ * walks each done document's own mdast via a separate
126
+ * `collectTaskItems(doc.root)` call) on top of `isDoneItemPredicate`. Its
127
+ * peek (`anyDeferredDisposedBoxOnADoneItem`) instead re-tests
128
+ * `openTaskItems` (a different traversal) against the same
129
+ * `DEFERRED_DISPOSITION_RE` constant `hasDeferredDisposedBox` uses — so a
130
+ * corruption of `hasDeferredDisposedBox`'s own body doesn't blind this
131
+ * peek either.
132
+ *
133
+ * Both peeks share `isDoneItem` and the underlying `collectTaskItems` box
134
+ * collection with the very selections they protect — a corruption isolated to
135
+ * either would defeat both peek and real selection identically, uniformly,
136
+ * for every lane. This is a real residual gap, not a narrow one: verified by
137
+ * sabotaging `isDoneItem` against this repo's own real corpus during bug
138
+ * 0131's round-2 review, which produced **zero violations, exit 0** — not a
139
+ * partial miss. `headerStateCondition` does **not** independently backstop
140
+ * this (an earlier draft of this comment claimed it "would likely also
141
+ * surface through `headerViolations`" — false: `headerStateCondition` never
142
+ * calls `isDoneItem`, it recomputes the folder half of the same determination
143
+ * inline, so it only catches a corruption if a live state/folder mismatch
144
+ * already exists in the scanned corpus, which it usually doesn't).
145
+ *
146
+ * `honestyAtClose` itself can't close this gap generically — a corpus with
147
+ * zero done-items is legitimate on a freshly-bootstrapped lane's first day,
148
+ * so a library-level "zero done-items across the whole call is always wrong"
149
+ * assertion would be exactly the false-positive class `expectEmptyHeaders`
150
+ * exists to avoid. What closes it is caller knowledge: **a corpus with an
151
+ * established history should assert its own "zero done-items is never
152
+ * legitimate here" claim on top.** `scripts/check-ledger.mjs` (this repo's
153
+ * own wiring) does exactly that — 0 done-items summed across every lane fails
154
+ * the build, because this repo has carried done-items in every
155
+ * terminal-states lane for its entire history. A `kit/`-seeded caller with no
156
+ * history yet should not copy that assertion verbatim; it becomes true, and
157
+ * worth adding, once the corpus has one.
158
+ *
159
+ * `headerViolations` gets no computed declaration — nothing in the corpus
160
+ * can tell "no non-board documents authored yet" apart from "the selector
161
+ * broke." Callers who know the former is legitimate (a freshly-bootstrapped
162
+ * lane) opt in explicitly via {@link HonestyAtCloseOptions.expectEmptyHeaders}.
55
163
  */
56
164
  export declare function honestyAtClose(corpus: Corpus, options?: HonestyAtCloseOptions): ArchViolation[];
57
165
  /** What a {@link honestyAtClose} run actually examined. */
@@ -77,6 +185,8 @@ export interface LedgerStats {
77
185
  * Callers must not re-derive it. `check-ledger.mjs` did, with a copy of the very
78
186
  * expression 0119 removed, and its copy disagreed with the preset on 56 of 56
79
187
  * records while heading a section captioned "so a green is provably non-vacuous".
188
+ *
189
+ * Pure read-only counting, not a rule — no evidence gate applies here.
80
190
  */
81
191
  export declare function ledgerStats(corpus: Corpus, options?: HonestyAtCloseOptions): LedgerStats;
82
192
  //# sourceMappingURL=ledger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/rules/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAChE;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,sEAAsE;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5C;AAgPD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GAClC,aAAa,EAAE,CAoBjB;AAED,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,wEAAwE;IACxE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,qFAAqF;IACrF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;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,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,qFAAqF;IACrF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,WAAW,CAqB5F"}
@@ -1,5 +1,7 @@
1
1
  import { finishPreset } from '@nielspeter/eess';
2
2
  import { collectTaskItems } from '../model/task-items.js';
3
+ import { docs } from '../builders/docs.js';
4
+ import { taskItems } from '../builders/task-items.js';
3
5
  const DEFAULT_DONE_FOLDERS = ['/completed/', '/fixed/', '/wont-do/', '/delivered/', '/archived/'];
4
6
  const DEFAULT_BOARD_FILES = ['ROADMAP.md', 'BUGS.md', 'REFINEMENT.md', 'SUPPORT.md', 'README.md'];
5
7
  const DEFAULT_STATES = ['Draft', 'Ready', 'Open', 'Done', "Won't-do"];
@@ -142,40 +144,203 @@ function headerStateViolation(doc, inDoneFolder, closeInPlace, states, terminalS
142
144
  }
143
145
  return null;
144
146
  }
145
- /** Ledger reconciliation of one done-item: unchecked boxes + the `none`-summary lie. */
146
- function ledgerViolations(doc) {
147
- const out = [];
148
- let anyDeferredDisposedBox = false;
149
- for (const box of collectTaskItems(doc.root)) {
150
- if (box.checked)
151
- continue; // only open boxes are live ledger entries
152
- if (DEFERRED_DISPOSITION_RE.test(box.text))
153
- anyDeferredDisposedBox = true;
154
- if (!DISPOSITION_RE.test(box.text)) {
155
- out.push(v('ledger/silent-open-box', doc, box.line, 'unchecked box with no disposition (done-otherwise / deferred→<home> / dropped-on-purpose / validation-owed)', "silence is not 'nothing deferred' — a done-item with a silently-open box has lost scope"));
147
+ /** A box's disposition is disclosed, or it is a silent open box. */
148
+ function isDisposed(boxText) {
149
+ return DISPOSITION_RE.test(boxText);
150
+ }
151
+ /**
152
+ * Does this document carry at least one open box disposed as `deferred→<home>`?
153
+ *
154
+ * A corruption here (always `false`) is caught by
155
+ * `scripts/nonvacuity/bad-ledger.mjs`'s `completed/0005-deferred-none-lie.md`
156
+ * fixture (bug 0131 round-2 review) — before it existed, no fixture in that
157
+ * corpus carried a `deferred→<home>` box at all, so this function's only
158
+ * "protection" was this repo's own live corpus incidentally carrying one,
159
+ * which would have silently vanished the day that box got resolved.
160
+ */
161
+ function hasDeferredDisposedBox(doc) {
162
+ return collectTaskItems(doc.root).some((box) => !box.checked && DEFERRED_DISPOSITION_RE.test(box.text));
163
+ }
164
+ /**
165
+ * A `none` deferral-summary while the document carries a box disposed as
166
+ * `deferred→<home>` — the summary contradicts the boxes. Absence of a summary
167
+ * is deliberately NOT gated; only a *contradicting* one is.
168
+ */
169
+ function deferredNoneLieViolation(doc) {
170
+ const lines = stripFencedCode(doc.text).split('\n');
171
+ for (let i = 0; i < lines.length; i++) {
172
+ const raw = lines[i] ?? '';
173
+ if (/^\s*>/.test(raw))
174
+ continue;
175
+ const sm = raw.match(DEFERRED_SUMMARY_RE);
176
+ if (sm && /^none\b/i.test((sm[1] ?? '').trim())) {
177
+ return v('ledger/deferred-none-lie', doc, i + 1, "'deferred: none' contradicts a box disposed as deferred→<home>", 'the out-loud summary must reconcile with the box states, not override them');
156
178
  }
157
179
  }
158
- // A `none` deferral-summary while a box carries a defer disposition — the
159
- // summary contradicts the boxes. (Absence of a summary is deliberately NOT gated.)
160
- if (anyDeferredDisposedBox) {
161
- const lines = stripFencedCode(doc.text).split('\n');
162
- for (let i = 0; i < lines.length; i++) {
163
- const raw = lines[i] ?? '';
164
- if (/^\s*>/.test(raw))
165
- continue;
166
- const sm = raw.match(DEFERRED_SUMMARY_RE);
167
- if (sm && /^none\b/i.test((sm[1] ?? '').trim())) {
168
- out.push(v('ledger/deferred-none-lie', doc, i + 1, "'deferred: none' contradicts a box disposed as deferred→<home>", 'the out-loud summary must reconcile with the box states, not override them'));
169
- break;
180
+ return null;
181
+ }
182
+ /** Predicate: not a board/index file (never scanned as an item). */
183
+ function notBoardFile(boardFiles) {
184
+ return {
185
+ description: 'is not a board file',
186
+ test: (doc) => !boardFiles.has(doc.relPath.split('/').pop() ?? doc.relPath),
187
+ };
188
+ }
189
+ /** Predicate: this document is a done-item under the caller's own vocabulary. */
190
+ function isDoneItemPredicate(doneFolders, terminalStates) {
191
+ return {
192
+ description: 'is a done item',
193
+ test: (doc) => isDoneItem(doc, doneFolders, terminalStates),
194
+ };
195
+ }
196
+ /**
197
+ * Predicate: this task item's own document is a done-item.
198
+ *
199
+ * A corruption here (always `false`) is caught not by a purpose-built
200
+ * fixture but as a side effect of `ledger.test.ts`'s pre-existing
201
+ * `flags a silent open box in a done-item (red)` /
202
+ * `passes a done-item whose every open box is disposed (green)` pair, and of
203
+ * `scripts/nonvacuity/bad-ledger.mjs`'s `completed/0001-silent-open-box.md`
204
+ * fixture — both keep a real open box on a real done-item in the corpus, the
205
+ * exact shape `honestyAtClose`'s independent `anyOpenBoxOnADoneItem` peek
206
+ * (see its docstring) needs to diverge from a corrupted `belongsToADoneItem`.
207
+ * Simplifying either fixture to drop that box, even for reasons unrelated to
208
+ * this concern, would silently regress the coverage.
209
+ */
210
+ function belongsToADoneItem(doneFolders, terminalStates) {
211
+ return {
212
+ description: 'belongs to a done item',
213
+ test: (t) => isDoneItem(t.doc, doneFolders, terminalStates),
214
+ };
215
+ }
216
+ /** Condition: the header `State:` line is readable and matches its folder. */
217
+ function headerStateCondition(doneFolders, closeInPlace, states, terminalStates) {
218
+ return {
219
+ description: 'have a readable State: line that matches its folder',
220
+ evaluate(elements, _ctx) {
221
+ const out = [];
222
+ for (const doc of elements) {
223
+ const inDoneFolder = doneFolders.some((seg) => `/${doc.relPath}`.includes(seg));
224
+ const found = headerStateViolation(doc, inDoneFolder, closeInPlace, states, terminalStates);
225
+ if (found)
226
+ out.push(found);
170
227
  }
171
- }
172
- }
173
- return out;
228
+ return out;
229
+ },
230
+ };
231
+ }
232
+ /** Condition: an open box on a done-item carries a disposition token. */
233
+ function dispositionCondition() {
234
+ return {
235
+ description: 'carry a disposition token (done-otherwise / deferred→<home> / dropped-on-purpose / validation-owed)',
236
+ evaluate(elements, _ctx) {
237
+ return elements
238
+ .filter((t) => !isDisposed(t.text))
239
+ .map((t) => v('ledger/silent-open-box', t.doc, t.line, 'unchecked box with no disposition (done-otherwise / deferred→<home> / dropped-on-purpose / validation-owed)', "silence is not 'nothing deferred' — a done-item with a silently-open box has lost scope"));
240
+ },
241
+ };
242
+ }
243
+ /** Condition: a document with a deferred-disposed box does not lie in its summary. */
244
+ function deferredNoneLieCondition() {
245
+ return {
246
+ description: "not summarize deferrals as 'none' while a box is deferred→<home>",
247
+ evaluate(elements, _ctx) {
248
+ const out = [];
249
+ for (const doc of elements) {
250
+ const found = deferredNoneLieViolation(doc);
251
+ if (found)
252
+ out.push(found);
253
+ }
254
+ return out;
255
+ },
256
+ };
174
257
  }
175
258
  /**
176
259
  * Run the honesty-at-close gate over a corpus. Throws `ArchRuleError` on any
177
260
  * finding. Placement is checked on every item; ledger reconciliation only on
178
261
  * done-items (the inverse of the frozen-folder exemption).
262
+ *
263
+ * Three builder-based rules, merged: header state↔folder (`docs()`), silent
264
+ * open boxes (`taskItems()`, filtered to done-items), and the deferred-none
265
+ * lie (`docs()`, filtered to done-items carrying a deferred-disposed box).
266
+ *
267
+ * **Emptiness declarations, and why each is shaped the way it is** (bug 0131
268
+ * follow-up, six-persona review before this landed): `.expectEmpty()` is only
269
+ * a sound fail-closed gate when the thing that decides *whether* to declare
270
+ * it is independent of the predicate the declaration would otherwise let
271
+ * pass silently. Two designs were tried and rejected for this reason:
272
+ *
273
+ * 1. Peeking the exact same selection each rule gates (`.select()` on
274
+ * `openBoxesOnDoneItems`/`doneItemsWithDeferredBox` themselves) before
275
+ * conditionally declaring `.expectEmpty()`. This *reads* as a live check
276
+ * but is circular: the peek and the real run filter the identical
277
+ * elements through the identical predicates with nothing in between, so
278
+ * the declaration is always self-consistent and can never expire — it
279
+ * provides zero protection against exactly the corruption class ADR-010
280
+ * exists to catch, for either rule.
281
+ * 2. Gating on `terminalStates.length === 0` alone. Correct for the
282
+ * always-structurally-empty `proposals` lane, but too narrow: it doesn't
283
+ * cover a plan/bug lane's own test fixtures that legitimately have zero
284
+ * done-items in a given run (e.g. a single-document fixture testing an
285
+ * unrelated placement rule).
286
+ * 3. Gating both rules on one coarse "any done item exists in this corpus"
287
+ * signal. Independent of the right predicate, but the wrong *scope*: most
288
+ * done items carry zero open boxes and zero deferred boxes — that's the
289
+ * normal, healthy, permanent state for a reconciled item, not a corner
290
+ * case — so "a done item exists" routinely holds while the real selection
291
+ * (open boxes on it, or a deferred box on it) is legitimately empty. That
292
+ * false-positived on the project's own `fixed/green-bug-closed.md` fixture
293
+ * (a done item with one already-checked box, no open boxes at all).
294
+ *
295
+ * The fix: peek `openTaskItems` once (`taskItems(corpus).that().areOpen()`,
296
+ * a purely structural filter, no done-item check), then derive each rule's
297
+ * own emptiness signal from *that*, narrowed to what the rule actually
298
+ * selects, while staying independent of the specific predicate/function
299
+ * being protected:
300
+ *
301
+ * - `silentOpenBoxViolations` is gated by `belongsToADoneItem`. Its peek
302
+ * (`anyOpenBoxOnADoneItem`) calls `isDoneItem` on `openTaskItems` directly
303
+ * — not through `belongsToADoneItem` — so a corruption of that predicate
304
+ * specifically doesn't also blind the peek.
305
+ * - `deferredLieViolations`'s selection adds `hasDeferredDisposedBox` (which
306
+ * walks each done document's own mdast via a separate
307
+ * `collectTaskItems(doc.root)` call) on top of `isDoneItemPredicate`. Its
308
+ * peek (`anyDeferredDisposedBoxOnADoneItem`) instead re-tests
309
+ * `openTaskItems` (a different traversal) against the same
310
+ * `DEFERRED_DISPOSITION_RE` constant `hasDeferredDisposedBox` uses — so a
311
+ * corruption of `hasDeferredDisposedBox`'s own body doesn't blind this
312
+ * peek either.
313
+ *
314
+ * Both peeks share `isDoneItem` and the underlying `collectTaskItems` box
315
+ * collection with the very selections they protect — a corruption isolated to
316
+ * either would defeat both peek and real selection identically, uniformly,
317
+ * for every lane. This is a real residual gap, not a narrow one: verified by
318
+ * sabotaging `isDoneItem` against this repo's own real corpus during bug
319
+ * 0131's round-2 review, which produced **zero violations, exit 0** — not a
320
+ * partial miss. `headerStateCondition` does **not** independently backstop
321
+ * this (an earlier draft of this comment claimed it "would likely also
322
+ * surface through `headerViolations`" — false: `headerStateCondition` never
323
+ * calls `isDoneItem`, it recomputes the folder half of the same determination
324
+ * inline, so it only catches a corruption if a live state/folder mismatch
325
+ * already exists in the scanned corpus, which it usually doesn't).
326
+ *
327
+ * `honestyAtClose` itself can't close this gap generically — a corpus with
328
+ * zero done-items is legitimate on a freshly-bootstrapped lane's first day,
329
+ * so a library-level "zero done-items across the whole call is always wrong"
330
+ * assertion would be exactly the false-positive class `expectEmptyHeaders`
331
+ * exists to avoid. What closes it is caller knowledge: **a corpus with an
332
+ * established history should assert its own "zero done-items is never
333
+ * legitimate here" claim on top.** `scripts/check-ledger.mjs` (this repo's
334
+ * own wiring) does exactly that — 0 done-items summed across every lane fails
335
+ * the build, because this repo has carried done-items in every
336
+ * terminal-states lane for its entire history. A `kit/`-seeded caller with no
337
+ * history yet should not copy that assertion verbatim; it becomes true, and
338
+ * worth adding, once the corpus has one.
339
+ *
340
+ * `headerViolations` gets no computed declaration — nothing in the corpus
341
+ * can tell "no non-board documents authored yet" apart from "the selector
342
+ * broke." Callers who know the former is legitimate (a freshly-bootstrapped
343
+ * lane) opt in explicitly via {@link HonestyAtCloseOptions.expectEmptyHeaders}.
179
344
  */
180
345
  export function honestyAtClose(corpus, options = {}) {
181
346
  const doneFolders = options.doneFolders ?? DEFAULT_DONE_FOLDERS;
@@ -183,19 +348,64 @@ export function honestyAtClose(corpus, options = {}) {
183
348
  const closeInPlace = options.closeInPlace ?? false;
184
349
  const states = options.states ?? DEFAULT_STATES;
185
350
  const terminalStates = options.terminalStates ?? DEFAULT_TERMINAL_STATES;
186
- const violations = [];
187
- for (const doc of corpus.documents()) {
188
- const base = doc.relPath.split('/').pop() ?? doc.relPath;
189
- if (boardFiles.has(base))
190
- continue;
191
- const inDoneFolder = doneFolders.some((seg) => `/${doc.relPath}`.includes(seg));
192
- const header = headerStateViolation(doc, inDoneFolder, closeInPlace, states, terminalStates);
193
- if (header)
194
- violations.push(header);
195
- if (isDoneItem(doc, doneFolders, terminalStates))
196
- violations.push(...ledgerViolations(doc));
197
- }
198
- return finishPreset(violations, options);
351
+ const expectEmptyHeaders = options.expectEmptyHeaders ?? false;
352
+ let headerRule = docs(corpus)
353
+ .that()
354
+ .satisfy(notBoardFile(boardFiles))
355
+ .should()
356
+ .satisfy(headerStateCondition(doneFolders, closeInPlace, states, terminalStates));
357
+ if (expectEmptyHeaders)
358
+ headerRule = headerRule.expectEmpty();
359
+ const headerViolations = headerRule.violations();
360
+ // Open task items, collected once and reused for both peeks below. "Any
361
+ // done item exists" is too coarse a signal on its own — most done items
362
+ // legitimately carry zero open boxes and zero deferred boxes, so gating on
363
+ // it alone false-positives on the common, healthy case (a done item with
364
+ // nothing outstanding). Each peek below narrows to what its own rule
365
+ // actually selects, while staying independent of the predicate/function
366
+ // that rule uses to select it.
367
+ const openTaskItems = taskItems(corpus)
368
+ .that()
369
+ .areOpen()
370
+ .select({
371
+ label: 'open task items',
372
+ identify: (t) => ({ name: t.doc.relPath, file: t.doc.file, line: t.line }),
373
+ }).elements;
374
+ // Independent of `belongsToADoneItem`: calls `isDoneItem` directly rather
375
+ // than through that predicate object, so a corruption of
376
+ // `belongsToADoneItem` itself doesn't also blind this peek.
377
+ const anyOpenBoxOnADoneItem = openTaskItems.some((t) => isDoneItem(t.doc, doneFolders, terminalStates));
378
+ let silentBoxRule = taskItems(corpus)
379
+ .that()
380
+ .areOpen()
381
+ .satisfy(belongsToADoneItem(doneFolders, terminalStates))
382
+ .should()
383
+ .satisfy(dispositionCondition());
384
+ if (!anyOpenBoxOnADoneItem)
385
+ silentBoxRule = silentBoxRule.expectEmpty();
386
+ const silentOpenBoxViolations = silentBoxRule.violations();
387
+ // Independent of `hasDeferredDisposedBox`: that function walks each done
388
+ // document's own mdast via a separate `collectTaskItems(doc.root)` call:
389
+ // this peek instead reuses the flat, already-collected `openTaskItems` list
390
+ // (from the `taskItems()` builder's own traversal) and the same
391
+ // `DEFERRED_DISPOSITION_RE` constant `hasDeferredDisposedBox` tests against
392
+ // — two different collection paths converging on the one shared pattern,
393
+ // so a corruption of `hasDeferredDisposedBox`'s own body doesn't blind this
394
+ // peek too.
395
+ const anyDeferredDisposedBoxOnADoneItem = openTaskItems.some((t) => isDoneItem(t.doc, doneFolders, terminalStates) && DEFERRED_DISPOSITION_RE.test(t.text));
396
+ let deferredLieRule = docs(corpus)
397
+ .that()
398
+ .satisfy(isDoneItemPredicate(doneFolders, terminalStates))
399
+ .satisfy({
400
+ description: 'carries a box disposed as deferred→<home>',
401
+ test: (doc) => hasDeferredDisposedBox(doc),
402
+ })
403
+ .should()
404
+ .satisfy(deferredNoneLieCondition());
405
+ if (!anyDeferredDisposedBoxOnADoneItem)
406
+ deferredLieRule = deferredLieRule.expectEmpty();
407
+ const deferredLieViolations = deferredLieRule.violations();
408
+ return finishPreset([...headerViolations, ...silentOpenBoxViolations, ...deferredLieViolations], options);
199
409
  }
200
410
  /**
201
411
  * The denominator, computed by the preset itself.
@@ -209,6 +419,8 @@ export function honestyAtClose(corpus, options = {}) {
209
419
  * Callers must not re-derive it. `check-ledger.mjs` did, with a copy of the very
210
420
  * expression 0119 removed, and its copy disagreed with the preset on 56 of 56
211
421
  * records while heading a section captioned "so a green is provably non-vacuous".
422
+ *
423
+ * Pure read-only counting, not a rule — no evidence gate applies here.
212
424
  */
213
425
  export function ledgerStats(corpus, options = {}) {
214
426
  const doneFolders = options.doneFolders ?? DEFAULT_DONE_FOLDERS;
@@ -1 +1 @@
1
- {"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/rules/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA4B,MAAM,kBAAkB,CAAA;AAIz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AC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxC,IAAI,KAAK,EAAE,KAAK,KAAK,SAAS;YAAE,iBAAiB,IAAI,CAAC,CAAA;aACjD,IAAI,KAAK,KAAK,IAAI;YAAE,eAAe,IAAI,CAAC,CAAA;QAC7C,IAAI,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC;YAAE,SAAS,IAAI,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,EAAE,CAAA;AACnE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nielspeter/eess-md",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Architecture testing for a Markdown corpus — the Markdown dialect of the eess family. Links resolve, code pointers ground, ADRs declare enforcement.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -48,7 +48,7 @@
48
48
  "eess"
49
49
  ],
50
50
  "dependencies": {
51
- "@nielspeter/eess": "^0.2.2",
51
+ "@nielspeter/eess": "^0.4.0",
52
52
  "mdast-util-from-markdown": "^2.0.3",
53
53
  "mdast-util-gfm": "^3.1.0",
54
54
  "micromark-extension-gfm": "^3.0.0",