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
@@ -1,4 +1,4 @@
1
- // SK002 — .shipkit/* contract fulfillness (meta/contracts.md). The rule is the
1
+ // SK002 — .shipkit/* contract fulfillness (meta/contracts/index.md). The rule is the
2
2
  // registration point; the evaluation machinery stays in
3
3
  // contracts/contracts-engine.ts (venue manifests are DATA rows, not rules —
4
4
  // one SK id covers the invariant "declared contracts are fulfilled, folders
@@ -13,7 +13,7 @@ export const contractsFulfillness = check({
13
13
  blocking: true,
14
14
  title: 'contracts',
15
15
  description: 'every declared venue has a complete contract folder',
16
- owner: 'meta/contracts.md',
16
+ owner: 'meta/contracts/index.md',
17
17
  // keyed on what the contracts read: each artifact, each detector, and each
18
18
  // folder a glob walked through `c.entries`, a gitignored one included
19
19
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
@@ -1,5 +1,5 @@
1
- // SK003 — the CLAUDE.md two-line contract (meta/agent-folder.md): CLAUDE.md
2
- // is an include index, never a doc; `@./agent/index.md` comes LAST (include
1
+ // SK003 — the CLAUDE.md two-line contract (meta/agent-folder/index.md): CLAUDE.md
2
+ // is an include index, never a doc; `@./<agent dir>/index.md` comes LAST (include
3
3
  // order is SEMANTIC — base context first, repo docs after so they
4
4
  // override); a
5
5
  // public repo's `@./CLAUDE.local.md` line-1 indirection must be gitignored.
@@ -7,9 +7,10 @@
7
7
  // which one lands (its house template, or `--include`). A repo with neither
8
8
  // CLAUDE.md nor agent/ is not a two-line-contract repo and passes.
9
9
  import { check, type FixResult } from '../check.ts'
10
+ import { DEFAULT_AGENT_DIR, agentDirOf } from '../core/agent-dir.ts'
10
11
 
11
12
  /** the repo router line, always LAST: start writes it whenever agent/index.md exists */
12
- export const AGENT_LINE = '@./agent/index.md'
13
+ export const AGENT_LINE = `@./${DEFAULT_AGENT_DIR}/index.md`
13
14
  const LOCAL_LINE = '@./CLAUDE.local.md'
14
15
 
15
16
  export const claudeMdShape = check({
@@ -17,18 +18,22 @@ export const claudeMdShape = check({
17
18
  blocking: true,
18
19
  title: 'CLAUDE.md',
19
20
  description: 'CLAUDE.md loads the house wiki into every session',
20
- owner: 'meta/agent-folder.md',
21
+ owner: 'meta/agent-folder/index.md',
21
22
  // keyed on what it reads: CLAUDE.md, whether agent/index.md exists, and
22
23
  // the ignore files git read for the gitignore probe (c.exec runs traced)
23
- runs: { onPreCommit: { budgetMs: 40 }, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
24
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
24
25
  cache: { by: 'reads' },
25
26
  fix: 'ci',
26
27
  applies: 'always',
27
28
  run: async (c) => {
28
- const hasAgent = c.exists('agent/index.md')
29
29
  const claude = c.read('CLAUDE.md')
30
+ // the folder the last include names (a base wiki host names a folder of its wiki), agent/ otherwise
31
+ const dir = agentDirOf(claude)
32
+ const agentIndex = `${dir}/index.md`
33
+ const agentLine = `@./${agentIndex}`
34
+ const hasAgent = c.exists(agentIndex)
30
35
  if (claude == null) {
31
- if (hasAgent) c.fail(`agent/index.md exists but there is no CLAUDE.md routing it — the two-line contract wants ${AGENT_LINE}`)
36
+ if (hasAgent) c.fail(`${agentIndex} exists but there is no CLAUDE.md routing it — the two-line contract wants ${agentLine}`)
32
37
  else c.ok('no CLAUDE.md / agent — not a two-line-contract repo')
33
38
  return
34
39
  }
@@ -38,11 +43,13 @@ export const claudeMdShape = check({
38
43
  if (prose > 0)
39
44
  c.fail(`CLAUDE.md carries ${prose} non-include line(s) — it is a tiny include index, content belongs in agent/index.md`)
40
45
  if (includes.length > 2)
41
- c.fail(`CLAUDE.md has ${includes.length} include lines — the contract is 2: base context, then ${AGENT_LINE}`)
42
- if (hasAgent && !lines.includes(AGENT_LINE))
43
- c.fail(`agent/index.md exists but CLAUDE.md does not import it — add ${AGENT_LINE} as the LAST line`)
44
- if (lines.includes(AGENT_LINE) && lines.at(-1) !== AGENT_LINE)
45
- c.fail(`include order inverted — base context first, ${AGENT_LINE} LAST (order is semantic: repo docs override the base)`)
46
+ c.fail(`CLAUDE.md has ${includes.length} include lines — the contract is 2: base context, then ${agentLine}`)
47
+ if (hasAgent && !lines.includes(agentLine))
48
+ c.fail(`${agentIndex} exists but CLAUDE.md does not import it — add ${agentLine} as the LAST line`)
49
+ if (lines.includes(agentLine) && lines.at(-1) !== agentLine)
50
+ c.fail(`include order inverted — base context first, ${agentLine} LAST (order is semantic: repo docs override the base)`)
51
+ if (dir !== DEFAULT_AGENT_DIR && !hasAgent)
52
+ c.fail(`CLAUDE.md's last include names ${agentIndex}, which does not exist: the agent folder it declares is missing`)
46
53
  if (lines.includes(LOCAL_LINE)) {
47
54
  const r = await c.exec(['git', 'check-ignore', '-q', 'CLAUDE.local.md'], { cwd: c.root, timeoutMs: 5_000 })
48
55
  if (r.code === 1)
@@ -58,7 +65,7 @@ export const claudeMdShape = check({
58
65
  // trading a loud FAIL for a permanent silent gap. Creation and prose
59
66
  // relocation stay human/machine-local (`shipkit start --include`).
60
67
  repair: (c): FixResult => {
61
- if (!c.exists('agent/index.md')) return { changed: false, summary: 'no agent/index.md — nothing mechanical to fix' }
68
+ if (!c.exists(`${DEFAULT_AGENT_DIR}/index.md`)) return { changed: false, summary: 'no agent/index.md — nothing mechanical to fix' }
62
69
  const cur = c.read('CLAUDE.md')
63
70
  if (cur == null) return { changed: false, summary: 'CLAUDE.md missing — creation needs the base include (shipkit start <name> writes it), not autofixable' }
64
71
  if (cur.split('\n').includes(AGENT_LINE)) return { changed: false, summary: `${AGENT_LINE} already routed — remaining findings need a human` }
@@ -1,4 +1,4 @@
1
- // SK004 — the .gitignore policy block (meta/contracts.md git policy;
1
+ // SK004 — the .gitignore policy block (meta/contracts/index.md git policy;
2
2
  // .shipkit/tmp/ spelled out because shipkit writes its per-run logs there in
3
3
  // every repo). A marker-keyed managed block so the always-gitignored contract
4
4
  // surfaces can never silently rot per repo. Ecosystem-specific names the
@@ -31,10 +31,12 @@ const END = '# <<< shipkit gitignore policy'
31
31
  const CONTRIB = '# repo-contributed lines (repo.config.ts gitignore:)'
32
32
 
33
33
  const DRAFTS_BACK = '!.comfy-ts/drafts/'
34
+ const SOCIAL_BACK = `!${LAYOUT.social}/`
34
35
 
35
36
  /** re-includes a private repo carries and a declared public one drops: a
36
- * draft names private loras, a plan or a board quotes the owner */
37
- const PRIVATE_ONLY: ReadonlySet<string> = new Set([DRAFTS_BACK, `!${LAYOUT.plans}/`])
37
+ * draft names private loras, a plan or a board quotes the owner, a social
38
+ * draft carries his angles and notes */
39
+ const PRIVATE_ONLY: ReadonlySet<string> = new Set([DRAFTS_BACK, `!${LAYOUT.plans}/`, SOCIAL_BACK])
38
40
 
39
41
  export const POLICY_LINES = [
40
42
  // everything shipkit keeps lives under .shipkit/ (core/layout.ts). Local
@@ -44,6 +46,10 @@ export const POLICY_LINES = [
44
46
  // below the block, `!.shipkit/itch/`, where the last match wins
45
47
  `${SHIPKIT_DIR}/*`,
46
48
  ...TRACKED_DIRS.map((d) => `!${d}/`),
49
+ // the social drafts, posted or not: what was said where is history the
50
+ // desks date posts from. A rendered trailer is made again by its command
51
+ SOCIAL_BACK,
52
+ `${LAYOUT.social}/drafts/**/*-trailer.mp4`,
47
53
  `${LAYOUT.assets}/out/`,
48
54
  // already covered by the line above, and spelled out anyway so this check
49
55
  // asks git about it: a negation below the block that exposed the keyword
@@ -156,6 +162,21 @@ async function trackedGenerated(d: Disk): Promise<string[]> {
156
162
  return GENERATED_TRACKED_PATHS.filter((p) => listed.has(p))
157
163
  }
158
164
 
165
+ /** a declared public repo's files under the private only folders git still tracks: the block ignores what git does
166
+ * not hold yet, never a file tracked before the flip */
167
+ async function trackedPrivate(d: Disk, config: RepoConfig): Promise<Map<string, number>> {
168
+ const out = new Map<string, number>()
169
+ if (!declaredPublic(config) || !d.exists('.git')) return out
170
+ const dirs = [LAYOUT.plans, LAYOUT.social]
171
+ const r = await d.exec([gitBin(), 'ls-files', '-z', '--', ...dirs], { cwd: d.root })
172
+ if (r.code !== 0) return out
173
+ for (const f of r.out.split('\0')) {
174
+ const dir = dirs.find((x) => f.startsWith(`${x}/`))
175
+ if (dir) out.set(dir, (out.get(dir) ?? 0) + 1)
176
+ }
177
+ return out
178
+ }
179
+
159
180
  type Parsed = { text: string; crlf: boolean; lines: string[]; b: number; e: number }
160
181
 
161
182
  function parse(d: Disk): Parsed | null {
@@ -209,8 +230,9 @@ export const gitignorePolicy = check({
209
230
  blocking: true,
210
231
  title: '.gitignore',
211
232
  description: 'the managed .gitignore block keeps private contract folders out of git',
212
- owner: 'meta/contracts.md',
213
- // it untracks generated files (a commit) unless the run is frozen
233
+ owner: 'meta/contracts/index.md',
234
+ // unless the run is frozen: its body rewrites a stale block, its repair
235
+ // untracks generated files (a commit)
214
236
  writes: true,
215
237
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
216
238
  // .gitignore plus what git currently TRACKS and IGNORES, which the tree
@@ -233,7 +255,20 @@ export const gitignorePolicy = check({
233
255
  c.lines.push({ kind: 'fix-fail', text: 'shipkit ci (or check --fix SK004) moves them and lands one commit' })
234
256
  }
235
257
  const legacy = hasLegacy(c.root)
236
- const s = blockState(c, c.config, legacy)
258
+ let s = blockState(c, c.config, legacy)
259
+ // a stale block means shipkit's policy moved, not that this repo broke:
260
+ // every run that may write renders it in place, so a policy change never
261
+ // turns the whole fleet red until each repo runs its gate
262
+ if (s === 'stale') {
263
+ if (c.frozen) {
264
+ c.warn('.gitignore policy block is stale: the policy moved, and a frozen run rewrites nothing')
265
+ c.lines.push({ kind: 'fix-warn', text: 'any run that is not frozen rewrites it in place (sk check, sk ci)' })
266
+ return
267
+ }
268
+ writeBlock(c, c.config, legacy)
269
+ c.note('.gitignore policy block rewritten in place: the policy or repo-contributed lines moved')
270
+ s = blockState(c, c.config, legacy)
271
+ }
237
272
  switch (s) {
238
273
  case 'missing-file': return c.fail('.gitignore missing — the contract git policy is unenforced')
239
274
  case 'missing-block': return c.fail('.gitignore has no shipkit policy block — contract surfaces can leak into git')
@@ -285,6 +320,10 @@ export const gitignorePolicy = check({
285
320
  return
286
321
  }
287
322
  c.ok(`.gitignore policy block current, ${claimed.length + backProbes.size} patterns verified against git`)
323
+ for (const [dir, n] of await trackedPrivate(c, c.config)) {
324
+ c.warn(`a public repo still tracks ${n} file${n === 1 ? '' : 's'} under ${dir}/: strangers read them, and the block keeps only new ones local`)
325
+ c.lines.push({ kind: 'fix-warn', text: `git rm -r --cached -q ${dir} && git commit -m "untrack ${dir}" -- ${dir} (the files stay on the disk)` })
326
+ }
288
327
  },
289
328
  repair: async (c): Promise<FixResult> => {
290
329
  // the move first: it writes the new block itself, before any folder moves
@@ -57,7 +57,7 @@ import { isRunningCopy, rememberLatest } from '../core/self-update.ts'
57
57
  import { rootPublishesNpm } from '../core/repo-facts.ts'
58
58
  import { mutateLease, withMutateLease } from '../core/locked-write.ts'
59
59
  import { detectPackageManager, isRefusal, LOCK_FILES } from '../core/package-manager.ts'
60
- import { check, type CheckEnv } from '../check.ts'
60
+ import { check } from '../check.ts'
61
61
 
62
62
  type Pkg = { version?: string; dependencies?: Record<string, string>; devDependencies?: Record<string, string> }
63
63
 
@@ -87,7 +87,7 @@ export const rvlibVersions = check({
87
87
  blocking: true,
88
88
  title: 'rvlib versions',
89
89
  description: 'the rvlib packages installed here are as new as the published ones',
90
- owner: 'build/shipkit/consuming.md',
90
+ owner: 'tools/shipkit/consuming.md',
91
91
  // it updates the rvlib deps unless the run is frozen
92
92
  writes: true,
93
93
  runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: true, onHealth: true, onSave: false, onClock: { every: '24h', inactive: 'wait' } },
@@ -1,4 +1,4 @@
1
- // SK006 — npm publish safety (meta/rv-conventions/package-json.md).
1
+ // SK006 — npm publish safety (patterns/rv-conventions/package-json.md).
2
2
  // `private: true` is npm's own unconditional publish refusal — THE lock
3
3
  // (SK001 enforces its presence). This rule closes the contradiction class
4
4
  // around it: a private package carrying publish machinery is either a
@@ -37,7 +37,7 @@ export const npmPublishSafety = check({
37
37
  blocking: true,
38
38
  title: 'npm publish safety',
39
39
  description: 'a private package carries no publish machinery',
40
- owner: 'meta/rv-conventions/package-json.md',
40
+ owner: 'patterns/rv-conventions/package-json.md',
41
41
  // keyed on what it reads: the root package.json and every declared release
42
42
  // unit's, at the dirs the config picks
43
43
  runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
@@ -67,7 +67,7 @@ export const npmPublishSafety = check({
67
67
  `${localHits.join(', ')} — a local protocol cannot resolve on a consumer's machine, so publishing that ships a package which fails at install. Declare the version it WILL be, and keep the local wiring in overrides (npm ignores those from a dependency) or in devDependencies`,
68
68
  )
69
69
  if (pkg.name?.startsWith('rvlib-') === true) {
70
- if (localHits.length === 0) c.ok('rvlib-* package — publishes by design (distribute/npm owns it)')
70
+ if (localHits.length === 0) c.ok('rvlib-* package — publishes by design (guides/npm owns it)')
71
71
  return
72
72
  }
73
73
  if (rootPublishesNpm(c.config)) {
@@ -1,4 +1,4 @@
1
- // SK007 — github visibility tripwire (meta/contracts.md pre-public gate).
1
+ // SK007 — github visibility tripwire (meta/contracts/index.md pre-public gate).
2
2
  // `repo.config.ts visibility: 'private' | 'public'` (absent = 'private')
3
3
  // states the INTENT; gh states the FACT; a mismatch in either direction is
4
4
  // red — public-while-declared-private is the leak case,
@@ -26,7 +26,7 @@ export const githubVisibility = check({
26
26
  blocking: false,
27
27
  title: 'github visibility',
28
28
  description: 'the github visibility of this repo matches the one it declares',
29
- owner: 'meta/contracts.md',
29
+ owner: 'meta/contracts/index.md',
30
30
  runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: 'moved', onClock: 'once' },
31
31
  cache: { by: 'fact', key: (env) => declaredVisibility(env.config) },
32
32
  fix: 'none',
@@ -10,7 +10,7 @@
10
10
  import { existsSync, mkdirSync, readFileSync } from 'fs'
11
11
  import { dirname, join } from 'path'
12
12
  import type { RepoConfig } from '../repo-config.ts'
13
- import { check, type FixResult, type CheckEnv } from '../check.ts'
13
+ import { check, type FixResult } from '../check.ts'
14
14
  import { LAYOUT } from '../core/layout.ts'
15
15
  import { atomicWrite } from '../core/locked-write.ts'
16
16
  import { configPath, fileStamp } from '../core/file-stamp.ts'
@@ -85,8 +85,8 @@ export const reviewerAgent = check({
85
85
  blocking: true,
86
86
  title: 'reviewer definition',
87
87
  description: 'the declared reviewer agent has its brief, its definition and read only tools',
88
- owner: 'identity/how-we-work.md',
89
- runs: { onPreCommit: { budgetMs: 20 }, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
88
+ owner: 'preferences/how-we-work/index.md',
89
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
90
90
  // the answer is the config, the definition file and the brief. The brief
91
91
  // is a CONFIG path that may sit outside the repo, so both files enter the
92
92
  // key by content, wherever they live
@@ -1,4 +1,4 @@
1
- // SK010 — undeclared unit (build/shipkit/units.md). Units are
1
+ // SK010 — undeclared unit (tools/shipkit/units.md). Units are
2
2
  // DECLARED, never inferred, so resolution is deterministic. This rule is the
3
3
  // other half of that deal: a package.json sitting in the repo that no unit
4
4
  // claims would be invisible to every release surface, and its version would
@@ -37,7 +37,7 @@ export const undeclaredUnit = check({
37
37
  blocking: true,
38
38
  title: 'units declared',
39
39
  description: 'every package.json is a declared unit or declared not releasable',
40
- owner: 'build/shipkit/units.md',
40
+ owner: 'tools/shipkit/units.md',
41
41
  // keyed on what it reads: the listing of every package.json, each one it
42
42
  // opens, and the declared units' package.json
43
43
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
@@ -1,5 +1,5 @@
1
1
  // SK011 — a dependency range on a SIBLING unit must be satisfied by
2
- // the version that sibling actually carries (build/shipkit/units.md).
2
+ // the version that sibling actually carries (tools/shipkit/units.md).
3
3
  //
4
4
  // The failure it exists for: one unit is edited and its dependents keep a
5
5
  // range that names a version nobody published, or an older one that lacks the
@@ -58,7 +58,7 @@ export const siblingUnitRanges = check({
58
58
  blocking: true,
59
59
  title: 'sibling unit ranges',
60
60
  description: 'every range on a sibling unit floors at the version that sibling carries',
61
- owner: 'build/shipkit/built-in-checks.md',
61
+ owner: 'tools/shipkit/built-in-checks.md',
62
62
  // keyed on what it reads: every declared unit's package.json, at the dirs
63
63
  // the config picks
64
64
  runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
@@ -29,8 +29,8 @@ export const configBarrelImport = check({
29
29
  blocking: true,
30
30
  title: 'config import path',
31
31
  description: 'repo.config.ts imports `defineRepo` from the narrow module, never the barrel',
32
- owner: 'build/shipkit/config-keys.md',
33
- runs: { onPreCommit: { budgetMs: 20 }, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
32
+ owner: 'tools/shipkit/config-keys.md',
33
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
34
34
  cache: { by: 'reads' },
35
35
  fix: 'ci',
36
36
  applies: 'always',
@@ -1,4 +1,4 @@
1
- // SK013 — the harness half of ONE WAY IN (build/shipkit/one-way-in.md). Rule SK001 routes
1
+ // SK013 — the harness half of ONE WAY IN (tools/shipkit/one-way-in.md). Rule SK001 routes
2
2
  // the package.json scripts, and that alone is not enough: `bun test` is a bun
3
3
  // BUILTIN, so no script can intercept it and the reflex stays open. This rule
4
4
  // makes the repo carry the two things that CAN close it, and repairs them:
@@ -20,7 +20,7 @@ import type { RepoConfig } from '../repo-config.ts'
20
20
  import { repoOff } from '../core/when.ts'
21
21
  import { check, type CheckCtx, type FixResult } from '../check.ts'
22
22
 
23
- const OWNER = 'build/shipkit/one-way-in.md'
23
+ const OWNER = 'tools/shipkit/one-way-in.md'
24
24
  export const SETTINGS_PATH = '.claude/settings.json'
25
25
 
26
26
  type Settings = {
@@ -1,4 +1,4 @@
1
- // SK015 nested repo (build/shipkit.md): a repo.config.ts inside a larger git
1
+ // SK015 nested repo (tools/shipkit/index.md): a repo.config.ts inside a larger git
2
2
  // work tree declares `nested: true`, and a work tree root never does. The call
3
3
  // sites that write history refuse on the disk fact either way (core/nesting.ts),
4
4
  // so this rule is about the declaration telling the truth to the next reader.
@@ -11,8 +11,8 @@ export const nestedRepo = check({
11
11
  blocking: true,
12
12
  title: 'nested repo',
13
13
  description: 'a config inside a larger work tree declares `nested: true`, and only there',
14
- owner: 'build/shipkit/config-keys.md',
15
- runs: { onPreCommit: { budgetMs: 20 }, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
14
+ owner: 'tools/shipkit/config-keys.md',
15
+ runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
16
16
  // the declaration, and where the git work tree root sits, which no tree
17
17
  // id describes, so its path is the rest of the key
18
18
  cache: { by: 'files', inputs: [CONFIG_FILE], key: (env) => `nested=${env.config.nested === true}|top=${nestedIn(env.root) ?? 'root'}` },
@@ -1,5 +1,5 @@
1
1
  // SK016 — the shapes the check file replaced, and the machine that
2
- // rewrites them (build/shipkit/writing-a-check.md owns the shape itself).
2
+ // rewrites them (tools/shipkit/writing-a-check.md owns the shape itself).
3
3
  //
4
4
  // The window: every shape below is still READ, named once per run, and
5
5
  // refused at the first release after `shipkit fleet` shows no repo below 0.40
@@ -37,7 +37,7 @@ const inOwnProcess = (c: CheckCtx): ConfigRewriter => async (plan) => {
37
37
  }
38
38
  }
39
39
 
40
- const OWNER = 'build/shipkit/writing-a-check.md'
40
+ const OWNER = 'tools/shipkit/writing-a-check.md'
41
41
 
42
42
  export const legacyCheckShapes = check({
43
43
  id: 'SK016',
@@ -1,4 +1,4 @@
1
- // SK017 vscode hub task (build/vscode-tasks.md): no folder-open task starts
1
+ // SK017 vscode hub task (patterns/vscode-tasks/index.md): no folder-open task starts
2
2
  // the shipkit hub (it runs in the home, and VS Code needs no task for it), and
3
3
  // no `👁 TSC` watcher runs beside a gate that already runs `typecheck`.
4
4
  //
@@ -190,7 +190,7 @@ export const vscodeHubTask = check({
190
190
  blocking: false,
191
191
  title: 'vscode hub task',
192
192
  description: 'no vscode task starts the shipkit hub, and no extra tsc watcher runs',
193
- owner: 'build/vscode-tasks.md',
193
+ owner: 'patterns/vscode-tasks/index.md',
194
194
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: false, onHealth: true, onSave: 'moved', onClock: false },
195
195
  cache: { by: 'reads' },
196
196
  fix: 'ci',
@@ -1,4 +1,4 @@
1
- // SK018 — every test file runs in a check (build/shipkit/test-runner.md).
1
+ // SK018 — every test file runs in a check (tools/shipkit/test-runner.md).
2
2
  // A `*.test.ts` that no check runs is a green nobody measured: the file says
3
3
  // something is proved, and nothing proves it. Each file belongs to the release
4
4
  // unit whose dir holds it (the root takes the rest), and the unit's own
@@ -12,7 +12,7 @@ export const testFilesRun = check({
12
12
  blocking: true,
13
13
  title: 'test files run',
14
14
  description: 'every test file in the repo runs in a test check or is ignored on purpose',
15
- owner: 'build/shipkit/test-runner.md',
15
+ owner: 'tools/shipkit/test-runner.md',
16
16
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
17
17
  cache: { by: 'reads' },
18
18
  fix: 'none',
@@ -1,4 +1,4 @@
1
- // SK019 — tests run through the generated test checks only (build/shipkit/test-runner.md).
1
+ // SK019 — tests run through the generated test checks only (tools/shipkit/test-runner.md).
2
2
  // The floor `test` slot and one `test:<unit>` per declared
3
3
  // unit are the ONE way tests run: in the unit's dir with its bunfig and
4
4
  // preload, parallel, timed against the budget, and planned file by file by
@@ -37,7 +37,7 @@ export const testsRunInUnits = check({
37
37
  blocking: true,
38
38
  title: 'tests run in unit checks',
39
39
  description: 'no check runs the test runner itself: tests run only in the generated test checks',
40
- owner: 'build/shipkit/test-runner.md',
40
+ owner: 'tools/shipkit/test-runner.md',
41
41
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
42
42
  cache: { by: 'reads' },
43
43
  fix: 'none',
@@ -1,4 +1,4 @@
1
- // SK020: a check file never spawns itself (build/shipkit/writing-a-check.md
1
+ // SK020: a check file never spawns itself (tools/shipkit/writing-a-check.md
2
2
  // owns the one body shape, `run: (c) => …`). A `cmd` that names the file's
3
3
  // own path runs the file a second time, in its own process, behind an
4
4
  // `import.meta.main` guard: a second way to write a body, with none of what
@@ -11,7 +11,7 @@ import { check } from '../check.ts'
11
11
  import { isLegacyCheckSource } from '../core/check-file-names.ts'
12
12
  import { repoCheckSources } from '../core/legacy-shapes.ts'
13
13
 
14
- const OWNER = 'build/shipkit/writing-a-check.md'
14
+ const OWNER = 'tools/shipkit/writing-a-check.md'
15
15
 
16
16
  /** the source with every comment blanked, so a file that MENTIONS the
17
17
  * shape in a comment is not a file that has it, and a `/*` inside a glob
@@ -1,4 +1,4 @@
1
- // SK022 machine runs the pin (build/shipkit/home.md): on a machine with a house
1
+ // SK022 machine runs the pin (tools/shipkit/home.md): on a machine with a house
2
2
  // every shipkit runs the house copy, whatever a repo installed, so a repo's
3
3
  // rvlib-shipkit pin is a minimum. It warns when the repo asks for a version
4
4
  // newer than the one this process runs: a rule or an api that pin relies on
@@ -24,7 +24,7 @@ export const machineRunsThePin = check({
24
24
  blocking: false,
25
25
  title: 'machine runs the pin',
26
26
  description: 'the shipkit this machine runs is at least the version this repo pins',
27
- owner: 'build/shipkit/home.md',
27
+ owner: 'tools/shipkit/home.md',
28
28
  runs: { onPreCommit: false, onCi: false, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
29
29
  // the pin, the install (gitignored) and the version this machine runs,
30
30
  // which is no file of the repo
@@ -17,7 +17,7 @@ export const identityColors = check({
17
17
  blocking: false,
18
18
  title: 'identity colors',
19
19
  description: 'repo.config.ts declares identity colours: colorLight and colorDark, two hex',
20
- owner: 'build/shipkit/built-in-checks.md',
20
+ owner: 'tools/shipkit/built-in-checks.md',
21
21
  runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: 'moved', onClock: false },
22
22
  // the config, and the installed lib that says whether it knows the key
23
23
  cache: { by: 'files', inputs: [CONFIG_FILE], key: (env) => `installed=${fileStamp(join(env.root, INSTALLED_CONFIG_SRC))}` },
@@ -1,4 +1,4 @@
1
- // SK025 release drift (build/shipkit/built-in-checks.md): every unit this repo
1
+ // SK025 release drift (tools/shipkit/built-in-checks.md): every unit this repo
2
2
  // releases matches what npm serves and what its push remote holds, the same
3
3
  // survey `shipkit releases` prints. It replaces a drift copy per page. A repo
4
4
  // that releases nothing (a private root with no release config and no units)
@@ -40,7 +40,7 @@ export const releaseDrift = check({
40
40
  blocking: false,
41
41
  title: 'release drift',
42
42
  description: 'every unit this repo releases matches npm and its push remote',
43
- owner: 'build/shipkit/built-in-checks.md',
43
+ owner: 'tools/shipkit/built-in-checks.md',
44
44
  runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: false, onClock: { every: (last) => (last?.status === 'pass' ? ['20h', '28h'] : '4h'), inactive: 'wait' } },
45
45
  cache: { by: 'ttl', span: '20h', key: (env) => releasedUnits(env.root, env.config).map((u) => `${u.id}@${u.version}`).join(',') },
46
46
  fix: 'none',
@@ -1,4 +1,4 @@
1
- // SK026 asks auto close (build/shipkit/built-in-checks.md): probe every open
1
+ // SK026 asks auto close (tools/shipkit/built-in-checks.md): probe every open
2
2
  // ask's own `check:` and archive the ones that pass, so an act done in the
3
3
  // world leaves the queue without anyone editing a file. An open queue is no
4
4
  // warning: the hub and `shipkit needs` show it. A repo with no queue skips.
@@ -13,7 +13,7 @@ export const asksAutoclose = check({
13
13
  blocking: false,
14
14
  title: 'asks auto close',
15
15
  description: 'no open ask whose own probe passes stays in the queue',
16
- owner: 'build/shipkit/built-in-checks.md',
16
+ owner: 'tools/shipkit/built-in-checks.md',
17
17
  runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: false, onClock: { every: ['20h', '28h'], inactive: 'wait' } },
18
18
  cache: { by: 'never', why: "runs each open ask's own probe, a shell command that reads the world" },
19
19
  fix: 'none',
@@ -1,4 +1,4 @@
1
- // SK027 agent wiki links (build/shipkit/built-in-checks.md): a repo's agent/
1
+ // SK027 agent wiki links (tools/shipkit/built-in-checks.md): a repo's agent/
2
2
  // IS an md wiki, entered by agent/index.md. Every page is LISTED by an index
3
3
  // (src/wiki/agent-index.ts: one bullet, numbered item, table row or @ include
4
4
  // names it or its folder), every index is in sight of what a session loads,
@@ -9,6 +9,8 @@
9
9
  import { existsSync, readFileSync } from 'fs'
10
10
  import { basename, dirname, join } from 'path'
11
11
  import { check } from '../check.ts'
12
+ import { DEFAULT_AGENT_DIR, nestedAgentDir } from '../core/agent-dir.ts'
13
+ import { agentDirAt } from '../core/agent-dir-at.ts'
12
14
  import { CONTRIBUTION_FILE } from '../core/global-contribution.ts'
13
15
  import { indexCovers, indexesOutOfSight, loadedFiles, unlisted } from '../wiki/agent-index.ts'
14
16
  import { lintMd } from '../wiki/lint-md.ts'
@@ -18,13 +20,17 @@ export const agentWikiLinks = check({
18
20
  blocking: true,
19
21
  title: 'agent wiki links',
20
22
  description: 'every agent/ page is listed by an index a session sees, and every agent/ link resolves',
21
- owner: 'meta/agent-folder.md',
23
+ owner: 'meta/agent-folder/index.md',
22
24
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
23
25
  // the md lint walks agent/ on disk rather than through `c`; the loaded context starts at CLAUDE.md
24
26
  cache: { by: 'files', inputs: ['agent', 'CLAUDE.md', 'CLAUDE.local.md'], key: null },
25
27
  fix: 'none',
26
28
  applies: 'always',
27
29
  run: (c) => {
30
+ // a nested agent folder is a folder of another wiki, whose lint (and wiki-root relative routes) cover it
31
+ const dir = agentDirAt(c.root)
32
+ if (nestedAgentDir(dir)) return void c.lines.push({ kind: 'skip', text: `the agent folder ${dir}/ is a folder of another wiki, whose own lint covers it` })
33
+ if (dir !== DEFAULT_AGENT_DIR) return void c.fail(`CLAUDE.md names ${dir}/ as the agent folder: it is agent/, or a folder of another wiki (meta/agent-folder/index.md)`)
28
34
  if (!existsSync(join(c.root, 'agent/index.md'))) return void c.lines.push({ kind: 'skip', text: 'no agent/ wiki in this repo' })
29
35
  const lint = lintMd({ root: join(c.root, 'agent'), index: 'index.md', boundary: c.root })
30
36
  const read = (p: string): string | null => {
@@ -1,4 +1,4 @@
1
- // SK028 readme (build/shipkit/built-in-checks.md): the README.md a repo's hub
1
+ // SK028 readme (tools/shipkit/built-in-checks.md): the README.md a repo's hub
2
2
  // page shows exists and carries what makes the repo recognizable at a glance.
3
3
  // A list of named requirements, each reporting its own line, so a new
4
4
  // mandatory item is one more entry. Read through `c` only, so the answer is
@@ -67,7 +67,7 @@ export const readme = check({
67
67
  blocking: false,
68
68
  title: 'readme',
69
69
  description: 'README.md exists and shows at least one screenshot',
70
- owner: 'build/shipkit/built-in-checks.md',
70
+ owner: 'tools/shipkit/built-in-checks.md',
71
71
  runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: 'moved', onClock: false },
72
72
  cache: { by: 'reads' },
73
73
  fix: 'none',
@@ -1,4 +1,4 @@
1
- // SK029 explicit check files (build/shipkit/runs.md owns the declaration):
1
+ // SK029 explicit check files (tools/shipkit/runs.md owns the declaration):
2
2
  // every check file of the repo declares runs, cache, fix and applies, with
3
3
  // no retired key. A file that does not does not load, and discovery shows
4
4
  // it as one failing row. The repair ports it with the values the retired
@@ -49,7 +49,7 @@ export const explicitCheckFiles = check({
49
49
  id: 'SK029',
50
50
  title: 'explicit check files',
51
51
  description: 'every check file declares runs, cache, fix and applies, and the config says only off',
52
- owner: 'build/shipkit/runs.md',
52
+ owner: 'tools/shipkit/runs.md',
53
53
  blocking: true,
54
54
  runs: { onPreCommit: false, onCi: true, onFull: true, onRelease: true, onHealth: true, onSave: 'moved', onClock: false },
55
55
  // the listing of check files and their sources, read through `c`
@@ -79,7 +79,7 @@ export const explicitCheckFiles = check({
79
79
  if (run.did.length > 0) did.push(`ported ${run.did.join('; ')}`)
80
80
  hand.push(...run.hand)
81
81
  } catch {
82
- hand.push(`the port did not answer (exit ${r.code}: ${r.out.trim().slice(0, 160)}): port ${files.map((f) => f.rel).join(', ')} by hand (build/shipkit/runs.md)`)
82
+ hand.push(`the port did not answer (exit ${r.code}: ${r.out.trim().slice(0, 160)}): port ${files.map((f) => f.rel).join(', ')} by hand (tools/shipkit/runs.md)`)
83
83
  }
84
84
  }
85
85
  if (cfg.keys.length > 0) {
@@ -1,4 +1,4 @@
1
- // SK030 cache audit (build/shipkit/runs.md owns the cache): a sample of the
1
+ // SK030 cache audit (tools/shipkit/runs.md owns the cache): a sample of the
2
2
  // checks the cache answers is re-run fresh about once a day, and a cached
3
3
  // green a fresh run disagrees with fails, naming the check whose key misses a
4
4
  // path. The work is `sk cache-audit` (core/cache-audit.ts), in its own
@@ -12,11 +12,13 @@ export const cacheAudit = check({
12
12
  id: 'SK030',
13
13
  title: 'cache audit',
14
14
  description: 'a sample of cached answers matches what a fresh run of each check says',
15
- owner: 'build/shipkit/runs.md',
15
+ owner: 'tools/shipkit/runs.md',
16
16
  blocking: true,
17
- // never a gate: it re-runs other checks. The daemon asks it about once a
18
- // day, and only while somebody works in the repo
19
- runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: true, onSave: false, onClock: { every: ['20h', '28h'], inactive: 'wait' } },
17
+ // never a gate and never the health pass: it re-runs other checks fresh,
18
+ // minutes of work that made a plain `sk check` take ten. The daemon asks
19
+ // it about once a day, only while somebody works in the repo; by hand:
20
+ // `sk cache-audit`
21
+ runs: { onPreCommit: false, onCi: false, onFull: false, onRelease: false, onHealth: false, onSave: false, onClock: { every: ['20h', '28h'], inactive: 'wait' } },
20
22
  cache: { by: 'never', why: 'it runs other checks fresh, so its answer is that run itself' },
21
23
  fix: 'none',
22
24
  applies: 'always',
@@ -1,6 +1,6 @@
1
- // SK031 traced audit (build/shipkit/cache.md owns the key): about once a day
2
- // each gate task runs under the tracer, and a gitignored path it reads that
3
- // its key misses joins that task's key from the kept answer. SK032 carries the
1
+ // SK031 traced audit (tools/shipkit/cache.md owns the key): about once a day
2
+ // each gate task runs under the tracer, and a path it reads that its key
3
+ // misses (gitignored, or tracked outside a declared list) joins that task's key from the kept answer. SK032 carries the
4
4
  // kept proposals into repo.config.ts in the gate's fix pass. The work is
5
5
  // `sk trace-audit` (core/trace-audit.ts), in its own process, because it runs
6
6
  // the gate's tasks. On wherever the tracer runs, unless the machine opted out.
@@ -13,8 +13,8 @@ const CLI = join(import.meta.dir, '../cli.ts')
13
13
  export const traceAuditCheck = check({
14
14
  id: 'SK031',
15
15
  title: 'traced audit',
16
- description: 'every gitignored path a gate task reads is in its key',
17
- owner: 'build/shipkit/cache.md',
16
+ description: 'every path a gate task reads is in its key, gitignored or outside a declared list',
17
+ owner: 'tools/shipkit/cache.md',
18
18
  blocking: false,
19
19
  // never a gate: it runs the gate's tasks. The daemon asks it about once a
20
20
  // day, and only while somebody works in the repo
@@ -33,8 +33,8 @@ export const traceAuditCheck = check({
33
33
  const missing = out.tasks.filter((x) => x.uncovered.length > 0)
34
34
  // a finding joins its task's key at once (core/audit-report.ts), so it
35
35
  // is news, never a failure: SK032 carries it into repo.config.ts
36
- for (const t of missing) c.ok(`${t.id} reads ${t.uncovered.length} gitignored path(s) the config does not name, keyed from this audit: ${t.propose.join(', ')}`)
37
- if (missing.length === 0) c.ok(`${out.tasks.filter((x) => x.status === 'audited').length} gate task(s) audited: every gitignored path they read is in their key`)
36
+ for (const t of missing) c.ok(`${t.id} reads ${t.uncovered.length} path(s) outside its key the config does not name, keyed from this audit: ${t.propose.join(', ')}`)
37
+ if (missing.length === 0) c.ok(`${out.tasks.filter((x) => x.status === 'audited').length} gate task(s) audited: every path they read is in their key`)
38
38
  },
39
39
  })
40
40