looply-cli 0.0.0-stage → 0.3.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 (793) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +137 -3
  3. package/dist/.src-hash +1 -0
  4. package/dist/acceptance-observe.d.ts +108 -0
  5. package/dist/acceptance-observe.d.ts.map +1 -0
  6. package/dist/acceptance-observe.js +152 -0
  7. package/dist/acceptance-observe.js.map +1 -0
  8. package/dist/agent-cmd.d.ts +131 -0
  9. package/dist/agent-cmd.d.ts.map +1 -0
  10. package/dist/agent-cmd.js +154 -0
  11. package/dist/agent-cmd.js.map +1 -0
  12. package/dist/agent-contained.d.ts +114 -0
  13. package/dist/agent-contained.d.ts.map +1 -0
  14. package/dist/agent-contained.js +292 -0
  15. package/dist/agent-contained.js.map +1 -0
  16. package/dist/agent-driver.d.ts +130 -0
  17. package/dist/agent-driver.d.ts.map +1 -0
  18. package/dist/agent-driver.js +170 -0
  19. package/dist/agent-driver.js.map +1 -0
  20. package/dist/agent-envelope.d.ts +94 -0
  21. package/dist/agent-envelope.d.ts.map +1 -0
  22. package/dist/agent-envelope.js +214 -0
  23. package/dist/agent-envelope.js.map +1 -0
  24. package/dist/agent-exec.d.ts +182 -0
  25. package/dist/agent-exec.d.ts.map +1 -0
  26. package/dist/agent-exec.js +125 -0
  27. package/dist/agent-exec.js.map +1 -0
  28. package/dist/agent-runtime.d.ts +23 -0
  29. package/dist/agent-runtime.d.ts.map +1 -0
  30. package/dist/agent-runtime.js +143 -0
  31. package/dist/agent-runtime.js.map +1 -0
  32. package/dist/approval-gate-read.d.ts +66 -0
  33. package/dist/approval-gate-read.d.ts.map +1 -0
  34. package/dist/approval-gate-read.js +138 -0
  35. package/dist/approval-gate-read.js.map +1 -0
  36. package/dist/approval-resolution.d.ts +87 -0
  37. package/dist/approval-resolution.d.ts.map +1 -0
  38. package/dist/approval-resolution.js +100 -0
  39. package/dist/approval-resolution.js.map +1 -0
  40. package/dist/approval-resumes.d.ts +102 -0
  41. package/dist/approval-resumes.d.ts.map +1 -0
  42. package/dist/approval-resumes.js +167 -0
  43. package/dist/approval-resumes.js.map +1 -0
  44. package/dist/ask-brain.d.ts +167 -0
  45. package/dist/ask-brain.d.ts.map +1 -0
  46. package/dist/ask-brain.js +355 -0
  47. package/dist/ask-brain.js.map +1 -0
  48. package/dist/autonomy-authority.d.ts +80 -0
  49. package/dist/autonomy-authority.d.ts.map +1 -0
  50. package/dist/autonomy-authority.js +82 -0
  51. package/dist/autonomy-authority.js.map +1 -0
  52. package/dist/autonomy-controller.d.ts +321 -0
  53. package/dist/autonomy-controller.d.ts.map +1 -0
  54. package/dist/autonomy-controller.js +517 -0
  55. package/dist/autonomy-controller.js.map +1 -0
  56. package/dist/autonomy-store.d.ts +327 -0
  57. package/dist/autonomy-store.d.ts.map +1 -0
  58. package/dist/autonomy-store.js +581 -0
  59. package/dist/autonomy-store.js.map +1 -0
  60. package/dist/autonomy-tick.d.ts +257 -0
  61. package/dist/autonomy-tick.d.ts.map +1 -0
  62. package/dist/autonomy-tick.js +616 -0
  63. package/dist/autonomy-tick.js.map +1 -0
  64. package/dist/bin.d.ts +3 -0
  65. package/dist/bin.d.ts.map +1 -0
  66. package/dist/bin.js +2727 -0
  67. package/dist/bin.js.map +1 -0
  68. package/dist/brain-advice.d.ts +21 -0
  69. package/dist/brain-advice.d.ts.map +1 -0
  70. package/dist/brain-advice.js +51 -0
  71. package/dist/brain-advice.js.map +1 -0
  72. package/dist/candidate-replay-runtime.d.ts +125 -0
  73. package/dist/candidate-replay-runtime.d.ts.map +1 -0
  74. package/dist/candidate-replay-runtime.js +188 -0
  75. package/dist/candidate-replay-runtime.js.map +1 -0
  76. package/dist/checkout-carry.d.ts +76 -0
  77. package/dist/checkout-carry.d.ts.map +1 -0
  78. package/dist/checkout-carry.js +125 -0
  79. package/dist/checkout-carry.js.map +1 -0
  80. package/dist/citation-readers.d.ts +26 -0
  81. package/dist/citation-readers.d.ts.map +1 -0
  82. package/dist/citation-readers.js +102 -0
  83. package/dist/citation-readers.js.map +1 -0
  84. package/dist/command-receipts.d.ts +79 -0
  85. package/dist/command-receipts.d.ts.map +1 -0
  86. package/dist/command-receipts.js +143 -0
  87. package/dist/command-receipts.js.map +1 -0
  88. package/dist/command-runner.d.ts +32 -0
  89. package/dist/command-runner.d.ts.map +1 -0
  90. package/dist/command-runner.js +108 -0
  91. package/dist/command-runner.js.map +1 -0
  92. package/dist/compatible-sets.d.ts +67 -0
  93. package/dist/compatible-sets.d.ts.map +1 -0
  94. package/dist/compatible-sets.js +81 -0
  95. package/dist/compatible-sets.js.map +1 -0
  96. package/dist/compile-check.d.ts +31 -0
  97. package/dist/compile-check.d.ts.map +1 -0
  98. package/dist/compile-check.js +34 -0
  99. package/dist/compile-check.js.map +1 -0
  100. package/dist/compile-store.d.ts +16 -0
  101. package/dist/compile-store.d.ts.map +1 -0
  102. package/dist/compile-store.js +21 -0
  103. package/dist/compile-store.js.map +1 -0
  104. package/dist/completion.d.ts +106 -0
  105. package/dist/completion.d.ts.map +1 -0
  106. package/dist/completion.js +131 -0
  107. package/dist/completion.js.map +1 -0
  108. package/dist/config.d.ts +549 -0
  109. package/dist/config.d.ts.map +1 -0
  110. package/dist/config.js +763 -0
  111. package/dist/config.js.map +1 -0
  112. package/dist/control-file.d.ts +142 -0
  113. package/dist/control-file.d.ts.map +1 -0
  114. package/dist/control-file.js +144 -0
  115. package/dist/control-file.js.map +1 -0
  116. package/dist/coordinator-state.d.ts +131 -0
  117. package/dist/coordinator-state.d.ts.map +1 -0
  118. package/dist/coordinator-state.js +380 -0
  119. package/dist/coordinator-state.js.map +1 -0
  120. package/dist/coordinator.d.ts +95 -0
  121. package/dist/coordinator.d.ts.map +1 -0
  122. package/dist/coordinator.js +97 -0
  123. package/dist/coordinator.js.map +1 -0
  124. package/dist/cursor-store.d.ts +53 -0
  125. package/dist/cursor-store.d.ts.map +1 -0
  126. package/dist/cursor-store.js +98 -0
  127. package/dist/cursor-store.js.map +1 -0
  128. package/dist/daemon-cmd.d.ts +239 -0
  129. package/dist/daemon-cmd.d.ts.map +1 -0
  130. package/dist/daemon-cmd.js +1751 -0
  131. package/dist/daemon-cmd.js.map +1 -0
  132. package/dist/daemon-lock.d.ts +140 -0
  133. package/dist/daemon-lock.d.ts.map +1 -0
  134. package/dist/daemon-lock.js +352 -0
  135. package/dist/daemon-lock.js.map +1 -0
  136. package/dist/daemon-recovery.d.ts +78 -0
  137. package/dist/daemon-recovery.d.ts.map +1 -0
  138. package/dist/daemon-recovery.js +161 -0
  139. package/dist/daemon-recovery.js.map +1 -0
  140. package/dist/daemon.d.ts +368 -0
  141. package/dist/daemon.d.ts.map +1 -0
  142. package/dist/daemon.js +601 -0
  143. package/dist/daemon.js.map +1 -0
  144. package/dist/declared-response-shape.d.ts +93 -0
  145. package/dist/declared-response-shape.d.ts.map +1 -0
  146. package/dist/declared-response-shape.js +200 -0
  147. package/dist/declared-response-shape.js.map +1 -0
  148. package/dist/declared-surfaces.d.ts +16 -0
  149. package/dist/declared-surfaces.d.ts.map +1 -0
  150. package/dist/declared-surfaces.js +19 -0
  151. package/dist/declared-surfaces.js.map +1 -0
  152. package/dist/depends-review.d.ts +113 -0
  153. package/dist/depends-review.d.ts.map +1 -0
  154. package/dist/depends-review.js +110 -0
  155. package/dist/depends-review.js.map +1 -0
  156. package/dist/doctor.d.ts +91 -0
  157. package/dist/doctor.d.ts.map +1 -0
  158. package/dist/doctor.js +71 -0
  159. package/dist/doctor.js.map +1 -0
  160. package/dist/edge-approval.d.ts +105 -0
  161. package/dist/edge-approval.d.ts.map +1 -0
  162. package/dist/edge-approval.js +100 -0
  163. package/dist/edge-approval.js.map +1 -0
  164. package/dist/evidence-cache.d.ts +45 -0
  165. package/dist/evidence-cache.d.ts.map +1 -0
  166. package/dist/evidence-cache.js +90 -0
  167. package/dist/evidence-cache.js.map +1 -0
  168. package/dist/evidence-cmd.d.ts +133 -0
  169. package/dist/evidence-cmd.d.ts.map +1 -0
  170. package/dist/evidence-cmd.js +347 -0
  171. package/dist/evidence-cmd.js.map +1 -0
  172. package/dist/evidence-facts.d.ts +40 -0
  173. package/dist/evidence-facts.d.ts.map +1 -0
  174. package/dist/evidence-facts.js +114 -0
  175. package/dist/evidence-facts.js.map +1 -0
  176. package/dist/exclusive-lock.d.ts +52 -0
  177. package/dist/exclusive-lock.d.ts.map +1 -0
  178. package/dist/exclusive-lock.js +150 -0
  179. package/dist/exclusive-lock.js.map +1 -0
  180. package/dist/exec-domains.d.ts +140 -0
  181. package/dist/exec-domains.d.ts.map +1 -0
  182. package/dist/exec-domains.js +287 -0
  183. package/dist/exec-domains.js.map +1 -0
  184. package/dist/exemption-store.d.ts +197 -0
  185. package/dist/exemption-store.d.ts.map +1 -0
  186. package/dist/exemption-store.js +266 -0
  187. package/dist/exemption-store.js.map +1 -0
  188. package/dist/explicit-start-gate.d.ts +96 -0
  189. package/dist/explicit-start-gate.d.ts.map +1 -0
  190. package/dist/explicit-start-gate.js +103 -0
  191. package/dist/explicit-start-gate.js.map +1 -0
  192. package/dist/fs-trouble.d.ts +70 -0
  193. package/dist/fs-trouble.d.ts.map +1 -0
  194. package/dist/fs-trouble.js +98 -0
  195. package/dist/fs-trouble.js.map +1 -0
  196. package/dist/gate.d.ts +278 -0
  197. package/dist/gate.d.ts.map +1 -0
  198. package/dist/gate.js +278 -0
  199. package/dist/gate.js.map +1 -0
  200. package/dist/git-driver.d.ts +519 -0
  201. package/dist/git-driver.d.ts.map +1 -0
  202. package/dist/git-driver.js +900 -0
  203. package/dist/git-driver.js.map +1 -0
  204. package/dist/git-push-executor.d.ts +41 -0
  205. package/dist/git-push-executor.d.ts.map +1 -0
  206. package/dist/git-push-executor.js +142 -0
  207. package/dist/git-push-executor.js.map +1 -0
  208. package/dist/glob.d.ts +26 -0
  209. package/dist/glob.d.ts.map +1 -0
  210. package/dist/glob.js +93 -0
  211. package/dist/glob.js.map +1 -0
  212. package/dist/goal-adaptive.d.ts +295 -0
  213. package/dist/goal-adaptive.d.ts.map +1 -0
  214. package/dist/goal-adaptive.js +393 -0
  215. package/dist/goal-adaptive.js.map +1 -0
  216. package/dist/goal-compile.d.ts +342 -0
  217. package/dist/goal-compile.d.ts.map +1 -0
  218. package/dist/goal-compile.js +444 -0
  219. package/dist/goal-compile.js.map +1 -0
  220. package/dist/goal-depends-executor.d.ts +55 -0
  221. package/dist/goal-depends-executor.d.ts.map +1 -0
  222. package/dist/goal-depends-executor.js +202 -0
  223. package/dist/goal-depends-executor.js.map +1 -0
  224. package/dist/goal-execution-evidence.d.ts +135 -0
  225. package/dist/goal-execution-evidence.d.ts.map +1 -0
  226. package/dist/goal-execution-evidence.js +159 -0
  227. package/dist/goal-execution-evidence.js.map +1 -0
  228. package/dist/goal-gap.d.ts +140 -0
  229. package/dist/goal-gap.d.ts.map +1 -0
  230. package/dist/goal-gap.js +197 -0
  231. package/dist/goal-gap.js.map +1 -0
  232. package/dist/goal-met-target.d.ts +98 -0
  233. package/dist/goal-met-target.d.ts.map +1 -0
  234. package/dist/goal-met-target.js +92 -0
  235. package/dist/goal-met-target.js.map +1 -0
  236. package/dist/goal-ownership.d.ts +416 -0
  237. package/dist/goal-ownership.d.ts.map +1 -0
  238. package/dist/goal-ownership.js +576 -0
  239. package/dist/goal-ownership.js.map +1 -0
  240. package/dist/goal-runs.d.ts +82 -0
  241. package/dist/goal-runs.d.ts.map +1 -0
  242. package/dist/goal-runs.js +120 -0
  243. package/dist/goal-runs.js.map +1 -0
  244. package/dist/goal-store.d.ts +146 -0
  245. package/dist/goal-store.d.ts.map +1 -0
  246. package/dist/goal-store.js +294 -0
  247. package/dist/goal-store.js.map +1 -0
  248. package/dist/goal-view.d.ts +156 -0
  249. package/dist/goal-view.d.ts.map +1 -0
  250. package/dist/goal-view.js +499 -0
  251. package/dist/goal-view.js.map +1 -0
  252. package/dist/governed-approvals.d.ts +152 -0
  253. package/dist/governed-approvals.d.ts.map +1 -0
  254. package/dist/governed-approvals.js +246 -0
  255. package/dist/governed-approvals.js.map +1 -0
  256. package/dist/governed-broker.d.ts +169 -0
  257. package/dist/governed-broker.d.ts.map +1 -0
  258. package/dist/governed-broker.js +196 -0
  259. package/dist/governed-broker.js.map +1 -0
  260. package/dist/governed-run.d.ts +220 -0
  261. package/dist/governed-run.d.ts.map +1 -0
  262. package/dist/governed-run.js +406 -0
  263. package/dist/governed-run.js.map +1 -0
  264. package/dist/grant-reconcile.d.ts +63 -0
  265. package/dist/grant-reconcile.d.ts.map +1 -0
  266. package/dist/grant-reconcile.js +121 -0
  267. package/dist/grant-reconcile.js.map +1 -0
  268. package/dist/index-for-head.d.ts +56 -0
  269. package/dist/index-for-head.d.ts.map +1 -0
  270. package/dist/index-for-head.js +103 -0
  271. package/dist/index-for-head.js.map +1 -0
  272. package/dist/index.d.ts +39 -0
  273. package/dist/index.d.ts.map +1 -0
  274. package/dist/index.js +55 -0
  275. package/dist/index.js.map +1 -0
  276. package/dist/init-detect.d.ts +39 -0
  277. package/dist/init-detect.d.ts.map +1 -0
  278. package/dist/init-detect.js +188 -0
  279. package/dist/init-detect.js.map +1 -0
  280. package/dist/integration-deps.d.ts +62 -0
  281. package/dist/integration-deps.d.ts.map +1 -0
  282. package/dist/integration-deps.js +251 -0
  283. package/dist/integration-deps.js.map +1 -0
  284. package/dist/integration-runtime.d.ts +458 -0
  285. package/dist/integration-runtime.d.ts.map +1 -0
  286. package/dist/integration-runtime.js +681 -0
  287. package/dist/integration-runtime.js.map +1 -0
  288. package/dist/integration.d.ts +45 -0
  289. package/dist/integration.d.ts.map +1 -0
  290. package/dist/integration.js +87 -0
  291. package/dist/integration.js.map +1 -0
  292. package/dist/integrator.d.ts +84 -0
  293. package/dist/integrator.d.ts.map +1 -0
  294. package/dist/integrator.js +193 -0
  295. package/dist/integrator.js.map +1 -0
  296. package/dist/lane-claims.d.ts +174 -0
  297. package/dist/lane-claims.d.ts.map +1 -0
  298. package/dist/lane-claims.js +218 -0
  299. package/dist/lane-claims.js.map +1 -0
  300. package/dist/lane-coverage.d.ts +87 -0
  301. package/dist/lane-coverage.d.ts.map +1 -0
  302. package/dist/lane-coverage.js +129 -0
  303. package/dist/lane-coverage.js.map +1 -0
  304. package/dist/ledger-replay.d.ts +115 -0
  305. package/dist/ledger-replay.d.ts.map +1 -0
  306. package/dist/ledger-replay.js +155 -0
  307. package/dist/ledger-replay.js.map +1 -0
  308. package/dist/ledger-store.d.ts +68 -0
  309. package/dist/ledger-store.d.ts.map +1 -0
  310. package/dist/ledger-store.js +111 -0
  311. package/dist/ledger-store.js.map +1 -0
  312. package/dist/loop-safety-observer.d.ts +132 -0
  313. package/dist/loop-safety-observer.d.ts.map +1 -0
  314. package/dist/loop-safety-observer.js +76 -0
  315. package/dist/loop-safety-observer.js.map +1 -0
  316. package/dist/loop-safety-store.d.ts +339 -0
  317. package/dist/loop-safety-store.d.ts.map +1 -0
  318. package/dist/loop-safety-store.js +800 -0
  319. package/dist/loop-safety-store.js.map +1 -0
  320. package/dist/machine-store.d.ts +54 -0
  321. package/dist/machine-store.d.ts.map +1 -0
  322. package/dist/machine-store.js +149 -0
  323. package/dist/machine-store.js.map +1 -0
  324. package/dist/mcp-main.d.ts +2 -0
  325. package/dist/mcp-main.d.ts.map +1 -0
  326. package/dist/mcp-main.js +116 -0
  327. package/dist/mcp-main.js.map +1 -0
  328. package/dist/mcp-server.d.ts +72 -0
  329. package/dist/mcp-server.d.ts.map +1 -0
  330. package/dist/mcp-server.js +259 -0
  331. package/dist/mcp-server.js.map +1 -0
  332. package/dist/model-routing.d.ts +75 -0
  333. package/dist/model-routing.d.ts.map +1 -0
  334. package/dist/model-routing.js +108 -0
  335. package/dist/model-routing.js.map +1 -0
  336. package/dist/model-transport.d.ts +188 -0
  337. package/dist/model-transport.d.ts.map +1 -0
  338. package/dist/model-transport.js +625 -0
  339. package/dist/model-transport.js.map +1 -0
  340. package/dist/notify-cadence.d.ts +55 -0
  341. package/dist/notify-cadence.d.ts.map +1 -0
  342. package/dist/notify-cadence.js +68 -0
  343. package/dist/notify-cadence.js.map +1 -0
  344. package/dist/notify-channel.d.ts +69 -0
  345. package/dist/notify-channel.d.ts.map +1 -0
  346. package/dist/notify-channel.js +151 -0
  347. package/dist/notify-channel.js.map +1 -0
  348. package/dist/notify.d.ts +71 -0
  349. package/dist/notify.d.ts.map +1 -0
  350. package/dist/notify.js +125 -0
  351. package/dist/notify.js.map +1 -0
  352. package/dist/observation-inventory.d.ts +65 -0
  353. package/dist/observation-inventory.d.ts.map +1 -0
  354. package/dist/observation-inventory.js +139 -0
  355. package/dist/observation-inventory.js.map +1 -0
  356. package/dist/owned-children.d.ts +45 -0
  357. package/dist/owned-children.d.ts.map +1 -0
  358. package/dist/owned-children.js +64 -0
  359. package/dist/owned-children.js.map +1 -0
  360. package/dist/packet-for-goal.d.ts +19 -0
  361. package/dist/packet-for-goal.d.ts.map +1 -0
  362. package/dist/packet-for-goal.js +32 -0
  363. package/dist/packet-for-goal.js.map +1 -0
  364. package/dist/pair-cmd.d.ts +85 -0
  365. package/dist/pair-cmd.d.ts.map +1 -0
  366. package/dist/pair-cmd.js +205 -0
  367. package/dist/pair-cmd.js.map +1 -0
  368. package/dist/partial-asker.d.ts +96 -0
  369. package/dist/partial-asker.d.ts.map +1 -0
  370. package/dist/partial-asker.js +117 -0
  371. package/dist/partial-asker.js.map +1 -0
  372. package/dist/pdf-text-lines.d.ts +17 -0
  373. package/dist/pdf-text-lines.d.ts.map +1 -0
  374. package/dist/pdf-text-lines.js +70 -0
  375. package/dist/pdf-text-lines.js.map +1 -0
  376. package/dist/pdf-text-worker.d.ts +2 -0
  377. package/dist/pdf-text-worker.d.ts.map +1 -0
  378. package/dist/pdf-text-worker.js +81 -0
  379. package/dist/pdf-text-worker.js.map +1 -0
  380. package/dist/pdf-text.d.ts +56 -0
  381. package/dist/pdf-text.d.ts.map +1 -0
  382. package/dist/pdf-text.js +64 -0
  383. package/dist/pdf-text.js.map +1 -0
  384. package/dist/pending-action.d.ts +154 -0
  385. package/dist/pending-action.d.ts.map +1 -0
  386. package/dist/pending-action.js +148 -0
  387. package/dist/pending-action.js.map +1 -0
  388. package/dist/preemptor.d.ts +40 -0
  389. package/dist/preemptor.d.ts.map +1 -0
  390. package/dist/preemptor.js +49 -0
  391. package/dist/preemptor.js.map +1 -0
  392. package/dist/programme-mode.d.ts +29 -0
  393. package/dist/programme-mode.d.ts.map +1 -0
  394. package/dist/programme-mode.js +50 -0
  395. package/dist/programme-mode.js.map +1 -0
  396. package/dist/progress-view.d.ts +14 -0
  397. package/dist/progress-view.d.ts.map +1 -0
  398. package/dist/progress-view.js +114 -0
  399. package/dist/progress-view.js.map +1 -0
  400. package/dist/project-graph-builder.d.ts +81 -0
  401. package/dist/project-graph-builder.d.ts.map +1 -0
  402. package/dist/project-graph-builder.js +246 -0
  403. package/dist/project-graph-builder.js.map +1 -0
  404. package/dist/project-graph-runtime.d.ts +86 -0
  405. package/dist/project-graph-runtime.d.ts.map +1 -0
  406. package/dist/project-graph-runtime.js +112 -0
  407. package/dist/project-graph-runtime.js.map +1 -0
  408. package/dist/project-index-builder.d.ts +96 -0
  409. package/dist/project-index-builder.d.ts.map +1 -0
  410. package/dist/project-index-builder.js +298 -0
  411. package/dist/project-index-builder.js.map +1 -0
  412. package/dist/project-index-facts.d.ts +51 -0
  413. package/dist/project-index-facts.d.ts.map +1 -0
  414. package/dist/project-index-facts.js +117 -0
  415. package/dist/project-index-facts.js.map +1 -0
  416. package/dist/project-index-store.d.ts +97 -0
  417. package/dist/project-index-store.d.ts.map +1 -0
  418. package/dist/project-index-store.js +140 -0
  419. package/dist/project-index-store.js.map +1 -0
  420. package/dist/project-memory-store.d.ts +127 -0
  421. package/dist/project-memory-store.d.ts.map +1 -0
  422. package/dist/project-memory-store.js +302 -0
  423. package/dist/project-memory-store.js.map +1 -0
  424. package/dist/proposal-store.d.ts +14 -0
  425. package/dist/proposal-store.d.ts.map +1 -0
  426. package/dist/proposal-store.js +19 -0
  427. package/dist/proposal-store.js.map +1 -0
  428. package/dist/prover.d.ts +80 -0
  429. package/dist/prover.d.ts.map +1 -0
  430. package/dist/prover.js +137 -0
  431. package/dist/prover.js.map +1 -0
  432. package/dist/provider-identity-store.d.ts +34 -0
  433. package/dist/provider-identity-store.d.ts.map +1 -0
  434. package/dist/provider-identity-store.js +72 -0
  435. package/dist/provider-identity-store.js.map +1 -0
  436. package/dist/provider-identity.d.ts +104 -0
  437. package/dist/provider-identity.d.ts.map +1 -0
  438. package/dist/provider-identity.js +167 -0
  439. package/dist/provider-identity.js.map +1 -0
  440. package/dist/provider-limit.d.ts +79 -0
  441. package/dist/provider-limit.d.ts.map +1 -0
  442. package/dist/provider-limit.js +148 -0
  443. package/dist/provider-limit.js.map +1 -0
  444. package/dist/provider-preflight.d.ts +171 -0
  445. package/dist/provider-preflight.d.ts.map +1 -0
  446. package/dist/provider-preflight.js +395 -0
  447. package/dist/provider-preflight.js.map +1 -0
  448. package/dist/provider-state.d.ts +120 -0
  449. package/dist/provider-state.d.ts.map +1 -0
  450. package/dist/provider-state.js +182 -0
  451. package/dist/provider-state.js.map +1 -0
  452. package/dist/providers.d.ts +132 -0
  453. package/dist/providers.d.ts.map +1 -0
  454. package/dist/providers.js +161 -0
  455. package/dist/providers.js.map +1 -0
  456. package/dist/publication-recorder.d.ts +117 -0
  457. package/dist/publication-recorder.d.ts.map +1 -0
  458. package/dist/publication-recorder.js +124 -0
  459. package/dist/publication-recorder.js.map +1 -0
  460. package/dist/pursuit-delivery.d.ts +24 -0
  461. package/dist/pursuit-delivery.d.ts.map +1 -0
  462. package/dist/pursuit-delivery.js +38 -0
  463. package/dist/pursuit-delivery.js.map +1 -0
  464. package/dist/queue-store.d.ts +132 -0
  465. package/dist/queue-store.d.ts.map +1 -0
  466. package/dist/queue-store.js +185 -0
  467. package/dist/queue-store.js.map +1 -0
  468. package/dist/queue-summary.d.ts +14 -0
  469. package/dist/queue-summary.d.ts.map +1 -0
  470. package/dist/queue-summary.js +82 -0
  471. package/dist/queue-summary.js.map +1 -0
  472. package/dist/queue-view.d.ts +20 -0
  473. package/dist/queue-view.d.ts.map +1 -0
  474. package/dist/queue-view.js +163 -0
  475. package/dist/queue-view.js.map +1 -0
  476. package/dist/queue-write-lease.d.ts +106 -0
  477. package/dist/queue-write-lease.d.ts.map +1 -0
  478. package/dist/queue-write-lease.js +282 -0
  479. package/dist/queue-write-lease.js.map +1 -0
  480. package/dist/rails-home.d.ts +162 -0
  481. package/dist/rails-home.d.ts.map +1 -0
  482. package/dist/rails-home.js +452 -0
  483. package/dist/rails-home.js.map +1 -0
  484. package/dist/rails-migrations.d.ts +75 -0
  485. package/dist/rails-migrations.d.ts.map +1 -0
  486. package/dist/rails-migrations.js +199 -0
  487. package/dist/rails-migrations.js.map +1 -0
  488. package/dist/rails-stores.d.ts +49 -0
  489. package/dist/rails-stores.d.ts.map +1 -0
  490. package/dist/rails-stores.js +100 -0
  491. package/dist/rails-stores.js.map +1 -0
  492. package/dist/reaper.d.ts +69 -0
  493. package/dist/reaper.d.ts.map +1 -0
  494. package/dist/reaper.js +152 -0
  495. package/dist/reaper.js.map +1 -0
  496. package/dist/record-store.d.ts +36 -0
  497. package/dist/record-store.d.ts.map +1 -0
  498. package/dist/record-store.js +78 -0
  499. package/dist/record-store.js.map +1 -0
  500. package/dist/recovery-io.d.ts +50 -0
  501. package/dist/recovery-io.d.ts.map +1 -0
  502. package/dist/recovery-io.js +122 -0
  503. package/dist/recovery-io.js.map +1 -0
  504. package/dist/recovery.d.ts +146 -0
  505. package/dist/recovery.d.ts.map +1 -0
  506. package/dist/recovery.js +110 -0
  507. package/dist/recovery.js.map +1 -0
  508. package/dist/redraw.d.ts +34 -0
  509. package/dist/redraw.d.ts.map +1 -0
  510. package/dist/redraw.js +62 -0
  511. package/dist/redraw.js.map +1 -0
  512. package/dist/rejected-evidence.d.ts +255 -0
  513. package/dist/rejected-evidence.d.ts.map +1 -0
  514. package/dist/rejected-evidence.js +324 -0
  515. package/dist/rejected-evidence.js.map +1 -0
  516. package/dist/report-cmd.d.ts +32 -0
  517. package/dist/report-cmd.d.ts.map +1 -0
  518. package/dist/report-cmd.js +201 -0
  519. package/dist/report-cmd.js.map +1 -0
  520. package/dist/repos-cmd.d.ts +80 -0
  521. package/dist/repos-cmd.d.ts.map +1 -0
  522. package/dist/repos-cmd.js +240 -0
  523. package/dist/repos-cmd.js.map +1 -0
  524. package/dist/request-body-shape.d.ts +93 -0
  525. package/dist/request-body-shape.d.ts.map +1 -0
  526. package/dist/request-body-shape.js +407 -0
  527. package/dist/request-body-shape.js.map +1 -0
  528. package/dist/requirement-claims.d.ts +89 -0
  529. package/dist/requirement-claims.d.ts.map +1 -0
  530. package/dist/requirement-claims.js +92 -0
  531. package/dist/requirement-claims.js.map +1 -0
  532. package/dist/retention-apply-runtime.d.ts +105 -0
  533. package/dist/retention-apply-runtime.d.ts.map +1 -0
  534. package/dist/retention-apply-runtime.js +269 -0
  535. package/dist/retention-apply-runtime.js.map +1 -0
  536. package/dist/reverify.d.ts +41 -0
  537. package/dist/reverify.d.ts.map +1 -0
  538. package/dist/reverify.js +69 -0
  539. package/dist/reverify.js.map +1 -0
  540. package/dist/round-records.d.ts +65 -0
  541. package/dist/round-records.d.ts.map +1 -0
  542. package/dist/round-records.js +61 -0
  543. package/dist/round-records.js.map +1 -0
  544. package/dist/round-runner.d.ts +924 -0
  545. package/dist/round-runner.d.ts.map +1 -0
  546. package/dist/round-runner.js +1693 -0
  547. package/dist/round-runner.js.map +1 -0
  548. package/dist/run-approval.d.ts +180 -0
  549. package/dist/run-approval.d.ts.map +1 -0
  550. package/dist/run-approval.js +199 -0
  551. package/dist/run-approval.js.map +1 -0
  552. package/dist/run-cmd.d.ts +359 -0
  553. package/dist/run-cmd.d.ts.map +1 -0
  554. package/dist/run-cmd.js +4418 -0
  555. package/dist/run-cmd.js.map +1 -0
  556. package/dist/run-delivery.d.ts +71 -0
  557. package/dist/run-delivery.d.ts.map +1 -0
  558. package/dist/run-delivery.js +104 -0
  559. package/dist/run-delivery.js.map +1 -0
  560. package/dist/run-ended.d.ts +75 -0
  561. package/dist/run-ended.d.ts.map +1 -0
  562. package/dist/run-ended.js +27 -0
  563. package/dist/run-ended.js.map +1 -0
  564. package/dist/run-ending-locator.d.ts +125 -0
  565. package/dist/run-ending-locator.d.ts.map +1 -0
  566. package/dist/run-ending-locator.js +133 -0
  567. package/dist/run-ending-locator.js.map +1 -0
  568. package/dist/run-launcher.d.ts +459 -0
  569. package/dist/run-launcher.d.ts.map +1 -0
  570. package/dist/run-launcher.js +652 -0
  571. package/dist/run-launcher.js.map +1 -0
  572. package/dist/run-lease.d.ts +208 -0
  573. package/dist/run-lease.d.ts.map +1 -0
  574. package/dist/run-lease.js +301 -0
  575. package/dist/run-lease.js.map +1 -0
  576. package/dist/run-refusal-marks.d.ts +189 -0
  577. package/dist/run-refusal-marks.d.ts.map +1 -0
  578. package/dist/run-refusal-marks.js +249 -0
  579. package/dist/run-refusal-marks.js.map +1 -0
  580. package/dist/run-start-marks.d.ts +153 -0
  581. package/dist/run-start-marks.d.ts.map +1 -0
  582. package/dist/run-start-marks.js +269 -0
  583. package/dist/run-start-marks.js.map +1 -0
  584. package/dist/scan-cmd.d.ts +14 -0
  585. package/dist/scan-cmd.d.ts.map +1 -0
  586. package/dist/scan-cmd.js +270 -0
  587. package/dist/scan-cmd.js.map +1 -0
  588. package/dist/scan-events.d.ts +50 -0
  589. package/dist/scan-events.d.ts.map +1 -0
  590. package/dist/scan-events.js +91 -0
  591. package/dist/scan-events.js.map +1 -0
  592. package/dist/scan.d.ts +191 -0
  593. package/dist/scan.d.ts.map +1 -0
  594. package/dist/scan.js +417 -0
  595. package/dist/scan.js.map +1 -0
  596. package/dist/scope-rule.d.ts +148 -0
  597. package/dist/scope-rule.d.ts.map +1 -0
  598. package/dist/scope-rule.js +121 -0
  599. package/dist/scope-rule.js.map +1 -0
  600. package/dist/self-repo-id.d.ts +18 -0
  601. package/dist/self-repo-id.d.ts.map +1 -0
  602. package/dist/self-repo-id.js +70 -0
  603. package/dist/self-repo-id.js.map +1 -0
  604. package/dist/serve-cmd.d.ts +115 -0
  605. package/dist/serve-cmd.d.ts.map +1 -0
  606. package/dist/serve-cmd.js +505 -0
  607. package/dist/serve-cmd.js.map +1 -0
  608. package/dist/serve.d.ts +167 -0
  609. package/dist/serve.d.ts.map +1 -0
  610. package/dist/serve.js +336 -0
  611. package/dist/serve.js.map +1 -0
  612. package/dist/server-client.d.ts +766 -0
  613. package/dist/server-client.d.ts.map +1 -0
  614. package/dist/server-client.js +475 -0
  615. package/dist/server-client.js.map +1 -0
  616. package/dist/session-adapter-runtime.d.ts +195 -0
  617. package/dist/session-adapter-runtime.d.ts.map +1 -0
  618. package/dist/session-adapter-runtime.js +373 -0
  619. package/dist/session-adapter-runtime.js.map +1 -0
  620. package/dist/session-checkpoint-runtime.d.ts +62 -0
  621. package/dist/session-checkpoint-runtime.d.ts.map +1 -0
  622. package/dist/session-checkpoint-runtime.js +268 -0
  623. package/dist/session-checkpoint-runtime.js.map +1 -0
  624. package/dist/session-control-transport.d.ts +106 -0
  625. package/dist/session-control-transport.d.ts.map +1 -0
  626. package/dist/session-control-transport.js +232 -0
  627. package/dist/session-control-transport.js.map +1 -0
  628. package/dist/session-observation-store.d.ts +98 -0
  629. package/dist/session-observation-store.d.ts.map +1 -0
  630. package/dist/session-observation-store.js +155 -0
  631. package/dist/session-observation-store.js.map +1 -0
  632. package/dist/session-observe-runtime.d.ts +123 -0
  633. package/dist/session-observe-runtime.d.ts.map +1 -0
  634. package/dist/session-observe-runtime.js +317 -0
  635. package/dist/session-observe-runtime.js.map +1 -0
  636. package/dist/session-store.d.ts +98 -0
  637. package/dist/session-store.d.ts.map +1 -0
  638. package/dist/session-store.js +116 -0
  639. package/dist/session-store.js.map +1 -0
  640. package/dist/sessions-cmd.d.ts +202 -0
  641. package/dist/sessions-cmd.d.ts.map +1 -0
  642. package/dist/sessions-cmd.js +609 -0
  643. package/dist/sessions-cmd.js.map +1 -0
  644. package/dist/settings-overlay.d.ts +53 -0
  645. package/dist/settings-overlay.d.ts.map +1 -0
  646. package/dist/settings-overlay.js +175 -0
  647. package/dist/settings-overlay.js.map +1 -0
  648. package/dist/setup-prompt.d.ts +34 -0
  649. package/dist/setup-prompt.d.ts.map +1 -0
  650. package/dist/setup-prompt.js +92 -0
  651. package/dist/setup-prompt.js.map +1 -0
  652. package/dist/setup.d.ts +103 -0
  653. package/dist/setup.d.ts.map +1 -0
  654. package/dist/setup.js +283 -0
  655. package/dist/setup.js.map +1 -0
  656. package/dist/shared-grants.d.ts +164 -0
  657. package/dist/shared-grants.d.ts.map +1 -0
  658. package/dist/shared-grants.js +242 -0
  659. package/dist/shared-grants.js.map +1 -0
  660. package/dist/signals.d.ts +55 -0
  661. package/dist/signals.d.ts.map +1 -0
  662. package/dist/signals.js +85 -0
  663. package/dist/signals.js.map +1 -0
  664. package/dist/source-cmd.d.ts +201 -0
  665. package/dist/source-cmd.d.ts.map +1 -0
  666. package/dist/source-cmd.js +684 -0
  667. package/dist/source-cmd.js.map +1 -0
  668. package/dist/source-verdict.d.ts +99 -0
  669. package/dist/source-verdict.d.ts.map +1 -0
  670. package/dist/source-verdict.js +182 -0
  671. package/dist/source-verdict.js.map +1 -0
  672. package/dist/spend-ledger.d.ts +350 -0
  673. package/dist/spend-ledger.d.ts.map +1 -0
  674. package/dist/spend-ledger.js +546 -0
  675. package/dist/spend-ledger.js.map +1 -0
  676. package/dist/stale-run-sweep.d.ts +79 -0
  677. package/dist/stale-run-sweep.d.ts.map +1 -0
  678. package/dist/stale-run-sweep.js +116 -0
  679. package/dist/stale-run-sweep.js.map +1 -0
  680. package/dist/start-attempts.d.ts +385 -0
  681. package/dist/start-attempts.d.ts.map +1 -0
  682. package/dist/start-attempts.js +613 -0
  683. package/dist/start-attempts.js.map +1 -0
  684. package/dist/status-cmd.d.ts +28 -0
  685. package/dist/status-cmd.d.ts.map +1 -0
  686. package/dist/status-cmd.js +116 -0
  687. package/dist/status-cmd.js.map +1 -0
  688. package/dist/stop-follow-up.d.ts +107 -0
  689. package/dist/stop-follow-up.d.ts.map +1 -0
  690. package/dist/stop-follow-up.js +172 -0
  691. package/dist/stop-follow-up.js.map +1 -0
  692. package/dist/surface-lease.d.ts +118 -0
  693. package/dist/surface-lease.d.ts.map +1 -0
  694. package/dist/surface-lease.js +485 -0
  695. package/dist/surface-lease.js.map +1 -0
  696. package/dist/sync.d.ts +54 -0
  697. package/dist/sync.d.ts.map +1 -0
  698. package/dist/sync.js +93 -0
  699. package/dist/sync.js.map +1 -0
  700. package/dist/syncing-ledger.d.ts +45 -0
  701. package/dist/syncing-ledger.d.ts.map +1 -0
  702. package/dist/syncing-ledger.js +53 -0
  703. package/dist/syncing-ledger.js.map +1 -0
  704. package/dist/temp-fixtures.d.ts +68 -0
  705. package/dist/temp-fixtures.d.ts.map +1 -0
  706. package/dist/temp-fixtures.js +38 -0
  707. package/dist/temp-fixtures.js.map +1 -0
  708. package/dist/token-window.d.ts +84 -0
  709. package/dist/token-window.d.ts.map +1 -0
  710. package/dist/token-window.js +143 -0
  711. package/dist/token-window.js.map +1 -0
  712. package/dist/tool-bridge.d.ts +177 -0
  713. package/dist/tool-bridge.d.ts.map +1 -0
  714. package/dist/tool-bridge.js +329 -0
  715. package/dist/tool-bridge.js.map +1 -0
  716. package/dist/tool-call-record.d.ts +197 -0
  717. package/dist/tool-call-record.d.ts.map +1 -0
  718. package/dist/tool-call-record.js +276 -0
  719. package/dist/tool-call-record.js.map +1 -0
  720. package/dist/tool-protocol.d.ts +135 -0
  721. package/dist/tool-protocol.d.ts.map +1 -0
  722. package/dist/tool-protocol.js +104 -0
  723. package/dist/tool-protocol.js.map +1 -0
  724. package/dist/tool-worker.d.ts +3 -0
  725. package/dist/tool-worker.d.ts.map +1 -0
  726. package/dist/tool-worker.js +478 -0
  727. package/dist/tool-worker.js.map +1 -0
  728. package/dist/toolchain-mirror.d.ts +86 -0
  729. package/dist/toolchain-mirror.d.ts.map +1 -0
  730. package/dist/toolchain-mirror.js +307 -0
  731. package/dist/toolchain-mirror.js.map +1 -0
  732. package/dist/trusted-git.d.ts +243 -0
  733. package/dist/trusted-git.d.ts.map +1 -0
  734. package/dist/trusted-git.js +920 -0
  735. package/dist/trusted-git.js.map +1 -0
  736. package/dist/ui.d.ts +76 -0
  737. package/dist/ui.d.ts.map +1 -0
  738. package/dist/ui.js +118 -0
  739. package/dist/ui.js.map +1 -0
  740. package/dist/untrusted-exec.d.ts +275 -0
  741. package/dist/untrusted-exec.d.ts.map +1 -0
  742. package/dist/untrusted-exec.js +479 -0
  743. package/dist/untrusted-exec.js.map +1 -0
  744. package/dist/untrusted-gate.d.ts +73 -0
  745. package/dist/untrusted-gate.d.ts.map +1 -0
  746. package/dist/untrusted-gate.js +226 -0
  747. package/dist/untrusted-gate.js.map +1 -0
  748. package/dist/uploader.d.ts +153 -0
  749. package/dist/uploader.d.ts.map +1 -0
  750. package/dist/uploader.js +204 -0
  751. package/dist/uploader.js.map +1 -0
  752. package/dist/verifier.d.ts +66 -0
  753. package/dist/verifier.d.ts.map +1 -0
  754. package/dist/verifier.js +170 -0
  755. package/dist/verifier.js.map +1 -0
  756. package/dist/verify-apply.d.ts +26 -0
  757. package/dist/verify-apply.d.ts.map +1 -0
  758. package/dist/verify-apply.js +36 -0
  759. package/dist/verify-apply.js.map +1 -0
  760. package/dist/verify-cmd.d.ts +44 -0
  761. package/dist/verify-cmd.d.ts.map +1 -0
  762. package/dist/verify-cmd.js +125 -0
  763. package/dist/verify-cmd.js.map +1 -0
  764. package/dist/verify-pass.d.ts +73 -0
  765. package/dist/verify-pass.d.ts.map +1 -0
  766. package/dist/verify-pass.js +103 -0
  767. package/dist/verify-pass.js.map +1 -0
  768. package/dist/welcome.d.ts +43 -0
  769. package/dist/welcome.d.ts.map +1 -0
  770. package/dist/welcome.js +116 -0
  771. package/dist/welcome.js.map +1 -0
  772. package/dist/workspace-provisioner.d.ts +65 -0
  773. package/dist/workspace-provisioner.d.ts.map +1 -0
  774. package/dist/workspace-provisioner.js +66 -0
  775. package/dist/workspace-provisioner.js.map +1 -0
  776. package/dist/workspace-quarantine.d.ts +64 -0
  777. package/dist/workspace-quarantine.d.ts.map +1 -0
  778. package/dist/workspace-quarantine.js +156 -0
  779. package/dist/workspace-quarantine.js.map +1 -0
  780. package/dist/workspace-residue-sweep.d.ts +113 -0
  781. package/dist/workspace-residue-sweep.d.ts.map +1 -0
  782. package/dist/workspace-residue-sweep.js +158 -0
  783. package/dist/workspace-residue-sweep.js.map +1 -0
  784. package/dist/workspace.d.ts +639 -0
  785. package/dist/workspace.d.ts.map +1 -0
  786. package/dist/workspace.js +2026 -0
  787. package/dist/workspace.js.map +1 -0
  788. package/package.json +52 -4
  789. package/win/CredProbe.cs +64 -0
  790. package/win/FakeClaude.cs +56 -0
  791. package/win/HandleProbe.cs +116 -0
  792. package/win/TokenProbe.cs +53 -0
  793. package/win/appcontainer.ps1 +500 -0
@@ -0,0 +1,81 @@
1
+ import { type ProjectGraphSnapshot, type ProjectIndexSnapshot, type ProjectMemoryRecord } from '@looply/core';
2
+ /**
3
+ * JOINING FIVE STORES INTO ONE ANSWERABLE SHAPE.
4
+ *
5
+ * ─────────────────────────────────────────────────────────────────────────────
6
+ * 🔴 IT DERIVES. IT NEVER ORIGINATES.
7
+ *
8
+ * Every node and every edge here traces to a record some other component
9
+ * already wrote: a file in the committed tree, a symbol the extractor found, an
10
+ * Item's own `goalId`, a memory record's own `kind`. Nothing is invented, and
11
+ * nothing is upgraded — a memory record of kind `inference` becomes a node of
12
+ * authority `model_inference` because that is what it already was, and there is
13
+ * no argument to this builder by which it could become anything else.
14
+ *
15
+ * That is the whole safety property, and it is achieved by NOT HAVING A KNOB
16
+ * rather than by validating one: `NODE_AUTHORITY` and `EDGE_AUTHORITY` are
17
+ * lookups on the type, and the type comes from the source record.
18
+ *
19
+ * ─────────────────────────────────────────────────────────────────────────────
20
+ * WHAT IT COSTS TO BUILD, AND WHY THAT IS FINE
21
+ *
22
+ * Measured on this repository at the freeze: 563 tracked files, 440 TypeScript.
23
+ * The structural pass is one linear walk of the index's own already-sorted
24
+ * collections; there is no parsing here at all, because Phase 12 already did it
25
+ * and this consumes its output. A whole graph is cheaper than the index build
26
+ * that precedes it, which is why there is no incremental path — see the store.
27
+ */
28
+ /** What the builder needs from the operational stores. Deliberately narrow. */
29
+ export interface OperationalInput {
30
+ /**
31
+ * ⚠️ `text`, NOT `title`. A Goal's field is the user's own wording preserved
32
+ * verbatim, and naming it `title` here would invite a caller to pass a
33
+ * summary — which `goal.ts` refuses in the strongest terms it has.
34
+ */
35
+ readonly goals: readonly {
36
+ readonly id: string;
37
+ readonly text: string;
38
+ readonly version: number;
39
+ }[];
40
+ readonly items: readonly {
41
+ readonly id: string;
42
+ readonly title: string;
43
+ readonly goalId?: string | null;
44
+ readonly evidence: readonly {
45
+ readonly path: string;
46
+ }[];
47
+ }[];
48
+ }
49
+ export interface BuildGraphInput {
50
+ readonly projectKey: string;
51
+ readonly index: ProjectIndexSnapshot;
52
+ readonly memory: readonly ProjectMemoryRecord[];
53
+ readonly operational: OperationalInput;
54
+ }
55
+ /**
56
+ * 🔴 THE ONLY FIELDS OF A MEMORY RECORD THAT REACH THE GRAPH.
57
+ *
58
+ * Named as a list, and picked one at a time below rather than spread, because
59
+ * the failure this prevents is silent and permanent: a `{...record}` would carry
60
+ * `content` — which the store caps at a thousand characters precisely BECAUSE a
61
+ * field that long is a field that can hold a secret — into a derived file with
62
+ * its own lifetime and its own copies.
63
+ *
64
+ * The graph holds RELATIONSHIPS. The claims stay in memory, where Phase 11
65
+ * already bounds them, already redacts them, and already decides what a prompt
66
+ * may see. A query here returns memory IDS; the context builder resolves them
67
+ * back through the store. That is one authority for what a claim says, not two.
68
+ */
69
+ export declare const MEMORY_NODE_FIELDS: readonly ["id", "kind", "subject"];
70
+ /**
71
+ * Build the whole graph for one project at one moment.
72
+ *
73
+ * 🔴 REFUSED PARTS ARE DROPPED, NOT REPAIRED. `admitGraphNode` and
74
+ * `admitGraphEdge` are the same policy a test and a store can ask, and a builder
75
+ * that "fixed" a refusal would be a second place the policy lived — the exact
76
+ * duplication Phase 11 spent a fence on preventing. A dangling edge is dropped
77
+ * because a graph that names a node it does not have answers a question with an
78
+ * absence that reads as a finding.
79
+ */
80
+ export declare function buildProjectGraph(input: BuildGraphInput): ProjectGraphSnapshot;
81
+ //# sourceMappingURL=project-graph-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-graph-builder.d.ts","sourceRoot":"","sources":["../src/project-graph-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAsBL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpG,QAAQ,CAAC,KAAK,EAAE,SAAS;QACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACzD,EAAE,CAAC;CACL;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;CACxC;AAmCD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,oCAAqC,CAAC;AAgCrE;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,oBAAoB,CA6I9E"}
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MEMORY_NODE_FIELDS = void 0;
4
+ exports.buildProjectGraph = buildProjectGraph;
5
+ const core_1 = require("@looply/core");
6
+ /**
7
+ * A file path a knowledge or work record refers to, normalised the ONE way.
8
+ *
9
+ * ⚠️ THROUGH `canonicalPath`'s RULES, NOT A SECOND OPINION. An Item's evidence
10
+ * and a memory record's `scope.path` are written by other components which do
11
+ * not necessarily agree with the index on a leading `./` or a backslash. Two
12
+ * spellings of one file would produce two nodes, and the whole join would come
13
+ * apart quietly — half the edges pointing at a path the index never emitted.
14
+ */
15
+ function samePathAs(index) {
16
+ const known = new Set(index.files.map((f) => f.path));
17
+ return (raw) => {
18
+ const p = raw.replace(/\\/g, '/').replace(/\/+/g, '/').replace(/^\.\//, '').replace(/^\/+/, '');
19
+ return known.has(p) ? p : null;
20
+ };
21
+ }
22
+ /** The memory kinds that become nodes, and the node type each becomes. */
23
+ const MEMORY_NODE_TYPE = {
24
+ fact: 'fact',
25
+ decision: 'decision',
26
+ inference: 'inference',
27
+ attempt: 'attempt',
28
+ };
29
+ /** The edge a memory node hangs on, by kind. */
30
+ const MEMORY_EDGE_TYPE = {
31
+ fact: 'fact_about',
32
+ decision: 'decision_about',
33
+ inference: 'inference_about',
34
+ attempt: 'attempt_on',
35
+ };
36
+ /**
37
+ * 🔴 THE ONLY FIELDS OF A MEMORY RECORD THAT REACH THE GRAPH.
38
+ *
39
+ * Named as a list, and picked one at a time below rather than spread, because
40
+ * the failure this prevents is silent and permanent: a `{...record}` would carry
41
+ * `content` — which the store caps at a thousand characters precisely BECAUSE a
42
+ * field that long is a field that can hold a secret — into a derived file with
43
+ * its own lifetime and its own copies.
44
+ *
45
+ * The graph holds RELATIONSHIPS. The claims stay in memory, where Phase 11
46
+ * already bounds them, already redacts them, and already decides what a prompt
47
+ * may see. A query here returns memory IDS; the context builder resolves them
48
+ * back through the store. That is one authority for what a claim says, not two.
49
+ */
50
+ exports.MEMORY_NODE_FIELDS = ['id', 'kind', 'subject'];
51
+ function truncateLabel(s) {
52
+ return s.length <= core_1.MAX_NODE_LABEL_CHARS ? s : s.slice(0, core_1.MAX_NODE_LABEL_CHARS);
53
+ }
54
+ function makeNode(type, sourceId, label, presence) {
55
+ return {
56
+ id: (0, core_1.nodeId)(type, sourceId),
57
+ type,
58
+ sourceId,
59
+ // From the table, never from an argument. See the header.
60
+ authority: core_1.NODE_AUTHORITY[type],
61
+ presence,
62
+ label: truncateLabel(label),
63
+ };
64
+ }
65
+ function makeEdge(type, from, to, provenance) {
66
+ return { id: (0, core_1.edgeId)(type, from, to), type, from, to, authority: core_1.EDGE_AUTHORITY[type], provenance };
67
+ }
68
+ /**
69
+ * Build the whole graph for one project at one moment.
70
+ *
71
+ * 🔴 REFUSED PARTS ARE DROPPED, NOT REPAIRED. `admitGraphNode` and
72
+ * `admitGraphEdge` are the same policy a test and a store can ask, and a builder
73
+ * that "fixed" a refusal would be a second place the policy lived — the exact
74
+ * duplication Phase 11 spent a fence on preventing. A dangling edge is dropped
75
+ * because a graph that names a node it does not have answers a question with an
76
+ * absence that reads as a finding.
77
+ */
78
+ function buildProjectGraph(input) {
79
+ const nodes = new Map();
80
+ const edges = new Map();
81
+ const resolvePath = samePathAs(input.index);
82
+ const add = (n) => {
83
+ if ((0, core_1.admitGraphNode)(n).ok !== true)
84
+ return null;
85
+ /**
86
+ * First writer wins, which makes this pass ORDER-INDEPENDENT rather than
87
+ * protecting anything today.
88
+ *
89
+ * ⚠️ AND A MUTATION PROVED THAT DISTINCTION. Removing this guard changed no
90
+ * observable behaviour, because the only `historical` node is minted after
91
+ * `resolvePath` returned null — for a path the index does not have — so
92
+ * there can be no `current` node with that id to protect. The guard is
93
+ * cheap insurance against the structural and knowledge passes being
94
+ * reordered, and it is NOT the reason a current file stays current.
95
+ *
96
+ * Recorded rather than deleted, and recorded rather than left claiming a
97
+ * protection it does not perform: a comment that overstates what a line does
98
+ * is the defect this codebase keeps finding in its own docblocks.
99
+ */
100
+ if (!nodes.has(n.id))
101
+ nodes.set(n.id, n);
102
+ return n.id;
103
+ };
104
+ const link = (type, from, to, p) => {
105
+ if (from === null || to === null)
106
+ return;
107
+ const e = makeEdge(type, from, to, p);
108
+ if ((0, core_1.admitGraphEdge)(e, nodes).ok === true)
109
+ edges.set(e.id, e);
110
+ };
111
+ /* ── the project itself, so `contains` has a root ── */
112
+ const project = add(makeNode('project', input.projectKey, input.projectKey, 'current'));
113
+ /* ── structural: everything the committed tree establishes ── */
114
+ const indexRef = { via: 'project-index', refs: [input.index.treeSha] };
115
+ for (const name of input.index.packages) {
116
+ const pkg = add(makeNode('package', name, name, 'current'));
117
+ link('contains', project, pkg, indexRef);
118
+ }
119
+ for (const f of input.index.files) {
120
+ const file = add(makeNode('file', f.path, f.path, 'current'));
121
+ if (f.packageName !== null) {
122
+ link('contains', (0, core_1.nodeId)('package', f.packageName), file, indexRef);
123
+ }
124
+ }
125
+ for (const s of input.index.symbols) {
126
+ const sym = add(makeNode('symbol', s.id, s.name, 'current'));
127
+ link('declares', (0, core_1.nodeId)('file', s.file), sym, indexRef);
128
+ }
129
+ for (const i of input.index.imports) {
130
+ if (i.resolved === null)
131
+ continue;
132
+ const from = (0, core_1.nodeId)('file', i.from);
133
+ const to = (0, core_1.nodeId)('file', i.resolved);
134
+ link('imports', from, to, indexRef);
135
+ /**
136
+ * ⚠️ AND SEPARATELY, IF THE IMPORTER IS A TEST. Not instead of `imports` —
137
+ * as well. A planner asking "what depends on this" wants the test in the
138
+ * answer, and one asking "what should I run" wants only the test. Two
139
+ * questions, so two edges, rather than one edge and a filter somebody has
140
+ * to remember to apply.
141
+ */
142
+ if ((0, core_1.isTestPath)(i.from))
143
+ link('structurally_tests', from, to, indexRef);
144
+ }
145
+ /* ── operational: what Looply is working on ── */
146
+ for (const g of input.operational.goals) {
147
+ add(makeNode('goal', g.id, g.text, 'current'));
148
+ }
149
+ for (const it of input.operational.items) {
150
+ const item = add(makeNode('item', it.id, it.title, 'current'));
151
+ if (it.goalId !== undefined && it.goalId !== null) {
152
+ link('goal_has_item', (0, core_1.nodeId)('goal', it.goalId), item, { via: 'goal-store', refs: [it.goalId] });
153
+ }
154
+ for (const e of it.evidence) {
155
+ const path = resolvePath(e.path);
156
+ /**
157
+ * An Item naming a path the tree does not have is ordinary — the work may
158
+ * be to CREATE it. It becomes a historical file node rather than a current
159
+ * one, so the join survives and nothing tells a planner the file is there.
160
+ */
161
+ const target = path !== null
162
+ ? (0, core_1.nodeId)('file', path)
163
+ : add(makeNode('file', canonicalise(e.path), canonicalise(e.path), 'historical'));
164
+ link('item_touches', item, target, { via: 'queue-store', refs: [it.id] });
165
+ }
166
+ }
167
+ /* ── knowledge: what memory holds, at the authority memory gave it ── */
168
+ for (const r of input.memory) {
169
+ /**
170
+ * 🔴 ANOTHER PROJECT'S CLAIM IS NOT THIS PROJECT'S CLAIM.
171
+ *
172
+ * `ProjectMemoryStore.parse` already refuses to LOAD a foreign record, so
173
+ * production cannot reach this line. It is here because the phase requires
174
+ * isolation to hold at the graph's own boundary rather than be inherited
175
+ * from a caller — and because `memory` is an injected array, so the only
176
+ * thing standing between two projects would otherwise be that every future
177
+ * caller remembered.
178
+ *
179
+ * The dangerous case is not the obvious one. A foreign record scoped to a
180
+ * path that also exists HERE would attach to this project's file node and
181
+ * be returned by `decisionsFor` as though a person had said it about this
182
+ * code.
183
+ */
184
+ if (r.scope.projectKey !== input.projectKey)
185
+ continue;
186
+ /**
187
+ * A withdrawal is not a claim. Phase 11 refuses to render one and so does
188
+ * this: a node for it would be a decision-shaped thing whose whole content
189
+ * is that another decision stopped applying.
190
+ */
191
+ if (r.withdrawn === true)
192
+ continue;
193
+ const type = MEMORY_NODE_TYPE[r.kind];
194
+ // Picked field by field. See MEMORY_NODE_FIELDS — never a spread.
195
+ const known = add(makeNode(type, r.id, r.subject, 'current'));
196
+ if (known === null)
197
+ continue;
198
+ const target = subjectTarget(r, resolvePath, add);
199
+ if (target === null)
200
+ continue;
201
+ link(MEMORY_EDGE_TYPE[r.kind], known, target, { via: 'project-memory', refs: [r.id] });
202
+ }
203
+ const built = {
204
+ revision: {
205
+ schema: core_1.PROJECT_GRAPH_SCHEMA,
206
+ builder: core_1.GRAPH_BUILDER_VERSION,
207
+ treeSha: input.index.treeSha,
208
+ // The dormant assurance, given a caller. See `GraphRevision`.
209
+ indexDigest: (0, core_1.indexDigest)(input.index),
210
+ memoryCursor: (0, core_1.memoryCursor)(input.memory.map((r) => r.id)),
211
+ operationalCursor: (0, core_1.operationalCursor)(input.operational.goals.map((g) => ({ id: g.id, version: g.version }))),
212
+ },
213
+ projectKey: input.projectKey,
214
+ nodes: (0, core_1.sortNodes)([...nodes.values()]),
215
+ edges: (0, core_1.sortEdges)([...edges.values()]),
216
+ };
217
+ return built;
218
+ }
219
+ /** The one path normalisation, applied to a path the index does not have. */
220
+ function canonicalise(raw) {
221
+ return raw.replace(/\\/g, '/').replace(/\/+/g, '/').replace(/^\.\//, '').replace(/^\/+/, '');
222
+ }
223
+ /**
224
+ * What a memory record is ABOUT, as a node.
225
+ *
226
+ * 🔴 THE `historical` BRANCH IS §2.11, AND IT IS THE WHOLE REASON THIS IS NOT
227
+ * THREE LINES. A person's decision about `src/auth.ts` must survive that file
228
+ * being deleted — dropping it loses a constraint because of a rename, which is
229
+ * C0-13-7 — and it must not be attached to a node claiming the file is there,
230
+ * which is PSG-N24. So the target is minted as `historical`, the edge is kept,
231
+ * and every structural query filters on presence.
232
+ *
233
+ * A record scoped to no path at all is about the PROJECT. That is the common
234
+ * case for a decision ("never force-push"), and attaching it to the project root
235
+ * is what makes it findable without pretending it is about a file.
236
+ */
237
+ function subjectTarget(r, resolvePath, add) {
238
+ if (r.scope.path === undefined)
239
+ return (0, core_1.nodeId)('project', r.scope.projectKey);
240
+ const path = resolvePath(r.scope.path);
241
+ if (path !== null)
242
+ return (0, core_1.nodeId)('file', path);
243
+ const gone = canonicalise(r.scope.path);
244
+ return add(makeNode('file', gone, gone, 'historical'));
245
+ }
246
+ //# sourceMappingURL=project-graph-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-graph-builder.js","sourceRoot":"","sources":["../src/project-graph-builder.ts"],"names":[],"mappings":";;;AAsKA,8CA6IC;AAnTD,uCAyBsB;AAoDtB;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,KAA2B;IAC7C,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAW,EAAE,EAAE;QACrB,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChG,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,MAAM,gBAAgB,GAAgD;IACpE,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,gDAAgD;AAChD,MAAM,gBAAgB,GAAgD;IACpE,IAAI,EAAE,YAAY;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,E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C,IAAI,CAAC,CAAC;IACxC,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { type GraphStaleness, type ProjectGraphSnapshot, type ProjectIndexSnapshot, type ProjectMemoryRecord } from '@looply/core';
2
+ import { type OperationalInput } from './project-graph-builder';
3
+ /**
4
+ * THE ONE PLACE A CURRENT GRAPH COMES FROM.
5
+ *
6
+ * ─────────────────────────────────────────────────────────────────────────────
7
+ * 🔴 THERE IS NO GRAPH STORE, AND THAT IS A DECISION WITH A MEASUREMENT BEHIND IT
8
+ *
9
+ * The obvious shape was a sibling of `ProjectIndexStore`: content-addressed
10
+ * files under `.looply/state`, loaded on a hit, rebuilt on a miss. It was not
11
+ * built, for three reasons that all point the same way.
12
+ *
13
+ * 1. THE BUILD IS ALREADY FREE. Phase 12 does the expensive part — reading
14
+ * blobs, extracting symbols — and this consumes its OUTPUT. Building a whole
15
+ * graph is one linear walk of collections already sorted and already in
16
+ * memory. Caching a walk behind a filesystem is slower than the walk.
17
+ *
18
+ * 2. A STORE IS A PROMISE. This phase's own audit found that
19
+ * `MAX_SNAPSHOTS = 4` in the index store documents a retention policy that
20
+ * NOTHING implements — no prune, no eviction, and the `readDir` capability
21
+ * the constructor accepts is never called. Shipping a second store beside
22
+ * it would have meant either repeating that or fixing it as a side effect of
23
+ * an unrelated phase.
24
+ *
25
+ * 3. LOSS MUST BE RECOVERABLE ANYWAY. The graph is derived. With nothing
26
+ * persisted, "recoverable" is not a property to be tested — it is the only
27
+ * thing that can happen.
28
+ *
29
+ * ─────────────────────────────────────────────────────────────────────────────
30
+ * 🔴 AND THE FRESHNESS GUARD IS STILL LOAD-BEARING — MORE SO
31
+ *
32
+ * The worry about dropping the store is that `graphFreshness` becomes the
33
+ * `agrees()` of this phase: correct, tested, and unreachable. It does not,
34
+ * because the world moves DURING a run.
35
+ *
36
+ * Measured: the index is built once, at `run-cmd.ts` before the round loop, and
37
+ * `round-runner.ts` commits inside that loop. So the committed tree changes
38
+ * mid-run, every run that lands anything. Phase 12 already meets this and loses:
39
+ * index-derived facts carry the tree they were observed at, `currencyOf` marks
40
+ * them `stale-revision` after the first commit, and the model's structural
41
+ * knowledge goes dark for the rest of the run — precisely when it has begun
42
+ * changing the repository and needs it most.
43
+ *
44
+ * This asks the question every time it is consulted, and REBUILDS rather than
45
+ * going quiet. The guard fires on the common path, not on a contrived one.
46
+ */
47
+ export interface GraphRuntimeDeps {
48
+ readonly projectKey: string;
49
+ /** The committed tree, now. Throwing is treated as "could not look". */
50
+ readonly headTreeSha: () => Promise<string>;
51
+ /** The index for a tree — cached or freshly built; this does not care which. */
52
+ readonly indexFor: (treeSha: string) => Promise<ProjectIndexSnapshot | null>;
53
+ /** Every memory record held for this project. Bounding happens downstream. */
54
+ readonly memory: () => readonly ProjectMemoryRecord[];
55
+ readonly operational: () => OperationalInput;
56
+ }
57
+ /**
58
+ * Holds at most one graph and will not hand out a stale one.
59
+ *
60
+ * ⚠️ NOT A CACHE WITH A CORRECTNESS CHECK BOLTED ON. The check IS the interface:
61
+ * `current()` has no path that returns a graph without having just established
62
+ * that its revision agrees with the world, and the post-condition below asserts
63
+ * it rather than trusting the branch above to have been written correctly.
64
+ */
65
+ export declare class ProjectGraphRuntime {
66
+ private readonly deps;
67
+ private held;
68
+ private lastRefusal;
69
+ private builds;
70
+ constructor(deps: GraphRuntimeDeps);
71
+ /** Why the last call could not produce a graph, or null if it could. */
72
+ refusal(): GraphStaleness | null;
73
+ /** How many times a graph has actually been built. For tests and diagnosis. */
74
+ buildCount(): number;
75
+ /**
76
+ * A graph that speaks for the present, or null.
77
+ *
78
+ * 🔴 NULL IS A REFUSAL, NOT AN EMPTY GRAPH. A caller handed an empty graph
79
+ * would render "nothing depends on this file", which is a finding. Handed
80
+ * null, it renders nothing at all — which is the truth: Looply could not
81
+ * establish the structure this time.
82
+ */
83
+ current(): Promise<ProjectGraphSnapshot | null>;
84
+ private refuse;
85
+ }
86
+ //# sourceMappingURL=project-graph-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-graph-runtime.d.ts","sourceRoot":"","sources":["../src/project-graph-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAC7E,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,MAAM,SAAS,mBAAmB,EAAE,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,gBAAgB,CAAC;CAC9C;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAmB;IAKlB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,IAAI,CAAqC;IACjD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,MAAM,CAAK;gBAEU,IAAI,EAAE,gBAAgB;IAEnD,wEAAwE;IACxE,OAAO,IAAI,cAAc,GAAG,IAAI;IAIhC,+EAA+E;IAC/E,UAAU,IAAI,MAAM;IAIpB;;;;;;;OAOG;IACG,OAAO,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAkErD,OAAO,CAAC,MAAM;CAUf"}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectGraphRuntime = void 0;
4
+ const core_1 = require("@looply/core");
5
+ const project_graph_builder_1 = require("./project-graph-builder");
6
+ /**
7
+ * Holds at most one graph and will not hand out a stale one.
8
+ *
9
+ * ⚠️ NOT A CACHE WITH A CORRECTNESS CHECK BOLTED ON. The check IS the interface:
10
+ * `current()` has no path that returns a graph without having just established
11
+ * that its revision agrees with the world, and the post-condition below asserts
12
+ * it rather than trusting the branch above to have been written correctly.
13
+ */
14
+ class ProjectGraphRuntime {
15
+ deps;
16
+ held = null;
17
+ lastRefusal = null;
18
+ builds = 0;
19
+ constructor(deps) {
20
+ this.deps = deps;
21
+ }
22
+ /** Why the last call could not produce a graph, or null if it could. */
23
+ refusal() {
24
+ return this.lastRefusal;
25
+ }
26
+ /** How many times a graph has actually been built. For tests and diagnosis. */
27
+ buildCount() {
28
+ return this.builds;
29
+ }
30
+ /**
31
+ * A graph that speaks for the present, or null.
32
+ *
33
+ * 🔴 NULL IS A REFUSAL, NOT AN EMPTY GRAPH. A caller handed an empty graph
34
+ * would render "nothing depends on this file", which is a finding. Handed
35
+ * null, it renders nothing at all — which is the truth: Looply could not
36
+ * establish the structure this time.
37
+ */
38
+ async current() {
39
+ let treeSha;
40
+ try {
41
+ treeSha = await this.deps.headTreeSha();
42
+ }
43
+ catch {
44
+ return this.refuse('unconfirmable');
45
+ }
46
+ let index;
47
+ try {
48
+ index = await this.deps.indexFor(treeSha);
49
+ }
50
+ catch {
51
+ return this.refuse('unconfirmable');
52
+ }
53
+ if (index === null)
54
+ return this.refuse('unconfirmable');
55
+ /**
56
+ * ⚠️ AND THE INDEX MUST BE FOR THE TREE WE ASKED ABOUT. `ProjectIndexStore`
57
+ * already refuses a snapshot filed under the wrong name, but this does not
58
+ * inherit that: `indexFor` is an injected function, and a caller that built
59
+ * one from a different revision would otherwise have it silently signed into
60
+ * a graph revision claiming the tree we measured.
61
+ */
62
+ if (index.treeSha !== treeSha)
63
+ return this.refuse('stale-index');
64
+ const memory = this.deps.memory();
65
+ const operational = this.deps.operational();
66
+ const world = {
67
+ currentTreeSha: treeSha,
68
+ currentIndexDigest: (0, core_1.indexDigest)(index),
69
+ currentMemoryCursor: (0, core_1.memoryCursor)(memory.map((r) => r.id)),
70
+ currentOperationalCursor: (0, core_1.operationalCursor)(operational.goals.map((g) => ({ id: g.id, version: g.version }))),
71
+ };
72
+ if (this.held !== null && (0, core_1.graphFreshness)(this.held.revision, world).current) {
73
+ this.lastRefusal = null;
74
+ return this.held;
75
+ }
76
+ const built = (0, project_graph_builder_1.buildProjectGraph)({
77
+ projectKey: this.deps.projectKey,
78
+ index,
79
+ memory,
80
+ operational,
81
+ });
82
+ this.builds += 1;
83
+ /**
84
+ * 🔴 THE POST-CONDITION, ASSERTED RATHER THAN ASSUMED.
85
+ *
86
+ * A graph is only ever returned after this passes, so there is no ordering
87
+ * of the branches above — and no future edit to them — that can hand out one
88
+ * whose revision does not agree with the world it was just measured against.
89
+ * If the builder and the cursor functions ever disagree, this says so
90
+ * immediately instead of shipping a graph that lies about which world it
91
+ * describes.
92
+ */
93
+ const check = (0, core_1.graphFreshness)(built.revision, world);
94
+ if (!check.current)
95
+ return this.refuse(check.because);
96
+ this.held = built;
97
+ this.lastRefusal = null;
98
+ return built;
99
+ }
100
+ refuse(because) {
101
+ this.lastRefusal = because;
102
+ /**
103
+ * The held graph is DROPPED, not kept for a luckier moment. Keeping it would
104
+ * mean a later call could return a graph built against a world nobody
105
+ * re-checked, which is the whole failure this class exists to prevent.
106
+ */
107
+ this.held = null;
108
+ return null;
109
+ }
110
+ }
111
+ exports.ProjectGraphRuntime = ProjectGraphRuntime;
112
+ //# sourceMappingURL=project-graph-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-graph-runtime.js","sourceRoot":"","sources":["../src/project-graph-runtime.ts"],"names":[],"mappings":";;;AAAA,uCASsB;AACtB,mEAAmF;A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;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArGD,kDAqGC"}
@@ -0,0 +1,96 @@
1
+ import { type IndexedImport, type IndexedSymbol, type ProjectIndexSnapshot } from '@looply/core';
2
+ import type { GitDriver } from './git-driver';
3
+ /**
4
+ * BUILDING THE INDEX FROM WHAT GIT ALREADY KNOWS.
5
+ *
6
+ * ─────────────────────────────────────────────────────────────────────────────
7
+ * 🔴 NO PARSER, AND THAT IS A SHIPPING CONSTRAINT RATHER THAN A PREFERENCE
8
+ *
9
+ * `typescript` is NOT a dependency of this package. It resolves inside this
10
+ * monorepo only because the root has a hoisted dev copy — the published
11
+ * `looply-cli` declares three runtime dependencies and TypeScript is not among
12
+ * them. A `require('typescript')` here would pass every test in this repository
13
+ * and throw MODULE_NOT_FOUND for every real `npx looply-cli` user, and the
14
+ * committed-tree certifier could not catch it either: it borrows `node_modules`
15
+ * from the working tree, which HAS the hoisted copy.
16
+ *
17
+ * So extraction is dependency-free and deliberately CONSERVATIVE. It finds what
18
+ * it can state plainly and records everything else as unparsed WITH A REASON.
19
+ * A guessed symbol would be structural truth invented by pattern-matching,
20
+ * which is precisely what a deterministic index exists not to contain.
21
+ *
22
+ * ─────────────────────────────────────────────────────────────────────────────
23
+ * WHAT IT FINDS, AND WHAT IT DOES NOT
24
+ *
25
+ * finds top-level `export` declarations and static import specifiers
26
+ * does not private symbols, re-export chains, dynamic imports, anything
27
+ * inside a namespace or a conditional block
28
+ *
29
+ * The boundary is chosen so that a false POSITIVE is nearly impossible: every
30
+ * pattern is anchored to the start of a line, so a match is a real top-level
31
+ * declaration or nothing. Missing something is recoverable — a later phase can
32
+ * widen it. Inventing something is not, because a graph built on it looks
33
+ * exactly like a graph built on evidence.
34
+ */
35
+ /**
36
+ * Files above this are recorded as `unparsed`, not read.
37
+ *
38
+ * A megabyte of source is a generated file or a vendored blob, and reading it
39
+ * would spend the whole budget on something no dependency question is about.
40
+ * Recorded rather than skipped, so a reader knows the index HAS an opinion
41
+ * about that path and the opinion is "I did not look".
42
+ */
43
+ export declare const MAX_INDEXED_BYTES: number;
44
+ /** Where a workspace package's files live, and what the package is called. */
45
+ export interface PackageRoot {
46
+ readonly name: string;
47
+ /** Canonical, no trailing slash. e.g. `packages/core`. */
48
+ readonly dir: string;
49
+ }
50
+ export interface BuildIndexInput {
51
+ readonly git: Pick<GitDriver, 'listTree' | 'readBlob' | 'headTreeSha'>;
52
+ readonly packages: readonly PackageRoot[];
53
+ /** Defaults to the committed tree at HEAD. */
54
+ readonly treeSha?: string;
55
+ }
56
+ /**
57
+ * The package a file belongs to.
58
+ *
59
+ * Longest prefix wins, so a nested package inside another is attributed to the
60
+ * nearer one rather than to whichever happened to be checked first — an order
61
+ * dependence would be exactly the kind of non-determinism this phase is about.
62
+ */
63
+ export declare function packageFor(path: string, packages: readonly PackageRoot[]): string | null;
64
+ export interface Extraction {
65
+ readonly symbols: readonly IndexedSymbol[];
66
+ readonly imports: readonly IndexedImport[];
67
+ }
68
+ /**
69
+ * Read one TypeScript file's exported declarations and imports.
70
+ *
71
+ * Line-anchored on purpose: a pattern that could match mid-line would find
72
+ * `export` inside a string or a comment and invent a symbol from it.
73
+ */
74
+ export declare function extractFrom(path: string, source: string): Extraction;
75
+ /**
76
+ * Where a specifier points, when that can be answered without guessing.
77
+ *
78
+ * 🔴 RELATIVE SPECIFIERS ONLY. A bare specifier may be a package OR a path
79
+ * alias configured in a tsconfig this extractor does not read, and inventing a
80
+ * target would put a relationship in the index that nothing established.
81
+ * `null` means NOT RESOLVED — it does not mean external.
82
+ *
83
+ * ⚠️ THE EXTENSION IS NOT GUESSED EITHER. `./foo` could be `foo.ts`, `foo.tsx`
84
+ * or `foo/index.ts`, and choosing one would be right most of the time, which is
85
+ * the worst possible property for a fact somebody builds on. The caller
86
+ * resolves against the real file list; this reports the normalised path only.
87
+ */
88
+ export declare function resolveSpecifier(from: string, specifier: string): string | null;
89
+ /**
90
+ * Build the whole index for a revision.
91
+ *
92
+ * Every collection is sorted before it is returned, so the caller cannot
93
+ * accidentally depend on the order git happened to emit.
94
+ */
95
+ export declare function buildProjectIndex(input: BuildIndexInput): Promise<ProjectIndexSnapshot>;
96
+ //# sourceMappingURL=project-index-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-index-builder.d.ts","sourceRoot":"","sources":["../src/project-index-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAE5C,8EAA8E;AAC9E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;IACvE,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,GAAG,IAAI,CAQxF;AAuED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;CAC5C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,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