@agentshouse/mdmodel 0.1.0-alpha.8 → 0.1.0-c83456e1cebfb

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 (205) hide show
  1. package/API.md +298 -0
  2. package/README.md +29 -172
  3. package/dist/blocks.d.ts +11 -0
  4. package/dist/blocks.d.ts.map +1 -0
  5. package/dist/blocks.js +62 -0
  6. package/dist/definition.d.ts +15 -9
  7. package/dist/definition.d.ts.map +1 -1
  8. package/dist/definition.js +148 -133
  9. package/dist/divide.d.ts +3 -0
  10. package/dist/divide.d.ts.map +1 -0
  11. package/dist/divide.js +310 -0
  12. package/dist/document.d.ts +2 -0
  13. package/dist/document.d.ts.map +1 -1
  14. package/dist/document.js +89 -120
  15. package/dist/fields.d.ts +4 -0
  16. package/dist/fields.d.ts.map +1 -0
  17. package/dist/fields.js +3 -0
  18. package/dist/index.d.ts +6 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +4 -3
  21. package/dist/links.d.ts +1 -0
  22. package/dist/links.d.ts.map +1 -1
  23. package/dist/links.js +618 -224
  24. package/dist/paths.d.ts +2 -3
  25. package/dist/paths.d.ts.map +1 -1
  26. package/dist/paths.js +27 -37
  27. package/dist/profile.js +1 -3
  28. package/dist/project.d.ts +19 -1
  29. package/dist/project.d.ts.map +1 -1
  30. package/dist/project.js +83 -73
  31. package/dist/refuse.d.ts.map +1 -1
  32. package/dist/refuse.js +2 -10
  33. package/dist/schema.d.ts +2 -1
  34. package/dist/schema.d.ts.map +1 -1
  35. package/dist/schema.js +22 -33
  36. package/dist/sections.d.ts +2 -1
  37. package/dist/sections.d.ts.map +1 -1
  38. package/dist/sections.js +45 -67
  39. package/dist/types.d.ts +30 -2
  40. package/dist/types.d.ts.map +1 -1
  41. package/dist/types.js +1 -3
  42. package/dist/validate.d.ts +3 -2
  43. package/dist/validate.d.ts.map +1 -1
  44. package/dist/validate.js +145 -122
  45. package/dist/version.d.ts +1 -1
  46. package/dist/version.d.ts.map +1 -1
  47. package/dist/version.js +1 -3
  48. package/dist/yaml.d.ts +1 -0
  49. package/dist/yaml.d.ts.map +1 -1
  50. package/dist/yaml.js +196 -187
  51. package/fixtures/README.md +77 -52
  52. package/fixtures/cases/binary-any-reference/expected.json +0 -1
  53. package/fixtures/cases/binary-any-reference/schema.yaml +4 -0
  54. package/fixtures/cases/binary-document-collision/expected.json +1 -2
  55. package/fixtures/cases/binary-document-collision/schema.yaml +2 -0
  56. package/fixtures/cases/binary-link-outside-collection/expected.json +1 -2
  57. package/fixtures/cases/binary-link-outside-collection/schema.yaml +2 -0
  58. package/fixtures/cases/binary-prototype-reference/expected.json +0 -1
  59. package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -0
  60. package/fixtures/cases/binary-typed-reference/expected.json +0 -1
  61. package/fixtures/cases/binary-typed-reference/schema.yaml +5 -0
  62. package/fixtures/cases/bracketed-link-definition/schema.yaml +6 -0
  63. package/fixtures/cases/declared-binary-links/schema.yaml +2 -0
  64. package/fixtures/cases/duplicate-link-definition/schema.yaml +6 -0
  65. package/fixtures/cases/fenced-link-definition/schema.yaml +6 -0
  66. package/fixtures/cases/field-enum/expected.json +1 -2
  67. package/fixtures/cases/field-enum/schema.yaml +7 -0
  68. package/fixtures/cases/frontmatter-schema/expected.json +5 -0
  69. package/fixtures/cases/frontmatter-schema/schema.yaml +6 -0
  70. package/fixtures/cases/interrupted-link-definition/schema.yaml +2 -0
  71. package/fixtures/cases/long-fence-link-definition/schema.yaml +2 -0
  72. package/fixtures/cases/malformed-definition/expected.json +2 -4
  73. package/fixtures/cases/malformed-definition/schema.yaml +4 -0
  74. package/fixtures/cases/member-document/context.json +1 -0
  75. package/fixtures/cases/member-document/library/people/ana.md +5 -0
  76. package/fixtures/cases/member-document/schema.yaml +5 -0
  77. package/fixtures/cases/missing-binary-image/expected.json +1 -2
  78. package/fixtures/cases/missing-binary-image/schema.yaml +2 -0
  79. package/fixtures/cases/missing-binary-link/expected.json +1 -2
  80. package/fixtures/cases/missing-binary-link/schema.yaml +2 -0
  81. package/fixtures/cases/missing-required-field/expected.json +1 -2
  82. package/fixtures/cases/missing-required-field/schema.yaml +7 -0
  83. package/fixtures/cases/missing-section-item-kind/context.json +1 -0
  84. package/fixtures/cases/missing-section-item-kind/expected.json +5 -0
  85. package/fixtures/cases/missing-section-item-kind/schema.yaml +6 -0
  86. package/fixtures/cases/paragraph-link-definition/schema.yaml +2 -0
  87. package/fixtures/cases/prototype-field/context.json +1 -0
  88. package/fixtures/cases/prototype-field/expected.json +6 -0
  89. package/fixtures/cases/prototype-field/library/item.md +9 -0
  90. package/fixtures/cases/prototype-field/schema.yaml +6 -0
  91. package/fixtures/cases/quoted-link-definition/expected.json +1 -2
  92. package/fixtures/cases/quoted-link-definition/schema.yaml +2 -0
  93. package/fixtures/cases/referenced-missing-file/expected.json +0 -1
  94. package/fixtures/cases/referenced-missing-file/schema.yaml +10 -0
  95. package/fixtures/cases/second-member-document/context.json +1 -0
  96. package/fixtures/cases/second-member-document/expected.json +5 -0
  97. package/fixtures/cases/second-member-document/schema.yaml +5 -0
  98. package/fixtures/cases/section-item-enum/context.json +1 -0
  99. package/fixtures/cases/section-item-enum/expected.json +6 -0
  100. package/fixtures/cases/section-item-enum/library/task.md +8 -0
  101. package/fixtures/cases/section-item-enum/schema.yaml +4 -0
  102. package/fixtures/cases/section-item-kind/context.json +1 -0
  103. package/fixtures/cases/section-item-kind/expected.json +6 -0
  104. package/fixtures/cases/section-item-kind/library/task.md +8 -0
  105. package/fixtures/cases/section-item-kind/schema.yaml +4 -0
  106. package/fixtures/cases/section-items/context.json +1 -0
  107. package/fixtures/cases/section-items/expected.json +1 -0
  108. package/fixtures/cases/section-items/library/other.md +3 -0
  109. package/fixtures/cases/section-items/library/page.md +28 -0
  110. package/fixtures/cases/section-items/schema.yaml +8 -0
  111. package/fixtures/cases/section-reference-path/context.json +1 -0
  112. package/fixtures/cases/section-reference-path/expected.json +6 -0
  113. package/fixtures/cases/section-reference-path/library/other.md +3 -0
  114. package/fixtures/cases/section-reference-path/library/page.md +7 -0
  115. package/fixtures/cases/section-reference-path/schema.yaml +4 -0
  116. package/fixtures/cases/section-reference-type/context.json +1 -0
  117. package/fixtures/cases/section-reference-type/expected.json +6 -0
  118. package/fixtures/cases/section-reference-type/library/note.md +1 -0
  119. package/fixtures/cases/section-reference-type/library/page.md +7 -0
  120. package/fixtures/cases/section-reference-type/schema.yaml +4 -0
  121. package/fixtures/cases/shortcut-reference-link/context.json +1 -0
  122. package/fixtures/cases/shortcut-reference-link/expected.json +5 -0
  123. package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
  124. package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -0
  125. package/fixtures/cases/structured-section/expected.json +1 -2
  126. package/fixtures/cases/structured-section/schema.yaml +7 -0
  127. package/fixtures/cases/submission-keys/context.json +1 -0
  128. package/fixtures/cases/submission-keys/expected.json +1 -0
  129. package/fixtures/cases/submission-keys/library/notes/visitor.md +8 -0
  130. package/fixtures/cases/submission-keys/schema.yaml +4 -0
  131. package/fixtures/cases/text-field-kind/context.json +1 -0
  132. package/fixtures/cases/text-field-kind/expected.json +6 -0
  133. package/fixtures/cases/text-field-kind/library/page.md +4 -0
  134. package/fixtures/cases/text-field-kind/schema.yaml +4 -0
  135. package/fixtures/cases/truncated-link-definition/expected.json +1 -2
  136. package/fixtures/cases/truncated-link-definition/schema.yaml +2 -0
  137. package/fixtures/cases/types-folder-content/context.json +1 -0
  138. package/fixtures/cases/types-folder-content/expected.json +1 -0
  139. package/fixtures/cases/types-folder-content/library/types/task.md +4 -0
  140. package/fixtures/cases/types-folder-content/schema.yaml +4 -0
  141. package/fixtures/cases/unclosed-frontmatter/expected.json +1 -2
  142. package/fixtures/cases/undeclared-field/context.json +1 -0
  143. package/fixtures/cases/undeclared-field/expected.json +6 -0
  144. package/fixtures/cases/undeclared-field/library/item.md +9 -0
  145. package/fixtures/cases/undeclared-field/schema.yaml +6 -0
  146. package/fixtures/cases/unknown-type/context.json +1 -0
  147. package/fixtures/cases/unknown-type/expected.json +6 -0
  148. package/fixtures/cases/unknown-type/library/item.md +3 -0
  149. package/fixtures/cases/unknown-type/schema.yaml +4 -0
  150. package/fixtures/cases/unlisted-reference-type/context.json +1 -0
  151. package/fixtures/cases/unlisted-reference-type/expected.json +5 -0
  152. package/fixtures/cases/unlisted-reference-type/schema.yaml +4 -0
  153. package/fixtures/cases/unresolved-link/expected.json +1 -2
  154. package/fixtures/cases/unresolved-link/schema.yaml +6 -0
  155. package/fixtures/cases/valid-typed-document/library/tasks/one.md +1 -0
  156. package/fixtures/cases/valid-typed-document/schema.yaml +15 -0
  157. package/fixtures/cases/wide-item-fence-link/schema.yaml +2 -0
  158. package/fixtures/division.json +409 -0
  159. package/fixtures/projection.json +77 -28
  160. package/package.json +3 -12
  161. package/dist/definition.js.map +0 -1
  162. package/dist/document.js.map +0 -1
  163. package/dist/index.js.map +0 -1
  164. package/dist/links.js.map +0 -1
  165. package/dist/paths.js.map +0 -1
  166. package/dist/profile.js.map +0 -1
  167. package/dist/project.js.map +0 -1
  168. package/dist/refuse.js.map +0 -1
  169. package/dist/schema.js.map +0 -1
  170. package/dist/sections.js.map +0 -1
  171. package/dist/types.js.map +0 -1
  172. package/dist/validate.js.map +0 -1
  173. package/dist/version.js.map +0 -1
  174. package/dist/yaml.js.map +0 -1
  175. package/fixtures/cases/binary-any-reference/library/types/note.md +0 -5
  176. package/fixtures/cases/binary-document-collision/library/types/note.md +0 -3
  177. package/fixtures/cases/binary-link-outside-collection/library/types/note.md +0 -3
  178. package/fixtures/cases/binary-prototype-reference/library/types/note.md +0 -5
  179. package/fixtures/cases/binary-typed-reference/library/types/note.md +0 -5
  180. package/fixtures/cases/binary-typed-reference/library/types/person.md +0 -3
  181. package/fixtures/cases/bracketed-link-definition/library/types/task.md +0 -7
  182. package/fixtures/cases/declared-binary-links/library/types/note.md +0 -3
  183. package/fixtures/cases/duplicate-link-definition/library/types/task.md +0 -7
  184. package/fixtures/cases/fenced-link-definition/library/types/task.md +0 -7
  185. package/fixtures/cases/field-enum/library/types/task.md +0 -8
  186. package/fixtures/cases/interrupted-link-definition/library/types/note.md +0 -3
  187. package/fixtures/cases/long-fence-link-definition/library/types/note.md +0 -3
  188. package/fixtures/cases/malformed-definition/library/types/task.md +0 -5
  189. package/fixtures/cases/missing-binary-image/library/types/note.md +0 -3
  190. package/fixtures/cases/missing-binary-link/library/types/note.md +0 -3
  191. package/fixtures/cases/missing-required-field/library/types/task.md +0 -8
  192. package/fixtures/cases/paragraph-link-definition/library/types/note.md +0 -3
  193. package/fixtures/cases/prd-definition/library/types/task.md +0 -15
  194. package/fixtures/cases/quoted-link-definition/library/types/note.md +0 -3
  195. package/fixtures/cases/referenced-missing-file/library/types/person.md +0 -5
  196. package/fixtures/cases/referenced-missing-file/library/types/task.md +0 -8
  197. package/fixtures/cases/structured-section/library/types/task.md +0 -8
  198. package/fixtures/cases/truncated-link-definition/library/types/note.md +0 -3
  199. package/fixtures/cases/unresolved-link/library/types/task.md +0 -7
  200. package/fixtures/cases/valid-typed-document/library/types/person.md +0 -5
  201. package/fixtures/cases/valid-typed-document/library/types/task.md +0 -12
  202. package/fixtures/cases/wide-item-fence-link/library/types/note.md +0 -3
  203. package/markdown-syntax-profile.md +0 -9
  204. /package/fixtures/cases/{prd-definition → frontmatter-schema}/context.json +0 -0
  205. /package/fixtures/cases/{prd-definition → member-document}/expected.json +0 -0
@@ -2,10 +2,13 @@
2
2
 
3
3
  Each directory under `cases/` is one text Library, one validation context,
4
4
  and one expected verdict. Consumers load the files under `library/` as
5
- path-to-content, load the required `context.json` as `ValidationContext`, and
6
- compare `validate(library, context)` against `expected.json`. Text-only cases
7
- carry `{ "binaryTargets": [] }`. Binary targets are membership declarations;
8
- the corpus supplies no binary bytes or placeholder Documents.
5
+ path-to-content, an absent `library/` being the empty Library, and the
6
+ required `context.json` as `ValidationContext`. Cases with a `schema.yaml` call
7
+ `verify` with its text, then compare its refusal or
8
+ `validate(library, context, verified.model)` against `expected.json`. Other
9
+ cases compare `validate(library, context)` directly. Text-only cases carry
10
+ `{ "binaryTargets": [] }`. Binary targets are membership declarations; the
11
+ corpus supplies no binary bytes or placeholder Documents.
9
12
 
10
13
  ## Preamble operations
11
14
 
@@ -15,29 +18,48 @@ the validation Libraries. Each row carries `name`, exact `source`, expected
15
18
  the source, compare `Document.preamble`, apply
16
19
  `{ kind: 'preamble', prior: preamble, value }`, and compare the serialized result.
17
20
  These cases cover empty and heading-free Documents, frontmatter boundaries,
18
- fenced headings, newline/source preservation, and the Runtime moved-export
19
- example from its [approved candidate](https://github.com/agentshouse/mdruntime/blob/ed0a6f0b95317d9ade846ec1f2871a3997519bc4/test/rooms.ts).
20
- The package check runs every row in ESM, CommonJS, and the browser-target VM
21
- bundle, also checking stale priors, immutable Documents, and conversion of the
22
- Runtime link rewrite into a preamble operation through public APIs.
21
+ fenced headings, newline/source preservation, and a moved-export link rewrite.
23
22
 
24
23
  ## Projection
25
24
 
26
25
  `projection.json` exercises the public `project` seam separately from the
27
- validation Libraries. It carries `definitions`, the MD Type definition sources
28
- keyed by a label, and `cases`. Each case carries `name`, the `file` the Document
29
- sits at, exact `source`, the `documentTargets` the collection holds as Markdown
30
- documents, the `definition` label or `null`, an optional `move`, and `expected`.
26
+ validation Libraries. It carries `schema`, one schema text, and `cases`. Each
27
+ case carries `name`, the `file` the Document sits at, exact `source`, the
28
+ `documentTargets` the collection holds as Markdown documents, the `definition`
29
+ type name or `null`, an optional `move`, an optional `links` inventory, an
30
+ optional `relabel`, and `expected`.
31
31
  A case carrying a `move` lists both the Path its target sits at and the Path the
32
32
  move takes it to, because the collection holds that target either way.
33
33
 
34
- Parse the source, call `project(document, file, context)` with
35
- `{ documentTargets, definition }`, and compare against `expected`, replacing the
36
- `<package-version>` token in a refusal the same way `cases/` does. Then check
34
+ Verify the schema, parse the source, call `project(document, file, context)`
35
+ with `documentTargets` and the verified type `definition` names, and compare against `expected`. Where
36
+ `links` is present, compare `links(document, file)` against it. Then check
37
37
  that the source is unchanged. Where `move` is present, apply
38
38
  `{ kind: 'link', href, to }`, confirm the serialized Document changed, and
39
39
  confirm the projection of the moved Document is still exactly `expected`: a
40
- moved Path rewrites destinations and leaves the projection alone.
40
+ moved Path rewrites destinations and leaves the projection alone. Where
41
+ `relabel` is present, split the source at its `from`, which the source carries
42
+ exactly once, join the pieces with its `to`, parse the result, and confirm its
43
+ projection is exactly the relabel's own `expected` and differs from the case's:
44
+ a changed visible label changes the projection.
45
+
46
+ ## Division
47
+
48
+ `division.json` exercises the public `divide` seam separately from the
49
+ validation Libraries. It carries `schema` and `cases` like `projection.json`,
50
+ and each case adds the `budget` the division runs under. Parse the source, call
51
+ `divide(document, file, context)` with `{ documentTargets, definition, budget }`,
52
+ and compare against `expected`: either `{ "ok": true, "spans": [...] }`, where
53
+ each span carries the exact `text` to embed and the exact `source` the returned
54
+ `start` and `end` address in that case's source, or `{ "ok": false, "refusal": ... }`. Then
55
+ check that the source is unchanged. A span's `text` and `source` differ where
56
+ the embedded text repeats a continuation's own heading, carries an internal
57
+ link's visible label, or carries a frontmatter value without the quotes the
58
+ author wrote, and where the addressed extent encloses a declared structured
59
+ section between two pieces one span packs together or the whole of a free-text
60
+ value one span carries part of. `start` and `end` are UTF-8 byte offsets into the case's
61
+ source; every source in this corpus is ASCII, so a consumer compares the
62
+ addressed `source` with an ordinary string slice.
41
63
 
42
64
  ## Verdict format
43
65
 
@@ -55,51 +77,54 @@ Refusal:
55
77
  "file": "<library path>",
56
78
  "location": "<field or section name>",
57
79
  "rule": "<rule id>",
58
- "version": "<package version>",
59
80
  "referrers": ["<library path>"]
60
81
  }
61
82
  ```
62
83
 
63
84
  `location` is omitted when the rule is not about a field or section.
64
- `referrers` is present only for `referenced-missing-file`.
65
- The `version` field in these fixtures is the token `<package-version>`;
66
- replace it with the package's semantic version before comparing.
85
+ `referrers` is present only for `referenced-missing-file`. A schema refusal
86
+ carries no `file`; its `location`, when present, is the dotted path of the
87
+ schema part it concerns, such as `types.task.fields.title`, or `line <n>` for
88
+ `schema-yaml`.
67
89
 
68
90
  ## Rule ids
69
91
 
70
- | Rule | When |
71
- | ------------------------- | ---------------------------------------------------------------------- |
72
- | `binary-target-document` | A path is declared as both a text Document and a binary target |
73
- | `frontmatter-fence` | A present frontmatter fence does not parse as the accepted YAML subset |
74
- | `definition-type` | A `types/` file is not a definition, or its type name is empty |
75
- | `definition-shape` | A definition carries a key other than `type`, `fields`, and `sections` |
76
- | `definition-fields` | `fields` is not a mapping |
77
- | `definition-field` | A field spec is not an object of the accepted keys |
78
- | `definition-field-kind` | A field kind is not string, number, date, enum, reference, or list |
79
- | `definition-enum-values` | An enum field has no non-empty string `values` |
80
- | `definition-reference-to` | A reference field has no non-empty `to` type name |
81
- | `definition-list-of` | A list field has no `of` that is one scalar kind |
82
- | `definition-sections` | `sections` is not a mapping |
83
- | `definition-section` | A section spec is not an object of the accepted keys |
84
- | `definition-section-kind` | A section kind is not `text` or `list` |
85
- | `definition-duplicate` | Two definition files share a type name |
86
- | `unknown-type` | A file declares a type that is not in `types/` |
87
- | `required-field` | A required field is missing |
88
- | `required-section` | A required section heading is missing |
89
- | `field-kind` | A field value fails its kind, including date |
90
- | `field-enum` | A field value is not one of the declared enum values |
91
- | `unresolved-reference` | A reference does not resolve to a current file of the required type |
92
- | `unresolved-link` | A relative body link does not resolve to a current path |
93
- | `structured-section` | A declared structured-list section does not parse as a list |
94
- | `referenced-missing-file` | Remaining files still reference an absent path |
95
- | `unwritable-link` | No Markdown destination form can carry a new link destination |
96
-
97
- `unwritable-link` is refused by `apply`, not by `validate`, so no case under
98
- `cases/` carries it.
92
+ | Rule | When |
93
+ | ------------------------- | -------------------------------------------------------------------------------- |
94
+ | `binary-target-document` | A path is declared as both a text Document and a binary target |
95
+ | `frontmatter-fence` | A present frontmatter fence does not parse as the accepted YAML subset |
96
+ | `schema-yaml` | A schema text is not a mapping in the accepted YAML subset |
97
+ | `schema-shape` | A schema is not a mapping of exactly `types` to a mapping of non-empty names |
98
+ | `schema-member-document` | A second type is marked `member_document: true` |
99
+ | `definition-shape` | A type is not a mapping of `fields`, `sections`, and a boolean `member_document` |
100
+ | `definition-fields` | `fields` is not a mapping |
101
+ | `definition-field` | A field spec is not an object of the accepted keys |
102
+ | `definition-field-kind` | A field kind is not text, string, number, date, enum, reference, or list |
103
+ | `definition-enum-values` | An enum field has no non-empty string `values` |
104
+ | `definition-reference-to` | A reference has no `to` naming `any` or a type of the same schema |
105
+ | `definition-list-of` | A list field or list section has no `of` that is one scalar kind |
106
+ | `definition-sections` | `sections` is not a mapping |
107
+ | `definition-section` | A section spec is not an object of the accepted keys |
108
+ | `definition-section-kind` | A section kind is not `text` or `list` |
109
+ | `unknown-type` | A file declares a type absent from the governing schema |
110
+ | `required-field` | A required field is missing |
111
+ | `required-section` | A required section heading is missing |
112
+ | `field-kind` | A field value fails its kind, including date |
113
+ | `field-enum` | A field value is not one of the declared enum values |
114
+ | `undeclared-field` | A typed file carries a frontmatter field its type does not declare |
115
+ | `unresolved-reference` | A reference field or item resolves to no current file of the required type |
116
+ | `unresolved-link` | A relative body link does not resolve to a current path |
117
+ | `structured-section` | A declared list section is not a list of its declared item kind |
118
+ | `referenced-missing-file` | Remaining files still reference an absent path |
119
+ | `unwritable-link` | No Markdown destination form can carry a new link destination |
120
+ | `division-budget` | A division budget is not a whole number of at least 2 |
121
+
122
+ `unwritable-link` is refused by `apply` and `division-budget` by `divide`, not
123
+ by `validate`, so no case under `cases/` carries either.
99
124
 
100
125
  ## YAML subset
101
126
 
102
- Frontmatter is a mapping in a closed YAML subset: block and flow mappings,
127
+ Frontmatter and a schema text are each a mapping in a closed YAML subset: block and flow mappings,
103
128
  block and flow sequences, plain and quoted scalars, `true`, `false`, `null`,
104
129
  and decimal numbers. It does not take YAML 1.1 boolean or timestamp aliases,
105
- octal numbers, anchors, tags, or block scalars.
130
+ octal numbers, anchors, tags, or block scalars. A mapping carries each key once.
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
4
  "rule": "unresolved-reference",
5
- "version": "<package-version>",
6
5
  "location": "subject"
7
6
  }
@@ -0,0 +1,4 @@
1
+ types:
2
+ note:
3
+ fields:
4
+ subject: { kind: reference, to: any, required: true }
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
- "rule": "binary-target-document",
5
- "version": "<package-version>"
4
+ "rule": "binary-target-document"
6
5
  }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
- "rule": "unresolved-link",
5
- "version": "<package-version>"
4
+ "rule": "unresolved-link"
6
5
  }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
4
  "rule": "unresolved-reference",
5
- "version": "<package-version>",
6
5
  "location": "subject"
7
6
  }
@@ -0,0 +1,4 @@
1
+ types:
2
+ note:
3
+ fields:
4
+ subject: { kind: reference, to: any, required: true }
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
4
  "rule": "unresolved-reference",
5
- "version": "<package-version>",
6
5
  "location": "subject"
7
6
  }
@@ -0,0 +1,5 @@
1
+ types:
2
+ note:
3
+ fields:
4
+ subject: { kind: reference, to: person, required: true }
5
+ person: {}
@@ -0,0 +1,6 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ sections:
6
+ Description: { kind: text, required: true }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -0,0 +1,6 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ sections:
6
+ Description: { kind: text, required: true }
@@ -0,0 +1,6 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ sections:
6
+ Description: { kind: text, required: true }
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "item.md",
4
4
  "location": "status",
5
- "rule": "field-enum",
6
- "version": "<package-version>"
5
+ "rule": "field-enum"
7
6
  }
@@ -0,0 +1,7 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ status: { kind: enum, values: [open, in-progress, done], required: true }
6
+ sections:
7
+ Description: { kind: text, required: true }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "location": "line 1",
4
+ "rule": "schema-yaml"
5
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ types:
3
+ task:
4
+ fields:
5
+ title: { kind: string }
6
+ ---
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -1,7 +1,5 @@
1
1
  {
2
2
  "verdict": "refuse",
3
- "file": "types/task.md",
4
- "location": "title",
5
- "rule": "definition-field-kind",
6
- "version": "<package-version>"
3
+ "location": "types.task.fields.title",
4
+ "rule": "definition-field-kind"
7
5
  }
@@ -0,0 +1,4 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: widget }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: contact
3
+ name: Ana
4
+ member: ana@example.com
5
+ ---
@@ -0,0 +1,5 @@
1
+ types:
2
+ contact:
3
+ member_document: true
4
+ fields:
5
+ name: { kind: string, required: true }
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
- "rule": "unresolved-link",
5
- "version": "<package-version>"
4
+ "rule": "unresolved-link"
6
5
  }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
- "rule": "unresolved-link",
5
- "version": "<package-version>"
4
+ "rule": "unresolved-link"
6
5
  }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "item.md",
4
4
  "location": "title",
5
- "rule": "required-field",
6
- "version": "<package-version>"
5
+ "rule": "required-field"
7
6
  }
@@ -0,0 +1,7 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ status: { kind: enum, values: [open, in-progress, done], required: true }
6
+ sections:
7
+ Description: { kind: text, required: true }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "location": "types.task.sections.Acceptance",
4
+ "rule": "definition-list-of"
5
+ }
@@ -0,0 +1,6 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ sections:
6
+ Acceptance: { kind: list }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "item.md",
4
+ "location": "__proto__",
5
+ "rule": "undeclared-field"
6
+ }
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: task
3
+ title: Ship
4
+ __proto__: Ada
5
+ ---
6
+
7
+ ## Description
8
+
9
+ Go.
@@ -0,0 +1,6 @@
1
+ types:
2
+ task:
3
+ fields:
4
+ title: { kind: string, required: true }
5
+ sections:
6
+ Description: { kind: text, required: true }
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
- "rule": "unresolved-link",
5
- "version": "<package-version>"
4
+ "rule": "unresolved-link"
6
5
  }
@@ -0,0 +1,2 @@
1
+ types:
2
+ note: {}
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "people/ada.md",
4
4
  "rule": "referenced-missing-file",
5
- "version": "<package-version>",
6
5
  "referrers": ["a.md", "b.md"]
7
6
  }
@@ -0,0 +1,10 @@
1
+ types:
2
+ person:
3
+ fields:
4
+ name: { kind: string, required: true }
5
+ task:
6
+ fields:
7
+ title: { kind: string, required: true }
8
+ owner: { kind: reference, to: person, required: true }
9
+ sections:
10
+ Description: { kind: text, required: true }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "location": "types.person.member_document",
4
+ "rule": "schema-member-document"
5
+ }
@@ -0,0 +1,5 @@
1
+ types:
2
+ contact:
3
+ member_document: true
4
+ person:
5
+ member_document: true
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "task.md",
4
+ "location": "Stages",
5
+ "rule": "structured-section"
6
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ type: task
3
+ ---
4
+
5
+ ## Stages
6
+
7
+ - draft
8
+ - shipped
@@ -0,0 +1,4 @@
1
+ types:
2
+ task:
3
+ sections:
4
+ Stages: { kind: list, of: enum, values: [draft, done] }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "task.md",
4
+ "location": "Estimates",
5
+ "rule": "structured-section"
6
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ type: task
3
+ ---
4
+
5
+ ## Estimates
6
+
7
+ - 3
8
+ - not a number
@@ -0,0 +1,4 @@
1
+ types:
2
+ task:
3
+ sections:
4
+ Estimates: { kind: list, of: number }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,3 @@
1
+ ---
2
+ type: page
3
+ ---
@@ -0,0 +1,28 @@
1
+ ---
2
+ type: page
3
+ ---
4
+
5
+ [self]: page.md
6
+
7
+ ## Estimates
8
+
9
+ - 3
10
+ - -1.5
11
+
12
+ ## Dates
13
+
14
+ - 2026-10-06
15
+
16
+ ## Stages
17
+
18
+ - draft
19
+ - done
20
+
21
+ ## Related
22
+
23
+ - [the other page](other.md)
24
+ - [this page][self]
25
+
26
+ ## Notes
27
+
28
+ - any text, [a link](other.md) included
@@ -0,0 +1,8 @@
1
+ types:
2
+ page:
3
+ sections:
4
+ Estimates: { kind: list, of: number }
5
+ Dates: { kind: list, of: date }
6
+ Stages: { kind: list, of: enum, values: [draft, done] }
7
+ Related: { kind: list, of: reference, to: page }
8
+ Notes: { kind: list, of: string }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "page.md",
4
+ "location": "Related",
5
+ "rule": "structured-section"
6
+ }
@@ -0,0 +1,3 @@
1
+ ---
2
+ type: page
3
+ ---