@driftsys/markspec 0.5.0 → 0.6.1

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 (484) hide show
  1. package/README.md +74 -20
  2. package/esm/ast/build.d.ts +11 -21
  3. package/esm/ast/build.d.ts.map +1 -1
  4. package/esm/ast/build.js +50 -139
  5. package/esm/ast/nodes.d.ts +11 -43
  6. package/esm/ast/nodes.d.ts.map +1 -1
  7. package/esm/ast/nodes.js +6 -1
  8. package/esm/ast/normalize.d.ts +8 -17
  9. package/esm/ast/normalize.d.ts.map +1 -1
  10. package/esm/ast/normalize.js +14 -72
  11. package/esm/compiler/constants.d.ts +16 -0
  12. package/esm/compiler/constants.d.ts.map +1 -0
  13. package/esm/compiler/constants.js +26 -0
  14. package/esm/compiler/discipline_classifier.d.ts +55 -0
  15. package/esm/compiler/discipline_classifier.d.ts.map +1 -0
  16. package/esm/compiler/discipline_classifier.js +191 -0
  17. package/esm/compiler/inverses.d.ts +7 -0
  18. package/esm/compiler/inverses.d.ts.map +1 -1
  19. package/esm/compiler/inverses.js +1 -18
  20. package/esm/compiler/mod.d.ts +30 -1
  21. package/esm/compiler/mod.d.ts.map +1 -1
  22. package/esm/compiler/mod.js +198 -65
  23. package/esm/compiler/schema.d.ts +15 -0
  24. package/esm/compiler/schema.d.ts.map +1 -1
  25. package/esm/compiler/schema.js +12 -0
  26. package/esm/config/markspec.d.ts +5 -0
  27. package/esm/config/markspec.d.ts.map +1 -1
  28. package/esm/config/markspec.js +17 -2
  29. package/esm/formatter/mod.d.ts +9 -3
  30. package/esm/formatter/mod.d.ts.map +1 -1
  31. package/esm/formatter/mod.js +97 -49
  32. package/esm/lexicons/loader.d.ts +35 -0
  33. package/esm/lexicons/loader.d.ts.map +1 -0
  34. package/esm/lexicons/loader.js +51 -0
  35. package/esm/lexicons/mod.d.ts +13 -0
  36. package/esm/lexicons/mod.d.ts.map +1 -0
  37. package/esm/lexicons/mod.js +12 -0
  38. package/esm/lint/glossary.d.ts +45 -0
  39. package/esm/lint/glossary.d.ts.map +1 -0
  40. package/esm/lint/glossary.js +85 -0
  41. package/esm/lint/mod.d.ts +4 -0
  42. package/esm/lint/mod.d.ts.map +1 -1
  43. package/esm/lint/mod.js +2 -0
  44. package/esm/lint/range_util.d.ts +25 -0
  45. package/esm/lint/range_util.d.ts.map +1 -0
  46. package/esm/lint/range_util.js +50 -0
  47. package/esm/lint/rules/ears.d.ts +39 -0
  48. package/esm/lint/rules/ears.d.ts.map +1 -0
  49. package/esm/lint/rules/ears.js +316 -0
  50. package/esm/lint/rules/incose_sentence.d.ts +46 -0
  51. package/esm/lint/rules/incose_sentence.d.ts.map +1 -0
  52. package/esm/lint/rules/incose_sentence.js +417 -0
  53. package/esm/lint/rules/modal_sentence.d.ts +46 -0
  54. package/esm/lint/rules/modal_sentence.d.ts.map +1 -0
  55. package/esm/lint/rules/modal_sentence.js +146 -0
  56. package/esm/lint/rules/passive.d.ts +64 -0
  57. package/esm/lint/rules/passive.d.ts.map +1 -0
  58. package/esm/lint/rules/passive.js +282 -0
  59. package/esm/lint/rules/suppression.d.ts +38 -3
  60. package/esm/lint/rules/suppression.d.ts.map +1 -1
  61. package/esm/lint/rules/suppression.js +58 -4
  62. package/esm/lint/rules/xref.d.ts +19 -0
  63. package/esm/lint/rules/xref.d.ts.map +1 -0
  64. package/esm/lint/rules/xref.js +248 -0
  65. package/esm/lint/runner.d.ts +31 -11
  66. package/esm/lint/runner.d.ts.map +1 -1
  67. package/esm/lint/runner.js +67 -26
  68. package/esm/lint/score.d.ts +64 -0
  69. package/esm/lint/score.d.ts.map +1 -0
  70. package/esm/lint/score.js +163 -0
  71. package/esm/lint/segmenter.d.ts +32 -0
  72. package/esm/lint/segmenter.d.ts.map +1 -0
  73. package/esm/lint/segmenter.js +79 -0
  74. package/esm/lint/types.d.ts +12 -0
  75. package/esm/lint/types.d.ts.map +1 -1
  76. package/esm/lock/canonical_edges.d.ts +31 -0
  77. package/esm/lock/canonical_edges.d.ts.map +1 -0
  78. package/esm/lock/canonical_edges.js +57 -0
  79. package/esm/lock/check.d.ts +24 -0
  80. package/esm/lock/check.d.ts.map +1 -0
  81. package/esm/lock/check.js +127 -0
  82. package/esm/lock/hash.d.ts +12 -0
  83. package/esm/lock/hash.d.ts.map +1 -0
  84. package/esm/lock/hash.js +32 -0
  85. package/esm/lock/mod.d.ts +19 -0
  86. package/esm/lock/mod.d.ts.map +1 -0
  87. package/esm/lock/mod.js +14 -0
  88. package/esm/lock/model.d.ts +81 -0
  89. package/esm/lock/model.d.ts.map +1 -0
  90. package/esm/lock/model.js +7 -0
  91. package/esm/lock/parser.d.ts +26 -0
  92. package/esm/lock/parser.d.ts.map +1 -0
  93. package/esm/lock/parser.js +195 -0
  94. package/esm/lock/resolve.d.ts +142 -0
  95. package/esm/lock/resolve.d.ts.map +1 -0
  96. package/esm/lock/resolve.js +389 -0
  97. package/esm/lock/serializer.d.ts +14 -0
  98. package/esm/lock/serializer.d.ts.map +1 -0
  99. package/esm/lock/serializer.js +104 -0
  100. package/esm/mod.d.ts +16 -9
  101. package/esm/mod.d.ts.map +1 -1
  102. package/esm/mod.js +12 -4
  103. package/esm/model/attributes.d.ts +6 -0
  104. package/esm/model/attributes.d.ts.map +1 -1
  105. package/esm/model/attributes.js +37 -0
  106. package/esm/model/discipline.d.ts +53 -0
  107. package/esm/model/discipline.d.ts.map +1 -0
  108. package/esm/model/discipline.js +50 -0
  109. package/esm/model/mod.d.ts +188 -30
  110. package/esm/model/mod.d.ts.map +1 -1
  111. package/esm/model/mod.js +42 -1
  112. package/esm/model/profile.d.ts +69 -0
  113. package/esm/model/profile.d.ts.map +1 -1
  114. package/esm/parser/attributes.d.ts.map +1 -1
  115. package/esm/parser/attributes.js +1 -10
  116. package/esm/parser/body_tokens.d.ts +35 -0
  117. package/esm/parser/body_tokens.d.ts.map +1 -0
  118. package/esm/parser/body_tokens.js +232 -0
  119. package/esm/parser/glossary.d.ts +8 -0
  120. package/esm/parser/glossary.d.ts.map +1 -1
  121. package/esm/parser/glossary.js +6 -4
  122. package/esm/parser/grammars.d.ts +5 -3
  123. package/esm/parser/grammars.d.ts.map +1 -1
  124. package/esm/parser/grammars.js +18 -4
  125. package/esm/parser/language_spec.d.ts +55 -0
  126. package/esm/parser/language_spec.d.ts.map +1 -0
  127. package/esm/parser/language_spec.js +419 -0
  128. package/esm/parser/line_map.d.ts +60 -0
  129. package/esm/parser/line_map.d.ts.map +1 -0
  130. package/esm/parser/line_map.js +41 -0
  131. package/esm/parser/markdown.d.ts +9 -0
  132. package/esm/parser/markdown.d.ts.map +1 -1
  133. package/esm/parser/markdown.js +97 -31
  134. package/esm/parser/mod.d.ts +4 -0
  135. package/esm/parser/mod.d.ts.map +1 -1
  136. package/esm/parser/mod.js +30 -8
  137. package/esm/parser/source.d.ts +39 -8
  138. package/esm/parser/source.d.ts.map +1 -1
  139. package/esm/parser/source.js +155 -65
  140. package/esm/parser/translate.d.ts +24 -0
  141. package/esm/parser/translate.d.ts.map +1 -0
  142. package/esm/parser/translate.js +99 -0
  143. package/esm/profile/chain.d.ts +8 -0
  144. package/esm/profile/chain.d.ts.map +1 -1
  145. package/esm/profile/chain.js +29 -1
  146. package/esm/profile/default_profile.d.ts +25 -0
  147. package/esm/profile/default_profile.d.ts.map +1 -0
  148. package/esm/profile/default_profile.js +43 -0
  149. package/esm/profile/discipline_mode.d.ts +64 -0
  150. package/esm/profile/discipline_mode.d.ts.map +1 -0
  151. package/esm/profile/discipline_mode.js +133 -0
  152. package/esm/profile/discipline_registry.d.ts +41 -0
  153. package/esm/profile/discipline_registry.d.ts.map +1 -0
  154. package/esm/profile/discipline_registry.js +67 -0
  155. package/esm/profile/load.d.ts +3 -1
  156. package/esm/profile/load.d.ts.map +1 -1
  157. package/esm/profile/load.js +24 -5
  158. package/esm/profile/manifest.d.ts.map +1 -1
  159. package/esm/profile/manifest.js +253 -20
  160. package/esm/profile/merge.d.ts.map +1 -1
  161. package/esm/profile/merge.js +112 -0
  162. package/esm/profile/mod.d.ts +2 -0
  163. package/esm/profile/mod.d.ts.map +1 -1
  164. package/esm/profile/mod.js +2 -0
  165. package/esm/sync/locked_attributes.d.ts +19 -0
  166. package/esm/sync/locked_attributes.d.ts.map +1 -0
  167. package/esm/sync/locked_attributes.js +27 -0
  168. package/esm/sync/log.d.ts +34 -0
  169. package/esm/sync/log.d.ts.map +1 -0
  170. package/esm/sync/log.js +48 -0
  171. package/esm/sync/mapping.d.ts +66 -0
  172. package/esm/sync/mapping.d.ts.map +1 -0
  173. package/esm/sync/mapping.js +165 -0
  174. package/esm/sync/mod.d.ts +16 -0
  175. package/esm/sync/mod.d.ts.map +1 -0
  176. package/esm/sync/mod.js +12 -0
  177. package/esm/sync/status.d.ts +23 -0
  178. package/esm/sync/status.d.ts.map +1 -0
  179. package/esm/sync/status.js +21 -0
  180. package/esm/typl/ast.d.ts +87 -0
  181. package/esm/typl/ast.d.ts.map +1 -0
  182. package/esm/typl/ast.js +21 -0
  183. package/esm/typl/bridge.d.ts +32 -0
  184. package/esm/typl/bridge.d.ts.map +1 -0
  185. package/esm/typl/bridge.js +27 -0
  186. package/esm/typl/bullet.d.ts +34 -0
  187. package/esm/typl/bullet.d.ts.map +1 -0
  188. package/esm/typl/bullet.js +44 -0
  189. package/esm/typl/diagnostics.d.ts +43 -0
  190. package/esm/typl/diagnostics.d.ts.map +1 -0
  191. package/esm/typl/diagnostics.js +61 -0
  192. package/esm/typl/fence.d.ts +31 -0
  193. package/esm/typl/fence.d.ts.map +1 -0
  194. package/esm/typl/fence.js +24 -0
  195. package/esm/typl/grammar.d.ts +20 -0
  196. package/esm/typl/grammar.d.ts.map +1 -0
  197. package/esm/typl/grammar.js +471 -0
  198. package/esm/typl/inline.d.ts +34 -0
  199. package/esm/typl/inline.d.ts.map +1 -0
  200. package/esm/typl/inline.js +48 -0
  201. package/esm/typl/lexer.d.ts +37 -0
  202. package/esm/typl/lexer.d.ts.map +1 -0
  203. package/esm/typl/lexer.js +234 -0
  204. package/esm/typl/mod.d.ts +23 -0
  205. package/esm/typl/mod.d.ts.map +1 -0
  206. package/esm/typl/mod.js +16 -0
  207. package/esm/typl/registry.d.ts +42 -0
  208. package/esm/typl/registry.d.ts.map +1 -0
  209. package/esm/typl/registry.js +26 -0
  210. package/esm/typl/validator.d.ts +29 -0
  211. package/esm/typl/validator.d.ts.map +1 -0
  212. package/esm/typl/validator.js +141 -0
  213. package/esm/util/line_endings.d.ts +33 -0
  214. package/esm/util/line_endings.d.ts.map +1 -0
  215. package/esm/util/line_endings.js +53 -0
  216. package/esm/util/modals.d.ts +29 -0
  217. package/esm/util/modals.d.ts.map +1 -0
  218. package/esm/util/modals.js +38 -0
  219. package/esm/validator/discipline.d.ts +35 -0
  220. package/esm/validator/discipline.d.ts.map +1 -0
  221. package/esm/validator/discipline.js +204 -0
  222. package/esm/validator/mod.d.ts +1 -1
  223. package/esm/validator/mod.d.ts.map +1 -1
  224. package/esm/validator/mod.js +23 -2
  225. package/esm/validator/modal_keywords.d.ts +15 -13
  226. package/esm/validator/modal_keywords.d.ts.map +1 -1
  227. package/esm/validator/modal_keywords.js +26 -109
  228. package/esm/validator/pattern.d.ts +15 -8
  229. package/esm/validator/pattern.d.ts.map +1 -1
  230. package/esm/validator/pattern.js +42 -19
  231. package/esm/validator/per_type_attrs.d.ts +2 -2
  232. package/esm/validator/per_type_attrs.d.ts.map +1 -1
  233. package/esm/validator/per_type_attrs.js +2 -2
  234. package/esm/validator/pipeline.d.ts +11 -0
  235. package/esm/validator/pipeline.d.ts.map +1 -1
  236. package/esm/validator/pipeline.js +37 -15
  237. package/esm/validator/type_resolution.d.ts +3 -3
  238. package/esm/validator/type_resolution.d.ts.map +1 -1
  239. package/esm/validator/type_resolution.js +31 -9
  240. package/package.json +2 -2
  241. package/script/ast/build.d.ts +11 -21
  242. package/script/ast/build.d.ts.map +1 -1
  243. package/script/ast/build.js +51 -140
  244. package/script/ast/nodes.d.ts +11 -43
  245. package/script/ast/nodes.d.ts.map +1 -1
  246. package/script/ast/nodes.js +6 -1
  247. package/script/ast/normalize.d.ts +8 -17
  248. package/script/ast/normalize.d.ts.map +1 -1
  249. package/script/ast/normalize.js +16 -74
  250. package/script/compiler/constants.d.ts +16 -0
  251. package/script/compiler/constants.d.ts.map +1 -0
  252. package/script/compiler/constants.js +29 -0
  253. package/script/compiler/discipline_classifier.d.ts +55 -0
  254. package/script/compiler/discipline_classifier.d.ts.map +1 -0
  255. package/script/compiler/discipline_classifier.js +196 -0
  256. package/script/compiler/inverses.d.ts +7 -0
  257. package/script/compiler/inverses.d.ts.map +1 -1
  258. package/script/compiler/inverses.js +2 -19
  259. package/script/compiler/mod.d.ts +30 -1
  260. package/script/compiler/mod.d.ts.map +1 -1
  261. package/script/compiler/mod.js +202 -69
  262. package/script/compiler/schema.d.ts +15 -0
  263. package/script/compiler/schema.d.ts.map +1 -1
  264. package/script/compiler/schema.js +12 -0
  265. package/script/config/markspec.d.ts +5 -0
  266. package/script/config/markspec.d.ts.map +1 -1
  267. package/script/config/markspec.js +17 -2
  268. package/script/formatter/mod.d.ts +9 -3
  269. package/script/formatter/mod.d.ts.map +1 -1
  270. package/script/formatter/mod.js +99 -51
  271. package/script/lexicons/loader.d.ts +35 -0
  272. package/script/lexicons/loader.d.ts.map +1 -0
  273. package/script/lexicons/loader.js +55 -0
  274. package/script/lexicons/mod.d.ts +13 -0
  275. package/script/lexicons/mod.d.ts.map +1 -0
  276. package/script/lexicons/mod.js +17 -0
  277. package/script/lint/glossary.d.ts +45 -0
  278. package/script/lint/glossary.d.ts.map +1 -0
  279. package/script/lint/glossary.js +88 -0
  280. package/script/lint/mod.d.ts +4 -0
  281. package/script/lint/mod.d.ts.map +1 -1
  282. package/script/lint/mod.js +6 -1
  283. package/script/lint/range_util.d.ts +25 -0
  284. package/script/lint/range_util.d.ts.map +1 -0
  285. package/script/lint/range_util.js +53 -0
  286. package/script/lint/rules/ears.d.ts +39 -0
  287. package/script/lint/rules/ears.d.ts.map +1 -0
  288. package/script/lint/rules/ears.js +320 -0
  289. package/script/lint/rules/incose_sentence.d.ts +46 -0
  290. package/script/lint/rules/incose_sentence.d.ts.map +1 -0
  291. package/script/lint/rules/incose_sentence.js +421 -0
  292. package/script/lint/rules/modal_sentence.d.ts +46 -0
  293. package/script/lint/rules/modal_sentence.d.ts.map +1 -0
  294. package/script/lint/rules/modal_sentence.js +150 -0
  295. package/script/lint/rules/passive.d.ts +64 -0
  296. package/script/lint/rules/passive.d.ts.map +1 -0
  297. package/script/lint/rules/passive.js +286 -0
  298. package/script/lint/rules/suppression.d.ts +38 -3
  299. package/script/lint/rules/suppression.d.ts.map +1 -1
  300. package/script/lint/rules/suppression.js +59 -3
  301. package/script/lint/rules/xref.d.ts +19 -0
  302. package/script/lint/rules/xref.d.ts.map +1 -0
  303. package/script/lint/rules/xref.js +251 -0
  304. package/script/lint/runner.d.ts +31 -11
  305. package/script/lint/runner.d.ts.map +1 -1
  306. package/script/lint/runner.js +67 -26
  307. package/script/lint/score.d.ts +64 -0
  308. package/script/lint/score.d.ts.map +1 -0
  309. package/script/lint/score.js +167 -0
  310. package/script/lint/segmenter.d.ts +32 -0
  311. package/script/lint/segmenter.d.ts.map +1 -0
  312. package/script/lint/segmenter.js +82 -0
  313. package/script/lint/types.d.ts +12 -0
  314. package/script/lint/types.d.ts.map +1 -1
  315. package/script/lock/canonical_edges.d.ts +31 -0
  316. package/script/lock/canonical_edges.d.ts.map +1 -0
  317. package/script/lock/canonical_edges.js +61 -0
  318. package/script/lock/check.d.ts +24 -0
  319. package/script/lock/check.d.ts.map +1 -0
  320. package/script/lock/check.js +130 -0
  321. package/script/lock/hash.d.ts +12 -0
  322. package/script/lock/hash.d.ts.map +1 -0
  323. package/script/lock/hash.js +36 -0
  324. package/script/lock/mod.d.ts +19 -0
  325. package/script/lock/mod.d.ts.map +1 -0
  326. package/script/lock/mod.js +31 -0
  327. package/script/lock/model.d.ts +81 -0
  328. package/script/lock/model.d.ts.map +1 -0
  329. package/script/lock/model.js +10 -0
  330. package/script/lock/parser.d.ts +26 -0
  331. package/script/lock/parser.d.ts.map +1 -0
  332. package/script/lock/parser.js +198 -0
  333. package/script/lock/resolve.d.ts +142 -0
  334. package/script/lock/resolve.d.ts.map +1 -0
  335. package/script/lock/resolve.js +397 -0
  336. package/script/lock/serializer.d.ts +14 -0
  337. package/script/lock/serializer.d.ts.map +1 -0
  338. package/script/lock/serializer.js +107 -0
  339. package/script/mod.d.ts +16 -9
  340. package/script/mod.d.ts.map +1 -1
  341. package/script/mod.js +111 -38
  342. package/script/model/attributes.d.ts +6 -0
  343. package/script/model/attributes.d.ts.map +1 -1
  344. package/script/model/attributes.js +38 -1
  345. package/script/model/discipline.d.ts +53 -0
  346. package/script/model/discipline.d.ts.map +1 -0
  347. package/script/model/discipline.js +53 -0
  348. package/script/model/mod.d.ts +188 -30
  349. package/script/model/mod.d.ts.map +1 -1
  350. package/script/model/mod.js +48 -1
  351. package/script/model/profile.d.ts +69 -0
  352. package/script/model/profile.d.ts.map +1 -1
  353. package/script/parser/attributes.d.ts.map +1 -1
  354. package/script/parser/attributes.js +1 -10
  355. package/script/parser/body_tokens.d.ts +35 -0
  356. package/script/parser/body_tokens.d.ts.map +1 -0
  357. package/script/parser/body_tokens.js +235 -0
  358. package/script/parser/glossary.d.ts +8 -0
  359. package/script/parser/glossary.d.ts.map +1 -1
  360. package/script/parser/glossary.js +7 -4
  361. package/script/parser/grammars.d.ts +5 -3
  362. package/script/parser/grammars.d.ts.map +1 -1
  363. package/script/parser/grammars.js +21 -8
  364. package/script/parser/language_spec.d.ts +55 -0
  365. package/script/parser/language_spec.d.ts.map +1 -0
  366. package/script/parser/language_spec.js +423 -0
  367. package/script/parser/line_map.d.ts +60 -0
  368. package/script/parser/line_map.d.ts.map +1 -0
  369. package/script/parser/line_map.js +44 -0
  370. package/script/parser/markdown.d.ts +9 -0
  371. package/script/parser/markdown.d.ts.map +1 -1
  372. package/script/parser/markdown.js +95 -29
  373. package/script/parser/mod.d.ts +4 -0
  374. package/script/parser/mod.d.ts.map +1 -1
  375. package/script/parser/mod.js +32 -7
  376. package/script/parser/source.d.ts +39 -8
  377. package/script/parser/source.d.ts.map +1 -1
  378. package/script/parser/source.js +156 -69
  379. package/script/parser/translate.d.ts +24 -0
  380. package/script/parser/translate.d.ts.map +1 -0
  381. package/script/parser/translate.js +102 -0
  382. package/script/profile/chain.d.ts +8 -0
  383. package/script/profile/chain.d.ts.map +1 -1
  384. package/script/profile/chain.js +29 -1
  385. package/script/profile/default_profile.d.ts +25 -0
  386. package/script/profile/default_profile.d.ts.map +1 -0
  387. package/script/profile/default_profile.js +46 -0
  388. package/script/profile/discipline_mode.d.ts +64 -0
  389. package/script/profile/discipline_mode.d.ts.map +1 -0
  390. package/script/profile/discipline_mode.js +138 -0
  391. package/script/profile/discipline_registry.d.ts +41 -0
  392. package/script/profile/discipline_registry.d.ts.map +1 -0
  393. package/script/profile/discipline_registry.js +70 -0
  394. package/script/profile/load.d.ts +3 -1
  395. package/script/profile/load.d.ts.map +1 -1
  396. package/script/profile/load.js +24 -5
  397. package/script/profile/manifest.d.ts.map +1 -1
  398. package/script/profile/manifest.js +252 -19
  399. package/script/profile/merge.d.ts.map +1 -1
  400. package/script/profile/merge.js +112 -0
  401. package/script/profile/mod.d.ts +2 -0
  402. package/script/profile/mod.d.ts.map +1 -1
  403. package/script/profile/mod.js +6 -1
  404. package/script/sync/locked_attributes.d.ts +19 -0
  405. package/script/sync/locked_attributes.d.ts.map +1 -0
  406. package/script/sync/locked_attributes.js +30 -0
  407. package/script/sync/log.d.ts +34 -0
  408. package/script/sync/log.d.ts.map +1 -0
  409. package/script/sync/log.js +52 -0
  410. package/script/sync/mapping.d.ts +66 -0
  411. package/script/sync/mapping.d.ts.map +1 -0
  412. package/script/sync/mapping.js +169 -0
  413. package/script/sync/mod.d.ts +16 -0
  414. package/script/sync/mod.d.ts.map +1 -0
  415. package/script/sync/mod.js +21 -0
  416. package/script/sync/status.d.ts +23 -0
  417. package/script/sync/status.d.ts.map +1 -0
  418. package/script/sync/status.js +24 -0
  419. package/script/typl/ast.d.ts +87 -0
  420. package/script/typl/ast.d.ts.map +1 -0
  421. package/script/typl/ast.js +24 -0
  422. package/script/typl/bridge.d.ts +32 -0
  423. package/script/typl/bridge.d.ts.map +1 -0
  424. package/script/typl/bridge.js +30 -0
  425. package/script/typl/bullet.d.ts +34 -0
  426. package/script/typl/bullet.d.ts.map +1 -0
  427. package/script/typl/bullet.js +47 -0
  428. package/script/typl/diagnostics.d.ts +43 -0
  429. package/script/typl/diagnostics.d.ts.map +1 -0
  430. package/script/typl/diagnostics.js +65 -0
  431. package/script/typl/fence.d.ts +31 -0
  432. package/script/typl/fence.d.ts.map +1 -0
  433. package/script/typl/fence.js +27 -0
  434. package/script/typl/grammar.d.ts +20 -0
  435. package/script/typl/grammar.d.ts.map +1 -0
  436. package/script/typl/grammar.js +474 -0
  437. package/script/typl/inline.d.ts +34 -0
  438. package/script/typl/inline.d.ts.map +1 -0
  439. package/script/typl/inline.js +51 -0
  440. package/script/typl/lexer.d.ts +37 -0
  441. package/script/typl/lexer.d.ts.map +1 -0
  442. package/script/typl/lexer.js +237 -0
  443. package/script/typl/mod.d.ts +23 -0
  444. package/script/typl/mod.d.ts.map +1 -0
  445. package/script/typl/mod.js +29 -0
  446. package/script/typl/registry.d.ts +42 -0
  447. package/script/typl/registry.d.ts.map +1 -0
  448. package/script/typl/registry.js +29 -0
  449. package/script/typl/validator.d.ts +29 -0
  450. package/script/typl/validator.d.ts.map +1 -0
  451. package/script/typl/validator.js +144 -0
  452. package/script/util/line_endings.d.ts +33 -0
  453. package/script/util/line_endings.d.ts.map +1 -0
  454. package/script/util/line_endings.js +58 -0
  455. package/script/util/modals.d.ts +29 -0
  456. package/script/util/modals.d.ts.map +1 -0
  457. package/script/util/modals.js +42 -0
  458. package/script/validator/discipline.d.ts +35 -0
  459. package/script/validator/discipline.d.ts.map +1 -0
  460. package/script/validator/discipline.js +207 -0
  461. package/script/validator/mod.d.ts +1 -1
  462. package/script/validator/mod.d.ts.map +1 -1
  463. package/script/validator/mod.js +23 -1
  464. package/script/validator/modal_keywords.d.ts +15 -13
  465. package/script/validator/modal_keywords.d.ts.map +1 -1
  466. package/script/validator/modal_keywords.js +26 -109
  467. package/script/validator/pattern.d.ts +15 -8
  468. package/script/validator/pattern.d.ts.map +1 -1
  469. package/script/validator/pattern.js +42 -19
  470. package/script/validator/per_type_attrs.d.ts +2 -2
  471. package/script/validator/per_type_attrs.d.ts.map +1 -1
  472. package/script/validator/per_type_attrs.js +2 -2
  473. package/script/validator/pipeline.d.ts +11 -0
  474. package/script/validator/pipeline.d.ts.map +1 -1
  475. package/script/validator/pipeline.js +40 -17
  476. package/script/validator/type_resolution.d.ts +3 -3
  477. package/script/validator/type_resolution.d.ts.map +1 -1
  478. package/script/validator/type_resolution.js +31 -9
  479. package/esm/parser/entity_refs.d.ts +0 -53
  480. package/esm/parser/entity_refs.d.ts.map +0 -1
  481. package/esm/parser/entity_refs.js +0 -151
  482. package/script/parser/entity_refs.d.ts +0 -53
  483. package/script/parser/entity_refs.d.ts.map +0 -1
  484. package/script/parser/entity_refs.js +0 -155
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module core/util/modals
3
+ *
4
+ * RFC 2119 and EARS modal-keyword helpers shared by `formatter/mod.ts`
5
+ * and `ast/normalize.ts`. Extracted to `core/util/` to avoid a dep cycle:
6
+ * `ast/` is a dependency of `formatter/`, so `formatter → ast` is OK but
7
+ * `ast → formatter` is not.
8
+ */
9
+ /**
10
+ * RFC 2119 modal keywords in uppercase form, with optional ` NOT` suffix.
11
+ * Captured for canonical-form normalisation per spec §3.4.1: uppercase
12
+ * input is accepted but emitted lowercase, unconditionally.
13
+ */
14
+ export declare const RFC2119_MODAL_RE: RegExp;
15
+ /**
16
+ * EARS keywords subject to the sentence-initial rule of spec §3.4.1:
17
+ * lowercased when mid-sentence, preserved when starting a sentence.
18
+ * `If…then` is deferred to a later slice because its multi-token form
19
+ * needs separate handling.
20
+ */
21
+ export declare const EARS_KEYWORD_RE: RegExp;
22
+ /**
23
+ * Decide whether the EARS keyword at `offset` in `line` is at sentence
24
+ * start (return value true). Walks left over whitespace and reports true
25
+ * when it hits the beginning of the line or a sentence-terminating
26
+ * punctuation character (`.`, `!`, `?`).
27
+ */
28
+ export declare function isSentenceInitial(line: string, offset: number): boolean;
29
+ //# sourceMappingURL=modals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../src/util/modals.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAA0C,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAmC,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAOvE"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /**
3
+ * @module core/util/modals
4
+ *
5
+ * RFC 2119 and EARS modal-keyword helpers shared by `formatter/mod.ts`
6
+ * and `ast/normalize.ts`. Extracted to `core/util/` to avoid a dep cycle:
7
+ * `ast/` is a dependency of `formatter/`, so `formatter → ast` is OK but
8
+ * `ast → formatter` is not.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.EARS_KEYWORD_RE = exports.RFC2119_MODAL_RE = void 0;
12
+ exports.isSentenceInitial = isSentenceInitial;
13
+ /**
14
+ * RFC 2119 modal keywords in uppercase form, with optional ` NOT` suffix.
15
+ * Captured for canonical-form normalisation per spec §3.4.1: uppercase
16
+ * input is accepted but emitted lowercase, unconditionally.
17
+ */
18
+ exports.RFC2119_MODAL_RE = /\b(SHALL|SHOULD|MAY|MUST)(\s+NOT)?\b/g;
19
+ /**
20
+ * EARS keywords subject to the sentence-initial rule of spec §3.4.1:
21
+ * lowercased when mid-sentence, preserved when starting a sentence.
22
+ * `If…then` is deferred to a later slice because its multi-token form
23
+ * needs separate handling.
24
+ */
25
+ exports.EARS_KEYWORD_RE = /\b(When|While|Where|Unless)\b/g;
26
+ /**
27
+ * Decide whether the EARS keyword at `offset` in `line` is at sentence
28
+ * start (return value true). Walks left over whitespace and reports true
29
+ * when it hits the beginning of the line or a sentence-terminating
30
+ * punctuation character (`.`, `!`, `?`).
31
+ */
32
+ function isSentenceInitial(line, offset) {
33
+ if (offset === 0)
34
+ return true;
35
+ let i = offset - 1;
36
+ while (i >= 0 && (line[i] === " " || line[i] === "\t"))
37
+ i--;
38
+ if (i < 0)
39
+ return true;
40
+ const prev = line[i];
41
+ return prev === "." || prev === "!" || prev === "?";
42
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @module core/validator/discipline
3
+ *
4
+ * Discipline-attribute validator per ADR-017 Slice 3. Emits seven codes:
5
+ *
6
+ * - MSL-T025 — `Discipline:` value not in the effective kind set (error)
7
+ * - MSL-T026 — `Discipline-frozen:` value malformed (error)
8
+ * - MSL-T027 — `Discipline-frozen:` kind not in the effective set (error)
9
+ * - MSL-T028 — `Discipline:` conflicts with channel-3 derivation (warning)
10
+ * - MSL-T029 — `Discipline:` conflicts with channel-4 derivation (warning)
11
+ * - MSL-T030 — `Discipline-frozen:` differs from current derivation (warning)
12
+ * - MSL-T031 — `Discipline:` and `Discipline-frozen:` disagree (warning)
13
+ *
14
+ * The effective kind set used by T025/T027 is `CORE_KINDS` plus any kinds
15
+ * the active profile chain declared via `profile.kinds:` (Slice 2's
16
+ * effective registry).
17
+ *
18
+ * Tasks 5–8 of the plan add T026–T031 incrementally on top of this skeleton.
19
+ */
20
+ import type { Diagnostic, DisciplineRegistry, DisplayId, Entry } from "../model/mod.js";
21
+ /**
22
+ * Validate the `Discipline:` and `Discipline-frozen:` attributes across
23
+ * every entry. Pure function: takes the entries, a lookup map (used by
24
+ * later tasks for channel-4 derivation), and the effective registry.
25
+ *
26
+ * @param entries Entries to walk.
27
+ * @param entriesByDisplayId Lookup map for channel-4 derivation. Tasks 5–8
28
+ * will use this; Task 4 ignores it but keeps the parameter to fix the
29
+ * signature now.
30
+ * @param registry Effective discipline registry from Slice 2's
31
+ * `buildEffectiveDisciplineRegistry()`, or `CORE_DISCIPLINE_REGISTRY` in
32
+ * core-only mode.
33
+ */
34
+ export declare function validateDiscipline(entries: readonly Entry[], entriesByDisplayId: ReadonlyMap<DisplayId, Entry>, registry: DisciplineRegistry): Diagnostic[];
35
+ //# sourceMappingURL=discipline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discipline.d.ts","sourceRoot":"","sources":["../../src/validator/discipline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,KAAK,EACN,MAAM,iBAAiB,CAAC;AAmFzB;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,kBAAkB,EAAE,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,EACjD,QAAQ,EAAE,kBAAkB,GAC3B,UAAU,EAAE,CAuHd"}
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ /**
3
+ * @module core/validator/discipline
4
+ *
5
+ * Discipline-attribute validator per ADR-017 Slice 3. Emits seven codes:
6
+ *
7
+ * - MSL-T025 — `Discipline:` value not in the effective kind set (error)
8
+ * - MSL-T026 — `Discipline-frozen:` value malformed (error)
9
+ * - MSL-T027 — `Discipline-frozen:` kind not in the effective set (error)
10
+ * - MSL-T028 — `Discipline:` conflicts with channel-3 derivation (warning)
11
+ * - MSL-T029 — `Discipline:` conflicts with channel-4 derivation (warning)
12
+ * - MSL-T030 — `Discipline-frozen:` differs from current derivation (warning)
13
+ * - MSL-T031 — `Discipline:` and `Discipline-frozen:` disagree (warning)
14
+ *
15
+ * The effective kind set used by T025/T027 is `CORE_KINDS` plus any kinds
16
+ * the active profile chain declared via `profile.kinds:` (Slice 2's
17
+ * effective registry).
18
+ *
19
+ * Tasks 5–8 of the plan add T026–T031 incrementally on top of this skeleton.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.validateDiscipline = validateDiscipline;
23
+ const mod_js_1 = require("../model/mod.js");
24
+ const discipline_classifier_js_1 = require("../compiler/discipline_classifier.js");
25
+ /**
26
+ * Read the first non-empty value of a single-cardinality attribute. Mirrors
27
+ * the helper in the classifier so the validator doesn't need to import it.
28
+ */
29
+ function singleAttrValue(entry, key) {
30
+ for (const attr of entry.rawAttributes) {
31
+ if (attr.key === key) {
32
+ const trimmed = attr.value.trim();
33
+ if (trimmed.length > 0)
34
+ return trimmed;
35
+ }
36
+ }
37
+ return undefined;
38
+ }
39
+ /**
40
+ * Build the effective kind set from `CORE_KINDS` plus every type → kind
41
+ * value the registry contains.
42
+ */
43
+ function effectiveKindSet(registry) {
44
+ const set = new Set(mod_js_1.CORE_KINDS);
45
+ for (const kind of registry.values())
46
+ set.add(kind);
47
+ return set;
48
+ }
49
+ /**
50
+ * Compute channel-3 alone for an entry — what the type-based registry
51
+ * lookup would yield. Returns `undefined` when no type or unknown type.
52
+ */
53
+ function channel3Kind(entry, registry) {
54
+ if (entry.type === undefined) {
55
+ // Fallback: look at the raw Type: attribute (mirrors resolvedType()
56
+ // in the classifier so the validator works in core-only mode).
57
+ for (const attr of entry.rawAttributes) {
58
+ if (attr.key === "Type") {
59
+ const trimmed = attr.value.trim();
60
+ if (trimmed.length > 0)
61
+ return registry.get(trimmed);
62
+ }
63
+ }
64
+ return undefined;
65
+ }
66
+ return registry.get(entry.type);
67
+ }
68
+ /**
69
+ * Compute channel-4 alone for an entry — walk Allocated-to targets,
70
+ * return the unique discipline if one, MIXED_DISCIPLINE if many,
71
+ * `undefined` if none.
72
+ */
73
+ function channel4Kind(entry, entriesByDisplayId, registry) {
74
+ const seen = new Set();
75
+ for (const attr of entry.rawAttributes) {
76
+ if (attr.key !== "Allocated-to")
77
+ continue;
78
+ for (const raw of attr.value.split(",")) {
79
+ const token = raw.trim();
80
+ if (token.length === 0)
81
+ continue;
82
+ const target = entriesByDisplayId.get((0, mod_js_1.makeDisplayId)(token));
83
+ if (!target)
84
+ continue;
85
+ const targetType = target.type ??
86
+ target.rawAttributes.find((a) => a.key === "Type")?.value.trim();
87
+ if (!targetType)
88
+ continue;
89
+ const kind = registry.get(targetType);
90
+ if (kind !== undefined)
91
+ seen.add(kind);
92
+ }
93
+ }
94
+ if (seen.size === 0)
95
+ return undefined;
96
+ if (seen.size === 1)
97
+ return [...seen][0];
98
+ return mod_js_1.MIXED_DISCIPLINE;
99
+ }
100
+ /**
101
+ * Validate the `Discipline:` and `Discipline-frozen:` attributes across
102
+ * every entry. Pure function: takes the entries, a lookup map (used by
103
+ * later tasks for channel-4 derivation), and the effective registry.
104
+ *
105
+ * @param entries Entries to walk.
106
+ * @param entriesByDisplayId Lookup map for channel-4 derivation. Tasks 5–8
107
+ * will use this; Task 4 ignores it but keeps the parameter to fix the
108
+ * signature now.
109
+ * @param registry Effective discipline registry from Slice 2's
110
+ * `buildEffectiveDisciplineRegistry()`, or `CORE_DISCIPLINE_REGISTRY` in
111
+ * core-only mode.
112
+ */
113
+ function validateDiscipline(entries, entriesByDisplayId, registry) {
114
+ const out = [];
115
+ const knownKinds = effectiveKindSet(registry);
116
+ for (const entry of entries) {
117
+ const override = singleAttrValue(entry, "Discipline");
118
+ if (override !== undefined && !knownKinds.has(override)) {
119
+ out.push({
120
+ code: "MSL-T025",
121
+ severity: "error",
122
+ message: `${entry.displayId}: Discipline: '${override}' is not a known kind (declare it under profile.kinds: or use a core kind: ${[...mod_js_1.CORE_KINDS].join(" / ")})`,
123
+ location: entry.location,
124
+ });
125
+ }
126
+ const frozen = singleAttrValue(entry, "Discipline-frozen");
127
+ if (frozen !== undefined) {
128
+ const parsed = (0, discipline_classifier_js_1.parseFrozenValue)(frozen);
129
+ if (parsed === undefined) {
130
+ out.push({
131
+ code: "MSL-T026",
132
+ severity: "error",
133
+ message: `${entry.displayId}: Discipline-frozen: '${frozen}' is malformed (expected '<kind>' or '<kind> @ YYYY-MM-DD'; kind must match /^[a-z][a-z0-9-]*$/; date must be calendar-valid)`,
134
+ location: entry.location,
135
+ });
136
+ }
137
+ else if (!knownKinds.has(parsed.kind)) {
138
+ out.push({
139
+ code: "MSL-T027",
140
+ severity: "error",
141
+ message: `${entry.displayId}: Discipline-frozen: kind '${parsed.kind}' is not a known kind (declare it under profile.kinds: or use a core kind: ${[...mod_js_1.CORE_KINDS].join(" / ")})`,
142
+ location: entry.location,
143
+ });
144
+ }
145
+ }
146
+ // T028 / T029: override vs channel-3 / channel-4 conflicts. Only run
147
+ // when the override is well-formed (suppressed by T025) and a channel
148
+ // actually produced a kind (default-system suppression).
149
+ if (override !== undefined && knownKinds.has(override)) {
150
+ const c3 = channel3Kind(entry, registry);
151
+ if (c3 !== undefined && c3 !== override) {
152
+ out.push({
153
+ code: "MSL-T028",
154
+ severity: "warning",
155
+ message: `${entry.displayId}: Discipline: '${override}' conflicts with type-based derivation '${c3}' (from Type: ${entry.type ?? "(raw)"})`,
156
+ location: entry.location,
157
+ });
158
+ }
159
+ const c4 = channel4Kind(entry, entriesByDisplayId, registry);
160
+ if (c4 !== undefined && c4 !== override) {
161
+ out.push({
162
+ code: "MSL-T029",
163
+ severity: "warning",
164
+ message: `${entry.displayId}: Discipline: '${override}' conflicts with allocation-based derivation '${c4}' (via Allocated-to)`,
165
+ location: entry.location,
166
+ });
167
+ }
168
+ }
169
+ // T030: freeze divergence. Runs whenever the freeze is well-formed
170
+ // and references a known kind — NOT suppressed by default-system
171
+ // derivation (drift from a known kind to default-system is exactly
172
+ // what freeze is designed to surface).
173
+ if (frozen !== undefined) {
174
+ const parsedF = (0, discipline_classifier_js_1.parseFrozenValue)(frozen);
175
+ if (parsedF !== undefined && knownKinds.has(parsedF.kind)) {
176
+ const current = (0, discipline_classifier_js_1.classifyDerivationOnly)(entry, entriesByDisplayId, registry);
177
+ if (current !== parsedF.kind) {
178
+ out.push({
179
+ code: "MSL-T030",
180
+ severity: "warning",
181
+ message: `${entry.displayId}: Discipline-frozen: '${parsedF.kind}' differs from current derivation '${current}' (something changed since the freeze on ${parsedF.date ?? "(no date)"})`,
182
+ location: entry.location,
183
+ });
184
+ }
185
+ }
186
+ }
187
+ // T031: override vs freeze disagreement. Both must be well-formed
188
+ // and reference known kinds — otherwise upstream errors (T025/T026/T027)
189
+ // handle the case.
190
+ if (override !== undefined &&
191
+ knownKinds.has(override) &&
192
+ frozen !== undefined) {
193
+ const parsedF = (0, discipline_classifier_js_1.parseFrozenValue)(frozen);
194
+ if (parsedF !== undefined && knownKinds.has(parsedF.kind)) {
195
+ if (override !== parsedF.kind) {
196
+ out.push({
197
+ code: "MSL-T031",
198
+ severity: "warning",
199
+ message: `${entry.displayId}: Discipline: '${override}' disagrees with Discipline-frozen: '${parsedF.kind}' (the override wins for derivedDiscipline; remove or update the freeze if the override is intentional)`,
200
+ location: entry.location,
201
+ });
202
+ }
203
+ }
204
+ }
205
+ }
206
+ return out;
207
+ }
@@ -30,7 +30,7 @@ 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
35
  export { validateListingDocuments } from "./listing.js";
36
36
  export type { ListingFileContext, ListingKind } from "./listing.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;AAmCpE,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;AAwZD,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,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"}
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"}
@@ -15,12 +15,13 @@
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.validateListingDocuments = 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
23
  const value_types_js_1 = require("./value_types.js");
24
+ const mod_js_2 = require("../typl/mod.js");
24
25
  /** Universal attribute keys the core recognizes. */
25
26
  const UNIVERSAL_KEYS = new Set(mod_js_1.UNIVERSAL_ATTRIBUTE_KEYS);
26
27
  /**
@@ -52,6 +53,11 @@ function validate(entries) {
52
53
  const diagnostics = [];
53
54
  checkStructural(entries, diagnostics);
54
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);
55
61
  const valid = !diagnostics.some((d) => d.severity === "error");
56
62
  return { diagnostics, valid };
57
63
  }
@@ -368,6 +374,21 @@ function checkStructural(entries, diagnostics) {
368
374
  location: entry.location,
369
375
  });
370
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
+ }
371
392
  }
372
393
  }
373
394
  }
@@ -453,6 +474,7 @@ function findAttr(attrs, key) {
453
474
  }
454
475
  var pipeline_js_1 = require("./pipeline.js");
455
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; } });
456
478
  var listing_js_1 = require("./listing.js");
457
479
  Object.defineProperty(exports, "validateListingDocuments", { enumerable: true, get: function () { return listing_js_1.validateListingDocuments; } });
458
480
  var types_js_1 = require("./types.js");
@@ -2,22 +2,24 @@
2
2
  * @module core/validator/modal_keywords
3
3
  *
4
4
  * MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
5
- * `SHOULD`, `MAY`, `MUST`, optionally `… NOT`) in entry-body prose.
6
- * The formatter normalises these to lowercase per spec §3.4.1; this
7
- * validator surfaces the deviation in a lint-only flow. Profiles may
8
- * promote the severity. Each prose-bearing node's `InlineContent.markers`
9
- * carries pre-extracted `ModalMarker` objects from the builder; an
10
- * uppercase match is detected where `marker.raw` differs from
11
- * `marker.canonical`. EARS markers are not flagged — MSL-M060 targets
12
- * RFC 2119 only. Code, Feature, and Math blocks are automatically
13
- * excluded because the builder does not extract markers from verbatim
14
- * content.
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.
15
14
  */
16
15
  import type { Diagnostic, Entry } from "../model/mod.js";
17
16
  /**
18
- * Scan an entry's body for uppercase modal keywords and emit MSL-M060
19
- * for each occurrence. Severity is `warning`; the formatter rewrites
20
- * them on the next run.
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).
21
23
  */
22
24
  export declare function validateModalKeywords(entry: Entry): readonly Diagnostic[];
23
25
  //# sourceMappingURL=modal_keywords.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal_keywords.d.ts","sourceRoot":"","sources":["../../src/validator/modal_keywords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAiFzD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,UAAU,EAAE,CAkDzE"}
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"}
@@ -3,123 +3,40 @@
3
3
  * @module core/validator/modal_keywords
4
4
  *
5
5
  * MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
6
- * `SHOULD`, `MAY`, `MUST`, optionally `… NOT`) in entry-body prose.
7
- * The formatter normalises these to lowercase per spec §3.4.1; this
8
- * validator surfaces the deviation in a lint-only flow. Profiles may
9
- * promote the severity. Each prose-bearing node's `InlineContent.markers`
10
- * carries pre-extracted `ModalMarker` objects from the builder; an
11
- * uppercase match is detected where `marker.raw` differs from
12
- * `marker.canonical`. EARS markers are not flagged — MSL-M060 targets
13
- * RFC 2119 only. Code, Feature, and Math blocks are automatically
14
- * excluded because the builder does not extract markers from verbatim
15
- * content.
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.
16
15
  */
17
16
  Object.defineProperty(exports, "__esModule", { value: true });
18
17
  exports.validateModalKeywords = validateModalKeywords;
19
18
  const type_resolution_js_1 = require("./type_resolution.js");
20
- // ---------------------------------------------------------------------------
21
- // Marker collection from bodyAst
22
- // ---------------------------------------------------------------------------
23
- /** Collect all modal markers from an InlineContent object. */
24
- function modalsFromInline(content) {
25
- return content.markers.filter((m) => m.kind === "modal");
26
- }
27
- /** Recursively collect modal markers from a list item's blocks. */
28
- function modalsFromListItem(item) {
29
- const out = [];
30
- for (const block of item.blocks) {
31
- out.push(...modalsFromBlock(block));
32
- }
33
- return out;
34
- }
35
- /** Collect all modal markers from a single BodyBlock (recursively). */
36
- function modalsFromBlock(block) {
37
- const out = [];
38
- switch (block.kind) {
39
- case "paragraph":
40
- out.push(...modalsFromInline(block.content));
41
- break;
42
- case "list":
43
- for (const item of block.items) {
44
- out.push(...modalsFromListItem(item));
45
- }
46
- break;
47
- case "table":
48
- for (const cell of block.header) {
49
- out.push(...modalsFromInline(cell));
50
- }
51
- for (const row of block.rows) {
52
- for (const cell of row) {
53
- out.push(...modalsFromInline(cell));
54
- }
55
- }
56
- break;
57
- case "note":
58
- out.push(...modalsFromInline(block.content));
59
- break;
60
- case "blockquote":
61
- out.push(...modalsFromInline(block.content));
62
- break;
63
- case "definition-list":
64
- for (const item of block.items) {
65
- out.push(...modalsFromInline(item.term));
66
- out.push(...modalsFromInline(item.definition));
67
- }
68
- break;
69
- case "code":
70
- case "feature":
71
- case "math":
72
- case "figure":
73
- case "caption":
74
- case "unknown":
75
- // Verbatim / structural nodes: no modal markers.
76
- break;
77
- default:
78
- break;
79
- }
80
- return out;
81
- }
82
- // ---------------------------------------------------------------------------
83
- // Public API
84
- // ---------------------------------------------------------------------------
85
19
  /**
86
- * Scan an entry's body for uppercase modal keywords and emit MSL-M060
87
- * for each occurrence. Severity is `warning`; the formatter rewrites
88
- * them on the next run.
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).
89
26
  */
90
27
  function validateModalKeywords(entry) {
91
28
  const diagnostics = [];
92
- let anyModalSeen = false;
93
- const blocks = entry.bodyAst ?? [];
94
- for (const block of blocks) {
95
- for (const marker of modalsFromBlock(block)) {
96
- anyModalSeen = true;
97
- // MSL-M060: RFC 2119 keywords in non-canonical (uppercase) form.
98
- // `marker.raw` is the original source text; `marker.canonical` is
99
- // always lowercase. When they differ, the keyword is uppercase.
100
- // EARS markers (cls = "ears") are always case-preserved and
101
- // are not subject to MSL-M060.
102
- if (marker.cls !== "rfc2119")
103
- continue;
104
- const raw = marker.raw ?? marker.canonical;
105
- if (raw === marker.canonical)
106
- continue; // already lowercase — OK
107
- diagnostics.push({
108
- code: "MSL-M060",
109
- severity: "warning",
110
- message: `${entry.displayId}: modal keyword '${raw}' in body ` +
111
- `prose is uppercase (spec §3.4.1 canonical form is lowercase; ` +
112
- `'markspec format' will rewrite it)`,
113
- location: {
114
- file: entry.location.file,
115
- // marker.range.start.line is body-relative 1-based.
116
- // entry.location.line is the title line (0-based offset 0).
117
- // Body line 1 → file line entry.location.line + 0, etc.
118
- line: entry.location.line + (marker.range.start.line - 1),
119
- column: marker.range.start.column,
120
- },
121
- });
122
- }
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
+ });
123
40
  }
124
41
  // MSL-M061 — Requirement-type entry contains no modal keyword
125
42
  // (info; style hint). Gated on the resolved core type being
@@ -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"}