rvlib-shipkit 2.31.0 → 2.33.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 (408) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +1 -1
  3. package/src/advisors/acts.ts +16 -15
  4. package/src/advisors/advice.ts +56 -102
  5. package/src/advisors/advisor-view.ts +122 -76
  6. package/src/advisors/app-graph.ts +1 -1
  7. package/src/advisors/app.ts +3 -11
  8. package/src/advisors/cf-api.ts +1 -1
  9. package/src/advisors/dir-bucket.ts +4 -3
  10. package/src/advisors/edge/api.ts +20 -221
  11. package/src/advisors/edge/bucket.ts +2 -2
  12. package/src/advisors/edge/handler.ts +13 -155
  13. package/src/advisors/edge/here.ts +5 -5
  14. package/src/advisors/edge/pages.ts +12 -9
  15. package/src/advisors/edge/shell.ts +6 -5
  16. package/src/advisors/edge/sign-in.ts +101 -36
  17. package/src/advisors/edge/status.ts +19 -6
  18. package/src/advisors/edge/types.ts +36 -60
  19. package/src/advisors/expose.ts +29 -29
  20. package/src/advisors/here.ts +12 -12
  21. package/src/advisors/invite-send.ts +79 -35
  22. package/src/advisors/invite.ts +31 -8
  23. package/src/advisors/job.ts +24 -16
  24. package/src/advisors/login.ts +40 -15
  25. package/src/advisors/owner-store.ts +46 -22
  26. package/src/advisors/photos.ts +3 -3
  27. package/src/advisors/project.ts +27 -25
  28. package/src/advisors/reach.ts +89 -0
  29. package/src/advisors/rights.ts +1 -1
  30. package/src/advisors/routes.ts +55 -74
  31. package/src/advisors/scan.ts +0 -4
  32. package/src/advisors/setup-run.ts +14 -14
  33. package/src/advisors/share-trace.ts +3 -3
  34. package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
  35. package/src/advisors/speaks.ts +29 -0
  36. package/src/advisors/sync.ts +97 -183
  37. package/src/advisors/tunnel.ts +6 -5
  38. package/src/advisors/users-listen.ts +92 -0
  39. package/src/advisors/users-router.ts +261 -87
  40. package/src/advisors/users-store.ts +81 -0
  41. package/src/agent-time/blocked-scan.ts +181 -0
  42. package/src/agent-time/registry.ts +12 -5
  43. package/src/agent-time/store.ts +9 -109
  44. package/src/asks/ask-bar-fold.ts +2 -1
  45. package/src/asks/ask-close.ts +2 -1
  46. package/src/asks/ask-doc.ts +2 -1
  47. package/src/asks/ask-migrate.ts +3 -2
  48. package/src/asks/ask-steps-fold.ts +2 -1
  49. package/src/asks/ask-store.ts +4 -3
  50. package/src/check.ts +3 -43
  51. package/src/checks/SK001-package-json-shape.check.ts +4 -55
  52. package/src/checks/SK004-gitignore-policy.check.ts +24 -69
  53. package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
  54. package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
  55. package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
  56. package/src/checks/SK020-self-spawning-check.check.ts +5 -7
  57. package/src/checks/SK035-public-clean.check.ts +1 -1
  58. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
  59. package/src/checks/SK042-post-kinds.check.ts +5 -14
  60. package/src/checks/SK054-agent-allow-list.check.ts +5 -74
  61. package/src/checks/SK055-retired-config-keys.check.ts +45 -0
  62. package/src/cli/cmd_Advisors.ts +11 -45
  63. package/src/cli/cmd_Asks.ts +3 -10
  64. package/src/cli/cmd_Backup.ts +25 -127
  65. package/src/cli/cmd_BackupTargets.ts +1 -1
  66. package/src/cli/cmd_Capacity.ts +6 -2
  67. package/src/cli/cmd_Checks.ts +0 -14
  68. package/src/cli/cmd_Ci.ts +2 -1
  69. package/src/cli/cmd_Db.ts +3 -82
  70. package/src/cli/cmd_Home.ts +4 -32
  71. package/src/cli/cmd_Hq.ts +0 -17
  72. package/src/cli/cmd_Releases.ts +57 -4
  73. package/src/cli/cmd_Review.ts +333 -354
  74. package/src/cli/cmd_Shot.ts +26 -4
  75. package/src/cli/cmd_SocialDrafts.ts +6 -13
  76. package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
  77. package/src/cli/cmd_Time.ts +1 -1
  78. package/src/cli/cmd_Trailer.ts +1 -1
  79. package/src/cli/inbox-hook-run.ts +5 -23
  80. package/src/cli/registry-heads.ts +5 -55
  81. package/src/cli/registry.ts +1 -5
  82. package/src/cli/review-here.ts +1 -1
  83. package/src/cli.ts +15 -4
  84. package/src/collections/collection-types.ts +1 -1
  85. package/src/collections/review.ts +5 -4
  86. package/src/core/admission.ts +268 -0
  87. package/src/core/agent-allow-policy.ts +32 -2
  88. package/src/core/agent-env.ts +8 -0
  89. package/src/core/allow-rows.ts +74 -0
  90. package/src/core/check-file-names.ts +19 -106
  91. package/src/core/code-lines.ts +36 -21
  92. package/src/core/footprint.ts +17 -13
  93. package/src/core/identities-root.ts +1 -4
  94. package/src/core/layout.ts +1 -2
  95. package/src/core/machine-db.ts +33 -208
  96. package/src/core/machine-layout.ts +14 -127
  97. package/src/core/machine-read.ts +5 -2
  98. package/src/core/mask-source.ts +60 -0
  99. package/src/core/memory-watch.ts +17 -14
  100. package/src/core/motherhome.ts +8 -35
  101. package/src/core/one-way-in-policy.ts +0 -3
  102. package/src/core/peer-sk.ts +8 -0
  103. package/src/core/repo-walk.ts +0 -9
  104. package/src/core/retention.ts +1 -9
  105. package/src/core/retired-checks.ts +2 -0
  106. package/src/core/tmux-policy.ts +1 -1
  107. package/src/core/tree-watch.ts +2 -2
  108. package/src/core/when.ts +7 -45
  109. package/src/gate/admit-heavy.ts +150 -0
  110. package/src/gate/check-runner.ts +6 -0
  111. package/src/gate/discover-checks.ts +42 -32
  112. package/src/gate/gate-checks.ts +21 -131
  113. package/src/gate/head-gate.ts +1 -1
  114. package/src/gate/job-run.ts +2 -1
  115. package/src/gate/pre-commit-discovery.ts +22 -28
  116. package/src/gate/run-check.ts +3 -4
  117. package/src/gate/run-ci.ts +4 -0
  118. package/src/gate/run-fix.ts +5 -17
  119. package/src/gate/run-fixers.ts +6 -42
  120. package/src/home/app-sign.ts +2 -2
  121. package/src/home/backup-status.ts +52 -92
  122. package/src/home/backup-verdict.ts +2 -2
  123. package/src/home/daemon-jobs.ts +51 -95
  124. package/src/home/database-words.ts +1 -2
  125. package/src/home/databases.ts +9 -25
  126. package/src/home/home-launchd.ts +0 -6
  127. package/src/home/home-paths.ts +8 -4
  128. package/src/home/home-routes.ts +3 -10
  129. package/src/home/home-state.ts +2 -14
  130. package/src/home/inbox-shape.ts +14 -15
  131. package/src/home/inbox.ts +1 -1
  132. package/src/home/machine-repair.ts +102 -103
  133. package/src/home/resume.ts +1 -15
  134. package/src/home/run-daemon.ts +7 -12
  135. package/src/home/space-page.ts +3 -2
  136. package/src/home/supervise.ts +3 -7
  137. package/src/hooks/commit-msg-run.ts +61 -0
  138. package/src/hooks/commit-run.ts +16 -166
  139. package/src/hooks/gate-outcome.ts +108 -0
  140. package/src/hooks/git-hook.ts +9 -9
  141. package/src/hooks/hook-config.ts +8 -8
  142. package/src/hooks/leak-guard.ts +1 -1
  143. package/src/hooks/pre-commit-checks.ts +1 -1
  144. package/src/hooks/run-hooks.ts +2 -6
  145. package/src/hooks/shared-file.ts +3 -2
  146. package/src/hq/daemon-db.ts +8 -8
  147. package/src/hq/door.ts +3 -16
  148. package/src/hq/hq-db.ts +4 -3
  149. package/src/hq/hq-local.ts +1 -2
  150. package/src/hq/hq-store.ts +0 -15
  151. package/src/hq/item-direct.ts +8 -10
  152. package/src/hq/item-fill.ts +37 -0
  153. package/src/hq/kinds/item-gone.ts +7 -10
  154. package/src/hq/kinds/item-msg.ts +12 -18
  155. package/src/hq/kinds/item.ts +13 -19
  156. package/src/hq/kinds/report.ts +3 -4
  157. package/src/hq/owner-switch.ts +3 -3
  158. package/src/hq/report.ts +5 -9
  159. package/src/hq/switch.ts +2 -11
  160. package/src/hq/thread-sync.ts +5 -17
  161. package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
  162. package/src/http/owner-word.ts +1 -1
  163. package/src/identities/machine.ts +16 -0
  164. package/src/init-repo.ts +0 -1
  165. package/src/ledger/check-stats.ts +6 -5
  166. package/src/ledger/db.ts +2 -4
  167. package/src/ledger/record-kept.ts +117 -48
  168. package/src/ledger/run-log.ts +21 -2
  169. package/src/ledger/slow-tests.ts +96 -0
  170. package/src/ledger/store.ts +3 -86
  171. package/src/ledger/suite-log.ts +8 -2
  172. package/src/media-store/backup/facts.ts +3 -37
  173. package/src/media-store/backup/keys.ts +1 -8
  174. package/src/media-store/backup/manifest.ts +6 -67
  175. package/src/media-store/backup/restore.ts +4 -13
  176. package/src/media-store/backup/retention.ts +13 -1
  177. package/src/media-store/backup/run.ts +6 -267
  178. package/src/media-store/backup/snapshot.ts +2 -38
  179. package/src/media-store/backup/sources.ts +3 -113
  180. package/src/media-store/backup/target-send.ts +5 -29
  181. package/src/media-store/db.ts +8 -7
  182. package/src/media-store/forget-one.ts +1 -1
  183. package/src/media-store/forget.ts +1 -80
  184. package/src/orchestrator/guards.ts +0 -1
  185. package/src/orchestrator/presence.ts +2 -2
  186. package/src/orchestrator/routes.ts +1 -1
  187. package/src/orchestrator/started.ts +0 -9
  188. package/src/orchestrator/talk-key.ts +3 -4
  189. package/src/orchestrator/unheard.ts +1 -1
  190. package/src/plan/planner.ts +3 -2
  191. package/src/recordings/edit.ts +3 -3
  192. package/src/recordings/marks-draw.ts +17 -6
  193. package/src/recordings/marks.ts +120 -9
  194. package/src/reflections/reflections-queue.ts +3 -10
  195. package/src/release/notes.ts +1 -1
  196. package/src/release/public-clean.ts +66 -6
  197. package/src/release/run-bump.ts +11 -0
  198. package/src/release/run-release.ts +4 -0
  199. package/src/releases/from-thread.ts +3 -3
  200. package/src/releases/model.ts +186 -36
  201. package/src/releases/store.ts +13 -3
  202. package/src/releases/validate.ts +83 -0
  203. package/src/repo-config.ts +36 -64
  204. package/src/review/answer-kinds.ts +63 -4
  205. package/src/review/blocked-guard.ts +11 -0
  206. package/src/review/blocked-object.ts +298 -0
  207. package/src/review/cells.ts +144 -230
  208. package/src/review/close.ts +39 -1
  209. package/src/review/doc-save.ts +3 -2
  210. package/src/review/draft-item.ts +1 -1
  211. package/src/review/events.ts +3 -7
  212. package/src/review/expect.ts +23 -39
  213. package/src/review/format.ts +79 -46
  214. package/src/review/glyphs.ts +1 -0
  215. package/src/review/hand-over.ts +3 -3
  216. package/src/review/heard.ts +1 -1
  217. package/src/review/holds-sync.ts +2 -1
  218. package/src/review/inbox-hook.ts +2 -2
  219. package/src/review/inbox-read.ts +39 -33
  220. package/src/review/instruction-guards.ts +12 -0
  221. package/src/review/instructions.ts +0 -1
  222. package/src/review/item-db.ts +13 -43
  223. package/src/review/item-hq.ts +2 -2
  224. package/src/review/item-rows.ts +3 -14
  225. package/src/review/kind-catalog.ts +3 -1
  226. package/src/review/kinds.ts +18 -8
  227. package/src/review/live-view.ts +3 -0
  228. package/src/review/media-kind.ts +1 -1
  229. package/src/review/mentions.ts +1 -2
  230. package/src/review/model.ts +158 -114
  231. package/src/review/move.ts +149 -0
  232. package/src/review/need-threads.ts +3 -2
  233. package/src/review/object-card.ts +11 -0
  234. package/src/review/object-read.ts +6 -1
  235. package/src/review/one-block.ts +1 -1
  236. package/src/review/owner-read.ts +1 -1
  237. package/src/review/phone-push.ts +10 -9
  238. package/src/review/previews.ts +32 -4
  239. package/src/review/push.ts +2 -2
  240. package/src/review/recap.ts +129 -0
  241. package/src/review/referring.ts +6 -3
  242. package/src/review/reflection-object.ts +4 -3
  243. package/src/review/routes.ts +51 -47
  244. package/src/review/secret-route.ts +3 -2
  245. package/src/review/settle.ts +0 -6
  246. package/src/review/snooze.ts +5 -3
  247. package/src/review/speaker.ts +68 -0
  248. package/src/review/start-title.ts +19 -0
  249. package/src/review/store-parties.ts +28 -0
  250. package/src/review/store.ts +94 -59
  251. package/src/review/{wakes.ts → thread-events.ts} +92 -7
  252. package/src/review/thread-md.ts +35 -14
  253. package/src/review/thread-state.ts +804 -0
  254. package/src/review/threads.ts +29 -347
  255. package/src/review/traces.ts +104 -7
  256. package/src/review/trailer-item.ts +1 -1
  257. package/src/review/unit.ts +7 -9
  258. package/src/review/verdict-items.ts +12 -10
  259. package/src/review/view-layout.ts +25 -1
  260. package/src/review/watch-feed.ts +1 -2
  261. package/src/review/working-guards.ts +2 -3
  262. package/src/rules/untrack-generated.ts +1 -15
  263. package/src/secrets/copy.ts +4 -4
  264. package/src/secrets/lapse.ts +2 -1
  265. package/src/serve/hub-app/advisor-app.tsx +4 -4
  266. package/src/serve/hub-app/advisor-face.tsx +9 -3
  267. package/src/serve/hub-app/advisor-host.ts +27 -27
  268. package/src/serve/hub-app/advisors-model.ts +17 -8
  269. package/src/serve/hub-app/advisors-rights.tsx +1 -1
  270. package/src/serve/hub-app/advisors-st.ts +15 -14
  271. package/src/serve/hub-app/advisors-view.tsx +13 -11
  272. package/src/serve/hub-app/app-bridge.ts +23 -3
  273. package/src/serve/hub-app/asks-page.tsx +1 -1
  274. package/src/serve/hub-app/auto-text.tsx +71 -16
  275. package/src/serve/hub-app/check-view.tsx +0 -8
  276. package/src/serve/hub-app/controls.css +14 -3
  277. package/src/serve/hub-app/database-view.tsx +1 -2
  278. package/src/serve/hub-app/dock-st.ts +1 -1
  279. package/src/serve/hub-app/git-view.tsx +3 -1
  280. package/src/serve/hub-app/hub.css +12 -5
  281. package/src/serve/hub-app/icons.tsx +1 -1
  282. package/src/serve/hub-app/inbox-view.tsx +1 -2
  283. package/src/serve/hub-app/live-sources.ts +2 -2
  284. package/src/serve/hub-app/main-panel.tsx +2 -1
  285. package/src/serve/hub-app/panel-repo.ts +0 -9
  286. package/src/serve/hub-app/pic.tsx +29 -12
  287. package/src/serve/hub-app/polled.ts +16 -2
  288. package/src/serve/hub-app/recordings-st.ts +23 -2
  289. package/src/serve/hub-app/recordings-view.tsx +68 -10
  290. package/src/serve/hub-app/ref-pill.ts +1 -1
  291. package/src/serve/hub-app/repo-st.ts +1 -2
  292. package/src/serve/hub-app/review/advisor-add.tsx +1 -1
  293. package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
  294. package/src/serve/hub-app/review/draft-body.tsx +2 -2
  295. package/src/serve/hub-app/review/heard-line.tsx +1 -1
  296. package/src/serve/hub-app/review/instructions-view.tsx +1 -8
  297. package/src/serve/hub-app/review/kind-states.tsx +14 -9
  298. package/src/serve/hub-app/review/kit.tsx +4 -11
  299. package/src/serve/hub-app/review/lane-bar.tsx +3 -3
  300. package/src/serve/hub-app/review/lightbox.tsx +15 -11
  301. package/src/serve/hub-app/review/line-window.ts +4 -1
  302. package/src/serve/hub-app/review/live-bar-st.ts +2 -2
  303. package/src/serve/hub-app/review/live-view.tsx +57 -1
  304. package/src/serve/hub-app/review/object-panel.tsx +20 -8
  305. package/src/serve/hub-app/review/question-views.tsx +191 -53
  306. package/src/serve/hub-app/review/recap-bar.tsx +40 -0
  307. package/src/serve/hub-app/review/request-cell.tsx +48 -0
  308. package/src/serve/hub-app/review/review-cells.tsx +154 -96
  309. package/src/serve/hub-app/review/review-host.ts +8 -4
  310. package/src/serve/hub-app/review/review-kit.ts +17 -11
  311. package/src/serve/hub-app/review/review-list.tsx +30 -35
  312. package/src/serve/hub-app/review/review-st.ts +32 -42
  313. package/src/serve/hub-app/review/review-thread.tsx +139 -85
  314. package/src/serve/hub-app/review/review-views.tsx +127 -68
  315. package/src/serve/hub-app/review/share-lines.tsx +4 -4
  316. package/src/serve/hub-app/review/start-st.ts +2 -5
  317. package/src/serve/hub-app/review/superseded-runs.ts +4 -3
  318. package/src/serve/hub-app/review/thread-close.tsx +10 -7
  319. package/src/serve/hub-app/review/thread-st.ts +381 -202
  320. package/src/serve/hub-app/review/tone-bar.tsx +129 -0
  321. package/src/serve/hub-app/review/tones.ts +53 -0
  322. package/src/serve/hub-app/review/trailer-body.tsx +2 -2
  323. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  324. package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
  325. package/src/serve/hub-app/review.css +189 -106
  326. package/src/serve/hub-app/search-view.tsx +1 -1
  327. package/src/serve/hub-app/social/social-model.ts +0 -4
  328. package/src/serve/hub-app/source-acts.ts +2 -1
  329. package/src/serve/hub-app/stores/stores-page.tsx +2 -2
  330. package/src/serve/hub-app/terminal-sources.tsx +2 -1
  331. package/src/serve/hub-app/thread-row.tsx +3 -4
  332. package/src/serve/hub-app/tree-build.ts +0 -4
  333. package/src/serve/hub-app/urls-view.tsx +2 -1
  334. package/src/serve/hub-app/view-layout.css +13 -3
  335. package/src/serve/hub-app/wikis-view.tsx +5 -2
  336. package/src/serve/hub-runtime.ts +7 -37
  337. package/src/serve/project-gutter-route.ts +6 -2
  338. package/src/serve/read-thread.ts +20 -2
  339. package/src/serve/read-worker.ts +9 -1
  340. package/src/serve/record-pages.ts +46 -0
  341. package/src/serve/serve-hub.ts +2 -2
  342. package/src/serve/terminal-host.ts +1 -1
  343. package/src/serve/terminal-route.ts +1 -3
  344. package/src/serve/tracked-watch.ts +1 -3
  345. package/src/setup-house.ts +2 -2
  346. package/src/shipkit-files.ts +1 -1
  347. package/src/shipkit.ts +1 -6
  348. package/src/shot/client.ts +2 -1
  349. package/src/shot/film-box.ts +0 -20
  350. package/src/shot/on-place.ts +141 -0
  351. package/src/social/drafts.ts +1 -1
  352. package/src/social/kinds.ts +6 -29
  353. package/src/social/load.ts +2 -2
  354. package/src/social/post-object.ts +3 -2
  355. package/src/social/release-stage.ts +1 -1
  356. package/src/social/stage.ts +2 -2
  357. package/src/stores/model.ts +4 -0
  358. package/src/stores/routes.ts +11 -3
  359. package/src/suite/judge-suites.ts +58 -0
  360. package/src/suite/red-alone.ts +54 -18
  361. package/src/suite/runner-shapes.ts +2 -2
  362. package/src/suite/suite-cli.ts +67 -14
  363. package/src/suite/test-units.ts +2 -1
  364. package/src/urls/fill.ts +1 -1
  365. package/src/urls/places.ts +1 -2
  366. package/src/vault/vault-config.ts +2 -2
  367. package/src/vault/vault-init.ts +1 -5
  368. package/src/wiki/graph-page.ts +14 -2
  369. package/src/advisors/copy-truth.ts +0 -49
  370. package/src/advisors/door-child.ts +0 -112
  371. package/src/advisors/door-serve.ts +0 -52
  372. package/src/advisors/door.ts +0 -118
  373. package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
  374. package/src/checks/SK029-explicit-check-files.check.ts +0 -112
  375. package/src/checks/SK048-one-local-file.check.ts +0 -36
  376. package/src/core/config-rewrite.ts +0 -111
  377. package/src/core/daemon-port.ts +0 -10
  378. package/src/core/legacy-shapes.ts +0 -263
  379. package/src/core/migrate-layout.ts +0 -638
  380. package/src/core/port-check-cli.ts +0 -52
  381. package/src/core/port-check-file.ts +0 -295
  382. package/src/core/port-check-files.ts +0 -31
  383. package/src/gate/discover-legacy-checks.ts +0 -26
  384. package/src/home/home-move.ts +0 -527
  385. package/src/home/machine-fold.ts +0 -810
  386. package/src/hq/item-shapes.ts +0 -54
  387. package/src/hq/kinds/items-read.ts +0 -4
  388. package/src/media-store/backup/daemon.ts +0 -220
  389. package/src/media-store/backup/kept.ts +0 -241
  390. package/src/media-store/backup/prune.ts +0 -359
  391. package/src/media-store/backup/secret.ts +0 -88
  392. package/src/media-store/backup/ssh-space.ts +0 -202
  393. package/src/media-store/backup/watch.ts +0 -117
  394. package/src/review/band.ts +0 -182
  395. package/src/review/folders.ts +0 -216
  396. package/src/review/hook-ask.ts +0 -58
  397. package/src/review/role.ts +0 -48
  398. package/src/review/thread-fold.ts +0 -64
  399. package/src/review/wait.ts +0 -91
  400. package/src/rules/rule.ts +0 -43
  401. package/src/serve/hook-thread.ts +0 -37
  402. package/src/serve/hook-work.ts +0 -92
  403. package/src/serve/hook-worker.ts +0 -57
  404. package/src/serve/hub-app/review/dock.tsx +0 -147
  405. package/src/serve/hub-app/review/faces.tsx +0 -18
  406. package/src/serve/hub-app/review/item-verdict.tsx +0 -112
  407. package/src/serve/hub-app/review/review-board.tsx +0 -48
  408. /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
@@ -4,17 +4,19 @@
4
4
  import { existsSync, readFileSync } from 'node:fs'
5
5
  import { join } from 'node:path'
6
6
  import { detail, markIt, newsDetail, wordText, type Say } from './format.ts'
7
+ import { oncePerBurst } from './speaker.ts'
7
8
  import { mediaDir } from './store.ts'
8
9
  import { hookAnswer, type HookInput, type Unwatched } from './inbox-hook.ts'
9
- import { isOwnerWait, waitOf } from './wait.ts'
10
- import { byMachine, moveOf, openBrokenOf, stateOf, verdictOf, WORKING_FRESH_MS, type ReviewItem } from './model.ts'
11
- import { ageWords } from './band.ts'
12
- import { workingsOf } from './traces.ts'
13
- import { wakingUnread } from './wakes.ts'
10
+ import { byMachine, moveOf, stateOf, STATUS_LABEL, TONE_ASKS, verdictOf, WORKING_FRESH_MS, type ReviewItem } from './model.ts'
11
+ import { wakingUnread } from './thread-events.ts'
14
12
  import { relayLine, relayOf, resumableOf, resumeLine, type Me, type Parties } from './parties.ts'
15
- import { followedIds, holderOf, hookHears, hookWord, membersOf, ownAddressesOf, readNoAct, threadByItem, threadOfItem, threadsOf, turnOf, unansweredWord, unseen, type Thread } from './threads.ts'
13
+ import { followedIds, holderOf, hookHears, hookWord, membersOf, ownAddressesOf, threadByItem, threadOfItem, threadsOf, unseen, type Thread } from './threads.ts'
16
14
  import type { Handed } from '../agent-time/registry.ts'
17
15
  import { laneAskForMe, laneAskLine, laneAskOf, laneAskOwed, orchestratorOf } from './lane-ask.ts'
16
+ import { ageWords, isOwedWork, isOwnerWait, laneLives, threadState, type ThreadState } from './thread-state.ts'
17
+
18
+ /** an owed thread as the hook names it: its tone and what that tone asks (model.ts TONE_ASKS) */
19
+ const toneOf = (t: Thread): string => ((v) => `(${STATUS_LABEL[v]}: ${TONE_ASKS[v].replace('<id>', t.head.item.id)})`)(verdictOf(t.head)?.status ?? 'rework')
18
20
 
19
21
  /** one store as the inbox reads it: its repo by name, its root, whether the caller stands in it */
20
22
  export interface StoreRead {
@@ -40,7 +42,7 @@ export interface Selected {
40
42
  plain: ReviewItem[]
41
43
  owed: Thread[]
42
44
  news: ReviewItem[]
43
- /** his newest word an agent read with no act since (review/traces.ts readNoAct): still owed */
45
+ /** his newest word an agent read with no act since (the state's owed word, read): still owed */
44
46
  read: Thread[]
45
47
  }
46
48
 
@@ -52,7 +54,7 @@ export function selectInbox(s: StoreRead, keep: (x: ReviewItem, byItem: Readonly
52
54
  const news = unseen(s.items, s.say.to).filter(of)
53
55
  const followed = followedIds(s.items)
54
56
  // as a hook, the session a held thread's holder is (`mine`) owes the owner's words only: unseen (`seen` clears
55
- // them), or read with no act since (readNoAct: `working` clears them). One nobody hears is listed with `take`
57
+ // them), or read with no act since (the state's owes: `working` clears them). One nobody hears is listed with `take`
56
58
  const held = (x: ReviewItem): boolean => {
57
59
  const t = byItem.get(x.item.id)
58
60
  return o.hook === 'mine' && t !== undefined && holderOf(t) !== null
@@ -75,8 +77,10 @@ export function selectInbox(s: StoreRead, keep: (x: ReviewItem, byItem: Readonly
75
77
  out.push(n)
76
78
  }
77
79
  }
78
- const owed = threads.filter((t) => of(t.head) && !at.has(t.head.item.id) && t.head.item.origin.by === 'agent' && verdictOf(t.head)?.seen === true && stateOf(t.head, false).state === 'claimed')
79
- const read = threads.filter((t) => of(t.head) && !at.has(t.head.item.id) && readNoAct(t) !== null)
80
+ // a « fix » or a « no » read and not done, his word read with no act since: owed, by the thread's state
81
+ const owesOf = (t: Thread) => threadState(t).owes
82
+ const owed = threads.filter((t) => of(t.head) && !at.has(t.head.item.id) && owesOf(t).some((o) => 'seen' in o && isOwedWork(o.kind) && o.seen))
83
+ const read = threads.filter((t) => of(t.head) && !at.has(t.head.item.id) && owesOf(t).some((o) => o.kind === 'word' && o.read !== null))
80
84
  return { threads: out, plain: o.all ? [] : news.filter(plainApproval), owed, news, read }
81
85
  }
82
86
 
@@ -97,12 +101,11 @@ const elsewhere = (s: StoreRead, bin: string): string => `in ${s.repo} (${s.root
97
101
  /** a thread whose newest word of his an agent read and nobody acted on since: owed like an unseen one */
98
102
  function readLine(s: StoreRead, t: Thread, bin: string): string {
99
103
  const address = ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id
100
- const r = readNoAct(t)!
101
- return `thread ${address}: ${r.who} read ${wordText(r.word)} at ${r.at}, and nothing was done in the thread since: answer it there (${bin} thread reply ${address} "…"); work longer than this turn first says what it does (${bin} thread working ${address} "…"), which answers nothing`
104
+ const r = threadState(t).owes.find((o) => o.kind === 'word' && o.read !== null)
105
+ if (r?.kind !== 'word' || r.read === null) return `thread ${address}: his word was read, nothing done since`
106
+ return `thread ${address}: ${r.read.who} read ${wordText(r.word)} at ${r.read.at}, and nothing was done in the thread since: answer it there (${bin} thread reply ${address} "…"); work longer than this turn first says what it does (${bin} thread working ${address} "…"), which answers nothing`
102
107
  }
103
108
 
104
- /** a lane the registry knows live, or whose watch lives */
105
- const laneLives = (p: Parties, lane: string, session: string | undefined): boolean => p.lanes.some((l) => l.name === lane && (session === undefined || l.session === session) && (l.live || l.watch))
106
109
 
107
110
  /** the thread is `me`'s to close: a lane, the threads it holds; a session, those it holds itself or by a lane of it
108
111
  * that ended (a live lane's thread is that lane's) */
@@ -114,22 +117,23 @@ export function holdsToClose(t: Thread, me: Me, p: Parties): boolean {
114
117
  return h.lane === undefined || !laneLives(p, h.lane, h.session)
115
118
  }
116
119
 
117
- /** why the agents still owe a thread on their move, each reason in plain words: his word with no answer since (a
118
- * `working` is none), a « broken » line still open and who wrote it, a `working` past its time. Empty on any other
119
- * turn; one plain line when none of these says why */
120
- export function heldOwedOf(t: Thread, p: Parties, now = new Date()): string[] {
121
- if (turnOf(t, now) !== 'agents') return []
120
+ /** why the agents still owe a thread on their move, each reason in plain words, from its state's owes
121
+ * (review/thread-state.ts): the owner's word with no answer since; a « broken » line still open and
122
+ * who wrote it; a `working` past its time. Empty on any other turn; one plain line when none of these says why */
123
+ export function heldOwedOf(s: ThreadState, p: Parties, now = new Date()): string[] {
124
+ if (s.turn !== 'agents') return []
122
125
  const out: string[] = []
123
- const w = unansweredWord(t)
124
- if (w !== null) out.push(`${wordText(w)} has no answer since (a working, a read, a take answer nothing)`)
125
- const broken = membersOf(t).flatMap((x) => openBrokenOf(x)).at(-1)
126
- if (broken !== undefined) {
127
- const by = byMachine(broken) ? `the machine (${broken.who})` : broken.who !== 'agent' && !laneLives(p, broken.who, broken.session) ? `${broken.who}, which ended` : broken.who === 'agent' ? 'the session' : broken.who
128
- out.push(`a « broken » line of ${by} is still open since ${broken.at.slice(0, 16).replace('T', ' ')} UTC: « ${(broken.text ?? '').replace(/\s+/g, ' ').trim().slice(0, 140)} »: close it with a fixed update once it is`)
126
+ if (s.unanswered !== null) out.push(`${wordText(s.unanswered)} has no answer since (a working, a read, a take answer nothing)`)
127
+ for (const o of s.owes) {
128
+ if (o.kind === 'in-work' && o.broken !== null) {
129
+ const b = o.broken
130
+ const by = byMachine(b) ? `the machine (${b.who})` : b.who !== 'agent' && !laneLives(p, b.who, b.session) ? `${b.who}, which ended` : b.who === 'agent' ? 'the session' : b.who
131
+ out.push(`a « broken » line of ${by} is still open since ${b.at.slice(0, 16).replace('T', ' ')} UTC: « ${(b.text ?? '').replace(/\s+/g, ' ').trim().slice(0, 140)} »: close it with a fixed update once it is`)
132
+ }
129
133
  }
130
- const last = workingsOf(t, now).last
131
- if (last !== null && now.getTime() - Date.parse(last.at) > WORKING_FRESH_MS) out.push(`the working line « ${last.note} » is ${ageWords(now.getTime() - Date.parse(last.at))} old, nothing since`)
132
- return out.length > 0 ? out : ['the agents\' move, none of the above says why: read it whole with sk thread show']
134
+ const w = s.working
135
+ if (w != null && now.getTime() - Date.parse(w.at) > WORKING_FRESH_MS) out.push(`the working line « ${w.note} » is ${ageWords(now.getTime() - Date.parse(w.at))} old, nothing since`)
136
+ return out.length > 0 ? out : ["the agents' move, none of the above says why: read it whole with sk thread show"]
133
137
  }
134
138
 
135
139
  /** the threads of store `s` that `me` holds to close and still owes, past those already printed (`shown`, by head), each
@@ -138,7 +142,7 @@ export function heldOwedLines(s: StoreRead, me: Me, p: Parties, shown: ReadonlyS
138
142
  const out: string[] = []
139
143
  for (const t of threadsOf(s.items, s.say.spec)) {
140
144
  if (shown.has(t.head.item.id) || !holdsToClose(t, me, p)) continue
141
- const why = heldOwedOf(t, p, now)
145
+ const why = heldOwedOf(threadState(t, now), p, now)
142
146
  if (why.length === 0) continue
143
147
  out.push(`thread ${ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id} "${t.head.item.title}":\n${why.map((w) => ` ${w}`).join('\n')}`)
144
148
  }
@@ -190,8 +194,8 @@ export function unwatchedOf(s: StoreRead, me: Me, p: Parties, watched: boolean,
190
194
  if (me.session === null || me.lane !== null || watched) return null
191
195
  const byItem = threadByItem(threadsOf(s.items, s.say.spec))
192
196
  const mine = [...new Set(byItem.values())].filter((t) => hookHears(me, t.head, byItem, p, s.repo) === 'mine' && holderOf(t) !== null)
193
- const open = mine.filter((t) => waitOf(t, now) !== 'done')
194
- return { repo: s.repo, open: open.length, his: open.filter((t) => isOwnerWait(waitOf(t, now))).map((t) => ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id) }
197
+ const open = mine.filter((t) => threadState(t, now).turn !== 'done')
198
+ return { repo: s.repo, open: open.length, his: open.filter((t) => isOwnerWait(threadState(t, now).wait)).map((t) => ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id) }
195
199
  }
196
200
 
197
201
  /** the threads of store `s` that hold a word of the owner nobody hears, as `me` reads them: unseen ones (`threads`),
@@ -243,7 +247,7 @@ export function hookReply(o: HookIn): string | null {
243
247
  const live = relayOf(holderOf(t), o.parties)
244
248
  mine.push(live !== null && live.lane !== o.me.lane ? `${readLine(s, t, bin)}\n ${relayLine(live, ownAddressesOf(t, s.say.spec)[0] ?? t.head.item.id, bin)}` : readLine(s, t, bin))
245
249
  }
246
- owed.push(...heard.owed.map((t) => (s.here ? t.head.item.id : `${t.head.item.id} (in ${s.repo})`)))
250
+ owed.push(...heard.owed.map((t) => `${t.head.item.id} ${toneOf(t)}${s.here ? '' : ` (in ${s.repo})`}`))
247
251
  plain.push(...heard.plain.map((x) => x.item.id))
248
252
  if (!anyone) {
249
253
  const shown = new Set([...heard.threads.flatMap((g) => (g.t ? [g.t.head.item.id] : [])), ...heard.read.map((t) => t.head.item.id), ...heard.owed.map((t) => t.head.item.id)])
@@ -266,7 +270,9 @@ export function hookReply(o: HookIn): string | null {
266
270
  const nobodyText = [...nobody, ...(nobodyMore > 0 ? [`${nobodyMore} more: ${bin} thread inbox lists them`] : [])].join('\n').trim()
267
271
  const watchedIn = o.watchedIn ?? (() => o.parties.sessions.some((s) => s.id === o.me.session && s.watch))
268
272
  const unwatched = anyone ? [] : o.stores.flatMap((s) => unwatchedOf(s, o.me, o.parties, watchedIn(s.dir)) ?? [])
269
- return hookAnswer(o.input, mine.join('\n').trim(), owed, bin, nobodyText, lanes.join('\n').trim(), { ...(o.handed ? { handed: o.handed } : {}), held: held.join('\n').trim(), unwatched, ...(o.laneWatches ? { laneWatches: o.laneWatches } : {}), ...(o.role ? { role: o.role } : {}) })
273
+ // the prompt's whole context is one burst: an advisor's note once in it (review/speaker.ts)
274
+ const noted = oncePerBurst()
275
+ return hookAnswer(o.input, noted(mine.join('\n').trim()), owed, bin, noted(nobodyText), lanes.join('\n').trim(), { ...(o.handed ? { handed: o.handed } : {}), held: held.join('\n').trim(), unwatched, ...(o.laneWatches ? { laneWatches: o.laneWatches } : {}), ...(o.role ? { role: o.role } : {}) })
270
276
  }
271
277
 
272
278
  // the events his answers reach a session on: a posting verb warns when one lacks. SessionStart, which only tells a
@@ -190,3 +190,15 @@ export function commandForHim(prose: string): string | null {
190
190
 
191
191
  /** a step's prose holds a link he clicks: a markdown link or an autolink */
192
192
  export const hasLink = (prose: string): boolean => /\[[^\]\n]*\]\([^)\s]+\)|<https?:\/\/[^>\s]+>/.test(prose.replace(/```[\s\S]*?```/g, ' '))
193
+
194
+ /** the words by which a typed answer asks him to pick lettered options, null when it does not: a text question that
195
+ * stands in for a question with a row per thing (« your letter per word », « Arrivée B, Adieu A », « A, B or C ») */
196
+ export function lettersAsText(words: string): string | null {
197
+ const said = /\b(?:one\s+)?letters?\s+(?:per|for each|for every|of each)\b[^.,?!\n(]*/i.exec(words)?.[0]
198
+ if (said !== undefined) return said.trim()
199
+ const list = /\b[A-H]\s*[,/]\s*[A-H](?:\s*(?:,|\/|or)\s*[A-H])*\b/.exec(words)?.[0]
200
+ if (list !== undefined) return list
201
+ // a thing and its letter, twice or more: « Arrivée B, Adieu A »
202
+ const pairs = words.match(/\p{L}{2,}\s+[A-H](?=\s*[,;)·…]|\s*$)/gu) ?? []
203
+ return pairs.length >= 2 ? pairs.slice(0, 2).join(', ') : null
204
+ }
@@ -15,7 +15,6 @@ export type StepChoice = { options: string[]; pick?: number }
15
15
  /** a field he fills inside a step, written as a fenced block whose info string names its widget: ```secret <name>
16
16
  * [login]```, ```url```, ```text```; its body the one line hint. A secret goes to the vault through the secret field */
17
17
  export type StepField = { kind: 'secret'; name: string; login?: true; hint: string } | { kind: 'url' | 'text'; hint: string }
18
- export const FIELD_KINDS = ['secret', 'url', 'text'] as const
19
18
  const FIELD_FENCE = /^\s{0,3}(`{3,}|~{3,})\s*(secret|url|text)(?:\s+(.*?))?\s*$/
20
19
 
21
20
  /** a step's fields and its markdown split around them */
@@ -49,9 +49,6 @@ create table if not exists review_replaced (repo text not null, id text not null
49
49
  let bound: Database | null = null
50
50
  /** this process's own connection, a file, with the inode it opened: a file deleted or replaced since is opened again */
51
51
  const opened = new Map<string, { db: Database; ino: number }>()
52
- /** the daemon file's own path as these connections found it: a fold puts a tombstone there, a way back a file, each a
53
- * new inode; null before the first open */
54
- let walked: number | null = null
55
52
 
56
53
  /** `fn` with the copy read and written through `db`: the connection whose transaction is open (the feed's landing) */
57
54
  export function withItemsDb<T>(db: Database, fn: () => T): T {
@@ -79,16 +76,7 @@ export function itemsDb(): Database {
79
76
  if (bound != null) return bound
80
77
  // the daemon's file and its migration (hq/daemon-db.ts): loaded at the first read of a thread
81
78
  const { daemonDbPath, openDaemonDb } = require('../hq/daemon-db.ts') as typeof import('../hq/daemon-db.ts')
82
- // a walk of the daemon file moved the store since these connections opened: each opens again where it is now,
83
- // through the open that refuses while a walk runs, never a stale file nor tables a fold has not filled yet
84
- const { forgetStoreHomes, oldStorePath } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
85
- const ino = lstatSync(oldStorePath('daemon file'), { throwIfNoEntry: false })?.ino ?? 0
86
- if (walked != null && ino !== walked) {
87
- closeItemsDb()
88
- forgetStoreHomes()
89
- }
90
- walked = ino
91
- let path = daemonDbPath()
79
+ const path = daemonDbPath()
92
80
  const held = opened.get(path)
93
81
  if (held != null) {
94
82
  if (lstatSync(path, { throwIfNoEntry: false })?.ino === held.ino) return held.db
@@ -99,24 +87,14 @@ export function itemsDb(): Database {
99
87
  }
100
88
  opened.delete(path)
101
89
  }
102
- let db = openDaemonDb(path)
90
+ const db = openDaemonDb(path)
103
91
  if (db == null) {
104
- const { foldRefusal } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
105
- const why = foldRefusal('daemon file', path)
92
+ const { storeRefusal } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
93
+ const why = storeRefusal('daemon file', path)
106
94
  if (why != null) throw itemsRefused(why)
107
- // the open was refused by a walk that ended since: once more, where the store is now
108
- forgetStoreHomes()
109
- path = daemonDbPath()
110
- db = openDaemonDb(path)
111
- if (db == null) {
112
- const again = foldRefusal('daemon file', path)
113
- if (again != null) throw itemsRefused(again)
114
- throw new Error(`the daemon's database ${path} does not open: every thread of this machine lives there`)
115
- }
95
+ throw new Error(`the daemon's database ${path} does not open: every thread of this machine lives there`)
116
96
  }
117
97
  opened.set(path, { db, ino: lstatSync(path, { throwIfNoEntry: false })?.ino ?? 0 })
118
- // no file before this open: the file it made is the one these connections found, never a walk
119
- if (ino === 0) walked = lstatSync(oldStorePath('daemon file'), { throwIfNoEntry: false })?.ino ?? 0
120
98
  return db
121
99
  }
122
100
 
@@ -127,7 +105,7 @@ const itemsRefused = (why: string): Error => {
127
105
  return refused
128
106
  }
129
107
 
130
- /** `fn` whose error a walk of the daemon file caused is told as the walk's line (walkedUnder) */
108
+ /** `fn` whose error a repair of the daemon file caused is told as the repair's line (walkedUnder) */
131
109
  export const walking =
132
110
  <A extends unknown[], R>(fn: (...a: A) => R) =>
133
111
  (...a: A): R => {
@@ -138,27 +116,19 @@ export const walking =
138
116
  }
139
117
  }
140
118
 
141
- /** an error of a held connection that a walk of the daemon file moved the store from under (its tables renamed away,
142
- * its file a tombstone): the walk's one line, a wait, and the connections closed so the next call opens where the
143
- * store is now. Any other error as it is */
119
+ /** an error of a held connection that a repair of the daemon file cut its tables from under: the repair's one line, a
120
+ * wait, and the connections closed so the next call opens them again. Any other error as it is */
144
121
  export function walkedUnder(e: unknown): unknown {
145
122
  if (!(e instanceof Error) || e.name === 'StoreRefused' || !/no such table: (\w+\.)?review_|disk I\/O error/.test(e.message)) return e
146
- const { foldRefusal, forgetStoreHomes, isTombstone, oldStorePath, waitRefused } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
123
+ const { storeRefusal } = require('../core/machine-db.ts') as typeof import('../core/machine-db.ts')
147
124
  const { daemonDbPath } = require('../hq/daemon-db.ts') as typeof import('../hq/daemon-db.ts')
148
- const old = oldStorePath('daemon file')
149
- const moved = (lstatSync(old, { throwIfNoEntry: false })?.ino ?? 0) !== walked
150
- const why = foldRefusal('daemon file', daemonDbPath())
151
- if (why == null && !moved) return e
125
+ const why = storeRefusal('daemon file', daemonDbPath())
126
+ if (why == null) return e
152
127
  closeItemsDb()
153
- forgetStoreHomes()
154
- walked = null
155
- if (why != null) return itemsRefused(why)
156
- const ended = waitRefused(`a ${isTombstone(old) ? 'fold' : 'way back'} of the daemon file moved the threads as this ran: run it again`)
157
- ended.message = `the threads do not read now: ${ended.message}`
158
- return ended
128
+ return itemsRefused(why)
159
129
  }
160
130
 
161
- /** closes this process's connections to the copy (a fold of this process, a test that moves it) */
131
+ /** closes this process's connections to the copy (a test that moves it) */
162
132
  export function closeItemsDb(): void {
163
133
  for (const { db } of opened.values()) {
164
134
  try {
@@ -8,14 +8,14 @@
8
8
  import { Database } from 'bun:sqlite'
9
9
  import { createHash } from 'node:crypto'
10
10
  import { lstatSync } from 'node:fs'
11
- import type { ThreadsWhere } from '../hq/shapes-words.ts'
11
+ import type { ThreadsWhere } from '../hq/threads-words.ts'
12
12
 
13
13
  /** the machine db switch: on, the threads of the repos the hq holds are read and written in the hq's file */
14
14
  export const HQ_THREADS = 'hq-threads'
15
15
  /** the machine db word of the repos the threads job holds (hq/thread-sync.ts heldRepos writes it), by their keys:
16
16
  * the repos whose threads are read here, and what the look of places sends the facts of (orchestrator/places-look.ts) */
17
17
  export const HELD_REPOS = 'hq-held-repos'
18
- /** the first version of the hq's file that holds the store's tables (hq/item-shapes.ts) */
18
+ /** the first version of the hq's file that holds the store's tables (hq/item-fill.ts) */
19
19
  export const HQ_ITEMS_FROM = 20
20
20
 
21
21
  /** the hq's file for one repo: its connection, the node of this daemon in it, and why it is not written (null when
@@ -8,7 +8,7 @@ import { existsSync } from 'node:fs'
8
8
  import { join } from 'node:path'
9
9
  import { metHeldOnLoop, neverWaitsHere, wroteOnLoop } from '../core/on-loop.ts'
10
10
  import { hqItemsOf, itemsDb, GONE, moveFolder, nextSeq, repoIdOf, repoTop, spoolOf, walking } from './item-db.ts'
11
- import { itemProblems, messageProblems, MESSAGE_RE, withoutDeleted, type Item, type Message, type ReviewItem } from './model.ts'
11
+ import { itemProblems, messageProblems, MESSAGE_RE, upgradeMessage, withoutDeleted, type Item, type Message, type ReviewItem } from './model.ts'
12
12
  import { revOf } from './rev.ts'
13
13
  import type { ReadAll } from './store.ts'
14
14
 
@@ -205,7 +205,8 @@ function readItem(head: string, msgs: readonly { id: string; body: string }[]):
205
205
  const m = JSON.parse(r.body) as unknown
206
206
  const p = messageProblems(m, r.id)
207
207
  if (p.length > 0) throw new Error(`thread/${r.id}.json: ${p.join('; ')}`)
208
- return m as Message
208
+ // an old status word reads as the tone it meant (model.ts LEGACY_STATUS); the row keeps what it holds
209
+ return upgradeMessage(m as Message)
209
210
  })
210
211
  // a message its author deleted, and the delete, leave every reader's thread here; the rows keep both
211
212
  return { item: item as Item, thread: withoutDeleted(thread) }
@@ -310,17 +311,6 @@ function rowsSweepGoneHere(dir: string, now: number, keepMs: number): number {
310
311
  return n
311
312
  }
312
313
 
313
- /** an item set aside in a folder of the old layout, kept as a row of the items gone under the same entry; false when
314
- * one is there */
315
- function rowsKeepGoneHere(dir: string, g: { entry: string; id: string; created: string; at: number; head: unknown; thread: unknown[] }): boolean {
316
- const { repo, db } = rowsOf(dir, { write: true })
317
- return db.transaction(() => {
318
- if (db.query('select 1 from review_gone where repo = ? and entry = ?').get(repo, g.entry) != null) return false
319
- db.query('insert into review_gone (repo, entry, id, created, seq, at, head, thread) values (?, ?, ?, ?, ?, ?, ?, ?)').run(repo, g.entry, g.id, g.created, nextSeq(db), g.at, JSON.stringify(g.head), JSON.stringify(g.thread))
320
- return true
321
- }).immediate()
322
- }
323
-
324
314
  /** the stamp of a store folder's rows: 'none' while its repo holds no item and no item gone */
325
315
  function rowsStampHere(dir: string): string {
326
316
  const { repo, db } = rowsOf(dir)
@@ -334,5 +324,4 @@ export const rowsGone = walking(rowsGoneHere)
334
324
  export const rowsGoneCreated = walking(rowsGoneCreatedHere)
335
325
  export const rowsGoneUse = walking(rowsGoneUseHere)
336
326
  export const rowsSweepGone = walking(rowsSweepGoneHere)
337
- export const rowsKeepGone = walking(rowsKeepGoneHere)
338
327
  export const rowsStamp = walking(rowsStampHere)
@@ -11,7 +11,7 @@ export const END = '<!-- /shipkit:thread-kinds -->'
11
11
 
12
12
  /** what each answer kind of a question draws for him and the `sk thread ask` flag that asks it, null while no flag does */
13
13
  export const ANSWER_WIDGETS: Record<AnswerKind, { shows: string; flag: string | null }> = {
14
- choice: { shows: 'the options side by side, each its media over one button, your pick a pill', flag: '--option "<label>=<file>" … --pick <n>' },
14
+ choice: { shows: 'the options side by side, each its media over one button, your pick a pill; several things each with candidates: one question, a row per thing (each set after its own `--row "<thing>"`), he clicks one a row', flag: '--option "<label>=<file>" … --pick <n>' },
15
15
  checklist: { shows: 'a line a step, he ticks each over days', flag: '--checklist "<step>" …' },
16
16
  confirm: { shows: 'one step in the real world, he answers « done »', flag: '--confirm' },
17
17
  text: { shows: 'a value he types', flag: '--text' },
@@ -62,6 +62,8 @@ export function renderCatalog(kinds: Record<string, HouseKind> = HOUSE_KINDS): s
62
62
  lines.set(words, [...(lines.get(words) ?? []), t === 'code' ? 'code[:<lang>]' : t])
63
63
  }
64
64
  for (const [words, ts] of lines) out.push(`- ${ts.map((t) => `\`${t}\``).join(', ')}: ${words}`)
65
+ out.push('', "### A recap of a long thread, on the owner's ask: `sk thread recap <address> --body <file>`", '')
66
+ out.push(`- \`recap\` ${MESSAGE_TYPES.recap.shows}; \`--offer\` asks him first, past about 15 KB of \`show --md\``)
65
67
  return out.join('\n')
66
68
  }
67
69
 
@@ -211,16 +211,26 @@ export const HOUSE_KINDS: Record<string, HouseKind> = {
211
211
  actions: {
212
212
  accept: { label: 'accept', icon: '✓', what: 'it goes to the owner of the rule it proposes: the agent that wrote it hands it over' },
213
213
  rework: { label: 'ask to rework', icon: '↻', words: true, what: 'your words go to the agent that wrote it: it rewrites the reflection and says so here' },
214
- discard: { label: 'discard', icon: '✕', what: 'the agent deletes its file: its card folds' },
214
+ discard: { label: 'discard', icon: '✕', no: true, what: 'the agent deletes its file: its card folds' },
215
215
  },
216
216
  },
217
- // merged into talk: an old `topic:<slug>` reads as `talk:<slug>` (review/model.ts canonicalAddress)
218
- topic: {
219
- label: 'topics',
220
- icon: 'M4 4.5h12v8.5H9l-4 3v-3H4zM7 8h6M7 10.5h4',
221
- color: 'plum',
222
- shows: 'a retired conversation in words, kept for its old items: its address reads as talk:',
223
- retired: 'merged into talk: the same thread answers as talk:<key>',
217
+ // a command the auto mode classifier refused, read from its record (review/blocked-object.ts): the daemon's
218
+ // transcript pass opens it, the refused session holds it, and the owner's click alone writes the rule
219
+ blocked: {
220
+ label: 'blocked commands',
221
+ icon: 'M10 2.5a7.5 7.5 0 1 0 0 15a7.5 7.5 0 1 0 0-15M4.7 4.7l10.6 10.6',
222
+ color: 'purple',
223
+ address: '<repo>/<hash of the command>',
224
+ shows: 'a command the auto mode classifier refused, opened by the machine: the command, the session and its lane, the reason, the narrowest allow rule (orange when it publishes or deletes); he allows it, allows his edit of the rule, or refuses, and the refused session hears it',
225
+ example: 'sk thread show blocked:<repo>/<hash>',
226
+ whole: true,
227
+ // its thread waits on him until he answers the card (review/holds-sync.ts reads its record)
228
+ holdsOpen: { until: 'the owner answers its card', move: 'owner' },
229
+ actions: {
230
+ allow: { label: 'allow', icon: '✅', what: "writes the rule shown into the repo's .claude/settings.json; the refused session hears « allowed », runs it once" },
231
+ edit: { label: 'allow the edited rule', icon: '✏️', words: true, fill: 'Rule', what: 'the rule in the reply box: edit it, send, and your rule is the one written' },
232
+ refuse: { label: 'refuse', icon: '✕', no: true, what:'writes nothing; the refused session hears « refused by the owner: do not ask again »' },
233
+ },
224
234
  },
225
235
  }
226
236
 
@@ -73,6 +73,9 @@ export function liveOpenHref(live: ViewLive, origin: string): string {
73
73
  }
74
74
  }
75
75
 
76
+ /** the hub's own tab that frames a page full window, its bar over it (live-bar.tsx LiveTab) */
77
+ export const liveTabHref = (url: string): string => `/live?url=${encodeURIComponent(url)}`
78
+
76
79
  /** what a live view draws now: the frame over its shot while it loads, the shot alone with why */
77
80
  export type LiveFace = { draw: 'frame'; loading: boolean } | { draw: 'shot'; why: string }
78
81
 
@@ -58,7 +58,7 @@ export const reviewMedia: MediaKind = {
58
58
  for (const e of ix.entries) {
59
59
  const at = Date.parse(e.row.updated)
60
60
  for (const x of membersOf(e.t)) {
61
- if (e.row.active) pinned.add(x.item.id)
61
+ if (e.row.state.active) pinned.add(x.item.id)
62
62
  used.set(x.item.id, Math.max(used.get(x.item.id) ?? 0, at))
63
63
  }
64
64
  }
@@ -80,8 +80,7 @@ export function resolveMentions(text: string, candidates: readonly MentionCandid
80
80
  const to: Mention[] = []
81
81
  const bad: string[] = []
82
82
  for (const name of mentionedNames(text)) {
83
- // `@orchestrator`, the old name of `@default`, still names it
84
- const want = name.toLowerCase() === 'orchestrator' ? 'default' : name.toLowerCase()
83
+ const want = name.toLowerCase()
85
84
  const c = candidates.find((x) => x.name.toLowerCase() === want)
86
85
  if (c === undefined) bad.push(`@${name}: nobody by that name here`)
87
86
  else if (c.refused !== undefined) bad.push(c.refused)