@driftsys/markspec 0.10.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. package/README.md +11 -2
  2. package/esm/ast/normalize.d.ts +4 -5
  3. package/esm/ast/normalize.d.ts.map +1 -1
  4. package/esm/ast/normalize.js +6 -37
  5. package/esm/collect/mod.d.ts +29 -9
  6. package/esm/collect/mod.d.ts.map +1 -1
  7. package/esm/collect/mod.js +36 -10
  8. package/esm/compiler/deserialize.d.ts +49 -0
  9. package/esm/compiler/deserialize.d.ts.map +1 -0
  10. package/esm/compiler/deserialize.js +139 -0
  11. package/esm/compiler/manifest.d.ts +3 -0
  12. package/esm/compiler/manifest.d.ts.map +1 -1
  13. package/esm/compiler/manifest.js +9 -3
  14. package/esm/compiler/mod.d.ts.map +1 -1
  15. package/esm/compiler/mod.js +18 -13
  16. package/esm/config/markspec.d.ts +40 -1
  17. package/esm/config/markspec.d.ts.map +1 -1
  18. package/esm/config/markspec.js +127 -2
  19. package/esm/config/mod.d.ts.map +1 -1
  20. package/esm/config/mod.js +143 -147
  21. package/esm/decl/duplicates.d.ts +29 -0
  22. package/esm/decl/duplicates.d.ts.map +1 -0
  23. package/esm/decl/duplicates.js +28 -0
  24. package/esm/decl/mod.d.ts +4 -2
  25. package/esm/decl/mod.d.ts.map +1 -1
  26. package/esm/decl/mod.js +2 -1
  27. package/esm/decl/surfaces.d.ts +29 -7
  28. package/esm/decl/surfaces.d.ts.map +1 -1
  29. package/esm/decl/surfaces.js +31 -18
  30. package/esm/discovery/mod.d.ts +24 -8
  31. package/esm/discovery/mod.d.ts.map +1 -1
  32. package/esm/discovery/mod.js +57 -21
  33. package/esm/discovery/projects.d.ts +109 -0
  34. package/esm/discovery/projects.d.ts.map +1 -0
  35. package/esm/discovery/projects.js +232 -0
  36. package/esm/formatter/entry_body.d.ts +86 -0
  37. package/esm/formatter/entry_body.d.ts.map +1 -0
  38. package/esm/formatter/entry_body.js +287 -0
  39. package/esm/formatter/mod.d.ts +13 -9
  40. package/esm/formatter/mod.d.ts.map +1 -1
  41. package/esm/formatter/mod.js +126 -50
  42. package/esm/gates/mod.d.ts +13 -2
  43. package/esm/gates/mod.d.ts.map +1 -1
  44. package/esm/gates/mod.js +41 -13
  45. package/esm/lint/runner.d.ts.map +1 -1
  46. package/esm/lint/runner.js +7 -5
  47. package/esm/lock/acquire_compile.d.ts +31 -0
  48. package/esm/lock/acquire_compile.d.ts.map +1 -0
  49. package/esm/lock/acquire_compile.js +83 -0
  50. package/esm/lock/cache_check.d.ts +28 -0
  51. package/esm/lock/cache_check.d.ts.map +1 -0
  52. package/esm/lock/cache_check.js +51 -0
  53. package/esm/lock/check.d.ts +14 -3
  54. package/esm/lock/check.d.ts.map +1 -1
  55. package/esm/lock/check.js +43 -4
  56. package/esm/lock/edge_drift.d.ts +2 -0
  57. package/esm/lock/edge_drift.d.ts.map +1 -1
  58. package/esm/lock/edge_drift.js +4 -0
  59. package/esm/lock/git_intent.d.ts +46 -0
  60. package/esm/lock/git_intent.d.ts.map +1 -0
  61. package/esm/lock/git_intent.js +111 -0
  62. package/esm/lock/mod.d.ts +11 -4
  63. package/esm/lock/mod.d.ts.map +1 -1
  64. package/esm/lock/mod.js +8 -2
  65. package/esm/lock/model.d.ts +24 -1
  66. package/esm/lock/model.d.ts.map +1 -1
  67. package/esm/lock/parser.d.ts.map +1 -1
  68. package/esm/lock/parser.js +32 -0
  69. package/esm/lock/pin_assurance.d.ts +20 -0
  70. package/esm/lock/pin_assurance.d.ts.map +1 -0
  71. package/esm/lock/pin_assurance.js +34 -0
  72. package/esm/lock/resolve.d.ts +8 -17
  73. package/esm/lock/resolve.d.ts.map +1 -1
  74. package/esm/lock/resolve.js +7 -67
  75. package/esm/lock/serializer.d.ts.map +1 -1
  76. package/esm/lock/serializer.js +23 -0
  77. package/esm/lock/upstream_common.d.ts +29 -0
  78. package/esm/lock/upstream_common.d.ts.map +1 -0
  79. package/esm/lock/upstream_common.js +38 -0
  80. package/esm/lock/upstream_deps.d.ts +63 -0
  81. package/esm/lock/upstream_deps.d.ts.map +1 -0
  82. package/esm/lock/upstream_deps.js +172 -0
  83. package/esm/lock/upstream_refs.d.ts +69 -0
  84. package/esm/lock/upstream_refs.d.ts.map +1 -0
  85. package/esm/lock/upstream_refs.js +238 -0
  86. package/esm/mod.d.ts +23 -11
  87. package/esm/mod.d.ts.map +1 -1
  88. package/esm/mod.js +20 -8
  89. package/esm/model/mod.d.ts +114 -28
  90. package/esm/model/mod.d.ts.map +1 -1
  91. package/esm/model/mod.js +76 -13
  92. package/esm/model/profile.d.ts +13 -0
  93. package/esm/model/profile.d.ts.map +1 -1
  94. package/esm/parser/code_regions.d.ts +29 -0
  95. package/esm/parser/code_regions.d.ts.map +1 -0
  96. package/esm/parser/code_regions.js +38 -0
  97. package/esm/parser/markdown.d.ts.map +1 -1
  98. package/esm/parser/markdown.js +110 -91
  99. package/esm/parser/mod.d.ts.map +1 -1
  100. package/esm/parser/mod.js +7 -1
  101. package/esm/parser/translate.d.ts.map +1 -1
  102. package/esm/parser/translate.js +5 -0
  103. package/esm/profile/manifest.d.ts.map +1 -1
  104. package/esm/profile/manifest.js +20 -3
  105. package/esm/profile/merge.js +7 -0
  106. package/esm/refs/mod.d.ts.map +1 -1
  107. package/esm/refs/mod.js +8 -19
  108. package/esm/reporter/mod.d.ts +11 -0
  109. package/esm/reporter/mod.d.ts.map +1 -1
  110. package/esm/reporter/mod.js +20 -9
  111. package/esm/typl/assemble.d.ts +53 -0
  112. package/esm/typl/assemble.d.ts.map +1 -0
  113. package/esm/typl/assemble.js +238 -0
  114. package/esm/typl/ast.d.ts +7 -1
  115. package/esm/typl/ast.d.ts.map +1 -1
  116. package/esm/typl/ast.js +3 -0
  117. package/esm/typl/bullet.d.ts +9 -7
  118. package/esm/typl/bullet.d.ts.map +1 -1
  119. package/esm/typl/bullet.js +6 -4
  120. package/esm/typl/citations.d.ts +27 -0
  121. package/esm/typl/citations.d.ts.map +1 -0
  122. package/esm/typl/citations.js +16 -0
  123. package/esm/typl/diagnostics.d.ts +2 -2
  124. package/esm/typl/diagnostics.d.ts.map +1 -1
  125. package/esm/typl/diagnostics.js +18 -0
  126. package/esm/typl/grammar.d.ts.map +1 -1
  127. package/esm/typl/grammar.js +6 -0
  128. package/esm/typl/lexer.d.ts.map +1 -1
  129. package/esm/typl/lexer.js +25 -4
  130. package/esm/typl/mod.d.ts +8 -2
  131. package/esm/typl/mod.d.ts.map +1 -1
  132. package/esm/typl/mod.js +5 -1
  133. package/esm/typl/recognize.js +2 -2
  134. package/esm/typl/registry.d.ts +1 -1
  135. package/esm/typl/resolve.d.ts +31 -0
  136. package/esm/typl/resolve.d.ts.map +1 -0
  137. package/esm/typl/resolve.js +27 -0
  138. package/esm/typl/table.d.ts +52 -0
  139. package/esm/typl/table.d.ts.map +1 -0
  140. package/esm/typl/table.js +69 -0
  141. package/esm/typl/validator.d.ts +24 -5
  142. package/esm/typl/validator.d.ts.map +1 -1
  143. package/esm/typl/validator.js +55 -75
  144. package/esm/upstream/mod.d.ts +45 -0
  145. package/esm/upstream/mod.d.ts.map +1 -0
  146. package/esm/upstream/mod.js +98 -0
  147. package/esm/upstream/project.d.ts +33 -0
  148. package/esm/upstream/project.d.ts.map +1 -0
  149. package/esm/upstream/project.js +38 -0
  150. package/esm/upstream/refs.d.ts +23 -0
  151. package/esm/upstream/refs.d.ts.map +1 -0
  152. package/esm/upstream/refs.js +71 -0
  153. package/esm/util/fence.d.ts +20 -29
  154. package/esm/util/fence.d.ts.map +1 -1
  155. package/esm/util/fence.js +42 -50
  156. package/esm/util/modals.d.ts +6 -0
  157. package/esm/util/modals.d.ts.map +1 -1
  158. package/esm/util/modals.js +37 -0
  159. package/esm/util/paths.d.ts +14 -0
  160. package/esm/util/paths.d.ts.map +1 -0
  161. package/esm/util/paths.js +22 -0
  162. package/esm/uxil/assemble.d.ts +38 -0
  163. package/esm/uxil/assemble.d.ts.map +1 -0
  164. package/esm/uxil/assemble.js +268 -0
  165. package/esm/uxil/ast.d.ts +63 -0
  166. package/esm/uxil/ast.d.ts.map +1 -0
  167. package/esm/uxil/ast.js +9 -0
  168. package/esm/uxil/citations.d.ts +27 -0
  169. package/esm/uxil/citations.d.ts.map +1 -0
  170. package/esm/uxil/citations.js +25 -0
  171. package/esm/uxil/diagnostics.d.ts +39 -0
  172. package/esm/uxil/diagnostics.d.ts.map +1 -0
  173. package/esm/uxil/diagnostics.js +135 -0
  174. package/esm/uxil/grammar.d.ts +72 -0
  175. package/esm/uxil/grammar.d.ts.map +1 -0
  176. package/esm/uxil/grammar.js +505 -0
  177. package/esm/uxil/lexer.d.ts +23 -0
  178. package/esm/uxil/lexer.d.ts.map +1 -0
  179. package/esm/uxil/lexer.js +58 -0
  180. package/esm/uxil/mod.d.ts +32 -0
  181. package/esm/uxil/mod.d.ts.map +1 -0
  182. package/esm/uxil/mod.js +11 -0
  183. package/esm/uxil/projection.d.ts +40 -0
  184. package/esm/uxil/projection.d.ts.map +1 -0
  185. package/esm/uxil/projection.js +41 -0
  186. package/esm/uxil/recognize.d.ts +16 -0
  187. package/esm/uxil/recognize.d.ts.map +1 -0
  188. package/esm/uxil/recognize.js +28 -0
  189. package/esm/uxil/registry.d.ts +37 -0
  190. package/esm/uxil/registry.d.ts.map +1 -0
  191. package/esm/uxil/registry.js +29 -0
  192. package/esm/uxil/surfaces.d.ts +36 -0
  193. package/esm/uxil/surfaces.d.ts.map +1 -0
  194. package/esm/uxil/surfaces.js +34 -0
  195. package/esm/uxil/validator.d.ts +36 -0
  196. package/esm/uxil/validator.d.ts.map +1 -0
  197. package/esm/uxil/validator.js +139 -0
  198. package/esm/uxil/vocab.d.ts +33 -0
  199. package/esm/uxil/vocab.d.ts.map +1 -0
  200. package/esm/uxil/vocab.js +36 -0
  201. package/esm/validator/body_blocks.d.ts +2 -1
  202. package/esm/validator/body_blocks.d.ts.map +1 -1
  203. package/esm/validator/body_blocks.js +80 -2
  204. package/esm/validator/caption_convention.d.ts +2 -1
  205. package/esm/validator/caption_convention.d.ts.map +1 -1
  206. package/esm/validator/caption_convention.js +2 -1
  207. package/esm/validator/corpus.d.ts +6 -0
  208. package/esm/validator/corpus.d.ts.map +1 -1
  209. package/esm/validator/corpus.js +55 -20
  210. package/esm/validator/discipline.d.ts +6 -4
  211. package/esm/validator/discipline.d.ts.map +1 -1
  212. package/esm/validator/discipline.js +6 -4
  213. package/esm/validator/mod.d.ts +1 -1
  214. package/esm/validator/mod.d.ts.map +1 -1
  215. package/esm/validator/mod.js +29 -16
  216. package/esm/validator/pipeline.d.ts +11 -1
  217. package/esm/validator/pipeline.d.ts.map +1 -1
  218. package/esm/validator/pipeline.js +76 -23
  219. package/esm/validator/trace_types.d.ts +9 -2
  220. package/esm/validator/trace_types.d.ts.map +1 -1
  221. package/esm/validator/trace_types.js +21 -5
  222. package/esm/validator/traceability.d.ts +15 -3
  223. package/esm/validator/traceability.d.ts.map +1 -1
  224. package/esm/validator/traceability.js +39 -4
  225. package/esm/validator/types.d.ts.map +1 -1
  226. package/esm/validator/types.js +11 -1
  227. package/esm/validator/uxil_family.d.ts +43 -0
  228. package/esm/validator/uxil_family.d.ts.map +1 -0
  229. package/esm/validator/uxil_family.js +52 -0
  230. package/package.json +1 -1
  231. package/script/ast/normalize.d.ts +4 -5
  232. package/script/ast/normalize.d.ts.map +1 -1
  233. package/script/ast/normalize.js +5 -36
  234. package/script/collect/mod.d.ts +29 -9
  235. package/script/collect/mod.d.ts.map +1 -1
  236. package/script/collect/mod.js +38 -10
  237. package/script/compiler/deserialize.d.ts +49 -0
  238. package/script/compiler/deserialize.d.ts.map +1 -0
  239. package/script/compiler/deserialize.js +144 -0
  240. package/script/compiler/manifest.d.ts +3 -0
  241. package/script/compiler/manifest.d.ts.map +1 -1
  242. package/script/compiler/manifest.js +10 -3
  243. package/script/compiler/mod.d.ts.map +1 -1
  244. package/script/compiler/mod.js +16 -11
  245. package/script/config/markspec.d.ts +40 -1
  246. package/script/config/markspec.d.ts.map +1 -1
  247. package/script/config/markspec.js +129 -3
  248. package/script/config/mod.d.ts.map +1 -1
  249. package/script/config/mod.js +143 -147
  250. package/script/decl/duplicates.d.ts +29 -0
  251. package/script/decl/duplicates.d.ts.map +1 -0
  252. package/script/decl/duplicates.js +31 -0
  253. package/script/decl/mod.d.ts +4 -2
  254. package/script/decl/mod.d.ts.map +1 -1
  255. package/script/decl/mod.js +4 -2
  256. package/script/decl/surfaces.d.ts +29 -7
  257. package/script/decl/surfaces.d.ts.map +1 -1
  258. package/script/decl/surfaces.js +32 -19
  259. package/script/discovery/mod.d.ts +24 -8
  260. package/script/discovery/mod.d.ts.map +1 -1
  261. package/script/discovery/mod.js +56 -20
  262. package/script/discovery/projects.d.ts +109 -0
  263. package/script/discovery/projects.d.ts.map +1 -0
  264. package/script/discovery/projects.js +240 -0
  265. package/script/formatter/entry_body.d.ts +86 -0
  266. package/script/formatter/entry_body.d.ts.map +1 -0
  267. package/script/formatter/entry_body.js +292 -0
  268. package/script/formatter/mod.d.ts +13 -9
  269. package/script/formatter/mod.d.ts.map +1 -1
  270. package/script/formatter/mod.js +124 -48
  271. package/script/gates/mod.d.ts +13 -2
  272. package/script/gates/mod.d.ts.map +1 -1
  273. package/script/gates/mod.js +50 -22
  274. package/script/lint/runner.d.ts.map +1 -1
  275. package/script/lint/runner.js +6 -4
  276. package/script/lock/acquire_compile.d.ts +31 -0
  277. package/script/lock/acquire_compile.d.ts.map +1 -0
  278. package/script/lock/acquire_compile.js +86 -0
  279. package/script/lock/cache_check.d.ts +28 -0
  280. package/script/lock/cache_check.d.ts.map +1 -0
  281. package/script/lock/cache_check.js +54 -0
  282. package/script/lock/check.d.ts +14 -3
  283. package/script/lock/check.d.ts.map +1 -1
  284. package/script/lock/check.js +43 -4
  285. package/script/lock/edge_drift.d.ts +2 -0
  286. package/script/lock/edge_drift.d.ts.map +1 -1
  287. package/script/lock/edge_drift.js +5 -0
  288. package/script/lock/git_intent.d.ts +46 -0
  289. package/script/lock/git_intent.d.ts.map +1 -0
  290. package/script/lock/git_intent.js +115 -0
  291. package/script/lock/mod.d.ts +11 -4
  292. package/script/lock/mod.d.ts.map +1 -1
  293. package/script/lock/mod.js +17 -2
  294. package/script/lock/model.d.ts +24 -1
  295. package/script/lock/model.d.ts.map +1 -1
  296. package/script/lock/parser.d.ts.map +1 -1
  297. package/script/lock/parser.js +32 -0
  298. package/script/lock/pin_assurance.d.ts +20 -0
  299. package/script/lock/pin_assurance.d.ts.map +1 -0
  300. package/script/lock/pin_assurance.js +37 -0
  301. package/script/lock/resolve.d.ts +8 -17
  302. package/script/lock/resolve.d.ts.map +1 -1
  303. package/script/lock/resolve.js +7 -68
  304. package/script/lock/serializer.d.ts.map +1 -1
  305. package/script/lock/serializer.js +23 -0
  306. package/script/lock/upstream_common.d.ts +29 -0
  307. package/script/lock/upstream_common.d.ts.map +1 -0
  308. package/script/lock/upstream_common.js +42 -0
  309. package/script/lock/upstream_deps.d.ts +63 -0
  310. package/script/lock/upstream_deps.d.ts.map +1 -0
  311. package/script/lock/upstream_deps.js +175 -0
  312. package/script/lock/upstream_refs.d.ts +69 -0
  313. package/script/lock/upstream_refs.d.ts.map +1 -0
  314. package/script/lock/upstream_refs.js +244 -0
  315. package/script/mod.d.ts +23 -11
  316. package/script/mod.d.ts.map +1 -1
  317. package/script/mod.js +55 -7
  318. package/script/model/mod.d.ts +114 -28
  319. package/script/model/mod.d.ts.map +1 -1
  320. package/script/model/mod.js +81 -14
  321. package/script/model/profile.d.ts +13 -0
  322. package/script/model/profile.d.ts.map +1 -1
  323. package/script/parser/code_regions.d.ts +29 -0
  324. package/script/parser/code_regions.d.ts.map +1 -0
  325. package/script/parser/code_regions.js +41 -0
  326. package/script/parser/markdown.d.ts.map +1 -1
  327. package/script/parser/markdown.js +108 -89
  328. package/script/parser/mod.d.ts.map +1 -1
  329. package/script/parser/mod.js +7 -1
  330. package/script/parser/translate.d.ts.map +1 -1
  331. package/script/parser/translate.js +5 -0
  332. package/script/profile/manifest.d.ts.map +1 -1
  333. package/script/profile/manifest.js +20 -3
  334. package/script/profile/merge.js +7 -0
  335. package/script/refs/mod.d.ts.map +1 -1
  336. package/script/refs/mod.js +7 -18
  337. package/script/reporter/mod.d.ts +11 -0
  338. package/script/reporter/mod.d.ts.map +1 -1
  339. package/script/reporter/mod.js +19 -8
  340. package/script/typl/assemble.d.ts +53 -0
  341. package/script/typl/assemble.d.ts.map +1 -0
  342. package/script/typl/assemble.js +241 -0
  343. package/script/typl/ast.d.ts +7 -1
  344. package/script/typl/ast.d.ts.map +1 -1
  345. package/script/typl/ast.js +3 -0
  346. package/script/typl/bullet.d.ts +9 -7
  347. package/script/typl/bullet.d.ts.map +1 -1
  348. package/script/typl/bullet.js +6 -4
  349. package/script/typl/citations.d.ts +27 -0
  350. package/script/typl/citations.d.ts.map +1 -0
  351. package/script/typl/citations.js +20 -0
  352. package/script/typl/diagnostics.d.ts +2 -2
  353. package/script/typl/diagnostics.d.ts.map +1 -1
  354. package/script/typl/diagnostics.js +18 -0
  355. package/script/typl/grammar.d.ts.map +1 -1
  356. package/script/typl/grammar.js +6 -0
  357. package/script/typl/lexer.d.ts.map +1 -1
  358. package/script/typl/lexer.js +25 -4
  359. package/script/typl/mod.d.ts +8 -2
  360. package/script/typl/mod.d.ts.map +1 -1
  361. package/script/typl/mod.js +14 -2
  362. package/script/typl/recognize.js +2 -2
  363. package/script/typl/registry.d.ts +1 -1
  364. package/script/typl/resolve.d.ts +31 -0
  365. package/script/typl/resolve.d.ts.map +1 -0
  366. package/script/typl/resolve.js +33 -0
  367. package/script/typl/table.d.ts +52 -0
  368. package/script/typl/table.d.ts.map +1 -0
  369. package/script/typl/table.js +75 -0
  370. package/script/typl/validator.d.ts +24 -5
  371. package/script/typl/validator.d.ts.map +1 -1
  372. package/script/typl/validator.js +55 -75
  373. package/script/upstream/mod.d.ts +45 -0
  374. package/script/upstream/mod.d.ts.map +1 -0
  375. package/script/upstream/mod.js +101 -0
  376. package/script/upstream/project.d.ts +33 -0
  377. package/script/upstream/project.d.ts.map +1 -0
  378. package/script/upstream/project.js +41 -0
  379. package/script/upstream/refs.d.ts +23 -0
  380. package/script/upstream/refs.d.ts.map +1 -0
  381. package/script/upstream/refs.js +74 -0
  382. package/script/util/fence.d.ts +20 -29
  383. package/script/util/fence.d.ts.map +1 -1
  384. package/script/util/fence.js +47 -54
  385. package/script/util/modals.d.ts +6 -0
  386. package/script/util/modals.d.ts.map +1 -1
  387. package/script/util/modals.js +38 -0
  388. package/script/util/paths.d.ts +14 -0
  389. package/script/util/paths.d.ts.map +1 -0
  390. package/script/util/paths.js +25 -0
  391. package/script/uxil/assemble.d.ts +38 -0
  392. package/script/uxil/assemble.d.ts.map +1 -0
  393. package/script/uxil/assemble.js +272 -0
  394. package/script/uxil/ast.d.ts +63 -0
  395. package/script/uxil/ast.d.ts.map +1 -0
  396. package/script/uxil/ast.js +10 -0
  397. package/script/uxil/citations.d.ts +27 -0
  398. package/script/uxil/citations.d.ts.map +1 -0
  399. package/script/uxil/citations.js +29 -0
  400. package/script/uxil/diagnostics.d.ts +39 -0
  401. package/script/uxil/diagnostics.d.ts.map +1 -0
  402. package/script/uxil/diagnostics.js +140 -0
  403. package/script/uxil/grammar.d.ts +72 -0
  404. package/script/uxil/grammar.d.ts.map +1 -0
  405. package/script/uxil/grammar.js +511 -0
  406. package/script/uxil/lexer.d.ts +23 -0
  407. package/script/uxil/lexer.d.ts.map +1 -0
  408. package/script/uxil/lexer.js +61 -0
  409. package/script/uxil/mod.d.ts +32 -0
  410. package/script/uxil/mod.d.ts.map +1 -0
  411. package/script/uxil/mod.js +37 -0
  412. package/script/uxil/projection.d.ts +40 -0
  413. package/script/uxil/projection.d.ts.map +1 -0
  414. package/script/uxil/projection.js +44 -0
  415. package/script/uxil/recognize.d.ts +16 -0
  416. package/script/uxil/recognize.d.ts.map +1 -0
  417. package/script/uxil/recognize.js +31 -0
  418. package/script/uxil/registry.d.ts +37 -0
  419. package/script/uxil/registry.d.ts.map +1 -0
  420. package/script/uxil/registry.js +32 -0
  421. package/script/uxil/surfaces.d.ts +36 -0
  422. package/script/uxil/surfaces.d.ts.map +1 -0
  423. package/script/uxil/surfaces.js +39 -0
  424. package/script/uxil/validator.d.ts +36 -0
  425. package/script/uxil/validator.d.ts.map +1 -0
  426. package/script/uxil/validator.js +142 -0
  427. package/script/uxil/vocab.d.ts +33 -0
  428. package/script/uxil/vocab.d.ts.map +1 -0
  429. package/script/uxil/vocab.js +41 -0
  430. package/script/validator/body_blocks.d.ts +2 -1
  431. package/script/validator/body_blocks.d.ts.map +1 -1
  432. package/script/validator/body_blocks.js +80 -2
  433. package/script/validator/caption_convention.d.ts +2 -1
  434. package/script/validator/caption_convention.d.ts.map +1 -1
  435. package/script/validator/caption_convention.js +2 -1
  436. package/script/validator/corpus.d.ts +6 -0
  437. package/script/validator/corpus.d.ts.map +1 -1
  438. package/script/validator/corpus.js +55 -19
  439. package/script/validator/discipline.d.ts +6 -4
  440. package/script/validator/discipline.d.ts.map +1 -1
  441. package/script/validator/discipline.js +6 -4
  442. package/script/validator/mod.d.ts +1 -1
  443. package/script/validator/mod.d.ts.map +1 -1
  444. package/script/validator/mod.js +29 -15
  445. package/script/validator/pipeline.d.ts +11 -1
  446. package/script/validator/pipeline.d.ts.map +1 -1
  447. package/script/validator/pipeline.js +75 -22
  448. package/script/validator/trace_types.d.ts +9 -2
  449. package/script/validator/trace_types.d.ts.map +1 -1
  450. package/script/validator/trace_types.js +20 -4
  451. package/script/validator/traceability.d.ts +15 -3
  452. package/script/validator/traceability.d.ts.map +1 -1
  453. package/script/validator/traceability.js +38 -3
  454. package/script/validator/types.d.ts.map +1 -1
  455. package/script/validator/types.js +10 -0
  456. package/script/validator/uxil_family.d.ts +43 -0
  457. package/script/validator/uxil_family.d.ts.map +1 -0
  458. package/script/validator/uxil_family.js +56 -0
@@ -21,7 +21,8 @@
21
21
  * - Inline HTML — remains inside `ParagraphNode.content.text` (remark
22
22
  * does not extract inline HTML nodes into block-level nodes); each
23
23
  * paragraph's text is scanned line-by-line using the same regex
24
- * approach as the old walkProseLines path, but bounded to prose-only
24
+ * approach as the old walkProseLines path (with inline code spans
25
+ * masked out first — they are literal text, never HTML), bounded to prose-only
25
26
  * nodes (code/feature/math blocks are automatically excluded because
26
27
  * the builder does not emit prose-bearing nodes for verbatim content).
27
28
  *
@@ -41,6 +42,15 @@ const directives_js_1 = require("../parser/directives.js");
41
42
  const HTML_TAG_RE = /<\/?[A-Za-z][A-Za-z0-9]*(\s[^>]*)?\/?>/;
42
43
  /** Any HTML comment, `<!--…-->`. */
43
44
  const HTML_COMMENT_RE = /<!--[\s\S]*?-->/;
45
+ /**
46
+ * A CommonMark raw HTML open or closing tag (§6.6) anchored at the scan
47
+ * position. Stricter than {@linkcode HTML_TAG_RE} on purpose: it decides
48
+ * code-span precedence, so `` a<b and `c>` `` must not read as a tag
49
+ * (a backtick cannot start an attribute name) and hide the code span.
50
+ */
51
+ const HTML_TAG_AT_RE = /^(?:<[A-Za-z][A-Za-z0-9-]*(?:\s+[A-Za-z_:][\w.:-]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][A-Za-z0-9-]*\s*>)/;
52
+ /** {@linkcode HTML_COMMENT_RE} anchored at the scan position. */
53
+ const HTML_COMMENT_AT_RE = new RegExp(`^${HTML_COMMENT_RE.source}`);
44
54
  /**
45
55
  * Return `true` when `line` contains raw HTML the body model forbids:
46
56
  * any tag, or any comment that isn't a standalone markspec directive.
@@ -73,6 +83,74 @@ const RAW_HTML_DIAG = {
73
83
  severity: "error",
74
84
  summary: "raw HTML inside entry body — only `<!-- markspec:* -->` directive comments are permitted (spec §2.4.1)",
75
85
  };
86
+ /**
87
+ * Blank out every CommonMark code span in `text` (delimiters included),
88
+ * keeping newlines so line offsets are preserved. A code span is literal
89
+ * text, never HTML (CommonMark §6.1), so `` `tool --root <ws>` `` must
90
+ * not reach the tag regex.
91
+ *
92
+ * Follows the CommonMark rules the regex scan would otherwise ignore:
93
+ * a backslash-escaped backtick does not open a span; an opening run of N
94
+ * backticks closes only at the next run of exactly N; an unmatched run
95
+ * is literal. Raw HTML and code spans bind left-to-right, so a tag that
96
+ * starts before a backtick run is skipped intact and still flagged.
97
+ */
98
+ function maskCodeSpans(text) {
99
+ const blank = (s) => s.replace(/[^\n]/g, " ");
100
+ let out = "";
101
+ let i = 0;
102
+ while (i < text.length) {
103
+ const ch = text[i];
104
+ if (ch === "\\" && i + 1 < text.length) {
105
+ out += text.slice(i, i + 2);
106
+ i += 2;
107
+ continue;
108
+ }
109
+ if (ch === "<") {
110
+ const rest = text.slice(i);
111
+ const tag = HTML_TAG_AT_RE.exec(rest) ?? HTML_COMMENT_AT_RE.exec(rest);
112
+ if (tag) {
113
+ out += tag[0];
114
+ i += tag[0].length;
115
+ continue;
116
+ }
117
+ }
118
+ if (ch !== "`") {
119
+ out += ch;
120
+ i++;
121
+ continue;
122
+ }
123
+ let runEnd = i;
124
+ while (runEnd < text.length && text[runEnd] === "`")
125
+ runEnd++;
126
+ const runLength = runEnd - i;
127
+ let close = -1;
128
+ let j = runEnd;
129
+ while (j < text.length) {
130
+ if (text[j] !== "`") {
131
+ j++;
132
+ continue;
133
+ }
134
+ let k = j;
135
+ while (k < text.length && text[k] === "`")
136
+ k++;
137
+ if (k - j === runLength) {
138
+ close = k;
139
+ break;
140
+ }
141
+ j = k;
142
+ }
143
+ if (close < 0) {
144
+ // Unmatched opener — the backticks are literal text.
145
+ out += text.slice(i, runEnd);
146
+ i = runEnd;
147
+ continue;
148
+ }
149
+ out += blank(text.slice(i, close));
150
+ i = close;
151
+ }
152
+ return out;
153
+ }
76
154
  /**
77
155
  * Scan `text` line-by-line for forbidden inline HTML, starting at
78
156
  * `startLine` (1-based body-relative). Returns one `{ diag, bodyLine }`
@@ -86,7 +164,7 @@ const RAW_HTML_DIAG = {
86
164
  */
87
165
  function htmlViolations(text, startLine) {
88
166
  const out = [];
89
- const lines = text.split("\n");
167
+ const lines = maskCodeSpans(text).split("\n");
90
168
  for (let li = 0; li < lines.length; li++) {
91
169
  const line = lines[li];
92
170
  if (line.trim() === "")
@@ -22,7 +22,8 @@ import type { CaptionConventions, Diagnostic, Entry } from "../model/mod.js";
22
22
  *
23
23
  * @param entry - The entry whose body AST is scanned for captions.
24
24
  * @param conventions - The configured position conventions from
25
- * `ProjectConfig.captionConventions`. An empty record means no
25
+ * `.markspec.yaml` `caption-conventions:` (`ToolConfig.captionConventions`).
26
+ * An empty record means no
26
27
  * conventions are set and the function returns immediately.
27
28
  */
28
29
  export declare function validateCaptionConvention(entry: Entry, conventions: CaptionConventions): readonly Diagnostic[];
@@ -1 +1 @@
1
- {"version":3,"file":"caption_convention.d.ts","sourceRoot":"","sources":["../../src/validator/caption_convention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7E;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,kBAAkB,GAC9B,SAAS,UAAU,EAAE,CAmCvB"}
1
+ {"version":3,"file":"caption_convention.d.ts","sourceRoot":"","sources":["../../src/validator/caption_convention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7E;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,kBAAkB,GAC9B,SAAS,UAAU,EAAE,CAmCvB"}
@@ -24,7 +24,8 @@ exports.validateCaptionConvention = validateCaptionConvention;
24
24
  *
25
25
  * @param entry - The entry whose body AST is scanned for captions.
26
26
  * @param conventions - The configured position conventions from
27
- * `ProjectConfig.captionConventions`. An empty record means no
27
+ * `.markspec.yaml` `caption-conventions:` (`ToolConfig.captionConventions`).
28
+ * An empty record means no
28
29
  * conventions are set and the function returns immediately.
29
30
  */
30
31
  function validateCaptionConvention(entry, conventions) {
@@ -14,6 +14,12 @@
14
14
  * collided tokens (MSL-R014 replaces them).
15
15
  */
16
16
  import type { Diagnostic, Entry } from "../model/mod.js";
17
+ /**
18
+ * Attribute corpus findings and replace generic duplicate diagnostics with
19
+ * corpus collisions. Append collisions after attribution so MSL-R014 remains
20
+ * an error even when its location belongs to a read-only corpus.
21
+ */
22
+ export declare function applyCorpusPostPass(diagnostics: readonly Diagnostic[], allEntries: readonly Entry[]): Diagnostic[];
17
23
  /** Result of {@linkcode detectCorpusCollisions}. */
18
24
  export interface CorpusCollisionResult {
19
25
  readonly diagnostics: readonly Diagnostic[];
@@ -1 +1 @@
1
- {"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../src/validator/corpus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAWzD,oDAAoD;AACpD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,SAAS,KAAK,EAAE,GAC3B,qBAAqB,CAoFvB;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,UAAU,EAAE,SAAS,KAAK,EAAE,EAC5B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAClC,UAAU,EAAE,CAmCd"}
1
+ {"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../src/validator/corpus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAe,MAAM,iBAAiB,CAAC;AAOtE;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,UAAU,EAAE,SAAS,KAAK,EAAE,GAC3B,UAAU,EAAE,CAUd;AA2BD,oDAAoD;AACpD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,SAAS,KAAK,EAAE,GAC3B,qBAAqB,CAsFvB;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,UAAU,EAAE,SAAS,KAAK,EAAE,EAC5B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAClC,UAAU,EAAE,CAyCd"}
@@ -15,9 +15,37 @@
15
15
  * collided tokens (MSL-R014 replaces them).
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.applyCorpusPostPass = applyCorpusPostPass;
18
19
  exports.detectCorpusCollisions = detectCorpusCollisions;
19
20
  exports.attributeCorpusDiagnostics = attributeCorpusDiagnostics;
20
21
  const mod_js_1 = require("../model/mod.js");
22
+ /**
23
+ * Attribute corpus findings and replace generic duplicate diagnostics with
24
+ * corpus collisions. Append collisions after attribution so MSL-R014 remains
25
+ * an error even when its location belongs to a read-only corpus.
26
+ */
27
+ function applyCorpusPostPass(diagnostics, allEntries) {
28
+ const collisions = detectCorpusCollisions(allEntries);
29
+ return [
30
+ ...attributeCorpusDiagnostics(diagnostics, allEntries, collisions.collidedTokens),
31
+ ...collisions.diagnostics,
32
+ ];
33
+ }
34
+ /**
35
+ * Remedy clause for an inter-tier MSL-R014 collision — both owners
36
+ * carry an origin (upstream and/or delivered profile), so the consumer
37
+ * reading the diagnostic can rename NEITHER read-only entry (#771; the
38
+ * #799 review extended this from the upstream↔upstream case to every
39
+ * origin pairing). The remedy names the actions a consumer CAN take.
40
+ * Same-source duplicates never reach this clause (excluded via
41
+ * `sameOriginSource` — that is the delivering author's own bug, kept on
42
+ * the generic duplicate codes), and project↔origin collisions keep the
43
+ * "rename this entry" wording above (the project entry is the
44
+ * consumer's own).
45
+ */
46
+ const INTER_TIER_REMEDY = "a consumer cannot rename either read-only entry; drop one of the " +
47
+ "colliding sources (a delivered profile in .markspec.yaml, an upstream " +
48
+ "in project.yaml) or coordinate a rename with its author";
21
49
  /** Generic duplicate detectors superseded by MSL-R014 for corpus collisions. */
22
50
  const GENERIC_DUP_CODES = new Set([
23
51
  "MSL-R005",
@@ -29,7 +57,7 @@ function detectCorpusCollisions(allEntries) {
29
57
  const corpusByDisplayId = new Map();
30
58
  const corpusById = new Map();
31
59
  for (const e of allEntries) {
32
- if (!e.origin)
60
+ if (!(0, mod_js_1.isCorpusEntry)(e))
33
61
  continue;
34
62
  if (!corpusByDisplayId.has(e.displayId)) {
35
63
  corpusByDisplayId.set(e.displayId, e);
@@ -43,16 +71,16 @@ function detectCorpusCollisions(allEntries) {
43
71
  const diagnostics = [];
44
72
  const collided = new Set();
45
73
  for (const e of allEntries) {
46
- if (!e.origin) {
74
+ if (!(0, mod_js_1.isCorpusEntry)(e)) {
47
75
  const displayOwner = corpusByDisplayId.get(e.displayId);
48
76
  if (displayOwner) {
49
77
  collided.add(e.displayId);
50
78
  diagnostics.push({
51
79
  code: "MSL-R014",
52
80
  severity: "error",
53
- message: `display ID '${e.displayId}' is already delivered by ` +
81
+ message: `display ID '${e.displayId}' is already provided by ` +
54
82
  `${(0, mod_js_1.formatEntryOrigin)(displayOwner.origin)}; rename this entry — ` +
55
- `delivered corpus entries are read-only`,
83
+ `upstream and delivered-corpus entries are read-only`,
56
84
  location: e.location,
57
85
  });
58
86
  }
@@ -63,9 +91,9 @@ function detectCorpusCollisions(allEntries) {
63
91
  diagnostics.push({
64
92
  code: "MSL-R014",
65
93
  severity: "error",
66
- message: `Id '${e.id}' is already delivered by ` +
94
+ message: `Id '${e.id}' is already provided by ` +
67
95
  `${(0, mod_js_1.formatEntryOrigin)(idOwner.origin)}; rename this entry — ` +
68
- `delivered corpus entries are read-only`,
96
+ `upstream and delivered-corpus entries are read-only`,
69
97
  location: e.location,
70
98
  });
71
99
  }
@@ -79,28 +107,30 @@ function detectCorpusCollisions(allEntries) {
79
107
  // violation, and stays on the generic duplicate codes.
80
108
  const displayOwner = corpusByDisplayId.get(e.displayId);
81
109
  if (displayOwner !== e && displayOwner &&
82
- displayOwner.origin.profileId !== e.origin.profileId) {
110
+ !(0, mod_js_1.sameOriginSource)(displayOwner.origin, e.origin)) {
83
111
  collided.add(e.displayId);
84
112
  diagnostics.push({
85
113
  code: "MSL-R014",
86
114
  severity: "error",
87
- message: `display ID '${e.displayId}' is already delivered by ` +
88
- `${(0, mod_js_1.formatEntryOrigin)(displayOwner.origin)}; delivered corpus ` +
89
- `entries are read-only`,
115
+ message: `display ID '${e.displayId}' is provided by both ` +
116
+ `${(0, mod_js_1.formatEntryOrigin)(displayOwner.origin)} and ` +
117
+ `${(0, mod_js_1.formatEntryOrigin)(e.origin)} — ` +
118
+ INTER_TIER_REMEDY,
90
119
  location: e.location,
91
120
  });
92
121
  }
93
122
  if (e.id) {
94
123
  const idOwner = corpusById.get(e.id);
95
124
  if (idOwner !== e && idOwner &&
96
- idOwner.origin.profileId !== e.origin.profileId) {
125
+ !(0, mod_js_1.sameOriginSource)(idOwner.origin, e.origin)) {
97
126
  collided.add(e.id);
98
127
  diagnostics.push({
99
128
  code: "MSL-R014",
100
129
  severity: "error",
101
- message: `Id '${e.id}' is already delivered by ` +
102
- `${(0, mod_js_1.formatEntryOrigin)(idOwner.origin)}; delivered corpus entries ` +
103
- `are read-only`,
130
+ message: `Id '${e.id}' is provided by both ` +
131
+ `${(0, mod_js_1.formatEntryOrigin)(idOwner.origin)} and ` +
132
+ `${(0, mod_js_1.formatEntryOrigin)(e.origin)} — ` +
133
+ INTER_TIER_REMEDY,
104
134
  location: e.location,
105
135
  });
106
136
  }
@@ -111,8 +141,8 @@ function detectCorpusCollisions(allEntries) {
111
141
  function attributeCorpusDiagnostics(diagnostics, allEntries, collidedTokens) {
112
142
  const corpusFiles = new Map();
113
143
  for (const e of allEntries) {
114
- if (e.origin) {
115
- corpusFiles.set(e.location.file, (0, mod_js_1.formatEntryOrigin)(e.origin));
144
+ if ((0, mod_js_1.isCorpusEntry)(e)) {
145
+ corpusFiles.set(e.location.file, e.origin);
116
146
  }
117
147
  }
118
148
  const out = [];
@@ -129,12 +159,18 @@ function attributeCorpusDiagnostics(diagnostics, allEntries, collidedTokens) {
129
159
  [...collidedTokens].some((t) => d.message.includes(`'${t}'`))) {
130
160
  continue;
131
161
  }
132
- const label = d.location ? corpusFiles.get(d.location.file) : undefined;
133
- if (label !== undefined) {
162
+ const origin = d.location ? corpusFiles.get(d.location.file) : undefined;
163
+ if (origin !== undefined) {
164
+ // Attribution verb follows the origin tier (#771): "delivered by"
165
+ // is ADR-030 profile-corpus language; a finding located in a
166
+ // hydrated upstream snapshot reads "from upstream" instead.
167
+ const verb = origin.kind === "upstream"
168
+ ? "from upstream"
169
+ : "delivered by";
134
170
  out.push({
135
171
  ...d,
136
172
  severity: d.severity === "error" ? "warning" : d.severity,
137
- message: `delivered by ${label}: ${d.message}`,
173
+ message: `${verb} ${(0, mod_js_1.formatEntryOrigin)(origin)}: ${d.message}`,
138
174
  });
139
175
  continue;
140
176
  }
@@ -23,10 +23,12 @@ import type { Diagnostic, DisciplineRegistry, DisplayId, Entry } from "../model/
23
23
  * every entry. Pure function: takes the entries, a lookup map (used by
24
24
  * later tasks for channel-4 derivation), and the effective registry.
25
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.
26
+ * @param entries Emittable entries to walk — the caller passes the #771
27
+ * partition (upstream entries are exempt emitters, ADR-031 §4.7).
28
+ * @param entriesByDisplayId Lookup map for channel-4 derivation, built from
29
+ * the FULL entry set (upstream included) so Allocated-to targets in
30
+ * upstream entries still resolve. Tasks 5–8 will use this; Task 4
31
+ * ignores it but keeps the parameter to fix the signature now.
30
32
  * @param registry Effective discipline registry from Slice 2's
31
33
  * `buildEffectiveDisciplineRegistry()`, or `CORE_DISCIPLINE_REGISTRY` in
32
34
  * core-only mode.
@@ -1 +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"}
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;;;;;;;;;;;;;;GAcG;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"}
@@ -102,10 +102,12 @@ function channel4Kind(entry, entriesByDisplayId, registry) {
102
102
  * every entry. Pure function: takes the entries, a lookup map (used by
103
103
  * later tasks for channel-4 derivation), and the effective registry.
104
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.
105
+ * @param entries Emittable entries to walk — the caller passes the #771
106
+ * partition (upstream entries are exempt emitters, ADR-031 §4.7).
107
+ * @param entriesByDisplayId Lookup map for channel-4 derivation, built from
108
+ * the FULL entry set (upstream included) so Allocated-to targets in
109
+ * upstream entries still resolve. Tasks 5–8 will use this; Task 4
110
+ * ignores it but keeps the parameter to fix the signature now.
109
111
  * @param registry Effective discipline registry from Slice 2's
110
112
  * `buildEffectiveDisciplineRegistry()`, or `CORE_DISCIPLINE_REGISTRY` in
111
113
  * core-only mode.
@@ -43,6 +43,6 @@ export { validateValue } from "./value_types.js";
43
43
  export type { ValueValidator } from "./value_types.js";
44
44
  export { normalizeListValues } from "./normalize.js";
45
45
  export { effectiveTraceRules, matchesAnyTarget, validateTraceabilityForEntry, } from "./traceability.js";
46
- export { attributeCorpusDiagnostics, detectCorpusCollisions, } from "./corpus.js";
46
+ export { applyCorpusPostPass, attributeCorpusDiagnostics, detectCorpusCollisions, } from "./corpus.js";
47
47
  export type { CorpusCollisionResult } from "./corpus.js";
48
48
  //# sourceMappingURL=mod.d.ts.map
@@ -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;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,EAA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EvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -15,7 +15,7 @@
15
15
  * a profile-aware validator layer (not in the core).
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.detectCorpusCollisions = exports.attributeCorpusDiagnostics = 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;
18
+ exports.detectCorpusCollisions = exports.attributeCorpusDiagnostics = exports.applyCorpusPostPass = 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;
@@ -51,21 +51,32 @@ const REFERENCE_SLUG_RE = /^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$/;
51
51
  */
52
52
  function validate(entries) {
53
53
  const diagnostics = [];
54
- checkStructural(entries, diagnostics);
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.
54
+ // Partition once (#771): upstream entries are read-only graph citizens
55
+ // (ADR-031 §4.7) — emit loops iterate `emittable`; resolution maps
56
+ // (checkReferences) still index the full `entries` list so links TO an
57
+ // upstream entry keep resolving.
58
+ const emittable = (0, mod_js_1.emittableEntries)(entries);
59
+ checkStructural(emittable, diagnostics);
60
+ checkReferences(emittable, entries, diagnostics);
61
+ // Typl declared-once (TYPL-009), citation resolution (TYPL-010/011), and
62
+ // undefined-typedef-refs (TYPL-005). Per-block diagnostics
63
+ // (TYPL-001/004/006/007/008) already fired during parse via the bridge.
64
+ // Receives the FULL list on purpose: validateTypl applies the partition
65
+ // itself — its typl-inert-upstream working set is the module's own
66
+ // registry-scope contract, not this orchestrator's to enforce.
59
67
  const typlResult = (0, mod_js_2.validateTypl)(entries);
60
68
  diagnostics.push(...typlResult.diagnostics);
61
69
  const valid = !diagnostics.some((d) => d.severity === "error");
62
70
  return { diagnostics, valid };
63
71
  }
64
- /** MSL-R structural checks on individual entries and cross-entry uniqueness. */
65
- function checkStructural(entries, diagnostics) {
72
+ /** MSL-R structural checks on individual entries and cross-entry uniqueness.
73
+ * Receives the pre-partitioned emittable list (#771) — upstream entries never
74
+ * enter these checks or the duplicate maps below (same as before the
75
+ * partition: the maps were built inside the guarded loop). */
76
+ function checkStructural(emittable, diagnostics) {
66
77
  const displayIds = new Map();
67
78
  const ids = new Map();
68
- for (const entry of entries) {
79
+ for (const entry of emittable) {
69
80
  // MSL-R003: exactly one `Id:` attribute per entry.
70
81
  // Dual-emit: MSL-I002 (Reference missing Id), MSL-I003 (Authored missing
71
82
  // Id), MSL-I004 (multiple Id) — nextgen §4.2 codes alongside legacy.
@@ -392,11 +403,13 @@ function checkStructural(entries, diagnostics) {
392
403
  }
393
404
  }
394
405
  }
395
- /** Cross-reference integrity checks. */
396
- function checkReferences(entries, diagnostics) {
406
+ /** Cross-reference integrity checks. Emit loops iterate the pre-partitioned
407
+ * `emittable` list (#771 — refs FROM an upstream entry are never checked);
408
+ * the resolution maps index `all` so refs TO an upstream entry resolve. */
409
+ function checkReferences(emittable, all, diagnostics) {
397
410
  // Build a display-ID index for cross-reference resolution.
398
411
  const byDisplayId = new Map();
399
- for (const entry of entries) {
412
+ for (const entry of all) {
400
413
  if (!byDisplayId.has(entry.displayId)) {
401
414
  byDisplayId.set(entry.displayId, entry);
402
415
  }
@@ -404,14 +417,14 @@ function checkReferences(entries, diagnostics) {
404
417
  // Also index by `Id:` value so references may target ULIDs or URIs
405
418
  // directly (profile tooling commonly accepts either).
406
419
  const byId = new Map();
407
- for (const entry of entries) {
420
+ for (const entry of all) {
408
421
  if (entry.id && !byId.has(entry.id)) {
409
422
  byId.set(entry.id, entry);
410
423
  }
411
424
  }
412
425
  // MSL-T012: `Supersedes:` — the one baked-in relation. Target must
413
426
  // resolve; profile rules check type/shape compatibility separately.
414
- for (const entry of entries) {
427
+ for (const entry of emittable) {
415
428
  const supersedes = entry.rawAttributes.find((a) => a.key === "Supersedes");
416
429
  if (!supersedes)
417
430
  continue;
@@ -428,7 +441,7 @@ function checkReferences(entries, diagnostics) {
428
441
  }
429
442
  // MSL-T005: `References:` — citations must resolve to a referenced
430
443
  // entry. This is a universal relation (citing identified → referenced).
431
- for (const entry of entries) {
444
+ for (const entry of emittable) {
432
445
  const citations = entry.rawAttributes.filter((a) => a.key === "References");
433
446
  for (const attr of citations) {
434
447
  // Citation format: "slug [free-text locator]"; take the first token.
@@ -494,5 +507,6 @@ Object.defineProperty(exports, "effectiveTraceRules", { enumerable: true, get: f
494
507
  Object.defineProperty(exports, "matchesAnyTarget", { enumerable: true, get: function () { return traceability_js_1.matchesAnyTarget; } });
495
508
  Object.defineProperty(exports, "validateTraceabilityForEntry", { enumerable: true, get: function () { return traceability_js_1.validateTraceabilityForEntry; } });
496
509
  var corpus_js_1 = require("./corpus.js");
510
+ Object.defineProperty(exports, "applyCorpusPostPass", { enumerable: true, get: function () { return corpus_js_1.applyCorpusPostPass; } });
497
511
  Object.defineProperty(exports, "attributeCorpusDiagnostics", { enumerable: true, get: function () { return corpus_js_1.attributeCorpusDiagnostics; } });
498
512
  Object.defineProperty(exports, "detectCorpusCollisions", { enumerable: true, get: function () { return corpus_js_1.detectCorpusCollisions; } });
@@ -27,6 +27,15 @@ export interface PipelineOptions {
27
27
  * Defaults to `true` (full-project scope — emit MSL-L006 normally).
28
28
  */
29
29
  readonly projectWide?: boolean;
30
+ /**
31
+ * Declared upstream ids (federated upstream, slice 4) — derived from
32
+ * `project.yaml`'s `dependencies:`/`references:` via `deriveUpstreamId`.
33
+ * When non-empty, Stage 4 fires `MSL-T014` (warning), naming the
34
+ * searched upstream set, instead of `MSL-L006` for an otherwise-
35
+ * unresolved trace target. Defaults to empty — `MSL-L006` unchanged.
36
+ * Scope-gated identically to `MSL-L006` (see `projectWide` above).
37
+ */
38
+ readonly declaredUpstreamIds?: readonly string[];
30
39
  }
31
40
  /**
32
41
  * Run the validator pipeline.
@@ -39,7 +48,8 @@ export interface PipelineOptions {
39
48
  * assignments).
40
49
  *
41
50
  * @param captionConventions - Optional project-configured caption-position
42
- * conventions (from `ProjectConfig.captionConventions`). When supplied
51
+ * conventions (from `.markspec.yaml` `caption-conventions:`, via
52
+ * `ToolConfig.captionConventions`). When supplied
43
53
  * and non-empty, MSL-C072 is checked for each entry. Defaults to no
44
54
  * conventions (rule inactive).
45
55
  * @param opts - Pipeline options. Pass `{ projectWide: false }` when
@@ -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;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,8DAA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