@cbartens/bkit 5.5.1 → 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 (288) 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 +35 -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 +19 -18
  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 +91 -167
  13. package/.bkit/core/.bkit/providers.md +29 -32
  14. package/.bkit/core/.bkit/templates.md +12 -11
  15. package/.bkit/core/.bkit/trackers.md +51 -28
  16. package/.bkit/core/.bkit/workflows.md +394 -355
  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 -29
  55. package/.bkit/core/engine/checks/after/github.ts +95 -17
  56. package/.bkit/core/engine/checks/after/index.ts +10 -7
  57. package/.bkit/core/engine/checks/after/suppression.ts +8 -5
  58. package/.bkit/core/engine/checks/after/tools.ts +46 -91
  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 +6 -6
  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 +407 -64
  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 +58 -8
  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 +185 -8
  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 +250 -3
  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 +157 -20
  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 +29 -15
  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 +32 -14
  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 +72 -18
  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 +29 -14
  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 +27 -12
  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 +41 -18
  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 +11 -11
  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 +16 -7
  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 +1 -1
  195. package/.bkit/templates/.github/workflows/bkit-cloud.yml +21 -19
  196. package/.bkit/templates/.husky/pre-push +4 -4
  197. package/.bkit/templates/.prettierignore +7 -0
  198. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +1 -1
  199. package/CHANGELOG.md +112 -0
  200. package/README.md +50 -35
  201. package/dist/checks/after/ci-yml.js +39 -28
  202. package/dist/checks/after/github.js +91 -17
  203. package/dist/checks/after/index.js +11 -8
  204. package/dist/checks/after/suppression.js +8 -5
  205. package/dist/checks/after/tools.js +39 -82
  206. package/dist/checks/before/env.js +2 -2
  207. package/dist/checks/before/files.js +5 -3
  208. package/dist/checks/before/index.js +15 -2
  209. package/dist/checks/before/repo.js +163 -2
  210. package/dist/checks/tips/catalogue.js +14 -5
  211. package/dist/checks/tips/detect.js +32 -0
  212. package/dist/checks/tips/index.js +4 -4
  213. package/dist/cli.js +19 -47
  214. package/dist/commands/analysis.js +109 -100
  215. package/dist/commands/ci/ci.js +6 -6
  216. package/dist/commands/comply.js +54 -91
  217. package/dist/commands/install/doctor.js +2 -2
  218. package/dist/commands/install/install.js +50 -19
  219. package/dist/commands/install/uninstall.js +59 -28
  220. package/dist/commands/land.js +16 -12
  221. package/dist/commands/lib.js +51 -16
  222. package/dist/commands/registry.js +4 -0
  223. package/dist/commands/setup/setup.js +7 -7
  224. package/dist/commands/stats.js +136 -0
  225. package/dist/commands/tips.js +7 -3
  226. package/dist/commands/workflow/branches.js +656 -56
  227. package/dist/commands/workflow/challenge.js +556 -0
  228. package/dist/commands/workflow/context.js +709 -30
  229. package/dist/commands/workflow/counters.js +208 -75
  230. package/dist/commands/workflow/decisions.js +441 -0
  231. package/dist/commands/workflow/disk.js +2 -2
  232. package/dist/commands/workflow/fids.js +689 -33
  233. package/dist/commands/workflow/issues.js +343 -59
  234. package/dist/commands/workflow/ledgers.js +762 -27
  235. package/dist/commands/workflow/locks.js +24 -2
  236. package/dist/commands/workflow/plan-blocks.js +437 -0
  237. package/dist/commands/workflow/plan-versions.js +22 -0
  238. package/dist/commands/workflow/prs.js +142 -32
  239. package/dist/commands/workflow/repo.js +52 -8
  240. package/dist/commands/workflow/roadmap.js +9 -7
  241. package/dist/commands/workflow/run-facts.js +426 -0
  242. package/dist/commands/workflow/runs.js +144 -43
  243. package/dist/commands/workflow/runtime.js +12 -1
  244. package/dist/commands/workflow/status.js +130 -29
  245. package/dist/commands/workflow/step-table.js +276 -0
  246. package/dist/commands/workflow/steps.js +171 -80
  247. package/dist/commands/workflow/summary.js +275 -0
  248. package/dist/commands/workflow/tests.js +834 -136
  249. package/dist/commands/workflow/tracker.js +983 -0
  250. package/dist/commands/workflow/workflows.js +834 -195
  251. package/dist/commands/workflow/workstreams.js +11 -5
  252. package/dist/commands/workflow/worktrees.js +147 -9
  253. package/dist/install/manifest.js +11 -9
  254. package/dist/install/modules/cloud.js +22 -13
  255. package/dist/install/modules/core.js +247 -3
  256. package/dist/install/modules/opencode.js +2 -2
  257. package/dist/install/version-file.js +6 -2
  258. package/dist/ledgers/migrate.js +81 -0
  259. package/dist/ledgers/status.js +61 -8
  260. package/dist/ledgers/telemetry.js +905 -124
  261. package/dist/render/hosts.js +4 -0
  262. package/dist/render/models.js +12 -0
  263. package/dist/shared/branches.js +3 -1
  264. package/dist/shared/egress.js +7 -0
  265. package/dist/shared/json.js +20 -7
  266. package/dist/shared/settings.js +125 -17
  267. package/dist/shared/text.js +333 -0
  268. package/dist/tools/grammar-density.js +183 -0
  269. package/dist/tools/instructions-sources.js +721 -0
  270. package/dist/tools/instructions.js +1579 -0
  271. package/package.json +113 -24
  272. package/.bkit/core/engine/commands/harvest.ts +0 -459
  273. package/.bkit/core/engine/tools/wording.ts +0 -748
  274. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
  275. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
  276. package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
  277. package/.bkit/core/prompts/bkit-build-summary.md +0 -94
  278. package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
  279. package/.bkit/core/prompts/bkit-design-summary.md +0 -107
  280. package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
  281. package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
  282. package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
  283. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
  284. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
  285. package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
  286. package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
  287. package/dist/commands/harvest.js +0 -353
  288. 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
  > - Name each field and where it lives; never copy a personal-data value into the report.
23
15
 
24
16
  ## Universal Instructions
@@ -29,9 +21,9 @@ Privacy rules land with features; nothing re-reads them together. Drift: new tab
29
21
 
30
22
  **Applies when:** system holds personal data (accounts, contact details, content about people). None → one `N/A` row with evidence, never "clean".
31
23
 
32
- **Cadence:** once before launch, then ≥ yearly (run can serve as annual privacy review). Extra pass when migration adds personal-data tables / columns, or a new processor lands.
24
+ **Cadence:** once before launch, then >= yearly (run can serve as annual privacy review). Extra pass when migration adds personal-data tables / columns, or a new processor lands.
33
25
 
34
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed. Covers regimes `Regimes` finds apply and guidance they rely on; statutes also record compilation.
26
+ **Anchor Standards:** Covers regimes `Regimes` finds apply and guidance they rely on; statutes also record compilation.
35
27
 
36
28
  - GDPR and UK GDPR.
37
29
  - ePrivacy Art 5(3) and EDPB Guidelines 2/2023.
@@ -63,36 +55,26 @@ Privacy rules land with features; nothing re-reads them together. Drift: new tab
63
55
 
64
56
  ### Pre-Flight / Dependencies
65
57
 
66
- **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.
67
-
68
- **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.
69
-
70
58
  #### Core
71
59
 
72
- Always verify.
73
-
74
- - [ ] **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.
60
+ - [ ] **Permissions:** blocked calls recorded
75
61
  - [ ] **Published Policy:** Step 10 — privacy policy and in-app privacy copy readable (repo file or live URL). Fallback: unreadable → `Not Checked`; no policy = finding.
76
62
  - [ ] **Web:** Steps 2, 6, 12 — regulator and law sources, vendor sub-processor pages, anchor standards. Fallback: regime changes and versions recorded as unread.
77
63
 
78
64
  #### Conditional
79
65
 
80
- Verify only when applicable.
81
-
82
66
  - [ ] **Live Catalogue:** Hosted DB → Steps 3, 7 — read-only listing of non-row stores and purge jobs, e.g. platform MCP `execute_sql`. Fallback: migrations only; live state = hypothesis.
83
67
  - [ ] **Vendor Settings:** Third-party processors → Steps 6, 7 — retention, scrubbing, region, e.g. vendor dashboard, API, MCP. Fallback: code and docs only; vendor settings `Not Checked`.
84
68
  - [ ] **Agreements:** Processors → Steps 6, 11 — signed processing agreements and breach-notice terms, e.g. repo copies, contract store. Fallback: public vendor terms; signed status `Not Checked`.
85
69
 
86
70
  ### 🔒 Gate 1: Prerequisites Check
87
71
 
88
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
89
-
90
72
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
91
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
73
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
92
74
 
93
75
  ### Probe Steps
94
76
 
95
- - [ ] **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.
77
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
96
78
  - [ ] **Step 2 — Regimes:** Per candidate regime: applies? why (user locations, turnover / volume thresholds, exemptions and their exceptions, child-directed or actual knowledge). Non-binding regime → mark which checks run as good practice. List law / regulator / code changes since previous report's date, with source links. **Done when:** `Regimes` row per regime: applies · why · changes.
97
79
  - [ ] **Step 3 — Inventory:** Schema and code. Per table / column / payload: what, whose (user / non-user member / third party named in content), why held, where documented; strictly necessary? default? Optional on by default or model-prompt data beyond task need = finding. Group by purpose → record-of-processing: lawful basis, subjects, recipients, transfer destination and mechanism, security measure. Consent purposes → consent record and withdrawal path. Third parties in content → legitimate-interests assessment and notify decision. Non-row stores: file storage, device caches, derived data (embeddings as personal as source text). Device storage (cookies, local storage, native caches, SDK identifiers) → strictly necessary vs needs consent. **Done when:** `Inventory` lists every store; store no doc mentions = finding.
98
80
  - [ ] **Step 4 — Children:** When product can hold children's data, state every run: how child is known (field / role / parent statement / not at all) and where; consent path per age band and rule setting it; child defaults (visibility, location, sharing, automated processing); age-threshold crossing (re-consent / role change / nothing); parent monitoring of a child (most children's rules require telling the child). **Done when:** answers in `Inventory`, or evidence product cannot hold children's data in `Checked`.
@@ -102,18 +84,16 @@ Verify only when applicable.
102
84
  - [ ] **Step 8 — Deletion:** Read account and tenant deletion code against inventory. Stores reached vs missed: email- / name-keyed rows, file objects, rows in other tenants naming the person. External systems from `Recipients`: does deleting our row delete theirs (payment customers, error-tracker user context, job payloads, backups)? Every run: after deleting a user, what still maps their id back to a person? Deletion test must go red on a missed store — "user can no longer sign in" is not a deletion test. **Done when:** `Deletion` lists every store reached / missed.
103
85
  - [ ] **Step 9 — Rights:** Per right, how it works today or that it doesn't: access and export (machine-readable where required); correction; partial erasure keeping the account (incl. parent for child); request from a third party named in content; objection and restriction; requester verification (incl. parent for child); response deadline per applicable regime; request log and complaints route. Automated actions with real effect (e.g. a model creating / changing / deleting user data) → "significant effect: yes / no" and reasoning. Right with no exercise path = owner decision, not defect. **Done when:** `Rights` line per right.
104
86
  - [ ] **Step 10 — Claims:** Read the privacy policy linked from sign-up and in-app privacy copy; compare each claim with `Inventory`, `Recipients`, `Retention`, `Deletion`, `Rights`. Unnamed processor, wrong retention period, unkept promise, unmentioned significant automated decision = finding. Store privacy declarations likewise once listings exist. Child members possible → child-readable policy and collection notices; notice to child when a parent can monitor. Terms, refund wording, accessibility statement likewise. **Done when:** `Claims` row per claim: matches / finding.
105
- - [ ] **Step 11 — Breaches:** Written breach plan per applicable regime: regulator clock and when affected people are told; internal log of every breach (notifiable or not); each processor's notice duty and speed from its agreement. Children's regime requires a written security programme → named coordinator, ≥ yearly risk assessment, tested safeguards. **Done when:** every requirement met or finding.
87
+ - [ ] **Step 11 — Breaches:** Written breach plan per applicable regime: regulator clock and when affected people are told; internal log of every breach (notifiable or not); each processor's notice duty and speed from its agreement. Children's regime requires a written security programme → named coordinator, >= yearly risk assessment, tested safeguards. **Done when:** every requirement met or finding.
106
88
  - [ ] **Step 12 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per standard and each obligation this procedure relies on → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
107
89
  - [ ] **Step 13 — Anything Else:** (a) Everything changed since previous report's commit touching personal data (migrations, tables / columns, routes and server actions, SDKs and outbound hosts, buckets, consent screens, privacy copy) → one-line verdict each. (b) Bounded ~30 min pass: what senior privacy counsel flags that no step asks; read what happened since previous run (incidents, new `docs/failures.jsonl` rows) — what would no step catch? End with what a regulator would ask that this run cannot answer and legal questions for owner / counsel. **Done when:** `Beyond the Steps` holds both passes and regulator questions, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
108
90
 
109
91
  ### 🔒 Gate 2: Probes Check
110
92
 
111
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
112
-
113
93
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
114
94
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
115
95
  - [ ] **No values:** no personal-data value anywhere in the report.
116
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
96
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
117
97
 
118
98
  ## Findings
119
99
 
@@ -125,7 +105,7 @@ Verify only when applicable.
125
105
  | `MEDIUM` | Doc describes a store / processor wrongly; purpose without impact assessment; right without exercise path; missing breach-plan element |
126
106
  | `LOW` | Undocumented field already covered by deletion, retention, and processor list; wording drift changing no obligation |
127
107
 
128
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: children's data first. No users yet → do not lower severity for empty production tables.
108
+ Within a severity: children's data first. No users yet → do not lower severity for empty production tables.
129
109
 
130
110
  <!-- prettier-ignore -->
131
111
  | ID | Severity | Location | Evidence | Expected |
@@ -205,17 +185,13 @@ PENDING
205
185
 
206
186
  ### 🔒 Gate 3: Report Check
207
187
 
208
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
209
-
210
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
188
+ - [ ] **No placeholders:** no `PENDING` left
211
189
  - [ ] **Summary:** names count per severity.
212
190
  - [ ] **Annual Review:** states whether this run serves as the annual privacy review and whether everyone with children's-data access completed privacy training.
213
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
214
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
191
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
192
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
215
193
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
216
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
217
-
218
- > `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.
194
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
219
195
 
220
196
  <!-- bkit:end -->
221
197
 
@@ -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
  > - Quote at most one line of prompt text per finding; never copy personal data or a model completion into the report.
23
15
  > - never call a model to generate. Token counts use a local tokenizer or a provider count endpoint only.
24
16
 
@@ -32,7 +24,7 @@ A prompt is written against one model maker's advice at one point in time. The m
32
24
 
33
25
  **Cadence:** quarterly. Extra pass after a model change at any call site (`bkit-audit-models`), a new prompt set, or a maker guide update.
34
26
 
35
- **Anchor Standards:** record URL, last-updated date or date read, and the model generation each targets. Newer version → `Standards` step reads what changed.
27
+ **Anchor Standards:** record URL, last-updated date or date read, and the model generation each targets.
36
28
 
37
29
  - Anthropic prompt engineering docs and the prompting best-practices page for current Claude models.
38
30
  - OpenAI prompt engineering guide and the model-specific prompting guide for each model in use (e.g. the cookbook guide per model generation).
@@ -69,55 +61,43 @@ Guides disagree. The guide for the model that runs the prompt wins. A prompt tha
69
61
 
70
62
  ### Pre-Flight / Dependencies
71
63
 
72
- **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.
73
-
74
- **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.
75
-
76
64
  #### Core
77
65
 
78
- Always verify.
79
-
80
- - [ ] **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.
81
- - [ ] **Code Search:** Steps 2, 4–9 — text search and language server for call sites (e.g. ripgrep, Serena, `tsserver`). Prompts often markdown or string literals; tool descriptions often strings in schema files. Language-server hits under-report; empty inconclusive → corroborate with text search and name the tool. Fallback: text search only; name it per claim.
82
- - [ ] **Web:** Steps 3, 10 — each maker's prompting guide (e.g. WebFetch, WebSearch). Fallback: guide practice recorded as unread; Steps 4–7 cite the previous report's guide version and say so.
66
+ - [ ] **Permissions:** blocked calls recorded
67
+ - [ ] **Code Search:** Steps 2, 4-9 — text search and language server for call sites (e.g. ripgrep, Serena, `tsserver`). Prompts often markdown or string literals; tool descriptions often strings in schema files. Language-server hits under-report; empty inconclusive → corroborate with text search and name the tool. Fallback: text search only; name it per claim.
68
+ - [ ] **Web:** Steps 3, 10 — each maker's prompting guide (e.g. WebFetch, WebSearch). Fallback: guide practice recorded as unread; Steps 4-7 cite the previous report's guide version and say so.
83
69
 
84
70
  #### Conditional
85
71
 
86
- Verify only when applicable.
87
-
88
72
  - [ ] **LLM Report:** A `bkit-audit-llm` report exists → Steps 2, 9 — its `Inventory` and `Evals`. Fallback: inventory from code; eval coverage `Not Checked`.
89
73
  - [ ] **Token Counter:** Step 8 — local tokenizer or provider count endpoint (no generation). Fallback: character count ÷ 4, labelled estimate.
90
74
 
91
75
  ### 🔒 Gate 1: Prerequisites Check
92
76
 
93
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
94
-
95
77
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
96
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
78
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
97
79
 
98
80
  ### Probe Steps
99
81
 
100
- - [ ] **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.
82
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
101
83
  - [ ] **Step 2 — Inventory:** Start from code: every model call site outside tests (newest `bkit-audit-llm` `Inventory` as cross-check, not source). Per prompt: file, call sites, model(s) that run it — every model in the fallback chain, resolved at the call site (choice and lifecycle → `bkit-audit-models`, not scored here) · maker guide that applies · task (extract, classify, write, converse, tool-calling) · output consumer (parser, schema, human) · eval set covering it (`bkit-audit-llm` `Evals`) · last-changed commit · model or guide changed since. Exclude bkit-managed files and coding-agent instruction files. Diff vs previous run; new prompt or new model read first. **Done when:** `Inventory` row per prompt, or `N/A` and STOP.
102
- - [ ] **Step 3 — Guides:** Per maker in `Inventory`: read current prompting guide and model-specific page for each model generation in use. Record URL, last-updated date or date read, generation targeted. Build `Guidance`: practice · source · makers it applies to · which conflict. Conflict between makers → note which prompts run on both. No guide, or URL dead → still read maker's model parameter docs per generation (e.g. reasoning-effort values, rejected sampling parameters) so Step 6 parameter checks run; parameter docs missing → that generation's parameter checks `Not Checked`. Guide unread → `Not Checked`; Steps 4–7 for that maker = previous report's reading, labelled. **Done when:** `Guidance` row per practice used in Steps 4–7, every row sourced.
84
+ - [ ] **Step 3 — Guides:** Per maker in `Inventory`: read current prompting guide and model-specific page for each model generation in use. Record URL, last-updated date or date read, generation targeted. Build `Guidance`: practice · source · makers it applies to · which conflict. Conflict between makers → note which prompts run on both. No guide, or URL dead → still read maker's model parameter docs per generation (e.g. reasoning-effort values, rejected sampling parameters) so Step 6 parameter checks run; parameter docs missing → that generation's parameter checks `Not Checked`. Guide unread → `Not Checked`; Steps 4-7 for that maker = previous report's reading, labelled. **Done when:** `Guidance` row per practice used in Steps 4-7, every row sourced.
103
85
  - [ ] **Step 4 — Clarity:** Per prompt: task and what a good answer looks like stated up front; audience and context given; each constraint carries its reason where the guide asks for one; says what to do, not only what to avoid; terms the output depends on defined (e.g. date format, "recent", allowed labels, "out-of-scope" in a redirect rule); conversational prompt states its job and the reply to off-topic asks (wording only — enforcement → `bkit-audit-llm` `Job Scope`); no contradiction within the prompt or between system prompt and template; no dead instruction naming a removed field, tool, or format. **Done when:** `Clarity` row per prompt: verdict per check, each failure cited.
104
86
  - [ ] **Step 5 — Structure:** Per prompt: sections and inputs delimited the way the guide recommends (e.g. XML tags, markdown headings); instructions apart from inserted data (layout only — injection → `bkit-audit-llm`); long inputs placed where the guide says (e.g. documents first, question last); output format stated and matching its consumer — read the parser or schema and compare field names, types, enums (human consumer → `N/A`); every parsed field has an instruction (or schema description) that sets it and says what it counts; every field the instructions ask for appears in the output format; structured-output or tool schema used where the provider supports it and the guide prefers it; examples present where format or judgment matters, varied, consistent with instructions, not copied verbatim into output. **Done when:** `Structure` row per prompt: verdict per check, format-vs-parser and field-to-instruction diffs recorded.
105
- - [ ] **Step 6 — Model Fit:** Per prompt × model running it, against that maker's current guide: emphasis level (all-caps, "CRITICAL", "must", alarm emoji) — some current guides say forceful wording now makes the model over-apply a rule; first sort each capitalised absolute (or bold / emoji emphasis), by the rule it governs, into invariant (safety, permission, required field, irreversible action) or judgement call → judge only judgement calls; reasoning controls (effort or thinking setting at call site vs hand-written "think step by step" on a model with built-in reasoning); verbosity and length controls; sampling parameters the model ignores or rejects (e.g. temperature on a reasoning model); prefill used where the model or API no longer supports it; workaround written for an older model still present after a model change. Prompt on models from several makers → practice every guide supports, or finding. **Done when:** `Model Fit` row per prompt × model: check · guide line · verdict.
87
+ - [ ] **Step 6 — Model Fit:** Per prompt x model running it, against that maker's current guide: emphasis level (all-caps, "CRITICAL", "must", alarm emoji) — some current guides say forceful wording now makes the model over-apply a rule; first sort each capitalised absolute (or bold / emoji emphasis), by the rule it governs, into invariant (safety, permission, required field, irreversible action) or judgement call → judge only judgement calls; reasoning controls (effort or thinking setting at call site vs hand-written "think step by step" on a model with built-in reasoning); verbosity and length controls; sampling parameters the model ignores or rejects (e.g. temperature on a reasoning model); prefill used where the model or API no longer supports it; workaround written for an older model still present after a model change. Prompt on models from several makers → practice every guide supports, or finding. **Done when:** `Model Fit` row per prompt x model: check · guide line · verdict.
106
88
  - [ ] **Step 7 — Tools and Schemas:** Per tool or output schema a prompt offers: description says what it does, when to use it, when not to; each parameter's meaning, unit, format, allowed values; names unambiguous; no two tools a model could confuse; error text returned to the model says how to recover. Capability and bounds → `bkit-audit-llm`. No tools or schemas → skip with evidence. **Done when:** `Tools and Schemas` row per tool / schema, or skip.
107
89
  - [ ] **Step 8 — Efficiency:** Per prompt: token count of fixed part (tool named); text duplicated across prompts that one shared fragment could hold; fixed content before variable content where the provider caches prompt prefixes; text no instruction or example needs. Spend beyond per-call count → `bkit-audit-cost`. **Done when:** `Efficiency` row per prompt: tokens · duplication · cache order · dead text.
108
- - [ ] **Step 9 — Deliberate Choices:** Every departure from a guide found in Steps 4–8: check `docs/decisions.jsonl`, prompt comments, and previous reports' `Deliberate Choices`. Recorded with a reason → listed once, not a finding; re-raise only when the guide changed since that reason was written. Unrecorded → adopt (finding) / reject (why; propose `docs/decisions.jsonl` row under `Process Improvements`) / not applicable. Each finding names the eval that would confirm the rewrite (`bkit-audit-llm` `Evals`); none → `unverified`, and propose the golden case to `bkit-audit-llm`. **Done when:** `Deliberate Choices` row per departure: practice · decision source or verdict.
90
+ - [ ] **Step 9 — Deliberate Choices:** Every departure from a guide found in Steps 4-8: check `docs/decisions.jsonl`, prompt comments, and previous reports' `Deliberate Choices`. Recorded with a reason → listed once, not a finding; re-raise only when the guide changed since that reason was written. Unrecorded → adopt (finding) / reject (why; propose `docs/decisions.jsonl` row under `Process Improvements`) / not applicable. Each finding names the eval that would confirm the rewrite (`bkit-audit-llm` `Evals`); none → `unverified`, and propose the golden case to `bkit-audit-llm`. **Done when:** `Deliberate Choices` row per departure: practice · decision source or verdict.
109
91
  - [ ] **Step 10 — Standards:** Confirm current version per anchor guide; read what changed since previous report's version. `Standards Coverage`: one row per guide recommendation that applies to a prompt in `Inventory` → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
110
92
  - [ ] **Step 11 — Anything Else:** (a) Changes since previous report's commit touching prompts, call-site model settings, tool or schema descriptions, or parsers of model output → one-line verdict each. (b) Bounded ~30 min pass: what a senior prompt engineer flags that no step asks; read maker changelogs and model release notes since previous run — 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`.
111
93
 
112
94
  ### 🔒 Gate 2: Probes Check
113
95
 
114
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
115
-
116
96
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
117
97
  - [ ] **Evidence:** every finding cites `file:line`, the guide line it departs from (URL + date read), and the tool behind it.
118
98
  - [ ] **No payloads:** at most one line of prompt text per finding; no personal data or model completion.
119
99
  - [ ] **Read-only:** no model generation call, no prompt or config changed.
120
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
100
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
121
101
 
122
102
  ## Findings
123
103
 
@@ -129,7 +109,7 @@ Verify only when applicable.
129
109
  | `MEDIUM` | Rule with no reason where the guide asks for one; examples missing where format matters, or contradicting instructions; prompt on several makers' models relying on one maker's behaviour; fixed content after variable content where the provider caches; text duplicated across prompts; dead instruction; departure from a guide not recorded |
130
110
  | `LOW` | Wording; token waste with no behaviour change; non-write tool description gaps |
131
111
 
132
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: write paths first, then prompts whose model changed. A departure recorded in `docs/decisions.jsonl` with a reason is not a finding.
112
+ Within a severity: write paths first, then prompts whose model changed. A departure recorded in `docs/decisions.jsonl` with a reason is not a finding.
133
113
 
134
114
  <!-- prettier-ignore -->
135
115
  | ID | Severity | Prompt | Location | Evidence | Expected | Verify |
@@ -209,18 +189,14 @@ PENDING
209
189
 
210
190
  ### 🔒 Gate 3: Report Check
211
191
 
212
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
213
-
214
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
192
+ - [ ] **No placeholders:** no `PENDING` left
215
193
  - [ ] **Summary:** names count per severity, prompts read, and guide versions read.
216
194
  - [ ] **Series:** `Inventory` and `Deliberate Choices` diffed against previous report's, or marked baseline.
217
195
  - [ ] **Guides:** every `Model Fit` verdict names the guide and date it was judged against.
218
- - [ ] **Writes:** only this report and template `Project Instructions` changed.
219
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
196
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed.
197
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
220
198
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
221
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
222
-
223
- > `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.
199
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
224
200
 
225
201
  <!-- bkit:end -->
226
202
 
@@ -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
  > - Non-production deployment only. NEVER production, the release branch, or a third party's own platform beyond calls the app already makes.
23
15
  > - Synthetic identities only; creating and deleting them is the only data write, and they are deleted before the report finishes. One request per probe. No load, volume fuzzing, or spend past a single cap. Stop at proof — do not pivot.
24
16
  > - never copy a working token or a personal-data value into the report. Record the route, the input shape, and the response.
@@ -33,7 +25,7 @@ Three shapes do not show up in a source read: row-security denial looks like emp
33
25
 
34
26
  **Cadence:** once before launch, then quarterly. Extra pass after any change to authentication, a route that takes an id, the inbound pipeline, or a machine-client tool.
35
27
 
36
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
28
+ **Anchor Standards:**
37
29
 
38
30
  - OWASP Web Security Testing Guide (e.g. WSTG v4.2; record if a newer stable release exists).
39
31
  - Penetration Testing Execution Standard (PTES): pre-engagement, intelligence gathering, threat modelling, vulnerability analysis, exploitation, post-exploitation, reporting.
@@ -79,23 +71,15 @@ One per probe, on the `Probes` row.
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
- - [ ] **Target:** Steps 2–13 — non-production deployment of this commit, resolved by commit SHA, confirmed serving. Fallback: none. Probes stay `INCONCLUSIVE`. NEVER point them at production.
92
- - [ ] **Identities:** Steps 2, 5–12, 15 — create and delete synthetic users and tenants, guarded so a non-synthetic identity cannot be deleted. Fallback: none. Do not probe with real accounts.
76
+ - [ ] **Permissions:** blocked calls recorded
77
+ - [ ] **Target:** Steps 2-13 — non-production deployment of this commit, resolved by commit SHA, confirmed serving. Fallback: none. Probes stay `INCONCLUSIVE`. NEVER point them at production.
78
+ - [ ] **Identities:** Steps 2, 5-12, 15 — create and delete synthetic users and tenants, guarded so a non-synthetic identity cannot be deleted. Fallback: none. Do not probe with real accounts.
93
79
  - [ ] **Web:** Steps 2, 14 — each platform's penetration-testing page, and anchor standards. Fallback: policy unread → do not send probes; record why.
94
80
 
95
81
  #### Conditional
96
82
 
97
- Verify only when applicable.
98
-
99
83
  - [ ] **Data API:** Client public key plus a user token can call the data API directly → Step 6 — e.g. PostgREST, Storage, Realtime. Fallback: app routes only; direct path `Not Checked`.
100
84
  - [ ] **Inbound Mail:** The synthetic tenant has an inbound address → Step 10. Fallback: skip; `Not Checked`.
101
85
  - [ ] **Machine Client:** A token-gated tool endpoint exists → Steps 2, 11. Fallback: skip with evidence.
@@ -104,16 +88,14 @@ Verify only when applicable.
104
88
 
105
89
  ### 🔒 Gate 1: Prerequisites Check
106
90
 
107
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
108
-
109
91
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
110
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
92
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
111
93
 
112
94
  ### Probe Steps
113
95
 
114
- - [ ] **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.
115
- - [ ] **Step 2 — Engage:** Record commit and non-production URL deployed for it (the deployment the live lane resolves for that SHA, not a branch alias that may be stale). Confirm serving. Write scope in `Scope`. **In:** non-production web URL (e.g. preview deploy, staging), API host, machine-client endpoint, inbound mail domain, data API via client public key, background-job serve endpoint, native build if tested. **Out:** production, release branch, persistent demo tenant, every third party's own platform, anything not on in-list. Read current penetration-testing page of each platform probes touch (app host, database, native vendor if in scope). Record what they allow and plan tier. Page forbids probe → do not send; `INCONCLUSIVE`. Create two synthetic tenants, attacker, and victim, each with roles the product distinguishes. Issue machine-client token for each owner where product has one, on plan the feature allows. Seed victim with few records, one recurring record, attachment. Do not touch persistent demo tenant. Read newest `bkit-audit-security` and `bkit-audit-llm` reports. Every finding they could not prove → probe; model audit's prompt-only rules → probe. Every trust boundary threat model names → ≥1 probe. No threat model → say so in `Scope`. Before destructive probe, confirm no other live test holds target database. Record window. Do not wait for named approver. Later probe degrades target, touches non-synthetic data, or reaches third party → stop remaining probes; record stop in `Scope`. **Done when:** `Scope` holds URL, commit, in-list, out-list, platform rules, plan tier, identities (no tokens), suspicion list. **Probe row** (every later probe): request with tokens redacted, response status, relevant body, verdict. `BROKE` adds blast radius by reasoning, not pivoting.
116
- - [ ] **Step 3 — Surface:** List attack surface at this commit: routes, server actions, machine-client tools, webhooks, response headers of each in-scope origin. Diff vs previous report's list. Everything new → ≥1 probe. **Done when:** `Surface` holds list and diff.
96
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
97
+ - [ ] **Step 2 — Engage:** Record commit and non-production URL deployed for it (the deployment the live lane resolves for that SHA, not a branch alias that may be stale). Confirm serving. Write scope in `Scope`. **In:** non-production web URL (e.g. preview deploy, staging), API host, machine-client endpoint, inbound mail domain, data API via client public key, background-job serve endpoint, native build if tested. **Out:** production, release branch, persistent demo tenant, every third party's own platform, anything not on in-list. Read current penetration-testing page of each platform probes touch (app host, database, native vendor if in scope). Record what they allow and plan tier. Page forbids probe → do not send; `INCONCLUSIVE`. Create two synthetic tenants, attacker, and victim, each with roles the product distinguishes. Issue machine-client token for each owner where product has one, on plan the feature allows. Seed victim with few records, one recurring record, attachment. Do not touch persistent demo tenant. Read newest `bkit-audit-security` and `bkit-audit-llm` reports. Every finding they could not prove → probe; model audit's prompt-only rules → probe. Every trust boundary threat model names → >=1 probe. No threat model → say so in `Scope`. Before destructive probe, confirm no other live test holds target database. Record window. Do not wait for named approver. Later probe degrades target, touches non-synthetic data, or reaches third party → stop remaining probes; record stop in `Scope`. **Done when:** `Scope` holds URL, commit, in-list, out-list, platform rules, plan tier, identities (no tokens), suspicion list. **Probe row** (every later probe): request with tokens redacted, response status, relevant body, verdict. `BROKE` adds blast radius by reasoning, not pivoting.
98
+ - [ ] **Step 3 — Surface:** List attack surface at this commit: routes, server actions, machine-client tools, webhooks, response headers of each in-scope origin. Diff vs previous report's list. Everything new → >=1 probe. **Done when:** `Surface` holds list and diff.
117
99
  - [ ] **Step 4 — Retest:** Re-run every earlier `BROKE` whose fix landed, from recorded reproduction. `FIXED` or `STILL BROKE`, with fix commit. Confirm regression test prior run named exists; if not → `bkit-audit-testing`. **Done when:** `Retests` row per prior break, or `none`.
118
100
  - [ ] **Step 5 — Cross-Tenant:** As attacker, request victim's records by id on every route that takes one: items, attachments, download URLs, members, invitations, machine-client read tools. Mixed own-and-foreign id list must be refused, not clamped to attacker's rows. Expected: denial or not-found; no victim field in any response part, including errors. **Done when:** `Probes` row per route, shape as Step 2.
119
101
  - [ ] **Step 6 — Direct API:** Step 5 goes through app; attacker can skip. With attacker's token and client public key, ask data API for victim's tenant: each tenant-scoped table, privileged routines, GraphQL if enabled, file-storage list and download, realtime subscribe. Expected: no victim row, object, or event. Denial looks like empty result → send same request once as victim to show it would have returned data. **Done when:** `Probes` row per surface, including victim-control request, or skip with evidence direct API not exposed.
@@ -123,19 +105,17 @@ Verify only when applicable.
123
105
  - [ ] **Step 10 — Inbound:** Mail to synthetic tenant inbound address, from attacker address, trying to make model: delete or change records message does not mention; leak other records into reply; fetch internal address (`http://169.254.169.254/`, localhost, private ranges); claim member (address or display name) from domain failing or lacking SPF and DKIM; exceed link and attachment caps. Payload corpus e.g. promptfoo, garak — record which. On a shared inbound provider, use the environment tag the project documents so the message cannot land in production. Expected: only records message genuinely describes are written; nothing else changes; no internal fetch; every cap fires. Check action log for what was written. Cost probe crosses one limit, once. **Done when:** `Probes` row per attempt, with action-log evidence, or `INCONCLUSIVE` where model spend unavailable.
124
106
  - [ ] **Step 11 — Tools:** With attacker's token, as client that ignores rules: set fields allow-list excludes; pass victim's ids; change recurring record without required scope; send oversized arguments; repeat create to test idempotency key. **Done when:** `Probes` row per case, or skip with evidence no machine-client tools.
125
107
  - [ ] **Step 12 — Boundaries:** Script and markup in text fields; check render on web, native client, reply. Injection through search query and filters reaching search routine. Webhook endpoints: no signature = denial; wrong signature = same denial plus error log. Rate limits: documented thresholds fire, then stop. **Done when:** `Probes` row per boundary.
126
- - [ ] **Step 13 — Off-Topic:** Per public free-text model surface (`bkit-audit-llm` `Job Scope`; none there → find from `Surface`), as an anonymous or synthetic visitor, one ask per probe: general coding (e.g. "write a Python function that…"), homework, essay, off-topic ask wrapped in an on-topic frame (e.g. "for my trip, write a script that…"); then one greeting as control. Expected: redirect per the surface's stated job, no off-topic answer; greeting gets a normal reply. Off-topic answered → `BROKE`; record what was meant to bound it (prompt, grounding gate, classifier). **Done when:** `Probes` row per surface × ask, or skip with evidence no public free-text model surface.
108
+ - [ ] **Step 13 — Off-Topic:** Per public free-text model surface (`bkit-audit-llm` `Job Scope`; none there → find from `Surface`), as an anonymous or synthetic visitor, one ask per probe: general coding (e.g. "write a Python function that…"), homework, essay, off-topic ask wrapped in an on-topic frame (e.g. "for my trip, write a script that…"); then one greeting as control. Expected: redirect per the surface's stated job, no off-topic answer; greeting gets a normal reply. Off-topic answered → `BROKE`; record what was meant to bound it (prompt, grounding gate, classifier). **Done when:** `Probes` row per surface x ask, or skip with evidence no public free-text model surface.
127
109
  - [ ] **Step 14 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per WSTG category (INFO, CONF, IDNT, ATHN, ATHZ, SESS, INPV, ERRH, CRYP, BUSL, CLNT, APIT), and per ATLAS tactic a model probe touched → 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.
128
110
  - [ ] **Step 15 — Anything Else:** (a) Everything changed since previous report's commit touching attack surface (routes, server actions, machine-client tools, webhooks, response headers, inbound handling, what client public key can reach; Step 3 diff = starting list) → one-line verdict each. (b) Bounded ~30 min pass: what senior penetration tester 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? Probes these passes send follow rules, use identities made for it, go in `Probes`. Then delete every identity this run created with guarded delete (reaps tenant it would strand); confirm orphan sweep finds nothing left. Record where full request/response evidence is kept, for how long, redaction applied. **Done when:** `Beyond the Steps` holds both passes, or `none`; `Cleanup` confirms every identity this run created is gone. Class seen on 2 runs → propose step in `Process Improvements`. `Expected` names where finding goes, recommends safer fix. This run does not file; the audit agent writes `docs/failures.jsonl` rows: `BROKE` → plan from this report, `docs/failures.jsonl` row, regression test (ideally deployed boundary) so `bkit-audit-testing` keeps it fixed; `HELD` with no test → `bkit-audit-testing`; model result → `bkit-audit-llm`, against finding it tested; `STILL BROKE` → original finding, with retest and fix commit; `INCONCLUSIVE` → next run's Step 2 suspicion list, with what blocked; `OTHER` → report, second run proposes verdict; vulnerability in database product itself, not project's use → vendor per that vendor's testing page, plus this report; stop condition → remaining probes stopped, stop recorded in `Scope`.
129
111
 
130
112
  ### 🔒 Gate 2: Probes Check
131
113
 
132
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
133
-
134
114
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
135
115
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
136
116
  - [ ] **Target:** no probe against production, the release branch, a third-party platform, or a non-synthetic identity.
137
117
  - [ ] **Cleanup:** every identity this run created is deleted; no token value in the report.
138
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
118
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
139
119
 
140
120
  ## Findings
141
121
 
@@ -149,7 +129,7 @@ Verify only when applicable.
149
129
  | `MEDIUM` | A mixed id list is clamped instead of refused; a rate limit or size cap does not fire; markup renders unsanitised on one surface; a public model surface answers an off-topic ask |
150
130
  | `LOW` | Status differs from expected, and the response exposes no data and grants no action |
151
131
 
152
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: cross-tenant first. Break on non-production target keeps severity it would have in production.
132
+ Within a severity: cross-tenant first. Break on non-production target keeps severity it would have in production.
153
133
 
154
134
  <!-- prettier-ignore -->
155
135
  | ID | Severity | Verdict | Location | Evidence | Expected |
@@ -217,17 +197,13 @@ PENDING
217
197
 
218
198
  ### 🔒 Gate 3: Report Check
219
199
 
220
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
221
-
222
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
200
+ - [ ] **No placeholders:** no `PENDING` left
223
201
  - [ ] **Summary:** names count per severity and probe counts (`HELD` / `BROKE` / `INCONCLUSIVE`).
224
202
  - [ ] **Cleanup:** states that every identity this run created is deleted, and where redacted evidence is kept.
225
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
226
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
203
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
204
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
227
205
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
228
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
229
-
230
- > `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.
206
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
231
207
 
232
208
  <!-- bkit:end -->
233
209
 
@@ -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 take a dependency down, inject a fault, or change an alert, monitor, or flag. A game day is a separate exercise; this run only records its date and outcome.
23
15
  > - never run a replay, retry, send, charge, or restore. Read the procedure only.
24
16
 
@@ -32,11 +24,11 @@ Failure paths are least-tested: happy path is tested; vendor outage stays unwalk
32
24
 
33
25
  **Cadence:** quarterly. Extra pass when a new vendor, webhook, or background job lands. Game day in `Degradation` is separate, also quarterly, on its own date; each run records when it last happened.
34
26
 
35
- **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
27
+ **Anchor Standards:**
36
28
 
37
29
  - Google SRE Workbook (online edition): Implementing SLOs, Alerting on SLOs (multi-window, multi-burn-rate), Example error budget policy.
38
30
  - Google SRE Book (online edition): Postmortem Culture.
39
- - AWS Well-Architected Framework, Reliability Pillar: REL05 BP01–BP07 (graceful degradation, throttling, retries, fail fast, client timeouts, stateless, emergency levers), REL11 (static stability), REL13 (disaster recovery). Record the publication date read.
31
+ - AWS Well-Architected Framework, Reliability Pillar: REL05 BP01-BP07 (graceful degradation, throttling, retries, fail fast, client timeouts, stateless, emergency levers), REL11 (static stability), REL13 (disaster recovery). Record the publication date read.
40
32
  - Background-job flow-control docs (e.g. Inngest concurrency and `createFunction`, Temporal task queues).
41
33
  - bkit block of `docs/deployments.md` (bkit version from `.bkit/version`): § Production rollback runbook; § Dev rollback runbook; § Consumer rollback path; § Smoke trigger plumbing; § Applying migrations at deploy time; § Build-vs-migration race; § Promote before the lanes (`bkit-tests-deploy`)
42
34
 
@@ -70,22 +62,14 @@ Failure paths are least-tested: happy path is tested; vendor outage stays unwalk
70
62
 
71
63
  ### Pre-Flight / Dependencies
72
64
 
73
- **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.
74
-
75
- **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.
76
-
77
65
  #### Core
78
66
 
79
- Always verify.
80
-
81
- - [ ] **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.
82
- - [ ] **Code Search:** Steps 2–12, 14, 16 — text search and language server for callers, e.g. ripgrep, Serena, `tsserver`. Language-server hits under-report; empty is inconclusive → corroborate with text search and name the tool. Fallback: text search only; name it per claim.
67
+ - [ ] **Permissions:** blocked calls recorded
68
+ - [ ] **Code Search:** Steps 2-12, 14, 16 — text search and language server for callers, e.g. ripgrep, Serena, `tsserver`. Language-server hits under-report; empty is inconclusive → corroborate with text search and name the tool. Fallback: text search only; name it per claim.
83
69
  - [ ] **Web:** Step 15 — fetch anchor standards. Fallback: versions recorded as unread.
84
70
 
85
71
  #### Conditional
86
72
 
87
- Verify only when applicable.
88
-
89
73
  - [ ] **Metrics:** Hosted traces, errors, or health endpoint → Steps 3, 13 — SLO queries and alert config, e.g. Sentry, Datadog, Better Stack. Fallback: repo config only; live measurements `Not Checked`.
90
74
  - [ ] **Job Platform:** Background jobs → Steps 6, 7 — flow control and replay docs, read-only, e.g. Inngest, Temporal. Log access: `.agents/context.md` `context-fetch` blocks below `bkit:end` are ready-made read-only readers (`bkit context list-blocks` → each block's `context` and `body`); set a body's `# Customise:` knobs to the audit window; run it via `direnv exec . bash`. Fallback: code only; live run history `Not Checked`.
91
75
  - [ ] **Deploy Platform:** Hosted deploys → Step 12 — skew protection, rollout, rollback history, e.g. Vercel API, Cloud Run. Fallback: repo config only; dashboard settings `Not Checked`.
@@ -93,18 +77,16 @@ Verify only when applicable.
93
77
 
94
78
  ### 🔒 Gate 1: Prerequisites Check
95
79
 
96
- **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
97
-
98
80
  - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
99
- - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
81
+ - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
100
82
 
101
83
  ### Probe Steps
102
84
 
103
- - [ ] **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.
85
+ - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
104
86
  - [ ] **Step 2 — Surfaces:** One table, kept run to run for diffs. Outbound calls (every SDK client and every `fetch` host); webhook receivers; background work (job functions and scheduled database jobs); write paths (routes and server actions that change data). Per dependency: hard (journey fails without it) or soft (degrades), and what it depends on in turn. Transitive counts (e.g. auth mail via mail vendor → mail outage is sign-in outage). Surface in code, not docs = finding; doc rewrite → `bkit-audit-documentation`. **Done when:** `Surfaces` lists every surface with hard/soft and transitive deps, or `N/A` and STOP.
105
87
  - [ ] **Step 3 — Journeys:** Every user-reliant journey. Per journey: SLI as good/total ratio, SLO over rolling 28-day window, current measurement with query that produced it. Keep table run to run. No target, or target nobody measures = finding. Error-budget policy: what changes when budget spent (e.g. feature freeze, mandatory postmortem when one incident uses >20% of budget). Record whether policy triggered since previous run and whether obeyed. No policy = finding. **Done when:** `Journeys` row per journey: SLI · SLO · measurement and query · budget triggered · obeyed.
106
88
  - [ ] **Step 4 — Dropped Errors:** Codebase-wide, not only errors that reached a log (`bkit-audit-logs` owns those). `catch` that neither rethrows, returns error, nor logs at `warn` or above; client calls whose error never read (e.g. Supabase `{ error }`, AWS SDK, Prisma); promises without `await` or `.catch`; broad catches turning every failure into one generic message so caller cannot tell timeout from bug. Dropped, never logged = invisible to user and operators; those first. Deliberate best-effort (telemetry, fire-and-forget notification) OK when code says so. Linter-catchable class (e.g. `@typescript-eslint/no-floating-promises`, unread client `error`) → name rule under `Process Improvements`; do not add it. Adding gate → `bkit-audit-gates`. **Done when:** every hit = finding with `file:line`.
107
- - [ ] **Step 5 — Timeouts:** Per outbound call from `Surfaces`. Timeout (`fetch` none by default; SDK may or may not). No timeout holds function open until platform kills it. Each timeout × attempts + backoff fits inside calling function's duration limit; each inner timeout shorter than outer. Function killed at limit reports nothing; platform timeouts → `bkit-audit-logs`; this step owns budget. Bounded retries with backoff on worth-retrying errors (timeouts, 429, 5xx), never 4xx. Retries only on safe ops: retrying create, charge, or send without idempotency key does it twice. Background-job retry setting (e.g. Inngest `retries`) and re-run behavior per step. Model call has fallback model/provider list or degraded path without model. Models listed → `bkit-audit-models`. Token caps and evals → `bkit-audit-llm`. Credit-limit vs rate-limit responses distinct, not one generic retry: credit limit does not succeed on retry unless `Retry-After`; rate limit backs off (e.g. OpenRouter `402` / `429`). Shared outbound client with default timeout/retry → check bypasses; absent → propose under `Process Improvements`. Same wrapper copied → name for `bkit-audit-duplication`. **Done when:** every call from `Surfaces` has timeout, budget, retry, and safety verdict.
89
+ - [ ] **Step 5 — Timeouts:** Per outbound call from `Surfaces`. Timeout (`fetch` none by default; SDK may or may not). No timeout holds function open until platform kills it. Each timeout x attempts + backoff fits inside calling function's duration limit; each inner timeout shorter than outer. Function killed at limit reports nothing; platform timeouts → `bkit-audit-logs`; this step owns budget. Bounded retries with backoff on worth-retrying errors (timeouts, 429, 5xx), never 4xx. Retries only on safe ops: retrying create, charge, or send without idempotency key does it twice. Background-job retry setting (e.g. Inngest `retries`) and re-run behavior per step. Model call has fallback model/provider list or degraded path without model. Models listed → `bkit-audit-models`. Token caps and evals → `bkit-audit-llm`. Credit-limit vs rate-limit responses distinct, not one generic retry: credit limit does not succeed on retry unless `Retry-After`; rate limit backs off (e.g. OpenRouter `402` / `429`). Shared outbound client with default timeout/retry → check bypasses; absent → propose under `Process Improvements`. Same wrapper copied → name for `bkit-audit-duplication`. **Done when:** every call from `Surfaces` has timeout, budget, retry, and safety verdict.
108
90
  - [ ] **Step 6 — Idempotency:** Webhooks at-least-once; job step re-runs after failure. Per receiver/step, second run harmless: dedupe on provider event id, conditional update, or naturally idempotent. Side effects (email, charge, row insert) outside step run again on every retry. Outside caller repeating create → `bkit-audit-security` and `bkit-audit-red-team`; this step reads code. Run failed for good needs written replay/bulk-retry procedure, tried on preview — read only, do not run. Replay creates new runs → repeats side effects this step did not make safe; reaches back only as far as plan history retention. Terminal failure with no replay path = lost work. **Done when:** every receiver and step has verdict; replay path or replacing finding recorded.
109
91
  - [ ] **Step 7 — Races:** Read-modify-write with no lock, conditional update, or unique constraint. Partial writes: two+ mutations outside transaction or stored procedure (e.g. client calls outside RPC). Concurrent jobs on same row/tenant with no concurrency key. Per job function: `concurrency` (key and scope), `throttle`, `rateLimit`, `idempotency`, `retries`, `onFailure` (or platform equivalents). Overlapping cron = finding. No failure handler leaving half-done state on terminal fail = finding. Unbounded work: loops over every tenant/row, queries with no limit (database-side limits → `bkit-audit-database`), fan-out with no cap, payloads with no size limit. Vendor ceilings (pooler client limit, job concurrency cap, mail send rate, model rate limit) vs expected peak product is sized for. Load test proposed under `Process Improvements`, not run. **Done when:** every function's flow-control settings and every unbounded site have verdict.
110
92
  - [ ] **Step 8 — Time:** Product stores/sends user-local times → DST transitions, cron timezone vs user-local send time, recurrence crossing DST, month-end (31st, February). Name test pinning each case; no test = finding. No user-local times → skip with evidence. **Done when:** each case names test, or skip recorded.
@@ -112,19 +94,17 @@ Verify only when applicable.
112
94
  - [ ] **Step 10 — Levers:** Per costly/risky subsystem abusable or runaway (paid model calls, inbound automation, scrapers, outbound fan-out): lever off/down without deploy (flag, kill switch, throttle). Record who pulls, how, last pulled/tested. Code change + redeploy is not a lever. No lever = finding; untried lever = finding. **Done when:** `Levers` row per subsystem: lever · who · how · last tested · verdict.
113
95
  - [ ] **Step 11 — Recovery:** State RPO (data loss) and RTO (time to work again) per data store and per `Journeys` row; compare with setup delivers. Read platform backup docs, do not assume. Restore drill → `bkit-audit-database`; this step owns whether targets written and achievable. DB backups often omit file storage, in-flight jobs, replay history, DNS, developer account access. Per store: recovery path or finding. Per scenario: path and who carries it out — region outage (name region); vendor account suspended or billing lapsed; lost source-host org, deploy team, or sole-account developer; key compromised and revoked. No path = finding. **Done when:** `Recovery` holds RPO, RTO, each scenario path, or replacing finding.
114
96
  - [ ] **Step 12 — Deploys:** Most outages follow a change. Version skew: client loaded pre-deploy keeps reaching server code it was built against where platform offers that. Framework may not pin custom client-side fetches (e.g. `fetch` from Next.js client components); check newer-server handling. Schema/code order: expand first, contract later so either rolls back alone. Rollback speed: last rollback duration or rollback runbook drill. No drill and no measured rollback = finding. Progressive rollout: staged rollout or what stops bad deploy reaching all users; neither = finding. Old native clients cannot roll back. API tolerates oldest supported version; forced-update/minimum-version gate; update channels map to runtime versions. Record oldest version in production traffic and support window. Store-side settings → `bkit-audit-app-store`. **Done when:** each check met, finding, or not applicable (why).
115
- - [ ] **Step 13 — Alerts:** Map each Step 4–9 failure mode to alert (error-tracker, health endpoint, uptime monitors, canaries, data-freshness, dropped-work). No alert = finding; alert with no runbook = finding. Whether alarms fire → `bkit-audit-logs`; this step checks coverage. `Journeys` SLO alert = burn-rate, long and short windows per Workbook, not raw threshold. Near-zero traffic: one failed request can look like outage — minimum request count or synthetic probe behind alert. Each vendor status feed reaches alert channel. **Done when:** `Alerts` maps every failure mode to alert, runbook, sensitivity verdict.
97
+ - [ ] **Step 13 — Alerts:** Map each Step 4-9 failure mode to alert (error-tracker, health endpoint, uptime monitors, canaries, data-freshness, dropped-work). No alert = finding; alert with no runbook = finding. Whether alarms fire → `bkit-audit-logs`; this step checks coverage. `Journeys` SLO alert = burn-rate, long and short windows per Workbook, not raw threshold. Near-zero traffic: one failed request can look like outage — minimum request count or synthetic probe behind alert. Each vendor status feed reaches alert channel. **Done when:** `Alerts` maps every failure mode to alert, runbook, sensitivity verdict.
116
98
  - [ ] **Step 14 — Incidents:** Severity levels, incident lead per incident, who told at each level and how. User comms: status page or in-app banner for outage plus message template. Drill with date. Never rehearsed = finding. Incidents since previous run: each blameless postmortem with owned actions; record closed actions. Gap = finding with proposal; do not file — report is output. **Done when:** `Incidents` states each requirement met or finding.
117
- - [ ] **Step 15 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per REL05 BP01–BP07, REL11, REL13, each SLO and error-budget checklist item → checked (name step) / not applicable (why) / finding. Each row pass / partial / fail with evidence. 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.
99
+ - [ ] **Step 15 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per REL05 BP01-BP07, REL11, REL13, each SLO and error-budget checklist item → checked (name step) / not applicable (why) / finding. Each row pass / partial / fail with evidence. 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.
118
100
  - [ ] **Step 16 — Anything Else:** (a) Everything changed since previous report's commit touching reliability (outbound calls and hosts, webhook receivers, job functions and flow-control, scheduled jobs, write paths, timeouts and duration limits, alerts and monitors) → one-line verdict each. (b) Bounded ~30 min pass: what senior SRE flags that no step asks; read since previous run (incidents and postmortems, log-audit sweeps, new `docs/failures.jsonl` rows, vendor status incidents) — what would no step catch? **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
119
101
 
120
102
  ### 🔒 Gate 2: Probes Check
121
103
 
122
- **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
123
-
124
104
  - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
125
105
  - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
126
106
  - [ ] **Read-only:** no dependency taken down; no replay, send, charge, or restore executed; no alert or monitor changed.
127
- - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
107
+ - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
128
108
 
129
109
  ## Findings
130
110
 
@@ -136,7 +116,7 @@ Verify only when applicable.
136
116
  | `MEDIUM` | Journey with no SLO or no measurement; no error-budget policy; retry on a client error; overlapping scheduled job; unbounded loop or fan-out; alert with no runbook; untested lever; game day more than one quarter overdue; incident process never drilled |
137
117
  | `LOW` | Soft dependency whose failure is unlabelled but the journey still succeeds; wording drift in an alert title |
138
118
 
139
- Scale per `.bkit/jsonl.md` § Severity. Within a severity: money and data first, then a broken core action. A silent write, or a charge or send that can happen twice, is at least `HIGH`. Do not lower either because traffic is low.
119
+ Within a severity: money and data first, then a broken core action. A silent write, or a charge or send that can happen twice, is at least `HIGH`. Do not lower either because traffic is low.
140
120
 
141
121
  <!-- prettier-ignore -->
142
122
  | ID | Severity | Location | Evidence | Expected |
@@ -216,18 +196,14 @@ PENDING
216
196
 
217
197
  ### 🔒 Gate 3: Report Check
218
198
 
219
- **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
220
-
221
- - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
199
+ - [ ] **No placeholders:** no `PENDING` left
222
200
  - [ ] **Summary:** names count per severity, journeys measured, and that every dependency was walked on paper.
223
201
  - [ ] **Series:** every series beside previous report's numbers, or marked baseline.
224
202
  - [ ] **Game Day:** states the date and outcome of the last game day, or that none is recorded, and names the next dependency.
225
- - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
226
- - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
203
+ - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
204
+ - [ ] **Process Improvements:** `Universal` and `Project` filled
227
205
  - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
228
- - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
229
-
230
- > `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.
206
+ - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
231
207
 
232
208
  <!-- bkit:end -->
233
209