@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,241 @@
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
+ # CI Performance Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Where CI wall clock and spend go, which lane holds the run open, and whether a change buys latency or cost.
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 dispatch, rerun, or cancel a workflow. A runner-class experiment is named, not run.
23
+ > - Billable rates are read this run from the billing pages. never copy a previous report's prices.
24
+
25
+ ## Universal Instructions
26
+
27
+ ### Context & Goals
28
+
29
+ CI time gets re-argued from impressions. Two mistakes recur:
30
+
31
+ - Lane duration alone ≠ wall-clock savings — only finish time relative to the run shows whether trimming it helps.
32
+ - Cost and latency are different purchases: state which a change buys, every time.
33
+ - Target failure: effort on a lane that does not hold the run open, or a latency change reported as money saved.
34
+
35
+ **Applies when:** a CI workflow. None → one `N/A` row with evidence, never "clean".
36
+
37
+ **Cadence:** quarterly; extra pass when workflow topology changes (new lane, runner class, or cache).
38
+
39
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
40
+
41
+ - DORA software delivery performance: change lead time, deployment frequency, failed-deployment recovery time, change fail rate, and deployment rework rate.
42
+ - Host CI metrics (e.g. GitHub Actions usage and performance: job run time, queue time, failure rate). Living docs; record the date read.
43
+ - Task-runner remote cache and affected selection (e.g. Turborepo remote caching and `--affected`), at the version in the lockfile.
44
+ - Package-manager store cache in CI (e.g. pnpm via `actions/setup-node` `cache: pnpm`), at the pinned setup version.
45
+ - Browser-test sharding and report merge (e.g. Playwright sharding and `merge-reports`), at the version in the lockfile.
46
+ - Concurrency groups and job timeouts (e.g. GitHub Actions `concurrency` and `timeout-minutes`).
47
+ - Runner billing (e.g. GitHub-hosted and larger runners, a remote builder such as Depot, mobile-build credits such as EAS). Record the date read.
48
+
49
+ ### Scope
50
+
51
+ - Per-lane duration, queue, finish time, and whether the lane holds the run open.
52
+ - Distributions (p50 and p90), not a single run, and job timeouts.
53
+ - Change lead time push → green → deployed, split by segment.
54
+ - Step timings, cache hit rate, shard balance, per-job setup cost, artifacts — on lanes that matter.
55
+ - Every cache: hit or miss, restore time vs cold rebuild, usage vs eviction limit.
56
+ - What a change actually runs: path filters and required checks.
57
+ - Local gate, timed separately, cache forced off.
58
+ - Re-runs, failures that passed later, duplicate runs — as minutes.
59
+ - Billable minutes and cost per successful merge; latency or cost on every finding.
60
+
61
+ ### Out of Scope
62
+
63
+ <!-- prettier-ignore -->
64
+ | Excluded item | Why | Where it belongs |
65
+ | --- | --- | --- |
66
+ | Spend outside CI minutes | Whole bill | `bkit-audit-cost` |
67
+ | Which checks should gate | Gate sweep | `bkit-audit-gates` |
68
+ | Product request latency | Hot paths | `bkit-audit-app-performance` |
69
+ | Why a test flakes, beyond minutes lost | Flake sweep | `bkit-audit-flakes` |
70
+ | Changing workflows, runners, or caches | Audit reports only | Plan from this report |
71
+
72
+ ### Pre-Flight / Dependencies
73
+
74
+ **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.
75
+
76
+ #### Core
77
+
78
+ Always verify.
79
+
80
+ - [ ] **CI API:** Steps 2–6, 10–11 — read-only run and job metadata, e.g. `gh run view`, `gh api`. Fallback: workflow files only; timings `Not Checked`.
81
+ - [ ] **Workflow Files:** Steps 3, 7–10 — workflows, task graph, cache config readable. Fallback: none; those steps `Not Checked`.
82
+ - [ ] **Web:** Step 12 — fetch anchor standards and current runner prices. Fallback: versions and prices unread. never reuse a previous report's prices.
83
+
84
+ #### Conditional
85
+
86
+ Verify only when applicable.
87
+
88
+ - [ ] **Host Metrics:** Host publishes queue time → Step 3 — e.g. Actions performance page. Fallback: queue from timestamps only.
89
+ - [ ] **Cache API:** Cache listing exists → Step 7 — e.g. `gh cache list`. Fallback: log lines only; eviction `Not Checked`.
90
+ - [ ] **Remote Builders:** Job only waits on external builder → Step 6 — builder API or log, e.g. EAS GraphQL. Fallback: wrapper-job duration only; worker time `Not Checked`.
91
+ - [ ] **Local Gate:** Pre-push or local CI command exists → Step 9. Fallback: skip with evidence.
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 — Reference:** Name reference run ids, event type, date. Push to integration branch vs pull request = different pipelines (some lanes push-only); never compare as one number without saying so. Record green/red per run — red lanes exit early and under-report duration. Runner classes and external queues drift; date matters. **Done when:** `Reference` holds ids, event types, conclusions, date.
104
+ - [ ] **Step 3 — Lanes:** Per job: conclusion, duration, start, column for holds-the-run-open (duration alone is not that column). Add queue time — duration start→completion hides runner wait. Queue = run created → job started; with `needs:` subtract upstream finish for runner wait; keep `needs:` wait for Step 5. Cross-check host average queue per job. e.g. GitHub Actions:
105
+
106
+ ```
107
+ gh run view <id> --json jobs \
108
+ --jq '.jobs[] | "\(.name)\t\(.conclusion)\t\((((.completedAt|fromdate)-(.startedAt|fromdate))/60)|floor)m\t\(.startedAt)"'
109
+ gh api "repos/{owner}/{repo}/actions/runs/<id>" --jq .created_at
110
+ gh api "repos/{owner}/{repo}/actions/runs/<id>/jobs?per_page=100" \
111
+ --jq '.jobs[] | "\(.name)\t\(.created_at)\t\(.started_at)"'
112
+ ```
113
+
114
+ **Done when:** `Lanes` has duration, queue, finish, holding-the-run-open per job.
115
+
116
+ - [ ] **Step 4 — Distributions:** One run cannot separate regression from noise. Pull ≥20 recent CI workflow runs per event type; keep green and red apart. Report p50 and p90 for total wall clock and critical-path lane finish, per event type. Say how typical Step 2 runs are. Every job timeout ≈1.5× its p99 (in this sample size, slowest run). No timeout → host default (e.g. GitHub Actions 360 minutes) and bills all of it. e.g. `gh api "repos/{owner}/{repo}/actions/workflows/<workflow>/runs?event=push&branch=<branch>&per_page=30"`. **Done when:** p50 and p90 in `Distributions`; each job within timeout rule or finding.
117
+ - [ ] **Step 5 — Lead Time:** Lane finish times = one segment. Report DORA change lead time for push to integration branch: push → all lanes green → deployed. Split queue (Step 3), critical-path execution, `needs:` waits, re-run time (Step 10). Name dominating segment — that is the one worth buying down. **Done when:** `Lead Time` names split and dominating segment.
118
+ - [ ] **Step 6 — Timings:** Inside lanes that hold the run open or that a proposal would trim: step timings; task-runner cache hit rate (zero cached on a lane that should cache = finding); test counts executed (wall clock per test compares runs better than wall clock alone); remote-builder jobs — record builder queue and build time separately from wrapper; shard balance — slowest/fastest >~1.3× means one shard holds the lane; fixed cost per job (checkout, toolchain setup, install) × parallel jobs (splitting buys wall clock, pays setup again); artifact upload/download time and stored size (large reports every green run cost time and storage). e.g. `gh run view <id> --log --job=<jobId>` and grep cache and executed-count lines. **Done when:** `Timings` holds hit rate, counts, shard ratio or "not sharded", setup cost, artifact size per lane that matters.
119
+ - [ ] **Step 7 — Caches:** Every cache, not only task runner. Hit or miss and restore time: package-manager store, framework build cache, browser binaries, native build caches (e.g. Gradle, CocoaPods, hosted mobile builds), image layer caches. Compare restore vs cold install — restore slower than rebuild = finding. Cache usage vs eviction limit — full cache evicts entries that matter. **Done when:** `Caches` row per cache: hit or miss · restore vs cold · over limit, or absent with evidence.
120
+ - [ ] **Step 8 — Affected:** Do PR lanes run only what changed (affected graph or path filter)? For docs-only change and one-app-scoped change, read `on:` triggers, `paths` filters, job-level `if:` — which lanes each starts. Where `paths` filter is safe, propose it and say required-check interaction: workflow skipped by path filter leaves required checks pending; job skipped by `if` reports success. **Done when:** `Affected` says what each sample change starts and names any required-check trap.
121
+ - [ ] **Step 9 — Local:** Time local gate on whole tree, cache forced off — warm or affected-only numbers are meaningless. Record beside CI critical path. **Done when:** `Local` holds forced whole-tree time, command, whether on critical path.
122
+ - [ ] **Step 10 — Reruns:** Red lane costs full re-run. Read concurrency block before counting. If in-progress runs not cancelled on integration branch, fix-and-repush = two complete runs; if cancelled, count cancelled minutes separately from re-runs — neither is zero. Flakiest lane slowest lane compounds wall clock; minutes here, cause → `bkit-audit-flakes`. Over Step 4 window: runs attempt >1; jobs failed then passed same commit, per lane — both → minutes. Also commits under both push and PR; runs completing after newer run started. **Done when:** `Reruns` holds those minutes and what concurrency block does.
123
+ - [ ] **Step 11 — Cost:** For Step 4 window: billable minutes per lane × runner class current per-minute price, remote-builder minutes, mobile-build credits — read prices this run. Derive cost per successful merge to integration branch, re-runs included. Spend outside CI minutes → `bkit-audit-cost`. Before recommending runner class change for CPU-bound lane, name one-run experiment on larger/different-architecture runner comparing cost and duration (running it is next step — changes workflow). Every finding states whether it buys latency or cost. **Done when:** `Cost` holds minutes, current prices, cost per merge, experiment name or "none".
124
+ - [ ] **Step 12 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per DORA metric, host performance metric, caching/sharding/concurrency/billing practice in anchor list → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
125
+ - [ ] **Step 13 — Anything Else:** (a) Everything changed since previous report's commit touching pipeline (workflows and composite actions, jobs and `needs:`, runner classes, task-runner config and cache keys, shard settings, remote-build profiles, local pre-push gate) → one-line verdict each. (b) Bounded ~30 min pass: what senior CI engineer flags that no step asks; read since previous run (incidents, new `docs/failures.jsonl` rows) — 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`.
126
+
127
+ ### 🔒 Gate 2: Probes Check
128
+
129
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
130
+
131
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
132
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
133
+ - [ ] **Event types:** push and pull request are never treated as one pipeline.
134
+ - [ ] **Prices current:** every rate was read this run, not copied from a prior report.
135
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
136
+
137
+ ## Findings
138
+
139
+ <!-- prettier-ignore -->
140
+ | Severity | Use |
141
+ | --- | --- |
142
+ | `CRITICAL` | No green path through the pipeline; a job with no timeout can bill the host maximum on every run |
143
+ | `HIGH` | The dominating segment is the one a proposal would not touch; latency described as cost savings, or the reverse, on that segment |
144
+ | `MEDIUM` | Cache miss on a lane that should cache; shard imbalance holding a lane open; setup cost paid again on every split; re-run minutes that rival the critical path |
145
+ | `LOW` | A slow lane that does not hold the run open; artifact size that is not on the critical path |
146
+
147
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: critical path first. Every finding states whether it buys latency or cost.
148
+
149
+ <!-- prettier-ignore -->
150
+ | ID | Severity | Location | Evidence | Expected |
151
+ | --- | --- | --- | --- | --- |
152
+ | PENDING | PENDING | PENDING | PENDING | PENDING |
153
+
154
+ Empty and clean → one row `None`.
155
+
156
+ ## Report
157
+
158
+ ### Summary
159
+
160
+ PENDING
161
+
162
+ ### Previous Run
163
+
164
+ PENDING
165
+
166
+ ### Reference
167
+
168
+ PENDING
169
+
170
+ ### Lanes
171
+
172
+ PENDING
173
+
174
+ ### Distributions
175
+
176
+ PENDING
177
+
178
+ ### Lead Time
179
+
180
+ PENDING
181
+
182
+ ### Timings
183
+
184
+ PENDING
185
+
186
+ ### Caches
187
+
188
+ PENDING
189
+
190
+ ### Affected
191
+
192
+ PENDING
193
+
194
+ ### Local
195
+
196
+ PENDING
197
+
198
+ ### Reruns
199
+
200
+ PENDING
201
+
202
+ ### Cost
203
+
204
+ PENDING
205
+
206
+ ### Checked
207
+
208
+ PENDING
209
+
210
+ ### Not Checked
211
+
212
+ PENDING
213
+
214
+ ### Standards Coverage
215
+
216
+ PENDING
217
+
218
+ ### Beyond the Steps
219
+
220
+ PENDING
221
+
222
+ ### Process Improvements
223
+
224
+ PENDING
225
+
226
+ ### 🔒 Gate 3: Report Check
227
+
228
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
229
+
230
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
231
+ - [ ] **Summary:** names count per severity and the segment that dominates wall clock.
232
+ - [ ] **Series:** every series beside previous report's numbers, or marked baseline.
233
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
234
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
235
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
236
+
237
+ > `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.
238
+
239
+ <!-- bkit:end -->
240
+
241
+ ## Project Instructions
@@ -0,0 +1,230 @@
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
+ # Config Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Whether settings outside the code agree across environments, dashboards, repository, and docs — variables, platform, and repository settings, DNS, and anything that expires on a date.
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 print or copy a secret value; names, presence, dates, and truncated SHA-256 fingerprints only.
23
+ > - Dashboards, CLIs, and APIs read-only; NEVER change a setting, secret, or DNS record.
24
+ > - Every drift claim names the environment and where each side was read.
25
+
26
+ ## Universal Instructions
27
+
28
+ ### Context & Goals
29
+
30
+ Code is reviewed; dashboards are not. Dashboard changes (hosting, database, payments, error tracker) leave no diff, review, or history → next environment built from docs differs. Target failure: **drift nobody sees until it fails** — e.g. variable in production missing in preview (preview passes on fallback production never takes, or reverse); required check waiting on renamed job; domain / membership / secret lapsing on a date with no deploy. Each = short outage, cheap to prevent, slow to diagnose (nothing changed).
31
+
32
+ **Applies when:** project deploys to ≥1 hosted environment, or holds settings outside the repo (variables, dashboards, repository settings, DNS). None → one `N/A` row with evidence, never "clean".
33
+
34
+ **Cadence:** monthly. Extra pass before any release, and after any change made in a dashboard.
35
+
36
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
37
+
38
+ - The Twelve-Factor App: III. Config and X. Dev/prod parity.
39
+ - Source-host CI security and ruleset docs (e.g. GitHub Actions secure-use reference, GitHub rulesets REST API).
40
+ - Platform production checklist (e.g. Supabase Production Checklist).
41
+ - TLS certificate validity schedule (e.g. CA/Browser Forum Baseline Requirements, Ballot SC-081v3).
42
+ - DNS CAA (RFC 8659); MTA-STS (RFC 8461) and TLS reporting (RFC 8460).
43
+ - Mailbox-provider sender requirements (e.g. Gmail, Yahoo) and one-click unsubscribe (RFC 8058).
44
+
45
+ ### Scope
46
+
47
+ - Variables across every environment and secret store.
48
+ - Secret values matching across stores; one declared source per secret.
49
+ - Platform dashboard settings vs repo and docs.
50
+ - Runtime versions; scheduled jobs wherever defined.
51
+ - Dashboard change history since previous run; secret-free settings snapshot.
52
+ - Repository rulesets, required checks, and security settings.
53
+ - DNS, domains, registrar, inbound mail transport.
54
+ - Deep / invite links and `.well-known` files.
55
+ - Email deliverability.
56
+ - Expiry calendar: credentials, certificates, accounts, plans.
57
+
58
+ ### Out of Scope
59
+
60
+ <!-- prettier-ignore -->
61
+ | Excluded item | Why | Where it belongs |
62
+ | --- | --- | --- |
63
+ | Config nothing reads; flags set the same everywhere | Dead config | `bkit-audit-dead-code` |
64
+ | Secret rotation, mail-authentication policy, who holds keys, workflow contents | Security sweep | `bkit-audit-security` |
65
+ | Store signing credentials, developer memberships, store accounts | Store sweep | `bkit-audit-app-store` |
66
+ | Rewriting docs that describe a setting wrongly | Docs sweep | `bkit-audit-documentation` |
67
+ | Error-stream and platform-log triage | Log sweep | `bkit-audit-logs` |
68
+ | Coding-agent settings, permissions, hooks, tool servers | Agent config sweep | `bkit-audit-agents` |
69
+ | bkit install state; templates adopted and wired | bkit adoption sweep | `bkit-audit-adoption` |
70
+ | Changing settings, secrets, or records | Audit reports only | Plan from this report |
71
+
72
+ ### Pre-Flight / Dependencies
73
+
74
+ **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.
75
+
76
+ #### Core
77
+
78
+ Always verify.
79
+
80
+ - [ ] **Variable Listing:** Steps 2, 3 — names per environment from every host, CI, and secret store (e.g. `vercel env ls`, `gh secret list` / `gh variable list`, `gcloud secrets list`, `eas env:list`). Fallback: repo-declared names only; environments `Not Checked`.
81
+ - [ ] **Platform Read:** Steps 4–6 — read-only dashboard / CLI / management API per platform (e.g. Vercel API, Supabase Management API, Stripe CLI, Sentry API). Fallback: repo and docs only; platform side `Not Checked`.
82
+ - [ ] **Audit Logs:** Step 6 — per-platform settings-change history (e.g. Vercel team activity, Supabase org audit log, GitHub org / repo audit log). Fallback: snapshot diff only; set-and-reverted changes `Not Checked`.
83
+ - [ ] **Repository API:** Step 7 — rulesets, protection, security settings (e.g. `gh api`, GitLab API). Fallback: none; items `Not Checked`.
84
+ - [ ] **DNS and TLS:** Steps 8, 11 — e.g. `dig`, RDAP / `whois`, `openssl s_client`. Fallback: online checker; name it.
85
+ - [ ] **Web:** Step 12 — fetch anchor standards. Fallback: versions recorded as unread.
86
+
87
+ #### Conditional
88
+
89
+ Verify only when applicable.
90
+
91
+ - [ ] **Built Bundle:** Build-time public variables → Step 3 — preview build's client bundle to search. Fallback: source search only; bundle `Not Checked`.
92
+ - [ ] **Secret Fingerprints:** Secret held in ≥2 stores → Step 3 — read-only value compare by SHA-256 (e.g. repo sync tooling's drift mode `node scripts/secrets/bkit-secrets.mjs drift` from bkit package template `.bkit/templates/scripts/secrets/`; or hash of value read in-process). Fallback: names + `updated_at` only; values `Not Checked`.
93
+ - [ ] **Registrar Account:** Owned domains → Steps 8, 11 — renewal, auto-renew, lock, MFA, contact (e.g. registrar dashboard / API). Fallback: RDAP for lock and expiry; rest `Not Checked`.
94
+ - [ ] **Test Devices:** Native app with deep / invite links → Step 9 — device or emulator with and without the app. Fallback: `.well-known` validation only; link opening `Not Checked`.
95
+ - [ ] **Mailbox-Provider Tools:** Sends email → Step 10 — e.g. Google Postmaster Tools, email-provider dashboard / API. Fallback: headers of one sent message; rates `Not Checked`.
96
+
97
+ ### 🔒 Gate 1: Prerequisites Check
98
+
99
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
100
+
101
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
102
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
103
+
104
+ ### Probe Steps
105
+
106
+ - [ ] **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.
107
+ - [ ] **Step 2 — Variables:** Every variable declared (env schema / loader, if any) or read in code (e.g. `process.env.X`, `os.environ[...]`) → where set: example env files, each hosting environment (e.g. development / preview / production), CI secrets and variables, secret manager, mobile build service (where used). One matrix, names only. Missing from an environment that runs code reading it = finding unless a doc says why. Set where nothing declares it → `bkit-audit-dead-code`. **Done when:** `Variables` matrix: variable × environment, names only.
108
+ - [ ] **Step 3 — Variable Handling:** Per matrix variable: (a) build-time public prefix (e.g. `NEXT_PUBLIC_*`, `EXPO_PUBLIC_*`, `VITE_*`) inlined into shipped bundle → never a secret; change needs rebuild, not env change. Search preview build's client bundle for server-only names and secret-key prefixes (e.g. `sk_live_`); presence only. (b) Secret held as host's secret type (unreadable back from dashboard / CLI). Preview holding production secret (e.g. DB service-role key, live payments key) = finding. (c) Missing / malformed value rejected at startup (e.g. env schema loader) in every environment, not first use; silent default differing between environments = finding. (d) Feature flags: owner, date added, value per environment; preview ≠ production with no doc saying why = drift; same everywhere → `bkit-audit-dead-code`. (e) Value parity: secret held in ≥2 stores for one environment (env file, hosting, CI, secret manager, mobile build service, function secrets) → same value everywhere; name present everywhere proves nothing (rotated in one store, stale in the rest). Compare SHA-256 fingerprints, never values: readable store → hash live value in-process; write-only store (e.g. GitHub Actions secrets) → fingerprint at last recorded push vs source, and `updated_at` vs that push (later = changed outside the sync). Store holding a name the deployed code no longer reads (renamed, stale) = finding. Unprovable → `Not Checked`, never pass. (f) Source: every secret has one declared source every store is compared against (e.g. sync config with one row per secret naming every store); copy no API reaches (pasted into a provider dashboard, e.g. webhook signing secret) → listed in a copy inventory with how to update it. No declared source, or unlisted hand-set copy = finding; no sync tooling → `Process Improvements` proposes one (e.g. bkit package template `.bkit/templates/scripts/secrets/`). Push path bypassing the sync → `bkit-audit-security`. **Done when:** every matrix variable answers (a)–(f) in `Variables`.
109
+ - [ ] **Step 4 — Platform Settings:** Per platform in use (e.g. hosting: Vercel, Netlify; DB / auth: Supabase, RDS, Auth0; mobile build: EAS), only settings the platform has; none → `N/A`. Dashboard vs repo / docs — hosting: build command, function regions / durations, deployment protection, deployment checks; DB + auth: config file (if any) vs each hosted project (e.g. auth settings, redirect URLs, email templates, rate limits, extensions, scheduled DB jobs vs docs); background jobs: registered per environment vs code registry; webhooks (payments, email): endpoints, subscribed events, inbound routes vs docs; error tracker: alert rules, monitors vs docs; mobile: build profiles / environments vs build config. Auth (config file, dev, production), where offered: site URL, redirect allow-list (no wildcard preview URLs in production), token / OTP expiry, leaked-password protection, SMTP sender, auth rate limits. Mobile config vs builds: runtime version, OTA-update channel per branch (if OTA updates ship, e.g. EAS Update), bundle ids — mismatch breaks OTA silently. Classify: in code / documented / recorded nowhere; recorded nowhere = finding even when value is right (next environment will not get it). **Done when:** `Platform Settings` row per setting: platform · environment · where recorded · verdict.
110
+ - [ ] **Step 5 — Runtimes and Crons:** Runtime version (e.g. `.nvmrc`, `engines`, `.python-version`) vs hosting, CI, mobile build images; DB major version (e.g. platform config file) vs each hosted environment; platform CLI version pinned. Every scheduled job wherever defined (hosting crons, job-runner cron triggers, DB scheduler, scheduled CI workflows) → timezone each runs in; job defined in two places runs twice = finding. **Done when:** `Platform Settings` holds row per runtime and per schedule.
111
+ - [ ] **Step 6 — Dashboard Changes:** Today's diff misses a setting changed and changed back → read each platform audit log since previous report; list each settings change: who, what, recorded in repo / doc? Snapshot dashboard config as secret-free JSON (e.g. hosting project API; DB management API: auth config, network restrictions, SSL enforcement, pooler; source-host API: rulesets); confirm no secret value; diff vs previous report's `Snapshot`, or committed project copy if any. No previous → baseline. **Done when:** `Dashboard Changes` lists every settings change; `Snapshot` holds JSON and diff, or marked baseline.
112
+ - [ ] **Step 7 — Repository:** Rulesets / branch protection on default + release branches; required status checks vs today's CI job names — renamed job = trap (waits on check that never reports, or merges without it once old name removed); merge methods; delete-branch-on-merge; default CI token permissions; CI secrets / variables vs docs. Ruleset detail: bypass actors + mode (e.g. GitHub `pull_request` narrower than `always`; `exempt` skips rules and leaves no bypass entry in audit log); stale reviews dismissed on push; code-owner review enforced; tag ruleset for release tags; protection rules per deployment environment holding secrets. Security: secret scanning + push protection, dependency alerts + security updates, code scanning, SHA-pinned-actions policy, approval before fork PR workflows run. Settings only; workflow contents → `bkit-audit-security`. **Done when:** `Repository` row per setting: expected · actual · verdict.
113
+ - [ ] **Step 8 — DNS:** Every domain and subdomain: registrar, renewal date, auto-renew, each record vs where its provider says it should point (e.g. hosting, email). Record for service no longer used = finding (dangling subdomain → takeover). Mail-authentication policy → `bkit-audit-security`; here drift and expiry only. CAA present → authorises every CA the hosts issue from (e.g. `letsencrypt.org`), else renewal fails silently; shrinking certificate lifetimes bite sooner. Registrar hardening: transfer lock (`clientTransferProhibited`), account MFA, registrant email deliverable and off-domain, DNSSEC on or off with written reason. Inbound mail: MX → intended provider; MTA-STS and TLS reporting set (testing mode, then enforce); DMARC `rua` mailbox exists and is read. **Done when:** `DNS` row per domain and record with verdict.
114
+ - [ ] **Step 9 — Links:** Native app with deep / invite links → web serves `/.well-known/apple-app-site-association` and `/.well-known/assetlinks.json`; each valid and names bundle id and signing identity of current build (`Platform Settings`). Open invite link on device with app (opens app) and without (reaches working web page). Broken file breaks every link silently. **Done when:** `Links` row per file and device case.
115
+ - [ ] **Step 10 — Deliverability:** Sends email → sending domains vs mailbox-provider sender requirements; record page thresholds. Spam rate (e.g. Google Postmaster Tools) vs bulk-sender limit. One-click unsubscribe (RFC 8058 `List-Unsubscribe-Post` header + visible link) on every non-transactional message; transactional (sign-in links, receipts) exempt. Bounces, complaints, unsubscribes suppressed; nothing re-adds them. Transactional separate from marketing (subdomain / stream) so marketing complaint cannot sink sign-in mail. **Done when:** `Deliverability` row per requirement: threshold · measurement · verdict.
116
+ - [ ] **Step 11 — Expiry:** Every credential / account with a date: domains, non-auto-renewing certificates, OAuth client secrets, expiring API keys, source-host tokens, build-service tokens, annual paid plans. Store signing credentials and developer memberships → listed by reference to `bkit-audit-app-store`. Per row: date, owner, what breaks. Due ≤60 days = finding; unknown date = finding. Each non-auto-renewing certificate: issuer and days left measured live (e.g. `openssl s_client`, TLS checker), not read from dashboard; cover custom DB domains, inbound mail hosts, API hosts off main host. Hand-renewed certificate = finding whatever its date; propose automation. **Done when:** `Expiry Calendar` sorted by date, every row with a date or an unknown-date finding.
117
+ - [ ] **Step 12 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per Twelve-Factor III and X requirement, CI secure-use recommendation, and platform checklist item → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
118
+ - [ ] **Step 13 — Anything Else:** (a) Everything changed since previous report's commit touching config (declared variables and example env files, hosting / DB / mobile config files, workflows, and rulesets, scheduled jobs, DNS records, every `Dashboard Changes` entry) → one-line verdict each; dashboard setting changed that no step lists = finding, propose adding it to `Platform Settings`. (b) Bounded ~30 min pass: what a senior platform engineer flags that no step asks; read what happened since previous run (incidents, `bkit-audit-logs` reports, new `docs/failures.jsonl` rows, vendor status incidents) — 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`.
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 secrets:** no secret value anywhere in the report, incl. `Snapshot`; fingerprints truncated SHA-256 only.
127
+ - [ ] **Remote untouched:** no dashboard setting, secret, or DNS record changed.
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` | Secret in a public build-time variable or client bundle; production secret reachable from preview; dangling record on a live domain; expired domain / certificate / credential still in use |
136
+ | `HIGH` | Required check that no longer reports; anything expiring ≤30 days; variable missing from an environment that runs code reading it; secret value differing between stores of one environment, or code reading a name no store holds; wildcard redirect in production auth; job scheduled in two places; bypass wider than needed or repository security setting off; CAA blocking the issuing CA; broken `.well-known` file or invite link |
137
+ | `MEDIUM` | Setting recorded nowhere; secret with no declared source; hand-set secret copy missing from the inventory; silent default differing between environments; flag drift with no doc; expiry 31–60 days or unknown; hand-renewed certificate; secret not held as secret type; runtime version drift; registrar hardening gap; deliverability rule not met |
138
+ | `LOW` | Doc describing a setting wrongly while the value is right; naming drift changing no behaviour |
139
+
140
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: secrets / production first.
141
+
142
+ <!-- prettier-ignore -->
143
+ | ID | Severity | Location | Evidence | Expected |
144
+ | --- | --- | --- | --- | --- |
145
+ | 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
+ ### Variables
160
+
161
+ PENDING
162
+
163
+ ### Platform Settings
164
+
165
+ PENDING
166
+
167
+ ### Dashboard Changes
168
+
169
+ PENDING
170
+
171
+ ### Snapshot
172
+
173
+ PENDING
174
+
175
+ ### Repository
176
+
177
+ PENDING
178
+
179
+ ### DNS
180
+
181
+ PENDING
182
+
183
+ ### Links
184
+
185
+ PENDING
186
+
187
+ ### Deliverability
188
+
189
+ PENDING
190
+
191
+ ### Expiry Calendar
192
+
193
+ PENDING
194
+
195
+ ### Checked
196
+
197
+ PENDING
198
+
199
+ ### Not Checked
200
+
201
+ PENDING
202
+
203
+ ### Standards Coverage
204
+
205
+ PENDING
206
+
207
+ ### Beyond the Steps
208
+
209
+ PENDING
210
+
211
+ ### Process Improvements
212
+
213
+ PENDING
214
+
215
+ ### 🔒 Gate 3: Report Check
216
+
217
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
218
+
219
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
220
+ - [ ] **Summary:** names count per severity, environments, and dashboards read.
221
+ - [ ] **Series:** `Snapshot` diffed against previous report's, or marked baseline.
222
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
223
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
224
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
225
+
226
+ > `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.
227
+
228
+ <!-- bkit:end -->
229
+
230
+ ## Project Instructions