@amalgm/shell 0.1.164-main.39109658056 → 0.1.164-main.39172889515

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 (343) hide show
  1. package/PURPOSE.md +103 -46
  2. package/dist/accepted-tail.d.ts +5 -3
  3. package/dist/accepted-tail.js +5 -2
  4. package/dist/accepted-tail.js.map +1 -1
  5. package/dist/apply-bound-ground.d.ts +109 -0
  6. package/dist/apply-bound-ground.js +349 -0
  7. package/dist/apply-bound-ground.js.map +1 -0
  8. package/dist/apply-bound-root.d.ts +23 -0
  9. package/dist/apply-bound-root.js +42 -0
  10. package/dist/apply-bound-root.js.map +1 -0
  11. package/dist/apply-enter-build.d.ts +75 -0
  12. package/dist/apply-enter-build.js +134 -0
  13. package/dist/apply-enter-build.js.map +1 -0
  14. package/dist/apply-enter-plan.d.ts +48 -0
  15. package/dist/apply-enter-plan.js +90 -0
  16. package/dist/apply-enter-plan.js.map +1 -0
  17. package/dist/apply-flush.d.ts +8 -0
  18. package/dist/apply-flush.js +57 -0
  19. package/dist/apply-flush.js.map +1 -0
  20. package/dist/apply-git-storage.d.ts +27 -0
  21. package/dist/apply-git-storage.js +108 -0
  22. package/dist/apply-git-storage.js.map +1 -0
  23. package/dist/apply-line.d.ts +54 -0
  24. package/dist/apply-line.js +126 -0
  25. package/dist/apply-line.js.map +1 -0
  26. package/dist/apply-placement.d.ts +31 -0
  27. package/dist/apply-placement.js +133 -0
  28. package/dist/apply-placement.js.map +1 -0
  29. package/dist/apply-recovery.d.ts +51 -6
  30. package/dist/apply-recovery.js +81 -14
  31. package/dist/apply-recovery.js.map +1 -1
  32. package/dist/apply-rows.d.ts +57 -40
  33. package/dist/apply-rows.js +86 -63
  34. package/dist/apply-rows.js.map +1 -1
  35. package/dist/apply-saves.d.ts +51 -27
  36. package/dist/apply-saves.js +98 -50
  37. package/dist/apply-saves.js.map +1 -1
  38. package/dist/apply-showing.d.ts +19 -0
  39. package/dist/apply-showing.js +44 -0
  40. package/dist/apply-showing.js.map +1 -0
  41. package/dist/apply-spelling.d.ts +35 -0
  42. package/dist/apply-spelling.js +79 -0
  43. package/dist/apply-spelling.js.map +1 -0
  44. package/dist/authority-binding.d.ts +1 -24
  45. package/dist/authority-binding.js +43 -7
  46. package/dist/authority-binding.js.map +1 -1
  47. package/dist/bounded-for-each.d.ts +4 -2
  48. package/dist/bounded-for-each.js +12 -8
  49. package/dist/bounded-for-each.js.map +1 -1
  50. package/dist/content-cache-host.d.ts +25 -8
  51. package/dist/content-cache-host.js +137 -85
  52. package/dist/content-cache-host.js.map +1 -1
  53. package/dist/content-cache-index.d.ts +15 -4
  54. package/dist/content-cache-index.js +30 -18
  55. package/dist/content-cache-index.js.map +1 -1
  56. package/dist/content-capture-pool.d.ts +3 -2
  57. package/dist/content-capture-pool.js +5 -3
  58. package/dist/content-capture-pool.js.map +1 -1
  59. package/dist/content-capture-worker.js +4 -5
  60. package/dist/content-capture-worker.js.map +1 -1
  61. package/dist/content-clock.d.ts +12 -4
  62. package/dist/content-clock.js +44 -10
  63. package/dist/content-clock.js.map +1 -1
  64. package/dist/declaration-commit.d.ts +1 -1
  65. package/dist/declaration-save.d.ts +1 -1
  66. package/dist/declaration-save.js +10 -8
  67. package/dist/declaration-save.js.map +1 -1
  68. package/dist/derived-relocation.d.ts +27 -0
  69. package/dist/derived-relocation.js +67 -0
  70. package/dist/derived-relocation.js.map +1 -0
  71. package/dist/detection/admission-save.d.ts +8 -4
  72. package/dist/detection/admission-save.js +3 -2
  73. package/dist/detection/admission-save.js.map +1 -1
  74. package/dist/detection/apply-ownership.d.ts +1 -1
  75. package/dist/detection/apply-ownership.js +27 -28
  76. package/dist/detection/apply-ownership.js.map +1 -1
  77. package/dist/detection/basis-advanced.d.ts +4 -0
  78. package/dist/detection/basis-advanced.js +9 -0
  79. package/dist/detection/basis-advanced.js.map +1 -1
  80. package/dist/detection/capture-outcome.js +2 -1
  81. package/dist/detection/capture-outcome.js.map +1 -1
  82. package/dist/detection/container-membership.d.ts +11 -7
  83. package/dist/detection/container-membership.js +12 -6
  84. package/dist/detection/container-membership.js.map +1 -1
  85. package/dist/detection/git-notice.d.ts +16 -1
  86. package/dist/detection/git-notice.js +65 -34
  87. package/dist/detection/git-notice.js.map +1 -1
  88. package/dist/detection/ground-proof.d.ts +16 -6
  89. package/dist/detection/ground-proof.js +77 -34
  90. package/dist/detection/ground-proof.js.map +1 -1
  91. package/dist/detection/ground-reader.d.ts +9 -2
  92. package/dist/detection/ground-reader.js +39 -2
  93. package/dist/detection/ground-reader.js.map +1 -1
  94. package/dist/detection/held-survey.d.ts +39 -0
  95. package/dist/detection/held-survey.js +105 -0
  96. package/dist/detection/held-survey.js.map +1 -0
  97. package/dist/detection/held-territory.d.ts +29 -11
  98. package/dist/detection/held-territory.js +79 -30
  99. package/dist/detection/held-territory.js.map +1 -1
  100. package/dist/detection/identity-discovery.js +8 -18
  101. package/dist/detection/identity-discovery.js.map +1 -1
  102. package/dist/detection/maintenance-sweep.d.ts +5 -2
  103. package/dist/detection/maintenance-sweep.js +6 -2
  104. package/dist/detection/maintenance-sweep.js.map +1 -1
  105. package/dist/detection/owed-selection.js +2 -1
  106. package/dist/detection/owed-selection.js.map +1 -1
  107. package/dist/detection/own-channel.d.ts +17 -0
  108. package/dist/detection/own-channel.js +31 -0
  109. package/dist/detection/own-channel.js.map +1 -0
  110. package/dist/detection/portable.d.ts +30 -1
  111. package/dist/detection/portable.js +78 -4
  112. package/dist/detection/portable.js.map +1 -1
  113. package/dist/detection/repository-publication.d.ts +2 -0
  114. package/dist/detection/repository-publication.js +13 -11
  115. package/dist/detection/repository-publication.js.map +1 -1
  116. package/dist/detection/repository-routes.d.ts +17 -10
  117. package/dist/detection/repository-routes.js +56 -34
  118. package/dist/detection/repository-routes.js.map +1 -1
  119. package/dist/detection/repository-seals.d.ts +93 -0
  120. package/dist/detection/repository-seals.js +132 -0
  121. package/dist/detection/repository-seals.js.map +1 -0
  122. package/dist/detection/root-examination.d.ts +2 -0
  123. package/dist/detection/root-examination.js +10 -9
  124. package/dist/detection/root-examination.js.map +1 -1
  125. package/dist/detection/runtime.d.ts +23 -17
  126. package/dist/detection/runtime.js +109 -82
  127. package/dist/detection/runtime.js.map +1 -1
  128. package/dist/detection/scope-frame.d.ts +89 -0
  129. package/dist/detection/scope-frame.js +239 -0
  130. package/dist/detection/scope-frame.js.map +1 -0
  131. package/dist/detection/scoped-identity-port.d.ts +4 -3
  132. package/dist/detection/scoped-identity-port.js +5 -2
  133. package/dist/detection/scoped-identity-port.js.map +1 -1
  134. package/dist/detection/seal-law.d.ts +21 -28
  135. package/dist/detection/seal-law.js +28 -41
  136. package/dist/detection/seal-law.js.map +1 -1
  137. package/dist/detection/spelled-lookup.d.ts +15 -0
  138. package/dist/detection/spelled-lookup.js +59 -0
  139. package/dist/detection/spelled-lookup.js.map +1 -0
  140. package/dist/detection/verified-content.d.ts +1 -1
  141. package/dist/detection/verified-content.js +4 -9
  142. package/dist/detection/verified-content.js.map +1 -1
  143. package/dist/detection/walk-law.d.ts +8 -5
  144. package/dist/detection/walk-law.js +9 -6
  145. package/dist/detection/walk-law.js.map +1 -1
  146. package/dist/detection/walked-roots.d.ts +17 -0
  147. package/dist/detection/walked-roots.js +27 -0
  148. package/dist/detection/walked-roots.js.map +1 -0
  149. package/dist/entity-apply-host.d.ts +30 -11
  150. package/dist/entity-apply-host.js +1493 -1136
  151. package/dist/entity-apply-host.js.map +1 -1
  152. package/dist/entity-apply-store.d.ts +27 -30
  153. package/dist/entity-apply-store.js +52 -109
  154. package/dist/entity-apply-store.js.map +1 -1
  155. package/dist/entity-record-observability.d.ts +1 -1
  156. package/dist/entity-record-observability.js +31 -28
  157. package/dist/entity-record-observability.js.map +1 -1
  158. package/dist/entity-record-saves.d.ts +8 -4
  159. package/dist/entity-record-saves.js +20 -13
  160. package/dist/entity-record-saves.js.map +1 -1
  161. package/dist/entity-record-store.d.ts +6 -3
  162. package/dist/entity-record-store.js +62 -21
  163. package/dist/entity-record-store.js.map +1 -1
  164. package/dist/files-register-host.d.ts +8 -2
  165. package/dist/files-register-host.js +24 -12
  166. package/dist/files-register-host.js.map +1 -1
  167. package/dist/filesystem.d.ts +12 -0
  168. package/dist/filesystem.js +52 -2
  169. package/dist/filesystem.js.map +1 -1
  170. package/dist/git-binding.d.ts +38 -8
  171. package/dist/git-binding.js +279 -54
  172. package/dist/git-binding.js.map +1 -1
  173. package/dist/git-capture.d.ts +11 -7
  174. package/dist/git-capture.js +17 -47
  175. package/dist/git-capture.js.map +1 -1
  176. package/dist/git-card.js +11 -8
  177. package/dist/git-card.js.map +1 -1
  178. package/dist/git-checkpoint-construction.d.ts +15 -5
  179. package/dist/git-checkpoint-construction.js +54 -37
  180. package/dist/git-checkpoint-construction.js.map +1 -1
  181. package/dist/git-checkpoint-preparation.d.ts +7 -3
  182. package/dist/git-checkpoint-preparation.js +50 -27
  183. package/dist/git-checkpoint-preparation.js.map +1 -1
  184. package/dist/git-command.d.ts +4 -0
  185. package/dist/git-command.js +12 -3
  186. package/dist/git-command.js.map +1 -1
  187. package/dist/git-configuration.d.ts +3 -0
  188. package/dist/git-configuration.js +19 -4
  189. package/dist/git-configuration.js.map +1 -1
  190. package/dist/git-evidence.d.ts +16 -7
  191. package/dist/git-evidence.js +49 -17
  192. package/dist/git-evidence.js.map +1 -1
  193. package/dist/git-index-entries.d.ts +5 -0
  194. package/dist/git-index-entries.js +25 -5
  195. package/dist/git-index-entries.js.map +1 -1
  196. package/dist/git-index-format.d.ts +6 -20
  197. package/dist/git-index-format.js +89 -51
  198. package/dist/git-index-format.js.map +1 -1
  199. package/dist/git-index-witness.d.ts +4 -3
  200. package/dist/git-index-witness.js +12 -11
  201. package/dist/git-index-witness.js.map +1 -1
  202. package/dist/git-literal-batch.d.ts +81 -0
  203. package/dist/git-literal-batch.js +151 -0
  204. package/dist/git-literal-batch.js.map +1 -0
  205. package/dist/git-literal-host.d.ts +34 -42
  206. package/dist/git-literal-host.js +73 -63
  207. package/dist/git-literal-host.js.map +1 -1
  208. package/dist/git-literal-read.d.ts +13 -34
  209. package/dist/git-literal-read.js +30 -19
  210. package/dist/git-literal-read.js.map +1 -1
  211. package/dist/git-literal-replay.d.ts +36 -15
  212. package/dist/git-literal-replay.js +120 -45
  213. package/dist/git-literal-replay.js.map +1 -1
  214. package/dist/git-native-index.d.ts +11 -9
  215. package/dist/git-native-index.js +23 -27
  216. package/dist/git-native-index.js.map +1 -1
  217. package/dist/git-operation-host.d.ts +4 -2
  218. package/dist/git-operation-host.js +4 -1
  219. package/dist/git-operation-host.js.map +1 -1
  220. package/dist/git-private-repository.js +2 -5
  221. package/dist/git-private-repository.js.map +1 -1
  222. package/dist/git-private-view.d.ts +15 -3
  223. package/dist/git-private-view.js +96 -20
  224. package/dist/git-private-view.js.map +1 -1
  225. package/dist/git-registration-host.d.ts +6 -5
  226. package/dist/git-registration-host.js +11 -9
  227. package/dist/git-registration-host.js.map +1 -1
  228. package/dist/git-repository-host.d.ts +126 -30
  229. package/dist/git-repository-host.js +597 -250
  230. package/dist/git-repository-host.js.map +1 -1
  231. package/dist/git-spelling.d.ts +41 -0
  232. package/dist/git-spelling.js +233 -0
  233. package/dist/git-spelling.js.map +1 -0
  234. package/dist/git-tree-objects.d.ts +22 -0
  235. package/dist/git-tree-objects.js +205 -0
  236. package/dist/git-tree-objects.js.map +1 -0
  237. package/dist/graph-heads.d.ts +36 -0
  238. package/dist/graph-heads.js +57 -0
  239. package/dist/graph-heads.js.map +1 -0
  240. package/dist/ground-basis.d.ts +47 -52
  241. package/dist/ground-basis.js +145 -309
  242. package/dist/ground-basis.js.map +1 -1
  243. package/dist/ground-coordination.d.ts +6 -3
  244. package/dist/ground-coordination.js +9 -6
  245. package/dist/ground-coordination.js.map +1 -1
  246. package/dist/ground-database.js +67 -11
  247. package/dist/ground-database.js.map +1 -1
  248. package/dist/ground-install-saves.d.ts +1 -1
  249. package/dist/ground-install-saves.js +1 -2
  250. package/dist/ground-install-saves.js.map +1 -1
  251. package/dist/ground-inventory-schema.js +9 -5
  252. package/dist/ground-inventory-schema.js.map +1 -1
  253. package/dist/ground-marks.d.ts +64 -0
  254. package/dist/ground-marks.js +173 -0
  255. package/dist/ground-marks.js.map +1 -0
  256. package/dist/ground-root-index.d.ts +3 -2
  257. package/dist/ground-root-index.js +4 -3
  258. package/dist/ground-root-index.js.map +1 -1
  259. package/dist/ground-save-ops.d.ts +6 -3
  260. package/dist/ground-save-ops.js +6 -3
  261. package/dist/ground-save-ops.js.map +1 -1
  262. package/dist/ground-saver-worker.js +4 -20
  263. package/dist/ground-saver-worker.js.map +1 -1
  264. package/dist/ground-saver.d.ts +0 -4
  265. package/dist/ground-saver.js +3 -15
  266. package/dist/ground-saver.js.map +1 -1
  267. package/dist/ground-store.d.ts +6 -1
  268. package/dist/ground-store.js +42 -6
  269. package/dist/ground-store.js.map +1 -1
  270. package/dist/ground-territory.d.ts +90 -114
  271. package/dist/ground-territory.js +273 -444
  272. package/dist/ground-territory.js.map +1 -1
  273. package/dist/link-target.d.ts +2 -0
  274. package/dist/link-target.js +16 -0
  275. package/dist/link-target.js.map +1 -0
  276. package/dist/materialize-records.d.ts +68 -0
  277. package/dist/materialize-records.js +435 -0
  278. package/dist/materialize-records.js.map +1 -0
  279. package/dist/materialized-graph.d.ts +2 -1
  280. package/dist/materialized-graph.js +8 -1
  281. package/dist/materialized-graph.js.map +1 -1
  282. package/dist/physical-path-witness.d.ts +2 -0
  283. package/dist/physical-path-witness.js +8 -6
  284. package/dist/physical-path-witness.js.map +1 -1
  285. package/dist/placement-owed.d.ts +23 -0
  286. package/dist/placement-owed.js +25 -0
  287. package/dist/placement-owed.js.map +1 -0
  288. package/dist/placement-tidy.d.ts +57 -0
  289. package/dist/placement-tidy.js +313 -0
  290. package/dist/placement-tidy.js.map +1 -0
  291. package/dist/received-state.d.ts +30 -0
  292. package/dist/received-state.js +102 -0
  293. package/dist/received-state.js.map +1 -0
  294. package/dist/repository-checkpoint-file.d.ts +20 -0
  295. package/dist/repository-checkpoint-file.js +129 -0
  296. package/dist/repository-checkpoint-file.js.map +1 -0
  297. package/dist/repository-statement.d.ts +18 -0
  298. package/dist/repository-statement.js +33 -0
  299. package/dist/repository-statement.js.map +1 -0
  300. package/dist/settled.d.ts +9 -0
  301. package/dist/settled.js +15 -0
  302. package/dist/settled.js.map +1 -0
  303. package/dist/sha256.d.ts +3 -0
  304. package/dist/sha256.js +12 -0
  305. package/dist/sha256.js.map +1 -0
  306. package/dist/source-proof.d.ts +2 -15
  307. package/dist/source-proof.js +9 -4
  308. package/dist/source-proof.js.map +1 -1
  309. package/dist/source-signature.d.ts +14 -3
  310. package/dist/source-signature.js +14 -5
  311. package/dist/source-signature.js.map +1 -1
  312. package/dist/sqlite.js +8 -8
  313. package/dist/sqlite.js.map +1 -1
  314. package/dist/sync-setting.d.ts +2 -1
  315. package/dist/sync-setting.js.map +1 -1
  316. package/dist/turns.d.ts +4 -0
  317. package/dist/turns.js +17 -1
  318. package/dist/turns.js.map +1 -1
  319. package/dist/user-ground-host.d.ts +34 -24
  320. package/dist/user-ground-host.js +856 -1052
  321. package/dist/user-ground-host.js.map +1 -1
  322. package/dist/watching/fsevents.d.ts +5 -2
  323. package/dist/watching/fsevents.js +11 -3
  324. package/dist/watching/fsevents.js.map +1 -1
  325. package/dist/watching/git-storage.d.ts +22 -0
  326. package/dist/watching/git-storage.js +125 -0
  327. package/dist/watching/git-storage.js.map +1 -0
  328. package/dist/watching/host.d.ts +66 -12
  329. package/dist/watching/host.js +476 -160
  330. package/dist/watching/host.js.map +1 -1
  331. package/dist/watching/index.d.ts +3 -2
  332. package/dist/watching/index.js +2 -1
  333. package/dist/watching/index.js.map +1 -1
  334. package/dist/wire-client.js +1 -1
  335. package/examinations/fixtures/private-wire-authority.js +227 -107
  336. package/npm-shrinkwrap.json +6 -6
  337. package/package.json +5 -5
  338. package/dist/git-private-index.d.ts +0 -11
  339. package/dist/git-private-index.js +0 -42
  340. package/dist/git-private-index.js.map +0 -1
  341. package/dist/repository-identity-steps.d.ts +0 -5
  342. package/dist/repository-identity-steps.js +0 -33
  343. package/dist/repository-identity-steps.js.map +0 -1
package/PURPOSE.md CHANGED
@@ -51,13 +51,16 @@ now is inaccessible, not wrong: its durable intent still owns the ground bound
51
51
  there while its receipt, kept in that binding's control tree, waits unread. A
52
52
  binding proved to be another object is unsafe. Neither poisons unrelated roots.
53
53
  One preimage association represents source roots (including leaves) and descendant
54
- directories. Primary and collateral renames use one placement checker; cancellation
55
- repairs only proved O addresses under their actual binding, never B or accepted
56
- history. Admission and receipt binding share one SQLite write transaction, including
57
- physical aliases whose pathname leases do not overlap. Private unbound receipt
54
+ directories. Every Apply move, of a primary, a room sibling or a tidy, is one no-replace
55
+ move that puts ground first and rows after. Retirement, materialized or cancelled, places
56
+ each participant's rows in both inventories where its object stands, under its
57
+ actual binding and the basis that read them; it changes addresses only, never a
58
+ sharing result or accepted history. Admission and receipt binding share one
59
+ SQLite write transaction, including physical aliases whose pathname leases do
60
+ not overlap. Private unbound receipt
58
61
  files grant no effects and cannot be adopted as earlier effect evidence.
59
62
  Controlled full-ideal checks cover these recovery paths, including a stopped
60
- primary rename and a second Apply targeting a still-owned collateral participant.
63
+ primary rename and a second Apply targeting a still-owned room sibling.
61
64
  Complete native and multi-machine convergence remain unproved.
62
65
 
63
66
  ## Operating axioms
@@ -648,24 +651,49 @@ after adoption.
648
651
  root whose own directory entry changed. If the directory at that address
649
652
  is still the same device, inode, and filesystem creation generation its
650
653
  content handle was opened on, that handle already covers everything inside
651
- and the ring adds nothing; missing ground, a lost handle, or a replaced
652
- directory retires the handle and re-establishes coverage. The blind
653
- interval could hide an effect through an alias in any root, so every root
654
- is put completely in question. On macOS
655
- each handle is its own FSEvents stream through Amalgm's own binding
654
+ and the ring adds nothing; a lost handle or a replaced directory retires
655
+ the handle and re-establishes coverage. The blind interval could hide an
656
+ effect through an alias in any root, so every root is put completely in
657
+ question. Ground that left is not lost coverage (Live's absence law):
658
+ every binding is declared at its physical address, and a declared root
659
+ that is missing, obstructed, or unreadable holds no handle, degrades
660
+ nothing, and is heard returning by its nearest listable ancestor's
661
+ address handle, while every other root keeps recording; a returning root
662
+ is caught up whole. Detect treats a root standing on another device than
663
+ it was bound on as unavailable too (`RootOffDevice`), while one re-created
664
+ on its bound device is the same workspace, read whole and compared (Live's
665
+ deletion law). Watch, the binding inventory, and Detect's domain
666
+ check ask one presence question (`presentDirectory`), so they never
667
+ disagree about which roots are there. The route Git takes from a
668
+ checkout to storage outside every root (each link it follows and each
669
+ directory it leaves by `..`, a gitfile it reads, the storage, its
670
+ `commondir` file, a linked worktree's common directory), resolved
671
+ physically as Git resolves it up to the first name Git cannot pass, is
672
+ declared to Watch as dependencies of
673
+ the root holding the checkout (`watching/git-storage.ts`): a storage
674
+ directory gets its own content and parent address handles, any other
675
+ name is heard at its parent's address handle filtered to its own change, every
676
+ ring is forwarded to `<checkout>/.git`, and absence or replacement rings
677
+ that path without degrading coverage. The route is read again when
678
+ repository membership changes and when a finished Detect pass read ground
679
+ holding the checkout. A checkout whose route Git cannot use yet keeps
680
+ declaring it as far as it reaches, so a repair anywhere on it is heard;
681
+ the walks that read it report it. On macOS each handle
682
+ is its own FSEvents stream through Amalgm's own binding
656
683
  (`native/fsevents/`), which asks for per-file events delivered without
657
684
  coalescing delay, so a ring reaches Detect at the platform floor and
658
685
  opening or closing one never interrupts another; Node's own watcher serves
659
686
  every handle in the process from one stream that it recreates, resuming
660
687
  from the present, on every change, and loses the events in between.
661
- Initialization failure or handle death is reported as degraded, retains
662
- full-root suspicion, and retries independently of Detect; it can never be
663
- reported as active coverage. A Linux descendant directory the tree cannot
664
- enter is not lost coverage: its parent hears it. One that vanished needs
665
- no handle. One this process may not read keeps any handle it already had,
666
- and Detect names that ground unavailable, until an event on its name asks
667
- again; entering it then ends an interval no handle heard, so its whole
668
- root is put in question. Only the root's own failure is lost coverage.
688
+ Initialization failure or handle death on present ground is reported as
689
+ degraded, retains full-root suspicion, and retries independently of Detect;
690
+ it can never be reported as active coverage. A Linux descendant directory
691
+ the tree cannot enter is not lost coverage: its parent hears it. One that
692
+ vanished needs no handle. One this process may not read keeps any handle it
693
+ already had, and Detect names that ground unavailable, until an event on
694
+ its name asks again; entering it then ends an interval no handle heard, so
695
+ its whole root is put in question. Only the root's own failure is lost
696
+ coverage.
669
697
 
670
698
  17. **Independent content may travel concurrently; authority remains atomic.**
671
699
  The host bounds parallel uploads for small immutable objects and processes
@@ -673,22 +701,29 @@ after adoption.
673
701
  memory. The registry head advances only after every referenced object is
674
702
  durably acknowledged.
675
703
 
676
- 18. **A Git repository travels through Git.** Filesystem marker presence
677
- classifies `repo.git` independently of whether Git commands succeed; a Git
678
- failure defers cloud publication for that materialized root but never
679
- demotes the entity, admits `.git` as ordinary ground, or prevents the
680
- watching runtime and unrelated roots from becoming ready. The host asks Git to pack the declared
681
- refs against the authority's known object frontier and asks Git to index
682
- received packs. Every directory with a `.git` directory or file begins its
683
- own repository rail. Ordinary children keep their UUID rows locally and
684
- ride in the nearest repository state metadata; a nested repository and its
685
- ancestry spine remain in the cloud graph, carry their own Card + Checkpoint,
686
- and materialize after their enclosing repository. The enclosing Card keeps
687
- its own Gitlink and index truth, but its Checkpoint excludes the nested
688
- worktree because that state belongs exclusively to the nested rail. Its
689
- enclosing identity entry carries only path, UUID, and type—never the nested
690
- repository's payload head. A shallow boundary travels with that metadata
691
- and is installed before Git reads the imported objects.
704
+ 18. **A Git repository travels through Git.** A `.git` that passes Git's own
705
+ structural test, read natively without running Git (`namesGitRepository`:
706
+ its storage holds a valid HEAD and its common directory holds `objects` and
707
+ `refs`; a `.git` link is followed, as Git follows it), classifies
708
+ `repo.git`, and the same test draws each nested boundary inside a
709
+ repository's capture. One Git would refuse is no repository: its
710
+ directory is a folder or workspace on the same UUID whose children travel
711
+ as ordinary entities until Git can use it again. `.git` itself, usable or
712
+ not, is never an entity. Past that test, a Git failure defers cloud
713
+ publication for that materialized root but never demotes the entity or
714
+ prevents the watching runtime and unrelated roots from becoming ready. The
715
+ host asks Git to pack the declared refs against the authority's known
716
+ object frontier and asks Git to index received packs. Every directory whose
717
+ `.git` Git can use begins its own repository rail. Ordinary children keep
718
+ their UUID rows locally and ride in the nearest repository state metadata;
719
+ a nested repository and its ancestry spine remain in the cloud graph, carry
720
+ their own Card + Checkpoint, and materialize after their enclosing
721
+ repository. The enclosing Card keeps its own Gitlink and index truth, but
722
+ its Checkpoint excludes the nested worktree because that state belongs
723
+ exclusively to the nested rail. Its enclosing identity entry carries only
724
+ path, UUID, and type—never the nested repository's payload head. A shallow
725
+ boundary travels with that metadata and is installed before Git reads the
726
+ imported objects.
692
727
 
693
728
  19. **Live owns transfer; Shell owns transfer effects.** `@amalgm/live`
694
729
  decides which entity types have artifacts, which chunks are missing, when
@@ -793,10 +828,19 @@ after adoption.
793
828
  private repository without source remote configuration. Checkpoint decoding
794
829
  and member verification have one private preparation owner, separate from
795
830
  index installation and working-file effects. Replay consumes and closes that
796
- preparation; it does not maintain a second package validator. Sparse directory
797
- entries currently cause an explicit unsupported-index refusal, never an
798
- incomplete index or an alternate-enabled index writer; the native decoder
799
- refuses them before any Git process could expand them. A form Git never
831
+ preparation; it does not maintain a second package validator. A sparse
832
+ index's folder entries, each one tree outside the cone, are read as Git
833
+ writes them and are their files' meaning. Git is never handed a sparse
834
+ index beside borrowed objects: Git expands one by writing every tree it
835
+ expands, and writing an object Git already holds refreshes the source
836
+ file's time, so the read would ring the repository's own Watch and each
837
+ capture would cause the next. Inventory that needs those files asks one
838
+ Git tree reader over borrowed objects, and Git lists untracked names over
839
+ the full index written from them in private storage, borrowing no
840
+ objects. Any stderr fails either read, because Git reports a tree or a
841
+ folder it cannot read yet exits 0 without it, and Shell's Git is asked for
842
+ no advice. No incomplete inventory escapes, and no source index or object
843
+ is written. A form Git never
800
844
  writes, or a required extension Git would not understand, is refused
801
845
  rather than guessed. A zero split link has no shared-base dependency.
802
846
  Fast reuse closes the complete metadata/namespace proof, whose index
@@ -1080,7 +1124,12 @@ after adoption.
1080
1124
  parent and name operations with that grammar, preserving `\\` as a literal
1081
1125
  character, and only then resolves those components with the host platform's
1082
1126
  path semantics for a filesystem effect. Durable records never rewrite or
1083
- mix separators accidentally.
1127
+ mix separators accidentally. A link's target text is portable grammar
1128
+ too, as in Git: it travels with `/`, and only a Windows host converts it,
1129
+ `/` to `\` when writing a link and `\` back to `/` when reading one
1130
+ (`src/link-target.ts`). A target with no Windows spelling, such as a
1131
+ literal `\` or a drive-less absolute path, cannot be reproduced there.
1132
+ Bindings and managed references are machine-local paths and stay native.
1084
1133
 
1085
1134
  37. **Git materialization reproduces Card bytes independently of machine
1086
1135
  preferences.** A repository created by Add disables receiver-global line
@@ -1622,7 +1671,11 @@ after adoption.
1622
1671
  them and never creates, replaces, or removes that nested worktree. Paused
1623
1672
  rebase, cherry-pick, and revert state is not yet represented
1624
1673
  by the current contract and refuses explicitly rather than being mistaken
1625
- for transient work or flattened into a clean stage-zero entry.
1674
+ for transient work or flattened into a clean stage-zero entry. Unchanged
1675
+ ground answers that refusal every time, so Detect withholds only that
1676
+ repository's unit and asks again only when its ground, Git storage
1677
+ included, rings; no timer repeats the read. A fault likewise withholds
1678
+ only its own repository's unit, and the pass retries it on its timer.
1626
1679
 
1627
1680
  Scheduling never extends source evidence. A suspended walk retains its
1628
1681
  physical identity basis, rechecks it before repository reuse or capture,
@@ -1650,12 +1703,16 @@ after adoption.
1650
1703
 
1651
1704
  74. **Same-slot records keep identity and derive distinct disk addresses.**
1652
1705
  Shell never rewrites a portable name to settle concurrent identities.
1653
- Cold materialization and Apply derive the same UUID-ordered suffixes from
1654
- the complete active sibling set; Detect recognizes both the portable name
1655
- and that exact derived name as the same record. A sibling-set change
1656
- relocates affected materializations while holding every source and
1657
- destination cone, with row addresses committed before disk movement so a
1658
- crash can only re-prove the same portable identities.
1706
+ Cold materialization, Apply and the placement tidy derive the same
1707
+ UUID-ordered suffixes from the complete active sibling set; Detect
1708
+ recognizes both the portable name and that exact derived name as the same
1709
+ record. A reveal moves only the siblings standing in its target's derived
1710
+ address. Every other sibling-set consequence is a placement note, written
1711
+ in the transaction that changed the slot, which the placement tidy pays
1712
+ off the Apply line. Each such move is one no-replace move, ground first
1713
+ and rows after, never onto an address the observation inventory records
1714
+ for another, so a crash leaves at most one move whose destination was
1715
+ free and Detect re-proves the same portable identities.
1659
1716
 
1660
1717
  75. **Ground storage has one initializer and one visible generation per root.**
1661
1718
  A ground file's migration and its process epoch run once per file per
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * The accepted tail: the latest authority-accepted result of every entity
3
3
  * delivered in (M, N], read in one SQLite transaction together with the local
4
- * delivery cursor N and its history floor.
4
+ * delivery cursor and its history floor. N is the cursor, or an earlier
5
+ * position the cursor has passed.
5
6
  *
6
7
  * The Inbox holds every authority record above the floor through the cursor.
7
8
  * A tail may begin only at or above that floor: below it this machine never
@@ -18,9 +19,10 @@ export declare class AcceptedHistoryUnavailableError extends Error {
18
19
  export interface AcceptedTail {
19
20
  /** M: the base the tail folds onto. */
20
21
  readonly after: number;
21
- /** N: the local gap-free authority cursor the tail runs through. */
22
+ /** N: the position the tail runs through, never past the local gap-free
23
+ * authority cursor. */
22
24
  readonly through: number;
23
25
  /** The latest accepted result per entity in (after, through]. */
24
26
  readonly results: readonly CloudEntityRecord[];
25
27
  }
26
- export declare function readAcceptedTail(database: Database.Database, authorityId: string, after: number): AcceptedTail;
28
+ export declare function readAcceptedTail(database: Database.Database, authorityId: string, after: number, until?: number): AcceptedTail;
@@ -9,14 +9,17 @@ export class AcceptedHistoryUnavailableError extends Error {
9
9
  this.name = "AcceptedHistoryUnavailableError";
10
10
  }
11
11
  }
12
- export function readAcceptedTail(database, authorityId, after) {
12
+ export function readAcceptedTail(database, authorityId, after, until) {
13
13
  return database.transaction(() => {
14
14
  const cursor = database.prepare(`
15
15
  SELECT received_through AS through, history_floor AS floor
16
16
  FROM authority_delivery_cursors WHERE authority_id = ?
17
17
  `).get(authorityId);
18
- const through = cursor?.through ?? 0;
18
+ const received = cursor?.through ?? 0;
19
+ const through = until ?? received;
19
20
  const floor = cursor?.floor ?? 0;
21
+ if (received < through)
22
+ throw new Error(`local delivery cursor ${received} has not reached ${through}`);
20
23
  if (through < after) {
21
24
  throw new Error("local delivery cursor is behind the active snapshot watermark");
22
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"accepted-tail.js","sourceRoot":"","sources":["../src/accepted-tail.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,0BAA0B,EAA0B,MAAM,cAAc,CAAC;AAElF,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IACnC;IAAwB;IAA7C,YAAqB,KAAa,EAAW,KAAa;QACxD,KAAK,CAAC,mCAAmC,KAAK,qCAAqC,KAAK,EAAE,CAAC,CAAC;QADzE,UAAK,GAAL,KAAK,CAAQ;QAAW,UAAK,GAAL,KAAK,CAAQ;QAExD,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAChD,CAAC;CACF;AAWD,MAAM,UAAU,gBAAgB,CAC9B,QAA2B,EAC3B,WAAmB,EACnB,KAAa;IAEb,OAAO,QAAQ,CAAC,WAAW,CAAC,GAAiB,EAAE;QAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC;;;KAG/B,CAAC,CAAC,GAAG,CAAC,WAAW,CAAmD,CAAC;QACtE,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,IAAI,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,KAAK,GAAG,KAAK;YAAE,MAAM,IAAI,+BAA+B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,IAAI,GAAG,EAA6B,CAAC;QACpD,KAAK,MAAM,EAAE,UAAU,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC;;;;KAI7C,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAqC,EAAE,CAAC;YAC5E,MAAM,QAAQ,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;YACxD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"accepted-tail.js","sourceRoot":"","sources":["../src/accepted-tail.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,0BAA0B,EAA0B,MAAM,cAAc,CAAC;AAElF,MAAM,OAAO,+BAAgC,SAAQ,KAAK;IACnC;IAAwB;IAA7C,YAAqB,KAAa,EAAW,KAAa;QACxD,KAAK,CAAC,mCAAmC,KAAK,qCAAqC,KAAK,EAAE,CAAC,CAAC;QADzE,UAAK,GAAL,KAAK,CAAQ;QAAW,UAAK,GAAL,KAAK,CAAQ;QAExD,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAC;IAChD,CAAC;CACF;AAYD,MAAM,UAAU,gBAAgB,CAC9B,QAA2B,EAC3B,WAAmB,EACnB,KAAa,EACb,KAAc;IAEd,OAAO,QAAQ,CAAC,WAAW,CAAC,GAAiB,EAAE;QAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC;;;KAG/B,CAAC,CAAC,GAAG,CAAC,WAAW,CAAmD,CAAC;QACtE,MAAM,QAAQ,GAAG,MAAM,EAAE,OAAO,IAAI,CAAC,CAAC;QACtC,MAAM,OAAO,GAAG,KAAK,IAAI,QAAQ,CAAC;QAClC,MAAM,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC;QACjC,IAAI,QAAQ,GAAG,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,oBAAoB,OAAO,EAAE,CAAC,CAAC;QACxG,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,KAAK,GAAG,KAAK;YAAE,MAAM,IAAI,+BAA+B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,IAAI,GAAG,EAA6B,CAAC;QACpD,KAAK,MAAM,EAAE,UAAU,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC;;;;KAI7C,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAqC,EAAE,CAAC;YAC5E,MAAM,QAAQ,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;YACxD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { type ApplyPreimage, type ApplyRecovery } from "./apply-recovery.js";
2
+ export type BoundGroundEffect = "complete" | "prefix" | "foreign";
3
+ /** The host's exact readings, each judged as the receipt's intent judges.
4
+ * Ground the host refuses to read is ground Apply never produces, so it
5
+ * matches nothing. */
6
+ export interface BoundGroundPort {
7
+ /** Whether `path` holds exactly the target, read as if it stood at the target address. */
8
+ matchesTarget(path: string): Promise<boolean>;
9
+ /** Whether `path` holds `preimage`'s complete ground unchanged. */
10
+ matchesPreimage(preimage: ApplyPreimage, path: string): Promise<boolean>;
11
+ /** Whether the present target's materialized parent stands at the target address's parent. */
12
+ parentStands(): boolean;
13
+ }
14
+ export type ReceiptMove = ApplyRecovery["moves"][number];
15
+ /** The private names one bound intent may hold beneath its control tree. */
16
+ export declare const displacedPath: (control: string) => string;
17
+ export declare const appliedPath: (control: string) => string;
18
+ export declare const relocatedPath: (control: string, uuid: string) => string;
19
+ /** The private names whose directory entries a bound intent's moves change.
20
+ * Both terminal commits flush their parents with the receipt's addresses. */
21
+ export declare const controlEntries: (recovery: ApplyRecovery, control: string) => readonly string[];
22
+ /**
23
+ * The receipt's sibling moves still to perform, in an order that performs
24
+ * them, and those a person blocked. Each makes room for the target, so none
25
+ * waits for the target to leave its source.
26
+ *
27
+ * - A move is a candidate while its source holds the sibling's own anchor. A
28
+ * sibling at neither address was moved by a person, and Detect owns it.
29
+ * - A candidate is kept when no spelling of its destination finds an object,
30
+ * or the object found leaves first: the sibling itself, or an earlier kept
31
+ * sibling.
32
+ * - Any other candidate is blocked: an object Apply never moves stands where
33
+ * the sibling must go. A blocked move is released; the sibling keeps its
34
+ * address.
35
+ */
36
+ export declare function pendingMoves(recovery: ApplyRecovery): {
37
+ kept: readonly ReceiptMove[];
38
+ blocked: readonly ReceiptMove[];
39
+ };
40
+ /** Whether a repository relocation group still stands at its source, its own
41
+ * object, not yet moved aside. Each group moves into the control tree once
42
+ * the reveal has recreated it from the parcel, proved again right before its
43
+ * move; retirement then proves it unchanged (releaseChangedRelocations). */
44
+ export declare function relocationPending(entry: ApplyRecovery["relocated"][number], control: string): boolean;
45
+ /** The receipt's repository relocation groups still pending. */
46
+ export declare function pendingRelocated(recovery: ApplyRecovery, control: string): ApplyRecovery["relocated"];
47
+ /** The rules in order; the first that decides is the answer. */
48
+ export declare function classifyBoundGround(recovery: ApplyRecovery, control: string, port: BoundGroundPort): Promise<BoundGroundEffect>;
49
+ /** Whether the source stands where the reveal's own steps may have left it:
50
+ * at its home, at the target, or displaced. A source anywhere else was
51
+ * replaced or removed by a person after the final guard, so the reveal acts
52
+ * on none of its ground and Verify finds the person's version. A create has
53
+ * no source, and its address is judged by the reveal's own install. */
54
+ export declare function sourceStands(recovery: ApplyRecovery, control: string): boolean;
55
+ /**
56
+ * Cancellation keeps every local version without replacing other ground.
57
+ * The person's version is home-bound when the reveal moved it away from its
58
+ * home (the source's address, or the target's for a create): a changed
59
+ * displaced source, or a source still at home. The reveal is then undone in
60
+ * reverse order, so that version stands at its home before the intent
61
+ * retires. Otherwise the person's version stands where the reveal put it,
62
+ * the reveal's own moves stand with it, and one interrupted between its link
63
+ * and its unlink finishes.
64
+ *
65
+ * 1. The primary. A person's write that reached a name the address still
66
+ * holds stays there, and the private name goes. An unchanged displaced
67
+ * source is no person's version; retirement deletes it. A present result
68
+ * leaves its address into `applied` before it is judged, so no write can
69
+ * reach it between the judgment and the move; only an exact target stays
70
+ * aside, and anything else returns to the address it left as a second
71
+ * local version. A primary between its link and its unlink keeps its home
72
+ * name, where a person's write through either name stands.
73
+ * 2. The person's version returns home.
74
+ * 3. The siblings that left the target's address before it, once the primary
75
+ * has left it again.
76
+ *
77
+ * Once it begins returning a version, every retry continues that return:
78
+ * the displaced name holds only the source (the reveal never displaces
79
+ * another object), so a returned source stands at its home, and a result
80
+ * held aside in `applied` stays there until retirement. Only a person who
81
+ * replaces the returned version at home before a crashed retry ends that
82
+ * evidence (docs/entity-apply.md, Returned version replaced). Every move only
83
+ * fills a vacant address beneath a standing parent, so a sibling whose
84
+ * address a person took keeps where it stands, and Detect owns it. A
85
+ * version that cannot return (a second local version, or a home a person
86
+ * filled or whose parent they removed) stays where it is, and recovery
87
+ * throws for explicit repair with every version kept. Each step skips what
88
+ * an interrupted attempt already did. Cancellation then flushes the
89
+ * receipt's whole footprint, so a retry that finds a move already done
90
+ * still flushes it before the intent can retire.
91
+ */
92
+ export declare function restoreBoundLocal(recovery: ApplyRecovery, control: string, port: BoundGroundPort): Promise<void>;
93
+ /**
94
+ * Displaced Git storage a person changed is the person's version: it returns
95
+ * as the marker of the folder whose storage it was, under the same law as
96
+ * every other return, and Detect records it once the intent retires. The
97
+ * receipt's manifest stays, so a crash before the cancelled commit reads the
98
+ * returned storage against it and is foreign again. Unchanged storage stays
99
+ * for retirement to delete. Cancellation calls this after restoreBoundLocal,
100
+ * which may have returned the folder home.
101
+ */
102
+ export declare function releaseChangedGitStorage(recovery: ApplyRecovery, control: string): Promise<void>;
103
+ /**
104
+ * A relocation group a person changed, before or after the reveal moved it
105
+ * aside, is the person's version: it returns to its own address and Detect
106
+ * records it once the intent retires. Only unchanged groups stay for
107
+ * retirement to delete. Either retirement calls this before its proof.
108
+ */
109
+ export declare function releaseChangedRelocations(recovery: ApplyRecovery, control: string, port: BoundGroundPort): Promise<void>;