@cbartens/bkit 0.0.0-stage → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/.bkit/README.md +417 -0
  2. package/.bkit/core/.agents/context.md +95 -0
  3. package/.bkit/core/.agents/docs.md +62 -0
  4. package/.bkit/core/.agents/rules.md +147 -0
  5. package/.bkit/core/.agents/skills.md +43 -0
  6. package/.bkit/core/.bkit/LICENSE.md +151 -0
  7. package/.bkit/core/.bkit/README.md +417 -0
  8. package/.bkit/core/.bkit/cloud.md +493 -0
  9. package/.bkit/core/.bkit/comparison.md +321 -0
  10. package/.bkit/core/.bkit/install.md +401 -0
  11. package/.bkit/core/.bkit/jsonl.md +497 -0
  12. package/.bkit/core/.bkit/prompts.md +474 -0
  13. package/.bkit/core/.bkit/providers.md +598 -0
  14. package/.bkit/core/.bkit/templates.md +470 -0
  15. package/.bkit/core/.bkit/trackers.md +95 -0
  16. package/.bkit/core/.bkit/workflows.md +1550 -0
  17. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +82 -0
  18. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +93 -0
  19. package/.bkit/core/.claude/hooks/bkit-preflight.sh +74 -0
  20. package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +115 -0
  21. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +135 -0
  22. package/.bkit/core/.cursor/hooks/bkit-gateguard.cjs +111 -0
  23. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +169 -0
  24. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +63 -0
  25. package/.bkit/core/.opencode/plugin/bkit-gateguard.js +225 -0
  26. package/.bkit/core/AGENTS.md +77 -0
  27. package/.bkit/core/LICENSE.md +149 -0
  28. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +272 -0
  29. package/.bkit/core/docs/templates/bkit-audit-adoption.md +223 -0
  30. package/.bkit/core/docs/templates/bkit-audit-agents.md +230 -0
  31. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +227 -0
  32. package/.bkit/core/docs/templates/bkit-audit-analytics.md +266 -0
  33. package/.bkit/core/docs/templates/bkit-audit-annotations.md +230 -0
  34. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +270 -0
  35. package/.bkit/core/docs/templates/bkit-audit-app-store.md +254 -0
  36. package/.bkit/core/docs/templates/bkit-audit-architecture.md +221 -0
  37. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +241 -0
  38. package/.bkit/core/docs/templates/bkit-audit-config.md +230 -0
  39. package/.bkit/core/docs/templates/bkit-audit-cost.md +218 -0
  40. package/.bkit/core/docs/templates/bkit-audit-coverage.md +221 -0
  41. package/.bkit/core/docs/templates/bkit-audit-database.md +229 -0
  42. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +251 -0
  43. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +283 -0
  44. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +268 -0
  45. package/.bkit/core/docs/templates/bkit-audit-documentation.md +280 -0
  46. package/.bkit/core/docs/templates/bkit-audit-duplication.md +253 -0
  47. package/.bkit/core/docs/templates/bkit-audit-failures.md +259 -0
  48. package/.bkit/core/docs/templates/bkit-audit-flakes.md +237 -0
  49. package/.bkit/core/docs/templates/bkit-audit-gates.md +250 -0
  50. package/.bkit/core/docs/templates/bkit-audit-issues.md +273 -0
  51. package/.bkit/core/docs/templates/bkit-audit-llm.md +239 -0
  52. package/.bkit/core/docs/templates/bkit-audit-logs.md +266 -0
  53. package/.bkit/core/docs/templates/bkit-audit-models.md +210 -0
  54. package/.bkit/core/docs/templates/bkit-audit-privacy.md +211 -0
  55. package/.bkit/core/docs/templates/bkit-audit-prompts.md +216 -0
  56. package/.bkit/core/docs/templates/bkit-audit-red-team.md +220 -0
  57. package/.bkit/core/docs/templates/bkit-audit-reliability.md +222 -0
  58. package/.bkit/core/docs/templates/bkit-audit-repo.md +224 -0
  59. package/.bkit/core/docs/templates/bkit-audit-security.md +274 -0
  60. package/.bkit/core/docs/templates/bkit-audit-slop.md +200 -0
  61. package/.bkit/core/docs/templates/bkit-audit-testing.md +270 -0
  62. package/.bkit/core/docs/templates/bkit-audit-usability.md +237 -0
  63. package/.bkit/core/docs/templates/bkit-plan.md +476 -0
  64. package/.bkit/core/engine/checks/after/auth.ts +149 -0
  65. package/.bkit/core/engine/checks/after/ci-yml.ts +701 -0
  66. package/.bkit/core/engine/checks/after/github.ts +424 -0
  67. package/.bkit/core/engine/checks/after/index.ts +530 -0
  68. package/.bkit/core/engine/checks/after/managed.ts +217 -0
  69. package/.bkit/core/engine/checks/after/suppression.ts +53 -0
  70. package/.bkit/core/engine/checks/after/tools.ts +427 -0
  71. package/.bkit/core/engine/checks/before/context-fetch.ts +429 -0
  72. package/.bkit/core/engine/checks/before/env.ts +187 -0
  73. package/.bkit/core/engine/checks/before/files.ts +204 -0
  74. package/.bkit/core/engine/checks/before/index.ts +206 -0
  75. package/.bkit/core/engine/checks/before/mcp.ts +127 -0
  76. package/.bkit/core/engine/checks/before/repo.ts +77 -0
  77. package/.bkit/core/engine/checks/before/version.ts +67 -0
  78. package/.bkit/core/engine/checks/status-holes.ts +479 -0
  79. package/.bkit/core/engine/cli.ts +867 -0
  80. package/.bkit/core/engine/commands/analysis.ts +550 -0
  81. package/.bkit/core/engine/commands/ci/ci.ts +483 -0
  82. package/.bkit/core/engine/commands/comply.ts +415 -0
  83. package/.bkit/core/engine/commands/harvest.ts +459 -0
  84. package/.bkit/core/engine/commands/install/check.ts +70 -0
  85. package/.bkit/core/engine/commands/install/doctor.ts +254 -0
  86. package/.bkit/core/engine/commands/install/install.ts +550 -0
  87. package/.bkit/core/engine/commands/install/uninstall.ts +995 -0
  88. package/.bkit/core/engine/commands/install/upgrade.ts +1037 -0
  89. package/.bkit/core/engine/commands/launch.ts +139 -0
  90. package/.bkit/core/engine/commands/lib.ts +495 -0
  91. package/.bkit/core/engine/commands/registry.ts +53 -0
  92. package/.bkit/core/engine/commands/setup/setup.ts +184 -0
  93. package/.bkit/core/engine/commands/telemetry.ts +32 -0
  94. package/.bkit/core/engine/commands/workflow/branches.ts +1514 -0
  95. package/.bkit/core/engine/commands/workflow/context.ts +961 -0
  96. package/.bkit/core/engine/commands/workflow/counters.ts +268 -0
  97. package/.bkit/core/engine/commands/workflow/fids.ts +243 -0
  98. package/.bkit/core/engine/commands/workflow/issues.ts +675 -0
  99. package/.bkit/core/engine/commands/workflow/ledgers.ts +575 -0
  100. package/.bkit/core/engine/commands/workflow/locks.ts +478 -0
  101. package/.bkit/core/engine/commands/workflow/prs.ts +1087 -0
  102. package/.bkit/core/engine/commands/workflow/repo.ts +220 -0
  103. package/.bkit/core/engine/commands/workflow/roadmap.ts +576 -0
  104. package/.bkit/core/engine/commands/workflow/runs.ts +2140 -0
  105. package/.bkit/core/engine/commands/workflow/runtime.ts +300 -0
  106. package/.bkit/core/engine/commands/workflow/skills.ts +118 -0
  107. package/.bkit/core/engine/commands/workflow/status.ts +455 -0
  108. package/.bkit/core/engine/commands/workflow/steps.ts +1300 -0
  109. package/.bkit/core/engine/commands/workflow/tests.ts +161 -0
  110. package/.bkit/core/engine/commands/workflow/workflows.ts +1573 -0
  111. package/.bkit/core/engine/commands/workflow/workstreams.ts +164 -0
  112. package/.bkit/core/engine/commands/workflow/worktrees.ts +534 -0
  113. package/.bkit/core/engine/install/cloud-env.ts +924 -0
  114. package/.bkit/core/engine/install/managed-block.ts +212 -0
  115. package/.bkit/core/engine/install/manifest.ts +448 -0
  116. package/.bkit/core/engine/install/modules/claude.ts +362 -0
  117. package/.bkit/core/engine/install/modules/cloud.ts +173 -0
  118. package/.bkit/core/engine/install/modules/codex.ts +219 -0
  119. package/.bkit/core/engine/install/modules/core.ts +620 -0
  120. package/.bkit/core/engine/install/modules/cursor.ts +231 -0
  121. package/.bkit/core/engine/install/modules/index.ts +242 -0
  122. package/.bkit/core/engine/install/modules/opencode.ts +573 -0
  123. package/.bkit/core/engine/install/payload-links.ts +150 -0
  124. package/.bkit/core/engine/install/placeholders.ts +108 -0
  125. package/.bkit/core/engine/install/template-copies.ts +119 -0
  126. package/.bkit/core/engine/install/version-file.ts +284 -0
  127. package/.bkit/core/engine/install/write.ts +467 -0
  128. package/.bkit/core/engine/ledgers/clamp-log.ts +32 -0
  129. package/.bkit/core/engine/ledgers/status.ts +213 -0
  130. package/.bkit/core/engine/ledgers/telemetry.ts +1143 -0
  131. package/.bkit/core/engine/render/hosts.ts +372 -0
  132. package/.bkit/core/engine/render/models.ts +323 -0
  133. package/.bkit/core/engine/render/parts.ts +38 -0
  134. package/.bkit/core/engine/render/trackers.ts +170 -0
  135. package/.bkit/core/engine/shared/egress.ts +345 -0
  136. package/.bkit/core/engine/shared/json.ts +16 -0
  137. package/.bkit/core/engine/shared/log-prefix.ts +9 -0
  138. package/.bkit/core/engine/shared/package-json.ts +29 -0
  139. package/.bkit/core/engine/shared/package-manager.ts +38 -0
  140. package/.bkit/core/engine/shared/package-roots.ts +163 -0
  141. package/.bkit/core/engine/shared/protected-paths.ts +164 -0
  142. package/.bkit/core/engine/shared/settings.ts +72 -0
  143. package/.bkit/core/engine/shared/timeouts.ts +20 -0
  144. package/.bkit/core/engine/tools/wording.ts +748 -0
  145. package/.bkit/core/hooks/gateguard-edit-payload.js +18 -0
  146. package/.bkit/core/hooks/gateguard-engine.js +193 -0
  147. package/.bkit/core/hooks/guardrails-shell.js +154 -0
  148. package/.bkit/core/hooks/guardrails-tiers.js +68 -0
  149. package/.bkit/core/hooks/preflight-linear.sh +73 -0
  150. package/.bkit/core/prompts/bkit-audit-generate.md +66 -0
  151. package/.bkit/core/prompts/bkit-build-challenge-1.md +79 -0
  152. package/.bkit/core/prompts/bkit-build-challenge-2.md +81 -0
  153. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +68 -0
  154. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +70 -0
  155. package/.bkit/core/prompts/bkit-build-challenge-tests.md +73 -0
  156. package/.bkit/core/prompts/bkit-build-install-skills.md +67 -0
  157. package/.bkit/core/prompts/bkit-build-plan-current.md +75 -0
  158. package/.bkit/core/prompts/bkit-build-plan-execute.md +72 -0
  159. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +73 -0
  160. package/.bkit/core/prompts/bkit-build-plan-verify.md +88 -0
  161. package/.bkit/core/prompts/bkit-build-summary.md +93 -0
  162. package/.bkit/core/prompts/bkit-debug-abort-handover.md +90 -0
  163. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +151 -0
  164. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +78 -0
  165. package/.bkit/core/prompts/bkit-debug-failure-soak.md +73 -0
  166. package/.bkit/core/prompts/bkit-debug-summary.md +95 -0
  167. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +72 -0
  168. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +72 -0
  169. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +75 -0
  170. package/.bkit/core/prompts/bkit-design-generate.md +110 -0
  171. package/.bkit/core/prompts/bkit-design-organise.md +85 -0
  172. package/.bkit/core/prompts/bkit-design-review-1.md +121 -0
  173. package/.bkit/core/prompts/bkit-design-review-2.md +111 -0
  174. package/.bkit/core/prompts/bkit-design-spike.md +97 -0
  175. package/.bkit/core/prompts/bkit-design-summary.md +106 -0
  176. package/.bkit/core/prompts/bkit-design-update.md +66 -0
  177. package/.bkit/core/prompts/bkit-plan-complexity-check.md +66 -0
  178. package/.bkit/core/prompts/bkit-plan-complexity-split.md +87 -0
  179. package/.bkit/core/prompts/bkit-plan-generate.md +74 -0
  180. package/.bkit/core/prompts/bkit-plan-review-1.md +90 -0
  181. package/.bkit/core/prompts/bkit-plan-review-2.md +80 -0
  182. package/.bkit/core/prompts/bkit-plan-review-3.md +92 -0
  183. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +84 -0
  184. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +84 -0
  185. package/.bkit/core/prompts/bkit-plan-summary.md +106 -0
  186. package/.bkit/core/prompts/bkit-plan-update.md +68 -0
  187. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +90 -0
  188. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +94 -0
  189. package/.bkit/core/prompts/bkit-ship-summary.md +77 -0
  190. package/.bkit/core/prompts/bkit-ship-update-docs.md +71 -0
  191. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +91 -0
  192. package/.bkit/core/prompts/bkit-utility-update-decisions.md +75 -0
  193. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +76 -0
  194. package/.bkit/core/prompts/bkit-utility-update-documentation.md +61 -0
  195. package/.bkit/core/prompts/bkit-utility-update-failures.md +76 -0
  196. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +75 -0
  197. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +82 -0
  198. package/.bkit/core/workflows/bkit-auto.md +121 -0
  199. package/.bkit/core/workflows/bkit-build.md +802 -0
  200. package/.bkit/core/workflows/bkit-debug.md +649 -0
  201. package/.bkit/core/workflows/bkit-design.md +495 -0
  202. package/.bkit/core/workflows/bkit-plan.md +510 -0
  203. package/.bkit/core/workflows/bkit-ship.md +650 -0
  204. package/.bkit/shared/.bkit/.env.example +86 -0
  205. package/.bkit/shared/.claude/bkit-cloud.md +117 -0
  206. package/.bkit/shared/.claude/settings.json +88 -0
  207. package/.bkit/shared/.codex/hooks.json +26 -0
  208. package/.bkit/shared/.cursor/bkit-cloud.md +84 -0
  209. package/.bkit/shared/.cursor/hooks.json +26 -0
  210. package/.bkit/shared/.cursor/mcp.json +15 -0
  211. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +12 -0
  212. package/.bkit/shared/.gitattributes +37 -0
  213. package/.bkit/shared/.mcp.json +16 -0
  214. package/.bkit/shared/.opencode/opencode.json +62 -0
  215. package/.bkit/shared/CLAUDE.md +11 -0
  216. package/.bkit/shared/LICENSE.md +22 -0
  217. package/.bkit/shared/docs/architecture.md +19 -0
  218. package/.bkit/shared/docs/data-schema.md +19 -0
  219. package/.bkit/shared/docs/deployments.md +433 -0
  220. package/.bkit/shared/docs/design.md +39 -0
  221. package/.bkit/shared/docs/noise.md +19 -0
  222. package/.bkit/shared/docs/observability.md +25 -0
  223. package/.bkit/shared/docs/security.md +42 -0
  224. package/.bkit/shared/docs/setup.md +30 -0
  225. package/.bkit/shared/docs/technology.md +18 -0
  226. package/.bkit/shared/docs/testing.md +413 -0
  227. package/.bkit/shared/gitignore +97 -0
  228. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +187 -0
  229. package/.bkit/templates/.cursor/Dockerfile +68 -0
  230. package/.bkit/templates/.cursor/environment.json +6 -0
  231. package/.bkit/templates/.cursor/settings.json +11 -0
  232. package/.bkit/templates/.envrc +7 -0
  233. package/.bkit/templates/.github/dependabot.yml +52 -0
  234. package/.bkit/templates/.github/renovate.json5 +224 -0
  235. package/.bkit/templates/.github/workflows/bkit-ci.yml +1062 -0
  236. package/.bkit/templates/.github/workflows/bkit-cloud.yml +564 -0
  237. package/.bkit/templates/.github/workflows/bkit-renovate.yml +102 -0
  238. package/.bkit/templates/.graphifyignore +108 -0
  239. package/.bkit/templates/.husky/pre-commit +16 -0
  240. package/.bkit/templates/.husky/pre-push +91 -0
  241. package/.bkit/templates/.lintstagedrc.json +3 -0
  242. package/.bkit/templates/.prettierignore +41 -0
  243. package/.bkit/templates/.serena/project.yml +243 -0
  244. package/.bkit/templates/.vale/styles/House/Filler.yml +11 -0
  245. package/.bkit/templates/.vale/styles/House/Hedging.yml +12 -0
  246. package/.bkit/templates/.vale/styles/House/LLMSlop.yml +13 -0
  247. package/.bkit/templates/.vale/styles/House/Verbose.yml +12 -0
  248. package/.bkit/templates/.vale.ini +67 -0
  249. package/.bkit/templates/LICENSE.md +22 -0
  250. package/.bkit/templates/context/bkit-cloudrun.md +84 -0
  251. package/.bkit/templates/context/bkit-expo.md +186 -0
  252. package/.bkit/templates/context/bkit-github.md +79 -0
  253. package/.bkit/templates/context/bkit-inngest.md +45 -0
  254. package/.bkit/templates/context/bkit-maestro.md +76 -0
  255. package/.bkit/templates/context/bkit-playwright.md +62 -0
  256. package/.bkit/templates/context/bkit-resend.md +36 -0
  257. package/.bkit/templates/context/bkit-sentry.md +65 -0
  258. package/.bkit/templates/context/bkit-serena.md +33 -0
  259. package/.bkit/templates/context/bkit-stripe.md +36 -0
  260. package/.bkit/templates/context/bkit-supabase.md +59 -0
  261. package/.bkit/templates/context/bkit-tavily.md +49 -0
  262. package/.bkit/templates/context/bkit-vercel.md +64 -0
  263. package/.bkit/templates/docs/capabilities.md +72 -0
  264. package/.bkit/templates/scripts/ci/accepted-divergences.json +21 -0
  265. package/.bkit/templates/scripts/ci/check-accepted-divergences.mjs +152 -0
  266. package/.bkit/templates/scripts/ci/check-accepted-divergences.test.mjs +130 -0
  267. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +98 -0
  268. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +86 -0
  269. package/.bkit/templates/scripts/graphify/bkit-graph-drift-rules.json +23 -0
  270. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +208 -0
  271. package/.bkit/templates/scripts/graphify/bkit-graph-eager-rules.json +35 -0
  272. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +236 -0
  273. package/.bkit/templates/scripts/graphify/bkit-graph-external-rules.json +17 -0
  274. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +290 -0
  275. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +19 -0
  276. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +120 -0
  277. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +232 -0
  278. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +36 -0
  279. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +927 -0
  280. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +351 -0
  281. package/.bkit/templates/scripts/launchd/ai.bkit.launchd.plist +26 -0
  282. package/.bkit/templates/scripts/launchd/bkit-launchd-env.sh +53 -0
  283. package/.bkit/templates/scripts/launchd/launchd.env.example +13 -0
  284. package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +275 -0
  285. package/.bkit/templates/scripts/secrets/bkit-secrets.config.mjs +66 -0
  286. package/.bkit/templates/scripts/secrets/bkit-secrets.mjs +785 -0
  287. package/.bkit/templates/scripts/serena/bkit-serena-mcp.sh +30 -0
  288. package/.bkit/templates/scripts/serena/bkit-serena.mcp.json +9 -0
  289. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +286 -0
  290. package/.bkit/templates/slop-scan.config.json +120 -0
  291. package/CHANGELOG.md +1503 -0
  292. package/LICENSE.md +161 -0
  293. package/README.md +184 -2
  294. package/dist/checks/after/auth.js +140 -0
  295. package/dist/checks/after/ci-yml.js +681 -0
  296. package/dist/checks/after/github.js +400 -0
  297. package/dist/checks/after/index.js +431 -0
  298. package/dist/checks/after/managed.js +187 -0
  299. package/dist/checks/after/suppression.js +39 -0
  300. package/dist/checks/after/tools.js +351 -0
  301. package/dist/checks/before/context-fetch.js +426 -0
  302. package/dist/checks/before/env.js +163 -0
  303. package/dist/checks/before/files.js +187 -0
  304. package/dist/checks/before/index.js +162 -0
  305. package/dist/checks/before/mcp.js +111 -0
  306. package/dist/checks/before/repo.js +71 -0
  307. package/dist/checks/before/version.js +60 -0
  308. package/dist/checks/status-holes.js +393 -0
  309. package/dist/cli.js +688 -0
  310. package/dist/commands/analysis.js +325 -0
  311. package/dist/commands/ci/ci.js +438 -0
  312. package/dist/commands/comply.js +310 -0
  313. package/dist/commands/harvest.js +354 -0
  314. package/dist/commands/install/check.js +61 -0
  315. package/dist/commands/install/doctor.js +209 -0
  316. package/dist/commands/install/install.js +475 -0
  317. package/dist/commands/install/uninstall.js +839 -0
  318. package/dist/commands/install/upgrade.js +782 -0
  319. package/dist/commands/launch.js +118 -0
  320. package/dist/commands/lib.js +363 -0
  321. package/dist/commands/registry.js +50 -0
  322. package/dist/commands/setup/setup.js +158 -0
  323. package/dist/commands/telemetry.js +29 -0
  324. package/dist/commands/workflow/branches.js +1265 -0
  325. package/dist/commands/workflow/context.js +846 -0
  326. package/dist/commands/workflow/counters.js +227 -0
  327. package/dist/commands/workflow/fids.js +224 -0
  328. package/dist/commands/workflow/issues.js +585 -0
  329. package/dist/commands/workflow/ledgers.js +472 -0
  330. package/dist/commands/workflow/locks.js +364 -0
  331. package/dist/commands/workflow/prs.js +904 -0
  332. package/dist/commands/workflow/repo.js +199 -0
  333. package/dist/commands/workflow/roadmap.js +495 -0
  334. package/dist/commands/workflow/runs.js +1717 -0
  335. package/dist/commands/workflow/runtime.js +257 -0
  336. package/dist/commands/workflow/skills.js +110 -0
  337. package/dist/commands/workflow/status.js +392 -0
  338. package/dist/commands/workflow/steps.js +1093 -0
  339. package/dist/commands/workflow/tests.js +144 -0
  340. package/dist/commands/workflow/workflows.js +1342 -0
  341. package/dist/commands/workflow/workstreams.js +141 -0
  342. package/dist/commands/workflow/worktrees.js +473 -0
  343. package/dist/install/cloud-env.js +818 -0
  344. package/dist/install/managed-block.js +182 -0
  345. package/dist/install/manifest.js +376 -0
  346. package/dist/install/modules/claude.js +288 -0
  347. package/dist/install/modules/cloud.js +151 -0
  348. package/dist/install/modules/codex.js +193 -0
  349. package/dist/install/modules/core.js +531 -0
  350. package/dist/install/modules/cursor.js +186 -0
  351. package/dist/install/modules/index.js +152 -0
  352. package/dist/install/modules/opencode.js +504 -0
  353. package/dist/install/payload-links.js +119 -0
  354. package/dist/install/placeholders.js +87 -0
  355. package/dist/install/template-copies.js +106 -0
  356. package/dist/install/version-file.js +204 -0
  357. package/dist/install/write.js +342 -0
  358. package/dist/ledgers/clamp-log.js +27 -0
  359. package/dist/ledgers/status.js +156 -0
  360. package/dist/ledgers/telemetry.js +637 -0
  361. package/dist/render/hosts.js +339 -0
  362. package/dist/render/models.js +288 -0
  363. package/dist/render/parts.js +33 -0
  364. package/dist/render/trackers.js +135 -0
  365. package/dist/shared/egress.js +299 -0
  366. package/dist/shared/json.js +16 -0
  367. package/dist/shared/log-prefix.js +7 -0
  368. package/dist/shared/package-json.js +22 -0
  369. package/dist/shared/package-manager.js +32 -0
  370. package/dist/shared/package-roots.js +145 -0
  371. package/dist/shared/protected-paths.js +153 -0
  372. package/dist/shared/settings.js +44 -0
  373. package/dist/shared/timeouts.js +19 -0
  374. package/dist/tools/wording.js +680 -0
  375. package/package.json +101 -4
@@ -0,0 +1,216 @@
1
+ <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. `@bkit-audit-generate` fills this template. -->
2
+
3
+ <!-- bkit:start -->
4
+
5
+ {{BKIT_MANAGED_MARKER}}
6
+
7
+ # Prompt Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Each prompt the product sends to a model — clear, well structured, and written for the model that runs it, per that model maker's current prompting guide.
11
+ >
12
+ > **Rules:**
13
+ >
14
+ > - Read-only audit; never edit code, config, or data.
15
+ > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
+ > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
+ > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
+ > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
+ > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
+ > - Every claim cites evidence (`file:line`, or command / query and its output) and tool behind it.
21
+ > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
+ > - Quote at most one line of prompt text per finding; never copy personal data or a model completion into the report.
23
+ > - never call a model to generate. Token counts use a local tokenizer or a provider count endpoint only.
24
+
25
+ ## Universal Instructions
26
+
27
+ ### Context & Goals
28
+
29
+ A prompt is written against one model maker's advice at one point in time. The model behind it changes, the advice changes, and the prompt does not. Rules pile up without reasons, emphasis written for an older model makes a newer one over-apply a rule, the output format drifts from the parser that reads it. Nothing fails a test: the model still answers, a little worse. Target failure: **a prompt that the current guide for the model running it says will degrade results, and nobody re-read it after the model or the guide changed.**
30
+
31
+ **Applies when:** the product sends a prompt to a language model at runtime (system prompt, message template, few-shot examples, tool or output-schema descriptions). Coding-agent instruction files and bkit-managed files are not product prompts. None → one `N/A` row with evidence, never "clean".
32
+
33
+ **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
+
35
+ **Anchor Standards:** record URL, last-updated date or date read, and the model generation each targets. Newer version → `Standards` step reads what changed.
36
+
37
+ - Anthropic prompt engineering docs and the prompting best-practices page for current Claude models.
38
+ - OpenAI prompt engineering guide and the model-specific prompting guide for each model in use (e.g. the cookbook guide per model generation).
39
+ - Google Gemini API prompt design strategies.
40
+ - Every other maker whose model runs a prompt (e.g. xAI, Mistral, Meta, DeepSeek, Qwen): its own prompting guide, or `Not Checked` when it publishes none.
41
+ - Each maker's tool-use and structured-output docs, for tool and schema descriptions.
42
+
43
+ Guides disagree. The guide for the model that runs the prompt wins. A prompt that runs on models from more than one maker (fallback chain, router, several hosts) relies only on practice every one of those guides supports.
44
+
45
+ ### Scope
46
+
47
+ - Every runtime prompt: system prompt, message template, few-shot set, prefill, tool descriptions, output-schema descriptions.
48
+ - Model and guide per prompt.
49
+ - Clarity: task, success, context and reason behind each rule, definitions, contradictions, dead instructions.
50
+ - Structure: sections, delimiters, ordering, examples, output format against its parser.
51
+ - Model fit: emphasis, reasoning and verbosity controls, sampling parameters, prefill, workarounds from an older model.
52
+ - Tool and output-schema descriptions.
53
+ - Token cost, duplication, cache-friendly ordering.
54
+ - Deliberate departures from a guide: recorded once, not re-raised.
55
+
56
+ ### Out of Scope
57
+
58
+ <!-- prettier-ignore -->
59
+ | Excluded item | Why | Where it belongs |
60
+ | --- | --- | --- |
61
+ | Injection boundary, tool capability, output validators, call limits, evals / golden sets | LLM sweep | `bkit-audit-llm` |
62
+ | Model choice, deprecation, catalogue, fallback-chain membership | Model sweep | `bkit-audit-models` |
63
+ | Coding-agent instruction files (e.g. `AGENTS.md`, `CLAUDE.md`, agent definitions, skills): loading, permissions, untrusted input | Agent config sweep | `bkit-audit-agents` |
64
+ | Contradictions between instruction files; always-loaded size | Documentation sweep | `bkit-audit-documentation` |
65
+ | bkit-managed prompts and templates (`.bkit/`, `bkit-*` host agent mirrors, `bkit:start` / `bkit:end` blocks) | Fixed upstream in bkit | bkit's own run of this audit |
66
+ | Live hostile probes | Red team | `bkit-audit-red-team` |
67
+ | Model spend beyond per-call token count | Cost sweep | `bkit-audit-cost` |
68
+ | Rewriting prompts | Audit reports only | Plan from this report |
69
+
70
+ ### Pre-Flight / Dependencies
71
+
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
+ #### Core
75
+
76
+ Always verify.
77
+
78
+ - [ ] **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.
79
+ - [ ] **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.
80
+
81
+ #### Conditional
82
+
83
+ Verify only when applicable.
84
+
85
+ - [ ] **LLM Report:** A `bkit-audit-llm` report exists → Steps 2, 9 — its `Inventory` and `Evals`. Fallback: inventory from code; eval coverage `Not Checked`.
86
+ - [ ] **Token Counter:** Step 8 — local tokenizer or provider count endpoint (no generation). Fallback: character count ÷ 4, labelled estimate.
87
+
88
+ ### 🔒 Gate 1: Prerequisites Check
89
+
90
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
91
+
92
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
93
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
94
+
95
+ ### Probe Steps
96
+
97
+ - [ ] **Step 1 — Previous Run:** Record `git rev-parse HEAD`. Read newest prior report for this slug under `docs/audits/`. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
98
+ - [ ] **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.
99
+ - [ ] **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. 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.
100
+ - [ ] **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); 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.
101
+ - [ ] **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; 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 diff recorded.
102
+ - [ ] **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; 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.
103
+ - [ ] **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.
104
+ - [ ] **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.
105
+ - [ ] **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.
106
+ - [ ] **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.
107
+ - [ ] **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`.
108
+
109
+ ### 🔒 Gate 2: Probes Check
110
+
111
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
112
+
113
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
114
+ - [ ] **Evidence:** every finding cites `file:line`, the guide line it departs from (URL + date read), and the tool behind it.
115
+ - [ ] **No payloads:** at most one line of prompt text per finding; no personal data or model completion.
116
+ - [ ] **Read-only:** no model generation call, no prompt or config changed.
117
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
118
+
119
+ ## Findings
120
+
121
+ <!-- prettier-ignore -->
122
+ | Severity | Use |
123
+ | --- | --- |
124
+ | `CRITICAL` | Output-format instruction contradicts the parser or schema that consumes it on a write path, so following the prompt writes wrong data or drops it |
125
+ | `HIGH` | Model changed and the prompt keeps practice the current guide says degrades results; contradictory instructions in one prompt; output format unstated where code parses it; write tool with no when-to-use or parameter meaning; sampling parameter or prefill the model rejects |
126
+ | `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 |
127
+ | `LOW` | Wording; token waste with no behaviour change; non-write tool description gaps |
128
+
129
+ 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.
130
+
131
+ <!-- prettier-ignore -->
132
+ | ID | Severity | Prompt | Location | Evidence | Expected | Verify |
133
+ | --- | --- | --- | --- | --- | --- | --- |
134
+ | PENDING | PENDING | PENDING | PENDING | PENDING | PENDING | PENDING |
135
+
136
+ Empty and clean → one row `None`. `Verify` = eval that confirms the fix, or `unverified`.
137
+
138
+ ## Report
139
+
140
+ ### Summary
141
+
142
+ PENDING
143
+
144
+ ### Previous Run
145
+
146
+ PENDING
147
+
148
+ ### Inventory
149
+
150
+ PENDING
151
+
152
+ ### Guidance
153
+
154
+ PENDING
155
+
156
+ ### Clarity
157
+
158
+ PENDING
159
+
160
+ ### Structure
161
+
162
+ PENDING
163
+
164
+ ### Model Fit
165
+
166
+ PENDING
167
+
168
+ ### Tools and Schemas
169
+
170
+ PENDING
171
+
172
+ ### Efficiency
173
+
174
+ PENDING
175
+
176
+ ### Deliberate Choices
177
+
178
+ PENDING
179
+
180
+ ### Checked
181
+
182
+ PENDING
183
+
184
+ ### Not Checked
185
+
186
+ PENDING
187
+
188
+ ### Standards Coverage
189
+
190
+ PENDING
191
+
192
+ ### Beyond the Steps
193
+
194
+ PENDING
195
+
196
+ ### Process Improvements
197
+
198
+ PENDING
199
+
200
+ ### 🔒 Gate 3: Report Check
201
+
202
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
203
+
204
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
205
+ - [ ] **Summary:** names count per severity, prompts read, and guide versions read.
206
+ - [ ] **Series:** `Inventory` and `Deliberate Choices` diffed against previous report's, or marked baseline.
207
+ - [ ] **Guides:** every `Model Fit` verdict names the guide and date it was judged against.
208
+ - [ ] **Writes:** only this report and template `Project Instructions` changed.
209
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
210
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
211
+
212
+ > `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.
213
+
214
+ <!-- bkit:end -->
215
+
216
+ ## Project Instructions
@@ -0,0 +1,220 @@
1
+ <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. `@bkit-audit-generate` fills this template. -->
2
+
3
+ <!-- bkit:start -->
4
+
5
+ {{BKIT_MANAGED_MARKER}}
6
+
7
+ # Red Team Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Active adversarial exploitation of a non-production deployment: one hostile request per probe, the request and response kept, then cleaned up.
11
+ >
12
+ > **Rules:**
13
+ >
14
+ > - Read-only audit; never edit code, config, or data.
15
+ > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
+ > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
+ > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
+ > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
+ > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
+ > - Every claim cites evidence (`file:line`, or command / query and its output) and tool behind it.
21
+ > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
+ > - Non-production deployment only. NEVER production, the release branch, or a third party's own platform beyond calls the app already makes.
23
+ > - 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
+ > - never copy a working token or a personal-data value into the report. Record the route, the input shape, and the response.
25
+
26
+ ## Universal Instructions
27
+
28
+ ### Context & Goals
29
+
30
+ Three shapes do not show up in a source read: row-security denial looks like empty result; middleware checks the route file does not show; prompt injection shows only when the model runs. Target failure: **a control that holds in the source and fails on a request** — e.g. mixed tenant-id list clamped to caller's rows, revoked token still accepted, message makes the model delete items it does not mention. Static suspicions from `bkit-audit-security` and `bkit-audit-llm`; this audit sends the request.
31
+
32
+ **Applies when:** non-production deployment can be called, and the system has auth or tenancy. None → one `N/A` row with evidence, never "clean".
33
+
34
+ **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
+
36
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
37
+
38
+ - OWASP Web Security Testing Guide (e.g. WSTG v4.2; record if a newer stable release exists).
39
+ - Penetration Testing Execution Standard (PTES): pre-engagement, intelligence gathering, threat modelling, vulnerability analysis, exploitation, post-exploitation, reporting.
40
+ - When a probe drives a model: OWASP GenAI Red Teaming Guide, OWASP AI Testing Guide, MITRE ATLAS.
41
+ - OWASP Mobile Application Security Testing Guide (MASTG), when the native build is in scope.
42
+
43
+ ### Scope
44
+
45
+ - Written in-list and out-list for this run, and what each platform's testing page allows.
46
+ - Attack-surface diff since the previous report. Everything new gets at least one probe.
47
+ - Retest of every earlier break whose fix has landed.
48
+ - Cross-tenant reads through the app and, separately, through the data API with the client public key.
49
+ - Acting above a role. A removed member trying every way back in.
50
+ - Authentication, session end, off-site redirects.
51
+ - Hostile inbound content: unauthorised writes, leaks, internal fetches, impersonation, caps.
52
+ - Machine-client tool misuse.
53
+ - Injection at render, search, and webhook boundaries. Rate-limit and cost caps, one crossing each.
54
+ - Cleanup of every identity this run created.
55
+
56
+ ### Out of Scope
57
+
58
+ <!-- prettier-ignore -->
59
+ | Excluded item | Why | Where it belongs |
60
+ | --- | --- | --- |
61
+ | Reading a control without sending the request | Static sweep | `bkit-audit-security` |
62
+ | What the model may do, and rules only the prompt enforces | Model sweep | `bkit-audit-llm` |
63
+ | Writing the regression test a held probe lacks | Test sweep | `bkit-audit-testing` |
64
+ | Production, the release branch, third-party platforms, the persistent demo tenant, identities this run did not create | Rules of engagement | — |
65
+ | Load, volume fuzzing, spend past one cap | Can take the target down | — |
66
+ | Applying fixes | Audit reports only | Plan from this report |
67
+
68
+ ### Verdicts
69
+
70
+ One per probe, on the `Probes` row.
71
+
72
+ - **HELD:** control did what it should. Held probe = result, not blank. No test proves it → `bkit-audit-testing`. Not a finding.
73
+ - **BROKE:** control failed = finding. Record blast radius by reasoning, not by pivoting.
74
+ - **INCONCLUSIVE:** blocked, skipped, or no clear answer. Say why. Stays in `Probes` — skipped check reads like passed. `BROKE` without kept response → `INCONCLUSIVE` until a later run reproduces.
75
+ - **FIXED** / **STILL BROKE:** retest of earlier `BROKE` only, with fix commit.
76
+ - **OTHER:** fits none. Say why. Same `OTHER` on 2 runs → propose new verdict in `Process Improvements`.
77
+
78
+ ### Pre-Flight / Dependencies
79
+
80
+ **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.
81
+
82
+ #### Core
83
+
84
+ Always verify.
85
+
86
+ - [ ] **Target:** Steps 2–12 — non-production deployment of this commit, resolved by commit SHA, confirmed serving. Fallback: none. Probes stay `INCONCLUSIVE`. NEVER point them at production.
87
+ - [ ] **Identities:** Steps 2, 5–12, 14 — create and delete synthetic users and tenants, guarded so a non-synthetic identity cannot be deleted. Fallback: none. Do not probe with real accounts.
88
+ - [ ] **Web:** Steps 2, 13 — each platform's penetration-testing page, and anchor standards. Fallback: policy unread → do not send probes; record why.
89
+
90
+ #### Conditional
91
+
92
+ Verify only when applicable.
93
+
94
+ - [ ] **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`.
95
+ - [ ] **Inbound Mail:** The synthetic tenant has an inbound address → Step 10. Fallback: skip; `Not Checked`.
96
+ - [ ] **Machine Client:** A token-gated tool endpoint exists → Steps 2, 11. Fallback: skip with evidence.
97
+ - [ ] **Native Build:** This run includes the native client → Step 8 — cached data and sync on a device or emulator. Fallback: web only; device path `Not Checked`.
98
+ - [ ] **Model Spend:** A probe drives a model → Step 10 — budget for one crossing of one cap. Fallback: do not send the cost probe; `INCONCLUSIVE`.
99
+
100
+ ### 🔒 Gate 1: Prerequisites Check
101
+
102
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
103
+
104
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
105
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
106
+
107
+ ### Probe Steps
108
+
109
+ - [ ] **Step 1 — Previous Run:** Record `git rev-parse HEAD`. Read newest prior report for this slug under `docs/audits/`. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
110
+ - [ ] **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.
111
+ - [ ] **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.
112
+ - [ ] **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`.
113
+ - [ ] **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.
114
+ - [ ] **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.
115
+ - [ ] **Step 7 — Roles:** Inside attacker tenant, low role tries what only higher role may do: invite, remove member, change plan, issue machine-client token, delete record not theirs, delete tenant. Check against role matrix. **Done when:** `Probes` row per operation.
116
+ - [ ] **Step 8 — Removed:** Realistic attacker = former tenant member. Remove attacker's second member, then try every way back: web session, native cached data and sync, machine-client token they issued, invitation links they sent, signed attachment URLs they were given, capability URL (calendar feed or equivalent), mail to tenant address. Expected: every path fails on next request; mail from removed member gets no more trust than stranger. **Done when:** `Probes` row per path.
117
+ - [ ] **Step 9 — Authentication:** Expired token and revoked one. Revoked machine token fails on next call — no grace period unless product records one. Token for plan excluding feature → refused. Cookie-authenticated write with no `Origin`, or foreign one. Redirect parameters pointing off-site. Sign-out-all ends every other session. **Done when:** `Probes` row per case.
118
+ - [ ] **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.
119
+ - [ ] **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.
120
+ - [ ] **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.
121
+ - [ ] **Step 13 — 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. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
122
+ - [ ] **Step 14 — 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 or append ledger: `BROKE` → plan from this report, `docs/failures.jsonl` row to append later, 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`.
123
+
124
+ ### 🔒 Gate 2: Probes Check
125
+
126
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
127
+
128
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
129
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
130
+ - [ ] **Target:** no probe against production, the release branch, a third-party platform, or a non-synthetic identity.
131
+ - [ ] **Cleanup:** every identity this run created is deleted; no token value in the report.
132
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
133
+
134
+ ## Findings
135
+
136
+ `HELD` probe stays in `Probes`. Every `BROKE` is finding, shares probe ID. `Expected` carries WSTG id, CWE, likelihood and impact rationale. Model finding also names OWASP Top 10 for LLM / agentic applications category and MITRE ATLAS technique — vocabulary `bkit-audit-llm` uses.
137
+
138
+ <!-- prettier-ignore -->
139
+ | Severity | Use |
140
+ | --- | --- |
141
+ | `CRITICAL` | Response contains another tenant's data; a revoked credential still performs a privileged action; the model deletes, leaks, or fetches internally on the attacker's instruction |
142
+ | `HIGH` | A role check fails on a real action; an unsigned or wrongly signed webhook is accepted; a removed member can still read or write; a signed URL still works after removal |
143
+ | `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 |
144
+ | `LOW` | Status differs from expected, and the response exposes no data and grants no action |
145
+
146
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: cross-tenant first. Break on non-production target keeps severity it would have in production.
147
+
148
+ <!-- prettier-ignore -->
149
+ | ID | Severity | Verdict | Location | Evidence | Expected |
150
+ | --- | --- | --- | --- | --- | --- |
151
+ | PENDING | PENDING | PENDING | PENDING | PENDING | PENDING |
152
+
153
+ Empty and clean → one row `None`.
154
+
155
+ ## Report
156
+
157
+ ### Summary
158
+
159
+ PENDING
160
+
161
+ ### Previous Run
162
+
163
+ PENDING
164
+
165
+ ### Scope
166
+
167
+ PENDING
168
+
169
+ ### Surface
170
+
171
+ PENDING
172
+
173
+ ### Retests
174
+
175
+ PENDING
176
+
177
+ ### Probes
178
+
179
+ PENDING
180
+
181
+ ### Cleanup
182
+
183
+ PENDING
184
+
185
+ ### Checked
186
+
187
+ PENDING
188
+
189
+ ### Not Checked
190
+
191
+ PENDING
192
+
193
+ ### Standards Coverage
194
+
195
+ PENDING
196
+
197
+ ### Beyond the Steps
198
+
199
+ PENDING
200
+
201
+ ### Process Improvements
202
+
203
+ PENDING
204
+
205
+ ### 🔒 Gate 3: Report Check
206
+
207
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
208
+
209
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
210
+ - [ ] **Summary:** names count per severity and probe counts (`HELD` / `BROKE` / `INCONCLUSIVE`).
211
+ - [ ] **Cleanup:** states that every identity this run created is deleted, and where redacted evidence is kept.
212
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
213
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
214
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
215
+
216
+ > `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.
217
+
218
+ <!-- bkit:end -->
219
+
220
+ ## Project Instructions