@cbartens/bkit 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/.bkit/README.md +154 -151
  2. package/.bkit/core/.agents/context.md +95 -29
  3. package/.bkit/core/.agents/docs.md +17 -15
  4. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +1 -0
  5. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +6 -5
  6. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-readguard.cjs +1 -0
  7. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-rules.cjs +65 -0
  8. package/.bkit/core/.agents/rules.md +108 -107
  9. package/.bkit/core/.agents/skills.md +63 -15
  10. package/.bkit/core/.bkit/README.md +154 -151
  11. package/.bkit/core/.bkit/authoring.md +714 -84
  12. package/.bkit/core/.bkit/cli.md +407 -0
  13. package/.bkit/core/.bkit/cloud.md +281 -193
  14. package/.bkit/core/.bkit/comparison.md +43 -41
  15. package/.bkit/core/.bkit/install.md +154 -84
  16. package/.bkit/core/.bkit/jsonl.md +193 -130
  17. package/.bkit/core/.bkit/pipeline.md +114 -114
  18. package/.bkit/core/.bkit/prompts.md +272 -165
  19. package/.bkit/core/.bkit/providers.md +457 -271
  20. package/.bkit/core/.bkit/router.md +69 -0
  21. package/.bkit/core/.bkit/templates.md +529 -256
  22. package/.bkit/core/.bkit/trackers.md +80 -52
  23. package/.bkit/core/.bkit/workflows.md +589 -504
  24. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +2 -2
  25. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +3 -3
  26. package/.bkit/core/.claude/hooks/bkit-preflight.sh +45 -14
  27. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +3 -3
  28. package/.bkit/core/.codex/hooks/bkit-rules.cjs +57 -0
  29. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +7 -7
  30. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +47 -12
  31. package/.bkit/core/.opencode/plugin/bkit-rules.js +89 -0
  32. package/.bkit/core/AGENTS.md +5 -73
  33. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +127 -105
  34. package/.bkit/core/docs/templates/bkit-audit-adoption.md +104 -70
  35. package/.bkit/core/docs/templates/bkit-audit-agents.md +94 -72
  36. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +99 -78
  37. package/.bkit/core/docs/templates/bkit-audit-analytics.md +140 -82
  38. package/.bkit/core/docs/templates/bkit-audit-annotations.md +98 -72
  39. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +121 -96
  40. package/.bkit/core/docs/templates/bkit-audit-app-store.md +157 -76
  41. package/.bkit/core/docs/templates/bkit-audit-architecture.md +113 -71
  42. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +75 -72
  43. package/.bkit/core/docs/templates/bkit-audit-config.md +122 -76
  44. package/.bkit/core/docs/templates/bkit-audit-cost.md +85 -74
  45. package/.bkit/core/docs/templates/bkit-audit-coverage.md +75 -68
  46. package/.bkit/core/docs/templates/bkit-audit-database.md +101 -70
  47. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +164 -83
  48. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +115 -86
  49. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +264 -88
  50. package/.bkit/core/docs/templates/bkit-audit-documentation.md +118 -93
  51. package/.bkit/core/docs/templates/bkit-audit-duplication.md +139 -86
  52. package/.bkit/core/docs/templates/bkit-audit-failures.md +110 -81
  53. package/.bkit/core/docs/templates/bkit-audit-flakes.md +99 -74
  54. package/.bkit/core/docs/templates/bkit-audit-gates.md +105 -77
  55. package/.bkit/core/docs/templates/bkit-audit-issues.md +104 -80
  56. package/.bkit/core/docs/templates/bkit-audit-llm.md +131 -58
  57. package/.bkit/core/docs/templates/bkit-audit-logs.md +123 -100
  58. package/.bkit/core/docs/templates/bkit-audit-models.md +98 -53
  59. package/.bkit/core/docs/templates/bkit-audit-privacy.md +56 -52
  60. package/.bkit/core/docs/templates/bkit-audit-prompts.md +63 -54
  61. package/.bkit/core/docs/templates/bkit-audit-red-team.md +124 -68
  62. package/.bkit/core/docs/templates/bkit-audit-reliability.md +95 -70
  63. package/.bkit/core/docs/templates/bkit-audit-repo.md +169 -73
  64. package/.bkit/core/docs/templates/bkit-audit-security.md +206 -96
  65. package/.bkit/core/docs/templates/bkit-audit-slop.md +77 -70
  66. package/.bkit/core/docs/templates/bkit-audit-testing.md +162 -114
  67. package/.bkit/core/docs/templates/bkit-audit-usability.md +113 -71
  68. package/.bkit/core/docs/templates/bkit-plan.md +138 -132
  69. package/.bkit/core/engine/checks/after/auth.ts +40 -37
  70. package/.bkit/core/engine/checks/after/ci-yml.ts +65 -2
  71. package/.bkit/core/engine/checks/after/index.ts +12 -2
  72. package/.bkit/core/engine/checks/after/tools.ts +80 -33
  73. package/.bkit/core/engine/checks/before/context-fetch.ts +227 -33
  74. package/.bkit/core/engine/checks/before/env.ts +1 -1
  75. package/.bkit/core/engine/checks/before/index.ts +7 -0
  76. package/.bkit/core/engine/checks/before/repo.ts +40 -0
  77. package/.bkit/core/engine/checks/status-holes.ts +916 -123
  78. package/.bkit/core/engine/checks/tips/catalogue.ts +68 -17
  79. package/.bkit/core/engine/checks/tips/detect.ts +32 -0
  80. package/.bkit/core/engine/checks/tips/index.ts +47 -6
  81. package/.bkit/core/engine/cli.ts +238 -84
  82. package/.bkit/core/engine/commands/analysis.ts +128 -76
  83. package/.bkit/core/engine/commands/ci/ci.ts +363 -29
  84. package/.bkit/core/engine/commands/ci/pins.ts +172 -0
  85. package/.bkit/core/engine/commands/ci/push-gate.ts +223 -0
  86. package/.bkit/core/engine/commands/install/uninstall.ts +21 -27
  87. package/.bkit/core/engine/commands/install/upgrade.ts +32 -15
  88. package/.bkit/core/engine/commands/land.ts +126 -11
  89. package/.bkit/core/engine/commands/lib.ts +303 -6
  90. package/.bkit/core/engine/commands/registry.ts +6 -2
  91. package/.bkit/core/engine/commands/setup/setup.ts +1 -0
  92. package/.bkit/core/engine/commands/stats.ts +91 -35
  93. package/.bkit/core/engine/commands/workflow/branches.ts +1477 -117
  94. package/.bkit/core/engine/commands/workflow/challenge.ts +114 -39
  95. package/.bkit/core/engine/commands/workflow/completeness.ts +109 -0
  96. package/.bkit/core/engine/commands/workflow/context.ts +433 -55
  97. package/.bkit/core/engine/commands/workflow/counters.ts +244 -39
  98. package/.bkit/core/engine/commands/workflow/decisions.ts +61 -17
  99. package/.bkit/core/engine/commands/workflow/disk.ts +237 -55
  100. package/.bkit/core/engine/commands/workflow/fids.ts +19 -1
  101. package/.bkit/core/engine/commands/workflow/issues.ts +6 -0
  102. package/.bkit/core/engine/commands/workflow/ledgers.ts +458 -18
  103. package/.bkit/core/engine/commands/workflow/locks.ts +2 -0
  104. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +124 -15
  105. package/.bkit/core/engine/commands/workflow/plans.ts +257 -0
  106. package/.bkit/core/engine/commands/workflow/prs.ts +12 -3
  107. package/.bkit/core/engine/commands/workflow/repo.ts +8 -0
  108. package/.bkit/core/engine/commands/workflow/roadmap.ts +56 -15
  109. package/.bkit/core/engine/commands/workflow/run-facts.ts +22 -31
  110. package/.bkit/core/engine/commands/workflow/runs.ts +652 -34
  111. package/.bkit/core/engine/commands/workflow/runtime.ts +3 -0
  112. package/.bkit/core/engine/commands/workflow/skills.ts +1 -0
  113. package/.bkit/core/engine/commands/workflow/status.ts +200 -17
  114. package/.bkit/core/engine/commands/workflow/step-table.ts +75 -33
  115. package/.bkit/core/engine/commands/workflow/steps.ts +635 -24
  116. package/.bkit/core/engine/commands/workflow/summary-findings.ts +177 -0
  117. package/.bkit/core/engine/commands/workflow/summary.ts +192 -46
  118. package/.bkit/core/engine/commands/workflow/tasks.ts +409 -0
  119. package/.bkit/core/engine/commands/workflow/test-blocks.ts +254 -0
  120. package/.bkit/core/engine/commands/workflow/tests-changed.ts +201 -0
  121. package/.bkit/core/engine/commands/workflow/tests.ts +1285 -356
  122. package/.bkit/core/engine/commands/workflow/workflows.ts +228 -43
  123. package/.bkit/core/engine/commands/workflow/worktrees.ts +389 -47
  124. package/.bkit/core/engine/install/cloud-env.ts +251 -121
  125. package/.bkit/core/engine/install/context-ci-workflow.ts +102 -0
  126. package/.bkit/core/engine/install/manifest.ts +60 -12
  127. package/.bkit/core/engine/install/modules/antigravity.ts +3 -2
  128. package/.bkit/core/engine/install/modules/cloud.ts +3 -3
  129. package/.bkit/core/engine/install/modules/codex.ts +15 -2
  130. package/.bkit/core/engine/install/modules/core.ts +956 -52
  131. package/.bkit/core/engine/install/modules/cursor.ts +6 -6
  132. package/.bkit/core/engine/install/modules/opencode.ts +16 -4
  133. package/.bkit/core/engine/install/template-notes.ts +130 -0
  134. package/.bkit/core/engine/install/version-file.ts +3 -2
  135. package/.bkit/core/engine/install/write.ts +5 -0
  136. package/.bkit/core/engine/ledgers/compact.ts +124 -0
  137. package/.bkit/core/engine/ledgers/journal.ts +291 -0
  138. package/.bkit/core/engine/ledgers/status.ts +160 -9
  139. package/.bkit/core/engine/ledgers/telemetry.ts +158 -21
  140. package/.bkit/core/engine/render/hosts.ts +114 -14
  141. package/.bkit/core/engine/shared/bkit-latest.ts +26 -4
  142. package/.bkit/core/engine/shared/dep-updater.ts +60 -0
  143. package/.bkit/core/engine/shared/egress.ts +1 -1
  144. package/.bkit/core/engine/shared/package-manager.ts +9 -0
  145. package/.bkit/core/engine/shared/settings.ts +92 -17
  146. package/.bkit/core/engine/shared/timeouts.ts +2 -0
  147. package/.bkit/core/engine/tools/cli-doc.ts +111 -0
  148. package/.bkit/core/engine/tools/grammar-density.ts +1 -1
  149. package/.bkit/core/engine/tools/instructions-sources.ts +15 -17
  150. package/.bkit/core/engine/tools/instructions.ts +94 -43
  151. package/.bkit/core/hooks/antigravity-hook.js +25 -10
  152. package/.bkit/core/hooks/gateguard-engine.js +53 -29
  153. package/.bkit/core/hooks/guardrails-shell.js +4 -4
  154. package/.bkit/core/hooks/guardrails-tiers.js +3 -3
  155. package/.bkit/core/hooks/preflight-linear.sh +9 -9
  156. package/.bkit/core/hooks/preflight-rules.sh +8 -0
  157. package/.bkit/core/hooks/readguard-engine.js +29 -10
  158. package/.bkit/core/hooks/session-rules-advisory.js +61 -0
  159. package/.bkit/core/prompts/bkit-audit-generate.md +187 -116
  160. package/.bkit/core/prompts/bkit-build-challenge-1.md +56 -37
  161. package/.bkit/core/prompts/bkit-build-challenge-2.md +65 -45
  162. package/.bkit/core/prompts/bkit-build-install-skills.md +38 -29
  163. package/.bkit/core/prompts/bkit-build-plan-convert.md +43 -32
  164. package/.bkit/core/prompts/bkit-build-plan-current.md +49 -39
  165. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +79 -55
  166. package/.bkit/core/prompts/bkit-build-plan-tasks.md +149 -0
  167. package/.bkit/core/prompts/bkit-build-plan-tests.md +120 -0
  168. package/.bkit/core/prompts/bkit-build-plan-verify.md +87 -50
  169. package/.bkit/core/prompts/bkit-debug-abort-handover.md +36 -35
  170. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +96 -64
  171. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +54 -45
  172. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +42 -33
  173. package/.bkit/core/prompts/bkit-debug-failure-soak.md +53 -37
  174. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +35 -30
  175. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +34 -29
  176. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +32 -28
  177. package/.bkit/core/prompts/bkit-design-generate.md +68 -52
  178. package/.bkit/core/prompts/bkit-design-organise.md +73 -35
  179. package/.bkit/core/prompts/bkit-design-review-1.md +58 -54
  180. package/.bkit/core/prompts/bkit-design-review-2.md +54 -50
  181. package/.bkit/core/prompts/bkit-design-spike.md +54 -47
  182. package/.bkit/core/prompts/bkit-design-update.md +42 -31
  183. package/.bkit/core/prompts/bkit-plan-generate.md +76 -58
  184. package/.bkit/core/prompts/bkit-plan-review-1.md +63 -49
  185. package/.bkit/core/prompts/bkit-plan-review-2.md +60 -48
  186. package/.bkit/core/prompts/bkit-plan-scope-check.md +53 -46
  187. package/.bkit/core/prompts/bkit-plan-update.md +70 -52
  188. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +82 -50
  189. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +80 -45
  190. package/.bkit/core/prompts/bkit-ship-update-docs.md +35 -29
  191. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +55 -49
  192. package/.bkit/core/prompts/bkit-utility-update-decisions.md +76 -49
  193. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +70 -41
  194. package/.bkit/core/prompts/bkit-utility-update-documentation.md +33 -30
  195. package/.bkit/core/prompts/bkit-utility-update-failures.md +73 -43
  196. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +77 -50
  197. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +77 -45
  198. package/.bkit/core/prompts/bkit-utility-update-tracker.md +144 -68
  199. package/.bkit/core/workflows/bkit-auto.md +53 -30
  200. package/.bkit/core/workflows/bkit-build.md +635 -304
  201. package/.bkit/core/workflows/bkit-debug.md +301 -148
  202. package/.bkit/core/workflows/bkit-design.md +167 -95
  203. package/.bkit/core/workflows/bkit-plan.md +172 -84
  204. package/.bkit/core/workflows/bkit-ship.md +299 -152
  205. package/.bkit/shared/.agents/plugins/bkit/hooks.json +10 -0
  206. package/.bkit/shared/.claude/bkit-cloud.md +12 -10
  207. package/.bkit/shared/.claude/settings.json +3 -0
  208. package/.bkit/shared/.codex/bkit-cloud.md +98 -0
  209. package/.bkit/shared/.codex/hooks.json +20 -0
  210. package/.bkit/shared/.cursor/bkit-cloud.md +3 -3
  211. package/.bkit/shared/.opencode/opencode.json +1 -1
  212. package/.bkit/shared/CLAUDE.md +5 -1
  213. package/.bkit/shared/GEMINI.md +4 -1
  214. package/.bkit/shared/docs/architecture.md +4 -7
  215. package/.bkit/shared/docs/data-schema.md +4 -7
  216. package/.bkit/shared/docs/deployments.md +239 -166
  217. package/.bkit/shared/docs/design.md +11 -12
  218. package/.bkit/shared/docs/noise.md +8 -7
  219. package/.bkit/shared/docs/observability.md +5 -8
  220. package/.bkit/shared/docs/security.md +35 -17
  221. package/.bkit/shared/docs/setup.md +29 -18
  222. package/.bkit/shared/docs/technology.md +3 -6
  223. package/.bkit/shared/docs/testing.md +282 -176
  224. package/.bkit/shared/gitignore +6 -2
  225. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +15 -16
  226. package/.bkit/templates/.cursor/Dockerfile +12 -8
  227. package/.bkit/templates/.cursor/environment.json +1 -1
  228. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +10 -8
  229. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +24 -12
  230. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +3 -3
  231. package/.bkit/templates/.github/renovate.json5 +34 -6
  232. package/.bkit/templates/.github/workflows/bkit-ci.yml +53 -50
  233. package/.bkit/templates/.github/workflows/bkit-cloud.yml +13 -14
  234. package/.bkit/templates/.github/workflows/bkit-health.yml +97 -0
  235. package/.bkit/templates/.github/workflows/bkit-renovate.yml +5 -4
  236. package/.bkit/templates/.github/workflows/bkit-trivy.yml +5 -4
  237. package/.bkit/templates/.husky/pre-commit +2 -2
  238. package/.bkit/templates/.husky/pre-push +95 -35
  239. package/.bkit/templates/.prettierignore +6 -7
  240. package/.bkit/templates/.vale.ini +27 -27
  241. package/.bkit/templates/context/bkit-cloudrun.md +23 -15
  242. package/.bkit/templates/context/bkit-expo.md +70 -52
  243. package/.bkit/templates/context/bkit-github.md +93 -56
  244. package/.bkit/templates/context/bkit-inngest.md +21 -15
  245. package/.bkit/templates/context/bkit-maestro.md +22 -16
  246. package/.bkit/templates/context/bkit-playwright.md +23 -17
  247. package/.bkit/templates/context/bkit-resend.md +12 -10
  248. package/.bkit/templates/context/bkit-sentry.md +30 -20
  249. package/.bkit/templates/context/bkit-serena.md +8 -7
  250. package/.bkit/templates/context/bkit-stripe.md +14 -13
  251. package/.bkit/templates/context/bkit-supabase.md +16 -13
  252. package/.bkit/templates/context/bkit-tavily.md +14 -11
  253. package/.bkit/templates/context/bkit-vercel.md +27 -18
  254. package/.bkit/templates/docs/capabilities.md +15 -14
  255. package/.bkit/templates/scripts/ci/{check-accepted-divergences.mjs → bkit-check-accepted-divergences.mjs} +6 -3
  256. package/.bkit/templates/scripts/ci/{check-accepted-divergences.test.mjs → bkit-check-accepted-divergences.test.mjs} +3 -3
  257. package/.bkit/templates/scripts/ci/{check-capstone.mjs → bkit-check-capstone.mjs} +2 -2
  258. package/.bkit/templates/scripts/ci/{check-capstone.test.mjs → bkit-check-capstone.test.mjs} +4 -4
  259. package/.bkit/templates/scripts/ci/{check-dependency-audit.mjs → bkit-check-dependency-audit.mjs} +103 -18
  260. package/.bkit/templates/scripts/ci/{check-dependency-audit.test.mjs → bkit-check-dependency-audit.test.mjs} +31 -3
  261. package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +387 -0
  262. package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +75 -0
  263. package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +160 -0
  264. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.mjs → bkit-resolve-push-base.mjs} +3 -3
  265. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.test.mjs → bkit-resolve-push-base.test.mjs} +4 -4
  266. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +9 -1
  267. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +1 -1
  268. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +3 -3
  269. package/.bkit/templates/scripts/graphify/bkit-graph-embed.py +63 -0
  270. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +2 -2
  271. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +69 -18
  272. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -3
  273. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +1 -1
  274. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
  275. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +197 -126
  276. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +64 -41
  277. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +23 -7
  278. package/.bkit/templates/slop-scan.config.json +9 -2
  279. package/CHANGELOG.md +119 -0
  280. package/README.md +250 -76
  281. package/dist/checks/after/auth.js +36 -33
  282. package/dist/checks/after/ci-yml.js +52 -2
  283. package/dist/checks/after/index.js +12 -4
  284. package/dist/checks/after/tools.js +73 -33
  285. package/dist/checks/before/context-fetch.js +218 -33
  286. package/dist/checks/before/env.js +1 -1
  287. package/dist/checks/before/index.js +6 -2
  288. package/dist/checks/before/repo.js +35 -1
  289. package/dist/checks/status-holes.js +739 -114
  290. package/dist/checks/tips/catalogue.js +59 -17
  291. package/dist/checks/tips/detect.js +30 -0
  292. package/dist/checks/tips/index.js +48 -6
  293. package/dist/cli.js +222 -84
  294. package/dist/commands/analysis.js +77 -53
  295. package/dist/commands/ci/ci.js +302 -25
  296. package/dist/commands/ci/pins.js +142 -0
  297. package/dist/commands/ci/push-gate.js +194 -0
  298. package/dist/commands/install/uninstall.js +23 -27
  299. package/dist/commands/install/upgrade.js +21 -11
  300. package/dist/commands/land.js +126 -10
  301. package/dist/commands/lib.js +244 -5
  302. package/dist/commands/registry.js +6 -2
  303. package/dist/commands/setup/setup.js +1 -0
  304. package/dist/commands/stats.js +69 -30
  305. package/dist/commands/workflow/branches.js +1232 -111
  306. package/dist/commands/workflow/challenge.js +90 -37
  307. package/dist/commands/workflow/completeness.js +97 -0
  308. package/dist/commands/workflow/context.js +371 -51
  309. package/dist/commands/workflow/counters.js +206 -40
  310. package/dist/commands/workflow/decisions.js +60 -17
  311. package/dist/commands/workflow/disk.js +213 -55
  312. package/dist/commands/workflow/fids.js +18 -1
  313. package/dist/commands/workflow/issues.js +6 -0
  314. package/dist/commands/workflow/ledgers.js +372 -21
  315. package/dist/commands/workflow/locks.js +2 -0
  316. package/dist/commands/workflow/plan-blocks.js +78 -14
  317. package/dist/commands/workflow/plans.js +205 -0
  318. package/dist/commands/workflow/prs.js +12 -3
  319. package/dist/commands/workflow/repo.js +6 -0
  320. package/dist/commands/workflow/roadmap.js +50 -17
  321. package/dist/commands/workflow/run-facts.js +23 -28
  322. package/dist/commands/workflow/runs.js +530 -33
  323. package/dist/commands/workflow/runtime.js +3 -0
  324. package/dist/commands/workflow/skills.js +1 -0
  325. package/dist/commands/workflow/status.js +166 -19
  326. package/dist/commands/workflow/step-table.js +61 -29
  327. package/dist/commands/workflow/steps.js +542 -26
  328. package/dist/commands/workflow/summary-findings.js +117 -0
  329. package/dist/commands/workflow/summary.js +154 -41
  330. package/dist/commands/workflow/tasks.js +378 -0
  331. package/dist/commands/workflow/test-blocks.js +231 -0
  332. package/dist/commands/workflow/tests-changed.js +172 -0
  333. package/dist/commands/workflow/tests.js +1013 -321
  334. package/dist/commands/workflow/workflows.js +191 -38
  335. package/dist/commands/workflow/worktrees.js +310 -42
  336. package/dist/install/cloud-env.js +233 -99
  337. package/dist/install/context-ci-workflow.js +85 -0
  338. package/dist/install/manifest.js +57 -12
  339. package/dist/install/modules/antigravity.js +3 -2
  340. package/dist/install/modules/cloud.js +3 -3
  341. package/dist/install/modules/codex.js +12 -2
  342. package/dist/install/modules/core.js +851 -53
  343. package/dist/install/modules/cursor.js +6 -6
  344. package/dist/install/modules/opencode.js +11 -5
  345. package/dist/install/template-notes.js +116 -0
  346. package/dist/install/version-file.js +3 -2
  347. package/dist/ledgers/compact.js +87 -0
  348. package/dist/ledgers/journal.js +233 -0
  349. package/dist/ledgers/status.js +115 -5
  350. package/dist/ledgers/telemetry.js +121 -17
  351. package/dist/render/hosts.js +100 -14
  352. package/dist/shared/bkit-latest.js +26 -4
  353. package/dist/shared/dep-updater.js +49 -0
  354. package/dist/shared/egress.js +1 -1
  355. package/dist/shared/package-manager.js +6 -0
  356. package/dist/shared/settings.js +59 -10
  357. package/dist/shared/timeouts.js +2 -0
  358. package/dist/tools/cli-doc.js +97 -0
  359. package/dist/tools/grammar-density.js +1 -1
  360. package/dist/tools/instructions-sources.js +15 -16
  361. package/dist/tools/instructions.js +83 -39
  362. package/package.json +58 -42
  363. package/.bkit/core/.bkit/lite.md +0 -73
  364. package/.bkit/core/engine/commands/workflow/workstreams.ts +0 -172
  365. package/.bkit/core/prompts/bkit-build-plan-execute.md +0 -124
  366. package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +0 -194
  367. package/dist/commands/workflow/workstreams.js +0 -149
  368. /package/.bkit/templates/.vale/styles/{House → Bkit}/Filler.yml +0 -0
  369. /package/.bkit/templates/.vale/styles/{House → Bkit}/Hedging.yml +0 -0
  370. /package/.bkit/templates/.vale/styles/{House → Bkit}/LLMSlop.yml +0 -0
  371. /package/.bkit/templates/.vale/styles/{House → Bkit}/Verbose.yml +0 -0
  372. /package/.bkit/templates/scripts/ci/{accepted-advisories.json → bkit-accepted-advisories.json} +0 -0
  373. /package/.bkit/templates/scripts/ci/{accepted-divergences.json → bkit-accepted-divergences.json} +0 -0
  374. /package/.bkit/templates/scripts/launchd/{launchd.env.example → bkit-launchd.env.example} +0 -0
  375. /package/.bkit/templates/scripts/launchd/{ai.bkit.launchd.plist → bkit-launchd.plist} +0 -0
@@ -1,134 +1,176 @@
1
- <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. The report is stamped with a `bkit:anchor` block recording the audited commit (`baseSha`) and branch (`baseRef`); never hand-author or edit it. `@bkit-audit-generate` fills this template. -->
2
-
3
1
  <!-- bkit:start -->
4
2
 
5
3
  {{BKIT_MANAGED_MARKER}}
6
4
 
5
+ <!-- Note: @bkit-audit-generate fills this template. The report lives at `docs/audits/{YYYYMM}/{slug}.md`, where `{YYYYMM}` is the UTC month of the run and `{slug}` is this file's name without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md`, where `{TIMESTAMP}` is the output of `date -u +%Y%m%dT%H%M%SZ`. NEVER overwrite an earlier report. The report is stamped with a `bkit:anchor` block that records the audited commit (`baseSha`) and branch (`baseRef`). NEVER write or edit that block by hand. -->
6
+
7
7
  # Config Audit
8
8
 
9
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.
10
+ > **Purpose:** Whether the settings outside the code agree across environments, dashboards, the repository and the docs: variables, platform and repository settings, DNS, and anything that expires on a date.
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - NEVER print or copy a secret value; names, presence, dates, and truncated SHA-256 fingerprints only.
15
- > - Dashboards, CLIs, and APIs read-only; NEVER change a setting, secret, or DNS record.
16
- > - Every drift claim names the environment and where each side was read.
14
+ > - NEVER print or copy a secret value.
15
+ > - Record a secret by its name, presence, dates and truncated SHA-256 fingerprint only.
16
+ > - Use dashboards, CLIs and APIs read-only.
17
+ > - NEVER change a setting, secret or DNS record.
18
+ > - Name the environment, and where each side was read, in every drift claim.
17
19
 
18
20
  ## Universal Instructions
19
21
 
20
22
  ### Context & Goals
21
23
 
22
- 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).
24
+ Code is reviewed, but dashboards are not. A dashboard change (hosting, database, payments, error tracker) leaves no diff, review or history, so the next environment built from the docs differs. The failure this audit targets is drift that nobody sees until it fails. Examples: a variable in production that is missing in preview, so preview passes on a fallback that production never takes, or the reverse; a required check waiting on a renamed job; or a domain, membership or secret lapsing on a date with no deploy. Each one is a short outage that is cheap to prevent and slow to diagnose, because nothing changed.
23
25
 
24
- **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".
26
+ **Applies when:** the project deploys to >=1 hosted environment, or holds settings outside the repo (variables, dashboards, repository settings, DNS). **If** neither holds → write one `N/A` row with its evidence, and never report the surface as "clean".
25
27
 
26
- **Cadence:** monthly. Extra pass before any release, and after any change made in a dashboard.
28
+ **Cadence:** Run once a month. Run an extra pass before any release, and after any change made in a dashboard.
27
29
 
28
30
  **Anchor Standards:**
29
31
 
30
32
  - The Twelve-Factor App: III. Config and X. Dev/prod parity.
31
- - Source-host CI security and ruleset docs (e.g. GitHub Actions secure-use reference, GitHub rulesets REST API).
32
- - Platform production checklist (e.g. Supabase Production Checklist).
33
- - TLS certificate validity schedule (e.g. CA/Browser Forum Baseline Requirements, Ballot SC-081v3).
33
+ - Source-host CI security and ruleset docs (e.g., GitHub Actions secure-use reference, GitHub rulesets REST API).
34
+ - Platform production checklist (e.g., Supabase Production Checklist).
35
+ - TLS certificate validity schedule (e.g., CA/Browser Forum Baseline Requirements, Ballot SC-081v3).
34
36
  - DNS CAA (RFC 8659); MTA-STS (RFC 8461) and TLS reporting (RFC 8460).
35
- - Mailbox-provider sender requirements (e.g. Gmail, Yahoo) and one-click unsubscribe (RFC 8058).
37
+ - Mailbox-provider sender requirements (e.g., Gmail, Yahoo) and one-click unsubscribe (RFC 8058).
36
38
  - bkit block of `docs/deployments.md` (bkit version from `.bkit/version`): § Autonomous phase-close prerequisites; § Post-merge dev CI auto-routing; § Promotion-lag warning (`Check Default Branch Lags Dev`)
37
39
 
38
40
  ### Scope
39
41
 
40
- - Variables across every environment and secret store.
41
- - Secret values matching across stores; one declared source per secret.
42
- - Platform dashboard settings vs repo and docs.
43
- - Runtime versions; scheduled jobs wherever defined.
44
- - Dashboard change history since previous run; secret-free settings snapshot.
45
- - Repository rulesets, required checks, and security settings.
46
- - DNS, domains, registrar, inbound mail transport.
47
- - Deep / invite links and `.well-known` files.
48
- - Email deliverability.
49
- - Expiry calendar: credentials, certificates, accounts, plans.
42
+ - Check the variables across every environment and secret store.
43
+ - Check that secret values match across stores.
44
+ - Check that each secret has one declared source.
45
+ - Compare the platform dashboard settings with the repo and docs.
46
+ - Check the runtime versions.
47
+ - Check the scheduled jobs, wherever they are defined.
48
+ - Read the dashboard change history since the previous run.
49
+ - Take a secret-free settings snapshot.
50
+ - Check the repository rulesets, required checks and security settings.
51
+ - Check DNS, domains, the registrar and inbound mail transport.
52
+ - Check deep and invite links and the `.well-known` files.
53
+ - Check email deliverability.
54
+ - Build the expiry calendar: credentials, certificates, accounts and plans.
50
55
 
51
56
  ### Out of Scope
52
57
 
53
58
  <!-- prettier-ignore -->
54
59
  | Excluded item | Why | Where it belongs |
55
60
  | --- | --- | --- |
56
- | Config nothing reads; flags set the same everywhere | Dead config | `bkit-audit-dead-code` |
57
- | Secret rotation, mail-authentication policy, who holds keys, workflow contents | Security sweep | `bkit-audit-security` |
58
- | Store signing credentials, developer memberships, store accounts | Store sweep | `bkit-audit-app-store` |
59
- | Rewriting docs that describe a setting wrongly | Docs sweep | `bkit-audit-documentation` |
60
- | Error-stream and platform-log triage | Log sweep | `bkit-audit-logs` |
61
- | Coding-agent settings, permissions, hooks, tool servers | Agent config sweep | `bkit-audit-agents` |
62
- | bkit install state; templates adopted and wired | bkit adoption sweep | `bkit-audit-adoption` |
63
- | Changing settings, secrets, or records | Audit reports only | Plan from this report |
61
+ | Config nothing reads; flags set the same everywhere | It is dead config | `bkit-audit-dead-code` |
62
+ | Secret rotation, mail-authentication policy, who holds keys, workflow contents | The security audit owns them | `bkit-audit-security` |
63
+ | Store signing credentials, developer memberships, store accounts | The app-store audit owns them | `bkit-audit-app-store` |
64
+ | Rewriting docs that describe a setting wrongly | The documentation audit owns it | `bkit-audit-documentation` |
65
+ | Error-stream and platform-log triage | The logs audit owns it | `bkit-audit-logs` |
66
+ | Coding-agent settings, permissions, hooks, tool servers | The agents audit owns agent config | `bkit-audit-agents` |
67
+ | bkit install state; templates adopted and wired | The adoption audit owns it | `bkit-audit-adoption` |
68
+ | Changing settings, secrets, or records | The audit only reports | A plan made from this report |
64
69
 
65
70
  ### Pre-Flight / Dependencies
66
71
 
67
72
  #### Core
68
73
 
69
- - [ ] **Permissions:** blocked calls recorded
70
- - [ ] **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`.
71
- - [ ] **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`.
72
- - [ ] **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`.
73
- - [ ] **Repository API:** Step 7 — rulesets, protection, security settings (e.g. `gh api`, GitLab API). Fallback: none; items `Not Checked`.
74
- - [ ] **DNS and TLS:** Steps 8, 11 — e.g. `dig`, RDAP / `whois`, `openssl s_client`. Fallback: online checker; name it.
75
- - [ ] **Web:** Step 12 — fetch anchor standards. Fallback: versions recorded as unread.
74
+ - [ ] **Permissions:** every blocked call is recorded.
75
+ - [ ] **Variable Listing:** Steps 2, 3 — the 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: use the repo-declared names only, and mark environments `Not Checked`.
76
+ - [ ] **Platform Read:** Steps 4-6 — a read-only dashboard, CLI or management API per platform (e.g., Vercel API, Supabase Management API, Stripe CLI, Sentry API). Fallback: use the repo and docs only, and mark the platform side `Not Checked`.
77
+ - [ ] **Audit Logs:** Step 6 — each platform's settings-change history (e.g., Vercel team activity, the Supabase org audit log, the GitHub org or repo audit log). Fallback: use the snapshot diff only, and mark set-and-reverted changes `Not Checked`.
78
+ - [ ] **Repository API:** Step 7 — rulesets, protection and security settings (e.g., `gh api`, GitLab API). Fallback: none. Mark those items `Not Checked`.
79
+ - [ ] **DNS and TLS:** Steps 8, 11 — DNS, registration and certificate reads (e.g., `dig`, RDAP / `whois`, `openssl s_client`). Fallback: use an online checker, and name it.
80
+ - [ ] **Web:** Step 12 — fetch the anchor standards. Fallback: record the versions as unread.
76
81
 
77
82
  #### Conditional
78
83
 
79
- - [ ] **Built Bundle:** Build-time public variables → Step 3 — preview build's client bundle to search. Fallback: source search only; bundle `Not Checked`.
80
- - [ ] **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`.
81
- - [ ] **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`.
82
- - [ ] **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`.
83
- - [ ] **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`.
84
+ - [ ] **Built Bundle:** **If** the app has build-time public variables → Step 3 — the preview build's client bundle, to search. Fallback: search the source only, and mark the bundle `Not Checked`.
85
+ - [ ] **Secret Fingerprints:** **If** a secret is held in >=2 stores → Step 3 — a read-only value comparison by SHA-256 (e.g., the repo sync tooling's drift mode `node scripts/secrets/bkit-secrets.mjs drift` from the bkit package template `.bkit/templates/scripts/secrets/`, or a hash of the value read in-process). Fallback: compare names and `updated_at` only, and mark values `Not Checked`.
86
+ - [ ] **Registrar Account:** **If** the project owns domains → Steps 8, 11 — renewal, auto-renew, lock, MFA and contact (e.g., the registrar dashboard or API). Fallback: use RDAP for lock and expiry, and mark the rest `Not Checked`.
87
+ - [ ] **Test Devices:** **If** a native app has deep or invite links → Step 9 — a device or emulator with the app, and one without it. Fallback: validate the `.well-known` files only, and mark link opening `Not Checked`.
88
+ - [ ] **Mailbox-Provider Tools:** **If** the app sends email → Step 10 — sender data (e.g., Google Postmaster Tools, the email-provider dashboard or API). Fallback: read the headers of one sent message, and mark rates `Not Checked`.
84
89
 
85
90
  ### 🔒 Gate 1: Prerequisites Check
86
91
 
87
- - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
88
- - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
92
+ - [ ] **Gaps named:** every missing item names its fallback and its `Not Checked` entry.
93
+ - [ ] **Gate 1 — Verified:** every item above, every Core item and every applicable Conditional item is checked.
89
94
 
90
95
  ### Probe Steps
91
96
 
92
- - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
93
- - [ ] **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 x environment, names only.
94
- - [ ] **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`.
95
- - [ ] **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.
96
- - [ ] **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.
97
- - [ ] **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.
98
- - [ ] **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.
99
- - [ ] **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.
100
- - [ ] **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.
101
- - [ ] **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.
102
- - [ ] **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.
103
- - [ ] **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. Per bkit anchor (doc section, rule, or issue shape): one row → followed (name step or evidence) / not applicable (why) / finding; departure with no recorded reason (e.g. `docs/decisions.jsonl` row, accepted-divergence entry) = finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
104
- - [ ] **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`.
97
+ - [ ] **Step 1 — Previous Run:** **Done when:** `Previous Run` holds the closure rate, or the run is marked baseline.
98
+ - [ ] **Step 2 — Variables:** For every variable declared (in the env schema or loader, where one exists) or read in code (e.g., `process.env.X`, `os.environ[...]`), record where it is set: example env files, each hosting environment (e.g., development / preview / production), CI secrets and variables, the secret manager, and the mobile build service, where one is used. Build one matrix, names only. A variable missing from an environment that runs code reading it is a finding, unless a doc says why. A variable set where nothing declares it goes to `bkit-audit-dead-code`. **Done when:** `Variables` holds the matrix of variable x environment, names only.
99
+ - [ ] **Step 3 — Variable Handling:** For each matrix variable, answer (a)-(f).
100
+ - (a) A build-time public prefix (e.g., `NEXT_PUBLIC_*`, `EXPO_PUBLIC_*`, `VITE_*`) is inlined into the shipped bundle, so it must never hold a secret value, and changing it needs a rebuild, not an env change.
101
+ - Search the preview build's client bundle for server-only names and secret-key prefixes (e.g., `sk_live_`), and record presence only.
102
+ - (b) Check that each secret is held as the host's secret type (unreadable back from the dashboard or CLI). A preview environment holding a production secret (e.g., a DB service-role key, a live payments key) is a finding.
103
+ - (c) Check that a missing or malformed value is rejected at startup (e.g., by an env schema loader) in every environment, not at first use. A silent default that differs between environments is a finding.
104
+ - (d) Feature flags: record the owner, the date added and the value per environment.
105
+ - **If** preview != production **and** no doc says why → it is drift.
106
+ - **If** a flag is the same everywhere → it goes to `bkit-audit-dead-code`.
107
+ - (e) Value parity:
108
+ - **If** a secret is held in >=2 stores for one environment (env file, hosting, CI, secret manager, mobile build service, function secrets) → it has the same value everywhere. A name present everywhere proves nothing, because the secret may be rotated in one store and stale in the rest.
109
+ - Compare SHA-256 fingerprints, never values.
110
+ - **If** the store is readable → hash the live value in-process.
111
+ - **If** the store is write-only (e.g., GitHub Actions secrets) → compare the fingerprint at the last recorded push with the source, and compare `updated_at` with that push (a later date means it changed outside the sync).
112
+ - A store holding a name the deployed code no longer reads (renamed, stale) is a finding.
113
+ - **If** parity cannot be proven → mark it `Not Checked`, never pass.
114
+ - (f) Source: every secret has one declared source that every store is compared against (e.g., a sync config with one row per secret naming every store).
115
+ - **If** a copy sits where no API reaches (pasted into a provider dashboard, e.g., a webhook signing secret) → check that it is listed in a copy inventory with how to update it.
116
+ - A secret with no declared source, or a hand-set copy that is not listed, is a finding.
117
+ - **If** there is no sync tooling → `Process Improvements` proposes one (e.g., the bkit package template `.bkit/templates/scripts/secrets/`).
118
+ - A push path that bypasses the sync goes to `bkit-audit-security`.
119
+
120
+ **Done when:** every matrix variable answers (a)-(f) in `Variables`.
121
+
122
+ - [ ] **Step 4 — Platform Settings:** For each platform in use (e.g., hosting: Vercel, Netlify; DB and auth: Supabase, RDS, Auth0; mobile build: EAS), check only the settings that platform has.
123
+ - **If** there are none → `N/A`.
124
+ - Compare the dashboard with the repo and docs:
125
+ - Hosting: the build command, function regions and durations, deployment protection and deployment checks.
126
+ - DB and auth: the config file, where one exists, against each hosted project (e.g., auth settings, redirect URLs, email templates, rate limits, extensions, and scheduled DB jobs against docs).
127
+ - Background jobs: those registered per environment against the code registry.
128
+ - Webhooks (payments, email): endpoints, subscribed events and inbound routes against docs.
129
+ - Error tracker: alert rules and monitors against docs.
130
+ - Mobile: build profiles and environments against the build config.
131
+ - Auth (config file, dev, production), where offered: the site URL, the redirect allow-list (no wildcard preview URLs in production), token and OTP expiry, leaked-password protection, the SMTP sender and auth rate limits.
132
+ - Mobile config against builds: the runtime version, the OTA-update channel per branch where OTA updates ship (e.g., EAS Update), and bundle ids. A mismatch breaks OTA silently.
133
+ - Classify each setting as in code, documented, or recorded nowhere. A setting recorded nowhere is a finding even when its value is right, because the next environment will not get it.
134
+
135
+ **Done when:** `Platform Settings` holds one row per setting, with platform, environment, where recorded and verdict.
136
+
137
+ - [ ] **Step 5 — Runtimes and Crons:** Compare the runtime version (e.g., `.nvmrc`, `engines`, `.python-version`) with the hosting, CI and mobile build images. Compare the DB major version (e.g., in the platform config file) with each hosted environment. Check that the platform CLI version is pinned. For every scheduled job, wherever it is defined (hosting crons, job-runner cron triggers, the DB scheduler, scheduled CI workflows), record the timezone it runs in. A job defined in two places runs twice, which is a finding. **Done when:** `Platform Settings` holds one row per runtime and per schedule.
138
+ - [ ] **Step 6 — Dashboard Changes:** Today's diff misses a setting that was changed and changed back, so read each platform's audit log since the previous report. List each settings change: who made it, what it was, and whether it is recorded in the repo or a doc. Snapshot the dashboard config as secret-free JSON (e.g., the hosting project API; the DB management API: auth config, network restrictions, SSL enforcement, pooler; the source-host API: rulesets). Confirm that the snapshot holds no secret value. Diff it against the previous report's `Snapshot`, or against the committed project copy, where one exists. **If** there is no previous snapshot → the run is the baseline. **Done when:** `Dashboard Changes` lists every settings change, and `Snapshot` holds the JSON and the diff, or is marked baseline.
139
+ - [ ] **Step 7 — Repository:** Check the rulesets or branch protection on the default and release branches. Compare the required status checks with today's CI job names. A renamed job is a trap: the branch waits on a check that never reports, or merges without it once the old name is removed. Check the merge methods, delete-branch-on-merge, the default CI token permissions, and CI secrets and variables against docs. Ruleset detail: bypass actors and mode (e.g., GitHub `pull_request` is narrower than `always`, and `exempt` skips rules and leaves no bypass entry in the audit log); stale reviews dismissed on push; code-owner review enforced; a tag ruleset for release tags; and protection rules for each deployment environment that holds secrets. Security: secret scanning and push protection, dependency alerts and security updates, code scanning, a SHA-pinned-actions policy, and approval before fork PR workflows run. Check settings only. Workflow contents go to `bkit-audit-security`. **Done when:** `Repository` holds one row per setting, with expected, actual and verdict.
140
+ - [ ] **Step 8 — DNS:** For every domain and subdomain, record the registrar, the renewal date and auto-renew, and compare each record with where its provider says it should point (e.g., hosting, email). A record for a service no longer used is a finding, because a dangling subdomain allows takeover. Mail-authentication policy goes to `bkit-audit-security`, so for mail-authentication records check only drift and expiry here. **If** CAA is present → check that it authorises every CA the hosts issue from (e.g., `letsencrypt.org`), because otherwise renewal fails silently. Shrinking certificate lifetimes make this bite sooner. Registrar hardening: the transfer lock (`clientTransferProhibited`), account MFA, a registrant email that is deliverable and off-domain, and DNSSEC on, or off with a written reason. Inbound mail: MX points to the intended provider; MTA-STS and TLS reporting are set (testing mode, then enforce); and the DMARC `rua` mailbox exists and is read. **Done when:** `DNS` holds one row per domain and record, with its verdict.
141
+ - [ ] **Step 9 — Links:** **If** a native app has deep or invite links → check that the web serves `/.well-known/apple-app-site-association` and `/.well-known/assetlinks.json`, and that each one is valid and names the bundle id and signing identity of the current build (`Platform Settings`). Open an invite link on a device with the app (it opens the app) and on one without it (it reaches a working web page). A broken file breaks every link silently. **Done when:** `Links` holds one row per file and per device case.
142
+ - [ ] **Step 10 — Deliverability:** **If** the app sends email → compare the sending domains with the mailbox-provider sender requirements, and record the page's thresholds. Compare the spam rate (e.g., Google Postmaster Tools) with the bulk-sender limit. Check for one-click unsubscribe (the RFC 8058 `List-Unsubscribe-Post` header and a visible link) on every non-transactional message. Transactional mail (sign-in links, receipts) is exempt. Check that bounces, complaints and unsubscribes are suppressed, and that nothing re-adds them. Check that transactional mail is separate from marketing (by subdomain or stream), so a marketing complaint cannot sink sign-in mail. **Done when:** `Deliverability` holds one row per requirement, with threshold, measurement and verdict.
143
+ - [ ] **Step 11 — Expiry:** List every credential or account with a date: domains, non-auto-renewing certificates, OAuth client secrets, expiring API keys, source-host tokens, build-service tokens and annual paid plans. List store signing credentials and developer memberships by reference to `bkit-audit-app-store`. For each row, record the date, the owner and what breaks. A date due in <=60 days is a finding, and so is an unknown date. For each non-auto-renewing certificate, measure the issuer and the days left live (e.g., `openssl s_client`, a TLS checker), not from a dashboard. Cover custom DB domains, inbound mail hosts and API hosts off the main host. A hand-renewed certificate is a finding whatever its date, so propose automation. **Done when:** `Expiry Calendar` is sorted by date, and every row has a date or an unknown-date finding.
144
+ - [ ] **Step 12 — Standards:** Confirm the current version of each anchor standard, and read what changed since the previous report's version. Give `Standards Coverage` one row per Twelve-Factor III and X requirement, per CI secure-use recommendation and per platform checklist item, each marked checked (naming the step), not applicable (saying why) or finding. Give each bkit anchor (a doc section, rule or issue shape) one row, marked followed (with the step or evidence), not applicable (saying why) or finding. A departure with no recorded reason (e.g., a `docs/decisions.jsonl` row or an accepted-divergence entry) is a finding. Mark each recommended practice the project does not apply as adopt (with a proposed step), reject (saying why) or not applicable. **Done when:** no row is empty.
145
+ - [ ] **Step 13 — Anything Else:** (a) Give a one-line verdict on each change since the previous report's commit that touches config: declared variables and example env files, hosting, DB and mobile config files, workflows and rulesets, scheduled jobs, DNS records, and every `Dashboard Changes` entry. A dashboard setting that changed and that no step lists is a finding, so propose adding it to `Platform Settings`. (b) In a bounded pass of about 30 minutes, note what a senior platform engineer would flag that no step asks about. Read what happened since the previous run (incidents, `bkit-audit-logs` reports, new `docs/failures.jsonl` rows, vendor status incidents), and ask what no step would catch. **Done when:** `Beyond the Steps` holds both passes, or says `none`. **If** one class of issue is seen on 2 runs → propose a step for it in `Process Improvements`.
105
146
 
106
147
  ### 🔒 Gate 2: Probes Check
107
148
 
108
- - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
109
- - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
110
- - [ ] **No secrets:** no secret value anywhere in the report, incl. `Snapshot`; fingerprints truncated SHA-256 only.
111
- - [ ] **Remote untouched:** no dashboard setting, secret, or DNS record changed.
112
- - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
149
+ - [ ] **Steps complete:** every step is `[x]`, or skipped with evidence that its surface is absent.
150
+ - [ ] **Evidence:** every finding cites evidence someone can check again, and the tool that produced it.
151
+ - [ ] **No secrets:** no secret value appears anywhere in the report, including `Snapshot`.
152
+ - [ ] **Fingerprints only:** every fingerprint in the report is a truncated SHA-256.
153
+ - [ ] **Remote untouched:** no dashboard setting, secret or DNS record changed.
154
+ - [ ] **Gate 2 — Verified:** every item above holds.
113
155
 
114
156
  ## Findings
115
157
 
116
158
  <!-- prettier-ignore -->
117
159
  | Severity | Use |
118
160
  | --- | --- |
119
- | `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 |
120
- | `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 |
121
- | `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 |
122
- | `LOW` | Doc describing a setting wrongly while the value is right; naming drift changing no behaviour |
161
+ | `CRITICAL` | A secret in a public build-time variable or the client bundle. A production secret reachable from preview. A dangling record on a live domain. An expired domain, certificate or credential still in use |
162
+ | `HIGH` | A required check that no longer reports. Anything expiring in <=30 days. A variable missing from an environment that runs code reading it. A secret value that differs between stores of one environment, or code reading a name no store holds. A wildcard redirect in production auth. A job scheduled in two places. A bypass wider than needed, or a repository security setting turned off. CAA blocking the issuing CA. A broken `.well-known` file or invite link |
163
+ | `MEDIUM` | A setting recorded nowhere. A secret with no declared source. A hand-set secret copy missing from the inventory. A silent default that differs between environments. Flag drift with no doc. An expiry in 31-60 days, or an unknown one. A hand-renewed certificate. A secret not held as a secret type. Runtime version drift. A registrar hardening gap. A deliverability rule not met |
164
+ | `LOW` | A doc that describes a setting wrongly while the value is right. Naming drift that changes no behaviour |
123
165
 
124
- Within a severity: secrets / production first.
166
+ Within a severity, list secrets and production findings first.
125
167
 
126
168
  <!-- prettier-ignore -->
127
169
  | ID | Severity | Location | Evidence | Expected |
128
170
  | --- | --- | --- | --- | --- |
129
171
  | PENDING | PENDING | PENDING | PENDING | PENDING |
130
172
 
131
- Empty and clean → one row `None`.
173
+ **If** the run finds nothing → write one row: `None`.
132
174
 
133
175
  ## Report
134
176
 
@@ -205,13 +247,17 @@ PENDING
205
247
 
206
248
  ### 🔒 Gate 3: Report Check
207
249
 
208
- - [ ] **No placeholders:** no `PENDING` left
209
- - [ ] **Summary:** names count per severity, environments, and dashboards read.
210
- - [ ] **Series:** `Snapshot` diffed against previous report's, or marked baseline.
211
- - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
212
- - [ ] **Process Improvements:** `Universal` and `Project` filled
213
- - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
214
- - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
250
+ - [ ] **No placeholders:** no `PENDING` is left.
251
+ - [ ] **Summary:** `Summary` gives the count per severity.
252
+ - [ ] **Environments:** `Summary` names the environments.
253
+ - [ ] **Dashboards read:** `Summary` names the dashboards read.
254
+ - [ ] **Series:** `Snapshot` is diffed against the previous report's, or the run is marked baseline.
255
+ - [ ] **Writes:** this run changed only this report, the template's `Project Instructions` and its own `docs/failures.jsonl` rows.
256
+ - [ ] **Throwaways removed:** every throwaway worktree or remote target is removed.
257
+ - [ ] **Process Improvements:** `Universal` and `Project` are both filled.
258
+ - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID is in exactly one `Suggested Issues` row.
259
+ - [ ] **Next Step:** every `Suggested Issues` row has a `Next Step`.
260
+ - [ ] **Gate 3 — Verified:** every item above holds.
215
261
 
216
262
  <!-- bkit:end -->
217
263