@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
@@ -15,13 +15,34 @@
15
15
  * a profile-aware validator layer (not in the core).
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.validateTraceabilityForEntry = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.normalizeListValues = exports.validateValue = exports.validateAttributesForEntry = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.runPipeline = void 0;
18
+ exports.validateTraceabilityForEntry = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.normalizeListValues = exports.validateValue = exports.validateAttributesForEntry = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.validateListingDocuments = exports.suppressDeclaredAttrR010 = exports.runPipeline = void 0;
19
19
  exports.validate = validate;
20
20
  exports.indexByDisplayId = indexByDisplayId;
21
21
  exports.findAttr = findAttr;
22
22
  const mod_js_1 = require("../model/mod.js");
23
+ const value_types_js_1 = require("./value_types.js");
24
+ const mod_js_2 = require("../typl/mod.js");
23
25
  /** Universal attribute keys the core recognizes. */
24
26
  const UNIVERSAL_KEYS = new Set(mod_js_1.UNIVERSAL_ATTRIBUTE_KEYS);
27
+ /**
28
+ * Value-type set that's repeatable per spec §1.8 — these attributes
29
+ * accept multiple lines for distinct values, so multiple trailers with
30
+ * the same key are legal. Single-cardinality attributes are anything
31
+ * not in this set.
32
+ */
33
+ const REPEATABLE_VALUE_TYPES = new Set([
34
+ "id-list",
35
+ "tag-list",
36
+ "citation",
37
+ "external-id",
38
+ ]);
39
+ /**
40
+ * Slug pattern for Reference-shape display IDs (spec §1.7, ADR-002 §Part 3).
41
+ * Pandoc/BibTeX cite-key convention, restricted to a portable character
42
+ * set: starts with a letter, body alphanumeric + `.` / `/` / `-` / `_`,
43
+ * ends with an alphanumeric.
44
+ */
45
+ const REFERENCE_SLUG_RE = /^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$/;
25
46
  /**
26
47
  * Validate a set of parsed entries for structural correctness and
27
48
  * cross-reference integrity.
@@ -32,6 +53,11 @@ function validate(entries) {
32
53
  const diagnostics = [];
33
54
  checkStructural(entries, diagnostics);
34
55
  checkReferences(entries, diagnostics);
56
+ // Typl cross-entry collisions (TYPL-002/003) and undefined-typedef-refs
57
+ // (TYPL-005). Per-block diagnostics (TYPL-001/004/006/007/008) already
58
+ // fired during parse via the bridge.
59
+ const typlResult = (0, mod_js_2.validateTypl)(entries);
60
+ diagnostics.push(...typlResult.diagnostics);
35
61
  const valid = !diagnostics.some((d) => d.severity === "error");
36
62
  return { diagnostics, valid };
37
63
  }
@@ -41,6 +67,8 @@ function checkStructural(entries, diagnostics) {
41
67
  const ids = new Map();
42
68
  for (const entry of entries) {
43
69
  // MSL-R003: exactly one `Id:` attribute per entry.
70
+ // Dual-emit: MSL-I002 (Reference missing Id), MSL-I003 (Authored missing
71
+ // Id), MSL-I004 (multiple Id) — nextgen §4.2 codes alongside legacy.
44
72
  const idAttrs = entry.rawAttributes.filter((a) => a.key === mod_js_1.IDENTITY_KEY);
45
73
  if (idAttrs.length === 0) {
46
74
  diagnostics.push({
@@ -49,6 +77,25 @@ function checkStructural(entries, diagnostics) {
49
77
  message: `${entry.displayId}: missing Id: attribute`,
50
78
  location: entry.location,
51
79
  });
80
+ // Dual-emit: shape-specific nextgen code
81
+ if (entry.shape === "Reference") {
82
+ diagnostics.push({
83
+ code: "MSL-I002",
84
+ severity: "error",
85
+ message: `${entry.displayId}: Reference-shape entry without Id: ` +
86
+ `fmt cannot mint URIs (spec section 4.2)`,
87
+ location: entry.location,
88
+ });
89
+ }
90
+ else {
91
+ diagnostics.push({
92
+ code: "MSL-I003",
93
+ severity: "error",
94
+ message: `${entry.displayId}: Authored-shape entry without Id: ` +
95
+ `run fmt to mint a ULID (spec section 4.2)`,
96
+ location: entry.location,
97
+ });
98
+ }
52
99
  }
53
100
  else if (idAttrs.length > 1) {
54
101
  diagnostics.push({
@@ -57,8 +104,17 @@ function checkStructural(entries, diagnostics) {
57
104
  message: `${entry.displayId}: multiple Id: attributes (${idAttrs.length}) — exactly one is required`,
58
105
  location: entry.location,
59
106
  });
107
+ // Dual-emit: MSL-I004
108
+ diagnostics.push({
109
+ code: "MSL-I004",
110
+ severity: "error",
111
+ message: `${entry.displayId}: multiple Id: trailers ` +
112
+ `(${idAttrs.length}) on the same entry (spec section 4.2)`,
113
+ location: entry.location,
114
+ });
60
115
  }
61
116
  // MSL-R004: `Id:` value must be a ULID or a scheme-qualified URI.
117
+ // Dual-emit: MSL-I001 — nextgen §4.2 code alongside legacy.
62
118
  if (idAttrs.length > 0) {
63
119
  const value = idAttrs[0].value;
64
120
  const isUlid = mod_js_1.ULID_RE.test(value);
@@ -70,9 +126,16 @@ function checkStructural(entries, diagnostics) {
70
126
  message: `${entry.displayId}: Id: value '${value}' is neither a bare ULID nor a scheme-qualified URI`,
71
127
  location: entry.location,
72
128
  });
129
+ diagnostics.push({
130
+ code: "MSL-I001",
131
+ severity: "error",
132
+ message: `${entry.displayId}: Id: value '${value}' is neither a ULID ` +
133
+ `(^[0-9A-HJKMNP-TV-Z]{26}$) nor an RFC 3986 URI (spec section 4.2)`,
134
+ location: entry.location,
135
+ });
73
136
  }
74
137
  // Shape consistency: ULID ↔ identified, URI ↔ referenced.
75
- if (isUlid && entry.shape !== "identified") {
138
+ if (isUlid && entry.shape !== "Authored") {
76
139
  diagnostics.push({
77
140
  code: "MSL-R004",
78
141
  severity: "error",
@@ -80,7 +143,7 @@ function checkStructural(entries, diagnostics) {
80
143
  location: entry.location,
81
144
  });
82
145
  }
83
- else if (isUri && entry.shape !== "referenced") {
146
+ else if (isUri && entry.shape !== "Reference") {
84
147
  diagnostics.push({
85
148
  code: "MSL-R004",
86
149
  severity: "error",
@@ -89,7 +152,21 @@ function checkStructural(entries, diagnostics) {
89
152
  });
90
153
  }
91
154
  }
155
+ // MSL-I006: Reference-shape display ID must match the slug pattern
156
+ // (spec §1.7, ADR-002 §Part 3). Authored entries have a free-form
157
+ // display ID at core level (tightened by profile patterns).
158
+ if (entry.shape === "Reference" && !REFERENCE_SLUG_RE.test(entry.displayId)) {
159
+ diagnostics.push({
160
+ code: "MSL-I006",
161
+ severity: "error",
162
+ message: `${entry.displayId}: Reference-shape display ID does not ` +
163
+ `match the slug pattern (spec §1.7); expected ` +
164
+ `^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$`,
165
+ location: entry.location,
166
+ });
167
+ }
92
168
  // MSL-R006: Display ID unique across all entries.
169
+ // Dual-emit: MSL-I008 (warning) — nextgen §4.2.
93
170
  const existingDisplay = displayIds.get(entry.displayId);
94
171
  if (existingDisplay) {
95
172
  diagnostics.push({
@@ -98,11 +175,21 @@ function checkStructural(entries, diagnostics) {
98
175
  message: `duplicate display ID '${entry.displayId}' (also at ${existingDisplay.location.file}:${existingDisplay.location.line})`,
99
176
  location: entry.location,
100
177
  });
178
+ diagnostics.push({
179
+ code: "MSL-I008",
180
+ severity: "warning",
181
+ message: `duplicate display ID '${entry.displayId}' within the same ` +
182
+ `shape (also at ${existingDisplay.location.file}:` +
183
+ `${existingDisplay.location.line}) -- cross-references resolve ` +
184
+ `by Id:, so this is style-only (spec section 4.2)`,
185
+ location: entry.location,
186
+ });
101
187
  }
102
188
  else {
103
189
  displayIds.set(entry.displayId, entry);
104
190
  }
105
191
  // MSL-R005: identity value unique across all entries.
192
+ // Dual-emit: MSL-I007 — nextgen §4.2.
106
193
  if (entry.id) {
107
194
  const existingId = ids.get(entry.id);
108
195
  if (existingId) {
@@ -112,17 +199,174 @@ function checkStructural(entries, diagnostics) {
112
199
  message: `duplicate Id '${entry.id}' (also at ${existingId.location.file}:${existingId.location.line})`,
113
200
  location: entry.location,
114
201
  });
202
+ diagnostics.push({
203
+ code: "MSL-I007",
204
+ severity: "error",
205
+ message: `duplicate Id: value '${entry.id}' across the project (also ` +
206
+ `at ${existingId.location.file}:${existingId.location.line}) ` +
207
+ `(spec section 4.2)`,
208
+ location: entry.location,
209
+ });
115
210
  }
116
211
  else {
117
212
  ids.set(entry.id, entry);
118
213
  }
119
214
  }
120
- // MSL-R010: Unknown attributes are warnings in the core. A
121
- // profile-aware validator widens this check to include profile-declared
122
- // attributes; until then, anything outside the universal set is
123
- // unrecognized.
215
+ // MSL-P010 — entry title is empty after trimming. The parser
216
+ // accepts an empty title for shape stability (`[REQ-001]` with
217
+ // nothing after) but the canonical form per spec §4.2 requires a
218
+ // non-empty human-readable title. Fires regardless of shape.
219
+ if (entry.title.trim().length === 0) {
220
+ diagnostics.push({
221
+ code: "MSL-P010",
222
+ severity: "error",
223
+ message: `${entry.displayId}: title is empty after trimming ` +
224
+ `(spec §4.2); add a non-empty human-readable title after ']'`,
225
+ location: entry.location,
226
+ });
227
+ }
228
+ // MSL-A011 — `citation`-typed attribute (References:) used CSV
229
+ // form. The canonical form is multi-line per spec §2.3.2: locators
230
+ // may contain commas (e.g. `[@iso26262, p. 42]`), so the parser
231
+ // never CSV-splits citation values. Detection scans for a `,` at
232
+ // bracket-depth zero — commas inside `[…]` are locators and OK.
233
+ for (const attr of entry.rawAttributes) {
234
+ const spec = (0, mod_js_1.attributeSpec)(attr.key);
235
+ if (spec?.type !== "citation")
236
+ continue;
237
+ let depth = 0;
238
+ let sawTopLevelComma = false;
239
+ for (const ch of attr.value) {
240
+ if (ch === "[")
241
+ depth++;
242
+ else if (ch === "]" && depth > 0)
243
+ depth--;
244
+ else if (ch === "," && depth === 0) {
245
+ sawTopLevelComma = true;
246
+ break;
247
+ }
248
+ }
249
+ if (sawTopLevelComma) {
250
+ diagnostics.push({
251
+ code: "MSL-A011",
252
+ severity: "error",
253
+ message: `${entry.displayId}: '${attr.key}' is citation-typed and ` +
254
+ `must use multi-line form (spec §2.3.2); CSV is rejected because ` +
255
+ `Pandoc locators may contain commas`,
256
+ location: entry.location,
257
+ });
258
+ }
259
+ }
260
+ // MSL-A012 — repeatable attribute value list is empty (spec §1.8).
261
+ // Fires when an authored repeatable attribute (id-list, tag-list,
262
+ // citation, external-id) carries no non-empty values after trimming
263
+ // and CSV splitting. `citation` is not CSV-splittable, so its check
264
+ // is a plain trim-and-empty test.
124
265
  for (const attr of entry.rawAttributes) {
125
- if (!UNIVERSAL_KEYS.has(attr.key) && attr.key !== "Type") {
266
+ const spec = (0, mod_js_1.attributeSpec)(attr.key);
267
+ if (!spec)
268
+ continue;
269
+ if (!REPEATABLE_VALUE_TYPES.has(spec.type))
270
+ continue;
271
+ const raw = attr.value;
272
+ const isCitation = spec.type === "citation";
273
+ const values = isCitation
274
+ ? [raw.trim()].filter((s) => s.length > 0)
275
+ : raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
276
+ if (values.length === 0) {
277
+ diagnostics.push({
278
+ code: "MSL-A012",
279
+ severity: "error",
280
+ message: `${entry.displayId}: '${attr.key}' is a repeatable ` +
281
+ `attribute but the value list is empty (spec §1.8)`,
282
+ location: entry.location,
283
+ });
284
+ }
285
+ }
286
+ // MSL-A013 — single-cardinality core attribute used more than once.
287
+ // `Id:` is excluded because MSL-R003 (above) reports its duplicates
288
+ // with a more specific message. Profile-declared attribute
289
+ // cardinality is enforced by the profile-aware Stage 3 (MSL-A002).
290
+ const seenSingleKeys = new Set();
291
+ const reportedA013 = new Set();
292
+ for (const attr of entry.rawAttributes) {
293
+ if (attr.key === mod_js_1.IDENTITY_KEY)
294
+ continue;
295
+ const spec = (0, mod_js_1.attributeSpec)(attr.key);
296
+ if (!spec)
297
+ continue;
298
+ if (REPEATABLE_VALUE_TYPES.has(spec.type))
299
+ continue;
300
+ if (seenSingleKeys.has(attr.key)) {
301
+ if (!reportedA013.has(attr.key)) {
302
+ diagnostics.push({
303
+ code: "MSL-A013",
304
+ severity: "error",
305
+ message: `${entry.displayId}: '${attr.key}' is single-cardinality ` +
306
+ `but appears more than once (spec §1.8)`,
307
+ location: entry.location,
308
+ });
309
+ reportedA013.add(attr.key);
310
+ }
311
+ }
312
+ else {
313
+ seenSingleKeys.add(attr.key);
314
+ }
315
+ }
316
+ // MSL-A030 / MSL-A050 / MSL-R010 checks per attribute
317
+ // (§4.4 / §4.8 / spec §1.5).
318
+ for (const attr of entry.rawAttributes) {
319
+ // MSL-A030: generated-origin attributes must not appear in source.
320
+ const spec = (0, mod_js_1.attributeSpec)(attr.key);
321
+ if (spec?.origin === "generated") {
322
+ diagnostics.push({
323
+ code: "MSL-A030",
324
+ severity: "error",
325
+ message: `${entry.displayId}: '${attr.key}' has generated origin and must not appear in source (computed at build time per ADR-003 §Part 3)`,
326
+ location: entry.location,
327
+ });
328
+ continue;
329
+ }
330
+ // MSL-A050: value does not parse against the declared value type
331
+ // (§4.4). The core knows the value type for the promoted Reference
332
+ // attributes (spec §1.5) and the universal enum attributes;
333
+ // profile-declared attribute types are validated by the
334
+ // profile-aware Stage 3 instead.
335
+ if (attr.key === "Reference-url") {
336
+ if (!value_types_js_1.HTTP_URL_RE.test(attr.value.trim())) {
337
+ diagnostics.push({
338
+ code: "MSL-A050",
339
+ severity: "error",
340
+ message: `${entry.displayId}: Reference-url value ` +
341
+ `'${attr.value.trim()}' is not an http(s) URL (spec §1.5)`,
342
+ location: entry.location,
343
+ });
344
+ continue;
345
+ }
346
+ }
347
+ if (spec?.type === "enum" && spec.enumValues) {
348
+ const trimmed = attr.value.trim();
349
+ if (trimmed.length > 0 && !spec.enumValues.includes(trimmed)) {
350
+ diagnostics.push({
351
+ code: "MSL-A050",
352
+ severity: "error",
353
+ message: `${entry.displayId}: ${attr.key} value '${trimmed}' ` +
354
+ `is not in the allowed set ` +
355
+ `{${spec.enumValues.join(", ")}} (spec §1.8 enum)`,
356
+ location: entry.location,
357
+ });
358
+ continue;
359
+ }
360
+ }
361
+ // MSL-R010: Unknown attributes are warnings in the core. A
362
+ // profile-aware validator widens this check to include profile-declared
363
+ // attributes; until then, anything outside the universal set is
364
+ // unrecognized. Core-typed attributes (per ADR-003 §Part 2) are
365
+ // suppressed here — the per-type validator emits a more specific
366
+ // MSL-T022 when they appear on the "wrong" type.
367
+ if (!UNIVERSAL_KEYS.has(attr.key) &&
368
+ attr.key !== "Type" &&
369
+ !mod_js_1.CORE_TYPE_SCOPED_ATTRS.has(attr.key)) {
126
370
  diagnostics.push({
127
371
  code: "MSL-R010",
128
372
  severity: "warning",
@@ -130,6 +374,21 @@ function checkStructural(entries, diagnostics) {
130
374
  location: entry.location,
131
375
  });
132
376
  }
377
+ // MSL-A006: empty element in CSV attribute value (e.g. "A,,B").
378
+ const csvSpec = (0, mod_js_1.attributeSpec)(attr.key);
379
+ if (csvSpec && mod_js_1.CSV_SPLITTABLE_TYPES.has(csvSpec.type) &&
380
+ attr.value.includes(",")) {
381
+ const parts = attr.value.split(",").map((s) => s.trim());
382
+ const emptyCount = parts.filter((s) => s.length === 0).length;
383
+ if (emptyCount > 0) {
384
+ diagnostics.push({
385
+ code: "MSL-A006",
386
+ severity: "warning",
387
+ message: `${entry.displayId}: attribute '${attr.key}' contains ${emptyCount} empty element(s) in CSV value "${attr.value}"`,
388
+ location: entry.location,
389
+ });
390
+ }
391
+ }
133
392
  }
134
393
  }
135
394
  }
@@ -186,11 +445,13 @@ function checkReferences(entries, diagnostics) {
186
445
  });
187
446
  continue;
188
447
  }
189
- if (resolved.shape !== "referenced") {
448
+ if (resolved.shape !== "Reference") {
190
449
  diagnostics.push({
191
- code: "MSL-T005",
192
- severity: "error",
193
- message: `${entry.displayId}: References: target '${slug}' is shape '${resolved.shape}', expected 'referenced'`,
450
+ code: "MSL-R085",
451
+ severity: "warning",
452
+ message: `${entry.displayId}: References: target '${slug}' resolves to a ` +
453
+ `'${resolved.shape}' entry but References must cite a ` +
454
+ `Reference-shape entry (spec §4.8)`,
194
455
  location: entry.location,
195
456
  });
196
457
  }
@@ -213,6 +474,9 @@ function findAttr(attrs, key) {
213
474
  }
214
475
  var pipeline_js_1 = require("./pipeline.js");
215
476
  Object.defineProperty(exports, "runPipeline", { enumerable: true, get: function () { return pipeline_js_1.runPipeline; } });
477
+ Object.defineProperty(exports, "suppressDeclaredAttrR010", { enumerable: true, get: function () { return pipeline_js_1.suppressDeclaredAttrR010; } });
478
+ var listing_js_1 = require("./listing.js");
479
+ Object.defineProperty(exports, "validateListingDocuments", { enumerable: true, get: function () { return listing_js_1.validateListingDocuments; } });
216
480
  var types_js_1 = require("./types.js");
217
481
  Object.defineProperty(exports, "classifyEntriesStage", { enumerable: true, get: function () { return types_js_1.classifyEntriesStage; } });
218
482
  Object.defineProperty(exports, "classifyEntry", { enumerable: true, get: function () { return types_js_1.classifyEntry; } });
@@ -221,8 +485,8 @@ Object.defineProperty(exports, "compileDisplayIdPattern", { enumerable: true, ge
221
485
  var attributes_js_1 = require("./attributes.js");
222
486
  Object.defineProperty(exports, "effectiveScope", { enumerable: true, get: function () { return attributes_js_1.effectiveScope; } });
223
487
  Object.defineProperty(exports, "validateAttributesForEntry", { enumerable: true, get: function () { return attributes_js_1.validateAttributesForEntry; } });
224
- var value_types_js_1 = require("./value_types.js");
225
- Object.defineProperty(exports, "validateValue", { enumerable: true, get: function () { return value_types_js_1.validateValue; } });
488
+ var value_types_js_2 = require("./value_types.js");
489
+ Object.defineProperty(exports, "validateValue", { enumerable: true, get: function () { return value_types_js_2.validateValue; } });
226
490
  var normalize_js_1 = require("./normalize.js");
227
491
  Object.defineProperty(exports, "normalizeListValues", { enumerable: true, get: function () { return normalize_js_1.normalizeListValues; } });
228
492
  var traceability_js_1 = require("./traceability.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,57 @@
1
+ "use strict";
2
+ /**
3
+ * @module core/validator/modal_keywords
4
+ *
5
+ * MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
6
+ * `SHOULD`, `MAY`, `MUST`, `WILL`) in entry-body prose. The formatter
7
+ * normalises these to lowercase per spec §3.4.1; this validator
8
+ * surfaces the deviation in a lint-only flow. Profiles may promote the
9
+ * severity.
10
+ *
11
+ * Reads `Entry.bodyTokens` (ADR-016) and filters for `kind === "modal"`
12
+ * AND `case === "upper"`. Code, feature, and math blocks are
13
+ * automatically excluded because the parser's `extractBodyTokens` does
14
+ * not emit tokens inside verbatim regions.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.validateModalKeywords = validateModalKeywords;
18
+ const type_resolution_js_1 = require("./type_resolution.js");
19
+ /**
20
+ * MSL-M060: report every uppercase RFC 2119 modal keyword in entry-body
21
+ * prose. Emits one diagnostic per uppercase occurrence with the exact
22
+ * source text in the message.
23
+ *
24
+ * MSL-M061: report when a Requirement-type entry contains no modal
25
+ * keyword at all (info severity; style hint to add an obligation verb).
26
+ */
27
+ function validateModalKeywords(entry) {
28
+ const diagnostics = [];
29
+ const modalTokens = entry.bodyTokens.filter((t) => t.kind === "modal");
30
+ const anyModalSeen = modalTokens.length > 0;
31
+ for (const t of modalTokens) {
32
+ if (t.case !== "upper")
33
+ continue;
34
+ diagnostics.push({
35
+ code: "MSL-M060",
36
+ severity: "warning",
37
+ message: `modal keyword '${t.text}' should be lowercase`,
38
+ location: t.location,
39
+ });
40
+ }
41
+ // MSL-M061 — Requirement-type entry contains no modal keyword
42
+ // (info; style hint). Gated on the resolved core type being
43
+ // `Requirement` so non-requirement entries (Tests, Contracts, etc.)
44
+ // are not flagged. The hint stays at info severity so it doesn't
45
+ // affect exit codes; profiles may promote.
46
+ if (!anyModalSeen && (0, type_resolution_js_1.resolvedCoreType)(entry) === "Requirement") {
47
+ diagnostics.push({
48
+ code: "MSL-M061",
49
+ severity: "info",
50
+ message: `${entry.displayId}: Requirement entry contains no modal ` +
51
+ `keyword (shall / should / may / must) — consider declaring one ` +
52
+ `to make the obligation explicit (spec §3.4.1 "Modal keywords")`,
53
+ location: entry.location,
54
+ });
55
+ }
56
+ return diagnostics;
57
+ }
@@ -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"}
@@ -5,41 +5,64 @@
5
5
  * Display-ID pattern template → anchored RegExp.
6
6
  *
7
7
  * Grammar (per ADR-009 §5):
8
- * pattern := literal-prefix placeholder (literal-suffix)?
9
- * placeholder := "{n}" | "{n:" PADDING "d}"
10
- * PADDING := "0" digits
8
+ * pattern := segment+ (exactly one counter)
9
+ * segment := literal | counter | named
10
+ * counter := "{n}" | "{n:" PADDING "d}"
11
+ * named := "{" identifier "}" (e.g. {scope}, {feature})
12
+ * PADDING := "0" digits
13
+ *
14
+ * The counter `{n}` is the numeric running index (exactly one required). A
15
+ * named placeholder such as `{scope}` matches a free alphanumeric segment —
16
+ * it validates the *shape* `PREFIX_<scope>_<NNNN>` without pinning the scope
17
+ * to a fixed value, so one profile pattern serves every feature scope.
11
18
  *
12
19
  * Examples:
13
- * REQ-{n} → ^REQ-(\d+)$
14
- * REQ-{n:04d} → ^REQ-(\d{4})$
15
- * STAKE-REQ-{n:06d} → ^STAKE-REQ-(\d{6})$
20
+ * REQ-{n} → ^REQ-(\d+)$
21
+ * REQ-{n:04d} → ^REQ-(\d{4})$
22
+ * XREQ_{scope}_{n:04d} → ^XREQ_(?<scope>[A-Za-z0-9]+)_(\d{4})$
16
23
  */
17
24
  Object.defineProperty(exports, "__esModule", { value: true });
18
25
  exports.compileDisplayIdPattern = compileDisplayIdPattern;
19
- const PLACEHOLDER_RE = /\{n(?::(0\d+)d)?\}/;
26
+ // One token: the {n} counter (optionally padded) OR a {named} segment.
27
+ const TOKEN_RE = /\{n(?::(0\d+)d)?\}|\{([A-Za-z][A-Za-z0-9_]*)\}/g;
20
28
  /**
21
29
  * Compile a display-ID pattern template into an anchored RegExp.
22
30
  *
23
- * Throws if the template is missing the `{n}` placeholder or has an invalid
24
- * padding specifier.
31
+ * Throws if the template is missing the `{n}` counter, has more than one, or
32
+ * has an invalid padding specifier.
25
33
  */
26
34
  function compileDisplayIdPattern(template) {
27
- const match = PLACEHOLDER_RE.exec(template);
28
- if (!match) {
35
+ let regexSource = "^";
36
+ let lastIndex = 0;
37
+ let counters = 0;
38
+ const re = new RegExp(TOKEN_RE);
39
+ let match;
40
+ while ((match = re.exec(template)) !== null) {
41
+ regexSource += escapeRegex(template.slice(lastIndex, match.index));
42
+ const named = match[2];
43
+ if (named === undefined) {
44
+ // {n} / {n:0Nd} counter
45
+ const padding = match[1];
46
+ regexSource += "(" + (padding ? `\\d{${Number(padding)}}` : `\\d+`) + ")";
47
+ counters++;
48
+ }
49
+ else {
50
+ // {scope}-style named segment → free alphanumeric capture
51
+ regexSource += `(?<${named}>[A-Za-z0-9]+)`;
52
+ }
53
+ lastIndex = match.index + match[0].length;
54
+ }
55
+ regexSource += escapeRegex(template.slice(lastIndex)) + "$";
56
+ if (counters === 0) {
29
57
  if (/\{n:[^}]*\}/.test(template)) {
30
58
  throw new Error(`display-id-pattern '${template}': invalid padding specifier ` +
31
59
  `(expected {n} or {n:NNd})`);
32
60
  }
33
61
  throw new Error(`display-id-pattern '${template}': missing {n} placeholder`);
34
62
  }
35
- const padding = match[1];
36
- const placeholderStart = match.index;
37
- const placeholderEnd = match.index + match[0].length;
38
- const prefix = template.slice(0, placeholderStart);
39
- const suffix = template.slice(placeholderEnd);
40
- const digitGroup = padding ? `\\d{${Number(padding)}}` : `\\d+`;
41
- const regexSource = "^" + escapeRegex(prefix) + "(" + digitGroup + ")" +
42
- escapeRegex(suffix) + "$";
63
+ if (counters > 1) {
64
+ throw new Error(`display-id-pattern '${template}': multiple {n} counters (expected one)`);
65
+ }
43
66
  return new RegExp(regexSource);
44
67
  }
45
68
  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"}