rvlib-shipkit 2.12.0 → 2.14.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 (378) hide show
  1. package/CHANGELOG.md +75 -21
  2. package/README.md +1 -1
  3. package/package.json +4 -2
  4. package/src/agent-time/store.ts +2 -2
  5. package/src/assets/run-assets.ts +2 -2
  6. package/src/assets/server/studio-server.ts +27 -23
  7. package/src/check.ts +4 -4
  8. package/src/checks/SK001-package-json-shape.check.ts +8 -4
  9. package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
  10. package/src/checks/SK003-claude-md-shape.check.ts +20 -13
  11. package/src/checks/SK004-gitignore-policy.check.ts +45 -6
  12. package/src/checks/SK005-rvlib-versions.check.ts +2 -2
  13. package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
  14. package/src/checks/SK007-github-visibility.check.ts +2 -2
  15. package/src/checks/SK008-reviewer-agent.check.ts +3 -3
  16. package/src/checks/SK010-undeclared-unit.check.ts +2 -2
  17. package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
  18. package/src/checks/SK012-config-barrel-import.check.ts +2 -2
  19. package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
  20. package/src/checks/SK015-nested-repo.check.ts +3 -3
  21. package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
  22. package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
  23. package/src/checks/SK018-test-files-run.check.ts +2 -2
  24. package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
  25. package/src/checks/SK020-self-spawning-check.check.ts +2 -2
  26. package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
  27. package/src/checks/SK024-identity-colors.check.ts +1 -1
  28. package/src/checks/SK025-release-drift.check.ts +2 -2
  29. package/src/checks/SK026-asks-autoclose.check.ts +2 -2
  30. package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
  31. package/src/checks/SK028-readme.check.ts +2 -2
  32. package/src/checks/SK029-explicit-check-files.check.ts +3 -3
  33. package/src/checks/SK030-cache-audit.check.ts +7 -5
  34. package/src/checks/SK031-trace-audit.check.ts +7 -7
  35. package/src/checks/SK032-ignored-inputs.check.ts +3 -3
  36. package/src/checks/SK033-global-contribution.check.ts +11 -4
  37. package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
  38. package/src/checks/SK035-public-clean.check.ts +46 -0
  39. package/src/checks/SK036-draft-media-size.check.ts +28 -0
  40. package/src/checks/SK037-keyword-additions.check.ts +43 -0
  41. package/src/cli/cmd_Backup.ts +152 -0
  42. package/src/cli/cmd_Ci.ts +8 -11
  43. package/src/cli/cmd_Commands.ts +4 -4
  44. package/src/cli/cmd_ConfigKeys.ts +2 -2
  45. package/src/cli/cmd_Drill.ts +145 -0
  46. package/src/cli/cmd_Home.ts +50 -3
  47. package/src/cli/cmd_Init.ts +1 -1
  48. package/src/cli/cmd_Media.ts +10 -8
  49. package/src/cli/cmd_Mv.ts +14 -7
  50. package/src/cli/cmd_Review.ts +6 -4
  51. package/src/cli/cmd_Shot.ts +5 -2
  52. package/src/cli/cmd_Smoke.ts +5 -2
  53. package/src/cli/cmd_Social.ts +226 -0
  54. package/src/cli/cmd_Sound.ts +1 -1
  55. package/src/cli/cmd_Start.ts +1 -1
  56. package/src/cli/cmd_Time.ts +1 -1
  57. package/src/cli/cmd_TraceAudit.ts +6 -6
  58. package/src/cli/cmd_Trailer.ts +7 -4
  59. package/src/cli/cmd_Veille.ts +173 -0
  60. package/src/cli/cmd_When.ts +2 -2
  61. package/src/cli/family-pages.ts +19 -16
  62. package/src/cli/registry.ts +13 -2
  63. package/src/cli.ts +5 -2
  64. package/src/collections/actions.ts +1 -49
  65. package/src/collections/checks.ts +2 -1
  66. package/src/collections/collection-types.ts +12 -3
  67. package/src/collections/providers.ts +4 -4
  68. package/src/collections/review.ts +3 -2
  69. package/src/collections/tests.ts +19 -8
  70. package/src/comfy/comfy-panel.ts +2 -2
  71. package/src/contracts/apply-contracts.ts +1 -3
  72. package/src/contracts/contract-manifests.ts +2 -3
  73. package/src/contracts/contract-types.ts +0 -1
  74. package/src/contracts/contracts-engine.ts +0 -3
  75. package/src/contracts/manifests/discord.contract.ts +1 -1
  76. package/src/contracts/manifests/identity.contract.ts +1 -1
  77. package/src/contracts/manifests/itch.contract.ts +1 -1
  78. package/src/contracts/manifests/steam.contract.ts +1 -1
  79. package/src/core/agent-dir-at.ts +12 -0
  80. package/src/core/agent-dir.ts +16 -0
  81. package/src/core/app-icon.ts +9 -3
  82. package/src/core/budget.ts +1 -1
  83. package/src/core/bun-builtins.ts +2 -2
  84. package/src/core/canonical-scripts.ts +2 -2
  85. package/src/core/discover-checks.ts +38 -6
  86. package/src/core/fix-scope.ts +4 -2
  87. package/src/core/floor-resolve.ts +68 -48
  88. package/src/core/floor.ts +9 -0
  89. package/src/core/git-root.ts +24 -0
  90. package/src/core/global-contribution.ts +4 -1
  91. package/src/core/ignored-block.ts +1 -1
  92. package/src/core/ignored-inputs.ts +3 -2
  93. package/src/core/last-good.ts +3 -1
  94. package/src/core/layout.ts +8 -0
  95. package/src/core/log-stamp.ts +36 -0
  96. package/src/core/loop-watch.ts +93 -0
  97. package/src/core/machine-link.ts +134 -0
  98. package/src/core/memory-watch.ts +41 -0
  99. package/src/core/motherhome.ts +2 -2
  100. package/src/core/one-way-in-policy.ts +34 -26
  101. package/src/core/run-ci.ts +9 -11
  102. package/src/core/run-fixers.ts +9 -9
  103. package/src/core/runs-matrix.ts +1 -1
  104. package/src/core/slots.ts +30 -0
  105. package/src/core/trace-audit.ts +50 -9
  106. package/src/core/tree-rev.ts +60 -0
  107. package/src/core/unit-files.ts +42 -0
  108. package/src/drill/render.ts +140 -0
  109. package/src/drill/run.ts +269 -0
  110. package/src/fleet/scan-fleet.ts +6 -5
  111. package/src/home/daemon-jobs.ts +201 -0
  112. package/src/home/global-context.ts +44 -8
  113. package/src/home/gui-app/ShipkitGui.swift +91 -2
  114. package/src/home/home-routes.ts +22 -15
  115. package/src/home/hubs.ts +10 -3
  116. package/src/home/inbox-shape.ts +54 -5
  117. package/src/home/inbox.ts +17 -2
  118. package/src/home/lib-watch.ts +10 -3
  119. package/src/home/machine-stores.ts +15 -29
  120. package/src/home/pm-config.ts +4 -1
  121. package/src/home/pm-inputs.ts +2 -0
  122. package/src/home/resources.ts +7 -2
  123. package/src/home/run-daemon.ts +15 -18
  124. package/src/home/run-pm.ts +3 -1
  125. package/src/home/serve-daemon.ts +4 -3
  126. package/src/home/serve-web.ts +104 -1
  127. package/src/hooks/commit-message.ts +29 -20
  128. package/src/hooks/hook-gates.ts +1 -1
  129. package/src/hooks/leak-guard.ts +69 -9
  130. package/src/hooks/run-hooks.ts +18 -22
  131. package/src/identities/identities.ts +334 -0
  132. package/src/identities/machine-route.ts +126 -0
  133. package/src/identities/machine.ts +62 -0
  134. package/src/init-repo.ts +3 -3
  135. package/src/ledger/check-stats.ts +10 -9
  136. package/src/ledger/gate-checks.ts +32 -1
  137. package/src/ledger/record-kept.ts +112 -0
  138. package/src/ledger/repo-view.ts +10 -0
  139. package/src/ledger/run-log.ts +17 -12
  140. package/src/ledger/run-timeline.ts +8 -4
  141. package/src/ledger/store.ts +7 -0
  142. package/src/ledger/suite-log.ts +17 -13
  143. package/src/media-kinds.ts +3 -2
  144. package/src/media-store/backup/daemon.ts +73 -0
  145. package/src/media-store/backup/keys.ts +25 -0
  146. package/src/media-store/backup/manifest.ts +193 -0
  147. package/src/media-store/backup/restore.ts +192 -0
  148. package/src/media-store/backup/run.ts +278 -0
  149. package/src/media-store/backup/secret.ts +86 -0
  150. package/src/media-store/backup/snapshot.ts +64 -0
  151. package/src/media-store/backup/sources.ts +199 -0
  152. package/src/media-store/content.ts +1 -1
  153. package/src/media-store/daemon.ts +56 -70
  154. package/src/media-store/db.ts +1 -1
  155. package/src/media-store/fact.ts +1 -1
  156. package/src/media-store/hand.ts +1 -1
  157. package/src/media-store/kind.ts +1 -1
  158. package/src/media-store/purge.ts +1 -1
  159. package/src/media-store/put.ts +5 -3
  160. package/src/media-store/remote.ts +1 -1
  161. package/src/media-store/space.ts +24 -5
  162. package/src/mv/mv-md.ts +63 -22
  163. package/src/pages/forward.ts +35 -0
  164. package/src/pages/frame-client.ts +118 -0
  165. package/src/pages/routes.ts +29 -0
  166. package/src/pages/unit.ts +92 -0
  167. package/src/plan/planner.ts +12 -0
  168. package/src/plan/repo-source.ts +19 -5
  169. package/src/reflect/transcript.ts +35 -10
  170. package/src/release/public-clean.ts +319 -0
  171. package/src/release/published-here.ts +22 -0
  172. package/src/release/run-bump.ts +3 -2
  173. package/src/release/run-release.ts +7 -4
  174. package/src/repo-config.ts +71 -13
  175. package/src/review/anim.ts +1 -1
  176. package/src/review/auto.ts +1 -1
  177. package/src/review/cells.ts +15 -1
  178. package/src/review/format.ts +2 -2
  179. package/src/review/http.ts +16 -2
  180. package/src/review/marks.ts +1 -1
  181. package/src/review/media-kind.ts +1 -1
  182. package/src/review/media-read.ts +1 -1
  183. package/src/review/model.ts +27 -6
  184. package/src/review/notes.ts +125 -0
  185. package/src/review/previews.ts +1 -1
  186. package/src/review/project.ts +7 -39
  187. package/src/review/role.ts +1 -1
  188. package/src/review/routes.ts +18 -14
  189. package/src/review/store.ts +42 -2
  190. package/src/review/threads.ts +1 -1
  191. package/src/review/trailer-desk.ts +3 -3
  192. package/src/review/trailer-media.ts +8 -5
  193. package/src/review/trailer-model.ts +1 -1
  194. package/src/review/trailer-routes.ts +1 -1
  195. package/src/review/trailer-shots.ts +22 -5
  196. package/src/review/unit.ts +2 -2
  197. package/src/scaffold/files/agent-handoff.md +3 -0
  198. package/src/scaffold/files/agent-index.md +4 -12
  199. package/src/scaffold/files/tsconfig.json +1 -1
  200. package/src/scaffold/project-scaffold.ts +6 -5
  201. package/src/serve/embed.ts +2 -2
  202. package/src/serve/hub-app/check-words.ts +1 -1
  203. package/src/serve/hub-app/col-card.tsx +3 -17
  204. package/src/serve/hub-app/col-tables-view.tsx +2 -1
  205. package/src/serve/hub-app/cols-svc.ts +0 -13
  206. package/src/serve/hub-app/dock-st.ts +4 -2
  207. package/src/serve/hub-app/dock-view.tsx +2 -0
  208. package/src/serve/hub-app/frames-st.ts +35 -0
  209. package/src/serve/hub-app/hash-route.ts +64 -1
  210. package/src/serve/hub-app/home-st.ts +32 -8
  211. package/src/serve/hub-app/home-strip.css +9 -1
  212. package/src/serve/hub-app/home-strip.tsx +7 -6
  213. package/src/serve/hub-app/home.html +5 -0
  214. package/src/serve/hub-app/hub-app.tsx +51 -7
  215. package/src/serve/hub-app/hub.css +29 -11
  216. package/src/serve/hub-app/icons.tsx +16 -1
  217. package/src/serve/hub-app/identities-st.ts +210 -0
  218. package/src/serve/hub-app/identities-view.tsx +353 -0
  219. package/src/serve/hub-app/identities.css +48 -0
  220. package/src/serve/hub-app/identity-address.ts +52 -0
  221. package/src/serve/hub-app/inbox-st.ts +60 -7
  222. package/src/serve/hub-app/inbox-view.tsx +49 -7
  223. package/src/serve/hub-app/inbox.css +12 -1
  224. package/src/serve/hub-app/index.html +3 -0
  225. package/src/serve/hub-app/kept-cols.tsx +30 -0
  226. package/src/serve/hub-app/keys.ts +10 -2
  227. package/src/serve/hub-app/list-walk.ts +89 -0
  228. package/src/serve/hub-app/machine-st.ts +12 -0
  229. package/src/serve/hub-app/media-svc.ts +1 -1
  230. package/src/serve/hub-app/media-view.tsx +2 -1
  231. package/src/serve/hub-app/pages-frames.tsx +134 -0
  232. package/src/serve/hub-app/pages-svc.ts +111 -0
  233. package/src/serve/hub-app/palette-st.ts +18 -3
  234. package/src/serve/hub-app/palette-view.tsx +9 -2
  235. package/src/serve/hub-app/planned-view.tsx +2 -1
  236. package/src/serve/hub-app/project-list.css +18 -14
  237. package/src/serve/hub-app/project-list.tsx +88 -49
  238. package/src/serve/hub-app/projects-svc.ts +33 -3
  239. package/src/serve/hub-app/repo-sections.ts +19 -2
  240. package/src/serve/hub-app/repo-st.ts +76 -20
  241. package/src/serve/hub-app/review/review-board.tsx +1 -1
  242. package/src/serve/hub-app/review/review-cells.tsx +6 -5
  243. package/src/serve/hub-app/review/review-kit.ts +30 -7
  244. package/src/serve/hub-app/review/review-page.tsx +6 -5
  245. package/src/serve/hub-app/review/review-st.ts +34 -15
  246. package/src/serve/hub-app/review/review-thread.tsx +63 -14
  247. package/src/serve/hub-app/review/review-views.tsx +133 -51
  248. package/src/serve/hub-app/review/thread-st.ts +80 -37
  249. package/src/serve/hub-app/review/trailer-page.tsx +7 -5
  250. package/src/serve/hub-app/review/trailer-st.ts +1 -1
  251. package/src/serve/hub-app/review.css +26 -9
  252. package/src/serve/hub-app/site/site-part.tsx +173 -0
  253. package/src/serve/hub-app/site/site-st.ts +157 -0
  254. package/src/serve/hub-app/site.css +35 -0
  255. package/src/serve/hub-app/social/calendar.tsx +182 -0
  256. package/src/serve/hub-app/social/comms-page.tsx +330 -0
  257. package/src/serve/hub-app/social/kit.tsx +244 -0
  258. package/src/serve/hub-app/social/post-card.tsx +456 -0
  259. package/src/serve/hub-app/social/problems.tsx +60 -0
  260. package/src/serve/hub-app/social/social-model.ts +154 -0
  261. package/src/serve/hub-app/social/social-page.tsx +681 -0
  262. package/src/serve/hub-app/social/social-st.ts +1014 -0
  263. package/src/serve/hub-app/social.css +289 -0
  264. package/src/serve/hub-app/stores/stores-page.tsx +312 -0
  265. package/src/serve/hub-app/stores/stores-st.ts +286 -0
  266. package/src/serve/hub-app/stores.css +54 -0
  267. package/src/serve/hub-app/timeline-geometry.ts +1 -1
  268. package/src/serve/hub-app/timeline-view.tsx +3 -2
  269. package/src/serve/hub-app/tree-build.ts +6 -0
  270. package/src/serve/hub-app/tree-row.tsx +27 -4
  271. package/src/serve/hub-app/tree-svc.ts +18 -49
  272. package/src/serve/hub-app/veille/veille-page.tsx +515 -0
  273. package/src/serve/hub-app/veille/veille-st.ts +443 -0
  274. package/src/serve/hub-app/veille.css +84 -0
  275. package/src/serve/hub-runtime.ts +20 -11
  276. package/src/serve/project-gutter-route.ts +44 -12
  277. package/src/serve/run-lanes.ts +7 -4
  278. package/src/serve/same-origin.ts +1 -1
  279. package/src/serve/serve-hub.ts +20 -12
  280. package/src/serve/tracked-watch.ts +24 -3
  281. package/src/serve/warm-cell.ts +5 -1
  282. package/src/shipkit-files.ts +15 -4
  283. package/src/shipkit.ts +0 -1
  284. package/src/shot/box.ts +160 -0
  285. package/src/shot/browser-slot.ts +74 -0
  286. package/src/shot/client.ts +42 -7
  287. package/src/shot/clip-encoder.ts +108 -24
  288. package/src/shot/film-box.ts +292 -0
  289. package/src/shot/shooter.ts +71 -17
  290. package/src/shot/shot-ask.ts +10 -2
  291. package/src/shot/stepped-clip.ts +5 -4
  292. package/src/site/desk.ts +242 -0
  293. package/src/site/routes.ts +66 -0
  294. package/src/site/unit.ts +62 -0
  295. package/src/social/brands.ts +22 -0
  296. package/src/social/card-drafts.ts +24 -0
  297. package/src/social/compose.ts +97 -0
  298. package/src/social/desk-index.ts +123 -0
  299. package/src/social/desk-wire.ts +64 -0
  300. package/src/social/drafts.ts +183 -0
  301. package/src/social/house.ts +24 -0
  302. package/src/social/load.ts +332 -0
  303. package/src/social/md.ts +70 -0
  304. package/src/social/media-facts.ts +53 -0
  305. package/src/social/media-kind.ts +189 -0
  306. package/src/social/media-limit.ts +42 -0
  307. package/src/social/media-of.ts +30 -0
  308. package/src/social/migrate.ts +123 -0
  309. package/src/social/open.ts +17 -0
  310. package/src/social/post-url.ts +158 -0
  311. package/src/social/presence.ts +332 -0
  312. package/src/social/public-read.ts +53 -0
  313. package/src/social/publish/bluesky.ts +168 -0
  314. package/src/social/publish/discord.ts +76 -0
  315. package/src/social/publish/index.ts +24 -0
  316. package/src/social/publish/secret.ts +13 -0
  317. package/src/social/push.ts +37 -0
  318. package/src/social/richtext.ts +37 -0
  319. package/src/social/routes.ts +186 -0
  320. package/src/social/stats.ts +134 -0
  321. package/src/social/text.ts +267 -0
  322. package/src/social/tracker-route.ts +39 -0
  323. package/src/social/tracker.ts +255 -0
  324. package/src/social/unit.ts +53 -0
  325. package/src/social/writes.ts +130 -0
  326. package/src/start-repo.ts +14 -9
  327. package/src/stores/collection.ts +27 -0
  328. package/src/stores/desk.ts +336 -0
  329. package/src/stores/model.ts +187 -0
  330. package/src/stores/routes.ts +126 -0
  331. package/src/stores/unit.ts +57 -0
  332. package/src/suite/calibrate.ts +127 -0
  333. package/src/suite/core-counters.ts +91 -0
  334. package/src/suite/judge-suites.ts +95 -35
  335. package/src/suite/suite-cli.ts +44 -10
  336. package/src/suite/suite-cpu-preload.ts +34 -9
  337. package/src/trace/tracer.ts +12 -5
  338. package/src/trailer/adapter.ts +5 -1
  339. package/src/trailer/build.ts +45 -12
  340. package/src/trailer/ffmpeg.ts +11 -0
  341. package/src/trailer/footage.ts +30 -13
  342. package/src/trailer/grammar.ts +18 -2
  343. package/src/trailer/graph.ts +28 -6
  344. package/src/trailer/holes.ts +1 -1
  345. package/src/trailer/passage.ts +18 -6
  346. package/src/trailer/plan.ts +74 -3
  347. package/src/trailer/prune.ts +1 -1
  348. package/src/trailer/states.ts +1 -1
  349. package/src/trailer/stitch.ts +67 -26
  350. package/src/trailer/url.ts +1 -1
  351. package/src/trailer/versions.ts +24 -0
  352. package/src/trailer/words.ts +1 -1
  353. package/src/ts/gate-typecheck.ts +32 -0
  354. package/src/ts/typecheck-cli.ts +9 -11
  355. package/src/tui/run-tui.ts +1 -1
  356. package/src/tui/tui-app.tsx +0 -1
  357. package/src/tui/tui-store.ts +1 -1
  358. package/src/veille/asks.ts +155 -0
  359. package/src/veille/auto.ts +31 -0
  360. package/src/veille/batch.ts +27 -0
  361. package/src/veille/chrome.ts +127 -0
  362. package/src/veille/collection.ts +28 -0
  363. package/src/veille/desk.ts +242 -0
  364. package/src/veille/identity.ts +80 -0
  365. package/src/veille/import.ts +68 -0
  366. package/src/veille/log.ts +183 -0
  367. package/src/veille/platforms.ts +118 -0
  368. package/src/veille/reads.ts +66 -0
  369. package/src/veille/replied.ts +110 -0
  370. package/src/veille/routes.ts +185 -0
  371. package/src/veille/service.ts +81 -0
  372. package/src/veille/watch.ts +116 -0
  373. package/src/veille/worth.ts +46 -0
  374. package/src/wiki/scan-md.ts +18 -0
  375. package/src/collections/posts.ts +0 -142
  376. package/src/contracts/manifests/social.contract.ts +0 -20
  377. package/src/scaffold/files/agent-coding.md +0 -35
  378. package/src/ts/typecheck-cache.ts +0 -11
@@ -0,0 +1,173 @@
1
+ // sk veille: an identity's Veille for agents (veille/, wiki tools/shipkit/veille.md, For agents: never the raw log): the
2
+ // feed as compact lines, one reply's brief or its draft, a pass with its reason, an older log brought in. Every module
3
+ // loads inside execute: the cli registers this file on every `sk` call
4
+ import { Command, Option } from 'clipanion'
5
+
6
+ type Ctx = { stdout: NodeJS.WritableStream; stderr: NodeJS.WritableStream }
7
+ type Identity = import('../veille/identity.ts').VeilleIdentity
8
+
9
+ interface Here {
10
+ out: (l: string) => void
11
+ identity: Identity
12
+ /** the repo the command runs in, null outside one */
13
+ root: string | null
14
+ asksDir: string | null
15
+ }
16
+
17
+ /** the identity named, else the one the current repo's Veille is */
18
+ async function run(context: Ctx, as: string | undefined, body: (h: Here) => Promise<number>): Promise<number> {
19
+ const out = (l: string): void => void context.stdout.write(`${l}\n`)
20
+ try {
21
+ const { identityOf, hasVeille } = await import('../veille/identity.ts')
22
+ const { veilleAt } = await import('../veille/routes.ts')
23
+ const { storeDir } = await import('../review/store.ts')
24
+ const { findRepoRoot } = await import('../ts/config.ts')
25
+ let root: string | null = null
26
+ try {
27
+ root = findRepoRoot(process.cwd())
28
+ } catch {
29
+ root = null
30
+ }
31
+ const here = root == null ? null : veilleAt(root)
32
+ const identity = as === undefined ? here?.identity : identityOf(as)
33
+ if (identity == null) throw new Error(as === undefined ? 'this repo shows no Veille: name the identity with --as <id>' : `no identity ${as}`)
34
+ if (!hasVeille(identity)) throw new Error(`${identity.id} has no watch list (${identity.watchFile})`)
35
+ const asksDir = here != null && here.identity.id === identity.id ? storeDir(here.asks.root) : null
36
+ return await body({ out, identity, root, asksDir })
37
+ } catch (e) {
38
+ context.stderr.write(`FAIL: veille: ${e instanceof Error ? e.message : String(e)}\n`)
39
+ return 1
40
+ }
41
+ }
42
+
43
+ const asOpt = (): string | undefined => Option.String('--as', { description: "the identity, by id (default: the one this repo's Veille is)" })
44
+
45
+ export class VeilleFeedCommand extends Command {
46
+ static override paths = [['veille', 'feed']]
47
+ static override usage = Command.Usage({
48
+ category: 'Veille',
49
+ description: 'the posts an identity scrolled past, ranked by the worth of a reply: one compact line each',
50
+ details:
51
+ "From the identity's log in shipkit's home: platform, author, their followers, age, likes, reposts, replies, views, the worth of a reply (w0 to w100), the subreddit, about 100 characters of text, its key. Only the active posts (worth at or over the rule maybe, not handled) unless --all; a platform switched off is left out unless --platform names it. Page: wiki tools/shipkit/veille.md",
52
+ examples: [
53
+ ['the best twenty of the last day', 'sk veille feed'],
54
+ ['X only, the last three days', 'sk veille feed --platform x --since 3d'],
55
+ ],
56
+ })
57
+ as = asOpt()
58
+ platform = Option.String('--platform', { description: 'one platform: x, threads, bluesky, mastodon, instagram, tiktok, reddit' })
59
+ top = Option.String('--top', '20', { description: 'how many lines' })
60
+ since = Option.String('--since', '24h', { description: 'the window: 90m, 24h, 3d, 7d' })
61
+ all = Option.Boolean('--all', false, { description: 'the expired and handled posts too' })
62
+ async execute(): Promise<number> {
63
+ return run(this.context, this.as, async (h) => {
64
+ const { feedLine } = await import('../veille/desk.ts')
65
+ const { isPlatform } = await import('../veille/platforms.ts')
66
+ const { interactions } = await import('../veille/asks.ts')
67
+ const { oursOf, veilleOf } = await import('../veille/service.ts')
68
+ const m = /^(\d+)\s*([mhd])$/.exec(this.since.trim())
69
+ if (m == null) throw new Error(`--since ${this.since}? like 90m, 24h or 3d`)
70
+ if (this.platform !== undefined && !isPlatform(this.platform)) throw new Error(`--platform ${this.platform}?`)
71
+ const { desk } = veilleOf(h.identity)
72
+ const off = this.platform === undefined ? desk.off() : []
73
+ const rows = desk
74
+ .feed({ ...(this.platform && isPlatform(this.platform) ? { platform: this.platform } : {}), sinceMs: Number(m[1]) * { m: 60_000, h: 3600_000, d: 86_400_000 }[m[2] as 'm' | 'h' | 'd'], all: this.all, ours: oursOf(h.identity), ...(h.asksDir ? { asks: interactions(h.asksDir).posts } : {}) })
75
+ .filter((r) => !off.includes(r.platform))
76
+ .slice(0, Number(this.top))
77
+ if (rows.length === 0) h.out(`no post in that window: the extension sends what ${h.identity.id}'s Chrome profile scrolls past`)
78
+ for (const r of rows) h.out(feedLine(r))
79
+ return 0
80
+ })
81
+ }
82
+ }
83
+
84
+ export class VeilleReplyCommand extends Command {
85
+ static override paths = [['veille', 'reply']]
86
+ static override usage = Command.Usage({
87
+ category: 'Veille',
88
+ description: "a reply to one post of the Veille: its brief, or with --text the draft the hub's page shows",
89
+ details: "The brief holds everything one reply needs: the post, the identity's voice pages, the media the project's drafts could lend. With --text: the draft written, shown at once on the Veille page, where he posts it himself.",
90
+ examples: [
91
+ ['the brief for one', 'sk veille reply x:1849000000000000001'],
92
+ ['the draft', 'sk veille reply x:1849000000000000001 --text "Love the silhouettes!"'],
93
+ ],
94
+ })
95
+ key = Option.String({ name: 'key' })
96
+ as = asOpt()
97
+ text = Option.String('--text', { description: 'the reply' })
98
+ media = Option.String('--media', { description: 'a media file of the drafts it lends, repo relative' })
99
+ async execute(): Promise<number> {
100
+ return run(this.context, this.as, async (h) => {
101
+ const { brief, mediaFor } = await import('../veille/desk.ts')
102
+ const { draftMedia } = await import('../social/media-of.ts')
103
+ const { oursOf, veilleOf } = await import('../veille/service.ts')
104
+ const { desk } = veilleOf(h.identity)
105
+ const row = desk.feed({ all: true, ours: oursOf(h.identity) }).find((r) => r.key === this.key)
106
+ if (row == null) throw new Error(`no post ${this.key} in the log: sk veille feed gives the keys`)
107
+ if (this.text === undefined) {
108
+ h.out(brief(row, h.root == null ? [] : mediaFor(row.text, draftMedia(h.root), h.root), { as: h.identity.id, pages: desk.watch().voice }))
109
+ return 0
110
+ }
111
+ desk.writeReply(row.key, { text: this.text, media: this.media ?? null, at: Date.now(), by: 'agent' })
112
+ h.out(`ok: the draft of ${row.key}, on the Veille page of ${h.identity.id}`)
113
+ return 0
114
+ })
115
+ }
116
+ }
117
+
118
+ export class VeillePassCommand extends Command {
119
+ static override paths = [['veille', 'pass']]
120
+ static override usage = Command.Usage({
121
+ category: 'Veille',
122
+ description: 'a post of the Veille not worth a reply: passed with its one line reason',
123
+ details: 'The post leaves the active groups for « vus ou expirés », its reason on its row (the identity\'s voice pages say when to pass).',
124
+ examples: [['pass one', 'sk veille pass x:1849000000000000001 --why "nothing specific to add"']],
125
+ })
126
+ key = Option.String({ name: 'key' })
127
+ as = asOpt()
128
+ why = Option.String('--why', { required: true, description: 'the real reason, one line' })
129
+ async execute(): Promise<number> {
130
+ return run(this.context, this.as, async (h) => {
131
+ const { oursOf, veilleOf } = await import('../veille/service.ts')
132
+ const { desk } = veilleOf(h.identity)
133
+ if (desk.feed({ all: true, ours: oursOf(h.identity) }).every((r) => r.key !== this.key)) throw new Error(`no post ${this.key} in the log: sk veille feed gives the keys`)
134
+ if (this.why.trim() === '') throw new Error('--why is empty')
135
+ desk.pass(this.key, this.why.trim())
136
+ h.out(`ok: ${this.key} passed`)
137
+ return 0
138
+ })
139
+ }
140
+ }
141
+
142
+ export class VeilleImportCommand extends Command {
143
+ static override paths = [['veille', 'import']]
144
+ static override usage = Command.Usage({
145
+ category: 'Veille',
146
+ description: "an older Veille log brought into an identity's: every day and mark kept, the posts counted",
147
+ details: "Merges a log folder (a repo's .shipkit/veille/) into the identity's in shipkit's home: each day's lines in the order they were seen, the marks (handled, passed, replied), the authors, the platforms off, the reply drafts. Prints the posts before and after, and fails when a post of either side is missing. The source is left as it is.",
148
+ examples: [['an older log', 'sk veille import ~/dev/my-game/.shipkit/veille --as studio']],
149
+ })
150
+ from = Option.String({ name: 'dir' })
151
+ as = Option.String('--as', { required: true, description: 'the identity, by id' })
152
+ async execute(): Promise<number> {
153
+ const out = (l: string): void => void this.context.stdout.write(`${l}\n`)
154
+ try {
155
+ const { identityOf } = await import('../veille/identity.ts')
156
+ const { importLog } = await import('../veille/import.ts')
157
+ const x = identityOf(this.as)
158
+ if (x == null) throw new Error(`no identity ${this.as}`)
159
+ const r = importLog(this.from, x.logDir)
160
+ out(`${this.from}: ${r.source} posts in ${r.days} days`)
161
+ out(`${x.logDir}: ${r.targetBefore} posts before, ${r.targetAfter} after`)
162
+ out(`marks ${Object.entries(r.marks).map(([k, n]) => `${k.replace('.json', '')} ${n}`).join(', ')}, reply drafts ${r.replies}`)
163
+ if (r.missing.length > 0) throw new Error(`${r.missing.length} posts missing after the import: ${r.missing.slice(0, 5).join(', ')}`)
164
+ out(`ok: every post of both logs is in ${x.id}'s`)
165
+ return 0
166
+ } catch (e) {
167
+ this.context.stderr.write(`FAIL: veille import: ${e instanceof Error ? e.message : String(e)}\n`)
168
+ return 1
169
+ }
170
+ }
171
+ }
172
+
173
+ export const VEILLE_COMMANDS = [VeilleFeedCommand, VeilleReplyCommand, VeillePassCommand, VeilleImportCommand]
@@ -23,8 +23,8 @@ export class WhenCommand extends Command {
23
23
  ['only what the quick gate runs', 'sk when --only onCi'],
24
24
  ['the matrix without the legend', 'sk when --no-legend'],
25
25
  ['machine-readable', 'sk when --json'],
26
- ['write the legend into a docs page between its markers', 'sk when --out wiki/build/shipkit/runs.md'],
27
- ['fail if that page is stale (lint mode)', 'sk when --out wiki/build/shipkit/runs.md --check'],
26
+ ['write the legend into a docs page between its markers', 'sk when --out wiki/tools/shipkit/runs.md'],
27
+ ['fail if that page is stale (lint mode)', 'sk when --out wiki/tools/shipkit/runs.md --check'],
28
28
  ],
29
29
  })
30
30
 
@@ -5,26 +5,29 @@ import { homedir } from 'os'
5
5
  import { join } from 'path'
6
6
 
7
7
  export const FAMILY_PAGES: Readonly<Record<string, string>> = {
8
- Asks: 'world/human-loop.md',
9
- Assets: 'build/generate-assets.md',
10
- Gate: 'build/shipkit.md',
11
- Health: 'build/shipkit.md',
12
- Home: 'build/shipkit/home.md',
13
- Media: 'build/shipkit/media-store.md',
14
- Refactor: 'build/typescript.md',
15
- Review: 'build/shipkit/review.md',
16
- Scaffold: 'build/pocketbase.md',
17
- Serve: 'build/shipkit/home.md',
18
- Setup: 'meta/rv-conventions.md',
19
- Sound: 'build/trailer.md',
20
- Trailer: 'build/trailer.md',
21
- Wiki: 'build/mdwiki.md',
8
+ Asks: 'preferences/human-loop/index.md',
9
+ Assets: 'tools/generate-assets/index.md',
10
+ Drill: 'meta/speed-up-agents/index.md',
11
+ Gate: 'tools/shipkit/index.md',
12
+ Health: 'tools/shipkit/index.md',
13
+ Home: 'tools/shipkit/home.md',
14
+ Media: 'tools/shipkit/media-store.md',
15
+ Refactor: 'patterns/typescript/index.md',
16
+ Review: 'tools/shipkit/review.md',
17
+ Scaffold: 'patterns/pocketbase/index.md',
18
+ Serve: 'tools/shipkit/home.md',
19
+ Setup: 'patterns/rv-conventions/index.md',
20
+ Social: 'tools/shipkit/social.md',
21
+ Sound: 'tools/trailer/index.md',
22
+ Trailer: 'tools/trailer/index.md',
23
+ Veille: 'tools/shipkit/veille.md',
24
+ Wiki: 'tools/mdwiki/index.md',
22
25
  }
23
26
 
24
- /** a page as a path any repo can read, when the lib runs from inside its wiki (`<wiki>/build/shipkit/rvlib-shipkit`);
27
+ /** a page as a path any repo can read, when the lib runs from the house repo beside its wiki (`<house>/packages/rvlib-shipkit`);
25
28
  * from an install, the page's wiki path */
26
29
  export function pageAt(rel: string): string {
27
- const abs = join(import.meta.dir, '../../../../..', rel)
30
+ const abs = join(import.meta.dir, '../../../../wiki', rel)
28
31
  if (!existsSync(abs)) return `wiki ${rel}`
29
32
  const home = homedir()
30
33
  return abs.startsWith(`${home}/`) ? `~${abs.slice(home.length)}` : abs
@@ -9,10 +9,11 @@ import { AssetsAddCommand, AssetsCheckCommand, AssetsFillCommand, AssetsGenComma
9
9
  import { BumpCommand } from './cmd_Bump.ts'
10
10
  import { CallsCommand } from './cmd_Calls.ts'
11
11
  import { TimeCommand } from './cmd_Time.ts'
12
+ import { DrillCompareCommand, DrillReportCommand, DrillVerdictCommand } from './cmd_Drill.ts'
12
13
  import { CheckCommand } from './cmd_Check.ts'
13
14
  import { CommandsCommand } from './cmd_Commands.ts'
14
15
  import { withFamilyPage } from './family-pages.ts'
15
- import { aliasArgs, CrossRepoActivityCommand } from './cmd_CrossRepoActivity.ts'
16
+ import { CrossRepoActivityCommand } from './cmd_CrossRepoActivity.ts'
16
17
  import { ConfigKeysCommand } from './cmd_ConfigKeys.ts'
17
18
  import { GlobalProcessesCommand, GlobalProcessOpenCommand, GlobalProcessRestartCommand, GlobalProcessStartCommand, GlobalProcessStopCommand } from './cmd_GlobalProcesses.ts'
18
19
  import { PlannedCommand } from './cmd_Planned.ts'
@@ -23,7 +24,7 @@ import { CiCommand } from './cmd_Ci.ts'
23
24
  import { ContractsCommand } from './cmd_Contracts.ts'
24
25
  import { FleetCommand } from './cmd_Fleet.ts'
25
26
  import { FleetPushCommand } from './cmd_FleetPush.ts'
26
- import { DaemonCommand, GuiCommand, PmCommand, PmInstallCommand, PmUninstallCommand, WebCommand } from './cmd_Home.ts'
27
+ import { DaemonCommand, DaemonJobCommand, GuiCommand, PmCommand, PmInstallCommand, PmUninstallCommand, WebCommand } from './cmd_Home.ts'
27
28
  import { HooksCommitMsgCommand, HooksInstallCommand, HooksListCommand, HooksPreCommitCommand } from './cmd_Hooks.ts'
28
29
  import { InitCommand } from './cmd_Init.ts'
29
30
  import { KeysCommand } from './cmd_Keys.ts'
@@ -45,7 +46,10 @@ import { StartCommand } from './cmd_Start.ts'
45
46
  import { TRAILER_COMMANDS } from './cmd_Trailer.ts'
46
47
  import { SOUND_COMMANDS } from './cmd_Sound.ts'
47
48
  import { REVIEW_COMMANDS } from './cmd_Review.ts'
49
+ import { SOCIAL_COMMANDS } from './cmd_Social.ts'
48
50
  import { MEDIA_COMMANDS } from './cmd_Media.ts'
51
+ import { BACKUP_COMMANDS } from './cmd_Backup.ts'
52
+ import { VEILLE_COMMANDS } from './cmd_Veille.ts'
49
53
  import { TuiCommand } from './cmd_Tui.ts'
50
54
  import { WikiLintCommand, WikiServeCommand } from './cmd_Wiki.ts'
51
55
 
@@ -86,10 +90,14 @@ export function buildCli(): Cli {
86
90
  for (const c of TRAILER_COMMANDS) cli.register(c)
87
91
  for (const c of SOUND_COMMANDS) cli.register(c)
88
92
  for (const c of REVIEW_COMMANDS) cli.register(c)
93
+ for (const c of SOCIAL_COMMANDS) cli.register(c)
89
94
  for (const c of MEDIA_COMMANDS) cli.register(c)
95
+ for (const c of BACKUP_COMMANDS) cli.register(c)
96
+ for (const c of VEILLE_COMMANDS) cli.register(c)
90
97
  cli.register(ServeCommand)
91
98
  cli.register(PmCommand)
92
99
  cli.register(DaemonCommand)
100
+ cli.register(DaemonJobCommand)
93
101
  cli.register(WebCommand)
94
102
  cli.register(PmInstallCommand)
95
103
  cli.register(PmUninstallCommand)
@@ -133,6 +141,9 @@ export function buildCli(): Cli {
133
141
  cli.register(CommandsCommand)
134
142
  cli.register(CallsCommand)
135
143
  cli.register(TimeCommand)
144
+ cli.register(DrillReportCommand)
145
+ cli.register(DrillVerdictCommand)
146
+ cli.register(DrillCompareCommand)
136
147
  cli.register(ConfigKeysCommand)
137
148
 
138
149
  return cli
package/src/cli.ts CHANGED
@@ -30,12 +30,14 @@ export const loadBoot = (cmd?: string) =>
30
30
  import('./core/one-lib.ts'),
31
31
  import('./cli/kit/calls.ts'),
32
32
  import('./home/autostart.ts'),
33
+ import('./core/machine-link.ts'),
33
34
  loadRole(cmd),
34
35
  ])
35
36
 
36
37
  // only when this file IS the process. A repo's installed copy first hands the
37
38
  // command to the house source (handoff.ts). One copy of the lib per process:
38
- // a repo config that imports its own install lands on this one (one-lib.ts).
39
+ // a repo config that imports its own install lands on this one (one-lib.ts),
40
+ // and a house repo's install becomes a link to it (machine-link.ts).
39
41
  // The run is logged (cli/kit/calls.ts, read back by `sk calls`). Then pm is
40
42
  // started when it is down (autostart.ts), before the command runs
41
43
  if (import.meta.main) {
@@ -48,10 +50,11 @@ if (import.meta.main) {
48
50
  throw e
49
51
  }
50
52
  bootLoaded()
51
- const [{ buildCli }, { aliasArgs }, { handoff }, { installOneLib }, { callsFile, logCall }, { autostart }] = m
53
+ const [{ buildCli }, { aliasArgs }, { handoff }, { installOneLib }, { callsFile, logCall }, { autostart }, { linkMachineCopy }] = m
52
54
  const argv = aliasArgs(raw)
53
55
  handoff(argv)
54
56
  installOneLib()
57
+ await linkMachineCopy()
55
58
  logCall(callsFile((await import('os')).homedir(), 'sk'), 'sk', argv)
56
59
  await autostart(argv)
57
60
  void buildCli().runExit(argv)
@@ -1,60 +1,12 @@
1
1
  // Act-in-place verbs behind the hub feed — every mutation targets a
2
2
  // git-tracked truth file (studio pick-flow precedent: the hub writes, the
3
3
  // repo's diff shows it; Feedback appends are append-only, never destructive).
4
- import { existsSync, readFileSync, readdirSync, writeFileSync } from 'fs'
4
+ import { existsSync, readFileSync, writeFileSync } from 'fs'
5
5
  import { join } from 'path'
6
6
  import { archiveAsk, proofAsk } from '../asks/asks-queue.ts'
7
- import { parsePostFile } from './posts.ts'
8
7
 
9
8
  const today = (): string => new Date().toISOString().slice(0, 10)
10
9
 
11
- const postPath = (root: string, channel: string, file: string): string => {
12
- if (channel.includes('/') || channel.includes('..') || file.includes('/') || file.includes('..')) throw new Error('bad path')
13
- const p = join(root, '.shipkit/social', channel, file)
14
- if (!existsSync(p)) throw new Error(`no such post: ${channel}/${file}`)
15
- return p
16
- }
17
-
18
- const setStatus = (p: string, status: string): void => {
19
- const md = readFileSync(p, 'utf8')
20
- if (!/^status:/m.test(md)) throw new Error('post has no status: frontmatter')
21
- writeFileSync(p, md.replace(/^status:.*$/m, `status: ${status}`))
22
- }
23
-
24
- /** pick one draft variant: it flips to picked, sibling drafts to rejected
25
- * (files KEPT — rejections are training data for the next generation) */
26
- export function pickPostVariant(root: string, channel: string, file: string): void {
27
- const p = postPath(root, channel, file)
28
- const dir = join(root, '.shipkit/social', channel)
29
- const slug = parsePostFile(dir, channel, file).slug
30
- setStatus(p, 'picked')
31
- for (const f of readdirSync(dir).filter((x) => x.endsWith('.md') && x !== file)) {
32
- const sib = parsePostFile(dir, channel, f)
33
- if (sib.slug === slug && sib.status === 'draft') setStatus(join(dir, f), 'rejected')
34
- }
35
- }
36
-
37
- /** the posted-URL proof: status → posted, `posted:` frontmatter carries the URL */
38
- export function markPosted(root: string, channel: string, file: string, url: string, rating?: number): void {
39
- const p = postPath(root, channel, file)
40
- setStatus(p, 'posted')
41
- const md = readFileSync(p, 'utf8')
42
- const withUrl = /^posted:/m.test(md) ? md.replace(/^posted:.*$/m, `posted: ${url}`) : md.replace(/^status:.*$/m, (s) => `${s}\nposted: ${url}`)
43
- const withRating = rating != null
44
- ? (/^rating:/m.test(withUrl) ? withUrl.replace(/^rating:.*$/m, `rating: ${rating}`) : withUrl.replace(/^posted:.*$/m, (s) => `${s}\nrating: ${rating}`))
45
- : withUrl
46
- writeFileSync(p, withRating)
47
- }
48
-
49
- /** append a dated remark under ## Feedback (created if absent) — NEVER
50
- * destructive; future generations re-read these before drafting */
51
- export function appendPostFeedback(root: string, channel: string, file: string, text: string): void {
52
- const p = postPath(root, channel, file)
53
- const md = readFileSync(p, 'utf8')
54
- const line = `- ${today()}: ${text.replace(/\n+/g, ' ').trim()}`
55
- writeFileSync(p, /^## Feedback\s*$/m.test(md) ? `${md.trimEnd()}\n${line}\n` : `${md.trimEnd()}\n\n## Feedback\n${line}\n`)
56
- }
57
-
58
10
  /** an asset remark → `.shipkit/assets/notes.md` (git-tracked; the studio
59
11
  * workspace is gitignored, so notes live beside kit.ts) */
60
12
  export function appendAssetNote(root: string, assetId: string, text: string): void {
@@ -21,7 +21,7 @@ import { FLOOR_IDS } from '../core/floor.ts'
21
21
  import { FOREVER_MS, formatLine, ttlMsOf } from '../core/wire.ts'
22
22
  import { gateInventory, type CheckRow } from '../ledger/gate-checks.ts'
23
23
  import { runsCellsOf } from '../core/runs-matrix.ts'
24
- import { readLastLines, readRuns, runsPath, type LastLine, type RunRow } from '../ledger/run-log.ts'
24
+ import { readLastLines, readRuns, runsPath, warmRuns, type LastLine, type RunRow } from '../ledger/run-log.ts'
25
25
  import { checkStatsFor, type CheckStat } from '../ledger/check-stats.ts'
26
26
  import { NEGATIVE_TTL_CAP_MS } from '../ledger/world-cache.ts'
27
27
  import type { RepoConfig } from '../repo-config.ts'
@@ -66,6 +66,7 @@ export function checksCollection(root: string, c: RepoConfig, o: ChecksOpts = {}
66
66
  kind: 'check',
67
67
  media: 'health',
68
68
  list: async () => {
69
+ if (o.runs == null) await warmRuns(runsPath(root))
69
70
  const rows = await gateInventory(root, c)
70
71
  const stats = o.stats ?? checkStatsFor(root, rows.map((r) => ({ id: r.decl.id })))
71
72
  const lines = o.lastLines ?? readLastLines(runsPath(root))
@@ -3,9 +3,10 @@
3
3
  // feed, the studio browse, and `shipkit needs`. Truth files never move to
4
4
  // fit the UI — a Collection only READS its source. Severity: yellow = a
5
5
  // default is in use, taste pending; red = missing with no inventable
6
- // default, or a paste-from-elsewhere. Doctrine page: build/collections in
6
+ // default, or a paste-from-elsewhere. Doctrine page: tools/shipkit/collections in
7
7
  // the docs wiki this lib ships beside.
8
8
 
9
+ import { yieldLoop } from '../core/loop-watch.ts'
9
10
  import type { WhenAt, WhenSource } from '../core/when.ts'
10
11
  import type { RunsCells } from '../core/runs-matrix.ts'
11
12
  import type { CheckFrom } from '../ledger/gate-checks.ts'
@@ -31,12 +32,16 @@ export const NO_CHECK = 'in no check'
31
32
  * section a row lives under (hub-app/tree-build.ts KIND_SECTION). There is no
32
33
  * catch all kind: a row belongs to an owner, and what belongs to the hub
33
34
  * itself is its status (serve/hub-problems.ts), never a row */
34
- export const RESOURCE_TYPES = ['ask', 'secret', 'asset', 'post', 'workflow', 'wiki', 'contract', 'check', 'test', 'reflection', 'process', 'card', 'cut'] as const
35
+ export const RESOURCE_TYPES = ['ask', 'secret', 'asset', 'post', 'workflow', 'wiki', 'contract', 'check', 'test', 'reflection', 'process', 'card', 'cut', 'store', 'veille'] as const
35
36
 
36
37
  /** the collection of the review cards that wait on him (collections/review.ts) */
37
38
  export const REVIEW_COL = 'review'
38
39
  /** the collection of the trailer cuts, one row a cut (collections/review.ts) */
39
40
  export const TRAILER_COL = 'trailers'
41
+ /** the collection of the store pages, one row a store (stores/collection.ts) */
42
+ export const STORES_COL = 'stores'
43
+ /** the collection of the Veille, one row for the identity whose posts it ranks (veille/collection.ts) */
44
+ export const VEILLE_COL = 'veille'
40
45
 
41
46
  export type ResourceType = (typeof RESOURCE_TYPES)[number]
42
47
 
@@ -327,10 +332,13 @@ export const brokenRow = (c: Collection, e: unknown): Instance => ({
327
332
  export type OnCollector = (collection: string, error: string | null) => void
328
333
 
329
334
  /** every resource of every collection, failure-isolated per collection: a
330
- * broken source reports itself as ONE red row, never blanks the tree */
335
+ * broken source reports itself as ONE red row, never blanks the tree. The
336
+ * loop is given back between two collections (wiki tools/shipkit/home.md,
337
+ * Nothing heavy on the daemon's loop) */
331
338
  export async function projectResources(collections: Collection[], onCollector?: OnCollector): Promise<Resource[]> {
332
339
  const out: Resource[] = []
333
340
  for (const c of collections) {
341
+ await yieldLoop()
334
342
  try {
335
343
  out.push(...(await listResources(c)))
336
344
  onCollector?.(c.id, null)
@@ -348,6 +356,7 @@ export async function projectResources(collections: Collection[], onCollector?:
348
356
  export async function projectNeeds(collections: Collection[], onCollector?: OnCollector): Promise<NeedItem[]> {
349
357
  const out: NeedItem[] = []
350
358
  for (const c of collections) {
359
+ await yieldLoop()
351
360
  try {
352
361
  for (const i of await c.list()) if (i.severity != null) out.push({ ...i, collection: c.id })
353
362
  onCollector?.(c.id, null)
@@ -24,10 +24,11 @@ import type { RepoConfig } from '../repo-config.ts'
24
24
  import { activeContracts, contractsConfigFrom } from '../contracts/apply-contracts.ts'
25
25
  import type { AskFacts, CheckFacts, Collection, Instance } from './collection-types.ts'
26
26
  import { mdBody } from './md-body.ts'
27
- import { socialPostsCollection } from './posts.ts'
28
27
  import { assetState, secretState, type SecretLevel, type SecretProbe } from './state-rules.ts'
29
28
  import { reflectionsCollection } from './reflections.ts'
30
29
  import { reviewCollection, trailersCollection } from './review.ts'
30
+ import { storesCollection } from '../stores/collection.ts'
31
+ import { veilleCollection } from '../veille/collection.ts'
31
32
  import { testsCollection } from './tests.ts'
32
33
  import { checksCollection } from './checks.ts'
33
34
  import { LAYOUT } from '../core/layout.ts'
@@ -415,10 +416,9 @@ export function buildCollections(root: string, c: RepoConfig, kit: ResolvedKit |
415
416
  asksCollection(root, c),
416
417
  credsCollection(root, c, { verdicts: () => verdictsOf(checks) }),
417
418
  mediaKitCollection(root, c.serve?.assets === false ? null : kit),
418
- socialPostsCollection(root),
419
419
  reflectionsCollection(root),
420
420
  testsCollection(root, c),
421
- // only where the repo has a review store or a trailer folder: the section of a repo with none is greyed
422
- ...[reviewCollection(root), trailersCollection(root)].filter((x): x is Collection => x !== null),
421
+ // only where the repo has a review store, a trailer folder or a store folder: the section of a repo with none is greyed
422
+ ...[reviewCollection(root), trailersCollection(root), storesCollection(root), veilleCollection(root)].filter((x): x is Collection => x !== null),
423
423
  ]
424
424
  }
@@ -1,11 +1,11 @@
1
- // the review store and the trailer cuts as tree rows (wiki build/shipkit/review.md). Under the review section, one row a
1
+ // the review store and the trailer cuts as tree rows (wiki tools/shipkit/review.md). Under the review section, one row a
2
2
  // card that waits on HIM (the owner's verdict, his answer to a question): yellow, so `sk needs` lists it too. Under the trailer
3
3
  // section, one row a cut, its open frame notes in the slot: they wait on agents, never on him, so a cut is never yellow.
4
4
  // Each collection exists only where the repo has its folder, so a repo with none draws the section greyed
5
5
  import { existsSync } from 'node:fs'
6
6
  import { join } from 'node:path'
7
7
  import { STATUS_LABEL, isFrame, stateOf, type ReviewItem } from '../review/model.ts'
8
- import { readAllCached, storeDir, storeStamp } from '../review/store.ts'
8
+ import { readAllCached, storeDir, storeStamp, warmStore } from '../review/store.ts'
9
9
  import { statusOf, waitingOnOwner, type Thread } from '../review/threads.ts'
10
10
  import { cutsOf, trailerIds } from '../review/trailer-desk.ts'
11
11
  import { REVIEW_COL, TRAILER_COL, type Collection, type Instance } from './collection-types.ts'
@@ -34,6 +34,7 @@ export function reviewCollection(root: string): Collection | null {
34
34
  kind: 'card',
35
35
  media: 'image',
36
36
  list: async () => {
37
+ await warmStore(dir)
37
38
  const { threads, items } = waitingCards(root)
38
39
  return threads.map(({ head: x }): Instance => ({
39
40
  id: `card:${x.item.id}`,
@@ -6,11 +6,14 @@
6
6
  // testPlanOf, the same plan rule SK018 judges, and whether a file needs fixing
7
7
  // is ledger/run-timeline.ts testFilesToFix, the same function the runs page
8
8
  // tab lists. A second answer to either would drift from the first.
9
- import { posix } from 'path'
10
- import { CheckCtx } from '../core/check-ctx.ts'
9
+ import { readFileSync } from 'fs'
10
+ import { join, posix } from 'path'
11
+ import { listRepoFiles } from '../core/floor.ts'
12
+ import { listingWithoutVendored } from '../core/vendored.ts'
13
+ import { readVendored } from '../core/vendored-read.ts'
11
14
  import { testFilesToFix } from '../ledger/run-timeline.ts'
12
15
  import { runsPath } from '../ledger/run-log.ts'
13
- import { readSuites, type SuiteRow } from '../ledger/suite-log.ts'
16
+ import { readSuites, warmSuites, type SuiteRow } from '../ledger/suite-log.ts'
14
17
  import type { RepoConfig } from '../repo-config.ts'
15
18
  import { rawName } from '../core/canonical-scripts.ts'
16
19
  import { DEFAULT_BUDGET_MS, normSuitePath } from '../suite/judge-suites.ts'
@@ -68,14 +71,22 @@ export function testsCollection(root: string, c: RepoConfig, o: TestsOpts = {}):
68
71
  list: async () => {
69
72
  let files = o.files
70
73
  let read = o.read
71
- if (files == null || read == null) {
72
- const disk = CheckCtx.open({ root, config: c })
73
- files ??= disk.list(TEST_GLOB)
74
- read ??= (rel) => disk.read(rel)
74
+ // what git sees, as a check's `list` lists it (tracked, or untracked and not ignored, the vendored dirs
75
+ // left out), from the repo listing the inventory reads too: kept on the tree's revision in the daemon,
76
+ // where a check context stages and hashes the whole tree
77
+ if (files == null) {
78
+ const glob = new Bun.Glob(TEST_GLOB)
79
+ files = listingWithoutVendored(listRepoFiles(root).filter((f) => glob.match(f)), TEST_GLOB, readVendored(root))
80
+ }
81
+ read ??= (rel) => {
82
+ try { return readFileSync(join(root, rel), 'utf8') } catch { return null }
75
83
  }
76
84
  let suites = o.suites
77
85
  if (suites == null) {
78
- try { suites = readSuites(runsPath(root)) } catch { suites = [] }
86
+ try {
87
+ await warmSuites(runsPath(root))
88
+ suites = readSuites(runsPath(root))
89
+ } catch { suites = [] }
79
90
  }
80
91
  return testInstances({ config: c, files: files.filter(isTestFile), read, suites })
81
92
  },
@@ -1,6 +1,6 @@
1
1
  // the comfy section's backend: the repo's .shipkit/comfy/ workflow modules, the
2
2
  // comfy-ts serve panel the hub embeds to tune and test one, and the box those
3
- // modules generate on. The contract this reads is owned by build/comfyui.md.
3
+ // modules generate on. The contract this reads is owned by tools/comfyui/index.md.
4
4
  //
5
5
  // The panel is a CHILD PROCESS rather than a route: comfy-ts owns that ui, and
6
6
  // a second implementation of a var form inside the hub is the redundant
@@ -15,7 +15,7 @@ export type ComfyPanelUp = { url: string; port: number }
15
15
  export type ComfyBox = { url: string; err: string | null }
16
16
 
17
17
  const SUFFIX = '.cflow.ts'
18
- /** the wm facts (build/comfyui.md) — an absent key defaults to them */
18
+ /** the wm facts (tools/comfyui/index.md) — an absent key defaults to them */
19
19
  const DEFAULT_BOX_PORT = 8085
20
20
 
21
21
  export const comfyWorkflowsDir = (root: string): string => join(root, '.shipkit/comfy', 'workflows')
@@ -15,15 +15,13 @@ import { evaluateContracts, type ContractsConfig, type ContractsResult } from '.
15
15
 
16
16
  export function contractsConfigFrom(c: RepoConfig, d: WebDisk & Pick<ScanCtx, 'root'>): ContractsConfig {
17
17
  const venues = c.venues ?? []
18
- const social = c.social ?? []
19
- const declared = [...venues, ...(social.length > 0 ? ['social'] : [])]
18
+ const declared = [...venues]
20
19
  const deploys = webDeploys(d)
21
20
  // a public repo whose only surface is an npm package has no page to serve an identity on
22
21
  const npmOnly = c.release?.npm === true && deploys.length === 0 && venues.length === 0
23
22
  return {
24
23
  root: d.root,
25
24
  declared,
26
- social,
27
25
  publicSurface: venues.length > 0 || deploys.length > 0 || (c.visibility === 'public' && !npmOnly),
28
26
  webRoot: webRootOf(c.contracts?.webRoot, deploys),
29
27
  exempt: c.contracts?.exempt,
@@ -4,7 +4,6 @@ import type { ContractManifest } from './contract-types.ts'
4
4
  import c0 from './manifests/discord.contract.ts'
5
5
  import c1 from './manifests/identity.contract.ts'
6
6
  import c2 from './manifests/itch.contract.ts'
7
- import c3 from './manifests/social.contract.ts'
8
- import c4 from './manifests/steam.contract.ts'
7
+ import c3 from './manifests/steam.contract.ts'
9
8
 
10
- export const allContracts: ContractManifest[] = [c0, c1, c2, c3, c4]
9
+ export const allContracts: ContractManifest[] = [c0, c1, c2, c3]
@@ -34,7 +34,6 @@ export type ContractEnv = {
34
34
  /** the dir the site serves, what `{web}` in a rule path stands for */
35
35
  webRoot: string
36
36
  venues: string[]
37
- social: string[]
38
37
  exists: (relPath: string) => boolean
39
38
  /** the text of a repo-relative file, null when none. A probe reads the
40
39
  * repo through this and `exists`, so a check reporting it is cached on
@@ -22,8 +22,6 @@ export type ContractsConfig = {
22
22
  root: string
23
23
  /** venue ids the repo declares it ships on (config side of both-ways drift) */
24
24
  declared: string[]
25
- /** social channel list — handed to custom rules via ContractEnv */
26
- social: string[]
27
25
  /** repo has a public surface (a deploy, a declared venue, a public repo) — gates 'always' contracts */
28
26
  publicSurface: boolean
29
27
  /** the dir the site serves, substituted for `{web}` in rule paths (default 'public') */
@@ -186,7 +184,6 @@ export async function evaluateContracts(manifests: ContractManifest[], cfg: Cont
186
184
  root: cfg.root,
187
185
  webRoot,
188
186
  venues: cfg.declared,
189
- social: cfg.social,
190
187
  exists: (rel) => d.exists(rel),
191
188
  read: (rel) => textOf(d, rel),
192
189
  }
@@ -5,7 +5,7 @@ import { defineContract, dirExists, md, png } from 'rvlib-shipkit/src/contracts/
5
5
  export default defineContract({
6
6
  venue: 'discord',
7
7
  dir: '.shipkit/discord',
8
- owner: 'distribute/post-publicly.md',
8
+ owner: 'guides/post-publicly/index.md',
9
9
  appliesTo: 'declared',
10
10
  detect: [dirExists('.shipkit/discord')],
11
11
  artifacts: [