cataly 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1297) hide show
  1. package/LICENSE +6 -100
  2. package/README.md +88 -207
  3. package/THIRD-PARTY-NOTICES.txt +47981 -0
  4. package/bin/cataly.js +56 -0
  5. package/package.json +15 -31
  6. package/.bun-test-timings.json +0 -106
  7. package/.dockerignore +0 -48
  8. package/.gitattributes +0 -1
  9. package/.github/actions/setup/action.yml +0 -54
  10. package/.github/pull_request_template.md +0 -54
  11. package/.github/social-preview.png +0 -0
  12. package/.github/workflows/ci.yml +0 -86
  13. package/.github/workflows/cla.yml +0 -188
  14. package/.github/workflows/cross-os.yml +0 -95
  15. package/.github/workflows/release.yml +0 -39
  16. package/.github/workflows/ulw-update.yml +0 -72
  17. package/.husky/pre-commit +0 -2
  18. package/.oxlintrc.json +0 -47
  19. package/.prettierignore +0 -9
  20. package/.prettierrc.json +0 -11
  21. package/CHANGELOG.md +0 -343
  22. package/CLA.md +0 -58
  23. package/CONTRIBUTING.md +0 -283
  24. package/LICENSE.omp-dori +0 -23
  25. package/LICENSING.md +0 -61
  26. package/NOTICE +0 -113
  27. package/README.de.md +0 -197
  28. package/README.it.md +0 -197
  29. package/README.ja.md +0 -189
  30. package/README.ko.md +0 -196
  31. package/README.zh.md +0 -177
  32. package/bun.lock +0 -198
  33. package/docs/architecture.png +0 -0
  34. package/docs/architecture.svg +0 -2
  35. package/docs/cataly-portrait.webp +0 -0
  36. package/docs/container.md +0 -163
  37. package/docs/discord-voice.md +0 -174
  38. package/docs/dori-vs-deepseek.en.png +0 -0
  39. package/docs/dori-vs-deepseek.ko.png +0 -0
  40. package/docs/hourly-loop.md +0 -28
  41. package/docs/how-it-works-dark.svg +0 -68
  42. package/docs/how-it-works-light.svg +0 -68
  43. package/docs/how-it-works.ko-dark.svg +0 -67
  44. package/docs/how-it-works.ko-light.svg +0 -67
  45. package/docs/lane-flow.png +0 -0
  46. package/docs/lane-flow.svg +0 -1
  47. package/docs/locks.md +0 -47
  48. package/docs/owner-profile.md +0 -71
  49. package/docs/platform-adapter.md +0 -67
  50. package/docs/releases.md +0 -505
  51. package/docs/runtime.md +0 -262
  52. package/examples/brief.md +0 -13
  53. package/examples/container/Dockerfile +0 -119
  54. package/examples/container/compose.yaml +0 -35
  55. package/examples/container/entrypoint.sh +0 -16
  56. package/examples/discord-voice.service +0 -25
  57. package/examples/update-supervisor.service +0 -22
  58. package/examples/update.config.json +0 -54
  59. package/extension/bootstrap.ts +0 -68
  60. package/extension/bun.lock +0 -167
  61. package/extension/deployment-health.ts +0 -83
  62. package/extension/discord-ask-auto.ts +0 -93
  63. package/extension/discord-ask-card.ts +0 -70
  64. package/extension/discord-ask-fields.ts +0 -196
  65. package/extension/discord-ask-form.ts +0 -207
  66. package/extension/discord-ask-html.ts +0 -132
  67. package/extension/discord-ask-interactions.ts +0 -153
  68. package/extension/discord-ask-remote.ts +0 -183
  69. package/extension/discord-ask.ts +0 -175
  70. package/extension/discord-lane-reply.ts +0 -214
  71. package/extension/discord-lane.ts +0 -399
  72. package/extension/head-admission.ts +0 -154
  73. package/extension/head-receipt.ts +0 -88
  74. package/extension/index.ts +0 -1450
  75. package/extension/lane-bookkeeping.ts +0 -33
  76. package/extension/lane-policy.ts +0 -111
  77. package/extension/monitor-output.ts +0 -111
  78. package/extension/monitor-state.ts +0 -91
  79. package/extension/monitor.ts +0 -548
  80. package/extension/native-remote-socket.ts +0 -180
  81. package/extension/native-remote-view.ts +0 -58
  82. package/extension/native-remote.ts +0 -451
  83. package/extension/package.json +0 -20
  84. package/extension/role-invariants.ts +0 -24
  85. package/extension/test/deployment-bootstrap.test.ts +0 -289
  86. package/extension/test/discord-ask-auto.test.ts +0 -256
  87. package/extension/test/discord-ask-buttons.test.ts +0 -147
  88. package/extension/test/discord-ask-card.test.ts +0 -169
  89. package/extension/test/discord-ask-form.test.ts +0 -317
  90. package/extension/test/discord-ask-mailbox.test.ts +0 -159
  91. package/extension/test/discord-ask-timeout.test.ts +0 -89
  92. package/extension/test/discord-ask.test.ts +0 -114
  93. package/extension/test/discord-lane-fence.test.ts +0 -94
  94. package/extension/test/discord-lane-reply.test.ts +0 -151
  95. package/extension/test/discord-lane-wake.test.ts +0 -162
  96. package/extension/test/fake-pi.ts +0 -173
  97. package/extension/test/fake-ulw.ts +0 -38
  98. package/extension/test/head-admission.test.ts +0 -548
  99. package/extension/test/head-receipt.test.ts +0 -85
  100. package/extension/test/index.test.ts +0 -773
  101. package/extension/test/lane-bookkeeping.test.ts +0 -68
  102. package/extension/test/lane-policy.test.ts +0 -263
  103. package/extension/test/launch-argv.test.ts +0 -214
  104. package/extension/test/launch-model.test.ts +0 -192
  105. package/extension/test/monitor-admission.test.ts +0 -186
  106. package/extension/test/monitor-bytes.test.ts +0 -110
  107. package/extension/test/monitor-once-admission.test.ts +0 -133
  108. package/extension/test/monitor-once-durability.test.ts +0 -70
  109. package/extension/test/monitor-once.test.ts +0 -190
  110. package/extension/test/monitor-output.test.ts +0 -140
  111. package/extension/test/monitor-replay.test.ts +0 -69
  112. package/extension/test/monitor-restart.test.ts +0 -110
  113. package/extension/test/monitor-state.test.ts +0 -44
  114. package/extension/test/monitor.test.ts +0 -229
  115. package/extension/test/native-prompt-matrix.test.ts +0 -46
  116. package/extension/test/native-remote.test.ts +0 -357
  117. package/extension/test/native-tool-completion.test.ts +0 -483
  118. package/extension/test/new-session.test.ts +0 -251
  119. package/extension/test/owes-gate.test.ts +0 -141
  120. package/extension/test/owes-monitor-lifecycle.test.ts +0 -88
  121. package/extension/test/record-head-inbound.ts +0 -38
  122. package/extension/test/report-generation.test.ts +0 -210
  123. package/extension/test/report-receipt-race.test.ts +0 -193
  124. package/extension/test/report-tool.test.ts +0 -251
  125. package/extension/test/role-invariants.test.ts +0 -91
  126. package/extension/test/source-bundle.test.ts +0 -91
  127. package/extension/test/status.test.ts +0 -104
  128. package/extension/tsconfig.json +0 -23
  129. package/install.sh +0 -245
  130. package/knip.json +0 -48
  131. package/native-addon/bun.lock +0 -27
  132. package/native-addon/package.json +0 -8
  133. package/native-omp.lock +0 -186
  134. package/native-omp.patch +0 -5343
  135. package/omp-ulw.lock +0 -1
  136. package/omp-ulw.overlay.lock +0 -99
  137. package/omp-ulw.patch +0 -3225
  138. package/prompts/duty.md +0 -11
  139. package/prompts/lane-footer.md +0 -18
  140. package/prompts/lead.md +0 -21
  141. package/prompts/nudge-waiting.md +0 -11
  142. package/prompts/nudge.md +0 -10
  143. package/prompts/owner-distill.md +0 -18
  144. package/prompts/review.md +0 -15
  145. package/release-capabilities.json +0 -7
  146. package/scripts/bench/fake-discord.ts +0 -103
  147. package/scripts/bench/variants.ts +0 -142
  148. package/scripts/bench-discord-intake.ts +0 -236
  149. package/scripts/check-loc.ts +0 -47
  150. package/scripts/check-test-fixtures.ts +0 -30
  151. package/scripts/ci-install-herdr.sh +0 -26
  152. package/scripts/consumer/omp +0 -26
  153. package/scripts/consumer-smoke-context.ts +0 -241
  154. package/scripts/consumer-smoke-harness.ts +0 -213
  155. package/scripts/consumer-smoke-inspect.ts +0 -108
  156. package/scripts/install-source.sh +0 -464
  157. package/scripts/release-build.ts +0 -181
  158. package/scripts/release-gate.ts +0 -77
  159. package/scripts/release-journal.ts +0 -105
  160. package/scripts/release-process.ts +0 -135
  161. package/scripts/release-publish.ts +0 -129
  162. package/scripts/release-remote.ts +0 -112
  163. package/scripts/release-source.ts +0 -75
  164. package/scripts/release.ts +0 -60
  165. package/scripts/source-configuration.ts +0 -304
  166. package/scripts/source-dependencies.ts +0 -51
  167. package/scripts/typecheck.ts +0 -46
  168. package/scripts/update-supervisor.ts +0 -112
  169. package/scripts/update-ulw-existing.ts +0 -126
  170. package/scripts/update-ulw-publish.ts +0 -142
  171. package/scripts/update-ulw.ts +0 -25
  172. package/scripts/verify-consumer-release.ts +0 -243
  173. package/skills/dori-mode/SKILL.md +0 -156
  174. package/skills/dori-mode/assets/dori-avatar.png +0 -0
  175. package/skills/dori-mode/references/config.example.json +0 -51
  176. package/skills/dori-mode/references/done-protocol.md +0 -38
  177. package/skills/dori-mode/references/onboarding.md +0 -62
  178. package/skills/dori-mode/references/scripts.md +0 -895
  179. package/skills/dori-mode/references/sessions.md +0 -165
  180. package/skills/dori-mode/references/setup.md +0 -150
  181. package/skills/dori-mode/references/writing.md +0 -37
  182. package/skills/dori-mode/scripts/bun.lock +0 -203
  183. package/skills/dori-mode/scripts/package.json +0 -27
  184. package/skills/dori-mode/scripts/src/artifact-config.ts +0 -48
  185. package/skills/dori-mode/scripts/src/artifact-files.ts +0 -125
  186. package/skills/dori-mode/scripts/src/artifact-records.ts +0 -122
  187. package/skills/dori-mode/scripts/src/artifact-report.ts +0 -79
  188. package/skills/dori-mode/scripts/src/artifacts.ts +0 -235
  189. package/skills/dori-mode/scripts/src/board.ts +0 -160
  190. package/skills/dori-mode/scripts/src/boot-checks.ts +0 -69
  191. package/skills/dori-mode/scripts/src/boot-monitors.ts +0 -245
  192. package/skills/dori-mode/scripts/src/boot.ts +0 -250
  193. package/skills/dori-mode/scripts/src/cgroup-memory.ts +0 -117
  194. package/skills/dori-mode/scripts/src/checkpoint-lock.ts +0 -169
  195. package/skills/dori-mode/scripts/src/checkpoints.ts +0 -185
  196. package/skills/dori-mode/scripts/src/cli-artifacts.ts +0 -74
  197. package/skills/dori-mode/scripts/src/cli-context.ts +0 -161
  198. package/skills/dori-mode/scripts/src/cli-decisions.ts +0 -181
  199. package/skills/dori-mode/scripts/src/cli-discord-gateway.ts +0 -33
  200. package/skills/dori-mode/scripts/src/cli-discord-ops.ts +0 -157
  201. package/skills/dori-mode/scripts/src/cli-discord-purpose.ts +0 -103
  202. package/skills/dori-mode/scripts/src/cli-discord-recovery.ts +0 -22
  203. package/skills/dori-mode/scripts/src/cli-discord.ts +0 -248
  204. package/skills/dori-mode/scripts/src/cli-errors.ts +0 -24
  205. package/skills/dori-mode/scripts/src/cli-harness.ts +0 -26
  206. package/skills/dori-mode/scripts/src/cli-headless.ts +0 -96
  207. package/skills/dori-mode/scripts/src/cli-inbound.ts +0 -71
  208. package/skills/dori-mode/scripts/src/cli-invoke.ts +0 -29
  209. package/skills/dori-mode/scripts/src/cli-journal.ts +0 -234
  210. package/skills/dori-mode/scripts/src/cli-lane-policy.ts +0 -42
  211. package/skills/dori-mode/scripts/src/cli-lanes.ts +0 -243
  212. package/skills/dori-mode/scripts/src/cli-messenger.ts +0 -147
  213. package/skills/dori-mode/scripts/src/cli-ops.ts +0 -171
  214. package/skills/dori-mode/scripts/src/cli-pr.ts +0 -158
  215. package/skills/dori-mode/scripts/src/cli-recall.ts +0 -75
  216. package/skills/dori-mode/scripts/src/cli-remote.ts +0 -241
  217. package/skills/dori-mode/scripts/src/cli-report.ts +0 -41
  218. package/skills/dori-mode/scripts/src/cli-schedule.ts +0 -98
  219. package/skills/dori-mode/scripts/src/cli-status.ts +0 -111
  220. package/skills/dori-mode/scripts/src/cli-telegram.ts +0 -100
  221. package/skills/dori-mode/scripts/src/cli-usage-report.ts +0 -109
  222. package/skills/dori-mode/scripts/src/cli-usage.ts +0 -134
  223. package/skills/dori-mode/scripts/src/cli-voice.ts +0 -93
  224. package/skills/dori-mode/scripts/src/cli.ts +0 -250
  225. package/skills/dori-mode/scripts/src/close-worktrees.ts +0 -74
  226. package/skills/dori-mode/scripts/src/config-identities.ts +0 -23
  227. package/skills/dori-mode/scripts/src/config.ts +0 -222
  228. package/skills/dori-mode/scripts/src/dead-panes.ts +0 -62
  229. package/skills/dori-mode/scripts/src/decisions-fold.ts +0 -155
  230. package/skills/dori-mode/scripts/src/decisions-record.ts +0 -154
  231. package/skills/dori-mode/scripts/src/decisions-render.ts +0 -43
  232. package/skills/dori-mode/scripts/src/decisions.ts +0 -180
  233. package/skills/dori-mode/scripts/src/delivery-lock.ts +0 -87
  234. package/skills/dori-mode/scripts/src/delivery-state.ts +0 -85
  235. package/skills/dori-mode/scripts/src/discord-lane-monitor.ts +0 -98
  236. package/skills/dori-mode/scripts/src/discord-lane-transcript.ts +0 -143
  237. package/skills/dori-mode/scripts/src/discord-lane-wake-command.ts +0 -42
  238. package/skills/dori-mode/scripts/src/discord-lane-wake-lease.ts +0 -52
  239. package/skills/dori-mode/scripts/src/discord-lane-wake-pending.ts +0 -11
  240. package/skills/dori-mode/scripts/src/discord-lane-wake.ts +0 -245
  241. package/skills/dori-mode/scripts/src/discord-lane-wake.yml +0 -17
  242. package/skills/dori-mode/scripts/src/doctor-config.ts +0 -24
  243. package/skills/dori-mode/scripts/src/doctor-monitors.ts +0 -195
  244. package/skills/dori-mode/scripts/src/doctor.ts +0 -223
  245. package/skills/dori-mode/scripts/src/done-flow.ts +0 -238
  246. package/skills/dori-mode/scripts/src/evidence-sequence.ts +0 -38
  247. package/skills/dori-mode/scripts/src/evidence-window.ts +0 -132
  248. package/skills/dori-mode/scripts/src/evidence.ts +0 -231
  249. package/skills/dori-mode/scripts/src/freshness-notify.ts +0 -226
  250. package/skills/dori-mode/scripts/src/freshness-policy.ts +0 -27
  251. package/skills/dori-mode/scripts/src/freshness-report.ts +0 -65
  252. package/skills/dori-mode/scripts/src/freshness.ts +0 -220
  253. package/skills/dori-mode/scripts/src/goal-record.ts +0 -99
  254. package/skills/dori-mode/scripts/src/heavy-slot.ts +0 -70
  255. package/skills/dori-mode/scripts/src/holds.ts +0 -27
  256. package/skills/dori-mode/scripts/src/host-guard.ts +0 -117
  257. package/skills/dori-mode/scripts/src/lane-policy-actions.ts +0 -155
  258. package/skills/dori-mode/scripts/src/lane-policy-launch.ts +0 -64
  259. package/skills/dori-mode/scripts/src/lane-policy-store.ts +0 -126
  260. package/skills/dori-mode/scripts/src/lane-policy.ts +0 -46
  261. package/skills/dori-mode/scripts/src/lane-run.ts +0 -70
  262. package/skills/dori-mode/scripts/src/lane-state.ts +0 -69
  263. package/skills/dori-mode/scripts/src/launch-errors.ts +0 -3
  264. package/skills/dori-mode/scripts/src/launch-finished.ts +0 -217
  265. package/skills/dori-mode/scripts/src/launch-footer.ts +0 -127
  266. package/skills/dori-mode/scripts/src/launch-generated.ts +0 -46
  267. package/skills/dori-mode/scripts/src/launch-headless.ts +0 -114
  268. package/skills/dori-mode/scripts/src/launch-input.ts +0 -54
  269. package/skills/dori-mode/scripts/src/launch-model.ts +0 -156
  270. package/skills/dori-mode/scripts/src/launch-queue-store.ts +0 -90
  271. package/skills/dori-mode/scripts/src/launch-queue.ts +0 -237
  272. package/skills/dori-mode/scripts/src/launch-selection.ts +0 -34
  273. package/skills/dori-mode/scripts/src/launch-session.ts +0 -248
  274. package/skills/dori-mode/scripts/src/launch-template.ts +0 -41
  275. package/skills/dori-mode/scripts/src/launch.ts +0 -250
  276. package/skills/dori-mode/scripts/src/lessons.ts +0 -202
  277. package/skills/dori-mode/scripts/src/lifecycle-session.ts +0 -114
  278. package/skills/dori-mode/scripts/src/messenger/discord-ask-mailbox.ts +0 -250
  279. package/skills/dori-mode/scripts/src/messenger/discord-ask-receiver.ts +0 -242
  280. package/skills/dori-mode/scripts/src/messenger/discord-channels.ts +0 -200
  281. package/skills/dori-mode/scripts/src/messenger/discord-gateway.ts +0 -250
  282. package/skills/dori-mode/scripts/src/messenger/discord-inbound-api.ts +0 -235
  283. package/skills/dori-mode/scripts/src/messenger/discord-inbound-context.ts +0 -107
  284. package/skills/dori-mode/scripts/src/messenger/discord-inbound-database.ts +0 -43
  285. package/skills/dori-mode/scripts/src/messenger/discord-inbound-env.ts +0 -26
  286. package/skills/dori-mode/scripts/src/messenger/discord-inbound-identity.ts +0 -23
  287. package/skills/dori-mode/scripts/src/messenger/discord-inbound-live.ts +0 -187
  288. package/skills/dori-mode/scripts/src/messenger/discord-inbound-queue.ts +0 -235
  289. package/skills/dori-mode/scripts/src/messenger/discord-inbound-state.ts +0 -44
  290. package/skills/dori-mode/scripts/src/messenger/discord-inbound-thread-admission.ts +0 -155
  291. package/skills/dori-mode/scripts/src/messenger/discord-inbound-thread-api.ts +0 -57
  292. package/skills/dori-mode/scripts/src/messenger/discord-inbound-thread-poll.ts +0 -80
  293. package/skills/dori-mode/scripts/src/messenger/discord-inbound-threads.ts +0 -121
  294. package/skills/dori-mode/scripts/src/messenger/discord-inbound.ts +0 -220
  295. package/skills/dori-mode/scripts/src/messenger/discord-lane-inbox.ts +0 -237
  296. package/skills/dori-mode/scripts/src/messenger/discord-markdown.ts +0 -206
  297. package/skills/dori-mode/scripts/src/messenger/discord-presence.ts +0 -11
  298. package/skills/dori-mode/scripts/src/messenger/discord-response.ts +0 -68
  299. package/skills/dori-mode/scripts/src/messenger/discord-source-fingerprint.ts +0 -40
  300. package/skills/dori-mode/scripts/src/messenger/discord.ts +0 -247
  301. package/skills/dori-mode/scripts/src/messenger/head-admission-state.ts +0 -159
  302. package/skills/dori-mode/scripts/src/messenger/head-admission.ts +0 -145
  303. package/skills/dori-mode/scripts/src/messenger/http.ts +0 -174
  304. package/skills/dori-mode/scripts/src/messenger/private-state-file.ts +0 -103
  305. package/skills/dori-mode/scripts/src/messenger/recall-discord.ts +0 -62
  306. package/skills/dori-mode/scripts/src/messenger/recall-ledger.ts +0 -250
  307. package/skills/dori-mode/scripts/src/messenger/recall-telegram.ts +0 -53
  308. package/skills/dori-mode/scripts/src/messenger/recall-text.ts +0 -235
  309. package/skills/dori-mode/scripts/src/messenger/slack-inbound.ts +0 -140
  310. package/skills/dori-mode/scripts/src/messenger/slack-presence.ts +0 -56
  311. package/skills/dori-mode/scripts/src/messenger/slack.ts +0 -172
  312. package/skills/dori-mode/scripts/src/messenger/split.ts +0 -92
  313. package/skills/dori-mode/scripts/src/messenger/telegram-cursor-error.ts +0 -2
  314. package/skills/dori-mode/scripts/src/messenger/telegram-inbound-state.ts +0 -73
  315. package/skills/dori-mode/scripts/src/messenger/telegram-inbound-update.ts +0 -104
  316. package/skills/dori-mode/scripts/src/messenger/telegram-inbound-win32-ffi.ts +0 -89
  317. package/skills/dori-mode/scripts/src/messenger/telegram-inbound-win32-native.ts +0 -243
  318. package/skills/dori-mode/scripts/src/messenger/telegram-inbound-win32-policy.ts +0 -79
  319. package/skills/dori-mode/scripts/src/messenger/telegram-inbound-win32-store.ts +0 -247
  320. package/skills/dori-mode/scripts/src/messenger/telegram-inbound.ts +0 -204
  321. package/skills/dori-mode/scripts/src/messenger/telegram-lag.ts +0 -144
  322. package/skills/dori-mode/scripts/src/messenger/telegram-line.ts +0 -11
  323. package/skills/dori-mode/scripts/src/messenger/telegram.ts +0 -214
  324. package/skills/dori-mode/scripts/src/messenger/thread-ledger.ts +0 -211
  325. package/skills/dori-mode/scripts/src/messenger/typing.ts +0 -19
  326. package/skills/dori-mode/scripts/src/messenger/voice.ts +0 -247
  327. package/skills/dori-mode/scripts/src/monitor-command.ts +0 -241
  328. package/skills/dori-mode/scripts/src/monitor-dori.ts +0 -162
  329. package/skills/dori-mode/scripts/src/monitor-launchers.ts +0 -145
  330. package/skills/dori-mode/scripts/src/monitor-presets.ts +0 -100
  331. package/skills/dori-mode/scripts/src/monitor-syntax.ts +0 -188
  332. package/skills/dori-mode/scripts/src/native-close-process.ts +0 -43
  333. package/skills/dori-mode/scripts/src/native-close.ts +0 -221
  334. package/skills/dori-mode/scripts/src/owes-file.ts +0 -54
  335. package/skills/dori-mode/scripts/src/owes-writer.ts +0 -35
  336. package/skills/dori-mode/scripts/src/owes.ts +0 -243
  337. package/skills/dori-mode/scripts/src/park.ts +0 -136
  338. package/skills/dori-mode/scripts/src/pause.ts +0 -238
  339. package/skills/dori-mode/scripts/src/pr-watch-fetch.ts +0 -250
  340. package/skills/dori-mode/scripts/src/pr-watch-tick.ts +0 -184
  341. package/skills/dori-mode/scripts/src/pr-watch.ts +0 -225
  342. package/skills/dori-mode/scripts/src/quota.ts +0 -245
  343. package/skills/dori-mode/scripts/src/reconcile.ts +0 -26
  344. package/skills/dori-mode/scripts/src/registry.ts +0 -250
  345. package/skills/dori-mode/scripts/src/remote-launch.ts +0 -223
  346. package/skills/dori-mode/scripts/src/remote-records.ts +0 -73
  347. package/skills/dori-mode/scripts/src/remote-worker.ts +0 -200
  348. package/skills/dori-mode/scripts/src/reopen.ts +0 -240
  349. package/skills/dori-mode/scripts/src/report-activity.ts +0 -48
  350. package/skills/dori-mode/scripts/src/report-delivery.ts +0 -26
  351. package/skills/dori-mode/scripts/src/report-events.ts +0 -79
  352. package/skills/dori-mode/scripts/src/reports.ts +0 -246
  353. package/skills/dori-mode/scripts/src/request-identity.ts +0 -74
  354. package/skills/dori-mode/scripts/src/routing.ts +0 -17
  355. package/skills/dori-mode/scripts/src/run.ts +0 -198
  356. package/skills/dori-mode/scripts/src/schedule-delivery.ts +0 -79
  357. package/skills/dori-mode/scripts/src/schedule-ownership.ts +0 -27
  358. package/skills/dori-mode/scripts/src/schedule-store.ts +0 -139
  359. package/skills/dori-mode/scripts/src/schedule-systemd.ts +0 -71
  360. package/skills/dori-mode/scripts/src/schedule-types.ts +0 -204
  361. package/skills/dori-mode/scripts/src/schedule-view.ts +0 -53
  362. package/skills/dori-mode/scripts/src/scheduler.ts +0 -198
  363. package/skills/dori-mode/scripts/src/session-id-headless.ts +0 -44
  364. package/skills/dori-mode/scripts/src/session-id.ts +0 -243
  365. package/skills/dori-mode/scripts/src/sessions.ts +0 -176
  366. package/skills/dori-mode/scripts/src/signals-parse.ts +0 -170
  367. package/skills/dori-mode/scripts/src/signals.ts +0 -150
  368. package/skills/dori-mode/scripts/src/slack-token.ts +0 -226
  369. package/skills/dori-mode/scripts/src/startup-screen.ts +0 -108
  370. package/skills/dori-mode/scripts/src/status-registry.ts +0 -69
  371. package/skills/dori-mode/scripts/src/status-render.ts +0 -98
  372. package/skills/dori-mode/scripts/src/status.ts +0 -210
  373. package/skills/dori-mode/scripts/src/supervision-activity.ts +0 -3
  374. package/skills/dori-mode/scripts/src/supervision-config.ts +0 -55
  375. package/skills/dori-mode/scripts/src/supervision-cost.ts +0 -101
  376. package/skills/dori-mode/scripts/src/supervision-evidence-state.ts +0 -246
  377. package/skills/dori-mode/scripts/src/supervision-git.ts +0 -158
  378. package/skills/dori-mode/scripts/src/supervision-observe.ts +0 -208
  379. package/skills/dori-mode/scripts/src/supervision-verdict.ts +0 -243
  380. package/skills/dori-mode/scripts/src/supervision.ts +0 -163
  381. package/skills/dori-mode/scripts/src/sync.ts +0 -134
  382. package/skills/dori-mode/scripts/src/tell.ts +0 -158
  383. package/skills/dori-mode/scripts/src/thread-groups.ts +0 -117
  384. package/skills/dori-mode/scripts/src/thread-status.ts +0 -25
  385. package/skills/dori-mode/scripts/src/tool-evidence.ts +0 -230
  386. package/skills/dori-mode/scripts/src/tool-fingerprint.ts +0 -166
  387. package/skills/dori-mode/scripts/src/usage-file.ts +0 -59
  388. package/skills/dori-mode/scripts/src/usage-index.ts +0 -85
  389. package/skills/dori-mode/scripts/src/usage-omp.ts +0 -174
  390. package/skills/dori-mode/scripts/src/usage-options.ts +0 -28
  391. package/skills/dori-mode/scripts/src/usage-session.ts +0 -248
  392. package/skills/dori-mode/scripts/src/usage-tree.ts +0 -226
  393. package/skills/dori-mode/scripts/src/verify-pr-check.ts +0 -164
  394. package/skills/dori-mode/scripts/src/verify-pr.ts +0 -128
  395. package/skills/dori-mode/scripts/src/voice/assistant.ts +0 -129
  396. package/skills/dori-mode/scripts/src/voice/audio.ts +0 -184
  397. package/skills/dori-mode/scripts/src/voice/backend.ts +0 -230
  398. package/skills/dori-mode/scripts/src/voice/commentary.ts +0 -155
  399. package/skills/dori-mode/scripts/src/voice/discord-events.ts +0 -36
  400. package/skills/dori-mode/scripts/src/voice/discord-link.ts +0 -90
  401. package/skills/dori-mode/scripts/src/voice/discord-receive.ts +0 -178
  402. package/skills/dori-mode/scripts/src/voice/discord-session.ts +0 -249
  403. package/skills/dori-mode/scripts/src/voice/discord.ts +0 -152
  404. package/skills/dori-mode/scripts/src/voice/facts.ts +0 -27
  405. package/skills/dori-mode/scripts/src/voice/prompts.ts +0 -117
  406. package/skills/dori-mode/scripts/src/voice/provider.ts +0 -158
  407. package/skills/dori-mode/scripts/src/voice/relay.ts +0 -199
  408. package/skills/dori-mode/scripts/src/voice/replies.ts +0 -139
  409. package/skills/dori-mode/scripts/src/voice/session.ts +0 -249
  410. package/skills/dori-mode/scripts/src/voice/settings.ts +0 -72
  411. package/skills/dori-mode/scripts/src/voice/status.ts +0 -75
  412. package/skills/dori-mode/scripts/src/voice/summary.ts +0 -68
  413. package/skills/dori-mode/scripts/src/voice/tools.ts +0 -75
  414. package/skills/dori-mode/scripts/src/voice/types.ts +0 -116
  415. package/skills/dori-mode/scripts/src/voice/usage.ts +0 -156
  416. package/skills/dori-mode/scripts/src/worklog-render.ts +0 -53
  417. package/skills/dori-mode/scripts/src/worklog.ts +0 -250
  418. package/skills/dori-mode/scripts/test/artifact-cli.test.ts +0 -199
  419. package/skills/dori-mode/scripts/test/artifact-close.test.ts +0 -247
  420. package/skills/dori-mode/scripts/test/artifact-config.test.ts +0 -53
  421. package/skills/dori-mode/scripts/test/artifact-files.test.ts +0 -135
  422. package/skills/dori-mode/scripts/test/artifact-fixture.ts +0 -37
  423. package/skills/dori-mode/scripts/test/artifacts.test.ts +0 -180
  424. package/skills/dori-mode/scripts/test/audio-samples.ts +0 -93
  425. package/skills/dori-mode/scripts/test/board.test.ts +0 -233
  426. package/skills/dori-mode/scripts/test/boot-checks.test.ts +0 -148
  427. package/skills/dori-mode/scripts/test/boot-decisions.test.ts +0 -106
  428. package/skills/dori-mode/scripts/test/boot-journals.test.ts +0 -138
  429. package/skills/dori-mode/scripts/test/boot-metadata.test.ts +0 -193
  430. package/skills/dori-mode/scripts/test/boot-monitor-matrix.test.ts +0 -249
  431. package/skills/dori-mode/scripts/test/boot-monitor-words.test.ts +0 -202
  432. package/skills/dori-mode/scripts/test/boot-monitors.test.ts +0 -246
  433. package/skills/dori-mode/scripts/test/boot-schedules.test.ts +0 -161
  434. package/skills/dori-mode/scripts/test/boot-slack.test.ts +0 -159
  435. package/skills/dori-mode/scripts/test/boot-worklog.test.ts +0 -146
  436. package/skills/dori-mode/scripts/test/boot.test.ts +0 -233
  437. package/skills/dori-mode/scripts/test/cgroup-memory.test.ts +0 -189
  438. package/skills/dori-mode/scripts/test/checkpoints-lock.test.ts +0 -180
  439. package/skills/dori-mode/scripts/test/checkpoints.test.ts +0 -154
  440. package/skills/dori-mode/scripts/test/cli-harness.test.ts +0 -70
  441. package/skills/dori-mode/scripts/test/cli-loading.test.ts +0 -220
  442. package/skills/dori-mode/scripts/test/config.test.ts +0 -141
  443. package/skills/dori-mode/scripts/test/dead-panes-retention.test.ts +0 -188
  444. package/skills/dori-mode/scripts/test/decisions-authority-cli.test.ts +0 -250
  445. package/skills/dori-mode/scripts/test/decisions-authority.test.ts +0 -226
  446. package/skills/dori-mode/scripts/test/decisions-flags.test.ts +0 -128
  447. package/skills/dori-mode/scripts/test/decisions-race.test.ts +0 -159
  448. package/skills/dori-mode/scripts/test/decisions.test.ts +0 -246
  449. package/skills/dori-mode/scripts/test/discord-api-base.test.ts +0 -121
  450. package/skills/dori-mode/scripts/test/discord-ask-receiver.test.ts +0 -220
  451. package/skills/dori-mode/scripts/test/discord-channels.test.ts +0 -180
  452. package/skills/dori-mode/scripts/test/discord-cli.test.ts +0 -210
  453. package/skills/dori-mode/scripts/test/discord-fakes.ts +0 -191
  454. package/skills/dori-mode/scripts/test/discord-head-admission.test.ts +0 -111
  455. package/skills/dori-mode/scripts/test/discord-head-cancel.test.ts +0 -140
  456. package/skills/dori-mode/scripts/test/discord-head-queued.test.ts +0 -114
  457. package/skills/dori-mode/scripts/test/discord-head-recovery.test.ts +0 -237
  458. package/skills/dori-mode/scripts/test/discord-head-thread-recovery.test.ts +0 -95
  459. package/skills/dori-mode/scripts/test/discord-inbound-ack-index.test.ts +0 -61
  460. package/skills/dori-mode/scripts/test/discord-inbound-activity-errors.test.ts +0 -77
  461. package/skills/dori-mode/scripts/test/discord-inbound-activity.test.ts +0 -250
  462. package/skills/dori-mode/scripts/test/discord-inbound-backlog-context.test.ts +0 -188
  463. package/skills/dori-mode/scripts/test/discord-inbound-backlog.test.ts +0 -228
  464. package/skills/dori-mode/scripts/test/discord-inbound-channels.test.ts +0 -182
  465. package/skills/dori-mode/scripts/test/discord-inbound-checkpoints.test.ts +0 -208
  466. package/skills/dori-mode/scripts/test/discord-inbound-cli.test.ts +0 -189
  467. package/skills/dori-mode/scripts/test/discord-inbound-close-route.test.ts +0 -177
  468. package/skills/dori-mode/scripts/test/discord-inbound-cursor-failures.test.ts +0 -234
  469. package/skills/dori-mode/scripts/test/discord-inbound-errors.test.ts +0 -95
  470. package/skills/dori-mode/scripts/test/discord-inbound-fakes.ts +0 -161
  471. package/skills/dori-mode/scripts/test/discord-inbound-ledger-close.test.ts +0 -140
  472. package/skills/dori-mode/scripts/test/discord-inbound-lifecycle.test.ts +0 -112
  473. package/skills/dori-mode/scripts/test/discord-inbound-live-async.test.ts +0 -45
  474. package/skills/dori-mode/scripts/test/discord-inbound-live-fakes.ts +0 -206
  475. package/skills/dori-mode/scripts/test/discord-inbound-live.test.ts +0 -239
  476. package/skills/dori-mode/scripts/test/discord-inbound-media.test.ts +0 -173
  477. package/skills/dori-mode/scripts/test/discord-inbound-memory-queue.ts +0 -109
  478. package/skills/dori-mode/scripts/test/discord-inbound-queue-cli.test.ts +0 -200
  479. package/skills/dori-mode/scripts/test/discord-inbound-queue.test.ts +0 -207
  480. package/skills/dori-mode/scripts/test/discord-inbound-queued-failures.test.ts +0 -188
  481. package/skills/dori-mode/scripts/test/discord-inbound-queued-receipts.test.ts +0 -203
  482. package/skills/dori-mode/scripts/test/discord-inbound-queued-recovery.test.ts +0 -162
  483. package/skills/dori-mode/scripts/test/discord-inbound-quiet-composition.test.ts +0 -243
  484. package/skills/dori-mode/scripts/test/discord-inbound-quiet.test.ts +0 -173
  485. package/skills/dori-mode/scripts/test/discord-inbound-state.test.ts +0 -146
  486. package/skills/dori-mode/scripts/test/discord-inbound-thread-admission.test.ts +0 -161
  487. package/skills/dori-mode/scripts/test/discord-inbound-thread-cancel.test.ts +0 -225
  488. package/skills/dori-mode/scripts/test/discord-inbound-thread-lifecycle.test.ts +0 -156
  489. package/skills/dori-mode/scripts/test/discord-inbound-thread-recovery.test.ts +0 -241
  490. package/skills/dori-mode/scripts/test/discord-inbound-threads.test.ts +0 -212
  491. package/skills/dori-mode/scripts/test/discord-inbound.test.ts +0 -190
  492. package/skills/dori-mode/scripts/test/discord-lane-inbox.test.ts +0 -250
  493. package/skills/dori-mode/scripts/test/discord-lane-monitor.test.ts +0 -184
  494. package/skills/dori-mode/scripts/test/discord-lane-wake-fixture.ts +0 -178
  495. package/skills/dori-mode/scripts/test/discord-lane-wake.test.ts +0 -204
  496. package/skills/dori-mode/scripts/test/discord-markdown.test.ts +0 -225
  497. package/skills/dori-mode/scripts/test/discord-presence-fakes.ts +0 -97
  498. package/skills/dori-mode/scripts/test/discord-presence-recovery.test.ts +0 -218
  499. package/skills/dori-mode/scripts/test/discord-presence.test.ts +0 -174
  500. package/skills/dori-mode/scripts/test/discord-purpose-receipts.test.ts +0 -138
  501. package/skills/dori-mode/scripts/test/discord-purpose-receiver.test.ts +0 -102
  502. package/skills/dori-mode/scripts/test/discord-purpose-source.test.ts +0 -245
  503. package/skills/dori-mode/scripts/test/discord-reply-binding.test.ts +0 -156
  504. package/skills/dori-mode/scripts/test/discord-send.test.ts +0 -234
  505. package/skills/dori-mode/scripts/test/discord-source-fingerprint.test.ts +0 -66
  506. package/skills/dori-mode/scripts/test/discord-split.test.ts +0 -124
  507. package/skills/dori-mode/scripts/test/discord-tables-cli.test.ts +0 -173
  508. package/skills/dori-mode/scripts/test/discord-transcribe-cli.test.ts +0 -61
  509. package/skills/dori-mode/scripts/test/doctor-cli.test.ts +0 -205
  510. package/skills/dori-mode/scripts/test/doctor-findings.test.ts +0 -246
  511. package/skills/dori-mode/scripts/test/doctor-metadata.test.ts +0 -108
  512. package/skills/dori-mode/scripts/test/doctor-runtime.test.ts +0 -156
  513. package/skills/dori-mode/scripts/test/doctor-supervision.test.ts +0 -175
  514. package/skills/dori-mode/scripts/test/doctor.test.ts +0 -214
  515. package/skills/dori-mode/scripts/test/done-flow.test.ts +0 -247
  516. package/skills/dori-mode/scripts/test/dori-monitor-vocabulary.test.ts +0 -130
  517. package/skills/dori-mode/scripts/test/eval-evidence.test.ts +0 -164
  518. package/skills/dori-mode/scripts/test/evidence-cli.test.ts +0 -107
  519. package/skills/dori-mode/scripts/test/evidence-order.test.ts +0 -129
  520. package/skills/dori-mode/scripts/test/evidence-sequence-fixture.ts +0 -177
  521. package/skills/dori-mode/scripts/test/evidence-sequence-race.test.ts +0 -136
  522. package/skills/dori-mode/scripts/test/evidence-sequence-scan.test.ts +0 -42
  523. package/skills/dori-mode/scripts/test/evidence-sequence.test.ts +0 -221
  524. package/skills/dori-mode/scripts/test/evidence.test.ts +0 -235
  525. package/skills/dori-mode/scripts/test/fakes.ts +0 -228
  526. package/skills/dori-mode/scripts/test/final-report.test.ts +0 -63
  527. package/skills/dori-mode/scripts/test/fixtures/verify-pr/browser-test-only.json +0 -67
  528. package/skills/dori-mode/scripts/test/fixtures/verify-pr/fix-then-untested-copy-fix.json +0 -120
  529. package/skills/dori-mode/scripts/test/fixtures/verify-pr/fix-with-own-ui-test.json +0 -57
  530. package/skills/dori-mode/scripts/test/fixtures/verify-pr/fixture-file-is-not-a-test.json +0 -190
  531. package/skills/dori-mode/scripts/test/fixtures/verify-pr/follow-up-fixes-without-tests.json +0 -150
  532. package/skills/dori-mode/scripts/test/fixtures/verify-pr/release-chore.json +0 -83
  533. package/skills/dori-mode/scripts/test/fixtures/verify-pr/source-fix-without-tests.json +0 -39
  534. package/skills/dori-mode/scripts/test/fixtures/verify-pr/tests-in-later-commits.json +0 -274
  535. package/skills/dori-mode/scripts/test/fixtures/verify-pr/wrong-commit-email.json +0 -57
  536. package/skills/dori-mode/scripts/test/freshness-git-timeout.fixture.ts +0 -113
  537. package/skills/dori-mode/scripts/test/freshness-git-timeout.test.ts +0 -156
  538. package/skills/dori-mode/scripts/test/freshness-policy.test.ts +0 -250
  539. package/skills/dori-mode/scripts/test/freshness-receipts.test.ts +0 -222
  540. package/skills/dori-mode/scripts/test/freshness.test.ts +0 -167
  541. package/skills/dori-mode/scripts/test/hardening-ceilings.test.ts +0 -142
  542. package/skills/dori-mode/scripts/test/hardening-cost.test.ts +0 -134
  543. package/skills/dori-mode/scripts/test/hardening.test.ts +0 -120
  544. package/skills/dori-mode/scripts/test/hc-runner.ts +0 -86
  545. package/skills/dori-mode/scripts/test/host-cgroup.test.ts +0 -185
  546. package/skills/dori-mode/scripts/test/host-sampling.test.ts +0 -105
  547. package/skills/dori-mode/scripts/test/inbound-activity-cli.test.ts +0 -64
  548. package/skills/dori-mode/scripts/test/lane-messenger-env.test.ts +0 -98
  549. package/skills/dori-mode/scripts/test/lane-policy-cli.test.ts +0 -184
  550. package/skills/dori-mode/scripts/test/lane-policy-launch.test.ts +0 -168
  551. package/skills/dori-mode/scripts/test/lane-policy.test.ts +0 -197
  552. package/skills/dori-mode/scripts/test/lane-race.test.ts +0 -247
  553. package/skills/dori-mode/scripts/test/launch-brief-restore.test.ts +0 -94
  554. package/skills/dori-mode/scripts/test/launch-brief.test.ts +0 -234
  555. package/skills/dori-mode/scripts/test/launch-context.test.ts +0 -97
  556. package/skills/dori-mode/scripts/test/launch-finished.test.ts +0 -60
  557. package/skills/dori-mode/scripts/test/launch-generated-recovery.test.ts +0 -218
  558. package/skills/dori-mode/scripts/test/launch-goal-proof.test.ts +0 -69
  559. package/skills/dori-mode/scripts/test/launch-goal.test.ts +0 -89
  560. package/skills/dori-mode/scripts/test/launch-model-compat.test.ts +0 -111
  561. package/skills/dori-mode/scripts/test/launch-model.test.ts +0 -176
  562. package/skills/dori-mode/scripts/test/launch-queue-cwd.test.ts +0 -105
  563. package/skills/dori-mode/scripts/test/launch-queue-fixture.ts +0 -109
  564. package/skills/dori-mode/scripts/test/launch-queue-races.test.ts +0 -226
  565. package/skills/dori-mode/scripts/test/launch-queue.test.ts +0 -150
  566. package/skills/dori-mode/scripts/test/launch-review.test.ts +0 -240
  567. package/skills/dori-mode/scripts/test/launch-selection.test.ts +0 -202
  568. package/skills/dori-mode/scripts/test/launch-serialization.test.ts +0 -62
  569. package/skills/dori-mode/scripts/test/launch-startup-wait.test.ts +0 -220
  570. package/skills/dori-mode/scripts/test/launch-template.test.ts +0 -248
  571. package/skills/dori-mode/scripts/test/lesson-cli-global.test.ts +0 -214
  572. package/skills/dori-mode/scripts/test/lesson-cli.test.ts +0 -168
  573. package/skills/dori-mode/scripts/test/lesson-flow.test.ts +0 -226
  574. package/skills/dori-mode/scripts/test/lessons.test.ts +0 -249
  575. package/skills/dori-mode/scripts/test/lifecycle-bound-readback.test.ts +0 -144
  576. package/skills/dori-mode/scripts/test/lifecycle-cli.test.ts +0 -77
  577. package/skills/dori-mode/scripts/test/lifecycle-close-hc-guard.test.ts +0 -170
  578. package/skills/dori-mode/scripts/test/lifecycle-close-legacy.test.ts +0 -155
  579. package/skills/dori-mode/scripts/test/lifecycle-close-readiness.test.ts +0 -190
  580. package/skills/dori-mode/scripts/test/lifecycle-close-recovery.test.ts +0 -224
  581. package/skills/dori-mode/scripts/test/lifecycle-close-retired.test.ts +0 -93
  582. package/skills/dori-mode/scripts/test/lifecycle-delivery-peer.test.ts +0 -120
  583. package/skills/dori-mode/scripts/test/lifecycle-fixture.ts +0 -231
  584. package/skills/dori-mode/scripts/test/lifecycle-generation-repair.test.ts +0 -196
  585. package/skills/dori-mode/scripts/test/lifecycle-process-guard.test.ts +0 -128
  586. package/skills/dori-mode/scripts/test/lifecycle-process-identity.test.ts +0 -142
  587. package/skills/dori-mode/scripts/test/lifecycle-quiescence-gap.test.ts +0 -152
  588. package/skills/dori-mode/scripts/test/lifecycle-recovery-repair.test.ts +0 -249
  589. package/skills/dori-mode/scripts/test/lifecycle-review.test.ts +0 -189
  590. package/skills/dori-mode/scripts/test/lifecycle-session-header.test.ts +0 -79
  591. package/skills/dori-mode/scripts/test/lifecycle-terminal-repair.test.ts +0 -237
  592. package/skills/dori-mode/scripts/test/lifecycle.test.ts +0 -198
  593. package/skills/dori-mode/scripts/test/loop-flag.test.ts +0 -58
  594. package/skills/dori-mode/scripts/test/messenger-certainty.test.ts +0 -196
  595. package/skills/dori-mode/scripts/test/messenger-local-receipt.test.ts +0 -71
  596. package/skills/dori-mode/scripts/test/messenger-presence.test.ts +0 -129
  597. package/skills/dori-mode/scripts/test/messenger-receipt-boundaries.test.ts +0 -102
  598. package/skills/dori-mode/scripts/test/messenger-reconnect.test.ts +0 -96
  599. package/skills/dori-mode/scripts/test/messenger.test.ts +0 -220
  600. package/skills/dori-mode/scripts/test/omp-launch-fixture.ts +0 -163
  601. package/skills/dori-mode/scripts/test/omp-launch.test.ts +0 -123
  602. package/skills/dori-mode/scripts/test/omp-pause.test.ts +0 -139
  603. package/skills/dori-mode/scripts/test/omp-session.test.ts +0 -250
  604. package/skills/dori-mode/scripts/test/omp-source-session.test.ts +0 -243
  605. package/skills/dori-mode/scripts/test/owes-concurrency.test.ts +0 -178
  606. package/skills/dori-mode/scripts/test/owes-recovery.test.ts +0 -67
  607. package/skills/dori-mode/scripts/test/owes-reminder-cli.test.ts +0 -76
  608. package/skills/dori-mode/scripts/test/owes-request.test.ts +0 -246
  609. package/skills/dori-mode/scripts/test/owes.test.ts +0 -236
  610. package/skills/dori-mode/scripts/test/pause.test.ts +0 -204
  611. package/skills/dori-mode/scripts/test/post-failed.test.ts +0 -63
  612. package/skills/dori-mode/scripts/test/pr-watch-fakes.ts +0 -121
  613. package/skills/dori-mode/scripts/test/pr-watch-lifecycle.test.ts +0 -236
  614. package/skills/dori-mode/scripts/test/pr-watch-track.test.ts +0 -192
  615. package/skills/dori-mode/scripts/test/pr-watch.test.ts +0 -185
  616. package/skills/dori-mode/scripts/test/quota.test.ts +0 -250
  617. package/skills/dori-mode/scripts/test/recall-cli.test.ts +0 -157
  618. package/skills/dori-mode/scripts/test/recall-ledger.test.ts +0 -240
  619. package/skills/dori-mode/scripts/test/recall-text.test.ts +0 -129
  620. package/skills/dori-mode/scripts/test/record-discord-gateway.ts +0 -40
  621. package/skills/dori-mode/scripts/test/record-discord-inbound.ts +0 -83
  622. package/skills/dori-mode/scripts/test/record-discord.ts +0 -73
  623. package/skills/dori-mode/scripts/test/record-fetch.ts +0 -34
  624. package/skills/dori-mode/scripts/test/record-gateway.ts +0 -132
  625. package/skills/dori-mode/scripts/test/record-inbound-activity-failure.ts +0 -27
  626. package/skills/dori-mode/scripts/test/record-slack-activity-backlog.ts +0 -42
  627. package/skills/dori-mode/scripts/test/record-telegram-epoch.ts +0 -41
  628. package/skills/dori-mode/scripts/test/record-telegram-startup.ts +0 -49
  629. package/skills/dori-mode/scripts/test/registry-read-removal.test.ts +0 -60
  630. package/skills/dori-mode/scripts/test/registry-transition.test.ts +0 -55
  631. package/skills/dori-mode/scripts/test/relayed-cli.test.ts +0 -128
  632. package/skills/dori-mode/scripts/test/reports-freshness.test.ts +0 -206
  633. package/skills/dori-mode/scripts/test/reports.test.ts +0 -236
  634. package/skills/dori-mode/scripts/test/repository-env.test.ts +0 -250
  635. package/skills/dori-mode/scripts/test/request-corruption.test.ts +0 -183
  636. package/skills/dori-mode/scripts/test/request-delivery.test.ts +0 -230
  637. package/skills/dori-mode/scripts/test/request-fixtures.ts +0 -48
  638. package/skills/dori-mode/scripts/test/request-journal.test.ts +0 -208
  639. package/skills/dori-mode/scripts/test/request-launch-env.test.ts +0 -45
  640. package/skills/dori-mode/scripts/test/request-launch-generation.test.ts +0 -34
  641. package/skills/dori-mode/scripts/test/request-launch-input.test.ts +0 -111
  642. package/skills/dori-mode/scripts/test/request-launch.test.ts +0 -242
  643. package/skills/dori-mode/scripts/test/request-lifecycle.test.ts +0 -228
  644. package/skills/dori-mode/scripts/test/request-origin-cli.test.ts +0 -118
  645. package/skills/dori-mode/scripts/test/reserved-key.test.ts +0 -92
  646. package/skills/dori-mode/scripts/test/routing.test.ts +0 -48
  647. package/skills/dori-mode/scripts/test/runtime-import.test.ts +0 -17
  648. package/skills/dori-mode/scripts/test/schedule-cli.test.ts +0 -229
  649. package/skills/dori-mode/scripts/test/schedule-delivery.test.ts +0 -239
  650. package/skills/dori-mode/scripts/test/schedule-post-budget.test.ts +0 -78
  651. package/skills/dori-mode/scripts/test/schedule-state.test.ts +0 -125
  652. package/skills/dori-mode/scripts/test/scheduler-delivery-state.test.ts +0 -166
  653. package/skills/dori-mode/scripts/test/scheduler.test.ts +0 -234
  654. package/skills/dori-mode/scripts/test/send-cli.test.ts +0 -90
  655. package/skills/dori-mode/scripts/test/session-id.test.ts +0 -57
  656. package/skills/dori-mode/scripts/test/session-observation-actions.test.ts +0 -105
  657. package/skills/dori-mode/scripts/test/session-observation.test.ts +0 -129
  658. package/skills/dori-mode/scripts/test/sessions.test.ts +0 -163
  659. package/skills/dori-mode/scripts/test/signals.test.ts +0 -157
  660. package/skills/dori-mode/scripts/test/slack-activity-backlog.test.ts +0 -62
  661. package/skills/dori-mode/scripts/test/slack-cli.test.ts +0 -249
  662. package/skills/dori-mode/scripts/test/slack-cursor-batch.test.ts +0 -146
  663. package/skills/dori-mode/scripts/test/slack-inbound.test.ts +0 -226
  664. package/skills/dori-mode/scripts/test/slack-route-fakes.ts +0 -47
  665. package/skills/dori-mode/scripts/test/slack-route-inbound.test.ts +0 -127
  666. package/skills/dori-mode/scripts/test/slack-route.test.ts +0 -141
  667. package/skills/dori-mode/scripts/test/slack-token-home.test.ts +0 -87
  668. package/skills/dori-mode/scripts/test/slack-token-read.test.ts +0 -165
  669. package/skills/dori-mode/scripts/test/slack-token.test.ts +0 -226
  670. package/skills/dori-mode/scripts/test/startup-screen.test.ts +0 -182
  671. package/skills/dori-mode/scripts/test/status-boundaries.test.ts +0 -167
  672. package/skills/dori-mode/scripts/test/status-cli.test.ts +0 -207
  673. package/skills/dori-mode/scripts/test/status-review.test.ts +0 -168
  674. package/skills/dori-mode/scripts/test/status.test.ts +0 -248
  675. package/skills/dori-mode/scripts/test/supervision-budget.test.ts +0 -216
  676. package/skills/dori-mode/scripts/test/supervision-confirmation.test.ts +0 -199
  677. package/skills/dori-mode/scripts/test/supervision-coverage.fixture.ts +0 -92
  678. package/skills/dori-mode/scripts/test/supervision-coverage.test.ts +0 -193
  679. package/skills/dori-mode/scripts/test/supervision-delivery.test.ts +0 -144
  680. package/skills/dori-mode/scripts/test/supervision-errors.test.ts +0 -180
  681. package/skills/dori-mode/scripts/test/supervision-evidence-boundary.test.ts +0 -106
  682. package/skills/dori-mode/scripts/test/supervision-evidence-review.test.ts +0 -248
  683. package/skills/dori-mode/scripts/test/supervision-explicit-activity.test.ts +0 -217
  684. package/skills/dori-mode/scripts/test/supervision-freshness-race.test.ts +0 -105
  685. package/skills/dori-mode/scripts/test/supervision-git-boundaries.test.ts +0 -211
  686. package/skills/dori-mode/scripts/test/supervision-git-fixtures.ts +0 -128
  687. package/skills/dori-mode/scripts/test/supervision-git.test.ts +0 -161
  688. package/skills/dori-mode/scripts/test/supervision-integration.fixture.ts +0 -134
  689. package/skills/dori-mode/scripts/test/supervision-integration.test.ts +0 -178
  690. package/skills/dori-mode/scripts/test/supervision-interruption.test.ts +0 -96
  691. package/skills/dori-mode/scripts/test/supervision-nested-git.test.ts +0 -214
  692. package/skills/dori-mode/scripts/test/supervision-overlap.test.ts +0 -175
  693. package/skills/dori-mode/scripts/test/supervision-path-identity.test.ts +0 -154
  694. package/skills/dori-mode/scripts/test/supervision-posting.test.ts +0 -55
  695. package/skills/dori-mode/scripts/test/supervision-recovery.test.ts +0 -161
  696. package/skills/dori-mode/scripts/test/supervision-resample-fixture.ts +0 -60
  697. package/skills/dori-mode/scripts/test/supervision-resample-repair.test.ts +0 -229
  698. package/skills/dori-mode/scripts/test/supervision-usage.test.ts +0 -48
  699. package/skills/dori-mode/scripts/test/supervision.test.ts +0 -249
  700. package/skills/dori-mode/scripts/test/sweeps-footer.test.ts +0 -176
  701. package/skills/dori-mode/scripts/test/sweeps-host.test.ts +0 -122
  702. package/skills/dori-mode/scripts/test/sweeps-launch.test.ts +0 -226
  703. package/skills/dori-mode/scripts/test/sweeps.test.ts +0 -202
  704. package/skills/dori-mode/scripts/test/sync-cache.test.ts +0 -159
  705. package/skills/dori-mode/scripts/test/sync-history.test.ts +0 -51
  706. package/skills/dori-mode/scripts/test/sync-observation.test.ts +0 -191
  707. package/skills/dori-mode/scripts/test/telegram-boundary-matrix.test.ts +0 -97
  708. package/skills/dori-mode/scripts/test/telegram-inbound-epoch-cli.test.ts +0 -162
  709. package/skills/dori-mode/scripts/test/telegram-inbound-epoch.test.ts +0 -203
  710. package/skills/dori-mode/scripts/test/telegram-inbound-fakes.ts +0 -38
  711. package/skills/dori-mode/scripts/test/telegram-inbound-loop.test.ts +0 -235
  712. package/skills/dori-mode/scripts/test/telegram-inbound-media.test.ts +0 -195
  713. package/skills/dori-mode/scripts/test/telegram-inbound-state.test.ts +0 -61
  714. package/skills/dori-mode/scripts/test/telegram-inbound-win32-token.test.ts +0 -42
  715. package/skills/dori-mode/scripts/test/telegram-inbound-win32.test.ts +0 -228
  716. package/skills/dori-mode/scripts/test/telegram-inbound.test.ts +0 -216
  717. package/skills/dori-mode/scripts/test/telegram-lag.test.ts +0 -164
  718. package/skills/dori-mode/scripts/test/telegram-line.test.ts +0 -27
  719. package/skills/dori-mode/scripts/test/telegram-send.test.ts +0 -112
  720. package/skills/dori-mode/scripts/test/telegram-startup.test.ts +0 -240
  721. package/skills/dori-mode/scripts/test/telegram-win32-fixtures.ts +0 -51
  722. package/skills/dori-mode/scripts/test/tell-fence-flow.test.ts +0 -138
  723. package/skills/dori-mode/scripts/test/tell-fence-lifecycle.test.ts +0 -122
  724. package/skills/dori-mode/scripts/test/tell-fence-monitor.test.ts +0 -232
  725. package/skills/dori-mode/scripts/test/tell-fence-process.test.ts +0 -100
  726. package/skills/dori-mode/scripts/test/tell-fence.test.ts +0 -208
  727. package/skills/dori-mode/scripts/test/tell-race.test.ts +0 -187
  728. package/skills/dori-mode/scripts/test/tell.test.ts +0 -141
  729. package/skills/dori-mode/scripts/test/thread-groups.test.ts +0 -228
  730. package/skills/dori-mode/scripts/test/thread-ledger-cli.test.ts +0 -112
  731. package/skills/dori-mode/scripts/test/thread-ledger-scope.test.ts +0 -132
  732. package/skills/dori-mode/scripts/test/thread-ledger.test.ts +0 -102
  733. package/skills/dori-mode/scripts/test/thread-status-cli.test.ts +0 -129
  734. package/skills/dori-mode/scripts/test/thread-watch.test.ts +0 -184
  735. package/skills/dori-mode/scripts/test/tool-completion.test.ts +0 -172
  736. package/skills/dori-mode/scripts/test/tool-evidence-cwd.test.ts +0 -126
  737. package/skills/dori-mode/scripts/test/tool-evidence.test.ts +0 -209
  738. package/skills/dori-mode/scripts/test/tool-fingerprint.test.ts +0 -96
  739. package/skills/dori-mode/scripts/test/transcribe-boundary.test.ts +0 -237
  740. package/skills/dori-mode/scripts/test/transcribe-stream.test.ts +0 -66
  741. package/skills/dori-mode/scripts/test/usage-cli.test.ts +0 -154
  742. package/skills/dori-mode/scripts/test/usage-close.test.ts +0 -60
  743. package/skills/dori-mode/scripts/test/usage-fakes.ts +0 -71
  744. package/skills/dori-mode/scripts/test/usage-file.test.ts +0 -87
  745. package/skills/dori-mode/scripts/test/usage-fork.test.ts +0 -78
  746. package/skills/dori-mode/scripts/test/usage-native.test.ts +0 -178
  747. package/skills/dori-mode/scripts/test/usage-omp.test.ts +0 -142
  748. package/skills/dori-mode/scripts/test/usage-provenance.test.ts +0 -115
  749. package/skills/dori-mode/scripts/test/usage-seance-history.test.ts +0 -61
  750. package/skills/dori-mode/scripts/test/usage-supervision.test.ts +0 -75
  751. package/skills/dori-mode/scripts/test/usage-tasks.test.ts +0 -148
  752. package/skills/dori-mode/scripts/test/verify-pr-github.test.ts +0 -230
  753. package/skills/dori-mode/scripts/test/verify-pr-setup.ts +0 -95
  754. package/skills/dori-mode/scripts/test/verify-pr.test.ts +0 -216
  755. package/skills/dori-mode/scripts/test/voice-audio.test.ts +0 -101
  756. package/skills/dori-mode/scripts/test/voice-backend-safety.test.ts +0 -142
  757. package/skills/dori-mode/scripts/test/voice-backend-usage.test.ts +0 -124
  758. package/skills/dori-mode/scripts/test/voice-backend.test.ts +0 -134
  759. package/skills/dori-mode/scripts/test/voice-boundaries.test.ts +0 -119
  760. package/skills/dori-mode/scripts/test/voice-commentary.test.ts +0 -245
  761. package/skills/dori-mode/scripts/test/voice-discord-contract.test.ts +0 -85
  762. package/skills/dori-mode/scripts/test/voice-discord-fakes.ts +0 -248
  763. package/skills/dori-mode/scripts/test/voice-discord-receive-library.test.ts +0 -180
  764. package/skills/dori-mode/scripts/test/voice-discord-receive.test.ts +0 -201
  765. package/skills/dori-mode/scripts/test/voice-discord-safety.test.ts +0 -64
  766. package/skills/dori-mode/scripts/test/voice-discord.test.ts +0 -216
  767. package/skills/dori-mode/scripts/test/voice-fixture.ts +0 -81
  768. package/skills/dori-mode/scripts/test/voice-gateway-resume.test.ts +0 -193
  769. package/skills/dori-mode/scripts/test/voice-live-contract.test.ts +0 -240
  770. package/skills/dori-mode/scripts/test/voice-live11.test.ts +0 -237
  771. package/skills/dori-mode/scripts/test/voice-native-output-fixture.ts +0 -150
  772. package/skills/dori-mode/scripts/test/voice-native-output.test.ts +0 -121
  773. package/skills/dori-mode/scripts/test/voice-provider.test.ts +0 -197
  774. package/skills/dori-mode/scripts/test/voice-relay.test.ts +0 -248
  775. package/skills/dori-mode/scripts/test/voice-replies-tail.test.ts +0 -171
  776. package/skills/dori-mode/scripts/test/voice-session-fixture.ts +0 -77
  777. package/skills/dori-mode/scripts/test/voice-session-safety.test.ts +0 -171
  778. package/skills/dori-mode/scripts/test/voice-session.test.ts +0 -134
  779. package/skills/dori-mode/scripts/test/voice-summary-admission.test.ts +0 -80
  780. package/skills/dori-mode/scripts/test/voice-summary-usage.test.ts +0 -82
  781. package/skills/dori-mode/scripts/test/voice-tools.test.ts +0 -164
  782. package/skills/dori-mode/scripts/test/worklog-records.test.ts +0 -190
  783. package/skills/dori-mode/scripts/test/worklog.test.ts +0 -151
  784. package/skills/dori-mode/scripts/tsconfig.json +0 -8
  785. package/src/backlog.ts +0 -154
  786. package/src/cli-args.ts +0 -97
  787. package/src/cli-lock.ts +0 -40
  788. package/src/cli-loops.ts +0 -155
  789. package/src/cli-owner.ts +0 -79
  790. package/src/cli-up.ts +0 -88
  791. package/src/cli.ts +0 -188
  792. package/src/delivery.ts +0 -28
  793. package/src/duty-inbox.ts +0 -46
  794. package/src/duty.ts +0 -217
  795. package/src/fit.ts +0 -92
  796. package/src/gate.ts +0 -110
  797. package/src/harness.ts +0 -161
  798. package/src/hooks.ts +0 -133
  799. package/src/inbox-files.ts +0 -136
  800. package/src/inbox-forward.ts +0 -178
  801. package/src/inbox-held.ts +0 -91
  802. package/src/inbox-lock.ts +0 -79
  803. package/src/inbox-spool.ts +0 -167
  804. package/src/inbox.ts +0 -237
  805. package/src/lanes.ts +0 -181
  806. package/src/lock-claim.ts +0 -73
  807. package/src/lock-list.ts +0 -57
  808. package/src/lock-owner.ts +0 -159
  809. package/src/lock-queue.ts +0 -158
  810. package/src/lock.ts +0 -106
  811. package/src/loop-audit.ts +0 -44
  812. package/src/loop-lock.ts +0 -101
  813. package/src/loop.ts +0 -222
  814. package/src/migrate-brief.ts +0 -47
  815. package/src/migrate-capture.ts +0 -89
  816. package/src/migrate-inbox.ts +0 -111
  817. package/src/migrate-swap.ts +0 -101
  818. package/src/migrate.ts +0 -210
  819. package/src/owner-check.ts +0 -115
  820. package/src/owner-distill.ts +0 -62
  821. package/src/owner.ts +0 -235
  822. package/src/platform/adapter.ts +0 -132
  823. package/src/platform/darwin.ts +0 -206
  824. package/src/platform/index.ts +0 -69
  825. package/src/platform/linux.ts +0 -150
  826. package/src/platform/shared.ts +0 -31
  827. package/src/platform/windows.ts +0 -76
  828. package/src/progress.ts +0 -132
  829. package/src/refs.ts +0 -12
  830. package/src/refusal.ts +0 -2
  831. package/src/release/archive.ts +0 -110
  832. package/src/release/automatic-cli.ts +0 -42
  833. package/src/release/automatic-policy.ts +0 -96
  834. package/src/release/automatic-state.ts +0 -55
  835. package/src/release/automatic.ts +0 -189
  836. package/src/release/bundle.ts +0 -132
  837. package/src/release/cli.ts +0 -248
  838. package/src/release/discovery.ts +0 -110
  839. package/src/release/files.ts +0 -245
  840. package/src/release/install.ts +0 -204
  841. package/src/release/launch-leases.ts +0 -79
  842. package/src/release/live.ts +0 -76
  843. package/src/release/manifest.ts +0 -243
  844. package/src/release/native-cache-cli.ts +0 -75
  845. package/src/release/native-cache-lease.ts +0 -250
  846. package/src/release/native-cache-prune.ts +0 -206
  847. package/src/release/native-cache-quarantine.ts +0 -150
  848. package/src/release/native-cache-refs.ts +0 -161
  849. package/src/release/native-cache-stage.ts +0 -41
  850. package/src/release/native-cache-uses.ts +0 -172
  851. package/src/release/native-cache.ts +0 -132
  852. package/src/release/native-export.ts +0 -46
  853. package/src/release/native.ts +0 -245
  854. package/src/release/process-cwd.ts +0 -125
  855. package/src/release/process-files.ts +0 -86
  856. package/src/release/provision.ts +0 -191
  857. package/src/release/references.ts +0 -188
  858. package/src/release/runtime.ts +0 -208
  859. package/src/release/setup.ts +0 -77
  860. package/src/release/source-bundle-update.ts +0 -133
  861. package/src/release/source-bundle.ts +0 -241
  862. package/src/release/source-checkout.ts +0 -56
  863. package/src/release/state.ts +0 -219
  864. package/src/release/types.ts +0 -34
  865. package/src/release/version.ts +0 -7
  866. package/src/remote/client.ts +0 -138
  867. package/src/remote/policy.ts +0 -53
  868. package/src/remote/socket-path.ts +0 -38
  869. package/src/remote/transport.ts +0 -65
  870. package/src/runtime/exec.ts +0 -35
  871. package/src/runtime/foreground.ts +0 -50
  872. package/src/runtime/group.ts +0 -17
  873. package/src/runtime/hc/deliver.ts +0 -129
  874. package/src/runtime/hc/exec.ts +0 -79
  875. package/src/runtime/hc/index.ts +0 -102
  876. package/src/runtime/hc/probe.ts +0 -119
  877. package/src/runtime/hc/sessions.ts +0 -168
  878. package/src/runtime/headless-broker.ts +0 -250
  879. package/src/runtime/headless-protocol.ts +0 -238
  880. package/src/runtime/headless-record.ts +0 -241
  881. package/src/runtime/headless-remote.ts +0 -222
  882. package/src/runtime/headless-rpc.ts +0 -224
  883. package/src/runtime/headless.ts +0 -250
  884. package/src/runtime/herdr/deliver.ts +0 -172
  885. package/src/runtime/herdr/exec.ts +0 -46
  886. package/src/runtime/herdr/index.ts +0 -94
  887. package/src/runtime/herdr/probe.ts +0 -134
  888. package/src/runtime/herdr/sessions.ts +0 -126
  889. package/src/runtime/omp-argv.ts +0 -172
  890. package/src/runtime/omp-options.ts +0 -41
  891. package/src/runtime/omp-prefixes.ts +0 -122
  892. package/src/runtime/omp.ts +0 -170
  893. package/src/runtime/registry.ts +0 -60
  894. package/src/runtime/select.ts +0 -86
  895. package/src/runtime/types.ts +0 -156
  896. package/src/setup-files.ts +0 -131
  897. package/src/setup-readback.ts +0 -61
  898. package/src/status-view.ts +0 -74
  899. package/src/store-journal.ts +0 -68
  900. package/src/store-types.ts +0 -140
  901. package/src/store.ts +0 -249
  902. package/src/target.ts +0 -29
  903. package/src/telemetry-otlp.ts +0 -78
  904. package/src/telemetry.ts +0 -203
  905. package/src/update/app-state.ts +0 -107
  906. package/src/update/cli.ts +0 -133
  907. package/src/update/command-output.ts +0 -158
  908. package/src/update/config.ts +0 -31
  909. package/src/update/controller.ts +0 -241
  910. package/src/update/deployment-active.ts +0 -155
  911. package/src/update/deployment-cli.ts +0 -107
  912. package/src/update/deployment-config.ts +0 -178
  913. package/src/update/deployment-files.ts +0 -189
  914. package/src/update/deployment-handoff.ts +0 -122
  915. package/src/update/deployment-health.ts +0 -146
  916. package/src/update/deployment-hold.ts +0 -90
  917. package/src/update/deployment-launch.ts +0 -202
  918. package/src/update/deployment-launcher.ts +0 -23
  919. package/src/update/deployment-legacy-monitors.ts +0 -196
  920. package/src/update/deployment-lock.ts +0 -28
  921. package/src/update/deployment-monitor-receipts.ts +0 -197
  922. package/src/update/deployment-monitors.ts +0 -188
  923. package/src/update/deployment-native-ui.ts +0 -111
  924. package/src/update/deployment-native.ts +0 -250
  925. package/src/update/deployment-prepare.ts +0 -165
  926. package/src/update/deployment-prior.ts +0 -95
  927. package/src/update/deployment-process.ts +0 -202
  928. package/src/update/deployment-quiesce.ts +0 -71
  929. package/src/update/deployment-restart-state.ts +0 -107
  930. package/src/update/deployment-restart.ts +0 -137
  931. package/src/update/deployment-rollback.ts +0 -139
  932. package/src/update/deployment-run.ts +0 -242
  933. package/src/update/deployment-shell.ts +0 -62
  934. package/src/update/deployment-signal.ts +0 -32
  935. package/src/update/deployment-toolchain.ts +0 -133
  936. package/src/update/deployment-types.ts +0 -168
  937. package/src/update/deployment.ts +0 -4
  938. package/src/update/detection-process.ts +0 -198
  939. package/src/update/environment.ts +0 -140
  940. package/src/update/github-ci.ts +0 -115
  941. package/src/update/load.ts +0 -250
  942. package/src/update/native-argv.ts +0 -88
  943. package/src/update/native-prompts.ts +0 -58
  944. package/src/update/pipeline.ts +0 -86
  945. package/src/update/pre-action-notice.ts +0 -118
  946. package/src/update/prepare.ts +0 -164
  947. package/src/update/proc.ts +0 -62
  948. package/src/update/process.ts +0 -202
  949. package/src/update/promotion.ts +0 -145
  950. package/src/update/publish-basis.ts +0 -85
  951. package/src/update/publish-config.ts +0 -122
  952. package/src/update/publish-export.ts +0 -177
  953. package/src/update/publish-github.ts +0 -232
  954. package/src/update/publish-lock.ts +0 -66
  955. package/src/update/publish-process.ts +0 -149
  956. package/src/update/publish-types.ts +0 -65
  957. package/src/update/publish.ts +0 -250
  958. package/src/update/recovery.ts +0 -248
  959. package/src/update/report.ts +0 -207
  960. package/src/update/response.ts +0 -59
  961. package/src/update/review.ts +0 -124
  962. package/src/update/reviewer-guard.ts +0 -131
  963. package/src/update/source-activity.ts +0 -152
  964. package/src/update/source-pin.ts +0 -9
  965. package/src/update/source-update-candidate.ts +0 -54
  966. package/src/update/source-update-cli.ts +0 -156
  967. package/src/update/source-update-config.ts +0 -110
  968. package/src/update/source-update-git.ts +0 -92
  969. package/src/update/source-update-idle.ts +0 -89
  970. package/src/update/source-update-run.ts +0 -215
  971. package/src/update/source-update-state.ts +0 -159
  972. package/src/update/source-update-target.ts +0 -100
  973. package/src/update/source.ts +0 -246
  974. package/src/update/state.ts +0 -231
  975. package/src/update/types.ts +0 -170
  976. package/src/update/worker-guard.ts +0 -147
  977. package/test/ambiguous-delivery.test.ts +0 -234
  978. package/test/backlog.test.ts +0 -105
  979. package/test/bin-mode.test.ts +0 -27
  980. package/test/ci-fixtures.test.ts +0 -114
  981. package/test/ci-install-herdr.test.ts +0 -127
  982. package/test/cla-precheck.test.ts +0 -117
  983. package/test/cli-args.test.ts +0 -37
  984. package/test/cli-native-admission.test.ts +0 -131
  985. package/test/duty-lock.test.ts +0 -31
  986. package/test/duty-notice-epoch.test.ts +0 -169
  987. package/test/duty-notice-lock.test.ts +0 -107
  988. package/test/duty-notice-once.test.ts +0 -172
  989. package/test/duty-progress-epochs.test.ts +0 -124
  990. package/test/duty-progress.test.ts +0 -243
  991. package/test/duty-prompts-access.test.ts +0 -126
  992. package/test/duty-reference-delivery.test.ts +0 -241
  993. package/test/duty-runtime.test.ts +0 -61
  994. package/test/duty-waiting-target.test.ts +0 -238
  995. package/test/duty-waiting-text.test.ts +0 -104
  996. package/test/duty-waiting-upgrade.test.ts +0 -72
  997. package/test/duty-waiting.test.ts +0 -222
  998. package/test/duty.test.ts +0 -178
  999. package/test/e2e-hc-deploy.test.ts +0 -156
  1000. package/test/e2e-hc-setup.ts +0 -123
  1001. package/test/e2e-hc.test.ts +0 -138
  1002. package/test/e2e-migrate.test.ts +0 -146
  1003. package/test/e2e.test.ts +0 -144
  1004. package/test/fake-hc.ts +0 -185
  1005. package/test/fake.ts +0 -189
  1006. package/test/fixtures/fake-agent-7501.sh +0 -14
  1007. package/test/fixtures/fake-agent.sh +0 -8
  1008. package/test/fixtures/headless-rpc.ts +0 -86
  1009. package/test/fixtures/inbox-lock-reclaimer.test.ts +0 -22
  1010. package/test/fixtures/lock-claim-reclaimer.test.ts +0 -21
  1011. package/test/fixtures/omp-native-host/bun.lock +0 -151
  1012. package/test/fixtures/omp-native-host/compose.ts +0 -250
  1013. package/test/fixtures/omp-native-host/head-admission.ts +0 -128
  1014. package/test/fixtures/omp-native-host/host.ts +0 -20
  1015. package/test/fixtures/omp-native-host/launch-model.ts +0 -18
  1016. package/test/fixtures/omp-native-host/native-message-head.ts +0 -92
  1017. package/test/fixtures/omp-native-host/package.json +0 -8
  1018. package/test/fixtures/omp-native-host/policy-host.ts +0 -123
  1019. package/test/fixtures/omp-native-host/policy-worker.ts +0 -12
  1020. package/test/fixtures/omp-native-host/prompt-matrix.ts +0 -249
  1021. package/test/fixtures/omp-native-host/request-run.ts +0 -56
  1022. package/test/fixtures/omp-native-host/required-source.ts +0 -126
  1023. package/test/fixtures/release-isolated-source-bundle.test.ts +0 -111
  1024. package/test/fixtures/remote-attach.ts +0 -25
  1025. package/test/fixtures/remote-endpoint.ts +0 -67
  1026. package/test/fixtures/remote-test-model.ts +0 -44
  1027. package/test/fixtures/runtime-headless.ts +0 -77
  1028. package/test/fixtures/screens/omo-dialog.txt +0 -12
  1029. package/test/fixtures/screens/omo-draft.txt +0 -7
  1030. package/test/fixtures/screens/omo-idle-live-monitors.txt +0 -9
  1031. package/test/fixtures/screens/omo-turn.txt +0 -9
  1032. package/test/gate.test.ts +0 -94
  1033. package/test/harness-lane-messenger-env.test.ts +0 -62
  1034. package/test/harness-omp.test.ts +0 -124
  1035. package/test/harness-setup.ts +0 -36
  1036. package/test/hc-rig.ts +0 -28
  1037. package/test/herdr-recorder.ts +0 -32
  1038. package/test/hooks.test.ts +0 -228
  1039. package/test/inbox-append-lock.test.ts +0 -180
  1040. package/test/inbox-commit-race.test.ts +0 -101
  1041. package/test/inbox-followups.test.ts +0 -139
  1042. package/test/inbox-forward.test.ts +0 -161
  1043. package/test/inbox-lead-intent.test.ts +0 -145
  1044. package/test/inbox-lock-crash-chain.test.ts +0 -180
  1045. package/test/inbox-lock-takeover.test.ts +0 -76
  1046. package/test/inbox-lock.test.ts +0 -99
  1047. package/test/inbox-owed-dup.test.ts +0 -68
  1048. package/test/inbox-reused-id.test.ts +0 -119
  1049. package/test/inbox-rollback-race.test.ts +0 -94
  1050. package/test/inbox-route-held.test.ts +0 -112
  1051. package/test/inbox-setup.ts +0 -38
  1052. package/test/inbox-spool-race.test.ts +0 -213
  1053. package/test/inbox-target-race.test.ts +0 -51
  1054. package/test/install-bun-path.test.ts +0 -53
  1055. package/test/install-command-collision.test.ts +0 -171
  1056. package/test/install-command-path.test.ts +0 -66
  1057. package/test/install-command-relink.test.ts +0 -114
  1058. package/test/install-configuration.test.ts +0 -250
  1059. package/test/install-consumer-pointer.test.ts +0 -100
  1060. package/test/install-consumer-setup.ts +0 -40
  1061. package/test/install-consumer.test.ts +0 -174
  1062. package/test/install-existing.test.ts +0 -82
  1063. package/test/install-selection.test.ts +0 -124
  1064. package/test/install-setup-safety.test.ts +0 -175
  1065. package/test/install-setup.ts +0 -169
  1066. package/test/install-side-omp-yml.test.ts +0 -179
  1067. package/test/install-side.test.ts +0 -246
  1068. package/test/install-ulw.test.ts +0 -190
  1069. package/test/install.test.ts +0 -140
  1070. package/test/lanes.test.ts +0 -97
  1071. package/test/lock-claim.test.ts +0 -130
  1072. package/test/lock-cli.test.ts +0 -145
  1073. package/test/lock-foreign.test.ts +0 -124
  1074. package/test/lock-queue.test.ts +0 -132
  1075. package/test/lock-race.test.ts +0 -146
  1076. package/test/lock-setup.ts +0 -46
  1077. package/test/lock.test.ts +0 -128
  1078. package/test/loop-lock.test.ts +0 -110
  1079. package/test/loop-setup.ts +0 -21
  1080. package/test/loop.test.ts +0 -240
  1081. package/test/managed-agent-command.test.ts +0 -190
  1082. package/test/managed-command-contract.test.ts +0 -62
  1083. package/test/managed-command-setup.ts +0 -68
  1084. package/test/managed-source-command.test.ts +0 -133
  1085. package/test/migrate-lock-release.test.ts +0 -46
  1086. package/test/migrate-roles.test.ts +0 -139
  1087. package/test/migrate-setup.ts +0 -77
  1088. package/test/migrate.test.ts +0 -224
  1089. package/test/module-graph.test.ts +0 -51
  1090. package/test/native-cache-prune-setup.ts +0 -83
  1091. package/test/native-export.test.ts +0 -168
  1092. package/test/native-file-digest.test.ts +0 -127
  1093. package/test/omp-setup.ts +0 -61
  1094. package/test/owner-distill.test.ts +0 -89
  1095. package/test/owner-recovery.test.ts +0 -183
  1096. package/test/owner.test.ts +0 -186
  1097. package/test/platform-adapter.test.ts +0 -236
  1098. package/test/proc-name.ts +0 -9
  1099. package/test/prompt-authority.test.ts +0 -47
  1100. package/test/prompt-goal-ownership.test.ts +0 -90
  1101. package/test/prompt-progress.test.ts +0 -55
  1102. package/test/prompt-routing.test.ts +0 -40
  1103. package/test/records-upgrade.test.ts +0 -165
  1104. package/test/release-automatic-bound-concurrency.test.ts +0 -78
  1105. package/test/release-automatic-concurrency.test.ts +0 -223
  1106. package/test/release-automatic-launch.test.ts +0 -202
  1107. package/test/release-automatic.test.ts +0 -243
  1108. package/test/release-bootstrap-runtime.test.ts +0 -53
  1109. package/test/release-bootstrap-setup.ts +0 -120
  1110. package/test/release-bootstrap.test.ts +0 -214
  1111. package/test/release-capabilities.test.ts +0 -56
  1112. package/test/release-consumer-discovery.test.ts +0 -117
  1113. package/test/release-consumer-liveness.test.ts +0 -63
  1114. package/test/release-consumer-lock.test.ts +0 -68
  1115. package/test/release-consumer-profile.test.ts +0 -82
  1116. package/test/release-consumer-runtime.test.ts +0 -144
  1117. package/test/release-consumer-security.test.ts +0 -196
  1118. package/test/release-consumer-selection.test.ts +0 -91
  1119. package/test/release-consumer-setup.ts +0 -233
  1120. package/test/release-consumer-side.test.ts +0 -250
  1121. package/test/release-consumer-state.test.ts +0 -122
  1122. package/test/release-consumer-toolchain.test.ts +0 -145
  1123. package/test/release-gate-parallel.test.ts +0 -90
  1124. package/test/release-gate.test.ts +0 -132
  1125. package/test/release-isolated-source-bundle.test.ts +0 -63
  1126. package/test/release-legacy-prerequisite.test.ts +0 -121
  1127. package/test/release-managed-command-env.test.ts +0 -170
  1128. package/test/release-manifest.test.ts +0 -115
  1129. package/test/release-native-cache-bytes.test.ts +0 -35
  1130. package/test/release-native-cache-cwd.test.ts +0 -75
  1131. package/test/release-native-cache-hold.test.ts +0 -161
  1132. package/test/release-native-cache-homes.test.ts +0 -73
  1133. package/test/release-native-cache-late.test.ts +0 -225
  1134. package/test/release-native-cache-lease.test.ts +0 -184
  1135. package/test/release-native-cache-prune-race.test.ts +0 -200
  1136. package/test/release-native-cache-prune-refs.test.ts +0 -207
  1137. package/test/release-native-cache-removal-recovery.test.ts +0 -239
  1138. package/test/release-native-cache-review.test.ts +0 -245
  1139. package/test/release-native-cache-threads.test.ts +0 -218
  1140. package/test/release-native-cache.test.ts +0 -217
  1141. package/test/release-native-recovery-setup.ts +0 -120
  1142. package/test/release-native-recovery.test.ts +0 -213
  1143. package/test/release-producer-setup.ts +0 -120
  1144. package/test/release-publication.test.ts +0 -72
  1145. package/test/release-publish-setup.ts +0 -192
  1146. package/test/release-publish.test.ts +0 -106
  1147. package/test/release-reference-renderer.test.ts +0 -150
  1148. package/test/release-setup-config.test.ts +0 -250
  1149. package/test/release-source-bundle.test.ts +0 -161
  1150. package/test/release-source.test.ts +0 -54
  1151. package/test/release-wrapper-command.test.ts +0 -101
  1152. package/test/remote-hc-native.test.ts +0 -221
  1153. package/test/remote-session.test.ts +0 -208
  1154. package/test/report-evidence-line.test.ts +0 -45
  1155. package/test/request-run-native.test.ts +0 -66
  1156. package/test/resolve-target.test.ts +0 -60
  1157. package/test/runtime-bound-delivery.test.ts +0 -53
  1158. package/test/runtime-core.test.ts +0 -244
  1159. package/test/runtime-exec.test.ts +0 -45
  1160. package/test/runtime-hc-argv.test.ts +0 -32
  1161. package/test/runtime-hc-deliver.test.ts +0 -176
  1162. package/test/runtime-hc-misc.test.ts +0 -147
  1163. package/test/runtime-hc-screen.test.ts +0 -96
  1164. package/test/runtime-hc.test.ts +0 -234
  1165. package/test/runtime-headless-native.test.ts +0 -206
  1166. package/test/runtime-headless-remote.test.ts +0 -128
  1167. package/test/runtime-headless-request.test.ts +0 -74
  1168. package/test/runtime-headless.test.ts +0 -238
  1169. package/test/runtime-herdr-deliver.test.ts +0 -241
  1170. package/test/runtime-herdr-groups.test.ts +0 -39
  1171. package/test/runtime-herdr-screen.test.ts +0 -59
  1172. package/test/runtime-herdr.test.ts +0 -248
  1173. package/test/runtime-omp-source.test.ts +0 -100
  1174. package/test/runtime-omp-timing.test.ts +0 -163
  1175. package/test/runtime-omp-typed.test.ts +0 -74
  1176. package/test/runtime-omp.test.ts +0 -226
  1177. package/test/runtime-select.test.ts +0 -183
  1178. package/test/screen.test.ts +0 -44
  1179. package/test/send-both.test.ts +0 -78
  1180. package/test/send.test.ts +0 -96
  1181. package/test/setup-files.test.ts +0 -187
  1182. package/test/shell-pane.test.ts +0 -202
  1183. package/test/shq.test.ts +0 -11
  1184. package/test/socket-budget.test.ts +0 -20
  1185. package/test/socket-budget.ts +0 -13
  1186. package/test/source-bundle-readonly.test.ts +0 -28
  1187. package/test/source-bundle-setup.ts +0 -157
  1188. package/test/source-bundle-update.test.ts +0 -125
  1189. package/test/source-bundle.test.ts +0 -249
  1190. package/test/status-view.test.ts +0 -150
  1191. package/test/telemetry-delivery.test.ts +0 -141
  1192. package/test/telemetry.test.ts +0 -185
  1193. package/test/terminal-context-migrate.test.ts +0 -126
  1194. package/test/terminal-context-setup.ts +0 -121
  1195. package/test/terminal-context-skill.test.ts +0 -135
  1196. package/test/terminal-context.test.ts +0 -136
  1197. package/test/terminal-managed-setup.ts +0 -102
  1198. package/test/ulw-canonical-repository.test.ts +0 -43
  1199. package/test/up.test.ts +0 -98
  1200. package/test/update-admission.test.ts +0 -250
  1201. package/test/update-app-state.test.ts +0 -88
  1202. package/test/update-boundaries.test.ts +0 -248
  1203. package/test/update-deploy-config.test.ts +0 -172
  1204. package/test/update-deploy-env.test.ts +0 -87
  1205. package/test/update-deploy-failure.test.ts +0 -72
  1206. package/test/update-deploy-files.test.ts +0 -173
  1207. package/test/update-deploy-foreground-cli.ts +0 -39
  1208. package/test/update-deploy-foreground-readiness.test.ts +0 -29
  1209. package/test/update-deploy-foreground-readiness.ts +0 -248
  1210. package/test/update-deploy-foreground-setup.ts +0 -228
  1211. package/test/update-deploy-foreground.test.ts +0 -236
  1212. package/test/update-deploy-hc.test.ts +0 -85
  1213. package/test/update-deploy-identity.test.ts +0 -230
  1214. package/test/update-deploy-launch.test.ts +0 -194
  1215. package/test/update-deploy-legacy-rollback.test.ts +0 -235
  1216. package/test/update-deploy-legacy-setup.ts +0 -87
  1217. package/test/update-deploy-lock.test.ts +0 -123
  1218. package/test/update-deploy-managed-bash.test.ts +0 -159
  1219. package/test/update-deploy-managed-setup.ts +0 -102
  1220. package/test/update-deploy-native-ui-consumer-setup.ts +0 -126
  1221. package/test/update-deploy-native-ui-consumers.test.ts +0 -150
  1222. package/test/update-deploy-native-ui-observed.test.ts +0 -97
  1223. package/test/update-deploy-native-ui.test.ts +0 -157
  1224. package/test/update-deploy-once.test.ts +0 -96
  1225. package/test/update-deploy-prepare-production.test.ts +0 -89
  1226. package/test/update-deploy-prepare-setup.ts +0 -119
  1227. package/test/update-deploy-prepare-umask.test.ts +0 -92
  1228. package/test/update-deploy-prepare.test.ts +0 -180
  1229. package/test/update-deploy-prior-source.test.ts +0 -108
  1230. package/test/update-deploy-rollback-presence.test.ts +0 -115
  1231. package/test/update-deploy-runtime.test.ts +0 -195
  1232. package/test/update-deploy-setup.ts +0 -74
  1233. package/test/update-deploy-shell-alias.test.ts +0 -172
  1234. package/test/update-deploy-shell-witness.test.ts +0 -47
  1235. package/test/update-deploy-source-launch.test.ts +0 -161
  1236. package/test/update-deploy-startup-stop.test.ts +0 -127
  1237. package/test/update-deploy-stop-recovery.test.ts +0 -123
  1238. package/test/update-detection-blackhole.test.ts +0 -168
  1239. package/test/update-detection-setup.ts +0 -139
  1240. package/test/update-detection.test.ts +0 -138
  1241. package/test/update-execution.test.ts +0 -250
  1242. package/test/update-monitor-lifecycle.test.ts +0 -83
  1243. package/test/update-native-bun-run.test.ts +0 -133
  1244. package/test/update-native-contract.test.ts +0 -246
  1245. package/test/update-native-launch-prefix.test.ts +0 -152
  1246. package/test/update-native-launchers.test.ts +0 -235
  1247. package/test/update-native-process-wrapper.test.ts +0 -151
  1248. package/test/update-native-source.test.ts +0 -127
  1249. package/test/update-pre-action-deployment.test.ts +0 -208
  1250. package/test/update-pre-action-notice.test.ts +0 -147
  1251. package/test/update-pre-action-setup.ts +0 -67
  1252. package/test/update-proc.test.ts +0 -83
  1253. package/test/update-promotion.test.ts +0 -139
  1254. package/test/update-publish-ancestor.test.ts +0 -46
  1255. package/test/update-publish-bootstrap.test.ts +0 -238
  1256. package/test/update-publish-deployment.test.ts +0 -83
  1257. package/test/update-publish-github.test.ts +0 -144
  1258. package/test/update-publish-recovery.test.ts +0 -152
  1259. package/test/update-publish-setup.ts +0 -43
  1260. package/test/update-publish-terminal.test.ts +0 -231
  1261. package/test/update-publish-wait.test.ts +0 -213
  1262. package/test/update-publish.test.ts +0 -173
  1263. package/test/update-report.test.ts +0 -136
  1264. package/test/update-response.test.ts +0 -81
  1265. package/test/update-review-scope.test.ts +0 -184
  1266. package/test/update-running-cancel.test.ts +0 -78
  1267. package/test/update-running-status.test.ts +0 -153
  1268. package/test/update-setup.ts +0 -245
  1269. package/test/update-source-activity.test.ts +0 -149
  1270. package/test/update-source-admission.test.ts +0 -80
  1271. package/test/update-source-ci.test.ts +0 -77
  1272. package/test/update-source-circuit.test.ts +0 -147
  1273. package/test/update-source-cli.test.ts +0 -31
  1274. package/test/update-source-config.test.ts +0 -77
  1275. package/test/update-source-git-setup.ts +0 -151
  1276. package/test/update-source-git.test.ts +0 -95
  1277. package/test/update-source-idle-setup.ts +0 -146
  1278. package/test/update-source-idle.test.ts +0 -148
  1279. package/test/update-source-intake-setup.ts +0 -21
  1280. package/test/update-source-journal-admission.test.ts +0 -129
  1281. package/test/update-source-pending-restart.test.ts +0 -60
  1282. package/test/update-source-rollout-setup.ts +0 -111
  1283. package/test/update-source-rollout.test.ts +0 -164
  1284. package/test/update-source-setup.ts +0 -21
  1285. package/test/update-source-state.test.ts +0 -195
  1286. package/test/update-source-supervisor.test.ts +0 -128
  1287. package/test/update-source-target.test.ts +0 -152
  1288. package/test/update-source-terminal-journal.test.ts +0 -59
  1289. package/test/update-source-toolchain.test.ts +0 -109
  1290. package/test/update-supervisor.test.ts +0 -113
  1291. package/test/update-ulw-publish-reuse.test.ts +0 -94
  1292. package/test/update-ulw-publish-setup.ts +0 -131
  1293. package/test/update-ulw-publish.test.ts +0 -75
  1294. package/test/update-verification.test.ts +0 -109
  1295. package/test/update.test.ts +0 -236
  1296. package/tsconfig.base.json +0 -20
  1297. package/tsconfig.json +0 -7
@@ -1,895 +0,0 @@
1
- # Scripts
2
-
3
- `scripts/` is a bun + TypeScript package with one CLI, `dori`. Every external command runs as an argv array; nothing builds a shell string.
4
-
5
- The CLI loads only the selected command graph, including its existing dependencies. `--version` needs no command/configuration graph; `harness`, `update` and `upstream` retain their separate entry paths. Ordinary commands, including journals and usage, still load and validate configuration and consumer-native dependencies before command execution. Lazy loading does not skip native integrity checks. Errors retain their original classes, messages and exit codes.
6
-
7
- ## Install and test
8
-
9
- ```sh
10
- cd skills/dori-mode/scripts
11
- bun install --frozen-lockfile # pinned runtime and development dependencies
12
- bun link # puts `dori` on your PATH
13
- bun test # behavior tests with fake herdr/hc/git/gh; nothing real is touched
14
- bunx tsc --noEmit # typecheck
15
- ```
16
-
17
- Needs: Bun 1.4.4+, the installed default OMP source bundle (18.20.0), herdr or hc, git, and the GitHub CLI (`gh`) for `merged`/`closed` signals (npm for `published`). An explicit external OMP is an advanced override, not bundle proof; historical published `v0.1.2` keeps its 18.18.8 contract. The `command`, `file` and `url` signals need nothing extra. The host guard reads `sysctl`, `memory_pressure` and `df` on macOS; on Linux it reads `/proc/loadavg` and `/proc/meminfo` (`MemAvailable` over `MemTotal`) directly in-process, then runs `df` and the selected runtime's session list. Linux no longer spawns `cat` or attempts the macOS-only probes; non-Linux command probes and their fallback behavior are retained. Host memory counts as 100% free when neither source works, and swap reads as unknown on Linux.
18
-
19
- On Linux, `sampleHost` also exposes `cgroup`: the tightest visible ancestor hard-limit headroom and, for v2, a separate `memory.high` headroom. `guard` and `can-launch` apply `memFreeMinPct` independently to host memory and both budgets; a roomy host never overrides a constrained account. The sampler resolves `/proc/self/cgroup` through `/proc/self/mountinfo`, reads each ancestor's own current usage, and stops at the mount root. It supports v2 `memory.max`/`memory.high` and hierarchical v1 `memory.limit_in_bytes`; v1 soft limits are not v2 throttling limits and are not used. Unlimited limits are ignored. Zero limits have zero headroom, and admission uses the unrounded percentage.
20
-
21
- Each budget retains raw `currentBytes` and `chargedFreePct`. Admission uses `freePct`, an available-budget estimate that subtracts clean, unmapped file cache from current usage: `max(0, file - shmem - file_mapped - file_dirty - file_writeback)`, capped at current usage. This prevents ordinary file caching from permanently holding a constrained account. It does not treat shared, mapped, dirty, writeback or kernel pages as free, and it is an estimate rather than an allocation guarantee. v1 uses `cache`/`mapped_file` and the matching local or `total_*` counters according to `memory.use_hierarchy`. Missing or malformed cache statistics set `cgroup.incomplete` and keep the raw charged budget as the conservative fallback. Missing limit or usage readings also set `incomplete`; readable budgets still apply, and unavailable budgets retain the existing host fallback rather than becoming an invented zero or unlimited value. No supported cgroup membership yields `version: null`. A resolved v2 hierarchy retains `version: 2` when memory interface files are absent: missing non-root limits set `incomplete: true`, while absent interfaces at the hierarchy root are expected. A fully readable unlimited hierarchy has null budgets with `incomplete: false`. Cgroup namespaces can hide outer ancestors, so only the visible hierarchy is covered. macOS does not read cgroup files.
22
-
23
- ## Lane status and one-message boards
24
-
25
- `dori status [<key>] [--json]` reads open lanes, or one named lane including a closed lane. It joins registry state, PID/session-verified OMP runtime state, report/checkpoint journals, open decisions and recorded monitor metadata. Unreadable registry files and invalid status fields are isolated with `registryIncomplete: true`; healthy lanes remain visible, and an empty incomplete view is unknown rather than "none open". Each source keeps its timestamp; unavailable runtime or journal observations are unknown, not idle or zero. Runtime identity must also match the lane's recorded session binding (`sync --write` establishes it); an unbound lane is unknown even if its pane contains a live agent. Damaged decision or monitor metadata makes its count unknown rather than reporting the remaining readable subset as a complete count. Monitor flags and expiry values are validated before counting. Legacy argv that boot can match through command still makes status counts unknown when malformed. Monitor metadata does not prove a process is running. The last sweep note and nudge/post timestamps are recorded evidence, not a prediction of the next freshness action. Status never runs a sweep, writes journals, sends messages or reads private session transcripts.
26
-
27
- `dori eta <key-prefix> [--json]` summarizes historical opening-to-close elapsed minutes for that explicit prefix. Fewer than three valid closed lanes produces no estimate; otherwise the median, range and sample count are shown. An incomplete registry also suppresses the estimate and identifies the readable sample count. This is not a completion promise.
28
-
29
- Start a board only when its destination is authorized:
30
-
31
- ```sh
32
- dori board discord --thread 123456789 --loop 2
33
- dori board telegram --to -100123456789 --thread 42 --loop 2
34
- ```
35
-
36
- The existing `DORI_DISCORD_TOKEN` or `DORI_TELEGRAM_TOKEN` supplies authentication. Discord accepts numeric channel IDs with `--to` or a thread ID with `--thread`; Telegram requires a numeric chat ID. `--lane KEY` limits the view. Omit `--loop` (or set it to `0`) for one update; a positive value is minutes. No board starts with installation, boot, status or launch. Supervise the command with a native monitor if desired; stopping that monitor stops updates.
37
-
38
- The board rejects unsupported options or extra positional arguments. A supplied `--lane` must name exactly one valid lane; it never falls back to all lanes.
39
-
40
- Each destination owns one private `<stateDir>/boards/<sha256>.json` record. A lock serializes writers, and the message ID survives restart. Unchanged content sends nothing; changed content edits that message, never splits it. The bounded summary scrubs local paths and pane IDs, neutralizes mentions, and states when lanes were omitted. HTTP(S) evidence links retain their origin and path, not URL userinfo, query strings or fragments. Because spaces can belong to an unquoted path, text from a local path to the end of its non-URL segment is omitted conservatively. Its timestamp is the last successful content update, not a heartbeat: a stopped updater leaves that timestamp unchanged.
41
-
42
- Before a send/edit, a durable pending record is written. An ambiguous create or any failed edit stops the command and holds future calls rather than creating another message. A definitively rejected initial create (HTTP/API 4xx, including exhausted 429 backoff) removes only its own uncreated intent; after correcting permissions, a new explicit invocation can create the board. There is no automatic resend. Even an edit with a known ID requires explicit acknowledgement after failure: inspect the destination and pass `--message ID`. Discord scopes an edit to the selected channel. Telegram edits identify only the chat and message, not the topic, so a Telegram recovery ID must already be recorded for the exact board destination. An ambiguous Telegram create without a recorded ID stays pending; the command cannot safely attach an unbound ID. A missing message is not automatically replaced. Do not delete a pending record or retry a create merely because the response was lost. API acceptance is not proof that the owner read the board.
43
-
44
- ## Configuration
45
-
46
- `~/.dori/config.json` (or the path in `DORI_CONFIG`). Every field is optional; see `config.example.json`. `DORI_STATE_DIR`, `DORI_LEAD_PANE` and `DORI_RUNTIME` override the file.
47
-
48
- | Field | Default | Used by |
49
- |---|---|---|
50
- | `runtime` | detected | every command that opens or reads a session: `"herdr"` or `"hc"`. Unset, the Dori picks hc inside an hc terminal (`HC_TERMINAL_ID`), herdr inside a herdr pane (`HERDR_PANE_ID`), else hc when it is on PATH, else herdr, and refuses only when neither is there. Lanes already open stay on the runtime that opened them |
51
- | `stateDir` | `~/.dori/state` | registry, heavy slots |
52
- | `artifactRoots` | `[]` (disabled) | explicit `{ "path": "/absolute/root", "baseUrl": "https://existing.example/prefix/" }` mappings for artifact registration; `~/` is expanded and a root without `baseUrl` is private-only |
53
- | `laneWorkspace` | current workspace | `launch`: the herdr workspace, or on hc the `dori.group` label (default `dori`) |
54
- | `workspaces` | all | `sync`, `dead-panes`: herdr workspaces, or `dori.group` labels on hc |
55
- | `ignorePanes`, `leadPane` | none | sessions the sweeps skip, by id (`w1:p3` on herdr, `t7` on hc); `leadPane` is also where lanes report |
56
- | `defaultCwd` | home | where lanes start, and the repo whose worktrees they own |
57
- | `agentCommand`, `defaultModel`, `launchKeywords` | `omp --dori-role lane --model {model} {prompt}`, `anthropic/claude-opus-5-5`, `ulw set goal and work` | `launch`; explicit configuration remains authoritative |
58
- | `requireModelReadback` | `false` | `launch`: refuse opaque or non-interactive templates before creating a pane when `true`. Readable interactive native launch templates always require matching readback |
59
- | `goalMarker` | `Pursuing goal` | launch goal-check policy; OMP activity is confirmed from the trusted extension goal record, while an explicitly empty marker keeps upstream's opt-out |
60
- | `startupWaitSeconds` | 180 | `launch`: how long after the start it waits for the agent's ready status and goal; raise it on a slow host. A value that is not a nonnegative number uses the default |
61
- | `sessionsDir` | `~/.omp/agent/sessions` | OMP session-id lookup |
62
- | `ompUlwPath` | `~/.dori/omp-ulw/index.ts` | nonempty paths retain the role-gated import; consumers use their manifest-bound cache pin, while `scripts/install-source.sh` sets `""` and loads the selected checkout once as an OMP extension (globally for primary, explicitly for side) |
63
- | `nudgeAfterMin`, `postAfterMin` | 15, 20 | `freshness` |
64
- | `closeAfterMin` | 5 | `watch` |
65
- | `heavySlots`, `heavyMaxLoad` | 1, 80 | `heavy` |
66
- | `deadPanePatterns` | `has stopped`, `no suitable jobs` | `dead-panes` |
67
- | `guard` | load 150/80, 20% memory, 50 GB disk, 20 panes | `guard` |
68
- | `hooks.threadReply`, `hooks.threadDone` | none | `freshness`, `close` |
69
- | `hooks.transcribe` | none | `transcribe` (argv with `{file}`, prints the text) |
70
- | `transcribeMaxBytes` | 26214400 (25 MiB) | `transcribe` HTTP(S) URLs: positive safe integer cap on actual streamed bytes; local files are unchanged |
71
- | `supervision` | no ceilings by default (set wallMinutes, tokens or costUsd to enable); hung after 20 min | `freshness`, `launch`, `close` (see Supervision below) |
72
- | `repoIdentities` | none | `verify-pr`, `launch` footer: expected Git name and email per `owner/repo` (keys match without case) |
73
- | `prAutoTrack` | `false` | `claim-done`, `checkpoint`: when `true`, pull-request links in a recorded claim's evidence or a checkpoint's `--remote-effect` receipts are tracked for `dori pr watch` with the lane and its thread. Any value other than `true` or `false` stops every command with `invalid prAutoTrack` |
74
-
75
- Hooks are argv templates for your messenger CLI. `{thread}`, `{text}` and `{key}` are filled into each argument separately, so the text stays one argument whatever it contains.
76
-
77
- ### Optional GPT-6.2 Sol Ultrafast lanes
78
-
79
- For an explicitly selected external OMP 19 runtime, configure OMP to load both
80
- the Cataly role extension and the
81
- [Codex 500k extension](https://github.com/dbc-hbin/omp-openai-codex-500k-extension).
82
- For an extension installed as a package, add its `index.ts` to OMP's `extensions`
83
- setting if the package is not auto-discovered. Keep the existing Cataly ULW
84
- configuration. Before changing either default, run `omp models openai-codex`
85
- with the **same** executable and OMP configuration that the lane will use.
86
- Continue only if it lists `openai-codex/gpt-6.2-sol-ultrafast`; the extension
87
- requires a Codex account that advertises Ultrafast.
88
-
89
- - For `dori launch`, set `"defaultModel": "openai-codex/gpt-6.2-sol-ultrafast"`
90
- in Cataly's `config.json`. Keep `--model {model}` in `agentCommand` so
91
- per-lane `--model` overrides still work.
92
- To create the native goal before the first turn on external OMP 19, end that
93
- template with `"--goal", "{prompt}"` instead of just `"{prompt}"`. Keep
94
- OMP's `goal.enabled` on and do not pass a second positional prompt. This
95
- setting is for fresh interactive lanes on the external runtime, not the
96
- bundled OMP.
97
- - For `dori harness start`, set the external OMP configuration's
98
- `modelRoles.default` to `openai-codex/gpt-6.2-sol-ultrafast`. This OMP default
99
- also applies to other fresh sessions on that configuration that do not
100
- select a model explicitly.
101
-
102
- For an unwrapped deployment whose `agentCommand` starts with `"omp"`, export
103
- `DORI_AGENT_ARGV='["/absolute/path/to/omp"]'` before invoking Cataly to select
104
- the same external executable for both paths. This does not replace managed
105
- wrappers or change running sessions. Setting a model ID alone does not
106
- install the extension or enable the tier. The 500,000-token window is a local
107
- context budget, not a server-side capacity increase.
108
-
109
- ## Read-only diagnostics
110
-
111
- `dori doctor [--json] [--repo owner/repo]` checks the selected home's configuration, registry, worklog, lessons, desired monitor metadata and trusted live lead. It exits 1 when a visible WARN remains, otherwise 0; INFO is advisory. It never edits config, starts/stops a monitor, invokes a hook or usage reader, contacts a messenger, or reads private session transcripts. Local runtime/process probes are read-only. `dori boot` includes a local `DOCTOR warn=N` advisory without changing boot's existing exit policy.
112
-
113
- Checks are identified by `runtime`, `registry`, `monitors`, `monitor-filter`, `monitor-runtime`, `supervision`, `repo-identities`, `worklog` and `lessons`. Optional `doctor: { "ignore": ["lessons"] }` suppresses named diagnostics; the selected ignore list remains in doctor output. Nothing is ignored by default. Repository identities are checked for open lanes' merged/closed repository signals and the optional `--repo`; doctor does not guess a GitHub repository from a directory name.
114
-
115
- `dori monitor-presets [watch|dead-panes|guard|freshness|pr-watch] [--json]` prints recommended structured argv and filters, starting nothing. Review the preset and restart only the explicitly authorized monitor in its owner session. Side installations must use their own bound CLI/PATH. Only the trusted current lead's filter produces WARN; historical or unverified owners stay INFO, so old manifests do not keep doctor failing after an upgrade. Filter diagnostics recognize direct `dori`, `omp-dori`, and `bun .../dori-mode/scripts/src/cli.ts` argv, even when the monitor was renamed; arbitrary shell scripts are not inferred from their name. The probes detect missing event categories, not every possible restriction in a custom regex.
116
-
117
- Desired specs alone are not evidence that a child is running. Only the current trusted Dori process, a fresh matching runtime receipt and the child's PID/start identity establish liveness. Other sessions' recorded monitors stay INFO with liveness explicitly unverified; stale, unreadable or mismatched current-lead receipts warn rather than claiming that a monitor is healthy. Doctor does not recommend an unattended restart.
118
-
119
- Doctor checks unreadable legacy terminal metadata under the same `PI_SESSION_DIR` or `PI_SESSION_FILE` roots as `dori boot`; those records cannot attest native monitor liveness. A native receipt must also match the desired restart policy, including when no restart policy is set.
120
-
121
- Malformed lane keys are counted without being printed. Unrecognized status or approval values in a trusted lead record appear as `unknown`; a record that fails the runtime trust checks does not attest a live lead.
122
-
123
- ## Library modules
124
-
125
- The CLI is a thin layer over typed modules you can import in your own scripts:
126
-
127
- | Module | What it gives you |
128
- |---|---|
129
- | `src/messenger/slack.ts` | `Slack`: post, edit, thread replies, file upload (upload URL + complete), presence; 429 backoff |
130
- | `src/messenger/telegram.ts` | `Telegram`: send, edit, typing, `sendMessageDraft` streaming with a `Thinking…` start, forum topics (create, rename, close, reopen), HTML tables |
131
- | `src/messenger/discord.ts` | `Discord`: send without pings, edit, typing, threads (start, rename, archive) |
132
- | `src/messenger/discord-gateway.ts` | `discordGateway`: one Gateway connection (HELLO/IDENTIFY/RESUME, heartbeat, backoff, terminal close codes) shared by presence and intake |
133
- | `src/messenger/discord-presence.ts` | `discordPresence`: the Gateway connection that keeps the bot online |
134
- | `src/messenger/discord-inbound.ts` | `discordInbound`: owner-only intake with per-channel cursors, awaited delivery, REST history and queued-owner reconciliation |
135
- | `src/messenger/discord-inbound-live.ts` | `discordInboundLive`: live Gateway delivery with REST backfill after every `READY`/`RESUMED` |
136
- | `src/messenger/discord-inbound-queue.ts` | `discordInboundQueue`: private disk FIFO, bounded cache and database size, exclusive consumer, restart recovery |
137
- | `src/messenger/typing.ts` | `typingWhile`: show typing while a piece of work runs, stop when it ends |
138
- | `src/messenger/voice.ts` | `transcribe`: voice note to text through your hook |
139
- | `src/messenger/thread-ledger.ts` | `ThreadLedger`: every thread the Dori posts in, persisted; given to `Slack`, it records each `chat.postMessage` (also raw `call`s) |
140
- | `src/messenger/slack-inbound.ts` | `pollSlackInbound`: threads view, the ledger's threads and unread counts, deduplicated, own messages filtered; each goes to the `emit` callback before any thread position is saved |
141
- | `src/messenger/telegram-inbound.ts` | `pollTelegramInbound`: owner-gated `getUpdates`, bot-bound cursor epochs and bounded replay receipts, DMs and the group gate |
142
- | `src/messenger/telegram-inbound-state.ts` | `fileTgInboundStore`: private atomic bot-specific cursor and message/revision receipts |
143
- | `src/messenger/slack-presence.ts` | `slackPresence`: hold a user account active |
144
- | `src/routing.ts` | `canLaunch`, `idleLaneFor`: the routing checks |
145
-
146
- Every module takes its HTTP, clock and timers as arguments. That is how the tests run without the network.
147
-
148
- `discordInboundLive` adapters expose `cursorFor(channel)` from their injected store. `storeFor(channel, false)` reads admission state without seeding an unseen channel; wrappers must forward that optional argument. An admission position is not a delivery receipt.
149
-
150
- Slack commits a successful poll's own-thread cursors in one ledger transaction, only after all reads and emits finish. `ThreadLedger.markSeen` takes the authenticated `SlackScope` and an array of `{ channel, rootTs, ts }` updates and merges them under the existing writer lock; concurrent thread records survive and seen positions never decrease. Empty batches do not take a lock, and batches with no newer known cursor do not rewrite the ledger. This does not reduce Slack requests or stop watching older threads.
151
-
152
- ## Commands
153
-
154
- ### `dori launch <key> --title T --brief FILE --done "..." [--thread REF] [--request INPUT] [--model M] [--cwd DIR] [--dry-run]`
155
- Opens a lane: puts current global and repository lessons above the brief, appends the footer, creates the runtime session and starts OMP. After 20 seconds it checks the unwrapped screen for known startup failures, including OMP extension/flag/model errors. Provider failure phrases are distinguished from code, paths and lane names; a custom omo agent's recoverable missing-extension warning is ignored, but a real failure beside it still counts. `STARTUP_OK` requires idle/working runtime status and an active goal from the live-process-bound OMP extension record; goal state is independent of terminal width, and an approval or shell never counts as ready. Custom agents retain their own goal record or footer-marker check. An explicitly empty `goalMarker` opts out of the goal check, not readiness. The status and goal are rechecked every 10 seconds until `startupWaitSeconds` (180 by default) after start, including while an agent has not reported a status yet. A running agent without a confirmed goal reports `STARTUP_NO_GOAL`; missing readiness is `STARTUP_UNCONFIRMED`. Lookup errors, shells and known failures end the wait immediately. A gone session whose lane is already closed, verified-done or journal-done is `STARTUP_DONE <key>`. Exit 0 on `STARTUP_OK` or `STARTUP_DONE`, and 3 otherwise.
156
-
157
- The lane never gets the Slack token itself: on hc every env value is a command-line argument, which `ps`, `hc get` and logs show. When the launcher has `DORI_SLACK_TOKEN_FILE`, or a `slack-token` file sits next to its config, the lane gets that path as `DORI_SLACK_TOKEN_FILE` and an empty `DORI_SLACK_TOKEN`, so a token inherited from another home's core cannot win. The path is passed absolute. A `DORI_SLACK_TOKEN_FILE` outside the launcher's home (its config's directory) is most likely inherited from another home, so the launch refuses it (`token file refused: ...`) unless `DORI_SLACK_TOKEN_FILE_OUTSIDE_HOME=1` says it is meant; links are resolved first, and the flag is passed to the lane empty. `dori boot` refuses such a path the same way. With neither, the Slack environment is unchanged. Independently, launch always sends empty `DORI_DISCORD_TOKEN` and `DORI_TELEGRAM_TOKEN` overrides so terminal-server tokens cannot leak into lane agents; an explicitly authorized messenger child must load its own token. Empty tokens are rejected before any messenger network request.
158
-
159
- `--dry-run` prints the brief as the lane would get it, lessons and footer included, and changes nothing.
160
-
161
- Readable interactive native OMP templates start without their work brief. The controller requires an exact catalog `provider/model` from `--model` or `defaultModel`, confirms the selected model in the current live session, then delivers the brief once via verified delivery. Missing, stale or mismatched readback holds delivery without choosing a substitute. The template needs exactly one standalone `{prompt}` and must not preconfigure the internal `--dori-launch-model` flag.
162
-
163
- Opaque and non-interactive templates keep their existing startup unless `requireModelReadback` is enabled. Their unavailable readback is reported, not inferred from the command. Native readback labels requested and observed models separately. Its billing classification is descriptive metadata, not approval to spend or quota evidence. These checks do not change request attribution, tool approvals or live-session ownership requirements.
164
-
165
- `--request discord:CHANNEL:MESSAGE`, `telegram:CHAT:MESSAGE`, or `slack:CHANNEL:TS` opts into original-request attribution. Use the actual received event ID, not a thread title, summary or invented UUID. This operator-supplied reference is not native admission or authority. It stays fixed for the lane: reopen and Discord wake start new local runs of that same request; a new task requires a new lane key even in the same thread. Adopt cannot attach a request retroactively. Legacy lanes remain unsourced.
166
-
167
- A sourced run is recorded in the existing report journal before its process starts and is bound to a native session only after exact live readback. The pane shell clears any inherited `DORI_LANE_RUN`; only the launched process receives its own run ID. Run journal commands from that environment, never copy or set the variable manually. A manual process restart without Dori's launch/reopen/wake does not inherit the earlier run. These records attribute work; they do not prove input admission, delivery, completion or permission.
168
-
169
- New launches record `launchSelection` in the registry and footer: `invocation` is the unchanged `launchKeywords` text, `selectedBy` is `default` (built-in), `config` (an explicit setting, including an empty string), or `provided` (programmatic configuration without matching load provenance), and `reason` identifies that origin. The configuration loader derives the origin, including the loaded file path, rather than trusting a supplied metadata field or rereading a file after it changes. Older and adopted lanes have no invented historical selection.
170
-
171
- `selectedBy` describes the provenance attached to matching invocation text, not assignment history. A file that explicitly supplies the built-in text is still `config`. Spreading a default or loaded configuration and assigning the same text again retains its matching `default` or `config` origin; the normalized object cannot identify that reassignment. Without matching provenance, the source is `provided`.
172
-
173
- This is requested-selection metadata, not proof of native activation, delivery or goal creation. The default remains `ulw set goal and work`; prompt bytes, raw `tell` delivery and startup goal checks are unchanged. Workflow names in a brief, quoted example or path do not choose this metadata. Native OMP/ULW still owns activation and workflow semantics; there is no new per-lane workflow switch.
174
-
175
- The footer uses the already selected runtime (`DORI_RUNTIME` > config > detection) for its report-forwarding command. It binds reports to this skill's CLI path and carries `kind`, `text` and the printed line as data arguments; supply values through environment variables or proper shell quoting, never by interpolating raw text into executable source. Before forwarding, verify the live agent, empty input and absence of approval/question prompts as described in [Messaging a session](sessions.md#messaging-a-session), then confirm delivery from a status transition or session record. Report text containing shell punctuation is still data, including when expanded through `"$line"`. If the lead pane or runtime is unavailable, the footer records and prints the report without a forwarding command. Preview runtime selection reads configuration/environment/PATH metadata and never starts a runtime.
176
-
177
- Sol lane main agents are encouraged to batch bookkeeping already required by the task and supplied launch footer. Checkpoints, reports, forwarding and claims remain mandatory when due; failed prerequisites stop dependent commands, and partial chains stay incomplete. A same-data checkpoint retry returns the existing record; a conflicting rewrite fails, and remote effects must never be replayed just to retry their journal entry. Strict one-line harness reviewers without a launch footer keep that output contract. The author's n=5-per-arm comparison used stubbed reporting/delivery on an earlier tree; it is not a reproduction or proof of turn or wall-time savings on the integrated tree.
178
-
179
- ### `dori adopt <key> --pane ID --title T --brief FILE --done "..." [--thread REF]`
180
- Registers a lane that is already running.
181
-
182
- ### `dori sync [--write]`
183
- Prints the observation pass start time and `key | thread | pane | session | status | source | relationship | unknownReason` for every open lane and every unregistered agent pane, followed by drift. Read-only unless `--write`, which stores successfully resolved session ids. The existing result fields retain their names and meanings; `observedAt` and the three row metadata fields are additive. A displayed registry session is a preserved value, not a successful live observation.
184
-
185
- `source` distinguishes extension, custom-agent argv/child-env, legacy start-time discovery, preserved registry values and no identity. `relationship` is `matched`, `changed`, `unbound` or `unknown` relative to the registry at observation: matched means equal observed IDs, **not** native current-owner proof. Rows are sampled during the pass, not atomically. Process-command failures and probe exceptions stay unknown and cannot change a stored session; an unattested positive-PID native record cannot be promoted to a start-time guess. An absent or retired record still permits legacy discovery, and successful custom argv discovery is unchanged. A clock observed behind native evidence is unknown, but this does not detect every clock rollback or reused PID.
186
-
187
- Read-only observations share successful process/pane listings only within that pass. Writes and action checks remain fresh; failed process-table evidence propagates as an error to trusted-state callers instead of masquerading as an absent native record. Neither this snapshot nor a matched relationship authorizes a nudge, kill or close. Strong current-owner and clock-rollback/PID-reuse guarantees require native owner/generation evidence or a portable process-birth identity contract and are not provided here.
188
-
189
- ### `dori report <key> --kind milestone|blocker|question|halted|done --text TEXT [--evidence-file PATH]...`
190
- Run by a lane. Appends one record to `<stateDir>/lanes/<key>/reports.jsonl` and prints the `[REPORT] <key> | <kind> | <text>` line the lane then sends to the lead pane. Each record is a single append, so the lane and the lead can write at the same time without losing one. The last record is the lane's progress state: `milestone` is running, `blocker` and `question` blocked (a question waits on the owner's answer), `halted` halted, `done` done. The screen grammar takes the same five kinds. Text stays data: newlines are folded into the printed line, never into the journal. A corrupt journal is an error with its line number, never an empty state. Lanes opened by `dori launch` are told to report this way and are marked `reportProtocol: "jsonl-v1"`; launch starts their journal with a `running` activity record, which is not a report and is never posted.
191
-
192
- `--owner SUMMARY` stores a separate owner-facing summary; the lead detail remains in `text` and the default printed line. `--json` prints the full report plus its content-bound `id` instead of the human line. Summaries must be nonempty, and receive the same terminal-control and local-path scrubbing before automatic posting. Existing reports without a summary remain readable.
193
-
194
- For a sourced lane, reports resolve the caller's recorded `DORI_LANE_RUN` under the registry writer lock. A late old-run report retains its original generation and native reference and does not change the current run's progress. Missing or unknown runs are refused. JSON receipts include provenance and an initially unverified delivery state; their IDs bind the complete provenance. Unsourced report IDs keep their existing six-field hash. `status --json` exposes the current execution and any explicitly linked delivery separately from progress.
195
-
196
- A report and a checkpoint can carry the evidence they rest on, kept on the record as `evidenceRefs`: an identity and a SHA-256 fingerprint. `--evidence-file PATH` (one flag per file, relative to the caller's directory) reads the file once: its canonical path is the identity, its bytes the fingerprint. Only a regular file is read. A FIFO, device or directory is refused without being opened, a link is resolved to the file it names, and a file that changes or is replaced while it is read is refused with nothing recorded, so the lane records it again once it is stable. In an OMP lane session, the Dori extension's `dori_report` tool records the same report for the lane registered to the session's pane (`HC_TERMINAL_ID`, else `HERDR_PANE_ID`) and returns its `[REPORT]` line to forward. Its `files` are read the same way, and its `toolCalls` names completed native tool calls on the session's current branch: each needs a successful, unpruned result for the same tool, not a background start. A background call becomes evidence only when its successful public `tool_execution_update` completion was captured for the same session, main agent, call and job while the call remained on the current branch. A completion that arrives before the tool returns is held until the returned background job ID matches; an older job with a reused call ID cannot record a receipt or consume the new job's completion. A small fingerprint receipt lives in the existing native journal; batched `async-result` text is never attributed to an individual job. Missing start/completion provenance, a restarted process or a completion received off-branch cannot be repaired by guessing. The fingerprint covers the tool name, visible result content and structured result data. Outer call IDs and timestamps, native async bookkeeping, and Bash timing/profile/timeout metadata do not count as new data; only the exact host-declared Bash wall-time line is removed, including before other native notices. Artifact locators declared in output metadata are normalized only in native footer/notice positions, not in arbitrary body lines or unrelated bracketed text. Other text and whitespace remain evidence, so a rerun with the same result is the same evidence without hiding changed structured output. Report, message and coordination calls are refused as evidence: `dori_report`, `monitor`, `goal`, `ask`, `todo`, `yield`, `think`, an argument that runs the Dori CLI in command position, a write to `agent://` or `xd://ask`, and command output holding a `[REPORT]` line. Quoted CLI or report text in ordinary file content remains data. Shell commands are classified using their recorded start directory, or the host-resolved directory of an explicit cwd argument, never the directory at report time. Background receipts retain the start directory. If a foreground call predates this process and its directory is unavailable, select file evidence rather than repeat a completed effect. The CLI never reads a native session file.
197
-
198
- For native `eval`, cell duration, input code and title are bookkeeping, not result data. The cells must be complete, and their public operation records must establish successful nested work: file/read/search operations. Native run events omit their effective cwd, including explicit overrides, so even exit code 0 cannot distinguish work from a relative coordination command. Such run events are refused; select files or a direct Bash result instead. Pure output without command operations remains eligible. A nested job start, an operation without a completion result, a caught failure, elided operation records or a coordination command is not evidence, even if the outer eval succeeded. The pinned host's asynchronous eval completion frames omit image bytes without attesting their absence, so no such frame can establish the full result. They are refused even when their text and cells appear complete. Select an evidence file or a foreground completed result instead when the nested work or full output cannot be established; printed claims and job IDs do not establish it. Fields inside actual output/views, including fields named `durationMs`, are preserved.
199
-
200
- Two clocks follow from the journals. The report clock is the last report's time, whatever it says; freshness nudges and posts on it as before. After reopen, report-based state and evidence are scoped to the current lifecycle generation; sequence allocation still reads both complete journals. The evidence clock folds reports, checkpoints and filesystem observations recorded in the existing activity journal. It advances for a changed file fingerprint (including an observed deletion, stored as `null`) or a previously unseen tool-result fingerprint. Reporting or checkpointing bytes that the observer already recorded does not count them twice. A file returning from B to A is a change; rerunning an already recorded tool result is not. Repeating a report, rewording it, touching a file or rerunning a call with the same result leaves it where it was; new bytes move it once. Records without `evidenceRefs`, including every record written before them, never move it. A checkpoint retried with the same step returns the original record, keeping the fingerprints of its first write. The tool's result says whether its evidence moved the clock. New evidence-bearing records carry a shared monotonic `evidenceSequence`, assigned with their append under the existing lane registry lock. The fold orders by timestamp, then this acceptance sequence, so equal-millisecond reports and checkpoints do not replay by journal source. Checkpoint retries retain their original sequence; their own writer lock still refuses contention immediately, and the registry lock's wait and timeout are unchanged. Records without a sequence remain readable and retain their former input order on otherwise unresolved ties.
201
-
202
- The report clock does not replace the thread-quiet clock, relay receipts or the nudge and posting policy described under `dori freshness`.
203
-
204
- ### `dori relayed <key> --report ID [--delivery ID] [--json]`
205
- After actually delivering a report to the owner, the lead acknowledges the exact `id` returned by `report --json`. This command sends nothing: it records the receipt and updates that lane's thread-quiet clock, without changing its nudge clock. A missing, replaced or non-journal report is refused, even if the newer report has the same timestamp. It does not resolve a blocker or change completion status. An ordinary messenger send is not proof that a particular report was relayed; use this explicit receipt after delivery.
206
-
207
- For sourced reports, `--delivery discord:CHANNEL:FIRST_REMOTE_MESSAGE` explicitly links an existing complete exact-reply receipt to the original Discord request. The receipt must be unique, no older than the report, and contain the complete remote message ID list. This is a caller-declared association, not proof of matching message bodies or human reading. No ID means `delivery.state: "unverified"`; Telegram, Slack and arbitrary `threadReply` hooks remain unverified rather than inferring success from an exit code. Hooks never inherit an earlier report's linked delivery. Legacy relay acknowledgement without delivery linking is unchanged.
208
-
209
- ### `dori boot`
210
- Run by the lead after a restart or a compaction, before it trusts what it remembers. It is read-only: it writes no registry record, relaunches nothing and stops no watch. It prints:
211
- - `RUNTIME <kind> (from <source>)` first: the runtime new lanes open on and why (`env`, `config`, `detect:HC_TERMINAL_ID`, `detect:HERDR_PANE_ID`, `detect:path`). `RUNTIME unavailable: <fix>` when none can be chosen, and boot then exits non-zero.
212
- - `SLACK authenticated user=... team=...` from `auth.test` when `DORI_SLACK_TOKEN` is set or `DORI_SLACK_TOKEN_FILE` names a token file (`SLACK skipped` otherwise). A token file that is missing, unreadable, not a regular file, owned by another user, empty or open to group or others is `SLACK token-file: <reason>`, naming only the path, and fails the boot. This proves the token, not that messages arrive. It runs last, after the local checks below, and gives up after 10 seconds (`SLACK auth.test timed out after 10000 ms`). A response without a user or team id is `SLACK auth failed`.
213
- - `PANES` with the lead pane's state, then `VANISHED <key> pane=...` for each open lane whose pane is gone (a `verified-done` lane is not flagged), and `UNREGISTERED <panes>` for panes no lane owns. Sessions are listed on every runtime a lane lives on (`herdr pane list` / `hc ls`); if that list fails, no lane is called vanished.
214
- - `DRIFT n=<count> <keys>`: lanes not finished (`closed`, `verified-done`, or a `done` report, the lanes `VANISHED` skips too) whose session the runtime's own probe reports gone (`herdr pane get`, `hc get`). Only lanes missing from the session list are probed. Any drift fails the boot; a probe that errors is `DRIFT probe-failed <key> (...)` and also fails it.
215
- - `CONFIG_WARN workspaces=[...] does not include laneWorkspace=...` when `config.workspaces` is set and leaves out `laneWorkspace`, or `CONFIG_WARN workspaces=[...] match none of the <n> live agent sessions ...` when live agent sessions (in `laneWorkspace` when it is set, the lead and `ignorePanes` aside) exist and none is in `config.workspaces`: `dead-panes` and `sync` filter on that list and would watch nothing. Checked only on a runtime with workspaces (herdr; hc has none). It fails the boot.
216
- - `REPORT <key> kind=... at=... state=...` for each launched (`jsonl-v1`) lane's last report, next to its registry status, since the two can disagree after a crash. A journal that holds only records dori wrote itself (the launch, a screen-detected stall) is `NO-REPORT <key>`, never a report, and a launched lane with no `reports.jsonl` yet is `NO-REPORT <key> ... (no journal)`. An adopted lane's journal is not read, as in `freshness`. An unreadable journal is `JOURNAL-ERROR <key>: ...` for that lane only; the other lanes are still checked.
217
- - `WORKLOG open=<n>` and an `OPEN <id> "<title>" source="<ref>" next="..."` line for each open worklog item (see `dori worklog` below).
218
- - `DECISIONS open=<n>` and a `DECIDE <id> age=<h>h lane=<k|-> thread=<ref|-> "<question>"` line for each open owner decision, only when `<stateDir>/decisions.jsonl` exists (see `dori decision` below).
219
- - `CLEANUP <keys> match=...` and an owner-session-only stop command for persistent watches tied only to finished lanes (closed, verified done, or a `done` report). OMP manifests are read from `<stateDir>/monitors/<encoded session id>.json`; exact argv tokens tie a watch to a lane, and any mention of an open lane keeps it. OMP cleanup uses `monitor({"op":"stop","name":...})` in the owning session. Original terminal-manifest discovery and its `kill_bash(...)` recommendation remain available for that metadata format. Boot never opens private session transcripts or stops a watch. Expired terminal watches remain `EXPIRED` with nothing to stop, and unreadable metadata remains an explicit `MONITORS unreadable` error.
220
-
221
- Exit 0 ends with `BOOT checked`. A lane file that cannot be read or parsed, or a lanes path that cannot be listed, is `REGISTRY unreadable <path>`; the other lanes are still checked. Any input that could not be read (Slack, the registry, panes, a journal, the worklog, the decisions, metadata) is printed and gives `BOOT incomplete`, exit 1.
222
-
223
- ### `dori checkpoint <key> --step ID --result TEXT --evidence PATH [--remote-effect RECEIPT]... [--evidence-file PATH]...` / `dori checkpoints <key>`
224
- Run by a lane after each completed step, and on resume before doing work. Each step is one line in `<stateDir>/lanes/<key>/checkpoints.jsonl` with its result, evidence and the receipts of remote effects it completed (a push, a merge, a deploy). Recording the same step again with the same data returns the original, unchanged; different data for a recorded step is refused, and so is a receipt another step already recorded. `--evidence-file` attaches fingerprinted evidence as on `dori report` (above); it is not part of the step's data. Under the writer lock, an existing step returns its original record and first fingerprints before reading any file, even if the temporary evidence was deleted. Conflicting payloads are refused before evidence reads; only a new step captures file bytes. Writes fsync the journal (and its directory when they create it) under a lock file, `checkpoints.jsonl.lock`, that records the writer's pid, host and time. A live writer's lock is refused with its pid and age. A lock whose pid is dead on this host, or that is two minutes old, is taken over, so a writer killed mid-write never locks the lane.
225
-
226
- Sourced checkpoints retain the original run provenance outside the step payload. Retrying the same step in another run returns the original receipt rather than attributing that effect twice. Step and remote-effect deduplication remain lane-wide. A missing or unknown run, or an invalid execution journal, does not discard completed remote effects: the checkpoint is saved with explicit unverified attribution and is not selected as current-run progress. An invalid journal is named in that attribution; it is not repaired or used for reports. A sourced launch or reopen checks its execution journal before creating a pane.
227
-
228
- A lane reads its checkpoints before resuming and never repeats a recorded remote effect. A crash between a remote action and its checkpoint is not covered by the journal: read the live remote state first, and use the service's idempotency key where it has one.
229
-
230
- ### `dori artifact add <key> <path> [--title T] [--public]` / `dori artifacts <key> [--json]`
231
- Register a regular file under an explicit `artifactRoots` path. Nothing is published by default: registration is private unless `--public` is given, and public registration requires that root's explicit HTTP(S) `baseUrl`. The command never guesses a preview server, starts one, uploads a file, fetches its URL or sends a message. Configure a root already served by your own approved read-only publisher; a base URL is a mapping, not proof that the server exists or that a recipient can reach it. Public registration is the operator's publication decision, not secret scanning of file contents.
232
-
233
- The most specific containing lexical root wins; a narrower private-only root cannot fall through to a wider public mapping. Both lexical and resolved paths must stay inside that root. Internal symlinks are allowed, but outside-root targets, hidden path components, dependency directories, and names containing `secret`, `credential`, `token` or `private` are refused. Control/format characters and unsupported file types are refused too. Allowed extensions are html, css, js, json, png, jpg, jpeg, gif, webp, avif, svg, ico, woff, woff2, ttf, otf, md, txt, csv, pdf, wav, mp3, ogg, m4a, flac, mp4, webm and mov. Path components in URLs are percent-encoded. Use the configured root's path spelling when it is a symlink alias.
234
-
235
- Registration refuses files whose lexical or canonical path is inside another registered lane's worktree, even under a shared artifact root. Ownership uses the same recorded worktrees and Git discovery as close, including discovery from `defaultCwd`; closed lane records still count while their worktrees remain. The error names another owning lane; move the file outside that worktree before registering it to the selected lane. If recorded ownership or lane-key prefixes associate the same worktree with multiple lanes, registration is refused even when the selected lane also owns it: either close could remove it. Files outside lane-owned worktrees may still use a shared root. This keeps each lane's artifact index responsible for the worktrees its close can remove.
236
-
237
- The private, fsynced `<stateDir>/lanes/<key>/artifacts.json` index holds a stable id per file path and immutable registrations: title, actual streamed SHA-256, size, visibility, explicit URL, canonical path and registration time (not filesystem birth time). Identical registration is idempotent; changed bytes, title, visibility or mapping append a version. Damaged indexes are reported, never replaced with an empty one. A live writer keeps its lock through hashing even beyond the usual stale-lock age. File changes, replacement or symlink retargeting during hashing are refused. Hashing is memory-bounded and reads at most the original file length.
238
-
239
- `artifacts` shows the current and registered hashes, every version and receipt, and checkpoint references. A changed/unreadable file or changed root mapping is not a newly verified version: register it again. Repeat the `--artifact ID` flag on `checkpoint` to append `artifact:<id>@sha256:<hash>` to the existing `--evidence`; only a current registered version can be bound. Each invocation resolves the current registration. An unchanged payload remains idempotent, but a changed/missing file or a new version cannot rewrite a completed checkpoint. On resume, read `checkpoints`; new verification needs a new version and step. The checkpoint does not itself run tests or make the file immutable.
240
-
241
- ### `dori artifact delivered <key> <id> --sha256 HASH --receipt REF`
242
- After an authorized delivery, record its actual message reference against a known content hash. This is explicitly **operator-reported** evidence, not a transport-verified receipt. Repeating the same hash/reference is idempotent. A receipt remains attached to its old hash when the file changes; no HTTP success, hook exit code or model inference creates a receipt. HTTP is `not-checked` and human viewing is `unknown`. Delivery recording and inventory remain available after close; new registration requires an open lane. A crash between sending and recording does not authorize a resend: inspect the transport first.
243
-
244
- `report --kind done` and the close hook/close receipt append the same public summary: current URL, content hash, registration time and matching checkpoint/receipt counts. They omit private names/paths and withhold changed or unavailable public links. A successful `threadDone` hook is not automatically counted as delivery; it may only rename a thread. Close preserves its lane-owned worktrees containing that lane's registered files or their recorded canonical targets, including private and older versions. An active writer, damaged index or unresolved worktree path conservatively keeps the worktree with an explicit warning. There is no automatic artifact copy, deletion or external upload.
245
-
246
- ### `dori verify-pr <owner/repo> <num> [--loop N] [--cwd DIR]`
247
- Run before a lane claims PR work done. It reads the PR through `gh api` (the PR, every commit with all of its files, the PR's files, then the PR again) and checks:
248
- - every commit's author and committer email is the one in `repoIdentities` for that repo, ignoring case. The name may differ. `noreply@github.com` is accepted only as the committer of a merge commit, even if it is the configured email. A repo with no configured identity fails before anything is read; `loadConfig` drops an entry whose `name` or `email` is not a nonempty string, so such a repo counts as unconfigured;
249
- - a PR with `fix:` or `fix(<scope>):` commits (with or without `!`) that touch source changes at least one test. A test file counts when GitHub lists it as added, modified, renamed, copied or changed (not removed) and it is named as a test (`*.test.*`, `*.spec.*`, `test_*.py`, `*_test.go`, `*_test.py`) or sits in a `test`, `tests` or `__tests__` directory. Nothing under a `fixtures`, `__fixtures__`, `__snapshots__`, `helpers`, `fakes` or `mocks` directory counts. In a test directory, a file that is not named as a test does not count when its name is `setup`, `conftest`, `test-utils`, `fixture(s)`, `helper(s)`, `fake(s)` or `mock(s)`, or when it sits in a `setup`, `conftest` or `test-utils` directory; a file named as a test (`test/setup.test.ts`, `test/helpers.test.ts`) counts. A body line `No test: <reason>` waives this. A fix commit without its own test is a warning, since its test may be in a later commit.
250
-
251
- If the head, body or commit count changed between the two reads, or GitHub's answer is incomplete, the result is `FAIL`. Each `gh api` call is killed after 120 seconds, which is also a `FAIL`. Changed UI tests (`.tsx`/`.jsx`, a `ui`, `component(s)`, `feature(s)`, `e2e`, `browser` or `playwright` directory, or DOM calls in the patch) are listed with a shell loop that runs them `--loop` times (default 20) at the reported head. dori never runs the loop. `PASS` exits 0, `FAIL` exits 2.
252
-
253
- ### `dori pr track <owner/repo#N|pull-url> [--lane K] [--thread REF]` / `pr untrack <ref>` / `pr list` / `pr watch [--loop MIN] [--ignore-author LOGIN]... [--self LOGIN]`
254
- Follow a pull request after the lane that opened it has closed: reviews, CI failures, commits someone else pushed to its branch, and its merge. `track` takes `owner/repo#N` or a `https://github.com/owner/repo/pull/N` link and prints `PR_TRACKED <owner/repo#N> lane=<key|-> thread=<ref|->`. `--lane` must name a registered lane (open or closed); its thread is used when `--thread` is not given (a lane launched without a thread, recorded as `none`, gives none, and `--thread none` also means no thread). A lane key or thread is one token, without spaces or control characters, because both are printed inside the event lines. A PR is one record however its owner and repository are cased. Tracking a tracked PR again replaces its lane and thread and keeps its cursor; if the watcher already saw it merge or close, it is read once more. `untrack` ends the tracking and prints `PR_UNTRACKED`, or `PR_NOT_TRACKED`; tracking it after that starts from a new baseline, even if no pass ran in between. `list` prints the tracked PRs as JSON with `since` (when this tracking began), `trackedAt` (the latest track) and the watcher's last head, state, read time and number of known items (`watch: null` before the first read, or after a `PR_WATCH_WARNING` that the cursor file is damaged).
255
-
256
- With `prAutoTrack: true` (default `false`), a recorded `claim-done` tracks every pull-request link in its evidence, and a `checkpoint` every link in its `--remote-effect` receipts, for that lane and its thread. Only full `https://github.com/<owner>/<repo>/pull/<N>` links count; `owner/repo#N` in free text may be an issue and is not taken. A link already tracked for the same lane and thread writes nothing, so a repeated receipt does not make a merged PR read again. The `PR_TRACKED` lines go to stderr. A tracking failure prints `PR_TRACK_WARNING <reason>` on stderr and never changes the claim or checkpoint, which is already recorded.
257
-
258
- The record is `<stateDir>/pr-watch.jsonl`, one append per change, so the lead and a lane can track at once; a write cut off halfway is skipped quietly, and other damage is named (`PR_WATCH_WARNING` from `list`, and once per damaged line `PR_WATCH_WARN - tracking record damaged: ...` from `watch`).
259
-
260
- `watch` needs `gh` with read access to the repositories. It prints `PR_WATCH_READY`, then every `--loop` minutes (once with no `--loop`) reads each tracked open PR through `gh api`: the PR, its review comments, conversation comments, reviews, its commits when the head moved, and the check runs and combined commit status of the head, every page of each. The first read of a PR is a baseline: `PR_WATCH_BASELINE <pr> lane=... thread=... head=<sha7> state=<state> known=<n>`, and nothing already there is reported. After that each new item is one line, once:
261
- - `PR_FEEDBACK <pr> lane=<key|-> thread=<ref|-> kind=<review-comment|comment|review-<state>> by=<login> <url> | <excerpt>`. A review counts when it is submitted in any state but a bodiless `COMMENTED` (its words are in its review comments), and again when its state changes, as when an approval is dismissed (`kind=review-dismissed by=<reviewer>`). A branch rule that dismisses stale approvals on every push therefore prints a line per dismissed approval. Pending reviews never count. Edits to an existing comment or review body are not news.
262
- - `PR_HEAD_MOVED <pr> lane=... thread=... by=<logins|unknown> +<new commits> <old7>..<new7>[ rewritten] <pr-url>` when the head moved with commits by someone other than us, or with no new commit at all. A commit's people are its author and committer; GitHub's `web-flow` web committer is not a person. A Git identity linked to no GitHub account counts as ours when its email is one of the configured `repoIdentities` emails, and otherwise prints as `unknown`; emails are never printed. `rewritten` means the old head is no longer in the PR, as after a force-push. Our own pushes print nothing. GitHub lists at most 250 commits of a PR; past that the new commits come from a compare of the old head with the new one. If GitHub no longer has the old head (the compare answers HTTP 404, as after a force-push), the line is `by=unknown +0 ... rewritten`; other compare failures are retried like any failed read.
263
- - `PR_CI_FAIL <pr> lane=... thread=... conclusion=<conclusion> head=<sha7> <url> | <check name>` for a check run concluding `failure`, `timed_out`, `cancelled`, `action_required` or `startup_failure`, or a commit status in `failure` or `error`, on the current head. A rerun that fails again is a new check run and a new line. Failures already there at the baseline are not repeated.
264
- - `PR_MERGED <pr> lane=... thread=... sha=<merge sha>` or `PR_CLOSED <pr> lane=... thread=... unmerged`, also at once for a PR already closed at its baseline. A merged PR is not read again unless it is tracked again. A PR closed unmerged costs one read of the PR per pass until it is untracked; when it reopens, `PR_REOPENED <pr> lane=... thread=...` follows what arrived meanwhile, and it is followed as before. If it was reopened and merged between two passes, what arrived meanwhile and `PR_MERGED` are printed instead.
265
-
266
- "Us" is the `gh` account (`gh api user`), or `--self LOGIN`. Until it is known, nothing is read and `PR_WATCH_WARN self holding: ...` is printed once, since every push of ours would otherwise look like someone else's. Comments and commits by us or by an `--ignore-author` login (repeatable, case-insensitive, for bots) are marked seen without a line. Text from GitHub is data: logins, kinds and check names are folded to one token, excerpts to one line of at most 160 characters with control, line-separator and bidirectional-control characters removed, and a URL that is not one clean `https://` token prints as `-`.
267
-
268
- The watcher's cursor is `<stateDir>/pr-watch-state.json`, written through a temp file and rename after the pass's lines are printed, so a crash in between prints a line again rather than losing it. Run one `pr watch` per state directory, as with `watch` and `freshness`. A failed read (a `gh` error or timeout after 120 seconds, an incomplete answer) changes nothing for that PR and prints `PR_WATCH_WARN <pr> <reason>` once per distinct reason until a read succeeds (for a PR closed unmerged, its one read); what arrived meanwhile is reported then. A commit list that holds the head read just before it anywhere but last, or lacks it while shorter than GitHub's 250-commit cap but not empty (a push during the read), is read once more, so a head is never saved with another head's commits; a branch still moving then is read again on the next pass. A cursor file that cannot be read or is damaged holds every pass with `PR_WATCH_WARN state holding: ...` and is left in place, never reset to a new baseline that would hide events. Any other failure of a pass (an unreadable tracking record, a cursor that cannot be saved) is `PR_WATCH_WARN run <reason>`, once per distinct reason. Each pass costs six `gh api` calls per open PR, more when the head moved or a list runs past 100 rows, and one per PR closed unmerged; five open PRs every three minutes is about 600 calls an hour, within GitHub's 5,000 hourly limit for an authenticated user. A list of exactly 3,000 rows is read whole; a longer one is refused rather than read in part.
269
-
270
- ### `dori claim-done [<key>] --evidence TEXT` / `dori object-done <key> --reason TEXT ...`
271
- The two halves of the done flow. Both message the lane's pane and check that Enter registered.
272
-
273
- Lane records change under a per-lane lock, and a status change applies only if no other status change (a claim, objection, verification, pause, resume or close, including a second objection to a `not-done` lane) landed since the command read the lane. Otherwise nothing is recorded: `claim-done`, `object-done`, `close`, `pause` and `resume` print `LANE_CHANGED <key> moved on while this ran (now <status>, was <status>); <change> not recorded` and exit 3. Read the lane again and decide anew.
274
-
275
- ### `dori lanes [--thread REF] [--open]`
276
- Lists registered lanes as JSON with their key, title, exact thread reference, status and open/close times. `--thread` matches the complete stored reference; use one consistent reference for lanes sharing a work thread. `--open` excludes only `closed`, so paused, blocked-progress, not-done and unverified claims remain visible. It changes no records.
277
-
278
- ### `dori close <key> [--note TEXT]`
279
- Set `"threadDonePolicy": "last-lane"` in the config to run `threadDone` only when the final registered member of that exact thread closes. Every non-closed member holds the hook. Close, park, abandon and reopen of an existing member acquire its lane delivery lock before the shared thread lock. The thread lock serializes the election and registry commit, including native pane confirmation for a reopened close. Park and abandon hold it from before the native pause or close through the terminal receipt; reopen holds it through pane creation and registration of the new paused generation, not startup, goal resume or note delivery. The recorded native session and its files are preserved across park/reopen. Thread hooks, cost recording and later cleanup run outside the lock. An unreadable or malformed membership row blocks election.
280
-
281
- A live thread lock held beyond 30 seconds prints `HELD <key> thread close in flight (...)` (manual close, exit 2) or `LANE_HELD ...; retried next tick` (watch). A claim verified while waiting stays open for boot monitor cleanup. An unprepared close checks Done inside the acquired lock, even if an earlier preflight passed while it was contended. A still-bound prepared native close keeps its saved checks. The default (or `"every-lane"`) keeps the per-lane hook behavior; `thread: "none"` never invokes a thread hook.
282
-
283
- The lead owns a shared thread's title and completion state; launch footers tell lanes not to rename or archive it when their own part finishes. Grouping changes only the existing hook decision, not the title or archive flag. Park and abandon never run the Done hook. Hooks remain external, best-effort effects: a crash after the close, or a failing hook, requires the lead to reconcile it. A member reopened after the close commit, or a new lane registered after the snapshot, is new work, not part of that completed election.
284
-
285
- Closes a lane now. Refuses (exit 2) unless every `Done =` signal reads back live or a still-bound native close already recorded the checks. Close and watch use the lane's delivery lock, so a `dori tell` or `dori pause` either finishes first or sees the resulting lane state. A delivery lock held beyond 30 seconds prints `HELD <key> a message to the lane is in flight (<holder>)` (manual close, exit 2) or `LANE_HELD ...; retried next tick` (watch).
286
-
287
- Native closes refuse a confirmed working or blocked main, including approval waits, with `HELD` / `LANE_HELD`. When close preparation can bind the native process, the existing intent records its exact PID, kernel `startTicks` and `bootId`; cleanup then requires both pane absence and that process incarnation's exit. This applies to first-run and reopened lanes on herdr and hc. HC prepared-close recovery requires complete observed foreground arguments: a name alone or malformed argv stays held even after the saved native process exits. A surviving process or failed/invalid read after preparation stays held; a later watch tick can settle after exit without closing the missing pane again. An interrupted close can also resume after that process exits when a fresh probe confirms only a bare shell remains; another native writer or a shell script stays held. Wall-clock shifts cannot release this fence. A reused PID from a different kernel incarnation is not signalled. An older prepared intent can acquire missing proof only from its still-live bound pane. An initial legacy close with no prepared proof retains its existing behavior when native identity is unknown, including a main that already shut down; it gains no unknown-state safety guarantee.
288
-
289
- These are living-work safety guards, not a full quiescence barrier. They do not guarantee safety for an unknown initial lane or completion of owned async jobs, queued input or services; that broader policy needs native read-only, explicit-unknown and quiescence APIs. Holding every unknown initial close, or retaining PID/boot/start evidence in native retirement records, are separate follow-up policies, not part of this change. `native-omp.patch` and `native-omp.lock` are unchanged.
290
-
291
- ### `dori lesson add <key> --rule TEXT --evidence PATH [--cwd DIR]` / `lesson add --global --rule TEXT --evidence REF` / `lesson list [--cwd DIR]` / `lesson mark <id> --outcome ...`
292
- A lesson is one rule learned in a lane, tied to the evidence that taught it and to the lane's repo (its `cwd`, resolved to a real path). A `--global` lesson is the lead's standing rule for every lane, whatever its repo: it has no `cwd` and is recorded as `lane: "lead"`. Since it reaches every future brief, it is the lead's: `--global` with a lane key is refused and writes nothing. So are `--global` and `lesson mark` on a global lesson when run from a pane that a registered open lane owns (your own session, from `HC_TERMINAL_ID`, else `HERDR_PANE_ID`, found as `claim-done` finds its lane); repo lessons stay markable from lanes. The pane check is a convenience check that stops a lane from adding or reviving a global lesson by accident or on routine instruction. It is not a security boundary: it reads only the session variables (`HC_TERMINAL_ID` first, then `HERDR_PANE_ID`), so unsetting them gets past it, and anything that can write files can append to `lessons.jsonl` directly. `dori launch` puts the newest `pending` or `helped` lessons for the new lane above its brief: up to 12 global ones under "Lessons for every lane", then up to 8 for its `cwd` under "Lessons for this repo". Each kind has its own cap, so global rules never push repo lessons out. A global cap only bounds runaway growth: a standing rule the owner gave must not disappear because newer ones arrived, so the cap sits well above the orders a real home holds. A lesson a cap still keeps out is returned in `omitted` and printed on stderr as `LESSON_OMITTED <id> (global) <rule>` for a global lesson or `LESSON_OMITTED <id> (<canonical-cwd>) <rule>` for a repo lesson, beside the launch warnings. `lesson list --cwd DIR` shows the global lessons too. `mark` records whether a lesson `helped`, had `no-effect`, was `harmful`, or is now `encoded` in a test, lint or doc; only `pending` and `helped` reach new briefs. Lessons live in `<stateDir>/lessons.jsonl`, one record per change: a mark appends, it never rewrites history. A rule is one line of at most 400 characters. A damaged line (not JSON, an unknown field, a malformed field, or a change to a lesson's fixed fields) is skipped and named: `lesson list` and `launch` print `LESSON_WARNING <path>:<line>: <reason>` on stderr and go on with the other lessons. The reason names the field for a malformed, unknown or changed field; a line that is not JSON, or not a JSON object, has no field to name and is reported as such. Each record starts on its own line, so a write cut off halfway damages only its own line.
293
-
294
- `dori close <key> --lesson TEXT [--evidence PATH]` adds a lesson as part of the close (evidence defaults to the `Done =` line). It never blocks the close: a failure prints `LESSON_WARNING`.
295
-
296
- ### `dori worklog add <title> --source REF [--thread REF]` / `next <id> <text>` / `note <id> <text>` / `close <id> --result TEXT` / `list [--open]`
297
- Optional `--thread REF` links the owner request to its work thread in the JSON record, rendered Markdown and boot output. The reference must be nonempty, whitespace-free and not `none`; old entries without it remain readable. Closing a worklog item does not close its lanes or its thread.
298
-
299
- The lead's record of owner requests, so an open request survives a restart, a compaction or a handoff. `add` records a request when it arrives, with its source (`slack:<channel>/<ts>` or any reference to the message) and prints the item with its 8-hex-digit id. `next` replaces the item's next step, `note` adds a dated note (a decision, who owns it), `close` records the result and ends the item; a closed or unknown item is refused. Each text is one line, without control characters (C0, DEL, C1) or the Unicode line and paragraph separators. `list` prints the items as JSON (`--open` only the open ones), oldest first.
300
-
301
- The record is `<stateDir>/worklog.jsonl`, one append per change, so the lead and a lane can write at the same time without losing one; a write cut off halfway damages only its own line, which every reader skips quietly as a normal result of the design (a line that does not parse but begins like a record, `{"op":"`). Any other bad line is real damage: `list` names it as `WORKLOG_WARNING <path>:<line>: <reason>` and skips it. If two writers close the same item at once, the first close in the record wins and a later `close` is a no-op; a `next` or `note` after the close lost the same race: it is skipped and `list` still names it as a `WORKLOG_WARNING`. After every change `<stateDir>/worklog.md` is rendered from the whole record (temp file and rename) for the lead to read: one heading per item with Source, Opened, Next, Notes and, once closed, Closed and Result, open items first. A render that raced another writer's append renders again, so the file always ends up holding every item. Edit through the command, not the file: a `worklog.md` that the command did not write (no marker on its first line) is never replaced (the marker is checked before the append and again right before the rename, and a publish that finds it gone is skipped), and every change is refused until it is moved aside.
302
-
303
- `dori boot` prints `WORKLOG open=<n>` and one `OPEN <id> "<title>" source="<ref>" next="<next step>"` line per open item, so the lead continues each from its Next line. A damaged line (not a torn write, a duplicate close, or a `next`/`note` after a close) is `WORKLOG damaged <path>:<line>: <reason>` and makes the boot incomplete. A `next` or `note` after a close prints as `WORKLOG warning <path>:<line>: <reason>` and does not fail the boot.
304
-
305
- ### `dori decision ask <question> --source REF ...` / `posted` / `answer` / `choose` / `withdraw` / `match` / `list` / `digest`
306
- The lead's record of product choices put to the owner, and of the lead's own routine choices, so a pending question is asked once, re-posted from the record rather than from memory, and its answer is bound to the right question and to who gave it. Successful mutating commands print the resulting decision as JSON; the read commands have the formats described below.
307
-
308
- Each decision has a `kind`. `owner` is the default, and every decision recorded without a kind (including every record written before kinds existed) reads as `owner`: only the owner's answer settles it. `routine` is a reversible choice inside the work's original scope and goal, between options already named: the owner may still answer it, and the lead may instead choose one of its numbered options with `choose`. Cost or spending, permissions or access, commitments to anyone outside, irreversible work, a change of scope or goal, and open questions are `owner`. The record never guesses a kind from the question's words; the lead states it when asking. No answer or choice in this record is a permission grant: a native execution approval is answered only at its own prompt, and nothing here reads or changes one.
309
-
310
- The command records the provenance the caller supplies; it does not fetch that message or authenticate its author. `authority` names the recorded answer path, not a new permission grant.
311
-
312
- - `ask <question> --source REF [--lane K] [--thread REF] [--kind owner|routine] [--option TEXT]... [--recommend N] [--worklog ID] [--message REF]` records a question with an 8-hex-digit id. `--option` may repeat up to 9 times; options are numbered 1..n in the order given. `--kind routine` needs at least two options and a thread (given, or the lane's), so an open question or one without the work's thread stays the owner's; any other `--kind` than `owner` or `routine` is refused. Any value flag of `dori decision` (`--source`, `--lane`, `--thread`, `--kind`, `--option`, `--recommend`, `--worklog`, `--message`, `--reason`) with no value, at the end of the line or followed by another flag, is refused with `<flag> needs a value` and nothing is written; a value that starts with `--` is given as `--option=--text`. `--recommend N` marks one option and is refused without options or outside 1..n. `--lane` must be a registered lane (open or closed); without `--thread` the lane's thread is stored, and `--thread none` stores no thread. `--worklog` links an open worklog item and is refused for an unknown or closed one. `--message` is where the question was posted (for example `discord:<channel>/<message-id>`).
313
- - `posted <id> --message REF` records or replaces the posted message of an open decision.
314
- - `answer <id> <answer> --source REF` records the owner's answer and the owner message it came from. When the decision has options and the answer is a bare number, it must be one of them and is recorded as `option: N` with the text; a number outside 1..n is refused and nothing is written. Any other text is recorded as free text with no option: a match is never guessed. When the decision links an open worklog item, a note `decision <id> answered: <answer>` is added to it. If that note would exceed 1000 characters, it records `decision <id> answered (see decisions.jsonl)` instead; the full answer stays in the decision ledger. A failed note prints `DECISION_WARNING <reason>` on stderr and keeps the answer. The decision reads `authority: "owner"`.
315
- - `choose <id> <N> --reason TEXT --source REF --thread REF` records the lead's own choice of option N of an open `routine` decision. First post the choice and its reason in the decision's original thread through the usual messaging; `--source` is that posted message and `--thread` must be exactly the decision's thread. The decision then reads `authority: "lead"`, `option: N`, `answer` as that option's text, `reason`, and `answerSource` as the posted message; its question `source` and `thread` stay as asked. An `owner` decision, anything other than exactly one bare option number in 1..n (free text, a number outside the options, two numbers), a missing or different `--thread`, or other than exactly one `--reason` is refused and nothing is written. A linked open worklog item gets the note `decision <id> chosen by the lead: <option>`. `choose` sends no message, does not forward the choice to a lane, and grants no permission.
316
- - `withdraw <id> --reason TEXT` ends a decision that is no longer needed because it became moot. It records no choice: it is not a way for the lead to decide an `owner` decision.
317
- - `match <message-ref>` prints the open decision posted as exactly that message and exits 0; with none it prints nothing and exits 1. This binds a reply: read the replied-to message id of the inbound reply and run `match` before reading the reply as an answer. A reply to any other message is an ordinary message. Only one open decision may be posted as a given message, so `ask --message` and `posted` refuse a message already bound to another open decision.
318
- - The reference is what a reply names, written the same way for `--message` and `match` (for example `<messenger>:<chat>/<id>`): on Discord use the physical channel and `ref=` on the owner `INBOUND` line, not the supplemental snapshot or its author; on Telegram use `reply=`. A Slack reply names only its thread root (the `<thread>` field of `INBOUND slack`), not a message inside the thread. So a question posted in a Slack thread is recorded with the thread root as `--message` (the question's own ts when it starts the thread; the ts `SENT` prints for a message posted inside a thread never matches a reply): one open decision per Slack thread, and every owner message in that thread matches it, so read the reply before recording it as the answer.
319
- - `list [--open]` prints the decisions as JSON, oldest first. `digest` prints one line per open decision for a status message: `<id> <age>h lane=<k|-> kind=<owner|routine> <question> | 1) <option> | 2) <option> (recommended)`. `match`, `list` and `digest` send damage and warnings to stderr as `DECISION_WARNING ...`.
320
-
321
- An unknown decision, or one already answered or withdrawn, is refused with a one-line error. Each text is one line without control characters (C0, DEL, C1) or the Unicode line and paragraph separators, and a lane, thread or message reference has no spaces. A lane launched without a thread (recorded as `none`) gives no thread.
322
-
323
- The record is `<stateDir>/decisions.jsonl`, one append per change (`ask`, `posted`, `answer`, `choose`, `withdraw`), with no rendered view. An `ask` records `kind` only when one was given; a `choose` record holds the option number, reason, source and thread, never answer text. The same rules hold when the record is read, so a hand-written or raced line cannot get past them: a `routine` ask without two options or a thread, a `choose` for an `owner` decision, for another thread or for an option the decision does not have, or one without an option number, is damage and settles nothing, even when it comes after the decision was settled. A `choose` counts as an answer in the races below. A record with `kind` or `choose` is unknown to an older `dori`, which names it as damage. As in the worklog, a write cut off halfway damages only its own line and is skipped quietly, any other bad line or unknown field is damage, and every write is read back. Each record carries its own random nonce `n` (8 hex digits), and a command judges its readback by that nonce, never by matching text or time, so two identical changes in the same millisecond are still told apart. If two writers resolve the same decision at once, the first `answer`, `choose` or `withdraw` in the record wins; a later `answer`, `choose`, `withdraw` or `posted` is ignored and named as a warning, and the losing command fails with a one-line error saying so (a losing `answer` or `choose` writes no worklog note). Message binding races the same way: the first `ask --message` or `posted` in the record binds a message among open decisions, and a later one naming a message another open decision holds does not bind it and is named as a warning. A losing `posted` changes nothing; a losing `ask` still records the decision, without the message, and its error names the holder and says to bind it with `decision posted` once the message is free. A `posted` replaced by a later `posted` before its readback reports that it was replaced. A resolved decision frees its message.
324
-
325
- `dori boot` prints `DECISIONS open=<n>` and one `DECIDE <id> age=<h>h lane=<k|-> thread=<ref|-> "<question>"` line per open decision after the `WORKLOG` lines. A damaged line is `DECISIONS damaged <path>:<line>: <reason>` and an unreadable record `DECISIONS unreadable <path>`; both make the boot incomplete. A lost race (a late change after a resolution, or a message binding another open decision already held) is `DECISIONS warning ...` and does not fail it. Without `decisions.jsonl`, boot prints nothing about decisions.
326
-
327
- Nothing is decided automatically: there are no defaults and silence is never an answer; a recommendation is not a choice, and a `routine` decision stays open until the owner answers or the lead records a `choose`. The command does not forward an answer or choice to a lane; the lead does that itself (with `dori tell` once available, or the existing session messaging rules). Owner requests stay in `dori worklog`; harness `backlog --decision` is for harness items not yet started, and a lane's `report --kind question` only marks that lane blocked.
328
-
329
- ### `dori pause <key> [--note TEXT]` / `dori resume <key> [--note TEXT]`
330
- `pause` is for when the owner said wait. It works on a `working` or `not-done` lane. It sends `/goal pause`, then confirms the current OMP session's recorded goal is paused or absent before marking the lane paused and sending Escape to an active turn. A completed/dropped goal requires the corresponding OMP no-goal screen response as corroboration. Missing/stale state, an open approval, or an unconfirmed send leaves the lane unchanged with `PAUSE_UNVERIFIED`, exit 3. Pausing the goal first prevents Escape from triggering a continuation. The whole pause holds the lane's delivery lock (see `dori tell`), so no tell starts a turn after its Escape; if a tell holds the lock for 30 seconds, the pause sends nothing and prints `PAUSE_UNVERIFIED <key> a message to the lane is in flight (delivery lock: <holder>); lane left <status>`, exit 3.
331
-
332
- A paused lane is skipped by `freshness`: no nudge, no post. Only `dori resume` ends a pause, on the owner's word. Activity never does, because a paused lane can still be woken by a background result, a queued message or a turn after Escape. If its pane reads `working` on two ticks in a row, `freshness` prints `WORKING-WHILE-PAUSED` once per working stretch (again after it goes idle and is woken, or after a new pause), so the lead can ask the owner, and the lane stays paused.
333
-
334
- `resume` sends `/goal resume` and confirms the trusted OMP goal state is active, then restores the lane's `pausedFrom` status and resets quiet time so a long pause does not become an instant nudge. Missing/stale state, an approval hold or an unconfirmed send gives `RESUME_UNVERIFIED`, exit 3.
335
-
336
- Both print `PAUSED` / `RESUMED` and exit 0 on success. A lane in any other state is refused (`NOT_PAUSED` / `NOT_RESUMED`, exit 2), and a second `pause` is a no-op. A lane claimed, objected to or closed while the goal command ran is left as that writer put it (`LANE_CHANGED`, exit 3); the goal command itself was confirmed, so check the lane before retrying. `claim-done` and `object-done` on a paused lane move it out of `paused` in the registry while its goal stays paused.
337
-
338
- ### `dori park <key> --note TEXT [--resume-when TEXT]` / `dori reopen <key> [--note TEXT]` / `dori holds [--thread REF]`
339
-
340
- `park` pauses an exact bound OMP session and closes only its pane; `close <key> --abandon --reason TEXT` explicitly ends unfinished work. Neither claims Done or removes worktrees. `holds` lists pauses and parked or interrupted park intents without changing anything. Reopen is explicit and reuses the recorded session. See [pause, park and abandon](sessions.md#pause-park-and-abandon) for identity, pending Discord work and recovery rules.
341
-
342
- ### `dori tell <key> --text TEXT`
343
- Sends the lead's message to a registered lane's session once through `sendVerified`. Ordinary messages from `claim-done`, `object-done` and freshness share its durable delivery fence. Explicit `pause` and `resume` remain control operations: they can still run and never resolve a message hold.
344
-
345
- This is a fence for Dori automation (`tell`, freshness nudges, and claim/objection notices), not a global native input lock. Direct owner messages through native Discord and native ASK replies keep their existing admission rules, so an uncertain automated send cannot cut off owner control or change the native ASK contract. Owner input does not resolve the record: later Dori automation remains held until the exact-ID release. Explicit `reopen --note` is the same operator-control exception: it may deliver the note once despite an automation hold and neither creates nor clears a `.delivery` record. An unconfirmed reopen note is reported by `reopen` and must not be resent automatically.
346
-
347
- A normal tell prints one line:
348
-
349
- | Line | Exit | Meaning |
350
- |---|---|---|
351
- | `TOLD <key> delivery=confirmed` | 0 | the agent's status moved to working after the send |
352
- | `TELL_UNCONFIRMED <key> delivery=unconfirmed: ...; do not resend` | 3 | the text may be in the session, but no move to working was seen. An agent that was already working gets it as queued input and always lands here. So does herdr's typed fallback when the text was typed but its Enter failed (stderr says `text typed but Enter failed`): read the pane, and if the text still sits in the input, press Enter only |
353
- | `TELL_HELD <key> delivery=held: request=<id> ...` | 2 | an earlier dispatch is uncertain. This new message was not sent or queued; inspect the exact request with `--status` before deciding whether to release its hold |
354
- | `TELL_FAILED <key> delivery=failed: <why>; nothing was sent` | 2 | no running agent (a shell, a suspended or stopped agent), an open approval, an unreadable status, on hc an agent that is `blocked` or in `error` or whose status changed just before the send, a paused lane, a lane with no session, or text containing a backtick or `$(`. When the runtime refused the delivery, `<why>` ends with `(status now: <status>)` read after the refusal (the paused, sessionless and unsafe-text refusals read nothing), so a blocked agent waiting on a question is told apart from a shell (`no agent`). `idle` or `working` there means a shell in front of a suspended agent, an open approval or a failed probe: read the pane before trying again |
355
-
356
- No `[LEAD]` prefix is added. Like every `--text`, leading and trailing whitespace is trimmed. The runtime's delivery shapes the rest: hc sends the text as it is, while herdr's typed fallback (used for agents herdr did not start) joins lines into one, replacing each line break and the indentation around it with ` / `, so a multi-line message arrives as one line there. A paused lane is refused because a message would start a turn the owner asked to hold; `dori resume` it first. tell reads the lane again under the lane's delivery lock (`<stateDir>/lanes/<key>.deliver.lock`), which `dori pause` holds from its `/goal pause` through its registry change and Escape: a tell either lands before a pause, whose Escape then stops the turn it started, or finds the lane paused and sends nothing. If the lock stays held for 30 seconds, tell sends nothing (`TELL_FAILED ... a pause or another tell holds the lane's delivery lock (<holder>)`); a holder that died is taken over, but a live one on this host keeps the lock however long its pane round trips take (30 seconds is how long the other side waits, not how long a holder may hold). `dori close` and the watch's auto-close take the same lock to mark a lane closed, so a lane closed meanwhile is refused the same way and a close never lands in the middle of a send. An unknown or closed key and a missing `--text` exit 1. Nothing is written to the registry or the lane's journal.
357
-
358
- Before runtime delivery, a private, atomically replaced and fsynced `<stateDir>/lanes/<key>.delivery` records the latest local dispatch ID, lane registration, session, timestamp and `uncertain` status, never the message body. A proven refusal records `failed`; the existing status readback records `confirmed` (not proof that the requested action ran). A process exit, unexpected runtime error or unconfirmed result keeps the hold across restarts and registry replacement. Unexpected runtime errors still propagate from direct commands after printing the uncertain request ID. Automatic watch/freshness ticks report the affected lane and continue processing other lanes without retrying its message. Unreadable state or a failed pre-delivery write stops dispatch. Claim and objection notifications do not wait for another in-flight delivery: they print the refusal instead, while their state transitions remain recorded. Freshness waits for its outer delivery lock; if it cannot acquire the lock, it skips the lane without printing a refusal. Freshness reports `HELD <key> TELL_HELD ...` for a fenced nudge, including its request ID.
359
-
360
- `dori tell <key> --status` is read-only and prints `TELL_STATE <key> <json-or-null>`. `dori tell <key> --resolve REQUEST_ID --note REASON` acquires the same delivery lock and accepts only the exact latest uncertain ID (or an already released identical ID). A missing, stale or different ID is refused with exit 2. Resolution records `released`, the time and operator note, and prints `TELL_RESOLVED` with exit 0. It ends only the hold: the original delivery remains unknown, is not confirmed or cancelled, and no text, Enter, goal command or queued task is sent. Repeating the same release is idempotent; it cannot release a newer request. These two operations also work for a closed registration. A following new dispatch replaces the latest record; this file is not a complete audit history or a native submission/run receipt.
361
-
362
- Watch notification refusals and uncertainty are stdout `LANE_NOTIFY_HELD` / `LANE_NOTIFY_UNCONFIRMED` events, not just stderr warnings. Freshness emits `HELD` for a refused nudge and `DELIVERY-ERROR` for a state/runtime error; watch emits `LANE_WATCH_ERROR` for a failed settle. Use the filters in [setup](setup.md#5-monitors) and reconcile these events even when the lane already changed to not-done. State transitions do not prove delivery.
363
-
364
- If `.delivery` is corrupt or unreadable, leave these automated sends blocked. Inspect the original session and recover the exact last record from trusted evidence; do not delete the file or invent a replacement ID to bypass its hold. If that record cannot be recovered, ask the operator how to recover state. Once a valid uncertain record is restored, the normal exact-ID release remains a separate explicit decision.
365
-
366
- The three tell modes are mutually exclusive. A later message rejected by the fence is not queued for automatic delivery after resolution. Neither activity nor a pause/resume changes the hold, and resolving it does not resume a paused lane.
367
-
368
- ### `dori watch`
369
- Runs forever. Every 30 seconds it prints each new claim once (`LANE_DONE_CLAIMED`). Claims older than `closeAfterMin` are settled: unpushed or uncommitted work and failing signals turn into objections (`LANE_NOT_DONE`); otherwise the lane is closed (`LANE_CLOSED`). A claim that is objected to, claimed again, paused or closed while these checks run is left as the other writer put it (`LANE_CHANGED`). Verifying and closing hold the lane's delivery lock (see `dori tell`); while a tell or pause holds it past 30 seconds, the claim is left as it is with `LANE_HELD <key> ...; retried next tick`. The deadline lives in the registry, so a restart picks up where it left off.
370
-
371
- ### `dori freshness [--loop MIN]`
372
- For working lanes that have gone quiet: a nudge in the pane after `nudgeAfterMin`, then the lane's last `[REPORT]` line posted to its thread after `postAfterMin`, with home paths and pane ids scrubbed. Each happens once per silence. The line is posted only once it is still the last `[REPORT]` line on the next tick (`PENDING-REPORT` the first time) and differs from the line posted last time (`STALE-REPORT` otherwise). A post whose `hooks.threadReply` command exits non-zero is not recorded as posted: it prints `POST-FAILED <key> thread hook failed (exit <code>)`, without copying private hook stderr, and is sent again on the next tick; the same failure for the same line is printed once, not on every retry. A `[REPORT]` line counts when it starts the row or is a whole quoted element of an argv array, the shape lanes send it in (`["herdr", "pane", "run", "<lead pane>", "[REPORT] key | kind | text"]`, or `["hc", "send", "<lead terminal>", "--", "[REPORT] key | kind | text"]` on hc). Prose that quotes the grammar mid-sentence, and a report whose text is one unfilled placeholder, are not reports. A held-back outcome is printed once per change, not on every tick. A nudge reports its delivery as `delivered` (the agent status moved to working) or `unconfirmed`.
373
-
374
- A lane with a `reports.jsonl` journal is read from the journal first. Its last report skips the two-tick `PENDING-REPORT` wait, since it cannot scroll off, and is posted once the thread has had no update for `postAfterMin`, so a lane that reports often still has its latest report posted, at most once per `postAfterMin`. Its time counts as the lane last being heard from, so a fresh report suppresses the nudge. A `blocker`, `question`, `halted` or `done` lane is not nudged, but its report is still posted. A `stalled` lane is neither nudged nor posted: it stopped on a failed compaction or at an idle prompt, so a typed nudge cannot restart it and a person has to look. `STALLED` is printed once per stall for the monitor (see the filter in `setup.md`), and `Working` on the screen returns the lane to running, after which nudges and posts resume. A `jsonl-v1` lane never falls back to scraping the screen. `launch` starts its journal with a `running` activity record, which is not a report, so a lane with no report of its own is `NO-REPORT` and is still watched for a stall; a `jsonl-v1` lane with no journal at all is `NO-REPORT` and is not watched. The screen is still read for activity: a compaction failure with no `Working` line below it, or an idle prompt with no `Working` line and no report for `nudgeAfterMin`, marks the lane `stalled` and prints `STALLED` once; `Working` on the screen moves it back to running. A journal that does not parse skips its lane and prints `JOURNAL-ERROR` with the file and line, once per error; the other lanes are still swept. Adopted lanes ignore the journal and keep the screen path. On the screen, a report is a line that starts with `[REPORT]` (after indentation) or the last quoted element of an argv row such as `["herdr", "pane", "run", "lead:p1", "[REPORT] ..."]`, optionally inside one spawn call. Prose, an instruction or a prompt that quotes the grammar mid-sentence is dropped.
375
-
376
- #### Opt-in nudge and posting policy
377
-
378
- Defaults preserve the behavior above. Set `freshness` in the config to choose the quieter policy:
379
-
380
- ```json
381
- "freshness": { "nudge": "idle-only", "autoPostKinds": ["milestone"], "postRaw": false }
382
- ```
383
-
384
- - `nudge: "idle-only"` requires a trusted runtime probe to report a live idle agent without a shell or approval prompt before safe delivery. hc also conditions delivery on idle; herdr has no atomic status-and-send operation, so this is a live pre-send check, not an atomic guarantee. Working, blocked, unknown and missing agents are not nudged. An unknown status is not evidence of idleness. A failed safe-delivery attempt emits `NUDGE-FAILED` once per silence stretch and retries on later ticks; it does not consume the nudge. The existing paused-lane, stall, hung-call and ceiling checks still run. `"all"` is the legacy default.
385
- - `autoPostKinds` limits automatic posts; omitted means all five kinds, and `[]` means none. Excluded reports produce one `UNRELAYED` notice to the lead per report/change, not a raw owner message.
386
- - `postRaw: false` posts only a supplied `--owner` summary. A report without one (including adopted screen reports), or a missing reply hook, produces `UNRELAYED`; `true` is the legacy default. New launch footers request the owner summary when this option is set; an existing lane needs an updated brief or the lead's manual relay. Add `UNRELAYED` and `NUDGE-FAILED` to a freshness monitor's filter. A summary is preferred whenever present.
387
- - `relayed` receipts suppress the acknowledged journal report across restarts. A changed kind, text or summary remains eligible; an identical line and summary with only a newer timestamp retains the legacy no-repeat behavior. Legacy screen reports retain their two-tick and last-line checks. A failed reply hook never creates a receipt.
388
-
389
- Run one freshness monitor per state directory. The sweep rechecks receipts before invoking the hook and never overwrites a receipt recorded while the hook runs. A manual send can still race the hook after that check. A receipt records confirmed delivery, not an atomic transaction with an external messenger: a crash after delivery but before recording may still require the lead to reconcile the message.
390
-
391
- #### Supervision
392
- For launched (`jsonl-v1`) lanes whose `reports.jsonl` journal exists, each `freshness` tick also checks the items below. An adopted lane is not supervised: it has no ceilings and no hung-call check, even if a journal exists for its key.
393
- - **Ceilings.** `wallMinutes` since the lane opened, and `tokens` and `costUsd` from `supervision.usageArgv`. Reaching one appends a `blocker` report and prints `BLOCKED`. The lane is never killed, closed or sent anything; it waits for the lead, and raising a ceiling alone does not resume it. Limits come from `supervision.defaults`, then `supervision.lanes.<key>`, then `launch --wall-minutes N|none --token-limit N|none --cost-limit N|none`, and are saved on the lane. `null` (`none`) disables one. A malformed `supervision` entry (a ceiling that is not a nonnegative number or `null`, a ceiling or setting name that does not exist, such as `toknes`, a `lanes` entry that is not an object, an argv or path list that is not strings) stops every command with `invalid supervision <name>`, so a typo never turns a ceiling off.
394
- - **Hung calls.** A `Working` or `Running` timer on the screen that keeps growing from the same start for `hungAfterMinutes`, with no fresh evidence for `staleAfterMinutes` and the quiet-cycle confirmation below, marks the lane stalled (`STALLED`). Verified watched-path changes enter the evidence clock described under `dori report`. Candidates are Git's changed-file list, including individual untracked files, in the lane's `cwd` (`gitActivity`), excluding `node_modules`, paths outside `cwd` and Dori's own `<stateDir>/lanes`, plus `activityPaths` and `launch --activity-path FILE`. A report without evidence, a checkpoint without `--evidence-file`, a touch, a stage-only status change or a rewrite of identical bytes does not advance the evidence clock. Paths leaving Git status are checked before their marks retire: a deletion counts, but a commit of unchanged bytes does not. A symlink counts by its target text and a directory by its entry names without walking it; FIFOs, sockets and devices are never opened. Files that change during observation stay unknown until checked again. `supervision.json` keeps the marks and the separate `lastReportAt` and `lastEvidenceAt`; legacy records seed marks without resetting the quiet clock. Evidence does not lift a ceiling, a pause or an open approval.
395
- - **Usage.** `supervision.usageArgv` is an argv template (`{key}`, `{session}`, `{cwd}`) that prints `{"tokens": N, "costUsd": N}` cumulative totals. Alternatively, explicitly select `supervision.usage: "omp"` for local native observations of registered and verified session history. The two options cannot be combined. Missing or incomplete values are unknown, never zero. With either option set, readings are appended to `cost.jsonl`. Neither enables provider queries or changes the lane’s runtime or model.
396
-
397
- Watched paths reuse only settled lstat marks. A change in the current or immediately preceding wall-clock second is re-read even if its stat key matches: coarse filesystem timestamps can hide a same-size rewrite. A mark captured in that window is not reusable later without another read. Once settled, that read produces a reusable mark and subsequent quiet sweeps use lstat only; none of this metadata alone advances the evidence clock.
398
-
399
- A failed Git discovery keeps the last trusted file marks and cursor. A failed file read keeps that path unknown and schedules it for the next cycle; other paths still advance within the 256-path budget. Actual failures record `evidenceError`, reported as `SUPERVISION-ERROR`, and invalidate quiet-cycle proof. Reached ceilings and unknown-usage warnings still reach the lead. A normal non-repository cwd has no Git candidates and still observes explicit paths and journal evidence. Each sweep observes at most 256 paths, including the final check of retiring prior candidates. A fixed snapshot drains in successive windows, without folding files into directory names. Newly discovered candidates are remembered for the next snapshot even if committed or removed before it starts; they never restart the current snapshot. New candidate schedules are atomically saved in the existing observation file before candidate I/O, so interruption during hashing does not lose newly discovered paths. A partial cycle reports `coverageComplete: false`, not a recurring error; its verified file changes still enter the evidence journal. A hung verdict requires a completed cycle with no candidate-set change, new evidence or read failure, in addition to the existing timer and stale-evidence guards. For 1,000 stable candidates the observer covers every file in four sweeps; a changed cycle cannot declare hung, and the next complete quiet cycle can. No partial scan is presented as complete.
400
-
401
- Before a new hung declaration, supervision rechecks the stat marks for all candidates in the completed cycle. This is a confirmation pass, not an atomic filesystem snapshot. Observation I/O runs outside the delivery lock; the results apply only if the lane is still in the same generation when supervision commits them.
402
-
403
- Each alert prints once per change. A confirmed hung stall and its delivery state survive incomplete windows and observation failures: a Working line alone does not resume it, a successful alert is not repeated each cycle, and an undelivered alert retries on the next sweep. Ordinary idle/compaction stalls still resume on Working. Fresh evidence resumes a hung stall even while usage is unknown; a reached ceiling remains blocked. `close` takes one more usage reading, prints `COST <key> tokens=... costUsd=...`, and, when either is known, runs `supervision.recordCostArgv` (`{key}`, `{session}`, `{tokens}`, `{costUsd}`, `{at}`, and `{closeKey}`, `<key>@<openedAt>`, the same on every attempt; unknown values are the literal `null`). Once the hook succeeds the reading is marked final in `cost.jsonl`, and a later close of the same lane returns it without running the hook again. If that hook fails, close prints `COST <key> not recorded: <reason>` and still closes the lane. A supervision step that fails (an unreadable `supervision.json` or checkpoint journal) prints `SUPERVISION-ERROR <key> <reason>` once per reason; that lane's reports are still read and posted, and the other lanes are still checked. Both hooks run without a shell and time out after 10 seconds. Run one `freshness` sweeper for all lanes: each tick covers every open lane, so a second sweeper would repeat nudges, thread posts and supervision alerts.
404
-
405
- ### `dori usage` and `dori quota`
406
-
407
- `dori usage [<key>] [--since 24h|7d] [--by lane|thread|day] [--json]` reads registered lane intervals and verifies session relationships before counting usage. Output is an API price estimate, not a bill. A missing, ambiguous, oversized or unreadable source is reported as incomplete, never free. Journals are read with size limits and locally cached as numeric observations, without saving their message text in the cache.
408
-
409
- `dori quota [--refresh] [--json]` is a separate, manual, display-only command. It requires a trusted, explicitly configured `quota.command` launcher; the command appends only `usage --json`. By default it reuses its five-minute cache; `--refresh` makes a new read. Output is bounded and normalized. The CLI does not redeem credits, reset usage, enable overage, switch accounts, or apply a budget based on quota observations.
410
-
411
- ### `dori dead-panes [--loop MIN]`
412
- After all watched runtime/group listings succeed, the loop forgets screen tails and unknown counts for panes no longer watched, and retains alert deduplication keys only for currently watched panes in the current hour. A failed or malformed listing preserves the prior state: runtime list adapters reject missing/non-array results and malformed rows rather than treating them as an empty snapshot. A returning pane starts a fresh two-screen/three-unknown-tick observation; a change of hour (including a backward clock step) starts a fresh hourly deduplication window.
413
-
414
- Prints `DEAD_PANE <id>` once per hour for a pane with no running agent status whose last lines match `deadPanePatterns` on two ticks in a row with the same text. A pane the runtime reports as idle, working, blocked or done (on hc: the agent's own report, which can also be error) is never dead. A pane that is neither is unrecognised; three unrecognised ticks in a row print `UNRECOGNISED_PANE <id> ...` once (list non-agent panes in `ignorePanes`).
415
-
416
- ### `dori guard [--loop MIN]`
417
- Prints `HOST_GUARD ALERT <reasons>` when load, free memory, free disk or the pane count crosses its threshold, and `HOST_GUARD CLEAR` when it recovers. It also prints `COMPUTE_READY` / `COMPUTE_BUSY` as load crosses `loadOk`. Only changes are printed.
418
-
419
- ### `dori can-launch`
420
- Prints `CAN_LAUNCH` and exits 0 when the host has room for another lane. Otherwise it prints `HOLD <reasons>` and exits 4. The reasons come from the guard's memory, disk and pane-count thresholds. CPU load alone never holds a launch, because it moves too fast to plan around.
421
-
422
- ### `dori schedule` / `dori scheduler`
423
-
424
- Schedules are opt-in and live in the selected configuration's `<stateDir>/schedule.json`. Adding one never starts a runner or installs an OS service.
425
-
426
- ```sh
427
- dori schedule add usage-board --cron "*/15 * * * *" --tz Asia/Seoul --deliver log -- bun usage-board.mjs
428
- dori schedule list
429
- dori scheduler
430
- dori schedule pause usage-board
431
- dori schedule resume usage-board
432
- dori schedule remove usage-board
433
- ```
434
-
435
- `add NAME --cron EXPR --tz IANA [--cwd DIR] [--deliver wake|log|post:PLATFORM:TARGET] -- COMMAND ARG...` saves the exact argv, not a shell command, and the absolute working directory (default: the caller's directory). Croner 11 parses five-field expressions; seconds and time-dependent `?` substitution are refused. IANA timezone rules apply, with conventional day-of-month/day-of-week OR matching. Fixed-time jobs in a spring-forward gap run after the jump that day and run only once in a fall-back fold. Interval expressions skip the gap and include both repeated intervals. `next` is a stored UTC cursor, not a promise that a runner is alive.
436
-
437
- One `scheduler` owns each state directory. It checks every second by default; `--loop MIN` accepts a positive polling ceiling below one minute, with sleep shortened to the earliest unpaused occurrence and `--loop 0` does one due-work pass, waits for its claimed foreground commands and delivery, then exits. Every occurrence is durably claimed and its cursor advanced before spawning. An occurrence at least a minute late is counted as missed, never burst-replayed; a recovery tick advances at most 1000 missed occurrences per job. A job never overlaps its own unfinished run or delivery. Other jobs can run concurrently. Busy occurrences also increment `missed`.
438
-
439
- `list` prints the next occurrence, pause state, missed count, and last run's claimed time, start/finish, PID, exit/signal, delivery status and private output path. Recorded PIDs are explicitly unverified, not live-process proof. `pause` affects future runs, not a current command. `resume` starts from the next future occurrence without replaying the paused interval. `remove` refuses a running command or pending delivery and preserves its existing logs.
440
-
441
- A restart never re-executes a claimed occurrence. An unfinished claim becomes `interrupted`, pauses that job and requires inspection of its recorded PID/output and any orphan before `schedule resume NAME --ack-interrupted`. Recorded PIDs are never signalled during recovery. An interrupted completed delivery becomes `unknown` and is not posted again. These are conservative at-most-once attempts, not exactly-once execution or delivery.
442
-
443
- Use an owner-controlled local state directory (owner-only ACLs on Windows). A crash can leave `scheduler.lock` or `schedule.json.lock`; neither is automatically taken over, even if old. To recover, first stop all launchers and verify no scheduler, job or schedule writer still owns the directory; preserve the marker and inspect `schedule.json` and its run logs. Only after confirming quiescence, move the orphaned marker out of the state directory, then restart and inspect interrupted runs before acknowledging them. Do not run mixed scheduler versions against the same state directory.
444
-
445
- SIGINT/SIGTERM stops the runner's own current children, allowing five seconds before SIGKILL. Commands must stay in the foreground; detached descendants are not supervised, and delivery snapshots the log when the direct child exits.
446
-
447
- Output and delivery:
448
-
449
- - Raw stdout/stderr share a private `0600` run log under `schedule-runs/`; state updates use a private file, atomic rename and fsync. Logs are retained, including after removal, so the owner controls retention.
450
- - `wake` (default) emits one `SCHEDULE_WAKE` JSON line with the result. `wake-emitted` means stdout accepted it, not native monitor admission or owner acknowledgement.
451
- - `log` emits no routine wake or post.
452
- - `post:discord:CHANNEL_OR_THREAD_ID`, `post:telegram:CHAT_ID[/TOPIC_ID]`, and `post:slack:WORKSPACE:ACCOUNT:CHANNEL[/THREAD_TS]` use the existing messenger clients and credentials, including protected `DORI_SLACK_TOKEN_FILE`. Discord thread IDs are channel targets, without a slash suffix. Other credentials are `DORI_DISCORD_TOKEN` and `DORI_TELEGRAM_TOKEN`. The existing message text safety guard still applies.
453
- - Wake delivery reads at most 64 KiB into the message; larger output sends the exit/byte count and complete private log path rather than silently truncating the raw file. Every message includes the log path. External posts have a conservative 2000 UTF-16-code-unit budget across all platforms: larger output becomes one summary with that path, not a message burst or provider-side truncation. Metadata that cannot fit is rejected before posting. The single post has a 30-second cancellation deadline. Posting never retries an uncertain request, including 429/5xx: the request may have landed, the run records `unknown`, and one `SCHEDULE_ERROR` warning is emitted. A new cron occurrence is separate work, not a retry.
454
-
455
- To attach the runner to an owning native session, explicitly start an ordinary persistent monitor with `argv: ["dori", "scheduler"]` and `filter: "^SCHEDULE_(WAKE|ERROR)"`. Bind its selected configuration and child-only credentials as for the other messenger monitors. Routine `log`/`post` results do not wake the owner; operational delivery failures do. No daemon-mode feature is required, and no monitor is installed automatically.
456
-
457
- `dori schedule adopt [NAME] --systemd UNIT [--system]` registers an existing `.timer` or `.service` for visibility only (`--user` by default; name defaults to the unit). `list` and `boot` use bounded `systemctl show` calls, including a timer's service when it triggers one, to show its next trigger, last observed service result and active state. Never-started services have no invented exit code; missed occurrences remain `systemd-managed`, not a fabricated count. Missing/inaccessible units are explicit errors. Adoption, pause refusal and removal never start, stop, enable, disable or edit a unit. `boot` also reports cron state read-only; it neither claims work nor recovers interrupted jobs.
458
-
459
- ### Discord REST test endpoint
460
- With `DORI_DISCORD_API_BASE` unset or empty, Discord REST requests use `https://discord.com/api/v10`. For an isolated test server, set it to an HTTP URL on `127.0.0.1`, `localhost` or `[::1]`, optionally with a path prefix; trailing slashes are removed. Credentials, query strings and fragments are refused without echoing the configured value. The local server receives the normal Bot authorization header, so use a synthetic token for tests. This overrides REST only, not Gateway or attachment/CDN URLs.
461
-
462
- ### `dori send <slack|telegram|discord> --to TARGET (--text TEXT | --text-file PATH) [--thread ID] [--edit ID] [--reply ID]`
463
- The body comes from `--text`, or from `--text-file PATH` read as UTF-8 (`-` reads standard input), so a long report or a body with quotes never passes through a shell string. Choose one; both, an unreadable file (the error names its code, such as `ENOENT`) or a body that is empty after trimming are refused before any request. A file body is trimmed like `--text` and gets the same `$(` refusal.
464
-
465
- Posts a message, or edits one with `--edit`. Tokens come from `DORI_SLACK_TOKEN`, or when that is unset or empty from the file `DORI_SLACK_TOKEN_FILE` names (plus `DORI_SLACK_COOKIE` for a user token). The file must be a regular file you own and owner-only (`chmod 600`), checked and read through one open descriptor; a file open to group or others, owned by someone else, not a regular file (a FIFO never blocks the read), missing or empty is refused. Windows has no mode bits or uid to check, so there the file's ACL is the owner's to set, and `dori boot` prints `SLACK token-file: the token file's NTFS ACL is not checked on Windows; ...` as a reminder. Other tokens come from `DORI_TELEGRAM_TOKEN` or `DORI_DISCORD_TOKEN`. Text containing `$(` is refused, since it can only come from a shell string.
466
-
467
- Messenger writes never automatically retry HTTP 408/5xx, a lost response, or an unreadable success acknowledgement. The CLI exits nonzero on uncertain delivery; library callers receive `MessengerError` with `code="DELIVERY_UNCERTAIN"` and `outcome="uncertain"`. This is not a confirmed rejection or a successful send. Keep the original command/target and any confirmed IDs: inspect that exact remote conversation, thread or file before deciding whether another write is safe. Do not repeat the whole command or generate a new request identity merely because no receipt arrived. Discord and Telegram partial-send failures name the earlier confirmed message IDs and stop before later parts. A Discord `--reply` that receives a parseable success object without a valid message ID still sends each remaining part once, retains its known IDs, and leaves the exact owner request unsettled. A later part's rejection does not resolve the earlier uncertainty.
468
-
469
- If Slack confirms a post but local thread tracking fails, the error instead carries `outcome="confirmed"`, `code="DELIVERY_CONFIRMED_LOCAL_ERROR"` and the original channel/message receipt; repair tracking rather than reposting. No automatic reconciliation or durable outbox is implied. Ordinary 4xx/API rejections remain `outcome="rejected"`. Automatic HTTP 429 retries honor `Retry-After` within the existing 60-second per-wait budget. A longer delay surfaces HTTP 429 without waiting or retrying early. GET and explicitly recognized read-only Slack/Telegram RPCs retain bounded 5xx backoff, while unknown RPC methods are conservatively treated as writes. An uncertain result when Discord opens the owner DM (`POST /users/@me/channels`) stops scope-all startup, REST refresh, or Gateway backfill without automatically repeating the write. Inspect the target before rerunning discovery; ordinary history GET retries are unchanged.
470
-
471
- `send telegram` splits plain text into consecutive messages of at most 4096 UTF-16 code units. It prefers a newline, then a space, in the back half of the window, and otherwise cuts at a whole Unicode character. Concatenating the parts gives the exact original text, including whitespace and non-BMP characters. On success, `SENT` names the last part. An API failure stops the remaining parts; earlier successful sends remain. No message-ID journal or multi-message editing is maintained.
472
-
473
- `--edit` always updates one existing message in place. Input over 4096 UTF-16 code units fails with an instruction to shorten the text or send without `--edit`, before any API request or mutation. It never edits a prefix and posts the remainder. The library's `rich=true` send path retains one unsplit HTML request, leaving Telegram to validate markup and its rendered-length limit. Rich edits use the same conservative preflight bound on the complete raw HTML, including tags and entities; markup over that bound is rejected even if its rendered text would fit. Short rich sends and edits keep their existing HTML behavior. HTML-aware splitting and multi-message edits are not implemented.
474
-
475
- On Discord, `--to` accepts an exact channel ID. With `DORI_DISCORD_GUILD_ID` set, it also accepts a unique channel name, with or without `#` (`--to chat` or `--to '#chat'`). Missing or ambiguous names fail before sending. `--thread ID` needs no `--to` and selects the thread for both sending and `--edit`; an edit still updates one message without printing a `SENT` line. New messages disable mentions. Forum and media channels hold posts rather than messages, so direct sends point to `dori thread discord create`.
476
-
477
- `send discord` splits text over 2000 UTF-16 code units into consecutive messages. It prefers a blank line, then a newline, then a space in the back half of the window, and otherwise cuts at a whole Unicode character. Code blocks follow Discord's rendering: runs of three or more backticks pair up in order wherever they sit, so a one-line block or a closer with text after it on its line closes the block. A block that a cut leaves open is closed with three backticks at the end of that part and reopened with three backticks and its language at the start of the next, so every part renders on its own; a language that is not 1 to 32 letters, digits or `_+-.#` reopens without one. When the cut falls just before the block's own closer, that closer ends the part instead of an empty block opening the next; a part never ends on a block's opening line, and a cut never falls inside a run of backticks. Parts that would hold only whitespace are dropped, since Discord refuses empty messages. Apart from those markers and dropped whitespace, the parts join back to the text. `SENT` lists every message ID in order. A failed part stops the rest; once a part is posted, any later failure, a transport error included, ends with `(part N of M; already posted: <ids>)`, and the posted parts stay.
478
-
479
- `--reply MESSAGE_ID` makes the first part a reply to that message in the target channel or thread, without pinging its author. The reference is bound to that exact physical channel (a thread has its own channel ID). Discord must accept the original message reference atomically: a deleted, unavailable or other-channel target fails instead of falling back to an unlinked post, and no later part is sent after that rejection. It is checked before any request: an empty or non-ID value, or `--reply` with `--edit`, is refused. Slack and Telegram refuse `--reply` instead of posting without it. `--edit` is never split: Discord text over 2000 code units is refused before any request.
480
-
481
- The Discord owed-answer gate requires `--reply` to name the original owner message in the exact destination channel or thread. After every part succeeds, `owes/sent.jsonl` records that request ID, a delivery ID and the complete ordered remote-message ID list. A partial or uncertain send, an edit, typing, a reaction alone, or a successful unlinked post never settles the request. Older channel/time-only receipts are ignored rather than guessed onto a request. The existing exact-message read mark, stale-owe limit and bounded continuations still apply. API acceptance is not proof that the owner read the answer; do not automatically resend an uncertain delivery.
482
-
483
- `send discord --render-tables` opts into aligned, monospaced pipe tables before the existing delivery path. The default remains the original text. Padding uses Unicode display width for CJK and emoji, preserves source escapes and inline code, and leaves existing fenced code and non-table text unchanged. Formatting is limited to 80 display columns (including indentation) and a 64 KiB UTF-8 budget for the complete transformed message, checked before padding is allocated. An oversized table/message or ambiguous row/code syntax keeps the original message; nothing is truncated. Indented code blocks and unsupported nested fence syntax are not reinterpreted.
484
-
485
- The flag applies to Discord sends and edits only; Slack and Telegram sends reject it. Rendered sends use the same 2000-code-unit splitting, first-part reply, disabled mentions and partial-send receipts described above. Rendering can add split parts. For `--edit`, the rendered text must fit one message: overflow is refused before any request, never converted into a new post. The formatter does not turn on automatically for SDK calls, thread starters or other commands.
486
-
487
- ### `dori thread discord create --to CHANNEL --title T [--text T] [--tag NAME]... [--message ID]`
488
- Creates a public thread in a text channel, or a post in a forum/media channel. `--to` uses the same ID/name lookup as Discord sends. A forum post uses `--text`, or the complete title when text is omitted, as its starter message. In a text channel, optional `--text` is sent inside the newly created thread. Authored whitespace is retained in titles and starter text; titles are limited to 100 characters. Starter messages disable mentions. Text over 2000 code units is split as `send discord` splits it: a forum post's starter holds the first part and the rest follow in the post, and ` mid=` names the first message.
489
-
490
- `--message ID` opens the thread on that existing message of the text channel (for example the owner's request) instead of a new thread without a starter; optional `--text` is then sent inside it. An invalid ID or `--tag` with `--message` is refused before any request; a forum or media channel is refused after its lookup.
491
-
492
- Repeat `--tag NAME` to apply forum tags by name or ID. An unknown tag reports the forum's known tag names; tags on a text-channel thread are rejected. Success prints the API's `THREAD <thread-id>`, with ` mid=<message-id>` when the API returns a starter message ID or an optional text-channel starter is sent. Thread creation and the messages sent after it (a text-channel or `--message` thread's text, a forum post's further parts) are separate API operations; if one of those sends fails, the created thread and the parts already posted remain.
493
-
494
- ### `dori thread discord set <thread-id> [--title T] [--tag NAME]... [--archive|--unarchive]`
495
- Renames a thread, replaces a forum post's complete applied-tag list, archives it or reopens it. Tag names/IDs resolve against the parent forum; unknown tags include its known tag names in the error. Supply at least one change and choose at most one of `--archive` and `--unarchive`. Success prints the thread ID returned by the API as `THREAD <thread-id>`.
496
-
497
- ### `dori thread discord status <thread-id> done|working`
498
- The lead marks a Discord work thread done or working without archiving it. The command reads the live title, adds exactly one U+2705 check-mark prefix followed by a space for `done`, or removes only that prefix for `working`. It preserves the rest of the current title, including owner renames, and never restores an old snapshot. An unchanged title makes no PATCH request. A non-thread, missing title, empty resulting title or title that would exceed 100 UTF-16 code units is refused rather than truncated. Archive and tag fields are never sent; use the explicit `set` command for those operations. API failures produce no success receipt.
499
-
500
- `done` refuses while any open lane names `discord:<id>` or the legacy raw id. A registered lane's session is refused for either state, using the same convenience session check as global lessons; this is not a security boundary against a process that changes its environment. New work registered or a title changed concurrently after the live checks is not an atomic transaction with Discord: the lead must reconcile that race. Success prints `THREAD_STATUS <id> <state> changed|unchanged <title>`.
501
-
502
- ### `dori react discord --to CHANNEL [--thread ID] --message ID [--emoji E] [--remove]`
503
- Adds the bot's own reaction, using the eyes emoji by default. `--to` is a channel ID; `--thread ID` selects a thread instead and needs no `--to`. `--emoji` accepts Unicode or a custom emoji in Discord's `name:id` form, URL-encoded for the API. `--remove` removes only the bot's own reaction. Success prints `REACTED <channel-or-thread-id> +` for add or `REACTED <channel-or-thread-id> -` for remove.
504
-
505
- A successful add also records the exact owner-message read mark used by the owed-answer gate. Removing a reaction does not create a mark. A mark alone never settles the request: a complete `send discord --reply MESSAGE_ID` receipt in the same channel or thread is required too.
506
-
507
- ### `dori channel discord set <channel> --purpose TEXT` / `clear <channel>` / `list`
508
- Records the operator's purpose note for a Discord channel, thread or DM in `<stateDir>/discord-channels.json` (owner-only, replaced whole under a writer lock), so `dori inbound discord --context` can show what a channel is for beside each owner message. `set` looks the channel up first (an ID, or a unique name with `DORI_DISCORD_GUILD_ID` as `send discord --to` takes it), records its name with the purpose and prints `PURPOSE <id> "<purpose>"`. The purpose is one line of 1 to 500 UTF-16 code units after trimming, without control, line-separator or bidirectional-override characters, checked before any request; a stored entry outside that form counts as damage. A thread's own purpose is kept apart from its channel's; `--context` shows both. `clear <id>` needs no token or lookup, so a deleted channel's note can still be removed, and prints `PURPOSE_CLEARED <id>` or `PURPOSE_NONE <id>`; a name is looked up first. `list` prints `CHANNEL <id> name="..." purpose="..." updated=<time>` per note. A damaged file is reported and never overwritten.
509
-
510
- Add `--source "discord CHANNEL MESSAGE"` when applying an owner request from intake. This opt-in mode verifies the current bot, the exact owner-authored message and its physical channel against the current inbound owner/channel/thread settings. Set/clear destinations must be IDs and must be that source channel or its actual thread parent (types 10/11/12); a category, a sibling thread or a matching title/name grants no authority. Bound `list` shows only those related notes. An unavailable message, revoked scope or mismatched metadata refuses the invocation without changing notes or receipts. Unbound commands retain the manual ID/name behavior above, including token-free clear by ID.
511
-
512
- Each bound set/clear stores its result with the note change under the same writer lock and atomic replacement. The receipt identity includes bot, owner, original channel, original message and destination. Repeating that identity with the same trimmed purpose (or another clear) returns the original result without rewriting a later manual edit; changing the purpose or switching between set and clear is a source-identity conflict. An original `PURPOSE_NONE` stays `PURPOSE_NONE` on replay. The receipt describes the first operation, not the current note: use `list` to inspect current state, and a new owner message for a new bound change. The current source is verified again even when a receipt exists.
513
-
514
- Existing flat note maps remain readable. The first write migrates `discord-channels.json` to `{ "version": 1, "notes": { ... }, "receipts": { ... } }`; notes and private receipts remain in this single owner-only file. Older flat-map-only writers reject this envelope, so upgrade all writers together. Receipts survive manual changes and have no automatic expiry. Preserve the complete file during backup or repair: discarding receipts loses the retry guarantee. Inbound context and `list` expose only notes, never receipt contents.
515
-
516
- ### `dori presence <slack|discord>`
517
- Keeps the account shown as online until explicitly stopped. Enable one instance per account under the owning OMP session's native `monitor` tool; two writers can compete.
518
- - **Discord:** use your own `DORI_DISCORD_TOKEN` in the child environment. REST inbound polling and message sending do not establish online presence. The Gateway keeper emits `PRESENCE_READY discord event=READY|RESUMED` only after that real dispatch, `PRESENCE_ACK discord seq=<number|->` only for the first actual heartbeat acknowledgement per connection and `PRESENCE_RECONNECT` while reconnecting. Later routine acknowledgements update lifecycle state silently. Authentication/configuration/intent failures exit nonzero with sanitized errors. SIGINT/SIGTERM ends retries, sockets and timers with `PRESENCE_STOPPED discord`; intentional monitor stop means offline. Restart only by explicit choice. See [operational details](../../../docs/releases.md#discord-online-presence).
519
- - **Slack, user token:** it opens one web-client-type socket and tickles it every minute. Slack shows a user active only while such a socket is open, and auto-aways an idle one after about 30 minutes. This retained source feature is outside the first Discord preview's live support scope.
520
-
521
- ### `dori inbound discord [--loop MINUTES] [--gateway | --wake-lanes]`
522
- Discord owner intake is built into Dori and uses the owner's bot token directly. It needs no Node, agent-messenger CLI, SDK adapter or private helper. Required child environment: `DORI_DISCORD_TOKEN`, `DORI_DISCORD_OWNER_ID`, and channel IDs from `DORI_DISCORD_CHANNEL_ID` or `DORI_DISCORD_CHANNEL_IDS` unless `DORI_DISCORD_SCOPE=all` is selected. IDs are positive decimal snowflake strings, never JavaScript numbers. `DORI_DISCORD_CHANNEL_IDS` adds comma-separated channel or thread IDs; all explicit IDs must be readable. Scope `all` adds readable guild text channels, active threads and the owner DM, skipping discovered 403/404 targets including an unavailable DM. Authentication, rate-limit and server failures still propagate. Threads under a watched channel are watched too, unless `DORI_DISCORD_THREADS=off`. Each watched channel has its own cursor.
523
-
524
- `--gateway` delivers owner messages live over a Gateway connection (intents `GUILD_MESSAGES`, `DIRECT_MESSAGES`, privileged `MESSAGE_CONTENT`; no presence update). After every `READY`/`RESUMED`, REST gaps and eligible queued owners are reconciled before newer delivery or filtered checkpoints. Records known before each delivery selection are processed in message-ID order per channel; the late-arrival and recovery boundaries below apply. It ignores `--loop`, including `--loop 0`, and runs until stopped. Intake and presence use separate Gateway sessions with independent lifecycles. See the [Gateway mode notes](../../../docs/releases.md#real-time-gateway-mode).
525
-
526
- Active threads under configured parent channels are followed automatically at startup, every tenth REST poll and every Gateway READY/RESUMED. Only Discord thread types 10/11/12 make `parent_id` a thread parent; a text channel's category does not. Explicitly configured threads do not make their parent watched. `DORI_DISCORD_THREADS=on` or unset enables following; `off` keeps only configured IDs without changing scope `all` or adding parent lookups there. Discovered history 403/404 targets are skipped without retrying every unchanged listing, then retried after disappearance and relisting; explicit targets remain strict. Archived threads stop polling but retain their cursor for reactivation.
527
-
528
- Unknown live channel scope uses at most 100 volatile candidates, 1 MiB aggregate serialized payload bytes, one concurrent resolver and 256 historical metadata lookup results with LRU eviction. Configured/currently-watched memberships are separate from that cache. Existing transient failures retry at 2–30 second backoff while retaining the original candidate payload; known-scoped frames keep synchronous full-payload SQLite admission. Overflow or an oversized candidate fails intake visibly, preserving committed queue work. Unknown-parent or unwatched-parent raw content is never spooled. **Crash, close or overflow may lose unresolved candidates**; their bodies cannot be reconstructed from IDs if deleted remotely. After positive durable admission, recovery of the full payload and optional parent provenance still requires the current intake scope; parent-based recovery requires following to remain enabled for a configured parent, even when the thread is archived or its history/metadata is unavailable. Excluded queued rows are discarded when drained, not held until following is re-enabled. Close cancels owned metadata fetch/retry work before awaiting drain and prevents late lookup completion from adopting or admitting a candidate.
529
-
530
- Without `--gateway`, REST polls continuously every three seconds by default. Each channel poll first reads one latest message. An empty head or an ID at or below the saved cursor needs no full history read; a newer head triggers the existing paginated gap drain. This reduces quiet response bodies without reducing request frequency, at the cost of one extra sequential request and round trip, consuming rate-limit budget for an active channel. The probed message is kept through the drain even if it is deleted between requests. Gateway reconnect backfills use the same path. `--loop 0.1` is six seconds; `--loop 0` is one-shot. Startup validates the authenticated bot, application Message Content Intent, channel access and View Channel/Read Message History permissions before printing `INBOUND_READY discord owner=<id> channel=<id[,id...]|all> bot=<id>` (with `mode=gateway` in Gateway mode). Sending replies additionally needs the relevant send/thread permissions.
531
-
532
- For an explicitly supervised continuous REST receiver, `--wake-lanes` enables auto-reopen for an exact registered herdr lane whose tab was closed and whose original OMP session was cleanly retired. Only a pending owner message to that lane can trigger a reopen; a live, explicitly paused, closed, or unverified lane is not reopened. Pending messages for a paused lane remain queued. The lane's final answer to that request is posted back to the original Discord message by the shared receiver, not by a pane-local Discord connection. Use one receiver for a given room, not an overlapping dedicated poller. `--gateway` and one-shot `--loop 0` do not support this feature. Existing monitor arguments, settings, and delivery behavior are unchanged unless the operator adds the flag.
533
-
534
- Each channel without a stored cursor baselines the latest message ID without replaying history; an empty channel saves `0`. This applies on cold start and to channels first found by a later REST discovery. A thread first discovered after startup starts at its creation ID or the parent's original start position, whichever is later; an existing cursor always wins. In scope `all`, a channel first seen through a live dispatch starts just before that message; earlier history is skipped. Send the first new request after readiness. The committed cursor is retained at `<stateDir>/discord-inbound/<channelId>.json`, in an owned private directory with atomic mode-0600 cursor files. REST polling and reconnect backfills checkpoint every owner immediately after its successful emit, combining filtered messages into that next owner checkpoint or one final save for a trailing filtered run. A failed owner emit can recheck a filtered prefix but cannot checkpoint past that owner in the drain. Live Gateway dispatches retain per-message checkpoints.
535
-
536
- Only remote history-read 403/404 responses make a discovered target unavailable; the same responses remain fatal for an explicit target. Missing owner content, delivery failures and local cursor errors are not skipped as lost access. Gateway intake stops before later queued messages can commit past that failure. A disappeared cursor for an already watched channel is a state error, not a reason to silently ignore messages or rebaseline; first-seen scope-all channel seeding remains unchanged.
537
-
538
- Output is `INBOUND discord <channel> <message> from=owner ref=<id|-> <JSON text>`. `ref=` is the message a reply answers; a forward names a message but answers none, so it prints `ref=-` and no `INBOUND_REPLY`. Bots, self, non-owner, webhook and system messages do not emit owner intake. Only watched channels are read (a thread is watched through its own channel ID, its configured parent, or `DORI_DISCORD_SCOPE=all`); a thread `INBOUND` line names the thread ID as `<channel>`, so replies go to the thread. An attachment-only or Discord voice message retains the text `""`. Reply context and attachments follow that unchanged line as separate records:
539
-
540
- - `INBOUND_REPLY discord <channel> <message> {"id":"<id>","author":"<id>","text":"..."}` copies the original reply snapshot, without fetching or substituting a newer message. Its ID must match `ref=`; any supplied reference or snapshot channel must be the same physical channel or thread, otherwise intake stops before emitting or checkpointing that message. Missing author or text is `null`, distinct from observed empty text `""`. An omitted `referenced_message` adds `"status":"unresolved"`; explicit `null` adds `"status":"unavailable"` (for example, a deleted target). Both retain the original ID and null author/text. A known `author` can be compared with the `owner=` and `bot=` IDs from `INBOUND_READY` for context only. Reply context is data, not a new owner request or a routing instruction.
541
- - `INBOUND_ATTACHMENT discord <channel> <message> {"filename":"...","content_type":"...","size":<bytes>,"url":"..."}` once per attachment, in Discord's order. `content_type` is optional. Message flag `IS_VOICE_MESSAGE` adds `"voice":true`; `"duration_secs":<seconds>` is included when Discord provides it. The exact signed CDN `url` expires; use it promptly when explicitly downloading or running `dori transcribe <url>`.
542
- - With `--context` only, `INBOUND_CONTEXT discord <channel> <message> {"channel":{"id":"<id>","name":"...","topic":"...","purpose":"..."|null},"thread":{"id":"<id>","name":"...","purpose":"..."|null}|null}` ends the group. A message in a thread names the parent channel under `channel` and the thread under `thread`, each with the purpose recorded for it by `dori channel discord set` (`null` when none); a DM is `"channel":{"id":"<id>","dm":true,"purpose":...}`. `name` and `topic` appear when Discord returns them. Each channel is looked up at most once a minute, shared while in flight, and a lookup is waited on for at most five seconds; a failed or still-hanging lookup is remembered for that minute, so later messages neither repeat the request nor wait again. Expired lookups are dropped as new ones are made and at most 500 are held, so a long-running intake across many threads keeps a bounded cache; a channel evicted by that cap within its minute is looked up again when it next appears. A failed or late lookup, or an unreadable purpose file, never holds or fails the message: the record keeps what is known (the message's channel ID and its purpose; for a thread whose parent cannot be read, the parent ID) and adds `"error":"channel lookup failed (HTTP <status>)"`, `"channel lookup timed out"` or `"channel purposes unreadable"`, never a response body. Channel and thread names and the topic are Discord metadata that others can set (any member who creates a thread names it; anyone with Manage Channels edits a topic), and a purpose is the operator's own note: all of it is context for reading the owner's words, not instructions. Without `--context` nothing is looked up and the output is unchanged.
543
-
544
- REST polling and Gateway delivery produce identical record groups. The formatter returns one string per owner message for the existing single emit before cursor commit. A malformed attachment or attachment list is a protocol error; the message stays uncommitted, as it does when emit throws. Consumers parsing only `INBOUND discord ` lines retain the same grammar. Metadata delivery downloads no files and starts no transcription or provider inference. This is new-message intake; edits and delete events are not delivered.
545
-
546
- Use one opted-in native `monitor` with filter `^INBOUND` and the [protected-token child argv recipe](../../../docs/releases.md#discord-owner-intake). Startup auth, permission, intent and state failures exit nonzero. Later REST polling retries transient remote failures and existing lane-route holds, keeping the server's supported rate-limit delay. Other delivery, protocol and storage failures stop intake rather than advancing the undelivered message. Gateway backfill retries transient remote failures while holding live messages. SIGINT/SIGTERM stops intake. Intake never sends presence updates; enable or stop the separate presence monitor intentionally. The [offline benchmark](../../../docs/releases.md#real-time-gateway-mode) uses only synthetic loopback traffic.
547
-
548
- REST and Gateway intake acquire the same state-directory lock before authentication or polling, including a fresh state directory. Gateway work is serialized through the owned private `<stateDir>/discord-inbound/gateway.sqlite` queue. Indexed queries select queued owners one record at a time; no queued-message array or Promise chain grows behind a stalled backfill. The page-cache budget is 256 KiB and database memory mapping is disabled. Incoming frames and an active REST history drain still use their ordinary memory. Invalid IDs and explicitly unwatched channels are rejected before spooling. Successful handling and cursor persistence precede exact-message-ID acknowledgement; an acknowledgement error stops dependent advancement. WAL `synchronous=NORMAL` retains process-crash recovery without adding two fsyncs per dispatch; power-loss recovery still relies on durable REST cursors.
549
-
550
- Queue admission is not the owner-output filter. Valid scoped Gateway `MESSAGE_CREATE` frames are persisted with their full payload before owner filtering, including other users', bots' and webhooks' text, attachment metadata and signed URLs. Scope `all` may admit valid frames from channels not yet discovered by REST. Only owner text is emitted; nonowner rows are discarded during drain, while pending payloads survive shutdown in the private queue. Ownership and `0700`/`0600` modes restrict access; row acknowledgement/deletion is not a secure-erasure promise for SQLite or its journal.
551
-
552
- The database is capped at 256 MiB plus journal overhead and reuses freed pages without shrinking its high-water size. Opening an older queue adds nullable admission metadata and lookup indexes in one transaction. Indexes consume the same database budget; building them also requires disk I/O and temporary space. Storage exhaustion stops intake with committed pending work intact. The exclusive SQLite connection rejects a second intake in the same state directory. REST mode refuses to start while Gateway work is pending. Restart with `--gateway` to drain it.
553
-
554
- Backfill merges known queued owner payloads with older REST gaps before emitting or checkpointing a newer record. A REST deletion does not cancel a durably queued request. A retained message prefix gets one recovery backfill before replay, including queued scope-all channels with saved cursors. A genuinely new queued channel starts just before its lowest known queued ID, still skipping earlier cold history.
555
-
556
- The queue's admission cursor records the durable position at intake, not delivery. An older owner frame admitted during an already-started newer emit remains deliverable late without regressing the cursor. Ordinary stale frames admitted after a completed cursor commit, and direct `accept` calls, retain their existing cursor gate. Cursor equality retains the committed-or-baselined ID gate. Outside the native lead receipt path below, an interruption between emit and cursor persistence or before an exact raw acknowledgement can still repeat output.
557
-
558
- Legacy rows have no admission position. A pending owner below the cursor is replayed conservatively because older intake may have skipped it; this migration/recovery window can repeat an already delivered request. It cannot restore payloads already deleted by older code. This is not unconditional exactly-once delivery or ordering across arbitrary late arrivals.
559
-
560
- Gateway shutdown retains admitted pending work, aborts its own waiting local obligation-ledger admission and cancels owned thread-metadata lookups/retries before awaiting active work. It does not cancel an in-flight history/context HTTP request; an undelivered admitted payload and its cursor remain recoverable on the next Gateway start. Unresolved volatile candidates have the loss boundary described above. Later queued work remains for restart. Genuine storage, protocol, context and delivery failures are not treated as cancellation. Restore storage before restarting after a disk error. Messages not successfully written still rely on REST cursor recovery.
561
-
562
- #### Native head admission receipts
563
-
564
- Supervised Discord intake uses the existing primary ASK mailbox and native lane paths first, with their current owner, conversation, session and message checks. Only the normal Dori lead fallback uses the monitor IPC receipt. An accepted receipt is proof of a `dori-monitor` aside in the native transcript, and a rejected receipt records the monitor filter's explicit rejection. Neither is evidence of a model turn, user authorization, ASK answer or acknowledgement, tool approval, Discord reply or reaction, or task completion. The aside uses the existing native delivery policy; it does not submit approval input.
565
-
566
- Before dispatch, the private SQLite ledger retains the bot, owner, channel and message identity, the normalized-source fingerprint and original source, and the native session file and process ID. The receipt must be present on disk; a successful send call, stdout, process exit and an in-memory notice do not count. The stored receipt precedes cursor persistence and exact-ID raw removal. A native receipt retires from SQLite only after the cursor is durable and no exact-ID pending copy remains. For Gateway duplicates, matching payloads can fill missing thread-parent provenance without replacing the first payload, cursor or FIFO position. Conflicting source payloads stop intake and preserve the original. REST uses the same attempt ledger, not a second raw spool.
567
-
568
- If the head is unavailable before prepare returns, no dispatch attempt exists yet. Gateway retains the raw FIFO record; REST keeps its prior cursor and still needs the source to be available in history on a later read. After the attempt is written, recovery does not rely on that history.
569
-
570
- After interruption, intake reconciles the original on-disk receipt before reading new history, without dispatching the source again. An unproven attempt holds cursor saves and FIFO removal even when its message is absent from Discord history. Preserve the original transcript and queue. Standalone stdout retains its existing transport-only behavior and does not settle a prior native attempt. Native admission needs a connected child IPC channel and a host that can verify ownership of the regular native transcript; a missing capability does not fall back to stdout. `DORI_MONITOR_ADMISSION=1` is internal to the native monitor, not an operator opt-in. Loss of the head IPC channel stops the receiver and releases queue ownership.
571
-
572
- #### `dori inbound-abandon discord BOT:OWNER:CHANNEL:MESSAGE --reason TEXT`
573
-
574
- Explicit operator recovery only. Inspect the retained source and original transcript first. If the exact native receipt exists, reconcile it without redelivery rather than abandoning. If it remains unconfirmed and the operator chooses to skip it, stop the original head and receiver first. The command checks the exact source identity and one nonempty reason. An occupied or uninspectable original PID, a settled native receipt, or a different reason for a previous decision leaves the existing record unchanged.
575
-
576
- The command records `ADMISSION_ABANDONED` and the local audit receipt, retaining the source and decision in SQLite. Repeating the same exact identity and reason returns the saved decision. It can finish the original source's cursor write after interruption; it never sends, resumes or replays input. It does not cancel a prior effect or close a Discord owner obligation. The existing successful-send and exact-message-mark requirements still apply.
577
-
578
- ### Discord owner obligation reminders
579
-
580
- Dori MAIN tracks owner `INBOUND discord` lines from its CLI or monitor delivery. A complete `dori send discord --reply <owner-message>` confirmed by Discord as a reply to that message supplies the answer receipt. `dori react discord --to <channel> --message <owner-message>` records the exact added reaction (eyes by default). Every accepted reply part must have a valid remote message ID. A plain fallback post, edit, reaction removal or incomplete split send does not supply the corresponding receipt. Direct SDK/API writes bypass this ledger. Check existing remote results before retrying: a remote send or reaction can succeed before a later local receipt write fails.
581
-
582
- The synchronous settle hook requests at most three continuations per open obligation younger than 30 minutes; lanes and subagents are exempt. This does not prove answer relevance, a human read or eventual completion. The reminder names each shown message's supported reaction command; do not repeat an already accepted answer or reaction merely because its local receipt is absent.
583
-
584
- The private `<stateDir>/owes` directory stores inbound previews (up to 500 characters), send receipts, marks and continuation attempts. Each JSONL snapshot retains at most 200 nonempty rows. A per-snapshot SQLite writer reservation serializes owner-lock recovery without storing any messages; the JSONL format is unchanged. Expiry is logical, not deletion; a crash can also leave private temporary snapshot files containing previews outside that row cap. Neither snapshot replacement nor expiry is secure erasure.
585
-
586
- Writers reuse per-file owner locks, wait asynchronously and publish capped snapshots atomically. A live holder has no automatic wait timeout; a stale lock whose PID has been reused may look live and require operator repair. Session changes abort waiting monitor admissions rather than waking an old session. Aborting the ledger wait for an already durably queued Gateway message retains its payload and cursor for restart; unresolved candidates have the loss boundary above. Unrelated failures remain errors.
587
-
588
- ### Opt-in conversation recall
589
-
590
- Set `"recall": {"enabled": true, "retentionDays": 30}` in `config.json` to retain bounded excerpts in the POSIX-only `<stateDir>/recall-scoped-v1.sqlite` ledger. Recall is off by default. The current user must own the ledger and state directory. Untrusted ancestor directories are rejected; Windows does not open the store. This does not import, change or delete an older `recall.sqlite`. Detected credential-shaped strings are masked, not a guarantee that all secrets are detected. Do not opt in for conversations that should not be retained.
591
-
592
- Rows are partitioned by transport, authenticated bot, configured owner and conversation space. Discord uses explicitly watched channels and their verified threads with parent following enabled; global or unverified scope is skipped. ASK and lane-routed input do not enter recall. A Discord CLI send is stored only after a confirmed reply in a verified watched conversation. Telegram uses its existing owner and chat/topic gates. On send, only new deliveries into that configured owner DM or group/topic are eligible. Edits and Slack are not recorded.
593
-
594
- When owner text refers to an earlier conversation, `INBOUND_RECALL` contains up to four bounded, JSON-encoded excerpts from that same space, or an empty result. Discord threads share a verified parent space; Telegram topics share their chat space. Excerpts provide context only, never current instruction, authorization or an ASK response. A lookup or storage failure does not change the original message or its delivery receipt.
595
-
596
- Use `dori recall --scope PLATFORM:BOT:OWNER --space=ID [--limit N] QUERY` with the exact IDs and Discord parent/channel ID or Telegram chat ID. `dori recall --scope PLATFORM:BOT:OWNER --purge` logically deletes only that exact identity’s rows, even if recall is off. Expiry is applied when that identity opens its ledger. Neither expiry nor purge is secure erasure; other identities, legacy files and backups are untouched.
597
-
598
- ### `dori inbound slack [--loop MIN] [--qualified-routes] [--adopt-legacy-threads WORKSPACE:ACCOUNT]`
599
- Authenticates with `auth.test` and by default prints exactly `INBOUND_READY slack`. Each message is `INBOUND <source> <channel> <thread> <ts> <user> <text>`: `<channel>` is the physical Slack channel ID and the final field is full JSON-encoded text. Existing monitors keep this format.
600
-
601
- To migrate a consumer to qualified output, first teach it to accept `INBOUND_READY slack workspace=<team_id> account=<user_id>` and to treat `slack:<team_id>:<user_id>:<channel>` in the channel slot as a Dori destination, not a Slack API channel ID. Then start that receiver with `dori inbound slack --qualified-routes` (and its usual `--loop` setting). All other message fields are unchanged.
602
-
603
- Copy the qualified destination into `dori send slack --to` (and retain `--thread` for a reply); a different authenticated workspace or account fails before posting, editing or allocating an upload. Bare physical channel IDs still explicitly select the currently configured account. Qualified destinations also work for library calls with `channel` or `channel_id`. Both receiver formats read from three places, each message once:
604
- - `threads-view`: unread replies in threads the account follows (Slack's own Threads view);
605
- - `own-thread`: new replies in any thread the Dori posted in, tagged or not;
606
- - `unread`: DMs, group DMs and channels with unread mentions.
607
-
608
- The Dori's own messages and bot messages are skipped; Slack keeps its existing all-non-self/non-bot policy, not an owner allowlist. Every message the Dori posts records its thread in `<stateDir>/slack-threads.json`, whichever helper sends it, so a guest's untagged reply under a root posted with a raw API call is still found. Version 2 keys each position by authenticated workspace, account, channel and root timestamp, never display name or credential text. Credential rotation for the same identity preserves the position; another account gets separate positions. Reply metadata that disagrees with its enclosing channel or thread stops the poll before any emit or cursor commit. This route identity is not a multi-tenant security boundary.
609
-
610
- A nonempty legacy array has no account identity. New posts and inbound polling refuse it without changing it: there is no automatic attribution, reset or resend. Stop old Slack sender/receiver processes first, confirm which workspace/account owns every legacy row, then run `dori inbound slack --loop 0 --adopt-legacy-threads WORKSPACE:ACCOUNT` with that account's credentials. A mismatch is refused. The locked, atomic conversion preserves every position and saves a `SLACK_THREADS_ADOPTED` receipt (scope, time, count); repeating the same decision returns that receipt, and another account cannot reassign it. If ownership is unknown or mixed, preserve the file and resolve ownership before proceeding rather than guessing. Empty legacy arrays need no decision. After conversion, old array-only writers fail closed; do not run an old receiver beside the upgraded one.
611
-
612
- Adoption prints only its receipt and exits without polling or advancing positions. Start the normal receiver separately to deliver pending replies; choose `--qualified-routes` only if its consumer has been updated. Output format does not affect account scoping or replace ledger adoption.
613
-
614
- ### `dori inbound telegram [--loop MIN]`
615
- Startup authenticates the configured bot with `getMe` and requires an empty `getWebhookInfo.url` before printing `INBOUND_READY` or calling `getUpdates`. An invalid identity, unavailable or malformed check, or active webhook is a sanitized nonzero startup error: no cursor acknowledgement is sent, and webhook settings are never changed. Pending checks are awaited; stopping the process while they are pending does not start polling. These online checks run only for an explicit Telegram inbound command, not for offline commands such as `inbound-lag`.
616
-
617
- Prints `INBOUND <source> <chat> <thread> <update-id> mid=<message_id> <from> <text>[ file=<kind>:<file_id>][ reply=<message_id>]`, keeping Slack's field order — `source` is `dm`, `topic`, `edit:dm` or `edit:topic`. `mid=<message_id>` is always present (never optional, so later fields never shift; `-` when unknown) and names the Telegram message behind the line: a new message and the edits that replace it share the same `mid=`, so a consumer can pair an edit with the original line. A media message appends ` file=<kind>:<file_id>` (voice, audio, video, video_note, animation, document, photo); the line carries the `file_id`, which a caller can pass to Telegram's `getFile`. A reply appends ` reply=<message_id>`, last, naming the message it answers (`dori decision match` binds by it). In a topic Telegram names the topic's own root as the target of every message that replies to nothing; that is no reply and prints no `reply=`. Only a reply within the same chat names its target; Telegram sends a reply to another chat's message as `external_reply`, which prints none. Live-location shares arrive as a stream of edits carrying only coordinates — those are dropped, not one line each. The corrupt-offset WARN prints to stdout, like every other inbound WARN. Without `--loop` the command is exactly one poll and returns, productive or not. Long-polls `getUpdates`:
618
- - only the configured owner's messages pass (`DORI_TELEGRAM_OWNER_ID`); bot messages never do;
619
- - DMs from the owner always pass; in a group (`DORI_TELEGRAM_GROUP_ID`) only the configured topic (`DORI_TELEGRAM_TOPIC_ID`) does — with a group but no topic, every owner message in the group passes — with no group configured, DMs only;
620
- - the receiver authenticates with `getMe`, confirms an empty webhook, and stores versioned state in `<stateDir>/telegram-inbound/<bot-id>.json` (POSIX directory 0700, atomic file 0600). On Windows, use an existing canonical local NTFS state directory owned by the current user; the cursor uses a private owner ACL and a per-bot lease. Storage checks run before readiness, and an unverified cursor write stops intake without polling again. Token rotation for the same bot retains state; another bot never borrows its cursor. The old `<stateDir>/telegram-offset` has no bot identity or observation time, so it is left untouched and ignored. An unconfirmed legacy message can replay on upgrade;
621
- - an offset is sent only while its last nonempty response is less than 24 hours old. At exactly 24 hours, with missing/invalid time metadata, or after clock rollback, the offset is omitted before requesting updates. Empty polls never renew this epoch. Telegram [retains updates for at most 24 hours](https://core.telegram.org/bots/api#getting-updates); its [random update-ID restart after at least a week without updates](https://core.telegram.org/bots/api#update) is a different boundary;
622
- - delivery is at-least-once: the offset and SHA-256 message/revision receipts are saved only after `INBOUND` is emitted (gate-dropped updates advance immediately). A crash between emission and that save can repeat a printed line. Saved receipts suppress replay when an offset must be omitted, including its reaction, but are not proof of native model admission or a completed answer. They include chat/message identity, dates, revision contents and update ID (not update ID alone), without storing plaintext. At most the current 100-update batch is retained; acknowledged/expired receipts are removed, preserving all matching batch receipts through a partial emit failure;
623
- - the full text is printed, JSON-escaped on one line: sending a later offset acknowledges earlier updates, which can no longer be fetched;
624
- - edits arrive too: `edited_message` updates are polled and printed as their own `edit` kind, carrying the edited text;
625
- - env ids are validated at start — `DORI_TELEGRAM_OWNER_ID`, `DORI_TELEGRAM_GROUP_ID` and `DORI_TELEGRAM_TOPIC_ID` must match `/^-?\d+$/` after trimming; empty, whitespace-only, `1e3` and `0x10` are refused with an error naming the variable;
626
- - reuses the bot token the skill already stores (`DORI_TELEGRAM_TOKEN`);
627
- - each new owner message gets one 👀 reaction as a read receipt (edits do not), sent in parallel with the `INBOUND` line so it never delays delivery; a failed reaction emits one warning per process, bounded to 300 characters, and the message is still delivered.
628
-
629
- ### Inbound recovery limits
630
-
631
- A live connection, a saved position and recoverable backlog are different. Intake reads only what the configured platform queries still return, plus any payloads already retained on the relevant [Discord delivery path](#discord-delivery-paths). A cursor, offset or queue admission position is not proof that every owner message was delivered.
632
-
633
- | Case | Discord | Slack | Telegram |
634
- |---|---|---|---|
635
- | First install (no saved position) | Each channel or thread attached at startup baselines its latest message ID (`0` if empty); it does not replay earlier messages. | The first poll reads the Threads view and unread counts as returned. Each own-thread ledger entry starts at the Dori's first recorded post, not at the beginning of the thread. | Starts at offset `0`. Only updates `getUpdates` still returns that pass the owner and DM/group/topic gates are emitted. |
636
- | Thread or channel created while offline | Configured parent channels follow active child threads at startup, every 10 REST polls and on Gateway `READY`/`RESUMED`. `DORI_DISCORD_THREADS=off` limits explicit scope to configured IDs; scope `all` independently discovers readable text channels and active threads at startup, on Gateway `READY`/`RESUMED` and every 100 REST polls. A followed thread first found at startup baselines its latest ID; if first found on a later refresh, it starts at the later of its creation ID and the parent's start position. Scope-all REST discovery baselines newly found targets. Archived threads are not found by active-thread discovery. | A thread without a ledger entry has no own-thread backfill, but can appear in the unread Threads view (default request limit 20). DM, group-DM and channel-mention notices from unread counts carry no message body. | There is no thread discovery or history fetch. An update from an offline period is eligible only if still returned at the requested offset and allowed by the configured routing gates. |
637
- | Edit behind the saved position | New-message intake only: Gateway admits `MESSAGE_CREATE`, not edits or deletes. | Own-thread polling does not replay an edit whose message `ts` is at or behind the saved position. The Threads view is an unread view, not an edit stream. | An eligible `edited_message` update can arrive as `edit:dm` or `edit:topic` even if the original message predates the offset. Location-only refreshes without text or caption are dropped. |
638
- | Message no longer returned by the platform | A newer REST head triggers history paging (100 per request) back toward the cursor. A successfully admitted Gateway payload may still be delivered if REST omits it; explicit-target history 403/404 errors can block backfill, while discovered targets with those responses are skipped. | The Threads view is partial. Each own-thread poll makes one `conversations.replies` request (`oldest` = saved `ts`, `inclusive=false`, limit 50), with no pagination; it advances to the newest timestamp returned after emission succeeds. | No chat history is fetched. A returned update that is dropped advances the offset immediately; a kept update advances it only after emit returns. The offset cannot recover updates Telegram no longer returns. |
639
- | Rate limit or outage | Continuous REST resumes from saved channel cursors after retryable failures. Gateway backfill retries transient failures with 2–30 s exponential backoff, respecting supported server delays, while admitted work waits. | A failed read or emit leaves own-thread positions unchanged; a subsequent poll can repeat prior output. | A subsequent poll uses the saved offset; an emit failure leaves the failed update uncheckpointed. |
640
-
641
- For inbound reads (Discord GET and the read-only Slack/Telegram calls sent as POST), the shared HTTP default allows up to five attempts on 429 or 5xx, with exponential waits from 1 s capped at 60 s and server delay handling. A 429 delay above the retry budget surfaces rather than retrying early; a transport error is not retried within the read call. Mutations may retry a known 429 rejection, but transport errors, HTTP 408 and 5xx leave delivery uncertain rather than triggering an automatic resend.
642
-
643
- #### Discord delivery paths
644
-
645
- Among Gateway message frames, only payloads actually admitted to the queue are retained, including nonowner payloads until drain. A new scope-all channel seen first through the queue starts just before its lowest known queued ID, not at the start of its history. Unresolved live thread candidates are volatile; discovery, archival or a live connection alone establishes no retained payload. A failed write (including at the 256 MiB database cap) stops intake with committed work intact. Pending admitted Gateway work survives an orderly shutdown and must be drained in Gateway mode. The [native lead receipt](#native-head-admission-receipts) resolves only its own admission boundary: legacy recovery and non-native emit/checkpoint gaps can still repeat output.
646
-
647
- The Gateway queue is separate from the native lane inbox. Discord can route to a bound live lane without `--wake-lanes`; that opt-in enables supervised continuous REST to service pending lane work and reopen eligible retired herdr lanes. It is not Gateway replay or platform history. Slack and Telegram keep positions, not a local payload queue for inbound replay.
648
-
649
- ### `dori inbound-lag [--limit N]`
650
- Prints `LAG n=<count> p50=<ms>ms p90=<ms>ms p99=<ms>ms max=<ms>ms[ skipped=<n>]` from `<stateDir>/telegram-lag.jsonl`, the meter `dori inbound telegram` writes beside its `INBOUND` lines. The reader works backwards in fixed-size blocks until it has the last `--limit` nonblank records (default 1000), then skips records without a usable lag. Malformed or torn records consume a window slot. Percentiles use the nearest rank, `ceil(p * n)`, over the remaining readings, rather than interpolating.
651
-
652
- - one record per handled message: `at` (when the receiver handled it), `tgDateMs` (Telegram's recorded message date), `lagMs` (`max(0, at - tgDateMs)` to clamp host/server clock skew), plus `updateId`, `messageId`, `source`, `chat`, `thread`, `from` and `kind`; an edited message's original `date` is used, so this is not a separate edit-delivery latency measurement;
653
- - a message whose payload carries no `date` records no `lagMs` at all, rather than a `0` that would drag every percentile down;
654
- - the `INBOUND` line itself is untouched — it is a positional contract that consumers parse, so receive lag lives in this separate file;
655
- - a failed append emits one warning per process on stdout (`WARN ...`, bounded to 300 characters); intake and cursor advancement continue;
656
- - new journals are created with mode `0600`, following the state-journal convention. Records include chat and user IDs but no message text or bot token. Existing file permissions are retained, and records accumulate locally until removed by the owner;
657
- - `skipped=<n>` counts records without a finite numeric lag in the window, including missing dates, malformed JSON and the partial last line a kill mid-write leaves behind.
658
-
659
- ### `dori transcribe <audio-file|url>`
660
- Runs the existing `hooks.transcribe` argv with `{file}` and prints the transcript. Local paths pass through unchanged: no URL size or format policy is applied to them, and local source files are retained.
661
-
662
- HTTP(S) downloads stream into a unique private temporary directory and owner-only file. `transcribeMaxBytes` defaults to **26214400 bytes (25 MiB)** and accepts a positive safe integer in the Dori config. The limit counts actual streamed, decompressed bytes across all chunks, not a missing, zero or claimed `Content-Length`; exceeding it aborts the download before the hook. A declared over-limit size is rejected before reading the body.
663
-
664
- Before calling the hook, Dori identifies downloaded WAV, Layer III MP3, Ogg, M4A/MP4 or FLAC and checks any declared MIME type against that identification. Missing or generic octet-stream MIME is accepted only for a recognized format. These are bounded metadata checks, not full codec decoding.
665
-
666
- - Ogg: a complete Opus or Vorbis identification packet must be present in the first 32 beginning-of-stream pages. `video/ogg` is accepted when supported audio is present; `audio/opus` requires Opus. Mapped Opus channels require the declared stream counts and channel mapping.
667
- - M4A/MP4: a supported major brand and a `soun` track handler are required. `video/mp4` is accepted when the container has an audio track. The box walk checks at most 4096 boxes and can find `moov` after `mdat`; fragmented files are supported.
668
- - MP3: ID3 alone is not audio. Indexed Layer III uses the frame header; free-format Layer III needs three complete frames with compatible headers and matching, padding-adjusted spacing, with the next header within 8192 bytes.
669
-
670
- Use a local path for unsupported Ogg codecs, very short free-format clips, or other files outside these inspection bounds.
671
-
672
- **Compatibility change:** raw PCM, unknown/truncated signatures and MIME/signature contradictions in URLs now fail before transcription. Convert unsupported input to one of the listed containers, fix an incorrect server MIME, or supply a local file path for a custom hook format. Size errors name `transcribeMaxBytes` and how to adjust it; other download refusals give their reason, the setting and a corrective action on one line. The downloaded file and directory are removed on success, overflow, failed downloads, rejected formats, and failed or empty transcription. Errors exit nonzero.
673
-
674
- ### `dori heavy <label> -- <command ...>`
675
- Waits until load is under `heavyMaxLoad` and one of `heavySlots` is free, then runs the command and frees the slot when it exits. A slot held by a process that no longer exists (or a zombie) is taken over. Use it for full builds and test suites. Installs, focused tests and git do not need it.
676
-
677
- ## Complete harness entrypoint
678
-
679
- `dori harness <args...>` dispatches to the retained upstream harness in `src/cli.ts`. It supports `up`, `role`, `start`, `report`, `ready`, `send`, `inbox`, `duty`, `review`, `merge`, `done`, `status`, `loop`, `backlog` and `migrate` without taking over the primary messenger/lane `dori` namespace. Direct source invocation is `bun src/cli.ts <args...>`; a separately linked root package exposes `dori-harness`. Nothing in installation starts this harness or another production messenger.
680
-
681
- ## Consumer release management
682
-
683
- `dori --version` and `dori update <check|install|status|rollback> [--version TAG] [--from DIST]` dispatch before normal Dori config loading. `check` and `install` accept an exact tag or a verified local asset directory; without a tag, network selection is stable-only. `rollback` validates the retained previous source and optionally asserts its tag with `--version`; `status` and `rollback` do not accept `--from`. Local Dori assets do not eliminate the initial anonymous network fetch for pinned public omp-ulw when it is not already provisioned.
684
-
685
- These consumer commands use no porting/review models or GitHub write permission. Install/update/rollback activation holds while any live Dori is detected, including idle sessions; operators explicitly stop their own monitors and end the owning session before retrying. No implicit kill, restart or watcher restoration occurs. Existing config/auth/work/sessions remain intact. Follow the [release guide](../../../docs/releases.md) for canonical download identity, checksum/source verification, interrupted-activation recovery and support limits.
686
-
687
- ## CI-gated source updates
688
-
689
- `dori update source` follows this repository's CI-passing `main` without model porting or consumer-release migration. It is opt-in and reuses the managed deployment transaction for private candidate preparation, same-session resume, monitor/intake health and rollback. Automatic forward stops require the existing draft-aware native UI handoff, currently Linux/herdr; unsupported UI surfaces hold rather than falling back to a signal. Source-update configuration admission requires POSIX ownership and mode checks; it is not available on Windows. Existing consumer commands are unaffected.
690
-
691
- ```bash
692
- dori update source check
693
- dori update source status
694
- dori idle-check --owner-quiet 30m
695
- dori update source apply --when idle --owner-quiet 30m --require-ci check,e2e-herdr,e2e-hc --dry-run
696
- dori update source apply --when idle
697
- dori lead restart --when idle
698
- ```
699
-
700
- Every command accepts `--config` for an existing source-update configuration. The default is `$DORI_HOME/source-update.json`, or `~/.dori/source-update.json` when `DORI_HOME` is unset. An explicit config wins over ambient home selection. Nothing creates this config, enables a service or changes a live installation implicitly.
701
-
702
- The source config is an owned regular JSON file without group/world write permission. Unknown keys are errors. Set real deployment identities and paths from the existing installation, not example session or pane IDs:
703
-
704
- | Field | Contract |
705
- | --- | --- |
706
- | `version` | Required `1`. |
707
- | `repository` | GitHub owner/repository; defaults to `vntrevx/Cataly`. |
708
- | `git`, `gh` | Trusted executable paths; defaults to the installed commands found on PATH. |
709
- | `credentialHome` | Existing controller-side GitHub authentication home; defaults to `deployment.home`. Inherited model keys and GitHub token variables are not forwarded. |
710
- | `activityFiles` | Required complete, distinct list of active inbound receiver records, inside `deployment.stateDir`. |
711
- | `ownerQuietMinutes` | Defaults to `30`; cannot be lower. `--owner-quiet` may use whole minutes or hours, never below 30 minutes. |
712
- | `activityMaxAgeSeconds` | Defaults to `120`; allowed range 1–300. |
713
- | `requiredCi` | Defaults to `check`, `e2e-herdr`, `e2e-hc`; all three remain mandatory. Additional exact job names are allowed. |
714
- | `intervalSeconds` | Resident source-mode check interval; defaults to 86400, allowed range 60–86400. |
715
- | `deployment` | The existing managed deployment fields described below: live source, release/state/home paths, private toolchain, runtime, exact pane/session/model, shared restart lock and fixed launcher slot. Source mode defaults `nativeStopMode` to `"ui"` and rejects `"signal"`. |
716
-
717
- Add `--activity-file` with its owned absolute record path to each existing `dori inbound discord`, `telegram` or `slack` monitor. List every such receiver in `activityFiles`; an omitted custom receiver cannot be discovered automatically. The primary managed intake heartbeat must be that receiver's activity path with `.heartbeat` appended. Keep the existing monitor loop, filtering, protected token loading and launch policy. Setup does not start or reconfigure receivers for you. The freshness bound must exceed the longest successful polling cycle plus network margin: Telegram `--loop 1` can take 25 seconds of long polling plus 60 seconds of sleep, so the default 120 seconds leaves 35 seconds for latency. For a longer loop, shorten it or explicitly raise `activityMaxAgeSeconds` within its supported range. Size the primary managed intake heartbeat's `maxAgeMs` for the same cadence.
718
-
719
- These receipts contain process identity, quiet/health timestamps and availability, not message content or session history. Actual inbound receipts and transitions from unavailable to healthy start a fresh quiet window; healthy heartbeats alone do not. Receiver restart also starts a new quiet window; downtime never counts as proven quiet. Telegram health waits until a polling backlog drains. Discord Gateway health starts after the current connection completes backfill and refreshes on heartbeat acknowledgements only while its durable delivery queue is empty and no volatile thread-scope candidate is pending. An owner frame staged for thread-scope resolution counts as a receipt when staged. Accepted frames remain on disk if activity observation fails. Missing, stale, future-dated, unavailable, dead or wrongly parented receiver evidence holds. Slack conservatively counts every delivered watched-thread inbound item and remains unavailable while any polled response reports more pages or a continuation cursor. All configured writers must be current descendants of the same lead.
720
-
721
- Idle means no non-closed registered lane (the reserved lead record is excluded), no unreadable lane record, the exact live lead/session marked idle, no pending approval, and at least the configured quiet period for every receiver. Paused and done-claimed lanes still block. The policy is checked again synchronously after the final native input observation and immediately before recording the first native UI exit request. A generic stop-intent record without that UI request receipt does not bypass admission, including during pending restart recovery. Run apply/restart outside the lead process tree.
722
-
723
- `check` reads the clean ordinary Git installation and selects the newest qualifying commit within 40 first-parent commits of current `main`. It binds the canonical repository, exact commit/tree, latest trusted Actions CI attempt and all required successful jobs. Unknown API/trust errors do not authorize falling back to an older success. The target must be a forward descendant of installed HEAD; dirty source, linked worktrees and consumer installations hold. A new candidate is privately cloned; the running checkout is never reset. The selected target stays fixed during preparation and its main ancestry and CI are revalidated before stopping.
724
-
725
- `--dry-run` proves current policy eligibility, including the failed-target circuit, without locks, ownership files, candidate preparation or native effects. It is not a claim that unprepared dependencies or future runtime health passed. `status` describes the last durable attempt, not current readiness. Successful apply preserves the private session by reference and requires matching code, native process, restored monitor descendants and a fresh intake heartbeat. Runtime health failure rolls back when existing identity/idle/approval guards permit it; new owner work is never interrupted to force rollback.
726
-
727
- A verified rollback circuit-blocks that target and older or unrelated targets. Inspect and fix its cause, then explicitly use `dori update source apply --when idle --retry-failed`, or wait for a passing descendant newer than the failed commit. Neither success nor failure of an explicitly permitted older installation erases another failed target. `status.failedCommits` retains all such receipts; each commit's receipt clears only when that exact target succeeds. Automatic candidates must be descendants of every retained failed commit. The resident supervisor never supplies that flag. Once native effects began, re-entering apply reconciles the managed write-ahead journal before fresh CI or quiet checks, so a stopped receiver or unavailable GitHub cannot strand recovery. A stale outer source receipt cannot replay the UI exit request. If that request remains unconfirmed, inspect the recorded actor/pane and complete its graceful exit; do not delete the receipt or blindly send the exit request again. Keep the recorded deployment configuration intact for recovery. Separate `lead restart` is held while a source transaction needs recovery. If a separately requested lead restart already has an exit-effect receipt, source `check` and `--dry-run` report that pending recovery without GitHub or fresh idle checks. `apply` first reconciles it and returns `recovery: "lead-restart"`; a subsequent apply performs fresh source selection. A held attempt with no exit-effect receipt may be superseded after its retry window, but the identity-bound inner journal takes precedence over a stale outer receipt.
728
-
729
- Apply/check exit `0` for a successful result, `4` for a policy hold or verified rollback, `6` for durable recovery pending and `2` for a failure requiring operator inspection. Interrupted operations exit `130`. Read the JSON status and error fields; neither a live process nor a printed result alone substitutes for managed health.
730
-
731
- For resident operation, use `scripts/update-supervisor.ts --mode source` with the real source config, private Bun and `--controller` equal to `deployment.liveSource`. That stable source pointer lets the supervisor exit `75` after a successful cutover so its service manager reloads accepted code. Normal checks use the daily default interval; pending recovery is revisited within 60 seconds, and `SIGUSR1` wakes an idle supervisor without interrupting its active operation. The interval is elapsed time, not a wall-clock schedule. To restrict attempts to night, an operator may instead schedule the same apply command with a user timer, such as `OnCalendar=daily` (local midnight). Installation enables neither supervision nor a timer. Existing upstream-supervisor mode and model-porting behavior are unchanged.
732
-
733
- ## Staged Dori updates
734
-
735
- `dori upstream` is the maintainer source-porting interface, with its own required `--config FILE`, dispatched before normal Dori config/state loading. It is separate from consumer `dori update`. Without `promotion`, it only stages source candidates and never commits, pushes or replaces live Dori. An explicit owner-approved promotion policy enables exact-source publication and optional managed herdr replacement after all checks and fresh review pass. That policy is standing authorization for its configured target, not permission for arbitrary repositories or sessions. Installation and boot never enable it. Neither mode upgrades global Bun, changes global model policy or updates ULW.
736
-
737
- The complete example is [`examples/update.config.json`](../../../examples/update.config.json), relative to the repository root. Its paths resolve relative to that file: it reads this checkout as `localSource` and writes an independent sibling staging directory. Worker/reviewer commands are explicit operator argv, separate from the installed lane defaults; use the source-only native launcher, not a side role wrapper or stock OMP. For the example's bare `omp`, prepend the prepared native cache for that invocation as below, or configure its printed absolute `bin/omp` path. Model/thinking selectors remain explicit examples, not controller defaults.
738
-
739
- ```sh
740
- native="$(bun scripts/source-dependencies.ts native "$PWD" "$HOME")"
741
- PATH="$native/bin:$PATH" dori upstream stage --config examples/update.config.json
742
- ```
743
-
744
- The native agent route targets the observed OMP 18.18.8 CLI/protocol. Both agents use `--no-pty`; the reviewer additionally uses `--no-lsp` to disable LSP tools, formatting and diagnostics, while the worker retains normal navigation support. User-supplied `--dori-role`/extension/profile flags are rejected. The controller loads its own trusted guard with an explicit `-e` for each agent (reviewer: exact read-only set; worker: built-in search/edit/shell tools only); normal role sessions and their pinned extension behavior remain unchanged.
745
-
746
- Agent commands may declare `engine:"omp"` or `engine:"external"`. Use `"omp"` for a custom actual compiled CLI executable with a readable, PID-preserving command prefix to apply native final-message parsing and capability guards. Without it, shared OMP classification reads the argv template, including Bun's `run` form, after leading `NAME=value` assignments and readable nested `env`/launcher prefixes. Direct OMP and known exec-preserving `env`, `nohup`, `nice` and `stdbuf` forms are usable; native checks read the OMP argv after that prefix and the controller preserves the complete configured argv. Attach interpreter option values with `=` as in `bun run --preload=FILE omp`; `bun run --smol omp` is also readable. General harness/lane classification still recognizes package runners and potentially forking launchers, but automated native updates refuse `timeout`, `caffeinate`, every `setsid` form (including conditional forks), `npx`, `bunx`, `bun x`, `npm exec`/`x` and conservatively unreadable runner variants at config load and again before model execution. The error requires a `PID-preserving` launch, even with explicit `engine:"omp"`: the launched PID must equal the guard receipt's PID; ancestry is not authorization. `npm exec`/`x` is unparsed unless `--` immediately precedes its command, because npm would otherwise consume OMP/controller options. Possible-OMP lanes still require trusted session state for goals and pause. An unreadable `env` prefix (`-S`, an unknown option), Bun/Node interpreter prefix, OMP-naming shell string or external wrapper behind a launcher also remains refused even with `"omp"`. Only `"external"` opts out: that trusted wrapper must run a real fresh model context, enforce read-only review itself and return only the final structured verdict line. A native OMP argv must end with `{prompt}`; controller options precede that positional (and a `--` immediately before it), and resume/continue/restore/fork flags remain forbidden. Whatever approval policy the CLI needs for edit/write/bash in print mode must be configured by the operator; the controller never adds auto-approval. Historical `env -u --profile` startup claims did not prove successful native scope validation: argument-printing probes stopped before receipt comparison. The current `env -u` and `stdbuf` regression sources exercise full worker/reviewer receipt validation without a provider; they do not claim a real model run.
747
-
748
- Before either native worker or reviewer starts, the job-owned `--config` overlay sets `disabledProviders` to `native`, `mcp-json`, `omp-plugins`, `agent-plugins`, `claude`, `claude-plugins`, `codex`, `gemini`, `opencode`, `cursor`, `windsurf`, and `vscode`, and preserves `mcp.enableProjectConfig:false`. OMP 18.18.8 loads this overlay before binding discovery settings and loading MCP, disabling every MCP-capable discovery source before server startup and instruction injection. This uses the supported [`disabledProviders` setting](https://github.com/can1357/oh-my-pi/blob/v18.18.8/packages/coding-agent/src/config/model-settings.ts#L77-L82) and [capability filtering](https://github.com/can1357/oh-my-pi/blob/v18.18.8/packages/coding-agent/src/capability/index.ts#L360-L400); it does not merely hide MCP tool names. The tagged setting declares no environment override; the rebuilt environment also excludes `PI_CONFIG_FILES` and reserved `PI_*`/`OMP_*` capabilities. No live/global client settings are edited.
749
-
750
- The native reviewer guard awaits `api.setActiveTools(["read","grep","glob"])` and verifies the exact active set before agent start and provider requests. CLI `--tools` alone is insufficient on the target runtime. A persistent `tool_call` hook also blocks every other tool **before approval/execution**. Blocked attempts remain in its nonce/job/source/PID-bound receipt and invalidate readiness, even if a later active-set readback is clean. The controller requires the actual scope receipt plus successful terminal model output. Its final reviewer text must be exactly one compact marker/JSON line, with no surrounding prose or code fence. Actual inherited MCP startup or instructions remain an isolation finding even with a clean tool roster.
751
-
752
- The native **worker** guard (`src/update/worker-guard.ts`) is the same mechanism with a different allow-list: it awaits `api.setActiveTools` to the built-in `read, grep, glob, find, ast_grep, ast_edit, edit, write, bash, lsp, todo, wait, eval` that exist, reads the set back (extras fail the run; `read`, `edit`, `write` and `bash` are required) and gates every call. MCP, web, GitHub, subagent (`task`), memory and skill-management tools are denied, so untrusted upstream content cannot steer the owner's global MCP servers. A denied attempt is recorded in the worker's nonce/job/PID-bound receipt (`blocked`) for the reviewer, but does not by itself fail the port. The worker keeps its normal shell and edit power as the operator's OS user: path confinement is by instruction and review, not by the guard.
753
-
754
- ```sh
755
- bun skills/dori-mode/scripts/src/cli.ts upstream check --config examples/update.config.json
756
- bun skills/dori-mode/scripts/src/cli.ts upstream stage --config examples/update.config.json
757
- bun skills/dori-mode/scripts/src/cli.ts upstream status --config examples/update.config.json
758
- bun skills/dori-mode/scripts/src/cli.ts upstream watch --config examples/update.config.json
759
- ```
760
-
761
- `check` observes exactly `remote` plus the full `ref`. A head equal to `baseUpstream` is unchanged. `stage` explicitly exercises the current exact head even when it is the baseline; its request receipt says `manual-current-head`, never a detected new commit. Both commands deduplicate an already attempted SHA, including failures and rejections. An unchanged head never spends another model run. `watch` is the same cycle with a configured interval and one controller lock for its lifetime. It stops on active or ambiguous work. Installation and normal boot start no updater.
762
-
763
- Configuration is strict: `version:1`, `target:"dori"`, `runtime:"herdr"`, separate `root`/`localSource`, public credential-free HTTPS or a local Git `remote`, `ref:"refs/heads/..."`, an exact `baseUpstream` Git SHA, real `worker`/`reviewer` commands, optional `provision` commands and a nonempty `checks` command set. Every command has a unique `name` (letters, digits, `.`, `_`, `-`), nonempty `argv`, positive `timeoutMs`, and for provisioning/checks an optional candidate-relative `cwd`. `engine` is valid only on worker/reviewer; `modelAgentDir` accepts `~`. No shell string is constructed. All source preparation uses independent ordinary clones, no linked worktree or live-tree Git operation.
764
-
765
- Every agent command must consume `{prompt}` or `{brief}`. `{candidate}`, `{job}`, `{agentConfig}` and `{sessions}` are also available per argv element. Worker and reviewer run in separate new processes with separate config/state/session/HOME/cache/tmp directories and contexts. Native OMP commands are rejected if they carry resume, continue, restore or fork flags; an `engine:"external"` wrapper is not inspected for them and owns its own fresh-context contract. Direct OMP invocation uses the actual CLI's `-p` pattern, `--no-session`, a dedicated `--session-dir` and native OMP `--config` overlay, `--no-title`, `--no-extensions`, `--no-skills`, `--no-rules`, `--no-context-files`, and `--wait-async`. The reviewer receives `--tools read,grep,glob`. Custom wrappers are trusted operator commands and must enforce equivalent fresh-context/read-only review behavior themselves. No automatic approval or credit/reset redemption is implemented.
766
-
767
- Direct OMP commands are pinned to `--mode json`: the controller reads completed assistant `message_end` text only and requires a matching terminal `agent_end` plus successful process exit. User/tool content, streaming deltas, `turn_end` repeats and nonterminal ends cannot supply a verdict. The final message attests observed provider/model separately from the requested selector; a different observed exact provider/model holds the candidate. A wrapper's final plain-text marker is accepted only as the wrapper's trusted output contract.
768
-
769
- `modelEnv` lists the exact host environment **names** a model client may inherit, such as `ANTHROPIC_API_KEY`. Their values are never in configuration, argv or receipts and are redacted from private child logs. Checks inherit none of these capabilities. By default the OMP agent directory is fresh too. An explicitly configured `modelAgentDir` is a trusted authentication/provider-settings reference outside source/staging, used only by model clients and never copied or snapshotted; it is never a session/state directory. Disabling discovery providers preserves this reference for model/auth resolution. Extra configured model/provider names alone do not establish session/state merging. `--no-session` and task-owned session paths keep normal session history separate; inherited MCP startup/instructions, writes to trusted/live client settings and credential copies remain disallowed. The native config overlay and Dori's generated `DORI_CONFIG` JSON are separate files.
770
-
771
- Every launch rebuilds its environment: dedicated `HOME`, Dori config/state, harness home, XDG paths and tmp; a job-owned shared cache for frozen installs; and, for model agents, a native session directory and isolated `DORI_HERDR_SESSION`/`HC_SESSION`. Parent pane/workspace/session IDs and unrelated environment variables are absent. `DORI_RUNTIME=herdr`, `DORI_TELEMETRY=0` and `DO_NOT_TRACK=1` apply only to automated launches. Model authentication is an explicit trusted capability. This is environment/path isolation, **not an OS sandbox**: configured commands and model tools still run as the operator's OS user.
772
-
773
- Runtime paths use a short per-command `/tmp/du-<identity>` symlink into the job's durable `runtime/ORDINAL` directory, so `HOME`, tmp, all XDG paths and native session/config paths remain short enough for Herdr/HC Unix sockets even under a deep staging root. Shared caches are reached through an owned link inside that directory; their actual data stays in the job. Each runtime's private `runtime-paths.json` binds its alias, real directory, cache, configuration hash and OS uid. Existing foreign paths, mismatched links or ownership receipts hold the launch without replacing them. The detector has the same mapping under `root/detector`.
774
-
775
- `GIT_CEILING_DIRECTORIES` is the canonical real runtime directory: Git discovery from runtime tmp paths stops there, including through the short alias. Repositories deliberately initialized below that boundary remain discoverable.
776
-
777
- These aliases and real runtime data are intentionally retained after exit or interruption: the controller cannot assume every descendant has stopped. `/tmp` aliases are not recovery snapshots or live activation links. After confirming **all** owned descendants have stopped, an operator may unlink only an alias whose uid and exact symlink target still match its retained ownership receipt; do not recursively remove its target or unrelated `/tmp` entries. Missing aliases can be recreated only from a matching ownership receipt; collisions require inspection. Recovery restores code/application data, not old runtime processes or their aliases.
778
-
779
- Before model work the job freezes base-upstream, current local source (including dirty/untracked adaptations) and exact new upstream, with SHA-256 manifests and a union of changed paths. Local native/ULW lock+patch payloads, `native-addon/` frozen manifests and admitted `ref/omp-ulw/` code are opaque frozen dependencies, not model update targets. They are carried byte for byte into the incoming candidate, retaining ordinary changed-path, source/check/review and recovery coverage. Manifests still bind `ulwPresent` and `ref/omp-ulw/` presence/absence; a worker/check must not install an absent library, and a conflicting incoming library holds rather than being replaced or deleted.
780
- Source manifests record excluded nodes, and admission checks those exclusions before copying or executing source. A pinned base or incoming upstream may exclude **only real `.git` directories**. Any other excluded path holds preparation before the worker, including tracked `bin/dori`, upstream `node_modules`, `.omp`, runtime directories, other `ref` checkouts and private-key/environment filenames. Git ignore rules do not select source: ordinary dirty, untracked and ignored adaptations remain hashed, frozen and required in changed-path coverage.
781
-
782
- The local input additionally permits real `node_modules` directories and a narrow non-source metadata boundary: root `config.json`; `.DS_Store`, `.env`, secret `.env.*`, `auth.json`, `credentials.json` and `.pem`/`.key`/`.p12`/`.pfx` files; and `auth`/`credentials` directories within the opaque `ref/omp-ulw` library. `.env.example` and `.env.sample` remain source. These credential/runtime inputs are never copied to the candidate or recovery source. Every other excluded local node holds preparation, including local `bin`, state/session/cache/tmp/evidence directories, other `ref` checkouts and opaque-library `bin`, `.cache`, `.omp` or global extension code. Keep runtime/application data outside the admitted source distribution; explicit application-data recovery is a separate input. The controller never silently drops those excluded code containers to finish a port.
783
-
784
- Workers must not install dependencies or create `node_modules` directories at any depth; on entry to verification, before configured provisioning begins, candidate admission permits only real `.git` metadata. The controller alone owns dependency provisioning.
785
-
786
- Candidate binding permits **only real `.git` and `node_modules` directories**, at the root or nested paths such as `ref/omp-ulw/.git` and `skills/dori-mode/scripts/node_modules`. These are exact path components, not prefix matches. Every other exclusion holds before/after trusted provision commands, at final source binding and after each check/review, even when the admitted-file hash is unchanged. Frozen-input checks and source snapshot/restore use the same admission boundary, so an excluded payload cannot disappear behind a successful hash comparison or recovery copy. Normal provision changes to admitted Dori source still precede the single final freeze; installed dependencies remain governed by trusted explicit provisioning.
787
-
788
- Admitted source symlinks/special files fail rather than being followed; permitted Git/dependency metadata must itself be a real directory. This is a source admission boundary, not an embedded-secret scanner: keep source free of credentials. Neither the controller nor its worker investigates, ports, fetches or updates ULW.
789
-
790
- The worker reconciles every changed path and emits a bound coverage receipt. It starts from incoming upstream rather than receiving a blanket old-source overlay. The controller then runs **every configured provisioning command** as trusted explicit preparation: frozen-lockfile installs for root, skill and extension, followed by the configured `bun run format` normalization in the example. Preparation may rewrite admitted Dori source, but frozen inputs, the opaque local ULW pin and Git metadata are enforced before and after every provision command, including failure. There is no automatic formatter, repair loop or retry.
791
-
792
- The worker performs a three-way integration: it carries local edits and removals forward while integrating the delta from base to incoming upstream. Starting from an incoming checkout does not authorize restoring locally removed code or tests. In particular, removed wording, source-text, forwarding and incidental-default assertions are not missing behavior coverage to resurrect; consumer-visible behavior and boundary regressions remain required.
793
-
794
- Only after all provisioning succeeds does the controller freeze and persist the final `sourceHash` and `ported-source.json`, then run **every configured check**. Provisioning receipts record actual preparation exits, not passed verification of that final hash. Check and review receipts must bind the final post-preparation source; any admitted-source mutation during a check or review holds the candidate rather than rebinding old evidence. All commands retain stdout/stderr/exit/time/process receipts. A fresh reviewer independently covers `upstreamCoverage`, `localAdaptations`, `correctness`, `isolation`, `verification`, `security`, `failureRecovery` and `scope`; its structured `DORI_UPDATE_REVIEW` response must bind the exact checked source, provide evidence for all eight items, findings and explicit limitations. Plain `VERDICT: CLEAR`, missing/malformed output, unavailable review, unknown items and stale source never grant readiness. Requested and observed model identities are separate receipt fields; unavailable observation stays `null`.
795
-
796
- The **entire final assistant response** must be one physical line: `DORI_UPDATE_REVIEW ` followed by one compact JSON object, with no introduction, explanation, bullets, markdown fence or surrounding text. An approval requires all eight items to pass and `findings: []`. Any unresolved finding requires rejection; nonblocking observations belong in the relevant checklist evidence or limitations. The controller does not strip surrounding prose or reinterpret an invalid approval as readiness.
797
-
798
- Private artifacts live in `root/jobs/JOB_ID/`: ordinary `candidate/`, frozen `inputs/`, `prepared-source.json`, `ported-source.json`, coverage/review briefs and receipts, per-command logs, generated `runtime/`, `job.json` and `report.json`. The report contains exact upstream/base/local/candidate hashes, actual check exits, independent verdict/limits, candidate path and rollback inputs. `ready` still means **candidate only**; automatic publication/deployment has a separate durable promotion record and never rewrites that readiness evidence. Candidate phases remain `prepared`, `porting`, `verifying`, `reviewing`, `ready`, `failed`, `rejected` and `interrupted`. The accepted upstream baseline advances in persisted state only after the configured complete promotion succeeds. Configuration identity stays bound to the root; changing policy requires a new staging root, not editing its historical baseline.
799
-
800
- Stdout emits path-free JSON `DORI_UPDATE` events; detailed status and receipts remain private. For stage-only watching, the owning session's monitor tool can run `watch` and filter phase/candidate/held/error events so unchanged observations stay quiet. Automatic live replacement instead needs the external supervisor below: an in-session watcher dies with the session it replaces. Neither form posts periodic owner progress merely because a detection interval elapsed. `status` prints private local reports and must not be forwarded wholesale to a messenger.
801
-
802
- With a configured managed deployment, `status.running` separately observes the current native process, session ownership, fresh loaded-extension source, immutable source hash and admitted native toolchain. It reports the running content hash, source path, PID/session, native version and bound native bundle identity where available; these are not inferred from the newest candidate or historical `jobs[].deployed` flag. Missing, stale or changed evidence produces `status: "unknown"` with a reason. A working or approval-pending session can be inspected without input, signals, restart, selection changes or deployment-state writes. Native verification retains the existing cache leases and may write or sweep lease metadata; it does not bypass cache-prune protection. The bounded verifier and its private temporary files are stopped and cleaned up on cancellation. This revision observation is not a new deployment health approval: the existing preparation, exact-source checks, immutable activation, rollback, locks and pin/review requirements still control updates.
803
-
804
- Optional `reporter` is a trusted argv command consuming `{text}` (also allowed: `{job}`, `{upstream}`, `{phase}`). Its text is a fixed path-free JSON projection with hashes, check exits, verdict and limitation count; detailed findings remain in the local artifact. It can call existing `dori send slack|telegram|discord --to ... --text {text}` using the operator's actual target and trusted executable path. Set `reporterEnv` to exact messenger token/cookie names; only the reporter inherits them. No target/channel is built into product code. Sending intent is durable before the external write. A reporter that never started or exited nonzero is `failed`; one killed or lost after it started is `ambiguous` and `sending` after a crash becomes `ambiguous` on recovery. Neither is ever resent, neither changes the verdict, and neither blocks later updates; both appear in `status` and make `check`/`stage` exit 3.
805
-
806
- ### Recovery drill
807
-
808
- Stop the watcher in its owning session first. Inspect retained process receipts and establish that all old children have stopped; the updater never guesses from an aged lock, kills an unknown PID or resumes an interrupted model/check. For an active job, `dori upstream recover --config FILE --ack-stopped ID` is the explicit acknowledgement. It clears active ownership and keeps the SHA deduplicated. A job that was still mid-run becomes `interrupted`; a job that already had a complete verdict (`ready`, `failed`, `rejected`) keeps it, and a `ready` verdict whose source no longer matches becomes `failed`. A live controller or foreign-host lock holds recovery.
809
-
810
- Acknowledgement never retries or rebinds a terminal failed candidate. To evaluate a corrected controller against the same upstream SHA, use a separate configuration and a fresh isolated `root`, retaining the previous root and its receipts unchanged. This is a new run: it must perform a fresh port, every configured check and a fresh independent review; no archived check or verdict grants readiness. Never rewrite the old state's `configHash`, job phase or receipts.
811
-
812
- If the watcher died while idle and there is no active job, `dori upstream recover --config FILE --ack-stopped none` acknowledges the stopped controller alone and retains its lock evidence in `recovery-ack.json`. Corrupt lock/state records require manual inspection; they are never guessed away.
813
-
814
- The following commands discover the existing terminal job and create **fresh sibling directories**. Run them from the checkout with `jq` available; `config` is the existing example. First run the isolated candidate with its dedicated application data under `root/application`, then stop that candidate's state writers. `--app-state` must name that existing task-owned data, never the owner's live state or model-client directory. If skill `DORI_STATE_DIR` and harness `DORI_HOME` are separate, supply their common owned data container so both relative trees are preserved.
815
-
816
- ```sh
817
- config="$PWD/examples/update.config.json"
818
- root="$(dirname "$PWD")/dori-update-staging"
819
- app_state="$root/application"
820
- job="$(jq -r '.jobs | to_entries | last | .value' "$root/state.json")"
821
- stamp="$(date +%s)"
822
- snapshot="$(dirname "$PWD")/dori-source-state-$stamp"
823
- restored="$(dirname "$PWD")/dori-restored-$stamp"
824
- bun skills/dori-mode/scripts/src/cli.ts upstream snapshot --config "$config" --job "$job" --output "$snapshot" --app-state "$app_state"
825
- bun skills/dori-mode/scripts/src/cli.ts upstream restore --config "$config" --input "$snapshot" --output "$restored"
826
- jq '{phase, sourceHash, applicationStateHash, applicationState, candidateOnly}' "$restored/recovery.json"
827
- ```
828
-
829
- `snapshot` requires no active/ambiguous updater work and freezes source, frozen inputs, updater control state and command receipts/logs. With explicit `--app-state`, it separately freezes actual application lane/paused state, receipts, monitor specifications, session identity metadata and inbound cursors. This state never enters source snapshots or model prompts. Application authentication, environment files, configuration/settings, private keys and personal client directories are excluded. No application state is inferred: omitting the flag records `applicationState:null` and produces a code/control-evidence snapshot only.
830
-
831
- `restore` validates source, application-data and control/evidence manifests before writing a new destination: mutable `candidate/`, mutable `app-state/` when supplied, frozen `inputs/`, archived original control evidence and an explicit `interrupted` recovery record. It preserves application data bytes and statuses; it does not rewrite paused lanes, launch monitors or reconnect old processes. Point a new owned Dori config's `stateDir` and `DORI_HOME` at the restored relative trees before an explicit isolated restart. `applicationManifest()` exposes the admitted application-data hash for comparison, and the existing Registry/Store/cursor/monitor readers can read the restored data normally.
832
-
833
- Restored historical checks/review grant no source readiness and are never loaded into the running watcher. Admitted opaque `ref/omp-ulw/` source and its presence/absence are restored with the code; installed packages, Git objects, model sessions/history and authentication are not. No existing source, live state or failed candidate is deleted or overwritten. State writers must remain stopped during a snapshot; changed inputs, links and special files fail rather than producing a misleading recovery copy. This is a source/application-data recovery procedure, not an OS image or an embedded-secret scanner.
834
-
835
- Exit codes: `0` unchanged/ready or completed status/recovery, `3` failed/rejected/held candidate or failed reporter, `4` detector unavailable with proven stopped ownership (retryable), `5` updater root locked by a verified live same-host controller (retryable), `2` configuration/operation error, `130` requested interruption. A timed-out detector is retryable only after its owned process group has stopped and both output pipes have drained; surviving or unproven descendants remain held. Before watcher activation, run `bun test ./test/update*.test.ts`, the repository checks, and a real explicitly configured `stage` cycle, then exercise the generated native guard and application-state restore on owned fixtures.
836
-
837
- ### Owner-authorized automatic publication and deployment
838
-
839
- The optional `promotion.publish` object defines `remote`, full branch `ref`, `author: {name,email}` and, for GitHub, `github: {gh,credentialHome,requiredChecks}`. The remote must be credential-free. `gh` is the actual trusted executable, `credentialHome` references existing controller-only GitHub authentication in place, and `requiredChecks` lists the exact required check names. Local Git remotes support isolated real-Git proofs without a GitHub capability. Workers, reviewers and checks do not inherit publication credentials.
840
-
841
- Publication derives its public manifest from the checked `ported-source.json`, verifies every exported byte and executable mode, and excludes the opaque `ref/omp-ulw` checkout. It never publishes the candidate's Git metadata, runtime state, model sessions or ignored private files. A separate own-repository commit preserves the exact expected main parent. The controller pushes an owned branch, opens or resumes its GitHub PR, requires successful checks for that exact commit, and only then fast-forwards the configured target. It never forces a ref. Concurrent target changes hold the job. Durable intent plus actual remote readback prevents a crash after push from repeating publication or model work.
842
-
843
- When `reporter` is configured, promotion awaits a separate durable notice before pushing main and another before the first forward runtime stop. These are notifications, not approval requests. Accepted notices are reused only for the same job, action, exact publication/deployment intent, configuration and command receipt. A failed, unresolved or incomplete attempt holds the effect without automatically resending; terminal reports preserve the separate notice receipts. Without a configured reporter, existing non-notifying library operations remain unchanged.
844
-
845
- Before new publication intent, the public frozen local tree must equal the observed target tree, so an owner commit cannot disappear beneath a newer manifest. Optional `publish.initialSource: {main,sourceHash,exportHash,baseUpstream,upstream}` authorizes one explicitly reviewed initial uncommitted source cutover. The exact main, reverified frozen local manifest, approved final public export and authentic upstream pair must all match. A durable job claim prevents reuse by another job; the publication record preserves its basis and pins for resume. It is not a concurrency or review override. Configure these pins before the state root's first use and never edit/remove them: configHash is write-once. After deployment changes local source, normal tree matching resumes without a config rewrite. Initial historical replay is labeled separately from a newly arrived upstream update. A confirmed published commit remains published when it is an ancestor of later main; deploying that older source holds rather than undoing owner work.
846
-
847
- Initial-source publication tests share only a checked immutable export-hash reference; every scenario still prepares its own isolated candidate and receipts. Pass the existing shared reference to bootstrap fixtures instead of repeating reference-only Git preparation inside each case's execution deadline.
848
-
849
- Terminal held promotions retain their evidence and baseline but do not block detection of newer upstream SHAs. Pre-record tree, pin and one-time-claim mismatches are durable terminal holds, not silent publishing retries. The same attempted SHA remains deduplicated and is not silently re-ported. Retryable busy/pre-stop preparation/lock holds do not consume the terminal failure notification. GitHub's stale `blocked` mergeability after successful exact-head checks remains waiting, not approval. CI waiting retains its first deadline: the configured check timeout sum, bounded to 1–24 hours. Missing evidence or unresolved mergeability at that deadline becomes a terminal hold with one notification.
850
-
851
- An owner commit on main, publish-only operation or rollback after successful publication can leave localSource behind main. The normal guard then holds until an operator reconciles source. Prepare an owned checkout of the actual target commit, retain the admitted opaque local ULW pin unchanged, inspect the owner delta and verify that source, then retarget the already-configured stable localSource link. Never rewrite configHash, baseline, old job evidence or publication receipts to bypass the guard. Admission runs at publication time after ready, so an unreconciled source can spend one doomed port per newer upstream SHA; same-SHA dedup still applies.
852
-
853
- `promotion.deployment` is optional and requires Linux or macOS process identity support. Configure `releaseRoot`, stable `liveSource`, operator `home`, `doriHome`, `doriConfig`, `stateDir`, private `bun`, session-runtime binary, `pane`, `sessionId`, `model`, shared `restartLock`, fixed `launcherPath` and bounded `healthTimeoutMs`. Omit `omp` for a new release's bound source default; supplying it is an explicit external-native override. Older no-lock records keep their original explicit-native contract. `runtime` is `herdr` by default (`herdr`, `w1:p2`, optional `herdrSession`) or `hc` (`hc`, `t7`, optional `hcSession`). On macOS the final identity check and signal remain separate calls: a reused PID cannot be excluded as with Linux pidfd binding. Optional `stopTimeoutMs`, `monitorBootstrapFile`, `quiesceCheckpointFile` and release-relative `shims` still cover the operator's runtime. Initial real-directory conversion can retain `legacyOmp` only when it matches the captured running executable; later rollback uses the prior recorded toolchain. The pane/session/state directory must describe that owning Dori.
854
-
855
- Optional `nativeStopMode` accepts `"ui"` or `"signal"`. Omit the property to retain the existing signal stop and canonical config/hash; there is no new default. `"ui"` applies only to the forward `stopRuntime` handoff on Linux/herdr. Other platform/runtime combinations hold before recording stop intent; they retain their default signal deployment support. Failed-start and rollback cleanup of the new runtime retain their existing identity-bound signal behavior. Normal UI exit was exercised with Native 18.20 on Linux/herdr; other native versions and renderers require separate validation, and the historical SIGTERM failure cause remains unconfirmed.
856
-
857
- A failed or missing UI-key acknowledgement does not prove that the key was undelivered. The controller still waits for the bound native exit and bare root shell. If either remains unsettled, restart keeps its pending intent and deployment remains retryable at the forward stop step; neither declares that the possibly exiting old actor was successfully rolled back. A later invocation resumes observation without sending another key. Rollback after the observed forward stop and cleanup of a newly launched runtime remain unchanged.
858
-
859
- UI handoff requires an external controller and an ended current Dori turn: let the target become actually idle before the controller stops it. A controller launched as the target's descendant is held. A quiesce checkpoint never permits a UI key while native metadata still reports working, and no Ctrl+C is sent. Before one Ctrl+D, the controller reobserves the exact pane, root, foreground, native process, source and session together with recognized empty native input. A draft, unknown footer or pending approval holds without a key or signal fallback. The journal persists `nativeUiExitRequestedAt` before dispatch; recovery never resends even after an uncertain key result. Native exit, PID-reuse checks and a positively observed bare root shell remain the completion authority.
860
-
861
- The deployment transaction verifies and prepares the committed managed release before touching the live source. A legacy real source directory is preserved by rename, not deleted. It journals the old pointers and exact PID/start/boot/session identities before stopping anything, switches only configured links, and resumes the same native session by reference. Existing application state, paused goals, cursors, credentials, model history and global model policy stay in place; they are not copied into a release. New health requires the correct role/session/PID/code, desired monitor descendants and fresh intake heartbeat. Process existence or a printed success string is insufficient.
862
-
863
- Managed startup, rollback and restart bind the actual native entrypoint, Bun bytes and owned per-process `{"update":{"auto":false}}` overlay. New default receipts additionally bind the complete native source identity, exact launcher and actual official addon bytes, plus the selected ULW base/patch/result identity; a launcher hash or 18.20.0 version alone is insufficient. Preparation occurs before admission, and reuse checks source drift. A configured external `omp` is marked `nativeOverride`, not patched-source evidence. Managed default role sessions explicitly load their prepared Dori extension once and route its default ULW import to the prepared dependency; explicit external ULW paths remain user choices. Global native/Bun installations and model/auth settings are not rewritten. Explicit process-local `OMP_ULW_SCOPE_FILE` is forwarded as a path, never copied as policy contents.
864
-
865
- `launcherPath` is the operator's stable restart executable slot, for example `~/.dori/bin/managed-native-restart`. The transaction preserves that slot and switches it to an owned script pinned to the prepared controller release. Do not point this field at a controller `.ts` source file or at the outer delay/model-watch wrapper. Before first conversion, a protected initial delegate may invoke `bun FIXED_CONTROLLER/src/update/deployment-launcher.ts DEPLOYMENT_CONFIG_JSON`; the outer helper delegates to the stable slot before any signal.
866
-
867
- Ordinary replacement/restart holds busy or approval-blocked actors. An initial self-handoff may use a private, expiring, exact-intent/commit/source/PID-bound quiesce checkpoint; it is not a reusable busy override, and approvals still block it. A trusted first-boot monitor bootstrap supplies `{version:1,sessionId,monitors:[{name,argv,filter,cwd}],intake:{path,monitor,maxAgeMs}}` and optional recorded running monitor PIDs. The controller revalidates ownership before cleanup. New persisted starts remain compatible with legacy rollback. Token-loading monitors must load their own credentials inside protected child launchers, not inherit a token or sudo password from the resumed Dori.
868
-
869
- Script-based monitors can share the native actor's foreground group. Only managed deployment may disregard their exact attested processes: the native actor must be present in its actual foreground group, and each ignored monitor must match its desired command/cwd and saved incarnation as that actor's descendant. Initial bootstrap needs a `runtime` receipt with `pid,startTicks,bootId,executable,imageDev,imageIno,pane,role,sessionId,startedAt`, plus each `running` entry's complete `identity` (`pid,startTicks,bootId,executable,imageDev,imageIno`). Thin `{name,pid}` entries alone do not grant this exception. Managed actors use their current owned runtime-health record and persisted monitor specs, including monitor start ticks. Unknown shells, a foreground root shell, stale/reused/foreign identities and missing proof still hold. Generic harness delivery and its foreground-shell rules are unchanged.
870
-
871
- Launch identification and failed-start cleanup use the same strong foreground attestation for managed actors, including a prior managed rollback. A matching live but unattested process is a hold, not evidence that no process launched. Starting or resuming a launch requires a positively identified bare pane-root shell with no live pane owner or children, including background or suspended descendants; a native actor's Bash monitors never satisfy that condition. Unknown metadata and unsupported shell flags hold rather than typing a second launch into an existing process. The pre-role, no-shell startup cleanup path remains bound to its exact journaled executable, argv and chronology, and initialized actors must be idle without approval before cleanup.
872
-
873
- A shell alias is admitted only when its absolute kernel argv0 resolves to the observed executable and the reported shell name remains bound to that argv0, for example `/bin/sh` resolving to `/usr/bin/dash`. A matching display name without exact canonical image and incarnation proof is insufficient.
874
-
875
- An initial legacy rollback may have no runtime-health writer. Only the controller's journaled rollback launch and health observation may then bind the new native incarnation to the preserved monitor commands, actual working directories and current descendant identities. This separate rollback proof does not rewrite the original bootstrap or authorize another launch. Unknown shells and changed incarnations still hold. Native `ps` observations use the observer's resolved time zone, so a caller's different `TZ` does not alter process-start chronology or relax its time window.
876
-
877
- Failed-start rollback discovery and its pre-signal safety attestation retry fresh observations within bounded windows, so an exiting monitor child cannot turn one transient snapshot into an immediate terminal rollback failure. Each attempt still enforces the exact process, image, argv, chronology, session, idle and approval guards; deadline or cancellation never authorizes signalling an unverified process. Observing a completed bootstrap rollback is read-only and requires the genuine `rolled-back`/`done` journal, `rollbackHealthyAt`, matching rollback process/runtime and original source proof, and the unchanged bootstrap with current monitor incarnations. This completed observation grants no launch capability and never rewrites the journal step or original bootstrap.
878
-
879
- Re-entering a completed rollback only waits for fresh bounded health to match its saved runtime receipt. It does not change `done`, persist the record again, restore pointers, signal or launch another process. Live replacement and kernel-bound cleanup require Linux `/proc` and pidfds; other platforms hold before native effects, while portable detection, publication, pointer and admission checks remain enabled. Pointer backups preserve the symlink inode itself rather than following its target on Linux and macOS, including dangling links.
880
-
881
- Herdr `done` is admitted as idle-equivalent only when process-bound native metadata does not attest `working`. Native working metadata remains authoritative and requires ordinary idle convergence or the exact one-shot quiesce checkpoint. Approval and identity guards still apply. Pre-stop command/lock failures get one persisted 1-hour failure-retry window; expiry is a terminal hold without signalling the actor. Verified busy waits do not consume that failure window. Malformed source, integrity failures and post-stop ambiguity do not acquire retry permission.
882
-
883
- The intake heartbeat is a decimal epoch-millisecond timestamp written by the configured intake monitor. It must be an owned regular file without group/world write permission; use mode `0600`, including for an existing receipt. A live process and a fresh but group-writable pulse do not satisfy deployment health.
884
-
885
- On failed startup or health, rollback restores the prior execution source and session when that can be done without interrupting new owner work or approvals. An ambiguous identity or newly busy actor holds for inspection instead. Runtime rollback does not rewrite published GitHub history: main and the running release can temporarily differ, and the promotion record distinguishes them. `dori upstream restart --config FILE` uses the configured managed restart lock and the same identity/health checks; existing model-watch helpers must delegate before sending any signal.
886
-
887
- ### Resident supervision
888
-
889
- Run `scripts/update-supervisor.ts --config FILE --controller DIRECTORY --bun EXECUTABLE` outside the Dori it may replace. The controller directory is a stable link to the accepted controller release; each cycle invokes the actual `upstream check`, so the next cycle loads accepted code. When the link changes, the supervisor exits for the service manager to reload itself. It uses `intervalSeconds` from the config, does not manufacture status messages, and never retries a model merely because the interval elapsed. Completed detector unavailability (exit `4`) and a lock held by a verified live controller (exit `5`) wait for the next interval rather than disabling the service; configuration errors and malformed, stale or unverifiable locks still stop it. Unfinished ambiguous model work remains held; only finished ready promotion effects have automatic readback-based recovery.
890
-
891
- On Linux, `SIGUSR1` wakes the supervisor's next check without interrupting an active cycle. An expiring initial quiesce checkpoint can therefore be consumed immediately rather than waiting a full polling interval. The signal does not bypass deployment, publication or review gates.
892
-
893
- [`examples/update-supervisor.service`](../../../examples/update-supervisor.service) supplies an outside-session systemd user unit for the layout `~/.dori/update/{config.json,controller}` and `~/.dori/toolchains/bun-1.4.4/bun`. Provision that private Bun and the trusted controller link explicitly, configure publication/runtime identities and protected monitor launchers, and install the unit as `~/.config/systemd/user/dori-upstream-update.service` before `systemctl --user enable --now dori-upstream-update.service`. This does not upgrade global Bun. Exclude generated releases/toolchains/jobs from unrelated home-backup source tracking. Systemd supervision does not silently recreate an unavailable unrelated herdr server.
894
-
895
- Use only trusted upstream and configured commands: source/process/environment separation is not an OS sandbox. First exercise a real nonempty upstream delta, exact-source checks/fresh review, publication readback, native restart, monitor/intake continuity and failed-start rollback in owned fixtures. If replaying an authentic historical change because upstream has no new revision, report that fact; an unchanged-head `stage` is not evidence that a new update was automatically ported.