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
@@ -2,6 +2,7 @@
2
2
  // steps and blurred boxes, one line each in the edit, in the take's pixels, each with an optional span of the take's
3
3
  // time (none: the whole clip). Their order is the drawing order, and the steps count in it. Pure: the page imports it
4
4
  // arrow 100,200 400,300 red 0:02-0:05
5
+ // arrow 100,200 250,120 400,300 red its tail, each point it bends through, its point
5
6
  // rect 400x300+100+200 yellow
6
7
  // text 120,80 "the bug is here" 48px white
7
8
  // step 300,400 blue
@@ -15,14 +16,13 @@ export type Box = { w: number; h: number; x: number; y: number }
15
16
  export type Span = { from: number; to: number }
16
17
 
17
18
  export type Mark =
18
- | { kind: 'arrow'; from: Pt; to: Pt; color: MarkColor; span: Span | null }
19
+ | { kind: 'arrow'; from: Pt; via: Pt[]; to: Pt; color: MarkColor; span: Span | null }
19
20
  | { kind: 'rect'; box: Box; color: MarkColor; span: Span | null }
20
21
  | { kind: 'text'; at: Pt; text: string; size: number | null; color: MarkColor; span: Span | null }
21
22
  | { kind: 'step'; at: Pt; color: MarkColor; span: Span | null }
22
23
  | { kind: 'blur'; box: Box; span: Span | null }
23
24
 
24
25
  export const MARK_VERBS = ['arrow', 'rect', 'text', 'step', 'blur'] as const
25
- export type MarkKind = Mark['kind']
26
26
 
27
27
  /** a line's words: a double quoted run is one word, its quotes gone, `\"` a quote inside it */
28
28
  export function words(line: string): string[] {
@@ -70,8 +70,12 @@ function options(rest: string[], verb: string, parseTime: (t: string) => number,
70
70
  export function parseMark(line: string, parseTime: (t: string) => number): Mark {
71
71
  const [verb, ...rest] = words(line)
72
72
  if (verb === 'arrow') {
73
- const o = options(rest.slice(2), verb, parseTime, { color: true, size: false })
74
- return { kind: 'arrow', from: pt(rest[0], 'arrow'), to: pt(rest[1], 'arrow'), color: o.color, span: o.span }
73
+ // every point word in a row: two at least, the tail and the point
74
+ let n = 0
75
+ while (n < rest.length && PT.test(rest[n]!)) n++
76
+ const ps = [...Array(Math.max(n, 2)).keys()].map((k) => pt(rest[k], 'arrow'))
77
+ const o = options(rest.slice(ps.length), verb, parseTime, { color: true, size: false })
78
+ return { kind: 'arrow', from: ps[0]!, via: ps.slice(1, -1), to: ps[ps.length - 1]!, color: o.color, span: o.span }
75
79
  }
76
80
  if (verb === 'rect' || verb === 'blur') {
77
81
  const o = options(rest.slice(1), verb, parseTime, { color: verb === 'rect', size: false })
@@ -97,7 +101,7 @@ export function printMark(m: Mark, printTime: (s: number) => string): string {
97
101
  const sp = m.span ? ` ${printTime(m.span.from)}-${printTime(m.span.to)}` : ''
98
102
  const sg = (n: number): string => (n < 0 ? String(n) : `+${n}`)
99
103
  const bx = (b: Box): string => `${b.w}x${b.h}${sg(b.x)}${sg(b.y)}`
100
- if (m.kind === 'arrow') return `arrow ${m.from.x},${m.from.y} ${m.to.x},${m.to.y} ${m.color}${sp}`
104
+ if (m.kind === 'arrow') return `arrow ${arrowPoints(m).map((p) => `${p.x},${p.y}`).join(' ')} ${m.color}${sp}`
101
105
  if (m.kind === 'rect') return `rect ${bx(m.box)} ${m.color}${sp}`
102
106
  if (m.kind === 'blur') return `blur ${bx(m.box)}${sp}`
103
107
  if (m.kind === 'text') return `text ${m.at.x},${m.at.y} ${quote(m.text)}${m.size ? ` ${m.size}px` : ''} ${m.color}${sp}`
@@ -111,7 +115,7 @@ export const stepNumber = (marks: readonly Mark[], i: number): number => marks.s
111
115
  export function moved(m: Mark, dx: number, dy: number): Mark {
112
116
  const p = (q: Pt): Pt => ({ x: Math.round(q.x + dx), y: Math.round(q.y + dy) })
113
117
  const b = (q: Box): Box => ({ ...q, x: Math.round(q.x + dx), y: Math.round(q.y + dy) })
114
- if (m.kind === 'arrow') return { ...m, from: p(m.from), to: p(m.to) }
118
+ if (m.kind === 'arrow') return { ...m, from: p(m.from), via: m.via.map(p), to: p(m.to) }
115
119
  if (m.kind === 'rect' || m.kind === 'blur') return { ...m, box: b(m.box) }
116
120
  return { ...m, at: p(m.at) }
117
121
  }
@@ -120,10 +124,9 @@ export function moved(m: Mark, dx: number, dy: number): Mark {
120
124
  export function boundsOf(m: Mark, frame: { width: number; height: number }): Box {
121
125
  const s = style(frame)
122
126
  if (m.kind === 'arrow') {
123
- const x = Math.min(m.from.x, m.to.x)
124
- const y = Math.min(m.from.y, m.to.y)
127
+ const b = arrowExtent(m)
125
128
  const pad = s.stroke * 3
126
- return { x: x - pad, y: y - pad, w: Math.abs(m.to.x - m.from.x) + pad * 2, h: Math.abs(m.to.y - m.from.y) + pad * 2 }
129
+ return { x: b.x - pad, y: b.y - pad, w: b.w + pad * 2, h: b.h + pad * 2 }
127
130
  }
128
131
  if (m.kind === 'rect' || m.kind === 'blur') return m.box
129
132
  if (m.kind === 'step') return { x: m.at.x - s.step, y: m.at.y - s.step, w: s.step * 2, h: s.step * 2 }
@@ -136,3 +139,111 @@ export function style(frame: { width: number; height: number }): { stroke: numbe
136
139
  const short = Math.min(frame.width, frame.height)
137
140
  return { stroke: Math.max(3, Math.round(short / 160)), text: Math.max(16, Math.round(short / 22)), step: Math.max(12, Math.round(short / 34)), blur: Math.max(8, Math.round(short / 60)) }
138
141
  }
142
+
143
+ // ---- the arrow's path: ONE smooth curve through its points (Catmull-Rom as cubic Béziers) for the page, the export
144
+ // and every hit; two points are the straight line they always were
145
+
146
+ type Arrow = Extract<Mark, { kind: 'arrow' }>
147
+ /** one piece of the curve: from the end of the piece before to `to`, bent by its two handles */
148
+ export type Seg = { c1: Pt; c2: Pt; to: Pt }
149
+
150
+ /** the arrow's points in order: its tail, each point it bends through, its point */
151
+ export const arrowPoints = (m: Arrow): Pt[] => [m.from, ...m.via, m.to]
152
+
153
+ /** the arrow again on these points (two at least): the first its tail, the last its point */
154
+ export const withPoints = (m: Arrow, ps: readonly Pt[]): Arrow => ({ ...m, from: ps[0]!, via: ps.slice(1, -1), to: ps[ps.length - 1]! })
155
+
156
+ /** the curve through every point, one piece between each two: each piece ends on its point, and the last handle lies
157
+ * on the line from the point before the tip, so the head turns as the last segment does */
158
+ export function arrowCurve(ps: readonly Pt[]): Seg[] {
159
+ const at = (i: number): Pt => ps[Math.max(0, Math.min(ps.length - 1, i))]!
160
+ const out: Seg[] = []
161
+ for (let i = 0; i + 1 < ps.length; i++) {
162
+ const [a, b, c, d] = [at(i - 1), at(i), at(i + 1), at(i + 2)]
163
+ out.push({ c1: { x: b.x + (c.x - a.x) / 6, y: b.y + (c.y - a.y) / 6 }, c2: { x: c.x - (d.x - b.x) / 6, y: c.y - (d.y - b.y) / 6 }, to: c })
164
+ }
165
+ return out
166
+ }
167
+
168
+ /** the point at `t` (0 to 1) of a piece that starts at `from` */
169
+ export function onSeg(from: Pt, s: Seg, t: number): Pt {
170
+ const u = 1 - t
171
+ const [k0, k1, k2, k3] = [u * u * u, 3 * u * u * t, 3 * u * t * t, t * t * t]
172
+ return { x: k0 * from.x + k1 * s.c1.x + k2 * s.c2.x + k3 * s.to.x, y: k0 * from.y + k1 * s.c1.y + k2 * s.c2.y + k3 * s.to.y }
173
+ }
174
+
175
+ /** the curve as close points, each with the piece it lies on */
176
+ export function arrowSamples(ps: readonly Pt[], per = 24): { p: Pt; seg: number }[] {
177
+ const out: { p: Pt; seg: number }[] = [{ p: ps[0]!, seg: 0 }]
178
+ arrowCurve(ps).forEach((s, i) => {
179
+ for (let k = 1; k <= per; k++) out.push({ p: onSeg(ps[i]!, s, k / per), seg: i })
180
+ })
181
+ return out
182
+ }
183
+
184
+ /** the way the head points, in radians: along the last segment, into the tip */
185
+ export function headAngle(ps: readonly Pt[]): number {
186
+ const segs = arrowCurve(ps)
187
+ const last = segs[segs.length - 1]!
188
+ return Math.atan2(last.to.y - last.c2.y, last.to.x - last.c2.x)
189
+ }
190
+
191
+ /** the box the curve itself covers, no stroke around it */
192
+ export function arrowExtent(m: Arrow): Box {
193
+ const ps = arrowSamples(arrowPoints(m)).map((s) => s.p)
194
+ const xs = ps.map((p) => p.x)
195
+ const ys = ps.map((p) => p.y)
196
+ const x = Math.min(...xs)
197
+ const y = Math.min(...ys)
198
+ return { x, y, w: Math.max(...xs) - x, h: Math.max(...ys) - y }
199
+ }
200
+
201
+ /** the point of the curve nearest `p`, the piece it lies on, and how far it is */
202
+ export function nearestOnArrow(m: Arrow, p: Pt): { at: Pt; seg: number; dist: number } {
203
+ const ps = arrowPoints(m)
204
+ const segs = arrowCurve(ps)
205
+ const N = 32
206
+ let best = { at: m.from, seg: 0, t: 0, dist: Infinity }
207
+ const consider = (seg: number, t: number): void => {
208
+ const q = onSeg(ps[seg]!, segs[seg]!, t)
209
+ const d = Math.hypot(q.x - p.x, q.y - p.y)
210
+ if (d < best.dist) best = { at: q, seg, t, dist: d }
211
+ }
212
+ segs.forEach((_, i) => {
213
+ for (let k = 0; k <= N; k++) consider(i, k / N)
214
+ })
215
+ // then finer around the closest: a point lands on the line, not a sample's step off it
216
+ for (let step = 1 / N; step > 1e-4; step /= 4) {
217
+ const { seg, t } = best
218
+ for (let k = -4; k <= 4; k++) consider(seg, Math.max(0, Math.min(1, t + (k * step) / 4)))
219
+ }
220
+ return { at: best.at, seg: best.seg, dist: best.dist }
221
+ }
222
+
223
+ /** the arrow with a new point where its curve passes nearest `p`, between the two points of that piece */
224
+ export function addArrowPoint(m: Arrow, p: Pt): Arrow {
225
+ const n = nearestOnArrow(m, p)
226
+ const ps = arrowPoints(m)
227
+ ps.splice(n.seg + 1, 0, { x: Math.round(n.at.x), y: Math.round(n.at.y) })
228
+ return withPoints(m, ps)
229
+ }
230
+
231
+ /** the arrow with its point `k` (arrowPoints' order) at `p` */
232
+ export const moveArrowPoint = (m: Arrow, k: number, p: Pt): Arrow => withPoints(m, arrowPoints(m).map((q, j) => (j === k ? { x: Math.round(p.x), y: Math.round(p.y) } : q)))
233
+
234
+ /** the arrow without its middle point `k`; its tail and its point always stay */
235
+ export const removeArrowPoint = (m: Arrow, k: number): Arrow => (k <= 0 || k > m.via.length ? m : withPoints(m, arrowPoints(m).filter((_, j) => j !== k)))
236
+
237
+ /** the arrow's point within `r` of `p` (arrowPoints' order), the nearest; null when none is */
238
+ export function arrowPointAt(m: Arrow, p: Pt, r: number): number | null {
239
+ let best: number | null = null
240
+ let bd = r
241
+ arrowPoints(m).forEach((q, k) => {
242
+ const d = Math.hypot(q.x - p.x, q.y - p.y)
243
+ if (d <= bd) {
244
+ best = k
245
+ bd = d
246
+ }
247
+ })
248
+ return best
249
+ }
@@ -9,23 +9,16 @@
9
9
  // lines only: a substring scan of the whole file called any note mentioning
10
10
  // "proposed change" a malformed request, and satisfied `scope claimed` from
11
11
  // ordinary prose.
12
- import { existsSync, readdirSync, readFileSync } from 'fs'
12
+ import { readdirSync, readFileSync } from 'fs'
13
13
  import { join } from 'path'
14
14
  import { mainCheckoutOf } from '../core/foreign.ts'
15
15
  import { LAYOUT } from '../core/layout.ts'
16
- import { LEGACY_CONTRACT_PREFIX } from '../core/migrate-layout.ts'
17
16
 
18
17
  export const REFLECTIONS_DIR = LAYOUT.reflections
19
18
 
20
19
  /** where a repo's queue sits: its main checkout's, from a lane worktree too, since the folder is gitignored and dies with
21
- * the worktree while its link lives in the repo's one thread store. A harvest across repos reads some that have not
22
- * run the new shipkit yet, whose queue is still in the old folder. This read dies once `shipkit fleet` shows no repo on
23
- * the old layout */
24
- export const queueDir = (root: string): string => {
25
- const main = mainCheckoutOf(root)
26
- const legacy = join(main, `${LEGACY_CONTRACT_PREFIX}reflections`)
27
- return !existsSync(join(main, REFLECTIONS_DIR)) && existsSync(legacy) ? legacy : join(main, REFLECTIONS_DIR)
28
- }
20
+ * the worktree while its link lives in the repo's one thread store */
21
+ export const queueDir = (root: string): string => join(mainCheckoutOf(root), REFLECTIONS_DIR)
29
22
 
30
23
  export const REQUEST_SECTIONS = [
31
24
  'what i was doing',
@@ -81,7 +81,7 @@ function folderNotes(root: string, u: ReleaseUnit, dir: string): UnitNotes {
81
81
  },
82
82
  promote: (v, date) => {
83
83
  if (nextError != null) return { error: nextError }
84
- if (next == null) return { error: `${rel} has no ${fileOf(NEXT)}: write the changes of this version in it, then bump` }
84
+ if (next == null) return { error: `${rel} has no ${fileOf(NEXT)}: sk releases check --write-template writes one to fill, then bump` }
85
85
  if (existsSync(join(dir, fileOf(v)))) return { error: `${rel}/${fileOf(v)} exists already: that version is written` }
86
86
  let done: Release
87
87
  try {
@@ -3,7 +3,7 @@
3
3
  // new repo, identity or machine is covered the day it exists. A hit reports file:line and the masked word, never
4
4
  // the word
5
5
  import { createHash, type Hash } from 'crypto'
6
- import { existsSync, readdirSync, readFileSync, statSync } from 'fs'
6
+ import { closeSync, existsSync, openSync, readdirSync, readFileSync, readSync, statSync } from 'fs'
7
7
  import { homedir } from 'os'
8
8
  import { dirname, join, relative } from 'path'
9
9
  import { scanFleet } from '../fleet/scan-fleet.ts'
@@ -352,21 +352,81 @@ export async function publicCleanBlockers(root: string, config: RepoConfig, unit
352
352
  * write and no call puts it back, so a same size edit whose mtime was restored still reads again */
353
353
  const digests = new Map<string, { at: string; hash: string }>()
354
354
 
355
+ /** the bytes hashed a chunk at a time: a file of a gigabyte costs a megabyte of memory, never its size */
356
+ const DIGEST_CHUNK = 1 << 20
357
+ const chunk = Buffer.alloc(DIGEST_CHUNK)
358
+
355
359
  const digestOf = (abs: string, s: { ino: bigint; size: bigint; mtimeNs: bigint; ctimeNs: bigint }): string | null => {
356
360
  const at = `${s.ino}:${s.size}:${s.mtimeNs}:${s.ctimeNs}`
357
361
  const held = digests.get(abs)
358
362
  if (held?.at === at) return held.hash
359
- let bytes: Buffer
363
+ const h = createHash('sha256')
364
+ let fd: number
360
365
  try {
361
- bytes = readFileSync(abs)
366
+ fd = openSync(abs, 'r')
362
367
  } catch {
363
368
  return null
364
369
  }
365
- const hash = createHash('sha256').update(bytes).digest('hex')
370
+ try {
371
+ for (let n = readSync(fd, chunk, 0, DIGEST_CHUNK, null); n > 0; n = readSync(fd, chunk, 0, DIGEST_CHUNK, null)) h.update(chunk.subarray(0, n))
372
+ } catch {
373
+ return null
374
+ } finally {
375
+ closeSync(fd)
376
+ }
377
+ const hash = h.digest('hex')
366
378
  digests.set(abs, { at, hash })
367
379
  return hash
368
380
  }
369
381
 
382
+ /** what of a unit's dir npm can pack, unit relative: with a `files` list, each entry's path up to its first glob,
383
+ * the unit's top level files (package.json, README, LICENSE) and `main` and `bin`; without one, the whole dir. A
384
+ * negated entry only takes away, so it is left in. A repo's generated outputs beside `files` (gigabytes of images)
385
+ * are never read */
386
+ export function packRoots(unitDir: string): string[] {
387
+ let pkg: { files?: unknown; main?: unknown; bin?: unknown }
388
+ try {
389
+ pkg = JSON.parse(readFileSync(join(unitDir, 'package.json'), 'utf8')) as typeof pkg
390
+ } catch {
391
+ return ['']
392
+ }
393
+ if (!Array.isArray(pkg.files)) return ['']
394
+ const roots = new Set<string>()
395
+ const add = (p: unknown): void => {
396
+ if (typeof p !== 'string' || p.startsWith('!')) return
397
+ const glob = p.search(/[*?[{]/)
398
+ const fixed = (glob === -1 ? p : p.slice(0, p.lastIndexOf('/', glob) + 1)).replace(/^\.?\/+/, '').replace(/\/+$/, '')
399
+ roots.add(fixed)
400
+ }
401
+ for (const f of pkg.files) add(f)
402
+ add(pkg.main)
403
+ for (const b of typeof pkg.bin === 'string' ? [pkg.bin] : pkg.bin != null && typeof pkg.bin === 'object' ? Object.values(pkg.bin) : []) add(b)
404
+ if (roots.has('')) return ['']
405
+ try {
406
+ for (const n of readdirSync(unitDir, { withFileTypes: true })) if (n.isFile()) roots.add(n.name)
407
+ } catch {}
408
+ const sorted = [...roots].sort()
409
+ return sorted.filter((r) => !sorted.some((o) => o !== r && r.startsWith(`${o}/`)))
410
+ }
411
+
412
+ /** the pack roots of a unit, each a path and its bytes' hash, the way treeStamp walks a dir */
413
+ function unitStamp(unitDir: string, h: Hash): void {
414
+ for (const r of packRoots(unitDir)) {
415
+ const abs = r === '' ? unitDir : join(unitDir, r)
416
+ let s
417
+ try {
418
+ s = statSync(abs, { bigint: true })
419
+ } catch {
420
+ continue
421
+ }
422
+ if (s.isDirectory()) treeStamp(abs, h, unitDir)
423
+ else {
424
+ const hash = digestOf(abs, s)
425
+ if (hash != null) h.update(`${r}\0${hash}\0`)
426
+ }
427
+ }
428
+ }
429
+
370
430
  /** every file under `dir` on the disk, ignored ones included (npm packs a gitignored file under `files`), as
371
431
  * path and a hash of its bytes, never its size and mtime: a same size edit that keeps its mtime must move the leak
372
432
  * gate's key. Dependency and git folders left out */
@@ -394,12 +454,12 @@ function treeStamp(dir: string, h: Hash, base = dir): void {
394
454
  }
395
455
  }
396
456
 
397
- /** the cache key part no tracked file carries: each unit's tree on disk, the house repos, the identity files, the
457
+ /** the cache key part no tracked file carries: what npm can pack of each unit on disk (packRoots), the house repos, the identity files, the
398
458
  * keyword and allow files. A new house repo moves it, so the answer never outlives the words it was asked with */
399
459
  export function publicCleanKey(root: string, units: { dir: string }[]): string {
400
460
  const h = createHash('sha256')
401
461
  const parts: string[] = []
402
- for (const u of units) treeStamp(u.dir, h)
462
+ for (const u of units) unitStamp(u.dir, h)
403
463
  parts.push(houseRepoWords(root).map((w) => w.word).join(','))
404
464
  parts.push(readMachineWords().words.map((w) => w.word).join(','))
405
465
  const ids = houseIdentitiesDir(root)
@@ -45,6 +45,7 @@ import type { RepoConfig } from '../repo-config.ts'
45
45
  import { nestedIn, nestedRefusal } from '../core/nesting.ts'
46
46
  import { LAYOUT } from '../core/layout.ts'
47
47
  import { dayStamp } from '../core/day-stamp.ts'
48
+ import { NEXT_REL, problemLines, validateNext } from '../releases/validate.ts'
48
49
 
49
50
  export type BumpKind = 'major' | 'minor' | 'patch'
50
51
 
@@ -274,6 +275,16 @@ export async function runBump(root: string, config: RepoConfig, kind: BumpKind |
274
275
  if (foreign != null) { print(`FAIL: ${foreign}`); return 1 }
275
276
  const nested = nestedIn(root)
276
277
  if (nested != null) { print(`FAIL: ${nestedRefusal(nested)}`); return 1 }
278
+ // next.md read whole FIRST, before any git move or the gate: every problem of it in this one run, each its line
279
+ // and the line it wants, never one a run after a full start
280
+ if (config.release?.releases === true && (o.all === true ? existsSync(join(root, NEXT_REL)) : (o.unit ?? 'root') === 'root')) {
281
+ const problems = validateNext(root, kind)
282
+ if (problems.length > 0) {
283
+ for (const l of problemLines(problems)) print(l)
284
+ print(` fix: ${problems.length === 1 ? 'that one' : `all ${problems.length}`}, then bump again (sk releases check${kind ? ` ${kind}` : ''} reads next.md alone)`)
285
+ return 1
286
+ }
287
+ }
277
288
 
278
289
  const git: Git = (args) => gitAt(root, args)
279
290
  const cur = git(['rev-parse', '--abbrev-ref', 'HEAD']).out
@@ -20,6 +20,7 @@ import { formatUnitError, resolveUnits, unitById, unknownUnit, type ReleaseUnit
20
20
  import { loadRepoConfig, type RepoConfig } from '../repo-config.ts'
21
21
  import { nestedIn, nestedRefusal } from '../core/nesting.ts'
22
22
  import { declaredTestUnits, testCheckId } from '../suite/test-units.ts'
23
+ import { slowReport, slowTestsPath } from '../ledger/slow-tests.ts'
23
24
  import { FOREIGN_WHY } from '../core/foreign.ts'
24
25
 
25
26
  // adding a FOURTH knob here is the signal that this shape wants rethinking
@@ -178,7 +179,10 @@ export async function runReleaseGate(root: string, print: (l: string) => void, o
178
179
  print(`FAIL: repo.config.ts at HEAD does not load — ${String(e).slice(0, 200)}`)
179
180
  return 1
180
181
  }
182
+ const at = Date.now()
181
183
  const code = await runCi(dir, releaseGateOptions(config, o.units, print))
184
+ // the tests that passed only alone never hold a release, and the report names them for the cleanup
185
+ for (const l of slowReport(slowTestsPath(root), at)) print(l)
182
186
  if (code !== 0) return code
183
187
  const rewrote = rewroteTracked(dir)
184
188
  if (rewrote === '') return 0
@@ -90,7 +90,7 @@ export async function changeOfThread(root: string, x: ReviewItem): Promise<{ cat
90
90
  * declares no release files throws, so the thread says why its line went nowhere */
91
91
  export async function onVerdict(root: string, id: string): Promise<string | null> {
92
92
  const x = readItem(storeDir(root), id)
93
- if (!x || !isApproved(verdictOf(x)?.status ?? 'rejected')) return null
93
+ if (!x || !isApproved(verdictOf(x)?.status ?? 'rework')) return null
94
94
  if (!versionsOf(storeDir(root), x).some((v) => v.changelog)) return null
95
95
  const why = await undeclaredReleases(root)
96
96
  if (why) throw new Error(why)
@@ -114,7 +114,7 @@ export async function onTakeBack(root: string, id: string): Promise<string | nul
114
114
  const versions = x ? versionsOf(dir, x) : []
115
115
  if (!versions.some((v) => v.changelog)) return null
116
116
  const thread = versions.at(-1)!.id
117
- const still = threadOfItem(id, threadsOf(readAll(dir).items))?.versions.find((v) => isApproved(verdictOf(v)?.status ?? 'rejected'))
117
+ const still = threadOfItem(id, threadsOf(readAll(dir).items))?.versions.find((v) => isApproved(verdictOf(v)?.status ?? 'rework'))
118
118
  if (still) return `the approval was taken back, and next.md keeps this thread's change: its version ${still.item.id} is still approved`
119
119
  const file = dropThreadChange(root, thread)
120
120
  if (file) {
@@ -151,7 +151,7 @@ export async function followAnswer(root: string, id: string, was: ReviewStatus |
151
151
  function approvedOf(dir: string, id: string): ReviewItem | null {
152
152
  const t = threadOfItem(id, threadsOf(readAll(dir).items))
153
153
  if (!t) return readItem(dir, id)
154
- return t.versions.find((v) => isApproved(verdictOf(v)?.status ?? 'rejected')) ?? t.head
154
+ return t.versions.find((v) => isApproved(verdictOf(v)?.status ?? 'rework')) ?? t.head
155
155
  }
156
156
 
157
157
  /** what a refresh did to one change: its stills, and its before dropped as blank or the same as the after */