@ruverd/julius 0.0.0-stage → 0.24.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 (704) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/CREDITS.md +25 -0
  3. package/LICENSE +21 -0
  4. package/PROVENANCE.md +9 -0
  5. package/README.md +225 -2
  6. package/dist/ai/crux.d.ts +60 -0
  7. package/dist/ai/crux.d.ts.map +1 -0
  8. package/dist/ai/crux.js +141 -0
  9. package/dist/ai/crux.js.map +1 -0
  10. package/dist/ai/failure.d.ts +60 -0
  11. package/dist/ai/failure.d.ts.map +1 -0
  12. package/dist/ai/failure.js +86 -0
  13. package/dist/ai/failure.js.map +1 -0
  14. package/dist/ai/llm/anthropic.d.ts +37 -0
  15. package/dist/ai/llm/anthropic.d.ts.map +1 -0
  16. package/dist/ai/llm/anthropic.js +144 -0
  17. package/dist/ai/llm/anthropic.js.map +1 -0
  18. package/dist/ai/llm/factory.d.ts +28 -0
  19. package/dist/ai/llm/factory.d.ts.map +1 -0
  20. package/dist/ai/llm/factory.js +36 -0
  21. package/dist/ai/llm/factory.js.map +1 -0
  22. package/dist/ai/llm/litellm.d.ts +34 -0
  23. package/dist/ai/llm/litellm.d.ts.map +1 -0
  24. package/dist/ai/llm/litellm.js +45 -0
  25. package/dist/ai/llm/litellm.js.map +1 -0
  26. package/dist/ai/llm/openai.d.ts +44 -0
  27. package/dist/ai/llm/openai.d.ts.map +1 -0
  28. package/dist/ai/llm/openai.js +239 -0
  29. package/dist/ai/llm/openai.js.map +1 -0
  30. package/dist/ai/llm/orcarouter.d.ts +34 -0
  31. package/dist/ai/llm/orcarouter.d.ts.map +1 -0
  32. package/dist/ai/llm/orcarouter.js +45 -0
  33. package/dist/ai/llm/orcarouter.js.map +1 -0
  34. package/dist/ai/llm/recover-tool.d.ts +19 -0
  35. package/dist/ai/llm/recover-tool.d.ts.map +1 -0
  36. package/dist/ai/llm/recover-tool.js +109 -0
  37. package/dist/ai/llm/recover-tool.js.map +1 -0
  38. package/dist/ai/llm/types.d.ts +122 -0
  39. package/dist/ai/llm/types.d.ts.map +1 -0
  40. package/dist/ai/llm/types.js +33 -0
  41. package/dist/ai/llm/types.js.map +1 -0
  42. package/dist/ai/providers.d.ts +59 -0
  43. package/dist/ai/providers.d.ts.map +1 -0
  44. package/dist/ai/providers.js +54 -0
  45. package/dist/ai/providers.js.map +1 -0
  46. package/dist/ai/summarize.d.ts +25 -0
  47. package/dist/ai/summarize.d.ts.map +1 -0
  48. package/dist/ai/summarize.js +34 -0
  49. package/dist/ai/summarize.js.map +1 -0
  50. package/dist/ai/synthesize.d.ts +40 -0
  51. package/dist/ai/synthesize.d.ts.map +1 -0
  52. package/dist/ai/synthesize.js +131 -0
  53. package/dist/ai/synthesize.js.map +1 -0
  54. package/dist/app/checkout.d.ts +46 -0
  55. package/dist/app/checkout.d.ts.map +1 -0
  56. package/dist/app/checkout.js +223 -0
  57. package/dist/app/checkout.js.map +1 -0
  58. package/dist/app/events.d.ts +44 -0
  59. package/dist/app/events.d.ts.map +1 -0
  60. package/dist/app/events.js +64 -0
  61. package/dist/app/events.js.map +1 -0
  62. package/dist/app/identity.d.ts +54 -0
  63. package/dist/app/identity.d.ts.map +1 -0
  64. package/dist/app/identity.js +96 -0
  65. package/dist/app/identity.js.map +1 -0
  66. package/dist/app/main.d.ts +2 -0
  67. package/dist/app/main.d.ts.map +1 -0
  68. package/dist/app/main.js +62 -0
  69. package/dist/app/main.js.map +1 -0
  70. package/dist/app/pages.d.ts +56 -0
  71. package/dist/app/pages.d.ts.map +1 -0
  72. package/dist/app/pages.js +193 -0
  73. package/dist/app/pages.js.map +1 -0
  74. package/dist/app/queue.d.ts +40 -0
  75. package/dist/app/queue.d.ts.map +1 -0
  76. package/dist/app/queue.js +68 -0
  77. package/dist/app/queue.js.map +1 -0
  78. package/dist/app/review-process.d.ts +66 -0
  79. package/dist/app/review-process.d.ts.map +1 -0
  80. package/dist/app/review-process.js +200 -0
  81. package/dist/app/review-process.js.map +1 -0
  82. package/dist/app/review-worker.d.ts +2 -0
  83. package/dist/app/review-worker.d.ts.map +1 -0
  84. package/dist/app/review-worker.js +108 -0
  85. package/dist/app/review-worker.js.map +1 -0
  86. package/dist/app/review.d.ts +23 -0
  87. package/dist/app/review.d.ts.map +1 -0
  88. package/dist/app/review.js +142 -0
  89. package/dist/app/review.js.map +1 -0
  90. package/dist/app/server.d.ts +49 -0
  91. package/dist/app/server.d.ts.map +1 -0
  92. package/dist/app/server.js +123 -0
  93. package/dist/app/server.js.map +1 -0
  94. package/dist/ask/ask.d.ts +195 -0
  95. package/dist/ask/ask.d.ts.map +1 -0
  96. package/dist/ask/ask.js +1252 -0
  97. package/dist/ask/ask.js.map +1 -0
  98. package/dist/ask/file-rank.d.ts +72 -0
  99. package/dist/ask/file-rank.d.ts.map +1 -0
  100. package/dist/ask/file-rank.js +160 -0
  101. package/dist/ask/file-rank.js.map +1 -0
  102. package/dist/ask/file-selection.d.ts +22 -0
  103. package/dist/ask/file-selection.d.ts.map +1 -0
  104. package/dist/ask/file-selection.js +66 -0
  105. package/dist/ask/file-selection.js.map +1 -0
  106. package/dist/ask/fuse.d.ts +195 -0
  107. package/dist/ask/fuse.d.ts.map +1 -0
  108. package/dist/ask/fuse.js +344 -0
  109. package/dist/ask/fuse.js.map +1 -0
  110. package/dist/ask/graphrank.d.ts +61 -0
  111. package/dist/ask/graphrank.d.ts.map +1 -0
  112. package/dist/ask/graphrank.js +130 -0
  113. package/dist/ask/graphrank.js.map +1 -0
  114. package/dist/ask/index-file.d.ts +44 -0
  115. package/dist/ask/index-file.d.ts.map +1 -0
  116. package/dist/ask/index-file.js +128 -0
  117. package/dist/ask/index-file.js.map +1 -0
  118. package/dist/bin/julius.d.ts +3 -0
  119. package/dist/bin/julius.d.ts.map +1 -0
  120. package/dist/bin/julius.js +4 -0
  121. package/dist/bin/julius.js.map +1 -0
  122. package/dist/blast/blast-cli.d.ts +35 -0
  123. package/dist/blast/blast-cli.d.ts.map +1 -0
  124. package/dist/blast/blast-cli.js +155 -0
  125. package/dist/blast/blast-cli.js.map +1 -0
  126. package/dist/blast/blast.d.ts +128 -0
  127. package/dist/blast/blast.d.ts.map +1 -0
  128. package/dist/blast/blast.js +383 -0
  129. package/dist/blast/blast.js.map +1 -0
  130. package/dist/blast/diff.d.ts +53 -0
  131. package/dist/blast/diff.d.ts.map +1 -0
  132. package/dist/blast/diff.js +193 -0
  133. package/dist/blast/diff.js.map +1 -0
  134. package/dist/blast/evidence.d.ts +51 -0
  135. package/dist/blast/evidence.d.ts.map +1 -0
  136. package/dist/blast/evidence.js +162 -0
  137. package/dist/blast/evidence.js.map +1 -0
  138. package/dist/blast/modules.d.ts +33 -0
  139. package/dist/blast/modules.d.ts.map +1 -0
  140. package/dist/blast/modules.js +83 -0
  141. package/dist/blast/modules.js.map +1 -0
  142. package/dist/blast/name.d.ts +74 -0
  143. package/dist/blast/name.d.ts.map +1 -0
  144. package/dist/blast/name.js +269 -0
  145. package/dist/blast/name.js.map +1 -0
  146. package/dist/blast/owners.d.ts +85 -0
  147. package/dist/blast/owners.d.ts.map +1 -0
  148. package/dist/blast/owners.js +272 -0
  149. package/dist/blast/owners.js.map +1 -0
  150. package/dist/blast/render.d.ts +46 -0
  151. package/dist/blast/render.d.ts.map +1 -0
  152. package/dist/blast/render.js +422 -0
  153. package/dist/blast/render.js.map +1 -0
  154. package/dist/blast/viz.d.ts +37 -0
  155. package/dist/blast/viz.d.ts.map +1 -0
  156. package/dist/blast/viz.js +180 -0
  157. package/dist/blast/viz.js.map +1 -0
  158. package/dist/brand.d.ts +13 -0
  159. package/dist/brand.d.ts.map +1 -0
  160. package/dist/brand.js +43 -0
  161. package/dist/brand.js.map +1 -0
  162. package/dist/check/learning-edits.d.ts +9 -0
  163. package/dist/check/learning-edits.d.ts.map +1 -0
  164. package/dist/check/learning-edits.js +62 -0
  165. package/dist/check/learning-edits.js.map +1 -0
  166. package/dist/check/local-check.d.ts +104 -0
  167. package/dist/check/local-check.d.ts.map +1 -0
  168. package/dist/check/local-check.js +830 -0
  169. package/dist/check/local-check.js.map +1 -0
  170. package/dist/check/types.d.ts +31 -0
  171. package/dist/check/types.d.ts.map +1 -0
  172. package/dist/check/types.js +2 -0
  173. package/dist/check/types.js.map +1 -0
  174. package/dist/claude/build-progress.d.ts +29 -0
  175. package/dist/claude/build-progress.d.ts.map +1 -0
  176. package/dist/claude/build-progress.js +76 -0
  177. package/dist/claude/build-progress.js.map +1 -0
  178. package/dist/claude/format.d.ts +131 -0
  179. package/dist/claude/format.d.ts.map +1 -0
  180. package/dist/claude/format.js +328 -0
  181. package/dist/claude/format.js.map +1 -0
  182. package/dist/claude/hook-layers.d.ts +8 -0
  183. package/dist/claude/hook-layers.d.ts.map +1 -0
  184. package/dist/claude/hook-layers.js +74 -0
  185. package/dist/claude/hook-layers.js.map +1 -0
  186. package/dist/claude/hooks.d.ts +101 -0
  187. package/dist/claude/hooks.d.ts.map +1 -0
  188. package/dist/claude/hooks.js +849 -0
  189. package/dist/claude/hooks.js.map +1 -0
  190. package/dist/claude/init.d.ts +70 -0
  191. package/dist/claude/init.d.ts.map +1 -0
  192. package/dist/claude/init.js +207 -0
  193. package/dist/claude/init.js.map +1 -0
  194. package/dist/claude/note-signals.d.ts +28 -0
  195. package/dist/claude/note-signals.d.ts.map +1 -0
  196. package/dist/claude/note-signals.js +325 -0
  197. package/dist/claude/note-signals.js.map +1 -0
  198. package/dist/claude/paths.d.ts +9 -0
  199. package/dist/claude/paths.d.ts.map +1 -0
  200. package/dist/claude/paths.js +22 -0
  201. package/dist/claude/paths.js.map +1 -0
  202. package/dist/claude/session-metrics.d.ts +73 -0
  203. package/dist/claude/session-metrics.d.ts.map +1 -0
  204. package/dist/claude/session-metrics.js +209 -0
  205. package/dist/claude/session-metrics.js.map +1 -0
  206. package/dist/claude/settings-merge.d.ts +66 -0
  207. package/dist/claude/settings-merge.d.ts.map +1 -0
  208. package/dist/claude/settings-merge.js +249 -0
  209. package/dist/claude/settings-merge.js.map +1 -0
  210. package/dist/claude/shim-template.d.ts +18 -0
  211. package/dist/claude/shim-template.d.ts.map +1 -0
  212. package/dist/claude/shim-template.js +226 -0
  213. package/dist/claude/shim-template.js.map +1 -0
  214. package/dist/claude/skill-template.d.ts +12 -0
  215. package/dist/claude/skill-template.d.ts.map +1 -0
  216. package/dist/claude/skill-template.js +294 -0
  217. package/dist/claude/skill-template.js.map +1 -0
  218. package/dist/claude/state.d.ts +73 -0
  219. package/dist/claude/state.d.ts.map +1 -0
  220. package/dist/claude/state.js +33 -0
  221. package/dist/claude/state.js.map +1 -0
  222. package/dist/claude/stats.d.ts +5 -0
  223. package/dist/claude/stats.d.ts.map +1 -0
  224. package/dist/claude/stats.js +24 -0
  225. package/dist/claude/stats.js.map +1 -0
  226. package/dist/claude/statusline.d.ts +14 -0
  227. package/dist/claude/statusline.d.ts.map +1 -0
  228. package/dist/claude/statusline.js +45 -0
  229. package/dist/claude/statusline.js.map +1 -0
  230. package/dist/claude/sync-run.d.ts +3 -0
  231. package/dist/claude/sync-run.d.ts.map +1 -0
  232. package/dist/claude/sync-run.js +46 -0
  233. package/dist/claude/sync-run.js.map +1 -0
  234. package/dist/claude/tally.d.ts +50 -0
  235. package/dist/claude/tally.d.ts.map +1 -0
  236. package/dist/claude/tally.js +211 -0
  237. package/dist/claude/tally.js.map +1 -0
  238. package/dist/cli-epilogue.d.ts +12 -0
  239. package/dist/cli-epilogue.d.ts.map +1 -0
  240. package/dist/cli-epilogue.js +55 -0
  241. package/dist/cli-epilogue.js.map +1 -0
  242. package/dist/cli-meta.d.ts +45 -0
  243. package/dist/cli-meta.d.ts.map +1 -0
  244. package/dist/cli-meta.js +145 -0
  245. package/dist/cli-meta.js.map +1 -0
  246. package/dist/cli-picker.d.ts +129 -0
  247. package/dist/cli-picker.d.ts.map +1 -0
  248. package/dist/cli-picker.js +432 -0
  249. package/dist/cli-picker.js.map +1 -0
  250. package/dist/cli.d.ts +3 -0
  251. package/dist/cli.d.ts.map +1 -0
  252. package/dist/cli.js +2213 -0
  253. package/dist/cli.js.map +1 -0
  254. package/dist/cloud/diff.d.ts +20 -0
  255. package/dist/cloud/diff.d.ts.map +1 -0
  256. package/dist/cloud/diff.js +59 -0
  257. package/dist/cloud/diff.js.map +1 -0
  258. package/dist/cloud/nudge.d.ts +66 -0
  259. package/dist/cloud/nudge.d.ts.map +1 -0
  260. package/dist/cloud/nudge.js +268 -0
  261. package/dist/cloud/nudge.js.map +1 -0
  262. package/dist/cloud/workspace-sync.d.ts +58 -0
  263. package/dist/cloud/workspace-sync.d.ts.map +1 -0
  264. package/dist/cloud/workspace-sync.js +268 -0
  265. package/dist/cloud/workspace-sync.js.map +1 -0
  266. package/dist/cloud/workspace.d.ts +159 -0
  267. package/dist/cloud/workspace.d.ts.map +1 -0
  268. package/dist/cloud/workspace.js +134 -0
  269. package/dist/cloud/workspace.js.map +1 -0
  270. package/dist/context/build.d.ts +52 -0
  271. package/dist/context/build.d.ts.map +1 -0
  272. package/dist/context/build.js +362 -0
  273. package/dist/context/build.js.map +1 -0
  274. package/dist/context/check.d.ts +42 -0
  275. package/dist/context/check.d.ts.map +1 -0
  276. package/dist/context/check.js +162 -0
  277. package/dist/context/check.js.map +1 -0
  278. package/dist/context/map-dir.d.ts +4 -0
  279. package/dist/context/map-dir.d.ts.map +1 -0
  280. package/dist/context/map-dir.js +6 -0
  281. package/dist/context/map-dir.js.map +1 -0
  282. package/dist/context/node-file.d.ts +109 -0
  283. package/dist/context/node-file.d.ts.map +1 -0
  284. package/dist/context/node-file.js +362 -0
  285. package/dist/context/node-file.js.map +1 -0
  286. package/dist/context/price.d.ts +49 -0
  287. package/dist/context/price.d.ts.map +1 -0
  288. package/dist/context/price.js +83 -0
  289. package/dist/context/price.js.map +1 -0
  290. package/dist/context/savings.d.ts +26 -0
  291. package/dist/context/savings.d.ts.map +1 -0
  292. package/dist/context/savings.js +59 -0
  293. package/dist/context/savings.js.map +1 -0
  294. package/dist/economy/cli.d.ts +3 -0
  295. package/dist/economy/cli.d.ts.map +1 -0
  296. package/dist/economy/cli.js +52 -0
  297. package/dist/economy/cli.js.map +1 -0
  298. package/dist/economy/delivery.d.ts +49 -0
  299. package/dist/economy/delivery.d.ts.map +1 -0
  300. package/dist/economy/delivery.js +176 -0
  301. package/dist/economy/delivery.js.map +1 -0
  302. package/dist/economy/index.d.ts +67 -0
  303. package/dist/economy/index.d.ts.map +1 -0
  304. package/dist/economy/index.js +519 -0
  305. package/dist/economy/index.js.map +1 -0
  306. package/dist/engine.d.ts +83 -0
  307. package/dist/engine.d.ts.map +1 -0
  308. package/dist/engine.js +122 -0
  309. package/dist/engine.js.map +1 -0
  310. package/dist/evaluation/index.d.ts +41 -0
  311. package/dist/evaluation/index.d.ts.map +1 -0
  312. package/dist/evaluation/index.js +61 -0
  313. package/dist/evaluation/index.js.map +1 -0
  314. package/dist/graph/bindings.d.ts +64 -0
  315. package/dist/graph/bindings.d.ts.map +1 -0
  316. package/dist/graph/bindings.js +713 -0
  317. package/dist/graph/bindings.js.map +1 -0
  318. package/dist/graph/build.d.ts +88 -0
  319. package/dist/graph/build.d.ts.map +1 -0
  320. package/dist/graph/build.js +375 -0
  321. package/dist/graph/build.js.map +1 -0
  322. package/dist/graph/cards.d.ts +46 -0
  323. package/dist/graph/cards.d.ts.map +1 -0
  324. package/dist/graph/cards.js +280 -0
  325. package/dist/graph/cards.js.map +1 -0
  326. package/dist/graph/check.d.ts +25 -0
  327. package/dist/graph/check.d.ts.map +1 -0
  328. package/dist/graph/check.js +192 -0
  329. package/dist/graph/check.js.map +1 -0
  330. package/dist/graph/container.d.ts +63 -0
  331. package/dist/graph/container.d.ts.map +1 -0
  332. package/dist/graph/container.js +190 -0
  333. package/dist/graph/container.js.map +1 -0
  334. package/dist/graph/enrich.d.ts +62 -0
  335. package/dist/graph/enrich.d.ts.map +1 -0
  336. package/dist/graph/enrich.js +253 -0
  337. package/dist/graph/enrich.js.map +1 -0
  338. package/dist/graph/extract-cache.d.ts +101 -0
  339. package/dist/graph/extract-cache.d.ts.map +1 -0
  340. package/dist/graph/extract-cache.js +199 -0
  341. package/dist/graph/extract-cache.js.map +1 -0
  342. package/dist/graph/extract.d.ts +85 -0
  343. package/dist/graph/extract.d.ts.map +1 -0
  344. package/dist/graph/extract.js +2376 -0
  345. package/dist/graph/extract.js.map +1 -0
  346. package/dist/graph/fingerprint.d.ts +76 -0
  347. package/dist/graph/fingerprint.d.ts.map +1 -0
  348. package/dist/graph/fingerprint.js +160 -0
  349. package/dist/graph/fingerprint.js.map +1 -0
  350. package/dist/graph/generic.d.ts +74 -0
  351. package/dist/graph/generic.d.ts.map +1 -0
  352. package/dist/graph/generic.js +580 -0
  353. package/dist/graph/generic.js.map +1 -0
  354. package/dist/graph/invariants.d.ts +33 -0
  355. package/dist/graph/invariants.d.ts.map +1 -0
  356. package/dist/graph/invariants.js +52 -0
  357. package/dist/graph/invariants.js.map +1 -0
  358. package/dist/graph/load.d.ts +29 -0
  359. package/dist/graph/load.d.ts.map +1 -0
  360. package/dist/graph/load.js +97 -0
  361. package/dist/graph/load.js.map +1 -0
  362. package/dist/graph/lsp/client.d.ts +43 -0
  363. package/dist/graph/lsp/client.d.ts.map +1 -0
  364. package/dist/graph/lsp/client.js +179 -0
  365. package/dist/graph/lsp/client.js.map +1 -0
  366. package/dist/graph/lsp/enrich.d.ts +11 -0
  367. package/dist/graph/lsp/enrich.d.ts.map +1 -0
  368. package/dist/graph/lsp/enrich.js +155 -0
  369. package/dist/graph/lsp/enrich.js.map +1 -0
  370. package/dist/graph/lsp/registry.d.ts +15 -0
  371. package/dist/graph/lsp/registry.d.ts.map +1 -0
  372. package/dist/graph/lsp/registry.js +46 -0
  373. package/dist/graph/lsp/registry.js.map +1 -0
  374. package/dist/graph/map.d.ts +107 -0
  375. package/dist/graph/map.d.ts.map +1 -0
  376. package/dist/graph/map.js +239 -0
  377. package/dist/graph/map.js.map +1 -0
  378. package/dist/graph/native.d.ts +38 -0
  379. package/dist/graph/native.d.ts.map +1 -0
  380. package/dist/graph/native.js +169 -0
  381. package/dist/graph/native.js.map +1 -0
  382. package/dist/graph/queries/c.scm +13 -0
  383. package/dist/graph/queries/c_sharp.scm +19 -0
  384. package/dist/graph/queries/clojure.scm +58 -0
  385. package/dist/graph/queries/cpp.scm +23 -0
  386. package/dist/graph/queries/dart.scm +42 -0
  387. package/dist/graph/queries/elixir.scm +54 -0
  388. package/dist/graph/queries/java.scm +20 -0
  389. package/dist/graph/queries/kotlin.scm +43 -0
  390. package/dist/graph/queries/lua.scm +36 -0
  391. package/dist/graph/queries/nix.scm +32 -0
  392. package/dist/graph/queries/php.scm +40 -0
  393. package/dist/graph/queries/ruby.scm +65 -0
  394. package/dist/graph/queries/rust.scm +41 -0
  395. package/dist/graph/queries/scala.scm +66 -0
  396. package/dist/graph/queries/solidity.scm +43 -0
  397. package/dist/graph/queries/swift.scm +51 -0
  398. package/dist/graph/refresh.d.ts +49 -0
  399. package/dist/graph/refresh.d.ts.map +1 -0
  400. package/dist/graph/refresh.js +255 -0
  401. package/dist/graph/refresh.js.map +1 -0
  402. package/dist/graph/relations.d.ts +14 -0
  403. package/dist/graph/relations.d.ts.map +1 -0
  404. package/dist/graph/relations.js +8 -0
  405. package/dist/graph/relations.js.map +1 -0
  406. package/dist/graph/resolve.d.ts +17 -0
  407. package/dist/graph/resolve.d.ts.map +1 -0
  408. package/dist/graph/resolve.js +654 -0
  409. package/dist/graph/resolve.js.map +1 -0
  410. package/dist/graph/root.d.ts +11 -0
  411. package/dist/graph/root.d.ts.map +1 -0
  412. package/dist/graph/root.js +40 -0
  413. package/dist/graph/root.js.map +1 -0
  414. package/dist/graph/scopes.d.ts +42 -0
  415. package/dist/graph/scopes.d.ts.map +1 -0
  416. package/dist/graph/scopes.js +342 -0
  417. package/dist/graph/scopes.js.map +1 -0
  418. package/dist/graph/seed.d.ts +38 -0
  419. package/dist/graph/seed.d.ts.map +1 -0
  420. package/dist/graph/seed.js +226 -0
  421. package/dist/graph/seed.js.map +1 -0
  422. package/dist/graph/source-files.d.ts +40 -0
  423. package/dist/graph/source-files.d.ts.map +1 -0
  424. package/dist/graph/source-files.js +85 -0
  425. package/dist/graph/source-files.js.map +1 -0
  426. package/dist/graph/traverse-cli.d.ts +55 -0
  427. package/dist/graph/traverse-cli.d.ts.map +1 -0
  428. package/dist/graph/traverse-cli.js +189 -0
  429. package/dist/graph/traverse-cli.js.map +1 -0
  430. package/dist/graph/traverse.d.ts +112 -0
  431. package/dist/graph/traverse.d.ts.map +1 -0
  432. package/dist/graph/traverse.js +192 -0
  433. package/dist/graph/traverse.js.map +1 -0
  434. package/dist/graph/types.d.ts +78 -0
  435. package/dist/graph/types.d.ts.map +1 -0
  436. package/dist/graph/types.js +14 -0
  437. package/dist/graph/types.js.map +1 -0
  438. package/dist/graph/workspace-cli.d.ts +48 -0
  439. package/dist/graph/workspace-cli.d.ts.map +1 -0
  440. package/dist/graph/workspace-cli.js +102 -0
  441. package/dist/graph/workspace-cli.js.map +1 -0
  442. package/dist/graph/workspace.d.ts +135 -0
  443. package/dist/graph/workspace.d.ts.map +1 -0
  444. package/dist/graph/workspace.js +598 -0
  445. package/dist/graph/workspace.js.map +1 -0
  446. package/dist/graph/write.d.ts +13 -0
  447. package/dist/graph/write.d.ts.map +1 -0
  448. package/dist/graph/write.js +86 -0
  449. package/dist/graph/write.js.map +1 -0
  450. package/dist/hosts/antigravity.d.ts +8 -0
  451. package/dist/hosts/antigravity.d.ts.map +1 -0
  452. package/dist/hosts/antigravity.js +42 -0
  453. package/dist/hosts/antigravity.js.map +1 -0
  454. package/dist/hosts/claude-global.d.ts +36 -0
  455. package/dist/hosts/claude-global.d.ts.map +1 -0
  456. package/dist/hosts/claude-global.js +153 -0
  457. package/dist/hosts/claude-global.js.map +1 -0
  458. package/dist/hosts/codex-hooks.d.ts +11 -0
  459. package/dist/hosts/codex-hooks.d.ts.map +1 -0
  460. package/dist/hosts/codex-hooks.js +80 -0
  461. package/dist/hosts/codex-hooks.js.map +1 -0
  462. package/dist/hosts/config-write.d.ts +36 -0
  463. package/dist/hosts/config-write.d.ts.map +1 -0
  464. package/dist/hosts/config-write.js +64 -0
  465. package/dist/hosts/config-write.js.map +1 -0
  466. package/dist/hosts/cursor-hooks.d.ts +21 -0
  467. package/dist/hosts/cursor-hooks.d.ts.map +1 -0
  468. package/dist/hosts/cursor-hooks.js +103 -0
  469. package/dist/hosts/cursor-hooks.js.map +1 -0
  470. package/dist/hosts/init.d.ts +26 -0
  471. package/dist/hosts/init.d.ts.map +1 -0
  472. package/dist/hosts/init.js +82 -0
  473. package/dist/hosts/init.js.map +1 -0
  474. package/dist/hosts/install.d.ts +12 -0
  475. package/dist/hosts/install.d.ts.map +1 -0
  476. package/dist/hosts/install.js +347 -0
  477. package/dist/hosts/install.js.map +1 -0
  478. package/dist/hosts/instructions.d.ts +7 -0
  479. package/dist/hosts/instructions.d.ts.map +1 -0
  480. package/dist/hosts/instructions.js +71 -0
  481. package/dist/hosts/instructions.js.map +1 -0
  482. package/dist/hosts/investigation-instructions.d.ts +2 -0
  483. package/dist/hosts/investigation-instructions.d.ts.map +1 -0
  484. package/dist/hosts/investigation-instructions.js +2 -0
  485. package/dist/hosts/investigation-instructions.js.map +1 -0
  486. package/dist/hosts/mcp-config.d.ts +59 -0
  487. package/dist/hosts/mcp-config.d.ts.map +1 -0
  488. package/dist/hosts/mcp-config.js +229 -0
  489. package/dist/hosts/mcp-config.js.map +1 -0
  490. package/dist/hosts/plan.d.ts +32 -0
  491. package/dist/hosts/plan.d.ts.map +1 -0
  492. package/dist/hosts/plan.js +77 -0
  493. package/dist/hosts/plan.js.map +1 -0
  494. package/dist/hosts/registry.d.ts +35 -0
  495. package/dist/hosts/registry.d.ts.map +1 -0
  496. package/dist/hosts/registry.js +157 -0
  497. package/dist/hosts/registry.js.map +1 -0
  498. package/dist/hosts/retract.d.ts +47 -0
  499. package/dist/hosts/retract.d.ts.map +1 -0
  500. package/dist/hosts/retract.js +541 -0
  501. package/dist/hosts/retract.js.map +1 -0
  502. package/dist/hosts/sections.d.ts +46 -0
  503. package/dist/hosts/sections.d.ts.map +1 -0
  504. package/dist/hosts/sections.js +126 -0
  505. package/dist/hosts/sections.js.map +1 -0
  506. package/dist/index.d.ts +43 -0
  507. package/dist/index.d.ts.map +1 -0
  508. package/dist/index.js +33 -0
  509. package/dist/index.js.map +1 -0
  510. package/dist/ingest/fs.d.ts +79 -0
  511. package/dist/ingest/fs.d.ts.map +1 -0
  512. package/dist/ingest/fs.js +307 -0
  513. package/dist/ingest/fs.js.map +1 -0
  514. package/dist/init-guard.d.ts +11 -0
  515. package/dist/init-guard.d.ts.map +1 -0
  516. package/dist/init-guard.js +21 -0
  517. package/dist/init-guard.js.map +1 -0
  518. package/dist/investigation/index.d.ts +57 -0
  519. package/dist/investigation/index.d.ts.map +1 -0
  520. package/dist/investigation/index.js +315 -0
  521. package/dist/investigation/index.js.map +1 -0
  522. package/dist/mcp/compact.d.ts +9 -0
  523. package/dist/mcp/compact.d.ts.map +1 -0
  524. package/dist/mcp/compact.js +133 -0
  525. package/dist/mcp/compact.js.map +1 -0
  526. package/dist/mcp/instructions.d.ts +5 -0
  527. package/dist/mcp/instructions.d.ts.map +1 -0
  528. package/dist/mcp/instructions.js +57 -0
  529. package/dist/mcp/instructions.js.map +1 -0
  530. package/dist/mcp/server.d.ts +7 -0
  531. package/dist/mcp/server.d.ts.map +1 -0
  532. package/dist/mcp/server.js +128 -0
  533. package/dist/mcp/server.js.map +1 -0
  534. package/dist/mcp/tool-names.d.ts +20 -0
  535. package/dist/mcp/tool-names.d.ts.map +1 -0
  536. package/dist/mcp/tool-names.js +36 -0
  537. package/dist/mcp/tool-names.js.map +1 -0
  538. package/dist/mcp/tools.d.ts +22 -0
  539. package/dist/mcp/tools.d.ts.map +1 -0
  540. package/dist/mcp/tools.js +300 -0
  541. package/dist/mcp/tools.js.map +1 -0
  542. package/dist/notes/ask-notes.d.ts +8 -0
  543. package/dist/notes/ask-notes.d.ts.map +1 -0
  544. package/dist/notes/ask-notes.js +19 -0
  545. package/dist/notes/ask-notes.js.map +1 -0
  546. package/dist/notes/branches.d.ts +102 -0
  547. package/dist/notes/branches.d.ts.map +1 -0
  548. package/dist/notes/branches.js +304 -0
  549. package/dist/notes/branches.js.map +1 -0
  550. package/dist/notes/cold-start.d.ts +177 -0
  551. package/dist/notes/cold-start.d.ts.map +1 -0
  552. package/dist/notes/cold-start.js +537 -0
  553. package/dist/notes/cold-start.js.map +1 -0
  554. package/dist/notes/edit-overlap.d.ts +62 -0
  555. package/dist/notes/edit-overlap.d.ts.map +1 -0
  556. package/dist/notes/edit-overlap.js +202 -0
  557. package/dist/notes/edit-overlap.js.map +1 -0
  558. package/dist/notes/git-facts.d.ts +21 -0
  559. package/dist/notes/git-facts.d.ts.map +1 -0
  560. package/dist/notes/git-facts.js +121 -0
  561. package/dist/notes/git-facts.js.map +1 -0
  562. package/dist/notes/home.d.ts +87 -0
  563. package/dist/notes/home.d.ts.map +1 -0
  564. package/dist/notes/home.js +430 -0
  565. package/dist/notes/home.js.map +1 -0
  566. package/dist/notes/learning-fields.d.ts +102 -0
  567. package/dist/notes/learning-fields.d.ts.map +1 -0
  568. package/dist/notes/learning-fields.js +217 -0
  569. package/dist/notes/learning-fields.js.map +1 -0
  570. package/dist/notes/note-gate.d.ts +42 -0
  571. package/dist/notes/note-gate.d.ts.map +1 -0
  572. package/dist/notes/note-gate.js +181 -0
  573. package/dist/notes/note-gate.js.map +1 -0
  574. package/dist/notes/notes.d.ts +214 -0
  575. package/dist/notes/notes.d.ts.map +1 -0
  576. package/dist/notes/notes.js +591 -0
  577. package/dist/notes/notes.js.map +1 -0
  578. package/dist/notes/pr-reviews.d.ts +108 -0
  579. package/dist/notes/pr-reviews.d.ts.map +1 -0
  580. package/dist/notes/pr-reviews.js +325 -0
  581. package/dist/notes/pr-reviews.js.map +1 -0
  582. package/dist/notes/repo-julius.d.ts +18 -0
  583. package/dist/notes/repo-julius.d.ts.map +1 -0
  584. package/dist/notes/repo-julius.js +111 -0
  585. package/dist/notes/repo-julius.js.map +1 -0
  586. package/dist/notes/session-cost.d.ts +35 -0
  587. package/dist/notes/session-cost.d.ts.map +1 -0
  588. package/dist/notes/session-cost.js +276 -0
  589. package/dist/notes/session-cost.js.map +1 -0
  590. package/dist/search/grep-cli.d.ts +35 -0
  591. package/dist/search/grep-cli.d.ts.map +1 -0
  592. package/dist/search/grep-cli.js +115 -0
  593. package/dist/search/grep-cli.js.map +1 -0
  594. package/dist/search/grep.d.ts +60 -0
  595. package/dist/search/grep.d.ts.map +1 -0
  596. package/dist/search/grep.js +176 -0
  597. package/dist/search/grep.js.map +1 -0
  598. package/dist/search/ignored-code.d.ts +9 -0
  599. package/dist/search/ignored-code.d.ts.map +1 -0
  600. package/dist/search/ignored-code.js +73 -0
  601. package/dist/search/ignored-code.js.map +1 -0
  602. package/dist/skills/skills.d.ts +118 -0
  603. package/dist/skills/skills.d.ts.map +1 -0
  604. package/dist/skills/skills.js +370 -0
  605. package/dist/skills/skills.js.map +1 -0
  606. package/dist/telemetry/contract.d.ts +103 -0
  607. package/dist/telemetry/contract.d.ts.map +1 -0
  608. package/dist/telemetry/contract.js +270 -0
  609. package/dist/telemetry/contract.js.map +1 -0
  610. package/dist/telemetry/flush.d.ts +21 -0
  611. package/dist/telemetry/flush.d.ts.map +1 -0
  612. package/dist/telemetry/flush.js +85 -0
  613. package/dist/telemetry/flush.js.map +1 -0
  614. package/dist/telemetry/gate.d.ts +30 -0
  615. package/dist/telemetry/gate.d.ts.map +1 -0
  616. package/dist/telemetry/gate.js +81 -0
  617. package/dist/telemetry/gate.js.map +1 -0
  618. package/dist/telemetry/identity.d.ts +40 -0
  619. package/dist/telemetry/identity.d.ts.map +1 -0
  620. package/dist/telemetry/identity.js +80 -0
  621. package/dist/telemetry/identity.js.map +1 -0
  622. package/dist/telemetry/index.d.ts +18 -0
  623. package/dist/telemetry/index.d.ts.map +1 -0
  624. package/dist/telemetry/index.js +16 -0
  625. package/dist/telemetry/index.js.map +1 -0
  626. package/dist/telemetry/key.d.ts +4 -0
  627. package/dist/telemetry/key.d.ts.map +1 -0
  628. package/dist/telemetry/key.js +4 -0
  629. package/dist/telemetry/key.js.map +1 -0
  630. package/dist/telemetry/notice.d.ts +19 -0
  631. package/dist/telemetry/notice.d.ts.map +1 -0
  632. package/dist/telemetry/notice.js +93 -0
  633. package/dist/telemetry/notice.js.map +1 -0
  634. package/dist/telemetry/queue.d.ts +35 -0
  635. package/dist/telemetry/queue.d.ts.map +1 -0
  636. package/dist/telemetry/queue.js +162 -0
  637. package/dist/telemetry/queue.js.map +1 -0
  638. package/dist/telemetry/send.d.ts +19 -0
  639. package/dist/telemetry/send.d.ts.map +1 -0
  640. package/dist/telemetry/send.js +84 -0
  641. package/dist/telemetry/send.js.map +1 -0
  642. package/dist/telemetry/sessions.d.ts +25 -0
  643. package/dist/telemetry/sessions.d.ts.map +1 -0
  644. package/dist/telemetry/sessions.js +104 -0
  645. package/dist/telemetry/sessions.js.map +1 -0
  646. package/dist/telemetry/track.d.ts +62 -0
  647. package/dist/telemetry/track.d.ts.map +1 -0
  648. package/dist/telemetry/track.js +142 -0
  649. package/dist/telemetry/track.js.map +1 -0
  650. package/dist/upkeep-run.d.ts +15 -0
  651. package/dist/upkeep-run.d.ts.map +1 -0
  652. package/dist/upkeep-run.js +71 -0
  653. package/dist/upkeep-run.js.map +1 -0
  654. package/dist/upkeep.d.ts +125 -0
  655. package/dist/upkeep.d.ts.map +1 -0
  656. package/dist/upkeep.js +255 -0
  657. package/dist/upkeep.js.map +1 -0
  658. package/dist/util/browser.d.ts +3 -0
  659. package/dist/util/browser.d.ts.map +1 -0
  660. package/dist/util/browser.js +14 -0
  661. package/dist/util/browser.js.map +1 -0
  662. package/dist/util/front-matter.d.ts +19 -0
  663. package/dist/util/front-matter.d.ts.map +1 -0
  664. package/dist/util/front-matter.js +21 -0
  665. package/dist/util/front-matter.js.map +1 -0
  666. package/dist/util/id.d.ts +7 -0
  667. package/dist/util/id.d.ts.map +1 -0
  668. package/dist/util/id.js +14 -0
  669. package/dist/util/id.js.map +1 -0
  670. package/dist/util/paths.d.ts +29 -0
  671. package/dist/util/paths.d.ts.map +1 -0
  672. package/dist/util/paths.js +71 -0
  673. package/dist/util/paths.js.map +1 -0
  674. package/dist/util/source.d.ts +4 -0
  675. package/dist/util/source.d.ts.map +1 -0
  676. package/dist/util/source.js +12 -0
  677. package/dist/util/source.js.map +1 -0
  678. package/dist/util/spinner.d.ts +15 -0
  679. package/dist/util/spinner.d.ts.map +1 -0
  680. package/dist/util/spinner.js +52 -0
  681. package/dist/util/spinner.js.map +1 -0
  682. package/dist/util/state.d.ts +100 -0
  683. package/dist/util/state.d.ts.map +1 -0
  684. package/dist/util/state.js +186 -0
  685. package/dist/util/state.js.map +1 -0
  686. package/dist/viewer/app.js +2 -0
  687. package/dist/viewer/index.html +49 -0
  688. package/dist/viewer/style.css +154 -0
  689. package/dist/viz/assemble.d.ts +83 -0
  690. package/dist/viz/assemble.d.ts.map +1 -0
  691. package/dist/viz/assemble.js +101 -0
  692. package/dist/viz/assemble.js.map +1 -0
  693. package/dist/viz/export.d.ts +39 -0
  694. package/dist/viz/export.d.ts.map +1 -0
  695. package/dist/viz/export.js +98 -0
  696. package/dist/viz/export.js.map +1 -0
  697. package/dist/viz/serve.d.ts +12 -0
  698. package/dist/viz/serve.d.ts.map +1 -0
  699. package/dist/viz/serve.js +129 -0
  700. package/dist/viz/serve.js.map +1 -0
  701. package/docs/assets/context-benchmark.svg +31 -0
  702. package/docs/assets/julius-hero.png +0 -0
  703. package/docs/upstream-changelog.md +785 -0
  704. package/package.json +138 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/app/pages.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gB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AO,CAAC,MAAM;CASf"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Where a reviewed pull request's page lives.
3
+ *
4
+ * This is the part GitHub Pages could not do. A private repository's graph must
5
+ * not be readable by anyone who guesses a URL, and the Actions route had only two
6
+ * options: publish to a public branch, or hand the reader a zip. So the page is
7
+ * held here and linked with a signed, expiring URL.
8
+ *
9
+ * The signature is the whole access-control story, deliberately: it is a
10
+ * capability, not a login. Anyone with the link can read that one page until it
11
+ * expires, which is the same property a GitHub artifact link has, and the link
12
+ * only ever appears in a comment on the pull request it describes.
13
+ *
14
+ * Pages are mirrored to `dir`, when one is given, because the token is DERIVED
15
+ * from the id rather than stored: a link keeps passing the signature check for as
16
+ * long as the secret lives, so a process that lost its pages answers 404 to a
17
+ * link that looks perfectly valid. That failure is silent at both ends — the
18
+ * comment still sits on the pull request, the reviewer just sees "not found" —
19
+ * and one restart of a container with nothing mounted stranded 29 of them. Disk
20
+ * is the fix; without a directory this behaves exactly as it did before.
21
+ */
22
+ import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
23
+ import { mkdirSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
24
+ import { join } from "node:path";
25
+ /** Long enough to review a PR at leisure, short enough that a leaked link dies. */
26
+ const DEFAULT_TTL_MS = 14 * 24 * 60 * 60 * 1000;
27
+ /** A page is ~50 kB; a few hundred of them is nothing, and eviction is by age. */
28
+ const DEFAULT_MAX_PAGES = 500;
29
+ /** One file per page, named by its id. The extension also means "fully written". */
30
+ const SUFFIX = ".json";
31
+ export class PageStore {
32
+ pages = new Map();
33
+ secret;
34
+ ttlMs;
35
+ maxPages;
36
+ now;
37
+ dir;
38
+ constructor(opts) {
39
+ this.secret = opts.secret;
40
+ this.ttlMs = opts.ttlMs ?? DEFAULT_TTL_MS;
41
+ this.maxPages = opts.maxPages ?? DEFAULT_MAX_PAGES;
42
+ this.now = opts.now ?? Date.now;
43
+ this.dir = opts.dir;
44
+ this.hydrate();
45
+ }
46
+ /** `owner/repo#number` → a path segment safe to put in a URL. */
47
+ static idFor(owner, repo, number) {
48
+ return `${owner}__${repo}__${number}`.replace(/[^A-Za-z0-9_.-]/g, "-");
49
+ }
50
+ /** Store (replacing any previous page for the same PR) and return `id` + `token`. */
51
+ put(owner, repo, number, html) {
52
+ const id = PageStore.idFor(owner, repo, number);
53
+ const page = { html, storedMs: this.now() };
54
+ this.pages.set(id, page);
55
+ this.write(id, page);
56
+ this.evict();
57
+ return { id, token: this.sign(id) };
58
+ }
59
+ /**
60
+ * The page, if the token is valid and it has not expired.
61
+ *
62
+ * Expiry is checked against the STORED time rather than encoded in the token,
63
+ * so a link cannot outlive the data it points at — and re-reviewing a PR
64
+ * refreshes both together.
65
+ *
66
+ * Answered from memory even when there is a directory: `id` comes off a URL,
67
+ * and an id that never reaches the filesystem cannot be walked out of it.
68
+ */
69
+ get(id, token) {
70
+ const page = this.pages.get(id);
71
+ if (!page || !token || !this.valid(id, token))
72
+ return null;
73
+ if (this.now() - page.storedMs > this.ttlMs) {
74
+ this.remove(id);
75
+ return null;
76
+ }
77
+ return page.html;
78
+ }
79
+ get size() {
80
+ return this.pages.size;
81
+ }
82
+ sign(id) {
83
+ return createHmac("sha256", this.secret).update(id).digest("hex").slice(0, 32);
84
+ }
85
+ valid(id, token) {
86
+ const a = Buffer.from(this.sign(id));
87
+ const b = Buffer.from(token);
88
+ // Length first: timingSafeEqual throws on a mismatch, which would turn a
89
+ // truncated token into a 500 instead of a 404.
90
+ return a.length === b.length && timingSafeEqual(a, b);
91
+ }
92
+ /** Oldest out first, plus anything past its TTL. */
93
+ evict() {
94
+ const cutoff = this.now() - this.ttlMs;
95
+ for (const [id, page] of this.pages)
96
+ if (page.storedMs < cutoff)
97
+ this.remove(id);
98
+ while (this.pages.size > this.maxPages) {
99
+ const oldest = this.pages.keys().next();
100
+ if (oldest.done)
101
+ break;
102
+ this.remove(oldest.value);
103
+ }
104
+ }
105
+ /** Take back what a previous process left on disk. */
106
+ hydrate() {
107
+ const dir = this.dir;
108
+ if (!dir)
109
+ return;
110
+ let names;
111
+ try {
112
+ mkdirSync(dir, { recursive: true });
113
+ names = readdirSync(dir);
114
+ }
115
+ catch (err) {
116
+ // Nothing usable there: carry on in memory, which is exactly what every
117
+ // deployment without a directory does anyway.
118
+ console.warn(`page store: ${dir} is unusable, pages will not survive a restart (${reason(err)})`);
119
+ return;
120
+ }
121
+ const loaded = [];
122
+ for (const name of names) {
123
+ // The suffix also skips the temp files a write leaves behind when it dies
124
+ // partway, so a half-written page is never a candidate to begin with.
125
+ if (!name.endsWith(SUFFIX))
126
+ continue;
127
+ const page = this.read(join(dir, name));
128
+ if (page)
129
+ loaded.push([name.slice(0, -SUFFIX.length), page]);
130
+ }
131
+ // Oldest first, because eviction takes the front of the Map and readdir order
132
+ // is the filesystem's business rather than a record of what happened when.
133
+ loaded.sort((a, b) => a[1].storedMs - b[1].storedMs);
134
+ for (const [id, page] of loaded)
135
+ this.pages.set(id, page);
136
+ // A restart is also when pages that expired while the process was down go.
137
+ this.evict();
138
+ }
139
+ /** A stored page, or nothing: truncated, corrupt and gone are one answer here. */
140
+ read(file) {
141
+ try {
142
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
143
+ const { html, storedMs } = (parsed ?? {});
144
+ if (typeof html !== "string" || typeof storedMs !== "number" || !Number.isFinite(storedMs))
145
+ return null;
146
+ return { html, storedMs };
147
+ }
148
+ catch {
149
+ return null;
150
+ }
151
+ }
152
+ /**
153
+ * Temp file, then rename: a reader only ever sees a whole page, and two reviews
154
+ * of the same pull request racing each other leave one of them intact rather
155
+ * than the two interleaved.
156
+ */
157
+ write(id, page) {
158
+ const dir = this.dir;
159
+ if (!dir)
160
+ return;
161
+ const tmp = join(dir, `${id}.${randomBytes(6).toString("hex")}.tmp`);
162
+ try {
163
+ mkdirSync(dir, { recursive: true });
164
+ writeFileSync(tmp, JSON.stringify(page));
165
+ renameSync(tmp, join(dir, `${id}${SUFFIX}`));
166
+ }
167
+ catch (err) {
168
+ // The page is in memory and its link works; it just will not outlive this
169
+ // process. Worth a line in the log and nothing more: throwing here would
170
+ // fail a review that has already done all of its work.
171
+ console.warn(`page store: could not write ${id} (${reason(err)})`);
172
+ try {
173
+ unlinkSync(tmp);
174
+ }
175
+ catch {
176
+ // Never created, or already renamed into place.
177
+ }
178
+ }
179
+ }
180
+ remove(id) {
181
+ this.pages.delete(id);
182
+ if (!this.dir)
183
+ return;
184
+ try {
185
+ unlinkSync(join(this.dir, `${id}${SUFFIX}`));
186
+ }
187
+ catch {
188
+ // Already gone: deleted underneath us, or it never reached the disk.
189
+ }
190
+ }
191
+ }
192
+ const reason = (err) => (err instanceof Error ? err.message : String(err));
193
+ //# sourceMappingURL=pages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/app/pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,mFAAmF;AACnF,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAChD,kFAAkF;AAClF,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,oFAAoF;AACpF,MAAM,MAAM,GAAG,OAAO,CAAC;AAgBvB,MAAM,OAAO,SAAS;IACH,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IACtC,MAAM,CAAS;IACf,KAAK,CAAS;IACd,QAAQ,CAAS;IACjB,GAAG,CAAe;IAClB,GAAG,CAAqB;IAEzC,YAAY,IAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAA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AC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YACzC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,0EAA0E;YAC1E,yEAAyE;YACzE,uDAAuD;YACvD,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACnE,IAAI,CAAC;gBACH,UAAU,CAAC,GAAG,CAAC,CAAC;YAClB,CAAC;YAAC,MAAM,CAAC;gBACP,gDAAgD;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,EAAU;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,OAAO;QACtB,IAAI,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACP,qEAAqE;QACvE,CAAC;IACH,CAAC;CACF;AAED,MAAM,MAAM,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The work queue.
3
+ *
4
+ * A webhook must be answered in seconds, and a review takes tens of them, so the
5
+ * HTTP handler's only job is to enqueue. Two properties matter and neither comes
6
+ * free from a bare array:
7
+ *
8
+ * - **Superseding.** Five pushes to one pull request in a minute is normal, and
9
+ * reviewing the first four is wasted work whose comments are immediately
10
+ * overwritten. A queued job for the same PR is replaced, not appended.
11
+ * - **A ceiling.** One repository must not be able to starve every other
12
+ * installation, so a fixed number of workers drain the queue.
13
+ */
14
+ export interface QueueOptions {
15
+ concurrency?: number;
16
+ /** Called for every failure: a job that throws must not take the process down,
17
+ * and a silent catch would hide a broken installation forever. */
18
+ onError?: (err: unknown, key: string) => void;
19
+ }
20
+ export declare class WorkQueue<T> {
21
+ private readonly run;
22
+ private readonly pending;
23
+ private readonly running;
24
+ private readonly concurrency;
25
+ private readonly onError;
26
+ private idle;
27
+ constructor(run: (item: T) => Promise<void>, opts?: QueueOptions);
28
+ /**
29
+ * Queue work under `key`, replacing anything queued under it and not yet started.
30
+ *
31
+ * A job already RUNNING is left alone: cancelling mid-clone buys nothing, and
32
+ * the newer job simply runs after it and overwrites the comment.
33
+ */
34
+ push(key: string, item: T): void;
35
+ get size(): number;
36
+ /** Resolves when nothing is queued or running — for tests and for shutdown. */
37
+ drain(): Promise<void>;
38
+ private pump;
39
+ }
40
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/app/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;sEACkE;IAClE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED,qBAAa,SAAS,CAAC,CAAC;IAQpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAPtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsC;IAC9D,OAAO,CAAC,IAAI,CAAyB;IAErC,YACmB,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EAChD,IAAI,GAAE,YAAiB,EAIxB;IAED;;;;;OAKG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAG/B;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,+EAA+E;IACzE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3B;IAED,OAAO,CAAC,IAAI;CAoBb"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The work queue.
3
+ *
4
+ * A webhook must be answered in seconds, and a review takes tens of them, so the
5
+ * HTTP handler's only job is to enqueue. Two properties matter and neither comes
6
+ * free from a bare array:
7
+ *
8
+ * - **Superseding.** Five pushes to one pull request in a minute is normal, and
9
+ * reviewing the first four is wasted work whose comments are immediately
10
+ * overwritten. A queued job for the same PR is replaced, not appended.
11
+ * - **A ceiling.** One repository must not be able to starve every other
12
+ * installation, so a fixed number of workers drain the queue.
13
+ */
14
+ export class WorkQueue {
15
+ run;
16
+ pending = new Map();
17
+ running = new Set();
18
+ concurrency;
19
+ onError;
20
+ idle = [];
21
+ constructor(run, opts = {}) {
22
+ this.run = run;
23
+ this.concurrency = Math.max(1, opts.concurrency ?? 2);
24
+ this.onError = opts.onError ?? (() => { });
25
+ }
26
+ /**
27
+ * Queue work under `key`, replacing anything queued under it and not yet started.
28
+ *
29
+ * A job already RUNNING is left alone: cancelling mid-clone buys nothing, and
30
+ * the newer job simply runs after it and overwrites the comment.
31
+ */
32
+ push(key, item) {
33
+ this.pending.set(key, item);
34
+ this.pump();
35
+ }
36
+ get size() {
37
+ return this.pending.size + this.running.size;
38
+ }
39
+ /** Resolves when nothing is queued or running — for tests and for shutdown. */
40
+ async drain() {
41
+ if (this.size === 0)
42
+ return;
43
+ await new Promise((resolve) => this.idle.push(resolve));
44
+ }
45
+ pump() {
46
+ while (this.running.size < this.concurrency) {
47
+ const next = this.pending.entries().next();
48
+ if (next.done)
49
+ break;
50
+ const [key, item] = next.value;
51
+ this.pending.delete(key);
52
+ this.running.add(key);
53
+ void this.run(item)
54
+ .catch((err) => this.onError(err, key))
55
+ .finally(() => {
56
+ this.running.delete(key);
57
+ this.pump();
58
+ if (this.size === 0) {
59
+ const waiting = this.idle;
60
+ this.idle = [];
61
+ for (const resolve of waiting)
62
+ resolve();
63
+ }
64
+ });
65
+ }
66
+ }
67
+ }
68
+ //# sourceMappingURL=queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/app/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,MAAM,OAAO,SAAS;IAQD,GAAG;IAPL,OAAO,GAAG,IAAI,GAAG,EAAa,CAAC;IAC/B,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5B,WAAW,CAAS;IACpB,OAAO,CAAsC;IACtD,IAAI,GAAsB,EAAE,CAAC;IAErC,YACmB,GAA+B,EAChD,IAAI,GAAiB,EAAE;mBADN,GAAG;QAGpB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,GAAW,EAAE,IAAO;QACvB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC/C,CAAC;IAED,+EAA+E;IAC/E,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;YAAE,OAAO;QAC5B,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,IAAI;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;YAC3C,IAAI,IAAI,CAAC,IAAI;gBAAE,MAAM;YACrB,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;iBAChB,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;iBACtC,OAAO,CAAC,GAAG,EAAE;gBACZ,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACzB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACZ,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;oBACpB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;oBAC1B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;oBACf,KAAK,MAAM,OAAO,IAAI,OAAO;wBAAE,OAAO,EAAE,CAAC;gBAC3C,CAAC;YACH,CAAC,CAAC,CAAC;QACP,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,66 @@
1
+ import { type ReviewJob } from "./events.js";
2
+ import type { reviewPullRequest, ReviewResult } from "./review.js";
3
+ /** Parent → child, once, immediately after the fork. */
4
+ export interface StartMessage {
5
+ t: "start";
6
+ job: ReviewJob;
7
+ /** Minted by the parent; the child never sees the App's private key. */
8
+ token: string;
9
+ api?: string;
10
+ }
11
+ /** Parent → child: the URL a `publish` request ended up at, or null. */
12
+ export interface PublishedMessage {
13
+ t: "published";
14
+ seq: number;
15
+ url: string | null;
16
+ }
17
+ export type ToChild = StartMessage | PublishedMessage;
18
+ /** Child → parent: a line for the App's log, so a review is still traceable. */
19
+ export interface LogMessage {
20
+ t: "log";
21
+ msg: string;
22
+ }
23
+ /** Child → parent: store this page and tell me its URL. */
24
+ export interface PublishMessage {
25
+ t: "publish";
26
+ seq: number;
27
+ html: string;
28
+ }
29
+ export interface DoneMessage {
30
+ t: "done";
31
+ result: ReviewResult;
32
+ }
33
+ export interface FailedMessage {
34
+ t: "failed";
35
+ message: string;
36
+ }
37
+ export type FromChild = LogMessage | PublishMessage | DoneMessage | FailedMessage;
38
+ export interface ChildReviewerOptions {
39
+ /** The module the child runs. Only tests pass this. */
40
+ entry?: string;
41
+ timeoutMs?: number;
42
+ }
43
+ /**
44
+ * The module a review runs in.
45
+ *
46
+ * `dist/app/review-worker.js` in an installed or containerised App. Run from a
47
+ * checkout there is no `dist`, so fall back to the TypeScript source next door:
48
+ * `fork` inherits `process.execArgv`, so a parent started through tsx hands the
49
+ * child the same loader and a `.ts` entry runs. Resolved once, at import.
50
+ *
51
+ * Exported so a test can assert the path a deployed App will fork actually exists —
52
+ * getting this wrong is the one failure here that no unit test of the protocol
53
+ * would catch and every review would hit.
54
+ */
55
+ export declare function reviewWorkerEntry(): string;
56
+ /**
57
+ * A reviewer with `reviewPullRequest`'s signature that runs it in a child process.
58
+ *
59
+ * Same shape on purpose: `server.ts` swaps one for the other in a single line, and
60
+ * every existing test that injects its own reviewer through `AppSeams.review` keeps
61
+ * running in-process, which is what a test wants.
62
+ */
63
+ export declare function childReviewer(opts?: ChildReviewerOptions): typeof reviewPullRequest;
64
+ /** The App's default reviewer. */
65
+ export declare const reviewInChildProcess: typeof reviewPullRequest;
66
+ //# sourceMappingURL=review-process.d.ts.map
@@ -0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H,wBAAgB,iBAAiB,IAAI,MAAM,CAK1C;AAsCD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,oBAAyB,GAAG,OAAO,iBAAiB,CAIvF;AAoFD,kCAAkC;AAClC,eAAO,MAAM,oBAAoB,0BAAkB,CAAC"}
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Running a review somewhere it cannot stop the App answering.
3
+ *
4
+ * A review is synchronous from end to end, and not in one place we could fix: the
5
+ * pull request is fetched with `spawnSync` (`./checkout.ts`), the whole repository
6
+ * is parsed in one `files.forEach` loop of native tree-sitter calls
7
+ * (`graph/build.ts`), the graph is written with a blocking `JSON.stringify`, and
8
+ * the viewer page is exported synchronously too. In-process that holds the event
9
+ * loop for the entire review.
10
+ *
11
+ * That is not a theory. On the deployed App, probing `GET /p/<id>` from outside
12
+ * every ten seconds while one review ran: three consecutive timeouts (no response
13
+ * at all, not even with `--max-time 45`), then 404 in 0.9s the moment the queue
14
+ * emptied. Meanwhile the box's load average was 0.96 on eight vCPUs — one thread
15
+ * pegged, seven cores idle — and the App's own logs put a single review at 92s to
16
+ * 274s ("3 changed → 0 affected in 180134ms"). So a *single* in-flight review took
17
+ * the whole HTTP surface down for minutes: the container's 5s `HEALTHCHECK` failed,
18
+ * Docker marked the container unhealthy, and pages the App had already produced
19
+ * were unreachable. On a busy repository that is most of the working day.
20
+ *
21
+ * Neither bounding the queue nor lowering `JULIUS_CONCURRENCY` touches this —
22
+ * concurrency was already 2 and one job is enough. Cooperative yielding inside the
23
+ * parse loop does not either: a `git fetch` of a large repository is one
24
+ * uninterruptible `spawnSync` that can legitimately take a minute, and it is not
25
+ * even using a core while it blocks. The work has to leave the process.
26
+ *
27
+ * A child process rather than a `worker_threads` worker, deliberately:
28
+ *
29
+ * - **The native grammars keep loading the way they already do.** `graph/native.ts`
30
+ * requires up to nine tree-sitter addons and constructs a `Parser` the first time
31
+ * a build needs them, and `graph/generic.ts` loads more through `createRequire`.
32
+ * In a worker all of that is re-instantiated per thread, which puts the
33
+ * N-API-in-worker behaviour of nine third-party native modules between the App
34
+ * and every review. A fork runs
35
+ * byte-identical code to what production runs today.
36
+ * - **A review can be killed.** A wedged parse or a 10-minute clone is a process
37
+ * to SIGKILL, not a thread with no safe way to stop it.
38
+ * - **A crash stops being an outage.** An OOM kill or a grammar segfault on a
39
+ * stranger's source now costs one review and is reported as a failure, instead
40
+ * of taking the HTTP server with it. This process clones code written by
41
+ * people who opened a pull request; that isolation is worth having on its own.
42
+ * - **The heap goes away.** A repository's graph is freed by the child exiting
43
+ * rather than left for the server process to fragment around.
44
+ *
45
+ * The parent keeps exactly the two things a review cannot mint for itself, and
46
+ * hands each across the IPC channel rather than argv or the environment (`ps` and
47
+ * `/proc/<pid>/environ` are readable; an installation token belongs in neither):
48
+ * the token, so the App's private key never crosses the boundary, and page
49
+ * publishing, because the store and the secret it signs URLs with live with the
50
+ * server.
51
+ */
52
+ import { fork } from "node:child_process";
53
+ import { existsSync } from "node:fs";
54
+ import { fileURLToPath } from "node:url";
55
+ import { jobKey } from "./events.js";
56
+ /**
57
+ * How long one review may take before the process running it is killed.
58
+ *
59
+ * Generously above the worst honest review observed in production (274s) and above
60
+ * what `checkout.ts`'s own 120s-per-git-call budget can add up to, because the cost
61
+ * of being wrong here is a review that never happens. It is a ceiling on a *lost*
62
+ * queue slot, not on responsiveness — the server no longer cares how long a review
63
+ * runs, only that the slot comes back.
64
+ */
65
+ const DEFAULT_TIMEOUT_MS = 15 * 60 * 1000;
66
+ /**
67
+ * The module a review runs in.
68
+ *
69
+ * `dist/app/review-worker.js` in an installed or containerised App. Run from a
70
+ * checkout there is no `dist`, so fall back to the TypeScript source next door:
71
+ * `fork` inherits `process.execArgv`, so a parent started through tsx hands the
72
+ * child the same loader and a `.ts` entry runs. Resolved once, at import.
73
+ *
74
+ * Exported so a test can assert the path a deployed App will fork actually exists —
75
+ * getting this wrong is the one failure here that no unit test of the protocol
76
+ * would catch and every review would hit.
77
+ */
78
+ export function reviewWorkerEntry() {
79
+ const js = fileURLToPath(new URL("./review-worker.js", import.meta.url));
80
+ if (existsSync(js))
81
+ return js;
82
+ const ts = js.replace(/\.js$/, ".ts");
83
+ return existsSync(ts) ? ts : js;
84
+ }
85
+ /**
86
+ * Live review processes.
87
+ *
88
+ * `main.ts` force-exits 25 seconds after SIGTERM if a review has not finished
89
+ * draining. That used to kill the review along with the process; now the review is
90
+ * a separate process that would outlive us, still holding a clone made with an
91
+ * installation token. So the last thing this process does is take them with it.
92
+ *
93
+ * A container stop is unaffected either way: Docker signals PID 1, not the process
94
+ * group, so a review keeps going through the grace period and the drain in `main.ts`
95
+ * means what it says. Ctrl-C in a terminal signals the whole group, so the children
96
+ * die with the default disposition and their reviews are reported as killed — which
97
+ * is what an interrupted review was before this too.
98
+ */
99
+ const live = new Set();
100
+ let hooked = false;
101
+ function track(child) {
102
+ live.add(child);
103
+ if (hooked)
104
+ return;
105
+ hooked = true;
106
+ process.on("exit", () => {
107
+ for (const c of live)
108
+ c.kill("SIGKILL");
109
+ });
110
+ }
111
+ /** A dead channel is not worth an exception: the exit handler already covers it. */
112
+ function post(child, msg) {
113
+ if (!child.connected)
114
+ return;
115
+ try {
116
+ child.send(msg);
117
+ }
118
+ catch {
119
+ /* channel closed under us — `exit` will settle the review */
120
+ }
121
+ }
122
+ /**
123
+ * A reviewer with `reviewPullRequest`'s signature that runs it in a child process.
124
+ *
125
+ * Same shape on purpose: `server.ts` swaps one for the other in a single line, and
126
+ * every existing test that injects its own reviewer through `AppSeams.review` keeps
127
+ * running in-process, which is what a test wants.
128
+ */
129
+ export function childReviewer(opts = {}) {
130
+ const entry = opts.entry ?? reviewWorkerEntry();
131
+ const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
132
+ return (job, deps) => runInChild(job, deps, entry, timeoutMs);
133
+ }
134
+ async function runInChild(job, deps, entry, timeoutMs) {
135
+ const log = deps.log ?? (() => { });
136
+ // Minted here rather than in the child: this is a network round trip, never a
137
+ // blocking one, and the cache that owns installation tokens — including the
138
+ // forget-a-rejected-token behaviour — belongs to the one process that sees every
139
+ // delivery.
140
+ const token = await deps.token(job.installationId);
141
+ // The job key as argv makes `ps` in a container say which pull request each
142
+ // review is; the token stays out of it.
143
+ const child = fork(entry, [jobKey(job)], { stdio: ["ignore", "inherit", "inherit", "ipc"] });
144
+ track(child);
145
+ try {
146
+ return await new Promise((resolve, reject) => {
147
+ let settled = false;
148
+ const settle = (fn) => {
149
+ if (settled)
150
+ return;
151
+ settled = true;
152
+ clearTimeout(timer);
153
+ fn();
154
+ };
155
+ const timer = setTimeout(() => {
156
+ settle(() => reject(new Error(`review exceeded ${timeoutMs}ms and was killed`)));
157
+ }, timeoutMs);
158
+ timer.unref();
159
+ child.on("message", (raw) => {
160
+ const msg = raw;
161
+ if (msg.t === "log") {
162
+ log(msg.msg);
163
+ return;
164
+ }
165
+ if (msg.t === "publish") {
166
+ // Publishing happens here because the store and its signing secret do.
167
+ // A page that cannot be stored costs the link, never the review — the
168
+ // same contract `review.ts` already has with a null `publish`.
169
+ const stored = deps.publish ? deps.publish(job, msg.html) : Promise.resolve(null);
170
+ void stored
171
+ .catch(() => null)
172
+ .then((url) => post(child, { t: "published", seq: msg.seq, url }));
173
+ return;
174
+ }
175
+ if (msg.t === "done") {
176
+ settle(() => resolve(msg.result));
177
+ return;
178
+ }
179
+ settle(() => reject(new Error(msg.message)));
180
+ });
181
+ child.on("error", (err) => settle(() => reject(err)));
182
+ // The case that used to be an App-wide outage: a child that dies without
183
+ // reporting. An OOM kill, a segfault in a grammar on hostile source. Now it
184
+ // is one failed review, named, with the signal that did it.
185
+ child.on("exit", (code, signal) => settle(() => reject(new Error(`review process exited ${signal ? `on ${signal}` : `with code ${code}`} before reporting a result`))));
186
+ post(child, { t: "start", job, token, api: deps.api });
187
+ });
188
+ }
189
+ finally {
190
+ live.delete(child);
191
+ // Whatever happened — done, failed, timed out, or a delivery superseded by the
192
+ // queue — nothing forked here is allowed to outlive the review. `review.ts`
193
+ // deletes the checkout before it reports, so this leaves nothing behind.
194
+ if (child.exitCode === null && child.signalCode === null)
195
+ child.kill("SIGKILL");
196
+ }
197
+ }
198
+ /** The App's default reviewer. */
199
+ export const reviewInChildProcess = childReviewer();
200
+ //# sourceMappingURL=review-process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-process.js","sourceRoot":"","sources":["../../src/app/review-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,EAAE,IAAI,EAAqB,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAkB,MAAM,aAAa,CAAC;AAGrD;;;;;;;;GAQG;AACH,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAmD1C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,IAAI,UAAU,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9B,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,IAAI,GAAG,IAAI,GAAG,EAAgB,CAAC;AACrC,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,SAAS,KAAK,CAAC,KAAmB;IAChC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChB,IAAI,MAAM;QA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ACzE,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=review-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-worker.d.ts","sourceRoot":"","sources":["../../src/app/review-worker.ts"],"names":[],"mappings":""}