@jasonbelmonti/markdown-engine 2.0.0 → 3.1.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.
Files changed (196) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +132 -57
  3. package/dist/api/contracts.d.ts +2 -1
  4. package/dist/api/contracts.d.ts.map +1 -1
  5. package/dist/api/contracts.js +1 -0
  6. package/dist/api/contracts.js.map +1 -1
  7. package/dist/api/declarative-validation.d.ts +2 -2
  8. package/dist/api/declarative-validation.d.ts.map +1 -1
  9. package/dist/api/declarative-validation.js +53 -31
  10. package/dist/api/declarative-validation.js.map +1 -1
  11. package/dist/api/document-set-validation-types.d.ts +32 -0
  12. package/dist/api/document-set-validation-types.d.ts.map +1 -0
  13. package/dist/api/document-set-validation-types.js +2 -0
  14. package/dist/api/document-set-validation-types.js.map +1 -0
  15. package/dist/api/document-set-validation.d.ts +4 -0
  16. package/dist/api/document-set-validation.d.ts.map +1 -0
  17. package/dist/api/document-set-validation.js +60 -0
  18. package/dist/api/document-set-validation.js.map +1 -0
  19. package/dist/api/serialize.d.ts +2 -1
  20. package/dist/api/serialize.d.ts.map +1 -1
  21. package/dist/api/serialize.js.map +1 -1
  22. package/dist/cli/declarative-validation.d.ts.map +1 -1
  23. package/dist/cli/declarative-validation.js +7 -12
  24. package/dist/cli/declarative-validation.js.map +1 -1
  25. package/dist/declarative-validation/applicability/classifier.d.ts +18 -0
  26. package/dist/declarative-validation/applicability/classifier.d.ts.map +1 -0
  27. package/dist/declarative-validation/applicability/classifier.js +37 -0
  28. package/dist/declarative-validation/applicability/classifier.js.map +1 -0
  29. package/dist/declarative-validation/applicability/index.d.ts +2 -0
  30. package/dist/declarative-validation/applicability/index.d.ts.map +1 -0
  31. package/dist/declarative-validation/applicability/index.js +2 -0
  32. package/dist/declarative-validation/applicability/index.js.map +1 -0
  33. package/dist/declarative-validation/assertions/context.d.ts +2 -2
  34. package/dist/declarative-validation/assertions/context.d.ts.map +1 -1
  35. package/dist/declarative-validation/assertions/diagnostics.d.ts +7 -4
  36. package/dist/declarative-validation/assertions/diagnostics.d.ts.map +1 -1
  37. package/dist/declarative-validation/assertions/diagnostics.js +26 -1
  38. package/dist/declarative-validation/assertions/diagnostics.js.map +1 -1
  39. package/dist/declarative-validation/assertions/evaluator.d.ts +2 -2
  40. package/dist/declarative-validation/assertions/evaluator.d.ts.map +1 -1
  41. package/dist/declarative-validation/assertions/evaluator.js +9 -0
  42. package/dist/declarative-validation/assertions/evaluator.js.map +1 -1
  43. package/dist/declarative-validation/assertions/frontmatter-shape.d.ts +9 -0
  44. package/dist/declarative-validation/assertions/frontmatter-shape.d.ts.map +1 -0
  45. package/dist/declarative-validation/assertions/frontmatter-shape.js +105 -0
  46. package/dist/declarative-validation/assertions/frontmatter-shape.js.map +1 -0
  47. package/dist/declarative-validation/assertions/group-evaluator.d.ts +6 -0
  48. package/dist/declarative-validation/assertions/group-evaluator.d.ts.map +1 -0
  49. package/dist/declarative-validation/assertions/group-evaluator.js +57 -0
  50. package/dist/declarative-validation/assertions/group-evaluator.js.map +1 -0
  51. package/dist/declarative-validation/assertions/id-targets.d.ts +15 -0
  52. package/dist/declarative-validation/assertions/id-targets.d.ts.map +1 -1
  53. package/dist/declarative-validation/assertions/id-targets.js +18 -55
  54. package/dist/declarative-validation/assertions/id-targets.js.map +1 -1
  55. package/dist/declarative-validation/assertions/ids.d.ts.map +1 -1
  56. package/dist/declarative-validation/assertions/ids.js +100 -14
  57. package/dist/declarative-validation/assertions/ids.js.map +1 -1
  58. package/dist/declarative-validation/assertions/index.d.ts +1 -0
  59. package/dist/declarative-validation/assertions/index.d.ts.map +1 -1
  60. package/dist/declarative-validation/assertions/index.js +1 -0
  61. package/dist/declarative-validation/assertions/index.js.map +1 -1
  62. package/dist/declarative-validation/assertions/table-column-coverage.d.ts +9 -0
  63. package/dist/declarative-validation/assertions/table-column-coverage.d.ts.map +1 -0
  64. package/dist/declarative-validation/assertions/table-column-coverage.js +108 -0
  65. package/dist/declarative-validation/assertions/table-column-coverage.js.map +1 -0
  66. package/dist/declarative-validation/assertions/text-format.d.ts +9 -0
  67. package/dist/declarative-validation/assertions/text-format.d.ts.map +1 -0
  68. package/dist/declarative-validation/assertions/text-format.js +75 -0
  69. package/dist/declarative-validation/assertions/text-format.js.map +1 -0
  70. package/dist/declarative-validation/compiler/applicability-plan.d.ts +5 -0
  71. package/dist/declarative-validation/compiler/applicability-plan.d.ts.map +1 -0
  72. package/dist/declarative-validation/compiler/applicability-plan.js +22 -0
  73. package/dist/declarative-validation/compiler/applicability-plan.js.map +1 -0
  74. package/dist/declarative-validation/compiler/assertion-builders.d.ts +2 -1
  75. package/dist/declarative-validation/compiler/assertion-builders.d.ts.map +1 -1
  76. package/dist/declarative-validation/compiler/assertion-builders.js +88 -13
  77. package/dist/declarative-validation/compiler/assertion-builders.js.map +1 -1
  78. package/dist/declarative-validation/compiler/assertion-shapes.d.ts +5 -1
  79. package/dist/declarative-validation/compiler/assertion-shapes.d.ts.map +1 -1
  80. package/dist/declarative-validation/compiler/assertion-shapes.js +120 -0
  81. package/dist/declarative-validation/compiler/assertion-shapes.js.map +1 -1
  82. package/dist/declarative-validation/compiler/assertions.d.ts +2 -1
  83. package/dist/declarative-validation/compiler/assertions.d.ts.map +1 -1
  84. package/dist/declarative-validation/compiler/assertions.js +16 -4
  85. package/dist/declarative-validation/compiler/assertions.js.map +1 -1
  86. package/dist/declarative-validation/compiler/compatibility.d.ts.map +1 -1
  87. package/dist/declarative-validation/compiler/compatibility.js +3 -0
  88. package/dist/declarative-validation/compiler/compatibility.js.map +1 -1
  89. package/dist/declarative-validation/compiler/group-plans.d.ts +6 -0
  90. package/dist/declarative-validation/compiler/group-plans.d.ts.map +1 -0
  91. package/dist/declarative-validation/compiler/group-plans.js +67 -0
  92. package/dist/declarative-validation/compiler/group-plans.js.map +1 -0
  93. package/dist/declarative-validation/compiler/index.d.ts +1 -1
  94. package/dist/declarative-validation/compiler/index.d.ts.map +1 -1
  95. package/dist/declarative-validation/compiler/index.js +70 -35
  96. package/dist/declarative-validation/compiler/index.js.map +1 -1
  97. package/dist/declarative-validation/compiler/plan.d.ts +80 -5
  98. package/dist/declarative-validation/compiler/plan.d.ts.map +1 -1
  99. package/dist/declarative-validation/compiler/rule-fields.d.ts +6 -0
  100. package/dist/declarative-validation/compiler/rule-fields.d.ts.map +1 -0
  101. package/dist/declarative-validation/compiler/rule-fields.js +40 -0
  102. package/dist/declarative-validation/compiler/rule-fields.js.map +1 -0
  103. package/dist/declarative-validation/diagnostics/profile-config-diagnostics.d.ts +0 -1
  104. package/dist/declarative-validation/diagnostics/profile-config-diagnostics.d.ts.map +1 -1
  105. package/dist/declarative-validation/diagnostics/profile-config-diagnostics.js +8 -2
  106. package/dist/declarative-validation/diagnostics/profile-config-diagnostics.js.map +1 -1
  107. package/dist/declarative-validation/evidence/index.d.ts +3 -3
  108. package/dist/declarative-validation/evidence/index.d.ts.map +1 -1
  109. package/dist/declarative-validation/evidence/index.js +6 -6
  110. package/dist/declarative-validation/evidence/index.js.map +1 -1
  111. package/dist/declarative-validation/profile/applicability-schema.d.ts +4 -0
  112. package/dist/declarative-validation/profile/applicability-schema.d.ts.map +1 -0
  113. package/dist/declarative-validation/profile/applicability-schema.js +24 -0
  114. package/dist/declarative-validation/profile/applicability-schema.js.map +1 -0
  115. package/dist/declarative-validation/profile/assertion-schema.d.ts +2 -1
  116. package/dist/declarative-validation/profile/assertion-schema.d.ts.map +1 -1
  117. package/dist/declarative-validation/profile/assertion-schema.js +194 -14
  118. package/dist/declarative-validation/profile/assertion-schema.js.map +1 -1
  119. package/dist/declarative-validation/profile/direct-profile-diagnostics.d.ts +3 -1
  120. package/dist/declarative-validation/profile/direct-profile-diagnostics.d.ts.map +1 -1
  121. package/dist/declarative-validation/profile/direct-profile-diagnostics.js +10 -2
  122. package/dist/declarative-validation/profile/direct-profile-diagnostics.js.map +1 -1
  123. package/dist/declarative-validation/profile/frontmatter-shape-schema.d.ts +8 -0
  124. package/dist/declarative-validation/profile/frontmatter-shape-schema.d.ts.map +1 -0
  125. package/dist/declarative-validation/profile/frontmatter-shape-schema.js +178 -0
  126. package/dist/declarative-validation/profile/frontmatter-shape-schema.js.map +1 -0
  127. package/dist/declarative-validation/profile/group-schema.d.ts +5 -0
  128. package/dist/declarative-validation/profile/group-schema.d.ts.map +1 -0
  129. package/dist/declarative-validation/profile/group-schema.js +55 -0
  130. package/dist/declarative-validation/profile/group-schema.js.map +1 -0
  131. package/dist/declarative-validation/profile/ids-assertion-contract.d.ts +12 -0
  132. package/dist/declarative-validation/profile/ids-assertion-contract.d.ts.map +1 -0
  133. package/dist/declarative-validation/profile/ids-assertion-contract.js +32 -0
  134. package/dist/declarative-validation/profile/ids-assertion-contract.js.map +1 -0
  135. package/dist/declarative-validation/profile/index.d.ts +63 -2
  136. package/dist/declarative-validation/profile/index.d.ts.map +1 -1
  137. package/dist/declarative-validation/profile/index.js.map +1 -1
  138. package/dist/declarative-validation/profile/materialization.d.ts.map +1 -1
  139. package/dist/declarative-validation/profile/materialization.js +13 -10
  140. package/dist/declarative-validation/profile/materialization.js.map +1 -1
  141. package/dist/declarative-validation/profile/schema.d.ts.map +1 -1
  142. package/dist/declarative-validation/profile/schema.js +73 -12
  143. package/dist/declarative-validation/profile/schema.js.map +1 -1
  144. package/dist/declarative-validation/profile/syntax-version.d.ts +7 -0
  145. package/dist/declarative-validation/profile/syntax-version.d.ts.map +1 -0
  146. package/dist/declarative-validation/profile/syntax-version.js +11 -0
  147. package/dist/declarative-validation/profile/syntax-version.js.map +1 -0
  148. package/dist/declarative-validation/profile/text-format-contract.d.ts +4 -0
  149. package/dist/declarative-validation/profile/text-format-contract.d.ts.map +1 -0
  150. package/dist/declarative-validation/profile/text-format-contract.js +6 -0
  151. package/dist/declarative-validation/profile/text-format-contract.js.map +1 -0
  152. package/dist/declarative-validation/results/clone-rule-result.d.ts +6 -0
  153. package/dist/declarative-validation/results/clone-rule-result.d.ts.map +1 -0
  154. package/dist/declarative-validation/results/clone-rule-result.js +125 -0
  155. package/dist/declarative-validation/results/clone-rule-result.js.map +1 -0
  156. package/dist/declarative-validation/results/create-result.d.ts +15 -0
  157. package/dist/declarative-validation/results/create-result.d.ts.map +1 -0
  158. package/dist/declarative-validation/results/create-result.js +58 -0
  159. package/dist/declarative-validation/results/create-result.js.map +1 -0
  160. package/dist/declarative-validation/results/index.d.ts +3 -25
  161. package/dist/declarative-validation/results/index.d.ts.map +1 -1
  162. package/dist/declarative-validation/results/index.js +2 -1
  163. package/dist/declarative-validation/results/index.js.map +1 -1
  164. package/dist/declarative-validation/results/skipped-rule-result.d.ts +10 -0
  165. package/dist/declarative-validation/results/skipped-rule-result.d.ts.map +1 -0
  166. package/dist/declarative-validation/results/skipped-rule-result.js +18 -0
  167. package/dist/declarative-validation/results/skipped-rule-result.js.map +1 -0
  168. package/dist/declarative-validation/results/types.d.ts +77 -0
  169. package/dist/declarative-validation/results/types.d.ts.map +1 -0
  170. package/dist/declarative-validation/results/types.js +2 -0
  171. package/dist/declarative-validation/results/types.js.map +1 -0
  172. package/dist/declarative-validation/selectors/table-targets.d.ts +23 -0
  173. package/dist/declarative-validation/selectors/table-targets.d.ts.map +1 -1
  174. package/dist/declarative-validation/selectors/table-targets.js +52 -9
  175. package/dist/declarative-validation/selectors/table-targets.js.map +1 -1
  176. package/dist-bundled/markdown-engine-cli.mjs +27373 -0
  177. package/docs/contracts/api.md +79 -15
  178. package/docs/contracts/declarative-validation.md +462 -40
  179. package/fixtures/declarative-validation/examples/okf-v0.1/fail/invalid-log-date/log.md +5 -0
  180. package/fixtures/declarative-validation/examples/okf-v0.1/fail/missing-concept-type/concepts/customer-metric.md +8 -0
  181. package/fixtures/declarative-validation/examples/okf-v0.1/fail/non-root-index-frontmatter/datasets/index.md +7 -0
  182. package/fixtures/declarative-validation/examples/okf-v0.1/pass/datasets/index.md +3 -0
  183. package/fixtures/declarative-validation/examples/okf-v0.1/pass/datasets/sales.md +16 -0
  184. package/fixtures/declarative-validation/examples/okf-v0.1/pass/index.md +8 -0
  185. package/fixtures/declarative-validation/examples/okf-v0.1/pass/log.md +9 -0
  186. package/fixtures/declarative-validation/examples/okf-v0.1/pass/playbooks/incident-response.md +17 -0
  187. package/fixtures/declarative-validation/examples/okf-v0.1/profiles/concept.yaml +14 -0
  188. package/fixtures/declarative-validation/examples/okf-v0.1/profiles/log.yaml +10 -0
  189. package/fixtures/declarative-validation/examples/okf-v0.1/profiles/non-root-index.yaml +9 -0
  190. package/fixtures/declarative-validation/examples/okf-v0.1/profiles/root-index.yaml +12 -0
  191. package/package.json +9 -3
  192. package/scripts/install-markdown-engine-cli.sh +113 -0
  193. package/skills/profile-backed-markdown/SKILL.md +54 -0
  194. package/skills/profile-backed-markdown/assets/profiles/operational-spec.yaml +98 -0
  195. package/skills/profile-backed-markdown/references/repair-brief.md +14 -0
  196. package/skills/profile-backed-markdown/scripts/validate-profile-backed-markdown.mjs +590 -0
package/CHANGELOG.md CHANGED
@@ -2,10 +2,54 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ No unreleased changes.
6
+
7
+ ## 3.1.0 - 2026-07-03
8
+
9
+ ### Added
10
+
11
+ - Added `validateDocumentSet(...)` as a public API for validating multiple
12
+ Markdown documents with declarative validation profiles.
13
+ - Added Declarative Validation V2 support for `frontmatterShape` and
14
+ `textFormat: isoDate` across profile schema validation, compiler contracts,
15
+ runtime evaluation, API contracts, and fixtures.
16
+ - Added OKF profile examples, role-profile fixtures, document-set proof tests,
17
+ and release-readiness evidence for profile-backed validation workflows.
18
+
19
+ ### Changed
20
+
21
+ - Expanded the GitHub Pages consumer site and docs with conditional validation,
22
+ OKF profile composition, repair-loop, and policy-validation guidance.
23
+ - Made the standalone CLI installer provider-neutral and removed its runtime
24
+ dependency on `npx markdown-engine`.
25
+
26
+ ## 3.0.0 - 2026-06-05
27
+
5
28
  ### Added
6
29
 
7
30
  - Added a GitHub Pages consumer site under `docs/` with value proposition,
8
- workflow examples, and quickstart material for package 2.0 users.
31
+ workflow examples, and quickstart material for package users.
32
+ - Added Conditional V2 release-readiness notes for MS-4 review, summarizing the
33
+ explicit `markdown-engine.validation@v2` opt-in, retained v1 profile
34
+ compatibility, v2 grouped-rule and `when` behavior, ID count and table-column
35
+ coverage evidence, downstream false-acceptance proof, and BEL-1121 release
36
+ verification handoff. This is documentation readiness only and does not claim
37
+ a tag, npm publication, npm dist-tag mutation, GitHub Release, downstream
38
+ adoption, release completion, or MS-4 approval.
39
+ - Added Conditional V2 public validation support behind explicit
40
+ `markdown-engine.validation@v2` profile opt-in, including ID count bounds,
41
+ table column coverage, non-recursive `anyOf` / `allOf` grouped rules,
42
+ rule-level `when` applicability, skipped-rule result metadata, downstream
43
+ false-acceptance proof, repeatability evidence, and boundary-audit coverage.
44
+
45
+ ### Changed
46
+
47
+ - Promoted package metadata to `@jasonbelmonti/markdown-engine@3.0.0` while
48
+ retaining the serialized rich IR document contract at
49
+ `documentVersion: "1.0.0"`.
50
+ - Preserved v1 declarative validation profile behavior and result shape;
51
+ Conditional V2 behavior is selected only by
52
+ `syntaxVersion: markdown-engine.validation@v2`.
9
53
 
10
54
  ## 2.0.0 - 2026-05-13
11
55
 
package/README.md CHANGED
@@ -3,14 +3,17 @@
3
3
  Deterministic Markdown parsing and validation engine package for downstream
4
4
  profile and runtime work.
5
5
 
6
- Current package release:
6
+ Package release state:
7
7
 
8
8
  - package name: `@jasonbelmonti/markdown-engine`
9
- - version: `2.0.0`
9
+ - package metadata version: `3.0.0`
10
+ - published npm versions before this release: `0.1.0`, `1.0.0`, `2.0.0`
11
+ - npm release target: `3.0.0` on `latest`
10
12
  - website: <https://jasonbelmonti.github.io/markdown-engine/>
11
- - release focus: package-level 2.0 hardening with the existing
12
- `documentVersion: "1.0.0"` rich IR contract as the default API and CLI
13
- document shape
13
+ - release focus: Conditional V2 explicit validation-profile syntax while
14
+ retaining the existing `documentVersion: "1.0.0"` rich IR contract as the
15
+ default API and CLI document shape
16
+ - maintainer documentation map: [docs/README.md](docs/README.md)
14
17
  - design reference:
15
18
  [Markdown Engine 1.0 Rich IR design](docs/design/markdown-engine-1.0-rich-ir-operational-design-spec.md)
16
19
 
@@ -40,6 +43,7 @@ The package root exports:
40
43
  - `validateAnnotations(document, annotations)`
41
44
  - `parseValidationProfile(input, options?)`
42
45
  - `validateWithProfile(document, profile, options?)`
46
+ - `validateDocumentSet(entries, options?)`
43
47
 
44
48
  Example:
45
49
 
@@ -80,7 +84,7 @@ console.log(validationResult.valid);
80
84
  console.log(serialize(validationResult, { pretty: true }));
81
85
  ```
82
86
 
83
- Package 2.0 keeps the serialized document contract at
87
+ Package 3.0 keeps the serialized document contract at
84
88
  `documentVersion: "1.0.0"` and makes that rich IR path the default for
85
89
  `normalize(parsed)`. Callers may still pass
86
90
  `normalize(parsed, { documentVersion: "1.0.0" })` explicitly. That path adds
@@ -153,6 +157,40 @@ Successful validation exits with code `0`; validation or normalization error
153
157
  diagnostics exit with code `1`. Validation JSON includes `profile`,
154
158
  `ruleResults`, `diagnostics`, and `evidence`.
155
159
 
160
+ Declarative validation compatibility is syntax-versioned. Existing v1 profiles
161
+ remain on the v1 result and evidence shape by keeping:
162
+
163
+ ```yaml
164
+ syntaxVersion: markdown-engine.validation@v1
165
+ ```
166
+
167
+ Conditional V2 behavior is selected only by an explicit v2 profile:
168
+
169
+ ```yaml
170
+ syntaxVersion: markdown-engine.validation@v2
171
+ rules:
172
+ - id: release.docs
173
+ anyOf:
174
+ - label: release-section
175
+ select:
176
+ target: section
177
+ title: Release
178
+ assert:
179
+ exists: true
180
+ - label: changelog-link
181
+ select:
182
+ target: link
183
+ text: changelog
184
+ assert:
185
+ exists: true
186
+ ```
187
+
188
+ CLI validation output uses `profile.syntaxVersion` as the v1/v2 discriminator.
189
+ V1 rule results keep the existing flat `ruleId`, `passed`, and `diagnostics`
190
+ fields. V2 rule results add `status` and `evaluation`; v2 profile metadata adds
191
+ `evaluatedRuleCount` and `skippedRuleCount` when the profile explicitly opts into
192
+ `markdown-engine.validation@v2`.
193
+
156
194
  Reader-facing declarative validation examples live under
157
195
  `fixtures/declarative-validation/examples/**`. From the repository or package
158
196
  root after building, run one passing and one intentionally failing example with:
@@ -165,17 +203,83 @@ node dist/cli/index.js validate --file fixtures/declarative-validation/examples/
165
203
  The passing example exits `0`; the failing example exits `1` and prints JSON
166
204
  diagnostics for review.
167
205
 
168
- Package 2.0 classifies the API normalization default as breaking for consumers
169
- that call `normalize(parsed)` and expect the legacy `0.0.0` shape. Migration is
170
- to either consume the rich IR fields (`target`, `sections`, `textSpans`,
171
- `tables`, `lists`, and `links`) or pin
172
- `normalize(parsed, { documentVersion: "0.0.0" })` until the downstream consumer
173
- is ready. The CLI already defaults to the rich IR document contract and keeps
206
+ ### OKF v0.1 example composition
207
+
208
+ The packaged OKF v0.1 examples show how callers can compose generic
209
+ declarative-validation primitives without making `markdown-engine` an OKF
210
+ adapter. The example profiles use `frontmatterShape` for role-specific
211
+ frontmatter checks, `textFormat` for `log.md` date headings, and
212
+ `validateDocumentSet` to aggregate caller-supplied Markdown/profile pairs.
213
+
214
+ The caller remains responsible for caller-owned path classification, bundle
215
+ traversal, IO, and profile selection. A caller-owned router should classify
216
+ non-reserved concept documents separately from reserved files:
217
+
218
+ - concept documents use `profiles/concept.yaml`, where `frontmatterShape`
219
+ requires a non-empty string `type`
220
+ - the bundle-root `index.md` uses `profiles/root-index.yaml`, which permits the
221
+ OKF version exception `okf_version: "0.1"`
222
+ - non-root `index.md` files use `profiles/non-root-index.yaml`, where
223
+ frontmatter is forbidden
224
+ - `log.md` uses `profiles/log.yaml`, where `textFormat` validates level-2 date
225
+ headings as real `YYYY-MM-DD` calendar dates
226
+
227
+ This package does not discover bundles, classify OKF paths, route roles for
228
+ callers, reject unknown concept types, check links, require optional
229
+ `index.md` files, or publish an OKF CLI.
230
+
231
+ ### Bundled CLI install for constrained agent harnesses
232
+
233
+ The package ships a single-file bundled CLI at
234
+ `dist-bundled/markdown-engine-cli.mjs`. Agent harnesses that forbid random
235
+ runtime package execution should install this artifact once and run it through a
236
+ local wrapper instead of using `npx`:
237
+
238
+ ```sh
239
+ scripts/install-markdown-engine-cli.sh
240
+ export PATH="${MARKDOWN_ENGINE_BIN_DIR:-$HOME/.local/bin}:$PATH"
241
+ ```
242
+
243
+ From a project root where the package is installed as a dependency, invoke the
244
+ packaged installer directly:
245
+
246
+ ```sh
247
+ node_modules/@jasonbelmonti/markdown-engine/scripts/install-markdown-engine-cli.sh
248
+ export PATH="${MARKDOWN_ENGINE_BIN_DIR:-$HOME/.local/bin}:$PATH"
249
+ ```
250
+
251
+ By default, the installer places the CLI under
252
+ `${MARKDOWN_ENGINE_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/markdown-engine}`
253
+ and writes the wrapper to
254
+ `${MARKDOWN_ENGINE_BIN_DIR:-$HOME/.local/bin}/markdown-engine`. The installer
255
+ uses a local bundled artifact only when it matches the pinned artifact hash.
256
+ Otherwise it downloads `@jasonbelmonti/markdown-engine@3.0.0` with `npm pack
257
+ --ignore-scripts` and extracts only
258
+ `package/dist-bundled/markdown-engine-cli.mjs` from the tarball. It verifies the
259
+ pinned artifact hash before installing:
260
+
261
+ ```text
262
+ f61ab59e28eb92cccf4fd8073c090102e67a9397a7f0d208661ded14b879053d
263
+ ```
264
+
265
+ The installed wrapper is:
266
+
267
+ ```sh
268
+ "${MARKDOWN_ENGINE_BIN_DIR:-$HOME/.local/bin}/markdown-engine" validate --file <file.md> --profile <profile.yaml> --format json
269
+ ```
270
+
271
+ Package 3.0 keeps the 2.0 API normalization default: callers that invoke
272
+ `normalize(parsed)` receive the rich IR `1.0.0` document shape. Consumers that
273
+ still need the legacy `0.0.0` shape should consume the rich IR fields
274
+ (`target`, `sections`, `textSpans`, `tables`, `lists`, and `links`) or pin
275
+ `normalize(parsed, { documentVersion: "0.0.0" })` until they are ready. The CLI
276
+ continues to default to the rich IR document contract and keeps
174
277
  `--document-version 0.0.0` for explicit legacy output.
175
278
 
176
- Contract references:
279
+ Package and contract references:
177
280
 
178
281
  - [Consumer website](https://jasonbelmonti.github.io/markdown-engine/)
282
+ - [Maintainer documentation map](docs/README.md)
179
283
  - [Public API contract](docs/contracts/api.md)
180
284
  - [Declarative validation contract](docs/contracts/declarative-validation.md)
181
285
  - [Frontmatter contract](docs/contracts/frontmatter.md)
@@ -186,61 +290,32 @@ Contract references:
186
290
 
187
291
  ## Validation
188
292
 
189
- Run the release-readiness gates from the repository root:
293
+ Run focused contract documentation gates from the repository root:
190
294
 
191
295
  ```sh
192
296
  npm run docs:rich-ir-contract
193
297
  npm run docs:declarative-validation-contract
194
298
  npm run audit:declarative-validation-boundary
299
+ ```
300
+
301
+ Run full release-readiness and publication dry-run gates only when preparing a
302
+ release, tag, package artifact, or publication decision:
303
+
304
+ ```sh
195
305
  npm run release:verify
196
306
  npm pack --dry-run
197
307
  npm publish --dry-run --access public
198
308
  ```
199
309
 
200
- Validation records include:
201
-
202
- - [EVD-6 rich IR contract docs](docs/evidence/wp-5-evd-6-rich-ir-contract.md)
203
- - [EVD-6 declarative validation repeatability](docs/evidence/wp-5-evd-6-declarative-validation-repeatability.md)
204
- - [EVD-7 declarative validation contract review](docs/evidence/wp-5-evd-7-declarative-validation-contract-review.md)
205
- - [EVD-8 declarative validation boundary audit](docs/evidence/wp-5-evd-8-declarative-validation-boundary-audit.md)
206
- - [BEL-986 declarative validation MS-2 approval](docs/evidence/bel-986-ms-2-approval.md)
207
- - [EVD-8 compatibility and CLI impact](docs/evidence/wp-5-evd-8-compatibility-cli-impact.md)
208
- - [EVD-9 1.0 downstream exercise](docs/evidence/wp-6-evd-9-downstream-exercise.md)
209
- - [EVD-10 declarative validation release-readiness handoff](docs/evidence/wp-6-evd-10-declarative-validation-release-readiness.md)
210
- - [EVD-10 1.0 release readiness](docs/evidence/wp-6-evd-10-release-readiness.md)
211
- - [EVD-7 release readiness](docs/evidence/wp-6-evd-7-release-readiness.md)
212
- - [EVD-9 merge readiness](docs/evidence/wp-6-evd-9-merge-readiness.md)
213
- - [EVD-10 rollback containment](docs/evidence/wp-6-evd-10-rollback-containment.md)
214
- - [EVD-11 downstream handoff](docs/evidence/wp-6-evd-11-downstream-handoff.md)
215
- - [BEL-1025 declarative validation example suite](docs/evidence/bel-1025-declarative-validation-example-suite.md)
310
+ The full maintainer and evidence index lives in
311
+ [docs/README.md](docs/README.md). The focused contract documentation gates
312
+ currently check these evidence records:
313
+
314
+ - [Rich IR contract documentation gate](docs/evidence/wp-5-evd-6-rich-ir-contract.md)
315
+ - [Declarative validation contract review](docs/evidence/wp-5-evd-7-declarative-validation-contract-review.md)
316
+ - [Declarative validation boundary audit](docs/evidence/wp-5-evd-8-declarative-validation-boundary-audit.md)
317
+ - [OKF validation seal evidence](docs/evidence/bel-1332-okf-release-readiness.md)
216
318
 
217
319
  Snapshot baseline updates are operational changes, not routine test-output
218
320
  cleanup. Use the [testing and snapshot operations](docs/testing.md) guide before
219
321
  updating files under `snapshots/**`.
220
-
221
- ## 2.0 Release Gate
222
-
223
- Do not tag or publish the 2.0 release until approval is recorded with:
224
-
225
- - semver classification distinguishing package version `2.0.0` from document
226
- contract version `1.0.0`
227
- - release/tag decision
228
- - rollback and containment notes
229
- - downstream profile/runtime consumer confirmation
230
- - complete evidence links from EVD-1 through EVD-11
231
-
232
- Current release decision: package `2.0.0` retains the public rich IR document
233
- contract at `documentVersion: "1.0.0"`, makes that contract the default API
234
- normalization output, and hardens declarative profile ingestion. The `v2.0.0`
235
- git tag must point only at a commit that passes the validation commands above.
236
-
237
- When 2.0 is approved, publish the package as:
238
-
239
- ```sh
240
- npm publish --access public
241
- ```
242
-
243
- The publish path is guarded by npm lifecycle scripts: `prepublishOnly` and
244
- `prepack` both run the release verification gate before `npm publish` or
245
- `npm pack` creates an artifact. The gate rebuilds `dist` and fails if tracked
246
- files drift from `HEAD`.
@@ -1,6 +1,7 @@
1
- export type MarkdownEngineApiName = "parse" | "normalize" | "validate" | "serialize" | "documentQueries" | "validateAnnotations" | "parseValidationProfile" | "validateWithProfile";
1
+ export type MarkdownEngineApiName = "parse" | "normalize" | "validate" | "serialize" | "documentQueries" | "validateAnnotations" | "parseValidationProfile" | "validateWithProfile" | "validateDocumentSet";
2
2
  export * from "./annotations.js";
3
3
  export * from "./declarative-validation.js";
4
+ export * from "./document-set-validation.js";
4
5
  export * from "./diagnostics.js";
5
6
  export * from "./document.js";
6
7
  export * from "./document-queries.js";
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/api/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,OAAO,GACP,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,GACxB,qBAAqB,CAAC;AAE1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/api/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,OAAO,GACP,WAAW,GACX,UAAU,GACV,WAAW,GACX,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,GACxB,qBAAqB,GACrB,qBAAqB,CAAC;AAE1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from "./annotations.js";
2
2
  export * from "./declarative-validation.js";
3
+ export * from "./document-set-validation.js";
3
4
  export * from "./diagnostics.js";
4
5
  export * from "./document.js";
5
6
  export * from "./document-queries.js";
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/api/contracts.ts"],"names":[],"mappings":"AAUA,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/api/contracts.ts"],"names":[],"mappings":"AAWA,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import type { EngineDocument } from "./document.js";
2
2
  import type { DeclarativeProfileParseOptions, DeclarativeProfileParseResult, JsonSafeValue, ValidationProfile } from "../declarative-validation/profile/index.js";
3
3
  import type { DeclarativeValidationOptions, DeclarativeValidationResult } from "../declarative-validation/results/index.js";
4
- export type { DeclarativeAssertion, DeclarativeIdSource, DeclarativeOutputFormat, DeclarativeProfileParseOptions, DeclarativeProfileParseResult, DeclarativeSectionOrder, DeclarativeSelector, DeclarativeTableCellPredicate, DeclarativeValidationRule, DeclarativeValidationSeverity, JsonSafeValue, ValidationProfile, } from "../declarative-validation/profile/index.js";
4
+ export type { DeclarativeAssertion, DeclarativeValidationApplicability, DeclarativeValidationAllOfRule, DeclarativeValidationAnyOfRule, DeclarativeValidationBranch, DeclarativeValidationFlatRule, DeclarativeFrontmatterFieldShape, DeclarativeFrontmatterPresence, DeclarativeFrontmatterShape, DeclarativeFrontmatterValueType, DeclarativeValidationGroupRule, DeclarativeValidationRuleFields, DeclarativeIdSource, DeclarativeOutputFormat, DeclarativeProfileParseOptions, DeclarativeProfileParseResult, DeclarativeSectionOrder, DeclarativeSelector, DeclarativeTableCellPredicate, DeclarativeTableColumnCoverage, DeclarativeTableColumnCoverageSource, DeclarativeTableColumnCoverageTarget, DeclarativeValidationRule, DeclarativeValidationSeverity, JsonSafeValue, ValidationProfile, } from "../declarative-validation/profile/index.js";
5
5
  export type { DeclarativeValidationEvidence } from "../declarative-validation/evidence/index.js";
6
- export type { DeclarativeValidationCliJsonResult, DeclarativeValidationConfigErrorResult, DeclarativeValidationOptions, DeclarativeValidationResult, } from "../declarative-validation/results/index.js";
6
+ export type { DeclarativeValidationAllOfEvaluationResult, DeclarativeValidationAnyOfEvaluationResult, DeclarativeValidationApplicabilityResult, DeclarativeValidationAssertionsEvaluationResult, DeclarativeValidationBranchReference, DeclarativeValidationBranchResult, DeclarativeValidationCliJsonResult, DeclarativeValidationConfigErrorResult, DeclarativeValidationOptions, DeclarativeValidationResultV1, DeclarativeValidationResultV2, DeclarativeValidationRuleEvaluationResult, DeclarativeValidationRuleResultV2, DeclarativeValidationRuleStatus, DeclarativeValidationSkippedEvaluationResult, DeclarativeValidationResult, } from "../declarative-validation/results/index.js";
7
7
  export interface DeclarativeValidationApi {
8
8
  parseValidationProfile(input: string | JsonSafeValue, options?: DeclarativeProfileParseOptions): DeclarativeProfileParseResult;
9
9
  validateWithProfile(document: EngineDocument, profile: ValidationProfile, options?: DeclarativeValidationOptions): DeclarativeValidationResult;
@@ -1 +1 @@
1
- {"version":3,"file":"declarative-validation.d.ts","sourceRoot":"","sources":["../../src/api/declarative-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAYpD,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,aAAa,EACb,iBAAiB,EAClB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,4CAA4C,CAAC;AAGpD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EACvB,mBAAmB,EACnB,6BAA6B,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,aAAa,EACb,iBAAiB,GAClB,MAAM,4CAA4C,CAAC;AACpD,YAAY,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AACjG,YAAY,EACV,kCAAkC,EAClC,sCAAsC,EACtC,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,4CAA4C,CAAC;AAEpD,MAAM,WAAW,wBAAwB;IACvC,sBAAsB,CACpB,KAAK,EAAE,MAAM,GAAG,aAAa,EAC7B,OAAO,CAAC,EAAE,8BAA8B,GACvC,6BAA6B,CAAC;IACjC,mBAAmB,CACjB,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,4BAA4B,GACrC,2BAA2B,CAAC;CAChC;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,aAAa,EAC7B,OAAO,GAAE,8BAAmC,GAC3C,6BAA6B,CAE/B;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,4BAAiC,GACzC,2BAA2B,CAoD7B"}
1
+ {"version":3,"file":"declarative-validation.d.ts","sourceRoot":"","sources":["../../src/api/declarative-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAkBpD,OAAO,KAAK,EACV,8BAA8B,EAC9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E,8BAAmC,GAC3C,6BAA6B,CAE/B;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,4BAAiC,GACzC,2BAA2B,CAgD7B"}
@@ -1,9 +1,9 @@
1
- import { cloneDiagnostics, hasErrorDiagnostic } from "../diagnostics/index.js";
2
- import { evaluateCompiledDeclarativeRule, sortValidationRuleResults, } from "../declarative-validation/assertions/index.js";
1
+ import { classifyCompiledDeclarativeRuleApplicability } from "../declarative-validation/applicability/index.js";
2
+ import { evaluateCompiledDeclarativeAllOfRule, evaluateCompiledDeclarativeAnyOfRule, evaluateCompiledDeclarativeRule, sortValidationRuleResults, } from "../declarative-validation/assertions/index.js";
3
3
  import { compileValidationProfile } from "../declarative-validation/compiler/index.js";
4
- import { createDeclarativeValidationEvidence } from "../declarative-validation/evidence/index.js";
5
4
  import { parseValidationProfileInput } from "../declarative-validation/profile/index.js";
6
5
  import { materializeValidationProfile } from "../declarative-validation/profile/materialization.js";
6
+ import { createDeclarativeValidationResult, createSkippedDeclarativeValidationRuleResult, } from "../declarative-validation/results/index.js";
7
7
  import { resolveDeclarativeSelector } from "../declarative-validation/selectors/index.js";
8
8
  export function parseValidationProfile(input, options = {}) {
9
9
  return parseValidationProfileInput(input, options);
@@ -11,40 +11,69 @@ export function parseValidationProfile(input, options = {}) {
11
11
  export function validateWithProfile(document, profile, options = {}) {
12
12
  const materializedProfile = materializeValidationProfile(profile, document.version);
13
13
  if (materializedProfile.diagnostics.length > 0) {
14
- return validationResult(document, materializedProfile.profile, [], materializedProfile.diagnostics, options);
14
+ return createDeclarativeValidationResult({
15
+ document,
16
+ profile: materializedProfile.profile,
17
+ ruleResults: [],
18
+ diagnostics: materializedProfile.diagnostics,
19
+ options,
20
+ });
15
21
  }
16
22
  const profileDocumentVersion = materializedProfile.profile.documentVersion ?? document.version;
17
23
  const versionDiagnostics = profileDocumentVersion === document.version
18
24
  ? []
19
25
  : [documentVersionMismatchDiagnostic(profileDocumentVersion, document.version)];
20
26
  if (versionDiagnostics.length > 0) {
21
- return validationResult(document, materializedProfile.profile, [], versionDiagnostics, options);
27
+ return createDeclarativeValidationResult({
28
+ document,
29
+ profile: materializedProfile.profile,
30
+ ruleResults: [],
31
+ diagnostics: versionDiagnostics,
32
+ options,
33
+ });
22
34
  }
23
35
  const compileResult = compileValidationProfile(materializedProfile.profile);
24
- const ruleResults = sortValidationRuleResults(compileResult.plan?.rules.map((rule) => evaluateCompiledDeclarativeRule(rule, resolveDeclarativeSelector(document, rule.selector))) ?? []);
36
+ const compiledRules = compileResult.plan?.rules ?? [];
37
+ const ruleResults = sortValidationRuleResults(compiledRules.flatMap((rule) => evaluateApplicableCompiledRule(document, rule)));
25
38
  const diagnostics = [
26
39
  ...compileResult.diagnostics,
27
40
  ...ruleResults.flatMap((result) => result.diagnostics),
28
41
  ];
29
- return validationResult(document, materializedProfile.profile, ruleResults, diagnostics, options);
42
+ return createDeclarativeValidationResult({
43
+ document,
44
+ profile: materializedProfile.profile,
45
+ ruleResults,
46
+ diagnostics,
47
+ options,
48
+ });
30
49
  }
31
- function validationResult(document, profile, ruleResults, diagnostics, options) {
32
- const result = {
33
- valid: !hasErrorDiagnostic(diagnostics),
34
- diagnostics: cloneDiagnostics(diagnostics),
35
- ruleResults: cloneRuleResults(ruleResults),
36
- profile: {
37
- syntaxVersion: profile.syntaxVersion,
38
- documentVersion: profile.documentVersion ?? document.version,
39
- ruleCount: profile.rules.length,
40
- },
41
- };
42
- return options.includeEvidence === true
43
- ? {
44
- ...result,
45
- evidence: createDeclarativeValidationEvidence(document, profile, ruleResults, diagnostics),
46
- }
47
- : result;
50
+ function evaluateApplicableCompiledRule(document, rule) {
51
+ const applicability = classifyCompiledDeclarativeRuleApplicability(rule, document);
52
+ return applicability.status === "notMatched"
53
+ ? [
54
+ createSkippedDeclarativeValidationRuleResult({
55
+ ruleId: rule.ruleId,
56
+ when: applicability.result,
57
+ }),
58
+ ]
59
+ : evaluateCompiledRule(document, rule);
60
+ }
61
+ function evaluateCompiledRule(document, rule) {
62
+ if (isCompiledAnyOfRule(rule)) {
63
+ return [evaluateCompiledDeclarativeAnyOfRule(rule, document)];
64
+ }
65
+ if (isCompiledAllOfRule(rule)) {
66
+ return [evaluateCompiledDeclarativeAllOfRule(rule, document)];
67
+ }
68
+ return [
69
+ evaluateCompiledDeclarativeRule(rule, resolveDeclarativeSelector(document, rule.selector)),
70
+ ];
71
+ }
72
+ function isCompiledAnyOfRule(rule) {
73
+ return "kind" in rule && rule.kind === "anyOf";
74
+ }
75
+ function isCompiledAllOfRule(rule) {
76
+ return "kind" in rule && rule.kind === "allOf";
48
77
  }
49
78
  function documentVersionMismatchDiagnostic(profileDocumentVersion, documentVersion) {
50
79
  return {
@@ -53,11 +82,4 @@ function documentVersionMismatchDiagnostic(profileDocumentVersion, documentVersi
53
82
  severity: "error",
54
83
  };
55
84
  }
56
- function cloneRuleResults(ruleResults) {
57
- return ruleResults.map((result) => ({
58
- ruleId: result.ruleId,
59
- passed: result.passed,
60
- diagnostics: cloneDiagnostics(result.diagnostics),
61
- }));
62
- }
63
85
  //# sourceMappingURL=declarative-validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"declarative-validation.js","sourceRoot":"","sources":["../../src/api/declarative-validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AAWpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAo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AM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAC,WAAW,CAAC;KAClD,CAAC,CAAC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"declarative-validation.js","sourceRoot":"","sources":["../../src/api/declarative-validation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4CAA4C,EAAE,MAAM,kDAAkD,CAAC;AAChH,OAAO,EACL,oCAAoC,EACpC,oCAAoC,EACpC,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAMvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AAOpG,OAAO,EACL,iCAAiC,EACjC,4CAA4C,GAC7C,MAAM,4CAA4C,CAAC;AAKpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AA8D1F,MAAM,UAAU,sBAAsB,CACpC,KAA6B,EAC7B,UAA0C,EAAE;IAE5C,OAAO,2BAA2B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,QAAwB,EACxB,OAA0B,EAC1B,UAAwC,EAAE;IAE1C,MAAM,mBAAmB,GAAG,4BAA4B,CACtD,OAAO,EACP,QAAQ,CAAC,OAAO,CACjB,CAAC;IACF,IAAI,mBAAmB,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/C,OAAO,iCAAiC,CAAC;YACvC,QAAQ;YACR,OAAO,EAAE,mBAAmB,CAAC,OAAO;YACpC,WAAW,EAAE,EAAE;YACf,WAAW,EAAE,mBAAmB,CAAC,WAAW;YAC5C,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED,MAAM,sBAAsB,GAC1B,mBAAmB,CAAC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C;gBAC3C,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,aAAa,CAAC,MAAM;aAC3B,CAAC;SACH;QACH,CAAC,CAAC,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,oBAAoB,CAC3B,QAAwB,EACxB,IAAuC;IAEvC,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,oCAAoC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,oCAAoC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO;QACL,+BAA+B,CAC7B,IAAI,EACJ,0BAA0B,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CACpD;KACF,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAAuC;IAEvC,OAAO,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;AACjD,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAAuC;IAEvC,OAAO,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;AACjD,CAAC;AAED,SAAS,iCAAiC,CACxC,sBAAiD,EACjD,eAA0C;IAE1C,OAAO;QACL,IAAI,EAAE,wCAAwC;QAC9C,OAAO,EAAE,4BAA4B,sBAAsB,sCAAsC,eAAe,IAAI;QACpH,QAAQ,EAAE,OAAgB;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { DeclarativeValidationOptions, DeclarativeValidationResult, JsonSafeValue, ValidationProfile } from "./declarative-validation.js";
2
+ import type { MarkdownDiagnostic } from "./diagnostics.js";
3
+ import type { NormalizeOptions } from "./normalize.js";
4
+ export type ValidateDocumentSetProfileInput = string | JsonSafeValue | ValidationProfile;
5
+ export interface ValidateDocumentSetEntry {
6
+ path: string;
7
+ markdown: string;
8
+ profile: ValidateDocumentSetProfileInput;
9
+ profilePath?: string;
10
+ }
11
+ export interface ValidateDocumentSetOptions {
12
+ documentVersion?: NormalizeOptions["documentVersion"];
13
+ preserveSourceLocations?: NormalizeOptions["preserveSourceLocations"];
14
+ includeEvidence?: DeclarativeValidationOptions["includeEvidence"];
15
+ }
16
+ export interface ValidateDocumentSetEntryResult {
17
+ path: string;
18
+ profilePath?: string;
19
+ diagnostics: MarkdownDiagnostic[];
20
+ parseDiagnostics: MarkdownDiagnostic[];
21
+ normalizationDiagnostics: MarkdownDiagnostic[];
22
+ profileDiagnostics: MarkdownDiagnostic[];
23
+ validationDiagnostics: MarkdownDiagnostic[];
24
+ validationResult?: DeclarativeValidationResult;
25
+ }
26
+ export interface ValidateDocumentSetResult {
27
+ valid: boolean;
28
+ diagnostics: MarkdownDiagnostic[];
29
+ entries: ValidateDocumentSetEntryResult[];
30
+ }
31
+ export type ValidateDocumentSetFunction = (entries: readonly ValidateDocumentSetEntry[], options?: ValidateDocumentSetOptions) => ValidateDocumentSetResult;
32
+ //# sourceMappingURL=document-set-validation-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-set-validation-types.d.ts","sourceRoot":"","sources":["../../src/api/document-set-validation-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,+BAA+B,GACvC,MAAM,GACN,aAAa,GACb,iBAAiB,CAAC;AAEtB,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,+BAA+B,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACtD,uBAAuB,CAAC,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAC;IACtE,eAAe,CAAC,EAAE,4BAA4B,CAAC,iBAAiB,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;IACvC,wBAAwB,EAAE,kBAAkB,EAAE,CAAC;IAC/C,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;IACzC,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;IAC5C,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;CAChD;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,OAAO,EAAE,8BAA8B,EAAE,CAAC;CAC3C;AAED,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,SAAS,wBAAwB,EAAE,EAC5C,OAAO,CAAC,EAAE,0BAA0B,KACjC,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=document-set-validation-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-set-validation-types.js","sourceRoot":"","sources":["../../src/api/document-set-validation-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { ValidateDocumentSetFunction } from "./document-set-validation-types.js";
2
+ export type { ValidateDocumentSetEntry, ValidateDocumentSetEntryResult, ValidateDocumentSetFunction, ValidateDocumentSetOptions, ValidateDocumentSetProfileInput, ValidateDocumentSetResult, } from "./document-set-validation-types.js";
3
+ export declare const validateDocumentSet: ValidateDocumentSetFunction;
4
+ //# sourceMappingURL=document-set-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-set-validation.d.ts","sourceRoot":"","sources":["../../src/api/document-set-validation.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAGV,2BAA2B,EAG5B,MAAM,oCAAoC,CAAC;AAG5C,YAAY,EACV,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAE5C,eAAO,MAAM,mBAAmB,EAAE,2BAgBjC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { parseValidationProfile, validateWithProfile, } from "./declarative-validation.js";
2
+ import { normalize } from "./normalize.js";
3
+ import { parse } from "./parse.js";
4
+ import { cloneDiagnostics, hasErrorDiagnostic } from "../diagnostics/index.js";
5
+ export const validateDocumentSet = (entries, options = {}) => {
6
+ const entryResults = entries.map((entry) => validateDocumentSetEntry(entry, options));
7
+ const diagnostics = cloneDiagnostics(entryResults.flatMap((entry) => entry.diagnostics));
8
+ return {
9
+ valid: !hasErrorDiagnostic(diagnostics),
10
+ diagnostics,
11
+ entries: entryResults,
12
+ };
13
+ };
14
+ function validateDocumentSetEntry(entry, options) {
15
+ const parseResult = parse(entry.markdown, { path: entry.path });
16
+ const normalizeResult = normalize(parseResult.parsed, normalizeOptions(options));
17
+ const profileResult = parseValidationProfile(profileParserInput(entry.profile), {
18
+ ...(entry.profilePath !== undefined ? { path: entry.profilePath } : {}),
19
+ });
20
+ let validationResult;
21
+ if (profileResult.profile !== undefined &&
22
+ !hasErrorDiagnostic(profileResult.diagnostics)) {
23
+ validationResult = validateWithProfile(normalizeResult.document, profileResult.profile, {
24
+ path: entry.path,
25
+ ...(options.includeEvidence !== undefined
26
+ ? { includeEvidence: options.includeEvidence }
27
+ : {}),
28
+ });
29
+ }
30
+ const validationDiagnostics = validationResult === undefined ? [] : validationResult.diagnostics;
31
+ const diagnostics = cloneDiagnostics([
32
+ ...normalizeResult.diagnostics,
33
+ ...profileResult.diagnostics,
34
+ ...validationDiagnostics,
35
+ ]);
36
+ return {
37
+ path: entry.path,
38
+ ...(entry.profilePath !== undefined ? { profilePath: entry.profilePath } : {}),
39
+ diagnostics,
40
+ parseDiagnostics: cloneDiagnostics(parseResult.diagnostics),
41
+ normalizationDiagnostics: cloneDiagnostics(normalizeResult.diagnostics),
42
+ profileDiagnostics: cloneDiagnostics(profileResult.diagnostics),
43
+ validationDiagnostics: cloneDiagnostics(validationDiagnostics),
44
+ ...(validationResult !== undefined ? { validationResult } : {}),
45
+ };
46
+ }
47
+ function normalizeOptions(options) {
48
+ return {
49
+ ...(options.documentVersion !== undefined
50
+ ? { documentVersion: options.documentVersion }
51
+ : {}),
52
+ ...(options.preserveSourceLocations !== undefined
53
+ ? { preserveSourceLocations: options.preserveSourceLocations }
54
+ : {}),
55
+ };
56
+ }
57
+ function profileParserInput(input) {
58
+ return input;
59
+ }
60
+ //# sourceMappingURL=document-set-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-set-validation.js","sourceRoot":"","sources":["../../src/api/document-set-validation.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAQnC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAW/E,MAAM,CAAC,MAAM,mBAAmB,GAAgC,CAC9D,OAAO,EACP,OAAO,GAAG,EAAE,EACZ,EAAE;IACF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACzC,wBAAwB,CAAC,KAAK,EAAE,OAAO,CAAC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ompatibilityMode } from "./compatibility.js";
2
+ import type { ValidateDocumentSetResult } from "./document-set-validation-types.js";
2
3
  import type { SerializableEngineResult } from "./document.js";
3
4
  import type { NormalizeResult } from "./normalize.js";
4
5
  import type { ParseResult } from "./parse.js";
5
6
  import type { ValidationResult } from "./validate.js";
6
- export type SerializableMarkdownEngineResult = ParseResult | NormalizeResult | ValidationResult | SerializableEngineResult;
7
+ export type SerializableMarkdownEngineResult = ParseResult | NormalizeResult | ValidateDocumentSetResult | ValidationResult | SerializableEngineResult;
7
8
  export { EngineCompatibilityError, type EngineCompatibilityMode, } from "./compatibility.js";
8
9
  export interface SerializeOptions {
9
10
  pretty?: boolean;