@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,37 +1,38 @@
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
  # Gate Candidates
8
8
 
9
9
  > [!CAUTION]
10
- > **Purpose:** Ranking of which detective audit sweeps can become preventive gates, in what order, and which must stay audits.
10
+ > **Purpose:** A ranking of which detective audit sweeps can become preventive gates, in what order, and which must stay audits.
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - never build, wire, or land a gate; never edit workflows, hooks, allowlists, or gate scripts.
15
- > - NEVER weaken an existing gate — no skip, rule downgrade, lowered floor, or broader ignore — so a candidate looks adoptable.
14
+ > - NEVER build, wire or land a gate.
15
+ > - NEVER edit workflows, hooks, allowlists or gate scripts.
16
+ > - NEVER weaken an existing gate so a candidate looks adoptable: no skip, rule downgrade, lowered floor or broader ignore.
16
17
 
17
18
  ## Universal Instructions
18
19
 
19
20
  ### Context & Goals
20
21
 
21
- Maintenance sweeps find breakage; none prevent the next. Sibling audits repeat “make it a gate”; an unscheduled sweep is not a control, even when the sweep is the stated prevention. Converting checks costs: day-one red on unencoded noise → gate disabled; wrong altitude (one rule where the class needs a guard per case) → reverted. This pass ranks candidates; it does not build gates. **Stays an audit** is a valid verdict.
22
+ Maintenance sweeps find breakage, and none of them prevents the next one. Sibling audits keep saying "make it a gate", but an unscheduled sweep is not a control, even when the sweep is the stated prevention. Converting a check into a gate has costs. A gate that is red on day one from unencoded noise gets disabled. A gate at the wrong altitude, such as one rule where the class needs a guard per case, gets reverted. This pass ranks candidates and does not build gates. Staying an audit is a valid verdict.
22
23
 
23
- **Applies when:** at least one detective audit exists, and a CI job, hook, or test could block a class before merge. None → one `N/A` row with evidence, never "clean".
24
+ **Applies when:** at least one detective audit exists, **and** a CI job, hook or test could block a class before merge. **If** not → write one `N/A` row with its evidence, and never report the surface as "clean".
24
25
 
25
- **Cadence:** quarterly. Extra pass when a sibling audit's `Process Improvements` proposes a new gate, or `bkit-audit-failures` names a recurring root-cause class as a gate candidate.
26
+ **Cadence:** Run once a quarter. Run an extra pass when a sibling audit's `Process Improvements` proposes a new gate, or when `bkit-audit-failures` names a recurring root-cause class as a gate candidate.
26
27
 
27
28
  **Anchor Standards:**
28
29
 
29
- - Fitness functions (e.g. Ford, Parsons, Kua, and Sadalage, _Building Evolutionary Architectures_, 2nd ed.).
30
- - Static-analysis review bar (e.g. Tricorder: under 10% effective false positives, and an actionable message; Sadowski et al., Communications of the ACM, 2018).
31
- - Quality gates on new code (e.g. SonarQube Clean as You Code).
32
- - Ratchet and baseline tools (e.g. Betterer; reviewdog `filter_mode: added`).
33
- - Policy as code (e.g. Conftest / OPA; JSON Schema).
34
- - Required status checks and a merge queue (e.g. GitHub rulesets).
30
+ - Fitness functions (e.g., Ford, Parsons, Kua, and Sadalage, _Building Evolutionary Architectures_, 2nd ed.).
31
+ - Static-analysis review bar (e.g., Tricorder: under 10% effective false positives, and an actionable message; Sadowski et al., Communications of the ACM, 2018).
32
+ - Quality gates on new code (e.g., SonarQube Clean as You Code).
33
+ - Ratchet and baseline tools (e.g., Betterer; reviewdog `filter_mode: added`).
34
+ - Policy as code (e.g., Conftest / OPA; JSON Schema).
35
+ - Required status checks and a merge queue (e.g., GitHub rulesets).
35
36
  - OpenSSF Scorecard checks, at the Scorecard version read.
36
37
  - DORA continuous integration capability.
37
38
  - bkit block of `docs/testing.md` (bkit version from `.bkit/version`): § CI test tiers (the bkit scaffold); § Accepted divergences; § Step names say whether a red is real; § Composite actions: two rules that fail silently; § JUnit reports for bkit
@@ -40,72 +41,78 @@ Maintenance sweeps find breakage; none prevent the next. Sibling audits repeat
40
41
 
41
42
  ### Scope
42
43
 
43
- - Candidates from sibling audits, repeat defects, and standard gates nobody proposed.
44
- - Score, disqualify, tier, moment, enforcement point, positive control, and report-only bar.
45
- - Health of gates that already landed.
46
- - Allowlist and ratchet-baseline expiry.
47
- - Re-review of gates that were reverted or rejected.
44
+ - Collect candidates from sibling audits, repeat defects, and standard gates nobody proposed.
45
+ - Score each candidate, check its disqualifiers, and set its tier, moment, enforcement point, positive control and report-only bar.
46
+ - Check the health of gates that already landed.
47
+ - Check allowlist and ratchet-baseline expiry.
48
+ - Re-review gates that were reverted or rejected.
48
49
 
49
50
  ### Out of Scope
50
51
 
51
52
  <!-- prettier-ignore -->
52
53
  | Excluded item | Why | Where it belongs |
53
54
  | --- | --- | --- |
54
- | Running a sibling sweep, or clearing what it found | That audit | source `bkit-audit-*` |
55
- | Building, wiring, or landing a gate, including workflow and allowlist edits | Audit reports only | Plan from this report |
55
+ | Running a sibling sweep, or clearing what it found | That audit covers it | source `bkit-audit-*` |
56
+ | Building, wiring, or landing a gate, including workflow and allowlist edits | The audit only reports | A plan made from this report |
56
57
 
57
58
  ### Verdicts
58
59
 
59
- One per candidate.
60
+ Give each candidate one verdict.
60
61
 
61
- - **ADOPT:** passes every `Score` axis and no `Disqualify` item holds. Its rank sets its place in the order. The report names the tracker issue to open and the `docs/decisions.jsonl` row to append. Opening and appending are the next step.
62
- - **REJECT:** fails a `Score` axis, or a `Disqualify` item holds. It stays an audit. Record why, so a later run can see when the reason stops holding.
63
- - **OTHER:** fits neither (waiting on a decision or a tool). Say why, and what would settle it. The next run resolves it to ADOPT or REJECT. The same OTHER on 2 runs → propose a new verdict in `Process Improvements`.
62
+ - **ADOPT:** the candidate passes every `Score` axis, and no `Disqualify` item holds. Its rank sets its place in the order. The report names the tracker issue to open and the `docs/decisions.jsonl` row to append. Opening and appending are the next step.
63
+ - **REJECT:** the candidate fails a `Score` axis, or a `Disqualify` item holds. It stays an audit. Record why, so a later run can see when the reason stops holding.
64
+ - **OTHER:** it fits no other verdict, because it waits on a decision or a tool. Say why, and what would settle it. The next run resolves it to ADOPT or REJECT. **If** the same `OTHER` shows up on 2 runs → propose a new verdict in `Process Improvements`.
64
65
 
65
66
  ### Pre-Flight / Dependencies
66
67
 
67
68
  #### Core
68
69
 
69
- - [ ] **Permissions:** blocked calls recorded
70
- - [ ] **Sibling Reports:** Steps 2, 3 — newest report per other `bkit-audit-*` slug under `docs/audits/`, else that template's `Process Improvements`. Fallback: templates only; a missing report = that audit `Not Checked`.
71
- - [ ] **Ledgers:** Steps 3, 10, 11 — `docs/failures.jsonl`, `docs/decisions.jsonl`, `docs/deferrals.jsonl`. Fallback: incident evidence and prior rejections `Not Checked`.
72
- - [ ] **Repo Gates:** Steps 7, 9, 12, 13, 15 — workflows, hook directory, gate scripts, allowlist files, e.g. `.github/workflows`, `.husky`, `.gitlab-ci.yml`, every `bkit:gate:*` script in `package.json`. Fallback: none; those items `Not Checked`.
73
- - [ ] **Web:** Step 14 — fetch anchor standards. Fallback: versions recorded as unread.
70
+ - [ ] **Permissions:** every blocked call is recorded.
71
+ - [ ] **Sibling Reports:** Steps 2, 3 — the newest report for each other `bkit-audit-*` slug under `docs/audits/`, or else that template's `Process Improvements`. Fallback: the templates only. A missing report marks that audit `Not Checked`.
72
+ - [ ] **Ledgers:** Steps 3, 10, 11 — `docs/failures.jsonl`, `docs/decisions.jsonl`, `docs/deferrals.jsonl`. Fallback: mark incident evidence and prior rejections `Not Checked`.
73
+ - [ ] **Repo Gates:** Steps 7, 9, 12, 13, 15 — workflows, the hook directory, gate scripts and allowlist files (e.g., `.github/workflows`, `.husky`, `.gitlab-ci.yml`, and every `bkit:gate:*` script in `package.json`). Fallback: none. Mark those items `Not Checked`.
74
+ - [ ] **Web:** Step 14 — fetch the anchor standards. Fallback: record the versions as unread.
74
75
 
75
76
  #### Conditional
76
77
 
77
- - [ ] **Ruleset Read:** Host exposes branch rules → Step 7 — required checks and bypass actors, e.g. `gh api` rulesets, GitLab protected branches. Fallback: workflow and hook files only; bypass actors `Not Checked`.
78
- - [ ] **Run History:** A gate has already landed → Step 12 — how often it fired, e.g. `gh run list`, CI analytics. Fallback: code reading only; fire rate `Not Checked`.
79
- - [ ] **Scorecard:** Repo is public, or a token is present → Steps 3, 14 — e.g. `scorecard`. Fallback: read the check list; live score `Not Checked`.
78
+ - [ ] **Ruleset Read:** **If** the host exposes branch rules → Step 7 — required checks and bypass actors (e.g., `gh api` rulesets, GitLab protected branches). Fallback: the workflow and hook files only, and mark bypass actors `Not Checked`.
79
+ - [ ] **Run History:** **If** a gate has already landed → Step 12 — how often it fired (e.g., `gh run list`, CI analytics). Fallback: code reading only, and mark the fire rate `Not Checked`.
80
+ - [ ] **Scorecard:** **If** the repo is public **or** a token is present → Steps 3, 14 — e.g., `scorecard`. Fallback: read the check list, and mark the live score `Not Checked`.
80
81
 
81
82
  ### 🔒 Gate 1: Prerequisites Check
82
83
 
83
- - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
84
- - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
84
+ - [ ] **Gaps named:** every missing item names its fallback and its `Not Checked` entry.
85
+ - [ ] **Gate 1 — Verified:** every item above, every Core item and every applicable Conditional item is checked.
85
86
 
86
87
  ### Probe Steps
87
88
 
88
- - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
89
- - [ ] **Step 2 — Inventory:** Collect gate candidates from each other `bkit-audit-*` report's `Process Improvements` (else that template's), without re-deriving. Record source slug. Two audits proposing one guard = one candidate, both sources — not two work items. Re-grep of a swept class + owner-allowlist over same literals = one guard. **Done when:** `Inventory` row per candidate: source slug · one-line guard.
90
- - [ ] **Step 3 — Widen:** Sibling sections are one source. Also add, record source each: (a) every defect class in `docs/failures.jsonl` on >=2 rows, whether or not a sibling proposed a gate; (b) standard gates nobody proposed, each vs tree — secret-scanning push protection, code scanning (e.g. CodeQL), dependency-review check, workflow linters (e.g. `actionlint`, `zizmor`), lockfile lint, test-runner forbid-only flag (e.g. Playwright `--forbid-only`), typechecking of test files, OpenSSF Scorecard checks; (c) policy-as-code for config with no type system (e.g. JSON Schema, Conftest) — bot config, job-runner triggers and concurrency, hosting config, mobile build config, workflow YAML. Class (c) is what `bkit-audit-testing` flags. Already enforced → `Health`, not a second candidate. **Done when:** every added row in `Inventory` with source.
91
- - [ ] **Step 4 — Score:** Per candidate, six axes. Fails if fail condition holds.
89
+ - [ ] **Step 1 — Previous Run:** **Done when:** `Previous Run` holds the closure rate, or the run is marked baseline.
90
+ - [ ] **Step 2 — Inventory:** Collect the gate candidates from each other `bkit-audit-*` report's `Process Improvements`, without re-deriving them.
91
+ - **If** an audit has no report yet → read that template's `Process Improvements` instead.
92
+ - Record the source slug.
93
+ - Merge duplicates: two audits proposing one guard make one candidate with both sources, not two work items. A re-grep of a swept class and an owner-allowlist over the same literals are one guard.
94
+
95
+ **Done when:** `Inventory` has a row per candidate: source slug · one-line guard.
96
+
97
+ - [ ] **Step 3 — Widen:** The sibling sections are one source. Also add the following, recording the source of each. (a) Every defect class on 2 or more rows in `docs/failures.jsonl`, whether or not a sibling proposed a gate. (b) Standard gates nobody proposed, each checked against the tree: secret-scanning push protection, code scanning (e.g., CodeQL), a dependency-review check, workflow linters (e.g., `actionlint`, `zizmor`), lockfile lint, the test runner's forbid-only flag (e.g., Playwright `--forbid-only`), typechecking of test files, the OpenSSF Scorecard checks, and a check on the outcome of every scheduled control. For each scheduled job, read the outcome of each run (status code or exit code), not only that it ran: a rejected run can log at info level. A job that did not write its owned rows in its window is a finding, even when it exited 0. **If** there are no scheduled jobs → record the skip with evidence of absence. (c) Policy as code for config with no type system (e.g., JSON Schema, Conftest): bot config, job-runner triggers and concurrency, hosting config, mobile build config, and workflow YAML. Class (c) is what `bkit-audit-testing` flags. **If** a gate is already enforced → it goes in `Health`, not in a second candidate. **Done when:** every added row is in `Inventory` with its source.
98
+ - [ ] **Step 4 — Score:** Score each candidate on six axes. It fails an axis when that axis's fail condition holds.
92
99
  - **Determinism.** Can a machine decide pass/fail with no judgement? Fails if the verdict needs someone to read intent.
93
100
  - **False-positive class.** Empty, a fixed allowlist, or structural? Fails if structural and unencoded.
94
101
  - **Incident evidence.** Has this class shipped a defect here? Fails if purely theoretical.
95
102
  - **Home lane.** Does a lane already exist to run it? Fails if it needs new infrastructure or an unavailable tool.
96
- - **Cost.** Runtime per change + developer wait and upkeep (baseline maintenance, version bumps). Fails if slower than the value it returns.
97
- - **Actionability.** Does failure say what to change and where (`file:line` plus fix)? Fails if developer must investigate. Deterministic but cryptic gate is bypassed as fast as a noisy one.
103
+ - **Cost.** Runtime per change, plus developer wait and upkeep (baseline maintenance, version bumps). Fails if it costs more than the value it returns.
104
+ - **Actionability.** Does a failure say what to change and where (`file:line` plus the fix)? Fails if the developer must investigate. A deterministic but cryptic gate is bypassed as fast as a noisy one.
98
105
 
99
- Rank by incident evidence x determinism ÷ effort. Prefer candidate with real incident over merely tidy. **Done when:** `Scores` holds six answers, rank, and fail axes.
106
+ Rank by incident evidence x determinism ÷ effort. Prefer a candidate with a real incident over one that is merely tidy. **Done when:** `Scores` holds the six answers, the rank and the failed axes.
100
107
 
101
- - [ ] **Step 5 — Disqualify:** Candidate stays audit if any hold:
102
- 1. **Judgement is the task.** Examples: log line that is bug or handled outcome; deferral that may still be live (`bkit-audit-deferrals`); duplication or two deliberately different decisions (`bkit-audit-duplication`). No gate decides these.
103
- 2. **The false-positive class is structural and unencoded.** Gate only after exclusions committed as config. Default sequence, per `bkit-audit-dead-code`: clear findings → commit baseline → wire lane. Where clearing is >1 PR, ratchet (`Sequence`) may wire lane first: committed baseline holds existing findings; gate enforces on new ones.
104
- 3. **The tool cannot run in CI.** Local-only graph tool with no CI provisioning (e.g. graphify) blocks graph-derived gate until that changes or check is reimplemented without it.
108
+ - [ ] **Step 5 — Disqualify:** A candidate stays an audit when any of these holds:
109
+ 1. **Judgement is the task.** Examples: whether a log line is a bug or a handled outcome; whether a deferral may still be live (`bkit-audit-deferrals`); whether code is duplication or two deliberately different decisions (`bkit-audit-duplication`). No gate decides these.
110
+ 2. **The false-positive class is structural and unencoded.** Gate it only after the exclusions are committed as config. The default sequence, as in `bkit-audit-dead-code`, is to clear the findings, commit the baseline, then wire the lane. **If** clearing takes more than one PR → a ratchet (`Sequence`) may wire the lane first: a committed baseline holds the existing findings, and the gate enforces on new ones.
111
+ 3. **The tool cannot run in CI.** A local-only graph tool with no CI provisioning (e.g., graphify) blocks a graph-derived gate until that changes, or until the check is reimplemented without it.
105
112
 
106
- **Done when:** each holding disqualifier named in `Scores`.
113
+ **Done when:** `Scores` names each disqualifier that holds.
107
114
 
108
- - [ ] **Step 6 — Tier:** Lowest tier that can see the defect. Pushing check down a tier → faster, earlier, less flaky. Rule that can be unit test should never be end-to-end spec. Ratchet (`Sequence`) at any tier; changes what gate compares against, not where it runs.
115
+ - [ ] **Step 6 — Tier:** Pick the lowest tier that can see the defect. Pushing a check down a tier makes it faster, earlier and less flaky, so a rule that can be a unit test should never be an end-to-end spec. A ratchet (`Sequence`) works at any tier, because it changes what the gate compares against, not where it runs.
109
116
  - **Unit / contract test.** Rule computable from source constants. Example: contrast over a palette.
110
117
  - **Static.** Signature is a literal. Example: env reachability, swept-class re-grep, migration hygiene.
111
118
  - **Migration lane.** Truth in database catalogue. Example: row-level coverage, definer-rights grants.
@@ -113,44 +120,62 @@ One per candidate.
113
120
  - **End-to-end.** Needs rendered page. Example: contrast and target size in situ.
114
121
  - **Scheduled.** Depends on external service. Example: model-id resolution against live catalogue.
115
122
 
116
- Then moment, separate from tier: editor or language server, pre-commit, pre-push, pull request, merge queue, post-merge, or scheduled. Cheap deterministic check → as early as it can run. Slow or flaky → merge queue or scheduled. **Done when:** `Tiers` holds tier and moment per candidate.
117
-
118
- - [ ] **Step 7 — Enforcement:** Where integration branch accepts direct push, CI check on that branch reds after code landed: detective, not preventive. Per candidate: required status check on integration and release branch? who bypasses? is only preventive point a pre-push hook a verify-skip flag skips? Ranking says so when only preventive point can be bypassed. **Done when:** `Enforcement` row per candidate: branch · required? · bypass · preventive point.
119
- - [ ] **Step 8 — Positive Control:** Gate that passes because it measures nothing is worse than no gate — it stops anyone looking. Control every new gate meets: put defect back, watch it red. This run does not build the gate; report states that control. Gate with no proven-red demonstration is not finished. Related cheap checks: unmatched browser-test locator can be passing assertion; row-level denial can be silent zero rows, indistinguishable from empty table (`bkit-audit-database`). Skip = hollow pass. Required job skipped by job-level condition reports success. Workflow skipped by path filter, branch filter, or skip-CI marker leaves required check pending. Per candidate: skip behaviour; how skip is kept from standing in for pass. If proven-red is convention for gate change, not merge requirement → propose in `Process Improvements`. **Done when:** `Controls` states positive control and skip behaviour per candidate.
120
- - [ ] **Step 9 — Sequence:** Each candidate: report-only >=1 full cycle, then enforcing. This run does not land gate. Read current tree, fix or allowlist findings, flip enforcing. Name candidates that would red if enforced cold. Report-only ends when gate meets stated bar, not just when cycle passed. Per candidate, bar: minimum runs; effective false-positive rate under 10% (findings judged not real problem ÷ all findings); no unexplained reds; no flakes of its own; added p90 runtime under stated budget. Name one enforcement tier. **Clear-then-gate** default: fix or allowlist every existing finding, then enforce on all. **Ratchet** (new violations only) when clearing existing findings is >1 PR: gate fails only on findings not in committed baseline (guard baseline file, or tool's own, e.g. Betterer results file, reviewdog added-only mode). Baseline may only shrink; each entry names owner. Allowlist per-offender, keyed to identity — never rule downgrade or route exclusion. Every entry cites owner; no owner and no date = permanent exemption. Ratchet baseline same contract; never grows. **Done when:** `Sequence` names bar and tier per candidate.
121
- - [ ] **Step 10 — Decision:** Any workflow change needs explicit human confirmation. Propose, do not edit. Rule forbidding weakening gate applies to new one: bar for adding is that what it catches will be fixed. Record ADOPT, REJECT, or OTHER, including `docs/decisions.jsonl` row to append for ADOPT and REJECT. Appending is next step. Rejection whose reason later stops holding must stay findable. **Done when:** every candidate in `Scores` has verdict and row text, or OTHER with what settles it; verdict counts (proposed, ADOPT, REJECT, OTHER, reverted) in `Scores`.
122
- - [ ] **Step 11 — Re-Review:** Gate built and reverted is not settled. Re-read each rejection in `docs/decisions.jsonl` and prior reports; check whether reasoning still holds. Two decisions on one guard, neither retired → criterion cannot be judged = finding. Reasoning no longer holds → score again into `Scores`, with `docs/decisions.jsonl` row that would retire old decision. **Done when:** `Rejections` row per reverted or rejected gate: still holds?
123
- - [ ] **Step 12 — Health:** Per landed gate, since previous report: fire rate, true-positive rate, overrides/bypasses, own flakes, runtime. Never fired = perfectly preventive or hollow — indistinguishable outside; fresh positive control (`Positive Control`) tells apart. Never fired or hollow → name that control as next step. Every `bkit:gate:*` script in `package.json` = landed gate; workflows, agents, pre-push run only these → expand each (follow every nested `pnpm <script>` to its body) → list each command. Hollow → `CRITICAL`: script missing, empty, or runs nothing that can fail (e.g. `echo`, `true`, `|| exit 0`); command exits 0 when its tool absent (e.g. `command -v … || echo skipping`) = that check hollow → name tool and install step. **Done when:** `Health` row per landed gate, or none landed; each `bkit:gate:*` row lists every command and which can skip.
124
- - [ ] **Step 13 — Allowlists:** Every allowlist entry (known-offender maps, ratchet baseline, dead-code ignores) past date or with cited issue closed. Each lapsed = finding: renew with reason, or fix offender. Per ratchet baseline, compare entry count vs previous report: grew, or entry with no owner = finding. **Done when:** `Allowlists` lists every lapsed, grown, or ownerless entry, or `none`.
125
- - [ ] **Step 14 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per anchor practice (fitness functions, static-analysis false-positive bar, new-code gating, ratchets, policy as code, rulesets and merge queue, DORA CI capability) and per OpenSSF Scorecard check → 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.
126
- - [ ] **Step 15 — Anything Else:** (a) Everything changed since previous report's commit touching gating (guards and contract tests, hook directory, gate scripts, workflow jobs, rulesets and branch protection, allowlists) → one-line verdict each. (b) Bounded ~30 min pass: what senior build and developer-productivity engineer flags that no step asks; read 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`.
123
+ Then pick the moment, separately from the tier: the editor or language server, pre-commit, pre-push, pull request, merge queue, post-merge, or scheduled. Run a cheap deterministic check as early as it can run. Put a slow or flaky one in the merge queue or on a schedule. **Done when:** `Tiers` holds the tier and the moment per candidate.
124
+
125
+ - [ ] **Step 7 — Enforcement:** **If** the integration branch accepts direct pushes → a CI check on that branch goes red after the code has landed, so it is detective, not preventive. For each candidate, record whether it is a required status check on the integration and release branches, who can bypass it, and whether the only preventive point is a pre-push hook that a verify-skip flag skips. **If** the only preventive point can be bypassed → the ranking says so. **Done when:** `Enforcement` has a row per candidate: branch · required? · bypass · preventive point.
126
+ - [ ] **Step 8 — Positive Control:** A gate that passes because it measures nothing is worse than no gate, because it stops anyone looking. The control every new gate must meet is to put the defect back and watch the gate go red. This run does not build the gate, so the report states that control. A gate with no proven-red demonstration is not finished. Related cheap checks: an unmatched browser-test locator can sit in a passing assertion, and a row-level denial can give silent zero rows that look like an empty table (`bkit-audit-database`). A skip is a hollow pass. A required job skipped by a job-level condition reports success. A workflow skipped by a path filter, a branch filter or a skip-CI marker leaves the required check pending. For each candidate, record the skip behaviour, and how a skip is kept from standing in for a pass. **If** proven-red is a convention for gate changes but not a merge requirement → propose making it one in `Process Improvements`. **Done when:** `Controls` states the positive control and the skip behaviour per candidate.
127
+ - [ ] **Step 9 — Sequence:** Each candidate runs report-only for at least one full cycle, then enforcing.
128
+ - This run does not land the gate. The landing reads the current tree, fixes or allowlists the findings, then flips the gate to enforcing.
129
+ - Name the candidates that would go red if enforced cold.
130
+ - Report-only ends when the gate meets its stated bar, not just when a cycle has passed. For each candidate, the bar is:
131
+ - a minimum number of runs
132
+ - an effective false-positive rate under 10% (findings judged not a real problem ÷ all findings)
133
+ - no unexplained reds
134
+ - no flakes of its own
135
+ - added p90 runtime under a stated budget
136
+ - Each report-only gate prints its finding count on every run, so `Health` can compute the false-positive rate.
137
+ - Name one enforcement tier. **Clear-then-gate** is the default: fix or allowlist every existing finding, then enforce on everything.
138
+ - Use a **Ratchet** (new violations only) when clearing the existing findings takes more than one PR. The gate then fails only on findings not in a committed baseline: the guard's baseline file, or the tool's own (e.g., the Betterer results file, or reviewdog's added-only mode).
139
+ - The baseline may only shrink, and each entry names an owner.
140
+ - An allowlist is per offender and keyed to its identity, never a rule downgrade or a route exclusion. Every entry cites an owner, because an entry with no owner and no date is a permanent exemption.
141
+ - A ratchet baseline has the same contract, and never grows.
142
+
143
+ **Done when:** `Sequence` names the bar and the tier per candidate.
144
+
145
+ - [ ] **Step 10 — Decision:** Any workflow change needs explicit human confirmation, so propose, and NEVER edit. The rule against weakening a gate applies to a new one too: the bar for adding a gate is that what it catches will be fixed. Record ADOPT, REJECT or OTHER, including the `docs/decisions.jsonl` row to append for ADOPT and REJECT. Appending is the next step. A rejection whose reason later stops holding must stay findable. **Done when:** every candidate in `Scores` has a verdict and row text, or OTHER with what settles it, and `Scores` holds the verdict counts (proposed, ADOPT, REJECT, OTHER, reverted).
146
+ - [ ] **Step 11 — Re-Review:** A gate that was built and reverted is not settled. Re-read each rejection in `docs/decisions.jsonl` and in prior reports, and check whether its reasoning still holds. Also search git history for gate steps that were removed or weakened (e.g., `git log -S` on the gate script or workflow step). A removed or weakened step with no `docs/decisions.jsonl` row is a finding. Two decisions on one guard with neither retired mean the criterion cannot be judged, which is a finding. **If** the reasoning no longer holds → score the candidate again in `Scores`, with the `docs/decisions.jsonl` row that would retire the old decision. **Done when:** `Rejections` has a row per reverted or rejected gate: still holds?
147
+ - [ ] **Step 12 — Health:** For each landed gate since the previous report, record the fire rate, the true-positive rate, overrides and bypasses, its own flakes, and its runtime. A gate that never fired is either perfectly preventive or hollow, and the two look the same from outside. A fresh positive control (`Positive Control`) tells them apart. **If** a gate never fired **or** is hollow → name that control as the next step. Every `bkit:gate:*` script in `package.json` is a landed gate, and workflows, agents and pre-push run only these. Expand each one, following every nested `pnpm <script>` to its body, and list each command. A hollow gate is `CRITICAL`: the script is missing or empty, or runs nothing that can fail (e.g., `echo`, `true`, `|| exit 0`, a trailing `; :` or `|| :`, `continue-on-error: true` on a test step, or a skip guard on a file that may be deleted, such as `if: hashFiles(...)`). A command that exits 0 when its tool is absent (e.g., `command -v … || echo skipping`) makes that check hollow; name the tool and its install step. For each test lane, compare the failure count in the runner's report with the step's conclusion: a `success` conclusion with failures is `CRITICAL`, because the lane goes green while tests fail. **If** a lane has no machine-readable runner report → record it in `Not Checked`, never as clean. **Done when:** `Health` has a row per landed gate, or says none landed, and each `bkit:gate:*` row lists every command and which ones can skip.
148
+ - [ ] **Step 13 — Allowlists:** Check every allowlist entry (known-offender maps, ratchet baselines, dead-code ignores) for a date that has passed or a cited issue that is closed. Each lapsed entry is a finding: renew it with a reason, or fix the offender. For each ratchet baseline, compare the entry count with the previous report. A baseline that grew, or an entry with no owner, is a finding. **Done when:** `Allowlists` lists every lapsed, grown or ownerless entry, or says `none`.
149
+ - [ ] **Step 14 — Standards:** Confirm the current version of each anchor standard, and read what changed since the previous report's version. In `Standards Coverage`, give one row per anchor practice (fitness functions, the static-analysis false-positive bar, new-code gating, ratchets, policy as code, rulesets and merge queue, the DORA CI capability) and per OpenSSF Scorecard check, marked checked (with the step), not applicable (saying why) or finding. Give each bkit anchor (a doc section, rule or issue shape) one row, marked followed (with the step or evidence), not applicable (saying why) or finding. A departure with no recorded reason (e.g., a `docs/decisions.jsonl` row or an accepted-divergence entry) is a finding. Mark each recommended practice the project does not apply as adopt (with a proposed step), reject (saying why) or not applicable. **Done when:** no row is empty.
150
+ - [ ] **Step 15 — Anything Else:** (a) List everything changed since the previous report's commit that touches gating (guards and contract tests, the hook directory, gate scripts, workflow jobs, rulesets and branch protection, allowlists), with a one-line verdict each. (b) In a bounded pass of about 30 minutes, note what a senior build and developer-productivity 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 note what no step would catch. **Done when:** `Beyond the Steps` holds both passes, or says `none`. **If** one class of issue is seen on 2 runs → propose a step for it in `Process Improvements`.
127
151
 
128
152
  ### 🔒 Gate 2: Probes Check
129
153
 
130
- - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
131
- - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
132
- - [ ] **Sources read:** every candidate cites the section it came from; a score off a sibling summary alone is not a score.
133
- - [ ] **No gate landed:** no workflow, hook, allowlist, or gate script changed.
134
- - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
154
+ - [ ] **Steps complete:** every step is `[x]`, or skipped with evidence that its surface is absent.
155
+ - [ ] **Evidence:** every finding cites evidence someone can check again, and the tool that produced it.
156
+ - [ ] **Sources read:** every candidate cites the section it came from.
157
+ - [ ] **No summary-only scores:** no score rests on a sibling summary alone.
158
+ - [ ] **No gate landed:** no workflow, hook, allowlist or gate script changed.
159
+ - [ ] **Gate 2 — Verified:** every item above holds.
135
160
 
136
161
  ## Findings
137
162
 
138
163
  <!-- prettier-ignore -->
139
164
  | Severity | Use |
140
165
  | --- | --- |
141
- | `CRITICAL` | Ungated class is data loss, a security hole, or a broken workflow with no workaround; a required check that reports success when skipped or when it measured nothing |
142
- | `HIGH` | Class that has shipped real damage and still has a workaround; a landed gate that has never fired and has no positive control; structural false positives with no committed baseline |
143
- | `MEDIUM` | Repeat defect class with a home lane and no gate; report-only candidate past its bar with no enforce-or-stay decision; allowlist entry past its date or with no owner |
144
- | `LOW` | Candidate with no incident; OTHER waiting on a tool or a decision; gate-message wording that changes no pass/fail |
166
+ | `CRITICAL` | An ungated class is data loss, a security hole, or a broken workflow with no workaround. A required check reports success when skipped, or when it measured nothing. |
167
+ | `HIGH` | A class has shipped real damage and still has a workaround. A landed gate has never fired and has no positive control. Structural false positives have no committed baseline. |
168
+ | `MEDIUM` | A repeat defect class has a home lane and no gate. A report-only candidate is past its bar with no enforce-or-stay decision. An allowlist entry is past its date or has no owner. |
169
+ | `LOW` | A candidate has no incident. An OTHER waits on a tool or a decision. Gate-message wording changes no pass/fail. |
145
170
 
146
- A candidate takes the severity of the class its gate would catch. Within a severity: higher `Score` first.
171
+ A candidate takes the severity of the class its gate would catch. Within a severity, list the higher `Score` first.
147
172
 
148
173
  <!-- prettier-ignore -->
149
174
  | ID | Severity | Verdict | Location | Evidence | Expected |
150
175
  | --- | --- | --- | --- | --- | --- |
151
176
  | PENDING | PENDING | PENDING | PENDING | PENDING | PENDING |
152
177
 
153
- Empty and clean → one row `None`.
178
+ **If** the run finds nothing → write one row: `None`.
154
179
 
155
180
  ## Report
156
181
 
@@ -227,13 +252,16 @@ PENDING
227
252
 
228
253
  ### 🔒 Gate 3: Report Check
229
254
 
230
- - [ ] **No placeholders:** no `PENDING` left
231
- - [ ] **Summary:** names count per severity and per verdict (ADOPT / REJECT / OTHER).
232
- - [ ] **Series:** verdict counts, `Health`, and allowlist sizes beside previous report's numbers, or marked baseline.
233
- - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
234
- - [ ] **Process Improvements:** `Universal` and `Project` filled
235
- - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
236
- - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
255
+ - [ ] **No placeholders:** no `PENDING` is left.
256
+ - [ ] **Summary:** `Summary` gives the count per severity.
257
+ - [ ] **Verdict counts:** `Summary` gives the count per verdict (ADOPT / REJECT / OTHER).
258
+ - [ ] **Series:** the report shows verdict counts, `Health`, and allowlist sizes beside the previous report's numbers, or marks the run as baseline.
259
+ - [ ] **Writes:** this run changed only this report, the template's `Project Instructions` and its own `docs/failures.jsonl` rows.
260
+ - [ ] **Throwaways removed:** every throwaway worktree or remote target is removed.
261
+ - [ ] **Process Improvements:** `Universal` and `Project` are both filled.
262
+ - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID is in exactly one `Suggested Issues` row.
263
+ - [ ] **Next Step:** every `Suggested Issues` row has a `Next Step`.
264
+ - [ ] **Gate 3 — Verified:** every item above holds.
237
265
 
238
266
  <!-- bkit:end -->
239
267