@agentshouse/mdmodel 0.1.0-alpha.9 → 0.1.0-c08b2adadd2fe

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 (497) hide show
  1. package/API.md +408 -0
  2. package/README.md +38 -194
  3. package/dist/definition.d.ts +72 -27
  4. package/dist/definition.d.ts.map +1 -1
  5. package/dist/definition.js +839 -145
  6. package/dist/divide.d.ts +3 -0
  7. package/dist/divide.d.ts.map +1 -0
  8. package/dist/divide.js +321 -0
  9. package/dist/document.d.ts +17 -3
  10. package/dist/document.d.ts.map +1 -1
  11. package/dist/document.js +514 -189
  12. package/dist/event.d.ts +78 -0
  13. package/dist/event.d.ts.map +1 -0
  14. package/dist/event.js +201 -0
  15. package/dist/facts.d.ts +15 -0
  16. package/dist/facts.d.ts.map +1 -0
  17. package/dist/facts.js +41 -0
  18. package/dist/fields.d.ts +6 -0
  19. package/dist/fields.d.ts.map +1 -0
  20. package/dist/fields.js +10 -0
  21. package/dist/index.d.ts +30 -4
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +18 -5
  24. package/dist/kinds.d.ts +18 -0
  25. package/dist/kinds.d.ts.map +1 -0
  26. package/dist/kinds.js +150 -0
  27. package/dist/markdown.d.ts +51 -0
  28. package/dist/markdown.d.ts.map +1 -0
  29. package/dist/markdown.js +271 -0
  30. package/dist/paths.d.ts +15 -4
  31. package/dist/paths.d.ts.map +1 -1
  32. package/dist/paths.js +156 -36
  33. package/dist/pattern.d.ts +10 -0
  34. package/dist/pattern.d.ts.map +1 -0
  35. package/dist/pattern.js +356 -0
  36. package/dist/project.d.ts +20 -1
  37. package/dist/project.d.ts.map +1 -1
  38. package/dist/project.js +98 -97
  39. package/dist/query/language.d.ts +254 -0
  40. package/dist/query/language.d.ts.map +1 -0
  41. package/dist/query/language.js +620 -0
  42. package/dist/query/match.d.ts +14 -0
  43. package/dist/query/match.d.ts.map +1 -0
  44. package/dist/query/match.js +150 -0
  45. package/dist/query/rows.d.ts +32 -0
  46. package/dist/query/rows.d.ts.map +1 -0
  47. package/dist/query/rows.js +161 -0
  48. package/dist/query/sql.d.ts +39 -0
  49. package/dist/query/sql.d.ts.map +1 -0
  50. package/dist/query/sql.js +285 -0
  51. package/dist/references.d.ts +4 -0
  52. package/dist/references.d.ts.map +1 -0
  53. package/dist/references.js +30 -0
  54. package/dist/refuse.d.ts.map +1 -1
  55. package/dist/refuse.js +2 -10
  56. package/dist/reserved.d.ts +6 -0
  57. package/dist/reserved.d.ts.map +1 -0
  58. package/dist/reserved.js +21 -0
  59. package/dist/schema.d.ts +8 -5
  60. package/dist/schema.d.ts.map +1 -1
  61. package/dist/schema.js +207 -41
  62. package/dist/types.d.ts +114 -4
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/types.js +1 -3
  65. package/dist/validate.d.ts +34 -2
  66. package/dist/validate.d.ts.map +1 -1
  67. package/dist/validate.js +449 -159
  68. package/dist/version.d.ts +1 -1
  69. package/dist/version.d.ts.map +1 -1
  70. package/dist/version.js +1 -3
  71. package/dist/yaml.d.ts +9 -3
  72. package/dist/yaml.d.ts.map +1 -1
  73. package/dist/yaml.js +326 -201
  74. package/fixtures/README.md +113 -56
  75. package/fixtures/cases/absent-link-dangles/library/item.md +8 -0
  76. package/fixtures/cases/absent-link-dangles/schema.yaml +6 -0
  77. package/fixtures/cases/absent-optional-field/context.json +1 -0
  78. package/fixtures/cases/absent-optional-field/expected.json +1 -0
  79. package/fixtures/cases/absent-optional-field/library/companies/acme.md +4 -0
  80. package/fixtures/cases/absent-optional-field/library/deals/lead.md +6 -0
  81. package/fixtures/cases/absent-optional-field/schema.yaml +56 -0
  82. package/fixtures/cases/absolute-link/context.json +1 -0
  83. package/fixtures/cases/absolute-link/expected.json +5 -0
  84. package/fixtures/cases/absolute-link/library/item.md +8 -0
  85. package/fixtures/cases/absolute-link/schema.yaml +6 -0
  86. package/fixtures/cases/attachment-reference-any-file/context.json +1 -0
  87. package/fixtures/cases/attachment-reference-any-file/expected.json +1 -0
  88. package/fixtures/cases/attachment-reference-any-file/library/companies/acme.md +4 -0
  89. package/fixtures/cases/attachment-reference-any-file/library/deals/renewal.md +15 -0
  90. package/fixtures/cases/attachment-reference-any-file/library/places/depot.md +4 -0
  91. package/fixtures/cases/attachment-reference-any-file/library/products/seats.md +4 -0
  92. package/fixtures/cases/attachment-reference-any-file/library/products/support.md +4 -0
  93. package/fixtures/cases/attachment-reference-any-file/schema.yaml +32 -0
  94. package/fixtures/cases/attachment-reference-dangles/context.json +1 -0
  95. package/fixtures/cases/attachment-reference-dangles/expected.json +1 -0
  96. package/fixtures/cases/attachment-reference-dangles/library/companies/acme.md +4 -0
  97. package/fixtures/cases/attachment-reference-dangles/library/deals/renewal.md +15 -0
  98. package/fixtures/cases/attachment-reference-dangles/library/places/depot.md +4 -0
  99. package/fixtures/cases/attachment-reference-dangles/library/products/seats.md +4 -0
  100. package/fixtures/cases/attachment-reference-dangles/library/products/support.md +4 -0
  101. package/fixtures/cases/attachment-reference-dangles/schema.yaml +32 -0
  102. package/fixtures/cases/attachment-reference-outside/context.json +1 -0
  103. package/fixtures/cases/attachment-reference-outside/expected.json +6 -0
  104. package/fixtures/cases/attachment-reference-outside/library/companies/acme.md +4 -0
  105. package/fixtures/cases/attachment-reference-outside/library/deals/renewal.md +15 -0
  106. package/fixtures/cases/attachment-reference-outside/library/places/depot.md +4 -0
  107. package/fixtures/cases/attachment-reference-outside/library/products/seats.md +4 -0
  108. package/fixtures/cases/attachment-reference-outside/library/products/support.md +4 -0
  109. package/fixtures/cases/attachment-reference-outside/schema.yaml +32 -0
  110. package/fixtures/cases/binary-any-reference/expected.json +1 -2
  111. package/fixtures/cases/binary-any-reference/schema.yaml +4 -0
  112. package/fixtures/cases/binary-document-collision/expected.json +1 -2
  113. package/fixtures/cases/binary-document-collision/schema.yaml +1 -0
  114. package/fixtures/cases/binary-image-dangles/expected.json +1 -0
  115. package/fixtures/cases/binary-image-dangles/schema.yaml +1 -0
  116. package/fixtures/cases/binary-link-dangles/expected.json +1 -0
  117. package/fixtures/cases/binary-link-dangles/schema.yaml +1 -0
  118. package/fixtures/cases/binary-link-outside-collection/expected.json +1 -2
  119. package/fixtures/cases/binary-link-outside-collection/schema.yaml +1 -0
  120. package/fixtures/cases/binary-prototype-reference/expected.json +1 -2
  121. package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -0
  122. package/fixtures/cases/binary-typed-reference/expected.json +1 -2
  123. package/fixtures/cases/binary-typed-reference/schema.yaml +5 -0
  124. package/fixtures/cases/boolean-field/context.json +1 -0
  125. package/fixtures/cases/boolean-field/expected.json +6 -0
  126. package/fixtures/cases/boolean-field/library/companies/acme.md +4 -0
  127. package/fixtures/cases/boolean-field/library/deals/renewal.md +31 -0
  128. package/fixtures/cases/boolean-field/schema.yaml +56 -0
  129. package/fixtures/cases/bracketed-link-definition/schema.yaml +6 -0
  130. package/fixtures/cases/closed-nested-object/context.json +1 -0
  131. package/fixtures/cases/closed-nested-object/expected.json +6 -0
  132. package/fixtures/cases/closed-nested-object/library/companies/acme.md +4 -0
  133. package/fixtures/cases/closed-nested-object/library/deals/renewal.md +32 -0
  134. package/fixtures/cases/closed-nested-object/schema.yaml +56 -0
  135. package/fixtures/cases/composed-root-reference/context.json +1 -0
  136. package/fixtures/cases/composed-root-reference/expected.json +6 -0
  137. package/fixtures/cases/composed-root-reference/library/a.md +5 -0
  138. package/fixtures/cases/composed-root-reference/schema.yaml +13 -0
  139. package/fixtures/cases/conditional-section/context.json +1 -0
  140. package/fixtures/cases/conditional-section/expected.json +6 -0
  141. package/fixtures/cases/conditional-section/library/questions/hosting.md +9 -0
  142. package/fixtures/cases/conditional-section/library/questions/payments.md +12 -0
  143. package/fixtures/cases/conditional-section/schema.yaml +14 -0
  144. package/fixtures/cases/cross-room-link/context.json +1 -0
  145. package/fixtures/cases/cross-room-link/expected.json +1 -0
  146. package/fixtures/cases/cross-room-link/library/clients/acme.md +6 -0
  147. package/fixtures/cases/cross-room-link/schema.yaml +3 -0
  148. package/fixtures/cases/cross-room-reference/context.json +1 -0
  149. package/fixtures/cases/cross-room-reference/expected.json +1 -0
  150. package/fixtures/cases/cross-room-reference/library/clients/acme.md +9 -0
  151. package/fixtures/cases/cross-room-reference/schema.yaml +9 -0
  152. package/fixtures/cases/date-time-format/context.json +1 -0
  153. package/fixtures/cases/date-time-format/expected.json +6 -0
  154. package/fixtures/cases/date-time-format/library/companies/acme.md +4 -0
  155. package/fixtures/cases/date-time-format/library/deals/renewal.md +31 -0
  156. package/fixtures/cases/date-time-format/schema.yaml +56 -0
  157. package/fixtures/cases/declared-binary-links/schema.yaml +1 -0
  158. package/fixtures/cases/default-unfilled/context.json +1 -0
  159. package/fixtures/cases/default-unfilled/expected.json +6 -0
  160. package/fixtures/cases/default-unfilled/library/companies/acme.md +4 -0
  161. package/fixtures/cases/default-unfilled/library/deals/renewal.md +29 -0
  162. package/fixtures/cases/default-unfilled/schema.yaml +56 -0
  163. package/fixtures/cases/defs-pattern/context.json +1 -0
  164. package/fixtures/cases/defs-pattern/expected.json +6 -0
  165. package/fixtures/cases/defs-pattern/library/companies/acme.md +4 -0
  166. package/fixtures/cases/defs-pattern/library/deals/renewal.md +31 -0
  167. package/fixtures/cases/defs-pattern/schema.yaml +56 -0
  168. package/fixtures/cases/dependent-rule/context.json +1 -0
  169. package/fixtures/cases/dependent-rule/expected.json +6 -0
  170. package/fixtures/cases/dependent-rule/library/companies/acme.md +4 -0
  171. package/fixtures/cases/dependent-rule/library/deals/renewal.md +30 -0
  172. package/fixtures/cases/dependent-rule/schema.yaml +56 -0
  173. package/fixtures/cases/duplicate-link-definition/schema.yaml +6 -0
  174. package/fixtures/cases/email-format/context.json +1 -0
  175. package/fixtures/cases/email-format/expected.json +6 -0
  176. package/fixtures/cases/email-format/library/companies/acme.md +4 -0
  177. package/fixtures/cases/email-format/library/deals/renewal.md +31 -0
  178. package/fixtures/cases/email-format/schema.yaml +56 -0
  179. package/fixtures/cases/fenced-link-definition/schema.yaml +6 -0
  180. package/fixtures/cases/field-enum/expected.json +2 -3
  181. package/fixtures/cases/field-enum/schema.yaml +7 -0
  182. package/fixtures/cases/frontmatter-schema/context.json +1 -0
  183. package/fixtures/cases/frontmatter-schema/expected.json +5 -0
  184. package/fixtures/cases/frontmatter-schema/schema.yaml +5 -0
  185. package/fixtures/cases/integer-field/context.json +1 -0
  186. package/fixtures/cases/integer-field/expected.json +6 -0
  187. package/fixtures/cases/integer-field/library/companies/acme.md +4 -0
  188. package/fixtures/cases/integer-field/library/deals/renewal.md +31 -0
  189. package/fixtures/cases/integer-field/schema.yaml +56 -0
  190. package/fixtures/cases/interrupted-link-definition/schema.yaml +1 -0
  191. package/fixtures/cases/json-schema-constructs/context.json +1 -0
  192. package/fixtures/cases/json-schema-constructs/expected.json +1 -0
  193. package/fixtures/cases/json-schema-constructs/library/companies/acme.md +4 -0
  194. package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +31 -0
  195. package/fixtures/cases/json-schema-constructs/schema.yaml +56 -0
  196. package/fixtures/cases/lazy-list-item/context.json +1 -0
  197. package/fixtures/cases/lazy-list-item/expected.json +3 -0
  198. package/fixtures/cases/lazy-list-item/library/item.md +8 -0
  199. package/fixtures/cases/lazy-list-item/schema.yaml +3 -0
  200. package/fixtures/cases/link-into-a-reserved-name/context.json +1 -0
  201. package/fixtures/cases/link-into-a-reserved-name/expected.json +5 -0
  202. package/fixtures/cases/link-into-a-reserved-name/library/notes/a.md +6 -0
  203. package/fixtures/cases/link-into-a-reserved-name/schema.yaml +3 -0
  204. package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/context.json +1 -0
  205. package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/expected.json +5 -0
  206. package/fixtures/cases/link-into-a-reserved-name-from-an-untyped-document/library/notes/b.md +5 -0
  207. package/fixtures/cases/list-of-objects-closed/context.json +1 -0
  208. package/fixtures/cases/list-of-objects-closed/expected.json +6 -0
  209. package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +4 -0
  210. package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +32 -0
  211. package/fixtures/cases/list-of-objects-closed/schema.yaml +56 -0
  212. package/fixtures/cases/list-of-objects-item/context.json +1 -0
  213. package/fixtures/cases/list-of-objects-item/expected.json +6 -0
  214. package/fixtures/cases/list-of-objects-item/library/companies/acme.md +4 -0
  215. package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +31 -0
  216. package/fixtures/cases/list-of-objects-item/schema.yaml +56 -0
  217. package/fixtures/cases/list-of-objects-reference/context.json +1 -0
  218. package/fixtures/cases/list-of-objects-reference/expected.json +6 -0
  219. package/fixtures/cases/list-of-objects-reference/library/companies/acme.md +4 -0
  220. package/fixtures/cases/list-of-objects-reference/library/deals/renewal.md +14 -0
  221. package/fixtures/cases/list-of-objects-reference/library/places/depot.md +4 -0
  222. package/fixtures/cases/list-of-objects-reference/library/products/seats.md +4 -0
  223. package/fixtures/cases/list-of-objects-reference/library/products/support.md +4 -0
  224. package/fixtures/cases/list-of-objects-reference/schema.yaml +32 -0
  225. package/fixtures/cases/list-size/context.json +1 -0
  226. package/fixtures/cases/list-size/expected.json +6 -0
  227. package/fixtures/cases/list-size/library/companies/acme.md +4 -0
  228. package/fixtures/cases/list-size/library/deals/renewal.md +31 -0
  229. package/fixtures/cases/list-size/schema.yaml +56 -0
  230. package/fixtures/cases/long-fence-link-definition/schema.yaml +1 -0
  231. package/fixtures/cases/malformed-definition/expected.json +2 -4
  232. package/fixtures/cases/malformed-definition/schema.yaml +3 -0
  233. package/fixtures/cases/member-document/context.json +1 -0
  234. package/fixtures/cases/member-document/expected.json +1 -0
  235. package/fixtures/cases/member-document/library/people/ana.md +5 -0
  236. package/fixtures/cases/member-document/schema.yaml +5 -0
  237. package/fixtures/cases/member-on-an-untyped-document/context.json +1 -0
  238. package/fixtures/cases/member-on-an-untyped-document/expected.json +6 -0
  239. package/fixtures/cases/member-on-an-untyped-document/library/note.md +4 -0
  240. package/fixtures/cases/member-on-another-type/context.json +1 -0
  241. package/fixtures/cases/member-on-another-type/expected.json +6 -0
  242. package/fixtures/cases/member-on-another-type/library/note.md +4 -0
  243. package/fixtures/cases/member-on-another-type/schema.yaml +7 -0
  244. package/fixtures/cases/missing-required-field/expected.json +2 -3
  245. package/fixtures/cases/missing-required-field/schema.yaml +7 -0
  246. package/fixtures/cases/missing-section-item-kind/expected.json +2 -4
  247. package/fixtures/cases/missing-section-item-kind/schema.yaml +6 -0
  248. package/fixtures/cases/misspelled-key/context.json +1 -0
  249. package/fixtures/cases/misspelled-key/expected.json +6 -0
  250. package/fixtures/cases/misspelled-key/library/companies/acme.md +4 -0
  251. package/fixtures/cases/misspelled-key/library/deals/renewal.md +32 -0
  252. package/fixtures/cases/misspelled-key/schema.yaml +56 -0
  253. package/fixtures/cases/nested-defs/context.json +1 -0
  254. package/fixtures/cases/nested-defs/expected.json +6 -0
  255. package/fixtures/cases/nested-defs/library/deal.md +6 -0
  256. package/fixtures/cases/nested-defs/schema.yaml +11 -0
  257. package/fixtures/cases/nested-object-reference/context.json +1 -0
  258. package/fixtures/cases/nested-object-reference/expected.json +6 -0
  259. package/fixtures/cases/nested-object-reference/library/companies/acme.md +4 -0
  260. package/fixtures/cases/nested-object-reference/library/deals/renewal.md +14 -0
  261. package/fixtures/cases/nested-object-reference/library/places/depot.md +4 -0
  262. package/fixtures/cases/nested-object-reference/library/products/seats.md +4 -0
  263. package/fixtures/cases/nested-object-reference/library/products/support.md +4 -0
  264. package/fixtures/cases/nested-object-reference/schema.yaml +32 -0
  265. package/fixtures/cases/nested-reference/context.json +1 -0
  266. package/fixtures/cases/nested-reference/expected.json +1 -0
  267. package/fixtures/cases/nested-reference/library/companies/acme.md +4 -0
  268. package/fixtures/cases/nested-reference/library/deals/renewal.md +15 -0
  269. package/fixtures/cases/nested-reference/library/places/depot.md +4 -0
  270. package/fixtures/cases/nested-reference/library/products/seats.md +4 -0
  271. package/fixtures/cases/nested-reference/library/products/support.md +4 -0
  272. package/fixtures/cases/nested-reference/schema.yaml +32 -0
  273. package/fixtures/cases/nested-required-field/context.json +1 -0
  274. package/fixtures/cases/nested-required-field/expected.json +6 -0
  275. package/fixtures/cases/nested-required-field/library/companies/acme.md +4 -0
  276. package/fixtures/cases/nested-required-field/library/deals/renewal.md +30 -0
  277. package/fixtures/cases/nested-required-field/schema.yaml +56 -0
  278. package/fixtures/cases/null-refused/context.json +1 -0
  279. package/fixtures/cases/null-refused/expected.json +6 -0
  280. package/fixtures/cases/null-refused/library/companies/acme.md +4 -0
  281. package/fixtures/cases/null-refused/library/deals/renewal.md +31 -0
  282. package/fixtures/cases/null-refused/schema.yaml +56 -0
  283. package/fixtures/cases/numeric-range/context.json +1 -0
  284. package/fixtures/cases/numeric-range/expected.json +6 -0
  285. package/fixtures/cases/numeric-range/library/companies/acme.md +4 -0
  286. package/fixtures/cases/numeric-range/library/deals/renewal.md +31 -0
  287. package/fixtures/cases/numeric-range/schema.yaml +56 -0
  288. package/fixtures/cases/one-of-variant/context.json +1 -0
  289. package/fixtures/cases/one-of-variant/expected.json +6 -0
  290. package/fixtures/cases/one-of-variant/library/companies/acme.md +4 -0
  291. package/fixtures/cases/one-of-variant/library/deals/renewal.md +31 -0
  292. package/fixtures/cases/one-of-variant/schema.yaml +56 -0
  293. package/fixtures/cases/open-map-value/context.json +1 -0
  294. package/fixtures/cases/open-map-value/expected.json +6 -0
  295. package/fixtures/cases/open-map-value/library/companies/acme.md +4 -0
  296. package/fixtures/cases/open-map-value/library/deals/renewal.md +31 -0
  297. package/fixtures/cases/open-map-value/schema.yaml +56 -0
  298. package/fixtures/cases/other-room-reference/context.json +1 -0
  299. package/fixtures/cases/other-room-reference/expected.json +6 -0
  300. package/fixtures/cases/other-room-reference/library/companies/acme.md +4 -0
  301. package/fixtures/cases/other-room-reference/library/deals/renewal.md +14 -0
  302. package/fixtures/cases/other-room-reference/library/places/depot.md +4 -0
  303. package/fixtures/cases/other-room-reference/library/products/seats.md +4 -0
  304. package/fixtures/cases/other-room-reference/library/products/support.md +4 -0
  305. package/fixtures/cases/other-room-reference/schema.yaml +32 -0
  306. package/fixtures/cases/paragraph-link-definition/schema.yaml +1 -0
  307. package/fixtures/cases/prototype-field/expected.json +2 -3
  308. package/fixtures/cases/prototype-field/schema.yaml +6 -0
  309. package/fixtures/cases/quoted-link-definition/expected.json +1 -2
  310. package/fixtures/cases/quoted-link-definition/library/notes/draft.md +1 -1
  311. package/fixtures/cases/quoted-link-definition/schema.yaml +1 -0
  312. package/fixtures/cases/reference-into-a-reserved-name/context.json +1 -0
  313. package/fixtures/cases/reference-into-a-reserved-name/expected.json +6 -0
  314. package/fixtures/cases/reference-into-a-reserved-name/library/notes/a.md +4 -0
  315. package/fixtures/cases/reference-into-a-reserved-name/library/settings/brief.md +1 -0
  316. package/fixtures/cases/reference-into-a-reserved-name/schema.yaml +3 -0
  317. package/fixtures/cases/referenced-missing-file/expected.json +0 -1
  318. package/fixtures/cases/referenced-missing-file/schema.yaml +11 -0
  319. package/fixtures/cases/remote-ref/context.json +1 -0
  320. package/fixtures/cases/remote-ref/expected.json +5 -0
  321. package/fixtures/cases/remote-ref/schema.yaml +3 -0
  322. package/fixtures/cases/room-md-declares-a-type/context.json +1 -0
  323. package/fixtures/cases/room-md-declares-a-type/expected.json +6 -0
  324. package/fixtures/cases/room-md-declares-a-type/library/ROOM.md +5 -0
  325. package/fixtures/cases/second-member-document/context.json +1 -0
  326. package/fixtures/cases/second-member-document/expected.json +5 -0
  327. package/fixtures/cases/second-member-document/schema.yaml +4 -0
  328. package/fixtures/cases/section-item-enum/context.json +1 -0
  329. package/fixtures/cases/section-item-enum/expected.json +6 -0
  330. package/fixtures/cases/section-item-enum/library/task.md +8 -0
  331. package/fixtures/cases/section-item-enum/schema.yaml +3 -0
  332. package/fixtures/cases/section-item-kind/context.json +1 -0
  333. package/fixtures/cases/section-item-kind/expected.json +6 -0
  334. package/fixtures/cases/section-item-kind/library/task.md +8 -0
  335. package/fixtures/cases/section-item-kind/schema.yaml +3 -0
  336. package/fixtures/cases/section-items/context.json +1 -0
  337. package/fixtures/cases/section-items/expected.json +1 -0
  338. package/fixtures/cases/section-items/library/other.md +3 -0
  339. package/fixtures/cases/section-items/library/page.md +42 -0
  340. package/fixtures/cases/section-items/schema.yaml +10 -0
  341. package/fixtures/cases/section-reference-path/context.json +1 -0
  342. package/fixtures/cases/section-reference-path/expected.json +6 -0
  343. package/fixtures/cases/section-reference-path/library/other.md +3 -0
  344. package/fixtures/cases/section-reference-path/library/page.md +7 -0
  345. package/fixtures/cases/section-reference-path/schema.yaml +3 -0
  346. package/fixtures/cases/section-reference-type/context.json +1 -0
  347. package/fixtures/cases/section-reference-type/expected.json +6 -0
  348. package/fixtures/cases/section-reference-type/library/note.md +1 -0
  349. package/fixtures/cases/section-reference-type/library/page.md +7 -0
  350. package/fixtures/cases/section-reference-type/schema.yaml +3 -0
  351. package/fixtures/cases/shortcut-reference-link/context.json +1 -0
  352. package/fixtures/cases/shortcut-reference-link/expected.json +5 -0
  353. package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
  354. package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -0
  355. package/fixtures/cases/string-length/context.json +1 -0
  356. package/fixtures/cases/string-length/expected.json +6 -0
  357. package/fixtures/cases/string-length/library/companies/acme.md +4 -0
  358. package/fixtures/cases/string-length/library/deals/renewal.md +31 -0
  359. package/fixtures/cases/string-length/schema.yaml +56 -0
  360. package/fixtures/cases/structured-section/expected.json +1 -2
  361. package/fixtures/cases/structured-section/schema.yaml +7 -0
  362. package/fixtures/cases/submission-keys/context.json +1 -0
  363. package/fixtures/cases/submission-keys/expected.json +1 -0
  364. package/fixtures/cases/submission-keys/library/notes/visitor.md +8 -0
  365. package/fixtures/cases/submission-keys/schema.yaml +4 -0
  366. package/fixtures/cases/text-field-kind/context.json +1 -0
  367. package/fixtures/cases/text-field-kind/expected.json +6 -0
  368. package/fixtures/cases/text-field-kind/library/page.md +4 -0
  369. package/fixtures/cases/text-field-kind/schema.yaml +4 -0
  370. package/fixtures/cases/thematic-break-in-a-list-section/context.json +1 -0
  371. package/fixtures/cases/thematic-break-in-a-list-section/expected.json +6 -0
  372. package/fixtures/cases/thematic-break-in-a-list-section/library/item.md +7 -0
  373. package/fixtures/cases/thematic-break-in-a-list-section/schema.yaml +3 -0
  374. package/fixtures/cases/truncated-link-definition/expected.json +1 -2
  375. package/fixtures/cases/truncated-link-definition/library/notes/draft.md +1 -1
  376. package/fixtures/cases/truncated-link-definition/schema.yaml +1 -0
  377. package/fixtures/cases/typed-path-names-another-type/context.json +11 -0
  378. package/fixtures/cases/typed-path-names-another-type/expected.json +6 -0
  379. package/fixtures/cases/typed-path-names-another-type/library/settings/prefs/one.md +3 -0
  380. package/fixtures/cases/typed-path-names-another-type/schema.yaml +6 -0
  381. package/fixtures/cases/typed-path-names-its-type/context.json +11 -0
  382. package/fixtures/cases/typed-path-names-its-type/expected.json +3 -0
  383. package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/deeper/two.md +1 -0
  384. package/fixtures/cases/typed-path-names-its-type/library/settings/prefs/one.md +4 -0
  385. package/fixtures/cases/typed-path-names-its-type/schema.yaml +6 -0
  386. package/fixtures/cases/typed-path-names-no-type/context.json +11 -0
  387. package/fixtures/cases/typed-path-names-no-type/expected.json +6 -0
  388. package/fixtures/cases/typed-path-names-no-type/library/settings/prefs/one.md +1 -0
  389. package/fixtures/cases/typed-path-names-no-type/schema.yaml +6 -0
  390. package/fixtures/cases/types-folder-content/context.json +1 -0
  391. package/fixtures/cases/types-folder-content/expected.json +1 -0
  392. package/fixtures/cases/types-folder-content/library/types/task.md +4 -0
  393. package/fixtures/cases/types-folder-content/schema.yaml +4 -0
  394. package/fixtures/cases/unclosed-frontmatter/expected.json +1 -2
  395. package/fixtures/cases/undeclared-field/expected.json +2 -3
  396. package/fixtures/cases/undeclared-field/schema.yaml +6 -0
  397. package/fixtures/cases/unevaluated-items-closed/context.json +1 -0
  398. package/fixtures/cases/unevaluated-items-closed/expected.json +6 -0
  399. package/fixtures/cases/unevaluated-items-closed/library/trip.md +6 -0
  400. package/fixtures/cases/unevaluated-items-closed/schema.yaml +10 -0
  401. package/fixtures/cases/unknown-type/context.json +1 -0
  402. package/fixtures/cases/unknown-type/expected.json +6 -0
  403. package/fixtures/cases/unknown-type/library/item.md +3 -0
  404. package/fixtures/cases/unknown-type/schema.yaml +3 -0
  405. package/fixtures/cases/unlisted-reference-type/context.json +1 -0
  406. package/fixtures/cases/unlisted-reference-type/expected.json +5 -0
  407. package/fixtures/cases/unlisted-reference-type/schema.yaml +3 -0
  408. package/fixtures/cases/unnamed-typed-path-checks-its-fields/context.json +11 -0
  409. package/fixtures/cases/unnamed-typed-path-checks-its-fields/expected.json +6 -0
  410. package/fixtures/cases/unnamed-typed-path-checks-its-fields/library/rooms/team/tasks/plan.md +4 -0
  411. package/fixtures/cases/unnamed-typed-path-checks-its-fields/schema.yaml +5 -0
  412. package/fixtures/cases/unnamed-typed-path-names-a-type/context.json +11 -0
  413. package/fixtures/cases/unnamed-typed-path-names-a-type/expected.json +6 -0
  414. package/fixtures/cases/unnamed-typed-path-names-a-type/library/rooms/team/tasks/plan.md +6 -0
  415. package/fixtures/cases/unnamed-typed-path-names-a-type/schema.yaml +5 -0
  416. package/fixtures/cases/unnamed-typed-path-reads-its-type/context.json +11 -0
  417. package/fixtures/cases/unnamed-typed-path-reads-its-type/expected.json +3 -0
  418. package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/plan.md +1 -0
  419. package/fixtures/cases/unnamed-typed-path-reads-its-type/library/rooms/team/tasks/plan.md +5 -0
  420. package/fixtures/cases/unnamed-typed-path-reads-its-type/schema.yaml +5 -0
  421. package/fixtures/cases/unnamed-typed-path-without-a-body/context.json +11 -0
  422. package/fixtures/cases/unnamed-typed-path-without-a-body/expected.json +5 -0
  423. package/fixtures/cases/unnamed-typed-path-without-a-body/library/rooms/team/tasks/plan.md +5 -0
  424. package/fixtures/cases/unnamed-typed-path-without-a-body/schema.yaml +5 -0
  425. package/fixtures/cases/unresolved-link/expected.json +1 -2
  426. package/fixtures/cases/unresolved-link/library/item.md +1 -1
  427. package/fixtures/cases/unresolved-link/schema.yaml +6 -0
  428. package/fixtures/cases/valid-typed-document/schema.yaml +16 -0
  429. package/fixtures/cases/wide-item-fence-link/schema.yaml +1 -0
  430. package/fixtures/division.json +454 -0
  431. package/fixtures/preamble.json +24 -3
  432. package/fixtures/projection.json +194 -22
  433. package/fixtures/queries.json +964 -0
  434. package/package.json +20 -13
  435. package/dist/definition.js.map +0 -1
  436. package/dist/document.js.map +0 -1
  437. package/dist/index.js.map +0 -1
  438. package/dist/links.d.ts +0 -25
  439. package/dist/links.d.ts.map +0 -1
  440. package/dist/links.js +0 -380
  441. package/dist/links.js.map +0 -1
  442. package/dist/paths.js.map +0 -1
  443. package/dist/profile.d.ts +0 -6
  444. package/dist/profile.d.ts.map +0 -1
  445. package/dist/profile.js +0 -7
  446. package/dist/profile.js.map +0 -1
  447. package/dist/project.js.map +0 -1
  448. package/dist/refuse.js.map +0 -1
  449. package/dist/schema.js.map +0 -1
  450. package/dist/sections.d.ts +0 -10
  451. package/dist/sections.d.ts.map +0 -1
  452. package/dist/sections.js +0 -79
  453. package/dist/sections.js.map +0 -1
  454. package/dist/types.js.map +0 -1
  455. package/dist/validate.js.map +0 -1
  456. package/dist/version.js.map +0 -1
  457. package/dist/yaml.js.map +0 -1
  458. package/fixtures/cases/binary-any-reference/library/types/note.md +0 -5
  459. package/fixtures/cases/binary-document-collision/library/types/note.md +0 -3
  460. package/fixtures/cases/binary-link-outside-collection/library/types/note.md +0 -3
  461. package/fixtures/cases/binary-prototype-reference/library/types/note.md +0 -5
  462. package/fixtures/cases/binary-typed-reference/library/types/note.md +0 -5
  463. package/fixtures/cases/binary-typed-reference/library/types/person.md +0 -3
  464. package/fixtures/cases/bracketed-link-definition/library/types/task.md +0 -7
  465. package/fixtures/cases/declared-binary-links/library/types/note.md +0 -3
  466. package/fixtures/cases/duplicate-link-definition/library/types/task.md +0 -7
  467. package/fixtures/cases/fenced-link-definition/library/types/task.md +0 -7
  468. package/fixtures/cases/field-enum/library/types/task.md +0 -8
  469. package/fixtures/cases/interrupted-link-definition/library/types/note.md +0 -3
  470. package/fixtures/cases/long-fence-link-definition/library/types/note.md +0 -3
  471. package/fixtures/cases/malformed-definition/library/types/task.md +0 -5
  472. package/fixtures/cases/missing-binary-image/expected.json +0 -6
  473. package/fixtures/cases/missing-binary-image/library/types/note.md +0 -3
  474. package/fixtures/cases/missing-binary-link/expected.json +0 -6
  475. package/fixtures/cases/missing-binary-link/library/types/note.md +0 -3
  476. package/fixtures/cases/missing-required-field/library/types/task.md +0 -8
  477. package/fixtures/cases/missing-section-item-kind/library/types/task.md +0 -7
  478. package/fixtures/cases/paragraph-link-definition/library/types/note.md +0 -3
  479. package/fixtures/cases/prd-definition/library/types/task.md +0 -16
  480. package/fixtures/cases/prototype-field/library/types/task.md +0 -7
  481. package/fixtures/cases/quoted-link-definition/library/types/note.md +0 -3
  482. package/fixtures/cases/referenced-missing-file/library/types/person.md +0 -5
  483. package/fixtures/cases/referenced-missing-file/library/types/task.md +0 -8
  484. package/fixtures/cases/structured-section/library/types/task.md +0 -8
  485. package/fixtures/cases/truncated-link-definition/library/types/note.md +0 -3
  486. package/fixtures/cases/undeclared-field/library/types/task.md +0 -7
  487. package/fixtures/cases/unresolved-link/library/types/task.md +0 -7
  488. package/fixtures/cases/valid-typed-document/library/types/person.md +0 -5
  489. package/fixtures/cases/valid-typed-document/library/types/task.md +0 -13
  490. package/fixtures/cases/wide-item-fence-link/library/types/note.md +0 -3
  491. package/markdown-syntax-profile.md +0 -9
  492. /package/fixtures/cases/{prd-definition → absent-link-dangles}/context.json +0 -0
  493. /package/fixtures/cases/{prd-definition → absent-link-dangles}/expected.json +0 -0
  494. /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/context.json +0 -0
  495. /package/fixtures/cases/{missing-binary-image → binary-image-dangles}/library/notes/draft.md +0 -0
  496. /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/context.json +0 -0
  497. /package/fixtures/cases/{missing-binary-link → binary-link-dangles}/library/notes/draft.md +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,67 @@ 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 and a heading an HTML block holds, setext, indented and empty
22
+ headings that open a section, newline/source preservation, and a moved-export
23
+ link rewrite.
23
24
 
24
25
  ## Projection
25
26
 
26
27
  `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`.
28
+ validation Libraries. It carries `schema`, one schema text, and `cases`. Each
29
+ case carries `name`, the `file` the Document sits at, exact `source`, the
30
+ `documentTargets` the collection holds as Markdown documents, the `definition`
31
+ type name or `null`, an optional `move`, an optional `links` inventory, an
32
+ optional `relabel`, an optional `filtered`, and `expected`.
31
33
  A case carrying a `move` lists both the Path its target sits at and the Path the
32
34
  move takes it to, because the collection holds that target either way.
33
35
 
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
36
+ Verify the schema, parse the source, call `project(document, file, context)`
37
+ with `documentTargets` and the verified type `definition` names, and compare against `expected`. Where
38
+ `links` is present, compare `links(document, file)` against it. Then check
37
39
  that the source is unchanged. Where `move` is present, apply
38
40
  `{ kind: 'link', href, to }`, confirm the serialized Document changed, and
39
41
  confirm the projection of the moved Document is still exactly `expected`: a
40
- moved Path rewrites destinations and leaves the projection alone.
42
+ moved Path rewrites destinations and leaves the projection alone. Where
43
+ `relabel` is present, split the source at its `from`, which the source carries
44
+ exactly once, join the pieces with its `to`, parse the result, and confirm its
45
+ projection is exactly the relabel's own `expected` and differs from the case's:
46
+ a changed visible label changes the projection. Where `filtered` is present,
47
+ apply `{ kind: 'field', name: field, value, prior }` with its `field` and
48
+ `value` and the Document's current value as `prior`, confirm the serialized
49
+ Document changed, and confirm its projection is still exactly `expected`: a
50
+ change to a value that is not prose leaves the projection alone.
51
+
52
+ ## Division
53
+
54
+ `division.json` exercises the public `divide` seam separately from the
55
+ validation Libraries. It carries `schema` and `cases` like `projection.json`,
56
+ and each case adds the `bound` the division runs under. Parse the source, call
57
+ `divide(document, file, context)` with `{ documentTargets, definition, bound }`,
58
+ and compare against `expected`: either `{ "ok": true, "spans": [...] }`, where
59
+ each span carries the exact `text` to embed and the exact `source` the returned
60
+ `start` and `end` address in that case's source, or `{ "ok": false, "refusal": ... }`. Then
61
+ check that the source is unchanged. A span's `text` and `source` differ where
62
+ the embedded text repeats a continuation's own heading, carries an internal
63
+ link's visible label, or carries a frontmatter value without the quotes the
64
+ author wrote, and where the addressed extent encloses a declared structured
65
+ section between two pieces one span packs together or the whole of a free-text
66
+ value one span carries part of. `start` and `end` are UTF-8 byte offsets into the case's
67
+ source; every source in this corpus is ASCII, so a consumer compares the
68
+ addressed `source` with an ordinary string slice.
69
+
70
+ ## Queries
71
+
72
+ `queries.json` is the one table of cases both query evaluators answer. It carries `schema`,
73
+ one schema text; `documents`, each named and carrying its `path`, the `type` a collection
74
+ stores for it (`any` for an untyped Markdown Document, `null` for one that is not Markdown),
75
+ its `fileId`, the `text` the device holds or `null`, and its `fields`; and `cases`, each with a
76
+ `name`, a `query` of filter parts, the `document` it names and whether it `matches`. Verify
77
+ the schema and plan `{ ...query, select: {} }` with `planOf` against its types. Then
78
+ `matches(plan, candidate)` over the named Document, given its type's definition, and the
79
+ condition `sql.tests` writes over a collection holding every Document of the table with the
80
+ values `indexed` derives from it must both answer `matches`. A new operator adds its cases
81
+ here first.
41
82
 
42
83
  ## Verdict format
43
84
 
@@ -53,54 +94,70 @@ Refusal:
53
94
  {
54
95
  "verdict": "refuse",
55
96
  "file": "<library path>",
56
- "location": "<field or section name>",
97
+ "location": "<JSON Pointer or section name>",
57
98
  "rule": "<rule id>",
58
- "version": "<package version>",
59
99
  "referrers": ["<library path>"]
60
100
  }
61
101
  ```
62
102
 
63
- `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.
103
+ `location` is the JSON Pointer of the frontmatter value a rule concerns, such
104
+ as `/shipping/city`, or the name of the section it concerns, and is omitted when
105
+ the rule concerns neither. `referrers` is present only for
106
+ `referenced-missing-file`. A schema refusal carries no `file`; its `location`
107
+ is the JSON Pointer of the schema part it concerns, such as
108
+ `/task/properties/title/type`, or `line <n>` for `schema-yaml`.
67
109
 
68
110
  ## Rule ids
69
111
 
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 text, 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 or list section 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
- | `undeclared-field` | A typed file carries a frontmatter field its type does not declare |
92
- | `unresolved-reference` | A reference does not resolve to a current file of the required type |
93
- | `unresolved-link` | A relative body link does not resolve to a current path |
94
- | `structured-section` | A declared structured-list section does not parse as a list |
95
- | `referenced-missing-file` | Remaining files still reference an absent path |
96
- | `unwritable-link` | No Markdown destination form can carry a new link destination |
97
-
98
- `unwritable-link` is refused by `apply`, not by `validate`, so no case under
99
- `cases/` carries it.
112
+ A frontmatter value that fails a JSON Schema keyword is refused under that
113
+ keyword's name, such as `required`, `type`, `enum`, `format`, `pattern`,
114
+ `minimum`, `maxLength`, `maxItems` or `oneOf`, at the value's JSON Pointer; a
115
+ missing required key is named by the Pointer it would sit at. A malformed
116
+ schema keyword is refused under that keyword's name at its Pointer in the
117
+ schema text. The model's own rules:
118
+
119
+ | Rule | When |
120
+ | ------------------------- | --------------------------------------------------------------------------------- |
121
+ | `binary-target-document` | A path is declared as both a text Document and a binary target |
122
+ | `frontmatter-fence` | A present frontmatter fence does not parse as the accepted YAML subset |
123
+ | `schema-yaml` | A schema text is not a mapping in the accepted YAML subset |
124
+ | `schema-type-name` | A type name is empty, starts with `$`, or is `any` or `attachment` |
125
+ | `provided-type` | A schema names a type its caller provides with a key but its two role keywords |
126
+ | `schema` | A type or subschema is neither a mapping nor a boolean |
127
+ | `schema-keyword` | A schema carries a key that is no JSON Schema 2020-12 keyword the model admits |
128
+ | `$defs` | `$defs` is not a mapping |
129
+ | `$ref` | A `$ref` reaches no subschema under `#/$defs/` of the same file |
130
+ | `reference` | `reference` is not on a string or names something but a type, `any`, `attachment` |
131
+ | `sections` | A section is not `{ kind: text }` or `{ kind: list, items }` over one scalar |
132
+ | `member_document` | The mark is not a boolean, or a second type carries it |
133
+ | `unknown-type` | A file declares a type absent from the governing schema, or other than its typed path requires it to name |
134
+ | `undeclared-field` | A closed object carries a key it does not declare |
135
+ | `required-section` | A required section heading is missing |
136
+ | `conditional-section` | A section its type's `if` branch requires is absent or holds no text |
137
+ | `unresolved-reference` | A reference at any depth or a section item reaches no member it admits |
138
+ | `unresolved-link` | A body link is an absolute path, leaves the collection or, from a typed Document at a document path, reaches a reserved name |
139
+ | `room-md-type` | `ROOM.md` declares a type |
140
+ | `required-body` | A file at a typed path that requires a body has a body holding no text |
141
+ | `structured-section` | A declared list section is not a list of values of its item schema |
142
+ | `referenced-missing-file` | Remaining files still reference an absent path |
143
+ | `unwritable-link` | No Markdown destination form can carry a new link destination |
144
+ | `division-bound` | A division bound is not a whole number of at least 2 |
145
+
146
+ A `then` or `else` of an `if` on a type, in its `allOf` or in such a branch may hold
147
+ `sections`, naming sections the type declares as the type declares them, else `sections`.
148
+
149
+ `unwritable-link` is refused by `apply` and `division-bound` by `divide`, not
150
+ by `validate`, so no case under `cases/` carries either.
151
+
152
+ A reference that admits `attachment` reaches any path in the same Library, so
153
+ neither `unresolved-reference` for an absent target nor
154
+ `referenced-missing-file` ever names it. A body link to an absent path in the
155
+ Library is accepted too, so `unresolved-link` never names it and
156
+ `referenced-missing-file` never counts it.
100
157
 
101
158
  ## YAML subset
102
159
 
103
- Frontmatter is a mapping in a closed YAML subset: block and flow mappings,
104
- block and flow sequences, plain and quoted scalars, `true`, `false`, `null`,
160
+ Frontmatter and a schema text are each a mapping in a closed YAML subset: block and flow mappings,
161
+ block and flow sequences, a block sequence item that opens a mapping, plain and quoted scalars (a single-quoted scalar doubles its apostrophe, a double-quoted one takes JSON's escapes), `true`, `false`, `null`,
105
162
  and decimal numbers. It does not take YAML 1.1 boolean or timestamp aliases,
106
- octal numbers, anchors, tags, or block scalars.
163
+ octal numbers, anchors, tags, or block scalars. A mapping carries each key once.
@@ -0,0 +1,8 @@
1
+ ---
2
+ type: task
3
+ title: Ship
4
+ ---
5
+
6
+ ## Description
7
+
8
+ See [plan](missing.md).
@@ -0,0 +1,6 @@
1
+ task:
2
+ properties:
3
+ title: { type: string }
4
+ required: [title]
5
+ sections:
6
+ Description: { kind: text, required: true }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: company
3
+ name: Acme
4
+ ---
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: deal
3
+ title: Lead
4
+ company: ../companies/acme.md
5
+ stage: lead
6
+ ---
@@ -0,0 +1,56 @@
1
+ $defs:
2
+ address:
3
+ type: object
4
+ properties:
5
+ city: { type: string }
6
+ country: { type: string, pattern: '^[A-Z]{2}$' }
7
+ required: [city]
8
+ company:
9
+ properties:
10
+ name: { type: string }
11
+ deal:
12
+ type: object
13
+ properties:
14
+ title: { type: string, minLength: 1, maxLength: 40 }
15
+ company: { type: string, reference: company }
16
+ stage: { enum: [lead, proposal, won, lost], default: lead }
17
+ amount: { type: integer, minimum: 0 }
18
+ probability: { type: number, minimum: 0, maximum: 1 }
19
+ open: { type: boolean }
20
+ closes_at: { type: string, format: date-time }
21
+ contact_email: { type: string, format: email }
22
+ note: { type: [string, 'null'] }
23
+ shipping: { $ref: '#/$defs/address' }
24
+ tags: { type: array, items: { type: string }, maxItems: 3 }
25
+ lines:
26
+ type: array
27
+ items:
28
+ type: object
29
+ properties:
30
+ product: { type: string }
31
+ quantity: { type: integer, minimum: 1 }
32
+ required: [product, quantity]
33
+ blocks:
34
+ type: array
35
+ items:
36
+ oneOf:
37
+ - properties:
38
+ kind: { const: paragraph }
39
+ text: { type: string }
40
+ required: [kind, text]
41
+ - properties:
42
+ kind: { const: quiz }
43
+ question: { type: string }
44
+ required: [kind, question]
45
+ attributes:
46
+ type: object
47
+ additionalProperties: { type: string }
48
+ required: [title, company, stage]
49
+ if:
50
+ properties:
51
+ stage: { const: won }
52
+ required: [stage]
53
+ then:
54
+ required: [amount]
55
+ sections:
56
+ Description: { kind: text }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,5 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "item.md",
4
+ "rule": "unresolved-link"
5
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ type: task
3
+ title: Ship
4
+ ---
5
+
6
+ ## Description
7
+
8
+ See [plan](/notes/plan.md).
@@ -0,0 +1,6 @@
1
+ task:
2
+ properties:
3
+ title: { type: string }
4
+ required: [title]
5
+ sections:
6
+ Description: { kind: text, required: true }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: company
3
+ name: Acme
4
+ ---
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: deal
3
+ title: Renewal
4
+ company: ../companies/acme.md
5
+ shipping:
6
+ city: Paris
7
+ depot: ../places/depot.md
8
+ lines:
9
+ - product: ../products/seats.md
10
+ quantity: 10
11
+ - { product: ../products/support.md, quantity: 1 }
12
+ contract: ../products/seats.md
13
+ ---
14
+
15
+ The yearly renewal.
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: place
3
+ name: Depot
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: product
3
+ name: Seats
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: product
3
+ name: Support
4
+ ---
@@ -0,0 +1,32 @@
1
+ $defs:
2
+ address:
3
+ type: object
4
+ properties:
5
+ city: { type: string }
6
+ depot: { type: string, reference: place }
7
+ required: [city]
8
+ company:
9
+ properties:
10
+ name: { type: string }
11
+ product:
12
+ properties:
13
+ name: { type: string }
14
+ place:
15
+ properties:
16
+ name: { type: string }
17
+ deal:
18
+ type: object
19
+ properties:
20
+ title: { type: string }
21
+ company: { type: string, reference: company }
22
+ shipping: { $ref: '#/$defs/address' }
23
+ lines:
24
+ type: array
25
+ items:
26
+ type: object
27
+ properties:
28
+ product: { type: string, reference: product }
29
+ quantity: { type: integer, minimum: 1 }
30
+ required: [product, quantity]
31
+ contract: { type: string, reference: attachment }
32
+ required: [title, company]
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: company
3
+ name: Acme
4
+ ---
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: deal
3
+ title: Renewal
4
+ company: ../companies/acme.md
5
+ shipping:
6
+ city: Paris
7
+ depot: ../places/depot.md
8
+ lines:
9
+ - product: ../products/seats.md
10
+ quantity: 10
11
+ - { product: ../products/support.md, quantity: 1 }
12
+ contract: ../assets/contract.pdf
13
+ ---
14
+
15
+ The yearly renewal.
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: place
3
+ name: Depot
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: product
3
+ name: Seats
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: product
3
+ name: Support
4
+ ---
@@ -0,0 +1,32 @@
1
+ $defs:
2
+ address:
3
+ type: object
4
+ properties:
5
+ city: { type: string }
6
+ depot: { type: string, reference: place }
7
+ required: [city]
8
+ company:
9
+ properties:
10
+ name: { type: string }
11
+ product:
12
+ properties:
13
+ name: { type: string }
14
+ place:
15
+ properties:
16
+ name: { type: string }
17
+ deal:
18
+ type: object
19
+ properties:
20
+ title: { type: string }
21
+ company: { type: string, reference: company }
22
+ shipping: { $ref: '#/$defs/address' }
23
+ lines:
24
+ type: array
25
+ items:
26
+ type: object
27
+ properties:
28
+ product: { type: string, reference: product }
29
+ quantity: { type: integer, minimum: 1 }
30
+ required: [product, quantity]
31
+ contract: { type: string, reference: attachment }
32
+ required: [title, company]
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1,6 @@
1
+ {
2
+ "verdict": "refuse",
3
+ "file": "deals/renewal.md",
4
+ "location": "/contract",
5
+ "rule": "unresolved-reference"
6
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: company
3
+ name: Acme
4
+ ---
@@ -0,0 +1,15 @@
1
+ ---
2
+ type: deal
3
+ title: Renewal
4
+ company: ../companies/acme.md
5
+ shipping:
6
+ city: Paris
7
+ depot: ../places/depot.md
8
+ lines:
9
+ - product: ../products/seats.md
10
+ quantity: 10
11
+ - { product: ../products/support.md, quantity: 1 }
12
+ contract: /rooms/other/assets/contract.pdf
13
+ ---
14
+
15
+ The yearly renewal.
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: place
3
+ name: Depot
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: product
3
+ name: Seats
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ type: product
3
+ name: Support
4
+ ---
@@ -0,0 +1,32 @@
1
+ $defs:
2
+ address:
3
+ type: object
4
+ properties:
5
+ city: { type: string }
6
+ depot: { type: string, reference: place }
7
+ required: [city]
8
+ company:
9
+ properties:
10
+ name: { type: string }
11
+ product:
12
+ properties:
13
+ name: { type: string }
14
+ place:
15
+ properties:
16
+ name: { type: string }
17
+ deal:
18
+ type: object
19
+ properties:
20
+ title: { type: string }
21
+ company: { type: string, reference: company }
22
+ shipping: { $ref: '#/$defs/address' }
23
+ lines:
24
+ type: array
25
+ items:
26
+ type: object
27
+ properties:
28
+ product: { type: string, reference: product }
29
+ quantity: { type: integer, minimum: 1 }
30
+ required: [product, quantity]
31
+ contract: { type: string, reference: attachment }
32
+ required: [title, company]
@@ -2,6 +2,5 @@
2
2
  "verdict": "refuse",
3
3
  "file": "notes/draft.md",
4
4
  "rule": "unresolved-reference",
5
- "version": "<package-version>",
6
- "location": "subject"
5
+ "location": "/subject"
7
6
  }
@@ -0,0 +1,4 @@
1
+ note:
2
+ properties:
3
+ subject: { type: string, reference: any }
4
+ required: [subject]
@@ -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 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1 @@
1
+ note: {}
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1 @@
1
+ note: {}