@openrig/cli 0.7.15 → 0.7.17

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 (603) hide show
  1. package/README.md +9 -9
  2. package/daemon/assets/onboarding/02-self-and-competent-action.md +5 -41
  3. package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
  4. package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
  5. package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
  6. package/daemon/assets/plugins/openrig/README.md +26 -7
  7. package/daemon/assets/plugins/openrig/plugin.json +1 -1
  8. package/daemon/assets/plugins/openrig/skills/working-with-an-openrig-team/SKILL.md +22 -6
  9. package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
  10. package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
  11. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md +4 -1
  12. package/daemon/assets/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md +1 -1
  13. package/daemon/assets/skills/rigs/SKILL.md +155 -41
  14. package/daemon/assets/skills/rigs/references/installing-for-someone.md +47 -0
  15. package/daemon/context-packs/help/manifest.yaml +1 -1
  16. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  17. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +169 -40
  18. package/daemon/context-packs/reference/getting-started.md +12 -11
  19. package/daemon/context-packs/reference/manifest.yaml +4 -1
  20. package/daemon/context-packs/reference/product-journey-sdlc.md +348 -0
  21. package/daemon/context-packs/reference/rig-spec.md +92 -4
  22. package/daemon/context-packs/reference/whats-new.md +397 -5
  23. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/claude-compaction-restore/SKILL.md +4 -1
  27. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/core/openrig-software-factory/references/worked-example.md +1 -1
  39. package/daemon/context-packs/skills/core/openrig-upgrade/SKILL.md +2 -0
  40. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
  48. package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  60. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  64. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  65. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  66. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  67. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  68. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  69. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  70. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  71. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  72. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  73. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  74. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  75. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  76. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  77. package/daemon/context-packs/skills/seat-continuity-and-handover/SKILL.md +1 -1
  78. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  79. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  80. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  81. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  82. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  83. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  84. package/daemon/dist/adapters/claude-code-adapter.js +42 -6
  85. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  86. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  87. package/daemon/dist/adapters/claude-resume.js +4 -2
  88. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  89. package/daemon/dist/adapters/codex-resume.d.ts +2 -0
  90. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  91. package/daemon/dist/adapters/codex-resume.js +28 -11
  92. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  93. package/daemon/dist/adapters/codex-runtime-adapter.d.ts +15 -0
  94. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  95. package/daemon/dist/adapters/codex-runtime-adapter.js +75 -28
  96. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  97. package/daemon/dist/adapters/openshell-driver.d.ts +1 -0
  98. package/daemon/dist/adapters/openshell-driver.d.ts.map +1 -1
  99. package/daemon/dist/adapters/openshell-driver.js +3 -0
  100. package/daemon/dist/adapters/openshell-driver.js.map +1 -1
  101. package/daemon/dist/adapters/openshell-podman-observer.d.ts +9 -7
  102. package/daemon/dist/adapters/openshell-podman-observer.d.ts.map +1 -1
  103. package/daemon/dist/adapters/openshell-podman-observer.js +20 -3
  104. package/daemon/dist/adapters/openshell-podman-observer.js.map +1 -1
  105. package/daemon/dist/adapters/pi-runner.d.ts +38 -4
  106. package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
  107. package/daemon/dist/adapters/pi-runner.js +244 -30
  108. package/daemon/dist/adapters/pi-runner.js.map +1 -1
  109. package/daemon/dist/adapters/tmux.d.ts +6 -0
  110. package/daemon/dist/adapters/tmux.d.ts.map +1 -1
  111. package/daemon/dist/adapters/tmux.js +17 -3
  112. package/daemon/dist/adapters/tmux.js.map +1 -1
  113. package/daemon/dist/build-info.js +3 -3
  114. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  115. package/daemon/dist/db/all-migrations.js +8 -0
  116. package/daemon/dist/db/all-migrations.js.map +1 -1
  117. package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts +14 -0
  118. package/daemon/dist/db/migrations/167_seat_handover_attempts.d.ts.map +1 -0
  119. package/daemon/dist/db/migrations/167_seat_handover_attempts.js +54 -0
  120. package/daemon/dist/db/migrations/167_seat_handover_attempts.js.map +1 -0
  121. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts +6 -0
  122. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.d.ts.map +1 -0
  123. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js +10 -0
  124. package/daemon/dist/db/migrations/168_context_usage_occupant_generation.js.map +1 -0
  125. package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts +5 -0
  126. package/daemon/dist/db/migrations/169_seat_runtime_home_records.d.ts.map +1 -0
  127. package/daemon/dist/db/migrations/169_seat_runtime_home_records.js +25 -0
  128. package/daemon/dist/db/migrations/169_seat_runtime_home_records.js.map +1 -0
  129. package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts +3 -0
  130. package/daemon/dist/db/migrations/170_rig_delivery_drains.d.ts.map +1 -0
  131. package/daemon/dist/db/migrations/170_rig_delivery_drains.js +21 -0
  132. package/daemon/dist/db/migrations/170_rig_delivery_drains.js.map +1 -0
  133. package/daemon/dist/domain/claim-service.d.ts +1 -3
  134. package/daemon/dist/domain/claim-service.d.ts.map +1 -1
  135. package/daemon/dist/domain/claim-service.js +3 -1
  136. package/daemon/dist/domain/claim-service.js.map +1 -1
  137. package/daemon/dist/domain/claude-compaction-enforcer.d.ts +11 -0
  138. package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
  139. package/daemon/dist/domain/claude-compaction-enforcer.js +83 -36
  140. package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
  141. package/daemon/dist/domain/codex-filesystem-preflight.d.ts +33 -0
  142. package/daemon/dist/domain/codex-filesystem-preflight.d.ts.map +1 -0
  143. package/daemon/dist/domain/codex-filesystem-preflight.js +255 -0
  144. package/daemon/dist/domain/codex-filesystem-preflight.js.map +1 -0
  145. package/daemon/dist/domain/codex-member-permissions.d.ts +23 -2
  146. package/daemon/dist/domain/codex-member-permissions.d.ts.map +1 -1
  147. package/daemon/dist/domain/codex-member-permissions.js +55 -9
  148. package/daemon/dist/domain/codex-member-permissions.js.map +1 -1
  149. package/daemon/dist/domain/codex-network-default.d.ts +13 -0
  150. package/daemon/dist/domain/codex-network-default.d.ts.map +1 -1
  151. package/daemon/dist/domain/codex-network-default.js +37 -30
  152. package/daemon/dist/domain/codex-network-default.js.map +1 -1
  153. package/daemon/dist/domain/codex-thread-id.d.ts +13 -0
  154. package/daemon/dist/domain/codex-thread-id.d.ts.map +1 -1
  155. package/daemon/dist/domain/codex-thread-id.js +132 -9
  156. package/daemon/dist/domain/codex-thread-id.js.map +1 -1
  157. package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
  158. package/daemon/dist/domain/compaction-restore-notice.js +59 -13
  159. package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
  160. package/daemon/dist/domain/connection-contract.d.ts.map +1 -1
  161. package/daemon/dist/domain/connection-contract.js +2 -1
  162. package/daemon/dist/domain/connection-contract.js.map +1 -1
  163. package/daemon/dist/domain/context-usage-store.d.ts +11 -2
  164. package/daemon/dist/domain/context-usage-store.d.ts.map +1 -1
  165. package/daemon/dist/domain/context-usage-store.js +33 -13
  166. package/daemon/dist/domain/context-usage-store.js.map +1 -1
  167. package/daemon/dist/domain/current-work.d.ts +5 -0
  168. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  169. package/daemon/dist/domain/current-work.js +66 -4
  170. package/daemon/dist/domain/current-work.js.map +1 -1
  171. package/daemon/dist/domain/destination-successor.d.ts +3 -0
  172. package/daemon/dist/domain/destination-successor.d.ts.map +1 -0
  173. package/daemon/dist/domain/destination-successor.js +49 -0
  174. package/daemon/dist/domain/destination-successor.js.map +1 -0
  175. package/daemon/dist/domain/environment-lifecycle.d.ts +15 -0
  176. package/daemon/dist/domain/environment-lifecycle.d.ts.map +1 -1
  177. package/daemon/dist/domain/environment-lifecycle.js +22 -4
  178. package/daemon/dist/domain/environment-lifecycle.js.map +1 -1
  179. package/daemon/dist/domain/expected-conversation.d.ts.map +1 -1
  180. package/daemon/dist/domain/expected-conversation.js +26 -11
  181. package/daemon/dist/domain/expected-conversation.js.map +1 -1
  182. package/daemon/dist/domain/gateway/destination-resolver.d.ts +4 -0
  183. package/daemon/dist/domain/gateway/destination-resolver.d.ts.map +1 -1
  184. package/daemon/dist/domain/gateway/destination-resolver.js +10 -3
  185. package/daemon/dist/domain/gateway/destination-resolver.js.map +1 -1
  186. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts +3 -1
  187. package/daemon/dist/domain/gateway/operator-delivery-engine.d.ts.map +1 -1
  188. package/daemon/dist/domain/gateway/operator-delivery-engine.js +14 -4
  189. package/daemon/dist/domain/gateway/operator-delivery-engine.js.map +1 -1
  190. package/daemon/dist/domain/health-diagnosis.d.ts.map +1 -1
  191. package/daemon/dist/domain/health-diagnosis.js +4 -0
  192. package/daemon/dist/domain/health-diagnosis.js.map +1 -1
  193. package/daemon/dist/domain/health-passive-ceremony.d.ts +3 -0
  194. package/daemon/dist/domain/health-passive-ceremony.d.ts.map +1 -1
  195. package/daemon/dist/domain/health-passive-ceremony.js +45 -4
  196. package/daemon/dist/domain/health-passive-ceremony.js.map +1 -1
  197. package/daemon/dist/domain/hosts/fleet-scopes.d.ts +111 -0
  198. package/daemon/dist/domain/hosts/fleet-scopes.d.ts.map +1 -0
  199. package/daemon/dist/domain/hosts/fleet-scopes.js +231 -0
  200. package/daemon/dist/domain/hosts/fleet-scopes.js.map +1 -0
  201. package/daemon/dist/domain/hosts/read-through.d.ts +1 -1
  202. package/daemon/dist/domain/hosts/read-through.d.ts.map +1 -1
  203. package/daemon/dist/domain/hosts/read-through.js +4 -0
  204. package/daemon/dist/domain/hosts/read-through.js.map +1 -1
  205. package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
  206. package/daemon/dist/domain/mission-control/mission-control-write-contract.js +1 -1
  207. package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
  208. package/daemon/dist/domain/native-model-picker.d.ts +2 -0
  209. package/daemon/dist/domain/native-model-picker.d.ts.map +1 -1
  210. package/daemon/dist/domain/native-model-picker.js +8 -2
  211. package/daemon/dist/domain/native-model-picker.js.map +1 -1
  212. package/daemon/dist/domain/native-permission-store.d.ts.map +1 -1
  213. package/daemon/dist/domain/native-permission-store.js +12 -5
  214. package/daemon/dist/domain/native-permission-store.js.map +1 -1
  215. package/daemon/dist/domain/native-process-lineage.d.ts +11 -1
  216. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  217. package/daemon/dist/domain/native-process-lineage.js +25 -4
  218. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  219. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  220. package/daemon/dist/domain/native-resume-probe.js +109 -26
  221. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  222. package/daemon/dist/domain/network/network-connector.d.ts.map +1 -1
  223. package/daemon/dist/domain/network/network-connector.js +5 -3
  224. package/daemon/dist/domain/network/network-connector.js.map +1 -1
  225. package/daemon/dist/domain/network/network-installations.d.ts +5 -4
  226. package/daemon/dist/domain/network/network-installations.d.ts.map +1 -1
  227. package/daemon/dist/domain/network/network-installations.js +42 -11
  228. package/daemon/dist/domain/network/network-installations.js.map +1 -1
  229. package/daemon/dist/domain/node-launcher.d.ts +6 -0
  230. package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
  231. package/daemon/dist/domain/node-launcher.js +10 -3
  232. package/daemon/dist/domain/node-launcher.js.map +1 -1
  233. package/daemon/dist/domain/occupant-invalidator.d.ts +4 -1
  234. package/daemon/dist/domain/occupant-invalidator.d.ts.map +1 -1
  235. package/daemon/dist/domain/occupant-invalidator.js +10 -2
  236. package/daemon/dist/domain/occupant-invalidator.js.map +1 -1
  237. package/daemon/dist/domain/operation-correlation.d.ts +1 -1
  238. package/daemon/dist/domain/operation-correlation.d.ts.map +1 -1
  239. package/daemon/dist/domain/operation-correlation.js +1 -1
  240. package/daemon/dist/domain/operation-correlation.js.map +1 -1
  241. package/daemon/dist/domain/permission-account.d.ts.map +1 -1
  242. package/daemon/dist/domain/permission-account.js +8 -6
  243. package/daemon/dist/domain/permission-account.js.map +1 -1
  244. package/daemon/dist/domain/permission-drift.d.ts.map +1 -1
  245. package/daemon/dist/domain/permission-drift.js +1 -1
  246. package/daemon/dist/domain/permission-drift.js.map +1 -1
  247. package/daemon/dist/domain/queue-destination-check.d.ts +2 -0
  248. package/daemon/dist/domain/queue-destination-check.d.ts.map +1 -1
  249. package/daemon/dist/domain/queue-destination-check.js +8 -11
  250. package/daemon/dist/domain/queue-destination-check.js.map +1 -1
  251. package/daemon/dist/domain/queue-erasure.d.ts +7 -1
  252. package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
  253. package/daemon/dist/domain/queue-erasure.js +226 -20
  254. package/daemon/dist/domain/queue-erasure.js.map +1 -1
  255. package/daemon/dist/domain/queue-repository.d.ts +39 -17
  256. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  257. package/daemon/dist/domain/queue-repository.js +96 -64
  258. package/daemon/dist/domain/queue-repository.js.map +1 -1
  259. package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
  260. package/daemon/dist/domain/queue-stuck-sweep.js +49 -21
  261. package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
  262. package/daemon/dist/domain/queue-transition-log.d.ts +6 -0
  263. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  264. package/daemon/dist/domain/queue-transition-log.js +9 -0
  265. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  266. package/daemon/dist/domain/queue-waiting.d.ts +4 -4
  267. package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
  268. package/daemon/dist/domain/queue-waiting.js +30 -16
  269. package/daemon/dist/domain/queue-waiting.js.map +1 -1
  270. package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
  271. package/daemon/dist/domain/queue-wake-ladder.js +90 -24
  272. package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
  273. package/daemon/dist/domain/receiver-context.js +1 -1
  274. package/daemon/dist/domain/receiver-context.js.map +1 -1
  275. package/daemon/dist/domain/restore-check-service.d.ts +13 -0
  276. package/daemon/dist/domain/restore-check-service.d.ts.map +1 -1
  277. package/daemon/dist/domain/restore-check-service.js +122 -9
  278. package/daemon/dist/domain/restore-check-service.js.map +1 -1
  279. package/daemon/dist/domain/restore-orchestrator.d.ts +4 -1
  280. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  281. package/daemon/dist/domain/restore-orchestrator.js +132 -48
  282. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  283. package/daemon/dist/domain/restore-preconditions.d.ts +2 -0
  284. package/daemon/dist/domain/restore-preconditions.d.ts.map +1 -1
  285. package/daemon/dist/domain/restore-preconditions.js +2 -0
  286. package/daemon/dist/domain/restore-preconditions.js.map +1 -1
  287. package/daemon/dist/domain/resume-metadata-refresher.d.ts +17 -4
  288. package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
  289. package/daemon/dist/domain/resume-metadata-refresher.js +64 -15
  290. package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
  291. package/daemon/dist/domain/resume-token-capture.d.ts +6 -0
  292. package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -1
  293. package/daemon/dist/domain/resume-token-capture.js +14 -8
  294. package/daemon/dist/domain/resume-token-capture.js.map +1 -1
  295. package/daemon/dist/domain/rig-delivery-drain.d.ts +46 -0
  296. package/daemon/dist/domain/rig-delivery-drain.d.ts.map +1 -0
  297. package/daemon/dist/domain/rig-delivery-drain.js +128 -0
  298. package/daemon/dist/domain/rig-delivery-drain.js.map +1 -0
  299. package/daemon/dist/domain/rig-edge-ops.js +1 -1
  300. package/daemon/dist/domain/rig-edge-ops.js.map +1 -1
  301. package/daemon/dist/domain/rig-lifecycle-service.d.ts.map +1 -1
  302. package/daemon/dist/domain/rig-lifecycle-service.js +4 -1
  303. package/daemon/dist/domain/rig-lifecycle-service.js.map +1 -1
  304. package/daemon/dist/domain/rig-teardown.d.ts +20 -3
  305. package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
  306. package/daemon/dist/domain/rig-teardown.js +71 -11
  307. package/daemon/dist/domain/rig-teardown.js.map +1 -1
  308. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  309. package/daemon/dist/domain/rigspec-instantiator.js +6 -2
  310. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  311. package/daemon/dist/domain/rigspec-preflight.d.ts +1 -1
  312. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  313. package/daemon/dist/domain/rigspec-preflight.js +36 -1
  314. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  315. package/daemon/dist/domain/rosters.d.ts +19 -0
  316. package/daemon/dist/domain/rosters.d.ts.map +1 -1
  317. package/daemon/dist/domain/rosters.js +69 -12
  318. package/daemon/dist/domain/rosters.js.map +1 -1
  319. package/daemon/dist/domain/runtime-adapter.d.ts +15 -0
  320. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  321. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  322. package/daemon/dist/domain/seat-delivery-guard.d.ts +8 -2
  323. package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
  324. package/daemon/dist/domain/seat-delivery-guard.js +38 -3
  325. package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
  326. package/daemon/dist/domain/seat-handover-attempts.d.ts +50 -0
  327. package/daemon/dist/domain/seat-handover-attempts.d.ts.map +1 -0
  328. package/daemon/dist/domain/seat-handover-attempts.js +75 -0
  329. package/daemon/dist/domain/seat-handover-attempts.js.map +1 -0
  330. package/daemon/dist/domain/seat-handover-service.d.ts +64 -1
  331. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  332. package/daemon/dist/domain/seat-handover-service.js +443 -29
  333. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  334. package/daemon/dist/domain/seat-launch-environment.d.ts +3 -2
  335. package/daemon/dist/domain/seat-launch-environment.d.ts.map +1 -1
  336. package/daemon/dist/domain/seat-launch-environment.js +16 -4
  337. package/daemon/dist/domain/seat-launch-environment.js.map +1 -1
  338. package/daemon/dist/domain/seat-lifecycle-service.d.ts +47 -2
  339. package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
  340. package/daemon/dist/domain/seat-lifecycle-service.js +48 -2
  341. package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
  342. package/daemon/dist/domain/seat-runtime-home-record-types.d.ts +16 -0
  343. package/daemon/dist/domain/seat-runtime-home-record-types.d.ts.map +1 -0
  344. package/daemon/dist/domain/seat-runtime-home-record-types.js +2 -0
  345. package/daemon/dist/domain/seat-runtime-home-record-types.js.map +1 -0
  346. package/daemon/dist/domain/seat-runtime-home-record.d.ts +173 -0
  347. package/daemon/dist/domain/seat-runtime-home-record.d.ts.map +1 -0
  348. package/daemon/dist/domain/seat-runtime-home-record.js +317 -0
  349. package/daemon/dist/domain/seat-runtime-home-record.js.map +1 -0
  350. package/daemon/dist/domain/seat-runtime-switch-service.d.ts +7 -0
  351. package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
  352. package/daemon/dist/domain/seat-runtime-switch-service.js +47 -2
  353. package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
  354. package/daemon/dist/domain/seat-skill-storage.d.ts +16 -1
  355. package/daemon/dist/domain/seat-skill-storage.d.ts.map +1 -1
  356. package/daemon/dist/domain/seat-skill-storage.js +178 -1
  357. package/daemon/dist/domain/seat-skill-storage.js.map +1 -1
  358. package/daemon/dist/domain/session-name.d.ts +13 -0
  359. package/daemon/dist/domain/session-name.d.ts.map +1 -1
  360. package/daemon/dist/domain/session-name.js +77 -0
  361. package/daemon/dist/domain/session-name.js.map +1 -1
  362. package/daemon/dist/domain/session-registry.d.ts +7 -1
  363. package/daemon/dist/domain/session-registry.d.ts.map +1 -1
  364. package/daemon/dist/domain/session-registry.js +7 -4
  365. package/daemon/dist/domain/session-registry.js.map +1 -1
  366. package/daemon/dist/domain/session-transport.d.ts +1 -0
  367. package/daemon/dist/domain/session-transport.d.ts.map +1 -1
  368. package/daemon/dist/domain/session-transport.js +33 -9
  369. package/daemon/dist/domain/session-transport.js.map +1 -1
  370. package/daemon/dist/domain/shared-history-selection.d.ts +1 -0
  371. package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
  372. package/daemon/dist/domain/shared-history-selection.js +3 -1
  373. package/daemon/dist/domain/shared-history-selection.js.map +1 -1
  374. package/daemon/dist/domain/skill-catalog.d.ts +3 -0
  375. package/daemon/dist/domain/skill-catalog.d.ts.map +1 -1
  376. package/daemon/dist/domain/skill-catalog.js +7 -3
  377. package/daemon/dist/domain/skill-catalog.js.map +1 -1
  378. package/daemon/dist/domain/snapshot-capture.d.ts +4 -1
  379. package/daemon/dist/domain/snapshot-capture.d.ts.map +1 -1
  380. package/daemon/dist/domain/snapshot-capture.js +24 -12
  381. package/daemon/dist/domain/snapshot-capture.js.map +1 -1
  382. package/daemon/dist/domain/startup-submission-evidence.d.ts.map +1 -1
  383. package/daemon/dist/domain/startup-submission-evidence.js +3 -2
  384. package/daemon/dist/domain/startup-submission-evidence.js.map +1 -1
  385. package/daemon/dist/domain/successor-session-launcher.d.ts +16 -0
  386. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  387. package/daemon/dist/domain/successor-session-launcher.js +70 -38
  388. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  389. package/daemon/dist/domain/types.d.ts +43 -2
  390. package/daemon/dist/domain/types.d.ts.map +1 -1
  391. package/daemon/dist/domain/types.js.map +1 -1
  392. package/daemon/dist/domain/user-settings/settings-browser.d.ts.map +1 -1
  393. package/daemon/dist/domain/user-settings/settings-browser.js +3 -1
  394. package/daemon/dist/domain/user-settings/settings-browser.js.map +1 -1
  395. package/daemon/dist/domain/user-settings/settings-store.d.ts +1 -1
  396. package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
  397. package/daemon/dist/domain/user-settings/settings-store.js +6 -0
  398. package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
  399. package/daemon/dist/domain/watchdog-policy-engine.d.ts +4 -0
  400. package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
  401. package/daemon/dist/domain/watchdog-policy-engine.js +28 -1
  402. package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
  403. package/daemon/dist/domain/workflow-exception-escalation.d.ts.map +1 -1
  404. package/daemon/dist/domain/workflow-exception-escalation.js +13 -8
  405. package/daemon/dist/domain/workflow-exception-escalation.js.map +1 -1
  406. package/daemon/dist/domain/workflow-instance-store.d.ts +14 -2
  407. package/daemon/dist/domain/workflow-instance-store.d.ts.map +1 -1
  408. package/daemon/dist/domain/workflow-instance-store.js +41 -4
  409. package/daemon/dist/domain/workflow-instance-store.js.map +1 -1
  410. package/daemon/dist/domain/workflow-projector.d.ts +55 -0
  411. package/daemon/dist/domain/workflow-projector.d.ts.map +1 -1
  412. package/daemon/dist/domain/workflow-projector.js +355 -174
  413. package/daemon/dist/domain/workflow-projector.js.map +1 -1
  414. package/daemon/dist/domain/workflow-reconciliation.d.ts +7 -1
  415. package/daemon/dist/domain/workflow-reconciliation.d.ts.map +1 -1
  416. package/daemon/dist/domain/workflow-reconciliation.js +51 -13
  417. package/daemon/dist/domain/workflow-reconciliation.js.map +1 -1
  418. package/daemon/dist/domain/workflow-runtime.d.ts +11 -3
  419. package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
  420. package/daemon/dist/domain/workflow-runtime.js +141 -27
  421. package/daemon/dist/domain/workflow-runtime.js.map +1 -1
  422. package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
  423. package/daemon/dist/lib/pane-envelope.js +12 -7
  424. package/daemon/dist/lib/pane-envelope.js.map +1 -1
  425. package/daemon/dist/routes/compaction.d.ts.map +1 -1
  426. package/daemon/dist/routes/compaction.js +6 -3
  427. package/daemon/dist/routes/compaction.js.map +1 -1
  428. package/daemon/dist/routes/queue.d.ts.map +1 -1
  429. package/daemon/dist/routes/queue.js +78 -31
  430. package/daemon/dist/routes/queue.js.map +1 -1
  431. package/daemon/dist/routes/restore-check.d.ts.map +1 -1
  432. package/daemon/dist/routes/restore-check.js +17 -0
  433. package/daemon/dist/routes/restore-check.js.map +1 -1
  434. package/daemon/dist/routes/rig-delivery-drain.d.ts +3 -0
  435. package/daemon/dist/routes/rig-delivery-drain.d.ts.map +1 -0
  436. package/daemon/dist/routes/rig-delivery-drain.js +46 -0
  437. package/daemon/dist/routes/rig-delivery-drain.js.map +1 -0
  438. package/daemon/dist/routes/scopes.d.ts.map +1 -1
  439. package/daemon/dist/routes/scopes.js +102 -19
  440. package/daemon/dist/routes/scopes.js.map +1 -1
  441. package/daemon/dist/routes/seat.d.ts.map +1 -1
  442. package/daemon/dist/routes/seat.js +50 -2
  443. package/daemon/dist/routes/seat.js.map +1 -1
  444. package/daemon/dist/routes/sessions.d.ts.map +1 -1
  445. package/daemon/dist/routes/sessions.js +54 -10
  446. package/daemon/dist/routes/sessions.js.map +1 -1
  447. package/daemon/dist/routes/startup.d.ts.map +1 -1
  448. package/daemon/dist/routes/startup.js +230 -40
  449. package/daemon/dist/routes/startup.js.map +1 -1
  450. package/daemon/dist/routes/transport.d.ts.map +1 -1
  451. package/daemon/dist/routes/transport.js +36 -2
  452. package/daemon/dist/routes/transport.js.map +1 -1
  453. package/daemon/dist/routes/up.js +2 -0
  454. package/daemon/dist/routes/up.js.map +1 -1
  455. package/daemon/dist/routes/watchdog.d.ts.map +1 -1
  456. package/daemon/dist/routes/watchdog.js +7 -1
  457. package/daemon/dist/routes/watchdog.js.map +1 -1
  458. package/daemon/dist/routes/workflow.d.ts.map +1 -1
  459. package/daemon/dist/routes/workflow.js +23 -5
  460. package/daemon/dist/routes/workflow.js.map +1 -1
  461. package/daemon/dist/server.d.ts.map +1 -1
  462. package/daemon/dist/server.js +2 -0
  463. package/daemon/dist/server.js.map +1 -1
  464. package/daemon/dist/startup.d.ts.map +1 -1
  465. package/daemon/dist/startup.js +111 -37
  466. package/daemon/dist/startup.js.map +1 -1
  467. package/daemon/docs/reference/agent-startup-guide.md +90 -2
  468. package/daemon/docs/reference/daemon-http-clients.md +69 -0
  469. package/daemon/docs/reference/developing.md +1 -1
  470. package/daemon/docs/reference/gateway-participants.md +5 -3
  471. package/daemon/docs/reference/getting-started.md +12 -11
  472. package/daemon/docs/reference/hosted-members.md +4 -2
  473. package/daemon/docs/reference/network-connector.md +4 -3
  474. package/daemon/docs/reference/queue-erasure.md +16 -1
  475. package/daemon/docs/reference/quickstart.md +2 -2
  476. package/daemon/docs/reference/rig-spec.md +92 -4
  477. package/daemon/docs/reference/rosters.md +26 -0
  478. package/daemon/docs/reference/seat-delivery.md +7 -1
  479. package/daemon/docs/reference/whats-new.md +397 -5
  480. package/daemon/specs/agents/shared/skills/core/openrig-software-factory/references/worked-example.md +1 -1
  481. package/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md +2 -0
  482. package/daemon/specs/agents/shared/skills/core/working-with-an-openrig-team/SKILL.md +22 -6
  483. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +78 -18
  484. package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +9 -6
  485. package/dist/build-info.js +3 -3
  486. package/dist/client.d.ts +7 -3
  487. package/dist/client.d.ts.map +1 -1
  488. package/dist/client.js +11 -2
  489. package/dist/client.js.map +1 -1
  490. package/dist/commands/config.d.ts.map +1 -1
  491. package/dist/commands/config.js +2 -0
  492. package/dist/commands/config.js.map +1 -1
  493. package/dist/commands/down.d.ts.map +1 -1
  494. package/dist/commands/down.js +5 -1
  495. package/dist/commands/down.js.map +1 -1
  496. package/dist/commands/environment.js +1 -1
  497. package/dist/commands/environment.js.map +1 -1
  498. package/dist/commands/launch.d.ts.map +1 -1
  499. package/dist/commands/launch.js +8 -0
  500. package/dist/commands/launch.js.map +1 -1
  501. package/dist/commands/mcp.d.ts.map +1 -1
  502. package/dist/commands/mcp.js +18 -1
  503. package/dist/commands/mcp.js.map +1 -1
  504. package/dist/commands/network.d.ts +2 -0
  505. package/dist/commands/network.d.ts.map +1 -1
  506. package/dist/commands/network.js +14 -1
  507. package/dist/commands/network.js.map +1 -1
  508. package/dist/commands/ps.d.ts.map +1 -1
  509. package/dist/commands/ps.js +11 -5
  510. package/dist/commands/ps.js.map +1 -1
  511. package/dist/commands/queue.d.ts +1 -1
  512. package/dist/commands/queue.d.ts.map +1 -1
  513. package/dist/commands/queue.js +49 -12
  514. package/dist/commands/queue.js.map +1 -1
  515. package/dist/commands/restore.d.ts.map +1 -1
  516. package/dist/commands/restore.js +6 -1
  517. package/dist/commands/restore.js.map +1 -1
  518. package/dist/commands/roster.d.ts +4 -2
  519. package/dist/commands/roster.d.ts.map +1 -1
  520. package/dist/commands/roster.js +2 -2
  521. package/dist/commands/roster.js.map +1 -1
  522. package/dist/commands/seat.d.ts +2 -0
  523. package/dist/commands/seat.d.ts.map +1 -1
  524. package/dist/commands/seat.js +201 -14
  525. package/dist/commands/seat.js.map +1 -1
  526. package/dist/commands/send.d.ts.map +1 -1
  527. package/dist/commands/send.js +31 -6
  528. package/dist/commands/send.js.map +1 -1
  529. package/dist/commands/setup.d.ts.map +1 -1
  530. package/dist/commands/setup.js +5 -3
  531. package/dist/commands/setup.js.map +1 -1
  532. package/dist/commands/up.d.ts.map +1 -1
  533. package/dist/commands/up.js +7 -0
  534. package/dist/commands/up.js.map +1 -1
  535. package/dist/commands/walk.d.ts.map +1 -1
  536. package/dist/commands/walk.js +4 -0
  537. package/dist/commands/walk.js.map +1 -1
  538. package/dist/commands/workflow.d.ts.map +1 -1
  539. package/dist/commands/workflow.js +30 -4
  540. package/dist/commands/workflow.js.map +1 -1
  541. package/dist/config-store.d.ts +3 -1
  542. package/dist/config-store.d.ts.map +1 -1
  543. package/dist/config-store.js +5 -0
  544. package/dist/config-store.js.map +1 -1
  545. package/dist/lib/bundle-check.d.ts.map +1 -1
  546. package/dist/lib/bundle-check.js +33 -3
  547. package/dist/lib/bundle-check.js.map +1 -1
  548. package/dist/mcp-http.d.ts +3 -0
  549. package/dist/mcp-http.d.ts.map +1 -1
  550. package/dist/mcp-http.js +13 -0
  551. package/dist/mcp-http.js.map +1 -1
  552. package/dist/mcp-server.d.ts +9 -2
  553. package/dist/mcp-server.d.ts.map +1 -1
  554. package/dist/mcp-server.js +287 -69
  555. package/dist/mcp-server.js.map +1 -1
  556. package/dist/person-registration-offer.d.ts.map +1 -1
  557. package/dist/person-registration-offer.js +2 -1
  558. package/dist/person-registration-offer.js.map +1 -1
  559. package/package.json +2 -2
  560. package/tui/dist/commands/registry.d.ts.map +1 -1
  561. package/tui/dist/commands/registry.js +1 -0
  562. package/tui/dist/commands/registry.js.map +1 -1
  563. package/tui/dist/config/config-model.js +1 -1
  564. package/tui/dist/config/config-model.js.map +1 -1
  565. package/tui/dist/crash-cart/start-daemon.d.ts.map +1 -1
  566. package/tui/dist/crash-cart/start-daemon.js +4 -2
  567. package/tui/dist/crash-cart/start-daemon.js.map +1 -1
  568. package/tui/dist/daemon-client.d.ts +12 -1
  569. package/tui/dist/daemon-client.d.ts.map +1 -1
  570. package/tui/dist/daemon-client.js +44 -2
  571. package/tui/dist/daemon-client.js.map +1 -1
  572. package/tui/dist/hydrate.d.ts +1 -1
  573. package/tui/dist/hydrate.d.ts.map +1 -1
  574. package/tui/dist/hydrate.js +43 -1
  575. package/tui/dist/hydrate.js.map +1 -1
  576. package/tui/dist/main.js +3 -0
  577. package/tui/dist/main.js.map +1 -1
  578. package/tui/dist/page-read.d.ts.map +1 -1
  579. package/tui/dist/page-read.js +2 -1
  580. package/tui/dist/page-read.js.map +1 -1
  581. package/tui/dist/render.d.ts.map +1 -1
  582. package/tui/dist/render.js +110 -16
  583. package/tui/dist/render.js.map +1 -1
  584. package/tui/dist/scopes/fleet-scopes-model.d.ts +73 -0
  585. package/tui/dist/scopes/fleet-scopes-model.d.ts.map +1 -0
  586. package/tui/dist/scopes/fleet-scopes-model.js +102 -0
  587. package/tui/dist/scopes/fleet-scopes-model.js.map +1 -0
  588. package/tui/dist/scopes/scopes-model.d.ts +2 -0
  589. package/tui/dist/scopes/scopes-model.d.ts.map +1 -1
  590. package/tui/dist/scopes/scopes-model.js +7 -4
  591. package/tui/dist/scopes/scopes-model.js.map +1 -1
  592. package/tui/dist/sections.d.ts.map +1 -1
  593. package/tui/dist/sections.js +5 -0
  594. package/tui/dist/sections.js.map +1 -1
  595. package/tui/dist/startup.d.ts +5 -0
  596. package/tui/dist/startup.d.ts.map +1 -1
  597. package/tui/dist/startup.js +12 -0
  598. package/tui/dist/startup.js.map +1 -1
  599. package/tui/dist/state.d.ts.map +1 -1
  600. package/tui/dist/state.js +12 -5
  601. package/tui/dist/state.js.map +1 -1
  602. package/tui/dist/types.d.ts +18 -1
  603. package/tui/dist/types.d.ts.map +1 -1
@@ -1,6 +1,8 @@
1
+ import { RigDeliveryDrainStore } from "./rig-delivery-drain.js";
1
2
  import { PROMPT_ALERT_TAG, readWakeLadderBackstop } from "./queue-wake-ladder.js";
2
3
  import { withUrgentLine } from "./urgent-line.js";
3
4
  import { quietCustodyBackstop, quietHoldCustody } from "./quiet-hold-custody.js";
5
+ import { cooperativeReadFile, readRowsCooperatively } from "./execution-candidate-reader.js";
4
6
  import { createHash } from "node:crypto";
5
7
  import { loadHumanRegistry, registeredPeople, resolveRegisteredHumanAddress, slackSubscriptionFor, withHumanAlertTag } from "./gateway/human-registry.js";
6
8
  import { DispatchBuffer } from "./gateway/dispatch-buffer.js";
@@ -31,7 +33,7 @@ import { parseSessionName, isHumanSeatSessionRef } from "./session-name.js";
31
33
  import { runnerPermissionOrigin } from "./runner-permissions.js";
32
34
  import { isHostPairingAsk } from "./hosts/pairing-ask.js";
33
35
  import { parseReplyToChoice, parseArrivalThread, parseReplyToThreadMissing, formatReplyToChoice, describeReplyToFallback, REPLY_TO_CHOICE_ACTOR } from "./reply-to-choice.js";
34
- import { classifyDestination } from "./gateway/destination-resolver.js";
36
+ import { classifyDestination, recordsNoWakeRoute } from "./gateway/destination-resolver.js";
35
37
  import { join } from "node:path";
36
38
  import { SettingsStore } from "./user-settings/settings-store.js";
37
39
  import { hostedMembersAt, hostedWakeFor, isHostedMemberAt } from "./rosters.js";
@@ -539,10 +541,12 @@ function isWakeTimeoutSignal(s) {
539
541
  }
540
542
  export class QueueRepository {
541
543
  db;
544
+ deliveryDrains;
542
545
  transitionLog;
543
546
  eventBus;
544
547
  destinationAdvisory;
545
548
  validateRig;
549
+ canRecordDestination;
546
550
  transport;
547
551
  /** W1 (transactional closure): the durable wake-intent store. A terminal act
548
552
  * (handoff / handoff-and-complete) stages an outbox intent row INSIDE its
@@ -606,10 +610,12 @@ export class QueueRepository {
606
610
  workflowFrontierPredicate;
607
611
  constructor(db, eventBus, opts) {
608
612
  this.db = db;
613
+ this.deliveryDrains = new RigDeliveryDrainStore(db);
609
614
  this.eventBus = eventBus;
610
615
  this.transitionLog = new QueueTransitionLog(db);
611
616
  this.wakeRepo = new QueueWakeRepository(db);
612
617
  this.validateRig = opts?.validateRig ?? (() => true);
618
+ this.canRecordDestination = opts?.canRecordDestination ?? this.validateRig;
613
619
  this.destinationAdvisory = opts?.destinationAdvisory ?? (() => null);
614
620
  if (opts?.transport)
615
621
  this.attachTransport(opts.transport);
@@ -988,13 +994,15 @@ export class QueueRepository {
988
994
  return "skipped";
989
995
  const alreadyHeld = this.outbox.getById(outboxId);
990
996
  if (alreadyHeld?.deliveryState === "retained" || alreadyHeld?.deliveryState === "retired") {
997
+ if (this.deliveryDrains.holds(alreadyHeld.destinationSession))
998
+ return "retained";
991
999
  if (alreadyHeld.auditPointer)
992
1000
  this.recordNudgeAttempt(alreadyHeld.auditPointer, "retained:typing_guard");
993
1001
  return "retained";
994
1002
  }
995
1003
  let recovering = false;
996
1004
  const claim = (entry) => {
997
- if (!eligible(entry) || attempted.has(entry.outboxId) || !this.outbox.claimForDelivery(entry.outboxId))
1005
+ if (this.deliveryDrains.holds(entry.destinationSession) || !eligible(entry) || attempted.has(entry.outboxId) || !this.outbox.claimForDelivery(entry.outboxId))
998
1006
  return false;
999
1007
  this.bindFirstTarget(entry);
1000
1008
  attempted.add(entry.outboxId);
@@ -1003,6 +1011,8 @@ export class QueueRepository {
1003
1011
  };
1004
1012
  let superseded = false;
1005
1013
  const actionable = (entry) => {
1014
+ if (!eligible(entry))
1015
+ return false;
1006
1016
  const current = this.currentWakeIntent(entry);
1007
1017
  if (!current) {
1008
1018
  // Existing failed state means the requested old delivery was refused;
@@ -1206,18 +1216,19 @@ export class QueueRepository {
1206
1216
  const BATCH = 200;
1207
1217
  const horizon = this.db.prepare("SELECT COALESCE(MAX(rowid),0) AS id FROM outbox_entries").get().id;
1208
1218
  // Retire never-attempted obsolete notifications without materializing historical intents.
1209
- tally.failed += this.db.prepare(`UPDATE outbox_entries AS o SET delivery_state = 'failed',
1219
+ if (!opts?.eligible)
1220
+ tally.failed += this.db.prepare(`UPDATE outbox_entries AS o SET delivery_state = 'failed',
1210
1221
  tags = json_insert(COALESCE(tags, '[]'), '$[#]', 'queue:wake-superseded')
1211
1222
  WHERE delivery_state = 'pending' AND rowid <= ? AND substr(outbox_id, 1, ?) = ?
1212
1223
  AND substr(outbox_id, 1, ?) != ?
1213
1224
  AND NOT EXISTS (SELECT 1 FROM queue_items q WHERE q.qitem_id = o.audit_pointer
1214
1225
  AND q.state = 'pending' AND q.destination_session = o.destination_session)`)
1215
- .run(horizon, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX, CLAIM_OVERRIDDEN_WAKE_PREFIX.length, CLAIM_OVERRIDDEN_WAKE_PREFIX).changes;
1226
+ .run(horizon, WAKE_INTENT_PREFIX.length, WAKE_INTENT_PREFIX, CLAIM_OVERRIDDEN_WAKE_PREFIX.length, CLAIM_OVERRIDDEN_WAKE_PREFIX).changes;
1216
1227
  // A stop also refuses every later claim inside a delivery: coalesced peers and members it releases for their own send.
1217
1228
  // So does a missing receiver, for a notification already tried. One never tried still gets its attempt, so its row
1218
1229
  // records why it didn't land.
1219
1230
  const eligible = (entry) => {
1220
- if (opts?.stopRequested?.())
1231
+ if (opts?.stopRequested?.() || opts?.eligible && !opts.eligible(entry))
1221
1232
  return false;
1222
1233
  if (entry.deliveryState === "pending" || !this.wakeHasNoReceiver(entry.destinationSession))
1223
1234
  return true;
@@ -1292,9 +1303,11 @@ export class QueueRepository {
1292
1303
  * copies were deleted, refused at the seat boundary instead); this
1293
1304
  * site holds no copy of its own.
1294
1305
  */
1295
- async maybeNudge(qitemId, destinationSession, nudgeOpt, sourceSession, bodyOverride, trigger = "agent") {
1306
+ async maybeNudge(qitemId, destinationSession, nudgeOpt, sourceSession, bodyOverride, trigger = "agent", opts) {
1296
1307
  if (nudgeOpt === false)
1297
1308
  return;
1309
+ if (!opts?.explicit && this.deliveryDrains.holds(destinationSession))
1310
+ return;
1298
1311
  if (!this.transport)
1299
1312
  return;
1300
1313
  const outcome = await this.performWakeSend(qitemId, destinationSession, sourceSession, bodyOverride, undefined, undefined, trigger);
@@ -1302,6 +1315,7 @@ export class QueueRepository {
1302
1315
  }
1303
1316
  /** The following startup intent drain owns durable pending wakes. Legacy packets
1304
1317
  * and overdue claimed work (not eligible for that drain) still use the nudge path. */
1318
+ // Held workflow boot packets remain owed: their keepalive resumes after END; the sweep reports unclaimed work.
1305
1319
  async recoverLostNudge(qitemId, destinationSession, sourceSession) {
1306
1320
  const outboxId = `${WAKE_INTENT_PREFIX}${qitemId}`;
1307
1321
  if (this.outbox?.getById(outboxId) && this.getById(qitemId)?.state === "pending")
@@ -1323,6 +1337,8 @@ export class QueueRepository {
1323
1337
  }
1324
1338
  if (state !== "running" && state !== "idle")
1325
1339
  return;
1340
+ if (addresses.some(address => this.deliveryDrains.holds(address)))
1341
+ return;
1326
1342
  if (addresses.every(address => this.promptRecoveryState.get(address) === false))
1327
1343
  return;
1328
1344
  // A compaction's "Compacted" is also a clear. While its turn boundary, restore or audit is still owed, a retried wake
@@ -1389,7 +1405,7 @@ export class QueueRepository {
1389
1405
  * gateway, not held or released for quiet hours, and its seat now pane-bound. A handoff's retry ladder is the
1390
1406
  * caller's to check: the sweep defers to a live ladder, the reachable-seat retry leaves every handed-off row to it. */
1391
1407
  unroutableWakeRetryable(row, now = new Date()) {
1392
- return row.lastNudgeResult?.startsWith("unroutable:") === true
1408
+ return recordsNoWakeRoute(row.lastNudgeResult)
1393
1409
  && !row.claimedAt
1394
1410
  && row.deliveryOutcome !== "never-posted" && row.deliveryOutcome !== "transport-failed"
1395
1411
  && !this.isLocalHumanDecisionWithoutGateway(row)
@@ -1405,12 +1421,15 @@ export class QueueRepository {
1405
1421
  const addresses = this.resolveSessionAddresses(sessionName);
1406
1422
  if (!addresses.length)
1407
1423
  return;
1424
+ if (addresses.some(address => this.deliveryDrains.holds(address)))
1425
+ return;
1408
1426
  // As for a prompt clear (#2575): while a compaction's restore is owed, the wake would reach the agent before it.
1409
1427
  if ([sessionName, ...addresses].some(address => this.hasPendingPostCompactStage?.(address)))
1410
1428
  return;
1411
1429
  const rows = this.db.prepare(`SELECT qitem_id FROM queue_items
1412
1430
  WHERE destination_session IN (${addresses.map(() => "?").join(",")}) AND state = 'pending'
1413
- AND handed_off_from IS NULL AND last_nudge_result LIKE 'unroutable:%' ORDER BY ts_created, qitem_id`)
1431
+ AND handed_off_from IS NULL AND (last_nudge_result LIKE 'unroutable:%' OR last_nudge_result LIKE 'awaiting-pickup:%')
1432
+ ORDER BY ts_created, qitem_id`)
1414
1433
  .all(...addresses);
1415
1434
  const now = new Date();
1416
1435
  // One attempt per intent for the pass: a returned result and its resume go as one send, so the second row's turn
@@ -1663,7 +1682,7 @@ export class QueueRepository {
1663
1682
  // instance. Host identity is added only at the cross-host forwarding boundary
1664
1683
  // (routes/queue.ts stamp-at-FORWARD), and a genuine origin triple arriving from a
1665
1684
  // forward is stored verbatim (never re-stamped, never stripped).
1666
- if (!this.validateRig(input.destinationSession)) {
1685
+ if (!this.canRecordDestination(input.destinationSession)) {
1667
1686
  throw destinationValidationError("destination_session", input.destinationSession, this.loadHumanRegistryFn);
1668
1687
  }
1669
1688
  let wakeStaged = false;
@@ -1765,7 +1784,7 @@ export class QueueRepository {
1765
1784
  * compose with an outer transaction, use create() instead.
1766
1785
  */
1767
1786
  createWithinTransaction(input) {
1768
- if (!this.validateRig(input.destinationSession)) {
1787
+ if (!this.canRecordDestination(input.destinationSession)) {
1769
1788
  throw destinationValidationError("destination_session", input.destinationSession, this.loadHumanRegistryFn);
1770
1789
  }
1771
1790
  const result = this.createInTransactionalContext(input);
@@ -1950,7 +1969,7 @@ export class QueueRepository {
1950
1969
  return registry.ok && resolveRegisteredHumanAddress(destination, registry.entities) !== null;
1951
1970
  }
1952
1971
  /** The registered person an address names, so an ask back reaches them; null for anyone else, the unattributed
1953
- * terminal actor included (it's a person address, but nothing is delivered there). */
1972
+ * terminal actor included (a person address, but a row there asks no one; it waits on Steering and in the Feed, and OpenRig reports it as undeliverable). */
1954
1973
  reachablePerson(address) {
1955
1974
  if (!address || address === UNATTRIBUTED_ACTOR)
1956
1975
  return null;
@@ -2018,7 +2037,7 @@ export class QueueRepository {
2018
2037
  if (isTerminalState(source.state)) {
2019
2038
  throw new QueueRepositoryError("qitem_already_terminal", `qitem ${input.qitemId} is already in terminal state ${source.state}`);
2020
2039
  }
2021
- if (!this.validateRig(input.toSession)) {
2040
+ if (!this.canRecordDestination(input.toSession)) {
2022
2041
  throw destinationValidationError("to_session", input.toSession, this.loadHumanRegistryFn);
2023
2042
  }
2024
2043
  this.assertHumanAlert(input.humanAlert, input.toSession);
@@ -2177,7 +2196,7 @@ export class QueueRepository {
2177
2196
  if (isTerminalState(source.state)) {
2178
2197
  throw new QueueRepositoryError("qitem_already_terminal", `qitem ${input.qitemId} is already in terminal state ${source.state}`);
2179
2198
  }
2180
- if (!this.validateRig(input.toSession)) {
2199
+ if (!this.canRecordDestination(input.toSession)) {
2181
2200
  throw destinationValidationError("to_session", input.toSession, this.loadHumanRegistryFn);
2182
2201
  }
2183
2202
  this.assertHumanAlert(input.humanAlert, input.toSession);
@@ -2683,6 +2702,7 @@ export class QueueRepository {
2683
2702
  }
2684
2703
  const hasNote = typeof input.transitionNote === "string" && input.transitionNote.trim().length > 0;
2685
2704
  const hasValidSummary = typeof input.summary === "string" && input.summary.trim().length > 0;
2705
+ const hasValidEvidenceRef = typeof input.evidenceRef === "string" && input.evidenceRef.trim().length > 0;
2686
2706
  const isGuardedTerminal = ["done", "canceled", "handed-off"].includes(qitem.state);
2687
2707
  const isStatePreservingAppend = input.state === undefined || (isGuardedTerminal && input.state === qitem.state)
2688
2708
  || (hasReestimate && input.state === qitem.state);
@@ -2837,31 +2857,14 @@ export class QueueRepository {
2837
2857
  throw new QueueRepositoryError("invalid_human_notification", "An informational delivery cannot become a human approval park; author a separate decision request.");
2838
2858
  }
2839
2859
  // A park on a person by any address (a legacy human seat, or a registered person's own address or alias) keeps the
2840
- // summary and evidence it names. validateHumanPark still requires them only for the legacy human-seat form.
2860
+ // summary and evidence it names, or the row's own where it names a blank one. validateHumanPark still requires them
2861
+ // only for the legacy human-seat form.
2841
2862
  const isHumanPark = input.state === "blocked" && !!effectiveBlockedOn && this.isPersonAddress(effectiveBlockedOn);
2842
- // A done close can also store the artifact the work produced, so the finished row carries its link.
2843
- const isDoneClose = input.state === "done";
2844
- // OPR.0.5.1 slice-51-06 D2 — summary/evidence_ref are persist-able ONLY at a human-seat park
2845
- // (see the FR-6 note below). Silently ignoring them on any other transition is a data-loss trap
2846
- // (the operator believes the metadata was saved). HARD-REJECT before ANY UPDATE/log/event so the
2847
- // caller learns immediately and nothing is half-applied. null/undefined = absent (allowed);
2848
- // empty string = present (a deliberate value → rejected on a non-park transition).
2849
- if (!isHumanPark) {
2850
- const invalidFields = [];
2851
- if (input.summary != null)
2852
- invalidFields.push("summary");
2853
- if (input.evidenceRef != null && !isDoneClose)
2854
- invalidFields.push("evidenceRef");
2855
- if (invalidFields.length > 0) {
2856
- const flags = invalidFields.map((f) => (f === "summary" ? "--summary" : "--evidence-ref")).join(" / ");
2857
- const where = invalidFields.map((f) => f === "summary"
2858
- ? "summary persists on a human-seat park, or on its own (rig queue update <id> --summary … with no --state)"
2859
- : "evidenceRef persists on a human-seat park or a done close").join("; ");
2860
- throw new QueueRepositoryError("summary_evidence_not_persistable", `${where}; the '${input.state}' transition cannot store ${invalidFields.length > 1 ? "them" : "it"}. Remove ${flags}, or use one of those.`, { invalidFields });
2861
- }
2862
- }
2863
- // SWEEP-a (shape f2576102) — closure/blocked-field COHERENCE, beside the reference
2864
- // reject above: an incoherent field must never silently persist (worse than a drop —
2863
+ // OPR.0.5.1 slice-51-06 D2 refused the whole transition when summary/evidence_ref came with a state it
2864
+ // didn't store them for, so finished work could stay pending over optional metadata. A state change now
2865
+ // stores them (below), except a blank value; the route reports what wasn't stored.
2866
+ // SWEEP-a (shape f2576102) — closure/blocked-field COHERENCE: an incoherent
2867
+ // field must never silently persist (worse than a drop —
2865
2868
  // the COALESCE below would write it). Admits-map, derived from LIVE schema use:
2866
2869
  // closure_reason/closure_target → state "done", OR the PARK-RECORD form
2867
2870
  // (state "blocked" with closureReason "blocked_on" — the workflow gate/park
@@ -2915,8 +2918,8 @@ export class QueueRepository {
2915
2918
  let effectiveSummary = qitem.summary;
2916
2919
  let effectiveEvidenceRef = qitem.evidenceRef;
2917
2920
  if (isHumanPark) {
2918
- effectiveSummary = input.summary ?? qitem.summary;
2919
- effectiveEvidenceRef = input.evidenceRef ?? qitem.evidenceRef;
2921
+ effectiveSummary = hasValidSummary ? input.summary : qitem.summary;
2922
+ effectiveEvidenceRef = hasValidEvidenceRef ? input.evidenceRef : qitem.evidenceRef;
2920
2923
  const park = validateHumanPark({
2921
2924
  blockedOn: effectiveBlockedOn,
2922
2925
  summary: effectiveSummary,
@@ -3023,16 +3026,15 @@ export class QueueRepository {
3023
3026
  resolution = ?
3024
3027
  WHERE qitem_id = ?`)
3025
3028
  .run(input.state, ts, validation.closureReason, validation.closureTarget, input.handedOffTo ?? null, nextBlockedOn, nextResolution, input.qitemId);
3026
- // FR-6: park-time summary/evidence_ref are PERSISTED onto the existing
3027
- // item (not merely validated-then-dropped) — visible to the attention
3028
- // query and to Packet 2. A done close writes evidence_ref the same way.
3029
- if (isHumanPark) {
3030
- this.persistSummary(input.qitemId, input.summary ?? null);
3031
- this.persistEvidenceRef(input.qitemId, input.evidenceRef ?? null);
3032
- }
3033
- else if (isDoneClose) {
3034
- this.persistEvidenceRef(input.qitemId, input.evidenceRef ?? null);
3035
- }
3029
+ // FR-6: summary/evidence_ref are PERSISTED onto the existing item (not
3030
+ // merely validated-then-dropped) — visible to the attention query, to
3031
+ // Packet 2 and to every reader of the row. Only non-blank values are
3032
+ // stored, on a park on a person too: a blank one would erase the row's
3033
+ // subject or evidence link, and the route reports it as not stored.
3034
+ if (hasValidSummary)
3035
+ this.persistSummary(input.qitemId, input.summary);
3036
+ if (hasValidEvidenceRef)
3037
+ this.persistEvidenceRef(input.qitemId, input.evidenceRef);
3036
3038
  const transition = this.transitionLog.append({
3037
3039
  qitemId: input.qitemId,
3038
3040
  state: input.state,
@@ -3114,9 +3116,9 @@ export class QueueRepository {
3114
3116
  closureReason: validation.closureReason ?? null,
3115
3117
  closureTarget: validation.closureTarget ?? null,
3116
3118
  actorSession: input.actorSession,
3117
- // FR-1 × FR-6: the event carries the summary as of THIS mutation
3119
+ // FR-1 × FR-6: the event carries the summary as stored by THIS mutation
3118
3120
  // (park-time summary included) so surfaces refresh without a fetch.
3119
- summary: effectiveSummary ?? null,
3121
+ summary: this.getById(input.qitemId)?.summary ?? null,
3120
3122
  });
3121
3123
  return { persistedEvent, persistedEvents: [...dependentEvents, persistedEvent] };
3122
3124
  }
@@ -3687,9 +3689,11 @@ export class QueueRepository {
3687
3689
  return posted !== null && answered !== null && answered > posted;
3688
3690
  }
3689
3691
  /** A park's current question: its latest human-required transition, and that notification's final post receipt, if any. */
3690
- /** The opaque revision of what a person decides on (#2446): the question (body, intent, questions) and its decision state
3691
- * (open, blocked or terminal; who it's addressed to or parked on; its answers, a decision made for them, the current park,
3692
- * and the replies returned). A label, a wake, a claim or a note on a park doesn't change it; a new park does, on any blocker. */
3692
+ /** The opaque revision of what a person decides on (#2446): the question (body, intent, questions, and the evidence it
3693
+ * points to, when it has any) and its decision state (open, blocked or terminal; who it's addressed to or parked on; its
3694
+ * answers, a decision made for them, the current park, and the replies returned). A label, a wake, a claim or a note on a
3695
+ * park doesn't change it; a new park does, on any blocker, and so does a new evidence pointer. A row with no evidence
3696
+ * keeps the revision it had before evidence counted. */
3693
3697
  decisionRevision(item, opts) {
3694
3698
  const phase = item.state === "blocked" ? "blocked" : item.state === "pending" || item.state === "in-progress" ? "open" : item.state;
3695
3699
  const excludeOp = typeof opts?.excludeOperationReply === "string" && opts.excludeOperationReply.length > 0
@@ -3713,7 +3717,8 @@ export class QueueRepository {
3713
3717
  parkEntry = transitions[i].transitionId;
3714
3718
  }
3715
3719
  const decision = [item.body, item.humanIntent ?? null, item.humanQuestions ?? null, phase, item.destinationSession, item.blockedOn,
3716
- item.humanAnswers ?? null, item.delegatedDecision ?? null, this.currentHumanRequiredEpisode(item.qitemId)?.key ?? null, parkEntry, replies];
3720
+ item.humanAnswers ?? null, item.delegatedDecision ?? null, this.currentHumanRequiredEpisode(item.qitemId)?.key ?? null, parkEntry, replies,
3721
+ ...(item.evidenceRef ? [item.evidenceRef] : [])];
3717
3722
  return `dr1-${createHash("sha256").update(JSON.stringify(decision)).digest("hex").slice(0, 24)}`;
3718
3723
  }
3719
3724
  listRelayOwnerNotificationReceipts(qitemId) {
@@ -4284,12 +4289,9 @@ export class QueueRepository {
4284
4289
  this.eventBus.notifySubscribers(persisted);
4285
4290
  return persisted;
4286
4291
  }
4287
- findUndelivered(opts) {
4288
- // OPR.0.5.6.14 — delivery truth belongs to the CURRENT human-notification
4289
- // episode, not to the row's whole history. Pull every active row that can
4290
- // carry a current episode or a legacy nudge/receipt, then derive/filter in
4291
- // JS. LIMIT is applied after that filtering so historical POSTED episodes
4292
- // cannot consume the window and hide a later failure.
4292
+ /** The active rows findUndelivered considers: each can carry a current owner episode, a legacy nudge failure or a
4293
+ * delivery receipt. Which of them is undelivered is derived per row afterwards. */
4294
+ undeliveredCandidateFilter(opts) {
4293
4295
  const ownerEpisodeCandidate = this.hasOwnerNotificationColumns
4294
4296
  ? `EXISTS (SELECT 1 FROM queue_transitions owner_episode
4295
4297
  WHERE owner_episode.qitem_id = queue_items.qitem_id
@@ -4299,6 +4301,7 @@ export class QueueRepository {
4299
4301
  "state IN ('pending', 'in-progress', 'blocked')",
4300
4302
  `((state = 'pending' AND (last_nudge_result LIKE 'failed:%'
4301
4303
  OR last_nudge_result LIKE 'unroutable:%'
4304
+ OR last_nudge_result LIKE 'awaiting-pickup:%'
4302
4305
  OR last_nudge_result LIKE 'gateway-owned%'))
4303
4306
  OR ${ownerEpisodeCandidate}
4304
4307
  OR EXISTS (SELECT 1 FROM queue_transitions receipt
@@ -4318,6 +4321,35 @@ export class QueueRepository {
4318
4321
  conditions.push("(destination_session LIKE ? ESCAPE '\\' OR source_session LIKE ? ESCAPE '\\')");
4319
4322
  params.push(`%@${escaped}`, `%@${escaped}`);
4320
4323
  }
4324
+ return { conditions, params };
4325
+ }
4326
+ /**
4327
+ * The ids of the rows findUndelivered considers, oldest first, with no row's delivery outcome derived: a caller that
4328
+ * must stay responsive (the stuck sweep) derives each one by id, `findUndelivered({ qitemId })`, between its own
4329
+ * yields, so a long candidate set never runs as one synchronous read. On a WAL file database outside a transaction the
4330
+ * read runs in rowid windows on its own readonly connection and yields between windows (readRowsCooperatively, one
4331
+ * snapshot for the whole read); otherwise it is one id-only read on this handle. Every candidate is returned: nothing
4332
+ * is capped, and rows that change after the read are judged on that fresh read by id.
4333
+ */
4334
+ async undeliveredCandidateIds(opts) {
4335
+ const { conditions, params } = this.undeliveredCandidateFilter(opts);
4336
+ const where = conditions.join(" AND ");
4337
+ const columns = "qitem_id, ts_created, queue_items.rowid AS rid";
4338
+ const file = cooperativeReadFile(this.db);
4339
+ const rows = file
4340
+ ? (await readRowsCooperatively(file, "queue_items", `SELECT ${columns} FROM queue_items WHERE queue_items.rowid > ? AND queue_items.rowid <= ? AND ${where}`, params)).rows
4341
+ : this.db.prepare(`SELECT ${columns} FROM queue_items WHERE ${where}`).all(...params);
4342
+ // findUndelivered's order: oldest first, ties in rowid order.
4343
+ rows.sort((a, b) => (a.ts_created < b.ts_created ? -1 : a.ts_created > b.ts_created ? 1 : a.rid - b.rid));
4344
+ return rows.map((row) => row.qitem_id);
4345
+ }
4346
+ findUndelivered(opts) {
4347
+ // OPR.0.5.6.14 — delivery truth belongs to the CURRENT human-notification
4348
+ // episode, not to the row's whole history. Pull every active row that can
4349
+ // carry a current episode or a legacy nudge/receipt, then derive/filter in
4350
+ // JS. LIMIT is applied after that filtering so historical POSTED episodes
4351
+ // cannot consume the window and hide a later failure.
4352
+ const { conditions, params } = this.undeliveredCandidateFilter(opts);
4321
4353
  const columns = opts?.compact ? this.compactColumns() : "*";
4322
4354
  const sql = `SELECT ${columns} FROM queue_items WHERE ${conditions.join(" AND ")} ORDER BY ts_created ASC`;
4323
4355
  const rows = this.db.prepare(sql).all(...params);
@@ -4348,7 +4380,7 @@ export class QueueRepository {
4348
4380
  // undelivered. An active non-human row can still have an old OWNER
4349
4381
  // transition; that historical episode is not a current obligation.
4350
4382
  const lastNudge = item.lastNudgeResult ?? "";
4351
- if (item.state === "pending" && (lastNudge.startsWith("failed:") || lastNudge.startsWith("unroutable:"))) {
4383
+ if (item.state === "pending" && (lastNudge.startsWith("failed:") || recordsNoWakeRoute(lastNudge))) {
4352
4384
  out.push(item);
4353
4385
  }
4354
4386
  }
@@ -4357,8 +4389,8 @@ export class QueueRepository {
4357
4389
  }
4358
4390
  return opts?.compact ? out.map(compactRow) : out;
4359
4391
  }
4360
- /** Read the same address-admission predicate used by queue writes before choosing
4361
- * a recovery owner. Admission does not require a live seat or terminal binding. */
4392
+ /** Existing address preflight for choosing a receiver or recovery owner.
4393
+ * Recordability is separate and does not establish that somebody can receive the work. */
4362
4394
  acceptsDestination(destinationSession) {
4363
4395
  return this.validateRig(destinationSession);
4364
4396
  }