@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
@@ -0,0 +1,172 @@
1
+ /**
2
+ * @module core/lock/upstream_deps
3
+ *
4
+ * Lock-mediated acquisition of org-manifest `dependencies:` git repositories
5
+ * (design §4.3), the sibling of `upstream_refs.ts`. Unlike a `references:`
6
+ * published site (fetched as ready JSON), a dependency is a git tree we
7
+ * resolve, acquire at one sha, and compile in-process into the same cache
8
+ * layout. Three flows: first-lock (resolve intent → acquire → compile → pin),
9
+ * keep/restore (pin exists → verify cache offline, re-acquire the *pinned* sha
10
+ * only to repopulate), update (`--update` → re-resolve + move the pin).
11
+ *
12
+ * Warn-and-write policy (design §4.2, decision 1): an unreachable dependency
13
+ * yields a warning and the resolvable pins still lock. Pure — git, fs, and
14
+ * temp-dir access flow through {@linkcode UpstreamDepsIO}.
15
+ */
16
+ import { join } from "@std/path";
17
+ import { deriveUpstreamId, probeCacheSnapshot } from "./upstream_refs.js";
18
+ import { upstreamNotLockable, writeCacheFiles } from "./upstream_common.js";
19
+ import { resolveIntent } from "./git_intent.js";
20
+ /** Warn-and-write diagnostic — one dependency could not be locked (decision 1). */
21
+ function l213(id, detail) {
22
+ return upstreamNotLockable("dependency", id, detail);
23
+ }
24
+ /** Cross-kind id-collision diagnostic — a dependency id is already claimed
25
+ * by a `references:` entry (warn-and-write: the dependency is skipped). */
26
+ function l216(id) {
27
+ return {
28
+ code: "MSL-L216",
29
+ severity: "warning",
30
+ message: `upstream id '${id}' is claimed by both a 'references:' entry and a ` +
31
+ `'dependencies:' entry — skipping the dependency (the reference ` +
32
+ `snapshot owns the cache); set a distinct 'name:' on one of them`,
33
+ location: undefined,
34
+ };
35
+ }
36
+ /** Acquire the tree at `sha` into a fresh temp dir, compile it, clean up.
37
+ * A temp-dir creation failure is turned into a warn-and-write `{ error }`
38
+ * rather than propagating and aborting the whole lock. */
39
+ async function acquireAndCompile(url, sha, io) {
40
+ let tmp;
41
+ try {
42
+ tmp = await io.makeTempDir();
43
+ }
44
+ catch (err) {
45
+ return {
46
+ error: `temp dir creation failed (${err instanceof Error ? err.message : String(err)})`,
47
+ };
48
+ }
49
+ try {
50
+ const acq = await io.git.acquireTree(url, sha, tmp);
51
+ if (acq.error !== undefined) {
52
+ return { error: `acquire ${sha.slice(0, 12)} failed (${acq.error})` };
53
+ }
54
+ return await io.compileTree(tmp);
55
+ }
56
+ finally {
57
+ await io.removeDir(tmp);
58
+ }
59
+ }
60
+ /** Write `manifest.json` + `compiled.json` for a snapshot under `dir`. The
61
+ * clean `id` (not `dir`) is threaded through so a cache-write-failure
62
+ * warning names the upstream, not the raw cache path. */
63
+ function writeSnapshotCache(id, dir, snap, io) {
64
+ const writes = [
65
+ [
66
+ join(dir, "manifest.json"),
67
+ new TextEncoder().encode(JSON.stringify(snap.manifestJson, null, 2)),
68
+ ],
69
+ [join(dir, "compiled.json"), snap.compiledBytes],
70
+ ];
71
+ return writeCacheFiles(writes, "dependency", id, io.writeFile);
72
+ }
73
+ /**
74
+ * RESTORE — the pin exists but its cache is missing or hash-broken. Re-acquire
75
+ * the *pinned* sha (intent is NOT re-resolved) purely to repopulate the cache;
76
+ * the pin never moves. Returns a warning on any failure (unreachable, markspec
77
+ * version skew, or cache-write error) and `undefined` on a clean repopulate.
78
+ * In every case the caller keeps the existing row.
79
+ */
80
+ async function restore(id, existing, dir, io) {
81
+ const snap = await acquireAndCompile(existing.url, existing.sha, io);
82
+ if ("error" in snap)
83
+ return l213(id, `restore failed: ${snap.error}`);
84
+ if (snap.snapshot !== existing.snapshot) {
85
+ // Same sha but a different compiled hash → markspec wire-format skew
86
+ // (the source is byte-identical by git's guarantee). Keep the pin, do
87
+ // not clobber the cache; tell the user to re-pin explicitly.
88
+ return l213(id, `restore recompiled to a different snapshot (markspec version skew?) — run 'markspec lock --update=${id}' to re-pin`);
89
+ }
90
+ return await writeSnapshotCache(id, dir, snap, io);
91
+ }
92
+ /**
93
+ * FIRST-LOCK or UPDATE — resolve the declared intent to a sha, acquire,
94
+ * compile, and write the cache. Returns the new pinned row, or a warning
95
+ * (ls-remote / intent / acquire / cache-write failure). The caller decides
96
+ * whether to fall back to a prior `existing` row.
97
+ */
98
+ async function firstLockOrUpdate(ref, id, dir, intent, io, lockedAt) {
99
+ const refs = await io.git.lsRemote(ref.url);
100
+ if ("error" in refs)
101
+ return l213(id, `ls-remote failed (${refs.error})`);
102
+ const ri = resolveIntent(intent, refs);
103
+ if ("error" in ri)
104
+ return l213(id, ri.error);
105
+ const snap = await acquireAndCompile(ref.url, ri.sha, io);
106
+ if ("error" in snap)
107
+ return l213(id, snap.error);
108
+ const writeErr = await writeSnapshotCache(id, dir, snap, io);
109
+ if (writeErr)
110
+ return writeErr;
111
+ return {
112
+ kind: "dependency",
113
+ id,
114
+ url: ref.url,
115
+ intent,
116
+ resolved: ri.resolved,
117
+ sha: ri.sha,
118
+ snapshot: snap.snapshot,
119
+ lockedAt,
120
+ };
121
+ }
122
+ export async function resolveProjectDependencies(opts) {
123
+ const dependencies = [];
124
+ const diagnostics = [];
125
+ const byId = new Map(opts.existing.map((row) => [row.id, row]));
126
+ const seen = new Set();
127
+ for (const ref of opts.dependencies) {
128
+ const id = deriveUpstreamId(ref);
129
+ if (id === undefined) {
130
+ diagnostics.push(l213(ref.name ?? ref.url, "no safe upstream id could be derived — set an explicit 'name:'"));
131
+ continue;
132
+ }
133
+ // Cross-kind collision: a `references:` entry already owns this id.
134
+ // Skip the dependency (warn-and-write) — it must not clobber the cache.
135
+ if (opts.reservedIds?.has(id)) {
136
+ diagnostics.push(l216(id));
137
+ continue;
138
+ }
139
+ if (seen.has(id)) {
140
+ diagnostics.push(l213(id, "duplicate upstream id — set distinct 'name:'"));
141
+ continue;
142
+ }
143
+ seen.add(id);
144
+ const dir = join(opts.cacheRoot, id);
145
+ const existing = byId.get(id);
146
+ const selectedForUpdate = opts.update === true || opts.update === id;
147
+ // KEEP / RESTORE
148
+ if (existing !== undefined && !selectedForUpdate) {
149
+ if (await probeCacheSnapshot(dir, existing.snapshot, opts.io.readFile)) {
150
+ dependencies.push(existing); // idempotent — no git
151
+ continue;
152
+ }
153
+ const restoreDiag = await restore(id, existing, dir, opts.io);
154
+ if (restoreDiag)
155
+ diagnostics.push(restoreDiag);
156
+ dependencies.push(existing); // the pin never moves on restore
157
+ continue;
158
+ }
159
+ // FIRST-LOCK or UPDATE.
160
+ const intent = ref.version ?? "auto";
161
+ const outcome = await firstLockOrUpdate(ref, id, dir, intent, opts.io, opts.lockedAt);
162
+ if ("code" in outcome) {
163
+ diagnostics.push(outcome);
164
+ if (existing !== undefined)
165
+ dependencies.push(existing);
166
+ }
167
+ else {
168
+ dependencies.push(outcome);
169
+ }
170
+ }
171
+ return { dependencies, diagnostics };
172
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @module lock/upstream_refs
3
+ *
4
+ * Lock-mediated resolution of org-manifest `references:` projectRefs
5
+ * (design §4.2): fetch a published compile-output snapshot over https or
6
+ * `file://`, cache it under `.markspec/cache/upstreams/<id>/`, and pin it
7
+ * as an extended `[[upstream.registry]]` lockfile row. Three flows:
8
+ * first lock (new declaration → fetch + pin), keep/restore (pin exists →
9
+ * verify cache offline, refetch only to repopulate, never move the pin),
10
+ * update (`--update` → refetch + move the pin).
11
+ *
12
+ * Pure module: network and file access only via {@linkcode UpstreamRefsIO}.
13
+ */
14
+ import type { Diagnostic, ProjectRef } from "../model/mod.js";
15
+ import type { UpstreamRegistry } from "./model.js";
16
+ import type { FetchUrl, ReadFile } from "./resolve.js";
17
+ /**
18
+ * Root directory under which every upstream's cached snapshot is stored,
19
+ * one subdirectory per upstream id (`<root>/<id>/manifest.json`, etc.).
20
+ * Shared by `markspec lock` (the writer) and `markspec check` (the
21
+ * offline MSL-L212 prober) so the two commands can never disagree on
22
+ * where the cache lives.
23
+ */
24
+ export declare function upstreamCacheRoot(projectRoot: string): string;
25
+ /** IO seam — the CLI supplies Deno-backed implementations. */
26
+ export interface UpstreamRefsIO {
27
+ readonly fetchUrl: FetchUrl;
28
+ /** Bytes reader used to probe the existing cache (missing → `{error}`). */
29
+ readonly readFile: ReadFile;
30
+ /** Write `bytes` to `path`, creating parent directories. */
31
+ readonly writeFile: (path: string, bytes: Uint8Array) => Promise<{
32
+ error?: string;
33
+ }>;
34
+ }
35
+ /** See module doc. */
36
+ export interface ResolveProjectReferencesOptions {
37
+ readonly references: readonly ProjectRef[];
38
+ readonly existing: readonly UpstreamRegistry[];
39
+ readonly cacheRoot: string;
40
+ readonly update: boolean | string;
41
+ readonly io: UpstreamRefsIO;
42
+ readonly lockedAt: string;
43
+ }
44
+ /** Result of {@linkcode resolveProjectReferences}. */
45
+ export interface ResolveProjectReferencesResult {
46
+ readonly registries: UpstreamRegistry[];
47
+ readonly diagnostics: Diagnostic[];
48
+ }
49
+ /**
50
+ * Derive the upstream id for a projectRef: the explicit `name`, else the
51
+ * last non-empty path segment of the URL with any `.git` suffix stripped.
52
+ * Returns `undefined` when no safe id can be derived.
53
+ */
54
+ export declare function deriveUpstreamId(ref: ProjectRef): string | undefined;
55
+ /**
56
+ * Probe whether the cached snapshot under `dir` is present and hash-intact
57
+ * against `snapshot`: `manifest.json` must exist and parse, its
58
+ * `entries.file` must name a safe relative path, and the hashed bytes of
59
+ * that file must equal `snapshot`.
60
+ *
61
+ * Shared by {@linkcode cacheIntact} (this module's keep/restore flow) and
62
+ * `verifyUpstreamCache` (`cache_check.ts`'s MSL-L212 offline cache-drift
63
+ * gate) so the two never disagree on what "cache intact" means — the
64
+ * single probe implementation, not a duplicate.
65
+ */
66
+ export declare function probeCacheSnapshot(dir: string, snapshot: string, readFile: ReadFile): Promise<boolean>;
67
+ /** See module doc for the flow table. */
68
+ export declare function resolveProjectReferences(opts: ResolveProjectReferencesOptions): Promise<ResolveProjectReferencesResult>;
69
+ //# sourceMappingURL=upstream_refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstream_refs.d.ts","sourceRoot":"","sources":["../../src/lock/upstream_refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE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E,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAgCD,yCAAyC;AACzC,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,8BAA8B,CAAC,CAkGzC"}
@@ -0,0 +1,238 @@
1
+ /**
2
+ * @module lock/upstream_refs
3
+ *
4
+ * Lock-mediated resolution of org-manifest `references:` projectRefs
5
+ * (design §4.2): fetch a published compile-output snapshot over https or
6
+ * `file://`, cache it under `.markspec/cache/upstreams/<id>/`, and pin it
7
+ * as an extended `[[upstream.registry]]` lockfile row. Three flows:
8
+ * first lock (new declaration → fetch + pin), keep/restore (pin exists →
9
+ * verify cache offline, refetch only to repopulate, never move the pin),
10
+ * update (`--update` → refetch + move the pin).
11
+ *
12
+ * Pure module: network and file access only via {@linkcode UpstreamRefsIO}.
13
+ */
14
+ import { join } from "@std/path";
15
+ import { sha256Bytes } from "./hash.js";
16
+ import { upstreamNotLockable, writeCacheFiles } from "./upstream_common.js";
17
+ import { checkSnapshotSchema } from "../compiler/deserialize.js";
18
+ import { isUnsafeRelPath } from "../util/paths.js";
19
+ /**
20
+ * Root directory under which every upstream's cached snapshot is stored,
21
+ * one subdirectory per upstream id (`<root>/<id>/manifest.json`, etc.).
22
+ * Shared by `markspec lock` (the writer) and `markspec check` (the
23
+ * offline MSL-L212 prober) so the two commands can never disagree on
24
+ * where the cache lives.
25
+ */
26
+ export function upstreamCacheRoot(projectRoot) {
27
+ return join(projectRoot, ".markspec", "cache", "upstreams");
28
+ }
29
+ /** Safe upstream id — a single path segment (also enforced by the config
30
+ * loader on explicit `name:` values). */
31
+ const UPSTREAM_ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
32
+ /**
33
+ * Derive the upstream id for a projectRef: the explicit `name`, else the
34
+ * last non-empty path segment of the URL with any `.git` suffix stripped.
35
+ * Returns `undefined` when no safe id can be derived.
36
+ */
37
+ export function deriveUpstreamId(ref) {
38
+ if (ref.name !== undefined) {
39
+ return UPSTREAM_ID_RE.test(ref.name) ? ref.name : undefined;
40
+ }
41
+ const trimmed = ref.url.replace(/\/+$/, "");
42
+ const segment = trimmed.split(/[/:]/).filter((s) => s.length > 0).pop();
43
+ if (segment === undefined)
44
+ return undefined;
45
+ const id = segment.replace(/\.git$/, "");
46
+ return UPSTREAM_ID_RE.test(id) ? id : undefined;
47
+ }
48
+ function l213(id, detail) {
49
+ return upstreamNotLockable("reference", id, detail);
50
+ }
51
+ async function fetchSnapshot(id, baseUrl, fetchUrl) {
52
+ const manifestUrl = `${baseUrl}/manifest.json`;
53
+ const manifestBytes = await fetchUrl(manifestUrl);
54
+ if ("error" in manifestBytes) {
55
+ return l213(id, `fetch of ${manifestUrl} failed (${manifestBytes.error})`);
56
+ }
57
+ let manifest;
58
+ try {
59
+ manifest = JSON.parse(new TextDecoder().decode(manifestBytes));
60
+ }
61
+ catch (err) {
62
+ return l213(id, `manifest.json is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
63
+ }
64
+ const skew = checkSnapshotSchema(manifest, manifestUrl);
65
+ if (skew)
66
+ return l213(id, skew.message);
67
+ const entriesFile = manifest.entries?.file;
68
+ if (entriesFile === undefined || isUnsafeRelPath(entriesFile)) {
69
+ return l213(id, "manifest entries block missing or names an unsafe path");
70
+ }
71
+ const files = new Map();
72
+ const dataBytes = await fetchUrl(`${baseUrl}/${entriesFile}`);
73
+ if ("error" in dataBytes) {
74
+ return l213(id, `fetch of '${entriesFile}' failed (${dataBytes.error})`);
75
+ }
76
+ files.set(entriesFile, dataBytes);
77
+ const indexFile = manifest.entries?.index;
78
+ if (manifest.entries?.format === "ndjson" && indexFile !== undefined) {
79
+ if (isUnsafeRelPath(indexFile)) {
80
+ return l213(id, "manifest entries index names an unsafe path");
81
+ }
82
+ const indexBytes = await fetchUrl(`${baseUrl}/${indexFile}`);
83
+ if ("error" in indexBytes) {
84
+ return l213(id, `fetch of '${indexFile}' failed (${indexBytes.error})`);
85
+ }
86
+ files.set(indexFile, indexBytes);
87
+ }
88
+ return {
89
+ manifestBytes,
90
+ manifest,
91
+ files,
92
+ snapshotHash: await sha256Bytes(dataBytes),
93
+ };
94
+ }
95
+ function writeCache(id, dir, fetched, io) {
96
+ const writes = [
97
+ [join(dir, "manifest.json"), fetched.manifestBytes],
98
+ ...[...fetched.files].map(([rel, bytes]) => [join(dir, rel), bytes]),
99
+ ];
100
+ return writeCacheFiles(writes, "reference", id, io.writeFile);
101
+ }
102
+ /**
103
+ * Probe whether the cached snapshot under `dir` is present and hash-intact
104
+ * against `snapshot`: `manifest.json` must exist and parse, its
105
+ * `entries.file` must name a safe relative path, and the hashed bytes of
106
+ * that file must equal `snapshot`.
107
+ *
108
+ * Shared by {@linkcode cacheIntact} (this module's keep/restore flow) and
109
+ * `verifyUpstreamCache` (`cache_check.ts`'s MSL-L212 offline cache-drift
110
+ * gate) so the two never disagree on what "cache intact" means — the
111
+ * single probe implementation, not a duplicate.
112
+ */
113
+ export async function probeCacheSnapshot(dir, snapshot, readFile) {
114
+ const manifestBytes = await readFile(join(dir, "manifest.json"));
115
+ if ("error" in manifestBytes)
116
+ return false;
117
+ let entriesFile;
118
+ try {
119
+ const manifest = JSON.parse(new TextDecoder().decode(manifestBytes));
120
+ entriesFile = manifest.entries?.file;
121
+ }
122
+ catch {
123
+ return false;
124
+ }
125
+ if (entriesFile === undefined || isUnsafeRelPath(entriesFile))
126
+ return false;
127
+ const dataBytes = await readFile(join(dir, entriesFile));
128
+ if ("error" in dataBytes)
129
+ return false;
130
+ return await sha256Bytes(dataBytes) === snapshot;
131
+ }
132
+ /** Is the cached snapshot for `row` present and hash-intact? */
133
+ async function cacheIntact(row, dir, readFile) {
134
+ if (row.snapshot === undefined)
135
+ return false;
136
+ return await probeCacheSnapshot(dir, row.snapshot, readFile);
137
+ }
138
+ function buildRow(id, baseUrl, fetched, manifestHash, lockedAt) {
139
+ const version = fetched.manifest.project?.version;
140
+ return {
141
+ kind: "registry",
142
+ id,
143
+ api: baseUrl,
144
+ resolvedManifestHash: manifestHash,
145
+ markspecSchema: fetched.manifest.markspecSchemaVersion,
146
+ ...(typeof version === "string" ? { version } : {}),
147
+ snapshot: fetched.snapshotHash,
148
+ lockedAt,
149
+ };
150
+ }
151
+ /** See module doc for the flow table. */
152
+ export async function resolveProjectReferences(opts) {
153
+ const registries = [];
154
+ const diagnostics = [];
155
+ const byId = new Map(opts.existing.map((row) => [row.id, row]));
156
+ const seen = new Set();
157
+ for (const ref of opts.references) {
158
+ const id = deriveUpstreamId(ref);
159
+ if (id === undefined) {
160
+ diagnostics.push(l213(ref.name ?? ref.url, "no safe upstream id could be derived — set an explicit 'name:'"));
161
+ continue;
162
+ }
163
+ if (seen.has(id)) {
164
+ diagnostics.push(l213(id, `duplicate upstream id (also derived for an earlier entry) — set distinct 'name:' values`));
165
+ continue;
166
+ }
167
+ seen.add(id);
168
+ const baseUrl = ref.url.replace(/\/+$/, "");
169
+ // join() at construction (#771): a template concat would mix the
170
+ // platform separator with a literal `/` — the Windows drift class
171
+ // that bit slices 2 and 4. Writer and reader must agree byte-for-byte.
172
+ const dir = join(opts.cacheRoot, id);
173
+ const existing = byId.get(id);
174
+ const selectedForUpdate = opts.update === true || opts.update === id;
175
+ if (existing !== undefined && !selectedForUpdate) {
176
+ // Keep — verify offline; restore only when the cache is broken.
177
+ if (await cacheIntact(existing, dir, opts.io.readFile)) {
178
+ registries.push(existing);
179
+ continue;
180
+ }
181
+ const fetched = await fetchSnapshot(id, baseUrl, opts.io.fetchUrl);
182
+ if ("code" in fetched) {
183
+ diagnostics.push(fetched);
184
+ registries.push(existing); // keep the pin; cache stays broken
185
+ continue;
186
+ }
187
+ // A snapshot-less existing row (representable — e.g. a hand-edited
188
+ // or pre-existing lockfile entry) has no pin to verify the fetch
189
+ // against; comparing against `undefined` would always "mismatch".
190
+ // Treat it as a first-lock/re-pin instead of MSL-L214.
191
+ if (existing.snapshot !== undefined &&
192
+ fetched.snapshotHash !== existing.snapshot) {
193
+ diagnostics.push({
194
+ code: "MSL-L214",
195
+ severity: "warning",
196
+ message: `upstream reference '${id}' restore mismatch: fetched snapshot ` +
197
+ `${fetched.snapshotHash} does not match locked ${existing.snapshot} — ` +
198
+ `the published site moved; run 'markspec lock --update=${id}' to move the pin`,
199
+ location: undefined,
200
+ });
201
+ registries.push(existing);
202
+ continue;
203
+ }
204
+ const writeError = await writeCache(id, dir, fetched, opts.io);
205
+ if (writeError) {
206
+ diagnostics.push(writeError);
207
+ registries.push(existing);
208
+ continue;
209
+ }
210
+ if (existing.snapshot === undefined) {
211
+ const manifestHash = await sha256Bytes(fetched.manifestBytes);
212
+ registries.push(buildRow(id, baseUrl, fetched, manifestHash, opts.lockedAt));
213
+ }
214
+ else {
215
+ registries.push(existing);
216
+ }
217
+ continue;
218
+ }
219
+ // First lock, or explicitly selected for update.
220
+ const fetched = await fetchSnapshot(id, baseUrl, opts.io.fetchUrl);
221
+ if ("code" in fetched) {
222
+ diagnostics.push(fetched);
223
+ if (existing !== undefined)
224
+ registries.push(existing);
225
+ continue;
226
+ }
227
+ const writeError = await writeCache(id, dir, fetched, opts.io);
228
+ if (writeError) {
229
+ diagnostics.push(writeError);
230
+ if (existing !== undefined)
231
+ registries.push(existing);
232
+ continue;
233
+ }
234
+ const manifestHash = await sha256Bytes(fetched.manifestBytes);
235
+ registries.push(buildRow(id, baseUrl, fetched, manifestHash, opts.lockedAt));
236
+ }
237
+ return { registries, diagnostics };
238
+ }
package/esm/mod.d.ts CHANGED
@@ -8,18 +8,17 @@
8
8
  * from core/mod.ts, never from internal paths.
9
9
  */
10
10
  import "./_dnt.polyfills.js";
11
- export declare const VERSION = "0.10.3";
12
- export declare const CORE_SCHEMA_VERSION = 1;
13
- export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, DEFAULT_PROJECT_CONFIG, descendantsOf, formatEntryOrigin, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
14
- export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, DeliveredDocument, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryOrigin, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, RelationDef, Severity, SourceLocation, Ulid, } from "./model/mod.js";
11
+ export declare const VERSION = "0.11.0";
12
+ export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, CORE_SCHEMA_VERSION, DEFAULT_PROJECT_CONFIG, descendantsOf, emittableEntries, formatEntryOrigin, isUpstreamEntry, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, sameOriginSource, } from "./model/mod.js";
13
+ export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, DeliveredDocument, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryOrigin, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProjectRef, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, RelationDef, Severity, SourceLocation, Ulid, } from "./model/mod.js";
15
14
  export { astEquivalent } from "./ast/equivalence.js";
16
15
  export { normalizeBodyAst } from "./ast/normalize.js";
17
16
  export { render } from "./ast/render.js";
18
17
  export type { AdmonitionKind, BlockquoteNode, BodyBlock, CaptionNode, CodeNode, DefinitionListNode, DefinitionPair, FeatureNode, FigureNode, InlineContent, ListItemNode, ListNode, MathNode, NoteNode, ParagraphNode, SourceRange, TableNode, UnknownNode, } from "./ast/nodes.js";
19
18
  export { discoverProjectRoot, loadConfig, parseProjectConfig, } from "./config/mod.js";
20
19
  export type { LoadConfigResult, ReadFile } from "./config/mod.js";
21
- export { addProfileSpecifier, discoverMarkspecRoot, MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
22
- export type { MarkspecYaml, ParseMarkspecYamlResult, } from "./config/markspec.js";
20
+ export { addProfileSpecifier, DEFAULT_TOOL_CONFIG, discoverMarkspecRoot, loadToolConfig, MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
21
+ export type { MarkspecYaml, ParseMarkspecYamlResult, ToolConfig, } from "./config/markspec.js";
23
22
  export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit, ensureCacheGitignored, loadChain, loadProfileForCommand, mergeChain, parseManifest, resolveEntryColor, resolveGitSpecifier, resolveLocalSpecifier, } from "./profile/mod.js";
24
23
  export type { AppendFile, CacheLocation, GitCacheKeyInput, LoadChainOptions, LoadChainResult, LoadProfileForCommandResult, MergeResult, ParseManifestResult, ResolvedProfileSource, ResolveGitOptions, RunGit, RunGitResult, } from "./profile/mod.js";
25
24
  export { buildEffectiveDisciplineRegistry } from "./profile/mod.js";
@@ -50,13 +49,16 @@ export type { ReportFormat, ReportKind, ReportOptions, } from "./reporter/mod.js
50
49
  export { ANTI_PATTERN_NOTE, computeScoreRollup, isProseScope, runLint, } from "./lint/mod.js";
51
50
  export type { EntryScore, LintDiagnostic, LintOptions, LintResult, RuleContribution, ScoreRollup, } from "./lint/mod.js";
52
51
  export * as typl from "./typl/mod.js";
53
- export { canonicalEdgeJson, checkDrift, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
54
- export type { BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, EdgeQuad, FetchUrl, GeneratedCache, LockedAttributes, LockEdge, Lockfile, LockfileMeta, LockfileToolchain, OfflineEdgeDrift, ParseLockfileResult, ReadFile as LockReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, Upstream, UpstreamProfile, UpstreamReference, UpstreamRegistry, } from "./lock/mod.js";
52
+ export { uxilDeclaringTypes, validateUxilFamily, } from "./validator/uxil_family.js";
53
+ export * as uxil from "./uxil/mod.js";
54
+ export { canonicalEdgeJson, checkDrift, compileAcquiredTree, dependencyPinAssurance, deriveUpstreamId, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, parseLsRemote, resolveBoundEntries, resolveIntent, resolveProfileChain, resolveProjectDependencies, resolveProjectReferences, resolveReferences, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, upstreamCacheRoot, verifyUpstreamCache, } from "./lock/mod.js";
55
+ export type { AcquireCompileIO, BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, CompiledSnapshot, EdgeQuad, FetchUrl, GeneratedCache, GitIO, GitRef, LockedAttributes, LockEdge, Lockfile, LockfileMeta, LockfileToolchain, OfflineEdgeDrift, ParseLockfileResult, ReadFile as LockReadFile, RefList, ResolvedBoundEntry, ResolvedIntent, ResolvedProfile, ResolvedReference, ResolvedUpstreams, ResolveProjectDependenciesOptions, ResolveProjectDependenciesResult, ResolveProjectReferencesOptions, ResolveProjectReferencesResult, ResolveUpstreamsOptions, Upstream, UpstreamDependency, UpstreamDepsIO, UpstreamProfile, UpstreamReference, UpstreamRefsIO, UpstreamRegistry, } from "./lock/mod.js";
55
56
  export { buildRefIndex, canonicalizeRefs, TRACE_ATTRIBUTE_KEYS, } from "./refs/mod.js";
56
57
  export type { RefIndex } from "./refs/mod.js";
57
58
  export { fmtDriftGate, lockfileDriftGate, proseLintGate } from "./gates/mod.js";
58
59
  export { FENCE_RE, isLineFenced, walkProseLines } from "./util/fence.js";
59
60
  export type { ProseLineCallback } from "./util/fence.js";
61
+ export { isUnsafeRelPath } from "./util/paths.js";
60
62
  export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
61
63
  export type { AttributeMapping, BoundEntryStatus, ConflictPolicy, Direction as SyncDirection, Mapping, ParseMappingResult, RemoteState, SyncLogEntry, } from "./sync/mod.js";
62
64
  export { type Arch as SelfUpgradeArch, assertTrustedReleaseUrl, classifyInstallPath, type ClassifyResult as SelfUpgradeClassifyResult, compareVersions, type Comparison, DEFAULT_RELEASES_API, DEFAULT_RELEASES_DOWNLOAD_BASE, detectTarget, type InstallSource, type Os as SelfUpgradeOs, parseSha256Line, type Platform as SelfUpgradePlatform, platformFromBuild, type ReleaseAssets, releaseAssets, type ReleaseEndpoints, type ResolveEndpointsInput, resolveReleaseEndpoints, type Target as SelfUpgradeTarget, } from "./self_upgrade/mod.js";
@@ -64,4 +66,10 @@ export { discoverFiles, isIgnored, MARKDOWN_EXTENSIONS, parseGitignore, RELEVANT
64
66
  export type { DiscoverOptions, DiscoveryDirEntry, DiscoveryIO, GitignoreRule, } from "./discovery/mod.js";
65
67
  export { collectProjectEntries } from "./collect/mod.js";
66
68
  export type { CollectOptions } from "./collect/mod.js";
69
+ export { checkSnapshotSchema, deserializeEntry, extractSerializedEntries, } from "./compiler/deserialize.js";
70
+ export type { ExtractedEntries } from "./compiler/deserialize.js";
71
+ export { loadUpstreamCorpus } from "./upstream/mod.js";
72
+ export type { LoadUpstreamCorpusResult, UpstreamSnapshotRef, } from "./upstream/mod.js";
73
+ export { upstreamRefsFromLockfile } from "./upstream/refs.js";
74
+ export { loadProjectUpstreams } from "./upstream/project.js";
67
75
  //# sourceMappingURL=mod.d.ts.map
package/esm/mod.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,WAAW,CAAC;AAChC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,cAAc,EACd,IAAI,GACL,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,M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AAK,UAAU,EACf,oBAAoB,EACpB,8BAA8B,EAC9B,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,EAAE,IAAI,aAAa,EACxB,eAAe,EACf,KAAK,QAAQ,IAAI,mBAAmB,EACpC,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,uBAAuB,EACvB,KAAK,MAAM,IAAI,iBAAiB,GACjC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,WAAW,CAAC;AAGhC,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mB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AC;AAG/B,OAAO,EACL,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EACV,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
package/esm/mod.js CHANGED
@@ -8,10 +8,9 @@
8
8
  * from core/mod.ts, never from internal paths.
9
9
  */
10
10
  import "./_dnt.polyfills.js";
11
- export const VERSION = "0.10.3";
12
- export const CORE_SCHEMA_VERSION = 1;
11
+ export const VERSION = "0.11.0";
13
12
  // Model types
14
- export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, DEFAULT_PROJECT_CONFIG, descendantsOf, formatEntryOrigin, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
13
+ export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, CORE_SCHEMA_VERSION, DEFAULT_PROJECT_CONFIG, descendantsOf, emittableEntries, formatEntryOrigin, isUpstreamEntry, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, sameOriginSource, } from "./model/mod.js";
15
14
  // AST (canonical body-AST — spec docs/specs/markspec-core-data-model.md §2)
16
15
  // SourceRange is body-relative (no `file`); use SourceLocation for file-absolute positions.
17
16
  export { astEquivalent } from "./ast/equivalence.js";
@@ -19,7 +18,7 @@ export { normalizeBodyAst } from "./ast/normalize.js";
19
18
  export { render } from "./ast/render.js";
20
19
  // Config
21
20
  export { discoverProjectRoot, loadConfig, parseProjectConfig, } from "./config/mod.js";
22
- export { addProfileSpecifier, discoverMarkspecRoot, MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
21
+ export { addProfileSpecifier, DEFAULT_TOOL_CONFIG, discoverMarkspecRoot, loadToolConfig, MARKSPEC_YAML_FILENAME, parseMarkspecYaml, readMarkspecYaml, } from "./config/markspec.js";
23
22
  // Profile system (ADR-008)
24
23
  export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit, ensureCacheGitignored, loadChain, loadProfileForCommand, mergeChain, parseManifest, resolveEntryColor, resolveGitSpecifier, resolveLocalSpecifier, } from "./profile/mod.js";
25
24
  export { buildEffectiveDisciplineRegistry } from "./profile/mod.js";
@@ -46,14 +45,17 @@ export { report } from "./reporter/mod.js";
46
45
  // Lint (prose-analysis)
47
46
  export { ANTI_PATTERN_NOTE, computeScoreRollup, isProseScope, runLint, } from "./lint/mod.js";
48
47
  export * as typl from "./typl/mod.js";
48
+ export { uxilDeclaringTypes, validateUxilFamily, } from "./validator/uxil_family.js";
49
+ export * as uxil from "./uxil/mod.js";
49
50
  // ── Lockfile (ADR-022) ───────────────────────────────────────────────────
50
- export { canonicalEdgeJson, checkDrift, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
51
+ export { canonicalEdgeJson, checkDrift, compileAcquiredTree, dependencyPinAssurance, deriveUpstreamId, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, parseLsRemote, resolveBoundEntries, resolveIntent, resolveProfileChain, resolveProjectDependencies, resolveProjectReferences, resolveReferences, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, upstreamCacheRoot, verifyUpstreamCache, } from "./lock/mod.js";
51
52
  // ── Trace-reference canonicalisation + heal (issue #593, Slice 4) ────────
52
53
  export { buildRefIndex, canonicalizeRefs, TRACE_ATTRIBUTE_KEYS, } from "./refs/mod.js";
53
54
  // ── Composite-`check` gate stages (ADR-027, #659) ─────────────────────────
54
55
  export { fmtDriftGate, lockfileDriftGate, proseLintGate } from "./gates/mod.js";
55
56
  // ── Fenced-code-block detection (#668/#679/#680) ──────────────────────────
56
57
  export { FENCE_RE, isLineFenced, walkProseLines } from "./util/fence.js";
58
+ export { isUnsafeRelPath } from "./util/paths.js";
57
59
  // ── External sync model (ADR-022) ────────────────────────────────────────
58
60
  export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
59
61
  // ── Self-upgrade ─────────────────────────────────────────────────────────
@@ -62,3 +64,11 @@ export { assertTrustedReleaseUrl, classifyInstallPath, compareVersions, DEFAULT_
62
64
  export { discoverFiles, isIgnored, MARKDOWN_EXTENSIONS, parseGitignore, RELEVANT_EXTENSIONS, SOURCE_EXTENSIONS, } from "./discovery/mod.js";
63
65
  // ── Project-entry collection (discover + parse → Entry[]) ────────────────
64
66
  export { collectProjectEntries } from "./collect/mod.js";
67
+ // ── Compiled-snapshot deserialization (federated upstream, slice 1) ──────
68
+ export { checkSnapshotSchema, deserializeEntry, extractSerializedEntries, } from "./compiler/deserialize.js";
69
+ // ── Upstream corpus loader (federated upstream, slice 1) ─────────────────
70
+ export { loadUpstreamCorpus } from "./upstream/mod.js";
71
+ // ── Lockfile → upstream-snapshot-ref mapping (federated upstream, slice 4) ──
72
+ export { upstreamRefsFromLockfile } from "./upstream/refs.js";
73
+ // ── Shared lockfile → upstream-corpus hydration (#771) ──────────────────
74
+ export { loadProjectUpstreams } from "./upstream/project.js";