rvlib-shipkit 2.25.0 → 2.27.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 (456) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/package.json +2 -2
  3. package/src/agent-time/diet.ts +77 -0
  4. package/src/agent-time/family.ts +72 -0
  5. package/src/agent-time/hooks.ts +331 -0
  6. package/src/agent-time/limits.ts +44 -0
  7. package/src/agent-time/live.ts +1 -3
  8. package/src/agent-time/mask.ts +96 -18
  9. package/src/agent-time/refused.ts +45 -0
  10. package/src/agent-time/render.ts +130 -17
  11. package/src/agent-time/report-cache.ts +57 -0
  12. package/src/agent-time/report.ts +349 -23
  13. package/src/agent-time/shape.ts +50 -3
  14. package/src/agent-time/store.ts +370 -95
  15. package/src/agent-time/timeline.ts +140 -21
  16. package/src/agent-time/turns.ts +18 -8
  17. package/src/annex/offload.ts +17 -6
  18. package/src/annex/tidy.ts +70 -10
  19. package/src/asks/ask-after.ts +40 -0
  20. package/src/asks/asks-queue.ts +205 -47
  21. package/src/assets/kit-config.ts +7 -3
  22. package/src/assets/kits/identity-kit.ts +289 -10
  23. package/src/check.ts +3 -1
  24. package/src/checks/SK004-gitignore-policy.check.ts +12 -5
  25. package/src/checks/SK013-one-way-in-policy.check.ts +8 -3
  26. package/src/checks/SK026-asks-autoclose.check.ts +5 -5
  27. package/src/checks/SK028-readme.check.ts +7 -66
  28. package/src/checks/SK030-cache-audit.check.ts +6 -1
  29. package/src/checks/SK031-trace-audit.check.ts +2 -0
  30. package/src/checks/SK033-global-contribution.check.ts +3 -1
  31. package/src/checks/SK035-public-clean.check.ts +2 -2
  32. package/src/checks/SK043-scratch-on-the-mac.check.ts +59 -4
  33. package/src/checks/SK045-slow-hooks.check.ts +47 -0
  34. package/src/checks/SK046-hook-records.check.ts +76 -0
  35. package/src/checks/SK047-login-in-description.check.ts +36 -0
  36. package/src/checks/SK048-one-local-file.check.ts +36 -0
  37. package/src/cli/cmd_Asks.ts +71 -5
  38. package/src/cli/cmd_Backup.ts +5 -3
  39. package/src/cli/cmd_Capacity.ts +2 -2
  40. package/src/cli/cmd_CrossRepoActivity.ts +5 -4
  41. package/src/cli/cmd_Db.ts +253 -0
  42. package/src/cli/cmd_History.ts +212 -0
  43. package/src/cli/cmd_Home.ts +31 -3
  44. package/src/cli/cmd_Hq.ts +516 -0
  45. package/src/cli/cmd_Machines.ts +36 -0
  46. package/src/cli/cmd_Media.ts +38 -6
  47. package/src/cli/cmd_Mv.ts +1 -1
  48. package/src/cli/cmd_Reflect.ts +23 -2
  49. package/src/cli/cmd_Releases.ts +30 -0
  50. package/src/cli/cmd_Review.ts +569 -118
  51. package/src/cli/cmd_Secret.ts +62 -12
  52. package/src/cli/cmd_Social.ts +83 -1
  53. package/src/cli/cmd_Space.ts +324 -0
  54. package/src/cli/cmd_Time.ts +82 -5
  55. package/src/cli/cmd_Tmp.ts +28 -4
  56. package/src/cli/cmd_Trailer.ts +14 -10
  57. package/src/cli/cmd_Urls.ts +56 -0
  58. package/src/cli/cmd_Vault.ts +583 -0
  59. package/src/cli/family-help.ts +4 -2
  60. package/src/cli/family-pages.ts +1 -1
  61. package/src/cli/registry.ts +26 -4
  62. package/src/collections/actions.ts +63 -13
  63. package/src/collections/collection-types.ts +23 -1
  64. package/src/collections/providers.ts +117 -23
  65. package/src/collections/review.ts +4 -4
  66. package/src/commands/runner.ts +5 -1
  67. package/src/contracts/contract-manifests.ts +6 -5
  68. package/src/contracts/contract-types.ts +6 -4
  69. package/src/contracts/contracts-engine.ts +11 -0
  70. package/src/contracts/manifests/chrome-web-store.contract.ts +31 -0
  71. package/src/core/budget.ts +12 -17
  72. package/src/core/capacity.ts +27 -18
  73. package/src/core/check-runner.ts +7 -4
  74. package/src/core/history-files.ts +9 -5
  75. package/src/core/layout.ts +3 -0
  76. package/src/core/machine-busy.ts +127 -0
  77. package/src/core/machine-commit.ts +6 -1
  78. package/src/core/machine-db.ts +368 -20
  79. package/src/core/machine-layout.ts +137 -0
  80. package/src/core/machine-read.ts +81 -0
  81. package/src/core/migrate-layout.ts +1 -1
  82. package/src/core/one-way-in-policy.ts +64 -7
  83. package/src/core/polling-policy.ts +27 -0
  84. package/src/core/retention.ts +16 -2
  85. package/src/core/scope.ts +107 -14
  86. package/src/core/signal-name.ts +6 -0
  87. package/src/core/slots.ts +5 -4
  88. package/src/core/trace-audit.ts +6 -1
  89. package/src/core/transient.ts +6 -0
  90. package/src/drill/clean.ts +25 -1
  91. package/src/drill/run.ts +2 -2
  92. package/src/drill/seal.ts +27 -4
  93. package/src/home/activity-shape.ts +2 -0
  94. package/src/home/activity.ts +66 -3
  95. package/src/home/app-sign.ts +15 -4
  96. package/src/home/daemon-jobs.ts +149 -7
  97. package/src/home/database-projects.ts +111 -0
  98. package/src/home/database-words.ts +203 -0
  99. package/src/home/databases.ts +460 -0
  100. package/src/home/global-units.ts +6 -0
  101. package/src/home/gui-app/ShipkitGui.swift +122 -1
  102. package/src/home/gui-app.ts +6 -3
  103. package/src/home/home-move.ts +514 -0
  104. package/src/home/home-paths.ts +12 -3
  105. package/src/home/home-routes.ts +68 -0
  106. package/src/home/inbox-shape.ts +24 -14
  107. package/src/home/machine-fold.ts +820 -0
  108. package/src/home/machine-host.ts +20 -5
  109. package/src/home/machine-repair.ts +503 -0
  110. package/src/home/machine-stores.ts +66 -15
  111. package/src/home/machine-temp.ts +547 -86
  112. package/src/home/resume.ts +79 -0
  113. package/src/home/run-daemon.ts +25 -4
  114. package/src/home/run-pm.ts +18 -5
  115. package/src/home/serve-daemon.ts +18 -3
  116. package/src/home/serve-web.ts +175 -7
  117. package/src/home/space-job.ts +115 -0
  118. package/src/home/space-page.ts +257 -0
  119. package/src/home/space-route.ts +167 -0
  120. package/src/home/space-words.ts +103 -0
  121. package/src/home/time-page-shape.ts +202 -0
  122. package/src/home/time-page.ts +64 -0
  123. package/src/home/vault-page.ts +482 -0
  124. package/src/home/vault-words.ts +132 -0
  125. package/src/hooks/leak-guard.ts +40 -13
  126. package/src/hooks/one-way-in-guard.ts +17 -4
  127. package/src/hq/cards.ts +581 -0
  128. package/src/hq/door-route.ts +43 -0
  129. package/src/hq/door.ts +163 -0
  130. package/src/hq/files-send.ts +348 -0
  131. package/src/hq/forgotten-log.ts +35 -0
  132. package/src/hq/history-check.ts +255 -0
  133. package/src/hq/history-place.ts +146 -0
  134. package/src/hq/history-send.ts +487 -0
  135. package/src/hq/hq-db.ts +99 -0
  136. package/src/hq/hq-local.ts +469 -0
  137. package/src/hq/hq-routes.ts +196 -0
  138. package/src/hq/hq-store.ts +599 -0
  139. package/src/hq/kinds/ask.ts +147 -0
  140. package/src/hq/kinds/card-gone.ts +83 -0
  141. package/src/hq/kinds/card-msg.ts +66 -0
  142. package/src/hq/kinds/card.ts +99 -0
  143. package/src/hq/kinds/index.ts +21 -0
  144. package/src/hq/kinds/kind.ts +126 -0
  145. package/src/hq/kinds/media.ts +125 -0
  146. package/src/hq/kinds/prompt.ts +219 -0
  147. package/src/hq/kinds/reflection.ts +128 -0
  148. package/src/hq/kinds/report.ts +55 -0
  149. package/src/hq/kinds/time-day.ts +236 -0
  150. package/src/hq/ledger.ts +473 -0
  151. package/src/hq/machine-key.ts +44 -0
  152. package/src/hq/machine-notes.ts +131 -0
  153. package/src/hq/outbox.ts +372 -0
  154. package/src/hq/replica.ts +168 -0
  155. package/src/hq/repo-id.ts +4 -0
  156. package/src/hq/report-facts.ts +117 -0
  157. package/src/hq/report.ts +274 -0
  158. package/src/hq/switch.ts +151 -0
  159. package/src/hq/vault-grant.ts +92 -0
  160. package/src/identities/identities.ts +15 -3
  161. package/src/identities/steps.ts +31 -0
  162. package/src/ledger/db.ts +73 -26
  163. package/src/ledger/gate-checks.ts +29 -4
  164. package/src/ledger/git-key.ts +3 -3
  165. package/src/ledger/git-scan.ts +49 -7
  166. package/src/ledger/run-log.ts +11 -3
  167. package/src/ledger/store.ts +26 -4
  168. package/src/media-store/backup/daemon.ts +36 -17
  169. package/src/media-store/backup/kept.ts +241 -0
  170. package/src/media-store/backup/restore.ts +14 -4
  171. package/src/media-store/backup/run.ts +11 -11
  172. package/src/media-store/backup/secret.ts +6 -4
  173. package/src/media-store/backup/snapshot.ts +4 -2
  174. package/src/media-store/backup/sources.ts +68 -20
  175. package/src/media-store/copy/config.ts +77 -0
  176. package/src/media-store/copy/copy.ts +194 -0
  177. package/src/media-store/copy/lifecycle.ts +43 -0
  178. package/src/media-store/copy/night.ts +90 -0
  179. package/src/media-store/copy/proof.ts +151 -0
  180. package/src/media-store/copy/snapshot.ts +152 -0
  181. package/src/media-store/copy/store.ts +62 -0
  182. package/src/media-store/copy/stream.ts +176 -0
  183. package/src/media-store/daemon.ts +66 -16
  184. package/src/media-store/db.ts +22 -11
  185. package/src/media-store/forget.ts +23 -3
  186. package/src/media-store/hand.ts +4 -3
  187. package/src/media-store/hq-find.ts +75 -0
  188. package/src/media-store/hq-send.ts +277 -0
  189. package/src/media-store/kind.ts +2 -0
  190. package/src/media-store/purge.ts +18 -15
  191. package/src/media-store/put.ts +24 -8
  192. package/src/media-store/remote.ts +16 -7
  193. package/src/media-store/space-listing.ts +240 -0
  194. package/src/media-store/space.ts +40 -21
  195. package/src/media-store/sync.ts +5 -5
  196. package/src/media-store/tidy.ts +98 -0
  197. package/src/media-store/upload.ts +3 -3
  198. package/src/media-store/webp.ts +66 -0
  199. package/src/messages/model.ts +16 -7
  200. package/src/messages/routes.ts +14 -4
  201. package/src/messages/score.ts +2 -2
  202. package/src/messages/suggest.ts +96 -0
  203. package/src/pages/frame-client.ts +10 -0
  204. package/src/plan/planner.ts +28 -17
  205. package/src/recordings/media-kind.ts +1 -0
  206. package/src/recordings/model.ts +1 -1
  207. package/src/recordings/recorder-app/Capture.swift +9 -7
  208. package/src/reflect/hq-corpus.ts +56 -0
  209. package/src/reflect/prompt-corpus.ts +3 -1
  210. package/src/reflect/transcript.ts +146 -36
  211. package/src/release/machine-words.ts +67 -0
  212. package/src/release/public-clean.ts +8 -3
  213. package/src/releases/from-card.ts +1 -1
  214. package/src/releases/model.ts +18 -0
  215. package/src/releases/routes.ts +10 -5
  216. package/src/releases/store.ts +23 -2
  217. package/src/repo-config.ts +42 -2
  218. package/src/review/anim.ts +2 -2
  219. package/src/review/auto.ts +2 -2
  220. package/src/review/card-db.ts +244 -0
  221. package/src/review/card-rows.ts +266 -0
  222. package/src/review/cells.ts +76 -5
  223. package/src/review/draft-card.ts +41 -0
  224. package/src/review/draft-model.ts +78 -0
  225. package/src/review/format.ts +29 -10
  226. package/src/review/gone.ts +98 -0
  227. package/src/review/inbox-hook.ts +35 -0
  228. package/src/review/marks.ts +1 -1
  229. package/src/review/media-kind.ts +7 -5
  230. package/src/review/media-read.ts +9 -7
  231. package/src/review/media.ts +32 -5
  232. package/src/review/model.ts +214 -45
  233. package/src/review/move.ts +491 -0
  234. package/src/review/notes.ts +12 -20
  235. package/src/review/previews.ts +15 -19
  236. package/src/review/project.ts +1 -1
  237. package/src/review/rev.ts +8 -0
  238. package/src/review/role.ts +1 -1
  239. package/src/review/routes.ts +64 -13
  240. package/src/review/stage-card.ts +8 -4
  241. package/src/review/stage-routes.ts +1 -1
  242. package/src/review/store.ts +529 -83
  243. package/src/review/thread-fold.ts +51 -0
  244. package/src/review/threads.ts +147 -9
  245. package/src/review/trailer-auto-mock.ts +63 -0
  246. package/src/review/trailer-card.ts +4 -4
  247. package/src/review/trailer-desk.ts +41 -7
  248. package/src/review/trailer-media.ts +1 -0
  249. package/src/review/trailer-model.ts +8 -0
  250. package/src/review/trailer-notes.ts +1 -1
  251. package/src/review/trailer-routes.ts +9 -1
  252. package/src/review/unit.ts +6 -6
  253. package/src/review/watchers.ts +1 -1
  254. package/src/rules/untrack-generated.ts +92 -8
  255. package/src/secrets/held.ts +16 -0
  256. package/src/secrets/keychain.ts +113 -0
  257. package/src/secrets/list.ts +16 -6
  258. package/src/secrets/manager.ts +24 -10
  259. package/src/secrets/read.ts +257 -0
  260. package/src/secrets/who-reads.ts +49 -0
  261. package/src/serve/door-forward.ts +268 -0
  262. package/src/serve/door-names.ts +47 -0
  263. package/src/serve/embed.ts +1 -1
  264. package/src/serve/hub-app/activity-view.tsx +56 -32
  265. package/src/serve/hub-app/activity.css +7 -1
  266. package/src/serve/hub-app/asks-page.tsx +48 -0
  267. package/src/serve/hub-app/asks-st.ts +25 -0
  268. package/src/serve/hub-app/clock-svc.ts +1 -2
  269. package/src/serve/hub-app/col-card.tsx +64 -13
  270. package/src/serve/hub-app/col-list-page.tsx +122 -0
  271. package/src/serve/hub-app/col-list-st.ts +103 -0
  272. package/src/serve/hub-app/col-tables-view.tsx +10 -41
  273. package/src/serve/hub-app/col-tables.ts +76 -8
  274. package/src/serve/hub-app/cols-svc.ts +70 -16
  275. package/src/serve/hub-app/database-st.ts +260 -0
  276. package/src/serve/hub-app/database-view.tsx +289 -0
  277. package/src/serve/hub-app/database.css +32 -0
  278. package/src/serve/hub-app/entry-bar.css +14 -0
  279. package/src/serve/hub-app/entry-bar.tsx +33 -0
  280. package/src/serve/hub-app/entry-pick.ts +31 -0
  281. package/src/serve/hub-app/floating.tsx +1 -0
  282. package/src/serve/hub-app/hash-route.ts +11 -1
  283. package/src/serve/hub-app/header-bar.tsx +14 -18
  284. package/src/serve/hub-app/home-st.ts +89 -9
  285. package/src/serve/hub-app/home-strip.css +5 -19
  286. package/src/serve/hub-app/home-strip.tsx +58 -92
  287. package/src/serve/hub-app/home.html +7 -0
  288. package/src/serve/hub-app/hub-app.tsx +31 -142
  289. package/src/serve/hub-app/hub-types.ts +3 -1
  290. package/src/serve/hub-app/hub.css +109 -23
  291. package/src/serve/hub-app/icons.tsx +18 -1
  292. package/src/serve/hub-app/identities-st.ts +56 -6
  293. package/src/serve/hub-app/identities-view.tsx +100 -58
  294. package/src/serve/hub-app/identities.css +17 -15
  295. package/src/serve/hub-app/identity-address.ts +5 -0
  296. package/src/serve/hub-app/inbox-st.ts +41 -24
  297. package/src/serve/hub-app/inbox-view.tsx +37 -41
  298. package/src/serve/hub-app/inbox.css +2 -5
  299. package/src/serve/hub-app/index.html +7 -0
  300. package/src/serve/hub-app/kept-cols.tsx +7 -0
  301. package/src/serve/hub-app/keys.ts +28 -15
  302. package/src/serve/hub-app/later.tsx +26 -0
  303. package/src/serve/hub-app/list-filter.tsx +14 -0
  304. package/src/serve/hub-app/list-walk.ts +72 -3
  305. package/src/serve/hub-app/machines-st.ts +251 -0
  306. package/src/serve/hub-app/machines-view.tsx +224 -0
  307. package/src/serve/hub-app/machines.css +76 -0
  308. package/src/serve/hub-app/md-copy.tsx +79 -0
  309. package/src/serve/hub-app/media-view.tsx +2 -0
  310. package/src/serve/hub-app/messages/messages-page.tsx +79 -7
  311. package/src/serve/hub-app/messages/messages-st.ts +99 -3
  312. package/src/serve/hub-app/messages.css +14 -0
  313. package/src/serve/hub-app/page-keys.ts +175 -0
  314. package/src/serve/hub-app/pages-frames.tsx +11 -3
  315. package/src/serve/hub-app/palette-st.ts +58 -11
  316. package/src/serve/hub-app/palette-view.tsx +3 -1
  317. package/src/serve/hub-app/project-list.css +54 -8
  318. package/src/serve/hub-app/project-list.tsx +128 -59
  319. package/src/serve/hub-app/projects-svc.ts +78 -7
  320. package/src/serve/hub-app/reader-chips.tsx +13 -0
  321. package/src/serve/hub-app/readme-view.tsx +2 -3
  322. package/src/serve/hub-app/readme.css +27 -5
  323. package/src/serve/hub-app/reflections-page.tsx +42 -0
  324. package/src/serve/hub-app/reflections-st.ts +17 -0
  325. package/src/serve/hub-app/releases/releases-page.tsx +25 -2
  326. package/src/serve/hub-app/releases/releases-st.ts +1 -1
  327. package/src/serve/hub-app/repo-sections.ts +9 -5
  328. package/src/serve/hub-app/repo-st.ts +35 -8
  329. package/src/serve/hub-app/review/draft-card.tsx +163 -0
  330. package/src/serve/hub-app/review/kit.tsx +50 -7
  331. package/src/serve/hub-app/review/note-place.ts +1 -1
  332. package/src/serve/hub-app/review/review-board.tsx +2 -2
  333. package/src/serve/hub-app/review/review-cells.tsx +145 -65
  334. package/src/serve/hub-app/review/review-kit.ts +27 -1
  335. package/src/serve/hub-app/review/review-list.tsx +68 -30
  336. package/src/serve/hub-app/review/review-page.tsx +7 -8
  337. package/src/serve/hub-app/review/review-st.ts +111 -24
  338. package/src/serve/hub-app/review/review-thread.tsx +49 -19
  339. package/src/serve/hub-app/review/review-views.tsx +475 -144
  340. package/src/serve/hub-app/review/thread-control-st.ts +115 -0
  341. package/src/serve/hub-app/review/thread-control.tsx +74 -0
  342. package/src/serve/hub-app/review/thread-st.ts +73 -26
  343. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  344. package/src/serve/hub-app/review/trailer-page.tsx +37 -16
  345. package/src/serve/hub-app/review/trailer-st.ts +41 -7
  346. package/src/serve/hub-app/review.css +267 -61
  347. package/src/serve/hub-app/side-lists.ts +72 -0
  348. package/src/serve/hub-app/sidebar.tsx +6 -3
  349. package/src/serve/hub-app/site/site-part.tsx +2 -8
  350. package/src/serve/hub-app/site/site-st.ts +4 -4
  351. package/src/serve/hub-app/social/comms-page.tsx +20 -5
  352. package/src/serve/hub-app/social/kit.tsx +30 -4
  353. package/src/serve/hub-app/social/post-card.tsx +139 -49
  354. package/src/serve/hub-app/social/serial-writes.ts +13 -0
  355. package/src/serve/hub-app/social/social-model.ts +11 -0
  356. package/src/serve/hub-app/social/social-page.tsx +94 -35
  357. package/src/serve/hub-app/social/social-st.ts +120 -36
  358. package/src/serve/hub-app/social/stage-popup.tsx +1 -1
  359. package/src/serve/hub-app/social/stage-st.ts +1 -1
  360. package/src/serve/hub-app/social/step-layout.ts +1 -1
  361. package/src/serve/hub-app/social.css +3 -0
  362. package/src/serve/hub-app/space-st.ts +209 -0
  363. package/src/serve/hub-app/space-view.tsx +196 -0
  364. package/src/serve/hub-app/space.css +27 -0
  365. package/src/serve/hub-app/stores/stores-page.tsx +91 -23
  366. package/src/serve/hub-app/stores/stores-st.ts +44 -19
  367. package/src/serve/hub-app/stores.css +6 -1
  368. package/src/serve/hub-app/theme-st.ts +22 -9
  369. package/src/serve/hub-app/time-charts.tsx +291 -0
  370. package/src/serve/hub-app/time-pages.tsx +749 -0
  371. package/src/serve/hub-app/time-st.ts +162 -0
  372. package/src/serve/hub-app/time-view.tsx +76 -0
  373. package/src/serve/hub-app/time.css +138 -0
  374. package/src/serve/hub-app/tree-build.ts +52 -42
  375. package/src/serve/hub-app/tree-row.tsx +4 -4
  376. package/src/serve/hub-app/tree-svc.ts +18 -9
  377. package/src/serve/hub-app/urls-svc.ts +154 -0
  378. package/src/serve/hub-app/urls-view.tsx +117 -0
  379. package/src/serve/hub-app/urls.css +30 -0
  380. package/src/serve/hub-app/vault-st.ts +127 -0
  381. package/src/serve/hub-app/vault-view.tsx +154 -0
  382. package/src/serve/hub-app/vault.css +38 -0
  383. package/src/serve/hub-app/veille/veille-st.ts +12 -10
  384. package/src/serve/hub-app/waiting-svc.ts +29 -0
  385. package/src/serve/hub-app/wikis-view.tsx +2 -2
  386. package/src/serve/hub-runtime.ts +15 -2
  387. package/src/serve/project-gutter-route.ts +27 -14
  388. package/src/serve/project-gutter.ts +25 -12
  389. package/src/serve/same-origin.ts +10 -0
  390. package/src/serve/serve-hub.ts +13 -4
  391. package/src/shipkit-files.ts +16 -2
  392. package/src/shipkit.ts +1 -1
  393. package/src/shot/shooter.ts +616 -420
  394. package/src/shot/shot-ask.ts +246 -155
  395. package/src/site/desk.ts +2 -2
  396. package/src/smoke/run-smoke.ts +3 -2
  397. package/src/social/cover.ts +202 -0
  398. package/src/social/discord-layout.ts +37 -13
  399. package/src/social/drafts.ts +3 -0
  400. package/src/social/load.ts +23 -2
  401. package/src/social/media-kind.ts +2 -1
  402. package/src/social/publish/discord.ts +5 -2
  403. package/src/social/publish/secret.ts +2 -2
  404. package/src/social/release-stage.ts +28 -13
  405. package/src/social/routes.ts +26 -1
  406. package/src/social/stage.ts +1 -1
  407. package/src/social/stats.ts +12 -9
  408. package/src/social/strip.ts +4 -1
  409. package/src/social/thumbnail.ts +255 -0
  410. package/src/stores/collection.ts +15 -11
  411. package/src/stores/desk.ts +236 -42
  412. package/src/stores/model.ts +72 -6
  413. package/src/stores/routes.ts +37 -12
  414. package/src/stores/unit.ts +14 -8
  415. package/src/suite/judge-suites.ts +113 -16
  416. package/src/suite/select.ts +45 -3
  417. package/src/suite/suite-cli.ts +81 -34
  418. package/src/trailer/bed.ts +1 -1
  419. package/src/trailer/build.ts +134 -21
  420. package/src/trailer/ffmpeg.ts +7 -0
  421. package/src/trailer/fonts.ts +3 -2
  422. package/src/trailer/grammar.ts +201 -2
  423. package/src/trailer/graph.ts +42 -5
  424. package/src/trailer/look.ts +21 -0
  425. package/src/trailer/mock.ts +154 -0
  426. package/src/trailer/passage.ts +65 -26
  427. package/src/trailer/score/heard.ts +89 -0
  428. package/src/trailer/score/sound.ts +14 -8
  429. package/src/trailer/sound/run.ts +16 -6
  430. package/src/trailer/stitch.ts +26 -5
  431. package/src/trailer/titles.ts +82 -19
  432. package/src/trailer/versions.ts +1 -3
  433. package/src/trailer/vertical.ts +3 -1
  434. package/src/urls/frame.ts +195 -0
  435. package/src/urls/routes.ts +43 -0
  436. package/src/urls/rows.ts +171 -0
  437. package/src/urls/unit.ts +73 -0
  438. package/src/vault/house-keys.ts +42 -0
  439. package/src/vault/layout.ts +50 -0
  440. package/src/vault/policy.ts +165 -0
  441. package/src/vault/vault-audit.ts +276 -0
  442. package/src/vault/vault-client.ts +40 -0
  443. package/src/vault/vault-config.ts +159 -0
  444. package/src/vault/vault-destroy.ts +78 -0
  445. package/src/vault/vault-handover.ts +305 -0
  446. package/src/vault/vault-http.ts +352 -0
  447. package/src/vault/vault-import.ts +208 -0
  448. package/src/vault/vault-init.ts +328 -0
  449. package/src/vault/vault-minter.ts +271 -0
  450. package/src/vault/vault-restore.ts +333 -0
  451. package/src/vault/vault-serve.ts +342 -0
  452. package/src/vault/vault-snapshot.ts +281 -0
  453. package/src/veille/asks.ts +1 -1
  454. package/src/veille/desk.ts +2 -2
  455. package/src/wiki/run-wiki.ts +2 -1
  456. package/src/wiki/scan-md.ts +42 -2
@@ -2,8 +2,15 @@
2
2
  // on the Mac's own disk, links not followed, stay under the cap (`annex.capGb`, else the house's `serve.annexScratch`,
3
3
  // else 20 GB). A folder born on the annex or moved there is a link and counts nothing; a spill counts whole. It warns,
4
4
  // never fails: the daemon's annex job moves stale scratch by itself in a repo that declared `annex`, and this row says
5
- // when it could not, with the one command that runs the pass now; in a repo that declared none, it names the opt in
5
+ // when it could not, with the one command that runs the pass now; in a repo that declared none, it names the opt in.
6
+ // It also tells the repo what the machine's temp sweep takes from its `.shipkit/tmp` (home/machine-temp.ts): each
7
+ // folder its annex config declares there, which belongs in `.shipkit/cache/`, and before the sweep's start date what
8
+ // would go and from when
9
+ import { realpathSync } from 'node:fs'
10
+ import { join } from 'node:path'
6
11
  import { check } from '../check.ts'
12
+ import { LAYOUT } from '../core/layout.ts'
13
+ import { BIG_WAIT_MS, dayOf, LIVE_NAME_MS, type TempUse } from '../home/machine-temp.ts'
7
14
 
8
15
  const GB = 1e9
9
16
 
@@ -15,11 +22,53 @@ export function scratchProblem(bytes: number, capGb: number, opted = true): stri
15
22
  return `${(bytes / GB).toFixed(1)} GB of .shipkit/tmp and .shipkit/cache on the Mac, over its ${capGb} GB cap: sk annex tidy moves stale scratch to the annex now (sk annex tidy --dry lists it first); a folder that must live there from its first byte goes in annex.born of repo.config.ts`
16
23
  }
17
24
 
25
+ /** a warning for each folder the annex config declares under `.shipkit/tmp`: the machine's sweep empties it every day,
26
+ * so what is kept or lives on the annex belongs in `.shipkit/cache/` */
27
+ export function declaredInTmp(declared: readonly string[]): string[] {
28
+ return declared.filter((d) => d.startsWith(`${LAYOUT.tmp}/`)).map((d) => `${d} is declared in the annex config, yet .shipkit/tmp is emptied every day: move it to ${d.replace(LAYOUT.tmp, '.shipkit/cache')} (the folder and its line in repo.config.ts); the sweep never takes it while it is declared`)
29
+ }
30
+
31
+ /** what the machine's temp sweep would delete in the repo's `.shipkit/tmp`, and from when, while its start date has not
32
+ * come: null once it deletes, with no date set, or with nothing to go */
33
+ export function tmpNotice(root: string, use: TempUse | null, from: number | null, now: number): string | null {
34
+ if (from == null || now >= from || use == null) return null
35
+ let real = join(root, LAYOUT.tmp)
36
+ try { real = realpathSync(real) } catch { return null }
37
+ const p = use.passes.find((x) => x.root === real && x.notice === true)
38
+ if (p == null || p.dropped === 0) return null
39
+ const names = (p.going ?? []).slice(0, 3).map((u) => `${u.path.slice(real.length + 1)} (${(u.bytes / GB).toFixed(2)} GB)`).join(', ')
40
+ return `from ${dayOf(from)} the machine's temp sweep deletes what nothing wrote for a day in .shipkit/tmp: ${p.dropped} units, ${(p.freed / GB).toFixed(2)} GB would go now (${names}); what must still exist tomorrow goes in .shipkit/cache/ or the Space (sk media put)`
41
+ }
42
+
43
+ /** the big units of the repo's `.shipkit/tmp` the last pass kept because no annex took them, and from when each goes:
44
+ * null with none */
45
+ export function waitingNotice(root: string, use: TempUse | null): string | null {
46
+ if (use == null) return null
47
+ let real = join(root, LAYOUT.tmp)
48
+ try { real = realpathSync(real) } catch { return null }
49
+ const w = use.passes.find((x) => x.root === real)?.waiting ?? []
50
+ if (w.length === 0) return null
51
+ const names = w.slice(0, 3).map((u) => `${u.path.slice(real.length + 1)} (${(u.bytes / GB).toFixed(2)} GB, goes ${dayOf(u.at + BIG_WAIT_MS)})`).join(', ')
52
+ return `${w.length} big units of .shipkit/tmp wait for the annex: plug it in and they move there, else each is deleted once idle ${BIG_WAIT_MS / 86_400_000} days: ${names}`
53
+ }
54
+
55
+ /** the units of the repo's `.shipkit/tmp` kept for a database or a lock and idle LIVE_NAME_MS at `now`: no pass takes
56
+ * them, so a person or the repo's agent decides; null with none */
57
+ export function liveStateNotice(root: string, use: TempUse | null, now: number): string | null {
58
+ if (use == null) return null
59
+ let real = join(root, LAYOUT.tmp)
60
+ try { real = realpathSync(real) } catch { return null }
61
+ const old = (use.passes.find((x) => x.root === real)?.live?.old ?? []).filter((u) => now - u.at >= LIVE_NAME_MS)
62
+ if (old.length === 0) return null
63
+ const names = old.slice(0, 5).map((u) => `${u.path.slice(real.length + 1)} (idle ${Math.floor((now - u.at) / 86_400_000)} d)`).join(', ')
64
+ return `${old.length} units of .shipkit/tmp hold a database or a lock, idle ${LIVE_NAME_MS / 86_400_000} days or more, and no sweep takes them: ${names}; move what is kept to .shipkit/cache/, delete the rest`
65
+ }
66
+
18
67
  export const scratchOnTheMac = check({
19
68
  id: 'SK043',
20
69
  blocking: false,
21
70
  title: 'scratch on the Mac',
22
- description: "this repo's .shipkit/tmp and .shipkit/cache on the Mac's disk stay under the scratch cap",
71
+ description: "scratch on the Mac stays under its cap, and nothing kept is declared in .shipkit/tmp",
23
72
  owner: 'tools/shipkit/annex.md',
24
73
  runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: false, onHealth: true, onSave: false, onClock: false },
25
74
  cache: { by: 'never', why: 'it measures scratch outside git, one du of about half a second' },
@@ -34,11 +83,17 @@ export const scratchOnTheMac = check({
34
83
  const p = policyOf(houseScratch, c.config.annex ?? {})
35
84
  const { offloads } = await import('../annex/offload.ts')
36
85
  const { held, heldWords, localSnapshots } = await import('../annex/snapshots.ts')
86
+ const { reposFrom, tempUse } = await import('../home/machine-temp.ts')
37
87
  const bytes = scratchOnMac(c.root)
38
88
  const why = scratchProblem(bytes, p.capGb, c.config.annex !== undefined)
39
89
  const words = heldWords(held(offloads().filter((x) => x.repo === c.root), localSnapshots()))
40
- if (why) c.warn(words ? `${why}; ${words}` : why)
41
- else c.ok(`${(bytes / GB).toFixed(1)} GB of scratch on the Mac, cap ${p.capGb} GB${words ? `; ${words}` : ''}`)
90
+ const use = tempUse()
91
+ const notice = tmpNotice(c.root, use, reposFrom(), Date.now())
92
+ const waiting = waitingNotice(c.root, use)
93
+ const live = liveStateNotice(c.root, use, Date.now())
94
+ const warns = [...(why ? [words ? `${why}; ${words}` : why] : []), ...declaredInTmp([...p.born, ...p.keep]), ...[notice, waiting, live].filter((w): w is string => w != null)]
95
+ for (const w of warns) c.warn(w)
96
+ if (warns.length === 0) c.ok(`${(bytes / GB).toFixed(1)} GB of scratch on the Mac, cap ${p.capGb} GB${words ? `; ${words}` : ''}`)
42
97
  },
43
98
  })
44
99
 
@@ -0,0 +1,47 @@
1
+ // SK045 slow hooks (tools/shipkit/built-in-checks-repo-wiring.md): a hook the repo's .claude settings run on every
2
+ // tool call answers under its budget, judged on what the gate itself can tell. A hook that takes a Bash call is
3
+ // probed on a no-op Bash call; any other (a save hook) fails unless repo.config.ts declares it instant with the
4
+ // reason. The runs the harness recorded are the world, read by SK046 as a warning. A user level hook is the
5
+ // machine's: judged in the house repo only, as a warning. agent-time/hooks.ts owns the budget, the probe and the verdict.
6
+ import { check, type CheckCtx } from '../check.ts'
7
+ import { INSTANT_KEY, REPO_SETTINGS, hasHooks, hooksKey, isHouse, repoHooks, userHooks, userSettingsFiles } from '../agent-time/hooks.ts'
8
+
9
+ async function body(c: CheckCtx): Promise<void> {
10
+ const { cadenceOf, judgeGate, probeHook, probeable } = await import('../agent-time/hooks.ts')
11
+ const { hooks: own, broken } = repoHooks(c.root)
12
+ for (const b of broken) c.fail(`${b} is not JSON: Claude Code loads none of its hooks either`, `fix the JSON of ${b}`)
13
+ const machine = isHouse(c.root) ? userHooks() : []
14
+ const instant = c.config.instantHooks ?? {}
15
+ const perCall = [...own, ...machine].filter((h) => cadenceOf(h.event) === 'call')
16
+ for (const h of perCall) {
17
+ const v = judgeGate(h, probeable(h) ? await probeHook(h, c.root) : null, { instant: instant[h.command], machine: h.source === 'user' })
18
+ if (v.level === 'fail') c.fail(v.text, v.fix)
19
+ else if (v.level === 'warn') c.warn(v.text, v.fix)
20
+ else c.ok(v.text)
21
+ }
22
+ const named = new Set([...own, ...machine].map((h) => h.command))
23
+ for (const command of Object.keys(instant))
24
+ if (!named.has(command)) c.warn(`repo.config.ts ${INSTANT_KEY} names \`${command}\`, which no settings hook runs`, `drop the entry, or copy the command exactly as .claude/settings.json writes it`)
25
+ if (perCall.length === 0 && broken.length === 0) c.ok('no hook on a tool call')
26
+ }
27
+
28
+ export const slowHooks = check({
29
+ id: 'SK045',
30
+ blocking: true,
31
+ title: 'slow hooks',
32
+ description: 'a hook on every tool call is probed under 150 ms, or declared instant in repo.config.ts',
33
+ owner: 'tools/shipkit/built-in-checks-repo-wiring.md',
34
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: false, onHealth: true, onSave: 'moved', onClock: false },
35
+ // the settings and the declaration are the inputs; the key adds the stamp of every script a hook runs
36
+ cache: {
37
+ by: 'files',
38
+ inputs: [...REPO_SETTINGS, 'repo.config.ts'],
39
+ optional: [...REPO_SETTINGS],
40
+ key: (env) => hooksKey(env.root, [...REPO_SETTINGS, ...(isHouse(env.root) ? userSettingsFiles() : [])]),
41
+ },
42
+ fix: 'none',
43
+ applies: (env) => (hasHooks(env.root) ? null : 'no hook in .claude/settings.json or .claude/settings.local.json'),
44
+ run: body,
45
+ })
46
+
47
+ export default slowHooks
@@ -0,0 +1,76 @@
1
+ // SK046 hook records (tools/shipkit/built-in-checks-repo-wiring.md): the runs the harness timed for each hook the
2
+ // repo's .claude settings declare, read from the agent time index over every work tree of the repo's git, warn past
3
+ // the budget of their cadence. The index is the machine's (other work trees, a loaded afternoon, a fix outside the
4
+ // named script), so this reports the world and never blocks; SK045 is the gate. Each run catches the index up by a
5
+ // bounded slice, newest files first.
6
+ import { check } from '../check.ts'
7
+ import { REPO_SETTINGS, hasHooks, hooksKey, isHouse, userSettingsFiles } from '../agent-time/hooks.ts'
8
+
9
+ /** the unread transcript bytes one run may index: about a third of a second */
10
+ export const CATCH_UP_BYTES = 256 * 1024 * 1024
11
+
12
+ /** the projects of every work tree of this repo's git: one script, one command, filed under each checkout's folder */
13
+ async function familyFilter(root: string): Promise<(project: string) => boolean> {
14
+ const { gitBin } = await import('../core/git-bin.ts')
15
+ const { projectSlug } = await import('../reflect/prompt-corpus.ts')
16
+ const out = Bun.spawnSync([gitBin(), 'worktree', 'list', '--porcelain'], { cwd: root, stdout: 'pipe', stderr: 'ignore' })
17
+ const paths = out.exitCode === 0 ? out.stdout.toString().split('\n').filter((l) => l.startsWith('worktree ')).map((l) => l.slice(9)) : []
18
+ const slugs = [...new Set([root, ...paths].map(projectSlug))]
19
+ return (p) => slugs.some((s) => p === s || p.startsWith(`${s}--claude-worktrees-`))
20
+ }
21
+
22
+ type Run = import('../agent-time/store.ts').HookRun
23
+ type Recorded = { family: Run[]; all: Run[]; behind: number; error: string | null }
24
+
25
+ /** the timed hook runs of this repo's family (and of every repo for the machine's hooks), after a bounded catch up */
26
+ async function recorded(root: string, machine: boolean): Promise<Recorded> {
27
+ const { catchUpPlan, hookRuns, indexTranscripts, listTranscripts, openIndex } = await import('../agent-time/store.ts')
28
+ const { discoverConfigRoots } = await import('../reflect/prompt-corpus.ts')
29
+ const { RECORD_DAYS } = await import('../agent-time/hooks.ts')
30
+ const keep = await familyFilter(root)
31
+ const from = Date.now() - RECORD_DAYS * 86_400_000
32
+ let db: ReturnType<typeof openIndex> | null = null
33
+ try {
34
+ db = openIndex()
35
+ const plan = catchUpPlan(db, listTranscripts(discoverConfigRoots(), keep).filter((f) => f.mtime >= from), CATCH_UP_BYTES)
36
+ if (plan.take.length > 0) indexTranscripts(db, plan.take)
37
+ return { family: hookRuns(db, keep, from), all: machine ? hookRuns(db, () => true, from) : [], behind: plan.behind, error: null }
38
+ } catch (e) {
39
+ return { family: [], all: [], behind: 0, error: e instanceof Error ? e.message : String(e) }
40
+ } finally {
41
+ db?.close()
42
+ }
43
+ }
44
+
45
+ export const hookRecords = check({
46
+ id: 'SK046',
47
+ blocking: false,
48
+ title: 'hook records',
49
+ description: "the runs the harness timed for each declared hook stay under its cadence's budget",
50
+ owner: 'tools/shipkit/built-in-checks-repo-wiring.md',
51
+ runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: false, onClock: { every: '6h', inactive: 'wait' } },
52
+ cache: { by: 'ttl', span: '6h', key: (env) => hooksKey(env.root, [...REPO_SETTINGS, ...(isHouse(env.root) ? userSettingsFiles() : [])]) },
53
+ fix: 'none',
54
+ applies: (env) => (hasHooks(env.root) ? null : 'no hook in .claude/settings.json or .claude/settings.local.json'),
55
+ run: async (c) => {
56
+ const { RECORD_DAYS, cadenceOf, changedAt, judgeRecords, matcherMatches, repoHooks, userHooks } = await import('../agent-time/hooks.ts')
57
+ const machine = isHouse(c.root) ? userHooks() : []
58
+ const hooks = [...repoHooks(c.root).hooks, ...machine].filter((h) => cadenceOf(h.event) !== 'other' && h.command !== '')
59
+ if (hooks.length === 0) return void c.ok('no command hook on a tool call or a turn')
60
+ const rec = await recorded(c.root, machine.length > 0)
61
+ if (rec.error != null) {
62
+ c.unmeasured = true
63
+ return void c.warn(`the agent time index did not open: ${rec.error}`, 'sk time opens and builds it')
64
+ }
65
+ const behind = rec.behind > 0 ? `the agent time index is ${(rec.behind / 1e9).toFixed(1)} GB behind for this repo: sk time catches it up` : undefined
66
+ for (const h of hooks) {
67
+ const since = Math.max(Date.now() - RECORD_DAYS * 86_400_000, changedAt(h.command, c.root) ?? 0)
68
+ const runs = (h.source === 'user' ? rec.all : rec.family).filter((r) => r.event === h.event && r.command === h.command && r.at >= since && (cadenceOf(h.event) !== 'call' || r.tool === '' || matcherMatches(h.matcher, r.tool)))
69
+ const v = judgeRecords(h, runs.map((r) => r.ms), behind)
70
+ if (v.level === 'ok') c.ok(v.text)
71
+ else c.warn(v.text, v.fix)
72
+ }
73
+ },
74
+ })
75
+
76
+ export default hookRecords
@@ -0,0 +1,36 @@
1
+ // SK047 login in a description: no global process of the repo writes a password in its `description`. A description
2
+ // shows on the home page, in `sk gp` and in pm's status, and a unit that reads the keychain when its file loads to
3
+ // build one spawns a read in every process that loads units. A login is declared in `logins` (tools/shipkit/urls.md):
4
+ // named by where its value lives, copied by one click on the repo's urls page. It reads the unit files as text, never
5
+ // imports one, and it warns: the description still works.
6
+ import { readFileSync } from 'fs'
7
+ import { relative } from 'path'
8
+ import { check } from '../check.ts'
9
+ import { unitFilesDeclaring } from '../core/unit-files.ts'
10
+
11
+ /** a `description:` value of a unit file: a template, a single or a double quoted text */
12
+ const DESCRIPTION = /\bdescription\s*:\s*(`(?:\\[^]|[^`\\])*`|'(?:\\.|[^'\\\n])*'|"(?:\\.|[^"\\\n])*")/g
13
+ /** the word a login line starts with, then its colon or equals sign */
14
+ const PASSWORD = /\b(pass(?:word)?|passwd|pwd|mot de passe)\b[`*_\s]*[:=]/i
15
+
16
+ /** how many descriptions of a unit file's text write a password line */
17
+ export const passwordDescriptions = (text: string): number => [...text.matchAll(DESCRIPTION)].filter((m) => PASSWORD.test(m[1]!)).length
18
+
19
+ export const loginInDescription = check({
20
+ id: 'SK047',
21
+ blocking: false,
22
+ title: 'login in a description',
23
+ description: 'no global process writes a password in its description: its logins declare it',
24
+ owner: 'tools/shipkit/urls.md',
25
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
26
+ cache: { by: 'files', inputs: ['.'], key: null },
27
+ fix: 'none',
28
+ applies: (env) => (unitFilesDeclaring(env.root, 'globalProcess').length === 0 ? 'this repo declares no global process' : null),
29
+ run: (c) => {
30
+ const hits = unitFilesDeclaring(c.root, 'globalProcess').filter((f) => passwordDescriptions(readFileSync(f, 'utf8')) > 0).map((f) => relative(c.root, f))
31
+ if (hits.length === 0) return c.ok('no global process writes a password in its description')
32
+ for (const f of hits) c.warn(`${f}: a description writes a password. Declare the login in \`logins\` beside the url, { account, secret } or { file, account, password }, and drop it from the description: the repo's urls page copies it in one click (wiki tools/shipkit/urls.md)`)
33
+ },
34
+ })
35
+
36
+ export default loginInDescription
@@ -0,0 +1,36 @@
1
+ // SK048 the one local file (tools/shipkit/home.md): where this machine's fold of the media index, the agent time index
2
+ // and the daemon's file into the machine db stands (home/machine-fold.ts), said in the house repo only, since it is the machine's and
3
+ // not a repo's. It warns, never fails: a walk stopped half way, a store refused as damaged, a file this code does not
4
+ // read. The fold off is a state the owner may keep, said in its ok line, as the day, the rows and the copies once folded
5
+ import { check } from '../check.ts'
6
+
7
+ export const oneLocalFile = check({
8
+ id: 'SK048',
9
+ blocking: false,
10
+ title: 'the one local file',
11
+ description: "the media index, the agent time index and the daemon's file are tables of the machine db",
12
+ owner: 'tools/shipkit/home.md',
13
+ runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: false, onHealth: true, onSave: false, onClock: false },
14
+ cache: { by: 'never', why: 'it reads the machine db and two lstats, a few ms, and the machine moves outside git' },
15
+ fix: 'none',
16
+ applies: (env) => {
17
+ // a require at the call: the module reads the house index, never at the load of the checks
18
+ const { houseRootOf } = require('../home/home-start.ts') as typeof import('../home/home-start.ts')
19
+ return houseRootOf(env.root) === env.root ? null : "the machine's fold is said in the house repo"
20
+ },
21
+ run: async (c) => {
22
+ const { foldWords } = await import('../home/machine-fold.ts')
23
+ let words: string[]
24
+ try {
25
+ words = foldWords()
26
+ } catch (e) {
27
+ return c.warn(`the machine db does not read, the fold's state is unknown: ${(e as Error).message}`)
28
+ }
29
+ // off is a state the owner may keep; a walk half way, a damaged file or a file this code does not read is not
30
+ const stuck = words.some((w) => /half way|is damaged|shape of before the fold/.test(w))
31
+ if (stuck) for (const w of words) c.warn(w)
32
+ else c.ok(words.join('; '))
33
+ },
34
+ })
35
+
36
+ export default oneLocalFile
@@ -1,9 +1,10 @@
1
1
  // shipkit asks — the per-repo human queue: `asks` lists, `asks check`
2
- // probes + archives, `ask "<title>"` creates. Three thin commands over
3
- // asks/asks-queue.ts (the plain module owns all logic).
2
+ // probes + archives, `ask "<title>"` creates, `asks decline` is the owner's no.
3
+ // Thin commands over asks/asks-queue.ts (the plain module owns all logic).
4
4
  import { join } from 'path'
5
5
  import { Command, Option } from 'clipanion'
6
- import { checkAsks, createAsk, renderAsksTable } from '../asks/asks-queue.ts'
6
+ import { afterValue } from '../asks/ask-after.ts'
7
+ import { checkAsks, createAsk, declineAsk, openAsks, renderAsksTable } from '../asks/asks-queue.ts'
7
8
  import { loadRepoConfig } from '../repo-config.ts'
8
9
  import { LAYOUT } from '../core/layout.ts'
9
10
 
@@ -16,10 +17,24 @@ export class AsksCommand extends Command {
16
17
  static override usage = Command.Usage({
17
18
  category: 'Asks',
18
19
  description: 'list open asks — the per-repo human action queue',
19
- examples: [['list open asks', 'sk asks']],
20
+ details: '--all lists the open asks of every machine and repo, read from the hq: one row an ask, whichever machines hold it through git (an ask is named by its repo\'s remote and its file\'s name), done on one machine wins. The files stay in their repos: the hq is their index.',
21
+ examples: [['list open asks', 'sk asks'], ['every machine\'s open asks, from the hq', 'sk asks --all']],
20
22
  })
21
23
 
24
+ all = Option.Boolean('--all', false, { description: 'the open asks of every machine and repo, from the hq' })
25
+ json = Option.Boolean('--json', false, { description: 'with --all: every ask the hq holds, as json' })
26
+
22
27
  async execute(): Promise<number> {
28
+ if (this.all) {
29
+ const { asksLines, hqAsks } = await import('../hq/files-send.ts')
30
+ const r = await hqAsks()
31
+ if ('refused' in r) {
32
+ this.context.stderr.write(`FAIL: ${r.refused}\n`)
33
+ return 1
34
+ }
35
+ this.context.stdout.write(`${this.json ? JSON.stringify(r.asks) : asksLines(r.asks).join('\n')}\n`)
36
+ return 0
37
+ }
23
38
  try {
24
39
  const root = process.cwd()
25
40
  const c = await loadRepoConfig(root)
@@ -53,6 +68,43 @@ export class AsksCheckCommand extends Command {
53
68
  }
54
69
  }
55
70
 
71
+ /** an open ask by its file, its name without `.md`, or its number */
72
+ export function openAskFile(dir: string, arg: string): string {
73
+ const open = openAsks(dir).map((a) => a.file)
74
+ const n = /^\d+$/.test(arg) ? Number(arg) : null
75
+ const hit = open.filter((f) => f === arg || f === `${arg}.md` || (n != null && parseInt(f, 10) === n))
76
+ if (hit.length === 1) return hit[0]!
77
+ throw new Error(hit.length === 0 ? `no open ask ${arg} in ${dir} (sk asks lists them)` : `${arg} names ${hit.length} asks: ${hit.join(', ')}`)
78
+ }
79
+
80
+ export class AsksDeclineCommand extends Command {
81
+ static override paths = [['asks', 'decline']]
82
+ static essential = { args: '<ask>' }
83
+
84
+ static override usage = Command.Usage({
85
+ category: 'Asks',
86
+ description: "the owner's « I will not do this »: the ask closes as declined and stays declined",
87
+ details: "The owner's word, never an agent's: an agent that thinks an ask is moot says so in a remark or a report, and the owner decides. The file gets status: declined, the day and the reason, and moves to declined/. To undo, set its status back to open: the next `sk asks check` brings it back. `sk ask` then refuses the same title or secret until a fact changed after the owner's no and it is asked again on purpose with --again --why.",
88
+ examples: [['decline ask 19, with a reason', 'sk asks decline 19 --why "not worth a paid key"'], ['by its file', 'sk asks decline 019-mint-a-key.md']],
89
+ })
90
+
91
+ ask = Option.String({ required: true })
92
+ why = Option.String('--why', { required: false, description: 'the reason, one line, kept in the file for every agent that reads it' })
93
+
94
+ async execute(): Promise<number> {
95
+ try {
96
+ const dir = await asksDir(process.cwd())
97
+ const file = openAskFile(dir, this.ask)
98
+ declineAsk(dir, file, this.why)
99
+ this.context.stdout.write(`declined ${dir}/declined/${file}\nundo: set its status back to open, then sk asks check\n`)
100
+ return 0
101
+ } catch (e) {
102
+ this.context.stderr.write(`FAIL: ${e instanceof Error ? e.message : String(e)}\n`)
103
+ return 1
104
+ }
105
+ }
106
+ }
107
+
56
108
  export class AskNewCommand extends Command {
57
109
  static override paths = [['ask'], ['asks', 'new']]
58
110
  static essential = { args: '<title>' }
@@ -65,6 +117,9 @@ export class AskNewCommand extends Command {
65
117
  ['with a reason', 'sk ask "buy the domain" --why "landing page is blocked on it"'],
66
118
  ['with metadata', 'sk ask "buy the domain" --kind action --blocks deploy --check "dig +short example.com"'],
67
119
  ['a token he pastes in the hub', 'sk ask "mint the npm token" --secret rv/npm/token'],
120
+ ['a login: its account and its password, both typed in the hub', 'sk ask "the shop admin login" --login rv/shop/admin'],
121
+ ['out of the way until a day', 'sk ask "delete the old copies" --after 2d'],
122
+ ['an ask he declined, again with what changed', 'sk ask "mint the npm token" --again --why "the free tier ended"'],
68
123
  ],
69
124
  })
70
125
 
@@ -74,11 +129,22 @@ export class AskNewCommand extends Command {
74
129
  check = Option.String('--check', { required: false, description: 'shell probe that exits 0 once the ask is done (enables auto-close)' })
75
130
  why = Option.String('--why', { required: false, description: 'one line of context: why this is worth a human interrupt' })
76
131
  secret = Option.Array('--secret', { required: false, description: 'a secret name the human stores (repeat for more): a credential ask whose page takes the pasted value' })
132
+ after = Option.String('--after', { required: false, description: 'the day it waits for (YYYY-MM-DD, YYYY-MM-DDTHH:MM, 2d, 1w): later until then, not counted, not pinged' })
133
+ login = Option.Array('--login', { required: false, description: 'a secret that is a login (repeat for more): the hub takes its account (email or user name) beside its password, stored together' })
134
+ again = Option.Boolean('--again', false, { description: 'ask again what the owner declined (same title or secret), on purpose: --why says what changed' })
77
135
 
78
136
  async execute(): Promise<number> {
79
137
  try {
138
+ const after = this.after == null ? undefined : afterValue(this.after, new Date())
80
139
  const dir = await asksDir(process.cwd())
81
- const file = createAsk(dir, this.title, { kind: this.kind, blocks: this.blocks, check: this.check, why: this.why, secrets: this.secret ?? [] })
140
+ const logins = this.login ?? []
141
+ const secrets = [...new Set([...(this.secret ?? []), ...logins])]
142
+ const who = secrets.length === 0 ? {} : await (await import('../secrets/who-reads.ts')).whoReads(secrets, process.cwd())
143
+ // the vault files a secret by its registry row: a name with none is refused when he stores it, so the ask is refused first
144
+ const stray = Object.values(who).filter((w) => !w.registered).map((w) => w.name)
145
+ if (stray.length > 0) throw new Error(`--secret ${stray.join(', ')}: no row in the secret registry, so the vault would refuse the value he pastes. Add ${stray.length > 1 ? 'their rows' : 'its row'} first (the name, what it is for, its scope), then run this again`)
146
+ const readers = secrets.length === 0 ? undefined : Object.fromEntries(Object.entries(who).map(([n, w]) => [n, w.words]))
147
+ const file = createAsk(dir, this.title, { kind: this.kind, blocks: this.blocks, check: this.check, why: this.why, secrets, logins, after, again: this.again, readers })
82
148
  this.context.stdout.write(`created ${dir}/${file}\nfill every {{placeholder}} in it: the hub shows the body as written\n`)
83
149
  return 0
84
150
  } catch (e) {
@@ -54,7 +54,9 @@ export class BackupCommand extends Command {
54
54
  for (const r of list) h.out(` refused ~/${r.path}: ${r.why}`)
55
55
  }
56
56
  if (this.check) {
57
- const c = await backupCheck(h.space, { home: h.home, repos: h.repos })
57
+ // a look only: the local files as the daemon's looks keep them, never each repo's git walk again
58
+ const { keptLocals } = await import('../media-store/backup/daemon.ts')
59
+ const c = await backupCheck(h.space, { home: h.home, repos: h.repos, locals: keptLocals() })
58
60
  h.out(`${c.files} files read; the last run: ${c.last ? `${c.last.at} (${c.last.key})` : 'none'}`)
59
61
  h.out(`${c.waiting.length} not in the Space yet (${mb(c.waiting.reduce((n, w) => n + w.size, 0))}), ${c.changed.length} changed since the last run, ${c.refused.length} refused`)
60
62
  for (const w of c.waiting.slice(0, 40)) h.out(` waiting ~/${w.path}`)
@@ -108,12 +110,12 @@ export class BackupRestoreCommand extends Command {
108
110
  category: 'Media',
109
111
  description: 'a backup run written back, every sha checked: to an empty folder, or in place',
110
112
  details: `${DETAILS}\n\nThe run is this Mac's last one at or before --at (the last one when it is left out); --host reads another Mac's runs, as a new Mac restoring the one it replaces. --to writes every file under the folder, at its path under the home (the folder must be empty or new). --in-place writes over the live files: a live file with other bytes is copied to ~/.shipkit/backup-replaced/<time>/ first, and a sqlite lands beside its live file as <file>.restored (stop pm, then move it). --path keeps the files under one path of the home.`,
111
- examples: [['the last run into a folder', 'sk backup restore --to ~/restore-1'], ['the veille logs as they were on a day, in place', 'sk backup restore --at 2026-11-04 --in-place --path .config/shipkit/home/veille']],
113
+ examples: [['the last run into a folder', 'sk backup restore --to ~/restore-1'], ['the veille logs as they were on a day, in place', 'sk backup restore --at 2026-11-04 --in-place --path .shipkit/home/veille']],
112
114
  })
113
115
  to = Option.String('--to', { description: 'an empty or new folder the files land under' })
114
116
  inPlace = Option.Boolean('--in-place', false, { description: 'over the live files, each one replaced copied aside first' })
115
117
  at = Option.String('--at', { description: 'the last run at or before this time: 2026-11-04T13:50Z, 2026-11-04 or 20261104T135000Z' })
116
- under = Option.String('--path', { description: 'only the files under this path of the home: .config/shipkit/home/veille' })
118
+ under = Option.String('--path', { description: 'only the files under this path of the home: .shipkit/home/veille (a run made before sk home move names it .config/shipkit/home/veille: either form matches)' })
117
119
  host = Option.String('--host', { description: "another Mac's runs, by the name `sk backup runs` prints: this Mac's when absent" })
118
120
  async execute(): Promise<number> {
119
121
  return run(this.context, async (h) => {
@@ -8,8 +8,8 @@ export class CapacityCommand extends Command {
8
8
 
9
9
  static override usage = Command.Usage({
10
10
  category: 'Health',
11
- description: 'how many lanes this repo runs now: the machine\'s cores, its load, the lanes live on it',
12
- details: 'reads the cores, the 1 minute load and the agents whose transcript moved in the last 3 minutes, every account and repo. The answer is this repo\'s live lanes plus one a free core, never under one. --max <n> is the maximum the owner gave: it replaces the number. Only a dying machine (a load of twice its cores) stops a lane, the maximum included. Run it before a lane starts. Report only, exit 0 always.',
11
+ description: 'how many lanes this repo runs now: the machine\'s cores, the cores in use, the lanes live on it',
12
+ details: 'reads the cores, the cores really in use (the CPU times, smoothed over 20 s by the daemon, else a 0.4 s sample), the 1 minute load and the agents whose transcript moved in the last 3 minutes, every account and repo. A free core is one neither in use nor held by a live agent; the load counts only once every core is taken, and alone where the machine gives no CPU times. The answer is this repo\'s live lanes plus one a free core, never under one. --max <n> is the maximum the owner gave: it replaces the number. Only a dying machine (85% of its cores in use and a load of twice its cores, or critical memory) stops a lane, the maximum included. Run it before a lane starts. Report only, exit 0 always.',
13
13
  examples: [
14
14
  ['before a lane starts', 'sk capacity'],
15
15
  ['with the maximum the owner gave', 'sk capacity --max 5'],
@@ -42,9 +42,10 @@ export async function daemonDeclared(port = Number(process.env.SHIPKIT_DAEMON_PO
42
42
  const dot = (r: ActivityRow): string => {
43
43
  const c = r.status
44
44
  if (c == null) return '·'
45
- if (c.state === 'red') return `● ${c.reds.length} red`
46
- if (c.state === 'orange') return `● ${c.warns.length} warn`
47
- return '● green'
45
+ const held = c.hands.length > 0 ? `, ${c.hands.length} waiting on the owner` : ''
46
+ if (c.state === 'red') return `● ${c.reds.length} red${held}`
47
+ if (c.state === 'orange') return `● ${c.warns.length} warn${held}`
48
+ return `● green${held}`
48
49
  }
49
50
 
50
51
  const commitLine = (c: ActivityCommit, now: number, old: boolean): string =>
@@ -60,7 +61,7 @@ export function renderActivity(a: ActivityAnswer, cap: number): string[] {
60
61
  const branch = r.branch ?? (r.detached == null ? '' : `detached ${r.detached}`)
61
62
  out.push(`${r.name} ${dot(r)} ${branch} (${upstreamWords(r)})`)
62
63
  for (const c of r.failing ?? []) {
63
- out.push(` ${c.status === 'fail' ? '✗' : '!'} ${c.id}${c.at == null ? '' : ` (${ageShort(c.at, a.now)})`}`)
64
+ out.push(` ${c.status === 'fail' ? '✗' : c.held === true ? '🤝' : '!'} ${c.id}${c.at == null ? '' : ` (${ageShort(c.at, a.now)})`}`)
64
65
  for (const l of c.lines) out.push(` ${l}`)
65
66
  }
66
67
  if (r.error != null) out.push(` git failed: ${r.error}`)