@cbartens/bkit 0.0.0-stage → 5.0.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 (373) hide show
  1. package/.bkit/README.md +421 -0
  2. package/.bkit/core/.agents/context.md +95 -0
  3. package/.bkit/core/.agents/docs.md +62 -0
  4. package/.bkit/core/.agents/rules.md +147 -0
  5. package/.bkit/core/.agents/skills.md +43 -0
  6. package/.bkit/core/.bkit/LICENSE.md +151 -0
  7. package/.bkit/core/.bkit/README.md +421 -0
  8. package/.bkit/core/.bkit/cloud.md +502 -0
  9. package/.bkit/core/.bkit/comparison.md +318 -0
  10. package/.bkit/core/.bkit/install.md +496 -0
  11. package/.bkit/core/.bkit/jsonl.md +497 -0
  12. package/.bkit/core/.bkit/prompts.md +474 -0
  13. package/.bkit/core/.bkit/providers.md +598 -0
  14. package/.bkit/core/.bkit/templates.md +471 -0
  15. package/.bkit/core/.bkit/trackers.md +95 -0
  16. package/.bkit/core/.bkit/workflows.md +1546 -0
  17. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +82 -0
  18. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +93 -0
  19. package/.bkit/core/.claude/hooks/bkit-preflight.sh +74 -0
  20. package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +115 -0
  21. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +135 -0
  22. package/.bkit/core/.cursor/hooks/bkit-gateguard.cjs +111 -0
  23. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +169 -0
  24. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +63 -0
  25. package/.bkit/core/.opencode/plugin/bkit-gateguard.js +225 -0
  26. package/.bkit/core/AGENTS.md +77 -0
  27. package/.bkit/core/LICENSE.md +149 -0
  28. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +272 -0
  29. package/.bkit/core/docs/templates/bkit-audit-adoption.md +223 -0
  30. package/.bkit/core/docs/templates/bkit-audit-agents.md +230 -0
  31. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +227 -0
  32. package/.bkit/core/docs/templates/bkit-audit-analytics.md +266 -0
  33. package/.bkit/core/docs/templates/bkit-audit-annotations.md +230 -0
  34. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +270 -0
  35. package/.bkit/core/docs/templates/bkit-audit-app-store.md +254 -0
  36. package/.bkit/core/docs/templates/bkit-audit-architecture.md +221 -0
  37. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +241 -0
  38. package/.bkit/core/docs/templates/bkit-audit-config.md +230 -0
  39. package/.bkit/core/docs/templates/bkit-audit-cost.md +218 -0
  40. package/.bkit/core/docs/templates/bkit-audit-coverage.md +221 -0
  41. package/.bkit/core/docs/templates/bkit-audit-database.md +229 -0
  42. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +251 -0
  43. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +283 -0
  44. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +268 -0
  45. package/.bkit/core/docs/templates/bkit-audit-documentation.md +280 -0
  46. package/.bkit/core/docs/templates/bkit-audit-duplication.md +253 -0
  47. package/.bkit/core/docs/templates/bkit-audit-failures.md +259 -0
  48. package/.bkit/core/docs/templates/bkit-audit-flakes.md +237 -0
  49. package/.bkit/core/docs/templates/bkit-audit-gates.md +250 -0
  50. package/.bkit/core/docs/templates/bkit-audit-issues.md +273 -0
  51. package/.bkit/core/docs/templates/bkit-audit-llm.md +239 -0
  52. package/.bkit/core/docs/templates/bkit-audit-logs.md +266 -0
  53. package/.bkit/core/docs/templates/bkit-audit-models.md +210 -0
  54. package/.bkit/core/docs/templates/bkit-audit-privacy.md +211 -0
  55. package/.bkit/core/docs/templates/bkit-audit-prompts.md +216 -0
  56. package/.bkit/core/docs/templates/bkit-audit-red-team.md +220 -0
  57. package/.bkit/core/docs/templates/bkit-audit-reliability.md +222 -0
  58. package/.bkit/core/docs/templates/bkit-audit-repo.md +224 -0
  59. package/.bkit/core/docs/templates/bkit-audit-security.md +274 -0
  60. package/.bkit/core/docs/templates/bkit-audit-slop.md +200 -0
  61. package/.bkit/core/docs/templates/bkit-audit-testing.md +270 -0
  62. package/.bkit/core/docs/templates/bkit-audit-usability.md +237 -0
  63. package/.bkit/core/docs/templates/bkit-plan.md +476 -0
  64. package/.bkit/core/engine/checks/after/auth.ts +247 -0
  65. package/.bkit/core/engine/checks/after/ci-yml.ts +739 -0
  66. package/.bkit/core/engine/checks/after/github.ts +424 -0
  67. package/.bkit/core/engine/checks/after/index.ts +556 -0
  68. package/.bkit/core/engine/checks/after/managed.ts +217 -0
  69. package/.bkit/core/engine/checks/after/tools.ts +427 -0
  70. package/.bkit/core/engine/checks/after/vercel.ts +101 -0
  71. package/.bkit/core/engine/checks/before/context-fetch.ts +429 -0
  72. package/.bkit/core/engine/checks/before/env.ts +201 -0
  73. package/.bkit/core/engine/checks/before/files.ts +202 -0
  74. package/.bkit/core/engine/checks/before/index.ts +206 -0
  75. package/.bkit/core/engine/checks/before/mcp.ts +127 -0
  76. package/.bkit/core/engine/checks/before/repo.ts +77 -0
  77. package/.bkit/core/engine/checks/before/version.ts +67 -0
  78. package/.bkit/core/engine/checks/status-holes.ts +479 -0
  79. package/.bkit/core/engine/cli.ts +871 -0
  80. package/.bkit/core/engine/commands/analysis.ts +550 -0
  81. package/.bkit/core/engine/commands/ci/ci.ts +483 -0
  82. package/.bkit/core/engine/commands/comply.ts +415 -0
  83. package/.bkit/core/engine/commands/harvest.ts +459 -0
  84. package/.bkit/core/engine/commands/install/check.ts +70 -0
  85. package/.bkit/core/engine/commands/install/doctor.ts +247 -0
  86. package/.bkit/core/engine/commands/install/install.ts +528 -0
  87. package/.bkit/core/engine/commands/install/uninstall.ts +972 -0
  88. package/.bkit/core/engine/commands/install/upgrade.ts +1026 -0
  89. package/.bkit/core/engine/commands/launch.ts +139 -0
  90. package/.bkit/core/engine/commands/lib.ts +494 -0
  91. package/.bkit/core/engine/commands/registry.ts +53 -0
  92. package/.bkit/core/engine/commands/setup/setup.ts +184 -0
  93. package/.bkit/core/engine/commands/telemetry.ts +32 -0
  94. package/.bkit/core/engine/commands/workflow/branches.ts +1514 -0
  95. package/.bkit/core/engine/commands/workflow/context.ts +961 -0
  96. package/.bkit/core/engine/commands/workflow/counters.ts +268 -0
  97. package/.bkit/core/engine/commands/workflow/fids.ts +243 -0
  98. package/.bkit/core/engine/commands/workflow/issues.ts +675 -0
  99. package/.bkit/core/engine/commands/workflow/ledgers.ts +575 -0
  100. package/.bkit/core/engine/commands/workflow/locks.ts +478 -0
  101. package/.bkit/core/engine/commands/workflow/prs.ts +1087 -0
  102. package/.bkit/core/engine/commands/workflow/repo.ts +220 -0
  103. package/.bkit/core/engine/commands/workflow/roadmap.ts +576 -0
  104. package/.bkit/core/engine/commands/workflow/runs.ts +2140 -0
  105. package/.bkit/core/engine/commands/workflow/runtime.ts +300 -0
  106. package/.bkit/core/engine/commands/workflow/skills.ts +118 -0
  107. package/.bkit/core/engine/commands/workflow/status.ts +455 -0
  108. package/.bkit/core/engine/commands/workflow/steps.ts +1300 -0
  109. package/.bkit/core/engine/commands/workflow/tests.ts +161 -0
  110. package/.bkit/core/engine/commands/workflow/workflows.ts +1573 -0
  111. package/.bkit/core/engine/commands/workflow/workstreams.ts +164 -0
  112. package/.bkit/core/engine/commands/workflow/worktrees.ts +534 -0
  113. package/.bkit/core/engine/install/cloud-env.ts +925 -0
  114. package/.bkit/core/engine/install/managed-block.ts +212 -0
  115. package/.bkit/core/engine/install/manifest.ts +448 -0
  116. package/.bkit/core/engine/install/modules/claude.ts +362 -0
  117. package/.bkit/core/engine/install/modules/cloud.ts +174 -0
  118. package/.bkit/core/engine/install/modules/codex.ts +219 -0
  119. package/.bkit/core/engine/install/modules/core.ts +600 -0
  120. package/.bkit/core/engine/install/modules/cursor.ts +231 -0
  121. package/.bkit/core/engine/install/modules/index.ts +242 -0
  122. package/.bkit/core/engine/install/modules/opencode.ts +573 -0
  123. package/.bkit/core/engine/install/placeholders.ts +108 -0
  124. package/.bkit/core/engine/install/template-copies.ts +119 -0
  125. package/.bkit/core/engine/install/version-file.ts +284 -0
  126. package/.bkit/core/engine/install/write.ts +467 -0
  127. package/.bkit/core/engine/ledgers/clamp-log.ts +32 -0
  128. package/.bkit/core/engine/ledgers/status.ts +213 -0
  129. package/.bkit/core/engine/ledgers/telemetry.ts +1143 -0
  130. package/.bkit/core/engine/render/hosts.ts +372 -0
  131. package/.bkit/core/engine/render/models.ts +323 -0
  132. package/.bkit/core/engine/render/parts.ts +38 -0
  133. package/.bkit/core/engine/render/trackers.ts +170 -0
  134. package/.bkit/core/engine/shared/egress.ts +345 -0
  135. package/.bkit/core/engine/shared/json.ts +16 -0
  136. package/.bkit/core/engine/shared/log-prefix.ts +9 -0
  137. package/.bkit/core/engine/shared/package-json.ts +29 -0
  138. package/.bkit/core/engine/shared/package-manager.ts +38 -0
  139. package/.bkit/core/engine/shared/package-roots.ts +163 -0
  140. package/.bkit/core/engine/shared/protected-paths.ts +164 -0
  141. package/.bkit/core/engine/shared/settings.ts +72 -0
  142. package/.bkit/core/engine/shared/timeouts.ts +20 -0
  143. package/.bkit/core/engine/tools/wording.ts +748 -0
  144. package/.bkit/core/hooks/gateguard-edit-payload.js +18 -0
  145. package/.bkit/core/hooks/gateguard-engine.js +193 -0
  146. package/.bkit/core/hooks/guardrails-shell.js +154 -0
  147. package/.bkit/core/hooks/guardrails-tiers.js +68 -0
  148. package/.bkit/core/hooks/preflight-linear.sh +73 -0
  149. package/.bkit/core/prompts/bkit-audit-generate.md +66 -0
  150. package/.bkit/core/prompts/bkit-build-challenge-1.md +79 -0
  151. package/.bkit/core/prompts/bkit-build-challenge-2.md +81 -0
  152. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +68 -0
  153. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +70 -0
  154. package/.bkit/core/prompts/bkit-build-challenge-tests.md +73 -0
  155. package/.bkit/core/prompts/bkit-build-install-skills.md +67 -0
  156. package/.bkit/core/prompts/bkit-build-plan-current.md +75 -0
  157. package/.bkit/core/prompts/bkit-build-plan-execute.md +72 -0
  158. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +73 -0
  159. package/.bkit/core/prompts/bkit-build-plan-verify.md +88 -0
  160. package/.bkit/core/prompts/bkit-build-summary.md +93 -0
  161. package/.bkit/core/prompts/bkit-debug-abort-handover.md +90 -0
  162. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +151 -0
  163. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +78 -0
  164. package/.bkit/core/prompts/bkit-debug-failure-soak.md +73 -0
  165. package/.bkit/core/prompts/bkit-debug-summary.md +95 -0
  166. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +72 -0
  167. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +72 -0
  168. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +75 -0
  169. package/.bkit/core/prompts/bkit-design-generate.md +110 -0
  170. package/.bkit/core/prompts/bkit-design-organise.md +85 -0
  171. package/.bkit/core/prompts/bkit-design-review-1.md +121 -0
  172. package/.bkit/core/prompts/bkit-design-review-2.md +111 -0
  173. package/.bkit/core/prompts/bkit-design-spike.md +97 -0
  174. package/.bkit/core/prompts/bkit-design-summary.md +106 -0
  175. package/.bkit/core/prompts/bkit-design-update.md +66 -0
  176. package/.bkit/core/prompts/bkit-plan-complexity-check.md +66 -0
  177. package/.bkit/core/prompts/bkit-plan-complexity-split.md +87 -0
  178. package/.bkit/core/prompts/bkit-plan-generate.md +74 -0
  179. package/.bkit/core/prompts/bkit-plan-review-1.md +90 -0
  180. package/.bkit/core/prompts/bkit-plan-review-2.md +80 -0
  181. package/.bkit/core/prompts/bkit-plan-review-3.md +92 -0
  182. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +84 -0
  183. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +84 -0
  184. package/.bkit/core/prompts/bkit-plan-summary.md +106 -0
  185. package/.bkit/core/prompts/bkit-plan-update.md +68 -0
  186. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +90 -0
  187. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +94 -0
  188. package/.bkit/core/prompts/bkit-ship-summary.md +77 -0
  189. package/.bkit/core/prompts/bkit-ship-update-docs.md +71 -0
  190. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +91 -0
  191. package/.bkit/core/prompts/bkit-utility-update-decisions.md +75 -0
  192. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +76 -0
  193. package/.bkit/core/prompts/bkit-utility-update-documentation.md +61 -0
  194. package/.bkit/core/prompts/bkit-utility-update-failures.md +76 -0
  195. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +75 -0
  196. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +82 -0
  197. package/.bkit/core/workflows/bkit-auto.md +121 -0
  198. package/.bkit/core/workflows/bkit-build.md +802 -0
  199. package/.bkit/core/workflows/bkit-debug.md +642 -0
  200. package/.bkit/core/workflows/bkit-design.md +495 -0
  201. package/.bkit/core/workflows/bkit-plan.md +510 -0
  202. package/.bkit/core/workflows/bkit-ship.md +650 -0
  203. package/.bkit/shared/.bkit/.env.example +108 -0
  204. package/.bkit/shared/.claude/bkit-cloud.md +117 -0
  205. package/.bkit/shared/.claude/settings.json +88 -0
  206. package/.bkit/shared/.codex/hooks.json +26 -0
  207. package/.bkit/shared/.cursor/bkit-cloud.md +84 -0
  208. package/.bkit/shared/.cursor/hooks.json +26 -0
  209. package/.bkit/shared/.cursor/mcp.json +15 -0
  210. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +12 -0
  211. package/.bkit/shared/.gitattributes +37 -0
  212. package/.bkit/shared/.mcp.json +16 -0
  213. package/.bkit/shared/.opencode/opencode.json +62 -0
  214. package/.bkit/shared/CLAUDE.md +11 -0
  215. package/.bkit/shared/LICENSE.md +22 -0
  216. package/.bkit/shared/docs/architecture.md +19 -0
  217. package/.bkit/shared/docs/data-schema.md +19 -0
  218. package/.bkit/shared/docs/deployments.md +438 -0
  219. package/.bkit/shared/docs/design.md +39 -0
  220. package/.bkit/shared/docs/noise.md +19 -0
  221. package/.bkit/shared/docs/observability.md +25 -0
  222. package/.bkit/shared/docs/security.md +42 -0
  223. package/.bkit/shared/docs/setup.md +30 -0
  224. package/.bkit/shared/docs/technology.md +18 -0
  225. package/.bkit/shared/docs/testing.md +413 -0
  226. package/.bkit/shared/gitignore +92 -0
  227. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +192 -0
  228. package/.bkit/templates/.cursor/Dockerfile +68 -0
  229. package/.bkit/templates/.cursor/environment.json +6 -0
  230. package/.bkit/templates/.cursor/settings.json +11 -0
  231. package/.bkit/templates/.envrc +7 -0
  232. package/.bkit/templates/.github/dependabot.yml +52 -0
  233. package/.bkit/templates/.github/renovate.json5 +239 -0
  234. package/.bkit/templates/.github/workflows/bkit-ci.yml +1082 -0
  235. package/.bkit/templates/.github/workflows/bkit-cloud.yml +566 -0
  236. package/.bkit/templates/.github/workflows/bkit-renovate.yml +107 -0
  237. package/.bkit/templates/.graphifyignore +108 -0
  238. package/.bkit/templates/.husky/pre-commit +16 -0
  239. package/.bkit/templates/.husky/pre-push +91 -0
  240. package/.bkit/templates/.lintstagedrc.json +3 -0
  241. package/.bkit/templates/.prettierignore +41 -0
  242. package/.bkit/templates/.serena/project.yml +243 -0
  243. package/.bkit/templates/.vale/styles/House/Filler.yml +11 -0
  244. package/.bkit/templates/.vale/styles/House/Hedging.yml +12 -0
  245. package/.bkit/templates/.vale/styles/House/LLMSlop.yml +13 -0
  246. package/.bkit/templates/.vale/styles/House/Verbose.yml +12 -0
  247. package/.bkit/templates/.vale.ini +67 -0
  248. package/.bkit/templates/LICENSE.md +22 -0
  249. package/.bkit/templates/context/bkit-cloudrun.md +84 -0
  250. package/.bkit/templates/context/bkit-expo.md +186 -0
  251. package/.bkit/templates/context/bkit-github.md +79 -0
  252. package/.bkit/templates/context/bkit-inngest.md +45 -0
  253. package/.bkit/templates/context/bkit-maestro.md +76 -0
  254. package/.bkit/templates/context/bkit-playwright.md +62 -0
  255. package/.bkit/templates/context/bkit-resend.md +36 -0
  256. package/.bkit/templates/context/bkit-sentry.md +65 -0
  257. package/.bkit/templates/context/bkit-serena.md +33 -0
  258. package/.bkit/templates/context/bkit-stripe.md +36 -0
  259. package/.bkit/templates/context/bkit-supabase.md +59 -0
  260. package/.bkit/templates/context/bkit-tavily.md +49 -0
  261. package/.bkit/templates/context/bkit-vercel.md +64 -0
  262. package/.bkit/templates/docs/capabilities.md +72 -0
  263. package/.bkit/templates/scripts/ci/accepted-divergences.json +21 -0
  264. package/.bkit/templates/scripts/ci/check-accepted-divergences.mjs +152 -0
  265. package/.bkit/templates/scripts/ci/check-accepted-divergences.test.mjs +130 -0
  266. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +98 -0
  267. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +86 -0
  268. package/.bkit/templates/scripts/graphify/bkit-graph-drift-rules.json +23 -0
  269. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +208 -0
  270. package/.bkit/templates/scripts/graphify/bkit-graph-eager-rules.json +35 -0
  271. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +236 -0
  272. package/.bkit/templates/scripts/graphify/bkit-graph-external-rules.json +17 -0
  273. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +290 -0
  274. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +19 -0
  275. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +120 -0
  276. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +232 -0
  277. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +36 -0
  278. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +927 -0
  279. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +351 -0
  280. package/.bkit/templates/scripts/launchd/ai.bkit.launchd.plist +26 -0
  281. package/.bkit/templates/scripts/launchd/bkit-launchd-env.sh +53 -0
  282. package/.bkit/templates/scripts/launchd/launchd.env.example +13 -0
  283. package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +275 -0
  284. package/.bkit/templates/scripts/secrets/bkit-secrets.config.mjs +66 -0
  285. package/.bkit/templates/scripts/secrets/bkit-secrets.mjs +785 -0
  286. package/.bkit/templates/scripts/serena/bkit-serena-mcp.sh +30 -0
  287. package/.bkit/templates/scripts/serena/bkit-serena.mcp.json +9 -0
  288. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +286 -0
  289. package/.bkit/templates/slop-scan.config.json +120 -0
  290. package/CHANGELOG.md +1486 -0
  291. package/LICENSE.md +161 -0
  292. package/README.md +185 -2
  293. package/dist/checks/after/auth.js +232 -0
  294. package/dist/checks/after/ci-yml.js +718 -0
  295. package/dist/checks/after/github.js +400 -0
  296. package/dist/checks/after/index.js +447 -0
  297. package/dist/checks/after/managed.js +187 -0
  298. package/dist/checks/after/tools.js +351 -0
  299. package/dist/checks/after/vercel.js +102 -0
  300. package/dist/checks/before/context-fetch.js +426 -0
  301. package/dist/checks/before/env.js +173 -0
  302. package/dist/checks/before/files.js +185 -0
  303. package/dist/checks/before/index.js +162 -0
  304. package/dist/checks/before/mcp.js +111 -0
  305. package/dist/checks/before/repo.js +71 -0
  306. package/dist/checks/before/version.js +60 -0
  307. package/dist/checks/status-holes.js +393 -0
  308. package/dist/cli.js +692 -0
  309. package/dist/commands/analysis.js +325 -0
  310. package/dist/commands/ci/ci.js +438 -0
  311. package/dist/commands/comply.js +310 -0
  312. package/dist/commands/harvest.js +354 -0
  313. package/dist/commands/install/check.js +61 -0
  314. package/dist/commands/install/doctor.js +207 -0
  315. package/dist/commands/install/install.js +461 -0
  316. package/dist/commands/install/uninstall.js +815 -0
  317. package/dist/commands/install/upgrade.js +771 -0
  318. package/dist/commands/launch.js +118 -0
  319. package/dist/commands/lib.js +362 -0
  320. package/dist/commands/registry.js +50 -0
  321. package/dist/commands/setup/setup.js +158 -0
  322. package/dist/commands/telemetry.js +29 -0
  323. package/dist/commands/workflow/branches.js +1265 -0
  324. package/dist/commands/workflow/context.js +846 -0
  325. package/dist/commands/workflow/counters.js +227 -0
  326. package/dist/commands/workflow/fids.js +224 -0
  327. package/dist/commands/workflow/issues.js +585 -0
  328. package/dist/commands/workflow/ledgers.js +472 -0
  329. package/dist/commands/workflow/locks.js +364 -0
  330. package/dist/commands/workflow/prs.js +904 -0
  331. package/dist/commands/workflow/repo.js +199 -0
  332. package/dist/commands/workflow/roadmap.js +495 -0
  333. package/dist/commands/workflow/runs.js +1717 -0
  334. package/dist/commands/workflow/runtime.js +257 -0
  335. package/dist/commands/workflow/skills.js +110 -0
  336. package/dist/commands/workflow/status.js +392 -0
  337. package/dist/commands/workflow/steps.js +1093 -0
  338. package/dist/commands/workflow/tests.js +144 -0
  339. package/dist/commands/workflow/workflows.js +1342 -0
  340. package/dist/commands/workflow/workstreams.js +141 -0
  341. package/dist/commands/workflow/worktrees.js +473 -0
  342. package/dist/install/cloud-env.js +819 -0
  343. package/dist/install/managed-block.js +182 -0
  344. package/dist/install/manifest.js +376 -0
  345. package/dist/install/modules/claude.js +288 -0
  346. package/dist/install/modules/cloud.js +152 -0
  347. package/dist/install/modules/codex.js +193 -0
  348. package/dist/install/modules/core.js +511 -0
  349. package/dist/install/modules/cursor.js +186 -0
  350. package/dist/install/modules/index.js +152 -0
  351. package/dist/install/modules/opencode.js +504 -0
  352. package/dist/install/placeholders.js +87 -0
  353. package/dist/install/template-copies.js +106 -0
  354. package/dist/install/version-file.js +204 -0
  355. package/dist/install/write.js +342 -0
  356. package/dist/ledgers/clamp-log.js +27 -0
  357. package/dist/ledgers/status.js +156 -0
  358. package/dist/ledgers/telemetry.js +637 -0
  359. package/dist/render/hosts.js +339 -0
  360. package/dist/render/models.js +288 -0
  361. package/dist/render/parts.js +33 -0
  362. package/dist/render/trackers.js +135 -0
  363. package/dist/shared/egress.js +299 -0
  364. package/dist/shared/json.js +16 -0
  365. package/dist/shared/log-prefix.js +7 -0
  366. package/dist/shared/package-json.js +22 -0
  367. package/dist/shared/package-manager.js +32 -0
  368. package/dist/shared/package-roots.js +145 -0
  369. package/dist/shared/protected-paths.js +153 -0
  370. package/dist/shared/settings.js +44 -0
  371. package/dist/shared/timeouts.js +19 -0
  372. package/dist/tools/wording.js +680 -0
  373. package/package.json +101 -4
@@ -0,0 +1,218 @@
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. `@bkit-audit-generate` fills this template. -->
2
+
3
+ <!-- bkit:start -->
4
+
5
+ {{BKIT_MANAGED_MARKER}}
6
+
7
+ # Cost Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Judge every vendor's plan against usage, bill drivers, and whether a spike would be noticed before the invoice.
11
+ >
12
+ > **Rules:**
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 evidence (`file:line`, or command / query and its output) and tool behind it.
21
+ > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
+ > - never change a plan, cancel a resource, or edit a billing setting.
23
+ > - NEVER copy an invoice number, payment-card detail, account id, or secret into the report.
24
+
25
+ ## Universal Instructions
26
+
27
+ ### Context & Goals
28
+
29
+ - Spend spans many vendors, each on its own plan; nobody sees the whole bill.
30
+ - Tiers chosen pre-launch stop fitting; free tiers end without deploy; usage-billed services spike from one bug (retry loop, cron fan-out over every tenant, uncapped scraper).
31
+ - A cut is never only saving: report what it would stop (e.g. uptime monitor disabled for billing never alerts).
32
+
33
+ **Applies when:** paid vendors, usage-billed APIs, or payment / store fees. None → one `N/A` row with evidence, never "clean".
34
+
35
+ **Cadence:** monthly, after invoices close. Extra pass when a vendor or a paid plan is added or changed, a spend alert fires, or at launch.
36
+
37
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
38
+
39
+ - FinOps Framework (e.g. the current edition). Capabilities this audit uses: Allocation, Anomaly Management, Budgeting, Forecasting, Unit Economics, and Rate Optimization, across Public Cloud, SaaS, and AI.
40
+ - FOCUS (FinOps Open Cost and Usage Specification); record the version.
41
+ - Vendor spend-control docs (e.g. host spend management, database spend cap, model-gateway guardrails, error-tracker spike protection); record the date read.
42
+
43
+ ### Scope
44
+
45
+ - Every vendor, plan, and environment, including fees that are not a vendor plan.
46
+ - Usage drivers in code, egress, and metered observability.
47
+ - Unit cost against revenue.
48
+ - Seats, idle resources, and duplicate vendors.
49
+ - Spend caps and alerts: whether a spike is noticed, and what a cap does when hit.
50
+ - Legacy subscriptions still billing after a replacement shipped.
51
+ - Currency, foreign exchange, and tax.
52
+
53
+ ### Out of Scope
54
+
55
+ <!-- prettier-ignore -->
56
+ | Excluded item | Why | Where it belongs |
57
+ | --- | --- | --- |
58
+ | Model-call limits in code | LLM sweep | `bkit-audit-llm` |
59
+ | Why CI minutes are high | CI performance sweep | `bkit-audit-ci-performance` |
60
+ | Whether a seat's access is still justified | Security sweep | `bkit-audit-security` |
61
+ | Editing docs to add a vendor | Documentation sweep | `bkit-audit-documentation` |
62
+ | Changing a plan, cap, or billing setting | Audit reports only | Plan from this report |
63
+
64
+ ### Verdicts
65
+
66
+ One per vendor, and one per paid resource inside a vendor that has several.
67
+
68
+ - **KEEP:** used, and the plan fits. Say what uses it.
69
+ - **RIGHT-SIZE:** used, but plan/tier no longer fits: unused headroom or near a hard limit. State change, monthly saving, and what it would stop.
70
+ - **REMOVE:** billed, nothing uses it. Proof = no code calls it and no workflow needs it (wider dead code → `bkit-audit-dead-code`). Language-server references where available, and text search; empty is inconclusive. Re-run an empty result once before `REMOVE`.
71
+ - **ASK:** cannot tell from evidence, usually unread dashboard. Name who can. An unread bill is `ASK`, never cheap.
72
+ - **OTHER:** fits none. Say why. Same `OTHER` on 2 runs → propose new verdict in `Process Improvements`.
73
+
74
+ ### Pre-Flight / Dependencies
75
+
76
+ **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.
77
+
78
+ #### Core
79
+
80
+ Always verify.
81
+
82
+ - [ ] **Bills:** Steps 3–5, 8 — invoices or billing export (e.g. FOCUS), read-only plan/usage/cap pages (e.g. host dashboard, cloud billing console, vendor API). Fallback: unread vendor = `ASK`; tax, foreign exchange, and card fees `Not Checked`.
83
+ - [ ] **Code Search:** Steps 3, 6, 7 — SDKs, outbound hosts, reference checks (e.g. ripgrep, language-server references). Fallback: docs and invoices only; `REMOVE` proof marked incomplete.
84
+ - [ ] **Web:** Step 9 — fetch anchor standards. Fallback: versions recorded as unread.
85
+
86
+ #### Conditional
87
+
88
+ Verify only when applicable.
89
+
90
+ - [ ] **Payment Reports:** Processor or store fees → Steps 3, 5 — fee and commission reports (e.g. card processor, app-store proceeds). Fallback: `Not Checked`.
91
+ - [ ] **Legacy Accounts:** Migration map names replaced platform → Step 3 — confirm those subscriptions are not still billing. Fallback: `ASK`.
92
+
93
+ ### 🔒 Gate 1: Prerequisites Check
94
+
95
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
96
+
97
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
98
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
99
+
100
+ ### Probe Steps
101
+
102
+ - [ ] **Step 1 — Previous Run:** Record `git rev-parse HEAD`. Read newest prior report for this slug under `docs/audits/`. 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.
103
+ - [ ] **Step 2 — Detect:** Find paid vendors, usage-billed APIs, or payment / store fees (manifests, outbound hosts, vendor docs). **Done when:** evidence in `Checked`, or `N/A` and STOP.
104
+ - [ ] **Step 3 — Inventory:** Build list from code (SDKs, outbound hosts), docs (vendor list, secrets list), and owner-shared invoices; compare. In code, not docs = finding (doc fix → `bkit-audit-documentation`). On invoice, nowhere in code = `REMOVE` candidate. Count non-vendor-plan fees (card-processor, app-store commission): grow with paying accounts; no vendor dashboard. Replaced platform still billing after replacement shipped = `REMOVE` candidate. **Done when:** `Vendors` lists every vendor with its sources.
105
+ - [ ] **Step 4 — Plans:** Per vendor: plan, billing model (flat, per seat, per use), spend last three months, usage driver, plan limit, proximity to limit. Split by environment; preview/dev billed like production = finding. Per usage-billed vendor: preview/E2E/CI vs production share, by feature where vendor can tell. Log audit environment split → start from `bkit-audit-logs`. E2E-driven usage on usage-billed vendor = `RIGHT-SIZE` candidate. Every free-tier resource production/CI depends on; behavior at limit (e.g. free DB pauses, free monitor stops). Free tier failing hard = finding even at $0 today. Compare monthly vs annual, prepaid credits, startup programmes, committed-use discounts; propose commitment only if usage stable ≥3 months. Record billing currency, card FX fees, sales tax/VAT/GST/reverse-charge correctness (invoice + card statement, not dashboards). **Done when:** `Vendors` row per vendor: verdict · plan · billing model · three-month spend · change since previous report · driver · limit · environment split. Total spend included.
106
+ - [ ] **Step 5 — Unit Cost:** Total monthly cost ÷ active accounts and active users; split fixed/variable. Per metered feature, cost per action (e.g. per model assist, per inbound message). Series vs previous report: without unit cost, bill health is undecidable as usage grows. vs revenue: price × assumed conversion, less processor fees and store commission, vs cost per account. Account costing more than it pays = finding with assumptions. **Done when:** `Unit Cost` holds figures, trend, assumptions.
107
+ - [ ] **Step 6 — Drivers:** Per usage-billed service: code driving the meter and worst case (retry, tenant fan-out, cron frequency). Multiplier with no upper bound = finding. Model-call multiplier also names `bkit-audit-llm` (in-code limits); other unbounded multipliers name `docs/failures.jsonl` row to append (append = next step). Egress/data transfer own line: grow with users, unnamed in code (DB egress, cached egress, host data transfer, origin transfer, storage transforms, log-drain egress); top routes/buckets by bytes. Observability metered: log drains, host observability events, replay, trace sample rates in code. From drivers, forecast monthly cost at 10× and 100× today's active accounts; name first vendor whose tier breaks and month at current growth. CI minutes → `bkit-audit-ci-performance`; do not analyse here. **Done when:** `Drivers` row per meter; `Forecast` holds 10×, 100×, first tier break, month.
108
+ - [ ] **Step 7 — Leftovers:** Seats for people who no longer need them — cost only here; access → `bkit-audit-security`. Idle resources: projects, DBs, monitors, buckets, domains from experiments. Duplicates: two vendors, one job. **Done when:** `Leftovers` row per hit with monthly amount and verdict.
109
+ - [ ] **Step 8 — Caps:** Per usage-billed vendor: spend cap or budget alert, amount, recipients. No cap and no alert = finding even when spend is small. When hit:
110
+ - Notify, stop spend, or pause service; whether hit = outage. Notify-only may leave production serving; pause may take production down (e.g. host spend limit notifies unless production deploys paused). Record check frequency; lag → overshoot.
111
+ - Line items cap does not cover; name per vendor spend-cap doc (e.g. compute, log drains).
112
+ - Model-gateway keys (e.g. per-key spend limit with reset, guardrail budget). Separate keys per environment/feature so preview or one feature cannot drain production. In-code limits → `bkit-audit-llm`; key-level budget stays here. No spend limit or one key shared across environments = finding.
113
+ - Error tracker: spike protection per project + notification when tripped (protection on alone does not notify). Ingest keys rate-limited. On-demand budget set. Quota exhaustion blinds `bkit-audit-logs`.
114
+
115
+ Anomalies since previous report: how found (alert or invoice), time to find, cost avoided. Cap that only notifies, omits line items, or pauses production → owner decision on notify/cap/pause with what each would stop; this run does not set it. **Done when:** `Caps` row per usage-billed vendor, and anomaly list.
116
+
117
+ - [ ] **Step 9 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per FinOps capability (Allocation, Anomaly Management, Budgeting, Forecasting, Unit Economics, and Rate Optimization) → checked (name step) / not applicable (why) / finding. Score each capability crawl, walk, or run; name next to raise. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
118
+ - [ ] **Step 10 — Anything Else:** (a) Everything changed since previous report's commit touching cost (SDKs, outbound hosts, vendors, plans, crons, schedules, fan-outs, model calls, sample rates, environment, seat changes) → one-line verdict each. (b) Bounded ~30 min pass: what senior FinOps flags that no step asks; read since previous run (incidents, log-audit reports under `docs/audits/`, new `docs/failures.jsonl` rows, vendor status incidents) — what would no step catch? Include invoice charges Steps 4–8 do not explain (new line item, fee, tax, FX, overage). **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
119
+
120
+ ### 🔒 Gate 2: Probes Check
121
+
122
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
123
+
124
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
125
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
126
+ - [ ] **No billing writes:** no plan, resource, cap, or billing setting changed.
127
+ - [ ] **No account secrets:** no invoice number, card detail, account id, or secret in the report.
128
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
129
+
130
+ ## Findings
131
+
132
+ <!-- prettier-ignore -->
133
+ | Severity | Use |
134
+ | --- | --- |
135
+ | `CRITICAL` | A cap or free-tier limit that stops production with no workaround; an unbounded meter already able to exhaust the account with no way to stop it |
136
+ | `HIGH` | Usage-billed vendor with no cap and no alert; account costs more than it pays; forecast breaks a tier inside the planning window; legacy subscription still billing after its replacement is live |
137
+ | `MEDIUM` | Plan no longer fits (`RIGHT-SIZE`); preview, end-to-end, or CI share of a usage bill; free tier that fails hard; cap that only notifies, omits line items, or pauses production; duplicate vendor; tax or foreign exchange applied wrongly |
138
+ | `LOW` | Docs omit a vendor the code calls; a seat whose access is otherwise in scope for the security sweep; a currency note with no wrong charge |
139
+
140
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: larger monthly amount first. No cap and no alert on a usage-billed vendor is at least `HIGH`, even when today's spend is small.
141
+
142
+ <!-- prettier-ignore -->
143
+ | ID | Severity | Verdict | Location | Evidence | Expected |
144
+ | --- | --- | --- | --- | --- | --- |
145
+ | PENDING | PENDING | PENDING | PENDING | PENDING | PENDING |
146
+
147
+ Empty and clean → one row `None`.
148
+
149
+ ## Report
150
+
151
+ ### Summary
152
+
153
+ PENDING
154
+
155
+ ### Previous Run
156
+
157
+ PENDING
158
+
159
+ ### Vendors
160
+
161
+ PENDING
162
+
163
+ ### Unit Cost
164
+
165
+ PENDING
166
+
167
+ ### Drivers
168
+
169
+ PENDING
170
+
171
+ ### Forecast
172
+
173
+ PENDING
174
+
175
+ ### Leftovers
176
+
177
+ PENDING
178
+
179
+ ### Caps
180
+
181
+ PENDING
182
+
183
+ ### Checked
184
+
185
+ PENDING
186
+
187
+ ### Not Checked
188
+
189
+ PENDING
190
+
191
+ ### Standards Coverage
192
+
193
+ PENDING
194
+
195
+ ### Beyond the Steps
196
+
197
+ PENDING
198
+
199
+ ### Process Improvements
200
+
201
+ PENDING
202
+
203
+ ### 🔒 Gate 3: Report Check
204
+
205
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
206
+
207
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
208
+ - [ ] **Summary:** names count per severity and total monthly spend.
209
+ - [ ] **Series:** `Vendors` spend, `Unit Cost`, and `Forecast` beside previous report's numbers, or marked baseline.
210
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
211
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
212
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
213
+
214
+ > `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.
215
+
216
+ <!-- bkit:end -->
217
+
218
+ ## Project Instructions
@@ -0,0 +1,221 @@
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. `@bkit-audit-generate` fills this template. -->
2
+
3
+ <!-- bkit:start -->
4
+
5
+ {{BKIT_MANAGED_MARKER}}
6
+
7
+ # Coverage Floor
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Ratchet of a CI coverage-floor gate — whether each committed floor still sits under measured branch coverage, and the next floor a gated surface should move to.
11
+ >
12
+ > **Rules:**
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 evidence (`file:line`, or command / query and its output) and tool behind it.
21
+ > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
+ > - never edit workflows, floor files, coverage config, or the gate script; the report states the edit.
23
+ > - never lower a floor, add an exclusion, or add an ignore hint.
24
+ > - NEVER run a tool that rewrites source to measure mutants or coverage. Read artifacts already produced.
25
+
26
+ ## Universal Instructions
27
+
28
+ ### Context & Goals
29
+
30
+ Static floor: coverage climbs, gate far below, large drop passes green. One-run tighten flakes — identical-code branch coverage moves between runs — flaky gate gets disabled. Target failure: **a floor left far under measured coverage, or ratcheted onto noise**.
31
+
32
+ **Applies when:** coverage floor gate exists. None → one `N/A` row with evidence, never "clean".
33
+
34
+ **Cadence:** monthly; extra pass after coverage lift, runner/provider version change, include/exclude/measured-glob change, or new package/app under gated glob.
35
+
36
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
37
+
38
+ - Coverage practice for a gate (e.g. Google, "Code Coverage Best Practices"; Ivanković et al., "Code Coverage at Google").
39
+ - Coverage guide for pinned runner and provider (e.g. Vitest coverage, including `coverage.include` and AST-aware remapping; Jest coverage; Istanbul). Record major pinned.
40
+ - Patch (diff) coverage (e.g. Codecov patch status; PR coverage-comment changed-file mode). Record action version.
41
+ - Ratchet tooling (e.g. Betterer). Record version read.
42
+ - Goodhart's law: coverage is a signal, not a goal.
43
+
44
+ ### Scope
45
+
46
+ - Floor history: no floor dropped, no new exclusion, no new ignore hint.
47
+ - Sample ≥10 full runs per gated surface; ratchet from lowest, never one run.
48
+ - Denominator: glob-should-cover files vs summary files.
49
+ - Identical-code variance across two runs; cause (tests vs tooling).
50
+ - Recommended floor per gated surface; surfaces move independently.
51
+ - Report-only surfaces, including named surface emitting no coverage.
52
+ - High-risk modules, report-only.
53
+ - Patch coverage of changes merged since previous report.
54
+
55
+ ### Out of Scope
56
+
57
+ <!-- prettier-ignore -->
58
+ | Excluded item | Why | Where it belongs |
59
+ | --- | --- | --- |
60
+ | Whether tests check the right behaviour, can fail, or run | Test quality | `bkit-audit-testing` |
61
+ | Conditional or timing-dependent tests behind a spread | Flake sweep | `bkit-audit-flakes` |
62
+ | Patch coverage as a new required check | Gate ranking | `bkit-audit-gates` |
63
+ | Changing floors, exclusions, ignore hints, or workflows | Audit reports only | Plan from this report |
64
+
65
+ ### Pre-Flight / Dependencies
66
+
67
+ **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.
68
+
69
+ #### Core
70
+
71
+ Always verify.
72
+
73
+ - [ ] **CI History:** Steps 4, 5, 7, 10 — branch coverage from full CI runs, e.g. `gh run list` / `gh run download`, GitLab pipelines, Codecov. Fallback: local re-runs fill gap; mark every local observation.
74
+ - [ ] **Coverage Artifacts:** Steps 6, 7, 11, 12 — summary and per-file coverage, e.g. `coverage-summary.json`, `coverage-final.json`, lcov. Fallback: percentages only; file-level claims `Not Checked`.
75
+ - [ ] **Git History:** Steps 3, 9, 15 — `git log -L` / `git log -p` on floor values and coverage config. Fallback: current tree only; history `Not Checked`.
76
+ - [ ] **Web:** Step 14 — fetch anchor standards. Fallback: versions recorded as unread.
77
+
78
+ #### Conditional
79
+
80
+ Verify only when applicable.
81
+
82
+ - [ ] **Local Runner:** Fewer than ten CI observations for a gated surface → Steps 4, 7 — re-run that surface's coverage command in detached worktree, removed before report finishes. Fallback: do not tighten that surface; shortfall in `Not Checked`.
83
+ - [ ] **Mutation Score:** Mutation report or `bkit-audit-testing` report exists → Step 9 — latest score beside each gated surface. Fallback: movement without mutation comparison; record in `Not Checked`. Do not start a run that rewrites source.
84
+ - [ ] **Patch Source:** Changed-file coverage reported → Step 12 — e.g. PR coverage comment changed-file table, Codecov patch status. Fallback: diff plus per-file coverage; if neither, `Not Checked`.
85
+
86
+ ### 🔒 Gate 1: Prerequisites Check
87
+
88
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
89
+
90
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
91
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
92
+
93
+ ### Probe Steps
94
+
95
+ - [ ] **Step 1 — Previous Run:** Record `git rev-parse HEAD`. Read newest prior report for this slug under `docs/audits/`. 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.
96
+ - [ ] **Step 2 — Detect:** Find coverage floor gate (CI job, script, or threshold failing below committed number) and where number is stored. List hard-gated vs report-only surfaces. Metric = branch coverage unless recorded decision names another; line, statement, function percentages are not floors. None → `N/A` and STOP. **Done when:** gate path, metric, surface list in `Checked`, or `N/A` and STOP.
97
+ - [ ] **Step 3 — History:** Since previous report's commit: no floor dropped (`git log -L` on each floor value and coverage include / exclude). Floor never moves down; drop is fixed, not accommodated. Diff exclusions. Count ignore hints under each gated glob, then and now (e.g. `v8 ignore`, `istanbul ignore`, `c8 ignore`, `# pragma: no cover`). Each new exclusion and ignore hint, with commit = finding. **Done when:** `History` lists every floor change, new exclusion, and new ignore hint, or `none`.
98
+ - [ ] **Step 4 — Sample:** Per gated surface, ≥10 full runs: same commit, or most recent full CI runs on default branch. CI history first; local re-run only to fill gap; mark local observations. Record every run id. No partial lane. Never ratchet off single run. **Done when:** `Sample` holds ≥10 observations per gated surface, or named shortfall and that floor not tightened.
99
+ - [ ] **Step 5 — Lowest:** Per gated surface, record every observation; ratchet from lowest, not latest. Write covered/total beside percentage. Spread = max − min. Spread above two points = finding (non-deterministic coverage); `Variance` finds cause; `Floor` does not tighten until spread fixed. **Done when:** `Sample` row per surface: observations · covered/total · lowest · spread.
100
+ - [ ] **Step 6 — Denominator:** Runner omits file no test imports unless include list names it (e.g. Vitest ≥4) → compare summary file count with `git ls-files` for glob surface should cover; list source files missing from report. Missing file inflates percentage = finding. Other runner → equivalent omission, or skip with evidence. **Done when:** missing files in `Denominator`, or skip recorded.
101
+ - [ ] **Step 7 — Variance:** Identical-code coverage should match. Two runs on same commit → diff per-file coverage (e.g. `coverage-final.json`); list files whose covered branches differ. Conditional or timing-dependent tests → `bkit-audit-flakes`. **Done when:** file list in `Variance`, or identical and recorded.
102
+ - [ ] **Step 8 — Floor:** Recommended floor = lowest observation, rounded down, minus one point. Spread above two points keeps current floor. Recommended below current floor → leave floor; drop = finding. Surfaces ratchet separately; do not nudge surface whose tests did not change. **Done when:** `Recommendation` holds current · lowest · recommended · move? per gated surface.
103
+ - [ ] **Step 9 — Movement:** Name tests that caused lift; durable (every tier invocation) vs conditional lane. Ratchet with no named cause = finding. Before crediting tests, record runner, coverage-provider package, and provider per run in `Sample`; diff lockfile between oldest and newest. Provider change (e.g. AST-aware remapping) moves branch counts with no test change → do not credit tests. Latest mutation score beside each gated surface. Coverage up, mutation flat = finding (covers code, checks nothing → `bkit-audit-testing`). **Done when:** `Movement` names cause per surface, or tooling change explaining it.
104
+ - [ ] **Step 10 — Report-Only:** List report-only surfaces and numbers. Not gating is part of record: stay report-only (why) or date to decide. Reported across runs with no decision = finding. Project-named surface with no coverage = finding, not omission. Record E2E-collected coverage, or server/route code no unit test reaches (e.g. V8/Istanbul via browser runner and merger). If none, say so. **Done when:** `Report-Only` row per surface: number · decision · coverage collected?
105
+ - [ ] **Step 11 — Modules:** Per project-named high-risk area: branch coverage and absolute uncovered branches. Name files so next run measures same set. Report-only; does not move floor. **Done when:** `Modules` row per area: files · branch % · uncovered branches.
106
+ - [ ] **Step 12 — Patch:** Every change merged since the previous report whose changed lines had branch coverage below a stated bar, and state the bar (default 90% per commit unless the project states another). Patch coverage names the change that dropped coverage, which the aggregate gate does not. Below the bar = finding, and a gate candidate for `bkit-audit-gates`. **Done when:** `Patch` lists every below-bar change, or `none`, and states the bar.
107
+ - [ ] **Step 13 — Recommend:** State old floor → new floor per surface and edit (file and value). Do not apply. Workflow change in edit needs explicit human confirmation. Note whether previous report's recommended floor matches tree. Per surface, one line on red: often untested file under glob, not removed coverage. If CI does not print recommended next floor (lowest of sample, rounded down, minus one point) beside current, propose in `Process Improvements`. **Done when:** `Recommendation` holds edit text and red-means line; tree unchanged.
108
+ - [ ] **Step 14 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per anchor practice for coverage gate (e.g. per-commit bar, include-list guidance, patch coverage, ratchet tooling) → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
109
+ - [ ] **Step 15 — Anything Else:** (a) Everything since previous report's commit touching coverage measurement (runner/provider versions, include/exclude, ignore hints, measured globs, floor files, gate script, merge script, floor step, new packages/apps) → one-line verdict each. (b) Bounded ~30 min pass: what senior test engineer owning CI quality gates flags that no step asks; read since previous run (incidents, `bkit-audit-logs` reports, new `docs/failures.jsonl` rows, vendor status) — what would no step catch? **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
110
+
111
+ ### 🔒 Gate 2: Probes Check
112
+
113
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
114
+
115
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
116
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
117
+ - [ ] **Floors untouched:** no workflow, floor file, coverage config, or gate script changed.
118
+ - [ ] **Sample:** every gated surface has ≥10 full-run observations, or named shortfall and its floor not tightened; no partial lane in the sample.
119
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
120
+
121
+ ## Findings
122
+
123
+ <!-- prettier-ignore -->
124
+ | Severity | Use |
125
+ | --- | --- |
126
+ | `CRITICAL` | Floor gate removed, or a gated surface dropped from it with no replacement; gate passes when the coverage summary is missing |
127
+ | `HIGH` | Floor lowered; new exclusion or ignore hint under a gated glob; spread above two points; source files in the glob missing from the summary |
128
+ | `MEDIUM` | Recommended floor below current and the drop left in place; coverage up while the mutation score stays flat; report-only surface with no stay-or-gate decision; high-risk module with uncovered branches; change merged below the patch bar; movement with no named cause |
129
+ | `LOW` | Comment or prose in a floor file that does not change the number; report-only drift inside a recorded stay-report-only decision |
130
+
131
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: gated surfaces, then exclusions.
132
+
133
+ <!-- prettier-ignore -->
134
+ | ID | Severity | Location | Evidence | Expected |
135
+ | --- | --- | --- | --- | --- |
136
+ | PENDING | PENDING | PENDING | PENDING | PENDING |
137
+
138
+ Empty and clean → one row `None`.
139
+
140
+ ## Report
141
+
142
+ ### Summary
143
+
144
+ PENDING
145
+
146
+ ### Previous Run
147
+
148
+ PENDING
149
+
150
+ ### History
151
+
152
+ PENDING
153
+
154
+ ### Sample
155
+
156
+ PENDING
157
+
158
+ ### Denominator
159
+
160
+ PENDING
161
+
162
+ ### Variance
163
+
164
+ PENDING
165
+
166
+ ### Movement
167
+
168
+ PENDING
169
+
170
+ ### Report-Only
171
+
172
+ PENDING
173
+
174
+ ### Modules
175
+
176
+ PENDING
177
+
178
+ ### Patch
179
+
180
+ PENDING
181
+
182
+ ### Recommendation
183
+
184
+ PENDING
185
+
186
+ ### Checked
187
+
188
+ PENDING
189
+
190
+ ### Not Checked
191
+
192
+ PENDING
193
+
194
+ ### Standards Coverage
195
+
196
+ PENDING
197
+
198
+ ### Beyond the Steps
199
+
200
+ PENDING
201
+
202
+ ### Process Improvements
203
+
204
+ PENDING
205
+
206
+ ### 🔒 Gate 3: Report Check
207
+
208
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
209
+
210
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
211
+ - [ ] **Summary:** names count per severity, and old floor → recommended floor per gated surface.
212
+ - [ ] **Series:** `Sample` spreads and the floor series beside previous report's numbers, or marked baseline.
213
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
214
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
215
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
216
+
217
+ > `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.
218
+
219
+ <!-- bkit:end -->
220
+
221
+ ## Project Instructions