@cbartens/bkit 5.5.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/.bkit/README.md +30 -20
  2. package/.bkit/core/.agents/docs.md +1 -0
  3. package/.bkit/core/.agents/rules.md +51 -26
  4. package/.bkit/core/.bkit/README.md +29 -19
  5. package/.bkit/core/.bkit/authoring.md +117 -0
  6. package/.bkit/core/.bkit/cloud.md +11 -11
  7. package/.bkit/core/.bkit/comparison.md +5 -5
  8. package/.bkit/core/.bkit/install.md +20 -20
  9. package/.bkit/core/.bkit/jsonl.md +202 -122
  10. package/.bkit/core/.bkit/lite.md +1 -1
  11. package/.bkit/core/.bkit/pipeline.md +49 -52
  12. package/.bkit/core/.bkit/prompts.md +106 -167
  13. package/.bkit/core/.bkit/providers.md +29 -32
  14. package/.bkit/core/.bkit/templates.md +44 -18
  15. package/.bkit/core/.bkit/trackers.md +60 -28
  16. package/.bkit/core/.bkit/workflows.md +399 -359
  17. package/.bkit/core/AGENTS.md +16 -22
  18. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +14 -38
  19. package/.bkit/core/docs/templates/bkit-audit-adoption.md +16 -40
  20. package/.bkit/core/docs/templates/bkit-audit-agents.md +19 -43
  21. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +16 -40
  22. package/.bkit/core/docs/templates/bkit-audit-analytics.md +14 -38
  23. package/.bkit/core/docs/templates/bkit-audit-annotations.md +11 -35
  24. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +15 -39
  25. package/.bkit/core/docs/templates/bkit-audit-app-store.md +12 -36
  26. package/.bkit/core/docs/templates/bkit-audit-architecture.md +16 -40
  27. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +16 -40
  28. package/.bkit/core/docs/templates/bkit-audit-config.md +18 -42
  29. package/.bkit/core/docs/templates/bkit-audit-cost.md +16 -40
  30. package/.bkit/core/docs/templates/bkit-audit-coverage.md +15 -39
  31. package/.bkit/core/docs/templates/bkit-audit-database.md +16 -40
  32. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +15 -39
  33. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +15 -38
  34. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +16 -40
  35. package/.bkit/core/docs/templates/bkit-audit-documentation.md +11 -35
  36. package/.bkit/core/docs/templates/bkit-audit-duplication.md +18 -42
  37. package/.bkit/core/docs/templates/bkit-audit-failures.md +13 -37
  38. package/.bkit/core/docs/templates/bkit-audit-flakes.md +12 -36
  39. package/.bkit/core/docs/templates/bkit-audit-gates.md +14 -38
  40. package/.bkit/core/docs/templates/bkit-audit-issues.md +15 -39
  41. package/.bkit/core/docs/templates/bkit-audit-llm.md +16 -40
  42. package/.bkit/core/docs/templates/bkit-audit-logs.md +14 -38
  43. package/.bkit/core/docs/templates/bkit-audit-models.md +12 -36
  44. package/.bkit/core/docs/templates/bkit-audit-privacy.md +12 -36
  45. package/.bkit/core/docs/templates/bkit-audit-prompts.md +15 -39
  46. package/.bkit/core/docs/templates/bkit-audit-red-team.md +15 -39
  47. package/.bkit/core/docs/templates/bkit-audit-reliability.md +15 -39
  48. package/.bkit/core/docs/templates/bkit-audit-repo.md +12 -36
  49. package/.bkit/core/docs/templates/bkit-audit-security.md +13 -37
  50. package/.bkit/core/docs/templates/bkit-audit-slop.md +14 -38
  51. package/.bkit/core/docs/templates/bkit-audit-testing.md +12 -36
  52. package/.bkit/core/docs/templates/bkit-audit-usability.md +16 -40
  53. package/.bkit/core/docs/templates/bkit-plan.md +97 -226
  54. package/.bkit/core/engine/checks/after/ci-yml.ts +39 -30
  55. package/.bkit/core/engine/checks/after/github.ts +101 -72
  56. package/.bkit/core/engine/checks/after/index.ts +10 -12
  57. package/.bkit/core/engine/checks/after/suppression.ts +8 -5
  58. package/.bkit/core/engine/checks/after/tools.ts +47 -92
  59. package/.bkit/core/engine/checks/before/env.ts +2 -2
  60. package/.bkit/core/engine/checks/before/files.ts +5 -4
  61. package/.bkit/core/engine/checks/before/index.ts +18 -1
  62. package/.bkit/core/engine/checks/before/repo.ts +168 -2
  63. package/.bkit/core/engine/checks/tips/catalogue.ts +16 -5
  64. package/.bkit/core/engine/checks/tips/detect.ts +34 -0
  65. package/.bkit/core/engine/checks/tips/index.ts +10 -7
  66. package/.bkit/core/engine/cli.ts +20 -53
  67. package/.bkit/core/engine/commands/analysis.ts +171 -140
  68. package/.bkit/core/engine/commands/ci/ci.ts +6 -6
  69. package/.bkit/core/engine/commands/comply.ts +77 -103
  70. package/.bkit/core/engine/commands/install/doctor.ts +2 -2
  71. package/.bkit/core/engine/commands/install/install.ts +57 -18
  72. package/.bkit/core/engine/commands/install/uninstall.ts +65 -28
  73. package/.bkit/core/engine/commands/land.ts +18 -12
  74. package/.bkit/core/engine/commands/lib.ts +79 -17
  75. package/.bkit/core/engine/commands/registry.ts +4 -0
  76. package/.bkit/core/engine/commands/setup/setup.ts +7 -7
  77. package/.bkit/core/engine/commands/stats.ts +204 -0
  78. package/.bkit/core/engine/commands/tips.ts +10 -5
  79. package/.bkit/core/engine/commands/workflow/branches.ts +741 -62
  80. package/.bkit/core/engine/commands/workflow/challenge.ts +673 -0
  81. package/.bkit/core/engine/commands/workflow/context.ts +853 -29
  82. package/.bkit/core/engine/commands/workflow/counters.ts +267 -84
  83. package/.bkit/core/engine/commands/workflow/decisions.ts +541 -0
  84. package/.bkit/core/engine/commands/workflow/disk.ts +2 -2
  85. package/.bkit/core/engine/commands/workflow/fids.ts +793 -33
  86. package/.bkit/core/engine/commands/workflow/issues.ts +427 -105
  87. package/.bkit/core/engine/commands/workflow/ledgers.ts +884 -27
  88. package/.bkit/core/engine/commands/workflow/locks.ts +26 -2
  89. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +582 -0
  90. package/.bkit/core/engine/commands/workflow/plan-versions.ts +21 -0
  91. package/.bkit/core/engine/commands/workflow/prs.ts +166 -30
  92. package/.bkit/core/engine/commands/workflow/repo.ts +59 -7
  93. package/.bkit/core/engine/commands/workflow/roadmap.ts +16 -7
  94. package/.bkit/core/engine/commands/workflow/run-facts.ts +501 -0
  95. package/.bkit/core/engine/commands/workflow/runs.ts +179 -49
  96. package/.bkit/core/engine/commands/workflow/runtime.ts +22 -1
  97. package/.bkit/core/engine/commands/workflow/status.ts +142 -29
  98. package/.bkit/core/engine/commands/workflow/step-table.ts +339 -0
  99. package/.bkit/core/engine/commands/workflow/steps.ts +213 -88
  100. package/.bkit/core/engine/commands/workflow/summary.ts +398 -0
  101. package/.bkit/core/engine/commands/workflow/tests.ts +1013 -148
  102. package/.bkit/core/engine/commands/workflow/tracker.ts +1195 -0
  103. package/.bkit/core/engine/commands/workflow/workflows.ts +984 -207
  104. package/.bkit/core/engine/commands/workflow/workstreams.ts +11 -5
  105. package/.bkit/core/engine/commands/workflow/worktrees.ts +276 -22
  106. package/.bkit/core/engine/install/manifest.ts +11 -9
  107. package/.bkit/core/engine/install/modules/cloud.ts +21 -13
  108. package/.bkit/core/engine/install/modules/core.ts +325 -7
  109. package/.bkit/core/engine/install/modules/opencode.ts +2 -2
  110. package/.bkit/core/engine/install/version-file.ts +6 -2
  111. package/.bkit/core/engine/ledgers/migrate.ts +92 -0
  112. package/.bkit/core/engine/ledgers/status.ts +92 -15
  113. package/.bkit/core/engine/ledgers/telemetry.ts +1261 -254
  114. package/.bkit/core/engine/render/hosts.ts +4 -0
  115. package/.bkit/core/engine/render/models.ts +12 -0
  116. package/.bkit/core/engine/shared/branches.ts +4 -1
  117. package/.bkit/core/engine/shared/egress.ts +7 -0
  118. package/.bkit/core/engine/shared/json.ts +25 -7
  119. package/.bkit/core/engine/shared/settings.ts +202 -33
  120. package/.bkit/core/engine/shared/text.ts +361 -0
  121. package/.bkit/core/engine/tools/grammar-density.ts +215 -0
  122. package/.bkit/core/engine/tools/instructions-sources.ts +834 -0
  123. package/.bkit/core/engine/tools/instructions.ts +1751 -0
  124. package/.bkit/core/hooks/gateguard-engine.js +24 -23
  125. package/.bkit/core/hooks/guardrails-shell.js +2 -3
  126. package/.bkit/core/hooks/guardrails-tiers.js +7 -1
  127. package/.bkit/core/hooks/readguard-engine.js +2 -2
  128. package/.bkit/core/prompts/bkit-audit-generate.md +62 -25
  129. package/.bkit/core/prompts/bkit-build-challenge-1.md +40 -17
  130. package/.bkit/core/prompts/bkit-build-challenge-2.md +44 -17
  131. package/.bkit/core/prompts/bkit-build-install-skills.md +26 -13
  132. package/.bkit/core/prompts/bkit-build-plan-convert.md +74 -0
  133. package/.bkit/core/prompts/bkit-build-plan-current.md +26 -13
  134. package/.bkit/core/prompts/bkit-build-plan-execute.md +74 -26
  135. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +64 -23
  136. package/.bkit/core/prompts/bkit-build-plan-verify.md +57 -33
  137. package/.bkit/core/prompts/bkit-debug-abort-handover.md +30 -14
  138. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +34 -14
  139. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +34 -17
  140. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +26 -13
  141. package/.bkit/core/prompts/bkit-debug-failure-soak.md +31 -16
  142. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +21 -11
  143. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +20 -11
  144. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +20 -11
  145. package/.bkit/core/prompts/bkit-design-generate.md +33 -13
  146. package/.bkit/core/prompts/bkit-design-organise.md +25 -12
  147. package/.bkit/core/prompts/bkit-design-review-1.md +31 -15
  148. package/.bkit/core/prompts/bkit-design-review-2.md +28 -13
  149. package/.bkit/core/prompts/bkit-design-spike.md +30 -13
  150. package/.bkit/core/prompts/bkit-design-update.md +33 -19
  151. package/.bkit/core/prompts/bkit-plan-generate.md +75 -19
  152. package/.bkit/core/prompts/bkit-plan-review-1.md +50 -27
  153. package/.bkit/core/prompts/bkit-plan-review-2.md +59 -28
  154. package/.bkit/core/prompts/bkit-plan-scope-check.md +109 -0
  155. package/.bkit/core/prompts/bkit-plan-update.md +61 -24
  156. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +27 -15
  157. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +31 -16
  158. package/.bkit/core/prompts/bkit-ship-update-docs.md +30 -15
  159. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +24 -14
  160. package/.bkit/core/prompts/bkit-utility-update-decisions.md +32 -14
  161. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +29 -14
  162. package/.bkit/core/prompts/bkit-utility-update-documentation.md +28 -13
  163. package/.bkit/core/prompts/bkit-utility-update-failures.md +31 -14
  164. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +33 -14
  165. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +38 -17
  166. package/.bkit/core/prompts/bkit-utility-update-tracker.md +43 -20
  167. package/.bkit/core/workflows/bkit-auto.md +54 -46
  168. package/.bkit/core/workflows/bkit-build.md +577 -458
  169. package/.bkit/core/workflows/bkit-debug.md +348 -333
  170. package/.bkit/core/workflows/bkit-design.md +201 -237
  171. package/.bkit/core/workflows/bkit-plan.md +210 -321
  172. package/.bkit/core/workflows/bkit-ship.md +328 -278
  173. package/.bkit/shared/.bkit/.env.example +2 -2
  174. package/.bkit/shared/.claude/settings.json +11 -0
  175. package/.bkit/shared/.cursor/mcp.json +1 -1
  176. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +1 -1
  177. package/.bkit/shared/.gitattributes +1 -1
  178. package/.bkit/shared/.mcp.json +1 -1
  179. package/.bkit/shared/.opencode/opencode.json +11 -0
  180. package/.bkit/shared/CLAUDE.md +2 -2
  181. package/.bkit/shared/GEMINI.md +2 -2
  182. package/.bkit/shared/docs/architecture.md +1 -1
  183. package/.bkit/shared/docs/data-schema.md +1 -1
  184. package/.bkit/shared/docs/deployments.md +16 -28
  185. package/.bkit/shared/docs/design.md +1 -1
  186. package/.bkit/shared/docs/noise.md +1 -1
  187. package/.bkit/shared/docs/observability.md +2 -2
  188. package/.bkit/shared/docs/security.md +1 -1
  189. package/.bkit/shared/docs/setup.md +1 -1
  190. package/.bkit/shared/docs/technology.md +1 -1
  191. package/.bkit/shared/docs/testing.md +27 -10
  192. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +1 -1
  193. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +26 -5
  194. package/.bkit/templates/.github/workflows/bkit-ci.yml +22 -84
  195. package/.bkit/templates/.github/workflows/bkit-cloud.yml +21 -19
  196. package/.bkit/templates/.husky/pre-push +52 -13
  197. package/.bkit/templates/.prettierignore +7 -0
  198. package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +194 -0
  199. package/.bkit/templates/scripts/ci/check-capstone.mjs +2 -4
  200. package/.bkit/templates/scripts/ci/check-capstone.test.mjs +4 -23
  201. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +104 -23
  202. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +103 -6
  203. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +1 -1
  204. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +3 -1
  205. package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +49 -29
  206. package/CHANGELOG.md +142 -0
  207. package/README.md +58 -34
  208. package/dist/checks/after/ci-yml.js +39 -29
  209. package/dist/checks/after/github.js +99 -72
  210. package/dist/checks/after/index.js +11 -13
  211. package/dist/checks/after/suppression.js +8 -5
  212. package/dist/checks/after/tools.js +40 -83
  213. package/dist/checks/before/env.js +2 -2
  214. package/dist/checks/before/files.js +5 -3
  215. package/dist/checks/before/index.js +15 -2
  216. package/dist/checks/before/repo.js +163 -2
  217. package/dist/checks/tips/catalogue.js +14 -5
  218. package/dist/checks/tips/detect.js +32 -0
  219. package/dist/checks/tips/index.js +7 -5
  220. package/dist/cli.js +19 -47
  221. package/dist/commands/analysis.js +109 -100
  222. package/dist/commands/ci/ci.js +6 -6
  223. package/dist/commands/comply.js +54 -91
  224. package/dist/commands/install/doctor.js +2 -2
  225. package/dist/commands/install/install.js +50 -19
  226. package/dist/commands/install/uninstall.js +59 -28
  227. package/dist/commands/land.js +16 -12
  228. package/dist/commands/lib.js +51 -16
  229. package/dist/commands/registry.js +4 -0
  230. package/dist/commands/setup/setup.js +7 -7
  231. package/dist/commands/stats.js +136 -0
  232. package/dist/commands/tips.js +7 -3
  233. package/dist/commands/workflow/branches.js +656 -56
  234. package/dist/commands/workflow/challenge.js +556 -0
  235. package/dist/commands/workflow/context.js +709 -30
  236. package/dist/commands/workflow/counters.js +208 -75
  237. package/dist/commands/workflow/decisions.js +441 -0
  238. package/dist/commands/workflow/disk.js +2 -2
  239. package/dist/commands/workflow/fids.js +689 -33
  240. package/dist/commands/workflow/issues.js +362 -99
  241. package/dist/commands/workflow/ledgers.js +762 -27
  242. package/dist/commands/workflow/locks.js +24 -2
  243. package/dist/commands/workflow/plan-blocks.js +437 -0
  244. package/dist/commands/workflow/plan-versions.js +22 -0
  245. package/dist/commands/workflow/prs.js +142 -32
  246. package/dist/commands/workflow/repo.js +52 -7
  247. package/dist/commands/workflow/roadmap.js +9 -7
  248. package/dist/commands/workflow/run-facts.js +426 -0
  249. package/dist/commands/workflow/runs.js +144 -43
  250. package/dist/commands/workflow/runtime.js +12 -1
  251. package/dist/commands/workflow/status.js +130 -29
  252. package/dist/commands/workflow/step-table.js +276 -0
  253. package/dist/commands/workflow/steps.js +171 -80
  254. package/dist/commands/workflow/summary.js +275 -0
  255. package/dist/commands/workflow/tests.js +834 -136
  256. package/dist/commands/workflow/tracker.js +983 -0
  257. package/dist/commands/workflow/workflows.js +834 -195
  258. package/dist/commands/workflow/workstreams.js +11 -5
  259. package/dist/commands/workflow/worktrees.js +221 -22
  260. package/dist/install/manifest.js +11 -9
  261. package/dist/install/modules/cloud.js +22 -13
  262. package/dist/install/modules/core.js +326 -7
  263. package/dist/install/modules/opencode.js +2 -2
  264. package/dist/install/version-file.js +6 -2
  265. package/dist/ledgers/migrate.js +81 -0
  266. package/dist/ledgers/status.js +61 -8
  267. package/dist/ledgers/telemetry.js +905 -124
  268. package/dist/render/hosts.js +4 -0
  269. package/dist/render/models.js +12 -0
  270. package/dist/shared/branches.js +3 -1
  271. package/dist/shared/egress.js +7 -0
  272. package/dist/shared/json.js +20 -7
  273. package/dist/shared/settings.js +147 -26
  274. package/dist/shared/text.js +333 -0
  275. package/dist/tools/grammar-density.js +183 -0
  276. package/dist/tools/instructions-sources.js +721 -0
  277. package/dist/tools/instructions.js +1579 -0
  278. package/package.json +114 -23
  279. package/.bkit/core/engine/commands/harvest.ts +0 -459
  280. package/.bkit/core/engine/tools/wording.ts +0 -748
  281. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
  282. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
  283. package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
  284. package/.bkit/core/prompts/bkit-build-summary.md +0 -94
  285. package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
  286. package/.bkit/core/prompts/bkit-design-summary.md +0 -107
  287. package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
  288. package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
  289. package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
  290. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
  291. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
  292. package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
  293. package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
  294. package/.bkit/templates/scripts/ci/lanes/check-tree-cache.mjs +0 -138
  295. package/.bkit/templates/scripts/ci/lanes/check-tree-cache.test.mjs +0 -181
  296. package/dist/commands/harvest.js +0 -353
  297. package/dist/tools/wording.js +0 -680
@@ -11,14 +11,6 @@
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - Read-only audit; never edit code, config, or data.
15
- > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
- > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
- > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
- > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
- > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
- > - Every claim cites this run's evidence (`file:line`, or command / query and its output) and tool behind it; a previous report's figure, list, or status is a lead, not evidence.
21
- > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
14
  > - NEVER delete, prune, push, drop a stash, or rewrite history; name the command, do not run it.
23
15
  > - NEVER copy a secret or personal-data value into the report; name the file and line.
24
16
  > - Name the machine. Local leftovers absent on a fresh checkout stay `Not Checked`.
@@ -33,7 +25,7 @@ Every task leaves a worktree, branch, stash, or scratch directory; nothing's job
33
25
 
34
26
  **Cadence:** monthly. Extra pass after a burst of parallel agent work (worktrees and branches pile up fastest).
35
27
 
36
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
28
+ **Anchor Standards:**
37
29
 
38
30
  - OpenSSF Scorecard checks; record the version run.
39
31
  - OpenSSF OSPS Baseline, the version marked current.
@@ -79,38 +71,28 @@ Every task leaves a worktree, branch, stash, or scratch directory; nothing's job
79
71
 
80
72
  ### Pre-Flight / Dependencies
81
73
 
82
- **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
83
-
84
- **Credentials:** probe direnv before marking a token / env var missing: `direnv exec . sh -c '[ -n "${VAR}" ] && echo set || echo unset'`; `unset` = missing. Run credentialed CLIs as `direnv exec . <cmd>`. No direnv (cloud session) → plain env check. Report names, never values.
85
-
86
74
  #### Core
87
75
 
88
- Always verify.
89
-
90
- - [ ] **Permissions:** Before Step 1 — one cheap read-only call per tool this run uses (every item below, every rule under `Project Instructions` `Permissions`), e.g. `gh run list --limit 1`, one MCP read, one anchor-standard fetch. Blocked / denied (here or in any step) → record call verbatim and narrow allow rule clearing it (e.g. `Bash(gh run list *)`) in `Not Checked`, `Process Improvements`, and `Project Instructions` `Permissions`; run every step the remaining tools allow; work needing blocked call → `Not Checked`. never stop the run for a blocked call; never retry or reword a blocked call to get past it.
91
- - [ ] **Git:** Steps 2–7, 9 — local checkout, worktrees, branches, stashes. Fallback: none; no checkout → `N/A` and STOP.
76
+ - [ ] **Permissions:** blocked calls recorded
77
+ - [ ] **Git:** Steps 2-7, 9 — local checkout, worktrees, branches, stashes. Fallback: none; no checkout → `N/A` and STOP.
92
78
  - [ ] **Host API:** Steps 4, 8 — read-only, e.g. `gh api`. Fallback: local git only; remote branches, pull requests, and settings `Not Checked`.
93
79
  - [ ] **Web:** Step 10 — fetch anchor standards. Fallback: versions recorded as unread.
94
80
 
95
81
  #### Conditional
96
82
 
97
- Verify only when applicable.
98
-
99
- - [ ] **Secret Scanners:** Leftovers or history → Steps 6–7 — e.g. gitleaks, TruffleHog. Fallback: pattern search; verified-credential check `Not Checked`. Reports outside the repo.
83
+ - [ ] **Secret Scanners:** Leftovers or history → Steps 6-7 — e.g. gitleaks, TruffleHog. Fallback: pattern search; verified-credential check `Not Checked`. Reports outside the repo.
100
84
  - [ ] **Repo Sizer:** History size → Step 7 — e.g. git-sizer. Fallback: `git rev-list` blob sizes.
101
85
  - [ ] **Dependency Version Linter:** Workspaces → Step 7 — e.g. sherif, syncpack. Fallback: diff manifests by reading.
102
86
  - [ ] **Scorecard:** Host exposes one → Step 8 — e.g. OpenSSF Scorecard, read-only token. Fallback: settings API only; scores `Not Checked`.
103
87
 
104
88
  ### 🔒 Gate 1: Prerequisites Check
105
89
 
106
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
107
-
108
90
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
109
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
91
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
110
92
 
111
93
  ### Probe Steps
112
94
 
113
- - [ ] **Step 1 — Previous Run:** Audited commit = this report's `bkit:anchor` `baseSha`. Read newest prior report for this slug under `docs/audits/`; its commit = its `bkit:anchor` `baseSha`, else the HEAD its `Previous Run` recorded. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
95
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
114
96
  - [ ] **Step 2 — Checkout:** Name machine and checkout. Worktrees, stashes, scratch directories are local — fresh cloud checkout sees none; say so, not clean. Remote branches and pull requests are shared; every run checks those. **Done when:** machine, checkout, and which surfaces are local-only in `Checked`.
115
97
  - [ ] **Step 3 — Worktrees:** `git worktree list --porcelain`. Per worktree: branch, ahead/behind integration branch, `git cherry`, pull-request state, uncommitted changes (`git status --porcelain`), last commit date, size (`du -sh`). Locked or files modified in the last day → KEEP or ASK, never REMOVE (agent may still be running). Also `git worktree prune --dry-run` for entries whose directory is gone. Never prune for real. **Done when:** `Worktrees` row per entry with verdict; totals in `Totals`.
116
98
  - [ ] **Step 4 — Branches:** Local: merged by ancestry, merged by squash (pull request merged, or `git cherry` all `-`), upstream gone, agent-prefix branches with no worktree. Remote: branches other than integration, production, dependency-update bot's, with pull-request state. Record delete-on-merge; when off, merged pull request leaves its branch. Unmerged with no pull request: every commit is RESCUE until shown otherwise. Open pull requests with no activity for 30 days, and old drafts. Tags no release or deploy uses. **Done when:** `Branches` row per item with verdict; counts in `Totals`.
@@ -124,13 +106,11 @@ Verify only when applicable.
124
106
 
125
107
  ### 🔒 Gate 2: Probes Check
126
108
 
127
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
128
-
129
109
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
130
110
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
131
111
  - [ ] **No values:** no secret or personal-data value anywhere in the report.
132
112
  - [ ] **Nothing removed:** no worktree, branch, stash, file, or remote ref deleted or pushed.
133
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
113
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
134
114
 
135
115
  ## Findings
136
116
 
@@ -142,7 +122,7 @@ Verify only when applicable.
142
122
  | `MEDIUM` | Leftover a test or script keeps producing; toolchain versions disagree; repository setting below the standard |
143
123
  | `LOW` | Regenerable cache, reported by size; naming drift; contribution scaffolding the owner must decide |
144
124
 
145
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: live credentials, then RESCUE, before REMOVE.
125
+ Within a severity: live credentials, then RESCUE, before REMOVE.
146
126
 
147
127
  <!-- prettier-ignore -->
148
128
  | ID | Severity | Verdict | Location | Evidence | Expected |
@@ -218,17 +198,13 @@ PENDING
218
198
 
219
199
  ### 🔒 Gate 3: Report Check
220
200
 
221
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
222
-
223
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
201
+ - [ ] **No placeholders:** no `PENDING` left
224
202
  - [ ] **Summary:** names count per severity, the machine, and the checkout.
225
203
  - [ ] **Series:** `Totals` beside previous report's numbers, or marked baseline.
226
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
227
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
204
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
205
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
228
206
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
229
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
230
-
231
- > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
207
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
232
208
 
233
209
  <!-- bkit:end -->
234
210
 
@@ -11,14 +11,6 @@
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - Read-only audit; never edit code, config, or data.
15
- > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
- > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
- > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
- > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
- > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
- > - Every claim cites this run's evidence (`file:line`, or command / query and its output) and tool behind it; a previous report's figure, list, or status is a lead, not evidence.
21
- > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
14
  > - NEVER copy a secret, token, key, or personal-data value into the report; name the location only.
23
15
  > - NEVER change a secret, workflow, platform setting, or remote row. Header and DNS reads are one read-only request each.
24
16
  > - NEVER send an exploit payload, a write, or a request at production. Hostile proof against a running deployment → `bkit-audit-red-team`.
@@ -33,9 +25,9 @@ Fixes land on call sites a sweep already knew; the doc records the rule. A later
33
25
 
34
26
  **Cadence:** monthly; extra pass when a change touches auth, webhook, rate limiter, or third-party processor.
35
27
 
36
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
28
+ **Anchor Standards:**
37
29
 
38
- - OWASP Application Security Verification Standard (e.g. ASVS 5.0, chapters V1–V17).
30
+ - OWASP Application Security Verification Standard (e.g. ASVS 5.0, chapters V1-V17).
39
31
  - OWASP Top 10 (e.g. 2025) and OWASP API Security Top 10 (e.g. 2023).
40
32
  - OWASP Mobile Application Security Verification Standard, when a native app ships (e.g. MASVS 2.1).
41
33
  - RFC 9116, `security.txt`.
@@ -81,16 +73,10 @@ Fixes land on call sites a sweep already knew; the doc records the rule. A later
81
73
 
82
74
  ### Pre-Flight / Dependencies
83
75
 
84
- **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
85
-
86
- **Credentials:** probe direnv before marking a token / env var missing: `direnv exec . sh -c '[ -n "${VAR}" ] && echo set || echo unset'`; `unset` = missing. Run credentialed CLIs as `direnv exec . <cmd>`. No direnv (cloud session) → plain env check. Report names, never values.
87
-
88
76
  #### Core
89
77
 
90
- Always verify.
91
-
92
- - [ ] **Permissions:** Before Step 1 — one cheap read-only call per tool this run uses (every item below, every rule under `Project Instructions` `Permissions`), e.g. `gh run list --limit 1`, one MCP read, one anchor-standard fetch. Blocked / denied (here or in any step) → record call verbatim and narrow allow rule clearing it (e.g. `Bash(gh run list *)`) in `Not Checked`, `Process Improvements`, and `Project Instructions` `Permissions`; run every step the remaining tools allow; work needing blocked call → `Not Checked`. never stop the run for a blocked call; never retry or reword a blocked call to get past it.
93
- - [ ] **Text Search:** Steps 2, 5–14, 17, 19 — literals, env names, routes, workflows, e.g. `git grep`, ripgrep. Fallback: none; name gap. Literal searched as regex matching nothing reads as clean — name tool and whether pattern was literal.
78
+ - [ ] **Permissions:** blocked calls recorded
79
+ - [ ] **Text Search:** Steps 2, 5-14, 17, 19 — literals, env names, routes, workflows, e.g. `git grep`, ripgrep. Fallback: none; name gap. Literal searched as regex matching nothing reads as clean — name tool and whether pattern was literal.
94
80
  - [ ] **Call Graph:** Steps 5, 9 — who calls a guard, e.g. language server `find_referencing_symbols`, `tsserver`. Fallback: text search only; empty = inconclusive, not absence.
95
81
  - [ ] **Live Read:** Steps 7, 11, 22 — one read-only GET per web origin; DNS for mail auth; `security.txt` fetch. Fallback: committed config only; served headers, DNS, `security.txt` → `Not Checked`.
96
82
  - [ ] **Git History:** Steps 14, 17 — full history for secrets and new dependencies. Fallback: current tree only; history → `Not Checked`.
@@ -98,8 +84,6 @@ Always verify.
98
84
 
99
85
  #### Conditional
100
86
 
101
- Verify only when applicable.
102
-
103
87
  - [ ] **Hosted Auth:** Managed auth provider → Step 8 — password, OTP, redirect, MFA settings + provider auth lints, e.g. dashboard, management API. Fallback: config file only; live settings → `Not Checked`.
104
88
  - [ ] **Platform Access:** Third-party consoles reaching production → Step 15 — members, roles, 2FA, token last-use. Fallback: none; items → `Not Checked`.
105
89
  - [ ] **Catalogue Read:** Hosted DB or file storage → Step 9 — read-only policy listing, e.g. platform MCP `execute_sql` `SELECT`. Fallback: migrations and policy files; live policies = hypotheses.
@@ -110,18 +94,16 @@ Verify only when applicable.
110
94
 
111
95
  ### 🔒 Gate 1: Prerequisites Check
112
96
 
113
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
114
-
115
97
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
116
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
98
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
117
99
 
118
100
  ### Probe Steps
119
101
 
120
- - [ ] **Step 1 — Previous Run:** Audited commit = this report's `bkit:anchor` `baseSha`. Read newest prior report for this slug under `docs/audits/`; its commit = its `bkit:anchor` `baseSha`, else the HEAD its `Previous Run` recorded. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
102
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
121
103
  - [ ] **Step 2 — Classes:** Before any new pass, re-grep all previously swept classes. Signatures = prior report class list + `Project Instructions`. No prior class list (baseline) → seed classes from threat model's literal rules (a call, name, or path; e.g. a banned call, a required guard) + `Project Instructions`; prose rules stay with Step 3; no threat model → `Project Instructions` alone, say so. Each: literal signature, owner file if any, hits outside owner. Clean class = result — record it. Env var read (e.g. `process.env.X`, `os.environ[...]`) and never declared = control never executed; reachability → `bkit-audit-dead-code`. Patterns literal, never regex. Literal class = candidate CI guard → propose under `Process Improvements`; do not add this run. **Done when:** `Classes` row per class: signature · hits outside owner · clean or finding; baseline names its seed source.
122
104
  - [ ] **Step 3 — Threat Model:** Read threat model. STRIDE (or model method) per boundary: web, native, machine clients, inbound mail, webhooks, background jobs, privileged service credentials. Diff vs shipped since previous report commit. Uncovered boundary = finding; propose update, do not edit doc. No threat model = first finding. **Done when:** `Threat Model` lists every boundary: covered / finding.
123
105
  - [ ] **Step 4 — Pass:** Broad pass all current Top 10 categories and ASVS chapters before targeted steps; use project application-security checklist or skill if present. Targeted steps = proof; this pass catches categories no later step names. **Done when:** each category in `Checked` as checked (name later step) / finding / `none`.
124
- - [ ] **Step 5 — Auth:** Per auth, role, machine-token, CORS, open-redirect docs. Build route inventory from code: framework route handlers; server actions (each = publicly POSTable endpoint); other HTTP routers; machine-client tools; background-job serve endpoint; webhooks — guard-diff inventory. Every member-required route calls the guard. Language-server call set on guard + siblings → diff inventory; route missing from reference set = finding. Authorise in handler, not only middleware (framework bypassed middleware before — Step 17). Local token fallback: pin algorithm (no `none`, no HMAC/RSA confusion); check `iss`, `aud`, `exp`, `nbf`; bounded-cache key rotation. Machine tokens: issuance, scope, revocation; CSPRNG ≥128 bits (ASVS 7.2.3); hash-only storage; constant-time compare; expiry or recorded reason for none; never logged; never in query string. Each run re-check latent constraints: in-process server-side call skipping CSRF origin check; rate-limit key falling through to shared bucket when forwarding header absent — still latent only. CORS/CSRF origin lists exact-match: must not reflect `Origin`, accept `null`, pair `*` with credentials, or suffix-match shared platform suffix (e.g. `*.vercel.app`, `*.github.io`). Language-server empty = inconclusive; pace reference queries; corroborate via text search; name tool per count. Apparent unguarded control → confirm middleware is not doing it out of sight. **Done when:** `Routes` row per surface: guard · authorises in handler · verdict.
106
+ - [ ] **Step 5 — Auth:** Per auth, role, machine-token, CORS, open-redirect docs. Build route inventory from code: framework route handlers; server actions (each = publicly POSTable endpoint); other HTTP routers; machine-client tools; background-job serve endpoint; webhooks — guard-diff inventory. Every member-required route calls the guard. Language-server call set on guard + siblings → diff inventory; route missing from reference set = finding. Authorise in handler, not only middleware (framework bypassed middleware before — Step 17). Local token fallback: pin algorithm (no `none`, no HMAC/RSA confusion); check `iss`, `aud`, `exp`, `nbf`; bounded-cache key rotation. Machine tokens: issuance, scope, revocation; CSPRNG >=128 bits (ASVS 7.2.3); hash-only storage; constant-time compare; expiry or recorded reason for none; never logged; never in query string. Each run re-check latent constraints: in-process server-side call skipping CSRF origin check; rate-limit key falling through to shared bucket when forwarding header absent — still latent only. CORS/CSRF origin lists exact-match: must not reflect `Origin`, accept `null`, pair `*` with credentials, or suffix-match shared platform suffix (e.g. `*.vercel.app`, `*.github.io`). Language-server empty = inconclusive; pace reference queries; corroborate via text search; name tool per count. Apparent unguarded control → confirm middleware is not doing it out of sight. **Done when:** `Routes` row per surface: guard · authorises in handler · verdict.
125
107
  - [ ] **Step 6 — Limits:** Map each sensitive flow → limiter, key, threshold: sign-in, sign-up, password reset/OTP, invitation send, machine-token issue, inbound per tenant, model-token spend paths. No limiter = finding. Step 2 only checks limiter constructed in owner. Arbitrary-address email flows: per-sender and per-recipient caps; no attacker-controlled free text in body. Plan, entitlement, price from server-side billing (price-id allow-list, webhook-set plan), never client field. Plan limits hold under concurrent creates. Body size limit; list endpoints cap `limit`/page size; JSON endpoints enforce `Content-Type`. **Done when:** `Limits` row per flow: limiter · key · threshold · verdict.
126
108
  - [ ] **Step 7 — Headers:** One read-only GET per production origin and preview origin (if any). Record CSP, HSTS, `X-Content-Type-Options: nosniff`, `Referrer-Policy`, `Permissions-Policy`. CSP: no script `unsafe-inline`/`unsafe-eval`; `frame-ancestors`; `object-src 'none'`. Diff served vs framework header config and middleware. Every auth cookie: `Secure`, `HttpOnly`, `SameSite`, `Domain`, `Path`, `__Host-` prefix, lifetime. Session cookie without `HttpOnly` → recorded reason + strict CSP. Name environment per read. **Done when:** `Headers` holds both origins and every auth cookie, or live read → `Not Checked`.
127
109
  - [ ] **Step 8 — Sessions:** Record auth-provider settings each run (e.g. Supabase Auth, Auth0, in-house); setting the provider lacks → not applicable: min password length; leaked-password protection (record plan — may be paid); OTP/magic-link expiry; email confirmation; site URL; redirect allow-list (no broad wildcards); anonymous sign-in off; MFA available; provider auth lints. Member removal, role change, password change → next request. Record tenant/role source: token claims (stale until expiry) vs database; token lifetime; refresh rotation + reuse detection. Password-reset tokens single-use, expire. Email change → re-verification. OAuth linking never auto-links unverified email. Sign-in, sign-up, password reset, invitation send/accept must not reveal account existence (body, status, timing). OAuth/OIDC if any: PKCE, `state`, `nonce`, exact redirect URIs; native redirects via verified universal/app links. **Done when:** `Sessions` records every setting: met / finding / not applicable (why).
@@ -144,13 +126,11 @@ Verify only when applicable.
144
126
 
145
127
  ### 🔒 Gate 2: Probes Check
146
128
 
147
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
148
-
149
129
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
150
130
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
151
131
  - [ ] **No values:** no secret, token, key, or personal-data value anywhere in the report.
152
132
  - [ ] **Read-only:** no workflow, secret, setting, or remote row changed; no exploit payload sent.
153
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
133
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
154
134
 
155
135
  ## Findings
156
136
 
@@ -162,7 +142,7 @@ Verify only when applicable.
162
142
  | `MEDIUM` | Sensitive flow with no limiter; CSP allows `unsafe-inline` scripts; DMARC `p=none`; long-lived token with no expiry and no recorded reason; processor missing from the doc; security event with no alert; preview holding a production secret |
163
143
  | `LOW` | Header or cookie attribute missing on a non-sensitive response; naming drift that changes no access; documented control already covered and still running |
164
144
 
165
- Scale per `.bkit/jsonl.md` § Severity. Within severity: cross-tenant and secrets first. `Expected` = destination + safer fix.
145
+ Within severity: cross-tenant and secrets first. `Expected` = destination + safer fix.
166
146
 
167
147
  <!-- prettier-ignore -->
168
148
  | ID | Severity | Location | Evidence | Expected |
@@ -270,17 +250,13 @@ PENDING
270
250
 
271
251
  ### 🔒 Gate 3: Report Check
272
252
 
273
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
274
-
275
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
253
+ - [ ] **No placeholders:** no `PENDING` left
276
254
  - [ ] **Summary:** names count per severity.
277
255
  - [ ] **Classes:** every standing class has a row, including the clean ones.
278
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
279
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
256
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
257
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
280
258
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
281
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
282
-
283
- > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
259
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
284
260
 
285
261
  <!-- bkit:end -->
286
262
 
@@ -11,14 +11,6 @@
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - Read-only audit; never edit code, config, or data.
15
- > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
- > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
- > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
- > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
- > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
- > - Every claim cites this run's evidence (`file:line`, or command / query and its output) and tool behind it; a previous report's figure, list, or status is a lead, not evidence.
21
- > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
14
  > - never recommend adding suppression; scanner config stays byte-identical to committed one.
23
15
 
24
16
  ## Universal Instructions
@@ -31,7 +23,7 @@ Each suppression made sense in one PR; nothing re-reads them. Glob hiding one de
31
23
 
32
24
  **Cadence:** quarterly; extra when override count exceeds previous report's or pinned scanner version changes.
33
25
 
34
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
26
+ **Anchor Standards:**
35
27
 
36
28
  - Slop scanner at pinned version (e.g. `slop-scan`).
37
29
  - Strictest preset of type-aware linter (e.g. typescript-eslint `strict-type-checked`, mypy `--strict`; rule list changes in minors).
@@ -74,38 +66,28 @@ Each suppression made sense in one PR; nothing re-reads them. Glob hiding one de
74
66
 
75
67
  ### Pre-Flight / Dependencies
76
68
 
77
- **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
78
-
79
- **Credentials:** probe direnv before marking a token / env var missing: `direnv exec . sh -c '[ -n "${VAR}" ] && echo set || echo unset'`; `unset` = missing. Run credentialed CLIs as `direnv exec . <cmd>`. No direnv (cloud session) → plain env check. Report names, never values.
80
-
81
69
  #### Core
82
70
 
83
- Always verify.
84
-
85
- - [ ] **Permissions:** Before Step 1 — one cheap read-only call per tool this run uses (every item below, every rule under `Project Instructions` `Permissions`), e.g. `gh run list --limit 1`, one MCP read, one anchor-standard fetch. Blocked / denied (here or in any step) → record call verbatim and narrow allow rule clearing it (e.g. `Bash(gh run list *)`) in `Not Checked`, `Process Improvements`, and `Project Instructions` `Permissions`; run every step the remaining tools allow; work needing blocked call → `Not Checked`. never stop the run for a blocked call; never retry or reword a blocked call to get past it.
86
- - [ ] **Scanner:** Steps 2–4 — pinned in manifest, e.g. `slop-scan`. Fallback: skip scanner steps; run code / config steps.
87
- - [ ] **Worktree:** Steps 2–8 — detached worktree off default branch. Fallback: Steps 5–7 read-only in main checkout; Steps 3, 8 `Not Checked`.
71
+ - [ ] **Permissions:** blocked calls recorded
72
+ - [ ] **Scanner:** Steps 2-4 — pinned in manifest, e.g. `slop-scan`. Fallback: skip scanner steps; run code / config steps.
73
+ - [ ] **Worktree:** Steps 2-8 — detached worktree off default branch. Fallback: Steps 5-7 read-only in main checkout; Steps 3, 8 `Not Checked`.
88
74
  - [ ] **Git History:** Steps 5, 8 — full history for blame and churn. Fallback: ages and churn `Not Checked`.
89
75
  - [ ] **Web:** Step 9 — fetch anchor standards. Fallback: versions recorded as unread.
90
76
 
91
77
  #### Conditional
92
78
 
93
- Verify only when applicable.
94
-
95
79
  - [ ] **Language Server:** Typed language → Step 4 — references, e.g. Serena, `tsserver`. Fallback: text search only; name it per `DELETE`.
96
80
  - [ ] **Typed Lint and Type Coverage:** Typed language → Step 7 — e.g. typescript-eslint typed rules, `type-coverage`, mypy. Fallback: text-search escape-hatch counts.
97
81
  - [ ] **Complexity and Mutation Tools:** Tools exist for language → Step 8 — e.g. `eslint-plugin-sonarjs`, Stryker, mutmut; install in worktree only. Fallback: `Not Checked`.
98
82
 
99
83
  ### 🔒 Gate 1: Prerequisites Check
100
84
 
101
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
102
-
103
85
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
104
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
86
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
105
87
 
106
88
  ### Probe Steps
107
89
 
108
- - [ ] **Step 1 — Previous Run:** Audited commit = this report's `bkit:anchor` `baseSha`. Read newest prior report for this slug under `docs/audits/`; its commit = its `bkit:anchor` `baseSha`, else the HEAD its `Previous Run` recorded. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
90
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
109
91
  - [ ] **Step 2 — Isolate:** Find scanner run (package scripts). Detached worktree off default branch (no new branch); clean `git status` before start; removed before report finishes. **Done when:** worktree path and clean status in `Checked`, or absent scanner recorded.
110
92
  - [ ] **Step 3 — Hidden Findings:** Pinned scanner, committed config → JSON baseline. Stripped config (build-artifact ignores only, no overrides, all rules on) under restore guard → scan → restore → `diff` byte-identical. Suppressed = in stripped, not baseline; stripped count not fix-list. Count override blocks. Restore fails → STOP; restore committed config; record finding. **Done when:** baseline / stripped / suppressed / override-block counts in `Counts`; config diff empty.
111
93
  - [ ] **Step 4 — Verdicts:** Read each suppressed site, not rule name → verdict. `DELETE` needs reference check: language-server references where available + text search basename (script / config refs language server lacks). Text search over-reports, language server under-reports → agreement = signal. Re-run every empty result once before `DELETE`. **Done when:** every suppressed finding has verdict and evidence.
@@ -119,18 +101,16 @@ Verify only when applicable.
119
101
 
120
102
  - [ ] **Step 6 — Config Suppressions:** List per config: linter rules off / warn for globs and ignore entries; resolved type-checker config per workspace (not file) — relaxed strictness / excludes (strictness identical across workspaces); coverage excludes and ignore comments; formatter ignores; prose-linter ignores / off-switches. **Done when:** every entry `FIX` / `KEEP`; count per kind in `Counts`.
121
103
  - [ ] **Step 7 — Inferred Types:** Most escape-hatch typing implicit (e.g. `res.json()`, `JSON.parse`, `json.loads`, untyped SDK return, `catch (e)`) → per package: type coverage and any-typed boundary identifiers; unsafe-any lint counts; unawaited / misused async (e.g. floating promises) in request handlers and background jobs (serverless: post-response work not guaranteed unless platform API, e.g. Next.js `after()` / `waitUntil`); defensive-noise density (unnecessary conditions / assertions, useless catches). Typed rules from CLI, config untouched; no typed linting → record. **Done when:** measurements in `Counts`; each handler violation = `FIX` row.
122
- - [ ] **Step 8 — Hotspots:** Top 20 functions by cognitive complexity (threshold 15) × 90-day churn. Mutation-test 1–2 packages with most suppressions / casts → surviving-mutant rate. Mock-only assertions = disguised suppression. Missing tools → install in worktree only; clean `git status` at end. **Done when:** hotspot table and mutant rate in `Counts`, or missing tool recorded.
104
+ - [ ] **Step 8 — Hotspots:** Top 20 functions by cognitive complexity (threshold 15) x 90-day churn. Mutation-test 1-2 packages with most suppressions / casts → surviving-mutant rate. Mock-only assertions = disguised suppression. Missing tools → install in worktree only; clean `git status` at end. **Done when:** hotspot table and mutant rate in `Counts`, or missing tool recorded.
123
105
  - [ ] **Step 9 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per standard and per strict-preset rule resolved config leaves off → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
124
106
  - [ ] **Step 10 — Anything Else:** (a) Everything changed since previous report's commit touching suppressions (scanner / linter / type-checker / coverage / prose configs, new disables / casts / escape-hatch types / skips, lint scripts) → one-line verdict each. (b) Bounded ~30 min pass: what senior reviewer of this language flags that no step asks; read since previous run (incidents, new `docs/failures.jsonl` rows) — what would no step catch? **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
125
107
 
126
108
  ### 🔒 Gate 2: Probes Check
127
109
 
128
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
129
-
130
110
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
131
111
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
132
112
  - [ ] **Tree clean:** scanner config byte-identical to committed; worktree `git status` clean.
133
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
113
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
134
114
 
135
115
  ## Findings
136
116
 
@@ -142,7 +122,7 @@ Verify only when applicable.
142
122
  | `MEDIUM` | Reason no longer matches code; disable for a rule the config lacks; `TODO` citing closed item; relaxed strictness in one workspace |
143
123
  | `LOW` | `KEEP` without written reason; commented-out code |
144
124
 
145
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: security / data first.
125
+ Within a severity: security / data first.
146
126
 
147
127
  <!-- prettier-ignore -->
148
128
  | ID | Severity | Verdict | Location | Evidence | Expected |
@@ -194,17 +174,13 @@ PENDING
194
174
 
195
175
  ### 🔒 Gate 3: Report Check
196
176
 
197
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
198
-
199
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
177
+ - [ ] **No placeholders:** no `PENDING` left
200
178
  - [ ] **Summary:** names count per severity and baseline / stripped / suppressed counts.
201
- - [ ] **Series:** `Counts` beside previous report's counts, or marked baseline.
202
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
203
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
179
+ - [ ] **Series:** `Counts` beside previous report's numbers, or marked baseline.
180
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
181
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
204
182
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
205
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
206
-
207
- > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
183
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
208
184
 
209
185
  <!-- bkit:end -->
210
186
 
@@ -11,14 +11,6 @@
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - Read-only audit; never edit code, config, or data.
15
- > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
- > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
- > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
- > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
- > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
- > - Every claim cites this run's evidence (`file:line`, or command / query and its output) and tool behind it; a previous report's figure, list, or status is a lead, not evidence.
21
- > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
14
  > - NEVER weaken, skip, delete, or quarantine a test to get green. A test that fails because it found a real bug is working.
23
15
  > - Mutation and clock probes restore the tree before the report finishes: in-place edits reverted, throwaway setup removed, `git status` clean on touched paths. Restore fails → STOP, restore, record as finding.
24
16
  > - Do not run suites that send mail, take payment, or write production tenants. Unit and local / throwaway targets only.
@@ -33,7 +25,7 @@ Green suite = tests passed — not that they could fail, that every promise has
33
25
 
34
26
  **Cadence:** monthly — every product area and every package or app; record mutation cost per package. Package mutation tool cannot finish → `Not Checked` with that cost, never omitted. Extra pass when: test-toolchain major or config changes (mutation with force — incremental misses those); new route, worker, or external service; `bkit-audit-logs` or `bkit-audit-flakes` reports bug no test caught.
35
27
 
36
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
28
+ **Anchor Standards:**
37
29
 
38
30
  - Risk-based testing (e.g. ISO/IEC/IEEE 29119 Part 1:2022 and Part 2:2021, ISTQB Foundation Level syllabus).
39
31
  - Test-size model (e.g. Testing Trophy, Google test sizes); unversioned → record the date read.
@@ -71,23 +63,15 @@ Green suite = tests passed — not that they could fail, that every promise has
71
63
 
72
64
  ### Pre-Flight / Dependencies
73
65
 
74
- **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
75
-
76
- **Credentials:** probe direnv before marking a token / env var missing: `direnv exec . sh -c '[ -n "${VAR}" ] && echo set || echo unset'`; `unset` = missing. Run credentialed CLIs as `direnv exec . <cmd>`. No direnv (cloud session) → plain env check. Report names, never values.
77
-
78
66
  #### Core
79
67
 
80
- Always verify.
81
-
82
- - [ ] **Permissions:** Before Step 1 — one cheap read-only call per tool this run uses (every item below, every rule under `Project Instructions` `Permissions`), e.g. `gh run list --limit 1`, one MCP read, one anchor-standard fetch. Blocked / denied (here or in any step) → record call verbatim and narrow allow rule clearing it (e.g. `Bash(gh run list *)`) in `Not Checked`, `Process Improvements`, and `Project Instructions` `Permissions`; run every step the remaining tools allow; work needing blocked call → `Not Checked`. never stop the run for a blocked call; never retry or reword a blocked call to get past it.
68
+ - [ ] **Permissions:** blocked calls recorded
83
69
  - [ ] **Git:** Steps 1, 14 — `git rev-parse`, diff since previous report. Fallback: run marked baseline; ages and the what-changed pass `Not Checked`.
84
70
  - [ ] **Test Runner:** Steps 3, 6, 9, 10 — execute or read reports, e.g. Vitest, Jest, pytest. Fallback: static read only; counts, mutation, clock runs `Not Checked`.
85
71
  - [ ] **Web:** Step 13 — fetch anchor standards. Fallback: versions recorded as unread.
86
72
 
87
73
  #### Conditional
88
74
 
89
- Verify only when applicable.
90
-
91
75
  - [ ] **Mutation Tool:** Tool exists for the language → Step 6 — e.g. Stryker, mutmut. Fallback: hand-break code tests protect; scores `Not Checked`.
92
76
  - [ ] **E2E Runner:** Browser or device E2E → Steps 3, 7, 9 — e.g. Playwright, Cypress, Maestro. Fallback: unit and integration only.
93
77
  - [ ] **DB Tests:** Row-level policies, buckets, or data migrations → Step 4 — e.g. pgTAP, `supabase db test`, deployed-schema check. Fallback: read existing tests; live matrix = hypothesis.
@@ -96,15 +80,13 @@ Verify only when applicable.
96
80
 
97
81
  ### 🔒 Gate 1: Prerequisites Check
98
82
 
99
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
100
-
101
83
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
102
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
84
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
103
85
 
104
86
  ### Probe Steps
105
87
 
106
- - [ ] **Step 1 — Previous Run:** Audited commit = this report's `bkit:anchor` `baseSha`. Read newest prior report for this slug under `docs/audits/`; its commit = its `bkit:anchor` `baseSha`, else the HEAD its `Previous Run` recorded. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
107
- - [ ] **Step 2 — Scope:** Every product area for Steps 3–5 (behaviour usually crosses packages). Every package or app for Steps 6–11. Area shared with native client → every platform; one defect can have a different cause on each. **Done when:** every area, every package, platforms in `Scope`; tools and commands in `Checked`.
88
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
89
+ - [ ] **Step 2 — Scope:** Every product area for Steps 3-5 (behaviour usually crosses packages). Every package or app for Steps 6-11. Area shared with native client → every platform; one defect can have a different cause on each. **Done when:** every area, every package, platforms in `Scope`; tools and commands in `Checked`.
108
90
  - [ ] **Step 3 — Behaviours:** Start from product should-do, not code — code finds untested code, not promises with no test or unguarded failures. Rows from:
109
91
  - Screens and routes (each action one row; finishing separate from opening).
110
92
  - Unattended work (workers, crons, inbound, webhooks, tool APIs).
@@ -146,7 +128,7 @@ Verify only when applicable.
146
128
  - Wrong surface. Write one place, assertion reads another — for every write, assertion reads surface write meant to change. Derived copies → `bkit-audit-database`.
147
129
  - Status-only assertion. Response code only on operation that succeeds when failed. Assert what was stored.
148
130
  - Two clients mocked as one. User-scoped and admin clients differ; same mock cannot see write through wrong one. Mocks keep runtime-different deps different.
149
- - "Did not throw" only check on boundary (webhook, external API, DB write). Not throwing ≠ work happened. Step 6 usually confirms.
131
+ - "Did not throw" only check on boundary (webhook, external API, DB write). Not throwing != work happened. Step 6 usually confirms.
150
132
 
151
133
  New shape → propose under `Process Improvements`. Do not edit this list during run. **Done when:** every hit in `Shapes`, or `none`.
152
134
 
@@ -160,13 +142,11 @@ Verify only when applicable.
160
142
 
161
143
  ### 🔒 Gate 2: Probes Check
162
144
 
163
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
164
-
165
145
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
166
146
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
167
147
  - [ ] **Tree clean:** mutation restores and throwaway clock setup removed; no test weakened, skipped, or deleted.
168
148
  - [ ] **Scores:** total and covered recorded, or mutation explicitly skipped with evidence.
169
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
149
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
170
150
 
171
151
  ## Findings
172
152
 
@@ -178,7 +158,7 @@ Verify only when applicable.
178
158
  | `MEDIUM` | Tier too low or too high; missing failure path; lint rule off that would catch a cannot-fail shape; duplicated procedures that disagree; snapshot that matches anything; suite that skips itself |
179
159
  | `LOW` | Equivalent mutant without a disable comment; cosmetic screen without a visual assertion; agreed duplicates |
180
160
 
181
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: security / data first.
161
+ Within a severity: security / data first.
182
162
 
183
163
  <!-- prettier-ignore -->
184
164
  | ID | Severity | Location | Evidence | Expected |
@@ -266,17 +246,13 @@ PENDING
266
246
 
267
247
  ### 🔒 Gate 3: Report Check
268
248
 
269
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
270
-
271
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
249
+ - [ ] **No placeholders:** no `PENDING` left
272
250
  - [ ] **Summary:** names the single most important finding, count per severity, and both mutation scores per package (or the skip).
273
251
  - [ ] **Series:** test count and runtime per tier, and both scores, beside previous report's numbers, or marked baseline.
274
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
275
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
252
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
253
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
276
254
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
277
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
278
-
279
- > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
255
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
280
256
 
281
257
  <!-- bkit:end -->
282
258