@driftsys/markspec 0.10.3 → 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 (376) 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 +4 -2
  19. package/esm/decl/mod.d.ts.map +1 -1
  20. package/esm/decl/mod.js +2 -1
  21. package/esm/decl/surfaces.d.ts +29 -7
  22. package/esm/decl/surfaces.d.ts.map +1 -1
  23. package/esm/decl/surfaces.js +31 -18
  24. package/esm/gates/mod.d.ts +13 -2
  25. package/esm/gates/mod.d.ts.map +1 -1
  26. package/esm/gates/mod.js +38 -11
  27. package/esm/lint/runner.d.ts.map +1 -1
  28. package/esm/lint/runner.js +3 -1
  29. package/esm/lock/acquire_compile.d.ts +31 -0
  30. package/esm/lock/acquire_compile.d.ts.map +1 -0
  31. package/esm/lock/acquire_compile.js +83 -0
  32. package/esm/lock/cache_check.d.ts +28 -0
  33. package/esm/lock/cache_check.d.ts.map +1 -0
  34. package/esm/lock/cache_check.js +51 -0
  35. package/esm/lock/check.d.ts +14 -3
  36. package/esm/lock/check.d.ts.map +1 -1
  37. package/esm/lock/check.js +41 -3
  38. package/esm/lock/git_intent.d.ts +46 -0
  39. package/esm/lock/git_intent.d.ts.map +1 -0
  40. package/esm/lock/git_intent.js +111 -0
  41. package/esm/lock/mod.d.ts +10 -3
  42. package/esm/lock/mod.d.ts.map +1 -1
  43. package/esm/lock/mod.js +7 -1
  44. package/esm/lock/model.d.ts +24 -1
  45. package/esm/lock/model.d.ts.map +1 -1
  46. package/esm/lock/parser.d.ts.map +1 -1
  47. package/esm/lock/parser.js +32 -0
  48. package/esm/lock/pin_assurance.d.ts +20 -0
  49. package/esm/lock/pin_assurance.d.ts.map +1 -0
  50. package/esm/lock/pin_assurance.js +34 -0
  51. package/esm/lock/resolve.d.ts +8 -17
  52. package/esm/lock/resolve.d.ts.map +1 -1
  53. package/esm/lock/resolve.js +7 -67
  54. package/esm/lock/serializer.d.ts.map +1 -1
  55. package/esm/lock/serializer.js +23 -0
  56. package/esm/lock/upstream_common.d.ts +29 -0
  57. package/esm/lock/upstream_common.d.ts.map +1 -0
  58. package/esm/lock/upstream_common.js +38 -0
  59. package/esm/lock/upstream_deps.d.ts +63 -0
  60. package/esm/lock/upstream_deps.d.ts.map +1 -0
  61. package/esm/lock/upstream_deps.js +172 -0
  62. package/esm/lock/upstream_refs.d.ts +69 -0
  63. package/esm/lock/upstream_refs.d.ts.map +1 -0
  64. package/esm/lock/upstream_refs.js +238 -0
  65. package/esm/mod.d.ts +16 -8
  66. package/esm/mod.d.ts.map +1 -1
  67. package/esm/mod.js +15 -5
  68. package/esm/model/mod.d.ts +93 -28
  69. package/esm/model/mod.d.ts.map +1 -1
  70. package/esm/model/mod.js +66 -13
  71. package/esm/model/profile.d.ts +13 -0
  72. package/esm/model/profile.d.ts.map +1 -1
  73. package/esm/parser/markdown.d.ts.map +1 -1
  74. package/esm/parser/markdown.js +7 -51
  75. package/esm/profile/manifest.d.ts.map +1 -1
  76. package/esm/profile/manifest.js +20 -3
  77. package/esm/profile/merge.js +7 -0
  78. package/esm/reporter/mod.d.ts +11 -0
  79. package/esm/reporter/mod.d.ts.map +1 -1
  80. package/esm/reporter/mod.js +19 -8
  81. package/esm/typl/assemble.d.ts +53 -0
  82. package/esm/typl/assemble.d.ts.map +1 -0
  83. package/esm/typl/assemble.js +238 -0
  84. package/esm/typl/ast.d.ts +7 -1
  85. package/esm/typl/ast.d.ts.map +1 -1
  86. package/esm/typl/ast.js +3 -0
  87. package/esm/typl/bullet.d.ts +9 -7
  88. package/esm/typl/bullet.d.ts.map +1 -1
  89. package/esm/typl/bullet.js +6 -4
  90. package/esm/typl/citations.d.ts +27 -0
  91. package/esm/typl/citations.d.ts.map +1 -0
  92. package/esm/typl/citations.js +16 -0
  93. package/esm/typl/diagnostics.d.ts +2 -2
  94. package/esm/typl/diagnostics.d.ts.map +1 -1
  95. package/esm/typl/diagnostics.js +18 -0
  96. package/esm/typl/grammar.d.ts.map +1 -1
  97. package/esm/typl/grammar.js +6 -0
  98. package/esm/typl/lexer.d.ts.map +1 -1
  99. package/esm/typl/lexer.js +25 -4
  100. package/esm/typl/mod.d.ts +8 -2
  101. package/esm/typl/mod.d.ts.map +1 -1
  102. package/esm/typl/mod.js +5 -1
  103. package/esm/typl/recognize.js +2 -2
  104. package/esm/typl/registry.d.ts +1 -1
  105. package/esm/typl/resolve.d.ts +31 -0
  106. package/esm/typl/resolve.d.ts.map +1 -0
  107. package/esm/typl/resolve.js +27 -0
  108. package/esm/typl/table.d.ts +52 -0
  109. package/esm/typl/table.d.ts.map +1 -0
  110. package/esm/typl/table.js +69 -0
  111. package/esm/typl/validator.d.ts +24 -5
  112. package/esm/typl/validator.d.ts.map +1 -1
  113. package/esm/typl/validator.js +55 -75
  114. package/esm/upstream/mod.d.ts +45 -0
  115. package/esm/upstream/mod.d.ts.map +1 -0
  116. package/esm/upstream/mod.js +98 -0
  117. package/esm/upstream/project.d.ts +33 -0
  118. package/esm/upstream/project.d.ts.map +1 -0
  119. package/esm/upstream/project.js +38 -0
  120. package/esm/upstream/refs.d.ts +23 -0
  121. package/esm/upstream/refs.d.ts.map +1 -0
  122. package/esm/upstream/refs.js +71 -0
  123. package/esm/util/paths.d.ts +14 -0
  124. package/esm/util/paths.d.ts.map +1 -0
  125. package/esm/util/paths.js +22 -0
  126. package/esm/uxil/assemble.d.ts +38 -0
  127. package/esm/uxil/assemble.d.ts.map +1 -0
  128. package/esm/uxil/assemble.js +268 -0
  129. package/esm/uxil/ast.d.ts +63 -0
  130. package/esm/uxil/ast.d.ts.map +1 -0
  131. package/esm/uxil/ast.js +9 -0
  132. package/esm/uxil/citations.d.ts +27 -0
  133. package/esm/uxil/citations.d.ts.map +1 -0
  134. package/esm/uxil/citations.js +25 -0
  135. package/esm/uxil/diagnostics.d.ts +39 -0
  136. package/esm/uxil/diagnostics.d.ts.map +1 -0
  137. package/esm/uxil/diagnostics.js +135 -0
  138. package/esm/uxil/grammar.d.ts +72 -0
  139. package/esm/uxil/grammar.d.ts.map +1 -0
  140. package/esm/uxil/grammar.js +505 -0
  141. package/esm/uxil/lexer.d.ts +23 -0
  142. package/esm/uxil/lexer.d.ts.map +1 -0
  143. package/esm/uxil/lexer.js +58 -0
  144. package/esm/uxil/mod.d.ts +32 -0
  145. package/esm/uxil/mod.d.ts.map +1 -0
  146. package/esm/uxil/mod.js +11 -0
  147. package/esm/uxil/projection.d.ts +40 -0
  148. package/esm/uxil/projection.d.ts.map +1 -0
  149. package/esm/uxil/projection.js +41 -0
  150. package/esm/uxil/recognize.d.ts +16 -0
  151. package/esm/uxil/recognize.d.ts.map +1 -0
  152. package/esm/uxil/recognize.js +28 -0
  153. package/esm/uxil/registry.d.ts +37 -0
  154. package/esm/uxil/registry.d.ts.map +1 -0
  155. package/esm/uxil/registry.js +29 -0
  156. package/esm/uxil/surfaces.d.ts +36 -0
  157. package/esm/uxil/surfaces.d.ts.map +1 -0
  158. package/esm/uxil/surfaces.js +34 -0
  159. package/esm/uxil/validator.d.ts +36 -0
  160. package/esm/uxil/validator.d.ts.map +1 -0
  161. package/esm/uxil/validator.js +139 -0
  162. package/esm/uxil/vocab.d.ts +33 -0
  163. package/esm/uxil/vocab.d.ts.map +1 -0
  164. package/esm/uxil/vocab.js +36 -0
  165. package/esm/validator/caption_convention.d.ts +2 -1
  166. package/esm/validator/caption_convention.d.ts.map +1 -1
  167. package/esm/validator/caption_convention.js +2 -1
  168. package/esm/validator/corpus.d.ts.map +1 -1
  169. package/esm/validator/corpus.js +40 -17
  170. package/esm/validator/discipline.d.ts +6 -4
  171. package/esm/validator/discipline.d.ts.map +1 -1
  172. package/esm/validator/discipline.js +6 -4
  173. package/esm/validator/mod.d.ts.map +1 -1
  174. package/esm/validator/mod.js +28 -15
  175. package/esm/validator/pipeline.d.ts +11 -1
  176. package/esm/validator/pipeline.d.ts.map +1 -1
  177. package/esm/validator/pipeline.js +68 -18
  178. package/esm/validator/trace_types.d.ts +9 -2
  179. package/esm/validator/trace_types.d.ts.map +1 -1
  180. package/esm/validator/trace_types.js +21 -5
  181. package/esm/validator/traceability.d.ts +15 -3
  182. package/esm/validator/traceability.d.ts.map +1 -1
  183. package/esm/validator/traceability.js +39 -4
  184. package/esm/validator/types.d.ts.map +1 -1
  185. package/esm/validator/types.js +11 -1
  186. package/esm/validator/uxil_family.d.ts +43 -0
  187. package/esm/validator/uxil_family.d.ts.map +1 -0
  188. package/esm/validator/uxil_family.js +52 -0
  189. package/package.json +1 -1
  190. package/script/compiler/deserialize.d.ts +49 -0
  191. package/script/compiler/deserialize.d.ts.map +1 -0
  192. package/script/compiler/deserialize.js +144 -0
  193. package/script/compiler/manifest.d.ts +3 -0
  194. package/script/compiler/manifest.d.ts.map +1 -1
  195. package/script/compiler/manifest.js +10 -3
  196. package/script/compiler/mod.d.ts.map +1 -1
  197. package/script/compiler/mod.js +15 -6
  198. package/script/config/markspec.d.ts +38 -1
  199. package/script/config/markspec.d.ts.map +1 -1
  200. package/script/config/markspec.js +129 -3
  201. package/script/config/mod.d.ts.map +1 -1
  202. package/script/config/mod.js +143 -147
  203. package/script/decl/duplicates.d.ts +29 -0
  204. package/script/decl/duplicates.d.ts.map +1 -0
  205. package/script/decl/duplicates.js +31 -0
  206. package/script/decl/mod.d.ts +4 -2
  207. package/script/decl/mod.d.ts.map +1 -1
  208. package/script/decl/mod.js +4 -2
  209. package/script/decl/surfaces.d.ts +29 -7
  210. package/script/decl/surfaces.d.ts.map +1 -1
  211. package/script/decl/surfaces.js +32 -19
  212. package/script/gates/mod.d.ts +13 -2
  213. package/script/gates/mod.d.ts.map +1 -1
  214. package/script/gates/mod.js +37 -10
  215. package/script/lint/runner.d.ts.map +1 -1
  216. package/script/lint/runner.js +3 -1
  217. package/script/lock/acquire_compile.d.ts +31 -0
  218. package/script/lock/acquire_compile.d.ts.map +1 -0
  219. package/script/lock/acquire_compile.js +86 -0
  220. package/script/lock/cache_check.d.ts +28 -0
  221. package/script/lock/cache_check.d.ts.map +1 -0
  222. package/script/lock/cache_check.js +54 -0
  223. package/script/lock/check.d.ts +14 -3
  224. package/script/lock/check.d.ts.map +1 -1
  225. package/script/lock/check.js +41 -3
  226. package/script/lock/git_intent.d.ts +46 -0
  227. package/script/lock/git_intent.d.ts.map +1 -0
  228. package/script/lock/git_intent.js +115 -0
  229. package/script/lock/mod.d.ts +10 -3
  230. package/script/lock/mod.d.ts.map +1 -1
  231. package/script/lock/mod.js +16 -2
  232. package/script/lock/model.d.ts +24 -1
  233. package/script/lock/model.d.ts.map +1 -1
  234. package/script/lock/parser.d.ts.map +1 -1
  235. package/script/lock/parser.js +32 -0
  236. package/script/lock/pin_assurance.d.ts +20 -0
  237. package/script/lock/pin_assurance.d.ts.map +1 -0
  238. package/script/lock/pin_assurance.js +37 -0
  239. package/script/lock/resolve.d.ts +8 -17
  240. package/script/lock/resolve.d.ts.map +1 -1
  241. package/script/lock/resolve.js +7 -68
  242. package/script/lock/serializer.d.ts.map +1 -1
  243. package/script/lock/serializer.js +23 -0
  244. package/script/lock/upstream_common.d.ts +29 -0
  245. package/script/lock/upstream_common.d.ts.map +1 -0
  246. package/script/lock/upstream_common.js +42 -0
  247. package/script/lock/upstream_deps.d.ts +63 -0
  248. package/script/lock/upstream_deps.d.ts.map +1 -0
  249. package/script/lock/upstream_deps.js +175 -0
  250. package/script/lock/upstream_refs.d.ts +69 -0
  251. package/script/lock/upstream_refs.d.ts.map +1 -0
  252. package/script/lock/upstream_refs.js +244 -0
  253. package/script/mod.d.ts +16 -8
  254. package/script/mod.d.ts.map +1 -1
  255. package/script/mod.js +40 -7
  256. package/script/model/mod.d.ts +93 -28
  257. package/script/model/mod.d.ts.map +1 -1
  258. package/script/model/mod.js +70 -14
  259. package/script/model/profile.d.ts +13 -0
  260. package/script/model/profile.d.ts.map +1 -1
  261. package/script/parser/markdown.d.ts.map +1 -1
  262. package/script/parser/markdown.js +6 -50
  263. package/script/profile/manifest.d.ts.map +1 -1
  264. package/script/profile/manifest.js +20 -3
  265. package/script/profile/merge.js +7 -0
  266. package/script/reporter/mod.d.ts +11 -0
  267. package/script/reporter/mod.d.ts.map +1 -1
  268. package/script/reporter/mod.js +18 -7
  269. package/script/typl/assemble.d.ts +53 -0
  270. package/script/typl/assemble.d.ts.map +1 -0
  271. package/script/typl/assemble.js +241 -0
  272. package/script/typl/ast.d.ts +7 -1
  273. package/script/typl/ast.d.ts.map +1 -1
  274. package/script/typl/ast.js +3 -0
  275. package/script/typl/bullet.d.ts +9 -7
  276. package/script/typl/bullet.d.ts.map +1 -1
  277. package/script/typl/bullet.js +6 -4
  278. package/script/typl/citations.d.ts +27 -0
  279. package/script/typl/citations.d.ts.map +1 -0
  280. package/script/typl/citations.js +20 -0
  281. package/script/typl/diagnostics.d.ts +2 -2
  282. package/script/typl/diagnostics.d.ts.map +1 -1
  283. package/script/typl/diagnostics.js +18 -0
  284. package/script/typl/grammar.d.ts.map +1 -1
  285. package/script/typl/grammar.js +6 -0
  286. package/script/typl/lexer.d.ts.map +1 -1
  287. package/script/typl/lexer.js +25 -4
  288. package/script/typl/mod.d.ts +8 -2
  289. package/script/typl/mod.d.ts.map +1 -1
  290. package/script/typl/mod.js +14 -2
  291. package/script/typl/recognize.js +2 -2
  292. package/script/typl/registry.d.ts +1 -1
  293. package/script/typl/resolve.d.ts +31 -0
  294. package/script/typl/resolve.d.ts.map +1 -0
  295. package/script/typl/resolve.js +33 -0
  296. package/script/typl/table.d.ts +52 -0
  297. package/script/typl/table.d.ts.map +1 -0
  298. package/script/typl/table.js +75 -0
  299. package/script/typl/validator.d.ts +24 -5
  300. package/script/typl/validator.d.ts.map +1 -1
  301. package/script/typl/validator.js +55 -75
  302. package/script/upstream/mod.d.ts +45 -0
  303. package/script/upstream/mod.d.ts.map +1 -0
  304. package/script/upstream/mod.js +101 -0
  305. package/script/upstream/project.d.ts +33 -0
  306. package/script/upstream/project.d.ts.map +1 -0
  307. package/script/upstream/project.js +41 -0
  308. package/script/upstream/refs.d.ts +23 -0
  309. package/script/upstream/refs.d.ts.map +1 -0
  310. package/script/upstream/refs.js +74 -0
  311. package/script/util/paths.d.ts +14 -0
  312. package/script/util/paths.d.ts.map +1 -0
  313. package/script/util/paths.js +25 -0
  314. package/script/uxil/assemble.d.ts +38 -0
  315. package/script/uxil/assemble.d.ts.map +1 -0
  316. package/script/uxil/assemble.js +272 -0
  317. package/script/uxil/ast.d.ts +63 -0
  318. package/script/uxil/ast.d.ts.map +1 -0
  319. package/script/uxil/ast.js +10 -0
  320. package/script/uxil/citations.d.ts +27 -0
  321. package/script/uxil/citations.d.ts.map +1 -0
  322. package/script/uxil/citations.js +29 -0
  323. package/script/uxil/diagnostics.d.ts +39 -0
  324. package/script/uxil/diagnostics.d.ts.map +1 -0
  325. package/script/uxil/diagnostics.js +140 -0
  326. package/script/uxil/grammar.d.ts +72 -0
  327. package/script/uxil/grammar.d.ts.map +1 -0
  328. package/script/uxil/grammar.js +511 -0
  329. package/script/uxil/lexer.d.ts +23 -0
  330. package/script/uxil/lexer.d.ts.map +1 -0
  331. package/script/uxil/lexer.js +61 -0
  332. package/script/uxil/mod.d.ts +32 -0
  333. package/script/uxil/mod.d.ts.map +1 -0
  334. package/script/uxil/mod.js +37 -0
  335. package/script/uxil/projection.d.ts +40 -0
  336. package/script/uxil/projection.d.ts.map +1 -0
  337. package/script/uxil/projection.js +44 -0
  338. package/script/uxil/recognize.d.ts +16 -0
  339. package/script/uxil/recognize.d.ts.map +1 -0
  340. package/script/uxil/recognize.js +31 -0
  341. package/script/uxil/registry.d.ts +37 -0
  342. package/script/uxil/registry.d.ts.map +1 -0
  343. package/script/uxil/registry.js +32 -0
  344. package/script/uxil/surfaces.d.ts +36 -0
  345. package/script/uxil/surfaces.d.ts.map +1 -0
  346. package/script/uxil/surfaces.js +39 -0
  347. package/script/uxil/validator.d.ts +36 -0
  348. package/script/uxil/validator.d.ts.map +1 -0
  349. package/script/uxil/validator.js +142 -0
  350. package/script/uxil/vocab.d.ts +33 -0
  351. package/script/uxil/vocab.d.ts.map +1 -0
  352. package/script/uxil/vocab.js +41 -0
  353. package/script/validator/caption_convention.d.ts +2 -1
  354. package/script/validator/caption_convention.d.ts.map +1 -1
  355. package/script/validator/caption_convention.js +2 -1
  356. package/script/validator/corpus.d.ts.map +1 -1
  357. package/script/validator/corpus.js +39 -16
  358. package/script/validator/discipline.d.ts +6 -4
  359. package/script/validator/discipline.d.ts.map +1 -1
  360. package/script/validator/discipline.js +6 -4
  361. package/script/validator/mod.d.ts.map +1 -1
  362. package/script/validator/mod.js +27 -14
  363. package/script/validator/pipeline.d.ts +11 -1
  364. package/script/validator/pipeline.d.ts.map +1 -1
  365. package/script/validator/pipeline.js +67 -17
  366. package/script/validator/trace_types.d.ts +9 -2
  367. package/script/validator/trace_types.d.ts.map +1 -1
  368. package/script/validator/trace_types.js +20 -4
  369. package/script/validator/traceability.d.ts +15 -3
  370. package/script/validator/traceability.d.ts.map +1 -1
  371. package/script/validator/traceability.js +38 -3
  372. package/script/validator/types.d.ts.map +1 -1
  373. package/script/validator/types.js +10 -0
  374. package/script/validator/uxil_family.d.ts +43 -0
  375. package/script/validator/uxil_family.d.ts.map +1 -0
  376. package/script/validator/uxil_family.js +56 -0
@@ -18,6 +18,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.detectCorpusCollisions = detectCorpusCollisions;
19
19
  exports.attributeCorpusDiagnostics = attributeCorpusDiagnostics;
20
20
  const mod_js_1 = require("../model/mod.js");
21
+ /**
22
+ * Remedy clause for an inter-tier MSL-R014 collision — both owners
23
+ * carry an origin (upstream and/or delivered profile), so the consumer
24
+ * reading the diagnostic can rename NEITHER read-only entry (#771; the
25
+ * #799 review extended this from the upstream↔upstream case to every
26
+ * origin pairing). The remedy names the actions a consumer CAN take.
27
+ * Same-source duplicates never reach this clause (excluded via
28
+ * `sameOriginSource` — that is the delivering author's own bug, kept on
29
+ * the generic duplicate codes), and project↔origin collisions keep the
30
+ * "rename this entry" wording above (the project entry is the
31
+ * consumer's own).
32
+ */
33
+ const INTER_TIER_REMEDY = "a consumer cannot rename either read-only entry; drop one of the " +
34
+ "colliding sources (a delivered profile in .markspec.yaml, an upstream " +
35
+ "in project.yaml) or coordinate a rename with its author";
21
36
  /** Generic duplicate detectors superseded by MSL-R014 for corpus collisions. */
22
37
  const GENERIC_DUP_CODES = new Set([
23
38
  "MSL-R005",
@@ -50,9 +65,9 @@ function detectCorpusCollisions(allEntries) {
50
65
  diagnostics.push({
51
66
  code: "MSL-R014",
52
67
  severity: "error",
53
- message: `display ID '${e.displayId}' is already delivered by ` +
68
+ message: `display ID '${e.displayId}' is already provided by ` +
54
69
  `${(0, mod_js_1.formatEntryOrigin)(displayOwner.origin)}; rename this entry — ` +
55
- `delivered corpus entries are read-only`,
70
+ `upstream and delivered-corpus entries are read-only`,
56
71
  location: e.location,
57
72
  });
58
73
  }
@@ -63,9 +78,9 @@ function detectCorpusCollisions(allEntries) {
63
78
  diagnostics.push({
64
79
  code: "MSL-R014",
65
80
  severity: "error",
66
- message: `Id '${e.id}' is already delivered by ` +
81
+ message: `Id '${e.id}' is already provided by ` +
67
82
  `${(0, mod_js_1.formatEntryOrigin)(idOwner.origin)}; rename this entry — ` +
68
- `delivered corpus entries are read-only`,
83
+ `upstream and delivered-corpus entries are read-only`,
69
84
  location: e.location,
70
85
  });
71
86
  }
@@ -79,28 +94,30 @@ function detectCorpusCollisions(allEntries) {
79
94
  // violation, and stays on the generic duplicate codes.
80
95
  const displayOwner = corpusByDisplayId.get(e.displayId);
81
96
  if (displayOwner !== e && displayOwner &&
82
- displayOwner.origin.profileId !== e.origin.profileId) {
97
+ !(0, mod_js_1.sameOriginSource)(displayOwner.origin, e.origin)) {
83
98
  collided.add(e.displayId);
84
99
  diagnostics.push({
85
100
  code: "MSL-R014",
86
101
  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`,
102
+ message: `display ID '${e.displayId}' is provided by both ` +
103
+ `${(0, mod_js_1.formatEntryOrigin)(displayOwner.origin)} and ` +
104
+ `${(0, mod_js_1.formatEntryOrigin)(e.origin)} — ` +
105
+ INTER_TIER_REMEDY,
90
106
  location: e.location,
91
107
  });
92
108
  }
93
109
  if (e.id) {
94
110
  const idOwner = corpusById.get(e.id);
95
111
  if (idOwner !== e && idOwner &&
96
- idOwner.origin.profileId !== e.origin.profileId) {
112
+ !(0, mod_js_1.sameOriginSource)(idOwner.origin, e.origin)) {
97
113
  collided.add(e.id);
98
114
  diagnostics.push({
99
115
  code: "MSL-R014",
100
116
  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`,
117
+ message: `Id '${e.id}' is provided by both ` +
118
+ `${(0, mod_js_1.formatEntryOrigin)(idOwner.origin)} and ` +
119
+ `${(0, mod_js_1.formatEntryOrigin)(e.origin)} — ` +
120
+ INTER_TIER_REMEDY,
104
121
  location: e.location,
105
122
  });
106
123
  }
@@ -112,7 +129,7 @@ function attributeCorpusDiagnostics(diagnostics, allEntries, collidedTokens) {
112
129
  const corpusFiles = new Map();
113
130
  for (const e of allEntries) {
114
131
  if (e.origin) {
115
- corpusFiles.set(e.location.file, (0, mod_js_1.formatEntryOrigin)(e.origin));
132
+ corpusFiles.set(e.location.file, e.origin);
116
133
  }
117
134
  }
118
135
  const out = [];
@@ -129,12 +146,18 @@ function attributeCorpusDiagnostics(diagnostics, allEntries, collidedTokens) {
129
146
  [...collidedTokens].some((t) => d.message.includes(`'${t}'`))) {
130
147
  continue;
131
148
  }
132
- const label = d.location ? corpusFiles.get(d.location.file) : undefined;
133
- if (label !== undefined) {
149
+ const origin = d.location ? corpusFiles.get(d.location.file) : undefined;
150
+ if (origin !== undefined) {
151
+ // Attribution verb follows the origin tier (#771): "delivered by"
152
+ // is ADR-030 profile-corpus language; a finding located in a
153
+ // hydrated upstream snapshot reads "from upstream" instead.
154
+ const verb = origin.kind === "upstream"
155
+ ? "from upstream"
156
+ : "delivered by";
134
157
  out.push({
135
158
  ...d,
136
159
  severity: d.severity === "error" ? "warning" : d.severity,
137
- message: `delivered by ${label}: ${d.message}`,
160
+ message: `${verb} ${(0, mod_js_1.formatEntryOrigin)(origin)}: ${d.message}`,
138
161
  });
139
162
  continue;
140
163
  }
@@ -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.
@@ -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,EAAE,SAAS,KAAK,EAAE,GAAG,cAAc,CAclE;AA2aD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,KAAK,EAAE,GACxB,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAM5B;AAGD,wBAAgB,QAAQ,CACtB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,GAAG,EAAE,MAAM,GACV,SAAS,GAAG,SAAS,CAEvB;AAED,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/validator/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAsCpE,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,cAAc,CAuBlE;AAibD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,KAAK,EAAE,GACxB,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAM5B;AAGD,wBAAgB,QAAQ,CACtB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,GAAG,EAAE,MAAM,GACV,SAAS,GAAG,SAAS,CAEvB;AAED,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -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.
@@ -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,CA0GhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CASvB"}
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;AAqCzB,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;IAE/B;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;GAiBG;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,CA2JhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CASvB"}
@@ -26,6 +26,16 @@ const feature_ac_js_1 = require("./feature_ac.js");
26
26
  const caption_convention_js_1 = require("./caption_convention.js");
27
27
  const discipline_js_1 = require("./discipline.js");
28
28
  const discipline_registry_js_1 = require("../profile/discipline_registry.js");
29
+ const uxil_family_js_1 = require("./uxil_family.js");
30
+ /** Cross-entry uxil codes suppressed under file-local scope (#727): a
31
+ * subset registry cannot distinguish a dangling reference from an
32
+ * unchecked file — the same false-positive class the MSL-L006 filter
33
+ * guards. Entry-local UXIL codes are unaffected. */
34
+ const FILE_LOCAL_SUPPRESSED_UXIL = new Set([
35
+ "UXIL-016",
36
+ "UXIL-017",
37
+ "UXIL-018",
38
+ ]);
29
39
  /**
30
40
  * Run the validator pipeline.
31
41
  *
@@ -37,7 +47,8 @@ const discipline_registry_js_1 = require("../profile/discipline_registry.js");
37
47
  * assignments).
38
48
  *
39
49
  * @param captionConventions - Optional project-configured caption-position
40
- * conventions (from `ProjectConfig.captionConventions`). When supplied
50
+ * conventions (from `.markspec.yaml` `caption-conventions:`, via
51
+ * `ToolConfig.captionConventions`). When supplied
41
52
  * and non-empty, MSL-C072 is checked for each entry. Defaults to no
42
53
  * conventions (rule inactive).
43
54
  * @param opts - Pipeline options. Pass `{ projectWide: false }` when
@@ -45,6 +56,14 @@ const discipline_registry_js_1 = require("../profile/discipline_registry.js");
45
56
  */
46
57
  function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
47
58
  const diagnostics = [];
59
+ // Partition per orchestrator (#771): emit loops here iterate
60
+ // `emittable` / `finalEmittable`; resolution maps build from the full
61
+ // lists so upstream entries stay live link targets (ADR-031 §4.7).
62
+ // `validate()` (Stage 1) and `validateTypl` derive their own partitions
63
+ // for their standalone callers — the guarantee is convention plus the
64
+ // upstream-silence anchor test, not a distinct type. A new stage added
65
+ // to this pipeline must loop over the emittable list.
66
+ const emittable = (0, mod_js_1.emittableEntries)(entries);
48
67
  // Stage 1 — core hygiene. When a profile is loaded, suppress MSL-R010
49
68
  // warnings for attributes the profile actually declares (Stage 3's scope
50
69
  // validates them directly — the core-only R010 check would be noise).
@@ -54,7 +73,7 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
54
73
  // included) so unknown `Type:` values fail fast regardless of profile.
55
74
  // Also covers late-stage display-ID-shape inference (step 8 → MSL-T021)
56
75
  // and caption-adjacency rules (§2.6 → MSL-C070).
57
- for (const entry of entries) {
76
+ for (const entry of emittable) {
58
77
  diagnostics.push(...(0, types_js_1.validateCoreTypeAttribute)(entry, profile));
59
78
  diagnostics.push(...(0, types_js_1.inferTypeFromDisplayIdShape)(entry));
60
79
  diagnostics.push(...(0, captions_js_1.validateCaptions)(entry));
@@ -66,8 +85,9 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
66
85
  }
67
86
  // Stage 1.6 — cross-file trace target-type compatibility (MSL-R083).
68
87
  // Runs project-wide because targets may live in any entry; needs the
69
- // whole batch indexed.
70
- diagnostics.push(...(0, trace_types_js_1.validateTraceTargetTypes)(entries));
88
+ // whole batch indexed (resolution side) while emitting only from the
89
+ // partition.
90
+ diagnostics.push(...(0, trace_types_js_1.validateTraceTargetTypes)(emittable, entries));
71
91
  // Stage 1.7 — discipline attribute validation (ADR-017 Slice 3).
72
92
  // Runs in both core-only and profile modes. In core-only mode the
73
93
  // registry is CORE_DISCIPLINE_REGISTRY (kinds: system/software/hardware
@@ -76,8 +96,10 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
76
96
  ? (0, discipline_registry_js_1.buildEffectiveDisciplineRegistry)(profile)
77
97
  : mod_js_1.CORE_DISCIPLINE_REGISTRY;
78
98
  const entriesByDisplayId = new Map(entries.map((e) => [(0, mod_js_1.makeDisplayId)(e.displayId), e]));
79
- diagnostics.push(...(0, discipline_js_1.validateDiscipline)(entries, entriesByDisplayId, disciplineRegistry));
99
+ diagnostics.push(...(0, discipline_js_1.validateDiscipline)(emittable, entriesByDisplayId, disciplineRegistry));
80
100
  // Stage 2 — classification (only when a profile is loaded).
101
+ // classifyEntriesStage handles upstream itself (pass-through, never
102
+ // re-classified) — it is a transform, not an emit loop; see types.ts.
81
103
  let finalEntries = entries;
82
104
  if (profile !== null) {
83
105
  const stage2 = (0, types_js_1.classifyEntriesStage)(entries, profile);
@@ -88,8 +110,10 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
88
110
  // Runs after Stage 2 so that profile-classified `entry.type` suppresses
89
111
  // the warning correctly. In core-only mode `finalEntries === entries`
90
112
  // and `entry.type` is always undefined, so this stage produces the same
91
- // diagnostics regardless of mode.
92
- for (const entry of finalEntries) {
113
+ // diagnostics regardless of mode. Partitions inline: `finalEmittable`
114
+ // below is derived from the post-normalization generation, which does
115
+ // not exist yet at this point.
116
+ for (const entry of (0, mod_js_1.emittableEntries)(finalEntries)) {
93
117
  diagnostics.push(...(0, types_js_1.inferTypeFromLateStageChain)(entry));
94
118
  }
95
119
  // Stage 2.5 — normalize profile-declared list-value attributes. Splits
@@ -98,16 +122,25 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
98
122
  if (profile !== null) {
99
123
  finalEntries = finalEntries.map((e) => (0, normalize_js_1.normalizeListValues)(e, profile));
100
124
  }
101
- // Stage 3 — typed attributes (only when a profile is loaded).
125
+ // Final generation reached — Stages 2 and 2.5 both produced new Entry
126
+ // objects, so the emit partition for Stages 3/4 is derived here, once.
127
+ const finalEmittable = (0, mod_js_1.emittableEntries)(finalEntries);
128
+ // Stage 3 — typed attributes (only when a profile is loaded). Upstream
129
+ // entries are validation-exempt (design §4.7) — outside the emit
130
+ // partition, but they remain in `finalEntries` for Stage 4's resolution
131
+ // maps below.
102
132
  if (profile !== null) {
103
- for (const entry of finalEntries) {
133
+ for (const entry of finalEmittable) {
104
134
  const stage3 = (0, attributes_js_1.validateAttributesForEntry)(entry, profile);
105
135
  diagnostics.push(...stage3);
106
136
  }
107
137
  }
108
138
  // Stage 4 — traceability rules (only when a profile is loaded). Builds two
109
139
  // indexes: by `entry.id` (ULID) and by `entry.displayId`, so trace values
110
- // resolve in either form (issue #593).
140
+ // resolve in either form (issue #593). Upstream entries MUST stay in both
141
+ // indexes — a project entry's link targeting an upstream entry must still
142
+ // resolve (design §4.7) — so this map-building loop is never filtered.
143
+ const projectWide = opts.projectWide !== false;
111
144
  if (profile !== null) {
112
145
  const graph = new Map();
113
146
  const byDisplayId = new Map();
@@ -117,15 +150,32 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
117
150
  if (!byDisplayId.has(e.displayId))
118
151
  byDisplayId.set(e.displayId, e);
119
152
  }
120
- const projectWide = opts.projectWide !== false;
121
- for (const entry of finalEntries) {
122
- const stage4 = (0, traceability_js_1.validateTraceabilityForEntry)(entry, profile, graph, byDisplayId);
123
- // Suppress MSL-L006 ("link target does not resolve") when running
124
- // file-locally: the checked subset cannot distinguish a typo from a
125
- // valid cross-file target. Only emit when the full entry set is present.
126
- diagnostics.push(...projectWide ? stage4 : stage4.filter((d) => d.code !== "MSL-L006"));
153
+ // Upstream entries are validation-exempt emitters (design §4.7): trace
154
+ // rules FROM an upstream entry are never checked. They remain
155
+ // resolution targets via the maps built above.
156
+ for (const entry of finalEmittable) {
157
+ const stage4 = (0, traceability_js_1.validateTraceabilityForEntry)(entry, profile, graph, byDisplayId, opts.declaredUpstreamIds);
158
+ // Suppress MSL-L006 ("link target does not resolve") and its
159
+ // federated-upstream replacement MSL-T014 when running file-locally:
160
+ // the checked subset cannot distinguish a typo from a valid
161
+ // cross-file/upstream target. Only emit when the full entry set is
162
+ // present.
163
+ diagnostics.push(...projectWide
164
+ ? stage4
165
+ : stage4.filter((d) => d.code !== "MSL-L006" && d.code !== "MSL-T014"));
127
166
  }
128
167
  }
168
+ // Stage 5 — uxil diagnostics family (S9 #727). Inert unless some profile
169
+ // tier designates a declaring type (`declares: ux-surface`). Receives the
170
+ // FULL classified list on purpose: the family derives its own #771
171
+ // partition and its own declaring/citing split — registry scope is the
172
+ // module's contract, not this orchestrator's (mirrors validateTypl).
173
+ // File-local scope (projectWide: false) suppresses the cross-entry codes
174
+ // (UXIL-016/017/018) — a subset registry cannot distinguish a dangling
175
+ // reference from an unchecked file, the same false-positive class the
176
+ // MSL-L006 suppression guards (#727 review).
177
+ const uxilDiagnostics = (0, uxil_family_js_1.validateUxilFamily)(finalEntries, profile);
178
+ diagnostics.push(...(projectWide ? uxilDiagnostics : uxilDiagnostics.filter((d) => !FILE_LOCAL_SUPPRESSED_UXIL.has(d.code))));
129
179
  const valid = !diagnostics.some((d) => d.severity === "error");
130
180
  return { entries: finalEntries, diagnostics, valid };
131
181
  }
@@ -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"}
@@ -86,19 +86,26 @@ function isTargetTypeCompatible(targetType, allowedTypes) {
86
86
  *
87
87
  * Unresolved targets are silently skipped — they're caught elsewhere
88
88
  * (MSL-R080 / MSL-T012 / MSL-T005). Targets without a resolvable core
89
- * type are also skipped (no compat call to make).
89
+ * type are also skipped (no compat call to make). Upstream TARGETS are
90
+ * exempt from the MSL-R083 type-compat checks (#771) — their type comes
91
+ * from a foreign vocabulary, the target-side twin of #765's MSL-L004 fix.
92
+ *
93
+ * @param emittable The #771 emit partition — trace rules are never
94
+ * checked FROM an upstream entry.
95
+ * @param all The full entry set (upstream included) — resolution maps
96
+ * index it so links TO an upstream entry keep resolving.
90
97
  */
91
- function validateTraceTargetTypes(entries) {
98
+ function validateTraceTargetTypes(emittable, all) {
92
99
  const byDisplayId = new Map();
93
100
  const byId = new Map();
94
- for (const e of entries) {
101
+ for (const e of all) {
95
102
  if (!byDisplayId.has(e.displayId))
96
103
  byDisplayId.set(e.displayId, e);
97
104
  if (e.id && !byId.has(e.id))
98
105
  byId.set(e.id, e);
99
106
  }
100
107
  const diagnostics = [];
101
- for (const entry of entries) {
108
+ for (const entry of emittable) {
102
109
  // MSL-R084: Supersedes target must be the same shape as the source.
103
110
  for (const attr of entry.rawAttributes) {
104
111
  if (attr.key !== "Supersedes")
@@ -126,6 +133,11 @@ function validateTraceTargetTypes(entries) {
126
133
  const resolved = byId.get(target) ?? byDisplayId.get(target);
127
134
  if (!resolved)
128
135
  continue;
136
+ // Target-side exemption (#771, matching #765's MSL-L004 fix): an
137
+ // upstream target's type comes from a foreign vocabulary — never
138
+ // judge core-type compatibility against it.
139
+ if ((0, mod_js_1.isUpstreamEntry)(resolved))
140
+ continue;
129
141
  const targetType = (0, type_resolution_js_1.resolvedCoreType)(resolved);
130
142
  if (!targetType)
131
143
  continue;
@@ -161,6 +173,10 @@ function validateTraceTargetTypes(entries) {
161
173
  const resolved = byId.get(target) ?? byDisplayId.get(target);
162
174
  if (!resolved)
163
175
  continue;
176
+ // Target-side exemption (#771) — same rationale as the
177
+ // TRACE_RULES loop above.
178
+ if ((0, mod_js_1.isUpstreamEntry)(resolved))
179
+ continue;
164
180
  const targetType = (0, type_resolution_js_1.resolvedCoreType)(resolved);
165
181
  if (!targetType)
166
182
  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,GACjC,OAAO,CAST;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EACjC,WAAW,GAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAa,GAClD,UAAU,EAAE,CAsFd"}
1
+ {"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../src/validator/traceability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,KAAK,EAEV,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,GACjC,OAAO,CAST;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EACjC,WAAW,GAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAa,EACnD,mBAAmB,GAAE,SAAS,MAAM,EAAO,GAC1C,UAAU,EAAE,CA+Gd"}
@@ -9,8 +9,13 @@
9
9
  * attributes:
10
10
  * - Required (MSL-L001)
11
11
  * - Cardinality bounds (MSL-L002 upper / MSL-L003 lower)
12
- * - Target match against the rule's target matchers (MSL-L004)
13
- * - Target existence (MSL-L006, warning; scheme-qualified URIs exempt)
12
+ * - Target match against the rule's target matchers (MSL-L004; skipped
13
+ * when the resolved target is an upstream entry — its `type` comes from
14
+ * the upstream's own profile, a vocabulary the consumer never
15
+ * re-classifies against, federated upstream slice 4)
16
+ * - Target existence (MSL-L006, warning; scheme-qualified URIs exempt) —
17
+ * or MSL-T014 (warning) instead of MSL-L006 when the caller declares a
18
+ * non-empty upstream set (federated upstream, slice 4)
14
19
  *
15
20
  * Referenced entries are skipped entirely — the profile manifest parser
16
21
  * rejects `referenced.traceability` at load time, so referenced entries
@@ -76,8 +81,15 @@ function matchesAnyTarget(target, matchers) {
76
81
  * @param graph - Index keyed by entry.id (ULID) for target lookup
77
82
  * @param byDisplayId - Index keyed by entry.displayId for target lookup
78
83
  * (issue #593 — display-ID targets). Defaults to empty.
84
+ * @param declaredUpstreamIds - Upstream ids the downstream project declares
85
+ * via `project.yaml` `dependencies:`/`references:`
86
+ * (federated upstream, slice 4). When non-empty, an
87
+ * otherwise-unresolved trace target fires MSL-T014
88
+ * (warning), naming the searched upstream set, instead
89
+ * of the generic MSL-L006. Defaults to empty — MSL-L006
90
+ * unchanged.
79
91
  */
80
- function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new Map()) {
92
+ function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new Map(), declaredUpstreamIds = []) {
81
93
  const diagnostics = [];
82
94
  if (entry.shape !== "Authored")
83
95
  return diagnostics;
@@ -127,6 +139,20 @@ function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new M
127
139
  // graph targets, so they are not "broken references".
128
140
  if (mod_js_1.URI_SCHEME_RE.test(v))
129
141
  continue;
142
+ // Federated upstream (slice 4): when the project declares an
143
+ // upstream set, an unresolved target replaces MSL-L006 with
144
+ // MSL-T014, naming the searched set — the same target fires
145
+ // exactly one of the two codes, never both.
146
+ if (declaredUpstreamIds.length > 0) {
147
+ diagnostics.push({
148
+ code: "MSL-T014",
149
+ severity: "warning",
150
+ message: `${entry.displayId}: link '${linkName}' target '${v}' not ` +
151
+ `found in project or upstreams: ${declaredUpstreamIds.join(", ")}`,
152
+ location: entry.location,
153
+ });
154
+ continue;
155
+ }
130
156
  diagnostics.push({
131
157
  code: "MSL-L006",
132
158
  severity: "warning",
@@ -136,6 +162,15 @@ function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new M
136
162
  });
137
163
  continue;
138
164
  }
165
+ // Federated upstream (slice 4): an upstream target's `type` is
166
+ // classified by the upstream's OWN profile — a foreign vocabulary the
167
+ // consumer's profile cannot map (design §4.5/D6: the consumer never
168
+ // re-classifies). The link still resolves (no L006/T014 — handled
169
+ // above); only the consumer's own target-type enforcement is skipped
170
+ // for this target. A project-authored target with a mismatched type
171
+ // still fires MSL-L004 below.
172
+ if ((0, mod_js_1.isUpstreamEntry)(target))
173
+ continue;
139
174
  if (!matchesAnyTarget(target, rule.target)) {
140
175
  diagnostics.push({
141
176
  code: "MSL-L004",