@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
@@ -4,39 +4,62 @@
4
4
  * Display-ID pattern template → anchored RegExp.
5
5
  *
6
6
  * Grammar (per ADR-009 §5):
7
- * pattern := literal-prefix placeholder (literal-suffix)?
8
- * placeholder := "{n}" | "{n:" PADDING "d}"
9
- * PADDING := "0" digits
7
+ * pattern := segment+ (exactly one counter)
8
+ * segment := literal | counter | named
9
+ * counter := "{n}" | "{n:" PADDING "d}"
10
+ * named := "{" identifier "}" (e.g. {scope}, {feature})
11
+ * PADDING := "0" digits
12
+ *
13
+ * The counter `{n}` is the numeric running index (exactly one required). A
14
+ * named placeholder such as `{scope}` matches a free alphanumeric segment —
15
+ * it validates the *shape* `PREFIX_<scope>_<NNNN>` without pinning the scope
16
+ * to a fixed value, so one profile pattern serves every feature scope.
10
17
  *
11
18
  * Examples:
12
- * REQ-{n} → ^REQ-(\d+)$
13
- * REQ-{n:04d} → ^REQ-(\d{4})$
14
- * STAKE-REQ-{n:06d} → ^STAKE-REQ-(\d{6})$
19
+ * REQ-{n} → ^REQ-(\d+)$
20
+ * REQ-{n:04d} → ^REQ-(\d{4})$
21
+ * XREQ_{scope}_{n:04d} → ^XREQ_(?<scope>[A-Za-z0-9]+)_(\d{4})$
15
22
  */
16
- const PLACEHOLDER_RE = /\{n(?::(0\d+)d)?\}/;
23
+ // One token: the {n} counter (optionally padded) OR a {named} segment.
24
+ const TOKEN_RE = /\{n(?::(0\d+)d)?\}|\{([A-Za-z][A-Za-z0-9_]*)\}/g;
17
25
  /**
18
26
  * Compile a display-ID pattern template into an anchored RegExp.
19
27
  *
20
- * Throws if the template is missing the `{n}` placeholder or has an invalid
21
- * padding specifier.
28
+ * Throws if the template is missing the `{n}` counter, has more than one, or
29
+ * has an invalid padding specifier.
22
30
  */
23
31
  export function compileDisplayIdPattern(template) {
24
- const match = PLACEHOLDER_RE.exec(template);
25
- if (!match) {
32
+ let regexSource = "^";
33
+ let lastIndex = 0;
34
+ let counters = 0;
35
+ const re = new RegExp(TOKEN_RE);
36
+ let match;
37
+ while ((match = re.exec(template)) !== null) {
38
+ regexSource += escapeRegex(template.slice(lastIndex, match.index));
39
+ const named = match[2];
40
+ if (named === undefined) {
41
+ // {n} / {n:0Nd} counter
42
+ const padding = match[1];
43
+ regexSource += "(" + (padding ? `\\d{${Number(padding)}}` : `\\d+`) + ")";
44
+ counters++;
45
+ }
46
+ else {
47
+ // {scope}-style named segment → free alphanumeric capture
48
+ regexSource += `(?<${named}>[A-Za-z0-9]+)`;
49
+ }
50
+ lastIndex = match.index + match[0].length;
51
+ }
52
+ regexSource += escapeRegex(template.slice(lastIndex)) + "$";
53
+ if (counters === 0) {
26
54
  if (/\{n:[^}]*\}/.test(template)) {
27
55
  throw new Error(`display-id-pattern '${template}': invalid padding specifier ` +
28
56
  `(expected {n} or {n:NNd})`);
29
57
  }
30
58
  throw new Error(`display-id-pattern '${template}': missing {n} placeholder`);
31
59
  }
32
- const padding = match[1];
33
- const placeholderStart = match.index;
34
- const placeholderEnd = match.index + match[0].length;
35
- const prefix = template.slice(0, placeholderStart);
36
- const suffix = template.slice(placeholderEnd);
37
- const digitGroup = padding ? `\\d{${Number(padding)}}` : `\\d+`;
38
- const regexSource = "^" + escapeRegex(prefix) + "(" + digitGroup + ")" +
39
- escapeRegex(suffix) + "$";
60
+ if (counters > 1) {
61
+ throw new Error(`display-id-pattern '${template}': multiple {n} counters (expected one)`);
62
+ }
40
63
  return new RegExp(regexSource);
41
64
  }
42
65
  function escapeRegex(s) {
@@ -10,7 +10,7 @@
10
10
  * to the existing MSL-R010 unknown-attribute warning in
11
11
  * `validator/mod.ts`.
12
12
  */
13
- import type { Diagnostic, Entry } from "../model/mod.js";
13
+ import type { Diagnostic, EffectiveProfile, Entry } from "../model/mod.js";
14
14
  /**
15
15
  * Emit per-type attribute diagnostics:
16
16
  *
@@ -25,5 +25,5 @@ import type { Diagnostic, Entry } from "../model/mod.js";
25
25
  * on a `jira:`-scheme reference). Universal and entirely unknown
26
26
  * attributes are exempt — those go through MSL-R010.
27
27
  */
28
- export declare function validatePerTypeAttributes(entry: Entry): readonly Diagnostic[];
28
+ export declare function validatePerTypeAttributes(entry: Entry, profile?: EffectiveProfile): readonly Diagnostic[];
29
29
  //# sourceMappingURL=per_type_attrs.d.ts.map
@@ -1 +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,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAmBzD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAsCvB"}
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"}
@@ -34,8 +34,8 @@ const UNIVERSAL_KEYS = new Set(UNIVERSAL_ATTRIBUTE_KEYS);
34
34
  * on a `jira:`-scheme reference). Universal and entirely unknown
35
35
  * attributes are exempt — those go through MSL-R010.
36
36
  */
37
- export function validatePerTypeAttributes(entry) {
38
- const type = resolvedCoreType(entry);
37
+ export function validatePerTypeAttributes(entry, profile) {
38
+ const type = resolvedCoreType(entry, profile);
39
39
  if (type === undefined) {
40
40
  const diagnostics = [];
41
41
  for (const attr of entry.rawAttributes) {
@@ -32,4 +32,15 @@ export interface PipelineResult {
32
32
  * conventions (rule inactive).
33
33
  */
34
34
  export declare function runPipeline(entries: readonly Entry[], profile: EffectiveProfile | null, captionConventions?: CaptionConventions): PipelineResult;
35
+ /**
36
+ * Drop core Stage 1 `MSL-R010` ("unknown attribute") warnings for attributes
37
+ * the loaded profile declares — Stage 3 validates those directly, so the
38
+ * core-only check would be noise. Returns `diagnostics` unchanged when no
39
+ * profile is loaded.
40
+ *
41
+ * Exported so callers that run only Stage 1 (e.g. the compiler's diagnostic
42
+ * pass) suppress the same false positives the full {@linkcode runPipeline}
43
+ * does, keeping LSP/MCP diagnostics consistent with the `validate` command.
44
+ */
45
+ export declare function suppressDeclaredAttrR010(diagnostics: readonly Diagnostic[], entries: readonly Entry[], profile: EffectiveProfile | null): readonly Diagnostic[];
35
46
  //# sourceMappingURL=pipeline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/validator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,KAAK,EACN,MAAM,iBAAiB,CAAC;AAmBzB,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAChC,kBAAkB,GAAE,kBAAuB,GAC1C,cAAc,CAwFhB"}
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/validator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,KAAK,EACN,MAAM,iBAAiB,CAAC;AAsBzB,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAChC,kBAAkB,GAAE,kBAAuB,GAC1C,cAAc,CA6FhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CASvB"}
@@ -7,6 +7,7 @@
7
7
  * Stage 3 (typed attribute validation — {@linkcode validateAttributesForEntry}),
8
8
  * and Stage 4 (traceability rules — {@linkcode validateTraceabilityForEntry}).
9
9
  */
10
+ import { CORE_DISCIPLINE_REGISTRY, makeDisplayId } from "../model/mod.js";
10
11
  import { validate } from "./mod.js";
11
12
  import { classifyEntriesStage, inferTypeFromDisplayIdShape, inferTypeFromLateStageChain, validateCoreTypeAttribute, } from "./types.js";
12
13
  import { validateBodyBlocks } from "./body_blocks.js";
@@ -19,6 +20,8 @@ import { normalizeListValues } from "./normalize.js";
19
20
  import { validateTraceabilityForEntry } from "./traceability.js";
20
21
  import { validateFeatureAc } from "./feature_ac.js";
21
22
  import { validateCaptionConvention } from "./caption_convention.js";
23
+ import { validateDiscipline } from "./discipline.js";
24
+ import { buildEffectiveDisciplineRegistry } from "../profile/discipline_registry.js";
22
25
  /**
23
26
  * Run the validator pipeline.
24
27
  *
@@ -40,20 +43,7 @@ export function runPipeline(entries, profile, captionConventions = {}) {
40
43
  // warnings for attributes the profile actually declares (Stage 3's scope
41
44
  // validates them directly — the core-only R010 check would be noise).
42
45
  const stage1 = validate(entries);
43
- const profileDeclaredAttrs = profile !== null
44
- ? collectAllProfileAttributes(entries, profile)
45
- : null;
46
- const filteredStage1 = profileDeclaredAttrs === null
47
- ? stage1.diagnostics
48
- : stage1.diagnostics.filter((d) => {
49
- if (d.code !== "MSL-R010")
50
- return true;
51
- const match = /attribute '([^']+)'/.exec(d.message);
52
- if (!match)
53
- return true;
54
- return !profileDeclaredAttrs.has(match[1]);
55
- });
56
- diagnostics.push(...filteredStage1);
46
+ diagnostics.push(...suppressDeclaredAttrR010(stage1.diagnostics, entries, profile));
57
47
  // Stage 1.5 — core type-attribute check. Runs always (core-only mode
58
48
  // included) so unknown `Type:` values fail fast regardless of profile.
59
49
  // Also covers late-stage display-ID-shape inference (step 8 → MSL-T021)
@@ -65,13 +55,22 @@ export function runPipeline(entries, profile, captionConventions = {}) {
65
55
  diagnostics.push(...validateCaptionConvention(entry, captionConventions));
66
56
  diagnostics.push(...validateBodyBlocks(entry));
67
57
  diagnostics.push(...validateFeatureAc(entry));
68
- diagnostics.push(...validatePerTypeAttributes(entry));
58
+ diagnostics.push(...validatePerTypeAttributes(entry, profile ?? undefined));
69
59
  diagnostics.push(...validateModalKeywords(entry));
70
60
  }
71
61
  // Stage 1.6 — cross-file trace target-type compatibility (MSL-R083).
72
62
  // Runs project-wide because targets may live in any entry; needs the
73
63
  // whole batch indexed.
74
64
  diagnostics.push(...validateTraceTargetTypes(entries));
65
+ // Stage 1.7 — discipline attribute validation (ADR-017 Slice 3).
66
+ // Runs in both core-only and profile modes. In core-only mode the
67
+ // registry is CORE_DISCIPLINE_REGISTRY (kinds: system/software/hardware
68
+ // only) so T025/T027 only accept core kinds.
69
+ const disciplineRegistry = profile !== null
70
+ ? buildEffectiveDisciplineRegistry(profile)
71
+ : CORE_DISCIPLINE_REGISTRY;
72
+ const entriesByDisplayId = new Map(entries.map((e) => [makeDisplayId(e.displayId), e]));
73
+ diagnostics.push(...validateDiscipline(entries, entriesByDisplayId, disciplineRegistry));
75
74
  // Stage 2 — classification (only when a profile is loaded).
76
75
  let finalEntries = entries;
77
76
  if (profile !== null) {
@@ -117,6 +116,29 @@ export function runPipeline(entries, profile, captionConventions = {}) {
117
116
  const valid = !diagnostics.some((d) => d.severity === "error");
118
117
  return { entries: finalEntries, diagnostics, valid };
119
118
  }
119
+ /**
120
+ * Drop core Stage 1 `MSL-R010` ("unknown attribute") warnings for attributes
121
+ * the loaded profile declares — Stage 3 validates those directly, so the
122
+ * core-only check would be noise. Returns `diagnostics` unchanged when no
123
+ * profile is loaded.
124
+ *
125
+ * Exported so callers that run only Stage 1 (e.g. the compiler's diagnostic
126
+ * pass) suppress the same false positives the full {@linkcode runPipeline}
127
+ * does, keeping LSP/MCP diagnostics consistent with the `validate` command.
128
+ */
129
+ export function suppressDeclaredAttrR010(diagnostics, entries, profile) {
130
+ if (profile === null)
131
+ return diagnostics;
132
+ const declared = collectAllProfileAttributes(entries, profile);
133
+ return diagnostics.filter((d) => {
134
+ if (d.code !== "MSL-R010")
135
+ return true;
136
+ const match = /attribute '([^']+)'/.exec(d.message);
137
+ if (!match)
138
+ return true;
139
+ return !declared.has(match[1]);
140
+ });
141
+ }
120
142
  /**
121
143
  * Union of all attribute names declared by the profile's effective scope
122
144
  * across all entries. Used to suppress core Stage 1 MSL-R010 warnings for
@@ -19,7 +19,7 @@
19
19
  * (display-ID shape) has its own warning-emitting stage in
20
20
  * `validator/types.ts` (`inferTypeFromDisplayIdShape`).
21
21
  */
22
- import type { Entry } from "../model/mod.js";
22
+ import type { EffectiveProfile, Entry } from "../model/mod.js";
23
23
  /**
24
24
  * Infer a core type from an Authored entry's display-ID prefix.
25
25
  * Returns the type when the display ID starts with one of the
@@ -53,7 +53,7 @@ export interface ResolvedTypeWithProvenance {
53
53
  * consult late-stage step-8 inference (`inferTypeFromDisplayIdShape`)
54
54
  * or treat the entry as unclassified (fallback to `Item`).
55
55
  */
56
- export declare function resolvedCoreTypeWithProvenance(entry: Entry): ResolvedTypeWithProvenance | undefined;
56
+ export declare function resolvedCoreTypeWithProvenance(entry: Entry, profile?: EffectiveProfile): ResolvedTypeWithProvenance | undefined;
57
57
  /**
58
58
  * Resolve an entry's effective core type without provenance. Convenience
59
59
  * wrapper around {@linkcode resolvedCoreTypeWithProvenance} for callers
@@ -63,5 +63,5 @@ export declare function resolvedCoreTypeWithProvenance(entry: Entry): ResolvedTy
63
63
  * type. The caller decides whether to skip validation, fall back to a
64
64
  * less specific check, or report on the unclassified state.
65
65
  */
66
- export declare function resolvedCoreType(entry: Entry): string | undefined;
66
+ export declare function resolvedCoreType(entry: Entry, profile?: EffectiveProfile): string | undefined;
67
67
  //# sourceMappingURL=type_resolution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type_resolution.d.ts","sourceRoot":"","sources":["../../src/validator/type_resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAuB7C;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAWpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAO7D;AAYD;mEACmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvD,0EAA0E;AAC1E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;CACnC;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,KAAK,GACX,0BAA0B,GAAG,SAAS,CAuCxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAEjE"}
1
+ {"version":3,"file":"type_resolution.d.ts","sourceRoot":"","sources":["../../src/validator/type_resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAuB/D;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAWpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAO7D;AAYD;mEACmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvD,0EAA0E;AAC1E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;CACnC;AAkBD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,0BAA0B,GAAG,SAAS,CA4CxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,GAAG,SAAS,CAEpB"}
@@ -79,6 +79,19 @@ function sourceValue(entry) {
79
79
  }
80
80
  return undefined;
81
81
  }
82
+ /**
83
+ * Map a profile-declared type name to the core type it `extends`. In the
84
+ * effective (merged) profile every type's `extends` is frozen to a core type
85
+ * (spec §1.3.1 step 2 / profile schema), so a single lookup — no chain walk —
86
+ * yields the core parent. Returns `undefined` when no profile is supplied, the
87
+ * name is not a profile type, or its `extends` is not a known core type.
88
+ */
89
+ function profileTypeToCore(typeName, profile) {
90
+ if (!profile)
91
+ return undefined;
92
+ const core = profile.types.get(typeName)?.value.extends;
93
+ return core && CORE_TYPE_HIERARCHY[core] ? core : undefined;
94
+ }
82
95
  /**
83
96
  * Resolve an entry's effective core type and report which step of the
84
97
  * spec §1.3.1 chain matched. First match wins. Returns `undefined` when
@@ -86,15 +99,24 @@ function sourceValue(entry) {
86
99
  * consult late-stage step-8 inference (`inferTypeFromDisplayIdShape`)
87
100
  * or treat the entry as unclassified (fallback to `Item`).
88
101
  */
89
- export function resolvedCoreTypeWithProvenance(entry) {
90
- // Step 1: explicit Type:
102
+ export function resolvedCoreTypeWithProvenance(entry, profile) {
103
+ // Step 1: explicit Type: — a core type directly, or a profile type whose
104
+ // `extends:` resolves to a core type (frozen at declaration).
91
105
  const explicit = explicitType(entry);
92
- if (explicit && CORE_TYPE_HIERARCHY[explicit]) {
93
- return { type: explicit, step: 1 };
106
+ if (explicit) {
107
+ if (CORE_TYPE_HIERARCHY[explicit])
108
+ return { type: explicit, step: 1 };
109
+ const core = profileTypeToCore(explicit, profile);
110
+ if (core)
111
+ return { type: core, step: 1 };
94
112
  }
95
- // Step 2: profile-classified entry.type
96
- if (entry.type && CORE_TYPE_HIERARCHY[entry.type]) {
97
- return { type: entry.type, step: 2 };
113
+ // Step 2: profile-classified entry.type — same core/profile resolution.
114
+ if (entry.type) {
115
+ if (CORE_TYPE_HIERARCHY[entry.type])
116
+ return { type: entry.type, step: 2 };
117
+ const core = profileTypeToCore(entry.type, profile);
118
+ if (core)
119
+ return { type: core, step: 2 };
98
120
  }
99
121
  // Step 3: Source: introspection
100
122
  const source = sourceValue(entry);
@@ -135,6 +157,6 @@ export function resolvedCoreTypeWithProvenance(entry) {
135
157
  * type. The caller decides whether to skip validation, fall back to a
136
158
  * less specific check, or report on the unclassified state.
137
159
  */
138
- export function resolvedCoreType(entry) {
139
- return resolvedCoreTypeWithProvenance(entry)?.type;
160
+ export function resolvedCoreType(entry, profile) {
161
+ return resolvedCoreTypeWithProvenance(entry, profile)?.type;
140
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driftsys/markspec",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Markdown flavor and toolchain for traceable industrial documentation",
5
5
  "keywords": [
6
6
  "markdown",
@@ -33,7 +33,7 @@
33
33
  "remark-gfm": "^4",
34
34
  "remark-parse": "^11",
35
35
  "unified": "^11",
36
- "web-tree-sitter": "^0.24"
36
+ "web-tree-sitter": "^0.25"
37
37
  },
38
38
  "_generatedBy": "dnt@dev"
39
39
  }
@@ -5,29 +5,10 @@
5
5
  * (post-`splitBodyAndAttributes`) with the shared remark processor and
6
6
  * maps each mdast block child to the §2.4-2.6 node taxonomy.
7
7
  *
8
- * Inline markers (modal + $Identifier) are extracted for prose-bearing
9
- * nodes: Paragraph, List items, Table cells, Note bodies, Blockquotes,
10
- * and DefinitionList term/definitions. They are NOT extracted inside
11
- * Code, Feature, or Math blocks (spec §2.5).
12
- *
13
8
  * This module is pure library code: no `Deno.*` APIs.
14
9
  */
15
- import type { BodyBlock, InlineMarker, SourceRange } from "./nodes.js";
16
- /**
17
- * Extract all inline markers from a prose text string.
18
- * `lineOffset` is the 0-based line index of the text within the body
19
- * (used for SourceRange line numbers).
20
- *
21
- * For multi-line text the SourceRange carries the first line's 1-based
22
- * column; this is best-effort for PR 2 (noted as DONE_WITH_CONCERNS:
23
- * multi-line paragraph ranges are approximated to the starting line).
24
- *
25
- * Exported so the AST-native §3.4.1 normalisation pass
26
- * (`core/ast/normalize.ts`) re-derives `InlineContent.markers` from the
27
- * normalised text with the SAME extraction the builder uses — no regex
28
- * duplication.
29
- */
30
- export declare function extractMarkersFromText(text: string, startRange: SourceRange): readonly InlineMarker[];
10
+ import type { Root } from "@types/mdast";
11
+ import type { BodyBlock } from "./nodes.js";
31
12
  /**
32
13
  * Return the exact source substring for an mdast node `position`, with
33
14
  * list-continuation indentation normalised to column 0 so the slice is a
@@ -67,4 +48,13 @@ export declare function verbatimSlice(body: string, pos: {
67
48
  * only for single-line paragraphs.
68
49
  */
69
50
  export declare function buildBodyAst(body: string): BodyBlock[];
51
+ /**
52
+ * Like {@linkcode buildBodyAst} but also returns the intermediate mdast
53
+ * `Root` so callers that need it (e.g. body-token extraction) avoid
54
+ * re-parsing.
55
+ */
56
+ export declare function buildBodyAstWithTree(body: string): {
57
+ blocks: BodyBlock[];
58
+ tree: Root;
59
+ };
70
60
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/ast/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAGV,SAAS,EAQT,YAAY,EAQZ,WAAW,EAGZ,MAAM,YAAY,CAAC;AAmBpB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,WAAW,GACtB,SAAS,YAAY,EAAE,CAyEzB;AAyCD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE;IACH,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,GAAG,SAAS,GACZ,MAAM,CAgCR;AA4cD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAUtD"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/ast/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAKV,IAAI,EAKL,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAGV,SAAS,EAeV,MAAM,YAAY,CAAC;AAwCpB;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE;IACH,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,GAAG,SAAS,GACZ,MAAM,CAgCR;AAucD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAkBrC"}