rvlib-shipkit 2.31.0 → 2.32.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 (384) hide show
  1. package/CHANGELOG.md +31 -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 +98 -73
  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 +26 -198
  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 +25 -23
  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 +92 -182
  37. package/src/advisors/tunnel.ts +6 -5
  38. package/src/advisors/users-listen.ts +92 -0
  39. package/src/advisors/users-router.ts +257 -85
  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_Checks.ts +0 -14
  67. package/src/cli/cmd_Db.ts +3 -82
  68. package/src/cli/cmd_Home.ts +4 -32
  69. package/src/cli/cmd_Hq.ts +0 -17
  70. package/src/cli/cmd_Releases.ts +57 -4
  71. package/src/cli/cmd_Review.ts +333 -354
  72. package/src/cli/cmd_SocialDrafts.ts +6 -13
  73. package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
  74. package/src/cli/cmd_Time.ts +1 -1
  75. package/src/cli/cmd_Trailer.ts +1 -1
  76. package/src/cli/inbox-hook-run.ts +5 -23
  77. package/src/cli/registry-heads.ts +5 -55
  78. package/src/cli/registry.ts +1 -5
  79. package/src/cli/review-here.ts +1 -1
  80. package/src/cli.ts +2 -2
  81. package/src/collections/collection-types.ts +1 -1
  82. package/src/collections/review.ts +5 -4
  83. package/src/core/agent-allow-policy.ts +32 -2
  84. package/src/core/agent-env.ts +8 -0
  85. package/src/core/allow-rows.ts +74 -0
  86. package/src/core/check-file-names.ts +19 -106
  87. package/src/core/footprint.ts +17 -13
  88. package/src/core/identities-root.ts +1 -4
  89. package/src/core/layout.ts +1 -2
  90. package/src/core/machine-db.ts +33 -208
  91. package/src/core/machine-layout.ts +14 -127
  92. package/src/core/mask-source.ts +60 -0
  93. package/src/core/memory-watch.ts +17 -14
  94. package/src/core/motherhome.ts +8 -35
  95. package/src/core/one-way-in-policy.ts +0 -3
  96. package/src/core/repo-walk.ts +0 -9
  97. package/src/core/retention.ts +1 -9
  98. package/src/core/retired-checks.ts +2 -0
  99. package/src/core/tmux-policy.ts +1 -1
  100. package/src/core/tree-watch.ts +2 -2
  101. package/src/core/when.ts +7 -45
  102. package/src/gate/discover-checks.ts +42 -32
  103. package/src/gate/gate-checks.ts +21 -131
  104. package/src/gate/pre-commit-discovery.ts +16 -25
  105. package/src/gate/run-check.ts +0 -4
  106. package/src/gate/run-fix.ts +5 -17
  107. package/src/gate/run-fixers.ts +6 -42
  108. package/src/home/app-sign.ts +2 -2
  109. package/src/home/backup-status.ts +52 -92
  110. package/src/home/backup-verdict.ts +2 -2
  111. package/src/home/daemon-jobs.ts +51 -95
  112. package/src/home/database-words.ts +1 -2
  113. package/src/home/databases.ts +9 -25
  114. package/src/home/home-launchd.ts +0 -6
  115. package/src/home/home-paths.ts +8 -4
  116. package/src/home/home-routes.ts +3 -10
  117. package/src/home/home-state.ts +2 -14
  118. package/src/home/inbox-shape.ts +14 -15
  119. package/src/home/inbox.ts +1 -1
  120. package/src/home/machine-repair.ts +102 -103
  121. package/src/home/resume.ts +1 -15
  122. package/src/home/run-daemon.ts +4 -11
  123. package/src/home/space-page.ts +3 -2
  124. package/src/home/supervise.ts +3 -7
  125. package/src/hooks/hook-config.ts +6 -7
  126. package/src/hooks/leak-guard.ts +1 -1
  127. package/src/hooks/run-hooks.ts +0 -5
  128. package/src/hq/daemon-db.ts +8 -8
  129. package/src/hq/door.ts +3 -16
  130. package/src/hq/hq-db.ts +4 -3
  131. package/src/hq/hq-local.ts +1 -2
  132. package/src/hq/hq-store.ts +0 -15
  133. package/src/hq/item-direct.ts +8 -10
  134. package/src/hq/item-fill.ts +37 -0
  135. package/src/hq/kinds/item-gone.ts +7 -10
  136. package/src/hq/kinds/item-msg.ts +12 -18
  137. package/src/hq/kinds/item.ts +13 -19
  138. package/src/hq/kinds/report.ts +3 -4
  139. package/src/hq/owner-switch.ts +3 -3
  140. package/src/hq/report.ts +5 -9
  141. package/src/hq/switch.ts +2 -11
  142. package/src/hq/thread-sync.ts +5 -17
  143. package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
  144. package/src/http/owner-word.ts +1 -1
  145. package/src/identities/machine.ts +16 -0
  146. package/src/init-repo.ts +0 -1
  147. package/src/ledger/check-stats.ts +6 -5
  148. package/src/ledger/db.ts +2 -4
  149. package/src/ledger/record-kept.ts +117 -48
  150. package/src/ledger/run-log.ts +21 -2
  151. package/src/ledger/slow-tests.ts +96 -0
  152. package/src/ledger/store.ts +3 -86
  153. package/src/ledger/suite-log.ts +8 -2
  154. package/src/media-store/backup/facts.ts +3 -37
  155. package/src/media-store/backup/keys.ts +1 -8
  156. package/src/media-store/backup/manifest.ts +6 -67
  157. package/src/media-store/backup/restore.ts +4 -13
  158. package/src/media-store/backup/retention.ts +13 -1
  159. package/src/media-store/backup/run.ts +6 -267
  160. package/src/media-store/backup/snapshot.ts +2 -38
  161. package/src/media-store/backup/sources.ts +3 -113
  162. package/src/media-store/backup/target-send.ts +5 -29
  163. package/src/media-store/db.ts +8 -7
  164. package/src/media-store/forget-one.ts +1 -1
  165. package/src/media-store/forget.ts +1 -80
  166. package/src/orchestrator/guards.ts +0 -1
  167. package/src/orchestrator/presence.ts +2 -2
  168. package/src/orchestrator/routes.ts +1 -1
  169. package/src/orchestrator/started.ts +0 -9
  170. package/src/orchestrator/talk-key.ts +3 -4
  171. package/src/orchestrator/unheard.ts +1 -1
  172. package/src/recordings/edit.ts +3 -3
  173. package/src/recordings/marks-draw.ts +17 -6
  174. package/src/recordings/marks.ts +120 -9
  175. package/src/reflections/reflections-queue.ts +3 -10
  176. package/src/release/notes.ts +1 -1
  177. package/src/release/public-clean.ts +66 -6
  178. package/src/release/run-bump.ts +11 -0
  179. package/src/release/run-release.ts +4 -0
  180. package/src/releases/from-thread.ts +3 -3
  181. package/src/releases/model.ts +186 -36
  182. package/src/releases/store.ts +13 -3
  183. package/src/releases/validate.ts +83 -0
  184. package/src/repo-config.ts +29 -64
  185. package/src/review/answer-kinds.ts +61 -4
  186. package/src/review/blocked-guard.ts +11 -0
  187. package/src/review/blocked-object.ts +298 -0
  188. package/src/review/cells.ts +116 -229
  189. package/src/review/close.ts +39 -1
  190. package/src/review/doc-save.ts +3 -2
  191. package/src/review/draft-item.ts +1 -1
  192. package/src/review/events.ts +3 -7
  193. package/src/review/expect.ts +23 -39
  194. package/src/review/format.ts +79 -46
  195. package/src/review/glyphs.ts +1 -0
  196. package/src/review/hand-over.ts +3 -3
  197. package/src/review/heard.ts +1 -1
  198. package/src/review/holds-sync.ts +2 -1
  199. package/src/review/inbox-hook.ts +2 -2
  200. package/src/review/inbox-read.ts +39 -33
  201. package/src/review/instruction-guards.ts +12 -0
  202. package/src/review/instructions.ts +0 -1
  203. package/src/review/item-db.ts +13 -43
  204. package/src/review/item-hq.ts +2 -2
  205. package/src/review/item-rows.ts +3 -14
  206. package/src/review/kind-catalog.ts +3 -1
  207. package/src/review/kinds.ts +18 -8
  208. package/src/review/live-view.ts +3 -0
  209. package/src/review/media-kind.ts +1 -1
  210. package/src/review/mentions.ts +1 -2
  211. package/src/review/model.ts +158 -114
  212. package/src/review/move.ts +149 -0
  213. package/src/review/need-threads.ts +3 -2
  214. package/src/review/object-card.ts +11 -0
  215. package/src/review/object-read.ts +6 -1
  216. package/src/review/one-block.ts +1 -1
  217. package/src/review/owner-read.ts +1 -1
  218. package/src/review/phone-push.ts +10 -9
  219. package/src/review/previews.ts +32 -4
  220. package/src/review/push.ts +2 -2
  221. package/src/review/recap.ts +129 -0
  222. package/src/review/referring.ts +6 -3
  223. package/src/review/reflection-object.ts +4 -3
  224. package/src/review/routes.ts +49 -19
  225. package/src/review/secret-route.ts +3 -2
  226. package/src/review/settle.ts +0 -6
  227. package/src/review/snooze.ts +5 -3
  228. package/src/review/speaker.ts +68 -0
  229. package/src/review/start-title.ts +19 -0
  230. package/src/review/store.ts +86 -59
  231. package/src/review/{wakes.ts → thread-events.ts} +92 -7
  232. package/src/review/thread-md.ts +35 -14
  233. package/src/review/thread-state.ts +798 -0
  234. package/src/review/threads.ts +29 -347
  235. package/src/review/traces.ts +104 -7
  236. package/src/review/trailer-item.ts +1 -1
  237. package/src/review/unit.ts +7 -9
  238. package/src/review/verdict-items.ts +12 -10
  239. package/src/review/view-layout.ts +25 -1
  240. package/src/review/watch-feed.ts +1 -2
  241. package/src/review/working-guards.ts +2 -3
  242. package/src/rules/untrack-generated.ts +1 -15
  243. package/src/secrets/lapse.ts +2 -1
  244. package/src/serve/hub-app/advisor-app.tsx +4 -4
  245. package/src/serve/hub-app/advisor-face.tsx +9 -3
  246. package/src/serve/hub-app/advisor-host.ts +27 -27
  247. package/src/serve/hub-app/advisors-model.ts +17 -8
  248. package/src/serve/hub-app/advisors-rights.tsx +1 -1
  249. package/src/serve/hub-app/advisors-st.ts +15 -14
  250. package/src/serve/hub-app/advisors-view.tsx +13 -11
  251. package/src/serve/hub-app/app-bridge.ts +23 -3
  252. package/src/serve/hub-app/asks-page.tsx +1 -1
  253. package/src/serve/hub-app/auto-text.tsx +71 -16
  254. package/src/serve/hub-app/check-view.tsx +0 -8
  255. package/src/serve/hub-app/controls.css +14 -3
  256. package/src/serve/hub-app/database-view.tsx +1 -2
  257. package/src/serve/hub-app/git-view.tsx +3 -1
  258. package/src/serve/hub-app/hub.css +12 -5
  259. package/src/serve/hub-app/icons.tsx +1 -1
  260. package/src/serve/hub-app/inbox-view.tsx +1 -2
  261. package/src/serve/hub-app/live-sources.ts +2 -2
  262. package/src/serve/hub-app/main-panel.tsx +2 -1
  263. package/src/serve/hub-app/panel-repo.ts +0 -9
  264. package/src/serve/hub-app/pic.tsx +29 -12
  265. package/src/serve/hub-app/polled.ts +16 -2
  266. package/src/serve/hub-app/recordings-st.ts +23 -2
  267. package/src/serve/hub-app/recordings-view.tsx +68 -10
  268. package/src/serve/hub-app/ref-pill.ts +1 -1
  269. package/src/serve/hub-app/repo-st.ts +1 -2
  270. package/src/serve/hub-app/review/advisor-add.tsx +1 -1
  271. package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
  272. package/src/serve/hub-app/review/draft-body.tsx +2 -2
  273. package/src/serve/hub-app/review/heard-line.tsx +1 -1
  274. package/src/serve/hub-app/review/instructions-view.tsx +1 -8
  275. package/src/serve/hub-app/review/kind-states.tsx +14 -9
  276. package/src/serve/hub-app/review/kit.tsx +4 -11
  277. package/src/serve/hub-app/review/lane-bar.tsx +3 -3
  278. package/src/serve/hub-app/review/lightbox.tsx +15 -11
  279. package/src/serve/hub-app/review/line-window.ts +4 -1
  280. package/src/serve/hub-app/review/live-bar-st.ts +2 -2
  281. package/src/serve/hub-app/review/live-view.tsx +57 -1
  282. package/src/serve/hub-app/review/object-panel.tsx +20 -8
  283. package/src/serve/hub-app/review/question-views.tsx +181 -54
  284. package/src/serve/hub-app/review/recap-bar.tsx +40 -0
  285. package/src/serve/hub-app/review/request-cell.tsx +48 -0
  286. package/src/serve/hub-app/review/review-cells.tsx +154 -96
  287. package/src/serve/hub-app/review/review-host.ts +2 -2
  288. package/src/serve/hub-app/review/review-kit.ts +17 -11
  289. package/src/serve/hub-app/review/review-list.tsx +23 -31
  290. package/src/serve/hub-app/review/review-st.ts +30 -40
  291. package/src/serve/hub-app/review/review-thread.tsx +139 -85
  292. package/src/serve/hub-app/review/review-views.tsx +124 -68
  293. package/src/serve/hub-app/review/share-lines.tsx +4 -4
  294. package/src/serve/hub-app/review/start-st.ts +2 -5
  295. package/src/serve/hub-app/review/superseded-runs.ts +4 -3
  296. package/src/serve/hub-app/review/thread-close.tsx +10 -7
  297. package/src/serve/hub-app/review/thread-st.ts +372 -201
  298. package/src/serve/hub-app/review/tone-bar.tsx +126 -0
  299. package/src/serve/hub-app/review/tones.ts +35 -0
  300. package/src/serve/hub-app/review/trailer-body.tsx +2 -2
  301. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  302. package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
  303. package/src/serve/hub-app/review.css +180 -106
  304. package/src/serve/hub-app/search-view.tsx +1 -1
  305. package/src/serve/hub-app/social/social-model.ts +0 -4
  306. package/src/serve/hub-app/source-acts.ts +2 -1
  307. package/src/serve/hub-app/stores/stores-page.tsx +2 -2
  308. package/src/serve/hub-app/terminal-sources.tsx +2 -1
  309. package/src/serve/hub-app/thread-row.tsx +3 -4
  310. package/src/serve/hub-app/tree-build.ts +0 -4
  311. package/src/serve/hub-app/urls-view.tsx +2 -1
  312. package/src/serve/hub-app/view-layout.css +13 -3
  313. package/src/serve/hub-app/wikis-view.tsx +5 -2
  314. package/src/serve/hub-runtime.ts +7 -37
  315. package/src/serve/project-gutter-route.ts +6 -2
  316. package/src/serve/read-thread.ts +20 -2
  317. package/src/serve/read-worker.ts +9 -1
  318. package/src/serve/record-pages.ts +46 -0
  319. package/src/serve/serve-hub.ts +2 -2
  320. package/src/serve/terminal-host.ts +1 -1
  321. package/src/serve/terminal-route.ts +1 -3
  322. package/src/serve/tracked-watch.ts +1 -3
  323. package/src/setup-house.ts +2 -2
  324. package/src/shipkit-files.ts +1 -1
  325. package/src/shipkit.ts +1 -6
  326. package/src/shot/film-box.ts +0 -20
  327. package/src/social/drafts.ts +1 -1
  328. package/src/social/kinds.ts +6 -29
  329. package/src/social/load.ts +2 -2
  330. package/src/social/post-object.ts +3 -2
  331. package/src/social/release-stage.ts +1 -1
  332. package/src/social/stage.ts +2 -2
  333. package/src/stores/model.ts +4 -0
  334. package/src/stores/routes.ts +11 -3
  335. package/src/suite/judge-suites.ts +58 -0
  336. package/src/suite/red-alone.ts +54 -18
  337. package/src/suite/runner-shapes.ts +2 -2
  338. package/src/suite/suite-cli.ts +67 -14
  339. package/src/suite/test-units.ts +2 -1
  340. package/src/urls/fill.ts +1 -1
  341. package/src/urls/places.ts +1 -2
  342. package/src/vault/vault-config.ts +2 -2
  343. package/src/vault/vault-init.ts +1 -5
  344. package/src/wiki/graph-page.ts +14 -2
  345. package/src/advisors/copy-truth.ts +0 -49
  346. package/src/advisors/door-child.ts +0 -112
  347. package/src/advisors/door-serve.ts +0 -52
  348. package/src/advisors/door.ts +0 -118
  349. package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
  350. package/src/checks/SK029-explicit-check-files.check.ts +0 -112
  351. package/src/checks/SK048-one-local-file.check.ts +0 -36
  352. package/src/core/config-rewrite.ts +0 -111
  353. package/src/core/daemon-port.ts +0 -10
  354. package/src/core/legacy-shapes.ts +0 -263
  355. package/src/core/migrate-layout.ts +0 -638
  356. package/src/core/port-check-cli.ts +0 -52
  357. package/src/core/port-check-file.ts +0 -295
  358. package/src/core/port-check-files.ts +0 -31
  359. package/src/gate/discover-legacy-checks.ts +0 -26
  360. package/src/home/home-move.ts +0 -527
  361. package/src/home/machine-fold.ts +0 -810
  362. package/src/hq/item-shapes.ts +0 -54
  363. package/src/hq/kinds/items-read.ts +0 -4
  364. package/src/media-store/backup/daemon.ts +0 -220
  365. package/src/media-store/backup/kept.ts +0 -241
  366. package/src/media-store/backup/prune.ts +0 -359
  367. package/src/media-store/backup/secret.ts +0 -88
  368. package/src/media-store/backup/ssh-space.ts +0 -202
  369. package/src/media-store/backup/watch.ts +0 -117
  370. package/src/review/band.ts +0 -182
  371. package/src/review/folders.ts +0 -216
  372. package/src/review/hook-ask.ts +0 -58
  373. package/src/review/role.ts +0 -48
  374. package/src/review/thread-fold.ts +0 -64
  375. package/src/review/wait.ts +0 -91
  376. package/src/rules/rule.ts +0 -43
  377. package/src/serve/hook-thread.ts +0 -37
  378. package/src/serve/hook-work.ts +0 -92
  379. package/src/serve/hook-worker.ts +0 -57
  380. package/src/serve/hub-app/review/dock.tsx +0 -147
  381. package/src/serve/hub-app/review/faces.tsx +0 -18
  382. package/src/serve/hub-app/review/item-verdict.tsx +0 -112
  383. package/src/serve/hub-app/review/review-board.tsx +0 -48
  384. /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
@@ -2,10 +2,10 @@
2
2
  // pick, a tick, an apply, a bare verdict, a close, a set aside) or an agent's (a read, on it, a take, a superseded
3
3
  // object, a state change), never a bubble that repeats the object's words; and where his newest word stands, read or
4
4
  // on it (wiki tools/shipkit/threads-how-it-fits.md, Read and on it). Pure and browser safe
5
- import { kindOfAsk, linesOf } from './answer-kinds.ts'
5
+ import { kindOfAsk, linesOf, noneAnswered, remarkOf } from './answer-kinds.ts'
6
6
  import { partyOf, WORKING_FRESH_MS, type AskState, type Message, type Op, type ReviewItem, type ReviewStatus } from './model.ts'
7
- import { membersOf, openingOf, type Thread } from './threads.ts'
8
- import { wakeOf } from './wakes.ts'
7
+ import { membersOf, type Thread } from './threads.ts'
8
+ import { wakeOf, openingOf } from './thread-events.ts'
9
9
 
10
10
  /** an ask's close or reopen as its trace line says it, who before it and its why after */
11
11
  const ASK_STATE_DID: Record<AskState, string> = {
@@ -41,6 +41,7 @@ export const TRACE_ACTS = {
41
41
  read: 'read',
42
42
  working: 'is on it',
43
43
  pick: 'picked',
44
+ none: 'answered none of these',
44
45
  tick: 'ticked',
45
46
  untick: 'unticked',
46
47
  confirm: 'confirmed',
@@ -61,9 +62,58 @@ export const TRACE_ACTS = {
61
62
  share: 'shared it',
62
63
  mention: 'mentioned in',
63
64
  rename: 'renamed the thread',
65
+ move: 'moved the thread',
66
+ close: 'closed the thread',
64
67
  } as const satisfies Record<string, string>
65
68
  export type TraceAct = keyof typeof TRACE_ACTS
66
69
 
70
+ /** how loud each act's line reads (wiki tools/shipkit/threads-page.md, Traces): `quiet` for the bookkeeping that changes
71
+ * nothing he decides on (who read, who holds, where the thread is filed, who sees it), `normal` for what changes the
72
+ * outcome or waits on him (his answer, a verdict, a close, a reopen, a fix, a question) */
73
+ export const TRACE_WEIGHT = {
74
+ dispatch: 'quiet',
75
+ ask: 'normal',
76
+ answer: 'normal',
77
+ reassign: 'quiet',
78
+ claim: 'quiet',
79
+ release: 'quiet',
80
+ blocked: 'normal',
81
+ fixed: 'normal',
82
+ done: 'normal',
83
+ wontfix: 'normal',
84
+ drop: 'normal',
85
+ withdraw: 'normal',
86
+ reopen: 'normal',
87
+ ready: 'quiet',
88
+ take: 'quiet',
89
+ read: 'quiet',
90
+ working: 'quiet',
91
+ pick: 'normal',
92
+ none: 'normal',
93
+ tick: 'normal',
94
+ untick: 'normal',
95
+ confirm: 'normal',
96
+ value: 'normal',
97
+ file: 'normal',
98
+ apply: 'normal',
99
+ store: 'normal',
100
+ verdict: 'normal',
101
+ aside: 'quiet',
102
+ back: 'quiet',
103
+ 'ask-state': 'normal',
104
+ action: 'normal',
105
+ act: 'normal',
106
+ supersede: 'quiet',
107
+ hold: 'normal',
108
+ unhold: 'normal',
109
+ lane: 'normal',
110
+ share: 'quiet',
111
+ mention: 'quiet',
112
+ rename: 'quiet',
113
+ move: 'quiet',
114
+ close: 'normal',
115
+ } as const satisfies Record<TraceAct, 'quiet' | 'normal'>
116
+
67
117
  /** one act as its line says it: who is the cell's, then `did`, then the object as a link to its cell, then when */
68
118
  export interface Trace {
69
119
  act: TraceAct
@@ -73,6 +123,34 @@ export interface Trace {
73
123
  until?: string
74
124
  /** `action`: the kind's action by name, its label read from the kind */
75
125
  action?: string
126
+ /** an act still running (a `working` no act ended, a share he can still end): it reads normal whatever its act */
127
+ live?: true
128
+ }
129
+
130
+ /** a trace line that steps back: a quiet act that no longer runs */
131
+ export const quietOf = (t: Trace): boolean => TRACE_WEIGHT[t.act] === 'quiet' && t.live !== true
132
+
133
+ /** a line of a run of traces, or two or more quiet lines in a row as one fold; a lone quiet line stays a line, a fold of
134
+ * one would hide nothing */
135
+ export type QuietPiece<T> = { one: T } | { fold: T[] }
136
+
137
+ export function foldQuiet<T>(xs: readonly T[], quiet: (x: T) => boolean): QuietPiece<T>[] {
138
+ const out: QuietPiece<T>[] = []
139
+ let run: T[] = []
140
+ const flush = (): void => {
141
+ if (run.length > 1) out.push({ fold: run })
142
+ else if (run.length === 1) out.push({ one: run[0]! })
143
+ run = []
144
+ }
145
+ for (const x of xs) {
146
+ if (quiet(x)) run.push(x)
147
+ else {
148
+ flush()
149
+ out.push({ one: x })
150
+ }
151
+ }
152
+ flush()
153
+ return out
76
154
  }
77
155
 
78
156
  /** what a trace needs beyond its item: the workings that ended, and any message's cell and title by its id */
@@ -82,7 +160,7 @@ export interface TraceCtx {
82
160
  title: (id: string) => string | null
83
161
  }
84
162
 
85
- const VERDICT_DID: Record<ReviewStatus, string> = { approved: 'approved', 'approved-with-fix': 'said ok with a fix to', rejected: 'rejected', archived: 'archived' }
163
+ const VERDICT_DID: Record<ReviewStatus, string> = { approved: 'approved', 'approved-with-fix': 'said ok with a fix to', rework: 'asked a rework of', 'wrong-direction': 'said wrong direction to', 'your-call': 'left to the agent', 'no-answer': 'left it unanswered', archived: 'archived' }
86
164
 
87
165
  const firstLine = (s: string | undefined, max = 80): string => {
88
166
  const l = (s ?? '').trim().split('\n')[0]?.trim() ?? ''
@@ -116,7 +194,12 @@ export function traceOf(x: ReviewItem, m: Message, n: number, ctx: TraceCtx): Tr
116
194
  }
117
195
  // an act of the version's kind on a spot (review/settle.ts): its line says what went where
118
196
  if (m.act !== undefined) return { act: 'act', did: firstLine(m.note, 200) || m.act.name }
119
- if (m.op === 'working') return m.note ?{ act: 'working', did: `${ctx.ended.has(m.id) ? 'was' : 'is'} on it: ${firstLine(m.note)}` } : null
197
+ if (m.op === 'working') return m.note ? (ctx.ended.has(m.id) ? { act: 'working', did: `was on it: ${firstLine(m.note)}` } : { act: 'working', did: `is on it: ${firstLine(m.note)}`, live: true }) : null
198
+ if (m.rename !== undefined) return { act: 'rename', did: `renamed the thread: « ${m.rename.from} » → « ${m.rename.to} »` }
199
+ if (m.moved !== undefined) return { act: 'move', did: `moved the thread from ${m.moved.from} to ${m.moved.to}` }
200
+ // an agent's close of the thread it finished: one line on its head; a version it closed says « no verdict needed »
201
+ if (m.closes === 'thread') return { act: 'close', did: `closed the thread: ${firstLine(m.note, 200)}` }
202
+ if (m.closes === 'version') return null
120
203
  // an attached object's hold flipped, the machine's check; his close that released the holds (review/holds.ts)
121
204
  if (m.hold !== undefined) return { act: 'hold', did: `checked: ${firstLine(m.text, 200)}` }
122
205
  if (owner && m.unhold !== undefined) return { act: 'unhold', did: `closed it while ${m.unhold.join(', ')} held it open` }
@@ -126,6 +209,8 @@ export function traceOf(x: ReviewItem, m: Message, n: number, ctx: TraceCtx): Tr
126
209
  const did = ASK_STATE_DID[s.state] + (s.state === 'merged' && s.into ? ` ask:${s.into}` : '')
127
210
  return { act: 'ask-state', did: `${did}${s.why ? `: ${firstLine(s.why)}` : ''}` }
128
211
  }
212
+ // his « no answer » on a version, a message or a question: one line, nobody owes anything
213
+ if (owner && m.verdict === 'no-answer') return { act: 'verdict', did: VERDICT_DID['no-answer'] }
129
214
  if (owner && m.answer !== undefined && m.re !== undefined) {
130
215
  const q = x.thread.find((y) => y.id === m.re)
131
216
  const a = m.answer
@@ -134,10 +219,22 @@ export function traceOf(x: ReviewItem, m: Message, n: number, ctx: TraceCtx): Tr
134
219
  if (a.stored !== undefined) return { act: 'store', did: `stored the secret as ${a.stored} for`, object: on }
135
220
  if (a.tick !== undefined && q !== undefined && kindOfAsk(q) === 'confirm') return { act: a.tick ? 'confirm' : 'untick', did: a.tick ? 'confirmed' : 'took back the confirm of', object: on }
136
221
  if (a.tick !== undefined) return { act: a.tick ? 'tick' : 'untick', did: `${a.tick ? 'ticked' : 'unticked'} « ${firstLine(q ? linesOf(q)[a.option ?? 0] : m.text)} » on`, object: on }
137
- if (a.option !== undefined) return { act: 'pick', did: `picked ${a.option + 1} « ${firstLine(q?.ask?.options[a.option] ?? m.text)} » on`, object: on }
222
+ if (a.option !== undefined) {
223
+ const label = q?.ask?.options[a.option]
224
+ // his remark draws in the question's widget, under the option: the line says there is one, never its words
225
+ const remark = label !== undefined && remarkOf(label, m.text) !== '' ? ' with a remark' : ''
226
+ if (m.verdict === 'your-call') return { act: 'pick', did: `left it to the agent, its pick ${a.option + 1} « ${firstLine(label ?? m.text)} » if it still holds, on`, object: on }
227
+ return { act: 'pick', did: `picked ${a.option + 1} « ${firstLine(label ?? m.text)} »${remark} on`, object: on }
228
+ }
138
229
  if (a.view !== undefined) return { act: 'file', did: 'added a file to', object: on }
139
230
  return { act: 'value', did: a.value !== undefined ? `answered « ${firstLine(a.value)} » to` : 'answered', object: on }
140
231
  }
232
+ // the owner's words alone that answer a question draw in its control (a choice's « none of these »): here one line, never a
233
+ // bubble repeating them
234
+ const none = owner ? noneAnswered(x.thread, m) : undefined
235
+ // his tone with them (store.ts answerAsk `tone`): a wrong direction, or « your call » with no pick to take
236
+ const toned = m.verdict === 'wrong-direction' ? 'said wrong direction on' : m.verdict === 'your-call' ? 'left it to the agent on' : null
237
+ if (none !== undefined) return { act: 'none', did: toned ?? (kindOfAsk(none) === 'choice' ? 'answered none of these on' : 'answered in words on'), object: { cell: own(none.id), label: 'the question' } }
141
238
  const words = m.text !== undefined && m.text.trim() !== ''
142
239
  if (owner && m.verdict !== undefined) {
143
240
  if (words || (m.rects?.length ?? 0) > 0 || (m.reactions?.length ?? 0) > 0 || m.pick !== undefined) return null
@@ -192,7 +289,7 @@ export function workingsOf(t: Thread, now = new Date()): { ended: Set<string>; o
192
289
  return { ended, open, last }
193
290
  }
194
291
 
195
- /** where his newest word stands (a tick inside an unfinished list is no word: review/wakes.ts): an agent on it (a
292
+ /** where his newest word stands (a tick inside an unfinished list is no word: review/thread-events.ts): an agent on it (a
196
293
  * `working` begun after it), else read by an agent, else null */
197
294
  export interface Cursor {
198
295
  who: string
@@ -1,4 +1,4 @@
1
- // a trailer item as `sk thread add --trailer` makes it (wiki tools/shipkit/threads.md, A trailer): the cut a .trailer file
1
+ // a trailer item as `sk thread post --trailer` makes it (wiki tools/shipkit/threads.md, A trailer): the cut a .trailer file
2
2
  // names, a kept version of it, the render it is compared with, each render pinned by its mtime, the shots the change
3
3
  // touched. No video is made: the hub plays the pinned renders in the trailer entry's player
4
4
  import { existsSync, readFileSync } from 'node:fs'
@@ -1,5 +1,5 @@
1
1
  // a repo's parts of the one store (wiki tools/shipkit/threads.md, A project's parts): its subject kinds, topics, sources,
2
- // auto rules and the dispatcher switch, declared once in a `review({...})` unit of any `<name>.shipkit.ts`. Every unit
2
+ // auto rules and its verbs, declared once in a `review({...})` unit of any `<name>.shipkit.ts`. Every unit
3
3
  // file imports this module, so it stays light: the store reads the pure part through specOf(dir), project.ts finds,
4
4
  // imports and serves the rest
5
5
  import { isKindColor, KIND_COLORS } from './glyphs.ts'
@@ -74,7 +74,7 @@ export interface KindDef<S extends Subject = Subject> extends SpecKind {
74
74
  text?(x: ReviewItem): ViewText | null
75
75
  /** the subject in parts, each a frame: a post's messages, with their logo, media and change */
76
76
  parts?(x: ReviewItem): ViewPart[]
77
- /** the `sk thread add` flags this kind reads, each with its help line: `--where <zone>:<x>,<y>` */
77
+ /** the `sk thread post` flags this kind reads, each with its help line: `--where <zone>:<x>,<y>` */
78
78
  flags?: Record<string, string>
79
79
  /** the subject (and its topic) an item of this kind gets from those flags, every flag as the list of its values;
80
80
  * throws with the reason a flag is wrong */
@@ -184,19 +184,18 @@ export interface ReviewSource {
184
184
  export interface ReviewDef {
185
185
  kinds?: Record<string, KindDef>
186
186
  topics?: Record<string, SpecTopic>
187
- dispatcher?: boolean
188
187
  sources?: readonly ReviewSource[]
189
188
  auto?: readonly AutoRule[]
190
189
  /** a repo relative font file the animation's labels are drawn in */
191
190
  anim?: { font?: string }
192
- /** the `sk thread add` and `add-view` flags of any kind (a ring over the subject), each with its help line */
191
+ /** the `sk thread post` and `add-view` flags of any kind (a ring over the subject), each with its help line */
193
192
  flags?: Record<string, string>
194
193
  /** what the repo checks and fills on a version before it is written (marks read from its own shots, the review light,
195
194
  * a lane from a commit, a refused contact sheet); throws to refuse it */
196
195
  add?(input: AddInput, flags: Record<string, string[]>): AddInput | Promise<AddInput>
197
196
  /** the same on a view added to an open version */
198
197
  addView?(view: ViewInput, flags: Record<string, string[]>): ViewExtra | Promise<ViewExtra>
199
- /** a draft version's live shots: `sk thread add --wip --live <name>`, `ready` stops the shot */
198
+ /** a draft version's live shots: `sk thread post --wip --live <name>`, `ready` stops the shot */
200
199
  live?: LiveShots
201
200
  /** the repo's own verbs under `sk thread <verb>`: a report replayed in the game, the town composer */
202
201
  verbs?: Record<string, { description: string; usage?: string; run(args: string[], ctx: VerbCtx): number | Promise<number> }>
@@ -228,7 +227,7 @@ export function reviewProblem(d: ReviewDef): string | null {
228
227
  if (!/^\d+(\.\d+)?m$/.test(r.every ?? '')) return `review: auto rule '${r.id}' runs every '<minutes>m', like '10m'`
229
228
  if (typeof r.when !== 'function') return `review: auto rule '${r.id}'.when is a function`
230
229
  }
231
- const core = new Set(['ls', 'add', 'add-view', 'show', 'inbox', 'seen', 'reply', 'withdraw', 'reopen', 'fixed', 'wontfix', 'claim', 'release', 'blocked', 'done', 'dispatcher', 'dispatch', 'ask', 'drop', 'reassign', 'next', 'topics', 'board', 'ready', 'delete', 'marks', 'anim', 'auto', 'watch', 'take', 'assign', 'working'])
230
+ const core = new Set(['ls', 'post', 'add-view', 'show', 'inbox', 'seen', 'reply', 'withdraw', 'reopen', 'fixed', 'wontfix', 'claim', 'release', 'done', 'ask', 'next', 'topics', 'board', 'ready', 'delete', 'marks', 'anim', 'auto', 'watch', 'take', 'assign', 'working'])
232
231
  for (const [v, def] of Object.entries(d.verbs ?? {})) {
233
232
  if (!WORD.test(v)) return `review: verb '${v}' is a lowercase word`
234
233
  if (core.has(v)) return `review: verb '${v}' is one of sk thread's own`
@@ -288,8 +287,8 @@ export function review(d: ReviewDef): ReviewUnit {
288
287
  return { ...d, kind: 'review' }
289
288
  }
290
289
 
291
- /** the model's part of a unit: its kinds, topics and dispatcher switch */
292
- export const specOfUnit = (u: ReviewDef | null): Spec => ({ kinds: u?.kinds ?? {}, topics: u?.topics ?? {}, dispatcher: u?.dispatcher === true })
290
+ /** the model's part of a unit: its kinds and topics */
291
+ export const specOfUnit = (u: ReviewDef | null): Spec => ({ kinds: u?.kinds ?? {}, topics: u?.topics ?? {} })
293
292
 
294
293
  /** a kind's declared data, as the browser reads it: no function crosses */
295
294
  export const kindData = (v: SpecKind): SpecKind => ({
@@ -307,5 +306,4 @@ export const kindData = (v: SpecKind): SpecKind => ({
307
306
  export const specData = (spec: Spec): Spec => ({
308
307
  kinds: Object.fromEntries(Object.entries(spec.kinds).map(([k, v]) => [k, kindData(v)])),
309
308
  topics: spec.topics,
310
- dispatcher: spec.dispatcher,
311
309
  })
@@ -5,10 +5,10 @@
5
5
  //
6
6
  // the one constraint a reader breaks first: a verdict message that names `re` answers that message, never the version,
7
7
  // so model.ts verdictOf skips it
8
- import { partyOf, wordsAnswerOf, type Message, type ReviewItem, type ReviewStatus } from './model.ts'
8
+ import { partyOf, statusRead, toneAskTail, type Message, type ReviewItem, type ReviewStatus } from './model.ts'
9
9
 
10
- /** the verdicts an item that asks takes: « later » is the thread's « set aside », never an item's answer */
11
- export const ITEM_VERDICTS = ['approved', 'approved-with-fix', 'rejected'] as const satisfies readonly ReviewStatus[]
10
+ /** the five tones, or no answer, an item that asks takes (model.ts STATUSES): « later » is the thread's « set aside », never an item's answer */
11
+ export const ITEM_VERDICTS = ['approved', 'approved-with-fix', 'rework', 'wrong-direction', 'your-call', 'no-answer'] as const satisfies readonly ReviewStatus[]
12
12
  export type ItemVerdict = (typeof ITEM_VERDICTS)[number]
13
13
  export const isItemVerdict = (s: string): s is ItemVerdict => (ITEM_VERDICTS as readonly string[]).includes(s)
14
14
 
@@ -32,8 +32,8 @@ export function verdictOnMessage(thread: readonly Message[], m: Pick<Message, 'i
32
32
  return null
33
33
  }
34
34
 
35
- /** the message asks the owner's verdict and has none yet, nor the owner's words after it (model.ts wordsAnswerOf) */
36
- export const verdictOpen = (thread: readonly Message[], m: Message): boolean => asksVerdict(m) && verdictOnMessage(thread, m) === null && wordsAnswerOf(thread, m) === undefined
35
+ /** the message asks the owner's verdict and has none yet: only the owner's verdict on it answers it, never a plain reply after it */
36
+ export const verdictOpen = (thread: readonly Message[], m: Message): boolean => asksVerdict(m) && verdictOnMessage(thread, m) === null
37
37
 
38
38
  /** each message of the items that asks the owner's verdict and has none, oldest first; `gone`: the ids a newer object
39
39
  * supersedes (review/supersede.ts), which ask nothing more */
@@ -47,7 +47,7 @@ export function openVerdictAsks(members: readonly ReviewItem[], gone: ReadonlySe
47
47
  export function judgeOf(thread: readonly Message[], m: Message, superseded = false): { judge?: { open: boolean; verdict?: MessageVerdict } } {
48
48
  if (!asksVerdict(m)) return {}
49
49
  const v = verdictOnMessage(thread, m)
50
- return { judge: { open: v === null && !superseded && wordsAnswerOf(thread, m) === undefined, ...(v ? { verdict: v } : {}) } }
50
+ return { judge: { open: v === null && !superseded, ...(v ? { verdict: v } : {}) } }
51
51
  }
52
52
 
53
53
  /** the owner's verdict on a message, as the store takes it: the message it answers, the status, the owner's words if any */
@@ -58,9 +58,10 @@ export function itemVerdictBody(body: unknown, thread: readonly Message[]): { ok
58
58
  const m = thread.find((x) => x.id === b.re)
59
59
  if (!m) return { ok: false, error: `re: ${b.re} is no message of this item` }
60
60
  if (!asksVerdict(m)) return { ok: false, error: `re: ${b.re} asks no verdict: a word on it goes in a reply` }
61
- if (!(ITEM_VERDICTS as readonly unknown[]).includes(b.status)) return { ok: false, error: `status: one of ${ITEM_VERDICTS.join(', ')}` }
61
+ const status = statusRead(b.status)
62
+ if (!(ITEM_VERDICTS as readonly unknown[]).includes(status)) return { ok: false, error: `status: one of ${ITEM_VERDICTS.join(', ')}` }
62
63
  const text = typeof b.text === 'string' ? b.text.trim() : ''
63
- return { ok: true, re: b.re, status: b.status as ItemVerdict, ...(text !== '' ? { text } : {}) }
64
+ return { ok: true, re: b.re, status: status as ItemVerdict, ...(text !== '' ? { text } : {}) }
64
65
  }
65
66
 
66
67
  const first = (t: string | undefined): string => (t ?? '').split('\n').find((l) => l.trim() !== '')?.trim() ?? ''
@@ -68,6 +69,7 @@ const first = (t: string | undefined): string => (t ?? '').split('\n').find((l)
68
69
  /** the watch's line of the owner's verdict on a message: what he judged, the owner's verdict, the owner's words */
69
70
  export function itemVerdictLine(x: ReviewItem, v: Message): string | null {
70
71
  const asked = v.re === undefined ? undefined : x.thread.find((m) => m.id === v.re)
71
- if (v.verdict === undefined || asked === undefined) return null
72
- return `${x.item.id} verdict ${v.verdict} "${x.item.title}" on ${asked.id} « ${first(asked.text).slice(0, 80)} »${v.text ? `: ${v.text.replace(/\s+/g, ' ')}` : ''}`
72
+ // a tone on a question is his answer to it: the answer's own line says it (format.ts answerLine, noneLine)
73
+ if (v.verdict === undefined || asked === undefined || asked.ask !== undefined) return null
74
+ return `${x.item.id} verdict ${v.verdict} "${x.item.title}" on ${asked.id} « ${first(asked.text).slice(0, 80)} »${v.text ? `: ${v.text.replace(/\s+/g, ' ')}` : ''}${toneAskTail(v.verdict, x.item.id)}`
73
75
  }
@@ -31,6 +31,30 @@ export const TILE_ASPECT = 16 / 10
31
31
  /** px: the widest least width of a gallery tile its tiny preview serves (review/previews.ts PREVIEW_W.tile). A tile of
32
32
  * the grid is under twice its least width, its frame TILE_ASPECT, drawn at 2x */
33
33
  export const TINY_TILE = 130
34
+
35
+ /** px: the box each preview of an image fits inside, never past the file's own pixels (review/previews.ts makes them):
36
+ * `tile` a small gallery tile's frame at 2x, `thumb` a larger tile, `fit` a view in the thread column */
37
+ export const PREVIEW_BOX = { tile: { w: TINY_TILE * 4, h: Math.round((TINY_TILE * 4) / TILE_ASPECT) }, thumb: { w: 480, h: Infinity }, fit: { w: 1600, h: Infinity } } as const
38
+ export type PreviewSize = keyof typeof PREVIEW_BOX
39
+
40
+ /** an image of unknown size counts as a large one of the frame's own shape */
41
+ const UNKNOWN = { w: 1600, h: 1000 }
42
+
43
+ /** the least preview that draws an image sharp at 2x in a gallery tile `boxW` css px wide (its frame TILE_ASPECT, the
44
+ * image contained): a 832 × 1152 picture in a 140 px tile is the tile preview, never the 1600 px one. Each preview a
45
+ * tile loads is decoded whole, so the pick bounds a gallery's memory */
46
+ export function tilePreviewOf(boxW: number, size?: { w: number; h: number }): PreviewSize {
47
+ const { w, h } = size !== undefined && size.w > 0 && size.h > 0 ? size : UNKNOWN
48
+ const s = Math.min(boxW / w, boxW / TILE_ASPECT / h)
49
+ const need = w * s * 2
50
+ for (const k of ['tile', 'thumb'] as const) {
51
+ const b = PREVIEW_BOX[k]
52
+ const p = Math.min(1, b.w / w, b.h / h)
53
+ // a few percent short is not seen; a preview that is the file whole is as sharp as it gets
54
+ if (p === 1 || w * p >= need * 0.95) return k
55
+ }
56
+ return 'fit'
57
+ }
34
58
  /** the cap of a view that fills the column, as a share of the window's height */
35
59
  export const FILL_VH = 70
36
60
 
@@ -53,7 +77,7 @@ export const LAYOUT: Readonly<Record<ViewForm, FormLayout>> = {
53
77
  pano: { shows: 'its still, « 360° · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
54
78
  splat: { shows: 'its poster, « splat · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
55
79
  mesh: { shows: 'its poster, « 3D mesh · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
56
- live: { shows: 'its shot, « live page · open »; framed live in the lightbox', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
80
+ live: { shows: 'its shot in a border of its own colour, « IFRAME » on it, a column of its ways to open it down its right side (here, beside the page, a tab, the hub\'s tab, copy its address); framed live in the lightbox',alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'stage' },
57
81
  'kind-page': { shows: 'its still, a tile a side, « open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'its actions under it' },
58
82
  html: { shows: 'the html page shrunk into a tile, « html · open »', alone: 'thumb', among: 'tile', opens: 'the lightbox', controls: 'copy html, changes since vN, under it' },
59
83
  md: { shows: 'its text whole', alone: 'row', among: 'row', opens: null, controls: 'copy markdown, changes since vN, under it' },
@@ -146,8 +146,7 @@ export class WatchFeed {
146
146
  this.lastBeat = this.now()
147
147
  if (event === 'hello') {
148
148
  const repos = data.repos
149
- // a daemon older than this watch names no stores: it is read the old way
150
- if (!Array.isArray(repos)) return this.down('the daemon is older than this watch')
149
+ if (!Array.isArray(repos)) return this.down("the daemon's hello names no stores")
151
150
  this.served = new Map((repos as { name: string; dir: string }[]).map((r) => [canonDir(r.dir), r.name]))
152
151
  if (typeof data.beatMs === 'number') this.beatMs = data.beatMs
153
152
  if (this.dog != null) clearInterval(this.dog)
@@ -1,10 +1,9 @@
1
1
  // what `sk thread working` refuses (wiki tools/shipkit/threads-how-it-fits.md, Read and on it): a line that only
2
2
  // acknowledges his answer to a question or a pick. A working line is no answer, so his answer would stay owed with
3
3
  // nothing planned to pay it. Pure and narrow: a false refusal of real work costs more than a missed acknowledgement
4
- import { moveOf } from './band.ts'
5
4
  import { partyOf, type Message } from './model.ts'
6
5
  import { membersOf, type Thread } from './threads.ts'
7
- import { wakeOf } from './wakes.ts'
6
+ import { wakeOf, messageMove } from './thread-events.ts'
8
7
 
9
8
  /** the words a line opens with when it only says it read: « noted », « seen », « ok », « I collect … » */
10
9
  const ACK = /^(?:ok(?:ay)?|noted|seen|got it|thanks|thank you|acknowledged|understood|received|sure|i(?:'ll| will)? collect(?:ed|ing)?|collect(?:ed|ing))\b/i
@@ -34,6 +33,6 @@ function newestWord(t: Thread): { x: Thread['head']; m: Message } | null {
34
33
  * and the line only acknowledges it */
35
34
  export function workingRefusal(t: Thread, line: string, ref: string, bin = 'sk'): string | null {
36
35
  const w = newestWord(t)
37
- if (w === null || moveOf(w.x, w.m) !== 'his-answer' || !ackOnly(line)) return null
36
+ if (w === null || messageMove(w.x, w.m) !== 'his-answer' || !ackOnly(line)) return null
38
37
  return `« ${line.trim()} » acknowledges his answer, and a working line answers nothing: his answer would stay owed. Answer it: ${bin} thread reply ${ref} "<what you take from it, what you do>"; say working only for work you start now`
39
38
  }
@@ -25,21 +25,7 @@ import { existsSync, lstatSync } from 'fs'
25
25
  import { join } from 'path'
26
26
  import { realGit, type GitIo } from '../core/git.ts'
27
27
 
28
- /** rendered into the SK004 managed block, anchored at the root where the old
29
- * layout wrote them (`.shipkit/*` covers the current ones): a bare name would
30
- * also hide a repo's own `apps/<app>/status.md`, since a case blind disk reads
31
- * it as `STATUS.md`. A glob is fine HERE: ignoring is not destructive. */
32
- export const GENERATED_IGNORE_LINES = [
33
- '# shipkit writes these on every run — ignored AND untracked (untrack-generated.ts)',
34
- '/STATUS.md',
35
- '/STATUS.md.lock',
36
- '/.STATUS.md.tmp-*',
37
- '/STATUS.full.md',
38
- '/STATUS.full.md.lock',
39
- '/.STATUS.full.md.tmp-*',
40
- ]
41
-
42
- /** the LITERAL subset an autofix may remove from the index. Never a glob and
28
+ /** the paths an autofix may remove from the index, ignored by the SK004 block's `.shipkit/*`. Never a glob and
43
29
  * never derived from a pattern: `git rm --cached` driven by a wildcard is how
44
30
  * a fixer eats source it was never pointed at. A future entry is added HERE,
45
31
  * by hand, spelled out. */
@@ -6,9 +6,10 @@
6
6
  import { basename } from 'path'
7
7
  import { askAddress, createAsk, listAsks, reopenAsk } from '../asks/ask-store.ts'
8
8
  import { readAll, storeDir } from '../review/store.ts'
9
- import { membersOf, orderedThreads } from '../review/threads.ts'
9
+ import { membersOf } from '../review/threads.ts'
10
10
  import { lapsesOf, neededLine, type Lapses } from './lapse-mark.ts'
11
11
  import { houseRowOf, type SecretsWhere } from './manager.ts'
12
+ import { orderedThreads } from '../review/thread-state.ts'
12
13
 
13
14
  /** the house registry's lapse mark of a name, or null */
14
15
  export const lapsesIn = (w: Pick<SecretsWhere, 'house'>, name: string): Lapses | null => houseRowOf(w, name)?.lapses ?? null
@@ -1,6 +1,6 @@
1
- // the advisors' door's page (wiki tools/shipkit/advisors.md, The advisor's app): the owner's own review page, the same
2
- // list and thread components, over the read only copy of the review api the door serves. Built by advisors/app.ts,
3
- // pinned by his `sk advisors expose`
1
+ // the advisors page's app (wiki tools/shipkit/advisors.md, The advisor's app): the owner's own review page, the same
2
+ // list and thread components, over the few review api paths the users' port serves. Built by advisors/app.ts, served
3
+ // by the users' port
4
4
  // the one constraint a reader breaks first: it imports the review page and its host only (tests/advisor-app.test.ts)
5
5
  import { autorun, observable, reaction, runInAction } from 'mobx'
6
6
  import { observer } from 'mobx-react-lite'
@@ -33,7 +33,7 @@ document.addEventListener('visibilitychange', () => {
33
33
  }
34
34
  })
35
35
  window.addEventListener('pagehide', () => here.hide())
36
- // a newer page at the door: reloaded at once when nothing is typed, else the line over the list says « reload »
36
+ // a newer page on the users' port: reloaded at once when nothing is typed, else the line over the list says « reload »
37
37
  const typed = (): boolean => [...document.querySelectorAll<HTMLTextAreaElement | HTMLInputElement>('textarea, input:not([type]), input[type="text"]')].some((e) => e.value.trim() !== '')
38
38
  reaction(() => host.stale, (on) => on && !typed() && location.reload())
39
39
  window.addEventListener('pageshow', () => document.visibilityState === 'visible' && here.show())
@@ -16,11 +16,17 @@ export const OWNER_HUE = 322
16
16
  /** how near the owner's hue a person's may fall before it turns away from it */
17
17
  const OWNER_NEAR = 50
18
18
 
19
- /** a person's hue: from their name, one name always one hue, turned off the owner's so the two never read alike */
19
+ /** the agents' hue: their mark's (hub.css `--agent`), the same for every lane */
20
+ export const AGENT_HUE = 14
21
+
22
+ /** how far a hue lies from another on the wheel, 0 to 180 */
23
+ const apart = (a: number, b: number): number => Math.abs(((a - b + 540) % 360) - 180)
24
+
25
+ /** a person's hue: from their name, one name always one hue, turned off the owner's and the agents' so a person never
26
+ * reads as either */
20
27
  export function faceHue(name: string): number {
21
28
  const h = laneHue(name.trim().toLowerCase())
22
- const d = Math.abs(((h - OWNER_HUE + 540) % 360) - 180)
23
- return d < OWNER_NEAR ? (h + 150) % 360 : h
29
+ return apart(h, OWNER_HUE) < OWNER_NEAR || apart(h, AGENT_HUE) < OWNER_NEAR ? (h + 180) % 360 : h
24
30
  }
25
31
 
26
32
  /** the disc's colour, and their words' in a thread: the person's own, never the owner's */
@@ -1,8 +1,8 @@
1
- // the review page's host at the advisors' door (wiki tools/shipkit/advisors.md, The advisor's app): the same page and
2
- // thread components as the owner's hub, over the read only copy of the review api the door serves. Every request is
3
- // one of that api's paths under `base` ('' at the door, the hub's preview prefix in his preview)
1
+ // the review page's host on the advisors page (wiki tools/shipkit/advisors.md, The advisor's app): the same page and
2
+ // thread components as the owner's hub, over the few review api paths the users' port serves. Every request is one of
3
+ // those paths under `base` ('' on the users' port, the hub's preview prefix in the owner's preview)
4
4
  // the one constraint a reader breaks first: this module and what it imports never reach the home, the terminal, the
5
- // vault or a secret (tests/advisor-app.test.ts walks the graph); the door's route list is the wall, this is hygiene
5
+ // vault or a secret (tests/advisor-app.test.ts walks the graph); the users' port's route list is the wall, this is hygiene
6
6
  import { makeAutoObservable, reaction, runInAction } from 'mobx'
7
7
  import { ClockSvc } from './clock-svc.ts'
8
8
  import { FrameCache } from './frames-st.ts'
@@ -11,34 +11,33 @@ import { canOf, type ReviewAct, type ReviewHome, type ReviewHost } from './revie
11
11
  import { ReviewSt } from './review/review-st.ts'
12
12
  import { reach } from './reach.ts'
13
13
 
14
- /** the header a write carries, its value the page's meta `advisor-csrf`: the door refuses a write without it */
14
+ /** the header a write carries, its value the page's meta `advisor-csrf`: the users' port refuses a write without it */
15
15
  export const CSRF_HEADER = 'x-advisor-csrf'
16
- /** the header of the door's api answers: the sha of the script its shell names now (advisors/edge/handler.ts) */
16
+ /** the header of the users' port's api answers: the sha of the script its shell names now (advisors/edge/handler.ts) */
17
17
  export const APP_HEADER = 'x-advisor-app'
18
18
  /** an advisor's page reads again this often, and not at all while its tab is hidden */
19
19
  export const ADVISOR_POLL_MS = 30_000
20
- /** after an act of theirs: a read this often, for this long, so their own words, pick or verdict show within a pass of
21
- * the Mac's job (advisors/job.ts, 10 s) */
20
+ /** after an act of theirs: a read this often, for this long, so what the act changed shows before the next poll */
22
21
  export const AFTER_ACT_MS = 2_000
23
22
  export const AFTER_ACT_FOR_MS = 25_000
24
23
 
25
24
  export interface AdvisorMeta {
26
- /** the prefix every api path goes under: '' at the door */
25
+ /** the prefix every api path goes under: '' on the users' port */
27
26
  base: string
28
27
  csrf: string
29
- /** the name the door knows the advisor by, the page's title */
28
+ /** the name the users' port knows the advisor by, the page's title */
30
29
  name: string
31
30
  /** the owner's name: the owner's words go under it */
32
31
  owner: string
33
- /** the advisor's own name for the page's head, '' when the door knows none */
32
+ /** the advisor's own name for the page's head, '' when the port knows none */
34
33
  me: string
35
- /** the start of their own photo's hash when the door serves one, '' for none: their face is their initials */
34
+ /** the start of their own photo's hash when the port serves one, '' for none: their face is their initials */
36
35
  photo: string
37
36
  /** the sha of this page's own script, from its address; '' when it has none (his preview) */
38
37
  app: string
39
38
  }
40
39
 
41
- /** the page's facts, from its meta tags: the door writes them in the shell, nothing else does */
40
+ /** the page's facts, from its meta tags: the users' port writes them in the shell, and the owner's preview in its own */
42
41
  export function advisorMeta(doc: Pick<Document, 'querySelector'>): AdvisorMeta {
43
42
  const meta = (n: string): string => doc.querySelector(`meta[name="${n}"]`)?.getAttribute('content') ?? ''
44
43
  const base = meta('advisor-base')
@@ -54,9 +53,9 @@ export class AdvisorHost implements ReviewHost {
54
53
  readonly clock = new ClockSvc()
55
54
  readonly home: ReviewHome = { embedded: false, layout: new LayoutSt(), frames: new FrameCache() }
56
55
  readonly review: ReviewSt
57
- /** the door's session ended (its 401): the page says so, with the way back */
56
+ /** the session ended (the users' port's 401): the page says so, with the way back */
58
57
  signedOut = false
59
- /** the door serves a newer page than this one: it says « reload », and reloads itself when nothing is typed */
58
+ /** the users' port serves a newer page than this one: it says « reload », and reloads itself when nothing is typed */
60
59
  stale = false
61
60
  /** the projects they may start a thread on, read once at the start */
62
61
  starts: { id: string; project: string }[] = []
@@ -72,7 +71,7 @@ export class AdvisorHost implements ReviewHost {
72
71
  const ok = Array.isArray(v) ? v.filter((x): x is { id: string; project: string } => typeof x?.id === 'string' && typeof x?.project === 'string') : []
73
72
  runInAction(() => (this.starts = ok))
74
73
  } catch {
75
- // a door that does not answer offers no project: the threads still read
74
+ // a port that does not answer offers no project: the threads still read
76
75
  }
77
76
  }
78
77
  async start(project: string, o: { title: string; text: string; files: readonly { token: string }[] }): Promise<void> {
@@ -107,8 +106,8 @@ export class AdvisorHost implements ReviewHost {
107
106
  }
108
107
  private brisk: ReturnType<typeof setInterval> | null = null
109
108
  private briskUntil = 0
110
- /** an act of theirs went out: the door draws it once the Mac's next pass wrote their copy (every 10 s), so the page
111
- * reads again every AFTER_ACT_MS for AFTER_ACT_FOR_MS, never waiting for its next poll. His preview takes no act */
109
+ /** an act of theirs went out: the users' port answers it from the store at the next read, so the page reads again
110
+ * every AFTER_ACT_MS for AFTER_ACT_FOR_MS, never waiting for its next poll. The owner's preview takes no act */
112
111
  moved(): void {
113
112
  if (this.meta.csrf === '' || this.signedOut) return
114
113
  this.briskUntil = Date.now() + AFTER_ACT_FOR_MS
@@ -134,15 +133,15 @@ export class AdvisorHost implements ReviewHost {
134
133
  this.signedOut = true
135
134
  this.review.stop()
136
135
  }
137
- /** at the door alone: his preview has no session to end */
136
+ /** on the users' port alone: the owner's preview has no session to end */
138
137
  get canSignOut(): boolean {
139
138
  return this.meta.csrf !== '' && this.meta.base === ''
140
139
  }
141
- /** « sign out »: the door ends this session, then the sign in page */
140
+ /** « sign out »: the users' port ends this session, then the sign in page */
142
141
  async signOut(go: (url: string) => void = (u) => location.assign(u)): Promise<void> {
143
142
  await reach(this.url('/api/advisor/out'), { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' }).catch(() => null)
144
143
  this.setSignedOut()
145
- // the next person on this browser starts with nothing of theirs: the door's origin holds this page's state alone
144
+ // the next person on this browser starts with nothing of theirs: the advisors page's origin holds this page's state alone
146
145
  try {
147
146
  localStorage.clear()
148
147
  } catch {
@@ -152,11 +151,11 @@ export class AdvisorHost implements ReviewHost {
152
151
  }
153
152
  }
154
153
 
155
- /** the page beats this often while its tab shows: well inside the door's HERE_FRESH_MS (advisors/edge/here.ts) */
154
+ /** the page beats this often while its tab shows: well inside the port's HERE_FRESH_MS (advisors/edge/here.ts) */
156
155
  export const HERE_BEAT_MS = 10_000
157
156
 
158
- /** the page's beat at the door (advisors/edge/here.ts): the thread it has open, every HERE_BEAT_MS while its tab shows
159
- * and at once when it changes; « none » as the tab hides or the page leaves. Its answer carries nothing. His preview
157
+ /** the page's beat on the users' port (advisors/edge/here.ts): the thread it has open, every HERE_BEAT_MS while its tab shows
158
+ * and at once when it changes; « none » as the tab hides or the page leaves. Its answer carries nothing. The owner's preview
160
159
  * (no token) never beats */
161
160
  export class HereBeat {
162
161
  private timer: ReturnType<typeof setInterval> | null = null
@@ -187,14 +186,15 @@ export class HereBeat {
187
186
  }
188
187
  }
189
188
 
190
- /** the one answer that means the session ended: the door's 401 (a new code was sent, or nothing is shared any more),
191
- * or a redirect (opaque under `redirect: 'manual'`), which the door never answers its own page. A 304 is the door saying the list or view the page holds is current; any other refusal is that request's own,
189
+ /** the one answer that means the session ended: the users' port's 401 (a new code was sent, or nothing is shared any
190
+ * more), or a redirect (opaque under `redirect: 'manual'`), which the port never answers its own page. A 304 is the
191
+ * port saying the list or view the page holds is current; any other refusal is that request's own,
192
192
  * shown where it was asked */
193
193
  export const signInEnded = (r: Pick<Response, 'type' | 'status'>): boolean =>
194
194
  r.type === 'opaqueredirect' || r.status === 401 || [301, 302, 303, 307, 308].includes(r.status)
195
195
 
196
196
  /** every request of the page: its own origin only, a write with the token, a redirect never followed. An ended session
197
- * stops the page, which says « sign in again », linking the door's sign in */
197
+ * stops the page, which says « sign in again », linking the advisors page's sign in */
198
198
  export function advisorFetch(host: Pick<AdvisorHost, 'meta' | 'setSignedOut'> & Partial<Pick<AdvisorHost, 'setStale'>>, inner: typeof fetch): typeof fetch {
199
199
  const wrapped = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
200
200
  const url = new URL(input instanceof Request ? input.url : String(input), location.href)