@driftsys/markspec 0.10.2 → 0.11.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 (414) hide show
  1. package/README.md +2 -2
  2. package/esm/compiler/deserialize.d.ts +49 -0
  3. package/esm/compiler/deserialize.d.ts.map +1 -0
  4. package/esm/compiler/deserialize.js +139 -0
  5. package/esm/compiler/manifest.d.ts +3 -0
  6. package/esm/compiler/manifest.d.ts.map +1 -1
  7. package/esm/compiler/manifest.js +9 -3
  8. package/esm/compiler/mod.d.ts.map +1 -1
  9. package/esm/compiler/mod.js +16 -7
  10. package/esm/config/markspec.d.ts +38 -1
  11. package/esm/config/markspec.d.ts.map +1 -1
  12. package/esm/config/markspec.js +127 -2
  13. package/esm/config/mod.d.ts.map +1 -1
  14. package/esm/config/mod.js +143 -147
  15. package/esm/decl/duplicates.d.ts +29 -0
  16. package/esm/decl/duplicates.d.ts.map +1 -0
  17. package/esm/decl/duplicates.js +28 -0
  18. package/esm/decl/mod.d.ts +20 -0
  19. package/esm/decl/mod.d.ts.map +1 -0
  20. package/esm/decl/mod.js +15 -0
  21. package/esm/decl/resolve.d.ts +104 -0
  22. package/esm/decl/resolve.d.ts.map +1 -0
  23. package/esm/decl/resolve.js +66 -0
  24. package/esm/decl/surfaces.d.ts +118 -0
  25. package/esm/decl/surfaces.d.ts.map +1 -0
  26. package/esm/decl/surfaces.js +135 -0
  27. package/esm/decl/table.d.ts +50 -0
  28. package/esm/decl/table.d.ts.map +1 -0
  29. package/esm/decl/table.js +124 -0
  30. package/esm/gates/mod.d.ts +13 -2
  31. package/esm/gates/mod.d.ts.map +1 -1
  32. package/esm/gates/mod.js +38 -11
  33. package/esm/lint/runner.d.ts.map +1 -1
  34. package/esm/lint/runner.js +3 -1
  35. package/esm/lock/acquire_compile.d.ts +31 -0
  36. package/esm/lock/acquire_compile.d.ts.map +1 -0
  37. package/esm/lock/acquire_compile.js +83 -0
  38. package/esm/lock/cache_check.d.ts +28 -0
  39. package/esm/lock/cache_check.d.ts.map +1 -0
  40. package/esm/lock/cache_check.js +51 -0
  41. package/esm/lock/check.d.ts +14 -3
  42. package/esm/lock/check.d.ts.map +1 -1
  43. package/esm/lock/check.js +41 -3
  44. package/esm/lock/git_intent.d.ts +46 -0
  45. package/esm/lock/git_intent.d.ts.map +1 -0
  46. package/esm/lock/git_intent.js +111 -0
  47. package/esm/lock/mod.d.ts +10 -3
  48. package/esm/lock/mod.d.ts.map +1 -1
  49. package/esm/lock/mod.js +7 -1
  50. package/esm/lock/model.d.ts +24 -1
  51. package/esm/lock/model.d.ts.map +1 -1
  52. package/esm/lock/parser.d.ts.map +1 -1
  53. package/esm/lock/parser.js +32 -0
  54. package/esm/lock/pin_assurance.d.ts +20 -0
  55. package/esm/lock/pin_assurance.d.ts.map +1 -0
  56. package/esm/lock/pin_assurance.js +34 -0
  57. package/esm/lock/resolve.d.ts +8 -17
  58. package/esm/lock/resolve.d.ts.map +1 -1
  59. package/esm/lock/resolve.js +7 -67
  60. package/esm/lock/serializer.d.ts.map +1 -1
  61. package/esm/lock/serializer.js +23 -0
  62. package/esm/lock/upstream_common.d.ts +29 -0
  63. package/esm/lock/upstream_common.d.ts.map +1 -0
  64. package/esm/lock/upstream_common.js +38 -0
  65. package/esm/lock/upstream_deps.d.ts +63 -0
  66. package/esm/lock/upstream_deps.d.ts.map +1 -0
  67. package/esm/lock/upstream_deps.js +172 -0
  68. package/esm/lock/upstream_refs.d.ts +69 -0
  69. package/esm/lock/upstream_refs.d.ts.map +1 -0
  70. package/esm/lock/upstream_refs.js +238 -0
  71. package/esm/mod.d.ts +16 -8
  72. package/esm/mod.d.ts.map +1 -1
  73. package/esm/mod.js +15 -5
  74. package/esm/model/mod.d.ts +93 -28
  75. package/esm/model/mod.d.ts.map +1 -1
  76. package/esm/model/mod.js +66 -13
  77. package/esm/model/profile.d.ts +13 -0
  78. package/esm/model/profile.d.ts.map +1 -1
  79. package/esm/parser/directives.d.ts +6 -0
  80. package/esm/parser/directives.d.ts.map +1 -1
  81. package/esm/parser/directives.js +17 -0
  82. package/esm/parser/markdown.d.ts.map +1 -1
  83. package/esm/parser/markdown.js +16 -51
  84. package/esm/profile/manifest.d.ts.map +1 -1
  85. package/esm/profile/manifest.js +20 -3
  86. package/esm/profile/merge.js +7 -0
  87. package/esm/reporter/mod.d.ts +11 -0
  88. package/esm/reporter/mod.d.ts.map +1 -1
  89. package/esm/reporter/mod.js +19 -8
  90. package/esm/typl/assemble.d.ts +53 -0
  91. package/esm/typl/assemble.d.ts.map +1 -0
  92. package/esm/typl/assemble.js +238 -0
  93. package/esm/typl/ast.d.ts +7 -1
  94. package/esm/typl/ast.d.ts.map +1 -1
  95. package/esm/typl/ast.js +3 -0
  96. package/esm/typl/bullet.d.ts +16 -24
  97. package/esm/typl/bullet.d.ts.map +1 -1
  98. package/esm/typl/bullet.js +9 -41
  99. package/esm/typl/citations.d.ts +27 -0
  100. package/esm/typl/citations.d.ts.map +1 -0
  101. package/esm/typl/citations.js +16 -0
  102. package/esm/typl/diagnostics.d.ts +2 -2
  103. package/esm/typl/diagnostics.d.ts.map +1 -1
  104. package/esm/typl/diagnostics.js +18 -0
  105. package/esm/typl/fence.d.ts +12 -21
  106. package/esm/typl/fence.d.ts.map +1 -1
  107. package/esm/typl/fence.js +5 -20
  108. package/esm/typl/grammar.d.ts.map +1 -1
  109. package/esm/typl/grammar.js +6 -0
  110. package/esm/typl/inline.d.ts +15 -24
  111. package/esm/typl/inline.d.ts.map +1 -1
  112. package/esm/typl/inline.js +6 -44
  113. package/esm/typl/lexer.d.ts.map +1 -1
  114. package/esm/typl/lexer.js +25 -4
  115. package/esm/typl/mod.d.ts +8 -2
  116. package/esm/typl/mod.d.ts.map +1 -1
  117. package/esm/typl/mod.js +5 -1
  118. package/esm/typl/recognize.d.ts +14 -0
  119. package/esm/typl/recognize.d.ts.map +1 -0
  120. package/esm/typl/recognize.js +19 -0
  121. package/esm/typl/registry.d.ts +1 -1
  122. package/esm/typl/resolve.d.ts +31 -0
  123. package/esm/typl/resolve.d.ts.map +1 -0
  124. package/esm/typl/resolve.js +27 -0
  125. package/esm/typl/table.d.ts +52 -0
  126. package/esm/typl/table.d.ts.map +1 -0
  127. package/esm/typl/table.js +69 -0
  128. package/esm/typl/validator.d.ts +24 -5
  129. package/esm/typl/validator.d.ts.map +1 -1
  130. package/esm/typl/validator.js +55 -75
  131. package/esm/upstream/mod.d.ts +45 -0
  132. package/esm/upstream/mod.d.ts.map +1 -0
  133. package/esm/upstream/mod.js +98 -0
  134. package/esm/upstream/project.d.ts +33 -0
  135. package/esm/upstream/project.d.ts.map +1 -0
  136. package/esm/upstream/project.js +38 -0
  137. package/esm/upstream/refs.d.ts +23 -0
  138. package/esm/upstream/refs.d.ts.map +1 -0
  139. package/esm/upstream/refs.js +71 -0
  140. package/esm/util/paths.d.ts +14 -0
  141. package/esm/util/paths.d.ts.map +1 -0
  142. package/esm/util/paths.js +22 -0
  143. package/esm/uxil/assemble.d.ts +38 -0
  144. package/esm/uxil/assemble.d.ts.map +1 -0
  145. package/esm/uxil/assemble.js +268 -0
  146. package/esm/uxil/ast.d.ts +63 -0
  147. package/esm/uxil/ast.d.ts.map +1 -0
  148. package/esm/uxil/ast.js +9 -0
  149. package/esm/uxil/citations.d.ts +27 -0
  150. package/esm/uxil/citations.d.ts.map +1 -0
  151. package/esm/uxil/citations.js +25 -0
  152. package/esm/uxil/diagnostics.d.ts +39 -0
  153. package/esm/uxil/diagnostics.d.ts.map +1 -0
  154. package/esm/uxil/diagnostics.js +135 -0
  155. package/esm/uxil/grammar.d.ts +72 -0
  156. package/esm/uxil/grammar.d.ts.map +1 -0
  157. package/esm/uxil/grammar.js +505 -0
  158. package/esm/uxil/lexer.d.ts +23 -0
  159. package/esm/uxil/lexer.d.ts.map +1 -0
  160. package/esm/uxil/lexer.js +58 -0
  161. package/esm/uxil/mod.d.ts +32 -0
  162. package/esm/uxil/mod.d.ts.map +1 -0
  163. package/esm/uxil/mod.js +11 -0
  164. package/esm/uxil/projection.d.ts +40 -0
  165. package/esm/uxil/projection.d.ts.map +1 -0
  166. package/esm/uxil/projection.js +41 -0
  167. package/esm/uxil/recognize.d.ts +16 -0
  168. package/esm/uxil/recognize.d.ts.map +1 -0
  169. package/esm/uxil/recognize.js +28 -0
  170. package/esm/uxil/registry.d.ts +37 -0
  171. package/esm/uxil/registry.d.ts.map +1 -0
  172. package/esm/uxil/registry.js +29 -0
  173. package/esm/uxil/surfaces.d.ts +36 -0
  174. package/esm/uxil/surfaces.d.ts.map +1 -0
  175. package/esm/uxil/surfaces.js +34 -0
  176. package/esm/uxil/validator.d.ts +36 -0
  177. package/esm/uxil/validator.d.ts.map +1 -0
  178. package/esm/uxil/validator.js +139 -0
  179. package/esm/uxil/vocab.d.ts +33 -0
  180. package/esm/uxil/vocab.d.ts.map +1 -0
  181. package/esm/uxil/vocab.js +36 -0
  182. package/esm/validator/body_blocks.d.ts.map +1 -1
  183. package/esm/validator/body_blocks.js +3 -9
  184. package/esm/validator/caption_convention.d.ts +2 -1
  185. package/esm/validator/caption_convention.d.ts.map +1 -1
  186. package/esm/validator/caption_convention.js +2 -1
  187. package/esm/validator/corpus.d.ts.map +1 -1
  188. package/esm/validator/corpus.js +40 -17
  189. package/esm/validator/discipline.d.ts +6 -4
  190. package/esm/validator/discipline.d.ts.map +1 -1
  191. package/esm/validator/discipline.js +6 -4
  192. package/esm/validator/mod.d.ts.map +1 -1
  193. package/esm/validator/mod.js +28 -15
  194. package/esm/validator/pipeline.d.ts +11 -1
  195. package/esm/validator/pipeline.d.ts.map +1 -1
  196. package/esm/validator/pipeline.js +68 -18
  197. package/esm/validator/trace_types.d.ts +9 -2
  198. package/esm/validator/trace_types.d.ts.map +1 -1
  199. package/esm/validator/trace_types.js +21 -5
  200. package/esm/validator/traceability.d.ts +15 -3
  201. package/esm/validator/traceability.d.ts.map +1 -1
  202. package/esm/validator/traceability.js +39 -4
  203. package/esm/validator/types.d.ts.map +1 -1
  204. package/esm/validator/types.js +11 -1
  205. package/esm/validator/uxil_family.d.ts +43 -0
  206. package/esm/validator/uxil_family.d.ts.map +1 -0
  207. package/esm/validator/uxil_family.js +52 -0
  208. package/package.json +1 -1
  209. package/script/compiler/deserialize.d.ts +49 -0
  210. package/script/compiler/deserialize.d.ts.map +1 -0
  211. package/script/compiler/deserialize.js +144 -0
  212. package/script/compiler/manifest.d.ts +3 -0
  213. package/script/compiler/manifest.d.ts.map +1 -1
  214. package/script/compiler/manifest.js +10 -3
  215. package/script/compiler/mod.d.ts.map +1 -1
  216. package/script/compiler/mod.js +15 -6
  217. package/script/config/markspec.d.ts +38 -1
  218. package/script/config/markspec.d.ts.map +1 -1
  219. package/script/config/markspec.js +129 -3
  220. package/script/config/mod.d.ts.map +1 -1
  221. package/script/config/mod.js +143 -147
  222. package/script/decl/duplicates.d.ts +29 -0
  223. package/script/decl/duplicates.d.ts.map +1 -0
  224. package/script/decl/duplicates.js +31 -0
  225. package/script/decl/mod.d.ts +20 -0
  226. package/script/decl/mod.d.ts.map +1 -0
  227. package/script/decl/mod.js +26 -0
  228. package/script/decl/resolve.d.ts +104 -0
  229. package/script/decl/resolve.d.ts.map +1 -0
  230. package/script/decl/resolve.js +70 -0
  231. package/script/decl/surfaces.d.ts +118 -0
  232. package/script/decl/surfaces.d.ts.map +1 -0
  233. package/script/decl/surfaces.js +141 -0
  234. package/script/decl/table.d.ts +50 -0
  235. package/script/decl/table.d.ts.map +1 -0
  236. package/script/decl/table.js +127 -0
  237. package/script/gates/mod.d.ts +13 -2
  238. package/script/gates/mod.d.ts.map +1 -1
  239. package/script/gates/mod.js +37 -10
  240. package/script/lint/runner.d.ts.map +1 -1
  241. package/script/lint/runner.js +3 -1
  242. package/script/lock/acquire_compile.d.ts +31 -0
  243. package/script/lock/acquire_compile.d.ts.map +1 -0
  244. package/script/lock/acquire_compile.js +86 -0
  245. package/script/lock/cache_check.d.ts +28 -0
  246. package/script/lock/cache_check.d.ts.map +1 -0
  247. package/script/lock/cache_check.js +54 -0
  248. package/script/lock/check.d.ts +14 -3
  249. package/script/lock/check.d.ts.map +1 -1
  250. package/script/lock/check.js +41 -3
  251. package/script/lock/git_intent.d.ts +46 -0
  252. package/script/lock/git_intent.d.ts.map +1 -0
  253. package/script/lock/git_intent.js +115 -0
  254. package/script/lock/mod.d.ts +10 -3
  255. package/script/lock/mod.d.ts.map +1 -1
  256. package/script/lock/mod.js +16 -2
  257. package/script/lock/model.d.ts +24 -1
  258. package/script/lock/model.d.ts.map +1 -1
  259. package/script/lock/parser.d.ts.map +1 -1
  260. package/script/lock/parser.js +32 -0
  261. package/script/lock/pin_assurance.d.ts +20 -0
  262. package/script/lock/pin_assurance.d.ts.map +1 -0
  263. package/script/lock/pin_assurance.js +37 -0
  264. package/script/lock/resolve.d.ts +8 -17
  265. package/script/lock/resolve.d.ts.map +1 -1
  266. package/script/lock/resolve.js +7 -68
  267. package/script/lock/serializer.d.ts.map +1 -1
  268. package/script/lock/serializer.js +23 -0
  269. package/script/lock/upstream_common.d.ts +29 -0
  270. package/script/lock/upstream_common.d.ts.map +1 -0
  271. package/script/lock/upstream_common.js +42 -0
  272. package/script/lock/upstream_deps.d.ts +63 -0
  273. package/script/lock/upstream_deps.d.ts.map +1 -0
  274. package/script/lock/upstream_deps.js +175 -0
  275. package/script/lock/upstream_refs.d.ts +69 -0
  276. package/script/lock/upstream_refs.d.ts.map +1 -0
  277. package/script/lock/upstream_refs.js +244 -0
  278. package/script/mod.d.ts +16 -8
  279. package/script/mod.d.ts.map +1 -1
  280. package/script/mod.js +40 -7
  281. package/script/model/mod.d.ts +93 -28
  282. package/script/model/mod.d.ts.map +1 -1
  283. package/script/model/mod.js +70 -14
  284. package/script/model/profile.d.ts +13 -0
  285. package/script/model/profile.d.ts.map +1 -1
  286. package/script/parser/directives.d.ts +6 -0
  287. package/script/parser/directives.d.ts.map +1 -1
  288. package/script/parser/directives.js +18 -0
  289. package/script/parser/markdown.d.ts.map +1 -1
  290. package/script/parser/markdown.js +15 -50
  291. package/script/profile/manifest.d.ts.map +1 -1
  292. package/script/profile/manifest.js +20 -3
  293. package/script/profile/merge.js +7 -0
  294. package/script/reporter/mod.d.ts +11 -0
  295. package/script/reporter/mod.d.ts.map +1 -1
  296. package/script/reporter/mod.js +18 -7
  297. package/script/typl/assemble.d.ts +53 -0
  298. package/script/typl/assemble.d.ts.map +1 -0
  299. package/script/typl/assemble.js +241 -0
  300. package/script/typl/ast.d.ts +7 -1
  301. package/script/typl/ast.d.ts.map +1 -1
  302. package/script/typl/ast.js +3 -0
  303. package/script/typl/bullet.d.ts +16 -24
  304. package/script/typl/bullet.d.ts.map +1 -1
  305. package/script/typl/bullet.js +10 -42
  306. package/script/typl/citations.d.ts +27 -0
  307. package/script/typl/citations.d.ts.map +1 -0
  308. package/script/typl/citations.js +20 -0
  309. package/script/typl/diagnostics.d.ts +2 -2
  310. package/script/typl/diagnostics.d.ts.map +1 -1
  311. package/script/typl/diagnostics.js +18 -0
  312. package/script/typl/fence.d.ts +12 -21
  313. package/script/typl/fence.d.ts.map +1 -1
  314. package/script/typl/fence.js +5 -20
  315. package/script/typl/grammar.d.ts.map +1 -1
  316. package/script/typl/grammar.js +6 -0
  317. package/script/typl/inline.d.ts +15 -24
  318. package/script/typl/inline.d.ts.map +1 -1
  319. package/script/typl/inline.js +6 -44
  320. package/script/typl/lexer.d.ts.map +1 -1
  321. package/script/typl/lexer.js +25 -4
  322. package/script/typl/mod.d.ts +8 -2
  323. package/script/typl/mod.d.ts.map +1 -1
  324. package/script/typl/mod.js +14 -2
  325. package/script/typl/recognize.d.ts +14 -0
  326. package/script/typl/recognize.d.ts.map +1 -0
  327. package/script/typl/recognize.js +22 -0
  328. package/script/typl/registry.d.ts +1 -1
  329. package/script/typl/resolve.d.ts +31 -0
  330. package/script/typl/resolve.d.ts.map +1 -0
  331. package/script/typl/resolve.js +33 -0
  332. package/script/typl/table.d.ts +52 -0
  333. package/script/typl/table.d.ts.map +1 -0
  334. package/script/typl/table.js +75 -0
  335. package/script/typl/validator.d.ts +24 -5
  336. package/script/typl/validator.d.ts.map +1 -1
  337. package/script/typl/validator.js +55 -75
  338. package/script/upstream/mod.d.ts +45 -0
  339. package/script/upstream/mod.d.ts.map +1 -0
  340. package/script/upstream/mod.js +101 -0
  341. package/script/upstream/project.d.ts +33 -0
  342. package/script/upstream/project.d.ts.map +1 -0
  343. package/script/upstream/project.js +41 -0
  344. package/script/upstream/refs.d.ts +23 -0
  345. package/script/upstream/refs.d.ts.map +1 -0
  346. package/script/upstream/refs.js +74 -0
  347. package/script/util/paths.d.ts +14 -0
  348. package/script/util/paths.d.ts.map +1 -0
  349. package/script/util/paths.js +25 -0
  350. package/script/uxil/assemble.d.ts +38 -0
  351. package/script/uxil/assemble.d.ts.map +1 -0
  352. package/script/uxil/assemble.js +272 -0
  353. package/script/uxil/ast.d.ts +63 -0
  354. package/script/uxil/ast.d.ts.map +1 -0
  355. package/script/uxil/ast.js +10 -0
  356. package/script/uxil/citations.d.ts +27 -0
  357. package/script/uxil/citations.d.ts.map +1 -0
  358. package/script/uxil/citations.js +29 -0
  359. package/script/uxil/diagnostics.d.ts +39 -0
  360. package/script/uxil/diagnostics.d.ts.map +1 -0
  361. package/script/uxil/diagnostics.js +140 -0
  362. package/script/uxil/grammar.d.ts +72 -0
  363. package/script/uxil/grammar.d.ts.map +1 -0
  364. package/script/uxil/grammar.js +511 -0
  365. package/script/uxil/lexer.d.ts +23 -0
  366. package/script/uxil/lexer.d.ts.map +1 -0
  367. package/script/uxil/lexer.js +61 -0
  368. package/script/uxil/mod.d.ts +32 -0
  369. package/script/uxil/mod.d.ts.map +1 -0
  370. package/script/uxil/mod.js +37 -0
  371. package/script/uxil/projection.d.ts +40 -0
  372. package/script/uxil/projection.d.ts.map +1 -0
  373. package/script/uxil/projection.js +44 -0
  374. package/script/uxil/recognize.d.ts +16 -0
  375. package/script/uxil/recognize.d.ts.map +1 -0
  376. package/script/uxil/recognize.js +31 -0
  377. package/script/uxil/registry.d.ts +37 -0
  378. package/script/uxil/registry.d.ts.map +1 -0
  379. package/script/uxil/registry.js +32 -0
  380. package/script/uxil/surfaces.d.ts +36 -0
  381. package/script/uxil/surfaces.d.ts.map +1 -0
  382. package/script/uxil/surfaces.js +39 -0
  383. package/script/uxil/validator.d.ts +36 -0
  384. package/script/uxil/validator.d.ts.map +1 -0
  385. package/script/uxil/validator.js +142 -0
  386. package/script/uxil/vocab.d.ts +33 -0
  387. package/script/uxil/vocab.d.ts.map +1 -0
  388. package/script/uxil/vocab.js +41 -0
  389. package/script/validator/body_blocks.d.ts.map +1 -1
  390. package/script/validator/body_blocks.js +3 -9
  391. package/script/validator/caption_convention.d.ts +2 -1
  392. package/script/validator/caption_convention.d.ts.map +1 -1
  393. package/script/validator/caption_convention.js +2 -1
  394. package/script/validator/corpus.d.ts.map +1 -1
  395. package/script/validator/corpus.js +39 -16
  396. package/script/validator/discipline.d.ts +6 -4
  397. package/script/validator/discipline.d.ts.map +1 -1
  398. package/script/validator/discipline.js +6 -4
  399. package/script/validator/mod.d.ts.map +1 -1
  400. package/script/validator/mod.js +27 -14
  401. package/script/validator/pipeline.d.ts +11 -1
  402. package/script/validator/pipeline.d.ts.map +1 -1
  403. package/script/validator/pipeline.js +67 -17
  404. package/script/validator/trace_types.d.ts +9 -2
  405. package/script/validator/trace_types.d.ts.map +1 -1
  406. package/script/validator/trace_types.js +20 -4
  407. package/script/validator/traceability.d.ts +15 -3
  408. package/script/validator/traceability.d.ts.map +1 -1
  409. package/script/validator/traceability.js +38 -3
  410. package/script/validator/types.d.ts.map +1 -1
  411. package/script/validator/types.js +10 -0
  412. package/script/validator/uxil_family.d.ts +43 -0
  413. package/script/validator/uxil_family.d.ts.map +1 -0
  414. package/script/validator/uxil_family.js +56 -0
@@ -13,7 +13,22 @@
13
13
  * delivering profile; generic duplicate codes are suppressed for
14
14
  * collided tokens (MSL-R014 replaces them).
15
15
  */
16
- import { formatEntryOrigin } from "../model/mod.js";
16
+ import { formatEntryOrigin, sameOriginSource } from "../model/mod.js";
17
+ /**
18
+ * Remedy clause for an inter-tier MSL-R014 collision — both owners
19
+ * carry an origin (upstream and/or delivered profile), so the consumer
20
+ * reading the diagnostic can rename NEITHER read-only entry (#771; the
21
+ * #799 review extended this from the upstream↔upstream case to every
22
+ * origin pairing). The remedy names the actions a consumer CAN take.
23
+ * Same-source duplicates never reach this clause (excluded via
24
+ * `sameOriginSource` — that is the delivering author's own bug, kept on
25
+ * the generic duplicate codes), and project↔origin collisions keep the
26
+ * "rename this entry" wording above (the project entry is the
27
+ * consumer's own).
28
+ */
29
+ const INTER_TIER_REMEDY = "a consumer cannot rename either read-only entry; drop one of the " +
30
+ "colliding sources (a delivered profile in .markspec.yaml, an upstream " +
31
+ "in project.yaml) or coordinate a rename with its author";
17
32
  /** Generic duplicate detectors superseded by MSL-R014 for corpus collisions. */
18
33
  const GENERIC_DUP_CODES = new Set([
19
34
  "MSL-R005",
@@ -46,9 +61,9 @@ export function detectCorpusCollisions(allEntries) {
46
61
  diagnostics.push({
47
62
  code: "MSL-R014",
48
63
  severity: "error",
49
- message: `display ID '${e.displayId}' is already delivered by ` +
64
+ message: `display ID '${e.displayId}' is already provided by ` +
50
65
  `${formatEntryOrigin(displayOwner.origin)}; rename this entry — ` +
51
- `delivered corpus entries are read-only`,
66
+ `upstream and delivered-corpus entries are read-only`,
52
67
  location: e.location,
53
68
  });
54
69
  }
@@ -59,9 +74,9 @@ export function detectCorpusCollisions(allEntries) {
59
74
  diagnostics.push({
60
75
  code: "MSL-R014",
61
76
  severity: "error",
62
- message: `Id '${e.id}' is already delivered by ` +
77
+ message: `Id '${e.id}' is already provided by ` +
63
78
  `${formatEntryOrigin(idOwner.origin)}; rename this entry — ` +
64
- `delivered corpus entries are read-only`,
79
+ `upstream and delivered-corpus entries are read-only`,
65
80
  location: e.location,
66
81
  });
67
82
  }
@@ -75,28 +90,30 @@ export function detectCorpusCollisions(allEntries) {
75
90
  // violation, and stays on the generic duplicate codes.
76
91
  const displayOwner = corpusByDisplayId.get(e.displayId);
77
92
  if (displayOwner !== e && displayOwner &&
78
- displayOwner.origin.profileId !== e.origin.profileId) {
93
+ !sameOriginSource(displayOwner.origin, e.origin)) {
79
94
  collided.add(e.displayId);
80
95
  diagnostics.push({
81
96
  code: "MSL-R014",
82
97
  severity: "error",
83
- message: `display ID '${e.displayId}' is already delivered by ` +
84
- `${formatEntryOrigin(displayOwner.origin)}; delivered corpus ` +
85
- `entries are read-only`,
98
+ message: `display ID '${e.displayId}' is provided by both ` +
99
+ `${formatEntryOrigin(displayOwner.origin)} and ` +
100
+ `${formatEntryOrigin(e.origin)} — ` +
101
+ INTER_TIER_REMEDY,
86
102
  location: e.location,
87
103
  });
88
104
  }
89
105
  if (e.id) {
90
106
  const idOwner = corpusById.get(e.id);
91
107
  if (idOwner !== e && idOwner &&
92
- idOwner.origin.profileId !== e.origin.profileId) {
108
+ !sameOriginSource(idOwner.origin, e.origin)) {
93
109
  collided.add(e.id);
94
110
  diagnostics.push({
95
111
  code: "MSL-R014",
96
112
  severity: "error",
97
- message: `Id '${e.id}' is already delivered by ` +
98
- `${formatEntryOrigin(idOwner.origin)}; delivered corpus entries ` +
99
- `are read-only`,
113
+ message: `Id '${e.id}' is provided by both ` +
114
+ `${formatEntryOrigin(idOwner.origin)} and ` +
115
+ `${formatEntryOrigin(e.origin)} — ` +
116
+ INTER_TIER_REMEDY,
100
117
  location: e.location,
101
118
  });
102
119
  }
@@ -108,7 +125,7 @@ export function attributeCorpusDiagnostics(diagnostics, allEntries, collidedToke
108
125
  const corpusFiles = new Map();
109
126
  for (const e of allEntries) {
110
127
  if (e.origin) {
111
- corpusFiles.set(e.location.file, formatEntryOrigin(e.origin));
128
+ corpusFiles.set(e.location.file, e.origin);
112
129
  }
113
130
  }
114
131
  const out = [];
@@ -125,12 +142,18 @@ export function attributeCorpusDiagnostics(diagnostics, allEntries, collidedToke
125
142
  [...collidedTokens].some((t) => d.message.includes(`'${t}'`))) {
126
143
  continue;
127
144
  }
128
- const label = d.location ? corpusFiles.get(d.location.file) : undefined;
129
- if (label !== undefined) {
145
+ const origin = d.location ? corpusFiles.get(d.location.file) : undefined;
146
+ if (origin !== undefined) {
147
+ // Attribution verb follows the origin tier (#771): "delivered by"
148
+ // is ADR-030 profile-corpus language; a finding located in a
149
+ // hydrated upstream snapshot reads "from upstream" instead.
150
+ const verb = origin.kind === "upstream"
151
+ ? "from upstream"
152
+ : "delivered by";
130
153
  out.push({
131
154
  ...d,
132
155
  severity: d.severity === "error" ? "warning" : d.severity,
133
- message: `delivered by ${label}: ${d.message}`,
156
+ message: `${verb} ${formatEntryOrigin(origin)}: ${d.message}`,
134
157
  });
135
158
  continue;
136
159
  }
@@ -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"}
@@ -99,10 +99,12 @@ function channel4Kind(entry, entriesByDisplayId, registry) {
99
99
  * every entry. Pure function: takes the entries, a lookup map (used by
100
100
  * later tasks for channel-4 derivation), and the effective registry.
101
101
  *
102
- * @param entries Entries to walk.
103
- * @param entriesByDisplayId Lookup map for channel-4 derivation. Tasks 5–8
104
- * will use this; Task 4 ignores it but keeps the parameter to fix the
105
- * signature now.
102
+ * @param entries Emittable entries to walk — the caller passes the #771
103
+ * partition (upstream entries are exempt emitters, ADR-031 §4.7).
104
+ * @param entriesByDisplayId Lookup map for channel-4 derivation, built from
105
+ * the FULL entry set (upstream included) so Allocated-to targets in
106
+ * upstream entries still resolve. Tasks 5–8 will use this; Task 4
107
+ * ignores it but keeps the parameter to fix the signature now.
106
108
  * @param registry Effective discipline registry from Slice 2's
107
109
  * `buildEffectiveDisciplineRegistry()`, or `CORE_DISCIPLINE_REGISTRY` in
108
110
  * core-only mode.
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/validator/mod.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AM,YAAY,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -13,7 +13,7 @@
13
13
  * constraints, enum vocabularies) are profile-declared and evaluated by
14
14
  * a profile-aware validator layer (not in the core).
15
15
  */
16
- import { attributeSpec, CORE_TYPE_SCOPED_ATTRS, CSV_SPLITTABLE_TYPES, IDENTITY_KEY, ULID_RE, UNIVERSAL_ATTRIBUTE_KEYS, URI_SCHEME_RE, } from "../model/mod.js";
16
+ import { attributeSpec, CORE_TYPE_SCOPED_ATTRS, CSV_SPLITTABLE_TYPES, emittableEntries, IDENTITY_KEY, ULID_RE, UNIVERSAL_ATTRIBUTE_KEYS, URI_SCHEME_RE, } from "../model/mod.js";
17
17
  import { HTTP_URL_RE } from "./value_types.js";
18
18
  import { validateTypl } from "../typl/mod.js";
19
19
  /** Universal attribute keys the core recognizes. */
@@ -45,21 +45,32 @@ const REFERENCE_SLUG_RE = /^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$/;
45
45
  */
46
46
  export function validate(entries) {
47
47
  const diagnostics = [];
48
- checkStructural(entries, diagnostics);
49
- checkReferences(entries, diagnostics);
50
- // Typl cross-entry collisions (TYPL-002/003) and undefined-typedef-refs
51
- // (TYPL-005). Per-block diagnostics (TYPL-001/004/006/007/008) already
52
- // fired during parse via the bridge.
48
+ // Partition once (#771): upstream entries are read-only graph citizens
49
+ // (ADR-031 §4.7) — emit loops iterate `emittable`; resolution maps
50
+ // (checkReferences) still index the full `entries` list so links TO an
51
+ // upstream entry keep resolving.
52
+ const emittable = emittableEntries(entries);
53
+ checkStructural(emittable, diagnostics);
54
+ checkReferences(emittable, entries, diagnostics);
55
+ // Typl declared-once (TYPL-009), citation resolution (TYPL-010/011), and
56
+ // undefined-typedef-refs (TYPL-005). Per-block diagnostics
57
+ // (TYPL-001/004/006/007/008) already fired during parse via the bridge.
58
+ // Receives the FULL list on purpose: validateTypl applies the partition
59
+ // itself — its typl-inert-upstream working set is the module's own
60
+ // registry-scope contract, not this orchestrator's to enforce.
53
61
  const typlResult = validateTypl(entries);
54
62
  diagnostics.push(...typlResult.diagnostics);
55
63
  const valid = !diagnostics.some((d) => d.severity === "error");
56
64
  return { diagnostics, valid };
57
65
  }
58
- /** MSL-R structural checks on individual entries and cross-entry uniqueness. */
59
- function checkStructural(entries, diagnostics) {
66
+ /** MSL-R structural checks on individual entries and cross-entry uniqueness.
67
+ * Receives the pre-partitioned emittable list (#771) — upstream entries never
68
+ * enter these checks or the duplicate maps below (same as before the
69
+ * partition: the maps were built inside the guarded loop). */
70
+ function checkStructural(emittable, diagnostics) {
60
71
  const displayIds = new Map();
61
72
  const ids = new Map();
62
- for (const entry of entries) {
73
+ for (const entry of emittable) {
63
74
  // MSL-R003: exactly one `Id:` attribute per entry.
64
75
  // Dual-emit: MSL-I002 (Reference missing Id), MSL-I003 (Authored missing
65
76
  // Id), MSL-I004 (multiple Id) — nextgen §4.2 codes alongside legacy.
@@ -386,11 +397,13 @@ function checkStructural(entries, diagnostics) {
386
397
  }
387
398
  }
388
399
  }
389
- /** Cross-reference integrity checks. */
390
- function checkReferences(entries, diagnostics) {
400
+ /** Cross-reference integrity checks. Emit loops iterate the pre-partitioned
401
+ * `emittable` list (#771 — refs FROM an upstream entry are never checked);
402
+ * the resolution maps index `all` so refs TO an upstream entry resolve. */
403
+ function checkReferences(emittable, all, diagnostics) {
391
404
  // Build a display-ID index for cross-reference resolution.
392
405
  const byDisplayId = new Map();
393
- for (const entry of entries) {
406
+ for (const entry of all) {
394
407
  if (!byDisplayId.has(entry.displayId)) {
395
408
  byDisplayId.set(entry.displayId, entry);
396
409
  }
@@ -398,14 +411,14 @@ function checkReferences(entries, diagnostics) {
398
411
  // Also index by `Id:` value so references may target ULIDs or URIs
399
412
  // directly (profile tooling commonly accepts either).
400
413
  const byId = new Map();
401
- for (const entry of entries) {
414
+ for (const entry of all) {
402
415
  if (entry.id && !byId.has(entry.id)) {
403
416
  byId.set(entry.id, entry);
404
417
  }
405
418
  }
406
419
  // MSL-T012: `Supersedes:` — the one baked-in relation. Target must
407
420
  // resolve; profile rules check type/shape compatibility separately.
408
- for (const entry of entries) {
421
+ for (const entry of emittable) {
409
422
  const supersedes = entry.rawAttributes.find((a) => a.key === "Supersedes");
410
423
  if (!supersedes)
411
424
  continue;
@@ -422,7 +435,7 @@ function checkReferences(entries, diagnostics) {
422
435
  }
423
436
  // MSL-T005: `References:` — citations must resolve to a referenced
424
437
  // entry. This is a universal relation (citing identified → referenced).
425
- for (const entry of entries) {
438
+ for (const entry of emittable) {
426
439
  const citations = entry.rawAttributes.filter((a) => a.key === "References");
427
440
  for (const attr of citations) {
428
441
  // Citation format: "slug [free-text locator]"; take the first token.
@@ -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,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAChC,kBAAkB,GAAE,kBAAuB,EAC3C,IAAI,GAAE,eAAoB,GACzB,cAAc,CA0Gh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ed 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
+ import { CORE_DISCIPLINE_REGISTRY, emittableEntries, makeDisplayId, } from "../model/mod.js";
11
11
  import { validate } from "./mod.js";
12
12
  import { classifyEntriesStage, inferTypeFromDisplayIdShape, inferTypeFromLateStageChain, validateCoreTypeAttribute, } from "./types.js";
13
13
  import { validateBodyBlocks } from "./body_blocks.js";
@@ -22,6 +22,16 @@ import { validateFeatureAc } from "./feature_ac.js";
22
22
  import { validateCaptionConvention } from "./caption_convention.js";
23
23
  import { validateDiscipline } from "./discipline.js";
24
24
  import { buildEffectiveDisciplineRegistry } from "../profile/discipline_registry.js";
25
+ import { validateUxilFamily } from "./uxil_family.js";
26
+ /** Cross-entry uxil codes suppressed under file-local scope (#727): a
27
+ * subset registry cannot distinguish a dangling reference from an
28
+ * unchecked file — the same false-positive class the MSL-L006 filter
29
+ * guards. Entry-local UXIL codes are unaffected. */
30
+ const FILE_LOCAL_SUPPRESSED_UXIL = new Set([
31
+ "UXIL-016",
32
+ "UXIL-017",
33
+ "UXIL-018",
34
+ ]);
25
35
  /**
26
36
  * Run the validator pipeline.
27
37
  *
@@ -33,7 +43,8 @@ import { buildEffectiveDisciplineRegistry } from "../profile/discipline_registry
33
43
  * assignments).
34
44
  *
35
45
  * @param captionConventions - Optional project-configured caption-position
36
- * conventions (from `ProjectConfig.captionConventions`). When supplied
46
+ * conventions (from `.markspec.yaml` `caption-conventions:`, via
47
+ * `ToolConfig.captionConventions`). When supplied
37
48
  * and non-empty, MSL-C072 is checked for each entry. Defaults to no
38
49
  * conventions (rule inactive).
39
50
  * @param opts - Pipeline options. Pass `{ projectWide: false }` when
@@ -41,6 +52,14 @@ import { buildEffectiveDisciplineRegistry } from "../profile/discipline_registry
41
52
  */
42
53
  export function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
43
54
  const diagnostics = [];
55
+ // Partition per orchestrator (#771): emit loops here iterate
56
+ // `emittable` / `finalEmittable`; resolution maps build from the full
57
+ // lists so upstream entries stay live link targets (ADR-031 §4.7).
58
+ // `validate()` (Stage 1) and `validateTypl` derive their own partitions
59
+ // for their standalone callers — the guarantee is convention plus the
60
+ // upstream-silence anchor test, not a distinct type. A new stage added
61
+ // to this pipeline must loop over the emittable list.
62
+ const emittable = emittableEntries(entries);
44
63
  // Stage 1 — core hygiene. When a profile is loaded, suppress MSL-R010
45
64
  // warnings for attributes the profile actually declares (Stage 3's scope
46
65
  // validates them directly — the core-only R010 check would be noise).
@@ -50,7 +69,7 @@ export function runPipeline(entries, profile, captionConventions = {}, opts = {}
50
69
  // included) so unknown `Type:` values fail fast regardless of profile.
51
70
  // Also covers late-stage display-ID-shape inference (step 8 → MSL-T021)
52
71
  // and caption-adjacency rules (§2.6 → MSL-C070).
53
- for (const entry of entries) {
72
+ for (const entry of emittable) {
54
73
  diagnostics.push(...validateCoreTypeAttribute(entry, profile));
55
74
  diagnostics.push(...inferTypeFromDisplayIdShape(entry));
56
75
  diagnostics.push(...validateCaptions(entry));
@@ -62,8 +81,9 @@ export function runPipeline(entries, profile, captionConventions = {}, opts = {}
62
81
  }
63
82
  // Stage 1.6 — cross-file trace target-type compatibility (MSL-R083).
64
83
  // Runs project-wide because targets may live in any entry; needs the
65
- // whole batch indexed.
66
- diagnostics.push(...validateTraceTargetTypes(entries));
84
+ // whole batch indexed (resolution side) while emitting only from the
85
+ // partition.
86
+ diagnostics.push(...validateTraceTargetTypes(emittable, entries));
67
87
  // Stage 1.7 — discipline attribute validation (ADR-017 Slice 3).
68
88
  // Runs in both core-only and profile modes. In core-only mode the
69
89
  // registry is CORE_DISCIPLINE_REGISTRY (kinds: system/software/hardware
@@ -72,8 +92,10 @@ export function runPipeline(entries, profile, captionConventions = {}, opts = {}
72
92
  ? buildEffectiveDisciplineRegistry(profile)
73
93
  : CORE_DISCIPLINE_REGISTRY;
74
94
  const entriesByDisplayId = new Map(entries.map((e) => [makeDisplayId(e.displayId), e]));
75
- diagnostics.push(...validateDiscipline(entries, entriesByDisplayId, disciplineRegistry));
95
+ diagnostics.push(...validateDiscipline(emittable, entriesByDisplayId, disciplineRegistry));
76
96
  // Stage 2 — classification (only when a profile is loaded).
97
+ // classifyEntriesStage handles upstream itself (pass-through, never
98
+ // re-classified) — it is a transform, not an emit loop; see types.ts.
77
99
  let finalEntries = entries;
78
100
  if (profile !== null) {
79
101
  const stage2 = classifyEntriesStage(entries, profile);
@@ -84,8 +106,10 @@ export function runPipeline(entries, profile, captionConventions = {}, opts = {}
84
106
  // Runs after Stage 2 so that profile-classified `entry.type` suppresses
85
107
  // the warning correctly. In core-only mode `finalEntries === entries`
86
108
  // and `entry.type` is always undefined, so this stage produces the same
87
- // diagnostics regardless of mode.
88
- for (const entry of finalEntries) {
109
+ // diagnostics regardless of mode. Partitions inline: `finalEmittable`
110
+ // below is derived from the post-normalization generation, which does
111
+ // not exist yet at this point.
112
+ for (const entry of emittableEntries(finalEntries)) {
89
113
  diagnostics.push(...inferTypeFromLateStageChain(entry));
90
114
  }
91
115
  // Stage 2.5 — normalize profile-declared list-value attributes. Splits
@@ -94,16 +118,25 @@ export function runPipeline(entries, profile, captionConventions = {}, opts = {}
94
118
  if (profile !== null) {
95
119
  finalEntries = finalEntries.map((e) => normalizeListValues(e, profile));
96
120
  }
97
- // Stage 3 — typed attributes (only when a profile is loaded).
121
+ // Final generation reached — Stages 2 and 2.5 both produced new Entry
122
+ // objects, so the emit partition for Stages 3/4 is derived here, once.
123
+ const finalEmittable = emittableEntries(finalEntries);
124
+ // Stage 3 — typed attributes (only when a profile is loaded). Upstream
125
+ // entries are validation-exempt (design §4.7) — outside the emit
126
+ // partition, but they remain in `finalEntries` for Stage 4's resolution
127
+ // maps below.
98
128
  if (profile !== null) {
99
- for (const entry of finalEntries) {
129
+ for (const entry of finalEmittable) {
100
130
  const stage3 = validateAttributesForEntry(entry, profile);
101
131
  diagnostics.push(...stage3);
102
132
  }
103
133
  }
104
134
  // Stage 4 — traceability rules (only when a profile is loaded). Builds two
105
135
  // indexes: by `entry.id` (ULID) and by `entry.displayId`, so trace values
106
- // resolve in either form (issue #593).
136
+ // resolve in either form (issue #593). Upstream entries MUST stay in both
137
+ // indexes — a project entry's link targeting an upstream entry must still
138
+ // resolve (design §4.7) — so this map-building loop is never filtered.
139
+ const projectWide = opts.projectWide !== false;
107
140
  if (profile !== null) {
108
141
  const graph = new Map();
109
142
  const byDisplayId = new Map();
@@ -113,15 +146,32 @@ export function runPipeline(entries, profile, captionConventions = {}, opts = {}
113
146
  if (!byDisplayId.has(e.displayId))
114
147
  byDisplayId.set(e.displayId, e);
115
148
  }
116
- const projectWide = opts.projectWide !== false;
117
- for (const entry of finalEntries) {
118
- const stage4 = validateTraceabilityForEntry(entry, profile, graph, byDisplayId);
119
- // Suppress MSL-L006 ("link target does not resolve") when running
120
- // file-locally: the checked subset cannot distinguish a typo from a
121
- // valid cross-file target. Only emit when the full entry set is present.
122
- diagnostics.push(...projectWide ? stage4 : stage4.filter((d) => d.code !== "MSL-L006"));
149
+ // Upstream entries are validation-exempt emitters (design §4.7): trace
150
+ // rules FROM an upstream entry are never checked. They remain
151
+ // resolution targets via the maps built above.
152
+ for (const entry of finalEmittable) {
153
+ const stage4 = validateTraceabilityForEntry(entry, profile, graph, byDisplayId, opts.declaredUpstreamIds);
154
+ // Suppress MSL-L006 ("link target does not resolve") and its
155
+ // federated-upstream replacement MSL-T014 when running file-locally:
156
+ // the checked subset cannot distinguish a typo from a valid
157
+ // cross-file/upstream target. Only emit when the full entry set is
158
+ // present.
159
+ diagnostics.push(...projectWide
160
+ ? stage4
161
+ : stage4.filter((d) => d.code !== "MSL-L006" && d.code !== "MSL-T014"));
123
162
  }
124
163
  }
164
+ // Stage 5 — uxil diagnostics family (S9 #727). Inert unless some profile
165
+ // tier designates a declaring type (`declares: ux-surface`). Receives the
166
+ // FULL classified list on purpose: the family derives its own #771
167
+ // partition and its own declaring/citing split — registry scope is the
168
+ // module's contract, not this orchestrator's (mirrors validateTypl).
169
+ // File-local scope (projectWide: false) suppresses the cross-entry codes
170
+ // (UXIL-016/017/018) — a subset registry cannot distinguish a dangling
171
+ // reference from an unchecked file, the same false-positive class the
172
+ // MSL-L006 suppression guards (#727 review).
173
+ const uxilDiagnostics = validateUxilFamily(finalEntries, profile);
174
+ diagnostics.push(...(projectWide ? uxilDiagnostics : uxilDiagnostics.filter((d) => !FILE_LOCAL_SUPPRESSED_UXIL.has(d.code))));
125
175
  const valid = !diagnostics.some((d) => d.severity === "error");
126
176
  return { entries: finalEntries, diagnostics, valid };
127
177
  }
@@ -20,7 +20,14 @@ import type { Diagnostic, Entry } from "../model/mod.js";
20
20
  *
21
21
  * Unresolved targets are silently skipped — they're caught elsewhere
22
22
  * (MSL-R080 / MSL-T012 / MSL-T005). Targets without a resolvable core
23
- * type are also skipped (no compat call to make).
23
+ * type are also skipped (no compat call to make). Upstream TARGETS are
24
+ * exempt from the MSL-R083 type-compat checks (#771) — their type comes
25
+ * from a foreign vocabulary, the target-side twin of #765's MSL-L004 fix.
26
+ *
27
+ * @param emittable The #771 emit partition — trace rules are never
28
+ * checked FROM an upstream entry.
29
+ * @param all The full entry set (upstream included) — resolution maps
30
+ * index it so links TO an upstream entry keep resolving.
24
31
  */
25
- export declare function validateTraceTargetTypes(entries: readonly Entry[]): readonly Diagnostic[];
32
+ export declare function validateTraceTargetTypes(emittable: readonly Entry[], all: readonly Entry[]): readonly Diagnostic[];
26
33
  //# sourceMappingURL=trace_types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trace_types.d.ts","sourceRoot":"","sources":["../../src/validator/trace_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAoFzD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,KAAK,EAAE,GACxB,SAAS,UAAU,EAAE,CAuHvB"}
1
+ {"version":3,"file":"trace_types.d.ts","sourceRoot":"","sources":["../../src/validator/trace_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAwFzD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,KAAK,EAAE,EAC3B,GAAG,EAAE,SAAS,KAAK,EAAE,GACpB,SAAS,UAAU,EAAE,CA8HvB"}
@@ -11,7 +11,7 @@
11
11
  * Unresolved targets are intentionally not flagged here — that is the
12
12
  * job of MSL-R080 / MSL-T012 / MSL-T005 in other passes.
13
13
  */
14
- import { CORE_RELATIONS, CORE_TYPE_HIERARCHY } from "../model/mod.js";
14
+ import { CORE_RELATIONS, CORE_TYPE_HIERARCHY, isUpstreamEntry, } from "../model/mod.js";
15
15
  import { resolvedCoreType } from "./type_resolution.js";
16
16
  const TRACE_RULES = CORE_RELATIONS
17
17
  .filter((r) => r.targetTypes)
@@ -83,19 +83,26 @@ function isTargetTypeCompatible(targetType, allowedTypes) {
83
83
  *
84
84
  * Unresolved targets are silently skipped — they're caught elsewhere
85
85
  * (MSL-R080 / MSL-T012 / MSL-T005). Targets without a resolvable core
86
- * type are also skipped (no compat call to make).
86
+ * type are also skipped (no compat call to make). Upstream TARGETS are
87
+ * exempt from the MSL-R083 type-compat checks (#771) — their type comes
88
+ * from a foreign vocabulary, the target-side twin of #765's MSL-L004 fix.
89
+ *
90
+ * @param emittable The #771 emit partition — trace rules are never
91
+ * checked FROM an upstream entry.
92
+ * @param all The full entry set (upstream included) — resolution maps
93
+ * index it so links TO an upstream entry keep resolving.
87
94
  */
88
- export function validateTraceTargetTypes(entries) {
95
+ export function validateTraceTargetTypes(emittable, all) {
89
96
  const byDisplayId = new Map();
90
97
  const byId = new Map();
91
- for (const e of entries) {
98
+ for (const e of all) {
92
99
  if (!byDisplayId.has(e.displayId))
93
100
  byDisplayId.set(e.displayId, e);
94
101
  if (e.id && !byId.has(e.id))
95
102
  byId.set(e.id, e);
96
103
  }
97
104
  const diagnostics = [];
98
- for (const entry of entries) {
105
+ for (const entry of emittable) {
99
106
  // MSL-R084: Supersedes target must be the same shape as the source.
100
107
  for (const attr of entry.rawAttributes) {
101
108
  if (attr.key !== "Supersedes")
@@ -123,6 +130,11 @@ export function validateTraceTargetTypes(entries) {
123
130
  const resolved = byId.get(target) ?? byDisplayId.get(target);
124
131
  if (!resolved)
125
132
  continue;
133
+ // Target-side exemption (#771, matching #765's MSL-L004 fix): an
134
+ // upstream target's type comes from a foreign vocabulary — never
135
+ // judge core-type compatibility against it.
136
+ if (isUpstreamEntry(resolved))
137
+ continue;
126
138
  const targetType = resolvedCoreType(resolved);
127
139
  if (!targetType)
128
140
  continue;
@@ -158,6 +170,10 @@ export function validateTraceTargetTypes(entries) {
158
170
  const resolved = byId.get(target) ?? byDisplayId.get(target);
159
171
  if (!resolved)
160
172
  continue;
173
+ // Target-side exemption (#771) — same rationale as the
174
+ // TRACE_RULES loop above.
175
+ if (isUpstreamEntry(resolved))
176
+ continue;
161
177
  const targetType = resolvedCoreType(resolved);
162
178
  if (!targetType)
163
179
  continue;
@@ -8,8 +8,13 @@
8
8
  * attributes:
9
9
  * - Required (MSL-L001)
10
10
  * - Cardinality bounds (MSL-L002 upper / MSL-L003 lower)
11
- * - Target match against the rule's target matchers (MSL-L004)
12
- * - Target existence (MSL-L006, warning; scheme-qualified URIs exempt)
11
+ * - Target match against the rule's target matchers (MSL-L004; skipped
12
+ * when the resolved target is an upstream entry — its `type` comes from
13
+ * the upstream's own profile, a vocabulary the consumer never
14
+ * re-classifies against, federated upstream slice 4)
15
+ * - Target existence (MSL-L006, warning; scheme-qualified URIs exempt) —
16
+ * or MSL-T014 (warning) instead of MSL-L006 when the caller declares a
17
+ * non-empty upstream set (federated upstream, slice 4)
13
18
  *
14
19
  * Referenced entries are skipped entirely — the profile manifest parser
15
20
  * rejects `referenced.traceability` at load time, so referenced entries
@@ -45,6 +50,13 @@ export declare function matchesAnyTarget(target: Entry, matchers: readonly Targe
45
50
  * @param graph - Index keyed by entry.id (ULID) for target lookup
46
51
  * @param byDisplayId - Index keyed by entry.displayId for target lookup
47
52
  * (issue #593 — display-ID targets). Defaults to empty.
53
+ * @param declaredUpstreamIds - Upstream ids the downstream project declares
54
+ * via `project.yaml` `dependencies:`/`references:`
55
+ * (federated upstream, slice 4). When non-empty, an
56
+ * otherwise-unresolved trace target fires MSL-T014
57
+ * (warning), naming the searched upstream set, instead
58
+ * of the generic MSL-L006. Defaults to empty — MSL-L006
59
+ * unchanged.
48
60
  */
49
- export declare function validateTraceabilityForEntry(entry: Entry, profile: EffectiveProfile, graph: ReadonlyMap<string, Entry>, byDisplayId?: ReadonlyMap<string, Entry>): Diagnostic[];
61
+ export declare function validateTraceabilityForEntry(entry: Entry, profile: EffectiveProfile, graph: ReadonlyMap<string, Entry>, byDisplayId?: ReadonlyMap<string, Entry>, declaredUpstreamIds?: readonly string[]): Diagnostic[];
50
62
  //# sourceMappingURL=traceability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../src/validator/traceability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAehC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,SAAS,aAAa,EAAE,GACj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