rvlib-shipkit 2.31.0 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/package.json +1 -1
  3. package/src/advisors/acts.ts +16 -15
  4. package/src/advisors/advice.ts +56 -102
  5. package/src/advisors/advisor-view.ts +122 -76
  6. package/src/advisors/app-graph.ts +1 -1
  7. package/src/advisors/app.ts +3 -11
  8. package/src/advisors/cf-api.ts +1 -1
  9. package/src/advisors/dir-bucket.ts +4 -3
  10. package/src/advisors/edge/api.ts +20 -221
  11. package/src/advisors/edge/bucket.ts +2 -2
  12. package/src/advisors/edge/handler.ts +13 -155
  13. package/src/advisors/edge/here.ts +5 -5
  14. package/src/advisors/edge/pages.ts +12 -9
  15. package/src/advisors/edge/shell.ts +6 -5
  16. package/src/advisors/edge/sign-in.ts +101 -36
  17. package/src/advisors/edge/status.ts +19 -6
  18. package/src/advisors/edge/types.ts +36 -60
  19. package/src/advisors/expose.ts +29 -29
  20. package/src/advisors/here.ts +12 -12
  21. package/src/advisors/invite-send.ts +79 -35
  22. package/src/advisors/invite.ts +31 -8
  23. package/src/advisors/job.ts +24 -16
  24. package/src/advisors/login.ts +40 -15
  25. package/src/advisors/owner-store.ts +46 -22
  26. package/src/advisors/photos.ts +3 -3
  27. package/src/advisors/project.ts +27 -25
  28. package/src/advisors/reach.ts +89 -0
  29. package/src/advisors/rights.ts +1 -1
  30. package/src/advisors/routes.ts +55 -74
  31. package/src/advisors/scan.ts +0 -4
  32. package/src/advisors/setup-run.ts +14 -14
  33. package/src/advisors/share-trace.ts +3 -3
  34. package/src/advisors/{door-probe.ts → sign-in-probe.ts} +7 -6
  35. package/src/advisors/speaks.ts +29 -0
  36. package/src/advisors/sync.ts +97 -183
  37. package/src/advisors/tunnel.ts +6 -5
  38. package/src/advisors/users-listen.ts +92 -0
  39. package/src/advisors/users-router.ts +261 -87
  40. package/src/advisors/users-store.ts +81 -0
  41. package/src/agent-time/blocked-scan.ts +181 -0
  42. package/src/agent-time/registry.ts +12 -5
  43. package/src/agent-time/store.ts +9 -109
  44. package/src/asks/ask-bar-fold.ts +2 -1
  45. package/src/asks/ask-close.ts +2 -1
  46. package/src/asks/ask-doc.ts +2 -1
  47. package/src/asks/ask-migrate.ts +3 -2
  48. package/src/asks/ask-steps-fold.ts +2 -1
  49. package/src/asks/ask-store.ts +4 -3
  50. package/src/check.ts +3 -43
  51. package/src/checks/SK001-package-json-shape.check.ts +4 -55
  52. package/src/checks/SK004-gitignore-policy.check.ts +24 -69
  53. package/src/checks/SK013-one-way-in-policy.check.ts +3 -7
  54. package/src/checks/SK017-vscode-hub-task.check.ts +4 -4
  55. package/src/checks/SK019-tests-run-in-units.check.ts +3 -14
  56. package/src/checks/SK020-self-spawning-check.check.ts +5 -7
  57. package/src/checks/SK035-public-clean.check.ts +1 -1
  58. package/src/checks/SK039-vscode-watch-generated.check.ts +1 -1
  59. package/src/checks/SK042-post-kinds.check.ts +5 -14
  60. package/src/checks/SK054-agent-allow-list.check.ts +5 -74
  61. package/src/checks/SK055-retired-config-keys.check.ts +45 -0
  62. package/src/cli/cmd_Advisors.ts +11 -45
  63. package/src/cli/cmd_Asks.ts +3 -10
  64. package/src/cli/cmd_Backup.ts +25 -127
  65. package/src/cli/cmd_BackupTargets.ts +1 -1
  66. package/src/cli/cmd_Capacity.ts +6 -2
  67. package/src/cli/cmd_Checks.ts +0 -14
  68. package/src/cli/cmd_Ci.ts +2 -1
  69. package/src/cli/cmd_Db.ts +3 -82
  70. package/src/cli/cmd_Home.ts +4 -32
  71. package/src/cli/cmd_Hq.ts +0 -17
  72. package/src/cli/cmd_Releases.ts +57 -4
  73. package/src/cli/cmd_Review.ts +333 -354
  74. package/src/cli/cmd_Shot.ts +26 -4
  75. package/src/cli/cmd_SocialDrafts.ts +6 -13
  76. package/src/cli/cmd_ThreadSyncNeeds.ts +6 -2
  77. package/src/cli/cmd_Time.ts +1 -1
  78. package/src/cli/cmd_Trailer.ts +1 -1
  79. package/src/cli/inbox-hook-run.ts +5 -23
  80. package/src/cli/registry-heads.ts +5 -55
  81. package/src/cli/registry.ts +1 -5
  82. package/src/cli/review-here.ts +1 -1
  83. package/src/cli.ts +15 -4
  84. package/src/collections/collection-types.ts +1 -1
  85. package/src/collections/review.ts +5 -4
  86. package/src/core/admission.ts +268 -0
  87. package/src/core/agent-allow-policy.ts +32 -2
  88. package/src/core/agent-env.ts +8 -0
  89. package/src/core/allow-rows.ts +74 -0
  90. package/src/core/check-file-names.ts +19 -106
  91. package/src/core/code-lines.ts +36 -21
  92. package/src/core/footprint.ts +17 -13
  93. package/src/core/identities-root.ts +1 -4
  94. package/src/core/layout.ts +1 -2
  95. package/src/core/machine-db.ts +33 -208
  96. package/src/core/machine-layout.ts +14 -127
  97. package/src/core/machine-read.ts +5 -2
  98. package/src/core/mask-source.ts +60 -0
  99. package/src/core/memory-watch.ts +17 -14
  100. package/src/core/motherhome.ts +8 -35
  101. package/src/core/one-way-in-policy.ts +0 -3
  102. package/src/core/peer-sk.ts +8 -0
  103. package/src/core/repo-walk.ts +0 -9
  104. package/src/core/retention.ts +1 -9
  105. package/src/core/retired-checks.ts +2 -0
  106. package/src/core/tmux-policy.ts +1 -1
  107. package/src/core/tree-watch.ts +2 -2
  108. package/src/core/when.ts +7 -45
  109. package/src/gate/admit-heavy.ts +150 -0
  110. package/src/gate/check-runner.ts +6 -0
  111. package/src/gate/discover-checks.ts +42 -32
  112. package/src/gate/gate-checks.ts +21 -131
  113. package/src/gate/head-gate.ts +1 -1
  114. package/src/gate/job-run.ts +2 -1
  115. package/src/gate/pre-commit-discovery.ts +22 -28
  116. package/src/gate/run-check.ts +3 -4
  117. package/src/gate/run-ci.ts +4 -0
  118. package/src/gate/run-fix.ts +5 -17
  119. package/src/gate/run-fixers.ts +6 -42
  120. package/src/home/app-sign.ts +2 -2
  121. package/src/home/backup-status.ts +52 -92
  122. package/src/home/backup-verdict.ts +2 -2
  123. package/src/home/daemon-jobs.ts +51 -95
  124. package/src/home/database-words.ts +1 -2
  125. package/src/home/databases.ts +9 -25
  126. package/src/home/home-launchd.ts +0 -6
  127. package/src/home/home-paths.ts +8 -4
  128. package/src/home/home-routes.ts +3 -10
  129. package/src/home/home-state.ts +2 -14
  130. package/src/home/inbox-shape.ts +14 -15
  131. package/src/home/inbox.ts +1 -1
  132. package/src/home/machine-repair.ts +102 -103
  133. package/src/home/resume.ts +1 -15
  134. package/src/home/run-daemon.ts +7 -12
  135. package/src/home/space-page.ts +3 -2
  136. package/src/home/supervise.ts +3 -7
  137. package/src/hooks/commit-msg-run.ts +61 -0
  138. package/src/hooks/commit-run.ts +16 -166
  139. package/src/hooks/gate-outcome.ts +108 -0
  140. package/src/hooks/git-hook.ts +9 -9
  141. package/src/hooks/hook-config.ts +8 -8
  142. package/src/hooks/leak-guard.ts +1 -1
  143. package/src/hooks/pre-commit-checks.ts +1 -1
  144. package/src/hooks/run-hooks.ts +2 -6
  145. package/src/hooks/shared-file.ts +3 -2
  146. package/src/hq/daemon-db.ts +8 -8
  147. package/src/hq/door.ts +3 -16
  148. package/src/hq/hq-db.ts +4 -3
  149. package/src/hq/hq-local.ts +1 -2
  150. package/src/hq/hq-store.ts +0 -15
  151. package/src/hq/item-direct.ts +8 -10
  152. package/src/hq/item-fill.ts +37 -0
  153. package/src/hq/kinds/item-gone.ts +7 -10
  154. package/src/hq/kinds/item-msg.ts +12 -18
  155. package/src/hq/kinds/item.ts +13 -19
  156. package/src/hq/kinds/report.ts +3 -4
  157. package/src/hq/owner-switch.ts +3 -3
  158. package/src/hq/report.ts +5 -9
  159. package/src/hq/switch.ts +2 -11
  160. package/src/hq/thread-sync.ts +5 -17
  161. package/src/hq/{shapes-words.ts → threads-words.ts} +2 -12
  162. package/src/http/owner-word.ts +1 -1
  163. package/src/identities/machine.ts +16 -0
  164. package/src/init-repo.ts +0 -1
  165. package/src/ledger/check-stats.ts +6 -5
  166. package/src/ledger/db.ts +2 -4
  167. package/src/ledger/record-kept.ts +117 -48
  168. package/src/ledger/run-log.ts +21 -2
  169. package/src/ledger/slow-tests.ts +96 -0
  170. package/src/ledger/store.ts +3 -86
  171. package/src/ledger/suite-log.ts +8 -2
  172. package/src/media-store/backup/facts.ts +3 -37
  173. package/src/media-store/backup/keys.ts +1 -8
  174. package/src/media-store/backup/manifest.ts +6 -67
  175. package/src/media-store/backup/restore.ts +4 -13
  176. package/src/media-store/backup/retention.ts +13 -1
  177. package/src/media-store/backup/run.ts +6 -267
  178. package/src/media-store/backup/snapshot.ts +2 -38
  179. package/src/media-store/backup/sources.ts +3 -113
  180. package/src/media-store/backup/target-send.ts +5 -29
  181. package/src/media-store/db.ts +8 -7
  182. package/src/media-store/forget-one.ts +1 -1
  183. package/src/media-store/forget.ts +1 -80
  184. package/src/orchestrator/guards.ts +0 -1
  185. package/src/orchestrator/presence.ts +2 -2
  186. package/src/orchestrator/routes.ts +1 -1
  187. package/src/orchestrator/started.ts +0 -9
  188. package/src/orchestrator/talk-key.ts +3 -4
  189. package/src/orchestrator/unheard.ts +1 -1
  190. package/src/plan/planner.ts +3 -2
  191. package/src/recordings/edit.ts +3 -3
  192. package/src/recordings/marks-draw.ts +17 -6
  193. package/src/recordings/marks.ts +120 -9
  194. package/src/reflections/reflections-queue.ts +3 -10
  195. package/src/release/notes.ts +1 -1
  196. package/src/release/public-clean.ts +66 -6
  197. package/src/release/run-bump.ts +11 -0
  198. package/src/release/run-release.ts +4 -0
  199. package/src/releases/from-thread.ts +3 -3
  200. package/src/releases/model.ts +186 -36
  201. package/src/releases/store.ts +13 -3
  202. package/src/releases/validate.ts +83 -0
  203. package/src/repo-config.ts +36 -64
  204. package/src/review/answer-kinds.ts +63 -4
  205. package/src/review/blocked-guard.ts +11 -0
  206. package/src/review/blocked-object.ts +298 -0
  207. package/src/review/cells.ts +144 -230
  208. package/src/review/close.ts +39 -1
  209. package/src/review/doc-save.ts +3 -2
  210. package/src/review/draft-item.ts +1 -1
  211. package/src/review/events.ts +3 -7
  212. package/src/review/expect.ts +23 -39
  213. package/src/review/format.ts +79 -46
  214. package/src/review/glyphs.ts +1 -0
  215. package/src/review/hand-over.ts +3 -3
  216. package/src/review/heard.ts +1 -1
  217. package/src/review/holds-sync.ts +2 -1
  218. package/src/review/inbox-hook.ts +2 -2
  219. package/src/review/inbox-read.ts +39 -33
  220. package/src/review/instruction-guards.ts +12 -0
  221. package/src/review/instructions.ts +0 -1
  222. package/src/review/item-db.ts +13 -43
  223. package/src/review/item-hq.ts +2 -2
  224. package/src/review/item-rows.ts +3 -14
  225. package/src/review/kind-catalog.ts +3 -1
  226. package/src/review/kinds.ts +18 -8
  227. package/src/review/live-view.ts +3 -0
  228. package/src/review/media-kind.ts +1 -1
  229. package/src/review/mentions.ts +1 -2
  230. package/src/review/model.ts +158 -114
  231. package/src/review/move.ts +149 -0
  232. package/src/review/need-threads.ts +3 -2
  233. package/src/review/object-card.ts +11 -0
  234. package/src/review/object-read.ts +6 -1
  235. package/src/review/one-block.ts +1 -1
  236. package/src/review/owner-read.ts +1 -1
  237. package/src/review/phone-push.ts +10 -9
  238. package/src/review/previews.ts +32 -4
  239. package/src/review/push.ts +2 -2
  240. package/src/review/recap.ts +129 -0
  241. package/src/review/referring.ts +6 -3
  242. package/src/review/reflection-object.ts +4 -3
  243. package/src/review/routes.ts +51 -47
  244. package/src/review/secret-route.ts +3 -2
  245. package/src/review/settle.ts +0 -6
  246. package/src/review/snooze.ts +5 -3
  247. package/src/review/speaker.ts +68 -0
  248. package/src/review/start-title.ts +19 -0
  249. package/src/review/store-parties.ts +28 -0
  250. package/src/review/store.ts +94 -59
  251. package/src/review/{wakes.ts → thread-events.ts} +92 -7
  252. package/src/review/thread-md.ts +35 -14
  253. package/src/review/thread-state.ts +804 -0
  254. package/src/review/threads.ts +29 -347
  255. package/src/review/traces.ts +104 -7
  256. package/src/review/trailer-item.ts +1 -1
  257. package/src/review/unit.ts +7 -9
  258. package/src/review/verdict-items.ts +12 -10
  259. package/src/review/view-layout.ts +25 -1
  260. package/src/review/watch-feed.ts +1 -2
  261. package/src/review/working-guards.ts +2 -3
  262. package/src/rules/untrack-generated.ts +1 -15
  263. package/src/secrets/copy.ts +4 -4
  264. package/src/secrets/lapse.ts +2 -1
  265. package/src/serve/hub-app/advisor-app.tsx +4 -4
  266. package/src/serve/hub-app/advisor-face.tsx +9 -3
  267. package/src/serve/hub-app/advisor-host.ts +27 -27
  268. package/src/serve/hub-app/advisors-model.ts +17 -8
  269. package/src/serve/hub-app/advisors-rights.tsx +1 -1
  270. package/src/serve/hub-app/advisors-st.ts +15 -14
  271. package/src/serve/hub-app/advisors-view.tsx +13 -11
  272. package/src/serve/hub-app/app-bridge.ts +23 -3
  273. package/src/serve/hub-app/asks-page.tsx +1 -1
  274. package/src/serve/hub-app/auto-text.tsx +71 -16
  275. package/src/serve/hub-app/check-view.tsx +0 -8
  276. package/src/serve/hub-app/controls.css +14 -3
  277. package/src/serve/hub-app/database-view.tsx +1 -2
  278. package/src/serve/hub-app/dock-st.ts +1 -1
  279. package/src/serve/hub-app/git-view.tsx +3 -1
  280. package/src/serve/hub-app/hub.css +12 -5
  281. package/src/serve/hub-app/icons.tsx +1 -1
  282. package/src/serve/hub-app/inbox-view.tsx +1 -2
  283. package/src/serve/hub-app/live-sources.ts +2 -2
  284. package/src/serve/hub-app/main-panel.tsx +2 -1
  285. package/src/serve/hub-app/panel-repo.ts +0 -9
  286. package/src/serve/hub-app/pic.tsx +29 -12
  287. package/src/serve/hub-app/polled.ts +16 -2
  288. package/src/serve/hub-app/recordings-st.ts +23 -2
  289. package/src/serve/hub-app/recordings-view.tsx +68 -10
  290. package/src/serve/hub-app/ref-pill.ts +1 -1
  291. package/src/serve/hub-app/repo-st.ts +1 -2
  292. package/src/serve/hub-app/review/advisor-add.tsx +1 -1
  293. package/src/serve/hub-app/review/advisor-invite.tsx +1 -1
  294. package/src/serve/hub-app/review/draft-body.tsx +2 -2
  295. package/src/serve/hub-app/review/heard-line.tsx +1 -1
  296. package/src/serve/hub-app/review/instructions-view.tsx +1 -8
  297. package/src/serve/hub-app/review/kind-states.tsx +14 -9
  298. package/src/serve/hub-app/review/kit.tsx +4 -11
  299. package/src/serve/hub-app/review/lane-bar.tsx +3 -3
  300. package/src/serve/hub-app/review/lightbox.tsx +15 -11
  301. package/src/serve/hub-app/review/line-window.ts +4 -1
  302. package/src/serve/hub-app/review/live-bar-st.ts +2 -2
  303. package/src/serve/hub-app/review/live-view.tsx +57 -1
  304. package/src/serve/hub-app/review/object-panel.tsx +20 -8
  305. package/src/serve/hub-app/review/question-views.tsx +191 -53
  306. package/src/serve/hub-app/review/recap-bar.tsx +40 -0
  307. package/src/serve/hub-app/review/request-cell.tsx +48 -0
  308. package/src/serve/hub-app/review/review-cells.tsx +154 -96
  309. package/src/serve/hub-app/review/review-host.ts +8 -4
  310. package/src/serve/hub-app/review/review-kit.ts +17 -11
  311. package/src/serve/hub-app/review/review-list.tsx +30 -35
  312. package/src/serve/hub-app/review/review-st.ts +32 -42
  313. package/src/serve/hub-app/review/review-thread.tsx +139 -85
  314. package/src/serve/hub-app/review/review-views.tsx +127 -68
  315. package/src/serve/hub-app/review/share-lines.tsx +4 -4
  316. package/src/serve/hub-app/review/start-st.ts +2 -5
  317. package/src/serve/hub-app/review/superseded-runs.ts +4 -3
  318. package/src/serve/hub-app/review/thread-close.tsx +10 -7
  319. package/src/serve/hub-app/review/thread-st.ts +381 -202
  320. package/src/serve/hub-app/review/tone-bar.tsx +129 -0
  321. package/src/serve/hub-app/review/tones.ts +53 -0
  322. package/src/serve/hub-app/review/trailer-body.tsx +2 -2
  323. package/src/serve/hub-app/review/trailer-st.ts +3 -2
  324. package/src/serve/hub-app/review/trailer-voices-st.ts +3 -2
  325. package/src/serve/hub-app/review.css +189 -106
  326. package/src/serve/hub-app/search-view.tsx +1 -1
  327. package/src/serve/hub-app/social/social-model.ts +0 -4
  328. package/src/serve/hub-app/source-acts.ts +2 -1
  329. package/src/serve/hub-app/stores/stores-page.tsx +2 -2
  330. package/src/serve/hub-app/terminal-sources.tsx +2 -1
  331. package/src/serve/hub-app/thread-row.tsx +3 -4
  332. package/src/serve/hub-app/tree-build.ts +0 -4
  333. package/src/serve/hub-app/urls-view.tsx +2 -1
  334. package/src/serve/hub-app/view-layout.css +13 -3
  335. package/src/serve/hub-app/wikis-view.tsx +5 -2
  336. package/src/serve/hub-runtime.ts +7 -37
  337. package/src/serve/project-gutter-route.ts +6 -2
  338. package/src/serve/read-thread.ts +20 -2
  339. package/src/serve/read-worker.ts +9 -1
  340. package/src/serve/record-pages.ts +46 -0
  341. package/src/serve/serve-hub.ts +2 -2
  342. package/src/serve/terminal-host.ts +1 -1
  343. package/src/serve/terminal-route.ts +1 -3
  344. package/src/serve/tracked-watch.ts +1 -3
  345. package/src/setup-house.ts +2 -2
  346. package/src/shipkit-files.ts +1 -1
  347. package/src/shipkit.ts +1 -6
  348. package/src/shot/client.ts +2 -1
  349. package/src/shot/film-box.ts +0 -20
  350. package/src/shot/on-place.ts +141 -0
  351. package/src/social/drafts.ts +1 -1
  352. package/src/social/kinds.ts +6 -29
  353. package/src/social/load.ts +2 -2
  354. package/src/social/post-object.ts +3 -2
  355. package/src/social/release-stage.ts +1 -1
  356. package/src/social/stage.ts +2 -2
  357. package/src/stores/model.ts +4 -0
  358. package/src/stores/routes.ts +11 -3
  359. package/src/suite/judge-suites.ts +58 -0
  360. package/src/suite/red-alone.ts +54 -18
  361. package/src/suite/runner-shapes.ts +2 -2
  362. package/src/suite/suite-cli.ts +67 -14
  363. package/src/suite/test-units.ts +2 -1
  364. package/src/urls/fill.ts +1 -1
  365. package/src/urls/places.ts +1 -2
  366. package/src/vault/vault-config.ts +2 -2
  367. package/src/vault/vault-init.ts +1 -5
  368. package/src/wiki/graph-page.ts +14 -2
  369. package/src/advisors/copy-truth.ts +0 -49
  370. package/src/advisors/door-child.ts +0 -112
  371. package/src/advisors/door-serve.ts +0 -52
  372. package/src/advisors/door.ts +0 -118
  373. package/src/checks/SK016-legacy-check-shapes.check.ts +0 -189
  374. package/src/checks/SK029-explicit-check-files.check.ts +0 -112
  375. package/src/checks/SK048-one-local-file.check.ts +0 -36
  376. package/src/core/config-rewrite.ts +0 -111
  377. package/src/core/daemon-port.ts +0 -10
  378. package/src/core/legacy-shapes.ts +0 -263
  379. package/src/core/migrate-layout.ts +0 -638
  380. package/src/core/port-check-cli.ts +0 -52
  381. package/src/core/port-check-file.ts +0 -295
  382. package/src/core/port-check-files.ts +0 -31
  383. package/src/gate/discover-legacy-checks.ts +0 -26
  384. package/src/home/home-move.ts +0 -527
  385. package/src/home/machine-fold.ts +0 -810
  386. package/src/hq/item-shapes.ts +0 -54
  387. package/src/hq/kinds/items-read.ts +0 -4
  388. package/src/media-store/backup/daemon.ts +0 -220
  389. package/src/media-store/backup/kept.ts +0 -241
  390. package/src/media-store/backup/prune.ts +0 -359
  391. package/src/media-store/backup/secret.ts +0 -88
  392. package/src/media-store/backup/ssh-space.ts +0 -202
  393. package/src/media-store/backup/watch.ts +0 -117
  394. package/src/review/band.ts +0 -182
  395. package/src/review/folders.ts +0 -216
  396. package/src/review/hook-ask.ts +0 -58
  397. package/src/review/role.ts +0 -48
  398. package/src/review/thread-fold.ts +0 -64
  399. package/src/review/wait.ts +0 -91
  400. package/src/rules/rule.ts +0 -43
  401. package/src/serve/hook-thread.ts +0 -37
  402. package/src/serve/hook-work.ts +0 -92
  403. package/src/serve/hook-worker.ts +0 -57
  404. package/src/serve/hub-app/review/dock.tsx +0 -147
  405. package/src/serve/hub-app/review/faces.tsx +0 -18
  406. package/src/serve/hub-app/review/item-verdict.tsx +0 -112
  407. package/src/serve/hub-app/review/review-board.tsx +0 -48
  408. /package/src/{scaffold → core}/jsonc-spans.ts +0 -0
@@ -0,0 +1,45 @@
1
+ // SK055: repo.config.ts carries no key that is gone. `defineRepo` refuses a removed key by name, so a config holding
2
+ // one never loads; the one exception is the empty `tasks: []` that every scaffold wrote, which loads and means
3
+ // nothing, so this check names it and its repair drops the line. A `tasks` with an entry is refused at load with the
4
+ // unit file to write instead, since a task is a command a person chose and no machine moves it.
5
+ import { check, type FixResult } from '../check.ts'
6
+
7
+ const CONFIG = 'repo.config.ts'
8
+ /** the scaffold's line, alone on its line, its comma and comment with it */
9
+ const EMPTY_TASKS = /^[ \t]*tasks[ \t]*:[ \t]*\[[ \t]*\][ \t]*,?[ \t]*(\/\/[^\n]*)?\n/gm
10
+
11
+ /** the config text without its empty `tasks: []` line, or null when it holds none or more than one */
12
+ export function dropEmptyTasks(src: string): string | null {
13
+ const hits = src.match(EMPTY_TASKS) ?? []
14
+ return hits.length !== 1 ? null : src.replace(EMPTY_TASKS, '')
15
+ }
16
+
17
+ export const retiredConfigKeys = check({
18
+ id: 'SK055',
19
+ blocking: true,
20
+ title: 'retired config keys',
21
+ description: 'repo.config.ts carries no key that shipkit retired',
22
+ owner: 'tools/shipkit/config-keys.md',
23
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
24
+ cache: { by: 'reads' },
25
+ fix: 'ci',
26
+ applies: 'always',
27
+ run: (c) => {
28
+ const src = c.read(CONFIG)
29
+ if (src == null) return void c.ok(`${CONFIG} absent`)
30
+ const n = (src.match(EMPTY_TASKS) ?? []).length
31
+ if (n === 0) return void c.ok(`${CONFIG} carries no retired key`)
32
+ c.fail(`${CONFIG} still carries \`tasks: []\`: the key is gone, a build step is a <name>.check.shipkit.ts file with \`build: true\``)
33
+ c.lines.push({ kind: 'fix-fail', text: n === 1 ? 'sk ci (or sk check --fix SK055) drops the line' : `${n} such lines: delete them by hand` })
34
+ },
35
+ repair: (c): FixResult => {
36
+ const src = c.read(CONFIG)
37
+ if (src == null) return { changed: false, summary: `${CONFIG} absent` }
38
+ const next = dropEmptyTasks(src)
39
+ if (next == null) return { changed: false, summary: (src.match(EMPTY_TASKS) ?? []).length === 0 ? 'no retired key' : 'more than one `tasks: []` line: delete them by hand' }
40
+ c.write(CONFIG, next)
41
+ return { changed: true, summary: `${CONFIG} drops its empty \`tasks: []\`` }
42
+ },
43
+ })
44
+
45
+ export default retiredConfigKeys
@@ -61,7 +61,7 @@ abstract class AdvisorsBase extends Command {
61
61
  }
62
62
  }
63
63
 
64
- /** the pass after an act: written to the door once it is set up */
64
+ /** the pass after an act: the owner's pass once the advisors page is set up, else the owner's preview refreshed */
65
65
  protected async pass(house: string | null, say: (l: string) => void): Promise<void> {
66
66
  const { advisorsPass } = await import('../advisors/job.ts')
67
67
  const { tunnelStart } = await import('../home/advisors-tunnel-start.ts')
@@ -399,7 +399,7 @@ export class AdvisorsExposeCommand extends AdvisorsBase {
399
399
  static override usage = Command.Usage({
400
400
  category: 'Review',
401
401
  description: 'set the advisors page up, once, in a terminal of the owner: a Cloudflare Tunnel to this Mac',
402
- details: 'In order: the tunnel rv-advisors, its one way in (the name to the advisors page\'s server on this Mac), its token into the vault, the process that runs cloudflared started and connected, the name pointed at the tunnel last, then what the advisors page was before removed (its Worker, its bucket, its Access apps). A second run writes nothing. Needs the setup token of the ask that opens the advisors page. Refused in an agent\'s shell and without a terminal (wiki tools/shipkit/advisors.md, The advisors page and its server).',
402
+ details: 'In order: the tunnel rv-advisors, its one way in (the name to the advisors page\'s server on this Mac), its token into the vault, the process that runs cloudflared started and connected, the name pointed at the tunnel last, then what the advisors page was before removed (its Worker, its bucket, its Access apps). A second run writes nothing. Needs the setup token of the ask that opens the advisors page. Refused in an agent\'s shell and without a terminal (wiki tools/shipkit/advisors.md, Who calls).',
403
403
  examples: [['the advisors page at advisors.example.org, under the zone example.org', 'sk advisors expose --host advisors.example.org']],
404
404
  })
405
405
  host = Option.String('--host', { required: true, description: 'the advisors\' name, under a zone of the Cloudflare account: advisors.<domain>' })
@@ -409,9 +409,9 @@ export class AdvisorsExposeCommand extends AdvisorsBase {
409
409
  const { notTypedByOwner } = await import('../vault/vault-init.ts')
410
410
  const why = notTypedByOwner({ env: process.env, stdinTTY: process.stdin.isTTY === true, stdoutTTY: process.stdout.isTTY === true })
411
411
  if (why !== null) throw new Error(`setting the advisors page up is the owner’s act: ${why}`)
412
- const { exposeDoor } = await import('../advisors/expose.ts')
412
+ const { exposeAdvisors } = await import('../advisors/expose.ts')
413
413
  const { tunnelStart } = await import('../home/advisors-tunnel-start.ts')
414
- await exposeDoor({ dir, cwd: process.cwd(), host: this.host.trim().toLowerCase(), say }, { tunnel: tunnelStart() })
414
+ await exposeAdvisors({ dir, cwd: process.cwd(), host: this.host.trim().toLowerCase(), say }, { tunnel: tunnelStart() })
415
415
  })
416
416
  }
417
417
  }
@@ -421,7 +421,7 @@ export class AdvisorsTunnelCommand extends AdvisorsBase {
421
421
  static override usage = Command.Usage({
422
422
  category: 'Review',
423
423
  description: 'keep cloudflared up while this Mac carries the hq: the pm process advisors-tunnel runs it',
424
- details: 'The tunnel\'s token from the vault, by its environment, never its command line. Without the token it waits and says so in one line; on a Mac that does not carry the hq it opens nothing (wiki tools/shipkit/advisors.md, The advisors page and its server).',
424
+ details: 'The tunnel\'s token from the vault, by its environment, never its command line. Without the token it waits and says so in one line; on a Mac that does not carry the hq it opens nothing (wiki tools/shipkit/advisors.md, Who calls).',
425
425
  })
426
426
 
427
427
  async execute(): Promise<number> {
@@ -430,56 +430,22 @@ export class AdvisorsTunnelCommand extends AdvisorsBase {
430
430
  }
431
431
  }
432
432
 
433
- export class AdvisorsLiveCommand extends Command {
434
- static override paths = [['advisors', 'live']]
435
- static override usage = Command.Usage({
436
- category: 'Review',
437
- description: "who answers the advisors' port: the daemon from live threads (on), or the copy (off)",
438
- details: "The machine switch advisors-live. On, the daemon of the Mac that carries the hq serves the advisors' port itself within 30 s: the list of threads, a thread, its pictures, a reply and a read cursor answer from the live threads, the rest as before. Off, the child over the copy again, as before. Nothing else changes: the rights, the sign in and every person's session stay (wiki tools/shipkit/advisors.md, Who calls).",
439
- examples: [
440
- ['where it stands', 'sk advisors live'],
441
- ['served live by the daemon', 'sk advisors live on'],
442
- ['back to the copy', 'sk advisors live off'],
443
- ],
444
- })
445
-
446
- to = Option.String({ required: false, name: 'on|off' })
447
-
448
- async execute(): Promise<number> {
449
- const { machineGet, machineSet } = await import('../core/machine-db.ts')
450
- const { ADVISORS_LIVE } = await import('../advisors/users-router.ts')
451
- if (this.to !== undefined) {
452
- if (this.to !== 'on' && this.to !== 'off') {
453
- this.context.stderr.write(`FAIL: on or off, not ${JSON.stringify(this.to).slice(0, 40)}\n`)
454
- return 1
455
- }
456
- if (!machineSet(ADVISORS_LIVE, this.to === 'on')) {
457
- this.context.stderr.write('FAIL: the machine db does not open: the switch is not set\n')
458
- return 1
459
- }
460
- }
461
- const on = machineGet<boolean>(ADVISORS_LIVE) === true
462
- this.context.stdout.write(`${on ? "advisors live: on, the daemon serves the advisors' port from the threads themselves (within 30 s of a change)" : "advisors live: off, the advisors' port reads the copy (sk advisors live on to serve it live)"}\n`)
463
- return 0
464
- }
465
- }
466
-
467
433
  export class AdvisorsCheckCommand extends AdvisorsBase {
468
434
  static override paths = [['advisors', 'check']]
469
435
  static override usage = Command.Usage({
470
436
  category: 'Review',
471
437
  description: 'prove from outside that the advisors page answers, its sign in tried in a real browser',
472
- details: "With Chrome on the machine, one try of the sign in in a headless Chrome: the form filled with nobody@example.org and a made up password, posted by the form itself; it wants the page's own « does not match », never « Forbidden ». One try a run, on an email no person has: no person's count moves. With no Chrome: a WARN, never a pass.",
438
+ details: "With Chrome on the machine, one try of the sign in in a headless Chrome: the form filled with nobody@example.org and a made up password, posted by the form itself; it wants the page's own « Check your email and password », never « Forbidden ». One try a run, on an email no person has: no person's count moves. With no Chrome: a WARN, never a pass.",
473
439
  })
474
440
 
475
441
  async execute(): Promise<number> {
476
442
  return this.go(async (dir, say) => {
477
443
  const { readState } = await import('../advisors/owner-store.ts')
478
- const { checkDoor } = await import('../advisors/expose.ts')
479
- const { probeSignIn } = await import('../advisors/door-probe.ts')
444
+ const { checkAdvisors } = await import('../advisors/expose.ts')
445
+ const { probeSignIn } = await import('../advisors/sign-in-probe.ts')
480
446
  const host = readState(dir).host
481
447
  if (host === null) throw new Error('the advisors page is not set up: sk advisors expose, in the owner’s terminal')
482
- const fails = await checkDoor(host)
448
+ const fails = await checkAdvisors(host)
483
449
  for (const f of fails) say(`FAIL ${f}`)
484
450
  const browser = await probeSignIn(host)
485
451
  if ('fail' in browser) say(`FAIL sign in in a browser: ${browser.fail}`)
@@ -497,7 +463,7 @@ export class AdvisorsPhotoCommand extends AdvisorsBase {
497
463
  static override usage = Command.Usage({
498
464
  category: 'Review',
499
465
  description: "a person's profile photo: cut square to 256 and 64 px webps, shown in the hub and on their page",
500
- details: 'An agent may set it: the hub shows it at once, and it reaches that person’s own signed in page only once the owner set it himself or sends it from the advisors page. A url is https only, an image type, 5 MB at most (wiki tools/shipkit/advisors.md, A face for each person).',
466
+ details: 'An agent may set it: the hub shows it at once, and it reaches that person’s own signed in page only once the owner set it himself or sends it from the advisors page. A url is https only, an image type, 5 MB at most (wiki tools/shipkit/advisors.md, A face for each advisor).',
501
467
  examples: [['from a file', 'sk advisors photo Ada ada.jpg'], ['from a url', 'sk advisors photo Ada --from-url https://example.org/ada.png'], ['back to initials', 'sk advisors photo Ada --remove']],
502
468
  })
503
469
  advisor = Option.String()
@@ -522,4 +488,4 @@ export class AdvisorsPhotoCommand extends AdvisorsBase {
522
488
  }
523
489
  }
524
490
 
525
- export const ADVISORS_COMMANDS = [AdvisorsListCommand, AdvisorsPeopleCommand, AdvisorsAccessCommand, AdvisorsRightsCommand, AdvisorsAddCommand, AdvisorsPhotoCommand, AdvisorsDraftCommand, AdvisorsDraftsCommand, AdvisorsEnableCommand, AdvisorsRevokeCommand, AdvisorsRenewCommand, AdvisorsExposeCommand, AdvisorsTunnelCommand, AdvisorsLiveCommand, AdvisorsCheckCommand, ThreadShareCommand, ThreadUnshareCommand]
491
+ export const ADVISORS_COMMANDS = [AdvisorsListCommand, AdvisorsPeopleCommand, AdvisorsAccessCommand, AdvisorsRightsCommand, AdvisorsAddCommand, AdvisorsPhotoCommand, AdvisorsDraftCommand, AdvisorsDraftsCommand, AdvisorsEnableCommand, AdvisorsRevokeCommand, AdvisorsRenewCommand, AdvisorsExposeCommand, AdvisorsTunnelCommand, AdvisorsCheckCommand, ThreadShareCommand, ThreadUnshareCommand]
@@ -438,12 +438,12 @@ export class AsksMigrateCommand extends Command {
438
438
  static override usage = Command.Usage({
439
439
  category: 'Asks',
440
440
  description: 'old asks into the thread store: files, « Done: » questions, old steps; a look unless --go',
441
- details: "Each file, open, done or declined, becomes its thread ask:<id>, or completes the thread it has: its facts on the head, its words, its status said in the thread, its later day as a set aside. Then every field of every file is compared with what the store reads back: any difference fails. Re-runnable: an ask whose thread says what its file says is left alone. An older ask's « Done: <title> » question folds into the ask bar, its one « done », counted before and after; his answer on one is kept. An open ask whose words are not the shape of wiki tools/shipkit/threads-instructions.md gets them again as instructions whose steps are their own checklist: an older one's « The steps » checklist folds in, a step that had him paste a secret at a terminal prompt holds its field in place of the command (a secret question asked beside the steps moves in, his stored answer kept), a « ## ✅ N. » heading drawn with no box becomes a step, a step that told the agent goes; his ticks kept by step title; one whose steps would read otherwise is left and named. --go runs sk backup first and stops when it fails. --all: every house repo. The files stay: remove them by git once the compare is clean.",
442
- examples: [['a look in this repo', 'sk asks migrate'], ['every house repo, after a backup', 'sk asks migrate --all --go']],
441
+ details: "Each file, open, done or declined, becomes its thread ask:<id>, or completes the thread it has: its facts on the head, its words, its status said in the thread, its later day as a set aside. Then every field of every file is compared with what the store reads back: any difference fails. Re-runnable: an ask whose thread says what its file says is left alone. An older ask's « Done: <title> » question folds into the ask bar, its one « done », counted before and after; his answer on one is kept. An open ask whose words are not the shape of wiki tools/shipkit/threads-instructions.md gets them again as instructions whose steps are their own checklist: an older one's « The steps » checklist folds in, a step that had him paste a secret at a terminal prompt holds its field in place of the command (a secret question asked beside the steps moves in, his stored answer kept), a « ## ✅ N. » heading drawn with no box becomes a step, a step that told the agent goes; his ticks kept by step title; one whose steps would read otherwise is left and named. --go writes: the ask files stay in git, the threads in the hq. --all: every house repo. The files stay: remove them by git once the compare is clean.",
442
+ examples: [['a look in this repo', 'sk asks migrate'], ['every house repo', 'sk asks migrate --all --go']],
443
443
  })
444
444
 
445
445
  all = Option.Boolean('--all', false, { description: 'every house repo, each its own store' })
446
- go = Option.Boolean('--go', false, { description: 'write, after sk backup' })
446
+ go = Option.Boolean('--go', false, { description: 'write' })
447
447
 
448
448
  async execute(): Promise<number> {
449
449
  const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
@@ -455,13 +455,6 @@ export class AsksMigrateCommand extends Command {
455
455
  const { houseRepoRoots } = await import('../social/house.ts')
456
456
  const roots = this.all ? (await houseRepoRoots(process.cwd())).map((r) => r.path) : [process.cwd()]
457
457
  const word = (c: { open: number; done: number; declined: number }): string => `${c.open} open, ${c.done} done, ${c.declined} declined`
458
- if (this.go)
459
- for (const argv of [['sk', 'backup']]) {
460
- out(`backup first: ${argv.join(' ')}`)
461
- const b = Bun.spawnSync(argv, { stdout: 'pipe', stderr: 'pipe' })
462
- for (const l of `${b.stdout?.toString() ?? ''}${b.stderr?.toString() ?? ''}`.trim().split('\n').slice(-3)) out(` ${l}`)
463
- if (b.exitCode !== 0) throw new Error(`${argv.join(' ')} failed: nothing written, the asks and the stores are as they were`)
464
- }
465
458
  let bad = 0
466
459
  for (const root of roots) {
467
460
  const fold = await foldDoneConfirms(root, { go: this.go, ...(process.env.SK_AGENT ? { lane: process.env.SK_AGENT } : {}) })
@@ -1,11 +1,11 @@
1
- // sk backup: the untracked project files of the house kept in the private Space (media-store/backup/, wiki
2
- // tools/shipkit/media-store-backup.md): a run now, what is not backed up yet, the runs, a restore, the drill.
1
+ // sk backup: the old runs of the retired backup of untracked project files (media-store/backup/, wiki
2
+ // tools/shipkit/media-store-backup.md): no new run, no prune; the runs, a restore, the drill, an undelete.
3
3
  // Every module loads inside execute: the cli registers this file on every `sk` call
4
4
  import { Command, Option } from './clip.ts'
5
5
  import { bytesWords } from '../core/words.ts'
6
6
  import { BackupStatusCommand, BackupTargetsCommand } from './cmd_BackupTargets.ts'
7
7
 
8
- const DETAILS = `the untracked project files, real files no git, no hq and no Space keeps (each house repo's untracked .shipkit/ files but its thread store folders, its hand tuned .comfy-ts/ files, its gitignored *.local.* files, and what its repo.config.ts names under backup: paths kept whole, sqlite files; the agents' memories, the veille logs, the rail order, the machine's private folder; never a database of the machine: the hq holds every thread and its events) go up to the owner's private Space under backup/<sha256>, each run under backup/runs/ with its parts under backup/parts/ (a part unchanged since the last run is not written again). The retention of the house config (serve.backupRetention) keeps every run of the last hours, then the newest of each day, week and month it counts; after each run the daemon deletes this machine's other runs and the objects only they named (sk backup prune). Secrets never go: a file whose name or text says it holds one is refused, with the reason. A foreign repo (foreign: true in its repo.config.ts) never goes: none of its files or memories, and each run names it as left out. The daemon runs it on change (debounced) and every 6 h. Page: wiki tools/shipkit/media-store.md, Backup`
8
+ const DETAILS = `the runs made before the backup of untracked project files retired: each one under backup/runs/ in the owner's private Space, its parts under backup/parts/, its files under backup/<sha256>. No new run is made and nothing prunes them, so every run stays readable and restorable. Page: wiki tools/shipkit/media-store-backup.md`
9
9
 
10
10
  type Ctx = { stdout: NodeJS.WritableStream; stderr: NodeJS.WritableStream }
11
11
 
@@ -39,48 +39,20 @@ async function run(context: Ctx, body: (h: Here) => Promise<number>): Promise<nu
39
39
  }
40
40
 
41
41
 
42
+ /** why no new run is made: each precious thing has its own store, and a check names what has none */
43
+ export const RETIRED_WORDS = 'the backup of untracked project files is retired: a precious file belongs in git, the hq, the Space (sk media put) or the vault, and the house check RV049 (sk check) names each untracked file that looks precious and where it belongs. The old runs stay in the Space: sk backup runs, sk backup restore'
44
+
42
45
  export class BackupCommand extends Command {
43
46
  static override paths = [['backup']]
44
47
  static override usage = Command.Usage({
45
48
  category: 'Media',
46
- description: 'the untracked project files of the house up to the private Space now, secrets refused',
47
- details: `${DETAILS}\n\nA run reads every source, hashes it (a sqlite: a consistent snapshot first), sends each object the Space lacks, then writes ONE manifest (path, sha, size, time of every file), last. A run whose state equals the last one writes nothing. --check sends nothing: it prints what the Space lacks, what changed since the last run, and what is refused, and exits 1 when something waits.`,
48
- examples: [['back up now', 'sk backup'], ['what is not backed up yet', 'sk backup --check']],
49
+ description: 'retired: no new run; the old runs stay readable (runs, restore, drill)',
50
+ details: `${RETIRED_WORDS}. Page: wiki tools/shipkit/media-store-backup.md`,
51
+ examples: [['the old runs', 'sk backup runs'], ['what looks precious and has no copy', 'sk check RV049']],
49
52
  })
50
- check = Option.Boolean('--check', false, { description: 'send nothing: what is not backed up yet, exit 1 when something waits' })
51
53
  async execute(): Promise<number> {
52
- return run(this.context, async (h) => {
53
- const { backupCheck, backupRun } = await import('../media-store/backup/run.ts')
54
- const { backupRepos } = await import('../media-store/backup/sources.ts')
55
- const { FOREIGN_WHY } = await import('../core/foreign.ts')
56
- const { relative } = await import('node:path')
57
- for (const r of backupRepos(h.repos).left) h.out(`left out ~/${relative(h.home, r)}: its files and memories: ${FOREIGN_WHY}`)
58
- const refusedLines = (list: { path: string; why: string }[]): void => {
59
- for (const r of list) h.out(` refused ~/${r.path}: ${r.why}`)
60
- }
61
- if (this.check) {
62
- // a look only: the local files as the daemon's looks keep them, never each repo's git walk again
63
- const { keptLocals } = await import('../media-store/backup/daemon.ts')
64
- const c = await backupCheck(h.space, { home: h.home, repos: h.repos, locals: keptLocals() })
65
- h.out(`${c.files} files read; the last run: ${c.last ? `${c.last.at} (${c.last.key})` : 'none'}`)
66
- h.out(`${c.waiting.length} not in the Space yet (${bytesWords(c.waiting.reduce((n, w) => n + w.size, 0))}), ${c.changed.length} changed since the last run, ${c.refused.length} refused`)
67
- for (const w of c.waiting.slice(0, 40)) h.out(` waiting ~/${w.path}`)
68
- if (c.waiting.length > 40) h.out(` … ${c.waiting.length - 40} more`)
69
- refusedLines(c.refused)
70
- return c.waiting.length > 0 || c.changed.length > 0 ? 1 : 0
71
- }
72
- const t0 = Date.now()
73
- const r = await backupRun(h.space, { home: h.home, repos: h.repos })
74
- h.out(`${r.files} files (${bytesWords(r.bytes)}): ${r.sent} objects up (${bytesWords(r.sentBytes)}), ${r.there} already there, ${r.refused.length} refused, in ${((Date.now() - t0) / 1000).toFixed(1)} s`)
75
- refusedLines(r.refused)
76
- for (const f of r.failed.slice(0, 5)) h.err(`FAIL: ${f.key}: ${f.error}`)
77
- if (r.failed.length > 0) {
78
- h.err(`FAIL: ${r.failed.length} objects did not go up: no manifest written, the next run tries again`)
79
- return 1
80
- }
81
- h.out(r.manifest ? `run ${r.manifest}: ${r.record.partsSent} of ${r.record.parts} parts written (${(r.record.partsBytes / 1e3).toFixed(1)} kB), the run ${(r.record.runBytes / 1e3).toFixed(1)} kB` : `unchanged since ${r.last?.at} (${r.last?.key}): nothing written`)
82
- return 0
83
- })
54
+ this.context.stderr.write(`FAIL: backup: ${RETIRED_WORDS}\n`)
55
+ return 1
84
56
  }
85
57
  }
86
58
 
@@ -92,24 +64,20 @@ export class BackupRunsCommand extends Command {
92
64
  static override usage = Command.Usage({
93
65
  category: 'Media',
94
66
  description: 'the backup runs in the Space, newest first: the count per machine, then time, machine and key',
95
- details: `${DETAILS}\n\nThe first line counts the runs per machine; the newest ${RUNS_SHOWN} follow, newest first, each with the retention slots that keep it, or « goes at the next prune ». --all lists every run, oldest first.`,
67
+ details: `${DETAILS}\n\nThe first line counts the runs per machine; the newest ${RUNS_SHOWN} follow, newest first. --all lists every run, oldest first.`,
96
68
  examples: [['the latest runs', 'sk backup runs'], ['every run', 'sk backup runs --all']],
97
69
  })
98
70
  all = Option.Boolean('--all', false, { description: 'every run, oldest first' })
99
71
  async execute(): Promise<number> {
100
72
  return run(this.context, async (h) => {
101
- const { runSlots, houseRetention, pinnedRuns } = await import('../media-store/backup/prune.ts')
102
- const { runsOf } = await import('../media-store/backup/manifest.ts')
103
- const { policy, why } = await houseRetention()
104
- const pins = await pinnedRuns()
105
- const rows = policy ? await runSlots(h.space, { policy, now: Date.now(), pinned: [...pins.keys()], pinLabel: (k) => pins.get(k) }) : (await runsOf(h.space)).map((r) => ({ run: r, host: r.machine, slots: null }))
73
+ const { runsOf, hostsOfRuns } = await import('../media-store/backup/manifest.ts')
74
+ const runs = await runsOf(h.space)
75
+ const hosts = await hostsOfRuns(h.space, runs)
76
+ const hostOf = (key: string): string => hosts.get(key) ?? '(host unread)'
106
77
  const per = new Map<string, number>()
107
- for (const r of rows) per.set(r.host ?? '(host unread)', (per.get(r.host ?? '(host unread)') ?? 0) + 1)
108
- const going = rows.filter((r) => r.slots?.length === 0).length
109
- h.out(`${rows.length} runs: ${[...per].map(([m, n]) => `${n} of ${m}`).join(', ')}${policy ? `; ${going} go at the next prune` : ''}${!this.all && rows.length > RUNS_SHOWN ? `; the newest ${RUNS_SHOWN} below, --all for every one` : ''}`)
110
- if (!policy) h.out(`note: ${why}`)
111
- const slotText = (s: string[] | null): string => (s == null ? '' : ` ${s.length ? s.join(', ') : 'goes at the next prune'}`)
112
- for (const r of this.all ? rows : rows.slice(-RUNS_SHOWN).reverse()) h.out(`${r.run.at.toISOString()} ${r.host ?? '(host unread)'} ${r.run.key} ${(r.run.size / 1e3).toFixed(0)} kB${slotText(r.slots)}`)
78
+ for (const r of runs) per.set(hostOf(r.key), (per.get(hostOf(r.key)) ?? 0) + 1)
79
+ h.out(`${runs.length} runs: ${[...per].map(([m, n]) => `${n} of ${m}`).join(', ')}${!this.all && runs.length > RUNS_SHOWN ? `; the newest ${RUNS_SHOWN} below, --all for every one` : ''}`)
80
+ for (const r of this.all ? runs : runs.slice(-RUNS_SHOWN).reverse()) h.out(`${r.at.toISOString()} ${hostOf(r.key)} ${r.key} ${(r.size / 1e3).toFixed(0)} kB`)
113
81
  return 0
114
82
  })
115
83
  }
@@ -119,8 +87,8 @@ export class BackupUndeleteCommand extends Command {
119
87
  static override paths = [['backup', 'undelete']]
120
88
  static override usage = Command.Usage({
121
89
  category: 'Media',
122
- description: 'a prune undone within its 7 days of trash: these keys, or every delete since a time, back',
123
- details: `${DETAILS}\n\nA prune deletes with a delete marker: the bucket keeps the versions for 7 days, then the trash goes. This removes the markers, so each object is back as it was. Name the keys (runs, parts, bytes under backup/), or --since a time to undo every delete since then. Undo a whole apply with --since its start, then run sk backup drill.`,
90
+ description: 'a past prune undone: these keys, or every delete since a time, back',
91
+ details: `${DETAILS}\n\nA past prune deleted with a delete marker, and the bucket keeps the versions behind it: nothing empties that trash now. This removes the markers, so each object is back as it was. Name the keys (runs, parts, bytes under backup/), or --since a time to undo every delete since then. Undo a whole apply with --since its start, then run sk backup drill.`,
124
92
  examples: [['undo an apply', 'sk backup undelete --since 2026-11-20T18:40Z'], ['one run back', 'sk backup undelete backup/runs/20261110T120000Z-laptop-0123456789ab.json.gz']],
125
93
  })
126
94
  since = Option.String('--since', { description: 'every key deleted at or after this time: 2026-11-20T18:40Z or 20261120T184000Z' })
@@ -140,61 +108,6 @@ export class BackupUndeleteCommand extends Command {
140
108
  }
141
109
  }
142
110
 
143
- export class BackupPinCommand extends Command {
144
- static override paths = [['backup', 'pin']]
145
- static override usage = Command.Usage({
146
- category: 'Media',
147
- description: 'a backup run kept past its retention slots for some days: the one taken before a migration',
148
- details: `${DETAILS}\n\nThe run is this machine's last one unless --run names another. The pin lives in the machine db; the prune keeps the run while it holds. With no flag beyond --list, the pins that hold.`,
149
- examples: [['keep the last run 30 days', "sk backup pin --why 'before the social posts migration'"], ['the pins that hold', 'sk backup pin --list']],
150
- })
151
- key = Option.String('--run', { description: 'the run key, as sk backup runs prints it: this machine\'s last run when absent' })
152
- days = Option.String('--days', '30', { description: 'how many days the pin holds' })
153
- why = Option.String('--why', '', { description: 'why it is kept, shown beside the run in sk backup runs' })
154
- list = Option.Boolean('--list', false, { description: 'the pins that hold, nothing pinned' })
155
- async execute(): Promise<number> {
156
- const { backupPins, pinRun } = await import('../media-store/backup/prune.ts')
157
- const { lastRun } = await import('../media-store/backup/run.ts')
158
- try {
159
- if (this.list) {
160
- for (const p of backupPins()) this.context.stdout.write(`${p.key} till ${new Date(p.until).toISOString()} ${p.why}\n`)
161
- return 0
162
- }
163
- const key = this.key ?? lastRun()?.key
164
- if (!key) throw new Error('this machine wrote no run yet: sk backup first')
165
- const days = Number(this.days)
166
- if (!Number.isFinite(days) || days <= 0) throw new Error(`--days ${this.days}: a number of days over 0`)
167
- const p = pinRun(key, days, this.why || 'pinned by hand')
168
- this.context.stdout.write(`ok: ${p.key} kept till ${new Date(p.until).toISOString()}: ${p.why}\n`)
169
- return 0
170
- } catch (e) {
171
- this.context.stderr.write(`FAIL: backup pin: ${(e as Error).message}\n`)
172
- return 1
173
- }
174
- }
175
- }
176
-
177
- export class BackupPruneCommand extends Command {
178
- static override paths = [['backup', 'prune']]
179
- static override usage = Command.Usage({
180
- category: 'Media',
181
- description: "this machine's runs no retention slot keeps, and the objects only they name: dry run unless --apply",
182
- details: `${DETAILS}\n\nThe policy is the house config's serve.backupRetention: every run of the last allHours, then the newest of each of the last days calendar days, weeks ISO weeks and months months (UTC), a slot with no run keeping the next older one. The newest run and every pinned run (sk backup pin) always stay. A machine prunes only its own runs. An object goes only when no run that stays names it, no run of another machine names it, and it is over 48 h old; each goes with every version, its index row first. Without --apply it prints what would go. The daemon prunes after each run, at most 200 runs at a time.`,
183
- examples: [['what the retention would delete', 'sk backup prune'], ['delete it', 'sk backup prune --apply']],
184
- })
185
- apply = Option.Boolean('--apply', false, { description: 'delete: without it, only print what would go' })
186
- async execute(): Promise<number> {
187
- return run(this.context, async (h) => {
188
- const { pruneBackups } = await import('../media-store/backup/prune.ts')
189
- const t0 = Date.now()
190
- const p = await pruneBackups(h.space, { apply: this.apply })
191
- for (const l of p.lines) (l.startsWith('WARN') ? h.err : h.out)(l)
192
- h.out(`in ${((Date.now() - t0) / 1000).toFixed(1)} s`)
193
- return p.result != null && p.result.failed.length > 0 ? 1 : 0
194
- })
195
- }
196
- }
197
-
198
111
  export class BackupRestoreCommand extends Command {
199
112
  static override paths = [['backup', 'restore']]
200
113
  static override usage = Command.Usage({
@@ -206,7 +119,7 @@ export class BackupRestoreCommand extends Command {
206
119
  to = Option.String('--to', { description: 'an empty or new folder the files land under' })
207
120
  inPlace = Option.Boolean('--in-place', false, { description: 'over the live files, each one replaced copied aside first' })
208
121
  at = Option.String('--at', { description: 'the last run at or before this time: 2026-11-04T13:50Z, 2026-11-04 or 20261104T135000Z' })
209
- 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)' })
122
+ under = Option.String('--path', { description: 'only the files under this path of the home: .shipkit/home/veille (a run made before the one root names it .config/shipkit/home/veille: either form matches)' })
210
123
  host = Option.String('--host', { description: "another Mac's runs, by the name `sk backup runs` prints: this Mac's when absent" })
211
124
  async execute(): Promise<number> {
212
125
  return run(this.context, async (h) => {
@@ -228,32 +141,17 @@ export class BackupDrillCommand extends Command {
228
141
  category: 'Media',
229
142
  description: 'a backup run restored into a scratch folder, every sha compared with the live files',
230
143
  details: `${DETAILS}\n\n--at drills an older run (a run of the first version, one manifest, reads too). A file the live machine changed since the run counts apart (the next run takes it), and so does one gone from the disk; a sqlite compares its rows per table. Exit 1 when a file did not come back with its sha. The scratch folder is removed unless --to names one.`,
231
- examples: [['the drill', 'sk backup drill'], ['an older run', 'sk backup drill --at 20261104T130646Z'], ['the mirror on a machine', 'sk backup drill --target nas']],
144
+ examples: [['the drill', 'sk backup drill'], ['an older run', 'sk backup drill --at 20261104T130646Z']],
232
145
  })
233
146
  to = Option.String('--to', { description: 'restore into this empty or new folder, and keep it' })
234
147
  at = Option.String('--at', { description: 'the last run at or before this time, an older run: 2026-11-04T13:50Z or 20261104T135000Z' })
235
148
  host = Option.String('--host', { description: "another Mac's runs, by the name `sk backup runs` prints: this Mac's when absent" })
236
- target = Option.String('--target', { description: 'an ssh target of sk backup targets: its mirror read in place of the Space' })
237
149
  async execute(): Promise<number> {
238
150
  return run(this.context, async (h) => {
239
151
  const { drill } = await import('../media-store/backup/restore.ts')
240
152
  const { parseAt } = await import('../media-store/backup/keys.ts')
241
153
  const t0 = Date.now()
242
- let space = h.space
243
- let recordAs: string | undefined
244
- if (this.target != null) {
245
- const { askHqAdmin } = await import('../hq/hq-local.ts')
246
- const { sshSpace } = await import('../media-store/backup/ssh-space.ts')
247
- const { machineName } = await import('../home/machine-host.ts')
248
- const r = await askHqAdmin<{ targets: import('../hq/backup-targets.ts').BackupTarget[] }>('/api/home/hq/targets')
249
- if ('refused' in r) throw new Error(r.refused)
250
- const t = r.targets.find((x) => x.id === this.target)
251
- if (t == null || t.address.kind !== 'ssh') throw new Error(`${this.target}: no ssh target of that id (sk backup targets)`)
252
- space = sshSpace({ peer: t.address.host, folder: t.address.folder, machine: machineName() })
253
- recordAs = `target-drill:files:${t.id}`
254
- h.out(`from ${space.where}`)
255
- }
256
- const d = await drill(space, { ...(recordAs == null ? {} : { recordAs }), home: h.home, ...(this.to !== undefined ? { to: this.to } : {}), ...(this.at ? { at: parseAt(this.at) } : {}), ...(this.host ? { machine: this.host } : {}) })
154
+ const d = await drill(h.space, { home: h.home, ...(this.to !== undefined ? { to: this.to } : {}), ...(this.at ? { at: parseAt(this.at) } : {}), ...(this.host ? { machine: this.host } : {}) })
257
155
  h.out(`run ${d.at} (${d.run}, version ${d.v}): ${d.files} files (${bytesWords(d.bytes)}), ${d.restored} restored with their sha, in ${((Date.now() - t0) / 1000).toFixed(1)} s`)
258
156
  h.out(`against the live files: ${d.sameAsLive} the same, ${d.liveMoved.length} moved since the run, ${d.liveGone.length} gone from the disk, ${d.failed.length} failed`)
259
157
  for (const s of d.sqlite) h.out(` sqlite ~/${s.path}: restored ${JSON.stringify(s.restored)}, live now ${JSON.stringify(s.live)}`)
@@ -265,4 +163,4 @@ export class BackupDrillCommand extends Command {
265
163
  }
266
164
  }
267
165
 
268
- export const BACKUP_COMMANDS = [BackupCommand, BackupRunsCommand, BackupPruneCommand, BackupPinCommand, BackupUndeleteCommand, BackupRestoreCommand, BackupDrillCommand, BackupStatusCommand, BackupTargetsCommand]
166
+ export const BACKUP_COMMANDS = [BackupCommand, BackupRunsCommand, BackupUndeleteCommand, BackupRestoreCommand, BackupDrillCommand, BackupStatusCommand, BackupTargetsCommand]
@@ -3,7 +3,7 @@
3
3
  // records. Every module loads inside execute: the cli registers this file on every `sk` call
4
4
  import { Command, Option } from './clip.ts'
5
5
 
6
- const STATUS_DETAILS = `one row a store of a machine (the vault and the hq of the hq's machine, then each machine's untracked project files), one line a place: its own disk, Time Machine, and every target of sk backup targets. Each line says its newest copy and its last proof, read from what the senders and the drills kept (no network). The table is judged on the machine that carries the hq, from its records and the other machines' hq reports; on a client this command reads it from the hq, so every machine prints the same table, stale (never green, never red) while the hq does not answer. A store with no working copy off its machine is red; so is a copy past its bound or a drill that failed; a cell not proven keeps the headline from green. The same table is the « backups » entry of the hub's database page, and any red puts a red band on every hub page. Exit 1 on any red. Page: wiki tools/shipkit/media-store-backup.md, The status`
6
+ const STATUS_DETAILS = `one row a store (the vault, the hq, the Space; the untracked project files are no row since their backup retired), one line a place: its own disk, Time Machine, and every target of sk backup targets. Each line says its newest copy and its last proof, read from what the senders and the drills kept (no network). The table is judged on the machine that carries the hq, from its records; on a client this command reads it from the hq, so every machine prints the same table, stale (never green, never red) while the hq does not answer. The vault or the hq with no working copy off its machine is red, the Space with no second copy orange; so is a copy past its bound or a drill that failed; a cell not proven keeps the headline from green. The same table is the « backups » entry of the hub's database page, and any red puts a red band on every hub page. Exit 1 on any red. Page: wiki tools/shipkit/media-store-backup.md, The status`
7
7
 
8
8
  const MARK = { ok: 'ok ', warn: 'WARN', danger: 'RED ', dim: ' ' } as const
9
9
 
@@ -1,5 +1,7 @@
1
1
  // sk capacity: how many lanes this repo runs now. Report only, exit 0 always: the orchestrator decides.
2
2
  import { Command, Option } from './clip.ts'
3
+ import { whoLines } from '../core/admission.ts'
4
+ import { readWho } from '../gate/admit-heavy.ts'
3
5
  import { capacityLines, readCapacity } from '../core/capacity.ts'
4
6
 
5
7
  export class CapacityCommand extends Command {
@@ -9,7 +11,7 @@ export class CapacityCommand extends Command {
9
11
  static override usage = Command.Usage({
10
12
  category: 'Health',
11
13
  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.',
14
+ 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. Then who uses the CPU, one ps grouped by repo (the Claude session above a process, else a path of its command) with the commands that lead each and its sessions: the same names a heavy command prints while it waits on a full machine. Report only, exit 0 always.',
13
15
  examples: [
14
16
  ['before a lane starts', 'sk capacity'],
15
17
  ['with the maximum the owner gave', 'sk capacity --max 5'],
@@ -23,8 +25,10 @@ export class CapacityCommand extends Command {
23
25
  async execute(): Promise<number> {
24
26
  const max = this.max == null ? null : Number(this.max)
25
27
  if (max != null && !(Number.isInteger(max) && max >= 1)) { this.context.stdout.write(`FAIL: --max takes a whole number of lanes, 1 or more, got ${this.max}\n`); return 2 }
28
+ const reading = readWho()
26
29
  const { capacity, live, repo } = readCapacity(process.cwd(), max)
27
- this.context.stdout.write(this.json ? `${JSON.stringify({ ...capacity, repo, live })}\n` : `${capacityLines(capacity, live, repo).join('\n')}\n`)
30
+ const who = await reading
31
+ this.context.stdout.write(this.json ? `${JSON.stringify({ ...capacity, repo, live, who })}\n` : `${[...capacityLines(capacity, live, repo), ...whoLines(who)].join('\n')}\n`)
28
32
  return 0
29
33
  }
30
34
  }
@@ -93,17 +93,3 @@ export class ChecksCommand extends Command {
93
93
  return 0
94
94
  }
95
95
  }
96
-
97
- /** `shipkit units`, the name 0.38 shipped for this inventory. Hidden from the
98
- * help and the command index, it answers the same table with one WARN on
99
- * stderr, so a `--json` consumer still parses stdout. It dies with the rest
100
- * of the compatibility window at 0.40. */
101
- export class UnitsAliasCommand extends ChecksCommand {
102
- static override paths = [['units']]
103
- static override usage = undefined
104
-
105
- override async execute(): Promise<number> {
106
- this.context.stderr.write('WARN shipkit units is now shipkit checks, the old name goes at 0.40\n')
107
- return await super.execute()
108
- }
109
- }
package/src/cli/cmd_Ci.ts CHANGED
@@ -79,7 +79,7 @@ export class CiCommand extends Command {
79
79
 
80
80
  private async gate(root: string): Promise<number> {
81
81
  const print = (l: string): void => { this.context.stdout.write(`${l}\n`) }
82
- const sel = { bail: this.bail, json: this.json, skipGroups: this.skip, withIds: this.withIds, onlyIds: listFlag(this.only), fresh: this.fresh, verbose: this.verbose, ...(this.full ? { tests: 'full' as const } : {}), print }
82
+ const sel = { admit: true, bail: this.bail, json: this.json, skipGroups: this.skip, withIds: this.withIds, onlyIds: listFlag(this.only), fresh: this.fresh, verbose: this.verbose, ...(this.full ? { tests: 'full' as const } : {}), print }
83
83
  if (this.headCheckout) return await (await import('../gate/head-gate.ts')).gateHeadCheckout(root, sel)
84
84
  if (this.head) return await (await import('../gate/head-gate.ts')).runHeadGate(root, sel)
85
85
  // a stale toolkit updates itself and restarts this exact invocation
@@ -87,6 +87,7 @@ export class CiCommand extends Command {
87
87
  await (await import('../core/self-update.ts')).maybeSelfUpdateAndRestart(root, { fresh: this.fresh })
88
88
  try {
89
89
  const opts = {
90
+ admit: true,
90
91
  bail: this.bail,
91
92
  json: this.json,
92
93
  fix: true,