rvlib-shipkit 2.27.0 → 2.28.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 (338) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/src/agent-time/hooks.ts +10 -3
  4. package/src/agent-time/live.ts +11 -5
  5. package/src/agent-time/registry.ts +289 -0
  6. package/src/agent-time/store.ts +2 -2
  7. package/src/annex/born.ts +2 -2
  8. package/src/annex/offload.ts +12 -11
  9. package/src/asks/ask-after.ts +6 -2
  10. package/src/asks/ask-bar-fold.ts +57 -0
  11. package/src/asks/ask-migrate.ts +280 -0
  12. package/src/asks/ask-steps-fold.ts +166 -0
  13. package/src/asks/ask-store.ts +586 -0
  14. package/src/assets/kits/identity-kit.ts +106 -38
  15. package/src/assets/kits/poster-thumbnail.ts +282 -0
  16. package/src/checks/SK003-claude-md-shape.check.ts +92 -25
  17. package/src/checks/SK004-gitignore-policy.check.ts +8 -4
  18. package/src/checks/SK013-one-way-in-policy.check.ts +10 -0
  19. package/src/checks/SK026-asks-autoclose.check.ts +9 -23
  20. package/src/checks/SK038-speaks-as.check.ts +3 -3
  21. package/src/checks/SK042-post-kinds.check.ts +26 -24
  22. package/src/checks/SK049-thread-answers-hook.check.ts +81 -0
  23. package/src/checks/SK050-retired-commands.check.ts +127 -0
  24. package/src/cli/cmd_Asks.ts +204 -53
  25. package/src/cli/cmd_Backup.ts +151 -8
  26. package/src/cli/cmd_Calls.ts +1 -0
  27. package/src/cli/cmd_Commands.ts +140 -34
  28. package/src/cli/cmd_Contracts.ts +1 -0
  29. package/src/cli/cmd_Keys.ts +1 -0
  30. package/src/cli/cmd_Lanes.ts +15 -4
  31. package/src/cli/cmd_Messages.ts +152 -1
  32. package/src/cli/cmd_Needs.ts +1 -0
  33. package/src/cli/cmd_Review.ts +931 -229
  34. package/src/cli/cmd_Secret.ts +255 -34
  35. package/src/cli/cmd_Social.ts +36 -33
  36. package/src/cli/cmd_SocialDrafts.ts +235 -0
  37. package/src/cli/cmd_Sound.ts +22 -1
  38. package/src/cli/cmd_Start.ts +3 -2
  39. package/src/cli/cmd_ThreadHolds.ts +34 -0
  40. package/src/cli/cmd_ThreadKinds.ts +146 -0
  41. package/src/cli/cmd_ThreadReflect.ts +83 -0
  42. package/src/cli/cmd_ThreadSyncNeeds.ts +62 -0
  43. package/src/cli/cmd_Vault.ts +1 -1
  44. package/src/cli/cmd_When.ts +1 -0
  45. package/src/cli/family-help.ts +2 -2
  46. package/src/cli/family-pages.ts +1 -1
  47. package/src/cli/kit/builtins.ts +1 -0
  48. package/src/cli/kit/verb.ts +6 -2
  49. package/src/cli/registry.ts +21 -2
  50. package/src/cli.ts +5 -2
  51. package/src/collections/actions.ts +25 -74
  52. package/src/collections/collection-types.ts +9 -5
  53. package/src/collections/md-body.ts +5 -3
  54. package/src/collections/pings.ts +13 -6
  55. package/src/collections/providers.ts +53 -61
  56. package/src/collections/reflections.ts +9 -4
  57. package/src/core/discover-checks.ts +18 -3
  58. package/src/core/git.ts +31 -0
  59. package/src/core/house-layout.ts +17 -0
  60. package/src/core/layout.ts +10 -5
  61. package/src/core/locked-write.ts +4 -1
  62. package/src/core/machine-db.ts +5 -3
  63. package/src/core/migrate-layout.ts +8 -10
  64. package/src/home/activity.ts +8 -15
  65. package/src/home/daemon-jobs.ts +13 -1
  66. package/src/home/home-paths.ts +6 -3
  67. package/src/home/home-routes.ts +8 -0
  68. package/src/home/inbox-shape.ts +233 -100
  69. package/src/home/inbox.ts +26 -71
  70. package/src/home/machine-fold.ts +10 -15
  71. package/src/home/machine-host.ts +19 -1
  72. package/src/home/other-macs.ts +2 -2
  73. package/src/home/serve-web.ts +6 -5
  74. package/src/home/space-page.ts +1 -1
  75. package/src/home/vault-page.ts +51 -17
  76. package/src/home/vault-words.ts +2 -2
  77. package/src/hooks/one-way-in-guard.ts +24 -2
  78. package/src/hq/files-send.ts +27 -28
  79. package/src/hq/hq-db.ts +4 -1
  80. package/src/hq/hq-local.ts +37 -4
  81. package/src/hq/hq-routes.ts +10 -2
  82. package/src/hq/hq-store.ts +6 -2
  83. package/src/hq/kinds/ask.ts +6 -6
  84. package/src/hq/outbox.ts +5 -3
  85. package/src/hq/replica.ts +1 -2
  86. package/src/hq/vault-route.ts +112 -0
  87. package/src/identities/collection.ts +2 -2
  88. package/src/identities/identities.ts +9 -8
  89. package/src/identities/machine-route.ts +8 -3
  90. package/src/ledger/db.ts +8 -1
  91. package/src/media-store/backup/daemon.ts +48 -8
  92. package/src/media-store/backup/keys.ts +1 -1
  93. package/src/media-store/backup/manifest.ts +20 -2
  94. package/src/media-store/backup/prune.ts +365 -0
  95. package/src/media-store/backup/retention.ts +122 -0
  96. package/src/media-store/backup/run.ts +14 -8
  97. package/src/media-store/backup/sources.ts +18 -17
  98. package/src/media-store/backup/thread-copy.ts +340 -0
  99. package/src/media-store/copy/config.ts +3 -4
  100. package/src/media-store/copy/store.ts +2 -2
  101. package/src/media-store/db.ts +2 -2
  102. package/src/media-store/forget.ts +118 -0
  103. package/src/media-store/purge.ts +3 -2
  104. package/src/media-store/space-listing.ts +20 -4
  105. package/src/media-store/space.ts +6 -5
  106. package/src/messages/guard.ts +49 -0
  107. package/src/messages/model.ts +1 -1
  108. package/src/messages/objects.ts +201 -0
  109. package/src/messages/routes.ts +2 -2
  110. package/src/messages/score.ts +1 -1
  111. package/src/messages/write.ts +285 -0
  112. package/src/pages/frame-client.ts +181 -4
  113. package/src/reflections/reflections-queue.ts +1 -1
  114. package/src/release/gate-checkout.ts +2 -1
  115. package/src/release/git-facts.ts +3 -2
  116. package/src/release/public-clean.ts +3 -2
  117. package/src/repo-config.ts +40 -18
  118. package/src/review/anim.ts +1 -1
  119. package/src/review/answer-kinds.ts +131 -0
  120. package/src/review/band.ts +53 -0
  121. package/src/review/branch-hold.ts +84 -0
  122. package/src/review/card-db.ts +16 -6
  123. package/src/review/card-rows.ts +4 -3
  124. package/src/review/cells.ts +297 -65
  125. package/src/review/close.ts +92 -0
  126. package/src/review/draft-card.ts +8 -16
  127. package/src/review/draft-model.ts +2 -2
  128. package/src/review/events.ts +171 -0
  129. package/src/review/format.ts +128 -14
  130. package/src/review/glyphs.ts +63 -0
  131. package/src/review/gone.ts +1 -1
  132. package/src/review/holds-sync.ts +62 -0
  133. package/src/review/holds.ts +85 -0
  134. package/src/review/house-kind-defs.ts +41 -0
  135. package/src/review/inbox-hook.ts +22 -9
  136. package/src/review/inbox-read.ts +201 -0
  137. package/src/review/instructions.ts +199 -0
  138. package/src/review/kind-apply.ts +61 -0
  139. package/src/review/kind-catalog.ts +96 -0
  140. package/src/review/kinds.ts +278 -0
  141. package/src/review/lane-ask.ts +109 -0
  142. package/src/review/model.ts +396 -86
  143. package/src/review/move.ts +3 -3
  144. package/src/review/need-address.ts +15 -0
  145. package/src/review/need-threads.ts +93 -0
  146. package/src/review/object-card.ts +48 -0
  147. package/src/review/object-read.ts +31 -0
  148. package/src/review/owner-verdict.ts +36 -0
  149. package/src/review/parties.ts +182 -0
  150. package/src/review/previews.ts +3 -1
  151. package/src/review/projections.ts +235 -0
  152. package/src/review/referring.ts +54 -0
  153. package/src/review/reflection-object.ts +195 -0
  154. package/src/review/routes.ts +137 -32
  155. package/src/review/secret-route.ts +80 -0
  156. package/src/review/snooze.ts +38 -0
  157. package/src/review/stage-card.ts +4 -4
  158. package/src/review/store.ts +366 -85
  159. package/src/review/supersede.ts +116 -0
  160. package/src/review/take-back.ts +52 -0
  161. package/src/review/thread-fold.ts +20 -7
  162. package/src/review/threads.ts +236 -39
  163. package/src/review/traces.ts +218 -0
  164. package/src/review/trailer-card.ts +2 -2
  165. package/src/review/unit.ts +71 -5
  166. package/src/review/verdict-items.ts +73 -0
  167. package/src/review/verdict-write.ts +15 -0
  168. package/src/review/wait.ts +85 -0
  169. package/src/review/watchers.ts +22 -9
  170. package/src/scaffold/files/claude-settings-local.json +2 -0
  171. package/src/secrets/archive-mark.ts +52 -0
  172. package/src/secrets/archive.ts +83 -0
  173. package/src/secrets/copy.ts +14 -14
  174. package/src/secrets/keychain-write.ts +48 -0
  175. package/src/secrets/keychain.ts +8 -5
  176. package/src/secrets/lapse-mark.ts +33 -0
  177. package/src/secrets/lapse.ts +60 -0
  178. package/src/secrets/list.ts +16 -22
  179. package/src/secrets/manager.ts +31 -16
  180. package/src/secrets/read.ts +161 -33
  181. package/src/secrets/tail.ts +31 -0
  182. package/src/serve/hub-app/asks-page.tsx +2 -1
  183. package/src/serve/hub-app/auto-text.tsx +14 -6
  184. package/src/serve/hub-app/benign-errors.ts +15 -1
  185. package/src/serve/hub-app/card-head.tsx +49 -0
  186. package/src/serve/hub-app/check-view.tsx +3 -2
  187. package/src/serve/hub-app/code-copy.ts +35 -0
  188. package/src/serve/hub-app/col-card.tsx +31 -40
  189. package/src/serve/hub-app/col-list-page.tsx +5 -2
  190. package/src/serve/hub-app/col-tables-view.tsx +7 -4
  191. package/src/serve/hub-app/col-tables.ts +5 -5
  192. package/src/serve/hub-app/cols-svc.ts +4 -79
  193. package/src/serve/hub-app/commands/commands-page.tsx +2 -1
  194. package/src/serve/hub-app/controls.css +83 -0
  195. package/src/serve/hub-app/frames-st.ts +17 -1
  196. package/src/serve/hub-app/git-view.tsx +3 -2
  197. package/src/serve/hub-app/home-st.ts +57 -6
  198. package/src/serve/hub-app/home-strip.css +1 -6
  199. package/src/serve/hub-app/home-strip.tsx +2 -1
  200. package/src/serve/hub-app/home.html +3 -0
  201. package/src/serve/hub-app/house-wiki-view.tsx +20 -0
  202. package/src/serve/hub-app/hub-app.tsx +48 -32
  203. package/src/serve/hub-app/hub-types.ts +2 -0
  204. package/src/serve/hub-app/hub.css +50 -61
  205. package/src/serve/hub-app/icons.tsx +14 -4
  206. package/src/serve/hub-app/identities-view.tsx +4 -3
  207. package/src/serve/hub-app/inbox-st.ts +203 -42
  208. package/src/serve/hub-app/inbox-view.tsx +189 -101
  209. package/src/serve/hub-app/inbox.css +47 -44
  210. package/src/serve/hub-app/index.html +3 -0
  211. package/src/serve/hub-app/instructions.css +30 -0
  212. package/src/serve/hub-app/keys.ts +5 -3
  213. package/src/serve/hub-app/machine-st.ts +2 -2
  214. package/src/serve/hub-app/machines-view.tsx +4 -11
  215. package/src/serve/hub-app/machines.css +0 -9
  216. package/src/serve/hub-app/markdown.css +51 -0
  217. package/src/serve/hub-app/md-copy.tsx +18 -40
  218. package/src/serve/hub-app/md.ts +25 -9
  219. package/src/serve/hub-app/media-view.tsx +2 -2
  220. package/src/serve/hub-app/messages/messages-page.tsx +2 -1
  221. package/src/serve/hub-app/messages/messages-st.ts +1 -1
  222. package/src/serve/hub-app/messages.css +0 -1
  223. package/src/serve/hub-app/objects.css +51 -0
  224. package/src/serve/hub-app/page-keys.ts +1 -1
  225. package/src/serve/hub-app/pages-frames.tsx +11 -1
  226. package/src/serve/hub-app/palette-st.ts +4 -4
  227. package/src/serve/hub-app/pane-boundary.tsx +72 -0
  228. package/src/serve/hub-app/pane-errors.ts +54 -0
  229. package/src/serve/hub-app/plan-view.tsx +3 -2
  230. package/src/serve/hub-app/planned-view.tsx +3 -3
  231. package/src/serve/hub-app/planned.css +0 -4
  232. package/src/serve/hub-app/processes-view.tsx +3 -2
  233. package/src/serve/hub-app/project-list.css +5 -13
  234. package/src/serve/hub-app/project-list.tsx +3 -6
  235. package/src/serve/hub-app/projects-svc.ts +6 -2
  236. package/src/serve/hub-app/readme.css +9 -15
  237. package/src/serve/hub-app/reflections-page.tsx +54 -1
  238. package/src/serve/hub-app/releases/releases-page.tsx +3 -2
  239. package/src/serve/hub-app/releases.css +0 -1
  240. package/src/serve/hub-app/review/code-colors.ts +30 -0
  241. package/src/serve/hub-app/review/diff-view.tsx +75 -0
  242. package/src/serve/hub-app/review/dock.tsx +104 -0
  243. package/src/serve/hub-app/review/draft-card.tsx +2 -2
  244. package/src/serve/hub-app/review/group-block.tsx +209 -0
  245. package/src/serve/hub-app/review/instructions-view.tsx +116 -0
  246. package/src/serve/hub-app/review/item-verdict.tsx +38 -0
  247. package/src/serve/hub-app/review/kind-states.tsx +193 -0
  248. package/src/serve/hub-app/review/kind-view.tsx +1 -37
  249. package/src/serve/hub-app/review/kit.tsx +57 -54
  250. package/src/serve/hub-app/review/lane-bar.tsx +64 -0
  251. package/src/serve/hub-app/review/object-card.tsx +62 -0
  252. package/src/serve/hub-app/review/object-panel.tsx +179 -0
  253. package/src/serve/hub-app/review/question-views.tsx +385 -0
  254. package/src/serve/hub-app/review/review-cells.tsx +86 -105
  255. package/src/serve/hub-app/review/review-list.tsx +104 -47
  256. package/src/serve/hub-app/review/review-page.tsx +5 -4
  257. package/src/serve/hub-app/review/review-st.ts +68 -28
  258. package/src/serve/hub-app/review/review-thread.tsx +171 -40
  259. package/src/serve/hub-app/review/review-views.tsx +35 -31
  260. package/src/serve/hub-app/review/thread-close.tsx +124 -0
  261. package/src/serve/hub-app/review/thread-control.tsx +4 -4
  262. package/src/serve/hub-app/review/thread-st.ts +222 -22
  263. package/src/serve/hub-app/review/trailer-card.tsx +1 -1
  264. package/src/serve/hub-app/review/trailer-timeline.tsx +2 -2
  265. package/src/serve/hub-app/review.css +216 -57
  266. package/src/serve/hub-app/section-head.tsx +51 -0
  267. package/src/serve/hub-app/social/calendar.tsx +5 -11
  268. package/src/serve/hub-app/social/comms-page.tsx +23 -10
  269. package/src/serve/hub-app/social/kit.tsx +8 -15
  270. package/src/serve/hub-app/social/next-release.tsx +3 -5
  271. package/src/serve/hub-app/social/post-card.tsx +3 -0
  272. package/src/serve/hub-app/social/post-page.tsx +80 -0
  273. package/src/serve/hub-app/social/problems.tsx +5 -9
  274. package/src/serve/hub-app/social/social-model.ts +13 -5
  275. package/src/serve/hub-app/social/social-page.tsx +1 -1
  276. package/src/serve/hub-app/social/social-st.ts +42 -5
  277. package/src/serve/hub-app/social.css +7 -17
  278. package/src/serve/hub-app/space.css +1 -1
  279. package/src/serve/hub-app/stores/stores-page.tsx +6 -2
  280. package/src/serve/hub-app/thread-row.tsx +101 -0
  281. package/src/serve/hub-app/time-ago.tsx +3 -2
  282. package/src/serve/hub-app/time-view.tsx +2 -1
  283. package/src/serve/hub-app/time.css +2 -5
  284. package/src/serve/hub-app/tree-row.tsx +1 -9
  285. package/src/serve/hub-app/vault-view.tsx +4 -4
  286. package/src/serve/hub-app/veille/veille-page.tsx +2 -11
  287. package/src/serve/hub-app/veille.css +0 -1
  288. package/src/serve/hub-app/waiting-svc.ts +4 -4
  289. package/src/serve/hub-app/when-view.tsx +6 -3
  290. package/src/serve/hub-app/wiki-st.ts +30 -4
  291. package/src/serve/hub-app/wikis-view.tsx +4 -3
  292. package/src/serve/hub-runtime.ts +20 -6
  293. package/src/serve/project-gutter-route.ts +16 -6
  294. package/src/serve/project-gutter.ts +6 -53
  295. package/src/serve/same-origin.ts +3 -0
  296. package/src/serve/secret-gate.ts +21 -0
  297. package/src/serve/serve-hub.ts +29 -20
  298. package/src/serve/tailnet-caller.ts +117 -0
  299. package/src/shipkit.ts +2 -2
  300. package/src/site/desk.ts +2 -2
  301. package/src/smoke/run-smoke.ts +3 -4
  302. package/src/social/brands.ts +4 -0
  303. package/src/social/card-drafts.ts +11 -19
  304. package/src/social/desk-index.ts +34 -13
  305. package/src/social/drafts.ts +4 -4
  306. package/src/social/import-drafts.ts +244 -0
  307. package/src/social/kind-pages.ts +3 -3
  308. package/src/social/kinds.ts +1 -1
  309. package/src/social/load.ts +89 -64
  310. package/src/social/media-kind.ts +68 -161
  311. package/src/social/media-of.ts +5 -4
  312. package/src/social/open.ts +3 -2
  313. package/src/social/post-object.ts +120 -0
  314. package/src/social/post-sources.ts +136 -0
  315. package/src/social/post-text.ts +103 -0
  316. package/src/social/posts.ts +378 -0
  317. package/src/social/presence.ts +7 -5
  318. package/src/social/publish/index.ts +17 -5
  319. package/src/social/publish/secret.ts +2 -2
  320. package/src/social/release-stage.ts +58 -57
  321. package/src/social/routes.ts +64 -24
  322. package/src/social/stage.ts +42 -57
  323. package/src/social/text.ts +4 -3
  324. package/src/social/thumbnail.ts +135 -43
  325. package/src/social/tracker.ts +1 -1
  326. package/src/social/writes.ts +12 -29
  327. package/src/stores/desk.ts +16 -11
  328. package/src/stores/unit.ts +2 -2
  329. package/src/trailer/sound/eleven.ts +33 -3
  330. package/src/urls/rows.ts +1 -1
  331. package/src/vault/vault-http.ts +11 -3
  332. package/src/vault/vault-import.ts +6 -1
  333. package/src/veille/identity.ts +2 -2
  334. package/src/wiki/graph-pages.ts +13 -1
  335. package/src/wiki/scan-md.ts +1 -1
  336. package/src/asks/asks-queue.ts +0 -424
  337. package/src/messages/suggest.ts +0 -96
  338. package/src/social/migrate.ts +0 -123
@@ -7,7 +7,7 @@
7
7
  // the page it opens. A click opens, only the chevron folds.
8
8
  import { observer } from 'mobx-react-lite'
9
9
  import { useEffect, useRef, type CSSProperties, type RefObject } from 'react'
10
- import { Icon, ICON } from './icons.tsx'
10
+ import { Caret, Icon, ICON } from './icons.tsx'
11
11
  import { pageKeyLabel, sectionKeyLabel } from './keys.ts'
12
12
  import type { RepoSt } from './repo-st.ts'
13
13
  import { GLYPH, GLYPH_WORD, markOf, rowName, rowSlots, type TreeRow } from './tree-build.ts'
@@ -21,14 +21,6 @@ export const useInSight = <T extends HTMLElement = HTMLDivElement>(on: boolean):
21
21
  return el
22
22
  }
23
23
 
24
- /** the fold marker: a chevron, right when the branch is shut and down when
25
- * it is open. The 9px triangle it replaces read as a dot with an opinion */
26
- export const Caret = ({ open }: { open: boolean }): React.ReactElement => (
27
- <svg className={open ? 'cvt open' : 'cvt'} viewBox="0 0 24 24" width="10" height="10" aria-hidden="true">
28
- <path d="M9 5l7 7-7 7" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" />
29
- </svg>
30
- )
31
-
32
24
  /** the chevron's own hit target: it folds, and the click never reaches the row */
33
25
  const Fold = observer(({ app, row }: { app: RepoSt; row: TreeRow }) => (
34
26
  <span className="tw" onClick={row.dir ? (e) => { e.stopPropagation(); app.tree.fold(row) } : undefined}>
@@ -20,8 +20,8 @@ const clock = (at: number): string => new Date(at).toTimeString().slice(0, 5)
20
20
 
21
21
  const processHref = (repo: string, id: string): string => `${repoPage(repo)}#${hashFor({ t: 'processes', id })}`
22
22
  /** an ask by its repo and number, its title on hover */
23
- const askWords = (a: { repo: string; file: string }): string => `${a.repo} ask ${/^(\d+)-/.exec(a.file)?.[1] ?? a.file}`
24
- const askHref = (repo: string, file: string): string => `${repoPage(repo)}#${hashFor({ t: 'item', col: 'asks', id: `ask:${file}` })}`
23
+ const askWords = (a: { repo: string; id: string }): string => `${a.repo} ask ${/^(\d+)-/.exec(a.id)?.[1] ?? a.id}`
24
+ const askHref = (repo: string, id: string): string => `${repoPage(repo)}#${hashFor({ t: 'item', col: 'asks', id: `ask:${id}` })}`
25
25
 
26
26
  /** a link that moves the home in place on a plain click, the browser's own way otherwise */
27
27
  const In = ({ href, go, children }: { href: string; go: () => void; children: string }) => (
@@ -80,7 +80,7 @@ const HEAD: Col[] = [
80
80
  const NameCell = ({ r }: { r: SecretRow }) => (
81
81
  <span className="vtname">
82
82
  <span className="mcsha">{r.name}</span>
83
- {r.registered ? null : <Hint className="vttag" tip="no row in the registry (wiki services/secrets/registry.md): every repo reads it, and the vault files it where it was put">no row</Hint>}
83
+ {r.registered ? null : <Hint className="vttag" tip="no row in the registry (wiki identities/_common/secrets-registry.md): every repo reads it, and the vault files it where it was put">no row</Hint>}
84
84
  {r.note == null ? null : <Hint className="vttag t-warn" tip={r.note}>note</Hint>}
85
85
  </span>
86
86
  )
@@ -99,7 +99,7 @@ const Secrets = observer(({ app, st }: { app: HomeSt; st: VaultSt }) => {
99
99
  <span className={`vth vt-${h.tone}`}>{h.text}</span>,
100
100
  <span title={writtenWords(r, d.at)}>{writtenShort(r, d.at)}</span>,
101
101
  r.chips == null || r.chips.length === 0 ? r.who : <ReaderChips who={{ long: r.who, chips: r.chips }} lead="who reads it" />,
102
- r.ask == null ? '' : <Hint tip={r.ask.title}><In href={askHref(r.ask.repo, r.ask.file)} go={() => app.openItem(r.ask!.repo, 'asks', `ask:${r.ask!.file}`)}>{askWords(r.ask)}</In></Hint>,
102
+ r.ask == null ? '' : <Hint tip={r.ask.title}><In href={askHref(r.ask.repo, r.ask.id)} go={() => app.openItem(r.ask!.repo, 'asks', `ask:${r.ask!.id}`)}>{askWords(r.ask)}</In></Hint>,
103
103
  r.for,
104
104
  ],
105
105
  }
@@ -10,7 +10,7 @@ import { COLUMNS, READER_QUIET_MS, replyUrl } from '../../../veille/platforms.ts
10
10
  import type { RepoSt } from '../repo-st.ts'
11
11
  import { PANEL, PhoneTop } from '../review/review-page.tsx'
12
12
  import { type FeedRow, type Platform, shelfOf, SHELVES, type VeilleSt, WINDOWS } from './veille-st.ts'
13
- import { Caret } from '../icons.tsx'
13
+ import { SectionHead } from '../section-head.tsx'
14
14
  import { AutoText } from '../auto-text.tsx'
15
15
 
16
16
  const short = (n: number | null): string => (n == null ? '–' : n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1e4 ? `${Math.round(n / 1e3)}k` : n >= 1e3 ? `${(n / 1e3).toFixed(1)}k` : String(n))
@@ -273,16 +273,7 @@ const ColumnRows = observer(({ v, platform }: { v: VeilleSt; platform: Platform
273
273
  if (rows.length === 0 && s.shelf !== 'now') return null
274
274
  return (
275
275
  <div key={s.shelf} className={`vl-shelf t-${SHELF_TONE[s.shelf]}`}>
276
- {s.shelf === 'done' ? (
277
- <button className="vl-shelfhead" onClick={() => v.toggleDone(platform)}>
278
- <Caret open={!folded} />
279
- {s.label} <span className="rv-dim">{rows.length}</span>
280
- </button>
281
- ) : (
282
- <div className="vl-shelfhead">
283
- {s.label} <span className="rv-dim">{rows.length}</span>
284
- </div>
285
- )}
276
+ <SectionHead label={s.label} n={rows.length} tone="var(--tone)" {...(s.shelf === 'done' ? { open: !folded, onFold: () => v.toggleDone(platform) } : {})} />
286
277
  {rows.length === 0 && <div className="rv-dim vl-none">rien pour l'instant</div>}
287
278
  {!folded && rows.map((r) => <PostRow key={r.key} v={v} row={r} />)}
288
279
  </div>
@@ -34,7 +34,6 @@
34
34
  .vl-dropped a{color:var(--ink);text-decoration:none}
35
35
  .vl-cap{font-size:11px;font-weight:700;color:var(--tone)}
36
36
  .vl-rows{flex:1;min-height:0;overflow-y:auto}
37
- .vl-shelfhead{display:flex;gap:var(--s2);align-items:center;width:100%;padding:var(--s0) var(--s2);font-size:11px;font-weight:700;color:var(--tone);background:var(--panel2);border:0;border-radius:0;border-left:3px solid var(--tone);text-align:left}
38
37
  .vl-none{font-size:11px;padding:var(--s1) var(--s2)}
39
38
  .vl-row{display:flex;flex-direction:column;gap:var(--s0);width:100%;text-align:left;padding:var(--s1) var(--s2);border:0;border-radius:0;border-bottom:1px solid var(--line);font-size:12px;box-shadow:inset 3px 0 0 transparent}
40
39
  .vl-row:hover{background:var(--hi3)}
@@ -1,9 +1,9 @@
1
- // everything that waits for the owner in every repo (asks, cards), for the picker: read when it opens, the three
2
- // lists of the inbox whole, since a jump reaches an item the inbox page has folded away too. A node of the home
1
+ // every thread that waits for the owner in every repo, for the picker: read when it opens, his two lists of the inbox
2
+ // whole (now and later), since a jump reaches an item the inbox page has folded away too. A node of the home
3
3
  import { makeAutoObservable, runInAction } from 'mobx'
4
4
  import type { InboxAnswer, InboxList, InboxRow } from '../../home/inbox-shape.ts'
5
5
 
6
- const LISTS: InboxList[] = ['main', 'yellow', 'later']
6
+ const LISTS: InboxList[] = ['main', 'later']
7
7
 
8
8
  export class HouseWaitingSvc {
9
9
  rows: InboxRow[] = []
@@ -17,7 +17,7 @@ export class HouseWaitingSvc {
17
17
  const pages = await Promise.all(
18
18
  LISTS.map(async (l) => {
19
19
  try {
20
- const r = await fetch(`/api/inbox?show=all&list=${l}&limit=500`)
20
+ const r = await fetch(`/api/inbox?list=${l}&limit=500`)
21
21
  return r.ok ? ((await r.json()) as InboxAnswer).rows : []
22
22
  } catch {
23
23
  return []
@@ -2,6 +2,7 @@
2
2
  // value, what it means), then one row per check with its value on each axis,
3
3
  // read from the facts every check row already carries (core/runs-matrix.ts),
4
4
  // so the page reads nothing of its own and never disagrees with `shipkit when`.
5
+ import { CardHead } from './card-head.tsx'
5
6
  import { observer } from 'mobx-react-lite'
6
7
  import { useState } from 'react'
7
8
  import { MATRIX_AXES, RUNS_LEGEND, inColumn, type MatrixAxis } from '../../core/runs-matrix.ts'
@@ -52,9 +53,11 @@ export const WhenPage = observer(({ app }: { app: RepoSt }) => {
52
53
  <h3 className="ctitle">what runs when</h3>
53
54
  </div>
54
55
  <div className="usays">every check declares every context, with no default. Click a column to see only what that context runs. `shipkit when` prints the same</div>
55
- <section className="csec"><div className="cstitle">the legend</div><Legend /></section>
56
+ <section className="csec"><CardHead title="the legend" /><Legend /></section>
56
57
  <section className="csec">
57
- <div className="cstitle">{only == null ? `${live.length} checks` : `${shown.length} of ${live.length} checks run on ${only}`}{only != null ? <> · <a href="#" onClick={(e) => { e.preventDefault(); setOnly(null) }}>show all</a></> : null}</div>
58
+ <CardHead title={only == null ? 'checks' : `checks run on ${only}`} n={only == null ? live.length : `${shown.length} of ${live.length}`}>
59
+ {only != null ? <a href="#" onClick={(e) => { e.preventDefault(); setOnly(null) }}>show all</a> : null}
60
+ </CardHead>
58
61
  <table className="whtable">
59
62
  <thead>
60
63
  <tr>
@@ -80,7 +83,7 @@ export const WhenPage = observer(({ app }: { app: RepoSt }) => {
80
83
  </section>
81
84
  {off.length > 0 ? (
82
85
  <section className="csec">
83
- <div className="cstitle">off in this repo ({off.length}): repo.config.ts `off`, or the check does not apply here</div>
86
+ <CardHead title="off in this repo" n={off.length} meta="repo.config.ts `off`, or the check does not apply here" />
84
87
  {off.map((r) => <div key={r.id} className="whoff"><span className="whid">{r.id}</span> <span className="dim">{r.cells.off}</span></div>)}
85
88
  </section>
86
89
  ) : null}
@@ -64,8 +64,11 @@ export class WikiSt {
64
64
  private timer: ReturnType<typeof setTimeout> | null = null
65
65
  private asked = 0
66
66
 
67
+ /** the newest page asked: a slower read of an older one never lands over it */
68
+ private opening = 0
69
+
67
70
  constructor(private readonly st: RepoSt) {
68
- makeAutoObservable<this, 'st' | 'frame' | 'timer' | 'asked'>(this, { st: false, frame: false, timer: false, asked: false })
71
+ makeAutoObservable<this, 'st' | 'frame' | 'timer' | 'asked' | 'opening'>(this, { st: false, frame: false, timer: false, asked: false, opening: false })
69
72
  }
70
73
 
71
74
  /** the wiki shown changed: its search starts over, and its index opens */
@@ -77,7 +80,16 @@ export class WikiSt {
77
80
  this.page = null
78
81
  this.error = ''
79
82
  this.listOpen = false
80
- if (href != null) void this.open('')
83
+ if (href != null) void this.open(this.next ?? '')
84
+ this.next = null
85
+ }
86
+
87
+ /** the page an address asks for (`/wiki#<page>`): opened at once, or as the wiki binds */
88
+ next: string | null = null
89
+
90
+ want(id: string): void {
91
+ if (this.href == null) this.next = id
92
+ else void this.open(id)
81
93
  }
82
94
 
83
95
  /** the graph's iframe, to send it focus and theme */
@@ -131,18 +143,32 @@ export class WikiSt {
131
143
  return true
132
144
  }
133
145
 
146
+ /** a picture a page names relative to itself (a generated page's icons), served from the wiki's own folder by
147
+ * `/graph/<id>/image`; null for a url, an absolute path, or a path that leaves the wiki */
148
+ imageUrl(page: string, rel: string): string | null {
149
+ if (this.href == null || rel === '' || /^([a-z][a-z0-9+.-]*:|\/)/i.test(rel)) return null
150
+ const out: string[] = []
151
+ for (const p of [...page.split('/').slice(0, -1), ...rel.split('/')]) {
152
+ if (p === '..') {
153
+ if (out.pop() === undefined) return null
154
+ } else if (p !== '.' && p !== '') out.push(p)
155
+ }
156
+ return this.st.url(`${this.href}/image?path=${encodeURIComponent(out.join('/'))}`)
157
+ }
158
+
134
159
  /** a page opens in the preview, and its ball is focused in the graph; '' = the wiki's index */
135
160
  async open(id: string): Promise<void> {
136
161
  const href = this.href
137
162
  if (href == null) return
163
+ const n = ++this.opening
138
164
  this.listOpen = false
139
165
  if (id !== '') this.send({ type: 'wiki-graph:focus', id })
140
166
  try {
141
167
  const r = await fetch(this.st.url(`${href}/page?node=${encodeURIComponent(id)}`))
142
168
  if (!r.ok) throw new Error(`${r.status} ${await r.text()}`)
143
169
  const p = (await r.json()) as WikiPage
144
- // the wiki changed while the page was read: it is not this one's
145
- if (href !== this.href) return
170
+ // the wiki changed, or a later page was asked, while the page was read: it is not this one's
171
+ if (href !== this.href || n !== this.opening) return
146
172
  runInAction(() => { this.page = p; this.error = '' })
147
173
  if (id === '') this.send({ type: 'wiki-graph:focus', id: p.id })
148
174
  } catch (e) {
@@ -44,14 +44,15 @@ export function openWikis(app: RepoSt): void {
44
44
 
45
45
  const PANEL = { overflow: 'hidden' } as const
46
46
 
47
- export const WikisView = observer(({ app, id }: { app: RepoSt; id: string }) => {
47
+ /** `label`: a tab's words where the page around names it otherwise (the house wiki's page, house-wiki-view.tsx) */
48
+ export const WikisView = observer(({ app, id, label }: { app: RepoSt; id: string; label?: (t: WikiTab) => string }) => {
48
49
  const i = app.cols.find(WIKIS, id)
49
50
  const w = app.wiki
50
51
  const href = i?.href ?? null
51
52
  useEffect(() => w.bind(href), [w, href])
52
53
  const tabs = (
53
54
  <span className="seg">
54
- {wikiTabs(app).map((t) => <button key={t.id} className={t.on ? 'on' : ''} onClick={t.go}><span className={`tl ${t.state}`}>{t.label}</span></button>)}
55
+ {wikiTabs(app).map((t) => <button key={t.id} className={t.on ? 'on' : ''} onClick={t.go}><span className={`tl ${t.state}`}>{label ? label(t) : t.label}</span></button>)}
55
56
  </span>
56
57
  )
57
58
  if (i == null) return <div className="graphview"><div className="gvhead">{tabs}</div><div className="ph">this wiki is not mounted here</div></div>
@@ -180,7 +181,7 @@ const WikiPreview = observer(({ w }: { w: WikiSt }) => {
180
181
  <button className="wpbtn" title={`copy ${p.file}`} onClick={() => void w.copyPath()}><Icon d={ICON.copy} /><span>{w.copied ? 'copied' : 'copy path'}</span></button>
181
182
  <button className="ghost wpclose" aria-label="close the preview" title="close the preview" onClick={() => w.close()}>×</button>
182
183
  </div>
183
- <div className="wpbody md readme-body" onClick={click} dangerouslySetInnerHTML={{ __html: renderWikiPage(p.md, p.links) }} />
184
+ <div className="wpbody md readme-body" onClick={click} dangerouslySetInnerHTML={{ __html: renderWikiPage(p.md, p.links, (rel) => w.imageUrl(p.id, rel)) }} />
184
185
  </div>
185
186
  )
186
187
  })
@@ -60,8 +60,9 @@ import { HubProblems } from './hub-problems.ts'
60
60
  import { hubHandler, type CheckTap, type HubDeps, type HubHandler } from './serve-hub.ts'
61
61
  import type { projectGutter } from './project-gutter-route.ts'
62
62
  import { defaultHubPort } from './hub-port.ts'
63
- import { LAYOUT } from '../core/layout.ts'
64
63
  import { storeDir, storeStamp } from '../review/store.ts'
64
+ import { syncNeedThreads } from '../review/need-threads.ts'
65
+ import { syncHolds } from '../review/holds-sync.ts'
65
66
  import { isStoreRefused } from '../core/machine-db.ts'
66
67
 
67
68
  /** the review store's stamp, or a word that it is refused now (a walk of the daemon's file): read again at the next ask */
@@ -419,13 +420,12 @@ export async function resolveHubDeps(root: string, boot: RepoConfig, io: ServeIo
419
420
  // a job outlives this image, so only an in process run holds a reload back
420
421
  busy: () => jobs == null && active > 0,
421
422
  collections: allCollections,
422
- asksDir: c.asks?.dir ?? LAYOUT.asks,
423
423
  comfy: panel == null ? null : { ensure: () => panel.ensure(), restart: () => panel.restart(), box: () => comfyBox(root), stop: () => panel.stop() },
424
424
  // RED-only pings while serving; notify command is repo config data.
425
425
  // Delivery failure must be LOUD — a silently broken notify path means
426
426
  // a silent one reads as no blockers at all
427
427
  pingTick: (needs) =>
428
- pingTick(root, c.asks?.dir ?? LAYOUT.asks, needs, {
428
+ pingTick(root, needs, {
429
429
  link: o?.link ?? (() => { const h = machinePublicHost(c); return h != null ? `http://${h}:${port}${o?.base ?? ''}/?f=needs` : undefined }),
430
430
  run: (cmd) => {
431
431
  const p = Bun.spawn(cmd, { stdout: 'ignore', stderr: 'pipe' })
@@ -524,12 +524,26 @@ export async function loadHub(root: string, io: ServeIo, o: LoadHubOpts): Promis
524
524
  const handler = hubHandler(deps, { base: o.base, projects: o.projects })
525
525
  // tick failures are LOUD (the hub's own lines), never swallowed
526
526
  const ping = async (): Promise<void> => {
527
- if (deps.pingTick == null) return
527
+ // the warm rows, never a compute of every collection of its own: the ping is not worth a held loop
528
+ let needs: Awaited<ReturnType<typeof handler.needs>>
528
529
  try {
529
- // the warm rows, never a compute of every collection of its own: the ping is not worth a held loop
530
- deps.pingTick(await handler.needs())
530
+ needs = await handler.needs()
531
+ deps.pingTick?.(needs)
531
532
  } catch (e) {
532
533
  io.printErr(`WARN ping tick broke: ${(e as Error).message}`)
534
+ return
535
+ }
536
+ try {
537
+ // the same needs keep the checks' and reflections' threads (wiki tools/shipkit/threads-how-it-fits.md, The model)
538
+ await syncNeedThreads(root, name, needs)
539
+ } catch (e) {
540
+ io.printErr(`WARN the checks' and reflections' threads did not sync: ${(e as Error).message}`)
541
+ }
542
+ try {
543
+ // the objects that hold a thread open, each checked on local state (wiki tools/shipkit/threads-how-it-fits.md, The model)
544
+ await syncHolds(root)
545
+ } catch (e) {
546
+ io.printErr(`WARN the threads' holds did not sync: ${(e as Error).message}`)
533
547
  }
534
548
  }
535
549
  const live: { stop: () => void }[] = []
@@ -14,10 +14,10 @@ import { loopWatch } from '../core/loop-watch.ts'
14
14
  import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'fs'
15
15
  import { readFile, stat } from 'fs/promises'
16
16
  import { homedir } from 'os'
17
- import { dirname, join } from 'path'
17
+ import { dirname, join, sep } from 'path'
18
18
  import {
19
- asksDirOf, branchOf, countSessions, descriptionOf, dirtyCount, gateFrom, checkStateOf, gitStamp, houseRepos, iconStamp, ICON_TYPES, lastActivity,
20
- lastRunAt, lastSessionAt, liveUrlOf, mergeOrder, openAsks, openFolders, parseClaudePids, parseDescribe, parseLsofCwd, parseOrder,
19
+ branchOf, countSessions, descriptionOf, dirtyCount, gateFrom, checkStateOf, gitStamp, houseRepos, iconStamp, ICON_TYPES, lastActivity,
20
+ lastRunAt, lastSessionAt, liveUrlOf, mergeOrder, openAskTitles, openFolders, parseClaudePids, parseDescribe, parseLsofCwd, parseOrder,
21
21
  recordOf, recordStamp, RELEASE_TAGS, renderOrder, versionOf, vscodeStoragePath, type CheckState, type Gate, type LastRow, type WiredRepo,
22
22
  } from './project-gutter.ts'
23
23
  import { readLastStatusReadonly } from '../ledger/run-log.ts'
@@ -121,7 +121,15 @@ export type ProjectRow = {
121
121
  export type ArchivedRow = { name: string; icon: string | null }
122
122
 
123
123
  /** `identities`: every identity of the machine, in their order, as the list's headers draw them */
124
- export type ProjectsAnswer = { projects: ProjectRow[]; archived: ArchivedRow[]; identities: RailIdentity[]; ms: number; at: number }
124
+ export type ProjectsAnswer = {
125
+ projects: ProjectRow[]
126
+ archived: ArchivedRow[]
127
+ identities: RailIdentity[]
128
+ /** the repo that holds the house wiki, its rail name; the home's wiki page shows its wikis. null with no house index */
129
+ house: string | null
130
+ ms: number
131
+ at: number
132
+ }
125
133
 
126
134
  /** a command's exit code and stdout, or null when its binary is missing */
127
135
  export type Run = (cmd: string[], cwd?: string) => Promise<{ code: number; out: string } | null>
@@ -379,7 +387,7 @@ export function projectGutter(d: GutterDeps) {
379
387
  const projects = repos.map((r, i): ProjectRow => loopWatch.timed(`projects: row ${r.name}`, () => {
380
388
  const config = readText(join(r.path, 'repo.config.ts'))
381
389
  const pkg = readText(join(r.path, 'package.json'))
382
- const asks = openAsks(join(r.path, asksDirOf(config, r.path)))
390
+ const asks = openAskTitles(r.path)
383
391
  // the README is read only when package.json says nothing
384
392
  const description = descriptionOf(pkg, '') ?? descriptionOf('', readText(join(r.path, 'README.md')))
385
393
  const state = gateOfRepo(r)
@@ -411,7 +419,9 @@ export function projectGutter(d: GutterDeps) {
411
419
  }
412
420
  }))
413
421
  const archived = archivedRepos.map((r) => ({ name: r.name, icon: iconUrl(r) }))
414
- return { projects: inOrder(projects, parseOrder(readText(orderAt))), archived, identities: ids.identities.map(railOf), ms: Math.round(performance.now() - t0), at: now() }
422
+ const index = house.index
423
+ const houseName = index == null ? null : (repos.find((r) => index.startsWith(`${r.path}${sep}`))?.name ?? null)
424
+ return { projects: inOrder(projects, parseOrder(readText(orderAt))), archived, identities: ids.identities.map(railOf), house: houseName, ms: Math.round(performance.now() - t0), at: now() }
415
425
  }
416
426
 
417
427
  /** the last answer while it is younger than POLL_MS, one measure otherwise,
@@ -10,10 +10,9 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'fs'
10
10
  import { basename, dirname, join, resolve, sep } from 'path'
11
11
  import { fileURLToPath } from 'url'
12
12
  import { gitRoot, isLinkedWorktree } from '../core/git-root.ts'
13
- import { askOf, isClosed, isLater } from '../asks/asks-queue.ts'
13
+ import { asksOfRepo, isClosed, isLater } from '../asks/ask-store.ts'
14
14
  import { DB_FILE } from '../ledger/db.ts'
15
15
  import { defaultHubPort } from './hub-port.ts'
16
- import { LAYOUT } from '../core/layout.ts'
17
16
  import { isArchived } from '../core/archived.ts'
18
17
  import { CLAUDE_FILES } from '../home/pm-inputs.ts'
19
18
  import { DEFAULT_AGENT_DIR } from '../core/agent-dir.ts'
@@ -198,12 +197,6 @@ export function configBlock(src: string, key: string): string | null {
198
197
  const stringKey = (block: string | null, key: string): string | null =>
199
198
  block == null ? null : (new RegExp(`\\b${key}\\s*:\\s*['"\`]([^'"\`]+)['"\`]`).exec(block)?.[1] ?? null)
200
199
 
201
- /** `asks: { dir }`, the queue's folder, `.shipkit/asks` when the config names
202
- * none. A repo that has not run the new shipkit yet still keeps its queue in
203
- * `asks/` (this read dies once `shipkit fleet` shows no repo on the old layout) */
204
- export const asksDirOf = (configSrc: string, repo?: string): string =>
205
- stringKey(configBlock(configSrc, 'asks'), 'dir') ?? (repo != null && !existsSync(join(repo, LAYOUT.asks)) && existsSync(join(repo, 'asks')) ? 'asks' : LAYOUT.asks)
206
-
207
200
  /** `smoke: { base }`, the one deployed url a repo declares in a machine
208
201
  * readable place, or null */
209
202
  export function liveUrlOf(configSrc: string): string | null {
@@ -211,51 +204,11 @@ export function liveUrlOf(configSrc: string): string | null {
211
204
  return u != null && /^https?:\/\//.test(u) ? u : null
212
205
  }
213
206
 
214
- /** an ask file is open until its frontmatter says `status: done` or `status: declined`, and counts once its `after:` day
215
- * came (asks-queue.ts parses it); a file the parser refuses still counts, never hidden */
216
- export const isOpenAsk = (md: string, now: number = Date.now()): boolean => {
217
- try {
218
- const a = askOf(md, '')
219
- return !isClosed(a.status) && !isLater(a, now)
220
- } catch {
221
- return !/^status:\s*(done|declined)\b/m.test(md)
222
- }
223
- }
224
-
225
- /** the open asks in a queue folder: its top level md files, the done/
226
- * and declined/ archives and every other folder left out. Read only: a missing folder is 0 */
227
- export const openAskCount = (dir: string, now?: number): number => openAsks(dir, now).length
228
-
229
- /** an ask's title: its first heading, else its first line of prose, the
230
- * frontmatter skipped */
231
- export function askTitle(md: string): string | null {
232
- const body = md.replace(/^---\n[\s\S]*?\n---\n?/, '')
233
- const lines = body.split('\n').map((l) => l.trim()).filter((l) => l !== '')
234
- const heading = lines.find((l) => /^#{1,6}\s+\S/.test(l))
235
- const title = heading?.replace(/^#{1,6}\s+/, '') ?? lines[0]
236
- return title == null || title === '' ? null : title
237
- }
238
-
239
- /** the titles of the open asks in a queue folder, by file name order, the
240
- * file name when an ask has no text */
241
- export function openAsks(dir: string, now: number = Date.now()): string[] {
242
- let files: string[]
243
- try {
244
- files = readdirSync(dir).filter((f) => f.endsWith('.md')).sort()
245
- } catch {
246
- return []
247
- }
248
- const out: string[] = []
249
- for (const f of files) {
250
- try {
251
- const md = readFileSync(join(dir, f), 'utf8')
252
- if (isOpenAsk(md, now)) out.push(askTitle(md) ?? f.replace(/\.md$/, ''))
253
- } catch {
254
- // a folder named like an md file, or a file gone mid read
255
- }
256
- }
257
- return out
258
- }
207
+ /** the titles of a repo's open asks, by id, the ones whose later day is ahead left out; a repo with no store is none */
208
+ export const openAskTitles = (root: string, now: number = Date.now()): string[] =>
209
+ asksOfRepo(root, new Date(now))
210
+ .filter((a) => !isClosed(a.status) && !isLater(a, now))
211
+ .map((a) => a.title)
259
212
 
260
213
  // ── the card facts: description, version, branch, last gate ─────────────
261
214
 
@@ -20,6 +20,9 @@ export const loopbackHost = (req: Request): boolean => loopbackName(hostName(req
20
20
  export type Reach = 'local' | 'tailnet'
21
21
  /** the web's tag on what it forwards to the daemon, which never sees the browser's Host */
22
22
  export const REACH_HEADER = 'x-shipkit-reach'
23
+ /** the web's tag of the Host it received: tailscaled keeps the browser's, a relay that fetches the web arrives as a
24
+ * loopback name; the daemon never sees the browser's Host itself */
25
+ export const HOST_HEADER = 'x-shipkit-host'
23
26
 
24
27
  export const reachOfHost = (host: string | null): Reach => (host != null && host !== '' && loopbackName(hostName(host)) ? 'local' : 'tailnet')
25
28
 
@@ -0,0 +1,21 @@
1
+ // the one gate before a secret's value is read from a request (wiki tools/shipkit/threads-asks.md, The secret field):
2
+ // typed in the hub on the Mac that runs it, or on the owner's phone over the tailnet's https (tailnet-caller.ts),
3
+ // never under another name than a loopback one, never from another site. The thread's secret field and the social
4
+ // desk's setup step both pass it.
5
+ // The one constraint a reader breaks first: a tailnet request passes on headers tailscaled wrote, so a relay to the
6
+ // home that keeps a caller's headers and has no tailscaled in front of it lets that caller pass as the phone
7
+ import { broughtByProxy } from './door-forward.ts'
8
+ import { loopbackHost, reachOf, sameOrigin } from './same-origin.ts'
9
+ import { tailnetRefusal, type TailnetWho } from './tailnet-caller.ts'
10
+
11
+ export const SECRET_WHERE = 'a secret is typed in the hub on the Mac that runs it, or on your phone over the tailnet'
12
+
13
+ /** why a request may not carry a secret's value, null when it may */
14
+ export async function secretRefusal(req: Request, o: { who?: TailnetWho } = {}): Promise<string | null> {
15
+ // the daemon is reached from the web by its loopback address, so another name is a page of another site (dns rebinding)
16
+ if (!loopbackHost(req)) return `${SECRET_WHERE}: this request names the hub by another name than localhost`
17
+ if (!sameOrigin(req)) return 'refused: a request of another site'
18
+ if (reachOf(req) === 'local' && !broughtByProxy(req)) return null
19
+ const why = await tailnetRefusal(req, o)
20
+ return why == null ? null : `${SECRET_WHERE}: ${why}`
21
+ }
@@ -7,13 +7,13 @@
7
7
  import { existsSync, realpathSync } from 'fs'
8
8
  import { join } from 'path'
9
9
  import { positionsFile } from 'rvlib-shipkit/src/wiki/graph-positions.ts'
10
- import { pageOf, searchWiki } from 'rvlib-shipkit/src/wiki/graph-pages.ts'
10
+ import { imageOf, pageOf, searchWiki } from 'rvlib-shipkit/src/wiki/graph-pages.ts'
11
11
  import { graphRoutes } from 'rvlib-shipkit/src/wiki/serve-graph.ts'
12
12
  import type { StudioRoutes } from '../assets/server/studio-server.ts'
13
13
  import { comfyBoxUp, type ComfyBox, type ComfyPanelUp } from '../comfy/comfy-panel.ts'
14
- import { appendAskRemark, appendAssetNote, askDecline, askDone, askProof, askSecret } from '../collections/actions.ts'
14
+ import { appendAssetNote, askDecline, askDone, askProof, askRemark } from '../collections/actions.ts'
15
15
  import type { HeldOf } from '../secrets/held.ts'
16
- import { managerStore, type SecretStore } from '../secrets/manager.ts'
16
+ import type { SecretStore } from '../secrets/manager.ts'
17
17
  import { brokenRow, projectResources, type Collection, type Instance, type NeedItem, type Resource } from '../collections/collection-types.ts'
18
18
  import type { CheckEvent } from '../core/run-check.ts'
19
19
  import { configDirty, readGateBlock, writeGateBlock, type GateEdit } from '../core/when-block.ts'
@@ -38,6 +38,7 @@ import { WarmCell, warmQueue } from './warm-cell.ts'
38
38
  import { resourcesAnswer, testRunsAnswer } from './resources-wire.ts'
39
39
  import { readmeRoutes } from './readme-route.ts'
40
40
  import { reviewRoutes } from '../review/routes.ts'
41
+ import type { TailnetWho } from './tailnet-caller.ts'
41
42
  import { veilleRoutes } from '../veille/routes.ts'
42
43
  import { storesRoutes } from '../stores/routes.ts'
43
44
  import { messagesRoutes } from '../messages/routes.ts'
@@ -118,13 +119,13 @@ export type HubDeps = {
118
119
  /** BROWSE-ALL: the collections with every instance incl. healthy —
119
120
  * the page shows everything that exists, dimmed never hidden */
120
121
  collections: () => Collection[]
121
- /** asks dir (repo-root-relative) for the act-in-place ask verbs */
122
- asksDir: string
123
122
  /** where a value pasted under a credential ask goes; absent = the repo's
124
- * `credsCommand`, as `sk secret set` runs it */
123
+ * house store, as `sk secret set` makes it */
125
124
  storeSecret?: SecretStore
126
125
  /** the store's read of a credential ask's names (collections/providers.ts heldOfAsks), a test passes its own */
127
126
  secretHeld?: HeldOf
127
+ /** who calls over the tailnet (serve/tailnet-caller.ts); absent = this Mac's tailscale, a test passes its own */
128
+ tailnet?: TailnetWho
128
129
  /** the comfy panel; null when the repo declares no workflow module, which
129
130
  * is also when the comfy section is absent from the page */
130
131
  comfy: ComfyDeps | null
@@ -294,26 +295,30 @@ export function hubHandler(d: HubDeps, o: { base?: string; projects?: Gutter } =
294
295
  return Response.json({ collections: out })
295
296
  }
296
297
  if (path.startsWith('/api/act/') && req.method === 'POST') {
297
- // act-in-place verbs — every mutation hits a git-tracked truth
298
- // file; errors surface as 400 text the card shows verbatim
298
+ // act-in-place verbs: an ask's act lands in its thread, an asset note in its file; errors surface as
299
+ // 400 text the card shows verbatim. An ask is named by its id (`ask`), or by `file` from an older page.
300
+ // A secret value has no verb here: it goes to its thread's secret route alone (review/secret-route.ts)
299
301
  // a parse error quotes the body, which can carry a pasted secret
300
302
  const b = (await req.json().catch(() => null)) as Record<string, string> | null
301
303
  if (b == null || typeof b !== 'object') return new Response('the body is not a json object', { status: 400 })
304
+ const ask = b.ask ?? b.file ?? ''
302
305
  try {
303
- if (path === '/api/act/ask-secret') {
304
- const value = typeof b.value === 'string' ? b.value : ''
305
- const account = typeof b.account === 'string' ? b.account : undefined
306
- return Response.json(await askSecret({ root: d.root, asksDir: d.asksDir, file: b.file ?? '', name: b.name ?? '', value, account, store: d.storeSecret ?? managerStore(d.root), held: d.secretHeld }))
306
+ if (path === '/api/act/ask-done') askDone(d.root, ask)
307
+ else if (path === '/api/act/ask-decline') askDecline(d.root, ask, typeof b.why === 'string' ? b.why : undefined)
308
+ else if (path === '/api/act/ask-proof') askProof(d.root, ask, b.url ?? '')
309
+ else if (path === '/api/act/reflection') {
310
+ // his action on a reflection object from its index: it lands in the thread that refers to it
311
+ const file = b.file ?? ''
312
+ if (!/^[^/\\]+\.md$/.test(file) || file.startsWith('.')) return new Response(`file: « ${file} » is no file of .shipkit/reflections/`, { status: 400 })
313
+ const { actOnReflection } = await import('../review/reflection-object.ts')
314
+ const r = await actOnReflection(d.root, d.name, file, { name: b.name ?? '', ...(typeof b.text === 'string' ? { text: b.text } : {}) })
315
+ return Response.json({ thread: r.thread, opened: r.opened })
307
316
  }
308
- if (path === '/api/act/ask-done') askDone(d.root, d.asksDir, b.file ?? '')
309
- else if (path === '/api/act/ask-decline') askDecline(d.root, d.asksDir, b.file ?? '', typeof b.why === 'string' ? b.why : undefined)
310
- else if (path === '/api/act/ask-proof') askProof(d.root, d.asksDir, b.file ?? '', b.url ?? '')
311
317
  else if (path === '/api/act/remark') {
312
- // ONE remark verb, routed by collection: a remark
313
- // lands in the item's own truth file
318
+ // ONE remark verb, routed by collection: an ask's in its thread, an asset's in its notes file
314
319
  const text = (b.text ?? '').trim()
315
320
  if (text === '') return new Response('empty remark', { status: 400 })
316
- if (b.kind === 'ask') appendAskRemark(d.root, d.asksDir, b.file ?? '', text)
321
+ if (b.kind === 'ask') askRemark(d.root, ask, text)
317
322
  else if (b.kind === 'media') appendAssetNote(d.root, b.id ?? '', text)
318
323
  else return new Response('unknown remark kind', { status: 400 })
319
324
  }
@@ -380,7 +385,7 @@ export function hubHandler(d: HubDeps, o: { base?: string; projects?: Gutter } =
380
385
  const embed = await embedRoute(path)
381
386
  if (embed != null) return embed
382
387
  // the one feedback store and the trailer view (review/routes.ts)
383
- const review = await reviewRoutes(d.root, req, path)
388
+ const review = await reviewRoutes(d.root, req, path, { ...(d.storeSecret ? { storeSecret: d.storeSecret } : {}), ...(d.secretHeld ? { secretHeld: d.secretHeld } : {}), ...(d.tailnet ? { tailnet: d.tailnet } : {}) })
384
389
  if (review != null) return review
385
390
  // the Veille of the identity this repo speaks as (veille/routes.ts)
386
391
  const veille = await veilleRoutes(d.root, req, path)
@@ -398,7 +403,7 @@ export function hubHandler(d: HubDeps, o: { base?: string; projects?: Gutter } =
398
403
  const messages = await messagesRoutes(d.root, req, path)
399
404
  if (messages != null) return messages
400
405
  // the Communications and Social desks (social/routes.ts)
401
- const social = await socialRoutes(d.root, req, path)
406
+ const social = await socialRoutes(d.root, req, path, d.tailnet ? { who: d.tailnet } : {})
402
407
  if (social != null) return social
403
408
  if (path === '/api/status.json') {
404
409
  const p = join(d.root, LAYOUT.status)
@@ -467,6 +472,10 @@ export function hubHandler(d: HubDeps, o: { base?: string; projects?: Gutter } =
467
472
  if (path === `/graph/${g.id}/positions`) return routes.save(req)
468
473
  // the wikis page's search bar and its preview panel: only a node of the graph is read
469
474
  if (path === `/graph/${g.id}/search`) return g.dir == null ? new Response('this wiki names no folder to read', { status: 404 }) : Response.json(searchWiki(held, g.dir, new URL(req.url).searchParams.get('q') ?? ''))
475
+ if (path === `/graph/${g.id}/image`) {
476
+ const img = g.dir == null ? null : imageOf(g.dir, new URL(req.url).searchParams.get('path') ?? '')
477
+ return img == null ? new Response('not a picture of this wiki', { status: 404 }) : new Response(Bun.file(img.file), { headers: { 'content-type': img.type, 'cache-control': 'no-cache' } })
478
+ }
470
479
  if (path === `/graph/${g.id}/page`) {
471
480
  const p = g.dir == null ? null : pageOf(held, g.dir, new URL(req.url).searchParams.get('node') ?? '')
472
481
  return p == null ? new Response('not a page of this wiki', { status: 404 }) : Response.json(p)