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
@@ -13,14 +13,11 @@ import { dirname, isAbsolute, join } from 'path'
13
13
  import { fileURLToPath } from 'url'
14
14
  import { armHooks } from '../hooks/run-hooks.ts'
15
15
  import { FOREIGN_WHY, isForeign } from '../core/foreign.ts'
16
- import { loadRepoConfig, type RepoConfig } from '../repo-config.ts'
16
+ import type { RepoConfig } from '../repo-config.ts'
17
17
  import { runFix } from './run-fix.ts'
18
18
  import { repoOff } from '../core/when.ts'
19
- import { discoverLegacyChecks } from './discover-legacy-checks.ts'
20
- import { repoCheckFiles } from '../core/repo-walk.ts'
19
+ import { repoUnitFiles } from '../core/repo-walk.ts'
21
20
  import { mutateLease, withMutateLease } from '../core/locked-write.ts'
22
- import { layoutSummary, migrateLayout } from '../core/migrate-layout.ts'
23
- import { renderPolicy } from '../checks/SK004-gitignore-policy.check.ts'
24
21
  import { spawnWithTimeout } from '../core/spawn-timeout.ts'
25
22
  import { gitBin } from '../core/git-bin.ts'
26
23
  import { LAYOUT } from '../core/layout.ts'
@@ -190,13 +187,12 @@ const writeMemo = (root: string, key: string): void => {
190
187
  } catch { /* a memo that cannot be kept only means the next pass runs the fixers */ }
191
188
  }
192
189
 
193
- /** the bytes of repo.config.ts and the set of check and check files, as one
194
- * hash. Read without git, so a repo with no history is covered too */
190
+ /** the bytes of repo.config.ts and the set of unit files, as one hash. Read without git, so a repo with no history
191
+ * is covered too */
195
192
  function shapeStamp(root: string): string {
196
193
  let config = ''
197
194
  try { config = readFileSync(join(root, 'repo.config.ts'), 'utf8') } catch {}
198
- const files = [...repoCheckFiles(root), ...discoverLegacyChecks(root).map((d) => d.path)].sort()
199
- return String(Bun.hash(`${config}\0${files.join('\0')}`))
195
+ return String(Bun.hash(`${config}\0${repoUnitFiles(root).join('\0')}`))
200
196
  }
201
197
 
202
198
  export type FixPassOpts = {
@@ -254,40 +250,8 @@ export async function runFixPass(root: string, config: RepoConfig, o: FixPassOpt
254
250
  return { ran: false, touched: [], failed: false, reshaped: false }
255
251
  }
256
252
 
257
- async function fixPassBody(root: string, loaded: RepoConfig, o: FixPassOpts, verify: boolean): Promise<FixPassResult> {
258
- let config = loaded
253
+ async function fixPassBody(root: string, config: RepoConfig, o: FixPassOpts, verify: boolean): Promise<FixPassResult> {
259
254
  const shapeBefore = shapeStamp(root)
260
- // the old root layout moves under .shipkit/ before anything else reads a
261
- // path: a move is not a decision, so it lands as one machine commit and
262
- // only what a machine cannot decide reaches a human. Runs before the tree
263
- // snapshot, and before hooks arm, because the hooks folder may be what moves.
264
- // A foreign repo's folders are the team's, whatever their name: none moves
265
- if (!verify && o.only == null && !isForeign(root)) {
266
- const m = migrateLayout(root, { config, renderGitignore: (t, legacy, cfg) => renderPolicy(t, cfg ?? config, legacy) })
267
- // the move rewrote repo.config.ts, so the config loaded before it names
268
- // folders that are gone, and every fixer below must read the new one
269
- if (m.swept.includes('repo.config.ts')) {
270
- try { config = await loadRepoConfig(root, { fresh: true }) } catch (e) {
271
- o.print(`WARN repo.config.ts does not load after the move rewrote it: ${String((e as Error)?.message ?? e).slice(0, 160)}`)
272
- }
273
- }
274
- const what = layoutSummary(m)
275
- if (what !== '') {
276
- if (m.uncommitted === true) {
277
- o.print(`WARN layout: ${what}. The commit did not land`)
278
- const p = m.pending ?? []
279
- o.print(` fix: commit exactly these paths, never a bare commit: git commit -m 'chore: ${what}' -- ${p.slice(0, 12).join(' ')}${p.length > 12 ? ` (+${p.length - 12} more, listed by git status)` : ''}`)
280
- } else o.print(`ok: layout: ${what}${m.commit != null ? `, committed as ${m.commit}` : ''}`)
281
- }
282
- if (m.deferred != null) {
283
- o.print(`WARN the move under .shipkit/ is deferred: ${m.deferred}`)
284
- o.print(' fix: commit or discard that edit, then re-run shipkit ci')
285
- }
286
- for (const r of m.refusals) {
287
- o.print(`WARN ${r.from}/ cannot move to ${r.to}/: ${r.reason}`)
288
- o.print(` fix: move the files into ${r.to}/ yourself, then delete ${r.from}/`)
289
- }
290
- }
291
255
  // the project's resources file its CLAUDE.md loads (context/project-context.ts), written where no daemon reaches:
292
256
  // a worktree, a stranger's repo. Gitignored, so never a fixer rewrite and never a decision; the line is SK003's.
293
257
  // Measured: about 80 ms the first time in a process, 10 to 15 ms when nothing moved
@@ -39,8 +39,8 @@ const realOf = (p: string): string => {
39
39
  }
40
40
 
41
41
  /** the signing keychain in the user's search list, once, at its path now: codesign finds an identity only there,
42
- * `--keychain` or not. An entry that names the same file by another path (the machine's old root, a link to the new
43
- * one since sk home move) gives way to it */
42
+ * `--keychain` or not. An entry that names the same file by another path (`~/.config/shipkit`, a link to the machine's
43
+ * one root) gives way to it */
44
44
  export function listed(kc: string, r: Run): void {
45
45
  const now = r(['security', 'list-keychains', '-d', 'user']).out.split('\n').map((l) => l.trim().replace(/^"|"$/g, '')).filter((l) => l !== '')
46
46
  if (now.includes(kc)) return
@@ -1,9 +1,9 @@
1
1
  // where every backup of the house lives and whether it works (wiki tools/shipkit/media-store-backup.md, The status):
2
- // one table, a row a store of a machine (the vault, the hq, then each machine's untracked project files; never a
3
- // database of a machine: the hq holds every thread, a machine's rows are its outbox, judged by hq-holds),
2
+ // one table, a row a store (the vault, the hq, the Space; never a machine's untracked files, whose backup is retired,
3
+ // nor a database of a machine: the hq holds every thread, a machine's rows are its outbox, judged by hq-holds),
4
4
  // a column a place (its own disk, Time Machine, each backup target), every cell its newest copy, its last proof and its
5
- // state. ONE judgement, made on the machine that carries the hq: the others report their own records with their hq
6
- // report and read the table from the hq, so every hub (the hq's Mac, a client, the phone) draws the same rows.
5
+ // state. ONE judgement, made on the machine that carries the hq: the other machines read the table from the hq, so
6
+ // every hub (the hq's Mac, a client, the phone) draws the same rows.
7
7
  //
8
8
  // The constraint a reader breaks first: it reads what the senders and the drills KEPT (the machine db, Litestream's own
9
9
  // files, Time Machine's prefs), never the network, so a page asks it often; a store with no working copy off its
@@ -12,14 +12,15 @@ import { machineGet, machineSet } from '../core/machine-db.ts'
12
12
  import { ageWords } from '../core/words.ts'
13
13
  import type { BackupTarget } from '../hq/backup-targets.ts'
14
14
  import { type Drill, healthWords, REPLICA_BEHIND_MS, replicaLag, type ReplicaHealth, type ReplicaPlace } from '../hq/replica.ts'
15
- import type { BackupDrill } from '../media-store/backup/restore.ts'
16
- import type { TargetSent, StoreId } from '../media-store/backup/target-send.ts'
17
- import { type BackupFacts, isBackupFacts, timeMachineFacts, type TimeMachineFacts } from '../media-store/backup/facts.ts'
15
+ import type { TargetSent } from '../media-store/backup/target-send.ts'
16
+ import { timeMachineFacts, type TimeMachineFacts } from '../media-store/backup/facts.ts'
18
17
  import { rowName } from './backup-verdict.ts'
19
18
  import type { Proof } from '../media-store/copy/proof.ts'
20
19
  import type { ProvedRecord, Sent } from '../vault/vault-snapshot.ts'
21
20
 
22
21
  export type CellState = 'ok' | 'warn' | 'danger' | 'dim'
22
+ /** the stores of the table: the vault, the hq, and the Space, whose one copy off its provider is the second place */
23
+ export type StoreId = 'vault' | 'hq' | 'space'
23
24
  /** `row` names the store and its machine; `short` is the cell of the matrix (an age, or a word for a state), `text`
24
25
  * and `proof` its full line; `off`: the place is off the store's machine, so it counts as a copy; `of`: a cell judged
25
26
  * by the proof of the Space's second copy */
@@ -38,17 +39,13 @@ const BROKEN = new Set(['drill FAILED', 'proof FAILED', 'stopped', 'stalled'])
38
39
  export const STORES: { id: StoreId; name: string; what: string }[] = [
39
40
  { id: 'vault', name: 'the vault', what: 'every secret, sealed: OpenBao' },
40
41
  { id: 'hq', name: 'the hq', what: 'hq.sqlite: machines, nodes, the items, messages and events of every thread' },
41
- { id: 'files', name: 'the untracked project files', what: "real files that exist nowhere else: what git does not track in each project (its .shipkit/ plans, notes and reviews, its *.local.* files, its tuned ComfyUI files, the paths its config names), the agents' memories, the Veille logs" },
42
+ { id: 'space', name: 'the Space', what: 'every media file the store keeps, the release pictures, the backup runs made before the backup of untracked files retired' },
42
43
  ]
43
- /** the stores every machine keeps of its own; the vault and the hq live on the hq's machine alone */
44
- const OWN_STORES: readonly StoreId[] = ['files']
45
44
 
46
45
  const H = 3_600_000
47
- /** past these a copy is stale: the vault's snapshot is daily, a backup run every 6 h, the hq's copy to a target is
48
- * hourly, the Space copied to the second place nightly */
49
- export const BOUNDS = { vault: 26 * H, run: 7 * H, hqCopy: 2 * H, hqCopyDanger: 26 * H, drill: 8 * 24 * H, timeMachine: 3 * 24 * H, spaceCopy: 26 * H, spaceCopyDanger: 50 * H }
50
- /** a machine's report older than this is stale: its rows are shown as they were, orange, never red */
51
- export const REPORT_STALE_MS = 15 * 60_000
46
+ /** past these a copy is stale: the vault's snapshot is daily, the hq's copy to a target is hourly, the Space copied
47
+ * to the second place nightly */
48
+ export const BOUNDS = { vault: 26 * H, hqCopy: 2 * H, hqCopyDanger: 26 * H, drill: 8 * 24 * H, timeMachine: 3 * 24 * H, spaceCopy: 26 * H, spaceCopyDanger: 50 * H }
52
49
 
53
50
  /** what the status reads, gathered by `readBackupInputs` in the daemon or handed by a test */
54
51
  export type BackupInputs = {
@@ -62,8 +59,6 @@ export type BackupInputs = {
62
59
  vaultNear: { count: number; newest: number | null }
63
60
  timeMachine: TimeMachineFacts
64
61
  secondPlaceKey: boolean | null
65
- /** every other machine's own stores, as its last hq report said them */
66
- others?: { machine: string; at: number; facts: BackupFacts | null }[]
67
62
  }
68
63
 
69
64
  const ago = (at: number, now: number): string => `${ageWords(at, now)}`
@@ -112,28 +107,30 @@ function sentCell(s: TargetSent | null, now: number, warnAt: number, dangerAt: n
112
107
  return { state: age > dangerAt ? 'danger' : age > warnAt ? 'warn' : 'ok', short: ago(s.at, now), text: `${s.name}, ${(s.bytes / 1e6).toFixed(1)} MB, ${ago(s.at, now)}`, proof: 'its sha checked on arrival', fix }
113
108
  }
114
109
 
115
- /** a store of `machine` at a place: `mine` reads that machine's own records, `d` the judge's (targets, the Space's
116
- * copy to the second place, the vault and the hq) */
117
- function cellOf(store: StoreId, p: Place, d: BackupInputs, machine: string, mine: Pick<BackupInputs, 'get' | 'timeMachine'>): Draft {
110
+ /** a store at a place, judged on `machine`, the one that carries the hq */
111
+ function cellOf(store: StoreId, p: Place, d: BackupInputs, machine: string): Draft {
118
112
  const now = d.now
119
113
  const c = (state: CellState, short: string, text: string, proof: string | null = null, fix: string | null = null): Draft => ({ state, short, text, proof, fix })
120
- const shortOf = (state: CellState, at: number, drill: CellState): string => (drill === 'danger' ? 'drill FAILED' : state === 'danger' ? `${ago(at, now)}, stale` : ago(at, now))
114
+ const shortOf = (state: CellState, at: number): string => (state === 'danger' ? `${ago(at, now)}, stale` : ago(at, now))
115
+ const target = d.targets.find((x) => x.id === p.id)
116
+ const space = target?.address.kind === 's3' && target.address.config === 'mediaSpace'
117
+ // the Space is at its provider, on no disk of a machine: its one copy off it is the second place
118
+ if (store === 'space' && !(target?.address.kind === 's3' && !space)) return c('dim', space ? 'itself' : 'not here', space ? 'the Space itself, at its provider' : `the Space is not copied to ${p.label}: its copy off its provider is the second place`)
121
119
  if (p.kind === 'mac') {
122
120
  if (store === 'vault') return c('dim', 'live', `the live vault on ${machine}${d.vaultNear.count > 0 ? `, ${d.vaultNear.count} sealed snapshots beside it${d.vaultNear.newest == null ? '' : `, the newest ${ago(d.vaultNear.newest, now)}`}` : ''}`, 'the same disk: no help if it dies')
123
- return c('dim', 'live', `${store === 'hq' ? 'the live hq.sqlite' : 'the live files'} on ${machine}`, 'the same disk: no help if it dies')
121
+ return c('dim', 'live', `the live hq.sqlite on ${machine}`, 'the same disk: no help if it dies')
124
122
  }
125
123
  if (p.kind === 'disk') {
126
- const tm = mine.timeMachine
124
+ const tm = d.timeMachine
127
125
  if (tm?.configured === false) return c('dim', 'not set up', `Time Machine is not set up on ${machine}: no copy there`, null, 'System Settings › General › Time Machine')
128
126
  if (tm?.newest == null) return c('warn', 'unknown', `no Time Machine snapshot known on ${machine}`, null, 'System Settings › General › Time Machine')
129
127
  const age = now - tm.newest
130
128
  return c(age > BOUNDS.timeMachine ? 'warn' : 'ok', ago(tm.newest, now), `in its last snapshot, ${ago(tm.newest, now)}`, 'encrypted; not restore tested by shipkit (no Full Disk Access)', age > BOUNDS.timeMachine ? 'plug the disk in, or Time Machine › Back Up Now' : null)
131
129
  }
132
- const t = d.targets.find((x) => x.id === p.id)!
130
+ const t = target!
133
131
  const stream = d.replica.place === undefined ? 'mediaSpace' : d.replica.place
134
132
  if (t.address.kind === 'ssh' && sameHost(t.address.host, machine)) return c('dim', 'itself', `${p.label} is the machine of this store: no copy off it`)
135
133
  if (!p.on) return c('warn', 'off', 'the target is switched off', null, `sk backup targets on ${p.id}`)
136
- const space = t.address.kind === 's3' && t.address.config === 'mediaSpace'
137
134
  if (space) {
138
135
  if (store === 'vault') {
139
136
  const sent = d.get<Sent>('vault-snapshot-sent')
@@ -141,17 +138,9 @@ function cellOf(store: StoreId, p: Place, d: BackupInputs, machine: string, mine
141
138
  if (sent == null) return c('danger', 'none', 'no sealed snapshot sent yet', null, 'sk vault snapshot')
142
139
  const age = now - sent.at
143
140
  const back = proved?.key === sent.key ? `restored with the seal key alone ${ago(proved.at, now)}` : proved == null ? 'never restored' : `the newest not restored yet (the last proof ${ago(proved.at, now)})`
144
- return c(age > BOUNDS.vault ? 'danger' : proved?.key === sent.key || age < H ? 'ok' : 'warn', shortOf(age > BOUNDS.vault ? 'danger' : 'ok', sent.at, 'ok'), `sealed snapshot ${ago(sent.at, now)}, ${sent.names} names`, back, age > BOUNDS.vault ? 'sk vault status' : null)
141
+ return c(age > BOUNDS.vault ? 'danger' : proved?.key === sent.key || age < H ? 'ok' : 'warn', shortOf(age > BOUNDS.vault ? 'danger' : 'ok', sent.at), `sealed snapshot ${ago(sent.at, now)}, ${sent.names} names`, back, age > BOUNDS.vault ? 'sk vault status' : null)
145
142
  }
146
- if (store === 'hq') return stream === 'mediaSpace' ? streamCell(d) : notStreamed(stream)
147
- const last = mine.get<{ at: string }>('backup-last')
148
- const parsed = last == null ? NaN : Date.parse(last.at)
149
- const at = Number.isFinite(parsed) ? parsed : null
150
- if (at == null) return c('danger', 'none', last == null ? 'no backup run yet' : 'its last run has no time that reads', null, 'sk backup')
151
- const fresh: CellState = now - at > BOUNDS.run ? 'danger' : 'ok'
152
- const drill = mine.get<BackupDrill>('backup-drill')
153
- const dw = drillWords(drill?.at, drill == null ? null : drill.failed === 0, now, BOUNDS.drill, `restored with every sha${drill == null ? '' : ` (${drill.restored} files)`}${drill?.first == null ? '' : `: ${drill.first.path}: ${drill.first.error}`}`)
154
- return c(worse(fresh, dw.state), shortOf(fresh, at, dw.state), `the backup run of ${ago(at, now)}`, dw.text, fresh === 'danger' ? 'sk backup' : dw.state === 'ok' ? null : 'sk backup drill')
143
+ return stream === 'mediaSpace' ? streamCell(d) : notStreamed(stream)
155
144
  }
156
145
  const second = t.address.kind === 's3'
157
146
  if (second && d.secondPlaceKey === false) return c('warn', 'no key yet', 'no key yet: nothing goes there', null, 'ask 035: the three rv/shipkit/copy-* secrets')
@@ -159,7 +148,7 @@ function cellOf(store: StoreId, p: Place, d: BackupInputs, machine: string, mine
159
148
  if (store === 'vault') return sentCell(d.get<TargetSent>(`target-sent:vault:${p.id}`), now, BOUNDS.vault, BOUNDS.vault + 2 * H, 'sk daemon job backup targets')
160
149
  if (store === 'hq') return sentCell(d.get<TargetSent>(`target-sent:hq:${p.id}`), now, BOUNDS.hqCopy, BOUNDS.hqCopyDanger, 'sk daemon job backup targets')
161
150
  if (second) {
162
- // the second place copies the whole Space each night, the runs of every machine with it
151
+ // the second place copies the whole Space each night, the old backup runs with it
163
152
  const proof = d.get<Proof>('space-copy-proof')
164
153
  const copy = (x: Draft): Draft => ({ ...x, of: 'space copy' })
165
154
  if (proof == null) return copy(d.get<boolean>('space-copy') === true ? c('warn', 'not yet', 'the first copy of the Space runs each night until it is whole: no proof yet', null, 'sk space') : c('warn', 'not yet', 'the Space is not copied there: the nightly copy is off', null, 'sk space copy --auto on'))
@@ -167,7 +156,7 @@ function cellOf(store: StoreId, p: Place, d: BackupInputs, machine: string, mine
167
156
  const of = `the nightly copy of ${first}`
168
157
  if (!proof.ok) return copy(c('danger', 'proof FAILED', `${of} failed its proof ${ago(proof.at, now)}`, proof.why[0] ?? 'the proof failed', 'sk space proof'))
169
158
  const age = now - proof.at
170
- // the backup runs are what this store is at the copy: the rest of the Space filling there is not its copy
159
+ // the backup runs are counted, each night's copy sends them first: the media filling behind them is not
171
160
  const waiting = proof.kinds.find((k) => k.kind === 'backup')?.waiting ?? 0
172
161
  const state: CellState = age > BOUNDS.spaceCopyDanger ? 'danger' : age > BOUNDS.spaceCopy || waiting > 0 ? 'warn' : 'ok'
173
162
  const proved = `${of}, proved ${ago(proof.at, now)}`
@@ -179,11 +168,7 @@ function cellOf(store: StoreId, p: Place, d: BackupInputs, machine: string, mine
179
168
  }
180
169
  return copy(c(state, state === 'danger' ? `${ago(proof.at, now)}, stale` : ago(proof.at, now), waiting > 0 ? `${proved}; ${waiting} files of the backup runs are not there yet` : proved, 'counts and a sample hashed', state === 'ok' ? null : 'sk space proof'))
181
170
  }
182
- if (machine !== (d.machine ?? machine)) return c('dim', 'not here', `the mirror to ${p.label} carries the runs of ${d.machine} only`)
183
- const sent = sentCell(d.get<TargetSent>(`target-sent:files:${p.id}`), now, BOUNDS.run, BOUNDS.run * 4, 'sk daemon job backup targets')
184
- const drill = d.get<BackupDrill>(`target-drill:files:${p.id}`)
185
- const dw = drillWords(drill?.at, drill == null ? null : drill.failed === 0, now, BOUNDS.drill, `restored from it with every sha${drill == null ? '' : ` (${drill.restored} files)`}${drill?.first == null ? '' : `: ${drill.first.path}: ${drill.first.error}`}`)
186
- return { ...sent, state: worse(sent.state, dw.state), short: dw.state === 'danger' ? 'drill FAILED' : sent.short, proof: dw.text, fix: dw.state === 'ok' || sent.state !== 'ok' ? sent.fix : `sk backup drill --target ${p.id}` }
171
+ return c('dim', 'not here', `nothing of ${store} goes to ${p.label}`)
187
172
  }
188
173
 
189
174
  const whereOf = (t: BackupTarget): string => (t.address.kind === 'ssh' ? `${t.address.host}:${t.address.folder}` : t.address.config === 'mediaSpace' ? 'the private Space (s3)' : 'the second place (s3)')
@@ -201,47 +186,33 @@ export function backupStatus(d: BackupInputs): BackupStatus {
201
186
  return a?.kind === 'ssh' ? a.host : ''
202
187
  }
203
188
  const offOf = (p: Place, machine: string): boolean => p.kind === 's3' || (p.kind === 'ssh' && !sameHost(hostOf(p.id), machine))
204
- const none: Pick<BackupInputs, 'get' | 'timeMachine'> = { get: () => null, timeMachine: null }
205
- const groups: { machine: string; stale: string | null; mine: Pick<BackupInputs, 'get' | 'timeMachine'>; ids: readonly StoreId[] }[] = [
206
- { machine: judge, stale: null, mine: d, ids: STORES.map((s) => s.id) },
207
- ...(d.others ?? []).map((o) => {
208
- // a machine whose report holds no backup records (an older shipkit, records of a wrong shape) is a row too,
209
- // orange: a machine left out of the table would let the headline go green over it
210
- if (o.facts == null) return { machine: o.machine, stale: `${o.machine} does not report its backups (its shipkit is older, or its records did not read): not judged`, mine: none, ids: OWN_STORES }
211
- const rec = o.facts.records as Record<string, unknown>
212
- const get = <T,>(k: string): T | null => (k in rec ? ((rec[k] ?? null) as T | null) : null)
213
- return { machine: o.machine, stale: d.now - o.at > REPORT_STALE_MS ? `${o.machine}'s last report is ${ageWords(o.at, d.now, { short: true })} old: its rows as they were` : null, mine: { get, timeMachine: o.facts.timeMachine }, ids: OWN_STORES }
214
- }),
215
- ]
216
189
  const cells: Cell[] = []
217
190
  const stores: StoreRow[] = []
218
191
  const alarms: string[] = []
219
- for (const g0 of groups) {
220
- // one machine's record that does not read leaves its rows orange, never the whole house's table thrown
221
- let g = g0
222
- let drafts: Map<StoreId, Cell[]>
223
- try {
224
- drafts = new Map(g.ids.map((id) => [id, places.map((p): Cell => ({ ...cellOf(id, p, d, g.machine, g.mine), row: `${g.machine}/${id}`, store: id, place: p.id, off: offOf(p, g.machine) }))]))
225
- } catch (e) {
226
- g = { ...g, stale: `${g.machine}'s backup records do not read (${(e as Error).message}): not judged`, mine: none }
227
- drafts = new Map(g.ids.map((id) => [id, places.map((p): Cell => ({ state: 'dim', short: '', text: 'not judged', proof: null, fix: null, row: `${g.machine}/${id}`, store: id, place: p.id, off: offOf(p, g.machine) }))]))
228
- }
229
- for (const id of g.ids) {
230
- const s = STORES.find((x) => x.id === id)!
231
- const row = `${g.machine}/${id}`
232
- const mine = drafts.get(id)!
233
- cells.push(...mine)
234
- const off = mine.filter((c) => c.off)
235
- const good = off.filter((c) => c.state === 'ok')
236
- const label = rowName({ id, name: s.name, machine: g.machine })
237
- if (g.stale == null) {
238
- // a copy there but not proven (never restored, behind) is said as such: the fix differs from a copy gone
239
- if (good.length === 0) alarms.unshift(off.some((c) => c.state === 'warn') ? `${label}: NO proven copy off ${g.machine}` : `${label}: NO working copy off ${g.machine}`)
240
- for (const c of off.filter((x) => x.state === 'danger' && BROKEN.has(x.short))) alarms.push(`${label} on ${places.find((p) => p.id === c.place)!.label}: ${c.text}`)
192
+ for (const s of STORES) {
193
+ const row = `${judge}/${s.id}`
194
+ const mine = places.map((p): Cell => {
195
+ // a record that does not read leaves its cell orange, never the whole table thrown
196
+ let cell: Draft
197
+ try {
198
+ cell = cellOf(s.id, p, d, judge)
199
+ } catch (e) {
200
+ cell = { state: 'warn', short: 'unknown', text: `its records do not read (${(e as Error).message}): not judged`, proof: null, fix: null }
241
201
  }
242
- const state: CellState = g.stale != null ? 'warn' : good.length === 0 ? 'danger' : off.some((c) => c.state === 'danger') ? 'danger' : off.some((c) => c.state === 'warn') ? 'warn' : 'ok'
243
- stores.push({ row, id, machine: g.machine, name: s.name, what: s.what, state, line: g.stale ?? `${good.length} of ${off.length} copies off ${g.machine} work`, ...(g.stale == null ? {} : { stale: true as const }) })
244
- }
202
+ // the Space's own place and a place it never goes to are no copy of it
203
+ return { ...cell, row, store: s.id, place: p.id, off: offOf(p, judge) && !(s.id === 'space' && cell.state === 'dim') }
204
+ })
205
+ cells.push(...mine)
206
+ const off = mine.filter((c) => c.off)
207
+ const good = off.filter((c) => c.state === 'ok')
208
+ const label = rowName(s)
209
+ // the Space is its provider's: its second copy missing is orange, a broken one red, never « no copy »
210
+ const none = good.length === 0 && s.id !== 'space'
211
+ // a copy there but not proven (never restored, behind) is said as such: the fix differs from a copy gone
212
+ if (none) alarms.unshift(off.some((c) => c.state === 'warn') ? `${label}: NO proven copy off ${judge}` : `${label}: NO working copy off ${judge}`)
213
+ for (const c of off.filter((x) => x.state === 'danger' && BROKEN.has(x.short))) alarms.push(`${label} on ${places.find((p) => p.id === c.place)!.label}: ${c.text}`)
214
+ const state: CellState = none ? 'danger' : off.some((c) => c.state === 'danger') ? 'danger' : off.some((c) => c.state === 'warn') || good.length === 0 ? 'warn' : 'ok'
215
+ stores.push({ row, id: s.id, machine: judge, name: s.name, what: s.what, state, line: `${good.length} of ${off.length} copies off ${judge} work` })
245
216
  }
246
217
  // the headline is the cells': a cell not proven (unknown, never drilled, behind) keeps it from green
247
218
  const unproven = cells.some((c) => c.state === 'warn' || c.state === 'danger') || stores.some((r) => r.state !== 'ok')
@@ -250,7 +221,7 @@ export function backupStatus(d: BackupInputs): BackupStatus {
250
221
  }
251
222
 
252
223
  /** every input, read on the machine that carries the hq: the targets of its hq, the kept records, Litestream's files,
253
- * pm's word on the replica's process, the vault's snapshot folder, Time Machine's prefs, the other machines' reports */
224
+ * pm's word on the replica's process, the vault's snapshot folder, Time Machine's prefs */
254
225
  export async function readBackupInputs(now = Date.now()): Promise<BackupInputs> {
255
226
  const [{ carriedHq }, { carriesHq }] = await Promise.all([import('../hq/hq-local.ts'), import('../hq/hq-role.ts')])
256
227
  const { listTargets } = await import('../hq/backup-targets.ts')
@@ -264,16 +235,6 @@ export async function readBackupInputs(now = Date.now()): Promise<BackupInputs>
264
235
  const store = carriesHq() ? carriedHq() : null
265
236
  const targets = store == null ? [] : listTargets(store.db)
266
237
  const machine = machineName()
267
- const others: NonNullable<BackupInputs['others']> = []
268
- // every machine of the owner's (a live node with the grant all), its newest report: one that says nothing of its
269
- // backups is a row too, orange; a guest's node never adds rows
270
- for (const m of store?.machines(null) ?? []) {
271
- if (sameHost(m.name, machine)) continue
272
- const latest = m.nodes.filter((n) => n.ended == null && n.report != null && store!.seesAll(n.id)).sort((a, b) => b.report!.at - a.report!.at)[0]
273
- if (latest == null) continue
274
- const b = latest.report!.body.backups
275
- others.push({ machine: m.name, at: latest.report!.at, facts: isBackupFacts(b) ? b : null })
276
- }
277
238
  const r = (await askPm().catch(() => null))?.resources.find((x) => x.id === 'hq-replica')
278
239
  let folder: string | null = null
279
240
  try {
@@ -303,7 +264,6 @@ export async function readBackupInputs(now = Date.now()): Promise<BackupInputs>
303
264
  vaultNear: { count, newest },
304
265
  timeMachine: await timeMachineFacts(now),
305
266
  secondPlaceKey: second == null ? null : !('failed' in second && second.failed.startsWith('no key yet')),
306
- others,
307
267
  }
308
268
  }
309
269
 
@@ -335,7 +295,7 @@ export const alarmKeys = (s: BackupStatus): string[] =>
335
295
  s.stale != null
336
296
  ? []
337
297
  : [
338
- ...s.stores.filter((r) => r.stale !== true && !s.cells.some((c) => c.row === r.row && c.state === 'ok' && c.off)).map((r) => `${r.row}:none`),
298
+ ...s.stores.filter((r) => r.stale !== true && r.id !== 'space' && !s.cells.some((c) => c.row === r.row && c.state === 'ok' && c.off)).map((r) => `${r.row}:none`),
339
299
  ...s.cells.filter((c) => c.state === 'danger' && BROKEN.has(c.short) && c.off && s.stores.find((r) => r.row === c.row)?.stale !== true).map((c) => `${c.row}@${c.place}`),
340
300
  ]
341
301
 
@@ -2,8 +2,8 @@
2
2
  // check. Pure: the hub's bundle imports it
3
3
  import type { BackupStatus, StoreRow } from './backup-status.ts'
4
4
 
5
- /** the name a line says: the vault and the hq are the house's, the files are a machine's */
6
- export const rowName = (r: Pick<StoreRow, 'id' | 'name' | 'machine'>): string => (r.id === 'files' ? `${r.name} of ${r.machine}` : r.name)
5
+ /** the name a line says: every store of the table is the house's */
6
+ export const rowName = (r: Pick<StoreRow, 'name'>): string => r.name
7
7
 
8
8
  export function verdictWords(s: BackupStatus): string {
9
9
  if (s.stale != null) return `not read: ${s.stale}`