rvlib-shipkit 2.13.0 → 2.15.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 (270) hide show
  1. package/CHANGELOG.md +38 -13
  2. package/package.json +1 -1
  3. package/src/assets/run-assets.ts +2 -2
  4. package/src/assets/server/studio-server.ts +27 -23
  5. package/src/check.ts +3 -3
  6. package/src/checks/SK001-package-json-shape.check.ts +4 -4
  7. package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
  8. package/src/checks/SK003-claude-md-shape.check.ts +19 -12
  9. package/src/checks/SK004-gitignore-policy.check.ts +18 -4
  10. package/src/checks/SK005-rvlib-versions.check.ts +1 -1
  11. package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
  12. package/src/checks/SK007-github-visibility.check.ts +2 -2
  13. package/src/checks/SK008-reviewer-agent.check.ts +1 -1
  14. package/src/checks/SK010-undeclared-unit.check.ts +2 -2
  15. package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
  16. package/src/checks/SK012-config-barrel-import.check.ts +1 -1
  17. package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
  18. package/src/checks/SK015-nested-repo.check.ts +2 -2
  19. package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
  20. package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
  21. package/src/checks/SK018-test-files-run.check.ts +2 -2
  22. package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
  23. package/src/checks/SK020-self-spawning-check.check.ts +2 -2
  24. package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
  25. package/src/checks/SK024-identity-colors.check.ts +1 -1
  26. package/src/checks/SK025-release-drift.check.ts +2 -2
  27. package/src/checks/SK026-asks-autoclose.check.ts +2 -2
  28. package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
  29. package/src/checks/SK028-readme.check.ts +2 -2
  30. package/src/checks/SK029-explicit-check-files.check.ts +3 -3
  31. package/src/checks/SK030-cache-audit.check.ts +7 -5
  32. package/src/checks/SK031-trace-audit.check.ts +7 -7
  33. package/src/checks/SK032-ignored-inputs.check.ts +3 -3
  34. package/src/checks/SK033-global-contribution.check.ts +11 -4
  35. package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
  36. package/src/checks/SK035-public-clean.check.ts +4 -4
  37. package/src/checks/SK036-draft-media-size.check.ts +2 -2
  38. package/src/checks/SK037-keyword-additions.check.ts +43 -0
  39. package/src/cli/cmd_Backup.ts +2 -2
  40. package/src/cli/cmd_Commands.ts +4 -4
  41. package/src/cli/cmd_ConfigKeys.ts +2 -2
  42. package/src/cli/cmd_Drill.ts +30 -1
  43. package/src/cli/cmd_Home.ts +1 -1
  44. package/src/cli/cmd_Init.ts +1 -1
  45. package/src/cli/cmd_Media.ts +5 -5
  46. package/src/cli/cmd_Mv.ts +14 -7
  47. package/src/cli/cmd_Review.ts +2 -2
  48. package/src/cli/cmd_Smoke.ts +1 -1
  49. package/src/cli/cmd_Social.ts +3 -3
  50. package/src/cli/cmd_Sound.ts +1 -1
  51. package/src/cli/cmd_TraceAudit.ts +6 -6
  52. package/src/cli/cmd_Trailer.ts +2 -2
  53. package/src/cli/cmd_Veille.ts +2 -2
  54. package/src/cli/cmd_When.ts +2 -2
  55. package/src/cli/family-pages.ts +19 -19
  56. package/src/cli/registry.ts +2 -1
  57. package/src/collections/collection-types.ts +2 -2
  58. package/src/collections/review.ts +1 -1
  59. package/src/comfy/comfy-panel.ts +2 -2
  60. package/src/contracts/manifests/discord.contract.ts +1 -1
  61. package/src/contracts/manifests/identity.contract.ts +1 -1
  62. package/src/contracts/manifests/itch.contract.ts +1 -1
  63. package/src/contracts/manifests/steam.contract.ts +1 -1
  64. package/src/core/agent-dir-at.ts +12 -0
  65. package/src/core/agent-dir.ts +28 -0
  66. package/src/core/budget.ts +1 -1
  67. package/src/core/canonical-scripts.ts +2 -2
  68. package/src/core/discover-checks.ts +1 -1
  69. package/src/core/global-contribution.ts +4 -1
  70. package/src/core/ignored-block.ts +1 -1
  71. package/src/core/ignored-inputs.ts +3 -2
  72. package/src/core/layout.ts +3 -3
  73. package/src/core/loop-watch.ts +1 -1
  74. package/src/core/motherhome.ts +2 -2
  75. package/src/core/one-way-in-policy.ts +8 -8
  76. package/src/core/run-ci.ts +3 -3
  77. package/src/core/runs-matrix.ts +1 -1
  78. package/src/core/slots.ts +14 -5
  79. package/src/core/trace-audit.ts +50 -9
  80. package/src/core/tree-rev.ts +1 -1
  81. package/src/drill/clean.ts +54 -0
  82. package/src/drill/run.ts +1 -1
  83. package/src/home/daemon-jobs.ts +1 -1
  84. package/src/home/global-context.ts +11 -8
  85. package/src/home/gui-app/ShipkitGui.swift +91 -2
  86. package/src/home/inbox-shape.ts +1 -1
  87. package/src/home/inbox.ts +1 -1
  88. package/src/home/pm-config.ts +4 -1
  89. package/src/home/pm-inputs.ts +2 -0
  90. package/src/home/resources.ts +7 -2
  91. package/src/home/run-pm.ts +1 -1
  92. package/src/home/serve-web.ts +2 -2
  93. package/src/hooks/commit-message.ts +1 -1
  94. package/src/hooks/hook-gates.ts +1 -1
  95. package/src/hooks/leak-guard.ts +61 -8
  96. package/src/hooks/run-hooks.ts +18 -18
  97. package/src/identities/identities.ts +1 -1
  98. package/src/identities/machine-route.ts +1 -1
  99. package/src/identities/machine.ts +1 -1
  100. package/src/init-repo.ts +2 -2
  101. package/src/ledger/gate-checks.ts +1 -1
  102. package/src/ledger/record-kept.ts +1 -1
  103. package/src/media-kinds.ts +1 -1
  104. package/src/media-store/backup/daemon.ts +1 -1
  105. package/src/media-store/backup/keys.ts +1 -1
  106. package/src/media-store/backup/manifest.ts +1 -1
  107. package/src/media-store/backup/restore.ts +1 -1
  108. package/src/media-store/backup/run.ts +1 -1
  109. package/src/media-store/backup/secret.ts +1 -1
  110. package/src/media-store/backup/snapshot.ts +1 -1
  111. package/src/media-store/backup/sources.ts +1 -1
  112. package/src/media-store/content.ts +1 -1
  113. package/src/media-store/daemon.ts +1 -1
  114. package/src/media-store/db.ts +1 -1
  115. package/src/media-store/fact.ts +1 -1
  116. package/src/media-store/hand.ts +1 -1
  117. package/src/media-store/kind.ts +1 -1
  118. package/src/media-store/purge.ts +1 -1
  119. package/src/media-store/put.ts +1 -1
  120. package/src/media-store/remote.ts +1 -1
  121. package/src/media-store/space.ts +1 -1
  122. package/src/mv/mv-md.ts +63 -22
  123. package/src/pages/forward.ts +1 -1
  124. package/src/pages/frame-client.ts +1 -1
  125. package/src/pages/routes.ts +1 -1
  126. package/src/pages/unit.ts +1 -1
  127. package/src/plan/planner.ts +1 -1
  128. package/src/plan/repo-source.ts +1 -1
  129. package/src/release/public-clean.ts +25 -7
  130. package/src/release/run-bump.ts +1 -1
  131. package/src/release/run-release.ts +3 -3
  132. package/src/repo-config.ts +23 -16
  133. package/src/review/anim.ts +1 -1
  134. package/src/review/auto.ts +1 -1
  135. package/src/review/cells.ts +15 -1
  136. package/src/review/format.ts +2 -2
  137. package/src/review/marks.ts +1 -1
  138. package/src/review/media-kind.ts +1 -1
  139. package/src/review/media-read.ts +1 -1
  140. package/src/review/model.ts +14 -4
  141. package/src/review/notes.ts +52 -4
  142. package/src/review/previews.ts +1 -1
  143. package/src/review/project.ts +1 -1
  144. package/src/review/role.ts +1 -1
  145. package/src/review/routes.ts +14 -2
  146. package/src/review/store.ts +2 -2
  147. package/src/review/threads.ts +1 -1
  148. package/src/review/trailer-desk.ts +3 -3
  149. package/src/review/trailer-media.ts +1 -1
  150. package/src/review/trailer-model.ts +1 -1
  151. package/src/review/trailer-routes.ts +1 -1
  152. package/src/review/trailer-shots.ts +1 -1
  153. package/src/review/unit.ts +1 -1
  154. package/src/scaffold/files/tsconfig.json +1 -1
  155. package/src/scaffold/project-scaffold.ts +1 -1
  156. package/src/serve/embed.ts +1 -1
  157. package/src/serve/hub-app/check-words.ts +1 -1
  158. package/src/serve/hub-app/frames-st.ts +1 -1
  159. package/src/serve/hub-app/hash-route.ts +1 -1
  160. package/src/serve/hub-app/home-st.ts +1 -1
  161. package/src/serve/hub-app/home-strip.css +1 -1
  162. package/src/serve/hub-app/hub-app.tsx +2 -2
  163. package/src/serve/hub-app/identities-st.ts +1 -1
  164. package/src/serve/hub-app/identities-view.tsx +5 -4
  165. package/src/serve/hub-app/identity-address.ts +1 -1
  166. package/src/serve/hub-app/inbox-st.ts +1 -1
  167. package/src/serve/hub-app/inbox-view.tsx +1 -1
  168. package/src/serve/hub-app/kept-cols.tsx +30 -0
  169. package/src/serve/hub-app/keys.ts +1 -1
  170. package/src/serve/hub-app/media-svc.ts +1 -1
  171. package/src/serve/hub-app/pages-frames.tsx +1 -1
  172. package/src/serve/hub-app/pages-svc.ts +1 -1
  173. package/src/serve/hub-app/projects-svc.ts +1 -1
  174. package/src/serve/hub-app/repo-st.ts +1 -1
  175. package/src/serve/hub-app/review/review-board.tsx +1 -1
  176. package/src/serve/hub-app/review/review-cells.tsx +3 -2
  177. package/src/serve/hub-app/review/review-page.tsx +5 -4
  178. package/src/serve/hub-app/review/review-st.ts +15 -7
  179. package/src/serve/hub-app/review/review-thread.tsx +52 -5
  180. package/src/serve/hub-app/review/review-views.tsx +50 -33
  181. package/src/serve/hub-app/review/thread-st.ts +79 -27
  182. package/src/serve/hub-app/review/trailer-page.tsx +5 -4
  183. package/src/serve/hub-app/review/trailer-st.ts +1 -1
  184. package/src/serve/hub-app/review.css +9 -1
  185. package/src/serve/hub-app/site/site-part.tsx +1 -1
  186. package/src/serve/hub-app/site/site-st.ts +1 -1
  187. package/src/serve/hub-app/social/calendar.tsx +1 -1
  188. package/src/serve/hub-app/social/comms-page.tsx +29 -5
  189. package/src/serve/hub-app/social/kit.tsx +1 -1
  190. package/src/serve/hub-app/social/post-card.tsx +1 -1
  191. package/src/serve/hub-app/social/social-model.ts +1 -1
  192. package/src/serve/hub-app/social/social-page.tsx +12 -5
  193. package/src/serve/hub-app/social/social-st.ts +31 -3
  194. package/src/serve/hub-app/social.css +1 -1
  195. package/src/serve/hub-app/stores/stores-page.tsx +5 -4
  196. package/src/serve/hub-app/stores/stores-st.ts +1 -1
  197. package/src/serve/hub-app/stores.css +1 -1
  198. package/src/serve/hub-app/tree-row.tsx +1 -1
  199. package/src/serve/hub-app/veille/veille-page.tsx +5 -4
  200. package/src/serve/hub-app/veille/veille-st.ts +1 -1
  201. package/src/serve/hub-app/veille.css +1 -1
  202. package/src/serve/hub-runtime.ts +6 -2
  203. package/src/serve/project-gutter-route.ts +1 -1
  204. package/src/shot/box.ts +5 -7
  205. package/src/shot/browser-slot.ts +18 -6
  206. package/src/shot/client.ts +1 -2
  207. package/src/shot/clip-encoder.ts +16 -13
  208. package/src/shot/film-box.ts +132 -28
  209. package/src/shot/shooter.ts +21 -2
  210. package/src/shot/stepped-clip.ts +1 -1
  211. package/src/site/desk.ts +2 -2
  212. package/src/site/routes.ts +1 -1
  213. package/src/site/unit.ts +1 -1
  214. package/src/social/card-drafts.ts +24 -0
  215. package/src/social/compose.ts +2 -2
  216. package/src/social/desk-index.ts +1 -1
  217. package/src/social/desk-wire.ts +1 -1
  218. package/src/social/drafts.ts +3 -3
  219. package/src/social/load.ts +14 -1
  220. package/src/social/media-facts.ts +1 -1
  221. package/src/social/media-kind.ts +1 -1
  222. package/src/social/media-limit.ts +1 -1
  223. package/src/social/media-of.ts +1 -1
  224. package/src/social/migrate.ts +1 -1
  225. package/src/social/post-url.ts +1 -1
  226. package/src/social/presence.ts +2 -2
  227. package/src/social/public-read.ts +1 -1
  228. package/src/social/publish/bluesky.ts +1 -1
  229. package/src/social/publish/discord.ts +1 -1
  230. package/src/social/push.ts +10 -4
  231. package/src/social/richtext.ts +1 -1
  232. package/src/social/routes.ts +10 -4
  233. package/src/social/stats.ts +1 -1
  234. package/src/social/text.ts +1 -1
  235. package/src/social/tracker-route.ts +1 -1
  236. package/src/social/tracker.ts +1 -1
  237. package/src/social/unit.ts +1 -1
  238. package/src/social/writes.ts +1 -1
  239. package/src/stores/collection.ts +1 -1
  240. package/src/stores/desk.ts +1 -1
  241. package/src/stores/model.ts +1 -1
  242. package/src/stores/routes.ts +1 -1
  243. package/src/stores/unit.ts +1 -1
  244. package/src/suite/judge-suites.ts +1 -1
  245. package/src/trace/tracer.ts +12 -5
  246. package/src/trailer/adapter.ts +1 -1
  247. package/src/trailer/build.ts +6 -4
  248. package/src/trailer/holes.ts +1 -1
  249. package/src/trailer/passage.ts +1 -1
  250. package/src/trailer/prune.ts +1 -1
  251. package/src/trailer/states.ts +1 -1
  252. package/src/trailer/versions.ts +1 -1
  253. package/src/trailer/words.ts +1 -1
  254. package/src/tui/run-tui.ts +1 -1
  255. package/src/tui/tui-store.ts +1 -1
  256. package/src/veille/asks.ts +1 -1
  257. package/src/veille/auto.ts +1 -1
  258. package/src/veille/batch.ts +1 -1
  259. package/src/veille/chrome.ts +1 -1
  260. package/src/veille/collection.ts +1 -1
  261. package/src/veille/desk.ts +1 -1
  262. package/src/veille/identity.ts +1 -1
  263. package/src/veille/import.ts +1 -1
  264. package/src/veille/log.ts +1 -1
  265. package/src/veille/platforms.ts +1 -1
  266. package/src/veille/reads.ts +1 -1
  267. package/src/veille/replied.ts +1 -1
  268. package/src/veille/routes.ts +2 -2
  269. package/src/veille/watch.ts +1 -1
  270. package/src/veille/worth.ts +2 -2
@@ -1,4 +1,4 @@
1
- // the page side of a repo page's frame (wiki build/shipkit/project-pages.md, The frame contract): the one module a
1
+ // the page side of a repo page's frame (wiki tools/shipkit/project-pages.md, The frame contract): the one module a
2
2
  // repo's page bundles to live in the hub. No framework, no hub code beyond the keys table. Framed, it speaks the
3
3
  // `{ shipkit: <verb> }` messages on its origin; alone at its own url, it keeps the keys in its own address, so the
4
4
  // page works the same either way
@@ -1,4 +1,4 @@
1
- // a repo's own pages on the hub (wiki build/shipkit/project-pages.md): their list, and the proxy that serves each one
1
+ // a repo's own pages on the hub (wiki tools/shipkit/project-pages.md): their list, and the proxy that serves each one
2
2
  // from the repo's process under the hub's origin, `/page/<id>/<rest>` to `<url><rest>`, streamed both ways. The one
3
3
  // constraint a reader breaks first: a page must use relative paths, an absolute one reaches the hub, never the page
4
4
  import { forwardPage, pagePath } from './forward.ts'
package/src/pages/unit.ts CHANGED
@@ -1,4 +1,4 @@
1
- // a repo's own pages in its hub (wiki build/shipkit/project-pages.md): a `page({...})` unit of any `<name>.shipkit.ts`,
1
+ // a repo's own pages in its hub (wiki tools/shipkit/project-pages.md): a `page({...})` unit of any `<name>.shipkit.ts`,
2
2
  // one page or an array of them as the default export. Every unit file imports this module, so it stays light: the
3
3
  // daemon reads the declarations and never the page's code
4
4
  import { existsSync } from 'node:fs'
@@ -379,7 +379,7 @@ export class Planner {
379
379
  }
380
380
 
381
381
  /** the last results of every repo whose look is due, read one repo at a time with the loop given back between
382
- * two, so the sync reads of the run records never stand together (wiki build/shipkit/home.md, Nothing heavy on
382
+ * two, so the sync reads of the run records never stand together (wiki tools/shipkit/home.md, Nothing heavy on
383
383
  * the daemon's loop). The host calls it before `tick`, which then finds them read */
384
384
  async refresh(): Promise<void> {
385
385
  for (const r of [...this.repos.values()]) {
@@ -127,7 +127,7 @@ export function repoSource(d: RepoSourceDeps): PlanSource {
127
127
  const facts = new Map<string, string>()
128
128
  const cache = (): WorldCache => ({ db: answersDb(d.root), ns: d.config().name, now: Date.now })
129
129
  /** the three reads of the run record the plan looks at every LAST_EVERY_MS, read again only once the record moved:
130
- * over a large record they are a sync read of every run (wiki build/shipkit/home.md, Nothing heavy on the daemon's
130
+ * over a large record they are a sync read of every run (wiki tools/shipkit/home.md, Nothing heavy on the daemon's
131
131
  * loop) */
132
132
  let held: { stamp: string; results: Record<string, LastResult>; costs: Record<string, { at: number; ms: number }>; gatedAt: number | null } | null = null
133
133
  const readRecord = (): NonNullable<typeof held> => {
@@ -1,4 +1,4 @@
1
- // what an npm unit publishes names nothing of the house (wiki build/shipkit/units.md): the file list is npm's own
1
+ // what an npm unit publishes names nothing of the house (wiki tools/shipkit/units.md): the file list is npm's own
2
2
  // pack list, the words come from the data (house repos, identities, the keyword file), so a new repo or identity is
3
3
  // covered the day it exists. A hit reports file:line and the masked word, never the word
4
4
  import { createHash } from 'crypto'
@@ -6,7 +6,7 @@ import { existsSync, readdirSync, readFileSync, statSync } from 'fs'
6
6
  import { homedir } from 'os'
7
7
  import { dirname, join, relative } from 'path'
8
8
  import { scanFleet } from '../fleet/scan-fleet.ts'
9
- import { evaluateLeak, globalAllowFile, globalKeywordFile, leakAllowProblem, loadAllowFile, maskPattern, occurrences, parsePatterns, patternFingerprint, type LoadedAllow } from '../hooks/leak-guard.ts'
9
+ import { evaluateLeak, globalAllowFile, withBuiltinRows, globalKeywordFile, leakAllowProblem, loadAllowFile, maskPattern, occurrences, parsePatterns, patternFingerprint, type LoadedAllow } from '../hooks/leak-guard.ts'
10
10
  import { readIdentities, type Identities } from '../identities/identities.ts'
11
11
  import { KEYWORD_FILE, LAYOUT } from '../core/layout.ts'
12
12
  import { parseDirectives, reaches } from '../core/waivers.ts'
@@ -119,7 +119,9 @@ export function allowedWords(pkg: Pkg): AllowedWord[] {
119
119
  const BINARY = /\.(png|jpe?g|gif|webp|ico|woff2?|ttf|eot|otf|zip|gz|wasm|mp3|mp4|ogg|wav|flac|node)$/i
120
120
 
121
121
  /** `directive`: the reason of the in-file `sk-disable-… SK035` that waives the site, null when none does */
122
- export type PublicSite = { file: string; line: number; masked: string; fingerprint: string; what: string; directive: string | null }
122
+ /** `count`: the matches of this pattern in this file, what an allowlist entry's `count` names. `over`: an entry
123
+ * allowed fewer */
124
+ export type PublicSite = { file: string; line: number; masked: string; fingerprint: string; what: string; directive: string | null; count: number; over?: { count: number; source: string } }
123
125
 
124
126
  export const PUBLIC_CLEAN_ID = 'SK035'
125
127
 
@@ -196,11 +198,12 @@ export function scanPublic(o: PublicCleanInput): Omit<PublicCleanResult, 'files'
196
198
  const file = h.file!
197
199
  const content = byFile.get(file) ?? ''
198
200
  if (!found.has(file)) found.set(file, occurrences(content, patterns))
199
- const lines = new Set((found.get(file)!.get(h.pattern) ?? []).map(([s]) => lineAt(content, s)))
201
+ const spans = found.get(file)!.get(h.pattern) ?? []
202
+ const lines = new Set(spans.map(([s]) => lineAt(content, s)))
200
203
  const label = what.get(h.pattern) ?? 'a keyword row'
201
204
  const directives = parseDirectives(file, content).filter((d) => d.reason != null && d.ids.includes(PUBLIC_CLEAN_ID))
202
205
  for (const line of [...lines].sort((a, b) => a - b))
203
- sites.push({ file, line, masked: maskPattern(h.pattern), fingerprint: patternFingerprint(h.pattern), what: label, directive: directives.find((d) => reaches(d, line))?.reason ?? null })
206
+ sites.push({ file, line, masked: maskPattern(h.pattern), fingerprint: patternFingerprint(h.pattern), what: label, directive: directives.find((d) => reaches(d, line))?.reason ?? null, count: spans.length, ...(h.over == null ? {} : { over: { count: h.over.count, source: h.over.source } }) })
204
207
  }
205
208
  sites.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line)
206
209
  return { hits: sites, refused, allowed, waived: waived.map((w) => ({ file: w.file ?? w.where, masked: maskPattern(w.pattern), reason: w.reason, source: w.source })) }
@@ -249,7 +252,7 @@ export async function publicClean(root: string, config: RepoConfig, unit: { dir:
249
252
  rel,
250
253
  files,
251
254
  words: [...houseRepoWords(root), ...(ids == null ? [] : identityWords(ids))],
252
- keywordText: kwFiles.map((f) => read(f) ?? '').join('\n'),
255
+ keywordText: withBuiltinRows(kwFiles.map((f) => read(f) ?? '')),
253
256
  allowedWords: allowedWords(pkg),
254
257
  allow: allow.entries,
255
258
  })
@@ -257,12 +260,27 @@ export async function publicClean(root: string, config: RepoConfig, unit: { dir:
257
260
  }
258
261
 
259
262
  /** the release preflight's refusals: one line a site, the word masked */
263
+ /** the packed files that name a checkout the house config lists under `start.skip` (a day-job repo): such a
264
+ * tarball never ships, and no waiver lifts it. The names come from the machine, so this file names none */
265
+ export function skippedNameSites(files: readonly { file: string; content: string }[], names: readonly string[]): string[] {
266
+ const lower = names.map((n) => n.toLowerCase()).filter((n) => n !== '')
267
+ return files.filter((f) => lower.some((n) => f.content.toLowerCase().includes(n))).map((f) => f.file)
268
+ }
269
+
260
270
  export async function publicCleanBlockers(root: string, config: RepoConfig, unit: { id: string; dir: string; targets: { npm: boolean } }): Promise<string[]> {
261
271
  if (!unit.targets.npm) return []
272
+ const { houseSkip } = await import('../start-repo.ts')
273
+ const skip = await houseSkip(homedir())
274
+ if (skip.length > 0) {
275
+ const listed = await packList(unit.dir)
276
+ if ('error' in listed) return [`unit '${unit.id}': ${listed.error}`]
277
+ const named = skippedNameSites(listed.files.map((f) => ({ file: f, content: readPlain(join(unit.dir, f)) ?? '' })), skip)
278
+ if (named.length > 0) return [`unit '${unit.id}': its tarball names a checkout the house never publishes (start.skip in the house config), no waiver lifts it:\n${named.join('\n')}`]
279
+ }
262
280
  const r = await publicClean(root, config, unit)
263
281
  const sites = [...r.refused.map((x) => `${x.file}: ${x.why}`), ...r.hits.filter((h) => h.directive == null).map((h) => `${h.file}:${h.line}: names ${h.what} (${h.masked}, ${h.fingerprint})`)]
264
282
  if (sites.length === 0) return []
265
- return [`unit '${unit.id}': its tarball names the house (rule SK035, build/shipkit/units.md), ${sites.length} site${sites.length === 1 ? '' : 's'}:\n${sites.slice(0, 20).join('\n')}${sites.length > 20 ? `\n… ${sites.length - 20} more: sk ci --only SK035` : ''}`]
283
+ return [`unit '${unit.id}': its tarball names the house (rule SK035, tools/shipkit/units.md), ${sites.length} site${sites.length === 1 ? '' : 's'}:\n${sites.slice(0, 20).join('\n')}${sites.length > 20 ? `\n… ${sites.length - 20} more: sk ci --only SK035` : ''}`]
266
284
  }
267
285
 
268
286
  /** every file under `dir` on the disk, ignored ones included (npm packs a gitignored file under `files`), as
@@ -254,7 +254,7 @@ export async function runBump(root: string, config: RepoConfig, kind: BumpKind |
254
254
  const s = new Set<string>([LAYOUT.status])
255
255
  if (c.docsBase != null) {
256
256
  const base = c.docsBase.startsWith('~/') ? join(homedir(), c.docsBase.slice(2)) : c.docsBase
257
- const page = join(base, 'build/shipkit/local-projects.md')
257
+ const page = join(base, 'tools/shipkit/local-projects.md')
258
258
  const prefix = r.endsWith('/') ? r : `${r}/`
259
259
  if (page.startsWith(prefix)) s.add(relative(r, page))
260
260
  }
@@ -21,7 +21,7 @@ import { nestedIn, nestedRefusal } from '../core/nesting.ts'
21
21
  import { declaredTestUnits, testCheckId } from '../suite/test-units.ts'
22
22
 
23
23
  // adding a FOURTH knob here is the signal that this shape wants rethinking
24
- // rather than another key (meta/gaps.md, release-path config keys accreting)
24
+ // rather than another key (meta/gaps/index.md, release-path config keys accreting)
25
25
  export type ReleaseConfig = {
26
26
  /** releases ship from this branch only (default 'main') */
27
27
  branch?: string
@@ -33,7 +33,7 @@ export type ReleaseConfig = {
33
33
  * package.json is not private refuses to release until this says true or
34
34
  * false. A private package NEVER publishes, whatever this says. True makes
35
35
  * the root package.json a public contract. What each check does with it:
36
- * wiki/build/shipkit/built-in-checks.md */
36
+ * wiki/tools/shipkit/built-in-checks.md */
37
37
  npm?: boolean
38
38
  /** argv printing an npm auth token on stdout, as in a secret-manager read.
39
39
  * Absent = rely on ambient npm auth. Never put a token in config.
@@ -55,7 +55,7 @@ export type ReleaseConfig = {
55
55
  tsconfig?: string
56
56
  /** check ids the release gate skips: a repo-wide task (a full matrix
57
57
  * build) that is about the REPO rather than the release. Which unit test
58
- * checks a release runs is not this key's: → build/shipkit/units.md */
58
+ * checks a release runs is not this key's: → tools/shipkit/units.md */
59
59
  skipTasks?: string[]
60
60
  /** `shipkit bump` run from a feature branch merges it into the release
61
61
  * branch first, with a merge commit. Default true. A branch is a GATE, so
@@ -41,7 +41,7 @@ export type ServeConfig = {
41
41
  port?: number
42
42
  /** the comfy-ts panel the comfy section embeds runs as its own process on
43
43
  * its own port — house range 5800+, default = the hub port plus 1000
44
- * (build/comfyui.md owns that surface) */
44
+ * (tools/comfyui/index.md owns that surface) */
45
45
  comfyPort?: number
46
46
  /** false hides the asset kit from the hub page (no asset rows, an empty
47
47
  * studio) and from `shipkit needs`, for a repo whose own tool mounts
@@ -106,9 +106,9 @@ export type RepoConfig = {
106
106
  social?: string[]
107
107
  /** the identity that speaks for this repo in public, an id of the house repo's `.shipkit/identities/` (`sk
108
108
  * identities`); unset, the one marked `default: true` speaks. A draft may name another (wiki
109
- * build/shipkit/social.md) */
109
+ * tools/shipkit/social.md) */
110
110
  speaksAs?: string
111
- /** machine-only state of this repo the backup keeps beyond its own rule (wiki build/shipkit/media-store.md,
111
+ /** machine-only state of this repo the backup keeps beyond its own rule (wiki tools/shipkit/media-store.md,
112
112
  * Backup, What a repo adds). Paths are repo relative; what git tracks never goes; a secret is refused as always */
113
113
  backup?: RepoBackup
114
114
  /** prefix for contract fix: pointers (docs checkout or URL) — written by init, never baked in */
@@ -182,12 +182,13 @@ export type RepoConfig = {
182
182
  /** repo-contributed .gitignore lines, rendered INSIDE rule SK004's managed
183
183
  * block — for ecosystem-specific names the published lib may not carry */
184
184
  gitignore?: string[]
185
- /** gitignored paths a task READS, by task id (`'*'` for every task),
186
- * repo-relative: a path joins that task's key by content (generated
187
- * types, a local fixture), and `dir/**` by the names under the dir (an
188
- * output folder a suite lists). A task keyed on the whole work tree sees
189
- * no gitignored file, and a declared list names none either, so both
190
- * carry these. The traced audit (SK031) finds the missing ones and the
185
+ /** paths a task READS outside its key, by task id (`'*'` for every
186
+ * task), repo-relative: a path joins that task's key by content
187
+ * (generated types, a local fixture, a doc a unit's test reads outside
188
+ * its dir), and `dir/**` by the names under the dir (an output folder a
189
+ * suite lists). A task keyed on the whole work tree sees no gitignored
190
+ * file, and a declared list (a unit's `test:<unit>`) sees nothing outside
191
+ * it, so both carry these. The traced audit (SK031) finds the missing ones and the
191
192
  * fix pass writes them into their own managed block; an entry written
192
193
  * outside it stops that repair */
193
194
  ignoredInputs?: Record<string, string[]>
@@ -203,7 +204,7 @@ export type RepoConfig = {
203
204
  nested?: boolean
204
205
  /** THE CHECKS THIS REPO TURNS OFF, check id → why, for a whole check it
205
206
  * does not own (one false finding is waived at its site instead): where
206
- * a check runs is its own declaration (build/shipkit/runs.md), and an
207
+ * a check runs is its own declaration (tools/shipkit/runs.md), and an
207
208
  * off check runs in no context. `defineRepo` throws on a blank reason and on a rule id no
208
209
  * check carries. The hub writes this map through the managed block in
209
210
  * this file (core/when-block.ts). */
@@ -233,7 +234,7 @@ export type RepoConfig = {
233
234
  archived?: boolean
234
235
  /** declared github visibility INTENT (absent = 'private'): public means
235
236
  * strangers read the tracked tree. What each check does with it:
236
- * wiki/build/shipkit/built-in-checks.md */
237
+ * wiki/tools/shipkit/built-in-checks.md */
237
238
  visibility?: 'private' | 'public'
238
239
  /** the reviewer agent type this repo declares: `.claude/agents/<name>.md`,
239
240
  * whose system prompt points at `brief` (an md file holding the standing
@@ -249,7 +250,7 @@ export type RepoConfig = {
249
250
  /** widens the read-only tool allowlist SK008 enforces (default Read, Grep, Glob, Bash) */
250
251
  tools?: string[]
251
252
  }
252
- /** ONE WAY IN escape hatch (build/shipkit/one-way-in.md): governed script names this
253
+ /** ONE WAY IN escape hatch (tools/shipkit/one-way-in.md): governed script names this
253
254
  * repo keeps as a direct tool call. Declared per NAME, never as a list of
254
255
  * banned binaries: the invariant is about which VERBS an agent reaches
255
256
  * for, and a binary blocklist goes stale the day a repo changes runner.
@@ -324,9 +325,15 @@ export type RepoConfig = {
324
325
  browsers?: {
325
326
  /** how many at once, a whole number of 1 or more. Default 2 */
326
327
  max?: number
327
- /** the ssh host whose browser films for this repo, like 'wm': on a Mac no browser of the repo starts, every
328
- * browserSlot there refuses but the box route's own */
329
- box?: string
328
+ /** the box that films for this repo from a Mac, like { host: 'wm', max: 5 }: there every browser start goes to
329
+ * that ssh host's warm browser (shot/box.ts), at most `max` at once (default 2, a pool apart from `max`), and
330
+ * browserSlot refuses any other start. SK_FILM_HERE=1 films on the Mac for one run, under `max` */
331
+ box?: {
332
+ /** the ssh host, as ~/.ssh/config names it */
333
+ host: string
334
+ /** how many at once there, a whole number of 1 or more. Default 2 */
335
+ max?: number
336
+ }
330
337
  }
331
338
  /** the suite budget for a plain `bun test` floor: per suite time limit, the
332
339
  * slow suites the quick tier leaves out, and the suites that cannot run in
@@ -455,7 +462,7 @@ export function defineRepo(c: RepoConfig): RepoConfig {
455
462
  const w = parseWhen(raw)
456
463
  if (typeof w === 'string') throw new Error(`defineRepo: when.${id} ${w}`)
457
464
  if (w.at !== 'off')
458
- throw new Error(`defineRepo: when.${id} '${raw}' no longer places a check: every check declares where it runs (build/shipkit/runs.md). A repo can only turn one off: off: { ${id}: '<why>' }`)
465
+ throw new Error(`defineRepo: when.${id} '${raw}' no longer places a check: every check declares where it runs (tools/shipkit/runs.md). A repo can only turn one off: off: { ${id}: '<why>' }`)
459
466
  }
460
467
  // a budget turns a slow pass yellow, so a value it cannot compare with dies here
461
468
  for (const [id, v] of Object.entries(c.budgets ?? {})) {
@@ -1,4 +1,4 @@
1
- // a card's before and after as a looping animation to send (wiki build/shipkit/review.md, Verbs on the store): the one
1
+ // a card's before and after as a looping animation to send (wiki tools/shipkit/review.md, Verbs on the store): the one
2
2
  // function behind the hub's « animation » and `sk review anim`. One cycle is drawn by ffmpeg's own filters (no per pixel
3
3
  // expression: a card renders in a few seconds), an mp4 then repeats it with no second encode
4
4
  import { createCanvas, GlobalFonts } from '@napi-rs/canvas'
@@ -1,4 +1,4 @@
1
- // auto rules (wiki build/shipkit/review.md, A project's parts): a rule of the repo's review unit answers on a clock, and
1
+ // auto rules (wiki tools/shipkit/review.md, A project's parts): a rule of the repo's review unit answers on a clock, and
2
2
  // its answer is raised as an item to a lane, open from the start. One open item a rule and key. The hub's daemon runs
3
3
  // them (startAuto), `sk review auto` reads their logs and runs one now
4
4
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
@@ -1,4 +1,4 @@
1
- // a thread read as one conversation (wiki build/shipkit/review.md, The thread): every version of a card, every verdict,
1
+ // a thread read as one conversation (wiki tools/shipkit/review.md, The thread): every version of a card, every verdict,
2
2
  // reply, note and state change is one cell, in time order, built at read time from the store's files (a supersedes chain
3
3
  // folds into one thread, nothing is rewritten). The paged list's rows and its query. Pure and browser safe: the routes
4
4
  // send these shapes, the hub page draws them
@@ -10,6 +10,7 @@ import {
10
10
  moveOf,
11
11
  partyOf,
12
12
  reworkOf,
13
+ isPostSubject,
13
14
  stateOf,
14
15
  STATUS_LABEL,
15
16
  thumbFileOf,
@@ -138,6 +139,10 @@ export interface ThreadView {
138
139
  /** the media files a view names that the store no longer holds, `<item id>/<name>`: the page says so in place of a
139
140
  * broken player (the routes fill it, the model never reads the disk) */
140
141
  missing: string[]
142
+ /** the posts he asked from this card (« 📣 post »), oldest first, each with where it stands */
143
+ posts: { id: string; state: ItemState }[]
144
+ /** the social drafts naming this card in their `review:`, oldest first (the routes fill it, the model never reads the disk) */
145
+ drafts: { slug: string; title: string }[]
141
146
  cells: Cell[]
142
147
  }
143
148
 
@@ -300,6 +305,13 @@ export function threadOfId(id: string, threads: readonly Thread[]): Thread | nul
300
305
  return holding.sort((a, b) => b.head.item.created.localeCompare(a.head.item.created))[0] ?? null
301
306
  }
302
307
 
308
+ /** the post requests naming one of these items as their card */
309
+ const postsOf = (ids: ReadonlySet<string>, items: readonly ReviewItem[], followed: ReadonlySet<string>): ThreadView['posts'] =>
310
+ items
311
+ .filter((x) => isPostSubject(x.item.subject) && ids.has(x.item.subject.card))
312
+ .sort((a, b) => a.item.created.localeCompare(b.item.created))
313
+ .map((x) => ({ id: x.item.id, state: stateOf(x, followed.has(x.item.id)) }))
314
+
303
315
  /** one thread for the per card api; `asked` the id the caller named (an old version opens at its cell) */
304
316
  export function threadView(t: Thread, items: readonly ReviewItem[], threads: readonly Thread[], asked: string, now = new Date()): ThreadView {
305
317
  const h = t.head
@@ -330,6 +342,8 @@ export function threadView(t: Thread, items: readonly ReviewItem[], threads: rea
330
342
  .filter((x) => unreadBy(x, 'owner').length > 0)
331
343
  .map((x) => x.item.id),
332
344
  missing: [],
345
+ posts: postsOf(new Set(idsOf(t)), items, followed),
346
+ drafts: [],
333
347
  cells: cellsOf(t, items),
334
348
  }
335
349
  }
@@ -1,4 +1,4 @@
1
- // what `sk review inbox`, `show`, `watch`, `next` and `board` print of an item and its answer (wiki build/shipkit/review.md):
1
+ // what `sk review inbox`, `show`, `watch`, `next` and `board` print of an item and its answer (wiki tools/shipkit/review.md):
2
2
  // one record per thread, rectangles normalized and in pixels, a frame note's cut, shot and time into it, and the lines the
3
3
  // repo's unit adds (a kind's facts, a source's), handed in as `more` so this module stays pure
4
4
  import { aboutText, isFrame, isGallery, isPair, NO_SPEC, placeText, stateOf, unreadBy, verdictOf, type Message, type Rect, type ReviewItem, type Spec, type Subject } from './model.ts'
@@ -130,7 +130,7 @@ export function detail(x: ReviewItem, dir: string, full = false, followed = fals
130
130
  `${r.id} ${st.state.toUpperCase()}${st.why ? ` (${st.why})` : ''} raised by ${raisedBy(r.origin)} ${r.created}${r.commit ? ` at ${r.commit}` : ''}`,
131
131
  head,
132
132
  ...sub,
133
- ...(r.origin.by === 'auto' && r.what ? r.what.split('\n').map((l) => ` ${l}`) : []),
133
+ ...(r.what ? r.what.split('\n').map((l) => ` ${l}`) : []),
134
134
  ...(st.topic ? [` topic ${st.topic}${st.worker ? `, claimed by ${st.worker}` : ''}${r.origin.by === 'owner' && r.origin.kind ? `, ${r.origin.kind}` : ''}`] : []),
135
135
  ...words.map((m) => ` ${m.who} ${m.at}${m.op ? ` ${m.op}${m.topic ? ` ${m.topic}` : ''}` : ''}: ${m.text ?? m.note ?? ''}${m.fix ? ` (${m.fix.commit})` : ''}`),
136
136
  ...(pins ? drawnText(pins) : []),
@@ -1,4 +1,4 @@
1
- // the owner's marks kept in the store (wiki build/shipkit/review.md, Verbs on the store): a mark is a `rate` message of his
1
+ // the owner's marks kept in the store (wiki tools/shipkit/review.md, Verbs on the store): a mark is a `rate` message of his
2
2
  // on a subject (stars, a mark word, a part's stars, a note); the latest is the mark, the older ones its history. Pure
3
3
  import { partyOf, subjectKey, type Message, type ReviewItem, type Spec } from './model.ts'
4
4
 
@@ -1,4 +1,4 @@
1
- // the review store as a kind of the media store (wiki build/shipkit/review.md, Media in the Space): each file a card's
1
+ // the review store as a kind of the media store (wiki tools/shipkit/review.md, Media in the Space): each file a card's
2
2
  // views name, by the facts its item.json keeps; kept on the disk while its thread is active or spoke in the window; an
3
3
  // image's previews sent up before it goes
4
4
  import { existsSync, statSync } from 'node:fs'
@@ -1,4 +1,4 @@
1
- // the reads a route or a tool makes of a card's file (wiki build/shipkit/review.md, Media in the Space): its key in the
1
+ // the reads a route or a tool makes of a card's file (wiki tools/shipkit/review.md, Media in the Space): its key in the
2
2
  // Space by the facts its item.json keeps, a URL signed for a file the disk let go, the file fetched back for its bytes
3
3
  import { existsSync, readFileSync } from 'node:fs'
4
4
  import { join } from 'node:path'
@@ -1,4 +1,4 @@
1
- // the one feedback store's model (wiki build/shipkit/review.md): every record the owner, a player or an agent raises
1
+ // the one feedback store's model (wiki tools/shipkit/review.md): every record the owner, a player or an agent raises
2
2
  // is an ITEM, a head (`item.json`: a typed subject, who raised it, the views) and an append only thread of messages
3
3
  // (verdicts, replies, ratings, state changes, read marks). The state is derived from the thread, never stored, so the
4
4
  // hub and every CLI write at once with no lost update. Pure and browser safe: the store, the routes and the hub page
@@ -28,7 +28,7 @@ export interface FrameSubject extends Subject {
28
28
 
29
29
  export const isFrame = (s: Subject): s is FrameSubject => s.kind === 'frame'
30
30
 
31
- /** a thing of a store page (wiki build/shipkit/stores.md): a picture by its repo path, or a field as `field:<heading>` */
31
+ /** a thing of a store page (wiki tools/shipkit/stores.md): a picture by its repo path, or a field as `field:<heading>` */
32
32
  export interface StoreSubject extends Subject {
33
33
  kind: 'store'
34
34
  store: string
@@ -37,6 +37,14 @@ export interface StoreSubject extends Subject {
37
37
 
38
38
  export const isStoreSubject = (s: Subject): s is StoreSubject => s.kind === 'store' && typeof s.store === 'string' && typeof s.asset === 'string'
39
39
 
40
+ /** a public post he asked for from a card: `card` the card's first version, so every later version asks the same */
41
+ export interface PostSubject extends Subject {
42
+ kind: 'post'
43
+ card: string
44
+ }
45
+
46
+ export const isPostSubject = (s: Subject): s is PostSubject => s.kind === 'post' && typeof s.card === 'string' && s.card !== ''
47
+
40
48
  /** what a repo's `review({...})` unit says of one subject kind that the pure model reads (review/unit.ts holds the rest):
41
49
  * its words, and on the server its key, its near rule and its problems. The hub gets the words alone */
42
50
  export interface SpecKind {
@@ -66,7 +74,7 @@ export interface Spec {
66
74
  }
67
75
 
68
76
  /** the kinds every repo has, whatever its unit declares */
69
- export const BUILTIN_KINDS: Record<string, SpecKind> = { shot: { label: 'images' }, screen: { label: 'screens' }, frame: { label: 'trailer frames' }, store: { label: 'store pages', icon: '🏪' } }
77
+ export const BUILTIN_KINDS: Record<string, SpecKind> = { shot: { label: 'images' }, screen: { label: 'screens' }, frame: { label: 'trailer frames' }, store: { label: 'store pages', icon: '🏪' }, post: { label: 'post requests', icon: '📣' } }
70
78
 
71
79
  export const NO_SPEC: Spec = { kinds: {}, topics: {}, dispatcher: false }
72
80
 
@@ -90,6 +98,7 @@ export function subjectKey(s: Subject, spec: Spec = NO_SPEC): string | null {
90
98
  if (isFrame(s)) return `frame:${s.trailer}/${s.cut}/${s.shot}`
91
99
  const kind = spec.kinds[s.kind]
92
100
  if (!kind && isStoreSubject(s)) return `store:${s.store}/${s.asset}`
101
+ if (!kind && isPostSubject(s)) return `post:${s.card}`
93
102
  if (kind) {
94
103
  const k = kind.key?.(s)
95
104
  return k ? `${s.kind}:${k}` : null
@@ -446,7 +455,7 @@ export const STATUS_LABEL: Record<ShownStatus, string> = {
446
455
  rated: 'rated',
447
456
  }
448
457
 
449
- /** the lifecycle (wiki build/shipkit/review.md, The lifecycle) */
458
+ /** the lifecycle (wiki tools/shipkit/review.md, The lifecycle) */
450
459
  export type State = 'draft' | 'new' | 'question' | 'open' | 'claimed' | 'blocked' | 'asks' | 'closed'
451
460
  type ClosedWhy = ReviewStatus | 'fixed' | 'wontfix' | 'dropped' | 'superseded' | 'withdrawn' | 'rated'
452
461
 
@@ -723,6 +732,7 @@ function subjectProblems(s: unknown, spec: Spec): string[] {
723
732
  if (!kind && !BUILTIN_KINDS[s.kind] && declared.length > 0) return [`subject: kind « ${s.kind} » is none of ${[...declared, ...Object.keys(BUILTIN_KINDS)].join(', ')}`]
724
733
  if (kind?.problems) return kind.problems(s as Subject).map((p) => `subject: ${p}`)
725
734
  if (s.kind === 'store' && !kind) return isStoreSubject(s as Subject) && s.store !== '' && s.asset !== '' ? [] : ['subject: a store thing has its store and asset']
735
+ if (s.kind === 'post' && !kind) return isPostSubject(s as Subject) ? [] : ['subject: a post request names its card']
726
736
  if (s.kind !== 'frame') return []
727
737
  const str = (k: string): boolean => typeof s[k] === 'string' && s[k] !== ''
728
738
  const num = (k: string): boolean => typeof s[k] === 'number' && Number.isFinite(s[k])
@@ -1,9 +1,10 @@
1
1
  // his notes on one thing a desk shows (a store page's picture or field, a draft): the first an item of the one store,
2
2
  // its subject the thing, so the review page and `sk review inbox` hold it; the next ones, while that thread is open,
3
- // his replies on it, never a second item. The one path for a note on a thing (wiki build/shipkit/stores.md)
4
- import { stateOf, subjectKey, type Origin, type ReviewItem, type Subject } from './model.ts'
3
+ // his replies on it, never a second item. The one path for a note on a thing (wiki tools/shipkit/stores.md)
4
+ import { threadOfId } from './cells.ts'
5
+ import { isPostSubject, stateOf, subjectKey, type Origin, type PostSubject, type ReviewItem, type Subject } from './model.ts'
5
6
  import { addMessage, raiseItem, readAll, specOf } from './store.ts'
6
- import { membersOf, threadsOf, type Thread } from './threads.ts'
7
+ import { followedIds, membersOf, threadsOf, type Thread } from './threads.ts'
7
8
 
8
9
  /** one note as a desk shows it: the owner's words, where it stands, the agent's last word once answered */
9
10
  export type SubjectNote = { id: string; at: string; text: string; state: string; answer?: string }
@@ -49,7 +50,7 @@ export function notesBy(dir: string, items: readonly ReviewItem[]): (subject: Su
49
50
  /** his note on the thing: a reply on its thread still open, else a new item titled `<name> : <first line>` */
50
51
  export async function noteOn(
51
52
  dir: string,
52
- o: { subject: Subject; origin: Extract<Origin, { by: 'owner' }>; name: string; text: string; topic?: string; image?: string },
53
+ o: { subject: Subject; origin: Extract<Origin, { by: 'owner' }>; name: string; text: string; topic?: string; image?: string; what?: string },
53
54
  ): Promise<{ id: string }> {
54
55
  const key = keyIn(dir)
55
56
  const k = key(o.subject)
@@ -72,6 +73,53 @@ export async function noteOn(
72
73
  title: head.length > 80 ? `${head.slice(0, 79).trimEnd()}…` : head,
73
74
  text,
74
75
  ...(o.image ? { image: o.image } : {}),
76
+ ...(o.what ? { what: o.what } : {}),
75
77
  })
76
78
  return { id: x.item.id }
77
79
  }
80
+
81
+ /** a post the owner asked from a card and no draft answers yet: what Communications lists on top of its drafts */
82
+ export type AskedPost = { id: string; at: string; card: string; title: string; text: string; state: string }
83
+
84
+ /** every post request not closed, oldest first: the card's title as it is now, the owner's words joined */
85
+ export function askedPosts(items: readonly ReviewItem[]): AskedPost[] {
86
+ const threads = threadsOf(items)
87
+ const followed = followedIds(items)
88
+ return items
89
+ .filter((x) => isPostSubject(x.item.subject))
90
+ .map((x) => ({ x, st: stateOf(x, followed.has(x.item.id)) }))
91
+ .filter(({ st }) => st.state !== 'closed')
92
+ .sort((a, b) => a.x.item.created.localeCompare(b.x.item.created))
93
+ .map(({ x, st }) => {
94
+ const card = (x.item.subject as PostSubject).card
95
+ const t = threadOfId(card, threads)
96
+ const words = x.thread.filter((m) => m.who === 'owner' && m.op === undefined && m.verdict === undefined && m.text !== undefined).map((m) => m.text as string)
97
+ return { id: x.item.id, at: x.item.created, card: t?.head.item.id ?? card, title: t?.head.item.title ?? card, text: words.join('\n'), state: st.state }
98
+ })
99
+ }
100
+
101
+ /** « 📣 post » on a card: a request for its own public post, keyed on the card's first version so every version asks
102
+ * the same one; `topic` the social unit's notes topic, left out where the store's topics lack it */
103
+ export async function askPost(dir: string, o: { card: string; text?: string; topic?: string }): Promise<{ id: string }> {
104
+ const t = threadOfId(o.card, threadsOf(readAll(dir).items))
105
+ if (!t) throw new Error(`post: no card ${o.card}`)
106
+ const head = t.head.item
107
+ if (isPostSubject(head.subject)) throw new Error('post: this card is itself a post request')
108
+ const first = t.versions.at(-1)?.item.id ?? head.id
109
+ const spec = specOf(dir)
110
+ const topic = o.topic !== undefined && (Object.keys(spec.topics).length === 0 || spec.topics[o.topic]) ? o.topic : undefined
111
+ const subject: PostSubject = { kind: 'post', card: first }
112
+ return noteOn(dir, {
113
+ subject,
114
+ origin: { by: 'owner', from: 'review' },
115
+ name: `post « ${head.title} »`,
116
+ text: o.text?.trim() || 'this card deserves its own post',
117
+ ...(topic ? { topic } : {}),
118
+ what: [
119
+ `A public post from the card « ${head.title} » (${head.id}).`,
120
+ `- read the card: \`sk review show ${head.id}\`; its views are the post's media`,
121
+ `- write the draft: \`.shipkit/social/drafts/<YYYYMMDD-HHMMSS>-<topic>/draft.md\`, \`review: ${head.id}\` in its front matter, the media in its \`media/\` (wiki tools/shipkit/social.md)`,
122
+ '- close this request: `sk review fixed <this id> --note "draft <slug>"`',
123
+ ].join('\n'),
124
+ })
125
+ }
@@ -1,4 +1,4 @@
1
- // a view's image at the size the page draws it (wiki build/shipkit/review.md, Previews): a webp made once per media
1
+ // a view's image at the size the page draws it (wiki tools/shipkit/review.md, Previews): a webp made once per media
2
2
  // file, kept in the repo's cache (`.shipkit/cache/review-previews/<id>/<name>.<size>.webp`, local, never in the store),
3
3
  // made again only when its source is newer. The full file is fetched only on zoom
4
4
  import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync } from 'node:fs'
@@ -1,4 +1,4 @@
1
- // a repo's review unit at work (wiki build/shipkit/review.md, A project's parts): its file found by a walk cached on the
1
+ // a repo's review unit at work (wiki tools/shipkit/review.md, A project's parts): its file found by a walk cached on the
2
2
  // walked dirs' times and its text, imported, its spec bound to the store; its sources pulled, its kinds' facts and data
3
3
  // view computed on the server, so the hub never bundles project code
4
4
  import { existsSync } from 'node:fs'
@@ -1,4 +1,4 @@
1
- // the dispatcher role (wiki build/shipkit/review.md, Raised items): one session routes what the owner, the players and
1
+ // the dispatcher role (wiki tools/shipkit/review.md, Raised items): one session routes what the owner, the players and
2
2
  // the rules raise. Its file sits beside the store, out of the store's watch
3
3
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
4
4
  import { join } from 'node:path'
@@ -1,4 +1,4 @@
1
- // the hub's review routes (wiki build/shipkit/review.md, The hub): the store's list, an item's images and clips, the
1
+ // the hub's review routes (wiki tools/shipkit/review.md, The hub): the store's list, an item's images and clips, the
2
2
  // owner's verdicts, replies and read marks appended to its thread. The trailer view's routes: trailer-routes.ts. Paths are
3
3
  // relative to the repo hub's base. null: not a path of these
4
4
  import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
@@ -8,6 +8,7 @@ import { isAnimFormat, isAnimLabels, isAnimMode, pairAnimation } from './anim.ts
8
8
  import { startAuto } from './auto.ts'
9
9
  import { bad, KEEP, NO_STORE, ranged, tagged, TYPES } from './http.ts'
10
10
  import { viewFilesOf, type Rect, type ReviewItem, type Subject } from './model.ts'
11
+ import { askPost } from './notes.ts'
11
12
  import { pasteHosts } from './paste.ts'
12
13
  import { openReview, partFile, viewOfItem } from './project.ts'
13
14
  import { isPreviewSize, previewOrRemote, warmPreviews } from './previews.ts'
@@ -21,6 +22,8 @@ import { trailerRoutes } from './trailer-routes.ts'
21
22
  import { specData, type ReviewUnit } from './unit.ts'
22
23
  import { liveWatchers } from './watchers.ts'
23
24
  import { autoRulesOf } from '../veille/auto.ts'
25
+ import { loadSocialUnit } from '../social/unit.ts'
26
+ import { draftsOfCard } from '../social/card-drafts.ts'
24
27
 
25
28
  // ── each repo's review unit, read again at most every 5 s; its auto rules scheduled in this server while it serves ──
26
29
 
@@ -142,7 +145,10 @@ async function reviewRoute(req: Request, path: string, dir: string, unit: Review
142
145
  }
143
146
  const t = threadOfId(id, x.threads)
144
147
  if (!t) return bad(`no item ${ref}`, 404)
145
- return tagged(req, x.tag, () => ({ ...threadView(t, readAllCached(dir).items, x.threads, id), missing: missingOf(dir, membersOf(t)) }))
148
+ return tagged(req, x.tag, () => {
149
+ const members = membersOf(t)
150
+ return { ...threadView(t, readAllCached(dir).items, x.threads, id), missing: missingOf(dir, members), drafts: draftsOfCard(dirname(dirname(dir)), new Set(members.map((m) => m.item.id))) }
151
+ })
146
152
  }
147
153
  if (path === '/api/review/board' && req.method === 'GET') {
148
154
  const x = indexOf(dir)
@@ -224,6 +230,12 @@ async function reviewRoute(req: Request, path: string, dir: string, unit: Review
224
230
  const r = writeVerdict(dir, id, await req.json())
225
231
  return r.ok ? Response.json(r.message, { headers: NO_STORE }) : Response.json({ error: r.errors.join('\n'), errors: r.errors }, { status: 400, headers: NO_STORE })
226
232
  }
233
+ if (name === 'post') {
234
+ const b = (await req.json().catch(() => ({}))) as { text?: unknown }
235
+ const social = await loadSocialUnit(dirname(dirname(dir)))
236
+ const text = typeof b.text === 'string' ? b.text : undefined
237
+ return Response.json(await askPost(dir, { card: id, topic: social?.notes ?? 'social', ...(text ? { text } : {}) }), { headers: NO_STORE })
238
+ }
227
239
  if (name === 'reply') return Response.json(addMessage(dir, id, 'owner', ((await req.json()) as { text?: unknown }).text), { headers: NO_STORE })
228
240
  if (name === 'read') {
229
241
  // the page names the words it drew: a word that came after them stays unread
@@ -1,4 +1,4 @@
1
- // the one feedback store on disk (wiki build/shipkit/review.md): `.shipkit/review/<id>/`, gitignored: `item.json`, the
1
+ // the one feedback store on disk (wiki tools/shipkit/review.md): `.shipkit/review/<id>/`, gitignored: `item.json`, the
2
2
  // media, and `thread/`, one file per message, never rewritten. An item is built in a dot folder and renamed, every file
3
3
  // written beside its place and renamed, so no reader sees half of one. The format is a project's own store's, verbatim. A folder of
4
4
  // the old shape (request.json, feedback.json, a message with `seen`) fails loud
@@ -606,7 +606,7 @@ function readRaws(dir: string): ReadAll {
606
606
  }
607
607
 
608
608
  /** the same read, the loop given back every READ_STEP items: a cold store of thousands of items is seconds of parsing
609
- * (wiki build/shipkit/home.md, Nothing heavy on the daemon's loop) */
609
+ * (wiki tools/shipkit/home.md, Nothing heavy on the daemon's loop) */
610
610
  async function readRawsAsync(dir: string): Promise<ReadAll> {
611
611
  const steps = readRawsSteps(dir)
612
612
  for (;;) {
@@ -1,4 +1,4 @@
1
- // the threads of the store (wiki build/shipkit/review.md): a card's versions, each superseding the last, and the raised
1
+ // the threads of the store (wiki tools/shipkit/review.md): a card's versions, each superseding the last, and the raised
2
2
  // items (a report, his note) the card answers, read as one thread per bug; their status, conversation and order, and
3
3
  // the active thread a new card already covers. Pure, over the items of review/model.ts
4
4
  import {