@cbartens/bkit 5.5.1 → 6.1.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 (425) hide show
  1. package/.bkit/README.md +167 -154
  2. package/.bkit/core/.agents/context.md +95 -29
  3. package/.bkit/core/.agents/docs.md +18 -15
  4. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +1 -0
  5. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +6 -5
  6. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-readguard.cjs +1 -0
  7. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-rules.cjs +65 -0
  8. package/.bkit/core/.agents/rules.md +112 -102
  9. package/.bkit/core/.agents/skills.md +63 -15
  10. package/.bkit/core/.bkit/README.md +167 -154
  11. package/.bkit/core/.bkit/authoring.md +747 -0
  12. package/.bkit/core/.bkit/cli.md +407 -0
  13. package/.bkit/core/.bkit/cloud.md +283 -195
  14. package/.bkit/core/.bkit/comparison.md +45 -43
  15. package/.bkit/core/.bkit/install.md +166 -95
  16. package/.bkit/core/.bkit/jsonl.md +339 -196
  17. package/.bkit/core/.bkit/pipeline.md +142 -145
  18. package/.bkit/core/.bkit/prompts.md +295 -264
  19. package/.bkit/core/.bkit/providers.md +460 -277
  20. package/.bkit/core/.bkit/router.md +69 -0
  21. package/.bkit/core/.bkit/templates.md +530 -256
  22. package/.bkit/core/.bkit/trackers.md +116 -65
  23. package/.bkit/core/.bkit/workflows.md +742 -618
  24. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +2 -2
  25. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +3 -3
  26. package/.bkit/core/.claude/hooks/bkit-preflight.sh +45 -14
  27. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +3 -3
  28. package/.bkit/core/.codex/hooks/bkit-rules.cjs +57 -0
  29. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +7 -7
  30. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +47 -12
  31. package/.bkit/core/.opencode/plugin/bkit-rules.js +89 -0
  32. package/.bkit/core/AGENTS.md +6 -80
  33. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +128 -130
  34. package/.bkit/core/docs/templates/bkit-audit-adoption.md +104 -94
  35. package/.bkit/core/docs/templates/bkit-audit-agents.md +96 -98
  36. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +100 -103
  37. package/.bkit/core/docs/templates/bkit-audit-analytics.md +141 -107
  38. package/.bkit/core/docs/templates/bkit-audit-annotations.md +99 -97
  39. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +122 -121
  40. package/.bkit/core/docs/templates/bkit-audit-app-store.md +158 -101
  41. package/.bkit/core/docs/templates/bkit-audit-architecture.md +114 -96
  42. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +76 -97
  43. package/.bkit/core/docs/templates/bkit-audit-config.md +123 -101
  44. package/.bkit/core/docs/templates/bkit-audit-cost.md +86 -99
  45. package/.bkit/core/docs/templates/bkit-audit-coverage.md +76 -93
  46. package/.bkit/core/docs/templates/bkit-audit-database.md +102 -95
  47. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +165 -108
  48. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +115 -109
  49. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +265 -113
  50. package/.bkit/core/docs/templates/bkit-audit-documentation.md +119 -118
  51. package/.bkit/core/docs/templates/bkit-audit-duplication.md +140 -111
  52. package/.bkit/core/docs/templates/bkit-audit-failures.md +111 -106
  53. package/.bkit/core/docs/templates/bkit-audit-flakes.md +100 -99
  54. package/.bkit/core/docs/templates/bkit-audit-gates.md +107 -103
  55. package/.bkit/core/docs/templates/bkit-audit-issues.md +105 -105
  56. package/.bkit/core/docs/templates/bkit-audit-llm.md +134 -85
  57. package/.bkit/core/docs/templates/bkit-audit-logs.md +124 -125
  58. package/.bkit/core/docs/templates/bkit-audit-models.md +99 -78
  59. package/.bkit/core/docs/templates/bkit-audit-privacy.md +56 -76
  60. package/.bkit/core/docs/templates/bkit-audit-prompts.md +63 -78
  61. package/.bkit/core/docs/templates/bkit-audit-red-team.md +125 -93
  62. package/.bkit/core/docs/templates/bkit-audit-reliability.md +97 -96
  63. package/.bkit/core/docs/templates/bkit-audit-repo.md +170 -98
  64. package/.bkit/core/docs/templates/bkit-audit-security.md +207 -121
  65. package/.bkit/core/docs/templates/bkit-audit-slop.md +78 -95
  66. package/.bkit/core/docs/templates/bkit-audit-testing.md +163 -139
  67. package/.bkit/core/docs/templates/bkit-audit-usability.md +114 -96
  68. package/.bkit/core/docs/templates/bkit-plan.md +158 -281
  69. package/.bkit/core/engine/checks/after/auth.ts +40 -37
  70. package/.bkit/core/engine/checks/after/ci-yml.ts +104 -31
  71. package/.bkit/core/engine/checks/after/github.ts +95 -17
  72. package/.bkit/core/engine/checks/after/index.ts +21 -8
  73. package/.bkit/core/engine/checks/after/suppression.ts +8 -5
  74. package/.bkit/core/engine/checks/after/tools.ts +125 -123
  75. package/.bkit/core/engine/checks/before/context-fetch.ts +227 -33
  76. package/.bkit/core/engine/checks/before/env.ts +3 -3
  77. package/.bkit/core/engine/checks/before/files.ts +5 -4
  78. package/.bkit/core/engine/checks/before/index.ts +25 -1
  79. package/.bkit/core/engine/checks/before/repo.ts +208 -2
  80. package/.bkit/core/engine/checks/status-holes.ts +916 -123
  81. package/.bkit/core/engine/checks/tips/catalogue.ts +82 -20
  82. package/.bkit/core/engine/checks/tips/detect.ts +66 -0
  83. package/.bkit/core/engine/checks/tips/index.ts +52 -11
  84. package/.bkit/core/engine/cli.ts +251 -130
  85. package/.bkit/core/engine/commands/analysis.ts +282 -199
  86. package/.bkit/core/engine/commands/ci/ci.ts +363 -29
  87. package/.bkit/core/engine/commands/ci/pins.ts +172 -0
  88. package/.bkit/core/engine/commands/ci/push-gate.ts +223 -0
  89. package/.bkit/core/engine/commands/comply.ts +77 -103
  90. package/.bkit/core/engine/commands/install/doctor.ts +2 -2
  91. package/.bkit/core/engine/commands/install/install.ts +57 -18
  92. package/.bkit/core/engine/commands/install/uninstall.ts +86 -55
  93. package/.bkit/core/engine/commands/install/upgrade.ts +32 -15
  94. package/.bkit/core/engine/commands/land.ts +139 -18
  95. package/.bkit/core/engine/commands/lib.ts +381 -22
  96. package/.bkit/core/engine/commands/registry.ts +10 -2
  97. package/.bkit/core/engine/commands/setup/setup.ts +8 -7
  98. package/.bkit/core/engine/commands/stats.ts +260 -0
  99. package/.bkit/core/engine/commands/tips.ts +10 -5
  100. package/.bkit/core/engine/commands/workflow/branches.ts +2215 -176
  101. package/.bkit/core/engine/commands/workflow/challenge.ts +748 -0
  102. package/.bkit/core/engine/commands/workflow/completeness.ts +109 -0
  103. package/.bkit/core/engine/commands/workflow/context.ts +1249 -47
  104. package/.bkit/core/engine/commands/workflow/counters.ts +483 -95
  105. package/.bkit/core/engine/commands/workflow/decisions.ts +585 -0
  106. package/.bkit/core/engine/commands/workflow/disk.ts +238 -56
  107. package/.bkit/core/engine/commands/workflow/fids.ts +811 -33
  108. package/.bkit/core/engine/commands/workflow/issues.ts +413 -64
  109. package/.bkit/core/engine/commands/workflow/ledgers.ts +1333 -36
  110. package/.bkit/core/engine/commands/workflow/locks.ts +28 -2
  111. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +691 -0
  112. package/.bkit/core/engine/commands/workflow/plan-versions.ts +21 -0
  113. package/.bkit/core/engine/commands/workflow/plans.ts +257 -0
  114. package/.bkit/core/engine/commands/workflow/prs.ts +178 -33
  115. package/.bkit/core/engine/commands/workflow/repo.ts +66 -8
  116. package/.bkit/core/engine/commands/workflow/roadmap.ts +72 -22
  117. package/.bkit/core/engine/commands/workflow/run-facts.ts +492 -0
  118. package/.bkit/core/engine/commands/workflow/runs.ts +827 -79
  119. package/.bkit/core/engine/commands/workflow/runtime.ts +25 -1
  120. package/.bkit/core/engine/commands/workflow/skills.ts +1 -0
  121. package/.bkit/core/engine/commands/workflow/status.ts +329 -33
  122. package/.bkit/core/engine/commands/workflow/step-table.ts +381 -0
  123. package/.bkit/core/engine/commands/workflow/steps.ts +841 -105
  124. package/.bkit/core/engine/commands/workflow/summary-findings.ts +177 -0
  125. package/.bkit/core/engine/commands/workflow/summary.ts +544 -0
  126. package/.bkit/core/engine/commands/workflow/tasks.ts +409 -0
  127. package/.bkit/core/engine/commands/workflow/test-blocks.ts +254 -0
  128. package/.bkit/core/engine/commands/workflow/tests-changed.ts +201 -0
  129. package/.bkit/core/engine/commands/workflow/tests.ts +2124 -330
  130. package/.bkit/core/engine/commands/workflow/tracker.ts +1195 -0
  131. package/.bkit/core/engine/commands/workflow/workflows.ts +1197 -235
  132. package/.bkit/core/engine/commands/workflow/worktrees.ts +543 -24
  133. package/.bkit/core/engine/install/cloud-env.ts +251 -121
  134. package/.bkit/core/engine/install/context-ci-workflow.ts +102 -0
  135. package/.bkit/core/engine/install/manifest.ts +67 -17
  136. package/.bkit/core/engine/install/modules/antigravity.ts +3 -2
  137. package/.bkit/core/engine/install/modules/cloud.ts +24 -16
  138. package/.bkit/core/engine/install/modules/codex.ts +15 -2
  139. package/.bkit/core/engine/install/modules/core.ts +1196 -45
  140. package/.bkit/core/engine/install/modules/cursor.ts +6 -6
  141. package/.bkit/core/engine/install/modules/opencode.ts +18 -6
  142. package/.bkit/core/engine/install/template-notes.ts +130 -0
  143. package/.bkit/core/engine/install/version-file.ts +9 -4
  144. package/.bkit/core/engine/install/write.ts +5 -0
  145. package/.bkit/core/engine/ledgers/compact.ts +124 -0
  146. package/.bkit/core/engine/ledgers/journal.ts +291 -0
  147. package/.bkit/core/engine/ledgers/migrate.ts +92 -0
  148. package/.bkit/core/engine/ledgers/status.ts +249 -21
  149. package/.bkit/core/engine/ledgers/telemetry.ts +1397 -253
  150. package/.bkit/core/engine/render/hosts.ts +118 -14
  151. package/.bkit/core/engine/render/models.ts +12 -0
  152. package/.bkit/core/engine/shared/bkit-latest.ts +26 -4
  153. package/.bkit/core/engine/shared/branches.ts +4 -1
  154. package/.bkit/core/engine/shared/dep-updater.ts +60 -0
  155. package/.bkit/core/engine/shared/egress.ts +8 -1
  156. package/.bkit/core/engine/shared/json.ts +25 -7
  157. package/.bkit/core/engine/shared/package-manager.ts +9 -0
  158. package/.bkit/core/engine/shared/settings.ts +243 -31
  159. package/.bkit/core/engine/shared/text.ts +361 -0
  160. package/.bkit/core/engine/shared/timeouts.ts +2 -0
  161. package/.bkit/core/engine/tools/cli-doc.ts +111 -0
  162. package/.bkit/core/engine/tools/grammar-density.ts +215 -0
  163. package/.bkit/core/engine/tools/instructions-sources.ts +832 -0
  164. package/.bkit/core/engine/tools/instructions.ts +1802 -0
  165. package/.bkit/core/hooks/antigravity-hook.js +25 -10
  166. package/.bkit/core/hooks/gateguard-engine.js +54 -29
  167. package/.bkit/core/hooks/guardrails-shell.js +4 -5
  168. package/.bkit/core/hooks/guardrails-tiers.js +10 -4
  169. package/.bkit/core/hooks/preflight-linear.sh +9 -9
  170. package/.bkit/core/hooks/preflight-rules.sh +8 -0
  171. package/.bkit/core/hooks/readguard-engine.js +29 -10
  172. package/.bkit/core/hooks/session-rules-advisory.js +61 -0
  173. package/.bkit/core/prompts/bkit-audit-generate.md +202 -94
  174. package/.bkit/core/prompts/bkit-build-challenge-1.md +76 -34
  175. package/.bkit/core/prompts/bkit-build-challenge-2.md +85 -38
  176. package/.bkit/core/prompts/bkit-build-install-skills.md +50 -28
  177. package/.bkit/core/prompts/bkit-build-plan-convert.md +85 -0
  178. package/.bkit/core/prompts/bkit-build-plan-current.md +59 -36
  179. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +101 -36
  180. package/.bkit/core/prompts/bkit-build-plan-tasks.md +149 -0
  181. package/.bkit/core/prompts/bkit-build-plan-tests.md +120 -0
  182. package/.bkit/core/prompts/bkit-build-plan-verify.md +104 -43
  183. package/.bkit/core/prompts/bkit-debug-abort-handover.md +47 -32
  184. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +109 -57
  185. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +65 -39
  186. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +53 -31
  187. package/.bkit/core/prompts/bkit-debug-failure-soak.md +65 -34
  188. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +46 -31
  189. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +45 -31
  190. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +43 -30
  191. package/.bkit/core/prompts/bkit-design-generate.md +80 -46
  192. package/.bkit/core/prompts/bkit-design-organise.md +83 -32
  193. package/.bkit/core/prompts/bkit-design-review-1.md +70 -50
  194. package/.bkit/core/prompts/bkit-design-review-2.md +65 -46
  195. package/.bkit/core/prompts/bkit-design-spike.md +64 -40
  196. package/.bkit/core/prompts/bkit-design-update.md +53 -28
  197. package/.bkit/core/prompts/bkit-plan-generate.md +101 -29
  198. package/.bkit/core/prompts/bkit-plan-review-1.md +78 -41
  199. package/.bkit/core/prompts/bkit-plan-review-2.md +78 -35
  200. package/.bkit/core/prompts/bkit-plan-scope-check.md +116 -0
  201. package/.bkit/core/prompts/bkit-plan-update.md +86 -31
  202. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +94 -50
  203. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +91 -41
  204. package/.bkit/core/prompts/bkit-ship-update-docs.md +45 -24
  205. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +65 -49
  206. package/.bkit/core/prompts/bkit-utility-update-decisions.md +87 -42
  207. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +81 -37
  208. package/.bkit/core/prompts/bkit-utility-update-documentation.md +43 -25
  209. package/.bkit/core/prompts/bkit-utility-update-failures.md +84 -37
  210. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +88 -42
  211. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +92 -39
  212. package/.bkit/core/prompts/bkit-utility-update-tracker.md +159 -60
  213. package/.bkit/core/workflows/bkit-auto.md +89 -58
  214. package/.bkit/core/workflows/bkit-build.md +967 -517
  215. package/.bkit/core/workflows/bkit-debug.md +555 -387
  216. package/.bkit/core/workflows/bkit-design.md +319 -283
  217. package/.bkit/core/workflows/bkit-plan.md +319 -342
  218. package/.bkit/core/workflows/bkit-ship.md +525 -328
  219. package/.bkit/shared/.agents/plugins/bkit/hooks.json +10 -0
  220. package/.bkit/shared/.bkit/.env.example +2 -2
  221. package/.bkit/shared/.claude/bkit-cloud.md +12 -10
  222. package/.bkit/shared/.claude/settings.json +14 -0
  223. package/.bkit/shared/.codex/bkit-cloud.md +98 -0
  224. package/.bkit/shared/.codex/hooks.json +20 -0
  225. package/.bkit/shared/.cursor/bkit-cloud.md +3 -3
  226. package/.bkit/shared/.cursor/mcp.json +1 -1
  227. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +1 -1
  228. package/.bkit/shared/.gitattributes +1 -1
  229. package/.bkit/shared/.mcp.json +1 -1
  230. package/.bkit/shared/.opencode/opencode.json +12 -1
  231. package/.bkit/shared/CLAUDE.md +6 -2
  232. package/.bkit/shared/GEMINI.md +5 -2
  233. package/.bkit/shared/docs/architecture.md +4 -7
  234. package/.bkit/shared/docs/data-schema.md +4 -7
  235. package/.bkit/shared/docs/deployments.md +241 -168
  236. package/.bkit/shared/docs/design.md +11 -12
  237. package/.bkit/shared/docs/noise.md +8 -7
  238. package/.bkit/shared/docs/observability.md +5 -8
  239. package/.bkit/shared/docs/security.md +35 -17
  240. package/.bkit/shared/docs/setup.md +29 -18
  241. package/.bkit/shared/docs/technology.md +3 -6
  242. package/.bkit/shared/docs/testing.md +289 -174
  243. package/.bkit/shared/gitignore +6 -2
  244. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +15 -16
  245. package/.bkit/templates/.cursor/Dockerfile +12 -8
  246. package/.bkit/templates/.cursor/environment.json +1 -1
  247. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +10 -8
  248. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +45 -12
  249. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +3 -3
  250. package/.bkit/templates/.github/renovate.json5 +34 -6
  251. package/.bkit/templates/.github/workflows/bkit-ci.yml +54 -51
  252. package/.bkit/templates/.github/workflows/bkit-cloud.yml +34 -33
  253. package/.bkit/templates/.github/workflows/bkit-health.yml +97 -0
  254. package/.bkit/templates/.github/workflows/bkit-renovate.yml +5 -4
  255. package/.bkit/templates/.github/workflows/bkit-trivy.yml +5 -4
  256. package/.bkit/templates/.husky/pre-commit +2 -2
  257. package/.bkit/templates/.husky/pre-push +96 -36
  258. package/.bkit/templates/.prettierignore +6 -0
  259. package/.bkit/templates/.vale.ini +27 -27
  260. package/.bkit/templates/context/bkit-cloudrun.md +23 -15
  261. package/.bkit/templates/context/bkit-expo.md +70 -52
  262. package/.bkit/templates/context/bkit-github.md +93 -56
  263. package/.bkit/templates/context/bkit-inngest.md +21 -15
  264. package/.bkit/templates/context/bkit-maestro.md +22 -16
  265. package/.bkit/templates/context/bkit-playwright.md +23 -17
  266. package/.bkit/templates/context/bkit-resend.md +12 -10
  267. package/.bkit/templates/context/bkit-sentry.md +30 -20
  268. package/.bkit/templates/context/bkit-serena.md +8 -7
  269. package/.bkit/templates/context/bkit-stripe.md +14 -13
  270. package/.bkit/templates/context/bkit-supabase.md +16 -13
  271. package/.bkit/templates/context/bkit-tavily.md +14 -11
  272. package/.bkit/templates/context/bkit-vercel.md +27 -18
  273. package/.bkit/templates/docs/capabilities.md +15 -14
  274. package/.bkit/templates/scripts/ci/{check-accepted-divergences.mjs → bkit-check-accepted-divergences.mjs} +6 -3
  275. package/.bkit/templates/scripts/ci/{check-accepted-divergences.test.mjs → bkit-check-accepted-divergences.test.mjs} +3 -3
  276. package/.bkit/templates/scripts/ci/{check-capstone.mjs → bkit-check-capstone.mjs} +2 -2
  277. package/.bkit/templates/scripts/ci/{check-capstone.test.mjs → bkit-check-capstone.test.mjs} +4 -4
  278. package/.bkit/templates/scripts/ci/{check-dependency-audit.mjs → bkit-check-dependency-audit.mjs} +103 -18
  279. package/.bkit/templates/scripts/ci/{check-dependency-audit.test.mjs → bkit-check-dependency-audit.test.mjs} +31 -3
  280. package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +387 -0
  281. package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +75 -0
  282. package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +160 -0
  283. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.mjs → bkit-resolve-push-base.mjs} +3 -3
  284. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.test.mjs → bkit-resolve-push-base.test.mjs} +4 -4
  285. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +10 -2
  286. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +1 -1
  287. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +3 -3
  288. package/.bkit/templates/scripts/graphify/bkit-graph-embed.py +63 -0
  289. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +2 -2
  290. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +69 -18
  291. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -3
  292. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +1 -1
  293. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
  294. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +197 -126
  295. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +64 -41
  296. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +23 -7
  297. package/.bkit/templates/slop-scan.config.json +9 -2
  298. package/CHANGELOG.md +231 -0
  299. package/README.md +278 -89
  300. package/dist/checks/after/auth.js +36 -33
  301. package/dist/checks/after/ci-yml.js +91 -30
  302. package/dist/checks/after/github.js +91 -17
  303. package/dist/checks/after/index.js +22 -11
  304. package/dist/checks/after/suppression.js +8 -5
  305. package/dist/checks/after/tools.js +111 -114
  306. package/dist/checks/before/context-fetch.js +218 -33
  307. package/dist/checks/before/env.js +3 -3
  308. package/dist/checks/before/files.js +5 -3
  309. package/dist/checks/before/index.js +20 -3
  310. package/dist/checks/before/repo.js +197 -2
  311. package/dist/checks/status-holes.js +739 -114
  312. package/dist/checks/tips/catalogue.js +70 -19
  313. package/dist/checks/tips/detect.js +62 -0
  314. package/dist/checks/tips/index.js +51 -9
  315. package/dist/cli.js +234 -124
  316. package/dist/commands/analysis.js +174 -141
  317. package/dist/commands/ci/ci.js +302 -25
  318. package/dist/commands/ci/pins.js +142 -0
  319. package/dist/commands/ci/push-gate.js +194 -0
  320. package/dist/commands/comply.js +54 -91
  321. package/dist/commands/install/doctor.js +2 -2
  322. package/dist/commands/install/install.js +50 -19
  323. package/dist/commands/install/uninstall.js +82 -55
  324. package/dist/commands/install/upgrade.js +21 -11
  325. package/dist/commands/land.js +137 -17
  326. package/dist/commands/lib.js +295 -21
  327. package/dist/commands/registry.js +10 -2
  328. package/dist/commands/setup/setup.js +8 -7
  329. package/dist/commands/stats.js +175 -0
  330. package/dist/commands/tips.js +7 -3
  331. package/dist/commands/workflow/branches.js +1873 -152
  332. package/dist/commands/workflow/challenge.js +609 -0
  333. package/dist/commands/workflow/completeness.js +97 -0
  334. package/dist/commands/workflow/context.js +1045 -46
  335. package/dist/commands/workflow/counters.js +385 -86
  336. package/dist/commands/workflow/decisions.js +484 -0
  337. package/dist/commands/workflow/disk.js +214 -56
  338. package/dist/commands/workflow/fids.js +706 -33
  339. package/dist/commands/workflow/issues.js +349 -59
  340. package/dist/commands/workflow/ledgers.js +1123 -37
  341. package/dist/commands/workflow/locks.js +26 -2
  342. package/dist/commands/workflow/plan-blocks.js +501 -0
  343. package/dist/commands/workflow/plan-versions.js +22 -0
  344. package/dist/commands/workflow/plans.js +205 -0
  345. package/dist/commands/workflow/prs.js +154 -35
  346. package/dist/commands/workflow/repo.js +58 -8
  347. package/dist/commands/workflow/roadmap.js +58 -23
  348. package/dist/commands/workflow/run-facts.js +421 -0
  349. package/dist/commands/workflow/runs.js +670 -72
  350. package/dist/commands/workflow/runtime.js +15 -1
  351. package/dist/commands/workflow/skills.js +1 -0
  352. package/dist/commands/workflow/status.js +282 -34
  353. package/dist/commands/workflow/step-table.js +308 -0
  354. package/dist/commands/workflow/steps.js +703 -96
  355. package/dist/commands/workflow/summary-findings.js +117 -0
  356. package/dist/commands/workflow/summary.js +388 -0
  357. package/dist/commands/workflow/tasks.js +378 -0
  358. package/dist/commands/workflow/test-blocks.js +231 -0
  359. package/dist/commands/workflow/tests-changed.js +172 -0
  360. package/dist/commands/workflow/tests.js +1695 -305
  361. package/dist/commands/workflow/tracker.js +983 -0
  362. package/dist/commands/workflow/workflows.js +1014 -222
  363. package/dist/commands/workflow/worktrees.js +432 -26
  364. package/dist/install/cloud-env.js +233 -99
  365. package/dist/install/context-ci-workflow.js +85 -0
  366. package/dist/install/manifest.js +64 -17
  367. package/dist/install/modules/antigravity.js +3 -2
  368. package/dist/install/modules/cloud.js +25 -16
  369. package/dist/install/modules/codex.js +12 -2
  370. package/dist/install/modules/core.js +1090 -48
  371. package/dist/install/modules/cursor.js +6 -6
  372. package/dist/install/modules/opencode.js +13 -7
  373. package/dist/install/template-notes.js +116 -0
  374. package/dist/install/version-file.js +9 -4
  375. package/dist/ledgers/compact.js +87 -0
  376. package/dist/ledgers/journal.js +233 -0
  377. package/dist/ledgers/migrate.js +81 -0
  378. package/dist/ledgers/status.js +176 -13
  379. package/dist/ledgers/telemetry.js +1010 -125
  380. package/dist/render/hosts.js +104 -14
  381. package/dist/render/models.js +12 -0
  382. package/dist/shared/bkit-latest.js +26 -4
  383. package/dist/shared/branches.js +3 -1
  384. package/dist/shared/dep-updater.js +49 -0
  385. package/dist/shared/egress.js +8 -1
  386. package/dist/shared/json.js +20 -7
  387. package/dist/shared/package-manager.js +6 -0
  388. package/dist/shared/settings.js +181 -24
  389. package/dist/shared/text.js +333 -0
  390. package/dist/shared/timeouts.js +2 -0
  391. package/dist/tools/cli-doc.js +97 -0
  392. package/dist/tools/grammar-density.js +183 -0
  393. package/dist/tools/instructions-sources.js +720 -0
  394. package/dist/tools/instructions.js +1623 -0
  395. package/package.json +156 -51
  396. package/.bkit/core/.bkit/lite.md +0 -73
  397. package/.bkit/core/engine/commands/harvest.ts +0 -459
  398. package/.bkit/core/engine/commands/workflow/workstreams.ts +0 -166
  399. package/.bkit/core/engine/tools/wording.ts +0 -748
  400. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
  401. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
  402. package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
  403. package/.bkit/core/prompts/bkit-build-plan-execute.md +0 -76
  404. package/.bkit/core/prompts/bkit-build-summary.md +0 -94
  405. package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
  406. package/.bkit/core/prompts/bkit-design-summary.md +0 -107
  407. package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
  408. package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
  409. package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
  410. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
  411. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
  412. package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
  413. package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
  414. package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +0 -194
  415. package/dist/commands/harvest.js +0 -353
  416. package/dist/commands/workflow/workstreams.js +0 -143
  417. package/dist/tools/wording.js +0 -680
  418. /package/.bkit/templates/.vale/styles/{House → Bkit}/Filler.yml +0 -0
  419. /package/.bkit/templates/.vale/styles/{House → Bkit}/Hedging.yml +0 -0
  420. /package/.bkit/templates/.vale/styles/{House → Bkit}/LLMSlop.yml +0 -0
  421. /package/.bkit/templates/.vale/styles/{House → Bkit}/Verbose.yml +0 -0
  422. /package/.bkit/templates/scripts/ci/{accepted-advisories.json → bkit-accepted-advisories.json} +0 -0
  423. /package/.bkit/templates/scripts/ci/{accepted-divergences.json → bkit-accepted-divergences.json} +0 -0
  424. /package/.bkit/templates/scripts/launchd/{launchd.env.example → bkit-launchd.env.example} +0 -0
  425. /package/.bkit/templates/scripts/launchd/{ai.bkit.launchd.plist → bkit-launchd.plist} +0 -0
@@ -1,176 +1,328 @@
1
- <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. The report is stamped with a `bkit:anchor` block recording the audited commit (`baseSha`) and branch (`baseRef`); never hand-author or edit it. `@bkit-audit-generate` fills this template. -->
2
-
3
1
  <!-- bkit:start -->
4
2
 
5
3
  {{BKIT_MANAGED_MARKER}}
6
4
 
5
+ <!-- Note: @bkit-audit-generate fills this template. The report lives at `docs/audits/{YYYYMM}/{slug}.md`, where `{YYYYMM}` is the UTC month of the run and `{slug}` is this file's name without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md`, where `{TIMESTAMP}` is the output of `date -u +%Y%m%dT%H%M%SZ`. NEVER overwrite an earlier report. The report is stamped with a `bkit:anchor` block that records the audited commit (`baseSha`) and branch (`baseRef`). NEVER write or edit that block by hand. -->
6
+
7
7
  # Dependency Triage
8
8
 
9
9
  > [!CAUTION]
10
- > **Purpose:** Batch open dependency-update PRs for verification; judge supply-chain settings, advisories, licences, end of life, off-manifest CLIs.
10
+ > **Purpose:** A verified batch of the open dependency-update PRs, and a judgement on supply-chain settings, advisories, licences, end of life and off-manifest CLIs.
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - Read-only audit; never edit code, config, or data.
15
- > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
- > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
- > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
- > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
- > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
- > - Every claim cites this run's evidence (`file:line`, or command / query and its output) and tool behind it; a previous report's figure, list, or status is a lead, not evidence.
21
- > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
- > - NEVER push, merge, label, close, or comment on a PR. NEVER commit onto the integration branch. Throwaway worktree = evidence; remove before report finishes.
23
- > - never resolve a lockfile conflict as text, and never with `-X ours` / `-X theirs`. NEVER run a recursive update that rewrites ranges the PRs did not name.
24
- > - A breaking major or a migration stays out of the batch even when green. This run records the plan; landing it is the next step.
14
+ > - NEVER push, merge, label, close or comment on a PR.
15
+ > - NEVER commit onto the integration branch.
16
+ > - Treat the throwaway worktree as evidence only, and remove it before the report finishes.
17
+ > - Never resolve a lockfile conflict as text, or with `-X ours` / `-X theirs`.
18
+ > - Do not run a recursive update that rewrites ranges the PRs did not name.
19
+ > - Keep a breaking major or a migration out of the batch, even when it is green.
20
+ > - Record the plan only. Landing it is the next step.
25
21
 
26
22
  ## Universal Instructions
27
23
 
28
24
  ### Context & Goals
29
25
 
30
- Every dependency PR rewrites the lockfile. Unbatched → PRs stale against each other, bot stops rebasing some, each separate merge = full CI. Batching is cheap; manual batching breaks CI: install rewrites manifest the commit omitted, recursive update rewrites bot-unproposed ranges, partial refresh leaves two copies of one tool. Breaking majors need a person; batch must not carry one. Target failure: **a batch that quietly carries a breaking major, or a lockfile that does not match its manifests**.
26
+ Every dependency PR rewrites the lockfile. Left unbatched, the PRs go stale against each other, the bot stops rebasing some of them, and each separate merge costs a full CI run. Batching is cheap, but batching by hand breaks CI in three ways: an install rewrites a manifest the commit left out, a recursive update rewrites ranges the bot never proposed, and a partial refresh leaves two copies of one tool. A breaking major needs a person, so the batch must not carry one. The failure this audit targets is a batch that quietly carries a breaking major, or a lockfile that does not match its manifests.
31
27
 
32
- **Applies when:** a dependency bot opens update PRs, or the repo has manifests and a lockfile. None → one `N/A` row with evidence, never "clean".
28
+ **Applies when:** a dependency bot opens update PRs, **or** the repo has manifests and a lockfile. **If** neither holds → write one `N/A` row with its evidence, and never report the surface as "clean".
33
29
 
34
- **Cadence:** weekly after bot open window. Extra pass: security PR outside window, bot config change on default branch, or `bkit-audit-app-store` deadline forcing SDK / target-API upgrade.
30
+ **Cadence:** Run once a week, after the bot's open window. Run an extra pass when a security PR opens outside the window, when the bot config changes on the default branch, or when a `bkit-audit-app-store` deadline forces an SDK or target-API upgrade.
35
31
 
36
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
32
+ **Anchor Standards:**
37
33
 
38
- - Dependency-bot best-practice and security presets (e.g. Renovate `config:best-practices`, and the presets it extends: `security:minimumReleaseAgeNpm`, `helpers:pinGitHubActionDigests`, `docker:pinDigests`, `abandonments:recommended`, `:configMigration`). Record the bot version.
39
- - Package-manager supply-chain settings (e.g. pnpm `minimumReleaseAge`, `trustPolicy: no-downgrade`, `blockExoticSubdeps`, `allowBuilds`, `strictDepBuilds`).
40
- - Registry provenance and trusted publishing (e.g. npm provenance).
34
+ - Dependency-bot best-practice and security presets (e.g., Renovate `config:best-practices`, and the presets it extends: `security:minimumReleaseAgeNpm`, `helpers:pinGitHubActionDigests`, `docker:pinDigests`, `abandonments:recommended`, `:configMigration`). Record the bot version.
35
+ - Package-manager supply-chain settings (e.g., pnpm `minimumReleaseAge`, `trustPolicy: no-downgrade`, `blockExoticSubdeps`, `allowBuilds`, `strictDepBuilds`). Read the package manager's defaults from the release notes of the pinned major, not the latest docs.
36
+ - Registry provenance and trusted publishing (e.g., npm provenance).
41
37
  - OpenSSF Scorecard; record version.
42
38
  - OpenSSF Concise Guide for Evaluating Open Source Software; record revision date.
43
- - Vulnerability scanner and advisory database (e.g. Trivy, OSV-Scanner, GitHub Advisory Database).
44
- - Lockfile-integrity linter (e.g. lockfile-lint). Unreadable format → apply checks by hand.
45
- - Runtime end-of-life catalogue (e.g. endoflife.date); record the date read.
39
+ - Vulnerability scanner and advisory database (e.g., Trivy, OSV-Scanner, GitHub Advisory Database).
40
+ - Lockfile-integrity linter (e.g., lockfile-lint). Unreadable format → apply checks by hand.
41
+ - Runtime end-of-life catalogue (e.g., endoflife.date); record the date read.
46
42
  - SPDX License List; record version.
47
- - Install-script supply-chain attacks (e.g. Shai-Hulud, September 2025, and Shai-Hulud 2.0, November 2025).
43
+ - Install-script supply-chain attacks (e.g., Shai-Hulud, September 2025, and Shai-Hulud 2.0, November 2025).
48
44
  - bkit block of `docs/deployments.md` (bkit version from `.bkit/version`): § Dependency updaters; § Manual CVE handling (when an alert fires)
49
45
 
50
46
  ### Scope
51
47
 
52
- - No dependency updater config is a CRITICAL finding. Examples: Renovate (`.github/renovate.json` or `.github/renovate.json5`) or Dependabot (`.github/dependabot.yml`). Copy one example and own it.
53
- - Open dependency PRs: classify, batch, verify, and plan the landing.
54
- - Bot config against best-practice and supply-chain settings, including which branch the bot actually reads.
55
- - Lockfile-maintenance cooldown while the package-manager release-age gate is off or absent.
56
- - Settings that multiply PRs and CI runs.
57
- - Supply-chain screen of the batch diff.
58
- - Advisories the bot does not see, fix latency, unmaintained, and deprecated packages, licences.
59
- - Off-manifest CLIs: pin, distance from latest, bot coverage.
60
- - Runtime and framework end of life.
48
+ - Report a missing dependency updater config as a CRITICAL finding. Examples are Renovate (`.github/renovate.json` or `.github/renovate.json5`) and Dependabot (`.github/dependabot.yml`). The project copies one example and owns it.
49
+ - Classify the open dependency PRs, batch them, verify the batch, and plan the landing.
50
+ - Check the bot config against the best-practice and supply-chain settings, including which branch the bot actually reads.
51
+ - Check the lockfile-maintenance cooldown while the package-manager release-age gate is off or absent.
52
+ - Find settings that multiply PRs and CI runs.
53
+ - Screen the batch diff for supply-chain risk.
54
+ - Find what the bot does not see: advisories, fix latency, unmaintained and deprecated packages, and licences.
55
+ - Check off-manifest CLIs: the pin, the distance from latest, and bot coverage.
56
+ - Check runtime and framework end of life.
61
57
 
62
58
  ### Out of Scope
63
59
 
64
60
  <!-- prettier-ignore -->
65
61
  | Excluded item | Why | Where it belongs |
66
62
  | --- | --- | --- |
67
- | Store submission deadlines | Store sweep | `bkit-audit-app-store` |
68
- | Dependencies nothing uses | Dead-code sweep | `bkit-audit-dead-code` |
69
- | Whether a vulnerable function is reachable, beyond naming the call | Security sweep | `bkit-audit-security` |
70
- | Tool-server packages (e.g. MCP) | Agent config sweep | `bkit-audit-agents` |
71
- | CLI outdated notices in CI logs | Annotations sweep | `bkit-audit-annotations` |
72
- | Landing the batch, or labelling, closing, or commenting on PRs | Audit reports only | Plan from this report |
63
+ | Store submission deadlines | The store sweep covers it | `bkit-audit-app-store` |
64
+ | Dependencies nothing uses | The dead-code sweep covers it | `bkit-audit-dead-code` |
65
+ | Whether a vulnerable function is reachable, beyond naming the call | The security sweep covers it | `bkit-audit-security` |
66
+ | Tool-server packages (e.g., MCP) | The agent config sweep covers it | `bkit-audit-agents` |
67
+ | CLI outdated notices in CI logs | The annotations sweep covers it | `bkit-audit-annotations` |
68
+ | Landing the batch, or labelling, closing, or commenting on PRs | The audit only reports | A plan made from this report |
73
69
 
74
70
  ### Verdicts
75
71
 
76
- One per PR. Class (A, B, or C) = evidence; below = outcomes. DECISION wins over IN BATCH: breaking major stays out even when green. Non-security PR still inside bot release age → EXCLUDED even when green.
72
+ Give each PR one verdict. The class (A, B or C) is the evidence, and the verdicts below are the outcomes. DECISION wins over IN BATCH, so a breaking major stays out even when it is green. A non-security PR still inside the bot's release age is EXCLUDED, even when it is green.
77
73
 
78
- - **IN BATCH:** green, or class A or B, and past the bot's release age. Goes in this run's batch.
79
- - **EXCLUDED:** class C, dropped during batch build, or still inside bot release age. Report names labels and comment text; this run does not apply them.
80
- - **DECISION:** a breaking major, a migration, or end of life inside 90 days. Listed for a person. Not a batch item.
81
- - **OTHER:** fits none. Same `OTHER` on 2 runs → propose new verdict in `Process Improvements`.
74
+ - **IN BATCH:** the PR is green, or class A or B, and past the bot's release age. It goes in this run's batch.
75
+ - **EXCLUDED:** the PR is class C, was dropped during the batch build, or is still inside the bot's release age. The report names the labels and the comment text, and this run does not apply them.
76
+ - **DECISION:** the PR is a breaking major, a migration, or reaches end of life inside 90 days. It is listed for a person, and is not a batch item.
77
+ - **OTHER:** it fits no other verdict. **If** the same `OTHER` shows up on 2 runs → propose a new verdict in `Process Improvements`.
82
78
 
83
- Batch verdict, in `Summary`, not per PR. The landing push's CI is the next step's result, not this run's.
79
+ The batch verdict goes in `Summary`, not on each PR. The CI result of the landing push belongs to the next step, not to this run.
84
80
 
85
- - **PASS:** drift check and every local verification command exited 0, baseline reds (Step 10) aside.
81
+ - **PASS:** the drift check and every local verification command exited 0, apart from baseline reds (Step 10).
86
82
  - **CONCERNS:** a PR was dropped during bisection.
87
- - **FAIL:** drift, or a red no single PR explains and the audited commit does not show.
83
+ - **FAIL:** the batch drifts, or it has a red that no single PR explains and the audited commit does not show.
84
+ - **UNVERIFIED:** permissions stopped the batch from assembling (Step 8), so nothing was verified. Name the permission it needs.
88
85
 
89
86
  ### Pre-Flight / Dependencies
90
87
 
91
- **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
92
-
93
- **Credentials:** probe direnv before marking a token / env var missing: `direnv exec . sh -c '[ -n "${VAR}" ] && echo set || echo unset'`; `unset` = missing. Run credentialed CLIs as `direnv exec . <cmd>`. No direnv (cloud session) → plain env check. Report names, never values.
94
-
95
88
  #### Core
96
89
 
97
- Always verify.
98
-
99
- - [ ] **Permissions:** Before Step 1 — one cheap read-only call per tool this run uses (every item below, every rule under `Project Instructions` `Permissions`), e.g. `gh run list --limit 1`, one MCP read, one anchor-standard fetch. Blocked / denied (here or in any step) → record call verbatim and narrow allow rule clearing it (e.g. `Bash(gh run list *)`) in `Not Checked`, `Process Improvements`, and `Project Instructions` `Permissions`; run every step the remaining tools allow; work needing blocked call → `Not Checked`. never stop the run for a blocked call; never retry or reword a blocked call to get past it. Call that ran but the API refused (e.g. HTTP 403 from an endpoint needing another token type, such as GitHub `GET /user/installations`) → not a block; `Not Checked` only, no allow rule.
100
- - [ ] **Git Host:** Steps 2, 3, 11, 12 — open PRs by head-ref prefix, CI runs, behind-count, e.g. `gh`, GitLab API. Fallback: none; PR steps `Not Checked`, batch verdict `FAIL`.
101
- - [ ] **Package Manager:** Steps 5, 8–10 — install, lockfile, registry metadata, e.g. pnpm, npm. Fallback: none; `Batch` and `Verification` `Not Checked`, batch verdict `FAIL`.
102
- - [ ] **Clean Worktree:** Steps 8–10 — detached worktree off the audited commit (`bkit:anchor` `baseSha`), removed before the report finishes; local integration branch ahead of remote ref → landing push carries those commits, so batch builds on them. Fallback: none; do not build the batch in the main checkout.
103
- - [ ] **Web:** Steps 13–15 — latest CLI releases, anchor standards, end-of-life dates, vendor support policy. Fallback: versions and days-left recorded as unread.
90
+ - [ ] **Permissions:** **If** a call ran and the API refused it (e.g., HTTP 403 from an endpoint that needs another token type, such as GitHub `GET /user/installations`) → it is not a block. Record it in `Not Checked` only, with no allow rule.
91
+ - [ ] **Git Host:** Steps 2, 3, 11, 12 — open PRs by head-ref prefix, CI runs and behind-count (e.g., `gh`, GitLab API). Fallback: none. Mark the PR steps `Not Checked`, and set the batch verdict to `FAIL`.
92
+ - [ ] **Package Manager:** Steps 5, 8-10 — install, lockfile and registry metadata (e.g., pnpm, npm). Fallback: none. Mark `Batch` and `Verification` `Not Checked`, and set the batch verdict to `FAIL`.
93
+ - [ ] **Clean Worktree:** Steps 8-10 — a detached worktree off the audited commit (`bkit:anchor` `baseSha`), removed before the report finishes. **If** the local integration branch is ahead of the remote ref → the landing push carries those commits, so the batch builds on them. Fallback: none. Do not build the batch in the main checkout.
94
+ - [ ] **Web:** Steps 13-15 — latest CLI releases, the anchor standards, end-of-life dates and vendor support policy. Fallback: record the versions as unread, and the days left as well.
104
95
 
105
96
  #### Conditional
106
97
 
107
- Verify only when applicable.
108
-
109
- - [ ] **Bot Dashboard:** Bot publishes a dashboard → Step 3 — blocked and will-not-rebase entries. Fallback: open PRs only; stopped-rebase set `Not Checked`.
110
- - [ ] **Config Validator:** Bot ships one → Step 3 — e.g. `renovate-config-validator`, on the config as the default branch has it, in the bot's read mode (repository, not global / self-hosted) with runner's global options the config needs; wrong mode or missing runner option → errors bot never hits (e.g. Renovate: bare file argument validates as global config; repository mode = `--no-global`, or no argument in a scratch checkout of the default-branch files, + runner `allowedEnv` as `RENOVATE_ALLOWED_ENV`, else false `allowedEnv` errors). Error left in bot's mode = finding, quoted with command; never waived as validator-only. Fallback: read the files; validity `Not Checked`.
111
- - [ ] **Vulnerability Scanner:** Lockfile, image, or requirements file → Step 13 — e.g. Trivy (`trivy fs --include-dev-deps`), OSV-Scanner, `npm audit`, host advisory API, vendor repository advisories. Fallback: one source only; the missing source `Not Checked`.
98
+ - [ ] **Bot Dashboard:** **If** the bot publishes a dashboard → Step 3 — blocked and will-not-rebase entries. Fallback: read the open PRs only, and mark the stopped-rebase set `Not Checked`.
99
+ - [ ] **Config Validator:** **If** the bot ships one → Step 3 — e.g., `renovate-config-validator`, on the config as the default branch has it. Run it in the bot's read mode (repository, not global or self-hosted), with the runner's global options the config needs. **If** the mode is wrong **or** a runner option is missing → the validator reports errors the bot never hits. For example, Renovate validates a bare file argument as global config. Repository mode is `--no-global`, or no argument in a scratch checkout of the default-branch files, plus the runner's `allowedEnv` as `RENOVATE_ALLOWED_ENV`. Without that, `allowedEnv` errors are false. An error left in the bot's own mode is a finding, quoted with its command. Never waive it as validator-only. Fallback: read the files, and mark validity `Not Checked`.
100
+ - [ ] **Vulnerability Scanner:** **If** the project has a lockfile, an image or a requirements file → Step 13 — e.g., Trivy (`trivy fs --include-dev-deps`), OSV-Scanner, `npm audit`, the host advisory API and vendor repository advisories. Fallback: use one source only, and mark the missing source `Not Checked`.
112
101
 
113
102
  ### 🔒 Gate 1: Prerequisites Check
114
103
 
115
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
116
-
117
- - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
118
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
104
+ - [ ] **Gaps named:** every missing item names its fallback and its `Not Checked` entry.
105
+ - [ ] **Gate 1 — Verified:** every item above, every Core item and every applicable Conditional item is checked.
119
106
 
120
107
  ### Probe Steps
121
108
 
122
- - [ ] **Step 1 — Previous Run:** Audited commit = this report's `bkit:anchor` `baseSha`. Read newest prior report for this slug under `docs/audits/`; its commit = its `bkit:anchor` `baseSha`, else the HEAD its `Previous Run` recorded. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
123
- - [ ] **Step 2 — Inventory:** From previous report, list deferred PRs and why. Deferred major whose blocker cleared → first candidate. Select open PRs by head-ref prefix from updater config (`branchPrefix`, default `renovate/`; Dependabot `dependabot/`), never title or author. Token-authored PR on prefix = in scope; record author as evidence, not selector. Per PR: number, title, head ref, head SHA, mergeable, merge state, files, labels, commits behind integration branch, latest CI run (finished only; in-progress ≠ result). **Done when:** `Inventory` names prefix and config source, lists every open PR on prefix, or `none`.
124
- - [ ] **Step 3 — Bot Health:** No dependency updater config = CRITICAL. Examples: Renovate (`.github/renovate.json` or `.github/renovate.json5`; rules example `.bkit/templates/.github/renovate.json5`, self-hosted runner example `.bkit/templates/.github/workflows/bkit-renovate.yml`) or Dependabot (`.github/dependabot.yml`; example `.bkit/templates/.github/dependabot.yml`). See `docs/deployments.md` § Dependency updaters. Both configs = finding; keep one. Bot dashboard: gather-only (bot rewrites). Record blocked entries and will-not-auto-rebase notices → stale until person acts. Bot reads presets from default branch, not integration. Fence / group on integration branch inactive until release carries it. Base-config edits on integration apply only if bot merges base-branch config — option read from default branch. PR proposes what integration config blocks → read default-branch copy before debugging rule; promotion-lag when branches differ = signal. Validate configs as default branch has them, in bot's repository mode (Pre-Flight); error left = finding. Dashboard + logs: config errors, PRs held by concurrency / hourly limits, awaiting approval, open config-migration PRs. Broken config ≈ quiet week. **Done when:** `Bot Health` holds blocked PRs, config read branch, validator result, held / awaiting-approval items.
125
- - [ ] **Step 4 — Supply Chain:** Read settings as default branch has them. Record each vs bot best-practice preset and package manager supply-chain page. Bot: minimum release age >= three days (e.g. Renovate `minimumReleaseAge` / `security:minimumReleaseAgeNpm` + `internalChecksFilter: "strict"`; Dependabot `cooldown`); actions / images digest-pinned; abandonment flagging (e.g. Renovate abandonments preset); config-migration PRs enabled, where bot offers them. Package manager, where offered (e.g. pnpm): trust policy no-downgrade, exotic subdeps blocked, explicit install-script allowlist, strict dependency builds; none offered → `N/A` with evidence. Release-age 0 on package manager = recorded trade-off where docs say so; re-deciding = person (`DECISION`). Gap: bot release age does not apply to lockfile-maintenance PRs (package manager makes changes; gate off → no cooldown) → batch with no cooldown; `Cooldown` stands in; `Screen` first. Missing / weaker setting → `Recommendations` row + line to add. **Done when:** `Supply Chain` row per setting: value · standard · verdict.
126
- - [ ] **Step 5 — Cooldown:** Package-manager cooldown off or absent → lockfile-maintenance PRs: no automerge; same age wait as other updates before land. Bot opens no lockfile-maintenance PRs (e.g. Dependabot) → those checks `N/A`. Check: lockfile-maintenance block + matching rules → no automerge; each merged lockfile-maintenance since previous run waited >= bot release age (e.g. Renovate `minimumReleaseAge`; newest version publish → merge); open younger → EXCLUDED + eligible date. Automerge groups that rewrite the lockfile: bot release-age check ages named packages only → newest transitive version in the PR's lockfile diff vs bot release age; younger → EXCLUDED + eligible date; automerge with package-manager cooldown off = finding. Same wait on other open non-security PRs: release-age check pending (e.g. `renovate/stability-days`) or newest version younger than bot release age → EXCLUDED + eligible date. Security PRs bypass (Step 13). Lockfile-maintenance automerged or landed before release age = finding. **Done when:** `Cooldown` holds automerge, each merged PR wait, each open PR eligible date.
127
- - [ ] **Step 6 — Volume:** Each bot PR = lockfile rewrite + preview + CI; each rebase = another CI. Read on default branch; record what each setting would change; lines to add → project-owned bot config. Grouping: related packages one PR (`group:monorepos`, `group:allNonMajor`, or equivalent). List solo opens that should group + catching rule. Schedule: one window; note outside opens (non-security) + why. Limits: concurrent, hourly, branch-concurrent; record held-back PRs. Rebase policy: conflict-only rebases skip CI on every integration move; unset → record default + count rebase pushes since previous run. Lockfile PR conflicts with most dependency merges; lockfile maintenance own schedule, not every bot run. Automerge: low-risk groups passing CI via platform automerge; lockfile maintenance must not automerge while `Cooldown` off. Majors await dashboard approval; unset → major PR + CI before decision. Scan scope: read bot's detected-file list (e.g. Renovate dashboard) for archived evidence, fixtures, test trees; repo-level ignore list replaces preset defaults (e.g. Renovate `ignorePaths` drops `:ignoreModulesAndTests`) → list paths + PRs touching only them. Setting cutting PRs / CI → `Recommendations` + line + PRs saved this run. **Done when:** `Volume` row per setting: value · what it would change · PRs saved.
128
- - [ ] **Step 7 — Classify:** Every PR that is not green. Quote the evidence line from the log. When nothing matches, the class is C.
109
+ - [ ] **Step 1 — Previous Run:** **Done when:** `Previous Run` holds the closure rate, or the run is marked baseline.
110
+ - [ ] **Step 2 — Inventory:** From the previous report, list the deferred PRs and why each was deferred. A deferred major whose blocker has cleared is the first candidate. Select open PRs by the head-ref prefix from the updater config (`branchPrefix`, default `renovate/`; Dependabot uses `dependabot/`), never by title or author. A token-authored PR on the prefix is in scope; record the author as evidence, not as the selector. For each PR, record the number, title, head ref, head SHA, mergeable, merge state, files, labels, commits behind the integration branch, and the latest CI run. Count finished runs only, because an in-progress run is not a result. **Done when:** `Inventory` names the prefix and the config source, and lists every open PR on the prefix, or says `none`.
111
+ - [ ] **Step 3 — Bot Health:** A missing dependency updater config is CRITICAL.
112
+ - Examples are Renovate (`.github/renovate.json` or `.github/renovate.json5`; rules example `.bkit/templates/.github/renovate.json5`, self-hosted runner example `.bkit/templates/.github/workflows/bkit-renovate.yml`) and Dependabot (`.github/dependabot.yml`; example `.bkit/templates/.github/dependabot.yml`). See `docs/deployments.md` § Dependency updaters.
113
+ - Two configs is a finding; keep one.
114
+ - Only read the bot dashboard, because the bot rewrites it.
115
+ - Record blocked entries and will-not-auto-rebase notices, because those PRs stay stale until a person acts.
116
+ - The bot reads presets from the default branch, not from the integration branch. A fence or group on the integration branch is inactive until a release carries it.
117
+ - Base-config edits on the integration branch apply only when the bot merges base-branch config, and it reads that option from the default branch.
118
+ - **If** a PR proposes what the integration config blocks → read the default-branch copy before debugging the rule. When the branches differ, that promotion lag is a signal.
119
+ - Validate the configs as the default branch has them, in the bot's repository mode (Pre-Flight). An error left there is a finding.
120
+ - Read the dashboard and logs for config errors, PRs held by concurrency or hourly limits, PRs awaiting approval, and open config-migration PRs. A broken config looks like a quiet week.
121
+
122
+ **Done when:** `Bot Health` holds the blocked PRs, the branch the config is read from, the validator result, and the held and awaiting-approval items.
123
+
124
+ - [ ] **Step 4 — Supply Chain:** Read the settings as the default branch has them.
125
+ - Record each one against the bot's best-practice preset and the package manager's supply-chain page.
126
+ - For the bot, check:
127
+ - a minimum release age of at least three days (e.g., Renovate `minimumReleaseAge` / `security:minimumReleaseAgeNpm` with `internalChecksFilter: "strict"`, or Dependabot `cooldown`)
128
+ - actions and images pinned by digest
129
+ - abandonment flagging (e.g., the Renovate abandonments preset)
130
+ - config-migration PRs enabled, where the bot offers them
131
+ - For the package manager, where it offers them (e.g., pnpm), check:
132
+ - trust policy no-downgrade
133
+ - exotic subdependencies blocked
134
+ - an explicit install-script allowlist
135
+ - strict dependency builds
136
+ - **If** the package manager offers none → write `N/A` with evidence.
137
+ - A release age of 0 on the package manager is a recorded trade-off where the docs say so. Record it, and leave re-deciding it to a person (`DECISION`).
138
+ - The gap is that the bot's release age does not apply to lockfile-maintenance PRs, because the package manager makes those changes. With the package-manager gate off, those PRs reach the batch with no cooldown. `Cooldown` checks what stands in for one, and `Screen` takes them first.
139
+ - **If** a setting is missing **or** weaker than the standard → add a `Recommendations` row with the line to add.
140
+
141
+ **Done when:** `Supply Chain` has a row per setting: value · standard · verdict.
142
+
143
+ - [ ] **Step 5 — Cooldown:** **If** the package-manager cooldown is off or absent:
144
+ - Lockfile-maintenance PRs must not automerge, and must wait the same age as other updates before they land.
145
+ - **If** the bot opens no lockfile-maintenance PRs (e.g., Dependabot) → the two checks below are `N/A`.
146
+ - Check that the lockfile-maintenance block and its matching rules do not automerge.
147
+ - Check that each lockfile-maintenance PR merged since the previous run waited at least the bot's release age (e.g., Renovate `minimumReleaseAge`), measured from the newest version's publish to the merge. **If** an open one is younger → it is EXCLUDED, with its eligible date.
148
+
149
+ For automerge groups that rewrite the lockfile, the bot's release-age check ages the named packages only. Compare the newest transitive version in the PR's lockfile diff with the bot's release age. **If** it is younger → it is EXCLUDED, with its eligible date. Automerge with the package-manager cooldown off is a finding. Apply the same wait to other open non-security PRs. **If** the release-age check is pending (e.g., `renovate/stability-days`) **or** the newest version is younger than the bot's release age → it is EXCLUDED, with its eligible date. Security PRs bypass this wait (Step 13). A lockfile-maintenance PR that automerged or landed before its release age is a finding.
150
+
151
+ **Done when:** `Cooldown` holds the automerge setting, each merged PR's wait, and each open PR's eligible date.
152
+
153
+ - [ ] **Step 6 — Volume:** Each bot PR is a lockfile rewrite, a preview and a CI run, and each rebase is another CI run.
154
+ - Read the settings on the default branch, and record what each one would change. The lines to add go in the project-owned bot config.
155
+ - Grouping:
156
+ - Check that related packages go in one PR (`group:monorepos`, `group:allNonMajor`, or an equivalent).
157
+ - List the solo PRs that should be grouped, and the rule that would catch them.
158
+ - Schedule:
159
+ - Check that the bot opens PRs in one window.
160
+ - Compare the bot's actual run start times (e.g., workflow run history) with the configured window. A window that no run lands in means routine PRs never open.
161
+ - **If** no dependency bot is configured → record an explicit skip.
162
+ - Note the non-security PRs opened outside it, and why.
163
+ - Limits: record the PRs held back by the concurrent, hourly and branch-concurrent limits.
164
+ - Rebase policy:
165
+ - Check that the bot rebases only on conflict, which avoids a CI run on every integration move.
166
+ - **If** it is unset → record the default, and count the rebase pushes since the previous run.
167
+ - The lockfile PR conflicts with most dependency merges, so check that lockfile maintenance runs on its own schedule, not on every bot run.
168
+ - Automerge:
169
+ - Check that low-risk groups that pass CI use platform automerge.
170
+ - Check that lockfile maintenance does not automerge while `Cooldown` is off.
171
+ - Check that majors wait for dashboard approval. Without it, a major opens a PR and runs CI before anyone decides.
172
+ - Scan scope:
173
+ - Read the bot's detected-file list (e.g., the Renovate dashboard) for archived evidence, fixtures and test trees.
174
+ - A repo-level ignore list replaces the preset defaults (e.g., Renovate `ignorePaths` drops `:ignoreModulesAndTests`), so list those paths and the PRs that touch only them.
175
+ - **If** a setting would cut PRs or CI runs → add a `Recommendations` row with the line and the PRs it saves this run.
176
+
177
+ **Done when:** `Volume` has a row per setting: value · what it would change · PRs saved.
178
+
179
+ - [ ] **Step 7 — Classify:** Classify every PR that is not green, and every green PR that bumps a version pinned beside a checksum. Quote the evidence line from the log. When nothing matches, the class is C.
129
180
  - **A — infrastructure:** preview-deploy wait timeout, registry fetch failure, a cold service refusing, a cancelled runner. Confirm: the same job passed on a neighbouring run or a retry of the same commit.
130
181
  - **B — stale:** outdated lockfile, lockfile config mismatch, a merge conflict, merge state dirty, behind the integration branch. Confirm: behind-count. Being behind says nothing about the dependency itself.
131
- - **C — real:** the failure survives a clean rebase onto the integration branch. Confirm: reproduce it on the batch worktree before Step 10, calling the test binary directly (e.g. `node_modules/.bin/vitest`); PR bumping the package-manager pin (e.g. `packageManager`) → wrapper exec (e.g. `pnpm exec`) fetches that version and installs, dirtying the worktree. Only C keeps a PR out of the batch.
132
- - **C, copy parity:** a test requires two copies of a file to stay identical and the bot updates only the copy it scans (other copy on an ignored path). Fails by design; fix = mirror the change into the other copy. Count recurrence in Step 16.
133
-
134
- Batch = green + A + B past bot release age. C → EXCLUDED → `Excluded`. Breaking major → DECISION even if IN BATCH. Non-security inside release age → EXCLUDED even if IN BATCH (Step 5). **Done when:** `Classes` row per non-green PR: class · behind-count · quoted evidence · verdict.
135
-
136
- - [ ] **Step 8 — Batch:** Detached worktree off audited commit (`bkit:anchor` `baseSha`), not the remote integration ref — local ahead → landing push carries those commits, so batch builds on them; no new branch. Merge each IN BATCH PR (`git merge --no-edit`); do not push. Lockfile conflict: never text-resolve → integration copy + regenerate (`git checkout <integration> -- <lockfile>`, `git merge --continue` in worktree only). Manifest conflict between batch PRs: higher version wins if not breaking major; else drop lower, record `replaced by #N`. Higher = breaking major → DECISION out; keep lower line, record major not taken. Manifest vs integration (not another PR): higher version line by line. Other conflict → abort merge, drop PR, record why. Record merged commit; install; lockfile-only PRs → refresh exactly named packages. Traps: (1) install rewrites manifests + lockfile (e.g. pnpm catalog, root `package.json`) — uncommitted edits fail frozen CI, pass locally. (2) recursive update rewrites bot-unproposed ranges in big diff — refresh named packages only. (3) partial refresh → split workspace versions; red typecheck / build → clean integration worktree first; fix = one version everywhere incl. shared version catalog (e.g. pnpm catalog). Drift: every manifest byte-identical to merged commit; quote diff command, exit code, output. Do not commit integration branch; never skip-CI marker. Lockfile sources: integrity hash per entry; tarballs from configured registry over HTTPS; both searches empty — quote hits + pulling package. **Done when:** `Batch` holds worktree commit, PRs in/out + why, drift check, both source searches.
137
- - [ ] **Step 9 — Screen:** Batch lockfile diff vs integration — list: new packages (transitive incl.); new install scripts + allowlist prompts; versions published < bot release age before run (lockfile-maintenance first); publisher change or less provenance (trust policy refuses when set); names one edit away from a popular package; OpenSSF Scorecard score per new package's source repo (e.g. via deps.dev), or `no score` (no linked repo or unscored; not a finding by itself). Worms via `postinstall` — read every new script. Package still inside release age = Cooldown miss → drop PR, rebuild. Other hits → verdict unchanged; `Recommendations` row + evidence for approver. **Done when:** `Screen` lists each hit, or `none`, and a Scorecard score or `no score` per new package.
138
- - [ ] **Step 10 — Verify:** `git status --porcelain` empty first (trap (1) in dirty tree). Frozen install → static / unit / integration gate → local E2E per app (store build vs deployed env tests none of batch — use local-build substrate). Beyond green typecheck: framework dependency doctor, where the framework ships one (e.g. `expo-doctor`; SDK-out-of-range packages compile/typecheck then break native/app); single-version check for runtime packages in `Project Instructions` (two versions = trap (3) — report + one version everywhere). Red may be stale install — clear installed deps (e.g. `node_modules`, `.venv`, `target/`), frozen install, re-run before blaming bump. Reproduce each red on audited commit without batch (clean worktree off `baseSha`); red there = baseline red → `Verification` + finding, reported apart from batch, not a batch FAIL; batch judged on remaining reds. Remaining red → drop suspect PR, rebuild batch, re-run; no single PR explains → FAIL. **Done when:** `Verification` quotes every command and exit code, and each baseline red; `Summary` has PASS, CONCERNS, or FAIL.
139
- - [ ] **Step 11 — Plan:** Report asks and stops — no push, merge, close, label. Direct-push integration branch → batch lands without feature-branch PR. Deployed-boundary checks on push only → landing push = batch meets external services. Never merge bot PRs one-by-one: N sequential → N integration runs + rebase per open PR after each; N one push → one integration run. `Plan` table columns: `Wave`, `PRs`, `Commits`, `Why together, or why apart`, `Pushes`, `CI runs`. Rules: (1) Default one wave — all IN BATCH in one push; commit series (not squash): non-major groups, then one commit per major each with install matching manifests; each commit revert/bisect point; CI once on push head — `Verify` head; earlier commits → frozen install + typecheck. (2) Second wave only for named reason — bisectability not enough; reason = production watch before next land (SDK / framework / native major, store build/submission, DB-client major); extra wave = +push, +integration run, rebase on open PRs — cost in row. (3) Order: security → non-majors → majors; within majors dependency before dependents (language before linter; UI lib + types together). (4) Unmerged automerge group → batch; self-merge first = separate push + rebases — fold in and close at push; merged pre-landing → rebase batch, drop from plan. (5) Close carried PRs right after push with `Excluded` comment → landing commit; bot auto-close next run only — until then may rebase + CI. (6) Land after bot weekly window, no mid-landing opens/rebases, no queued integration push. (7) List excluded/deferred PRs landing will rebase + CI cost; multi-cycle exclude → rebase each later push — recommend close + dashboard when wanted. (8) No skip-CI on dependency change; required checks test batch. Then ordered landing commands: push, close PRs + comments, labels for open. Cost one-by-one vs batch + CI already spent on branch PRs. Post-land watch: error-tracker release, error-rate / crash-free revert thresholds commit-by-commit — do not invent thresholds. **Done when:** `Plan` holds table, commands, both costs, watch.
140
- - [ ] **Step 12 — Excluded:** Report lists only — no label, comment, close. C-class + blocked stay open. Report supplies comment text (break + fix) and labels (deferred; major label on major). Comments start with marker in `Project Instructions`; next step finds marker and edits existing comment. Batch-carried PRs → close after land with batch pointer. Breaking major / migration = DECISION → `Recommendations`; real work → issue to open. DECISION evidence (not bare PR): migration guide, breaking changes vs codebase + hit counts, codemods, peer-dep matrix, rollback path. **Done when:** `Excluded` row per out-of-batch PR: verdict · labels · comment text or DECISION evidence.
141
- - [ ] **Step 13 — Unseen:** Bot-blind surfaces. (a) New advisories vs committed baseline — delta script: not in baseline + stale entries; batch fix → remove baseline entry same commit. Security PRs bypass release-age — confirm landing not queued; same as `bkit-audit-security`, do not duplicate. (b) Second vuln source — scanner on lockfile, language requirements, shipped images + host alerts + vendor repository advisories per shipped framework (e.g. `gh api repos/<owner>/<repo>/security-advisories`). Global databases (e.g. `gh api advisories/<id>`, OSV) can lag vendor advisories by days → vendor advisory missing from global database = finding (scanners and CI gate blind to it); already there → count once, no lag finding; no vendor advisories or host API → global only, that source `Not Checked` + reason. Lockfile scanners reading first doc only → empty without fail — confirm full read. Classify each advisory shipped, server-only, or dev-only, and say whether the vulnerable function is reachable. Destination for an advisory: `bkit-audit-security`. (c) Fix latency — shipped deps: publication → integration land; CRITICAL ≤7d, HIGH ≤30d; breach = finding, list first. Per open `CRITICAL` / `HIGH`: earliest bot open date = fixed-version publish + bot release age (none for a security update, per (a)) + next bot run, vs deadline; bot date past deadline = finding before the breach; bot blind to advisory (vendor-only) → no date, advisory itself = finding. (d) Container installing from bot-bumped manifest covered; second install line bypassing manifest = gap, back. (e) Unused deps → `bkit-audit-dead-code`; unmaintained (no release >1y or archived) on new deps since last pass → `Recommendations`. (f) Deprecated / abandoned whole tree — dashboard abandoned + frozen-install warnings. (g) Licences — new deps since last pass; copyleft (GPL, AGPL) or missing in shipped → `Recommendations`. Production tree licence diff vs previous (BSL, SSPL, commercial upgrades too). Shipped app notices regenerated on dep change; bundled fonts/icons/images — licence + ship terms. (h) Off-manifest CLIs — bot reads manifests only. Sources: CI `run:` (global installs, `npx` / `pnpm dlx`, `curl | sh`, system packages), setup-action version inputs (e.g. `supabase/setup-cli` `version:`), build-service CLI pin (e.g. `eas.json` `cli.version`), Dockerfiles, build images, version files (e.g. `.tool-versions`), repo scripts, global-install setup docs. Per CLI: location · pin or `floating` (unpinned, `latest`, open range) · latest release, read live · majors behind · bot-watched (manifest entry or bot rule, e.g. Renovate `customManagers`) yes / no. Floating in CI / build image = finding (unreviewed version each run, bypasses release age). Major behind = finding; end of life → Step 14. Unwatched → `Recommendations`: move into manifest or add bot rule. **Done when:** `Unseen` holds advisories, vendor-advisory gaps, latency + earliest bot dates, container install path, deprecated packages, licence diffs, row per off-manifest CLI.
142
- - [ ] **Step 14 — End of Life:** Compare versions in use with the end-of-life catalogue and each vendor's support policy. Record days left for the runtime, the framework, the native SDK, the package manager, the language, the database major, and container base images the project ships (sources in `Project Instructions`). An end of life inside 90 days is DECISION, and the report names the issue to open. **Done when:** `End of Life` row per runtime: version · days left · verdict.
143
- - [ ] **Step 15 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per bot preset, package-manager supply-chain setting, and Concise Guide rule → checked (name step) / not applicable (why) / finding. Per bkit anchor (doc section, rule, or issue shape): one row → followed (name step or evidence) / not applicable (why) / finding; departure with no recorded reason (e.g. `docs/decisions.jsonl` row, accepted-divergence entry) = finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
144
- - [ ] **Step 16 — Anything Else:** (a) Since previous report commit — dependency-touching changes (manifests, workspace file, bot configs, workflow `uses:`, Dockerfiles, requirements, runtime-version files, build-image, hosting runtime) → one-line verdict each. (b) ~30 min bounded pass — senior supply-chain gaps no step covers; since previous run: incidents, new `docs/failures.jsonl`, `bkit-audit-logs` reports, vendor status — what no step catches? **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
182
+ - **C — real:** the failure survives a clean rebase onto the integration branch. Confirm: reproduce it on the batch worktree before Step 10, calling the test binary directly (e.g., `node_modules/.bin/vitest`). **If** a PR bumps the package-manager pin (e.g., `packageManager`) → a wrapper exec (e.g., `pnpm exec`) fetches that version and installs, which dirties the worktree. Only C keeps a PR out of the batch.
183
+ - **C, copy parity:** a test requires two copies of a file to stay identical, and the bot updates only the copy it scans, because the other copy is on an ignored path. It fails by design, and the fix is to mirror the change into the other copy. Count recurrences in Step 16.
184
+ - **C, checksum:** the PR bumps a version pinned beside a checksum (e.g., a download URL and its SHA-256), and the checksum does not match the new version. A green PR can be C here, because a stale checksum fails only where the download runs.
185
+
186
+ The batch is the green, A and B PRs that are past the bot's release age. A class C PR is EXCLUDED and goes in `Excluded`. A breaking major is DECISION, even when it would be IN BATCH. A non-security PR inside the release age is EXCLUDED, even when it would be IN BATCH (Step 5). **Done when:** `Classes` has a row per classified PR (every non-green PR, and every green PR that bumps a version pinned beside a checksum): class · behind-count · quoted evidence · verdict.
187
+
188
+ - [ ] **Step 8 — Batch:** Make a detached worktree off the audited commit (`bkit:anchor` `baseSha`), not the remote integration ref.
189
+ - **If** the local branch is ahead → the landing push carries those commits, so the batch builds on them.
190
+ - Do not create a new branch.
191
+ - Merge each IN BATCH PR (`git merge --no-edit`), and NEVER push.
192
+ - **If** the lockfile conflicts:
193
+ - Never resolve it as text.
194
+ - Take the integration copy and regenerate it (`git checkout <integration> -- <lockfile>`, then `git merge --continue`, in the worktree only).
195
+ - **If** two batch PRs conflict on a manifest:
196
+ - **If** the higher version is not a breaking major → it wins, so drop the lower PR and record `replaced by #N`.
197
+ - **Else** → the major is DECISION and stays out, so keep the lower line and record that the major was not taken.
198
+ - **If** a manifest conflicts with the integration branch rather than another PR → take the higher version line by line.
199
+ - **If** any other conflict happens → abort the merge, drop the PR, and record why.
200
+ - **If** permissions stop the batch from assembling (e.g., a refused merge, fetch or install) → the batch verdict is `UNVERIFIED`, not FAIL, and Step 10 does not run.
201
+ - Record the merged commit, then install.
202
+ - After the install, record the resolved version of each changed package per workspace, from the lockfile.
203
+ - Check each package-manager override against the exact direct pin it shadows. **If** the manifest has no overrides → record `none`.
204
+ - For lockfile-only PRs, refresh exactly the named packages.
205
+ - Watch for three traps:
206
+ - Trap (1): an install rewrites manifests and the lockfile (e.g., the pnpm catalog or the root `package.json`), and the uncommitted edits fail frozen CI while passing locally.
207
+ - Trap (2): a recursive update rewrites ranges the bot never proposed, in a big diff, so refresh the named packages only.
208
+ - Trap (3): a partial refresh leaves split versions across the workspace.
209
+ - **If** typecheck or build is red → check a clean integration worktree first. The fix is one version everywhere, including the shared version catalog (e.g., the pnpm catalog).
210
+ - Drift check: every manifest is byte-identical to the merged commit. Quote the diff command, its exit code and its output.
211
+ - Do not commit to the integration branch, and never add a skip-CI marker.
212
+ - Lockfile sources: every entry has an integrity hash, and every tarball comes from the configured registry over HTTPS. Both searches should come back empty; quote any hits and the package that pulls them in.
213
+
214
+ **Done when:** `Batch` holds the worktree commit, the PRs in and out with why, the drift check, and both source searches.
215
+
216
+ - [ ] **Step 9 — Screen:** Compare the batch lockfile diff with the integration branch, and list: new packages, transitive ones included; new install scripts and allowlist prompts; versions published less than the bot's release age before the run, with lockfile-maintenance PRs first; a publisher change or weaker provenance, which the trust policy refuses when it is set; names one edit away from a popular package; and the OpenSSF Scorecard score for each new package's source repo (e.g., via deps.dev). Write `no score` when there is no linked repo or it is unscored; that is not a finding by itself. Worms spread through `postinstall`, so read every new script. A package still inside its release age is a `Cooldown` miss: drop the PR and rebuild the batch. Other hits leave the verdict unchanged, and get a `Recommendations` row with evidence for the approver. **Done when:** `Screen` lists each hit, or says `none`, and gives a Scorecard score or `no score` for each new package.
217
+ - [ ] **Step 10 — Verify:** First confirm `git status --porcelain` is empty, because trap (1) shows up as a dirty tree.
218
+ - Run a frozen install, then the static, unit and integration gate, then local E2E for each app. A store build or a deployed environment tests none of the batch, so use the local-build substrate.
219
+ - Go beyond a green typecheck: run the framework's dependency doctor, where the framework ships one (e.g., `expo-doctor`), because packages outside the SDK's range compile and typecheck, then break the native app.
220
+ - Run a single-version check for the runtime packages named in `Project Instructions`. Two versions is trap (3): report it, and the fix is one version everywhere.
221
+ - **If** a red is a timeout under heavy load (e.g., exit 143) → re-run that file alone and record the load average before blaming the batch.
222
+ - A red can come from a stale install. Clear the installed dependencies (e.g., `node_modules`, `.venv`, `target/`), run a frozen install, and re-run before blaming the bump.
223
+ - Reproduce each red on the audited commit without the batch, in a clean worktree off `baseSha`. A red there is a baseline red: it goes in `Verification` as a finding, reported apart from the batch, and it is not a batch FAIL.
224
+ - Judge the batch on the remaining reds.
225
+ - **If** a red remains → drop the suspect PR, rebuild the batch, and re-run.
226
+ - **If** no single PR explains it → the batch is FAIL.
227
+
228
+ **Done when:** `Verification` quotes every command and exit code, and each baseline red, and `Summary` has PASS, CONCERNS, FAIL or UNVERIFIED.
229
+
230
+ - [ ] **Step 11 — Plan:** The report asks and stops. It does not push, merge, close or label.
231
+ - **If** the integration branch takes direct pushes → the batch lands without a feature-branch PR.
232
+ - **If** the deployed-boundary checks run on push only → the landing push is where the batch first meets external services.
233
+ - Never merge bot PRs one by one. N merges in sequence cost N integration runs, plus a rebase on every open PR after each one. N PRs in one push cost one integration run.
234
+ - The `Plan` table has the columns `Wave`, `PRs`, `Commits`, `Why together, or why apart`, `Pushes` and `CI runs`.
235
+ - Follow these rules:
236
+ - (1) Default to one wave, with every IN BATCH PR in one push.
237
+ - Make a series of commits, not a squash: the non-major groups first, then one commit per major, each with an install that matches its manifests. Each commit is a point to revert or bisect to.
238
+ - CI runs once on the push head, so `Verify` covers the head, and the earlier commits get a frozen install and a typecheck.
239
+ - (2) Add a second wave only for a named reason; being able to bisect is not enough.
240
+ - The reason is a production watch before the next land, e.g., for an SDK, framework or native major, a store build or submission, or a DB-client major.
241
+ - An extra wave costs another push, another integration run and a rebase on every open PR, so put that cost in the row.
242
+ - (3) Order security first, then non-majors, then majors.
243
+ - Within the majors, put a dependency before its dependents, e.g., the language before the linter, and a UI library together with its types.
244
+ - (4) Put an unmerged automerge group in the batch. Letting it merge itself first costs a separate push plus rebases, so fold it in, and close it at the push.
245
+ - **If** it merged before the landing → rebase the batch and drop it from the plan.
246
+ - (5) Close the carried PRs right after the push, with an `Excluded` comment pointing at the landing commit. The bot only closes them on its next run, and until then it may rebase them and run CI.
247
+ - (6) Land after the bot's weekly window, with no opens or rebases mid-landing, and no integration push queued.
248
+ - (7) List the excluded and deferred PRs the landing will rebase, with the CI cost. A PR excluded over several cycles is rebased on every later push, so recommend closing it and using the dashboard when it is wanted.
249
+ - (8) Never add skip-CI on a dependency change, so the required checks test the batch.
250
+ - Then give the landing commands in order: the push, closing the PRs with comments, and the labels for the PRs left open.
251
+ - Give the cost of landing one by one against the batch, plus the CI already spent on the branch PRs.
252
+ - For the post-land watch, name the error-tracker release and the error-rate and crash-free thresholds for reverting commit by commit.
253
+ - Do not invent thresholds.
254
+
255
+ **Done when:** `Plan` holds the table, the commands, both costs, and the watch.
256
+
257
+ - [ ] **Step 12 — Excluded:** The report lists only. It does not label, comment or close. Class C and blocked PRs stay open. The report supplies the comment text (what broke and the fix) and the labels (deferred, plus the major label on a major). Comments start with the marker in `Project Instructions`, so the next step finds the marker and edits the existing comment. A PR the batch carries is closed after the landing, with a pointer to the batch. A breaking major or migration is DECISION and goes in `Recommendations`. **If** it is real work → name the issue to open. DECISION evidence is more than the bare PR: the migration guide, the breaking changes checked against the codebase with hit counts, codemods, the peer-dependency matrix, and the rollback path. **Done when:** `Excluded` has a row per out-of-batch PR: verdict · labels · comment text or DECISION evidence.
258
+ - [ ] **Step 13 — Unseen:** Check the surfaces the bot cannot see.
259
+ - (a) New advisories against the committed baseline. The delta script reports advisories not in the baseline, and stale baseline entries.
260
+ - **If** the batch fixes one → remove its baseline entry in the same commit.
261
+ - Security PRs bypass the release age, so confirm they are landing, not queued. `bkit-audit-security` asks the same question, so do not report it twice.
262
+ - (b) A second vulnerability source.
263
+ - Run the scanner over the lockfile, the language requirements files and the shipped images.
264
+ - Some lockfile scanners read only the first document and come back empty without failing, so confirm the full file was read.
265
+ - Read the host's alerts, and the vendor repository advisories for each shipped framework (e.g., `gh api repos/<owner>/<repo>/security-advisories`).
266
+ - Global databases (e.g., `gh api advisories/<id>`, OSV) can lag vendor advisories by days. A vendor advisory missing from the global database is a finding, because the scanners and the CI gate are blind to it.
267
+ - **If** the vendor advisory is already in the global database → count it once, with no lag finding.
268
+ - **If** there are no vendor advisories **or** no host API → use the global source only, and mark the other `Not Checked` with the reason.
269
+ - Classify each advisory as shipped, server-only or dev-only, and say whether the vulnerable function is reachable. An advisory goes to `bkit-audit-security`.
270
+ - (c) Fix latency for shipped dependencies, from publication to landing on the integration branch: CRITICAL within 7 days, HIGH within 30 days.
271
+ - A breach is a finding, listed first.
272
+ - For each open `CRITICAL` or `HIGH`, the earliest date the bot can open a PR is the fixed version's publish date, plus the bot's release age (none for a security update, per (a)), plus the next bot run. Compare it with the deadline.
273
+ - A bot date past the deadline is a finding before the breach happens.
274
+ - **If** the bot is blind to the advisory (vendor-only) → there is no date, and the advisory itself is a finding.
275
+ - (d) A container that installs from a manifest the bot bumps is covered. A second install line that bypasses the manifest is a gap; report it.
276
+ - (e) Unused dependencies go to `bkit-audit-dead-code`. New dependencies since the last pass that are unmaintained (no release for over a year, or archived) go in `Recommendations`.
277
+ - (f) Deprecated and abandoned packages across the whole tree, from the dashboard's abandoned list and frozen-install warnings.
278
+ - (g) Licences for new dependencies since the last pass.
279
+ - Judge each licence by shipping scope (deployed or distributed), not by membership of the dependency graph.
280
+ - A copyleft licence (GPL, AGPL) or a missing licence on a shipped dependency goes in `Recommendations`.
281
+ - Diff the production tree's licences against the previous run, including BSL, SSPL and commercial upgrades.
282
+ - Check that the shipped app's notices are regenerated when a dependency changes.
283
+ - For bundled fonts, icons and images, check the licence and the terms for shipping them.
284
+ - (h) Off-manifest CLIs, because the bot reads manifests only.
285
+ - Sources: CI `run:` lines (global installs, `npx` / `pnpm dlx`, `curl | sh`, system packages), setup-action version inputs (e.g., `supabase/setup-cli` `version:`), build-service CLI pins (e.g., `eas.json` `cli.version`), Dockerfiles, build images, version files (e.g., `.tool-versions`), repo scripts, and setup docs that install globally.
286
+ - For each CLI, record: location · pin, or `floating` (unpinned, `latest`, or an open range) · latest release, read live · majors behind · bot-watched (a manifest entry or a bot rule, e.g., Renovate `customManagers`) yes / no.
287
+ - A floating CLI in CI or a build image is a finding, because each run gets an unreviewed version that bypasses the release age.
288
+ - A major behind is a finding, and end of life goes to Step 14.
289
+ - An unwatched CLI gets a `Recommendations` row: move it into a manifest, or add a bot rule.
290
+
291
+ **Done when:** `Unseen` holds the advisories, the vendor-advisory gaps, the latency and the earliest bot dates, the container install path, the deprecated packages, the licence diffs, and a row per off-manifest CLI.
292
+
293
+ - [ ] **Step 14 — End of Life:** Compare the versions in use with the end-of-life catalogue and each vendor's support policy. Record the days left for the runtime, the framework, the native SDK, the package manager, the language, the database major, and the container base images the project ships (sources in `Project Instructions`). An end of life inside 90 days is DECISION, and the report names the issue to open. **Done when:** `End of Life` has a row per runtime: version · days left · verdict.
294
+ - [ ] **Step 15 — Standards:** Confirm the current version of each anchor standard, and read what changed since the previous report's version. In `Standards Coverage`, give one row per bot preset, package-manager supply-chain setting, and Concise Guide rule, marked checked (with the step), not applicable (saying why) or finding. Give each bkit anchor (a doc section, rule or issue shape) one row, marked followed (with the step or evidence), not applicable (saying why) or finding. A departure with no recorded reason (e.g., a `docs/decisions.jsonl` row or an accepted-divergence entry) is a finding. Mark each recommended practice the project does not apply as adopt (with a proposed step), reject (saying why) or not applicable. **Done when:** no row is empty.
295
+ - [ ] **Step 16 — Anything Else:** (a) List the dependency-touching changes since the previous report's commit (manifests, the workspace file, bot configs, workflow `uses:`, Dockerfiles, requirements, runtime-version files, the build image and the hosting runtime), with a one-line verdict each. (b) In a bounded pass of about 30 minutes, note what a senior supply-chain engineer would flag that no step asks about. Read what happened since the previous run: incidents, new `docs/failures.jsonl` rows, `bkit-audit-logs` reports and vendor status. Note what no step would catch. **Done when:** `Beyond the Steps` holds both passes, or says `none`. **If** one class of issue is seen on 2 runs → propose a step for it in `Process Improvements`.
145
296
 
146
297
  ### 🔒 Gate 2: Probes Check
147
298
 
148
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
149
-
150
- - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
151
- - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
152
- - [ ] **Batch local:** drift check quoted with exit code; no push; throwaway worktree removed; integration branch unchanged.
153
- - [ ] **No landing:** no PR merged, labelled, closed, or commented on.
154
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
299
+ - [ ] **Steps complete:** every step is `[x]`, or skipped with evidence that its surface is absent.
300
+ - [ ] **Evidence:** every finding cites evidence someone can check again, and the tool that produced it.
301
+ - [ ] **Batch local:** the drift check is quoted with its exit code.
302
+ - [ ] **No push:** nothing was pushed.
303
+ - [ ] **Worktree removed:** the throwaway worktree is removed.
304
+ - [ ] **Integration unchanged:** the integration branch is unchanged.
305
+ - [ ] **No landing:** no PR was merged, labelled, closed or commented on.
306
+ - [ ] **Gate 2 — Verified:** every item above holds.
155
307
 
156
308
  ## Findings
157
309
 
158
310
  <!-- prettier-ignore -->
159
311
  | Severity | Use |
160
312
  | --- | --- |
161
- | `CRITICAL` | No dependency updater config; shipped dependency with a known-bad install script or a publisher change the trust policy should have refused; lockfile entry with no integrity hash, or a tarball off the configured registry; CRITICAL advisory in a shipped dependency older than 7 days |
162
- | `HIGH` | HIGH advisory in a shipped dependency older than 30 days; lockfile-maintenance update that automerged or landed inside the release-age window; copyleft or missing licence on a shipped dependency |
163
- | `MEDIUM` | Updater config that scans bkit-owned trees (`.bkit/templates/**`, `.agents/skills/**`); supply-chain setting missing or weaker than the standard; setting that multiplies PR or CI runs; unmaintained or deprecated shipped dependency; end of life inside 90 days; two versions of one runtime package; off-manifest CLI floating in CI / build image, or a major behind |
164
- | `LOW` | Bot stopped rebasing a PR; grouping miss with no failure; shipped licence notice not regenerated; unwatched off-manifest CLI |
313
+ | `CRITICAL` | There is no dependency updater config. A shipped dependency has a known-bad install script, or a publisher change the trust policy should have refused. A lockfile entry has no integrity hash, or a tarball comes from off the configured registry. A CRITICAL advisory in a shipped dependency is older than 7 days. |
314
+ | `HIGH` | A HIGH advisory in a shipped dependency is older than 30 days. A lockfile-maintenance update automerged or landed inside the release-age window. A shipped dependency has a copyleft or missing licence. |
315
+ | `MEDIUM` | The updater config scans bkit-owned trees (`.bkit/templates/**`, `.agents/skills/**`). A supply-chain setting is missing or weaker than the standard. A setting multiplies PR or CI runs. A shipped dependency is unmaintained or deprecated. An end of life falls inside 90 days. A runtime package has two versions. An off-manifest CLI floats in CI or a build image, or is a major behind. |
316
+ | `LOW` | The bot stopped rebasing a PR. A grouping miss caused no failure. The shipped licence notice was not regenerated. An off-manifest CLI is unwatched. |
165
317
 
166
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: shipped exposure first.
318
+ Within a severity, list shipped exposure first.
167
319
 
168
320
  <!-- prettier-ignore -->
169
321
  | ID | Severity | Verdict | Location | Evidence | Expected |
170
322
  | --- | --- | --- | --- | --- | --- |
171
323
  | PENDING | PENDING | PENDING | PENDING | PENDING | PENDING |
172
324
 
173
- Empty and clean → one row `None`.
325
+ **If** the run finds nothing → write one row: `None`.
174
326
 
175
327
  ## Report
176
328
 
@@ -267,17 +419,17 @@ PENDING
267
419
 
268
420
  ### 🔒 Gate 3: Report Check
269
421
 
270
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
271
-
272
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
273
- - [ ] **Summary:** names count per severity, the batch verdict, and open / in-batch / excluded counts.
274
- - [ ] **Series:** security-fix latency and end-of-life days beside previous report's numbers, or marked baseline.
275
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
276
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
277
- - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
278
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
279
-
280
- > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
422
+ - [ ] **No placeholders:** no `PENDING` is left.
423
+ - [ ] **Summary:** `Summary` gives the count per severity.
424
+ - [ ] **Batch verdict:** `Summary` gives the batch verdict.
425
+ - [ ] **Counts:** `Summary` gives the open, in-batch and excluded counts.
426
+ - [ ] **Series:** the report shows security-fix latency and end-of-life days beside the previous report's numbers, or marks the run as baseline.
427
+ - [ ] **Writes:** this run changed only this report, the template's `Project Instructions` and its own `docs/failures.jsonl` rows.
428
+ - [ ] **Throwaways removed:** every throwaway worktree or remote target is removed.
429
+ - [ ] **Process Improvements:** `Universal` and `Project` are both filled.
430
+ - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID is in exactly one `Suggested Issues` row.
431
+ - [ ] **Next Step:** every `Suggested Issues` row has a `Next Step`.
432
+ - [ ] **Gate 3 — Verified:** every item above holds.
281
433
 
282
434
  <!-- bkit:end -->
283
435