@amalgm/live 0.2.81-main.39107155915 → 0.2.81-main.39176188543

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 (278) hide show
  1. package/PURPOSE.md +91 -68
  2. package/dist/apply/contracts.d.ts +150 -70
  3. package/dist/apply/contracts.d.ts.map +1 -1
  4. package/dist/apply/contracts.js +14 -1
  5. package/dist/apply/contracts.js.map +1 -1
  6. package/dist/apply/expected-repository.d.ts +49 -0
  7. package/dist/apply/expected-repository.d.ts.map +1 -0
  8. package/dist/apply/expected-repository.js +125 -0
  9. package/dist/apply/expected-repository.js.map +1 -0
  10. package/dist/apply/index.d.ts +5 -0
  11. package/dist/apply/index.d.ts.map +1 -1
  12. package/dist/apply/index.js +5 -0
  13. package/dist/apply/index.js.map +1 -1
  14. package/dist/apply/journey.d.ts +32 -0
  15. package/dist/apply/journey.d.ts.map +1 -0
  16. package/dist/apply/journey.js +335 -0
  17. package/dist/apply/journey.js.map +1 -0
  18. package/dist/apply/line.d.ts +42 -0
  19. package/dist/apply/line.d.ts.map +1 -0
  20. package/dist/apply/line.js +62 -0
  21. package/dist/apply/line.js.map +1 -0
  22. package/dist/apply/local-work.d.ts +10 -5
  23. package/dist/apply/local-work.d.ts.map +1 -1
  24. package/dist/apply/local-work.js +18 -8
  25. package/dist/apply/local-work.js.map +1 -1
  26. package/dist/apply/plans.d.ts +5 -3
  27. package/dist/apply/plans.d.ts.map +1 -1
  28. package/dist/apply/plans.js +11 -8
  29. package/dist/apply/plans.js.map +1 -1
  30. package/dist/apply/rail.d.ts +25 -12
  31. package/dist/apply/rail.d.ts.map +1 -1
  32. package/dist/apply/rail.js +309 -604
  33. package/dist/apply/rail.js.map +1 -1
  34. package/dist/apply/repository-boundaries.d.ts +60 -7
  35. package/dist/apply/repository-boundaries.d.ts.map +1 -1
  36. package/dist/apply/repository-boundaries.js +61 -11
  37. package/dist/apply/repository-boundaries.js.map +1 -1
  38. package/dist/apply/repository-paths.d.ts +33 -0
  39. package/dist/apply/repository-paths.d.ts.map +1 -0
  40. package/dist/apply/repository-paths.js +67 -0
  41. package/dist/apply/repository-paths.js.map +1 -0
  42. package/dist/apply/repository-result.d.ts +10 -26
  43. package/dist/apply/repository-result.d.ts.map +1 -1
  44. package/dist/apply/repository-result.js +50 -84
  45. package/dist/apply/repository-result.js.map +1 -1
  46. package/dist/apply/selection.d.ts +11 -4
  47. package/dist/apply/selection.d.ts.map +1 -1
  48. package/dist/apply/selection.js +43 -6
  49. package/dist/apply/selection.js.map +1 -1
  50. package/dist/apply/settling.d.ts +44 -0
  51. package/dist/apply/settling.d.ts.map +1 -0
  52. package/dist/apply/settling.js +36 -0
  53. package/dist/apply/settling.js.map +1 -0
  54. package/dist/apply/showing.d.ts +52 -0
  55. package/dist/apply/showing.d.ts.map +1 -0
  56. package/dist/apply/showing.js +66 -0
  57. package/dist/apply/showing.js.map +1 -0
  58. package/dist/apply/shown-checkpoint.d.ts +13 -0
  59. package/dist/apply/shown-checkpoint.d.ts.map +1 -0
  60. package/dist/apply/shown-checkpoint.js +112 -0
  61. package/dist/apply/shown-checkpoint.js.map +1 -0
  62. package/dist/detection/classify.d.ts +10 -6
  63. package/dist/detection/classify.d.ts.map +1 -1
  64. package/dist/detection/classify.js +6 -5
  65. package/dist/detection/classify.js.map +1 -1
  66. package/dist/detection/index.d.ts +0 -2
  67. package/dist/detection/index.d.ts.map +1 -1
  68. package/dist/detection/index.js +0 -2
  69. package/dist/detection/index.js.map +1 -1
  70. package/dist/detection/refusal.d.ts +7 -1
  71. package/dist/detection/refusal.d.ts.map +1 -1
  72. package/dist/detection/refusal.js +10 -3
  73. package/dist/detection/refusal.js.map +1 -1
  74. package/dist/detection/scoped-identity.d.ts +4 -1
  75. package/dist/detection/scoped-identity.d.ts.map +1 -1
  76. package/dist/detection/scoped-identity.js.map +1 -1
  77. package/dist/entities/bytes.d.ts +3 -0
  78. package/dist/entities/bytes.d.ts.map +1 -1
  79. package/dist/entities/bytes.js +20 -0
  80. package/dist/entities/bytes.js.map +1 -1
  81. package/dist/entities/cloud.d.ts +20 -10
  82. package/dist/entities/cloud.d.ts.map +1 -1
  83. package/dist/entities/cloud.js +28 -17
  84. package/dist/entities/cloud.js.map +1 -1
  85. package/dist/entities/digest-steps.d.ts +14 -0
  86. package/dist/entities/digest-steps.d.ts.map +1 -0
  87. package/dist/entities/digest-steps.js +26 -0
  88. package/dist/entities/digest-steps.js.map +1 -0
  89. package/dist/entities/index.d.ts +11 -3
  90. package/dist/entities/index.d.ts.map +1 -1
  91. package/dist/entities/index.js +11 -3
  92. package/dist/entities/index.js.map +1 -1
  93. package/dist/entities/json-steps.d.ts +21 -0
  94. package/dist/entities/json-steps.d.ts.map +1 -0
  95. package/dist/entities/json-steps.js +130 -0
  96. package/dist/entities/json-steps.js.map +1 -0
  97. package/dist/entities/placement-owed.d.ts +56 -0
  98. package/dist/entities/placement-owed.d.ts.map +1 -0
  99. package/dist/entities/placement-owed.js +71 -0
  100. package/dist/entities/placement-owed.js.map +1 -0
  101. package/dist/entities/repo-states.d.ts +61 -27
  102. package/dist/entities/repo-states.d.ts.map +1 -1
  103. package/dist/entities/repo-states.js +279 -165
  104. package/dist/entities/repo-states.js.map +1 -1
  105. package/dist/entities/types.d.ts +11 -0
  106. package/dist/entities/types.d.ts.map +1 -1
  107. package/dist/files/commands.d.ts +13 -7
  108. package/dist/files/commands.d.ts.map +1 -1
  109. package/dist/files/commands.js +22 -10
  110. package/dist/files/commands.js.map +1 -1
  111. package/dist/records/index.d.ts +7 -0
  112. package/dist/records/index.d.ts.map +1 -1
  113. package/dist/records/index.js +7 -0
  114. package/dist/records/index.js.map +1 -1
  115. package/dist/records/intentional.d.ts +1 -1
  116. package/dist/records/intentional.d.ts.map +1 -1
  117. package/dist/records/outbox.d.ts +6 -10
  118. package/dist/records/outbox.d.ts.map +1 -1
  119. package/dist/records/outbox.js +7 -37
  120. package/dist/records/outbox.js.map +1 -1
  121. package/dist/records/owned-effects.d.ts +15 -0
  122. package/dist/records/owned-effects.d.ts.map +1 -0
  123. package/dist/records/owned-effects.js +37 -0
  124. package/dist/records/owned-effects.js.map +1 -0
  125. package/dist/records/publication.d.ts +10 -5
  126. package/dist/records/publication.d.ts.map +1 -1
  127. package/dist/records/publication.js +16 -5
  128. package/dist/records/publication.js.map +1 -1
  129. package/dist/records/rail-ports.d.ts +172 -0
  130. package/dist/records/rail-ports.d.ts.map +1 -0
  131. package/dist/records/rail-ports.js +3 -0
  132. package/dist/records/rail-ports.js.map +1 -0
  133. package/dist/records/rail.d.ts +21 -168
  134. package/dist/records/rail.d.ts.map +1 -1
  135. package/dist/records/rail.js +84 -568
  136. package/dist/records/rail.js.map +1 -1
  137. package/dist/records/receive-channel.d.ts +58 -0
  138. package/dist/records/receive-channel.d.ts.map +1 -0
  139. package/dist/records/receive-channel.js +114 -0
  140. package/dist/records/receive-channel.js.map +1 -0
  141. package/dist/records/receive-loop.d.ts +62 -0
  142. package/dist/records/receive-loop.d.ts.map +1 -0
  143. package/dist/records/receive-loop.js +276 -0
  144. package/dist/records/receive-loop.js.map +1 -0
  145. package/dist/records/receive-pages.d.ts +28 -0
  146. package/dist/records/receive-pages.d.ts.map +1 -0
  147. package/dist/records/receive-pages.js +80 -0
  148. package/dist/records/receive-pages.js.map +1 -0
  149. package/dist/records/retry-clock.d.ts +14 -0
  150. package/dist/records/retry-clock.d.ts.map +1 -0
  151. package/dist/records/retry-clock.js +35 -0
  152. package/dist/records/retry-clock.js.map +1 -0
  153. package/dist/records/send-batch.d.ts +48 -0
  154. package/dist/records/send-batch.d.ts.map +1 -0
  155. package/dist/records/send-batch.js +82 -0
  156. package/dist/records/send-batch.js.map +1 -0
  157. package/dist/records/send-line.d.ts +82 -0
  158. package/dist/records/send-line.d.ts.map +1 -0
  159. package/dist/records/send-line.js +273 -0
  160. package/dist/records/send-line.js.map +1 -0
  161. package/dist/records/send-preparation.d.ts +46 -0
  162. package/dist/records/send-preparation.d.ts.map +1 -0
  163. package/dist/records/send-preparation.js +209 -0
  164. package/dist/records/send-preparation.js.map +1 -0
  165. package/dist/records/submit-frame.d.ts +55 -0
  166. package/dist/records/submit-frame.d.ts.map +1 -0
  167. package/dist/records/submit-frame.js +161 -0
  168. package/dist/records/submit-frame.js.map +1 -0
  169. package/dist/records/wire.d.ts +16 -30
  170. package/dist/records/wire.d.ts.map +1 -1
  171. package/dist/records/wire.js +22 -75
  172. package/dist/records/wire.js.map +1 -1
  173. package/dist/steps.d.ts +5 -1
  174. package/dist/steps.d.ts.map +1 -1
  175. package/dist/steps.js +13 -1
  176. package/dist/steps.js.map +1 -1
  177. package/dist/transfer/stream.d.ts +3 -7
  178. package/dist/transfer/stream.d.ts.map +1 -1
  179. package/dist/transfer/stream.js.map +1 -1
  180. package/dist/watching/suspicion.d.ts +4 -0
  181. package/dist/watching/suspicion.d.ts.map +1 -1
  182. package/dist/watching/suspicion.js +128 -70
  183. package/dist/watching/suspicion.js.map +1 -1
  184. package/dist-cjs/apply/contracts.js +15 -1
  185. package/dist-cjs/apply/contracts.js.map +1 -1
  186. package/dist-cjs/apply/expected-repository.js +128 -0
  187. package/dist-cjs/apply/expected-repository.js.map +1 -0
  188. package/dist-cjs/apply/index.js +5 -0
  189. package/dist-cjs/apply/index.js.map +1 -1
  190. package/dist-cjs/apply/journey.js +340 -0
  191. package/dist-cjs/apply/journey.js.map +1 -0
  192. package/dist-cjs/apply/line.js +69 -0
  193. package/dist-cjs/apply/line.js.map +1 -0
  194. package/dist-cjs/apply/local-work.js +18 -8
  195. package/dist-cjs/apply/local-work.js.map +1 -1
  196. package/dist-cjs/apply/plans.js +11 -8
  197. package/dist-cjs/apply/plans.js.map +1 -1
  198. package/dist-cjs/apply/rail.js +310 -605
  199. package/dist-cjs/apply/rail.js.map +1 -1
  200. package/dist-cjs/apply/repository-boundaries.js +66 -12
  201. package/dist-cjs/apply/repository-boundaries.js.map +1 -1
  202. package/dist-cjs/apply/repository-paths.js +73 -0
  203. package/dist-cjs/apply/repository-paths.js.map +1 -0
  204. package/dist-cjs/apply/repository-result.js +50 -85
  205. package/dist-cjs/apply/repository-result.js.map +1 -1
  206. package/dist-cjs/apply/selection.js +43 -6
  207. package/dist-cjs/apply/selection.js.map +1 -1
  208. package/dist-cjs/apply/settling.js +40 -0
  209. package/dist-cjs/apply/settling.js.map +1 -0
  210. package/dist-cjs/apply/showing.js +70 -0
  211. package/dist-cjs/apply/showing.js.map +1 -0
  212. package/dist-cjs/apply/shown-checkpoint.js +115 -0
  213. package/dist-cjs/apply/shown-checkpoint.js.map +1 -0
  214. package/dist-cjs/detection/classify.js +6 -5
  215. package/dist-cjs/detection/classify.js.map +1 -1
  216. package/dist-cjs/detection/index.js +0 -2
  217. package/dist-cjs/detection/index.js.map +1 -1
  218. package/dist-cjs/detection/refusal.js +12 -3
  219. package/dist-cjs/detection/refusal.js.map +1 -1
  220. package/dist-cjs/detection/scoped-identity.js.map +1 -1
  221. package/dist-cjs/entities/bytes.js +21 -0
  222. package/dist-cjs/entities/bytes.js.map +1 -1
  223. package/dist-cjs/entities/cloud.js +29 -17
  224. package/dist-cjs/entities/cloud.js.map +1 -1
  225. package/dist-cjs/entities/digest-steps.js +30 -0
  226. package/dist-cjs/entities/digest-steps.js.map +1 -0
  227. package/dist-cjs/entities/index.js +11 -3
  228. package/dist-cjs/entities/index.js.map +1 -1
  229. package/dist-cjs/entities/json-steps.js +135 -0
  230. package/dist-cjs/entities/json-steps.js.map +1 -0
  231. package/dist-cjs/entities/placement-owed.js +76 -0
  232. package/dist-cjs/entities/placement-owed.js.map +1 -0
  233. package/dist-cjs/entities/repo-states.js +289 -177
  234. package/dist-cjs/entities/repo-states.js.map +1 -1
  235. package/dist-cjs/files/commands.js +21 -9
  236. package/dist-cjs/files/commands.js.map +1 -1
  237. package/dist-cjs/records/index.js +19 -0
  238. package/dist-cjs/records/index.js.map +1 -1
  239. package/dist-cjs/records/outbox.js +8 -39
  240. package/dist-cjs/records/outbox.js.map +1 -1
  241. package/dist-cjs/records/owned-effects.js +41 -0
  242. package/dist-cjs/records/owned-effects.js.map +1 -0
  243. package/dist-cjs/records/publication.js +17 -5
  244. package/dist-cjs/records/publication.js.map +1 -1
  245. package/dist-cjs/records/rail-ports.js +4 -0
  246. package/dist-cjs/records/rail-ports.js.map +1 -0
  247. package/dist-cjs/records/rail.js +86 -571
  248. package/dist-cjs/records/rail.js.map +1 -1
  249. package/dist-cjs/records/receive-channel.js +119 -0
  250. package/dist-cjs/records/receive-channel.js.map +1 -0
  251. package/dist-cjs/records/receive-loop.js +280 -0
  252. package/dist-cjs/records/receive-loop.js.map +1 -0
  253. package/dist-cjs/records/receive-pages.js +85 -0
  254. package/dist-cjs/records/receive-pages.js.map +1 -0
  255. package/dist-cjs/records/retry-clock.js +39 -0
  256. package/dist-cjs/records/retry-clock.js.map +1 -0
  257. package/dist-cjs/records/send-batch.js +88 -0
  258. package/dist-cjs/records/send-batch.js.map +1 -0
  259. package/dist-cjs/records/send-line.js +277 -0
  260. package/dist-cjs/records/send-line.js.map +1 -0
  261. package/dist-cjs/records/send-preparation.js +213 -0
  262. package/dist-cjs/records/send-preparation.js.map +1 -0
  263. package/dist-cjs/records/submit-frame.js +167 -0
  264. package/dist-cjs/records/submit-frame.js.map +1 -0
  265. package/dist-cjs/records/wire.js +22 -77
  266. package/dist-cjs/records/wire.js.map +1 -1
  267. package/dist-cjs/steps.js +14 -2
  268. package/dist-cjs/steps.js.map +1 -1
  269. package/dist-cjs/transfer/stream.js.map +1 -1
  270. package/dist-cjs/watching/suspicion.js +128 -70
  271. package/dist-cjs/watching/suspicion.js.map +1 -1
  272. package/package.json +4 -4
  273. package/dist/detection/repository.d.ts +0 -26
  274. package/dist/detection/repository.d.ts.map +0 -1
  275. package/dist/detection/repository.js +0 -66
  276. package/dist/detection/repository.js.map +0 -1
  277. package/dist-cjs/detection/repository.js +0 -69
  278. package/dist-cjs/detection/repository.js.map +0 -1
package/PURPOSE.md CHANGED
@@ -230,12 +230,14 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
230
230
  on that machine, while cloud reconciliation preserves every unmaterialized
231
231
  boundary. A fresh verified install may be Watch's initial baseline so the
232
232
  downloader's own writes are not reinterpreted as user edits.
233
- 21. **A Git marker classifies its containing directory.** The presence of a
234
- `.git` directory or file makes its containing directory `repo.git`; its
235
- removal returns that same UUID to `workspace` or `folder`. Git command
236
- availability governs Card + Checkpoint capture, never classification, and
237
- `.git` itself is repository transport metadata that receives no entity
238
- row. Each such directory starts a repository rail: ordinary worktree
233
+ 21. **A Git marker classifies its containing directory.** A `.git`
234
+ directory or file that Git can use, by Git's own structural test, makes
235
+ its containing directory `repo.git`; its removal, or a break Git itself
236
+ would refuse, returns that same UUID to `workspace` or `folder`, whose
237
+ children then travel as ordinary entities. Git command availability
238
+ governs Card + Checkpoint capture, never classification, and `.git`
239
+ itself, usable or not, is Git's metadata that receives no entity row.
240
+ Each repository directory starts a repository rail: ordinary worktree
239
241
  children retain local UUID rows and ride in their nearest repository state
240
242
  manifest, while a nested repository and the ancestry spine that reaches it
241
243
  remain cloud graph records with their own Card + Checkpoint transport. The
@@ -245,10 +247,16 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
245
247
  never invents history beyond it. Every current graph a reader derives
246
248
  from a published snapshot and its later delivery tail passes through this
247
249
  same projection, and Add refuses a lookup that hands it a record the
248
- projection would not publish before it moves any bytes. Leaving repository
249
- territory first publishes every newly independent descendant while the
250
- repository boundary still hides them, then publishes the boundary retype
251
- alone; no authority prefix can expose a partial ordinary-file tree.
250
+ projection would not publish before it moves any bytes. Records follow
251
+ cause before effect: every accepted prefix must be reconstructible from
252
+ its accepted records and retained packages, without waiting for a later
253
+ record. Leaving repository territory publishes the boundary retype first,
254
+ then each newly independent descendant, whose retained latest statement
255
+ supplies its contents until its own record arrives; a repository that
256
+ stays a repository publishes after every record beneath it that crosses
257
+ its boundary. Every deletion is stated by the capture: by an ancestor's
258
+ Trash that still covers the entity, else by the new package of the live
259
+ repository that held it, else by the entity's own Trash record.
252
260
  22. **Transfer moves content; it never discovers state.** `upload` moves one
253
261
  already-registered immutable artifact toward cloud storage and `download`
254
262
  moves that same artifact toward a machine cache. Neither operation scans,
@@ -374,14 +382,14 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
374
382
  costs its Card + Checkpoint scope. Only honestly ambiguous evidence enters
375
383
  complete reconciliation. Detect ends after the exact proposal and local
376
384
  truth are committed together; cloud publication belongs to Send.
377
- 35. **The entity UUID is the ordered channel.** Cloud assigns a dense sequence
378
- independently to each entity UUID across all machines. Unrelated entities
379
- have no semantic order and may be sent concurrently; workspace or delivery
380
- cursors may discover records but never decide which entity state wins. The
381
- one graph-visibility barrier is not semantic ordering: any retype into a
382
- container is sent alone after earlier descendant records are accepted,
383
- because it may expose repository-owned ground; every observable prefix
384
- therefore remains a complete graph.
385
+ 35. **The entity UUID is the ordered channel; each computer sends one line.**
386
+ Cloud assigns a dense sequence independently to each entity UUID across all
387
+ machines. Within each authority, a computer's records are accepted in its
388
+ local record order, so what others observe of that computer's work is always
389
+ a prefix of what it recorded: a retype that exposes repository-owned ground
390
+ follows the records written before it, and every observable prefix remains a
391
+ complete graph. That line orders delivery, not truth: neither it nor a
392
+ workspace or delivery cursor decides which entity state wins.
385
393
  36. **Receive owns the local inbox.** Every cloud-accepted record, including
386
394
  one originating on this computer, enters the inbox under
387
395
  `(entityId, globalSequence)`. Each entity has its own received-through
@@ -412,26 +420,28 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
412
420
  after a final conflict-scoped guard, recoverable reveal, and the target type
413
421
  rereading exact truth. Lock and cargo attempts are finite and observable;
414
422
  their failure retains responsibility for retry rather than waiting forever.
415
- A failed lane records its outcome and arms its bounded backoff when that
416
- lane finishes, never when its work page or the wider drain finishes. Once
417
- the deadline elapses, retry and fresh ordinary work share bounded fair
418
- admission across every storage-page partition, so neither repeated failure
419
- nor unrelated progress can starve the other. Retry eligibility is re-read
420
- from current durable responsibility before admission; an omitted UUID
421
- retires its process-local park instead of reviving stale page work. Newer input for its
422
- entity may also release it, and a materialization dependency or conflict
423
- may additionally be released only by another lane's progress; a wake it caused
424
- itself can never re-run it. Parent and child UUIDs remain independent channels, but their
425
- physical materialization respects current parcel ownership: a child whose
426
- accepted parent is not yet a physical directory, or whose current ancestry
427
- still places it inside a repository parcel it is leaving, waits unresolved
428
- as a dependency without capture, error, or a filesystem effect. The
429
- boundary retype releases that child; nested repositories and their visible
430
- folder spine remain independent parcel boundaries. An accepted
431
- destination already recorded as a different entity is a conflict, never a
432
- local change to capture. The park timer and attempt count are process-local:
433
- after restart, the durable intent is re-proved once and, if still blocked,
434
- parks again from attempt one.
423
+ Each authority's accepted records apply in one line, in delivery order:
424
+ recovery work first, then the first unresolved materializable row, whose
425
+ target extends only over the adjacent content run of that same file or
426
+ link. A head with no intent and newer local work on its entity resolves at
427
+ once as superseded. A failed head keeps its durable intent, records its
428
+ outcome, and parks its whole line with bounded backoff while other
429
+ authorities' lines go on; waiting holds the queue position, never the
430
+ ground. The parked line runs again when its backoff elapses, its head
431
+ changes, newer local work appears for the head's entity, the producer its
432
+ dependency names releases it, or, for a conflict, another authority's line
433
+ progresses; a wake it caused itself can never re-run it. Parent and child
434
+ UUIDs remain independent channels. A result plays by what this computer
435
+ shows: one shown neither before nor after resolves in order with no
436
+ effect, so a child never waits for a parent this computer does not show.
437
+ Every file belongs to its nearest repository: a repository result acts
438
+ only on its territory, never on a nested repository's subtree or on ground
439
+ another rail owns here where its map disagrees, so it never waits on a
440
+ boundary. An accepted destination already recorded as
441
+ a different entity is a conflict, never a local change to capture. The park
442
+ timer and attempt count are process-local: after restart, the durable
443
+ intent is re-proved once and, if still blocked, parks again from attempt
444
+ one.
435
445
  A host proves current physical repository ground from Card + Checkpoint and
436
446
  the exact identity frontier sealed to that immutable transport. Compact
437
447
  machine evidence is accepted only when it reproduces the transport's
@@ -451,13 +461,16 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
451
461
  retained immutable payload through the target type's adapter; a link is
452
462
  restored as literal link target text and only an ordinary file is restored
453
463
  through the ordinary-file adapter.
454
- A missing active target below a still-present materialized root first
455
- passes through one finite Detect boundary. Before reveal, a proven move or
456
- settled local deletion becomes durable Trash work and supersedes the older Apply.
457
- After reveal begins, the boundary may still preserve a concurrent move or
458
- save, but Apply's own intermediate absence cannot authorize lifecycle; no
459
- durable local result authorizes idempotent repair from the accepted result.
460
- Only exact Verify may complete the intent. A missing materialization root
464
+ While an intent is unbound, a missing active target below a still-present
465
+ materialized root first passes through one finite Detect boundary. Before
466
+ reveal, a proven move or settled local deletion becomes durable Trash work
467
+ and supersedes the older Apply. An unbound intent whose target already
468
+ stood re-enters that boundary if the target later disappears; Apply's own
469
+ absence cannot authorize lifecycle, and when no durable local result
470
+ follows, idempotent repair reveals the accepted result, binding first.
471
+ Once bound, absence is read only through the receipt: a prefix of the
472
+ reveal resumes and anything else is a person's. Only exact Verify may
473
+ complete the intent. A missing materialization root
461
474
  remains a separate root-recovery responsibility; entity Apply never
462
475
  recreates it piecemeal.
463
476
  Text uses an exact-base splice with a complete snapshot fallback;
@@ -471,8 +484,9 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
471
484
  target, protects that entity's working ground. The local complete result is
472
485
  still accepted normally and wins only when cloud assigns its later
473
486
  sequence; Apply never rebases, merges, stale-refuses, or rewrites it. A
474
- reveal-time disk difference enters Detect and Record before incoming work
475
- may touch the path.
487
+ disk difference found before reveal enters Detect and Record before
488
+ incoming work may touch the path; one found by an owned intent's receipt
489
+ read is returned home and left to Detect.
476
490
  41. **Verify, not a write syscall, commits Apply.** Applied Watch rings are
477
491
  retained. Only exact type-specific reread may advance resolved and
478
492
  materialized cursors, update the local notebook, mark Inbox history
@@ -485,12 +499,15 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
485
499
  require old cargo, adopt a changed private survivor, or overwrite later
486
500
  observations. A phase alone does not prove whether physical effects exist:
487
501
  adopting an exact target may reach `revealed` without changing disk. Only
488
- a bound receipt proves effect ownership. Recovery may cancel an obsolete
489
- plan after accounting for every original effect and conditionally repairing
490
- its intermediate physical addresses. Cancellation preserves sharing values
491
- and leaves Inbox and materialization progress unresolved; a fresh intent
492
- replans only after the old owner's cleanup. An unexplained effect keeps its
493
- responsibility. Exact target Verify is still required to claim installation. For a
502
+ a bound receipt proves effect ownership. Shown bytes are attributed, never
503
+ guessed: Apply may drop private work for the newest record, but once it
504
+ binds recovery before its first visible effect it owns that ground until
505
+ it has read it once through the receipt. Its own complete result is
506
+ verified and projected in the commit that ends ownership; a prefix of its
507
+ own reveal resumes; anything else is the person's, returns to its home,
508
+ and is left to Detect. Cancellation preserves sharing values and resolves
509
+ nothing. The newest record then wins, never by releasing unread ground.
510
+ Exact target Verify is still required to claim installation. For a
494
511
  repository, Verify commits Card, Checkpoint, and the complete transported
495
512
  identity frontier as one notebook fact. The Watch observation caused by
496
513
  that reveal must compare equal to that same fact; it can never become a new
@@ -550,13 +567,15 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
550
567
  48. **A slot collision changes materialization, never identity.** Mutation-time
551
568
  guards refuse a second local owner of one `(parentUUID, name)` slot, but a
552
569
  merged graph may contain identities created concurrently in that slot.
553
- Every observer preserves every UUID and derives the same disk names from
554
- the complete active sibling set: the lexicographically lowest UUID keeps
555
- the bare name and later UUIDs take the next free Windows-style ` (n)`
556
- suffix before a file-like extension. UUID order is a deterministic
557
- machine-independent tiebreak, chronological only when the UUIDs are v7.
558
- A derived name is never a mutation, version input, or portable rename;
559
- whenever the sibling set changes, materialization is re-derived.
570
+ A Restore into an occupied name does the same. Every observer preserves
571
+ every UUID and derives the same disk names from the complete active
572
+ sibling set: the identity that arrived in the slot last, by the cloud's
573
+ acceptance order, takes the next free Windows-style ` (n)` suffix before a
574
+ file-like extension, and the earlier one keeps the bare name. Apply still
575
+ derives that order from lexicographic UUIDs; latest-arrival ordering is
576
+ unfinished there. A derived name is never a mutation, version input, or
577
+ portable rename; whenever the sibling set changes, materialization is
578
+ re-derived.
560
579
  49. **The executable bit is ordinary-file truth.** A text or binary file
561
580
  carries exactly one portable mode, `0644` or `0755`, and that mode is part
562
581
  of its canonical version. Detect records a mode-only change without
@@ -582,14 +601,18 @@ or certify a new wire contract, cloud migration or cross-machine rollout.
582
601
  ## Apply attribution boundary
583
602
 
584
603
  Detect describes observed user ground. A bound, nonterminal Apply recovery receipt
585
- owns only its original effect participants and address cones; a phase alone owns
586
- nothing. Detect defers dependent attribution and retains the Watch responsibility,
587
- while independent observations may commit. Ownership is rechecked at Record
588
- admission, including an originally empty answer. Terminal commit releases that
589
- ownership before private cleanup and wakes its original scopes. A capture blocked
590
- by its own receipt requests coherent cancellation; only proof of the original
591
- effects authorizes cancellation, and cancellation never resolves Inbox or advances
592
- verified state. Fresh intents have fresh host-minted attempt identities, even when
604
+ owns only its original effect participants and address cones; a phase alone
605
+ defers no Detect attribution, because an unbound revealed intent changed nothing
606
+ on disk (it still Verifies before newer work). Detect defers dependent
607
+ attribution and retains the Watch responsibility, while independent
608
+ observations may commit. Ownership is rechecked at Record admission, including
609
+ an originally empty answer. Terminal commit releases that ownership before
610
+ private cleanup and wakes its original scopes. A bound intent never captures,
611
+ so no capture is blocked by its own receipt: it ends only through its receipt
612
+ read, and only that read's proof of a person's change authorizes cancelling
613
+ it. Cancellation never resolves Inbox or advances verified state.
614
+ Detect's self-blocked capture answer (`replan`) is therefore unreachable and
615
+ awaits removal by its owner. Fresh intents have fresh host-minted attempt identities, even when
593
616
  the target and wall clock are identical, and run fresh preflight before new effects.
594
617
  Apply uses the same foreign-ownership rule at admission and terminal preparation;
595
618
  a dependent cancellation waits without resolving history or discarding evidence.
@@ -5,7 +5,8 @@ import type { ChangeFacet, TextSplice } from '../detection/record-proposal.js';
5
5
  import type { AcceptedEntityRecord } from '../records/contracts.js';
6
6
  import type { ContentManifest } from '../contracts/content.js';
7
7
  import type { TransferArtifact } from '../transfer/artifacts.js';
8
- export declare const ENTITY_APPLY_INTENT_CONTRACT = "amalgm.entity-apply-intent@2";
8
+ import { type ApplyPlay } from './showing.js';
9
+ export declare const ENTITY_APPLY_INTENT_CONTRACT = "amalgm.entity-apply-intent@3";
9
10
  export type ApplyIntentPhase = 'declared' | 'prepared' | 'revealed';
10
11
  /** One crash-recovery responsibility. It is written before any machine effect. */
11
12
  export interface EntityApplyIntent {
@@ -19,6 +20,9 @@ export interface EntityApplyIntent {
19
20
  readonly targetMutationId: string;
20
21
  readonly targetState: string;
21
22
  readonly targetType: EntityType;
23
+ /** The play judged when the intent began. Recovery finishes it; it is
24
+ * never judged again while the intent stays open. */
25
+ readonly play: ApplyPlay;
22
26
  readonly phase: ApplyIntentPhase;
23
27
  readonly createdAt: number;
24
28
  }
@@ -27,23 +31,52 @@ export interface MaterializedOfficialState {
27
31
  readonly globalSequence: number;
28
32
  readonly record: CloudEntityRecord;
29
33
  }
30
- /** One entity's contiguous unresolved Inbox range. */
34
+ /**
35
+ * The work at the head of one authority's line: one entity's unresolved
36
+ * Inbox records from its resolved position. Without an intent they run
37
+ * through the end of the entity's adjacent run in the line, the records no
38
+ * other unresolved record separates; with one, through the intent's target.
39
+ */
31
40
  export interface EntityApplyWork {
32
41
  readonly authorityId: string;
33
42
  readonly entityId: string;
43
+ /** The head's play: its open intent's, or judged at its position. */
44
+ readonly play: ApplyPlay;
34
45
  readonly resolvedThrough: number;
35
46
  readonly materialized: MaterializedOfficialState | null;
36
47
  readonly records: readonly AcceptedEntityRecord[];
37
48
  readonly intent: EntityApplyIntent | null;
49
+ /** True once the host durably bound this intent's recovery receipt. The host
50
+ * binds before any visible effect; from then the intent owns its ground
51
+ * until retirement and is never cancelled, even by newer local work. */
52
+ readonly effectsBound: boolean;
38
53
  /** A terminal decision owns cleanup even with no remaining Inbox or ground. */
39
54
  readonly retirement?: EntityApplyRetirement;
40
55
  }
41
- /** One stable page of unresolved entities. The cursor is opaque to Live. */
42
- export interface EntityApplyWorkPage {
43
- readonly work: readonly EntityApplyWork[];
44
- readonly nextCursor: string | null;
56
+ /**
57
+ * The head of an authority's line. An open intent or retirement heads it.
58
+ * Otherwise the head is the first unresolved Inbox row in delivery order,
59
+ * judged at its position (settling.ts): a play is a head whose work is that
60
+ * entity's adjacent run; a settlement owes no effect and resolves where it
61
+ * sits. Nothing is ever read past: a later row plays only after every
62
+ * earlier row resolved.
63
+ */
64
+ export type EntityApplyLineStep = {
65
+ readonly kind: 'head';
66
+ readonly work: EntityApplyWork;
67
+ } | {
68
+ readonly kind: 'settle';
69
+ readonly entityId: string;
70
+ readonly deliverySequence: number;
45
71
  }
72
+ /** No unresolved row is readable whole: the received prefix is resolved,
73
+ * or the first unresolved row waits for Receive to repair its entity's
74
+ * gap. Receive's commit wakes the line. */
75
+ | {
76
+ readonly kind: 'end';
77
+ };
46
78
  interface ApplyPlanBase {
79
+ readonly play: ApplyPlay;
47
80
  readonly entityId: string;
48
81
  readonly fromSequence: number;
49
82
  readonly throughSequence: number;
@@ -98,9 +131,11 @@ export interface RepositoryApplyPlan extends ApplyPlanBase {
98
131
  readonly parentTransportVersion: string | null;
99
132
  readonly transportVersion: string;
100
133
  }
101
- export interface LifecycleApplyPlan extends ApplyPlanBase {
102
- readonly kind: 'lifecycle';
103
- readonly status: 'trashed' | 'deleted';
134
+ /** The result stops showing here: trashed, deleted, moved under ground this
135
+ * computer does not show, or below a place that is no longer a shown
136
+ * container. Its subtree leaves this disk recoverably; nothing is fetched. */
137
+ export interface LeaveApplyPlan extends ApplyPlanBase {
138
+ readonly kind: 'leave';
104
139
  }
105
140
  /** A construct payload stages exactly like a binary file. The product's
106
141
  * adapter reports `dependency` from guard while a UUID the payload names is
@@ -110,7 +145,7 @@ export interface ConstructApplyPlan extends ApplyPlanBase {
110
145
  readonly artifact: TransferArtifact;
111
146
  readonly manifest: ContentManifest;
112
147
  }
113
- export type EntityApplyPlan = TextApplyPlan | BinaryApplyPlan | LinkApplyPlan | StructureApplyPlan | ReferenceApplyPlan | RepositoryApplyPlan | LifecycleApplyPlan | ConstructApplyPlan;
148
+ export type EntityApplyPlan = TextApplyPlan | BinaryApplyPlan | LinkApplyPlan | StructureApplyPlan | ReferenceApplyPlan | RepositoryApplyPlan | LeaveApplyPlan | ConstructApplyPlan;
114
149
  /** A concrete prerequisite and the component that can change it. `send`
115
150
  * names local results still waiting for their authority sequence. */
116
151
  export interface ApplyDependency {
@@ -118,11 +153,11 @@ export interface ApplyDependency {
118
153
  readonly entityIds: readonly string[];
119
154
  }
120
155
  /** A wait a person can see and resolve. It stays a dependency, never a
121
- * fault: the lane wakes on its producer's progress, not on backoff. A blocker
156
+ * fault: the line wakes on its producer's progress, not on backoff. A blocker
122
157
  * always names what releases it, so the current status can always show it. */
123
158
  export interface ApplyBlocker {
124
159
  readonly code: 'local-ground-would-be-displaced';
125
- readonly effect: 'trash' | 'replace-container' | 'repository-reveal';
160
+ readonly effect: 'leave' | 'replace-container' | 'repository-reveal';
126
161
  }
127
162
  /** A named prerequisite that another component's progress can change. */
128
163
  export interface ApplyDependencyOutcome {
@@ -131,6 +166,25 @@ export interface ApplyDependencyOutcome {
131
166
  readonly waitFor?: ApplyDependency;
132
167
  readonly blocker?: ApplyBlocker;
133
168
  }
169
+ /**
170
+ * Unbound only: under the ground lock, the play this head was judged at no
171
+ * longer holds, for example its place stopped showing or its workspace root
172
+ * is missing here. The host first makes durable the table fact the store
173
+ * judges by, such as the root being behind, so the next judgment sees it.
174
+ * The private intent retires cancelled and the line judges its head again.
175
+ */
176
+ export interface ApplyRejudge {
177
+ readonly kind: 'rejudge';
178
+ readonly reason: string;
179
+ }
180
+ /** The reveal found a person's version in the target's place before binding
181
+ * anything. Nothing of this intent is shown; it cancels, and Detect records
182
+ * the person's version. */
183
+ export interface ApplyDeclinedReveal {
184
+ readonly kind: 'declined';
185
+ readonly reason: string;
186
+ }
187
+ /** The named prerequisite a held line waits for. */
134
188
  export interface ApplyWait {
135
189
  readonly entityId: string;
136
190
  readonly reason: string;
@@ -138,21 +192,23 @@ export interface ApplyWait {
138
192
  readonly throughSequence: number;
139
193
  readonly blocker?: ApplyBlocker;
140
194
  }
141
- export type ApplyGuard = {
195
+ export type ApplyGuard =
196
+ /** The effect may run. For a bound intent: the ground is a prefix of this
197
+ * intent's own reveal order, so the reveal resumes. */
198
+ {
142
199
  readonly kind: 'safe';
143
- } | {
144
- readonly kind: 'already-target';
145
200
  }
146
- /** The original receipt can reach a safe cancellation, but no longer
147
- * authorizes the current effect plan. Keep Inbox unresolved and replan only
148
- * after that cancellation and its cleanup commit. */
201
+ /** Ground already holds the target. For a bound intent: the host recognized
202
+ * this intent's own complete effect from its recovery receipt. */
149
203
  | {
150
- readonly kind: 'replan';
151
- readonly reason: string;
204
+ readonly kind: 'already-target';
152
205
  }
153
206
  /** Ground differs from the last observation at this entity's own address,
154
207
  * or unrecorded ground holds the destination. Detect + Record can give that
155
- * ground identity, so the rail captures it before deciding anything. */
208
+ * ground identity, so the rail captures it before deciding anything. For a
209
+ * bound intent the ground is neither its own effect nor a prefix of it: it
210
+ * is a person's, and the rail cancels without capture so Detect records it
211
+ * once ownership ends. */
156
212
  | {
157
213
  readonly kind: 'local-change';
158
214
  readonly reason?: string;
@@ -162,43 +218,59 @@ export type ApplyGuard = {
162
218
  * removal becomes durable Trash work. After reveal, capture may
163
219
  * preserve a concurrent move or save but cannot authorize lifecycle from
164
220
  * Apply's own intermediate absence. A durable local result supersedes this
165
- * Apply; no result authorizes idempotent cloud repair. */
221
+ * Apply; no result authorizes idempotent cloud repair. A host never returns
222
+ * this for a bound intent: its receipt names the ground, so the read is
223
+ * always its own effect, a prefix of it, or a person's. */
166
224
  | {
167
225
  readonly kind: 'unsettled-ground';
168
226
  readonly reason?: string;
169
227
  }
170
- /** A prerequisite is not met yet: the accepted parent has not
171
- * materialized, a capability is missing, or the effect would displace local
172
- * remainder nothing else holds. The lane waits without capture or error and
173
- * is re-proved when the named producer's progress may have changed it. */
174
- | ApplyDependencyOutcome
175
- /** The destination is held by a different recorded entity. Capture can never
176
- * turn that into this entity's local work, so the lane parks: it re-runs
177
- * only when its input changes or another lane's progress may have moved the
178
- * occupant. The reason is evidence for the host. */
228
+ /** A prerequisite whose release can arrive while the line waits: a
229
+ * person's action at this place, such as an unfinished Git operation or
230
+ * local remainder the effect would displace, Detect, Send, or a lock. The
231
+ * line holds without capture or error and is re-proved when the named
232
+ * producer's progress may have changed it. */
233
+ | ApplyDependencyOutcome | ApplyRejudge
234
+ /** Ground this machine observes but sharing does not hold, such as ground
235
+ * its enrollment policy excludes, occupies the derived destination. Every
236
+ * shared sibling derives its own address, so no other recorded occupant is
237
+ * possible, and capture can never turn this one into this entity's local
238
+ * work. The line parks and reports the occupant: it re-runs only when its
239
+ * head changes, or when another authority's line progresses and may have
240
+ * moved the occupant. */
179
241
  | {
180
242
  readonly kind: 'conflict';
181
243
  readonly reason: string;
182
- } | {
244
+ }
245
+ /** Nothing is wrong, but ground is not yet settled enough to decide. The
246
+ * line re-proves after bounded backoff without a report. A fault throws
247
+ * instead, and the rail reports its cause under the same backoff. */
248
+ | {
183
249
  readonly kind: 'retry';
184
250
  readonly reason?: string;
185
251
  };
186
252
  export type ApplyVerification = {
187
253
  readonly kind: 'match';
188
- } | {
189
- readonly kind: 'replan';
190
- readonly reason: string;
191
- } | ApplyDependencyOutcome
192
- /** An active accepted target below a present materialized root is absent.
193
- * The rail re-enters the final guard and one lifecycle-protected Detect
194
- * boundary. A concurrent move or save remains local work; otherwise the
195
- * same intent idempotently reveals the official result. */
254
+ } | ApplyDependencyOutcome | ApplyRejudge
255
+ /** Unbound only: an active accepted target below a present materialized
256
+ * root is absent. The rail re-enters the final guard and one
257
+ * lifecycle-protected Detect boundary. A concurrent move or save remains
258
+ * local work; otherwise the same intent idempotently reveals the official
259
+ * result. A bound host reports local-change instead. */
196
260
  | {
197
261
  readonly kind: 'missing-target';
198
- } | {
262
+ }
263
+ /** Ground is not the exact target. Unbound, the rail captures it; bound, it
264
+ * is a person's and the rail cancels so Detect records it. */
265
+ | {
199
266
  readonly kind: 'local-change';
200
267
  readonly reason?: string;
201
- } | {
268
+ }
269
+ /** Nothing is wrong, but the target is not yet observable as complete, such
270
+ * as a product still converging on its accepted payload. The line re-proves
271
+ * after bounded backoff without a report. A fault, including a failed
272
+ * durability flush, throws instead, and the rail reports its cause. */
273
+ | {
202
274
  readonly kind: 'retry';
203
275
  readonly reason?: string;
204
276
  };
@@ -219,30 +291,25 @@ export interface EntityApplyRetirement {
219
291
  type MaybePromise<T> = T | Promise<T>;
220
292
  /** One prepared SQLite owner supplies these transactions for the rail lifetime. */
221
293
  export interface EntityApplyStorePort {
222
- /** At most one item per entity across a stable cursor scan, existing intents
223
- * first. Pagination prevents blocked UUIDs from starving unrelated work. */
224
- readApplyWork(limit: number, afterCursor: string | null): MaybePromise<EntityApplyWorkPage>;
225
- /** Re-read only these lanes for fair retry admission. Missing ids no longer
226
- * own locally eligible Apply responsibility and are omitted. */
227
- readApplyWorkForEntities(entityIds: readonly string[]): MaybePromise<readonly EntityApplyWork[]>;
228
- /** True when a local Outbox row is still unsequenced or was accepted after
229
- * `targetSequence`. An accepted local receipt remains protective until its
230
- * own official position is selected by Apply. */
294
+ /** Every authority with an open intent or an unresolved Inbox record. */
295
+ readApplyAuthorities(): MaybePromise<readonly string[]>;
296
+ /** This authority's line head: an open intent or retirement first, else
297
+ * its first unresolved row judged at its position, else the end. Nothing
298
+ * is resolved by reading. */
299
+ readApplyLineStep(authorityId: string): MaybePromise<EntityApplyLineStep>;
300
+ /** Settle the head at `deliverySequence` and the settling heads right
301
+ * after it, in one bounded commit that judges each again (settling.ts) at
302
+ * its position against committed tables. Returns how many settled: none
303
+ * when that row no longer heads the line as a settlement, which the next
304
+ * read then shows. Materialization, observed rows, notebook rows, claims
305
+ * and ground stay unchanged. */
306
+ settle(authorityId: string, deliverySequence: number): MaybePromise<number>;
307
+ /** True when a local Outbox row's official position is unknown or after
308
+ * `targetSequence`. Its position is its acknowledgement, or the Inbox
309
+ * position of the same mutation when Receive holds it before Send stamps
310
+ * the receipt. An accepted local receipt remains protective until its own
311
+ * official position is selected by Apply. */
231
312
  hasLocalWorkAfter(authorityId: string, entityId: string, targetSequence: number): MaybePromise<boolean>;
232
- /**
233
- * Resolve this computer's own exact publication without any Apply effect.
234
- * In one transaction, true only when no intent exists, Inbox work still
235
- * starts at `work.resolvedThrough` and ends at `target`, the retained Outbox
236
- * receipt `isExactOwnAcceptance` of `target`, no local work follows it, and
237
- * the local sharing basis still holds `target.resultState`, and the host
238
- * proves its ground sits at the derived address with no sibling relocation
239
- * owed. Then the range through `target` resolves and materialization
240
- * evidence is unchanged.
241
- * Otherwise nothing is written and the ordinary Apply journey decides.
242
- * The rail offers a page's lanes together, so calls for different entities
243
- * overlap.
244
- */
245
- resolveOwnPublication(work: EntityApplyWork, target: AcceptedEntityRecord): MaybePromise<boolean>;
246
313
  beginIntent(intent: EntityApplyIntent): MaybePromise<void>;
247
314
  setIntentPhase(intent: EntityApplyIntent): MaybePromise<void>;
248
315
  cancelIntent(intent: EntityApplyIntent): MaybePromise<EntityApplyRetirement>;
@@ -257,8 +324,9 @@ export interface EntityApplySocket {
257
324
  prepare(intent: EntityApplyIntent, plan: EntityApplyPlan): Promise<void>;
258
325
  /** Compare ground with the last local observation before preparation and again before reveal. */
259
326
  guard(intent: EntityApplyIntent, plan: EntityApplyPlan): Promise<ApplyGuard>;
260
- /** Final effect admission can discover an owner through a physical alias. */
261
- reveal(intent: EntityApplyIntent, plan: EntityApplyPlan): Promise<void | ApplyDependencyOutcome>;
327
+ /** Final effect admission can discover an owner through a physical alias,
328
+ * or decline before binding when a person's version replaced the ground. */
329
+ reveal(intent: EntityApplyIntent, plan: EntityApplyPlan): Promise<void | ApplyDependencyOutcome | ApplyDeclinedReveal>;
262
330
  /** Prove and stage a finite cleanup description without deleting recovery.
263
331
  * The store consumes this proof together with the requested terminal outcome.
264
332
  * Another effect owner can defer this boundary using the normal dependency. */
@@ -299,8 +367,11 @@ export type LocalCaptureResult = {
299
367
  */
300
368
  export interface EntityApplyEffectsPort {
301
369
  adapterFor(type: EntityType): OperationalEntityApplyAdapter;
302
- /** Resume only the recorded cleanup; never require current ground or cargo. */
303
- cleanup(retirement: EntityApplyRetirement): Promise<void>;
370
+ /** Resume only the recorded cleanup; never require the entity's current
371
+ * ground or cargo. Its private objects lie in one materialized root: while
372
+ * that root is unavailable the cleanup names it and waits, and the
373
+ * retirement keeps heading its line. */
374
+ cleanup(retirement: EntityApplyRetirement): Promise<void | ApplyDependencyOutcome>;
304
375
  /** Await the named observation. Local-only differences retain the Apply
305
376
  * intent and must never be treated as safely recorded bytes. After reveal,
306
377
  * the host protects the target from lifecycle inference while preserving
@@ -325,8 +396,8 @@ export interface EntityApplyRailOptions {
325
396
  readonly schedule: EntityApplySchedulePort;
326
397
  readonly sha256Hex: Sha256Hex;
327
398
  readonly now: () => number;
399
+ /** How many authority lines run at once. One line is always sequential. */
328
400
  readonly concurrency?: number;
329
- readonly workLimit?: number;
330
401
  readonly onWaiting?: (wait: ApplyWait) => void;
331
402
  readonly onBackgroundError?: (error: unknown) => void;
332
403
  }
@@ -337,8 +408,17 @@ export declare function createApplyIntent(input: {
337
408
  readonly entityId: string;
338
409
  readonly fromSequence: number;
339
410
  readonly target: AcceptedEntityRecord;
411
+ readonly play: ApplyPlay;
340
412
  readonly createdAt: number;
341
413
  }): EntityApplyIntent;
414
+ /**
415
+ * The one ownership law. Once an intent is revealed or its effects are bound,
416
+ * it owns its ground and ends only on evidence of that ground: a receipt read
417
+ * when bound, or for a revealed intent without effects its unbound Verify or
418
+ * a later durable local result. Anything else is private preparation, which
419
+ * newer work or a covering verified baseline may drop without a read.
420
+ */
421
+ export declare function applyIntentOwned(intent: EntityApplyIntent, effectsBound: boolean): boolean;
342
422
  export declare function advanceApplyIntent(intent: EntityApplyIntent, phase: Exclude<ApplyIntentPhase, 'declared'>): EntityApplyIntent;
343
423
  export {};
344
424
  //# sourceMappingURL=contracts.d.ts.map