@driftsys/markspec 0.4.0 → 0.6.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 (632) hide show
  1. package/README.md +74 -20
  2. package/esm/ast/build.d.ts +60 -0
  3. package/esm/ast/build.d.ts.map +1 -0
  4. package/esm/ast/build.js +516 -0
  5. package/esm/ast/equivalence.d.ts +18 -0
  6. package/esm/ast/equivalence.d.ts.map +1 -0
  7. package/esm/ast/equivalence.js +56 -0
  8. package/esm/ast/nodes.d.ts +189 -0
  9. package/esm/ast/nodes.d.ts.map +1 -0
  10. package/esm/ast/nodes.js +17 -0
  11. package/esm/ast/normalize.d.ts +58 -0
  12. package/esm/ast/normalize.d.ts.map +1 -0
  13. package/esm/ast/normalize.js +197 -0
  14. package/esm/ast/render.d.ts +34 -0
  15. package/esm/ast/render.d.ts.map +1 -0
  16. package/esm/ast/render.js +215 -0
  17. package/esm/compiler/constants.d.ts +16 -0
  18. package/esm/compiler/constants.d.ts.map +1 -0
  19. package/esm/compiler/constants.js +26 -0
  20. package/esm/compiler/discipline_classifier.d.ts +55 -0
  21. package/esm/compiler/discipline_classifier.d.ts.map +1 -0
  22. package/esm/compiler/discipline_classifier.js +191 -0
  23. package/esm/compiler/inverses.d.ts +2 -1
  24. package/esm/compiler/inverses.d.ts.map +1 -1
  25. package/esm/compiler/inverses.js +33 -14
  26. package/esm/compiler/manifest.d.ts +59 -0
  27. package/esm/compiler/manifest.d.ts.map +1 -0
  28. package/esm/compiler/manifest.js +48 -0
  29. package/esm/compiler/mod.d.ts +38 -1
  30. package/esm/compiler/mod.d.ts.map +1 -1
  31. package/esm/compiler/mod.js +202 -50
  32. package/esm/compiler/ndjson_writer.d.ts +50 -0
  33. package/esm/compiler/ndjson_writer.d.ts.map +1 -0
  34. package/esm/compiler/ndjson_writer.js +73 -0
  35. package/esm/compiler/schema.d.ts +33 -1
  36. package/esm/compiler/schema.d.ts.map +1 -1
  37. package/esm/compiler/schema.js +30 -9
  38. package/esm/config/markspec.d.ts +5 -0
  39. package/esm/config/markspec.d.ts.map +1 -1
  40. package/esm/config/markspec.js +17 -2
  41. package/esm/config/mod.d.ts.map +1 -1
  42. package/esm/config/mod.js +54 -0
  43. package/esm/formatter/mod.d.ts +55 -4
  44. package/esm/formatter/mod.d.ts.map +1 -1
  45. package/esm/formatter/mod.js +423 -46
  46. package/esm/formatter/synth_ulid.d.ts +21 -0
  47. package/esm/formatter/synth_ulid.d.ts.map +1 -0
  48. package/esm/formatter/synth_ulid.js +64 -0
  49. package/esm/lexicons/loader.d.ts +35 -0
  50. package/esm/lexicons/loader.d.ts.map +1 -0
  51. package/esm/lexicons/loader.js +51 -0
  52. package/esm/lexicons/mod.d.ts +13 -0
  53. package/esm/lexicons/mod.d.ts.map +1 -0
  54. package/esm/lexicons/mod.js +12 -0
  55. package/esm/lint/glossary.d.ts +45 -0
  56. package/esm/lint/glossary.d.ts.map +1 -0
  57. package/esm/lint/glossary.js +85 -0
  58. package/esm/lint/mod.d.ts +14 -0
  59. package/esm/lint/mod.d.ts.map +1 -0
  60. package/esm/lint/mod.js +9 -0
  61. package/esm/lint/range_util.d.ts +25 -0
  62. package/esm/lint/range_util.d.ts.map +1 -0
  63. package/esm/lint/range_util.js +50 -0
  64. package/esm/lint/rules/ears.d.ts +39 -0
  65. package/esm/lint/rules/ears.d.ts.map +1 -0
  66. package/esm/lint/rules/ears.js +316 -0
  67. package/esm/lint/rules/incose_sentence.d.ts +46 -0
  68. package/esm/lint/rules/incose_sentence.d.ts.map +1 -0
  69. package/esm/lint/rules/incose_sentence.js +417 -0
  70. package/esm/lint/rules/lexicon.d.ts +24 -0
  71. package/esm/lint/rules/lexicon.d.ts.map +1 -0
  72. package/esm/lint/rules/lexicon.js +236 -0
  73. package/esm/lint/rules/modal_sentence.d.ts +46 -0
  74. package/esm/lint/rules/modal_sentence.d.ts.map +1 -0
  75. package/esm/lint/rules/modal_sentence.js +146 -0
  76. package/esm/lint/rules/passive.d.ts +64 -0
  77. package/esm/lint/rules/passive.d.ts.map +1 -0
  78. package/esm/lint/rules/passive.js +282 -0
  79. package/esm/lint/rules/struct.d.ts +17 -0
  80. package/esm/lint/rules/struct.d.ts.map +1 -0
  81. package/esm/lint/rules/struct.js +55 -0
  82. package/esm/lint/rules/suppression.d.ts +54 -0
  83. package/esm/lint/rules/suppression.d.ts.map +1 -0
  84. package/esm/lint/rules/suppression.js +129 -0
  85. package/esm/lint/rules/xref.d.ts +19 -0
  86. package/esm/lint/rules/xref.d.ts.map +1 -0
  87. package/esm/lint/rules/xref.js +248 -0
  88. package/esm/lint/runner.d.ts +59 -0
  89. package/esm/lint/runner.d.ts.map +1 -0
  90. package/esm/lint/runner.js +153 -0
  91. package/esm/lint/score.d.ts +64 -0
  92. package/esm/lint/score.d.ts.map +1 -0
  93. package/esm/lint/score.js +163 -0
  94. package/esm/lint/segmenter.d.ts +32 -0
  95. package/esm/lint/segmenter.d.ts.map +1 -0
  96. package/esm/lint/segmenter.js +79 -0
  97. package/esm/lint/types.d.ts +31 -0
  98. package/esm/lint/types.d.ts.map +1 -0
  99. package/esm/lint/types.js +9 -0
  100. package/esm/lock/canonical_edges.d.ts +31 -0
  101. package/esm/lock/canonical_edges.d.ts.map +1 -0
  102. package/esm/lock/canonical_edges.js +57 -0
  103. package/esm/lock/check.d.ts +24 -0
  104. package/esm/lock/check.d.ts.map +1 -0
  105. package/esm/lock/check.js +127 -0
  106. package/esm/lock/hash.d.ts +12 -0
  107. package/esm/lock/hash.d.ts.map +1 -0
  108. package/esm/lock/hash.js +32 -0
  109. package/esm/lock/mod.d.ts +19 -0
  110. package/esm/lock/mod.d.ts.map +1 -0
  111. package/esm/lock/mod.js +14 -0
  112. package/esm/lock/model.d.ts +81 -0
  113. package/esm/lock/model.d.ts.map +1 -0
  114. package/esm/lock/model.js +7 -0
  115. package/esm/lock/parser.d.ts +26 -0
  116. package/esm/lock/parser.d.ts.map +1 -0
  117. package/esm/lock/parser.js +195 -0
  118. package/esm/lock/resolve.d.ts +142 -0
  119. package/esm/lock/resolve.d.ts.map +1 -0
  120. package/esm/lock/resolve.js +389 -0
  121. package/esm/lock/serializer.d.ts +14 -0
  122. package/esm/lock/serializer.d.ts.map +1 -0
  123. package/esm/lock/serializer.js +104 -0
  124. package/esm/mod.d.ts +28 -8
  125. package/esm/mod.d.ts.map +1 -1
  126. package/esm/mod.js +23 -4
  127. package/esm/model/attributes.d.ts +6 -0
  128. package/esm/model/attributes.d.ts.map +1 -1
  129. package/esm/model/attributes.js +200 -2
  130. package/esm/model/discipline.d.ts +53 -0
  131. package/esm/model/discipline.d.ts.map +1 -0
  132. package/esm/model/discipline.js +50 -0
  133. package/esm/model/discriminating_attr.d.ts +33 -0
  134. package/esm/model/discriminating_attr.d.ts.map +1 -0
  135. package/esm/model/discriminating_attr.js +74 -0
  136. package/esm/model/mod.d.ts +267 -14
  137. package/esm/model/mod.d.ts.map +1 -1
  138. package/esm/model/mod.js +99 -3
  139. package/esm/model/profile.d.ts +102 -27
  140. package/esm/model/profile.d.ts.map +1 -1
  141. package/esm/model/source_introspection.d.ts +26 -0
  142. package/esm/model/source_introspection.d.ts.map +1 -0
  143. package/esm/model/source_introspection.js +77 -0
  144. package/esm/model/type_hierarchy.d.ts +51 -0
  145. package/esm/model/type_hierarchy.d.ts.map +1 -0
  146. package/esm/model/type_hierarchy.js +126 -0
  147. package/esm/model/uri_scheme_map.d.ts +21 -0
  148. package/esm/model/uri_scheme_map.d.ts.map +1 -0
  149. package/esm/model/uri_scheme_map.js +66 -0
  150. package/esm/parser/attributes.d.ts.map +1 -1
  151. package/esm/parser/attributes.js +10 -16
  152. package/esm/parser/body_tokens.d.ts +35 -0
  153. package/esm/parser/body_tokens.d.ts.map +1 -0
  154. package/esm/parser/body_tokens.js +232 -0
  155. package/esm/parser/glossary.d.ts +51 -0
  156. package/esm/parser/glossary.d.ts.map +1 -0
  157. package/esm/parser/glossary.js +219 -0
  158. package/esm/parser/grammars.d.ts +5 -3
  159. package/esm/parser/grammars.d.ts.map +1 -1
  160. package/esm/parser/grammars.js +12 -4
  161. package/esm/parser/language_spec.d.ts +55 -0
  162. package/esm/parser/language_spec.d.ts.map +1 -0
  163. package/esm/parser/language_spec.js +419 -0
  164. package/esm/parser/line_map.d.ts +60 -0
  165. package/esm/parser/line_map.d.ts.map +1 -0
  166. package/esm/parser/line_map.js +41 -0
  167. package/esm/parser/markdown.d.ts +9 -0
  168. package/esm/parser/markdown.d.ts.map +1 -1
  169. package/esm/parser/markdown.js +317 -25
  170. package/esm/parser/mod.d.ts +5 -0
  171. package/esm/parser/mod.d.ts.map +1 -1
  172. package/esm/parser/mod.js +31 -8
  173. package/esm/parser/source.d.ts +53 -2
  174. package/esm/parser/source.d.ts.map +1 -1
  175. package/esm/parser/source.js +158 -68
  176. package/esm/parser/translate.d.ts +24 -0
  177. package/esm/parser/translate.d.ts.map +1 -0
  178. package/esm/parser/translate.js +99 -0
  179. package/esm/profile/chain.d.ts +8 -0
  180. package/esm/profile/chain.d.ts.map +1 -1
  181. package/esm/profile/chain.js +32 -14
  182. package/esm/profile/colors.js +1 -1
  183. package/esm/profile/default_profile.d.ts +25 -0
  184. package/esm/profile/default_profile.d.ts.map +1 -0
  185. package/esm/profile/default_profile.js +43 -0
  186. package/esm/profile/discipline_mode.d.ts +64 -0
  187. package/esm/profile/discipline_mode.d.ts.map +1 -0
  188. package/esm/profile/discipline_mode.js +133 -0
  189. package/esm/profile/discipline_registry.d.ts +41 -0
  190. package/esm/profile/discipline_registry.d.ts.map +1 -0
  191. package/esm/profile/discipline_registry.js +67 -0
  192. package/esm/profile/introspect.d.ts +135 -0
  193. package/esm/profile/introspect.d.ts.map +1 -0
  194. package/esm/profile/introspect.js +378 -0
  195. package/esm/profile/load.d.ts +3 -1
  196. package/esm/profile/load.d.ts.map +1 -1
  197. package/esm/profile/load.js +91 -5
  198. package/esm/profile/manifest.d.ts.map +1 -1
  199. package/esm/profile/manifest.js +512 -90
  200. package/esm/profile/merge.d.ts.map +1 -1
  201. package/esm/profile/merge.js +251 -39
  202. package/esm/profile/mod.d.ts +4 -4
  203. package/esm/profile/mod.d.ts.map +1 -1
  204. package/esm/profile/mod.js +7 -2
  205. package/esm/reporter/mod.js +4 -4
  206. package/esm/sync/locked_attributes.d.ts +19 -0
  207. package/esm/sync/locked_attributes.d.ts.map +1 -0
  208. package/esm/sync/locked_attributes.js +27 -0
  209. package/esm/sync/log.d.ts +34 -0
  210. package/esm/sync/log.d.ts.map +1 -0
  211. package/esm/sync/log.js +48 -0
  212. package/esm/sync/mapping.d.ts +66 -0
  213. package/esm/sync/mapping.d.ts.map +1 -0
  214. package/esm/sync/mapping.js +165 -0
  215. package/esm/sync/mod.d.ts +16 -0
  216. package/esm/sync/mod.d.ts.map +1 -0
  217. package/esm/sync/mod.js +12 -0
  218. package/esm/sync/status.d.ts +23 -0
  219. package/esm/sync/status.d.ts.map +1 -0
  220. package/esm/sync/status.js +21 -0
  221. package/esm/typl/ast.d.ts +87 -0
  222. package/esm/typl/ast.d.ts.map +1 -0
  223. package/esm/typl/ast.js +21 -0
  224. package/esm/typl/bridge.d.ts +32 -0
  225. package/esm/typl/bridge.d.ts.map +1 -0
  226. package/esm/typl/bridge.js +27 -0
  227. package/esm/typl/bullet.d.ts +34 -0
  228. package/esm/typl/bullet.d.ts.map +1 -0
  229. package/esm/typl/bullet.js +44 -0
  230. package/esm/typl/diagnostics.d.ts +43 -0
  231. package/esm/typl/diagnostics.d.ts.map +1 -0
  232. package/esm/typl/diagnostics.js +61 -0
  233. package/esm/typl/fence.d.ts +31 -0
  234. package/esm/typl/fence.d.ts.map +1 -0
  235. package/esm/typl/fence.js +24 -0
  236. package/esm/typl/grammar.d.ts +20 -0
  237. package/esm/typl/grammar.d.ts.map +1 -0
  238. package/esm/typl/grammar.js +471 -0
  239. package/esm/typl/inline.d.ts +34 -0
  240. package/esm/typl/inline.d.ts.map +1 -0
  241. package/esm/typl/inline.js +48 -0
  242. package/esm/typl/lexer.d.ts +37 -0
  243. package/esm/typl/lexer.d.ts.map +1 -0
  244. package/esm/typl/lexer.js +234 -0
  245. package/esm/typl/mod.d.ts +23 -0
  246. package/esm/typl/mod.d.ts.map +1 -0
  247. package/esm/typl/mod.js +16 -0
  248. package/esm/typl/registry.d.ts +42 -0
  249. package/esm/typl/registry.d.ts.map +1 -0
  250. package/esm/typl/registry.js +26 -0
  251. package/esm/typl/validator.d.ts +29 -0
  252. package/esm/typl/validator.d.ts.map +1 -0
  253. package/esm/typl/validator.js +141 -0
  254. package/esm/util/fence.d.ts +30 -0
  255. package/esm/util/fence.d.ts.map +1 -0
  256. package/esm/util/fence.js +40 -0
  257. package/esm/util/line_endings.d.ts +33 -0
  258. package/esm/util/line_endings.d.ts.map +1 -0
  259. package/esm/util/line_endings.js +53 -0
  260. package/esm/util/modals.d.ts +29 -0
  261. package/esm/util/modals.d.ts.map +1 -0
  262. package/esm/util/modals.js +38 -0
  263. package/esm/validator/attributes.d.ts +3 -3
  264. package/esm/validator/attributes.d.ts.map +1 -1
  265. package/esm/validator/attributes.js +1 -18
  266. package/esm/validator/body_blocks.d.ts +38 -0
  267. package/esm/validator/body_blocks.d.ts.map +1 -0
  268. package/esm/validator/body_blocks.js +218 -0
  269. package/esm/validator/caption_convention.d.ts +29 -0
  270. package/esm/validator/caption_convention.d.ts.map +1 -0
  271. package/esm/validator/caption_convention.js +58 -0
  272. package/esm/validator/captions.d.ts +22 -0
  273. package/esm/validator/captions.d.ts.map +1 -0
  274. package/esm/validator/captions.js +137 -0
  275. package/esm/validator/component_schemes.d.ts +73 -0
  276. package/esm/validator/component_schemes.d.ts.map +1 -0
  277. package/esm/validator/component_schemes.js +375 -0
  278. package/esm/validator/discipline.d.ts +35 -0
  279. package/esm/validator/discipline.d.ts.map +1 -0
  280. package/esm/validator/discipline.js +204 -0
  281. package/esm/validator/feature_ac.d.ts +28 -0
  282. package/esm/validator/feature_ac.d.ts.map +1 -0
  283. package/esm/validator/feature_ac.js +102 -0
  284. package/esm/validator/listing.d.ts +42 -0
  285. package/esm/validator/listing.d.ts.map +1 -0
  286. package/esm/validator/listing.js +295 -0
  287. package/esm/validator/mod.d.ts +3 -1
  288. package/esm/validator/mod.d.ts.map +1 -1
  289. package/esm/validator/mod.js +275 -13
  290. package/esm/validator/modal_keywords.d.ts +25 -0
  291. package/esm/validator/modal_keywords.d.ts.map +1 -0
  292. package/esm/validator/modal_keywords.js +54 -0
  293. package/esm/validator/pattern.d.ts +15 -8
  294. package/esm/validator/pattern.d.ts.map +1 -1
  295. package/esm/validator/pattern.js +42 -19
  296. package/esm/validator/per_type_attrs.d.ts +29 -0
  297. package/esm/validator/per_type_attrs.d.ts.map +1 -0
  298. package/esm/validator/per_type_attrs.js +75 -0
  299. package/esm/validator/pipeline.d.ts +18 -2
  300. package/esm/validator/pipeline.d.ts.map +1 -1
  301. package/esm/validator/pipeline.js +76 -21
  302. package/esm/validator/trace_types.d.ts +26 -0
  303. package/esm/validator/trace_types.d.ts.map +1 -0
  304. package/esm/validator/trace_types.js +232 -0
  305. package/esm/validator/traceability.d.ts +3 -4
  306. package/esm/validator/traceability.d.ts.map +1 -1
  307. package/esm/validator/traceability.js +5 -10
  308. package/esm/validator/type_resolution.d.ts +67 -0
  309. package/esm/validator/type_resolution.d.ts.map +1 -0
  310. package/esm/validator/type_resolution.js +162 -0
  311. package/esm/validator/types.d.ts +45 -0
  312. package/esm/validator/types.d.ts.map +1 -1
  313. package/esm/validator/types.js +128 -16
  314. package/esm/validator/value_types.d.ts +8 -0
  315. package/esm/validator/value_types.d.ts.map +1 -1
  316. package/esm/validator/value_types.js +8 -1
  317. package/package.json +2 -2
  318. package/script/ast/build.d.ts +60 -0
  319. package/script/ast/build.d.ts.map +1 -0
  320. package/script/ast/build.js +521 -0
  321. package/script/ast/equivalence.d.ts +18 -0
  322. package/script/ast/equivalence.d.ts.map +1 -0
  323. package/script/ast/equivalence.js +59 -0
  324. package/script/ast/nodes.d.ts +189 -0
  325. package/script/ast/nodes.d.ts.map +1 -0
  326. package/script/ast/nodes.js +18 -0
  327. package/script/ast/normalize.d.ts +58 -0
  328. package/script/ast/normalize.d.ts.map +1 -0
  329. package/script/ast/normalize.js +200 -0
  330. package/script/ast/render.d.ts +34 -0
  331. package/script/ast/render.d.ts.map +1 -0
  332. package/script/ast/render.js +218 -0
  333. package/script/compiler/constants.d.ts +16 -0
  334. package/script/compiler/constants.d.ts.map +1 -0
  335. package/script/compiler/constants.js +29 -0
  336. package/script/compiler/discipline_classifier.d.ts +55 -0
  337. package/script/compiler/discipline_classifier.d.ts.map +1 -0
  338. package/script/compiler/discipline_classifier.js +196 -0
  339. package/script/compiler/inverses.d.ts +2 -1
  340. package/script/compiler/inverses.d.ts.map +1 -1
  341. package/script/compiler/inverses.js +33 -14
  342. package/script/compiler/manifest.d.ts +59 -0
  343. package/script/compiler/manifest.d.ts.map +1 -0
  344. package/script/compiler/manifest.js +51 -0
  345. package/script/compiler/mod.d.ts +38 -1
  346. package/script/compiler/mod.d.ts.map +1 -1
  347. package/script/compiler/mod.js +206 -54
  348. package/script/compiler/ndjson_writer.d.ts +50 -0
  349. package/script/compiler/ndjson_writer.d.ts.map +1 -0
  350. package/script/compiler/ndjson_writer.js +78 -0
  351. package/script/compiler/schema.d.ts +33 -1
  352. package/script/compiler/schema.d.ts.map +1 -1
  353. package/script/compiler/schema.js +30 -8
  354. package/script/config/markspec.d.ts +5 -0
  355. package/script/config/markspec.d.ts.map +1 -1
  356. package/script/config/markspec.js +17 -2
  357. package/script/config/mod.d.ts.map +1 -1
  358. package/script/config/mod.js +54 -0
  359. package/script/formatter/mod.d.ts +55 -4
  360. package/script/formatter/mod.d.ts.map +1 -1
  361. package/script/formatter/mod.js +426 -46
  362. package/script/formatter/synth_ulid.d.ts +21 -0
  363. package/script/formatter/synth_ulid.d.ts.map +1 -0
  364. package/script/formatter/synth_ulid.js +67 -0
  365. package/script/lexicons/loader.d.ts +35 -0
  366. package/script/lexicons/loader.d.ts.map +1 -0
  367. package/script/lexicons/loader.js +55 -0
  368. package/script/lexicons/mod.d.ts +13 -0
  369. package/script/lexicons/mod.d.ts.map +1 -0
  370. package/script/lexicons/mod.js +17 -0
  371. package/script/lint/glossary.d.ts +45 -0
  372. package/script/lint/glossary.d.ts.map +1 -0
  373. package/script/lint/glossary.js +88 -0
  374. package/script/lint/mod.d.ts +14 -0
  375. package/script/lint/mod.d.ts.map +1 -0
  376. package/script/lint/mod.js +17 -0
  377. package/script/lint/range_util.d.ts +25 -0
  378. package/script/lint/range_util.d.ts.map +1 -0
  379. package/script/lint/range_util.js +53 -0
  380. package/script/lint/rules/ears.d.ts +39 -0
  381. package/script/lint/rules/ears.d.ts.map +1 -0
  382. package/script/lint/rules/ears.js +320 -0
  383. package/script/lint/rules/incose_sentence.d.ts +46 -0
  384. package/script/lint/rules/incose_sentence.d.ts.map +1 -0
  385. package/script/lint/rules/incose_sentence.js +421 -0
  386. package/script/lint/rules/lexicon.d.ts +24 -0
  387. package/script/lint/rules/lexicon.d.ts.map +1 -0
  388. package/script/lint/rules/lexicon.js +240 -0
  389. package/script/lint/rules/modal_sentence.d.ts +46 -0
  390. package/script/lint/rules/modal_sentence.d.ts.map +1 -0
  391. package/script/lint/rules/modal_sentence.js +150 -0
  392. package/script/lint/rules/passive.d.ts +64 -0
  393. package/script/lint/rules/passive.d.ts.map +1 -0
  394. package/script/lint/rules/passive.js +286 -0
  395. package/script/lint/rules/struct.d.ts +17 -0
  396. package/script/lint/rules/struct.d.ts.map +1 -0
  397. package/script/lint/rules/struct.js +59 -0
  398. package/script/lint/rules/suppression.d.ts +54 -0
  399. package/script/lint/rules/suppression.d.ts.map +1 -0
  400. package/script/lint/rules/suppression.js +136 -0
  401. package/script/lint/rules/xref.d.ts +19 -0
  402. package/script/lint/rules/xref.d.ts.map +1 -0
  403. package/script/lint/rules/xref.js +251 -0
  404. package/script/lint/runner.d.ts +59 -0
  405. package/script/lint/runner.d.ts.map +1 -0
  406. package/script/lint/runner.js +157 -0
  407. package/script/lint/score.d.ts +64 -0
  408. package/script/lint/score.d.ts.map +1 -0
  409. package/script/lint/score.js +167 -0
  410. package/script/lint/segmenter.d.ts +32 -0
  411. package/script/lint/segmenter.d.ts.map +1 -0
  412. package/script/lint/segmenter.js +82 -0
  413. package/script/lint/types.d.ts +31 -0
  414. package/script/lint/types.d.ts.map +1 -0
  415. package/script/lint/types.js +10 -0
  416. package/script/lock/canonical_edges.d.ts +31 -0
  417. package/script/lock/canonical_edges.d.ts.map +1 -0
  418. package/script/lock/canonical_edges.js +61 -0
  419. package/script/lock/check.d.ts +24 -0
  420. package/script/lock/check.d.ts.map +1 -0
  421. package/script/lock/check.js +130 -0
  422. package/script/lock/hash.d.ts +12 -0
  423. package/script/lock/hash.d.ts.map +1 -0
  424. package/script/lock/hash.js +36 -0
  425. package/script/lock/mod.d.ts +19 -0
  426. package/script/lock/mod.d.ts.map +1 -0
  427. package/script/lock/mod.js +31 -0
  428. package/script/lock/model.d.ts +81 -0
  429. package/script/lock/model.d.ts.map +1 -0
  430. package/script/lock/model.js +10 -0
  431. package/script/lock/parser.d.ts +26 -0
  432. package/script/lock/parser.d.ts.map +1 -0
  433. package/script/lock/parser.js +198 -0
  434. package/script/lock/resolve.d.ts +142 -0
  435. package/script/lock/resolve.d.ts.map +1 -0
  436. package/script/lock/resolve.js +397 -0
  437. package/script/lock/serializer.d.ts +14 -0
  438. package/script/lock/serializer.d.ts.map +1 -0
  439. package/script/lock/serializer.js +107 -0
  440. package/script/mod.d.ts +28 -8
  441. package/script/mod.d.ts.map +1 -1
  442. package/script/mod.js +129 -32
  443. package/script/model/attributes.d.ts +6 -0
  444. package/script/model/attributes.d.ts.map +1 -1
  445. package/script/model/attributes.js +201 -3
  446. package/script/model/discipline.d.ts +53 -0
  447. package/script/model/discipline.d.ts.map +1 -0
  448. package/script/model/discipline.js +53 -0
  449. package/script/model/discriminating_attr.d.ts +33 -0
  450. package/script/model/discriminating_attr.d.ts.map +1 -0
  451. package/script/model/discriminating_attr.js +77 -0
  452. package/script/model/mod.d.ts +267 -14
  453. package/script/model/mod.d.ts.map +1 -1
  454. package/script/model/mod.js +111 -3
  455. package/script/model/profile.d.ts +102 -27
  456. package/script/model/profile.d.ts.map +1 -1
  457. package/script/model/source_introspection.d.ts +26 -0
  458. package/script/model/source_introspection.d.ts.map +1 -0
  459. package/script/model/source_introspection.js +80 -0
  460. package/script/model/type_hierarchy.d.ts +51 -0
  461. package/script/model/type_hierarchy.d.ts.map +1 -0
  462. package/script/model/type_hierarchy.js +130 -0
  463. package/script/model/uri_scheme_map.d.ts +21 -0
  464. package/script/model/uri_scheme_map.d.ts.map +1 -0
  465. package/script/model/uri_scheme_map.js +69 -0
  466. package/script/parser/attributes.d.ts.map +1 -1
  467. package/script/parser/attributes.js +10 -16
  468. package/script/parser/body_tokens.d.ts +35 -0
  469. package/script/parser/body_tokens.d.ts.map +1 -0
  470. package/script/parser/body_tokens.js +235 -0
  471. package/script/parser/glossary.d.ts +51 -0
  472. package/script/parser/glossary.d.ts.map +1 -0
  473. package/script/parser/glossary.js +224 -0
  474. package/script/parser/grammars.d.ts +5 -3
  475. package/script/parser/grammars.d.ts.map +1 -1
  476. package/script/parser/grammars.js +15 -8
  477. package/script/parser/language_spec.d.ts +55 -0
  478. package/script/parser/language_spec.d.ts.map +1 -0
  479. package/script/parser/language_spec.js +423 -0
  480. package/script/parser/line_map.d.ts +60 -0
  481. package/script/parser/line_map.d.ts.map +1 -0
  482. package/script/parser/line_map.js +44 -0
  483. package/script/parser/markdown.d.ts +9 -0
  484. package/script/parser/markdown.d.ts.map +1 -1
  485. package/script/parser/markdown.js +315 -23
  486. package/script/parser/mod.d.ts +5 -0
  487. package/script/parser/mod.d.ts.map +1 -1
  488. package/script/parser/mod.js +36 -7
  489. package/script/parser/source.d.ts +53 -2
  490. package/script/parser/source.d.ts.map +1 -1
  491. package/script/parser/source.js +159 -69
  492. package/script/parser/translate.d.ts +24 -0
  493. package/script/parser/translate.d.ts.map +1 -0
  494. package/script/parser/translate.js +102 -0
  495. package/script/profile/chain.d.ts +8 -0
  496. package/script/profile/chain.d.ts.map +1 -1
  497. package/script/profile/chain.js +32 -14
  498. package/script/profile/colors.js +1 -1
  499. package/script/profile/default_profile.d.ts +25 -0
  500. package/script/profile/default_profile.d.ts.map +1 -0
  501. package/script/profile/default_profile.js +46 -0
  502. package/script/profile/discipline_mode.d.ts +64 -0
  503. package/script/profile/discipline_mode.d.ts.map +1 -0
  504. package/script/profile/discipline_mode.js +138 -0
  505. package/script/profile/discipline_registry.d.ts +41 -0
  506. package/script/profile/discipline_registry.d.ts.map +1 -0
  507. package/script/profile/discipline_registry.js +70 -0
  508. package/script/profile/introspect.d.ts +135 -0
  509. package/script/profile/introspect.d.ts.map +1 -0
  510. package/script/profile/introspect.js +381 -0
  511. package/script/profile/load.d.ts +3 -1
  512. package/script/profile/load.d.ts.map +1 -1
  513. package/script/profile/load.js +91 -5
  514. package/script/profile/manifest.d.ts.map +1 -1
  515. package/script/profile/manifest.js +511 -89
  516. package/script/profile/merge.d.ts.map +1 -1
  517. package/script/profile/merge.js +251 -39
  518. package/script/profile/mod.d.ts +4 -4
  519. package/script/profile/mod.d.ts.map +1 -1
  520. package/script/profile/mod.js +12 -6
  521. package/script/reporter/mod.js +4 -4
  522. package/script/sync/locked_attributes.d.ts +19 -0
  523. package/script/sync/locked_attributes.d.ts.map +1 -0
  524. package/script/sync/locked_attributes.js +30 -0
  525. package/script/sync/log.d.ts +34 -0
  526. package/script/sync/log.d.ts.map +1 -0
  527. package/script/sync/log.js +52 -0
  528. package/script/sync/mapping.d.ts +66 -0
  529. package/script/sync/mapping.d.ts.map +1 -0
  530. package/script/sync/mapping.js +169 -0
  531. package/script/sync/mod.d.ts +16 -0
  532. package/script/sync/mod.d.ts.map +1 -0
  533. package/script/sync/mod.js +21 -0
  534. package/script/sync/status.d.ts +23 -0
  535. package/script/sync/status.d.ts.map +1 -0
  536. package/script/sync/status.js +24 -0
  537. package/script/typl/ast.d.ts +87 -0
  538. package/script/typl/ast.d.ts.map +1 -0
  539. package/script/typl/ast.js +24 -0
  540. package/script/typl/bridge.d.ts +32 -0
  541. package/script/typl/bridge.d.ts.map +1 -0
  542. package/script/typl/bridge.js +30 -0
  543. package/script/typl/bullet.d.ts +34 -0
  544. package/script/typl/bullet.d.ts.map +1 -0
  545. package/script/typl/bullet.js +47 -0
  546. package/script/typl/diagnostics.d.ts +43 -0
  547. package/script/typl/diagnostics.d.ts.map +1 -0
  548. package/script/typl/diagnostics.js +65 -0
  549. package/script/typl/fence.d.ts +31 -0
  550. package/script/typl/fence.d.ts.map +1 -0
  551. package/script/typl/fence.js +27 -0
  552. package/script/typl/grammar.d.ts +20 -0
  553. package/script/typl/grammar.d.ts.map +1 -0
  554. package/script/typl/grammar.js +474 -0
  555. package/script/typl/inline.d.ts +34 -0
  556. package/script/typl/inline.d.ts.map +1 -0
  557. package/script/typl/inline.js +51 -0
  558. package/script/typl/lexer.d.ts +37 -0
  559. package/script/typl/lexer.d.ts.map +1 -0
  560. package/script/typl/lexer.js +237 -0
  561. package/script/typl/mod.d.ts +23 -0
  562. package/script/typl/mod.d.ts.map +1 -0
  563. package/script/typl/mod.js +29 -0
  564. package/script/typl/registry.d.ts +42 -0
  565. package/script/typl/registry.d.ts.map +1 -0
  566. package/script/typl/registry.js +29 -0
  567. package/script/typl/validator.d.ts +29 -0
  568. package/script/typl/validator.d.ts.map +1 -0
  569. package/script/typl/validator.js +144 -0
  570. package/script/util/fence.d.ts +30 -0
  571. package/script/util/fence.d.ts.map +1 -0
  572. package/script/util/fence.js +44 -0
  573. package/script/util/line_endings.d.ts +33 -0
  574. package/script/util/line_endings.d.ts.map +1 -0
  575. package/script/util/line_endings.js +58 -0
  576. package/script/util/modals.d.ts +29 -0
  577. package/script/util/modals.d.ts.map +1 -0
  578. package/script/util/modals.js +42 -0
  579. package/script/validator/attributes.d.ts +3 -3
  580. package/script/validator/attributes.d.ts.map +1 -1
  581. package/script/validator/attributes.js +1 -18
  582. package/script/validator/body_blocks.d.ts +38 -0
  583. package/script/validator/body_blocks.d.ts.map +1 -0
  584. package/script/validator/body_blocks.js +221 -0
  585. package/script/validator/caption_convention.d.ts +29 -0
  586. package/script/validator/caption_convention.d.ts.map +1 -0
  587. package/script/validator/caption_convention.js +61 -0
  588. package/script/validator/captions.d.ts +22 -0
  589. package/script/validator/captions.d.ts.map +1 -0
  590. package/script/validator/captions.js +140 -0
  591. package/script/validator/component_schemes.d.ts +73 -0
  592. package/script/validator/component_schemes.d.ts.map +1 -0
  593. package/script/validator/component_schemes.js +384 -0
  594. package/script/validator/discipline.d.ts +35 -0
  595. package/script/validator/discipline.d.ts.map +1 -0
  596. package/script/validator/discipline.js +207 -0
  597. package/script/validator/feature_ac.d.ts +28 -0
  598. package/script/validator/feature_ac.d.ts.map +1 -0
  599. package/script/validator/feature_ac.js +105 -0
  600. package/script/validator/listing.d.ts +42 -0
  601. package/script/validator/listing.d.ts.map +1 -0
  602. package/script/validator/listing.js +298 -0
  603. package/script/validator/mod.d.ts +3 -1
  604. package/script/validator/mod.d.ts.map +1 -1
  605. package/script/validator/mod.js +278 -14
  606. package/script/validator/modal_keywords.d.ts +25 -0
  607. package/script/validator/modal_keywords.d.ts.map +1 -0
  608. package/script/validator/modal_keywords.js +57 -0
  609. package/script/validator/pattern.d.ts +15 -8
  610. package/script/validator/pattern.d.ts.map +1 -1
  611. package/script/validator/pattern.js +42 -19
  612. package/script/validator/per_type_attrs.d.ts +29 -0
  613. package/script/validator/per_type_attrs.d.ts.map +1 -0
  614. package/script/validator/per_type_attrs.js +78 -0
  615. package/script/validator/pipeline.d.ts +18 -2
  616. package/script/validator/pipeline.d.ts.map +1 -1
  617. package/script/validator/pipeline.js +78 -22
  618. package/script/validator/trace_types.d.ts +26 -0
  619. package/script/validator/trace_types.d.ts.map +1 -0
  620. package/script/validator/trace_types.js +235 -0
  621. package/script/validator/traceability.d.ts +3 -4
  622. package/script/validator/traceability.d.ts.map +1 -1
  623. package/script/validator/traceability.js +5 -10
  624. package/script/validator/type_resolution.d.ts +67 -0
  625. package/script/validator/type_resolution.d.ts.map +1 -0
  626. package/script/validator/type_resolution.js +168 -0
  627. package/script/validator/types.d.ts +45 -0
  628. package/script/validator/types.d.ts.map +1 -1
  629. package/script/validator/types.js +131 -16
  630. package/script/validator/value_types.d.ts +8 -0
  631. package/script/validator/value_types.d.ts.map +1 -1
  632. package/script/validator/value_types.js +10 -2
@@ -30,8 +30,10 @@ export interface ValidateResult {
30
30
  export declare function validate(entries: readonly Entry[]): ValidateResult;
31
31
  export declare function indexByDisplayId(entries: readonly Entry[]): ReadonlyMap<string, Entry>;
32
32
  export declare function findAttr(attrs: readonly Attribute[], key: string): Attribute | undefined;
33
- export { runPipeline } from "./pipeline.js";
33
+ export { runPipeline, suppressDeclaredAttrR010 } from "./pipeline.js";
34
34
  export type { PipelineResult } from "./pipeline.js";
35
+ export { validateListingDocuments } from "./listing.js";
36
+ export type { ListingFileContext, ListingKind } from "./listing.js";
35
37
  export { classifyEntriesStage, classifyEntry } from "./types.js";
36
38
  export type { ClassifyResult, ClassifyStageResult } from "./types.js";
37
39
  export { compileDisplayIdPattern } from "./pattern.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/validator/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAWpE,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,cAAc,CAQlE;AAyLD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,KAAK,EAAE,GACxB,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAM5B;AAGD,wBAAgB,QAAQ,CACtB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,GAAG,EAAE,MAAM,GACV,SAAS,GAAG,SAAS,CAEvB;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/validator/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAqCpE,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,cAAc,CAclE;AA2aD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,KAAK,EAAE,GACxB,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAM5B;AAGD,wBAAgB,QAAQ,CACtB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,GAAG,EAAE,MAAM,GACV,SAAS,GAAG,SAAS,CAEvB;AAED,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC"}
@@ -13,9 +13,30 @@
13
13
  * constraints, enum vocabularies) are profile-declared and evaluated by
14
14
  * a profile-aware validator layer (not in the core).
15
15
  */
16
- import { IDENTITY_KEY, ULID_RE, UNIVERSAL_ATTRIBUTE_KEYS, URI_SCHEME_RE, } from "../model/mod.js";
16
+ import { attributeSpec, CORE_TYPE_SCOPED_ATTRS, CSV_SPLITTABLE_TYPES, IDENTITY_KEY, ULID_RE, UNIVERSAL_ATTRIBUTE_KEYS, URI_SCHEME_RE, } from "../model/mod.js";
17
+ import { HTTP_URL_RE } from "./value_types.js";
18
+ import { validateTypl } from "../typl/mod.js";
17
19
  /** Universal attribute keys the core recognizes. */
18
20
  const UNIVERSAL_KEYS = new Set(UNIVERSAL_ATTRIBUTE_KEYS);
21
+ /**
22
+ * Value-type set that's repeatable per spec §1.8 — these attributes
23
+ * accept multiple lines for distinct values, so multiple trailers with
24
+ * the same key are legal. Single-cardinality attributes are anything
25
+ * not in this set.
26
+ */
27
+ const REPEATABLE_VALUE_TYPES = new Set([
28
+ "id-list",
29
+ "tag-list",
30
+ "citation",
31
+ "external-id",
32
+ ]);
33
+ /**
34
+ * Slug pattern for Reference-shape display IDs (spec §1.7, ADR-002 §Part 3).
35
+ * Pandoc/BibTeX cite-key convention, restricted to a portable character
36
+ * set: starts with a letter, body alphanumeric + `.` / `/` / `-` / `_`,
37
+ * ends with an alphanumeric.
38
+ */
39
+ const REFERENCE_SLUG_RE = /^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$/;
19
40
  /**
20
41
  * Validate a set of parsed entries for structural correctness and
21
42
  * cross-reference integrity.
@@ -26,6 +47,11 @@ export function validate(entries) {
26
47
  const diagnostics = [];
27
48
  checkStructural(entries, diagnostics);
28
49
  checkReferences(entries, diagnostics);
50
+ // Typl cross-entry collisions (TYPL-002/003) and undefined-typedef-refs
51
+ // (TYPL-005). Per-block diagnostics (TYPL-001/004/006/007/008) already
52
+ // fired during parse via the bridge.
53
+ const typlResult = validateTypl(entries);
54
+ diagnostics.push(...typlResult.diagnostics);
29
55
  const valid = !diagnostics.some((d) => d.severity === "error");
30
56
  return { diagnostics, valid };
31
57
  }
@@ -35,6 +61,8 @@ function checkStructural(entries, diagnostics) {
35
61
  const ids = new Map();
36
62
  for (const entry of entries) {
37
63
  // MSL-R003: exactly one `Id:` attribute per entry.
64
+ // Dual-emit: MSL-I002 (Reference missing Id), MSL-I003 (Authored missing
65
+ // Id), MSL-I004 (multiple Id) — nextgen §4.2 codes alongside legacy.
38
66
  const idAttrs = entry.rawAttributes.filter((a) => a.key === IDENTITY_KEY);
39
67
  if (idAttrs.length === 0) {
40
68
  diagnostics.push({
@@ -43,6 +71,25 @@ function checkStructural(entries, diagnostics) {
43
71
  message: `${entry.displayId}: missing Id: attribute`,
44
72
  location: entry.location,
45
73
  });
74
+ // Dual-emit: shape-specific nextgen code
75
+ if (entry.shape === "Reference") {
76
+ diagnostics.push({
77
+ code: "MSL-I002",
78
+ severity: "error",
79
+ message: `${entry.displayId}: Reference-shape entry without Id: ` +
80
+ `fmt cannot mint URIs (spec section 4.2)`,
81
+ location: entry.location,
82
+ });
83
+ }
84
+ else {
85
+ diagnostics.push({
86
+ code: "MSL-I003",
87
+ severity: "error",
88
+ message: `${entry.displayId}: Authored-shape entry without Id: ` +
89
+ `run fmt to mint a ULID (spec section 4.2)`,
90
+ location: entry.location,
91
+ });
92
+ }
46
93
  }
47
94
  else if (idAttrs.length > 1) {
48
95
  diagnostics.push({
@@ -51,8 +98,17 @@ function checkStructural(entries, diagnostics) {
51
98
  message: `${entry.displayId}: multiple Id: attributes (${idAttrs.length}) — exactly one is required`,
52
99
  location: entry.location,
53
100
  });
101
+ // Dual-emit: MSL-I004
102
+ diagnostics.push({
103
+ code: "MSL-I004",
104
+ severity: "error",
105
+ message: `${entry.displayId}: multiple Id: trailers ` +
106
+ `(${idAttrs.length}) on the same entry (spec section 4.2)`,
107
+ location: entry.location,
108
+ });
54
109
  }
55
110
  // MSL-R004: `Id:` value must be a ULID or a scheme-qualified URI.
111
+ // Dual-emit: MSL-I001 — nextgen §4.2 code alongside legacy.
56
112
  if (idAttrs.length > 0) {
57
113
  const value = idAttrs[0].value;
58
114
  const isUlid = ULID_RE.test(value);
@@ -64,9 +120,16 @@ function checkStructural(entries, diagnostics) {
64
120
  message: `${entry.displayId}: Id: value '${value}' is neither a bare ULID nor a scheme-qualified URI`,
65
121
  location: entry.location,
66
122
  });
123
+ diagnostics.push({
124
+ code: "MSL-I001",
125
+ severity: "error",
126
+ message: `${entry.displayId}: Id: value '${value}' is neither a ULID ` +
127
+ `(^[0-9A-HJKMNP-TV-Z]{26}$) nor an RFC 3986 URI (spec section 4.2)`,
128
+ location: entry.location,
129
+ });
67
130
  }
68
131
  // Shape consistency: ULID ↔ identified, URI ↔ referenced.
69
- if (isUlid && entry.shape !== "identified") {
132
+ if (isUlid && entry.shape !== "Authored") {
70
133
  diagnostics.push({
71
134
  code: "MSL-R004",
72
135
  severity: "error",
@@ -74,7 +137,7 @@ function checkStructural(entries, diagnostics) {
74
137
  location: entry.location,
75
138
  });
76
139
  }
77
- else if (isUri && entry.shape !== "referenced") {
140
+ else if (isUri && entry.shape !== "Reference") {
78
141
  diagnostics.push({
79
142
  code: "MSL-R004",
80
143
  severity: "error",
@@ -83,7 +146,21 @@ function checkStructural(entries, diagnostics) {
83
146
  });
84
147
  }
85
148
  }
149
+ // MSL-I006: Reference-shape display ID must match the slug pattern
150
+ // (spec §1.7, ADR-002 §Part 3). Authored entries have a free-form
151
+ // display ID at core level (tightened by profile patterns).
152
+ if (entry.shape === "Reference" && !REFERENCE_SLUG_RE.test(entry.displayId)) {
153
+ diagnostics.push({
154
+ code: "MSL-I006",
155
+ severity: "error",
156
+ message: `${entry.displayId}: Reference-shape display ID does not ` +
157
+ `match the slug pattern (spec §1.7); expected ` +
158
+ `^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$`,
159
+ location: entry.location,
160
+ });
161
+ }
86
162
  // MSL-R006: Display ID unique across all entries.
163
+ // Dual-emit: MSL-I008 (warning) — nextgen §4.2.
87
164
  const existingDisplay = displayIds.get(entry.displayId);
88
165
  if (existingDisplay) {
89
166
  diagnostics.push({
@@ -92,11 +169,21 @@ function checkStructural(entries, diagnostics) {
92
169
  message: `duplicate display ID '${entry.displayId}' (also at ${existingDisplay.location.file}:${existingDisplay.location.line})`,
93
170
  location: entry.location,
94
171
  });
172
+ diagnostics.push({
173
+ code: "MSL-I008",
174
+ severity: "warning",
175
+ message: `duplicate display ID '${entry.displayId}' within the same ` +
176
+ `shape (also at ${existingDisplay.location.file}:` +
177
+ `${existingDisplay.location.line}) -- cross-references resolve ` +
178
+ `by Id:, so this is style-only (spec section 4.2)`,
179
+ location: entry.location,
180
+ });
95
181
  }
96
182
  else {
97
183
  displayIds.set(entry.displayId, entry);
98
184
  }
99
185
  // MSL-R005: identity value unique across all entries.
186
+ // Dual-emit: MSL-I007 — nextgen §4.2.
100
187
  if (entry.id) {
101
188
  const existingId = ids.get(entry.id);
102
189
  if (existingId) {
@@ -106,17 +193,174 @@ function checkStructural(entries, diagnostics) {
106
193
  message: `duplicate Id '${entry.id}' (also at ${existingId.location.file}:${existingId.location.line})`,
107
194
  location: entry.location,
108
195
  });
196
+ diagnostics.push({
197
+ code: "MSL-I007",
198
+ severity: "error",
199
+ message: `duplicate Id: value '${entry.id}' across the project (also ` +
200
+ `at ${existingId.location.file}:${existingId.location.line}) ` +
201
+ `(spec section 4.2)`,
202
+ location: entry.location,
203
+ });
109
204
  }
110
205
  else {
111
206
  ids.set(entry.id, entry);
112
207
  }
113
208
  }
114
- // MSL-R010: Unknown attributes are warnings in the core. A
115
- // profile-aware validator widens this check to include profile-declared
116
- // attributes; until then, anything outside the universal set is
117
- // unrecognized.
209
+ // MSL-P010 — entry title is empty after trimming. The parser
210
+ // accepts an empty title for shape stability (`[REQ-001]` with
211
+ // nothing after) but the canonical form per spec §4.2 requires a
212
+ // non-empty human-readable title. Fires regardless of shape.
213
+ if (entry.title.trim().length === 0) {
214
+ diagnostics.push({
215
+ code: "MSL-P010",
216
+ severity: "error",
217
+ message: `${entry.displayId}: title is empty after trimming ` +
218
+ `(spec §4.2); add a non-empty human-readable title after ']'`,
219
+ location: entry.location,
220
+ });
221
+ }
222
+ // MSL-A011 — `citation`-typed attribute (References:) used CSV
223
+ // form. The canonical form is multi-line per spec §2.3.2: locators
224
+ // may contain commas (e.g. `[@iso26262, p. 42]`), so the parser
225
+ // never CSV-splits citation values. Detection scans for a `,` at
226
+ // bracket-depth zero — commas inside `[…]` are locators and OK.
227
+ for (const attr of entry.rawAttributes) {
228
+ const spec = attributeSpec(attr.key);
229
+ if (spec?.type !== "citation")
230
+ continue;
231
+ let depth = 0;
232
+ let sawTopLevelComma = false;
233
+ for (const ch of attr.value) {
234
+ if (ch === "[")
235
+ depth++;
236
+ else if (ch === "]" && depth > 0)
237
+ depth--;
238
+ else if (ch === "," && depth === 0) {
239
+ sawTopLevelComma = true;
240
+ break;
241
+ }
242
+ }
243
+ if (sawTopLevelComma) {
244
+ diagnostics.push({
245
+ code: "MSL-A011",
246
+ severity: "error",
247
+ message: `${entry.displayId}: '${attr.key}' is citation-typed and ` +
248
+ `must use multi-line form (spec §2.3.2); CSV is rejected because ` +
249
+ `Pandoc locators may contain commas`,
250
+ location: entry.location,
251
+ });
252
+ }
253
+ }
254
+ // MSL-A012 — repeatable attribute value list is empty (spec §1.8).
255
+ // Fires when an authored repeatable attribute (id-list, tag-list,
256
+ // citation, external-id) carries no non-empty values after trimming
257
+ // and CSV splitting. `citation` is not CSV-splittable, so its check
258
+ // is a plain trim-and-empty test.
118
259
  for (const attr of entry.rawAttributes) {
119
- if (!UNIVERSAL_KEYS.has(attr.key) && attr.key !== "Type") {
260
+ const spec = attributeSpec(attr.key);
261
+ if (!spec)
262
+ continue;
263
+ if (!REPEATABLE_VALUE_TYPES.has(spec.type))
264
+ continue;
265
+ const raw = attr.value;
266
+ const isCitation = spec.type === "citation";
267
+ const values = isCitation
268
+ ? [raw.trim()].filter((s) => s.length > 0)
269
+ : raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
270
+ if (values.length === 0) {
271
+ diagnostics.push({
272
+ code: "MSL-A012",
273
+ severity: "error",
274
+ message: `${entry.displayId}: '${attr.key}' is a repeatable ` +
275
+ `attribute but the value list is empty (spec §1.8)`,
276
+ location: entry.location,
277
+ });
278
+ }
279
+ }
280
+ // MSL-A013 — single-cardinality core attribute used more than once.
281
+ // `Id:` is excluded because MSL-R003 (above) reports its duplicates
282
+ // with a more specific message. Profile-declared attribute
283
+ // cardinality is enforced by the profile-aware Stage 3 (MSL-A002).
284
+ const seenSingleKeys = new Set();
285
+ const reportedA013 = new Set();
286
+ for (const attr of entry.rawAttributes) {
287
+ if (attr.key === IDENTITY_KEY)
288
+ continue;
289
+ const spec = attributeSpec(attr.key);
290
+ if (!spec)
291
+ continue;
292
+ if (REPEATABLE_VALUE_TYPES.has(spec.type))
293
+ continue;
294
+ if (seenSingleKeys.has(attr.key)) {
295
+ if (!reportedA013.has(attr.key)) {
296
+ diagnostics.push({
297
+ code: "MSL-A013",
298
+ severity: "error",
299
+ message: `${entry.displayId}: '${attr.key}' is single-cardinality ` +
300
+ `but appears more than once (spec §1.8)`,
301
+ location: entry.location,
302
+ });
303
+ reportedA013.add(attr.key);
304
+ }
305
+ }
306
+ else {
307
+ seenSingleKeys.add(attr.key);
308
+ }
309
+ }
310
+ // MSL-A030 / MSL-A050 / MSL-R010 checks per attribute
311
+ // (§4.4 / §4.8 / spec §1.5).
312
+ for (const attr of entry.rawAttributes) {
313
+ // MSL-A030: generated-origin attributes must not appear in source.
314
+ const spec = attributeSpec(attr.key);
315
+ if (spec?.origin === "generated") {
316
+ diagnostics.push({
317
+ code: "MSL-A030",
318
+ severity: "error",
319
+ message: `${entry.displayId}: '${attr.key}' has generated origin and must not appear in source (computed at build time per ADR-003 §Part 3)`,
320
+ location: entry.location,
321
+ });
322
+ continue;
323
+ }
324
+ // MSL-A050: value does not parse against the declared value type
325
+ // (§4.4). The core knows the value type for the promoted Reference
326
+ // attributes (spec §1.5) and the universal enum attributes;
327
+ // profile-declared attribute types are validated by the
328
+ // profile-aware Stage 3 instead.
329
+ if (attr.key === "Reference-url") {
330
+ if (!HTTP_URL_RE.test(attr.value.trim())) {
331
+ diagnostics.push({
332
+ code: "MSL-A050",
333
+ severity: "error",
334
+ message: `${entry.displayId}: Reference-url value ` +
335
+ `'${attr.value.trim()}' is not an http(s) URL (spec §1.5)`,
336
+ location: entry.location,
337
+ });
338
+ continue;
339
+ }
340
+ }
341
+ if (spec?.type === "enum" && spec.enumValues) {
342
+ const trimmed = attr.value.trim();
343
+ if (trimmed.length > 0 && !spec.enumValues.includes(trimmed)) {
344
+ diagnostics.push({
345
+ code: "MSL-A050",
346
+ severity: "error",
347
+ message: `${entry.displayId}: ${attr.key} value '${trimmed}' ` +
348
+ `is not in the allowed set ` +
349
+ `{${spec.enumValues.join(", ")}} (spec §1.8 enum)`,
350
+ location: entry.location,
351
+ });
352
+ continue;
353
+ }
354
+ }
355
+ // MSL-R010: Unknown attributes are warnings in the core. A
356
+ // profile-aware validator widens this check to include profile-declared
357
+ // attributes; until then, anything outside the universal set is
358
+ // unrecognized. Core-typed attributes (per ADR-003 §Part 2) are
359
+ // suppressed here — the per-type validator emits a more specific
360
+ // MSL-T022 when they appear on the "wrong" type.
361
+ if (!UNIVERSAL_KEYS.has(attr.key) &&
362
+ attr.key !== "Type" &&
363
+ !CORE_TYPE_SCOPED_ATTRS.has(attr.key)) {
120
364
  diagnostics.push({
121
365
  code: "MSL-R010",
122
366
  severity: "warning",
@@ -124,6 +368,21 @@ function checkStructural(entries, diagnostics) {
124
368
  location: entry.location,
125
369
  });
126
370
  }
371
+ // MSL-A006: empty element in CSV attribute value (e.g. "A,,B").
372
+ const csvSpec = attributeSpec(attr.key);
373
+ if (csvSpec && CSV_SPLITTABLE_TYPES.has(csvSpec.type) &&
374
+ attr.value.includes(",")) {
375
+ const parts = attr.value.split(",").map((s) => s.trim());
376
+ const emptyCount = parts.filter((s) => s.length === 0).length;
377
+ if (emptyCount > 0) {
378
+ diagnostics.push({
379
+ code: "MSL-A006",
380
+ severity: "warning",
381
+ message: `${entry.displayId}: attribute '${attr.key}' contains ${emptyCount} empty element(s) in CSV value "${attr.value}"`,
382
+ location: entry.location,
383
+ });
384
+ }
385
+ }
127
386
  }
128
387
  }
129
388
  }
@@ -180,11 +439,13 @@ function checkReferences(entries, diagnostics) {
180
439
  });
181
440
  continue;
182
441
  }
183
- if (resolved.shape !== "referenced") {
442
+ if (resolved.shape !== "Reference") {
184
443
  diagnostics.push({
185
- code: "MSL-T005",
186
- severity: "error",
187
- message: `${entry.displayId}: References: target '${slug}' is shape '${resolved.shape}', expected 'referenced'`,
444
+ code: "MSL-R085",
445
+ severity: "warning",
446
+ message: `${entry.displayId}: References: target '${slug}' resolves to a ` +
447
+ `'${resolved.shape}' entry but References must cite a ` +
448
+ `Reference-shape entry (spec §4.8)`,
188
449
  location: entry.location,
189
450
  });
190
451
  }
@@ -205,7 +466,8 @@ export function indexByDisplayId(entries) {
205
466
  export function findAttr(attrs, key) {
206
467
  return attrs.find((a) => a.key === key);
207
468
  }
208
- export { runPipeline } from "./pipeline.js";
469
+ export { runPipeline, suppressDeclaredAttrR010 } from "./pipeline.js";
470
+ export { validateListingDocuments } from "./listing.js";
209
471
  export { classifyEntriesStage, classifyEntry } from "./types.js";
210
472
  export { compileDisplayIdPattern } from "./pattern.js";
211
473
  export { effectiveScope, validateAttributesForEntry } from "./attributes.js";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @module core/validator/modal_keywords
3
+ *
4
+ * MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
5
+ * `SHOULD`, `MAY`, `MUST`, `WILL`) in entry-body prose. The formatter
6
+ * normalises these to lowercase per spec §3.4.1; this validator
7
+ * surfaces the deviation in a lint-only flow. Profiles may promote the
8
+ * severity.
9
+ *
10
+ * Reads `Entry.bodyTokens` (ADR-016) and filters for `kind === "modal"`
11
+ * AND `case === "upper"`. Code, feature, and math blocks are
12
+ * automatically excluded because the parser's `extractBodyTokens` does
13
+ * not emit tokens inside verbatim regions.
14
+ */
15
+ import type { Diagnostic, Entry } from "../model/mod.js";
16
+ /**
17
+ * MSL-M060: report every uppercase RFC 2119 modal keyword in entry-body
18
+ * prose. Emits one diagnostic per uppercase occurrence with the exact
19
+ * source text in the message.
20
+ *
21
+ * MSL-M061: report when a Requirement-type entry contains no modal
22
+ * keyword at all (info severity; style hint to add an obligation verb).
23
+ */
24
+ export declare function validateModalKeywords(entry: Entry): readonly Diagnostic[];
25
+ //# sourceMappingURL=modal_keywords.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal_keywords.d.ts","sourceRoot":"","sources":["../../src/validator/modal_keywords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAa,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKpE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,UAAU,EAAE,CAoCzE"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @module core/validator/modal_keywords
3
+ *
4
+ * MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
5
+ * `SHOULD`, `MAY`, `MUST`, `WILL`) in entry-body prose. The formatter
6
+ * normalises these to lowercase per spec §3.4.1; this validator
7
+ * surfaces the deviation in a lint-only flow. Profiles may promote the
8
+ * severity.
9
+ *
10
+ * Reads `Entry.bodyTokens` (ADR-016) and filters for `kind === "modal"`
11
+ * AND `case === "upper"`. Code, feature, and math blocks are
12
+ * automatically excluded because the parser's `extractBodyTokens` does
13
+ * not emit tokens inside verbatim regions.
14
+ */
15
+ import { resolvedCoreType } from "./type_resolution.js";
16
+ /**
17
+ * MSL-M060: report every uppercase RFC 2119 modal keyword in entry-body
18
+ * prose. Emits one diagnostic per uppercase occurrence with the exact
19
+ * source text in the message.
20
+ *
21
+ * MSL-M061: report when a Requirement-type entry contains no modal
22
+ * keyword at all (info severity; style hint to add an obligation verb).
23
+ */
24
+ export function validateModalKeywords(entry) {
25
+ const diagnostics = [];
26
+ const modalTokens = entry.bodyTokens.filter((t) => t.kind === "modal");
27
+ const anyModalSeen = modalTokens.length > 0;
28
+ for (const t of modalTokens) {
29
+ if (t.case !== "upper")
30
+ continue;
31
+ diagnostics.push({
32
+ code: "MSL-M060",
33
+ severity: "warning",
34
+ message: `modal keyword '${t.text}' should be lowercase`,
35
+ location: t.location,
36
+ });
37
+ }
38
+ // MSL-M061 — Requirement-type entry contains no modal keyword
39
+ // (info; style hint). Gated on the resolved core type being
40
+ // `Requirement` so non-requirement entries (Tests, Contracts, etc.)
41
+ // are not flagged. The hint stays at info severity so it doesn't
42
+ // affect exit codes; profiles may promote.
43
+ if (!anyModalSeen && resolvedCoreType(entry) === "Requirement") {
44
+ diagnostics.push({
45
+ code: "MSL-M061",
46
+ severity: "info",
47
+ message: `${entry.displayId}: Requirement entry contains no modal ` +
48
+ `keyword (shall / should / may / must) — consider declaring one ` +
49
+ `to make the obligation explicit (spec §3.4.1 "Modal keywords")`,
50
+ location: entry.location,
51
+ });
52
+ }
53
+ return diagnostics;
54
+ }
@@ -4,20 +4,27 @@
4
4
  * Display-ID pattern template → anchored RegExp.
5
5
  *
6
6
  * Grammar (per ADR-009 §5):
7
- * pattern := literal-prefix placeholder (literal-suffix)?
8
- * placeholder := "{n}" | "{n:" PADDING "d}"
9
- * PADDING := "0" digits
7
+ * pattern := segment+ (exactly one counter)
8
+ * segment := literal | counter | named
9
+ * counter := "{n}" | "{n:" PADDING "d}"
10
+ * named := "{" identifier "}" (e.g. {scope}, {feature})
11
+ * PADDING := "0" digits
12
+ *
13
+ * The counter `{n}` is the numeric running index (exactly one required). A
14
+ * named placeholder such as `{scope}` matches a free alphanumeric segment —
15
+ * it validates the *shape* `PREFIX_<scope>_<NNNN>` without pinning the scope
16
+ * to a fixed value, so one profile pattern serves every feature scope.
10
17
  *
11
18
  * Examples:
12
- * REQ-{n} → ^REQ-(\d+)$
13
- * REQ-{n:04d} → ^REQ-(\d{4})$
14
- * STAKE-REQ-{n:06d} → ^STAKE-REQ-(\d{6})$
19
+ * REQ-{n} → ^REQ-(\d+)$
20
+ * REQ-{n:04d} → ^REQ-(\d{4})$
21
+ * XREQ_{scope}_{n:04d} → ^XREQ_(?<scope>[A-Za-z0-9]+)_(\d{4})$
15
22
  */
16
23
  /**
17
24
  * Compile a display-ID pattern template into an anchored RegExp.
18
25
  *
19
- * Throws if the template is missing the `{n}` placeholder or has an invalid
20
- * padding specifier.
26
+ * Throws if the template is missing the `{n}` counter, has more than one, or
27
+ * has an invalid padding specifier.
21
28
  */
22
29
  export declare function compileDisplayIdPattern(template: string): RegExp;
23
30
  //# sourceMappingURL=pattern.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/validator/pattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA0BhE"}
1
+ {"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/validator/pattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAuChE"}
@@ -4,39 +4,62 @@
4
4
  * Display-ID pattern template → anchored RegExp.
5
5
  *
6
6
  * Grammar (per ADR-009 §5):
7
- * pattern := literal-prefix placeholder (literal-suffix)?
8
- * placeholder := "{n}" | "{n:" PADDING "d}"
9
- * PADDING := "0" digits
7
+ * pattern := segment+ (exactly one counter)
8
+ * segment := literal | counter | named
9
+ * counter := "{n}" | "{n:" PADDING "d}"
10
+ * named := "{" identifier "}" (e.g. {scope}, {feature})
11
+ * PADDING := "0" digits
12
+ *
13
+ * The counter `{n}` is the numeric running index (exactly one required). A
14
+ * named placeholder such as `{scope}` matches a free alphanumeric segment —
15
+ * it validates the *shape* `PREFIX_<scope>_<NNNN>` without pinning the scope
16
+ * to a fixed value, so one profile pattern serves every feature scope.
10
17
  *
11
18
  * Examples:
12
- * REQ-{n} → ^REQ-(\d+)$
13
- * REQ-{n:04d} → ^REQ-(\d{4})$
14
- * STAKE-REQ-{n:06d} → ^STAKE-REQ-(\d{6})$
19
+ * REQ-{n} → ^REQ-(\d+)$
20
+ * REQ-{n:04d} → ^REQ-(\d{4})$
21
+ * XREQ_{scope}_{n:04d} → ^XREQ_(?<scope>[A-Za-z0-9]+)_(\d{4})$
15
22
  */
16
- const PLACEHOLDER_RE = /\{n(?::(0\d+)d)?\}/;
23
+ // One token: the {n} counter (optionally padded) OR a {named} segment.
24
+ const TOKEN_RE = /\{n(?::(0\d+)d)?\}|\{([A-Za-z][A-Za-z0-9_]*)\}/g;
17
25
  /**
18
26
  * Compile a display-ID pattern template into an anchored RegExp.
19
27
  *
20
- * Throws if the template is missing the `{n}` placeholder or has an invalid
21
- * padding specifier.
28
+ * Throws if the template is missing the `{n}` counter, has more than one, or
29
+ * has an invalid padding specifier.
22
30
  */
23
31
  export function compileDisplayIdPattern(template) {
24
- const match = PLACEHOLDER_RE.exec(template);
25
- if (!match) {
32
+ let regexSource = "^";
33
+ let lastIndex = 0;
34
+ let counters = 0;
35
+ const re = new RegExp(TOKEN_RE);
36
+ let match;
37
+ while ((match = re.exec(template)) !== null) {
38
+ regexSource += escapeRegex(template.slice(lastIndex, match.index));
39
+ const named = match[2];
40
+ if (named === undefined) {
41
+ // {n} / {n:0Nd} counter
42
+ const padding = match[1];
43
+ regexSource += "(" + (padding ? `\\d{${Number(padding)}}` : `\\d+`) + ")";
44
+ counters++;
45
+ }
46
+ else {
47
+ // {scope}-style named segment → free alphanumeric capture
48
+ regexSource += `(?<${named}>[A-Za-z0-9]+)`;
49
+ }
50
+ lastIndex = match.index + match[0].length;
51
+ }
52
+ regexSource += escapeRegex(template.slice(lastIndex)) + "$";
53
+ if (counters === 0) {
26
54
  if (/\{n:[^}]*\}/.test(template)) {
27
55
  throw new Error(`display-id-pattern '${template}': invalid padding specifier ` +
28
56
  `(expected {n} or {n:NNd})`);
29
57
  }
30
58
  throw new Error(`display-id-pattern '${template}': missing {n} placeholder`);
31
59
  }
32
- const padding = match[1];
33
- const placeholderStart = match.index;
34
- const placeholderEnd = match.index + match[0].length;
35
- const prefix = template.slice(0, placeholderStart);
36
- const suffix = template.slice(placeholderEnd);
37
- const digitGroup = padding ? `\\d{${Number(padding)}}` : `\\d+`;
38
- const regexSource = "^" + escapeRegex(prefix) + "(" + digitGroup + ")" +
39
- escapeRegex(suffix) + "$";
60
+ if (counters > 1) {
61
+ throw new Error(`display-id-pattern '${template}': multiple {n} counters (expected one)`);
62
+ }
40
63
  return new RegExp(regexSource);
41
64
  }
42
65
  function escapeRegex(s) {
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module core/validator/per_type_attrs
3
+ *
4
+ * Per-type attribute compatibility check (spec §4.3 — MSL-T022). When
5
+ * an entry's effective type resolves to a core type — via explicit
6
+ * `Type:`, profile classification, or URI-scheme inference for
7
+ * Reference-shape entries — any attribute that's known to the core
8
+ * hierarchy but not allowed on that type fires MSL-T022 as a warning.
9
+ * Unknown attributes (neither universal nor core-typed) fall through
10
+ * to the existing MSL-R010 unknown-attribute warning in
11
+ * `validator/mod.ts`.
12
+ */
13
+ import type { Diagnostic, EffectiveProfile, Entry } from "../model/mod.js";
14
+ /**
15
+ * Emit per-type attribute diagnostics:
16
+ *
17
+ * - **MSL-T022** (warning) — an attribute is core-known but not
18
+ * valid on the entry's *resolved* type.
19
+ * - **MSL-T024** (warning) — the entry's core type could not be
20
+ * resolved (no explicit `Type:`, no profile classification, no
21
+ * inferable signal — display-ID prefix / URI scheme /
22
+ * discriminating attribute) yet it carries a core-type-scoped
23
+ * attribute, so that attribute cannot be validated. Without this,
24
+ * such attributes slipped through silently (e.g. `Manufacturer:`
25
+ * on a `jira:`-scheme reference). Universal and entirely unknown
26
+ * attributes are exempt — those go through MSL-R010.
27
+ */
28
+ export declare function validatePerTypeAttributes(entry: Entry, profile?: EffectiveProfile): readonly Diagnostic[];
29
+ //# sourceMappingURL=per_type_attrs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per_type_attrs.d.ts","sourceRoot":"","sources":["../../src/validator/per_type_attrs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAmB3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,SAAS,UAAU,EAAE,CAsCvB"}