@driftsys/markspec 0.10.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. package/README.md +11 -2
  2. package/esm/ast/normalize.d.ts +4 -5
  3. package/esm/ast/normalize.d.ts.map +1 -1
  4. package/esm/ast/normalize.js +6 -37
  5. package/esm/collect/mod.d.ts +29 -9
  6. package/esm/collect/mod.d.ts.map +1 -1
  7. package/esm/collect/mod.js +36 -10
  8. package/esm/compiler/deserialize.d.ts +49 -0
  9. package/esm/compiler/deserialize.d.ts.map +1 -0
  10. package/esm/compiler/deserialize.js +139 -0
  11. package/esm/compiler/manifest.d.ts +3 -0
  12. package/esm/compiler/manifest.d.ts.map +1 -1
  13. package/esm/compiler/manifest.js +9 -3
  14. package/esm/compiler/mod.d.ts.map +1 -1
  15. package/esm/compiler/mod.js +18 -13
  16. package/esm/config/markspec.d.ts +40 -1
  17. package/esm/config/markspec.d.ts.map +1 -1
  18. package/esm/config/markspec.js +127 -2
  19. package/esm/config/mod.d.ts.map +1 -1
  20. package/esm/config/mod.js +143 -147
  21. package/esm/decl/duplicates.d.ts +29 -0
  22. package/esm/decl/duplicates.d.ts.map +1 -0
  23. package/esm/decl/duplicates.js +28 -0
  24. package/esm/decl/mod.d.ts +4 -2
  25. package/esm/decl/mod.d.ts.map +1 -1
  26. package/esm/decl/mod.js +2 -1
  27. package/esm/decl/surfaces.d.ts +29 -7
  28. package/esm/decl/surfaces.d.ts.map +1 -1
  29. package/esm/decl/surfaces.js +31 -18
  30. package/esm/discovery/mod.d.ts +24 -8
  31. package/esm/discovery/mod.d.ts.map +1 -1
  32. package/esm/discovery/mod.js +57 -21
  33. package/esm/discovery/projects.d.ts +109 -0
  34. package/esm/discovery/projects.d.ts.map +1 -0
  35. package/esm/discovery/projects.js +232 -0
  36. package/esm/formatter/entry_body.d.ts +86 -0
  37. package/esm/formatter/entry_body.d.ts.map +1 -0
  38. package/esm/formatter/entry_body.js +287 -0
  39. package/esm/formatter/mod.d.ts +13 -9
  40. package/esm/formatter/mod.d.ts.map +1 -1
  41. package/esm/formatter/mod.js +126 -50
  42. package/esm/gates/mod.d.ts +13 -2
  43. package/esm/gates/mod.d.ts.map +1 -1
  44. package/esm/gates/mod.js +41 -13
  45. package/esm/lint/runner.d.ts.map +1 -1
  46. package/esm/lint/runner.js +7 -5
  47. package/esm/lock/acquire_compile.d.ts +31 -0
  48. package/esm/lock/acquire_compile.d.ts.map +1 -0
  49. package/esm/lock/acquire_compile.js +83 -0
  50. package/esm/lock/cache_check.d.ts +28 -0
  51. package/esm/lock/cache_check.d.ts.map +1 -0
  52. package/esm/lock/cache_check.js +51 -0
  53. package/esm/lock/check.d.ts +14 -3
  54. package/esm/lock/check.d.ts.map +1 -1
  55. package/esm/lock/check.js +43 -4
  56. package/esm/lock/edge_drift.d.ts +2 -0
  57. package/esm/lock/edge_drift.d.ts.map +1 -1
  58. package/esm/lock/edge_drift.js +4 -0
  59. package/esm/lock/git_intent.d.ts +46 -0
  60. package/esm/lock/git_intent.d.ts.map +1 -0
  61. package/esm/lock/git_intent.js +111 -0
  62. package/esm/lock/mod.d.ts +11 -4
  63. package/esm/lock/mod.d.ts.map +1 -1
  64. package/esm/lock/mod.js +8 -2
  65. package/esm/lock/model.d.ts +24 -1
  66. package/esm/lock/model.d.ts.map +1 -1
  67. package/esm/lock/parser.d.ts.map +1 -1
  68. package/esm/lock/parser.js +32 -0
  69. package/esm/lock/pin_assurance.d.ts +20 -0
  70. package/esm/lock/pin_assurance.d.ts.map +1 -0
  71. package/esm/lock/pin_assurance.js +34 -0
  72. package/esm/lock/resolve.d.ts +8 -17
  73. package/esm/lock/resolve.d.ts.map +1 -1
  74. package/esm/lock/resolve.js +7 -67
  75. package/esm/lock/serializer.d.ts.map +1 -1
  76. package/esm/lock/serializer.js +23 -0
  77. package/esm/lock/upstream_common.d.ts +29 -0
  78. package/esm/lock/upstream_common.d.ts.map +1 -0
  79. package/esm/lock/upstream_common.js +38 -0
  80. package/esm/lock/upstream_deps.d.ts +63 -0
  81. package/esm/lock/upstream_deps.d.ts.map +1 -0
  82. package/esm/lock/upstream_deps.js +172 -0
  83. package/esm/lock/upstream_refs.d.ts +69 -0
  84. package/esm/lock/upstream_refs.d.ts.map +1 -0
  85. package/esm/lock/upstream_refs.js +238 -0
  86. package/esm/mod.d.ts +23 -11
  87. package/esm/mod.d.ts.map +1 -1
  88. package/esm/mod.js +20 -8
  89. package/esm/model/mod.d.ts +114 -28
  90. package/esm/model/mod.d.ts.map +1 -1
  91. package/esm/model/mod.js +76 -13
  92. package/esm/model/profile.d.ts +13 -0
  93. package/esm/model/profile.d.ts.map +1 -1
  94. package/esm/parser/code_regions.d.ts +29 -0
  95. package/esm/parser/code_regions.d.ts.map +1 -0
  96. package/esm/parser/code_regions.js +38 -0
  97. package/esm/parser/markdown.d.ts.map +1 -1
  98. package/esm/parser/markdown.js +110 -91
  99. package/esm/parser/mod.d.ts.map +1 -1
  100. package/esm/parser/mod.js +7 -1
  101. package/esm/parser/translate.d.ts.map +1 -1
  102. package/esm/parser/translate.js +5 -0
  103. package/esm/profile/manifest.d.ts.map +1 -1
  104. package/esm/profile/manifest.js +20 -3
  105. package/esm/profile/merge.js +7 -0
  106. package/esm/refs/mod.d.ts.map +1 -1
  107. package/esm/refs/mod.js +8 -19
  108. package/esm/reporter/mod.d.ts +11 -0
  109. package/esm/reporter/mod.d.ts.map +1 -1
  110. package/esm/reporter/mod.js +20 -9
  111. package/esm/typl/assemble.d.ts +53 -0
  112. package/esm/typl/assemble.d.ts.map +1 -0
  113. package/esm/typl/assemble.js +238 -0
  114. package/esm/typl/ast.d.ts +7 -1
  115. package/esm/typl/ast.d.ts.map +1 -1
  116. package/esm/typl/ast.js +3 -0
  117. package/esm/typl/bullet.d.ts +9 -7
  118. package/esm/typl/bullet.d.ts.map +1 -1
  119. package/esm/typl/bullet.js +6 -4
  120. package/esm/typl/citations.d.ts +27 -0
  121. package/esm/typl/citations.d.ts.map +1 -0
  122. package/esm/typl/citations.js +16 -0
  123. package/esm/typl/diagnostics.d.ts +2 -2
  124. package/esm/typl/diagnostics.d.ts.map +1 -1
  125. package/esm/typl/diagnostics.js +18 -0
  126. package/esm/typl/grammar.d.ts.map +1 -1
  127. package/esm/typl/grammar.js +6 -0
  128. package/esm/typl/lexer.d.ts.map +1 -1
  129. package/esm/typl/lexer.js +25 -4
  130. package/esm/typl/mod.d.ts +8 -2
  131. package/esm/typl/mod.d.ts.map +1 -1
  132. package/esm/typl/mod.js +5 -1
  133. package/esm/typl/recognize.js +2 -2
  134. package/esm/typl/registry.d.ts +1 -1
  135. package/esm/typl/resolve.d.ts +31 -0
  136. package/esm/typl/resolve.d.ts.map +1 -0
  137. package/esm/typl/resolve.js +27 -0
  138. package/esm/typl/table.d.ts +52 -0
  139. package/esm/typl/table.d.ts.map +1 -0
  140. package/esm/typl/table.js +69 -0
  141. package/esm/typl/validator.d.ts +24 -5
  142. package/esm/typl/validator.d.ts.map +1 -1
  143. package/esm/typl/validator.js +55 -75
  144. package/esm/upstream/mod.d.ts +45 -0
  145. package/esm/upstream/mod.d.ts.map +1 -0
  146. package/esm/upstream/mod.js +98 -0
  147. package/esm/upstream/project.d.ts +33 -0
  148. package/esm/upstream/project.d.ts.map +1 -0
  149. package/esm/upstream/project.js +38 -0
  150. package/esm/upstream/refs.d.ts +23 -0
  151. package/esm/upstream/refs.d.ts.map +1 -0
  152. package/esm/upstream/refs.js +71 -0
  153. package/esm/util/fence.d.ts +20 -29
  154. package/esm/util/fence.d.ts.map +1 -1
  155. package/esm/util/fence.js +42 -50
  156. package/esm/util/modals.d.ts +6 -0
  157. package/esm/util/modals.d.ts.map +1 -1
  158. package/esm/util/modals.js +37 -0
  159. package/esm/util/paths.d.ts +14 -0
  160. package/esm/util/paths.d.ts.map +1 -0
  161. package/esm/util/paths.js +22 -0
  162. package/esm/uxil/assemble.d.ts +38 -0
  163. package/esm/uxil/assemble.d.ts.map +1 -0
  164. package/esm/uxil/assemble.js +268 -0
  165. package/esm/uxil/ast.d.ts +63 -0
  166. package/esm/uxil/ast.d.ts.map +1 -0
  167. package/esm/uxil/ast.js +9 -0
  168. package/esm/uxil/citations.d.ts +27 -0
  169. package/esm/uxil/citations.d.ts.map +1 -0
  170. package/esm/uxil/citations.js +25 -0
  171. package/esm/uxil/diagnostics.d.ts +39 -0
  172. package/esm/uxil/diagnostics.d.ts.map +1 -0
  173. package/esm/uxil/diagnostics.js +135 -0
  174. package/esm/uxil/grammar.d.ts +72 -0
  175. package/esm/uxil/grammar.d.ts.map +1 -0
  176. package/esm/uxil/grammar.js +505 -0
  177. package/esm/uxil/lexer.d.ts +23 -0
  178. package/esm/uxil/lexer.d.ts.map +1 -0
  179. package/esm/uxil/lexer.js +58 -0
  180. package/esm/uxil/mod.d.ts +32 -0
  181. package/esm/uxil/mod.d.ts.map +1 -0
  182. package/esm/uxil/mod.js +11 -0
  183. package/esm/uxil/projection.d.ts +40 -0
  184. package/esm/uxil/projection.d.ts.map +1 -0
  185. package/esm/uxil/projection.js +41 -0
  186. package/esm/uxil/recognize.d.ts +16 -0
  187. package/esm/uxil/recognize.d.ts.map +1 -0
  188. package/esm/uxil/recognize.js +28 -0
  189. package/esm/uxil/registry.d.ts +37 -0
  190. package/esm/uxil/registry.d.ts.map +1 -0
  191. package/esm/uxil/registry.js +29 -0
  192. package/esm/uxil/surfaces.d.ts +36 -0
  193. package/esm/uxil/surfaces.d.ts.map +1 -0
  194. package/esm/uxil/surfaces.js +34 -0
  195. package/esm/uxil/validator.d.ts +36 -0
  196. package/esm/uxil/validator.d.ts.map +1 -0
  197. package/esm/uxil/validator.js +139 -0
  198. package/esm/uxil/vocab.d.ts +33 -0
  199. package/esm/uxil/vocab.d.ts.map +1 -0
  200. package/esm/uxil/vocab.js +36 -0
  201. package/esm/validator/body_blocks.d.ts +2 -1
  202. package/esm/validator/body_blocks.d.ts.map +1 -1
  203. package/esm/validator/body_blocks.js +80 -2
  204. package/esm/validator/caption_convention.d.ts +2 -1
  205. package/esm/validator/caption_convention.d.ts.map +1 -1
  206. package/esm/validator/caption_convention.js +2 -1
  207. package/esm/validator/corpus.d.ts +6 -0
  208. package/esm/validator/corpus.d.ts.map +1 -1
  209. package/esm/validator/corpus.js +55 -20
  210. package/esm/validator/discipline.d.ts +6 -4
  211. package/esm/validator/discipline.d.ts.map +1 -1
  212. package/esm/validator/discipline.js +6 -4
  213. package/esm/validator/mod.d.ts +1 -1
  214. package/esm/validator/mod.d.ts.map +1 -1
  215. package/esm/validator/mod.js +29 -16
  216. package/esm/validator/pipeline.d.ts +11 -1
  217. package/esm/validator/pipeline.d.ts.map +1 -1
  218. package/esm/validator/pipeline.js +76 -23
  219. package/esm/validator/trace_types.d.ts +9 -2
  220. package/esm/validator/trace_types.d.ts.map +1 -1
  221. package/esm/validator/trace_types.js +21 -5
  222. package/esm/validator/traceability.d.ts +15 -3
  223. package/esm/validator/traceability.d.ts.map +1 -1
  224. package/esm/validator/traceability.js +39 -4
  225. package/esm/validator/types.d.ts.map +1 -1
  226. package/esm/validator/types.js +11 -1
  227. package/esm/validator/uxil_family.d.ts +43 -0
  228. package/esm/validator/uxil_family.d.ts.map +1 -0
  229. package/esm/validator/uxil_family.js +52 -0
  230. package/package.json +1 -1
  231. package/script/ast/normalize.d.ts +4 -5
  232. package/script/ast/normalize.d.ts.map +1 -1
  233. package/script/ast/normalize.js +5 -36
  234. package/script/collect/mod.d.ts +29 -9
  235. package/script/collect/mod.d.ts.map +1 -1
  236. package/script/collect/mod.js +38 -10
  237. package/script/compiler/deserialize.d.ts +49 -0
  238. package/script/compiler/deserialize.d.ts.map +1 -0
  239. package/script/compiler/deserialize.js +144 -0
  240. package/script/compiler/manifest.d.ts +3 -0
  241. package/script/compiler/manifest.d.ts.map +1 -1
  242. package/script/compiler/manifest.js +10 -3
  243. package/script/compiler/mod.d.ts.map +1 -1
  244. package/script/compiler/mod.js +16 -11
  245. package/script/config/markspec.d.ts +40 -1
  246. package/script/config/markspec.d.ts.map +1 -1
  247. package/script/config/markspec.js +129 -3
  248. package/script/config/mod.d.ts.map +1 -1
  249. package/script/config/mod.js +143 -147
  250. package/script/decl/duplicates.d.ts +29 -0
  251. package/script/decl/duplicates.d.ts.map +1 -0
  252. package/script/decl/duplicates.js +31 -0
  253. package/script/decl/mod.d.ts +4 -2
  254. package/script/decl/mod.d.ts.map +1 -1
  255. package/script/decl/mod.js +4 -2
  256. package/script/decl/surfaces.d.ts +29 -7
  257. package/script/decl/surfaces.d.ts.map +1 -1
  258. package/script/decl/surfaces.js +32 -19
  259. package/script/discovery/mod.d.ts +24 -8
  260. package/script/discovery/mod.d.ts.map +1 -1
  261. package/script/discovery/mod.js +56 -20
  262. package/script/discovery/projects.d.ts +109 -0
  263. package/script/discovery/projects.d.ts.map +1 -0
  264. package/script/discovery/projects.js +240 -0
  265. package/script/formatter/entry_body.d.ts +86 -0
  266. package/script/formatter/entry_body.d.ts.map +1 -0
  267. package/script/formatter/entry_body.js +292 -0
  268. package/script/formatter/mod.d.ts +13 -9
  269. package/script/formatter/mod.d.ts.map +1 -1
  270. package/script/formatter/mod.js +124 -48
  271. package/script/gates/mod.d.ts +13 -2
  272. package/script/gates/mod.d.ts.map +1 -1
  273. package/script/gates/mod.js +50 -22
  274. package/script/lint/runner.d.ts.map +1 -1
  275. package/script/lint/runner.js +6 -4
  276. package/script/lock/acquire_compile.d.ts +31 -0
  277. package/script/lock/acquire_compile.d.ts.map +1 -0
  278. package/script/lock/acquire_compile.js +86 -0
  279. package/script/lock/cache_check.d.ts +28 -0
  280. package/script/lock/cache_check.d.ts.map +1 -0
  281. package/script/lock/cache_check.js +54 -0
  282. package/script/lock/check.d.ts +14 -3
  283. package/script/lock/check.d.ts.map +1 -1
  284. package/script/lock/check.js +43 -4
  285. package/script/lock/edge_drift.d.ts +2 -0
  286. package/script/lock/edge_drift.d.ts.map +1 -1
  287. package/script/lock/edge_drift.js +5 -0
  288. package/script/lock/git_intent.d.ts +46 -0
  289. package/script/lock/git_intent.d.ts.map +1 -0
  290. package/script/lock/git_intent.js +115 -0
  291. package/script/lock/mod.d.ts +11 -4
  292. package/script/lock/mod.d.ts.map +1 -1
  293. package/script/lock/mod.js +17 -2
  294. package/script/lock/model.d.ts +24 -1
  295. package/script/lock/model.d.ts.map +1 -1
  296. package/script/lock/parser.d.ts.map +1 -1
  297. package/script/lock/parser.js +32 -0
  298. package/script/lock/pin_assurance.d.ts +20 -0
  299. package/script/lock/pin_assurance.d.ts.map +1 -0
  300. package/script/lock/pin_assurance.js +37 -0
  301. package/script/lock/resolve.d.ts +8 -17
  302. package/script/lock/resolve.d.ts.map +1 -1
  303. package/script/lock/resolve.js +7 -68
  304. package/script/lock/serializer.d.ts.map +1 -1
  305. package/script/lock/serializer.js +23 -0
  306. package/script/lock/upstream_common.d.ts +29 -0
  307. package/script/lock/upstream_common.d.ts.map +1 -0
  308. package/script/lock/upstream_common.js +42 -0
  309. package/script/lock/upstream_deps.d.ts +63 -0
  310. package/script/lock/upstream_deps.d.ts.map +1 -0
  311. package/script/lock/upstream_deps.js +175 -0
  312. package/script/lock/upstream_refs.d.ts +69 -0
  313. package/script/lock/upstream_refs.d.ts.map +1 -0
  314. package/script/lock/upstream_refs.js +244 -0
  315. package/script/mod.d.ts +23 -11
  316. package/script/mod.d.ts.map +1 -1
  317. package/script/mod.js +55 -7
  318. package/script/model/mod.d.ts +114 -28
  319. package/script/model/mod.d.ts.map +1 -1
  320. package/script/model/mod.js +81 -14
  321. package/script/model/profile.d.ts +13 -0
  322. package/script/model/profile.d.ts.map +1 -1
  323. package/script/parser/code_regions.d.ts +29 -0
  324. package/script/parser/code_regions.d.ts.map +1 -0
  325. package/script/parser/code_regions.js +41 -0
  326. package/script/parser/markdown.d.ts.map +1 -1
  327. package/script/parser/markdown.js +108 -89
  328. package/script/parser/mod.d.ts.map +1 -1
  329. package/script/parser/mod.js +7 -1
  330. package/script/parser/translate.d.ts.map +1 -1
  331. package/script/parser/translate.js +5 -0
  332. package/script/profile/manifest.d.ts.map +1 -1
  333. package/script/profile/manifest.js +20 -3
  334. package/script/profile/merge.js +7 -0
  335. package/script/refs/mod.d.ts.map +1 -1
  336. package/script/refs/mod.js +7 -18
  337. package/script/reporter/mod.d.ts +11 -0
  338. package/script/reporter/mod.d.ts.map +1 -1
  339. package/script/reporter/mod.js +19 -8
  340. package/script/typl/assemble.d.ts +53 -0
  341. package/script/typl/assemble.d.ts.map +1 -0
  342. package/script/typl/assemble.js +241 -0
  343. package/script/typl/ast.d.ts +7 -1
  344. package/script/typl/ast.d.ts.map +1 -1
  345. package/script/typl/ast.js +3 -0
  346. package/script/typl/bullet.d.ts +9 -7
  347. package/script/typl/bullet.d.ts.map +1 -1
  348. package/script/typl/bullet.js +6 -4
  349. package/script/typl/citations.d.ts +27 -0
  350. package/script/typl/citations.d.ts.map +1 -0
  351. package/script/typl/citations.js +20 -0
  352. package/script/typl/diagnostics.d.ts +2 -2
  353. package/script/typl/diagnostics.d.ts.map +1 -1
  354. package/script/typl/diagnostics.js +18 -0
  355. package/script/typl/grammar.d.ts.map +1 -1
  356. package/script/typl/grammar.js +6 -0
  357. package/script/typl/lexer.d.ts.map +1 -1
  358. package/script/typl/lexer.js +25 -4
  359. package/script/typl/mod.d.ts +8 -2
  360. package/script/typl/mod.d.ts.map +1 -1
  361. package/script/typl/mod.js +14 -2
  362. package/script/typl/recognize.js +2 -2
  363. package/script/typl/registry.d.ts +1 -1
  364. package/script/typl/resolve.d.ts +31 -0
  365. package/script/typl/resolve.d.ts.map +1 -0
  366. package/script/typl/resolve.js +33 -0
  367. package/script/typl/table.d.ts +52 -0
  368. package/script/typl/table.d.ts.map +1 -0
  369. package/script/typl/table.js +75 -0
  370. package/script/typl/validator.d.ts +24 -5
  371. package/script/typl/validator.d.ts.map +1 -1
  372. package/script/typl/validator.js +55 -75
  373. package/script/upstream/mod.d.ts +45 -0
  374. package/script/upstream/mod.d.ts.map +1 -0
  375. package/script/upstream/mod.js +101 -0
  376. package/script/upstream/project.d.ts +33 -0
  377. package/script/upstream/project.d.ts.map +1 -0
  378. package/script/upstream/project.js +41 -0
  379. package/script/upstream/refs.d.ts +23 -0
  380. package/script/upstream/refs.d.ts.map +1 -0
  381. package/script/upstream/refs.js +74 -0
  382. package/script/util/fence.d.ts +20 -29
  383. package/script/util/fence.d.ts.map +1 -1
  384. package/script/util/fence.js +47 -54
  385. package/script/util/modals.d.ts +6 -0
  386. package/script/util/modals.d.ts.map +1 -1
  387. package/script/util/modals.js +38 -0
  388. package/script/util/paths.d.ts +14 -0
  389. package/script/util/paths.d.ts.map +1 -0
  390. package/script/util/paths.js +25 -0
  391. package/script/uxil/assemble.d.ts +38 -0
  392. package/script/uxil/assemble.d.ts.map +1 -0
  393. package/script/uxil/assemble.js +272 -0
  394. package/script/uxil/ast.d.ts +63 -0
  395. package/script/uxil/ast.d.ts.map +1 -0
  396. package/script/uxil/ast.js +10 -0
  397. package/script/uxil/citations.d.ts +27 -0
  398. package/script/uxil/citations.d.ts.map +1 -0
  399. package/script/uxil/citations.js +29 -0
  400. package/script/uxil/diagnostics.d.ts +39 -0
  401. package/script/uxil/diagnostics.d.ts.map +1 -0
  402. package/script/uxil/diagnostics.js +140 -0
  403. package/script/uxil/grammar.d.ts +72 -0
  404. package/script/uxil/grammar.d.ts.map +1 -0
  405. package/script/uxil/grammar.js +511 -0
  406. package/script/uxil/lexer.d.ts +23 -0
  407. package/script/uxil/lexer.d.ts.map +1 -0
  408. package/script/uxil/lexer.js +61 -0
  409. package/script/uxil/mod.d.ts +32 -0
  410. package/script/uxil/mod.d.ts.map +1 -0
  411. package/script/uxil/mod.js +37 -0
  412. package/script/uxil/projection.d.ts +40 -0
  413. package/script/uxil/projection.d.ts.map +1 -0
  414. package/script/uxil/projection.js +44 -0
  415. package/script/uxil/recognize.d.ts +16 -0
  416. package/script/uxil/recognize.d.ts.map +1 -0
  417. package/script/uxil/recognize.js +31 -0
  418. package/script/uxil/registry.d.ts +37 -0
  419. package/script/uxil/registry.d.ts.map +1 -0
  420. package/script/uxil/registry.js +32 -0
  421. package/script/uxil/surfaces.d.ts +36 -0
  422. package/script/uxil/surfaces.d.ts.map +1 -0
  423. package/script/uxil/surfaces.js +39 -0
  424. package/script/uxil/validator.d.ts +36 -0
  425. package/script/uxil/validator.d.ts.map +1 -0
  426. package/script/uxil/validator.js +142 -0
  427. package/script/uxil/vocab.d.ts +33 -0
  428. package/script/uxil/vocab.d.ts.map +1 -0
  429. package/script/uxil/vocab.js +41 -0
  430. package/script/validator/body_blocks.d.ts +2 -1
  431. package/script/validator/body_blocks.d.ts.map +1 -1
  432. package/script/validator/body_blocks.js +80 -2
  433. package/script/validator/caption_convention.d.ts +2 -1
  434. package/script/validator/caption_convention.d.ts.map +1 -1
  435. package/script/validator/caption_convention.js +2 -1
  436. package/script/validator/corpus.d.ts +6 -0
  437. package/script/validator/corpus.d.ts.map +1 -1
  438. package/script/validator/corpus.js +55 -19
  439. package/script/validator/discipline.d.ts +6 -4
  440. package/script/validator/discipline.d.ts.map +1 -1
  441. package/script/validator/discipline.js +6 -4
  442. package/script/validator/mod.d.ts +1 -1
  443. package/script/validator/mod.d.ts.map +1 -1
  444. package/script/validator/mod.js +29 -15
  445. package/script/validator/pipeline.d.ts +11 -1
  446. package/script/validator/pipeline.d.ts.map +1 -1
  447. package/script/validator/pipeline.js +75 -22
  448. package/script/validator/trace_types.d.ts +9 -2
  449. package/script/validator/trace_types.d.ts.map +1 -1
  450. package/script/validator/trace_types.js +20 -4
  451. package/script/validator/traceability.d.ts +15 -3
  452. package/script/validator/traceability.d.ts.map +1 -1
  453. package/script/validator/traceability.js +38 -3
  454. package/script/validator/types.d.ts.map +1 -1
  455. package/script/validator/types.js +10 -0
  456. package/script/validator/uxil_family.d.ts +43 -0
  457. package/script/validator/uxil_family.d.ts.map +1 -0
  458. package/script/validator/uxil_family.js +56 -0
@@ -1,57 +1,85 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateTypl = validateTypl;
4
+ const mod_js_1 = require("../model/mod.js");
5
+ const citations_js_1 = require("./citations.js");
6
+ const mod_js_2 = require("../decl/mod.js");
4
7
  const diagnostics_js_1 = require("./diagnostics.js");
5
8
  const registry_js_1 = require("./registry.js");
9
+ const resolve_js_1 = require("./resolve.js");
6
10
  /**
7
11
  * Validate the typl declarations across all entries.
8
12
  *
9
- * Returns the built corpus registry plus any diagnostics. The registry
10
- * is returned even when diagnostics are present so callers (compiler,
11
- * LSP) can use it for navigation and emission.
13
+ * Upstream entries (federated-upstream epic) are typl-inert: they are
14
+ * excluded from the working set before the registry is built, so their
15
+ * declarations neither emit their own TYPL diagnostics nor count toward
16
+ * the corpus-wide declared-once (TYPL-009) accounting — a project entry
17
+ * re-declaring a dotted name an upstream also publishes is not a
18
+ * collision. Cross-repo typl resolution is out of scope for this slice
19
+ * (see ADR-019 / federated-upstream design §4.7); this is the same #771
20
+ * `emittableEntries` partition the validator orchestrators apply.
21
+ *
22
+ * Returns the built corpus registry (scoped to non-upstream entries)
23
+ * plus any diagnostics. The registry is returned even when diagnostics
24
+ * are present so callers (compiler, LSP) can use it for navigation and
25
+ * emission.
12
26
  */
13
27
  function validateTypl(entries) {
14
- const registry = (0, registry_js_1.buildTypeRegistry)(entries);
28
+ const localEntries = (0, mod_js_1.emittableEntries)(entries);
29
+ const registry = (0, registry_js_1.buildTypeRegistry)(localEntries);
15
30
  const diagnostics = [];
16
- // Cross-entry $Name collisions (TYPL-002 + TYPL-003)
17
- for (const [name, decls] of registry.bindings) {
18
- if (decls.length < 2)
31
+ // Published tier (#723): dotted names are declared exactly once
32
+ // corpus-wide — every declaration after the first is TYPL-009. Plain
33
+ // (entry-local) names have no cross-entry rule: TYPL-002/003 are
34
+ // retired (deprecated, never emitted — see diagnostics.ts).
35
+ for (const { name, first, duplicates } of (0, mod_js_2.findDuplicateDeclarations)(registry.bindings, (name) => name.includes("."))) {
36
+ for (const dup of duplicates) {
37
+ const td = (0, diagnostics_js_1.typlDiagnostic)("TYPL-009", {
38
+ name,
39
+ otherFile: first.entryFile,
40
+ otherLine: first.binding.position.line,
41
+ }, dup.binding.position);
42
+ diagnostics.push({
43
+ code: td.code,
44
+ severity: td.severity,
45
+ message: td.message,
46
+ location: { file: dup.entryFile, line: 1, column: 1 },
47
+ });
48
+ }
49
+ }
50
+ // Citation validation (#723): bare published-shaped code spans must
51
+ // resolve (relative → entry root namespace) to a declared symbol.
52
+ for (const entry of localEntries) {
53
+ const citations = (0, citations_js_1.extractTyplCitations)(entry.bodyTokens);
54
+ if (citations.length === 0)
19
55
  continue;
20
- const first = decls[0];
21
- for (let i = 1; i < decls.length; i++) {
22
- const dup = decls[i];
23
- if (dup.binding.kind !== first.binding.kind) {
24
- const td = (0, diagnostics_js_1.typlDiagnostic)("TYPL-002", {
25
- name,
26
- kindA: dup.binding.kind,
27
- kindB: first.binding.kind,
28
- otherFile: first.entryFile,
29
- otherLine: first.binding.position.line,
30
- }, dup.binding.position);
56
+ const root = entry.types?.rootNamespace;
57
+ const scope = root !== undefined ? { base: root } : undefined;
58
+ for (const citation of citations) {
59
+ const res = (0, mod_js_2.resolveRef)(citation.name, scope, resolve_js_1.TYPL_REF_OPS);
60
+ if (!res.ok) {
61
+ const td = (0, diagnostics_js_1.typlDiagnostic)("TYPL-010", { name: citation.name }, { line: citation.location.line, column: citation.location.column });
31
62
  diagnostics.push({
32
63
  code: td.code,
33
64
  severity: td.severity,
34
65
  message: td.message,
35
- location: { file: dup.entryFile, line: 1, column: 1 },
66
+ location: citation.location,
36
67
  });
68
+ continue;
37
69
  }
38
- else if (!shapesEqual(dup.binding.shape, first.binding.shape)) {
39
- const td = (0, diagnostics_js_1.typlDiagnostic)("TYPL-003", {
40
- name,
41
- otherFile: first.entryFile,
42
- otherLine: first.binding.position.line,
43
- }, dup.binding.position);
70
+ if (!registry.bindings.has(res.ref)) {
71
+ const td = (0, diagnostics_js_1.typlDiagnostic)("TYPL-011", { name: res.ref }, { line: citation.location.line, column: citation.location.column });
44
72
  diagnostics.push({
45
73
  code: td.code,
46
74
  severity: td.severity,
47
75
  message: td.message,
48
- location: { file: dup.entryFile, line: 1, column: 1 },
76
+ location: citation.location,
49
77
  });
50
78
  }
51
79
  }
52
80
  }
53
81
  // Intra-entry undefined typedef ref (TYPL-005)
54
- for (const entry of entries) {
82
+ for (const entry of localEntries) {
55
83
  if (!entry.types)
56
84
  continue;
57
85
  const localTypedefs = new Set(entry.types.typedefs.map((t) => t.name));
@@ -94,51 +122,3 @@ function collectRefDiagnostics(shape, localTypedefs, entry, line, out) {
94
122
  // are leaves with no nested shape — nothing to recurse into.
95
123
  }
96
124
  }
97
- function shapesEqual(a, b) {
98
- if (a === b)
99
- return true;
100
- if (!a || !b)
101
- return false;
102
- if (a.kind !== b.kind)
103
- return false;
104
- switch (a.kind) {
105
- case "primitive":
106
- return a.type === b.type;
107
- case "range":
108
- return a.type === b.type &&
109
- a.exact === b.exact &&
110
- a.min === b.min &&
111
- a.max === b.max;
112
- case "length":
113
- return a.type === b.type &&
114
- a.exact === b.exact &&
115
- a.min === b.min &&
116
- a.max === b.max;
117
- case "pattern":
118
- return a.regex === b.regex &&
119
- a.flags === b.flags;
120
- case "literal":
121
- return a.value === b.value;
122
- case "enum":
123
- return a.values.length === b.values.length &&
124
- a.values.every((v, i) => v === b.values[i]);
125
- case "array":
126
- return a.exact === b.exact &&
127
- a.min === b.min &&
128
- a.max === b.max &&
129
- shapesEqual(a.element, b.element);
130
- case "optional":
131
- return shapesEqual(a.inner, b.inner);
132
- case "record": {
133
- const aKeys = Object.keys(a.fields).sort();
134
- const bKeys = Object.keys(b.fields).sort();
135
- if (aKeys.length !== bKeys.length)
136
- return false;
137
- return aKeys.every((k, i) => k === bKeys[i] && shapesEqual(a.fields[k], b.fields[k]));
138
- }
139
- case "ref":
140
- return a.name === b.name;
141
- default:
142
- return false;
143
- }
144
- }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @module upstream
3
+ *
4
+ * Upstream corpus loader — hydrates the cached compiled-JSON snapshots
5
+ * that `markspec lock` writes under `.markspec/cache/upstreams/<id>/`
6
+ * into read-only graph citizens carrying an `upstream` origin.
7
+ *
8
+ * Design: ADR-031 (docs/architecture/adr-031-federated-upstream-resolution.md).
9
+ * Sibling of `core/profile/delivered.ts` (`loadDeliveredCorpus`), same
10
+ * purity rules: no I/O of its own — file access via the injected
11
+ * {@linkcode ReadFile}.
12
+ */
13
+ import type { Diagnostic, Entry } from "../model/mod.js";
14
+ import type { ReadFile } from "../config/mod.js";
15
+ /** One locked upstream's cached snapshot (dir written by `markspec lock`). */
16
+ export interface UpstreamSnapshotRef {
17
+ /** projectRef `name` — cache directory, lockfile rows, origin badges. */
18
+ readonly id: string;
19
+ /** Resolved version label recorded by the lockfile (e.g. `v2.1.0`). */
20
+ readonly version: string;
21
+ /** Absolute path to `.markspec/cache/upstreams/<id>`. */
22
+ readonly dir: string;
23
+ }
24
+ /** Result of {@linkcode loadUpstreamCorpus}. */
25
+ export interface LoadUpstreamCorpusResult {
26
+ readonly entries: Entry[];
27
+ readonly diagnostics: Diagnostic[];
28
+ }
29
+ /** File reader injected by the caller (CLI/LSP own the I/O). */
30
+ export type { ReadFile };
31
+ /**
32
+ * Hydrate every locked upstream's cached snapshot into `Entry[]`.
33
+ *
34
+ * Per upstream: read `<dir>/manifest.json`, reject schema skew
35
+ * (UPSTREAM-SNAPSHOT-001), extract the serialized entries, and stamp each
36
+ * with `origin = { kind: "upstream", upstreamId, version }`.
37
+ *
38
+ * Authoritative-source rule (design §4.5): a snapshot entry that already
39
+ * carries an `origin` is a re-export of some other source's entry (the
40
+ * upstream's own corpus or its upstreams) and is skipped — every entry
41
+ * joins an aggregate only from its authoring project. A failing upstream
42
+ * contributes diagnostics but never aborts the others.
43
+ */
44
+ export declare function loadUpstreamCorpus(upstreams: readonly UpstreamSnapshotRef[], readFile: ReadFile): Promise<LoadUpstreamCorpusResult>;
45
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/upstream/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAMzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,gDAAgD;AAChD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;CACpC;AAED,gEAAgE;AAChE,YAAY,EAAE,QAAQ,EAAE,CAAC;AAEzB;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,SAAS,mBAAmB,EAAE,EACzC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,wBAAwB,CAAC,CA2EnC"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * @module upstream
4
+ *
5
+ * Upstream corpus loader — hydrates the cached compiled-JSON snapshots
6
+ * that `markspec lock` writes under `.markspec/cache/upstreams/<id>/`
7
+ * into read-only graph citizens carrying an `upstream` origin.
8
+ *
9
+ * Design: ADR-031 (docs/architecture/adr-031-federated-upstream-resolution.md).
10
+ * Sibling of `core/profile/delivered.ts` (`loadDeliveredCorpus`), same
11
+ * purity rules: no I/O of its own — file access via the injected
12
+ * {@linkcode ReadFile}.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.loadUpstreamCorpus = loadUpstreamCorpus;
16
+ const path_1 = require("@std/path");
17
+ const deserialize_js_1 = require("../compiler/deserialize.js");
18
+ const paths_js_1 = require("../util/paths.js");
19
+ /**
20
+ * Hydrate every locked upstream's cached snapshot into `Entry[]`.
21
+ *
22
+ * Per upstream: read `<dir>/manifest.json`, reject schema skew
23
+ * (UPSTREAM-SNAPSHOT-001), extract the serialized entries, and stamp each
24
+ * with `origin = { kind: "upstream", upstreamId, version }`.
25
+ *
26
+ * Authoritative-source rule (design §4.5): a snapshot entry that already
27
+ * carries an `origin` is a re-export of some other source's entry (the
28
+ * upstream's own corpus or its upstreams) and is skipped — every entry
29
+ * joins an aggregate only from its authoring project. A failing upstream
30
+ * contributes diagnostics but never aborts the others.
31
+ */
32
+ async function loadUpstreamCorpus(upstreams, readFile) {
33
+ const entries = [];
34
+ const diagnostics = [];
35
+ for (const up of upstreams) {
36
+ const manifestPath = (0, path_1.join)(up.dir, "manifest.json");
37
+ const manifestRaw = await readFile(manifestPath);
38
+ if (manifestRaw === undefined) {
39
+ diagnostics.push({
40
+ code: "UPSTREAM-SNAPSHOT-002",
41
+ severity: "error",
42
+ message: `upstream '${up.id}' snapshot manifest is missing or unreadable; ` +
43
+ `run 'markspec lock' to restore the cache`,
44
+ location: { file: manifestPath, line: 1, column: 1 },
45
+ });
46
+ continue;
47
+ }
48
+ let manifest;
49
+ try {
50
+ manifest = JSON.parse(manifestRaw);
51
+ }
52
+ catch (err) {
53
+ diagnostics.push({
54
+ code: "UPSTREAM-SNAPSHOT-003",
55
+ severity: "error",
56
+ message: `malformed upstream snapshot: manifest is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,
57
+ location: { file: manifestPath, line: 1, column: 1 },
58
+ });
59
+ continue;
60
+ }
61
+ const skew = (0, deserialize_js_1.checkSnapshotSchema)(manifest, manifestPath);
62
+ if (skew) {
63
+ diagnostics.push(skew);
64
+ continue;
65
+ }
66
+ // Snapshot files are read relative to the upstream's cache dir. The
67
+ // extractor is sync; pre-read the single file the manifest points at.
68
+ const block = manifest.entries;
69
+ const relFile = block?.file;
70
+ // The manifest is untrusted input (a hostile or corrupted upstream) —
71
+ // reject a data-file path that could escape the cache directory
72
+ // before ever joining it into a read. Latent today (fixtures only);
73
+ // becomes live once slice 2 populates caches from remote sites (repo
74
+ // precedent #699 treated the analogous symlink case as a security
75
+ // blocker).
76
+ if (relFile !== undefined && (0, paths_js_1.isUnsafeRelPath)(relFile)) {
77
+ diagnostics.push({
78
+ code: "UPSTREAM-SNAPSHOT-003",
79
+ severity: "error",
80
+ message: "malformed upstream snapshot: snapshot data-file path escapes the cache directory",
81
+ location: { file: manifestPath, line: 1, column: 1 },
82
+ });
83
+ continue;
84
+ }
85
+ const snapshotContent = relFile !== undefined
86
+ ? await readFile((0, path_1.join)(up.dir, relFile))
87
+ : undefined;
88
+ const extracted = (0, deserialize_js_1.extractSerializedEntries)(manifest, (rel) => (rel === relFile ? snapshotContent : undefined), manifestPath);
89
+ diagnostics.push(...extracted.diagnostics);
90
+ for (const s of extracted.entries) {
91
+ if (s.origin !== undefined)
92
+ continue; // authoritative-source rule
93
+ const entry = (0, deserialize_js_1.deserializeEntry)(s);
94
+ entries.push({
95
+ ...entry,
96
+ origin: { kind: "upstream", upstreamId: up.id, version: up.version },
97
+ });
98
+ }
99
+ }
100
+ return { entries, diagnostics };
101
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @module upstream/project
3
+ *
4
+ * Shared lockfile→upstream hydration (#771): the one function every
5
+ * surface that feeds locked upstream snapshots into the graph goes
6
+ * through — the CLI compiler (`compileProject`), `check`, the LSP
7
+ * (`seedUpstreamCorpus`), and the MCP server (`loadLockedUpstreams`).
8
+ * Composes {@linkcode upstreamRefsFromLockfile} +
9
+ * {@linkcode loadUpstreamCorpus} with the shared no-lockfile /
10
+ * empty-refs short-circuit so the four surfaces' HYDRATION soft-fail
11
+ * and diagnostic semantics cannot drift. Pure — file access via the
12
+ * injected {@linkcode ReadFile}, same rule as `loadUpstreamCorpus`;
13
+ * never throws on a missing or cold cache (failures surface as
14
+ * UPSTREAM-SNAPSHOT-00x diagnostics).
15
+ *
16
+ * Deliberate seam (#771): the `markspec.lock` READ + PARSE stays at the
17
+ * call sites, and their parse-diagnostic handling differs by design —
18
+ * `check` needs the full parse result for its MSL-L212 gate and edge
19
+ * ledger, the LSP keeps a module-scoped `Lockfile` for the
20
+ * `markspec/version` notification and watcher-driven reloads, and the
21
+ * MCP server pairs the read with the file mtime for `isStale()`. Do not
22
+ * fold the read into this function without re-homing those contracts.
23
+ */
24
+ import type { Lockfile } from "../lock/model.js";
25
+ import type { ReadFile } from "../config/mod.js";
26
+ import { type LoadUpstreamCorpusResult } from "./mod.js";
27
+ /**
28
+ * Hydrate a project's locked upstream snapshots into read-only
29
+ * `Entry[]`. Returns empty when there is no lockfile or no
30
+ * snapshot-carrying upstream rows (without touching `readFile`).
31
+ */
32
+ export declare function loadProjectUpstreams(projectRoot: string, lockfile: Lockfile | undefined, readFile: ReadFile): Promise<LoadUpstreamCorpusResult>;
33
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/upstream/project.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAsB,KAAK,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAG7E;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,wBAAwB,CAAC,CAKnC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * @module upstream/project
4
+ *
5
+ * Shared lockfile→upstream hydration (#771): the one function every
6
+ * surface that feeds locked upstream snapshots into the graph goes
7
+ * through — the CLI compiler (`compileProject`), `check`, the LSP
8
+ * (`seedUpstreamCorpus`), and the MCP server (`loadLockedUpstreams`).
9
+ * Composes {@linkcode upstreamRefsFromLockfile} +
10
+ * {@linkcode loadUpstreamCorpus} with the shared no-lockfile /
11
+ * empty-refs short-circuit so the four surfaces' HYDRATION soft-fail
12
+ * and diagnostic semantics cannot drift. Pure — file access via the
13
+ * injected {@linkcode ReadFile}, same rule as `loadUpstreamCorpus`;
14
+ * never throws on a missing or cold cache (failures surface as
15
+ * UPSTREAM-SNAPSHOT-00x diagnostics).
16
+ *
17
+ * Deliberate seam (#771): the `markspec.lock` READ + PARSE stays at the
18
+ * call sites, and their parse-diagnostic handling differs by design —
19
+ * `check` needs the full parse result for its MSL-L212 gate and edge
20
+ * ledger, the LSP keeps a module-scoped `Lockfile` for the
21
+ * `markspec/version` notification and watcher-driven reloads, and the
22
+ * MCP server pairs the read with the file mtime for `isStale()`. Do not
23
+ * fold the read into this function without re-homing those contracts.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.loadProjectUpstreams = loadProjectUpstreams;
27
+ const mod_js_1 = require("./mod.js");
28
+ const refs_js_1 = require("./refs.js");
29
+ /**
30
+ * Hydrate a project's locked upstream snapshots into read-only
31
+ * `Entry[]`. Returns empty when there is no lockfile or no
32
+ * snapshot-carrying upstream rows (without touching `readFile`).
33
+ */
34
+ async function loadProjectUpstreams(projectRoot, lockfile, readFile) {
35
+ if (!lockfile)
36
+ return { entries: [], diagnostics: [] };
37
+ const refs = (0, refs_js_1.upstreamRefsFromLockfile)(lockfile, projectRoot);
38
+ if (refs.length === 0)
39
+ return { entries: [], diagnostics: [] };
40
+ return await (0, mod_js_1.loadUpstreamCorpus)(refs, readFile);
41
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @module upstream/refs
3
+ *
4
+ * Map a parsed markspec.lock's snapshot-carrying upstream rows to the
5
+ * UpstreamSnapshotRef[] loadUpstreamCorpus consumes. Pure — no I/O.
6
+ */
7
+ import type { Lockfile } from "../lock/model.js";
8
+ import type { UpstreamSnapshotRef } from "./mod.js";
9
+ /**
10
+ * Map a parsed lockfile's snapshot-carrying upstream rows to
11
+ * UpstreamSnapshotRef[] for loadUpstreamCorpus. Registry + dependency
12
+ * rows with a `snapshot` are included; rows without a snapshot (legacy
13
+ * pin-only) are skipped.
14
+ *
15
+ * The `version` field feeds the origin badge (`<id>@<version>`).
16
+ * Registry rows use their published `project.version`, falling back to
17
+ * `UNVERSIONED` when unpublished. Dependency rows carry no `version`, so
18
+ * the label is derived from the `resolved` pin via
19
+ * {@linkcode versionFromResolved} (#800) — previously every git
20
+ * dependency rendered as `<id>@unversioned` despite carrying a precise pin.
21
+ */
22
+ export declare function upstreamRefsFromLockfile(lockfile: Lockfile, projectRoot: string): UpstreamSnapshotRef[];
23
+ //# sourceMappingURL=refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/upstream/refs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAwBpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,GAClB,mBAAmB,EAAE,CAqBvB"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ /**
3
+ * @module upstream/refs
4
+ *
5
+ * Map a parsed markspec.lock's snapshot-carrying upstream rows to the
6
+ * UpstreamSnapshotRef[] loadUpstreamCorpus consumes. Pure — no I/O.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.upstreamRefsFromLockfile = upstreamRefsFromLockfile;
10
+ const path_1 = require("@std/path");
11
+ const upstream_refs_js_1 = require("../lock/upstream_refs.js");
12
+ /** Fallback badge label when an upstream row carries neither a `version`
13
+ * field nor a `resolved` pin to derive one from. */
14
+ const UNVERSIONED = "unversioned";
15
+ /**
16
+ * Derive a human-readable badge label from a git dependency's `resolved`
17
+ * pin (`"tag:<t>"` | `"branch:<b>"` | `"sha:<s>"`). A tag or branch pin
18
+ * renders bare (`v2.1.0`, `main`); a sha pin renders as its 7-char short
19
+ * hash (`abcdef0`). A pin with an unrecognised scheme renders verbatim,
20
+ * and an empty pin falls back to `UNVERSIONED` (#800).
21
+ */
22
+ function versionFromResolved(resolved) {
23
+ const colon = resolved.indexOf(":");
24
+ if (colon < 0)
25
+ return resolved || UNVERSIONED;
26
+ const scheme = resolved.slice(0, colon);
27
+ const rest = resolved.slice(colon + 1);
28
+ if (rest.length === 0)
29
+ return UNVERSIONED;
30
+ if (scheme === "sha")
31
+ return rest.slice(0, 7);
32
+ if (scheme === "tag" || scheme === "branch")
33
+ return rest;
34
+ return resolved;
35
+ }
36
+ /**
37
+ * Map a parsed lockfile's snapshot-carrying upstream rows to
38
+ * UpstreamSnapshotRef[] for loadUpstreamCorpus. Registry + dependency
39
+ * rows with a `snapshot` are included; rows without a snapshot (legacy
40
+ * pin-only) are skipped.
41
+ *
42
+ * The `version` field feeds the origin badge (`<id>@<version>`).
43
+ * Registry rows use their published `project.version`, falling back to
44
+ * `UNVERSIONED` when unpublished. Dependency rows carry no `version`, so
45
+ * the label is derived from the `resolved` pin via
46
+ * {@linkcode versionFromResolved} (#800) — previously every git
47
+ * dependency rendered as `<id>@unversioned` despite carrying a precise pin.
48
+ */
49
+ function upstreamRefsFromLockfile(lockfile, projectRoot) {
50
+ const cacheRoot = (0, upstream_refs_js_1.upstreamCacheRoot)(projectRoot);
51
+ const refs = [];
52
+ for (const u of lockfile.upstreams) {
53
+ if (u.kind !== "registry" && u.kind !== "dependency")
54
+ continue;
55
+ if (u.snapshot === undefined)
56
+ continue;
57
+ let version;
58
+ if ("version" in u && u.version) {
59
+ version = u.version;
60
+ }
61
+ else if (u.kind === "dependency") {
62
+ version = versionFromResolved(u.resolved);
63
+ }
64
+ else {
65
+ version = UNVERSIONED;
66
+ }
67
+ refs.push({
68
+ id: u.id,
69
+ version,
70
+ dir: (0, path_1.join)(cacheRoot, u.id),
71
+ });
72
+ }
73
+ return refs;
74
+ }
@@ -1,38 +1,29 @@
1
1
  /**
2
- * @module core/util/fence
3
- *
4
- * Prose-line walker that skips lines inside fenced code blocks.
5
- * Several validator and formatter passes (body-block exclusions,
6
- * caption adjacency, `$Identifier` extraction, modal-keyword
7
- * normalisation) all needed to walk an entry body line-by-line while
8
- * treating fenced code as verbatim. This helper centralises that
9
- * pattern so the fence-toggle semantics stay consistent.
10
- *
11
- * Fence detection follows CommonMark §4.5 — a line whose first
12
- * non-whitespace content is three or more backticks or tildes opens
13
- * (or closes) a fenced block. The language tag that may follow the
14
- * opening fence does not affect detection: we toggle on every fence
15
- * marker regardless. (Mismatched marker types — ``` opener / ~~~
16
- * closer — are accepted by the walker because real Markdown parsers
17
- * already reject those upstream.)
2
+ * Legacy fence-prefix candidate used by the LSP source-file scanner.
3
+ * Markdown fence membership uses the AST-backed helpers below.
18
4
  */
19
- /** Three or more backticks or tildes at the start of a line. */
20
5
  export declare const FENCE_RE: RegExp;
21
- /** Callback for {@linkcode walkProseLines}. Receives one line + its 0-based index. */
6
+ /**
7
+ * Compute zero-based fenced-code lines, including opening and closing lines.
8
+ * Cache the sets for the 64 most recently queried exact document texts. Each
9
+ * call returns a new copy, so a caller that changes it cannot alter the cache.
10
+ * Callers making multiple membership queries should compute this set once and
11
+ * pass it to {@linkcode isLineFenced} or {@linkcode walkProseLines}.
12
+ */
13
+ export declare function fencedCodeLines(body: string): ReadonlySet<number>;
14
+ /**
15
+ * Callback for {@linkcode walkProseLines}. Receives a line and its 0-based index.
16
+ * The LF delimiter is excluded; a CR from a CRLF delimiter is preserved.
17
+ */
22
18
  export type ProseLineCallback = (line: string, index: number) => void;
23
19
  /**
24
- * Walk `body` line by line, invoking `cb` for every line that's NOT
25
- * inside a fenced code block. The first fence marker opens the block;
26
- * the next closes it. The fence-marker lines themselves are also
27
- * skipped (they're structural, not prose).
20
+ * Walk lines outside fenced code, using the cached CommonMark line set unless
21
+ * a precomputed set for this exact text is supplied. Indented code is yielded.
28
22
  */
29
- export declare function walkProseLines(body: string, cb: ProseLineCallback): void;
23
+ export declare function walkProseLines(body: string, cb: ProseLineCallback, fencedLines?: ReadonlySet<number>): void;
30
24
  /**
31
- * Return whether `lineIndex` (0-based) is a line {@linkcode walkProseLines}
32
- * would skip — either a fence-marker line itself, or content inside a
33
- * fenced block. Single-line-membership counterpart to `walkProseLines`'s
34
- * full-body callback walk, for callers that only need a yes/no answer for
35
- * one position (e.g. an LSP request gating a cursor position, #680).
25
+ * Return whether a zero-based document line belongs to the fenced-line set.
26
+ * Supply the set for this exact text when querying multiple positions.
36
27
  */
37
- export declare function isLineFenced(body: string, lineIndex: number): boolean;
28
+ export declare function isLineFenced(body: string, lineIndex: number, fencedLines?: ReadonlySet<number>): boolean;
38
29
  //# sourceMappingURL=fence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../src/util/fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAkB,CAAC;AAExC,sFAAsF;AACtF,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAYxE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAYrE"}
1
+ {"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../src/util/fence.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAkB,CAAC;AAKxC;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAajE;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,iBAAiB,EACrB,WAAW,GAAE,WAAW,CAAC,MAAM,CAAyB,GACvD,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,WAAW,CAAC,MAAM,CAAyB,GACvD,OAAO,CAET"}