@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,254 @@
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
+ # App Store Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Whether iOS and Android apps can ship and stay listed β€” deadlines, privacy declarations, permissions, signing credentials, review readiness, and once live: crashes, ratings, listing.
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
+ > - NEVER submit a build, change a listing, accept an agreement, submit a declaration, or create, rotate, or download a credential.
23
+ > - never copy certificate, key, token, or password material into the report; expiry, holder, and recovery path only.
24
+ > - Every store, deadline, and credential claim names the platform and the account it was read from.
25
+
26
+ ## Universal Instructions
27
+
28
+ ### Context & Goals
29
+
30
+ Stores change rules on their own schedule. New target API, higher upload SDK, privacy manifest, or in-app account deletion arrives with a deadline. Miss one β†’ next release blocked when needed, or listing hidden from new users. Nothing else watches this plane. Native builds on hosted builder (if used) may fail with no error-tracker issue. Review, policy notices, certificate expiry β†’ email to account holder. Target failure: **a release blocked, or a listing hidden, by a deadline, declaration, or credential nobody tracked.**
31
+
32
+ **Applies when:** native app prepared for store or already listed. None β†’ one `N/A` row with evidence, never "clean". Before first submission, readiness steps still run; live-only steps β†’ one `N/A` row with evidence, never "clean". Steps name Apple App Store and Google Play; other stores (e.g. Amazon Appstore, Microsoft Store, Huawei AppGallery) β†’ equivalent policy pages, or `N/A` per step with evidence.
33
+
34
+ **Cadence:** monthly. Extra pass after yearly conference that sets upload minimums (e.g. Apple's June developer conference) and after yearly target-API announcement (e.g. Google Play).
35
+
36
+ **Anchor Standards:** record version and date read. Newer version β†’ `Standards` step reads what changed.
37
+
38
+ - Apple App Review Guidelines. Record last-updated date.
39
+ - Apple upcoming requirements and Apple developer news. Record newest item read.
40
+ - App Store Connect Help: App Privacy, age ratings, Accessibility Nutrition Labels, EU Digital Services Act trader requirements. Record date read.
41
+ - Apple privacy manifest files, including required-reason APIs and list of commonly used SDKs. Record date read.
42
+ - Google Play Developer Program Policy: User Data, Permissions, Families, and Data safety. Record date read and newest policy-update announcement.
43
+ - Play target API level requirement and 16 KB page-size requirement. Record required level and each date.
44
+ - Android vitals. Record core vitals and their thresholds.
45
+ - Native framework and build-service docs (e.g. Expo and EAS). Record SDK version in use and support window.
46
+ - Age-assurance rules as stores apply them (e.g. Apple's Texas SB 2420 update, Google Play Age Signals API). Record jurisdictions in force on run date.
47
+
48
+ ### Scope
49
+
50
+ - Store state, accepted agreements, pending declarations, per platform.
51
+ - Deadlines, and guideline and policy diff since previous run.
52
+ - Store privacy declarations in depth β€” privacy manifest, store privacy labels, data-safety form β€” each matched to `bkit-audit-privacy`'s inventory and privacy policy. This audit does not rebuild that inventory.
53
+ - Permissions, including restricted-permission declarations.
54
+ - Store and push signing credentials: expiry, holder, recovery path.
55
+ - Universal links and App Links against store build.
56
+ - Once live: stability, store vitals, ratings, review prompts, releases, whether listing is true.
57
+ - Listing fields, localisation, screenshots, conversion.
58
+ - Review readiness: demo account, sign-in rules, how digital goods are sold, update-without-review limits, tablet, export compliance, trader status, pre-launch report, accessibility nutrition labels.
59
+ - Age rating and age assurance.
60
+
61
+ ### Out of Scope
62
+
63
+ <!-- prettier-ignore -->
64
+ | Excluded item | Why | Where it belongs |
65
+ | --- | --- | --- |
66
+ | What the app collects; privacy-policy wording; how a child is known | Privacy sweep owns the inventory; declarations here match it | `bkit-audit-privacy` |
67
+ | SDK or library upgrade a deadline forces | Dependency sweep | `bkit-audit-dependencies` |
68
+ | Crash and ANR clusters as log triage | Logs sweep; the rates stay here | `bkit-audit-logs` |
69
+ | Native accessibility beyond the nutrition-label comparison | Accessibility sweep | `bkit-audit-accessibility` |
70
+ | Expiry of credentials that are not store or push credentials | Config sweep | `bkit-audit-config` |
71
+ | Who should hold store access | Security sweep; the recovery path stays here | `bkit-audit-security` |
72
+ | Slow starts, hangs, wake locks, or battery drain as performance work | Performance sweep; the vital stays here | `bkit-audit-app-performance` |
73
+ | How the app works, from review themes | Usability sweep; the theme list stays here | `bkit-audit-usability` |
74
+ | Association-file hosting and DNS where the store build still matches | Config sweep | `bkit-audit-config` |
75
+ | Submitting a build, changing a listing, or touching a credential | Audit reports only | Plan from this report |
76
+
77
+ ### Pre-Flight / Dependencies
78
+
79
+ **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.
80
+
81
+ #### Core
82
+
83
+ Always verify.
84
+
85
+ - [ ] **Build Config:** Steps 2–6, 10 β€” app config and build profiles in repo, e.g. `app.json`, `eas.json`, `project.pbxproj`. Fallback: none; missing config = finding.
86
+ - [ ] **Web:** Step 12 β€” fetch anchor standards and deadline pages. Fallback: versions and dates recorded as unread.
87
+
88
+ #### Conditional
89
+
90
+ Verify only when applicable.
91
+
92
+ - [ ] **Build Service:** Hosted native builds β†’ Steps 2, 3, 6 β€” version and build number from service, not local config; last built artifact for native-library alignment, e.g. `eas build:list`, `eas build:view`. Fallback: local config only; remote version = hypothesis.
93
+ - [ ] **Store Consoles:** Store accounts exist β†’ Steps 2, 4, 8, 9, 11 β€” policy status, app content, agreements, listings, e.g. App Store Connect, Play Console. Fallback: repo only; store state `Not Checked`.
94
+ - [ ] **Credential Metadata:** Signing material exists β†’ Step 6 β€” expiry and holder from build service or console, never the material, e.g. `eas credentials`. Fallback: `Not Checked`.
95
+ - [ ] **Devices:** Deep links or binary to open β†’ Step 7 β€” device or emulator with app installed and one without. Fallback: file and config only; opening `Not Checked`.
96
+ - [ ] **Vitals:** App is live β†’ Step 8 β€” store vitals and error tracker, e.g. Play vitals, Xcode Organizer, Sentry, Crashlytics. Fallback: `Not Checked`.
97
+
98
+ ### πŸ”’ Gate 1: Prerequisites Check
99
+
100
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
101
+
102
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
103
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
104
+
105
+ ### Probe Steps
106
+
107
+ - [ ] **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.
108
+ - [ ] **Step 2 β€” Store State:** Per platform: version Β· build from build service when config keeps version remotely, not local app config; store state (not submitted, in review, live); readable accounts. Read Android policy-status and app-content pages, iOS agreements page. Unaccepted updated agreement or pending declaration blocks uploads = finding β†’ account holder, with page. **Done when:** `Store State` table per platform: version Β· build Β· target SDK Β· store state Β· accounts read Β· nearest deadline (filled in `Deadlines`).
109
+ - [ ] **Step 3 β€” Deadlines:** Confirm each date on current store page; page wins if it differs. (a) Target API level and date vs app target SDK from last built Android bundle, not config only. (b) Memory page size: date and target API the requirement names (e.g. updates targeting that API cannot ship unless native libraries support 16 KB pages). Check `.so` alignment in last built bundle, not config. Any app shipping native code in scope. (c) Upload minimum SDK and toolchain vs build image. (d) Native framework SDK support window. (e) Store policy announced since previous run. (f) Guideline and policy diff since previous report's date, tested against app, not deadline-only. Due within 90 days = finding. Due within 30 days = at least `HIGH`. Upgrade fix β†’ `bkit-audit-dependencies`. **Done when:** `Deadlines` row per item: requirement Β· date Β· app value Β· verdict.
110
+ - [ ] **Step 4 β€” Declarations:** Match each declaration to `bkit-audit-privacy`'s inventory and privacy policy. Do not rebuild the inventory. (a) iOS privacy manifest β€” required-reason APIs for app and every third-party SDK β€” and store privacy labels. (b) Each SDK on vendor's commonly-used list ships own privacy manifest and signature; tracking-domain list names any tracking domain the app contacts. (c) Android data-safety form. (d) Third-party AI: review guideline requiring disclosure where personal data is shared with third parties, including third-party AI, and explicit permission before sharing (e.g. App Review Guideline 5.1.2(i)). In-app consent screen, stored consent flag gating each call, withdraw path, and privacy label describe same flow. Gap β†’ `bkit-audit-privacy`, and plan item for consent screen. (e) Both stores require account deletion started inside the app, not only on the web. The Android form also requires a working web link, entered on the data-safety form, that names the app or developer and lets someone request deletion without reinstalling. Deleting an account revokes Sign in with Apple tokens through the revoke endpoint, and the server handles the server-to-server notifications for revoked consent and deleted accounts (e.g. Apple technote TN3194), when that provider exists. (f) Advertising-id and tracking answers match what `bkit-audit-analytics` found the app collects. Declaration mismatch = at least `HIGH` β†’ `bkit-audit-privacy`. **Done when:** `Declarations` row per label, manifest entry, and form answer: declared Β· inventory Β· verdict.
111
+ - [ ] **Step 5 β€” Permissions:** Each requested permission (e.g. camera, photos, location, contacts, notifications) has true purpose string and feature using it. Leftover permission from removed feature = finding β€” reviewers reject for it. Android: restricted permissions vs store policy. Photos/videos via system photo picker unless broad media access is core; broad media needs approved console declaration. Exact-alarm only for alarms/timers/calendar core apps; others β†’ schedule-exact with user consent. Full-screen intent default only alarm/calling apps; others need user consent and console declaration. Post-notifications at runtime when notification makes sense, not first launch. Unused permission β†’ plan from this report. **Done when:** `Permissions` row per permission: purpose string Β· feature Β· verdict.
112
+ - [ ] **Step 6 β€” Credentials:** iOS distribution certificate and provisioning profiles, push key, Android upload key and store app signing, build-service credentials, developer-program membership: each expiry, holder, recovery if holder leaves. Lost upload key with no store app signing β†’ app never updatable = `CRITICAL` until shown otherwise. Include push-messaging service-account credential for current HTTP API; legacy server keys must be unused. Record expiry, holder, recovery path only. Who should hold access β†’ `bkit-audit-security`. Other expiry β†’ `bkit-audit-config`. No owner or no recovery path = at least `HIGH`. **Done when:** `Credentials` row per item: expiry Β· holder Β· recovery Β· verdict.
113
+ - [ ] **Step 7 β€” Links:** Native app with invite/deep links β†’ association files on web domain over HTTPS, no redirect, cover invite/join/email deep-link paths, match shipped apps: iOS team and bundle id; Android SHA-256 fingerprints including store signing key's, not upload key only. Open invite link on device with app and without. Hosting/DNS drift where store build still matches β†’ `bkit-audit-config`. File mismatch vs store build = finding β†’ plan from this report. **Done when:** `Links` row per file and per device case.
114
+ - [ ] **Step 8 β€” Live:** Not listed β†’ `N/A` in `Live`, never "clean"; skip rest. (a) Crash-free sessions; Android ANR rate β€” store vitals, Xcode Organizer, error tracker. Compare crash/ANR vs overall and per-device bad-behaviour thresholds, not overall only. Cluster β†’ `bkit-audit-logs`. (b) Android vitals beyond crashes: excessive partial wake locks (core vital; record vitals-page date) and slow cold/warm starts. (c) Xcode Organizer beyond crashes: hang rate, launch time, memory, disk writes, battery, per version. Slow starts, hangs, wake locks, battery β†’ `bkit-audit-app-performance`. (d) Rating and change since previous run; recent review themes. How-app-works themes β†’ `bkit-audit-usability`. (e) Review prompts via store review API only β€” never incentivised or gated. Replies vs owner response-rate target. (f) Rejections since previous run and reasons. (g) Production: phased release and staged rollout, halt rule tied to crash-free sessions; external test tracks active. (h) Screenshots current, description true, support and privacy URLs work. Out-of-date listing β†’ owner, with screen or text. **Done when:** `Live` holds rates, rating, each verdict, or `N/A`.
115
+ - [ ] **Step 9 β€” Listing:** Pre-submission β†’ draft listing; live β†’ published. Title, subtitle, keyword field, short/full description: within store field limits, search-oriented words. Localised listings for shipped locales. Screenshot sets per required device size; tablet if supported. Live: conversion funnel (impressions, product-page views, installs) from both stores' acquisition reports, change since previous run. Record listing experiments; propose one quarterly test (screenshots or icon) to owner. **Done when:** `Listing` row per field and locale: within limits Β· true Β· verdict.
116
+ - [ ] **Step 10 β€” Readiness:** (a) Working demo account for reviewers, not seeded owner. (b) Sign in with Apple if any other third-party sign-in on iOS. (c) How digital subscriptions sold in-app. External processor vs in-app purchase limited by store/country rules β€” owner decision in `docs/decisions.jsonl`; match record to app behaviour. (d) Out-of-app purchase links vs same rules. (e) Subscription disclosures: terms, price, renewal before purchase; manage/cancel path; restore purchases if IAP used. External-processor-only subscriptions β†’ account deletion explains cancellation. (f) App ships over-the-air updates (e.g. Expo Updates, CodePush) β†’ script and assets only β€” never change primary purpose or skip-review feature. Runtime-version policy prevents incompatible binary landing. Breach β†’ plan from this report. None β†’ `N/A`. (g) Tablet supported β†’ layouts work on tablet for review; else flag false on purpose. (h) Export-compliance flag set so uploads not held. (i) Trader status on both stores β€” undeclared apps removed from EU storefronts. (j) Current closed-test rule for personal developer account (e.g. account created after 2023-11-13 needs closed test with β‰₯12 testers opted in 14 consecutive days before production). Identity verification and package-name registration; record store-page date for unregistered package removal (e.g. 2026-09-30). (k) Pre-launch report for latest build: crashes, accessibility, security warnings; failed devices/OS versions. (l) Accessibility nutrition labels: store declaration vs vendor criteria per feature (every common task completable). Voluntary until store requires. Evidence β†’ `bkit-audit-accessibility`. Unused permission, missing deletion path, review-rule gap β†’ plan from this report. **Done when:** `Readiness` row per item: met / finding / not applicable.
117
+ - [ ] **Step 11 β€” Age:** Both stores' age-rating questionnaires answered; re-answer when features change (messaging, UGC, AI chat, unrestricted web). Record store due date for new questions (e.g. Apple added bands due 2026-01-31 to keep submitting updates); unanswered past date = finding. Age assurance: owner decision in `docs/decisions.jsonl` when product holds children's data. Read both stores' jurisdiction lists (e.g. Texas SB 2420 for new Texas accounts from 2026-06-04 via declared-age-range API, significant-change API, server notification for revoked parental consent; Play age-signals API for eligible accounts). How child is known and consent given β†’ `bkit-audit-privacy`. Target-audience declaration accurate; Play Families applicability recorded. Age-rating or age-assurance gap β†’ owner; child safety β†’ `bkit-audit-privacy`. **Done when:** `Age` row per questionnaire and jurisdiction: answered Β· matches the app Β· verdict.
118
+ - [ ] **Step 12 β€” Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per App Review Guidelines section and per Play policy area (User Data, Permissions, Families, Data safety, and the rest) β†’ checked (name step) / not applicable (why) / finding. Unapplied recommended practice β†’ adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
119
+ - [ ] **Step 13 β€” Anything Else:** (a) All changes since previous report's commit touching native apps and listings (app config, build profiles, native permissions and config plugins, privacy manifest, entitlements, native SDK versions, store listing text, subscription and purchase flows, account deletion, over-the-air channels) β†’ one-line verdict each. (b) Bounded ~30 min pass: senior mobile release manager flags no step asks; read since previous run (incidents, `bkit-audit-logs` reports, new `docs/failures.jsonl` rows, vendor status incidents) β€” what would no step catch? **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs β†’ propose step in `Process Improvements`.
120
+
121
+ ### πŸ”’ Gate 2: Probes Check
122
+
123
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
124
+
125
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
126
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
127
+ - [ ] **Consoles untouched:** no build submitted, no listing or declaration edited, no agreement accepted, no credential created, rotated, or downloaded.
128
+ - [ ] **No secrets:** report contains no certificate, key, token, or password material.
129
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
130
+
131
+ ## Findings
132
+
133
+ <!-- prettier-ignore -->
134
+ | Severity | Use |
135
+ | --- | --- |
136
+ | `CRITICAL` | Upload key lost and no store app signing, so the app can never be updated; a deadline already passed so no update can ship |
137
+ | `HIGH` | Deadline within 30 days; privacy declaration does not match the app or the privacy inventory; credential with no recovery path; personal data sent to a third-party AI without explicit in-app permission |
138
+ | `MEDIUM` | Unused permission; association file does not match the store build; over-the-air update can change reviewed behaviour; age questionnaire stale; listing out of date; agreement unaccepted |
139
+ | `LOW` | Listing wording within limits that does not use search words; nutrition-label gap while the labels are still voluntary; no listing experiment proposed |
140
+
141
+ Scale per `.bkit/jsonl.md` Β§ Severity. Within a severity: blocked release and credentials first, then declarations. A deadline within 30 days, a privacy declaration that does not match the app, a credential with no recovery path, and personal data sent to a third-party AI without explicit in-app permission are each at least `HIGH`. `Expected` names where it goes.
142
+
143
+ <!-- prettier-ignore -->
144
+ | Finding | Goes to |
145
+ | --- | --- |
146
+ | A deadline that needs an SDK or library upgrade | `bkit-audit-dependencies` |
147
+ | A declaration that does not match what the app collects | `bkit-audit-privacy` |
148
+ | Personal data sent to a third-party AI without in-app disclosure and permission | `bkit-audit-privacy`, and a plan item for the consent screen |
149
+ | A credential with no owner or no recovery path | `bkit-audit-security` |
150
+ | A crash or ANR cluster | `bkit-audit-logs` |
151
+ | Slow starts, hangs, wake locks, or battery drain | `bkit-audit-app-performance` |
152
+ | Review themes about how the app works | `bkit-audit-usability` |
153
+ | Native accessibility | `bkit-audit-accessibility` |
154
+ | An unused permission, a missing deletion path, or a review-rule gap | Plan from this report |
155
+ | A universal link or App Link that does not match a store build | Plan from this report |
156
+ | An over-the-air update that changes reviewed behaviour, or a runtime-version gap | Plan from this report |
157
+ | The in-app subscription decision | The owner, recorded in `docs/decisions.jsonl` |
158
+ | An age-rating answer or age-assurance gap | The owner, recorded in `docs/decisions.jsonl`; child safety β†’ `bkit-audit-privacy` |
159
+ | An unaccepted agreement or a pending store declaration | The account holder, with the page |
160
+ | A listing that is out of date | The owner, with the screen or text to change |
161
+
162
+ <!-- prettier-ignore -->
163
+ | ID | Severity | Location | Evidence | Expected |
164
+ | --- | --- | --- | --- | --- |
165
+ | PENDING | PENDING | PENDING | PENDING | PENDING |
166
+
167
+ Empty and clean β†’ one row `None`.
168
+
169
+ ## Report
170
+
171
+ ### Summary
172
+
173
+ PENDING
174
+
175
+ ### Previous Run
176
+
177
+ PENDING
178
+
179
+ ### Store State
180
+
181
+ PENDING
182
+
183
+ ### Deadlines
184
+
185
+ PENDING
186
+
187
+ ### Declarations
188
+
189
+ PENDING
190
+
191
+ ### Permissions
192
+
193
+ PENDING
194
+
195
+ ### Credentials
196
+
197
+ PENDING
198
+
199
+ ### Links
200
+
201
+ PENDING
202
+
203
+ ### Live
204
+
205
+ PENDING
206
+
207
+ ### Listing
208
+
209
+ PENDING
210
+
211
+ ### Readiness
212
+
213
+ PENDING
214
+
215
+ ### Age
216
+
217
+ PENDING
218
+
219
+ ### Checked
220
+
221
+ PENDING
222
+
223
+ ### Not Checked
224
+
225
+ PENDING
226
+
227
+ ### Standards Coverage
228
+
229
+ PENDING
230
+
231
+ ### Beyond the Steps
232
+
233
+ PENDING
234
+
235
+ ### Process Improvements
236
+
237
+ PENDING
238
+
239
+ ### πŸ”’ Gate 3: Report Check
240
+
241
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
242
+
243
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
244
+ - [ ] **Summary:** names count per severity, and per platform the store state and nearest deadline.
245
+ - [ ] **Series:** ratings and the listing conversion funnel beside previous report's, or marked baseline / not live.
246
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
247
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
248
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
249
+
250
+ > `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.
251
+
252
+ <!-- bkit:end -->
253
+
254
+ ## Project Instructions
@@ -0,0 +1,221 @@
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
+ # Architecture Review
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Judgment on codebase shape β€” package graph, intended layers, server, and client boundary, and coupling the import graph cannot see.
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
+ > - A code graph confirms presence; a missing edge proves nothing. Corroborate every load-bearing claim with a language server or text search before it is a finding.
23
+ > - Build the graph locally and code-only; NEVER send the corpus or credentials to a model backend.
24
+
25
+ ## Universal Instructions
26
+
27
+ ### Context & Goals
28
+
29
+ File reading cannot answer acyclic package graph, hub modules, or copied types. Code graph + language server fail differently: graph edges may be false; omitted edges prove nothing. Target failure: **shape enforced in a diagram or clean graph but not in source** β€” type-only cycle treated as runtime, manifest edge as package dependency, privileged module reachable from client bundle.
30
+
31
+ **Applies when:** more than one package, or a written layer model. None β†’ one `N/A` row with evidence, never "clean".
32
+
33
+ **Cadence:** quarterly. Extra pass when a cycle adds a package, moves a module, or changes path aliases or project references. Production-checklist walk = part of quarterly pass.
34
+
35
+ **Anchor Standards:** record version and date read. Newer version β†’ `Standards` step reads what changed.
36
+
37
+ - C4 model (System Context, Container, Component).
38
+ - Architecture decision records (e.g. adr.github.io) and architectural fitness functions (e.g. _Building Evolutionary Architectures_).
39
+ - Product quality model, nine characteristics (e.g. ISO/IEC 25010:2023).
40
+ - Quality-attribute scenarios (e.g. ATAM utility tree).
41
+ - Package metrics: afferent coupling (Ca), efferent coupling (Ce), instability, abstractness, Stable Dependencies Principle (e.g. Robert C. Martin).
42
+ - Compiler-resolving dependency linter (e.g. dependency-cruiser, import-linter); record version.
43
+ - Workspace boundary checker (e.g. `turbo boundaries`, Nx module boundaries); record version.
44
+ - Layer-boundary linter (e.g. eslint-plugin-boundaries, ArchUnit).
45
+ - Well-architected pillars as a lens (e.g. AWS Well-Architected, Azure Well-Architected).
46
+ - Server and client component boundary, including a build-failing server-only guard (e.g. Next.js Server and Client Components, `server-only`).
47
+ - Host production checklists (e.g. Vercel, Supabase, Fly).
48
+
49
+ ### Scope
50
+
51
+ - Package dependency graph: cycles, back-edges, coupling metrics, fan-in, fan-out, duplicate symbols.
52
+ - Conformance to a written layer matrix, public entry points, and deep imports.
53
+ - Server and client boundary, and privileged modules.
54
+ - Coupling with no import edge: events, data ownership, change coupling.
55
+ - Shape against recorded decisions, context, and container views, and quality-attribute scenarios.
56
+ - Production-checklist gaps, routed to the audit that owns each.
57
+
58
+ ### Out of Scope
59
+
60
+ <!-- prettier-ignore -->
61
+ | Excluded item | Why | Where it belongs |
62
+ | --- | --- | --- |
63
+ | Whether a symbol is reachable | Reachability, not shape | `bkit-audit-dead-code` |
64
+ | Confirmed same-name copies, once named | Duplication sweep | `bkit-audit-duplication` |
65
+ | Auth holes and secret exposure in depth | Security sweep | `bkit-audit-security` |
66
+ | A table written from several places, in depth | Database sweep | `bkit-audit-database` |
67
+ | Cold-start time and request latency | Hot paths | `bkit-audit-app-performance` |
68
+ | Job retries and idempotency in depth | Reliability sweep | `bkit-audit-reliability` |
69
+ | Changing packages, layers, or the graph | Audit reports only | Plan from this report |
70
+
71
+ ### Pre-Flight / Dependencies
72
+
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
+ #### Core
76
+
77
+ Always verify.
78
+
79
+ - [ ] **Code Graph:** Steps 2–4 β€” local code-only extractor, e.g. graphify via a wrapper that strips API keys. Fallback: dependency linter and text search; graph counts `Not Checked`.
80
+ - [ ] **Dependency Linter:** Steps 5–6 β€” resolves through the compiler, e.g. dependency-cruiser, import-linter. Fallback: read import statements; say so per claim.
81
+ - [ ] **Git History:** Steps 1, 9, 13 β€” change coupling and the diff since the previous report. Fallback: change coupling `Not Checked`.
82
+ - [ ] **Web:** Step 12 β€” fetch anchor standards. Fallback: versions recorded as unread.
83
+
84
+ #### Conditional
85
+
86
+ Verify only when applicable.
87
+
88
+ - [ ] **Language Server:** Typed language β†’ Steps 7, 11 β€” references, e.g. Serena, `tsserver`, gopls. Fallback: text search; name it per claim. Repeat any surprising low count.
89
+ - [ ] **Workspace Boundaries:** Monorepo task runner with a boundaries command β†’ Step 5 β€” e.g. `turbo boundaries`, Nx. Fallback: layer matrix by hand.
90
+ - [ ] **Host Checklists:** Managed host β†’ Step 10 β€” production checklist, e.g. vendor docs, dashboard. Fallback: docs only; live settings `Not Checked`.
91
+
92
+ ### πŸ”’ Gate 1: Prerequisites Check
93
+
94
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
95
+
96
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
97
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
98
+
99
+ ### Probe Steps
100
+
101
+ - [ ] **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.
102
+ - [ ] **Step 2 β€” Graph:** Build locally, code-only, credentials stripped, via project wrapper (never bare extract). Record tool version, `built_at_commit`, node count, edge count, cross-package edge count. Graph commit β‰  reviewed `HEAD` β†’ findings invalid; rebuild. Derived output untracked; clean rebuild deletes only that output. After path-alias change β†’ clean rebuild β€” force flag that does not clear module-resolution cache keeps stale unresolved edges. Syntax-only graph (e.g. tree-sitter) does not consult language server: path aliases and manifest names are separate inputs; losing either drops edges with no error. Keep manifests in corpus so workspace imports resolve β†’ drop manifest-to-manifest edges before matrix. Skip whole-repo render; use package and module rollups. Dated extractor backups (if the tool keeps them) accumulate; clean rebuild clears them. **Done when:** commit, counts, tool list in `Graph`, or absent tool in `Not Checked`.
103
+ - [ ] **Step 3 β€” Report:** Read extractor report. Every finding-like section checked against source before it counts. Import cycles: type-only edges erased at compile time β‰  runtime cycle β€” check every edge. Cross-package edges: do not dismiss as impossible once aliases resolve; do dismiss manifest-to-manifest. God nodes: high degree = look, not defect. Community dump with numbered labels and near-zero cohesion β†’ clustering found no structure β€” skip. **Done when:** each section dispositioned in `Graph`.
104
+ - [ ] **Step 4 β€” Structure:** Query built graph, then graph file. Filters first: code only (source extensions; drop manifests and config); tests separated with repo's one test-path rule β€” do not type a shorter list. Test files cross boundaries; counting them as product hides shape. Views with/without test code can both be correct β€” record which. Dependency-shaped edges only (import, re-export, dynamic import). Nesting β‰  dependency. Name-matching edges (e.g. `indirect_call`) can invent links between unrelated files sharing a function name β€” exclude. Blast-radius under-reports: missed callers in anonymous callbacks, calls in module-level initialisers. Blast-radius set = starting set, never complete. Checks (each a series): (1) package dependency matrix, code-only, back-edges (libraryβ†’app, leafβ†’consumer) β€” should be DAG; per workspace Ca, Ce, instability I = Ce/(Ca+Ce), abstractness (share of exported types and interfaces); flag package depending on less stable one. (2) File-level cycles (SCC over import edges); component >1 file = candidate β†’ type-only check. (3) Fan-in: files everything imports. (4) Fan-out: most imports β€” barrels and god modules. (5) Duplicate symbol names: group callables by label across distinct non-test source files; β‰₯3 definitions = prompt. False positives: per-directory handlers, platform splits (e.g. `.native` / `.web`). Signal = type/component duplicated where canonical exists. Same grouping over test code alone. Copies without shared name β†’ text search. Confirmed hits β†’ `bkit-audit-duplication`. **Done when:** matrix, cycles, rankings, duplicates in `Structure`.
105
+ - [ ] **Step 5 β€” Layers:** Back-edge hunt with no written model lets legal wrong dependency pass. Carry allowed package-layer matrix from previous report. No matrix β†’ draft from recorded architecture decisions, mark proposed. Diff code-only matrix; every disallowed edge = candidate. Encode matrix as forbidden rules for compiler-resolving linter, config under repo-root `tmp/` only, type-only edges excluded; check extractor import cycles. Clean rule = fitness function to propose under `Process Improvements`. Run workspace boundary checker; record version; clean result = candidate for package-DAG gate, not proof. Native/restricted app: every package it imports transitively has no server-only or host-only module (e.g. `fs`, server-only import, service-role client) β€” forbidden rule so bundle break or client secret caught by structure. Public entry points: every workspace package declares them where the ecosystem supports it (e.g. Node `exports` map, Go `internal/`); deep imports past them = candidates. Name enforcing rule each would need. **Done when:** every disallowed edge in `Layers`, with rule that would forbid it.
106
+ - [ ] **Step 6 β€” Boundary:** List modules importing privileged data client, service-role secret, or non-public secret; confirm each imports guard that turns client import into build error (e.g. `server-only`), where the stack has one; none β†’ reach check alone, say so. Confirm no client-entry module reaches one transitively β€” client entry pulls imports into client bundle. Text search β†’ list; linter or blast-radius β†’ reach; `Cross-Check` confirms. **Done when:** every privileged module in `Boundary` with guard, reach, verdict.
107
+ - [ ] **Step 7 β€” Cross-Check:** Language server answers from disk β€” no mid-edit staleness; resolves what tree-sitter graph cannot. Graph misses anonymous-callback callers; language server misses what project graph cannot reach. Confirm fan-in and blast-radius with references before write-up. Pace reference queries β€” back-to-back calls can return partial count indistinguishable from real; repeat surprising low count after pause. Empty = inconclusive. Blind spots neither tool sees: middleware guards, config-referenced files, runtime-registered handlers, mock-factory keys, packages outside language-server project graph. Text search for non-source files, string literals, unknown names. **Done when:** every load-bearing claim in `Cross-Check` names both tools, or the blind spot.
108
+ - [ ] **Step 8 β€” References:** Pick 2–3 well-regarded OSS repos on same stack; compare shape: package boundaries, shared code location, config/env split, client code sharing. Record repo name, commit/tag, comparison. Difference = soft signal, not finding alone: report only with problem it would solve here, low-confidence, never rank above graph finding. **Done when:** repos, revisions, comparisons in `References`, or `none`.
109
+ - [ ] **Step 9 β€” Coupling:** Three couplings carry no import edge. Events/runtime wiring: every event sent vs handler registered, plus schedules, DB triggers, outbound DB HTTP, edge functions, inbound webhooks. Flag producer without consumer, consumer without producer, two packages coupled only via event. Data ownership: table and routine call sites per package and app. Flag table written from >1 module/app; table written via privileged client from >1 place. Change coupling: file pairs in commits since previous report, different packages or clients, co-change in >half commits with no import edge. Confirmed pairs β†’ `bkit-audit-duplication`. **Done when:** events, tables, pairs in `Coupling`.
110
+ - [ ] **Step 10 β€” Judgment:** Four criteria. Decisions vs code: every architecture-scoped decision still honoured + what enforces it (lint, dependency rule, test). Unenforced decision = finding. Shape with no decision = undocumented architecture. Context/containers: C4 System Context and Container as Mermaid, from previous report corrected. Every external service in code and env schema appears; nothing retired on diagram. Capability register = package-level view only. Quality attributes: pick product-quality characteristics that matter; one scenario each (stimulus, environment, response, response measure); carry forward; judge shape meets each. Production checklists (quarterly): walk host checklists β†’ route each gap to owning audit. **Done when:** decisions, views, scenarios, routed gaps in `Judgment`.
111
+ - [ ] **Step 11 β€” Verify:** No finding without opening file. Confirm: cycle is runtime not type-only; cross-package edge is real source import not shared manifest name; privileged call site unguarded not middleware-blind; duplicated name is real duplication not platform split/local handler. Cite `file:line`. Destinations (name; do not file): confirmed copies and change-coupled pairs β†’ `bkit-audit-duplication`; reachability or event without producer/consumer β†’ `bkit-audit-dead-code`; server-only from client or secret in native bundle β†’ `bkit-audit-security`; table multi-writer β†’ `bkit-audit-database`; production-checklist gap β†’ owning audit (`bkit-audit-security`, `bkit-audit-app-performance`, `bkit-audit-database`, `bkit-audit-reliability`); else β†’ slug this report names. **Done when:** every surviving candidate has `file:line`, tool, destination.
112
+ - [ ] **Step 12 β€” Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per anchor standard and product-quality characteristic β†’ checked (name step) / not applicable (why) / finding. Unapplied recommended practice β†’ adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
113
+ - [ ] **Step 13 β€” Anything Else:** (a) Everything since previous report's commit touching shape (workspaces add/remove, manifest deps between workspaces, export maps, path aliases and project references, moved modules, new jobs/events, migrations adding tables, new external services in env schema) β†’ one-line verdict each. (b) Bounded ~30 min: what senior architect flags that no step asks; read since previous run (incidents, `bkit-audit-logs`, new `docs/failures.jsonl`, vendor status) β€” 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`.
114
+
115
+ ### πŸ”’ Gate 2: Probes Check
116
+
117
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
118
+
119
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
120
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
121
+ - [ ] **Presence only:** no finding rests on a missing edge alone.
122
+ - [ ] **Graph commit:** graph was built from the reviewed commit, or the mismatch is itself a finding.
123
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
124
+
125
+ ## Findings
126
+
127
+ <!-- prettier-ignore -->
128
+ | Severity | Use |
129
+ | --- | --- |
130
+ | `CRITICAL` | Privileged or secret-bearing module reachable from a client bundle or a native app |
131
+ | `HIGH` | Runtime cycle or back-edge across the intended layers; privileged call site unguarded by anything either tool can see |
132
+ | `MEDIUM` | Architecture decision nothing enforces; confirmed duplicate where a canonical symbol exists; event with no producer or no consumer |
133
+ | `LOW` | Low-confidence shape difference versus a reference repo; diagram drift that changes no boundary |
134
+
135
+ Scale per `.bkit/jsonl.md` Β§ Severity. Within a severity: boundary / secrets first.
136
+
137
+ <!-- prettier-ignore -->
138
+ | ID | Severity | Location | Evidence | Expected |
139
+ | --- | --- | --- | --- | --- |
140
+ | PENDING | PENDING | PENDING | PENDING | PENDING |
141
+
142
+ Empty and clean β†’ one row `None`.
143
+
144
+ ## Report
145
+
146
+ ### Summary
147
+
148
+ PENDING
149
+
150
+ ### Previous Run
151
+
152
+ PENDING
153
+
154
+ ### Graph
155
+
156
+ PENDING
157
+
158
+ ### Structure
159
+
160
+ PENDING
161
+
162
+ ### Layers
163
+
164
+ PENDING
165
+
166
+ ### Boundary
167
+
168
+ PENDING
169
+
170
+ ### Cross-Check
171
+
172
+ PENDING
173
+
174
+ ### References
175
+
176
+ PENDING
177
+
178
+ ### Coupling
179
+
180
+ PENDING
181
+
182
+ ### Judgment
183
+
184
+ PENDING
185
+
186
+ ### Checked
187
+
188
+ PENDING
189
+
190
+ ### Not Checked
191
+
192
+ PENDING
193
+
194
+ ### Standards Coverage
195
+
196
+ PENDING
197
+
198
+ ### Beyond the Steps
199
+
200
+ PENDING
201
+
202
+ ### Process Improvements
203
+
204
+ PENDING
205
+
206
+ ### πŸ”’ Gate 3: Report Check
207
+
208
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
209
+
210
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
211
+ - [ ] **Summary:** names count per severity, tools available, and the graph commit.
212
+ - [ ] **Series:** node, edge, and cross-package counts, and the coupling table, beside previous report's numbers, or marked baseline.
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.
215
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
216
+
217
+ > `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.
218
+
219
+ <!-- bkit:end -->
220
+
221
+ ## Project Instructions