@amalgm/shell 0.1.164-preview.36072132286 → 0.1.164-preview.36809057014

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 (475) hide show
  1. package/PURPOSE.md +642 -128
  2. package/README.md +10 -8
  3. package/dist/accepted-tail.d.ts +26 -0
  4. package/dist/accepted-tail.js +37 -0
  5. package/dist/accepted-tail.js.map +1 -0
  6. package/dist/agent-execution.d.ts +16 -1
  7. package/dist/agent-execution.js +13 -5
  8. package/dist/agent-execution.js.map +1 -1
  9. package/dist/apply-cleanup.d.ts +28 -0
  10. package/dist/apply-cleanup.js +166 -0
  11. package/dist/apply-cleanup.js.map +1 -0
  12. package/dist/apply-recovery.d.ts +47 -0
  13. package/dist/apply-recovery.js +99 -0
  14. package/dist/apply-recovery.js.map +1 -0
  15. package/dist/apply-rows.d.ts +72 -0
  16. package/dist/apply-rows.js +150 -0
  17. package/dist/apply-rows.js.map +1 -0
  18. package/dist/apply-saves.d.ts +85 -0
  19. package/dist/apply-saves.js +238 -0
  20. package/dist/apply-saves.js.map +1 -0
  21. package/dist/boot.js +2 -1
  22. package/dist/boot.js.map +1 -1
  23. package/dist/capture-work.d.ts +8 -0
  24. package/dist/capture-work.js +67 -0
  25. package/dist/capture-work.js.map +1 -0
  26. package/dist/cargo-group.d.ts +45 -0
  27. package/dist/cargo-group.js +88 -0
  28. package/dist/cargo-group.js.map +1 -0
  29. package/dist/channel-session.d.ts +4 -2
  30. package/dist/channel-session.js +4 -3
  31. package/dist/channel-session.js.map +1 -1
  32. package/dist/chat-composition.d.ts +2 -0
  33. package/dist/chat-composition.js +1 -0
  34. package/dist/chat-composition.js.map +1 -1
  35. package/dist/cli.js +20 -1
  36. package/dist/cli.js.map +1 -1
  37. package/dist/construct-apply-host.d.ts +4 -2
  38. package/dist/construct-apply-host.js +8 -3
  39. package/dist/construct-apply-host.js.map +1 -1
  40. package/dist/construct-door.js +1 -1
  41. package/dist/construct-door.js.map +1 -1
  42. package/dist/construct-ledger.d.ts +6 -1
  43. package/dist/construct-ledger.js +21 -33
  44. package/dist/construct-ledger.js.map +1 -1
  45. package/dist/content-cache-collection.d.ts +18 -0
  46. package/dist/content-cache-collection.js +99 -0
  47. package/dist/content-cache-collection.js.map +1 -0
  48. package/dist/content-cache-host.d.ts +83 -17
  49. package/dist/content-cache-host.js +335 -95
  50. package/dist/content-cache-host.js.map +1 -1
  51. package/dist/content-cache-namespace.d.ts +59 -0
  52. package/dist/content-cache-namespace.js +210 -0
  53. package/dist/content-cache-namespace.js.map +1 -0
  54. package/dist/content-cache-ownership.d.ts +13 -0
  55. package/dist/content-cache-ownership.js +75 -0
  56. package/dist/content-cache-ownership.js.map +1 -0
  57. package/dist/content-cache-retention.d.ts +23 -0
  58. package/dist/content-cache-retention.js +195 -0
  59. package/dist/content-cache-retention.js.map +1 -0
  60. package/dist/content-capture-pool.d.ts +287 -0
  61. package/dist/content-capture-pool.js +461 -0
  62. package/dist/content-capture-pool.js.map +1 -0
  63. package/dist/content-capture-worker.d.ts +8 -0
  64. package/dist/content-capture-worker.js +109 -0
  65. package/dist/content-capture-worker.js.map +1 -0
  66. package/dist/content-clock.d.ts +42 -0
  67. package/dist/content-clock.js +166 -0
  68. package/dist/content-clock.js.map +1 -0
  69. package/dist/content-direct.d.ts +2 -0
  70. package/dist/content-direct.js +12 -0
  71. package/dist/content-direct.js.map +1 -1
  72. package/dist/content-failure.d.ts +18 -0
  73. package/dist/content-failure.js +38 -0
  74. package/dist/content-failure.js.map +1 -0
  75. package/dist/content-stream-thread.d.ts +60 -0
  76. package/dist/content-stream-thread.js +95 -0
  77. package/dist/content-stream-thread.js.map +1 -0
  78. package/dist/content-stream-worker.d.ts +7 -0
  79. package/dist/content-stream-worker.js +52 -0
  80. package/dist/content-stream-worker.js.map +1 -0
  81. package/dist/declaration-absorption.d.ts +37 -0
  82. package/dist/declaration-absorption.js +119 -0
  83. package/dist/declaration-absorption.js.map +1 -0
  84. package/dist/declaration-chain.d.ts +36 -0
  85. package/dist/declaration-chain.js +96 -0
  86. package/dist/declaration-chain.js.map +1 -0
  87. package/dist/declaration-commit.d.ts +31 -0
  88. package/dist/declaration-commit.js +49 -0
  89. package/dist/declaration-commit.js.map +1 -0
  90. package/dist/declaration-hold.d.ts +22 -0
  91. package/dist/declaration-hold.js +24 -0
  92. package/dist/declaration-hold.js.map +1 -0
  93. package/dist/declaration-journal.d.ts +62 -0
  94. package/dist/declaration-journal.js +99 -0
  95. package/dist/declaration-journal.js.map +1 -0
  96. package/dist/declaration-save.d.ts +31 -0
  97. package/dist/declaration-save.js +134 -0
  98. package/dist/declaration-save.js.map +1 -0
  99. package/dist/detection/accepted-result.d.ts +19 -1
  100. package/dist/detection/accepted-result.js +36 -5
  101. package/dist/detection/accepted-result.js.map +1 -1
  102. package/dist/detection/admission-save.d.ts +55 -0
  103. package/dist/detection/admission-save.js +48 -0
  104. package/dist/detection/admission-save.js.map +1 -0
  105. package/dist/detection/admission-units.d.ts +66 -0
  106. package/dist/detection/admission-units.js +322 -0
  107. package/dist/detection/admission-units.js.map +1 -0
  108. package/dist/detection/alias-discovery.d.ts +12 -0
  109. package/dist/detection/alias-discovery.js +80 -0
  110. package/dist/detection/alias-discovery.js.map +1 -0
  111. package/dist/detection/alias-examination.d.ts +30 -0
  112. package/dist/detection/alias-examination.js +49 -0
  113. package/dist/detection/alias-examination.js.map +1 -0
  114. package/dist/detection/apply-ownership.d.ts +81 -0
  115. package/dist/detection/apply-ownership.js +232 -0
  116. package/dist/detection/apply-ownership.js.map +1 -0
  117. package/dist/detection/basis-advanced.d.ts +11 -0
  118. package/dist/detection/basis-advanced.js +26 -0
  119. package/dist/detection/basis-advanced.js.map +1 -0
  120. package/dist/detection/capture-outcome.d.ts +16 -0
  121. package/dist/detection/capture-outcome.js +92 -0
  122. package/dist/detection/capture-outcome.js.map +1 -0
  123. package/dist/detection/container-membership.d.ts +32 -0
  124. package/dist/detection/container-membership.js +49 -0
  125. package/dist/detection/container-membership.js.map +1 -0
  126. package/dist/detection/detect-cancelled.d.ts +6 -0
  127. package/dist/detection/detect-cancelled.js +10 -0
  128. package/dist/detection/detect-cancelled.js.map +1 -0
  129. package/dist/detection/directory-proof.d.ts +47 -0
  130. package/dist/detection/directory-proof.js +77 -0
  131. package/dist/detection/directory-proof.js.map +1 -0
  132. package/dist/detection/disposition-rows.d.ts +18 -0
  133. package/dist/detection/disposition-rows.js +29 -0
  134. package/dist/detection/disposition-rows.js.map +1 -0
  135. package/dist/detection/dispositions.d.ts +130 -0
  136. package/dist/detection/dispositions.js +248 -0
  137. package/dist/detection/dispositions.js.map +1 -0
  138. package/dist/detection/git-notice.d.ts +88 -0
  139. package/dist/detection/git-notice.js +444 -0
  140. package/dist/detection/git-notice.js.map +1 -0
  141. package/dist/detection/ground-proof.d.ts +130 -0
  142. package/dist/detection/ground-proof.js +274 -0
  143. package/dist/detection/ground-proof.js.map +1 -0
  144. package/dist/detection/ground-reader.d.ts +29 -0
  145. package/dist/detection/ground-reader.js +102 -0
  146. package/dist/detection/ground-reader.js.map +1 -0
  147. package/dist/detection/held-territory.d.ts +51 -0
  148. package/dist/detection/held-territory.js +205 -0
  149. package/dist/detection/held-territory.js.map +1 -0
  150. package/dist/detection/identity-discovery.d.ts +45 -0
  151. package/dist/detection/identity-discovery.js +287 -0
  152. package/dist/detection/identity-discovery.js.map +1 -0
  153. package/dist/detection/maintenance-sweep.d.ts +108 -0
  154. package/dist/detection/maintenance-sweep.js +325 -0
  155. package/dist/detection/maintenance-sweep.js.map +1 -0
  156. package/dist/detection/name-reach.d.ts +12 -0
  157. package/dist/detection/name-reach.js +28 -0
  158. package/dist/detection/name-reach.js.map +1 -0
  159. package/dist/detection/notebook-basis.d.ts +5 -7
  160. package/dist/detection/notebook-basis.js +6 -7
  161. package/dist/detection/notebook-basis.js.map +1 -1
  162. package/dist/detection/owed-selection.d.ts +51 -0
  163. package/dist/detection/owed-selection.js +169 -0
  164. package/dist/detection/owed-selection.js.map +1 -0
  165. package/dist/detection/portable.d.ts +34 -34
  166. package/dist/detection/portable.js +67 -93
  167. package/dist/detection/portable.js.map +1 -1
  168. package/dist/detection/reconciliation-coverage.d.ts +7 -0
  169. package/dist/detection/reconciliation-coverage.js +16 -0
  170. package/dist/detection/reconciliation-coverage.js.map +1 -0
  171. package/dist/detection/repository-publication.d.ts +20 -0
  172. package/dist/detection/repository-publication.js +79 -0
  173. package/dist/detection/repository-publication.js.map +1 -0
  174. package/dist/detection/repository-routes.d.ts +43 -0
  175. package/dist/detection/repository-routes.js +97 -0
  176. package/dist/detection/repository-routes.js.map +1 -0
  177. package/dist/detection/root-examination.d.ts +94 -0
  178. package/dist/detection/root-examination.js +523 -0
  179. package/dist/detection/root-examination.js.map +1 -0
  180. package/dist/detection/runtime.d.ts +131 -64
  181. package/dist/detection/runtime.js +808 -1103
  182. package/dist/detection/runtime.js.map +1 -1
  183. package/dist/detection/scoped-identity-port.d.ts +34 -0
  184. package/dist/detection/scoped-identity-port.js +81 -0
  185. package/dist/detection/scoped-identity-port.js.map +1 -0
  186. package/dist/detection/seal-law.d.ts +66 -0
  187. package/dist/detection/seal-law.js +116 -0
  188. package/dist/detection/seal-law.js.map +1 -0
  189. package/dist/detection/sharing-policy.d.ts +11 -0
  190. package/dist/detection/sharing-policy.js +32 -0
  191. package/dist/detection/sharing-policy.js.map +1 -0
  192. package/dist/detection/thread-database.d.ts +4 -0
  193. package/dist/detection/thread-database.js +30 -0
  194. package/dist/detection/thread-database.js.map +1 -0
  195. package/dist/detection/unreadable.d.ts +11 -0
  196. package/dist/detection/unreadable.js +9 -0
  197. package/dist/detection/unreadable.js.map +1 -0
  198. package/dist/detection/verified-content.d.ts +6 -0
  199. package/dist/detection/verified-content.js +12 -0
  200. package/dist/detection/verified-content.js.map +1 -0
  201. package/dist/detection/walk-law.d.ts +34 -0
  202. package/dist/detection/walk-law.js +55 -0
  203. package/dist/detection/walk-law.js.map +1 -0
  204. package/dist/development/fly-guest.js +2 -1
  205. package/dist/development/fly-guest.js.map +1 -1
  206. package/dist/entity-apply-host.d.ts +29 -13
  207. package/dist/entity-apply-host.js +1426 -461
  208. package/dist/entity-apply-host.js.map +1 -1
  209. package/dist/entity-apply-store.d.ts +77 -30
  210. package/dist/entity-apply-store.js +221 -516
  211. package/dist/entity-apply-store.js.map +1 -1
  212. package/dist/entity-record-observability.js +2 -0
  213. package/dist/entity-record-observability.js.map +1 -1
  214. package/dist/entity-record-saves.d.ts +20 -0
  215. package/dist/entity-record-saves.js +91 -0
  216. package/dist/entity-record-saves.js.map +1 -0
  217. package/dist/entity-record-store.d.ts +15 -7
  218. package/dist/entity-record-store.js +57 -117
  219. package/dist/entity-record-store.js.map +1 -1
  220. package/dist/files-register-host.d.ts +22 -3
  221. package/dist/files-register-host.js +70 -31
  222. package/dist/files-register-host.js.map +1 -1
  223. package/dist/filesystem.js +3 -2
  224. package/dist/filesystem.js.map +1 -1
  225. package/dist/git-binding.d.ts +65 -0
  226. package/dist/git-binding.js +220 -0
  227. package/dist/git-binding.js.map +1 -0
  228. package/dist/git-capture.d.ts +39 -0
  229. package/dist/git-capture.js +86 -0
  230. package/dist/git-capture.js.map +1 -0
  231. package/dist/git-card.d.ts +12 -0
  232. package/dist/git-card.js +123 -0
  233. package/dist/git-card.js.map +1 -0
  234. package/dist/git-checkpoint-construction.d.ts +41 -0
  235. package/dist/git-checkpoint-construction.js +96 -0
  236. package/dist/git-checkpoint-construction.js.map +1 -0
  237. package/dist/git-checkpoint-preparation.d.ts +37 -0
  238. package/dist/git-checkpoint-preparation.js +145 -0
  239. package/dist/git-checkpoint-preparation.js.map +1 -0
  240. package/dist/git-command.d.ts +61 -8
  241. package/dist/git-command.js +217 -63
  242. package/dist/git-command.js.map +1 -1
  243. package/dist/git-configuration.d.ts +40 -0
  244. package/dist/git-configuration.js +217 -0
  245. package/dist/git-configuration.js.map +1 -0
  246. package/dist/git-evidence.d.ts +61 -0
  247. package/dist/git-evidence.js +181 -0
  248. package/dist/git-evidence.js.map +1 -0
  249. package/dist/git-index-entries.d.ts +15 -0
  250. package/dist/git-index-entries.js +44 -0
  251. package/dist/git-index-entries.js.map +1 -0
  252. package/dist/git-index-format.d.ts +35 -0
  253. package/dist/git-index-format.js +293 -0
  254. package/dist/git-index-format.js.map +1 -0
  255. package/dist/git-index-witness.d.ts +33 -0
  256. package/dist/git-index-witness.js +69 -0
  257. package/dist/git-index-witness.js.map +1 -0
  258. package/dist/git-literal-host.d.ts +82 -0
  259. package/dist/git-literal-host.js +172 -0
  260. package/dist/git-literal-host.js.map +1 -0
  261. package/dist/git-literal-read.d.ts +88 -0
  262. package/dist/git-literal-read.js +170 -0
  263. package/dist/git-literal-read.js.map +1 -0
  264. package/dist/git-literal-replay.d.ts +33 -0
  265. package/dist/git-literal-replay.js +268 -0
  266. package/dist/git-literal-replay.js.map +1 -0
  267. package/dist/git-native-file.d.ts +42 -0
  268. package/dist/git-native-file.js +145 -0
  269. package/dist/git-native-file.js.map +1 -0
  270. package/dist/git-native-index.d.ts +21 -0
  271. package/dist/git-native-index.js +44 -0
  272. package/dist/git-native-index.js.map +1 -0
  273. package/dist/git-operation-host.d.ts +48 -0
  274. package/dist/git-operation-host.js +127 -0
  275. package/dist/git-operation-host.js.map +1 -0
  276. package/dist/git-private-index.d.ts +11 -0
  277. package/dist/git-private-index.js +42 -0
  278. package/dist/git-private-index.js.map +1 -0
  279. package/dist/git-private-repository.d.ts +4 -0
  280. package/dist/git-private-repository.js +69 -0
  281. package/dist/git-private-repository.js.map +1 -0
  282. package/dist/git-private-view.d.ts +39 -0
  283. package/dist/git-private-view.js +162 -0
  284. package/dist/git-private-view.js.map +1 -0
  285. package/dist/git-ref-store.d.ts +12 -0
  286. package/dist/git-ref-store.js +68 -0
  287. package/dist/git-ref-store.js.map +1 -0
  288. package/dist/git-registration-host.d.ts +20 -30
  289. package/dist/git-registration-host.js +86 -249
  290. package/dist/git-registration-host.js.map +1 -1
  291. package/dist/git-repository-host.d.ts +148 -22
  292. package/dist/git-repository-host.js +633 -650
  293. package/dist/git-repository-host.js.map +1 -1
  294. package/dist/git-worktree-host.d.ts +2 -0
  295. package/dist/git-worktree-host.js +16 -0
  296. package/dist/git-worktree-host.js.map +1 -0
  297. package/dist/graph-publication.d.ts +75 -0
  298. package/dist/graph-publication.js +203 -0
  299. package/dist/graph-publication.js.map +1 -0
  300. package/dist/ground-basis.d.ts +242 -0
  301. package/dist/ground-basis.js +1023 -0
  302. package/dist/ground-basis.js.map +1 -0
  303. package/dist/ground-checkpoint-worker.d.ts +1 -0
  304. package/dist/ground-checkpoint-worker.js +84 -0
  305. package/dist/ground-checkpoint-worker.js.map +1 -0
  306. package/dist/ground-checkpoints.d.ts +16 -0
  307. package/dist/ground-checkpoints.js +45 -0
  308. package/dist/ground-checkpoints.js.map +1 -0
  309. package/dist/ground-coordination.d.ts +107 -3
  310. package/dist/ground-coordination.js +249 -24
  311. package/dist/ground-coordination.js.map +1 -1
  312. package/dist/ground-database.d.ts +42 -0
  313. package/dist/ground-database.js +290 -0
  314. package/dist/ground-database.js.map +1 -0
  315. package/dist/ground-differences.d.ts +23 -0
  316. package/dist/ground-differences.js +47 -0
  317. package/dist/ground-differences.js.map +1 -0
  318. package/dist/ground-holders.d.ts +4 -0
  319. package/dist/ground-holders.js +15 -0
  320. package/dist/ground-holders.js.map +1 -0
  321. package/dist/ground-initialization-worker.d.ts +1 -0
  322. package/dist/ground-initialization-worker.js +20 -0
  323. package/dist/ground-initialization-worker.js.map +1 -0
  324. package/dist/ground-initialization.d.ts +35 -0
  325. package/dist/ground-initialization.js +102 -0
  326. package/dist/ground-initialization.js.map +1 -0
  327. package/dist/ground-install-saves.d.ts +63 -0
  328. package/dist/ground-install-saves.js +139 -0
  329. package/dist/ground-install-saves.js.map +1 -0
  330. package/dist/ground-inventory-schema.d.ts +18 -0
  331. package/dist/ground-inventory-schema.js +168 -0
  332. package/dist/ground-inventory-schema.js.map +1 -0
  333. package/dist/ground-profile.d.ts +7 -0
  334. package/dist/ground-profile.js +52 -0
  335. package/dist/ground-profile.js.map +1 -0
  336. package/dist/ground-root-index.d.ts +2 -1
  337. package/dist/ground-root-index.js +16 -14
  338. package/dist/ground-root-index.js.map +1 -1
  339. package/dist/ground-row.d.ts +62 -0
  340. package/dist/ground-row.js +70 -0
  341. package/dist/ground-row.js.map +1 -0
  342. package/dist/ground-save-ops.d.ts +44 -0
  343. package/dist/ground-save-ops.js +41 -0
  344. package/dist/ground-save-ops.js.map +1 -0
  345. package/dist/ground-saver-worker.d.ts +1 -0
  346. package/dist/ground-saver-worker.js +156 -0
  347. package/dist/ground-saver-worker.js.map +1 -0
  348. package/dist/ground-saver.d.ts +75 -0
  349. package/dist/ground-saver.js +216 -0
  350. package/dist/ground-saver.js.map +1 -0
  351. package/dist/ground-store.d.ts +84 -0
  352. package/dist/ground-store.js +473 -0
  353. package/dist/ground-store.js.map +1 -0
  354. package/dist/ground-territory.d.ts +130 -0
  355. package/dist/ground-territory.js +511 -0
  356. package/dist/ground-territory.js.map +1 -0
  357. package/dist/index.d.ts +1 -1
  358. package/dist/index.js.map +1 -1
  359. package/dist/installation/ownership.d.ts +0 -2
  360. package/dist/installation/ownership.js +3 -15
  361. package/dist/installation/ownership.js.map +1 -1
  362. package/dist/machine-host.d.ts +3 -2
  363. package/dist/machine-host.js +28 -16
  364. package/dist/machine-host.js.map +1 -1
  365. package/dist/materialized-graph.d.ts +7 -7
  366. package/dist/materialized-graph.js +11 -23
  367. package/dist/materialized-graph.js.map +1 -1
  368. package/dist/module-thread.d.ts +9 -0
  369. package/dist/module-thread.js +10 -0
  370. package/dist/module-thread.js.map +1 -0
  371. package/dist/native/fsevents-stream.node +0 -0
  372. package/dist/physical-path-witness.d.ts +64 -0
  373. package/dist/physical-path-witness.js +168 -0
  374. package/dist/physical-path-witness.js.map +1 -0
  375. package/dist/register-upload-fusion.d.ts +5 -4
  376. package/dist/register-upload-fusion.js +9 -6
  377. package/dist/register-upload-fusion.js.map +1 -1
  378. package/dist/registry-graph.d.ts +3 -2
  379. package/dist/registry-graph.js +9 -6
  380. package/dist/registry-graph.js.map +1 -1
  381. package/dist/registry-page-cache.d.ts +5 -2
  382. package/dist/registry-page-cache.js.map +1 -1
  383. package/dist/repository-identity-steps.d.ts +5 -0
  384. package/dist/repository-identity-steps.js +33 -0
  385. package/dist/repository-identity-steps.js.map +1 -0
  386. package/dist/runtime-node-flags.d.ts +10 -0
  387. package/dist/runtime-node-flags.js +11 -0
  388. package/dist/runtime-node-flags.js.map +1 -0
  389. package/dist/service/adapter.d.ts +1 -1
  390. package/dist/service/adapter.js +1 -1
  391. package/dist/service/adapter.js.map +1 -1
  392. package/dist/service/cli.js +16 -20
  393. package/dist/service/cli.js.map +1 -1
  394. package/dist/service/control.d.ts +2 -2
  395. package/dist/service/keepalive.d.ts +4 -11
  396. package/dist/service/keepalive.js +65 -118
  397. package/dist/service/keepalive.js.map +1 -1
  398. package/dist/service/policy.d.ts +36 -0
  399. package/dist/service/policy.js +25 -0
  400. package/dist/service/policy.js.map +1 -0
  401. package/dist/service/portable.d.ts +1 -1
  402. package/dist/service/portable.js +1 -1
  403. package/dist/service/portable.js.map +1 -1
  404. package/dist/service/recovery.d.ts +10 -9
  405. package/dist/service/recovery.js +29 -19
  406. package/dist/service/recovery.js.map +1 -1
  407. package/dist/service/windows-action.d.ts +5 -3
  408. package/dist/service/windows-action.js +6 -9
  409. package/dist/service/windows-action.js.map +1 -1
  410. package/dist/service/windows-task.js +5 -5
  411. package/dist/service/windows-task.js.map +1 -1
  412. package/dist/sharing-admission.d.ts +17 -0
  413. package/dist/sharing-admission.js +128 -0
  414. package/dist/sharing-admission.js.map +1 -0
  415. package/dist/snapshot-delivery-baseline.d.ts +12 -3
  416. package/dist/snapshot-delivery-baseline.js +41 -42
  417. package/dist/snapshot-delivery-baseline.js.map +1 -1
  418. package/dist/source-proof.d.ts +36 -0
  419. package/dist/source-proof.js +70 -0
  420. package/dist/source-proof.js.map +1 -0
  421. package/dist/source-signature.d.ts +56 -0
  422. package/dist/source-signature.js +56 -0
  423. package/dist/source-signature.js.map +1 -0
  424. package/dist/source-witness.d.ts +15 -0
  425. package/dist/source-witness.js +29 -0
  426. package/dist/source-witness.js.map +1 -0
  427. package/dist/sqlite-durability.d.ts +31 -0
  428. package/dist/sqlite-durability.js +28 -0
  429. package/dist/sqlite-durability.js.map +1 -0
  430. package/dist/sqlite.d.ts +8 -2
  431. package/dist/sqlite.js +27 -4
  432. package/dist/sqlite.js.map +1 -1
  433. package/dist/sync-address.d.ts +19 -0
  434. package/dist/sync-address.js +52 -0
  435. package/dist/sync-address.js.map +1 -0
  436. package/dist/sync-setting.d.ts +15 -0
  437. package/dist/sync-setting.js +13 -0
  438. package/dist/sync-setting.js.map +1 -1
  439. package/dist/turns.d.ts +42 -0
  440. package/dist/turns.js +112 -0
  441. package/dist/turns.js.map +1 -0
  442. package/dist/updates/bootstrap.d.ts +53 -7
  443. package/dist/updates/bootstrap.js +224 -137
  444. package/dist/updates/bootstrap.js.map +1 -1
  445. package/dist/updates/controller.d.ts +8 -0
  446. package/dist/updates/controller.js +27 -3
  447. package/dist/updates/controller.js.map +1 -1
  448. package/dist/updates/store.d.ts +3 -0
  449. package/dist/updates/store.js +12 -0
  450. package/dist/updates/store.js.map +1 -1
  451. package/dist/user-ground-host.d.ts +364 -69
  452. package/dist/user-ground-host.js +5231 -3366
  453. package/dist/user-ground-host.js.map +1 -1
  454. package/dist/watching/fsevents.d.ts +52 -1
  455. package/dist/watching/fsevents.js +60 -25
  456. package/dist/watching/fsevents.js.map +1 -1
  457. package/dist/watching/host.d.ts +129 -5
  458. package/dist/watching/host.js +433 -80
  459. package/dist/watching/host.js.map +1 -1
  460. package/dist/watching/index.d.ts +1 -1
  461. package/dist/wire-binary.d.ts +3 -2
  462. package/dist/wire-binary.js +10 -8
  463. package/dist/wire-binary.js.map +1 -1
  464. package/dist/wire-client.d.ts +3 -4
  465. package/dist/wire-client.js +18 -44
  466. package/dist/wire-client.js.map +1 -1
  467. package/dist/wire-outbox.d.ts +34 -0
  468. package/dist/wire-outbox.js +127 -0
  469. package/dist/wire-outbox.js.map +1 -0
  470. package/dist/workspace-host.d.ts +4 -0
  471. package/dist/workspace-host.js +12 -1
  472. package/dist/workspace-host.js.map +1 -1
  473. package/examinations/fixtures/private-wire-authority.js +133 -10
  474. package/npm-shrinkwrap.json +43 -56
  475. package/package.json +26 -13
@@ -1,27 +1,28 @@
1
- import { type ChildRestartPolicy } from '@amalgm/core/supervision';
1
+ import { type RestartPolicy } from './policy.js';
2
2
  import type { ServiceIdentity } from './registration.js';
3
3
  export interface RecoveryState {
4
4
  readonly attempts: number;
5
- readonly maxAttempts: number;
6
5
  readonly generation: string | null;
7
6
  readonly lastFailure: string | null;
7
+ readonly lastFailureAt: string | null;
8
8
  readonly lastHealthyGeneration: string | null;
9
9
  readonly lastHealthyAt: string | null;
10
- readonly parked: boolean;
11
10
  }
12
11
  /** Only the controller holding the installation lease opens this journal.
13
- * Charge Core's allowance before the host effect: even death during spawn
14
- * cannot turn controller replacement into a fresh recovery budget. */
12
+ * Charge each start before the host effect so controller replacement cannot
13
+ * reset the backoff; a sustained healthy run is the only thing that does. */
15
14
  export declare class RuntimeRecovery {
16
- readonly policy: ChildRestartPolicy;
15
+ readonly policy: RestartPolicy;
17
16
  private readonly database;
18
- readonly maxAttempts: number;
19
- constructor(identity: ServiceIdentity, policy?: ChildRestartPolicy);
17
+ constructor(identity: ServiceIdentity, policy?: RestartPolicy);
20
18
  get state(): RecoveryState;
19
+ /** The backoff counts from the last failure, so time already spent down —
20
+ * a reboot, a controller replacement — is never waited again. */
21
21
  get delayMs(): number;
22
22
  begin(generation: string): void;
23
23
  healthy(generation: string): void;
24
24
  exited(generation: string, failure: string | null): void;
25
- retry(): void;
25
+ /** Operator retry and an authorized update both start without waiting. */
26
+ reset(): void;
26
27
  close(): void;
27
28
  }
@@ -1,16 +1,15 @@
1
- import { CHILD_RESTART_POLICY } from '@amalgm/core/supervision';
2
1
  import { join } from 'node:path';
3
2
  import { openFileDatabase } from '../sqlite.js';
3
+ import { backoffMs } from '../updates/bootstrap.js';
4
+ import { ALWAYS_ON_POLICY } from './policy.js';
4
5
  /** Only the controller holding the installation lease opens this journal.
5
- * Charge Core's allowance before the host effect: even death during spawn
6
- * cannot turn controller replacement into a fresh recovery budget. */
6
+ * Charge each start before the host effect so controller replacement cannot
7
+ * reset the backoff; a sustained healthy run is the only thing that does. */
7
8
  export class RuntimeRecovery {
8
9
  policy;
9
10
  database;
10
- maxAttempts;
11
- constructor(identity, policy = CHILD_RESTART_POLICY) {
11
+ constructor(identity, policy = ALWAYS_ON_POLICY.restart) {
12
12
  this.policy = policy;
13
- this.maxAttempts = policy.maxRestarts + 1;
14
13
  this.database = openFileDatabase(join(identity.serviceDir, 'recovery.sqlite'));
15
14
  try {
16
15
  this.database.pragma('synchronous = FULL');
@@ -19,8 +18,13 @@ export class RuntimeRecovery {
19
18
  attempts INTEGER NOT NULL CHECK (attempts >= 0),
20
19
  generation TEXT, lastFailure TEXT, lastHealthyGeneration TEXT, lastHealthyAt TEXT
21
20
  );
22
- INSERT OR IGNORE INTO recovery (id, attempts) VALUES (1, 0);
23
- UPDATE recovery SET generation = NULL,
21
+ INSERT OR IGNORE INTO recovery (id, attempts) VALUES (1, 0);`);
22
+ const columns = this.database.pragma('table_info(recovery)');
23
+ if (!columns.some(column => column.name === 'lastFailureAt'))
24
+ this.database.exec('ALTER TABLE recovery ADD COLUMN lastFailureAt TEXT');
25
+ // The failure time stays the runtime's own: a controller that died
26
+ // around a healthy runtime is no reason to delay its next start.
27
+ this.database.exec(`UPDATE recovery SET generation = NULL,
24
28
  lastFailure = 'Controller exited before its runtime drained'
25
29
  WHERE generation IS NOT NULL;`);
26
30
  }
@@ -30,28 +34,34 @@ export class RuntimeRecovery {
30
34
  }
31
35
  }
32
36
  get state() {
33
- const row = this.database.prepare('SELECT attempts, generation, lastFailure, lastHealthyGeneration, lastHealthyAt FROM recovery WHERE id = 1').get();
34
- return { ...row, maxAttempts: this.maxAttempts, parked: row.generation === null && row.attempts >= this.maxAttempts };
37
+ return this.database.prepare('SELECT attempts, generation, lastFailure, lastFailureAt, lastHealthyGeneration, lastHealthyAt FROM recovery WHERE id = 1').get();
35
38
  }
39
+ /** The backoff counts from the last failure, so time already spent down —
40
+ * a reboot, a controller replacement — is never waited again. */
36
41
  get delayMs() {
37
- const { attempts } = this.state;
38
- return attempts === 0 ? 0 : Math.min(this.policy.initialDelayMs * 2 ** (attempts - 1), this.policy.maxDelayMs);
42
+ const { attempts, lastFailureAt } = this.state;
43
+ const delay = backoffMs(this.policy, attempts);
44
+ if (!delay || !lastFailureAt)
45
+ return 0;
46
+ return Math.min(delay, Math.max(0, delay - (Date.now() - Date.parse(lastFailureAt))));
39
47
  }
40
48
  begin(generation) {
41
- const result = this.database.prepare('UPDATE recovery SET attempts = attempts + 1, generation = ? WHERE id = 1 AND generation IS NULL AND attempts < ?').run(generation, this.maxAttempts);
49
+ const result = this.database.prepare('UPDATE recovery SET attempts = attempts + 1, generation = ? WHERE id = 1 AND generation IS NULL').run(generation);
42
50
  if (result.changes !== 1)
43
- throw new Error('The runtime recovery allowance is exhausted or a generation is still owned.');
51
+ throw new Error('A runtime generation is still owned.');
44
52
  }
45
53
  healthy(generation) {
46
- this.database.prepare('UPDATE recovery SET attempts = 0, lastFailure = NULL, lastHealthyGeneration = ?, lastHealthyAt = ? WHERE id = 1 AND generation = ?')
54
+ this.database.prepare('UPDATE recovery SET attempts = 0, lastFailure = NULL, lastFailureAt = NULL, lastHealthyGeneration = ?, lastHealthyAt = ? WHERE id = 1 AND generation = ?')
47
55
  .run(generation, new Date().toISOString(), generation);
48
56
  }
49
57
  exited(generation, failure) {
50
- this.database.prepare('UPDATE recovery SET generation = NULL, lastFailure = COALESCE(?, lastFailure) WHERE id = 1 AND generation = ?')
51
- .run(failure?.slice(0, 1_024) ?? null, generation);
58
+ this.database.prepare(`UPDATE recovery SET generation = NULL, lastFailure = COALESCE(@failure, lastFailure),
59
+ lastFailureAt = CASE WHEN @failure IS NULL THEN lastFailureAt ELSE @at END WHERE id = 1 AND generation = @generation`)
60
+ .run({ failure: failure?.slice(0, 1_024) ?? null, at: new Date().toISOString(), generation });
52
61
  }
53
- retry() {
54
- this.database.prepare('UPDATE recovery SET attempts = 0, lastFailure = NULL WHERE id = 1 AND generation IS NULL AND attempts >= ?').run(this.maxAttempts);
62
+ /** Operator retry and an authorized update both start without waiting. */
63
+ reset() {
64
+ this.database.prepare('UPDATE recovery SET attempts = 0 WHERE id = 1').run();
55
65
  }
56
66
  close() { this.database.close(); }
57
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"recovery.js","sourceRoot":"","sources":["../../src/service/recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAA2B,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAahD;;sEAEsE;AACtE,MAAM,OAAO,eAAe;IAIsB;IAH/B,QAAQ,CAAC;IACjB,WAAW,CAAS;IAE7B,YAAY,QAAyB,EAAW,SAA6B,oBAAoB;QAAjD,WAAM,GAAN,MAAM,CAA2C;QAC/F,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;YAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;;;;;;;;sCAQa,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YAAC,MAAM,KAAK,CAAC;QAAC,CAAC;IACzD,CAA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,OAAsB;QAC/C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;2HACiG,CAAC;aACrH,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IAClG,CAAC;IAED,0EAA0E;IAC1E,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAC,GAAG,EAAE,CAAC;IAC/E,CAAC;IAED,KAAK,KAAW,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACzC"}
@@ -1,4 +1,4 @@
1
- import { type ChildRestartPolicy } from '@amalgm/core/supervision';
1
+ import { type RestartPolicy } from './policy.js';
2
2
  export declare const encodePowerShell: (source: string) => string;
3
3
  export declare function jsonExpression(value: unknown): string;
4
4
  export declare function powershellExecutable(env?: NodeJS.ProcessEnv): string;
@@ -9,8 +9,10 @@ export declare function quoteWindowsArgument(value: string): string;
9
9
  * https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw */
10
10
  export declare function powershellArguments(encoded: string, hidden?: boolean): string[];
11
11
  /** Scheduler owns this action's logged-in lifetime. Its launch-retry setting
12
- * cannot observe controller exits, so this native port applies Core's policy.
12
+ * cannot observe controller exits, so this action restarts the controller
13
+ * itself: every exit except an operator stop (0) is retried after a doubling
14
+ * delay capped at the policy's maximum, for as long as the user is logged in.
13
15
  * Self-assignment before launch avoids a spawn/assign race. The action alone
14
16
  * owns the non-inheritable job handle, which the OS closes on action death.
15
17
  * https://learn.microsoft.com/windows/win32/procthread/job-objects */
16
- export declare function windowsControllerAction(command: readonly string[], workingDirectory: string, restartPolicy?: ChildRestartPolicy): string;
18
+ export declare function windowsControllerAction(command: readonly string[], workingDirectory: string, restartPolicy?: RestartPolicy): string;
@@ -1,5 +1,5 @@
1
1
  import { win32 } from 'node:path';
2
- import { CHILD_RESTART_POLICY } from '@amalgm/core/supervision';
2
+ import { ALWAYS_ON_POLICY } from './policy.js';
3
3
  export const encodePowerShell = (source) => Buffer.from(source, 'utf16le').toString('base64');
4
4
  export function jsonExpression(value) {
5
5
  return `ConvertFrom-Json ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${Buffer.from(JSON.stringify(value), 'utf8').toString('base64')}')))`;
@@ -24,11 +24,13 @@ export function powershellArguments(encoded, hidden = false) {
24
24
  return args;
25
25
  }
26
26
  /** Scheduler owns this action's logged-in lifetime. Its launch-retry setting
27
- * cannot observe controller exits, so this native port applies Core's policy.
27
+ * cannot observe controller exits, so this action restarts the controller
28
+ * itself: every exit except an operator stop (0) is retried after a doubling
29
+ * delay capped at the policy's maximum, for as long as the user is logged in.
28
30
  * Self-assignment before launch avoids a spawn/assign race. The action alone
29
31
  * owns the non-inheritable job handle, which the OS closes on action death.
30
32
  * https://learn.microsoft.com/windows/win32/procthread/job-objects */
31
- export function windowsControllerAction(command, workingDirectory, restartPolicy = CHILD_RESTART_POLICY) {
33
+ export function windowsControllerAction(command, workingDirectory, restartPolicy = ALWAYS_ON_POLICY.restart) {
32
34
  if (!command.length || !command[0])
33
35
  throw new Error('The controller needs an executable.');
34
36
  const action = encodePowerShell(`
@@ -106,7 +108,6 @@ $start.WorkingDirectory = $launch.workingDirectory
106
108
  $start.UseShellExecute = $false
107
109
  $start.CreateNoWindow = $true
108
110
  $clock = [Diagnostics.Stopwatch]::StartNew()
109
- $history = @()
110
111
  $delay = $policy.initialDelayMs
111
112
  while ($true) {
112
113
  $started = $clock.ElapsedMilliseconds
@@ -119,11 +120,7 @@ while ($true) {
119
120
  } catch { [Console]::Error.WriteLine($_.Exception.Message) }
120
121
  finally { if ($runtimeProcess) { $runtimeProcess.Dispose() } }
121
122
  if ($result -eq 0) { exit 0 }
122
- $now = $clock.ElapsedMilliseconds
123
- if ($now - $started -ge $policy.stableAfterMs) { $delay = $policy.initialDelayMs; $history = @() }
124
- $history = @($history | Where-Object { $now - $_ -le $policy.windowMs })
125
- if ($history.Count -ge $policy.maxRestarts) { exit $result }
126
- $history += $now
123
+ if ($clock.ElapsedMilliseconds - $started -ge $policy.stableAfterMs) { $delay = $policy.initialDelayMs }
127
124
  Start-Sleep -Milliseconds $delay
128
125
  $delay = [Math]::Min($delay * 2, $policy.maxDelayMs)
129
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"windows-action.js","sourceRoot":"","sources":["../../src/service/windows-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAA2B,MAAM,0BAA0B,CAAC;AAEzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC9G,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,kFAAkF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;AAC/J,CAAC;AACD,MAAM,UAAU,oBAAoB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACvE,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAChH,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IACpF,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC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AAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC1H,IAAI,CAAC,oBAAoB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC;QAC9F,MAAM,IAAI,UAAU,CAAC,wFAAwF,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;sEAMsE;AACtE,MAAM,UAAU,uBAAuB,CAAC,OAA0B,EAAE,gBAAwB,EAC1F,gBAA+B,gBAAgB,CAAC,OAAO;IACvD,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC3F,MAAM,MAAM,GAAG,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkEtB,cAAc,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,gBAAgB,EAAE,CAAC;YAC7H,cAAc,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;CAwBxC,CAAC,CAAC;IACD,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,4 +1,3 @@
1
- import { CHILD_RESTART_POLICY } from '@amalgm/core/supervision';
2
1
  import { encodePowerShell, powershellArguments, powershellExecutable, quoteWindowsArgument } from './windows-action.js';
3
2
  export { encodePowerShell, powershellExecutable, quoteWindowsArgument, windowsControllerAction } from './windows-action.js';
4
3
  /** All input is structured JSON transported as ASCII stdin and decoded as UTF-8.
@@ -9,12 +8,13 @@ export function windowsTaskOperation(input) {
9
8
  const executable = powershellExecutable();
10
9
  const request = { operation: input.operation, name: input.name, executable,
11
10
  ...(input.action ? { arguments: powershellArguments(input.action, true).map(quoteWindowsArgument).join(' ') } : {}),
12
- restartCount: CHILD_RESTART_POLICY.maxRestarts,
13
- // MS-TSCH 2.5.4.2: these retries cover failure to start an action, not its exit.
11
+ // MS-TSCH 2.5.4.2: these retries cover failure to start an action, not its
12
+ // exit, which the action itself retries. Both values are the schema's
13
+ // bounds: the most retries, one minute apart.
14
14
  // https://learn.microsoft.com/openspecs/windows_protocols/ms-tsch/2ff4aa5a-7bc4-449f-bbb1-27475645867f
15
- // Task Scheduler's supported minimum is one minute.
16
15
  // https://learn.microsoft.com/windows/win32/taskschd/taskschedulerschema-restarttype-complextype
17
- restartIntervalMs: Math.max(60_000, CHILD_RESTART_POLICY.initialDelayMs) };
16
+ restartCount: 999,
17
+ restartIntervalMs: 60_000 };
18
18
  const command = encodePowerShell(`
19
19
  $ErrorActionPreference = 'Stop'
20
20
  $request = ConvertFrom-Json ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String([Console]::In.ReadToEnd())))
@@ -1 +1 @@
1
- {"version":3,"file":"windows-task.js","sourceRoot":"","sources":["../../src/service/windows-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAI5H;;;+EAG+E;AAC/E,MAAM,UAAU,oBAAoB,CAAC,KAIpC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oBAAoB,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU;QACxE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnH,2EAA2E;QAC3E,sEAAsE;QACtE,8CAA8C;QAC9C,uGAAuG;QACvG,iGAAiG;QACjG,YAAY,EAAE,GAAG;QACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BlC,CAAC,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;AACpI,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** Transaction-local provenance for the sharing baseline. The only durable
2
+ * value is its originating mutation ID on the existing notebook row. */
3
+ import { type LocalEntityRecord } from "@amalgm/live";
4
+ import type Database from "better-sqlite3";
5
+ import { type GroundRow } from "./ground-row.js";
6
+ import type { GroundTransition } from "./ground-basis.js";
7
+ export type SharingWrite = "replace" | "retain-equivalent";
8
+ export declare function sameSharingResult(before: GroundRow, after: GroundRow): boolean;
9
+ export declare class SharingAdmission {
10
+ #private;
11
+ constructor(database: Database.Database);
12
+ batch(get: (uuid: string) => GroundRow | undefined): {
13
+ changed(before: GroundRow | undefined, after: GroundRow | undefined, mode: SharingWrite): void;
14
+ admit(record: LocalEntityRecord): string;
15
+ finish(transitions: Iterable<GroundTransition>): ReadonlyMap<string, string | null>;
16
+ };
17
+ }
@@ -0,0 +1,128 @@
1
+ /** Transaction-local provenance for the sharing baseline. The only durable
2
+ * value is its originating mutation ID on the existing notebook row. */
3
+ import { assertRecord, checkLocalEntityRecord, encodeEntityRecord } from "@amalgm/live";
4
+ import { portableGroundRecord } from "./ground-row.js";
5
+ export function sameSharingResult(before, after) {
6
+ return before.resourceId === after.resourceId
7
+ && JSON.stringify(portableGroundRecord(before)) === JSON.stringify(portableGroundRecord(after));
8
+ }
9
+ /** A nested repository contributes its placement, never its independent head. */
10
+ function sameRepositoryPlacement(before, after) {
11
+ return before?.type === "repo.git" && after?.type === "repo.git"
12
+ && before.resourceId === after.resourceId && before.rootUUID === after.rootUUID
13
+ && before.parentUUID === after.parentUUID && before.name === after.name
14
+ && before.status === after.status;
15
+ }
16
+ export class SharingAdmission {
17
+ #database;
18
+ #append;
19
+ constructor(database) {
20
+ this.#database = database;
21
+ this.#append = database.prepare(`INSERT INTO record_outbox(
22
+ mutation_id, authority_id, entity_id, record_json, status, global_sequence, created_at, accepted_at
23
+ ) VALUES (?, ?, ?, ?, 'pending', NULL, ?, NULL)`);
24
+ }
25
+ batch(get) {
26
+ const touched = new Map();
27
+ const placements = new Map();
28
+ const admitted = new Map();
29
+ let sealed = false;
30
+ return {
31
+ changed(before, after, mode) {
32
+ if (sealed)
33
+ throw new Error("sharing projection cannot change after Record admission");
34
+ if (mode === "retain-equivalent" && before && after && sameSharingResult(before, after)) {
35
+ if (before.relativePath !== after.relativePath || before.rootUUID !== after.rootUUID) {
36
+ placements.set(before.uuid, { before: placements.get(before.uuid)?.before ?? before, after });
37
+ }
38
+ return;
39
+ }
40
+ const uuid = (after ?? before)?.uuid;
41
+ if (!uuid)
42
+ return;
43
+ const previous = touched.get(uuid);
44
+ touched.set(uuid, { before: previous ? previous.before : before, after });
45
+ },
46
+ // A repository's package is its territory, which the admitting unit's
47
+ // basis holds unchanged since the rows it was built from.
48
+ admit: (record) => {
49
+ sealed = true;
50
+ if (admitted.has(record.entityId))
51
+ throw new Error("one sharing batch cannot admit two records for one entity");
52
+ const row = get(record.entityId);
53
+ const valid = checkLocalEntityRecord(record);
54
+ if (!valid.ok)
55
+ throw new Error(valid.error);
56
+ if (!row || row.resourceId !== record.authorityId || record.change.origin !== "detected"
57
+ || JSON.stringify(portableGroundRecord(row)) !== JSON.stringify(assertRecord(record.change.result))) {
58
+ throw new Error("sharing admission requires its exact selected result");
59
+ }
60
+ const json = encodeEntityRecord(record);
61
+ this.#append.run(record.mutationId, record.authorityId, record.entityId, json, record.createdAt);
62
+ admitted.set(record.entityId, record);
63
+ return json;
64
+ },
65
+ finish: transitions => {
66
+ if (!this.#database.inTransaction)
67
+ throw new Error("sharing admission belongs to a ground transaction");
68
+ const originals = new Map([...transitions].filter(change => change.inventory === "detection_notebook")
69
+ .map(change => [(change.after ?? change.before).uuid, change.before]));
70
+ const original = (uuid) => originals.has(uuid) ? originals.get(uuid) : get(uuid);
71
+ const invalid = new Set(touched.keys());
72
+ const owner = (row, read) => {
73
+ if (!row || row.uuid === row.rootUUID)
74
+ return null;
75
+ const seen = new Set();
76
+ let uuid = row?.parentUUID;
77
+ while (uuid) {
78
+ if (seen.has(uuid))
79
+ throw new Error("sharing ancestry contains a cycle");
80
+ seen.add(uuid);
81
+ const parent = read(uuid);
82
+ if (!parent && uuid === row.rootUUID)
83
+ return null; // An unmaterialized boundary has no local certificate.
84
+ if (!parent)
85
+ throw new Error("sharing owner has incomplete original ancestry");
86
+ if (parent.type === "repo.git")
87
+ return parent;
88
+ if (parent.uuid === row.rootUUID)
89
+ return null;
90
+ uuid = parent.parentUUID;
91
+ }
92
+ return null;
93
+ };
94
+ for (const { before, after } of touched.values()) {
95
+ if (sameRepositoryPlacement(before, after))
96
+ continue;
97
+ for (const root of [owner(before, original), owner(after, get)])
98
+ if (root)
99
+ invalid.add(root.uuid);
100
+ }
101
+ for (const { before, after } of placements.values()) {
102
+ const priorOwner = owner(before, original), nextOwner = owner(after, get);
103
+ const address = (member, root) => root
104
+ ? member.relativePath.slice(root.relativePath ? root.relativePath.length + 1 : 0) : null;
105
+ if (priorOwner?.uuid === nextOwner?.uuid && address(before, priorOwner) === address(after, nextOwner))
106
+ continue;
107
+ for (const root of [priorOwner, nextOwner])
108
+ if (root)
109
+ invalid.add(root.uuid);
110
+ }
111
+ const changes = new Map();
112
+ for (const uuid of new Set([...invalid, ...admitted.keys()])) {
113
+ const row = get(uuid);
114
+ if (!row)
115
+ continue;
116
+ const next = admitted.get(uuid)?.mutationId ?? null;
117
+ // A newly inserted row starts without provenance. Cold declaration
118
+ // needs no extra write to erase a certificate that never existed.
119
+ if (next === null && !original(uuid))
120
+ continue;
121
+ changes.set(uuid, next);
122
+ }
123
+ return changes;
124
+ },
125
+ };
126
+ }
127
+ }
128
+ //# sourceMappingURL=sharing-admission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharing-admission.js","sourceRoot":"","sources":["../src/sharing-admission.ts"],"names":[],"mappings":"AAAA;wEACwE;AACxE,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAA0B,MAAM,cAAc,CAAC;AAEhH,OAAO,EAAE,oBAAoB,EAAkB,MAAM,iBAAiB,CAAC;AAKvE,MAAM,UAAU,iBAAiB,CAAC,MAAiB,EAAE,KAAgB;IACnE,OAAO,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;WACxC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;AACpG,CAAC;AAED,iFAAiF;AACjF,SAAS,uBAAuB,CAAC,MAA6B,EAAE,KAA4B;IAC1F,OAAO,MAAM,EAAE,IAAI,KAAK,UAAU,IAAI,KAAK,EAAE,IAAI,KAAK,UAAU;WAC3D,MAAM,CAAC,UAAU,KAAK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
@@ -6,7 +6,16 @@
6
6
  * or below N are history rather than Apply work. Per-entity cursors remain
7
7
  * lazy: the first later delivery proves its predecessor from this complete
8
8
  * authority prefix.
9
+ *
10
+ * A cursor that jumps to N never received the records it skipped, so N
11
+ * becomes the history floor: the Inbox holds every authority record in
12
+ * (floor, cursor], and nothing below the floor may be read as a tail.
9
13
  */
10
- import Database from "better-sqlite3";
11
- export declare function ensureSnapshotDeliveryBaselineTable(database: Database.Database): void;
12
- export declare function adoptSnapshotDeliveryBaseline(database: Database.Database, authorityId: string, deliverySequence: number, now?: number): number;
14
+ import type Database from "better-sqlite3";
15
+ /** `record.adoptSnapshotBaseline`, run only by the ground file's saver thread
16
+ * (ground-saver.ts): how many retained Inbox rows N resolves. */
17
+ export declare function adoptSnapshotDeliveryBaseline(database: Database.Database, input: {
18
+ readonly authorityId: string;
19
+ readonly deliverySequence: number;
20
+ readonly now: number;
21
+ }): number;
@@ -6,53 +6,52 @@
6
6
  * or below N are history rather than Apply work. Per-entity cursors remain
7
7
  * lazy: the first later delivery proves its predecessor from this complete
8
8
  * authority prefix.
9
+ *
10
+ * A cursor that jumps to N never received the records it skipped, so N
11
+ * becomes the history floor: the Inbox holds every authority record in
12
+ * (floor, cursor], and nothing below the floor may be read as a tail.
9
13
  */
10
- export function ensureSnapshotDeliveryBaselineTable(database) {
11
- database.exec(`
12
- CREATE TABLE IF NOT EXISTS authority_snapshot_baselines (
13
- authority_id TEXT PRIMARY KEY,
14
- delivery_sequence INTEGER NOT NULL CHECK(delivery_sequence >= 0)
15
- )
16
- `);
17
- }
18
- export function adoptSnapshotDeliveryBaseline(database, authorityId, deliverySequence, now = Date.now()) {
14
+ import { cachedStatement } from "./sqlite.js";
15
+ /** `record.adoptSnapshotBaseline`, run only by the ground file's saver thread
16
+ * (ground-saver.ts): how many retained Inbox rows N resolves. */
17
+ export function adoptSnapshotDeliveryBaseline(database, input) {
18
+ const { authorityId, deliverySequence, now } = input;
19
19
  if (!authorityId)
20
20
  throw new Error("snapshot delivery authority is required");
21
21
  if (!Number.isSafeInteger(deliverySequence) || deliverySequence < 0) {
22
22
  throw new Error("snapshot delivery watermark must be a non-negative integer");
23
23
  }
24
- ensureSnapshotDeliveryBaselineTable(database);
25
- return database.transaction(() => {
26
- database.prepare(`
27
- INSERT INTO authority_snapshot_baselines(authority_id, delivery_sequence)
28
- VALUES (?, ?)
29
- ON CONFLICT(authority_id) DO UPDATE SET
30
- delivery_sequence = MAX(delivery_sequence, excluded.delivery_sequence)
31
- `).run(authorityId, deliverySequence);
32
- database.prepare(`
33
- INSERT INTO authority_delivery_cursors(authority_id, received_through)
34
- VALUES (?, ?)
35
- ON CONFLICT(authority_id) DO UPDATE SET
36
- received_through = MAX(received_through, excluded.received_through)
37
- `).run(authorityId, deliverySequence);
38
- // The snapshot replaces per-entity receive history through N. Retain a
39
- // cursor only when this machine already holds a genuinely later delivery;
40
- // otherwise the first post-snapshot record establishes its immediate
41
- // predecessor from the complete authority prefix.
42
- database.prepare(`
43
- DELETE FROM entity_receive_cursors AS cursor
44
- WHERE cursor.authority_id = ?
45
- AND NOT EXISTS (
46
- SELECT 1 FROM record_inbox AS inbox
47
- WHERE inbox.authority_id = cursor.authority_id
48
- AND inbox.entity_id = cursor.entity_id
49
- AND inbox.delivery_sequence > ?
50
- )
51
- `).run(authorityId, deliverySequence);
52
- return database.prepare(`
53
- UPDATE record_inbox SET resolved_at = ?
54
- WHERE authority_id = ? AND delivery_sequence <= ? AND resolved_at IS NULL
55
- `).run(now, authorityId, deliverySequence).changes;
56
- })();
24
+ cachedStatement(database, `
25
+ INSERT INTO authority_snapshot_baselines(authority_id, delivery_sequence)
26
+ VALUES (?, ?)
27
+ ON CONFLICT(authority_id) DO UPDATE SET
28
+ delivery_sequence = MAX(delivery_sequence, excluded.delivery_sequence)
29
+ `).run(authorityId, deliverySequence);
30
+ cachedStatement(database, `
31
+ INSERT INTO authority_delivery_cursors(authority_id, received_through, history_floor)
32
+ VALUES (?, ?, ?)
33
+ ON CONFLICT(authority_id) DO UPDATE SET
34
+ history_floor = CASE WHEN received_through < excluded.received_through
35
+ THEN MAX(history_floor, excluded.received_through) ELSE history_floor END,
36
+ received_through = MAX(received_through, excluded.received_through)
37
+ `).run(authorityId, deliverySequence, deliverySequence);
38
+ // The snapshot replaces per-entity receive history through N. Retain a
39
+ // cursor only when this machine already holds a genuinely later delivery;
40
+ // otherwise the first post-snapshot record establishes its immediate
41
+ // predecessor from the complete authority prefix.
42
+ cachedStatement(database, `
43
+ DELETE FROM entity_receive_cursors AS cursor
44
+ WHERE cursor.authority_id = ?
45
+ AND NOT EXISTS (
46
+ SELECT 1 FROM record_inbox AS inbox
47
+ WHERE inbox.authority_id = cursor.authority_id
48
+ AND inbox.entity_id = cursor.entity_id
49
+ AND inbox.delivery_sequence > ?
50
+ )
51
+ `).run(authorityId, deliverySequence);
52
+ return cachedStatement(database, `
53
+ UPDATE record_inbox SET resolved_at = ?
54
+ WHERE authority_id = ? AND delivery_sequence <= ? AND resolved_at IS NULL
55
+ `).run(now, authorityId, deliverySequence).changes;
57
56
  }
58
57
  //# sourceMappingURL=snapshot-delivery-baseline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot-delivery-baseline.js","sourceRoot":"","sources":["../src/snapshot-delivery-baseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,UAAU,mCAAmC,CAAC,QAA2B;IAC7E,QAAQ,CAAC,IAAI,CAAC;;;;;GAKb,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,QAA2B,EAC3B,WAAmB,EACnB,gBAAwB,EACxB,MAAc,IAAI,CAAC,GAAG,EAAE;IAExB,IAAI,CAAC,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7E,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,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GAKzB,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACtC,eAAe,CAAC,QAAQ,EAAE;;;;;;;GAOzB,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IACxD,uEAAuE;IACvE,0EAA0E;IAC1E,qEAAqE;IACrE,kDAAkD;IAClD,eAAe,CAAC,QAAQ,EAAE;;;;;;;;;GASzB,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACtC,OAAO,eAAe,CAAC,QAAQ,EAAE;;;GAGhC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC;AACrD,CAAC"}
@@ -0,0 +1,36 @@
1
+ /** A retained observation closes in two phases. The semantic phase re-asks a
2
+ * slower owner such as Git and may await. The physical phase compares the
3
+ * original native witnesses and never awaits. Neither renews its baseline;
4
+ * together they belong to one observation, and neither alone admits it.
5
+ * Admission awaits every semantic phase first, then closes every physical
6
+ * phase with its commit, so final closure checks the original observation
7
+ * against its retained dependencies after all intervening semantic work. A
8
+ * change no witness holds belongs to a later Watch generation.
9
+ *
10
+ * The physical phase is data where it can be: witnesses any thread samples
11
+ * and judges. What only the admitting thread can answer — host authority
12
+ * such as the content clock, or a check over live objects — is an admission
13
+ * that runs there, synchronously, after the witnesses are judged. */
14
+ import { type SourceWitness } from "./source-witness.js";
15
+ export interface SourceProof {
16
+ semantic(): Promise<void>;
17
+ readonly witnesses: readonly SourceWitness[];
18
+ readonly admission?: () => void;
19
+ }
20
+ export declare const witnessProof: (witnesses: readonly SourceWitness[]) => SourceProof;
21
+ export declare const admissionProof: (admission: () => void) => SourceProof;
22
+ export declare const semanticProof: (semantic: () => Promise<void>) => SourceProof;
23
+ /** The admission half alone, for a caller whose witnesses were judged elsewhere.
24
+ * A void-typed boundary accepts a value-returning function; a Promise that
25
+ * slipped through must fail here rather than pass as a completed check. */
26
+ export declare function admitPhysically(proof: SourceProof): void;
27
+ export declare function closePhysically(proof: SourceProof): void;
28
+ export declare const proofLeaves: (proof: SourceProof) => readonly SourceProof[];
29
+ /** Each original proof closes once, at its last requested position, so no
30
+ * duplicate can close before a later dependency's work. Identity is
31
+ * ownership: equal paths or answers never merge proofs. Semantic phases run
32
+ * one at a time, so several repositories never multiply concurrent Git
33
+ * processes. */
34
+ export declare function sourceProofs(proofs: readonly SourceProof[]): SourceProof;
35
+ /** A standalone close: the semantic answer, then the original witnesses. */
36
+ export declare function closeSource(proof: SourceProof): Promise<void>;