@cbartens/bkit 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/.bkit/README.md +154 -151
  2. package/.bkit/core/.agents/context.md +95 -29
  3. package/.bkit/core/.agents/docs.md +17 -15
  4. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +1 -0
  5. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +6 -5
  6. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-readguard.cjs +1 -0
  7. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-rules.cjs +65 -0
  8. package/.bkit/core/.agents/rules.md +108 -107
  9. package/.bkit/core/.agents/skills.md +63 -15
  10. package/.bkit/core/.bkit/README.md +154 -151
  11. package/.bkit/core/.bkit/authoring.md +714 -84
  12. package/.bkit/core/.bkit/cli.md +407 -0
  13. package/.bkit/core/.bkit/cloud.md +281 -193
  14. package/.bkit/core/.bkit/comparison.md +43 -41
  15. package/.bkit/core/.bkit/install.md +154 -84
  16. package/.bkit/core/.bkit/jsonl.md +193 -130
  17. package/.bkit/core/.bkit/pipeline.md +114 -114
  18. package/.bkit/core/.bkit/prompts.md +272 -165
  19. package/.bkit/core/.bkit/providers.md +457 -271
  20. package/.bkit/core/.bkit/router.md +69 -0
  21. package/.bkit/core/.bkit/templates.md +529 -256
  22. package/.bkit/core/.bkit/trackers.md +80 -52
  23. package/.bkit/core/.bkit/workflows.md +589 -504
  24. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +2 -2
  25. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +3 -3
  26. package/.bkit/core/.claude/hooks/bkit-preflight.sh +45 -14
  27. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +3 -3
  28. package/.bkit/core/.codex/hooks/bkit-rules.cjs +57 -0
  29. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +7 -7
  30. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +47 -12
  31. package/.bkit/core/.opencode/plugin/bkit-rules.js +89 -0
  32. package/.bkit/core/AGENTS.md +5 -73
  33. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +127 -105
  34. package/.bkit/core/docs/templates/bkit-audit-adoption.md +104 -70
  35. package/.bkit/core/docs/templates/bkit-audit-agents.md +94 -72
  36. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +99 -78
  37. package/.bkit/core/docs/templates/bkit-audit-analytics.md +140 -82
  38. package/.bkit/core/docs/templates/bkit-audit-annotations.md +98 -72
  39. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +121 -96
  40. package/.bkit/core/docs/templates/bkit-audit-app-store.md +157 -76
  41. package/.bkit/core/docs/templates/bkit-audit-architecture.md +113 -71
  42. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +75 -72
  43. package/.bkit/core/docs/templates/bkit-audit-config.md +122 -76
  44. package/.bkit/core/docs/templates/bkit-audit-cost.md +85 -74
  45. package/.bkit/core/docs/templates/bkit-audit-coverage.md +75 -68
  46. package/.bkit/core/docs/templates/bkit-audit-database.md +101 -70
  47. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +164 -83
  48. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +115 -86
  49. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +264 -88
  50. package/.bkit/core/docs/templates/bkit-audit-documentation.md +118 -93
  51. package/.bkit/core/docs/templates/bkit-audit-duplication.md +139 -86
  52. package/.bkit/core/docs/templates/bkit-audit-failures.md +110 -81
  53. package/.bkit/core/docs/templates/bkit-audit-flakes.md +99 -74
  54. package/.bkit/core/docs/templates/bkit-audit-gates.md +105 -77
  55. package/.bkit/core/docs/templates/bkit-audit-issues.md +104 -80
  56. package/.bkit/core/docs/templates/bkit-audit-llm.md +131 -58
  57. package/.bkit/core/docs/templates/bkit-audit-logs.md +123 -100
  58. package/.bkit/core/docs/templates/bkit-audit-models.md +98 -53
  59. package/.bkit/core/docs/templates/bkit-audit-privacy.md +56 -52
  60. package/.bkit/core/docs/templates/bkit-audit-prompts.md +63 -54
  61. package/.bkit/core/docs/templates/bkit-audit-red-team.md +124 -68
  62. package/.bkit/core/docs/templates/bkit-audit-reliability.md +95 -70
  63. package/.bkit/core/docs/templates/bkit-audit-repo.md +169 -73
  64. package/.bkit/core/docs/templates/bkit-audit-security.md +206 -96
  65. package/.bkit/core/docs/templates/bkit-audit-slop.md +77 -70
  66. package/.bkit/core/docs/templates/bkit-audit-testing.md +162 -114
  67. package/.bkit/core/docs/templates/bkit-audit-usability.md +113 -71
  68. package/.bkit/core/docs/templates/bkit-plan.md +138 -132
  69. package/.bkit/core/engine/checks/after/auth.ts +40 -37
  70. package/.bkit/core/engine/checks/after/ci-yml.ts +65 -2
  71. package/.bkit/core/engine/checks/after/index.ts +12 -2
  72. package/.bkit/core/engine/checks/after/tools.ts +80 -33
  73. package/.bkit/core/engine/checks/before/context-fetch.ts +227 -33
  74. package/.bkit/core/engine/checks/before/env.ts +1 -1
  75. package/.bkit/core/engine/checks/before/index.ts +7 -0
  76. package/.bkit/core/engine/checks/before/repo.ts +40 -0
  77. package/.bkit/core/engine/checks/status-holes.ts +916 -123
  78. package/.bkit/core/engine/checks/tips/catalogue.ts +68 -17
  79. package/.bkit/core/engine/checks/tips/detect.ts +32 -0
  80. package/.bkit/core/engine/checks/tips/index.ts +47 -6
  81. package/.bkit/core/engine/cli.ts +238 -84
  82. package/.bkit/core/engine/commands/analysis.ts +128 -76
  83. package/.bkit/core/engine/commands/ci/ci.ts +363 -29
  84. package/.bkit/core/engine/commands/ci/pins.ts +172 -0
  85. package/.bkit/core/engine/commands/ci/push-gate.ts +223 -0
  86. package/.bkit/core/engine/commands/install/uninstall.ts +21 -27
  87. package/.bkit/core/engine/commands/install/upgrade.ts +32 -15
  88. package/.bkit/core/engine/commands/land.ts +126 -11
  89. package/.bkit/core/engine/commands/lib.ts +303 -6
  90. package/.bkit/core/engine/commands/registry.ts +6 -2
  91. package/.bkit/core/engine/commands/setup/setup.ts +1 -0
  92. package/.bkit/core/engine/commands/stats.ts +91 -35
  93. package/.bkit/core/engine/commands/workflow/branches.ts +1477 -117
  94. package/.bkit/core/engine/commands/workflow/challenge.ts +114 -39
  95. package/.bkit/core/engine/commands/workflow/completeness.ts +109 -0
  96. package/.bkit/core/engine/commands/workflow/context.ts +433 -55
  97. package/.bkit/core/engine/commands/workflow/counters.ts +244 -39
  98. package/.bkit/core/engine/commands/workflow/decisions.ts +61 -17
  99. package/.bkit/core/engine/commands/workflow/disk.ts +237 -55
  100. package/.bkit/core/engine/commands/workflow/fids.ts +19 -1
  101. package/.bkit/core/engine/commands/workflow/issues.ts +6 -0
  102. package/.bkit/core/engine/commands/workflow/ledgers.ts +458 -18
  103. package/.bkit/core/engine/commands/workflow/locks.ts +2 -0
  104. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +124 -15
  105. package/.bkit/core/engine/commands/workflow/plans.ts +257 -0
  106. package/.bkit/core/engine/commands/workflow/prs.ts +12 -3
  107. package/.bkit/core/engine/commands/workflow/repo.ts +8 -0
  108. package/.bkit/core/engine/commands/workflow/roadmap.ts +56 -15
  109. package/.bkit/core/engine/commands/workflow/run-facts.ts +22 -31
  110. package/.bkit/core/engine/commands/workflow/runs.ts +652 -34
  111. package/.bkit/core/engine/commands/workflow/runtime.ts +3 -0
  112. package/.bkit/core/engine/commands/workflow/skills.ts +1 -0
  113. package/.bkit/core/engine/commands/workflow/status.ts +200 -17
  114. package/.bkit/core/engine/commands/workflow/step-table.ts +75 -33
  115. package/.bkit/core/engine/commands/workflow/steps.ts +635 -24
  116. package/.bkit/core/engine/commands/workflow/summary-findings.ts +177 -0
  117. package/.bkit/core/engine/commands/workflow/summary.ts +192 -46
  118. package/.bkit/core/engine/commands/workflow/tasks.ts +409 -0
  119. package/.bkit/core/engine/commands/workflow/test-blocks.ts +254 -0
  120. package/.bkit/core/engine/commands/workflow/tests-changed.ts +201 -0
  121. package/.bkit/core/engine/commands/workflow/tests.ts +1285 -356
  122. package/.bkit/core/engine/commands/workflow/workflows.ts +228 -43
  123. package/.bkit/core/engine/commands/workflow/worktrees.ts +389 -47
  124. package/.bkit/core/engine/install/cloud-env.ts +251 -121
  125. package/.bkit/core/engine/install/context-ci-workflow.ts +102 -0
  126. package/.bkit/core/engine/install/manifest.ts +60 -12
  127. package/.bkit/core/engine/install/modules/antigravity.ts +3 -2
  128. package/.bkit/core/engine/install/modules/cloud.ts +3 -3
  129. package/.bkit/core/engine/install/modules/codex.ts +15 -2
  130. package/.bkit/core/engine/install/modules/core.ts +956 -52
  131. package/.bkit/core/engine/install/modules/cursor.ts +6 -6
  132. package/.bkit/core/engine/install/modules/opencode.ts +16 -4
  133. package/.bkit/core/engine/install/template-notes.ts +130 -0
  134. package/.bkit/core/engine/install/version-file.ts +3 -2
  135. package/.bkit/core/engine/install/write.ts +5 -0
  136. package/.bkit/core/engine/ledgers/compact.ts +124 -0
  137. package/.bkit/core/engine/ledgers/journal.ts +291 -0
  138. package/.bkit/core/engine/ledgers/status.ts +160 -9
  139. package/.bkit/core/engine/ledgers/telemetry.ts +158 -21
  140. package/.bkit/core/engine/render/hosts.ts +114 -14
  141. package/.bkit/core/engine/shared/bkit-latest.ts +26 -4
  142. package/.bkit/core/engine/shared/dep-updater.ts +60 -0
  143. package/.bkit/core/engine/shared/egress.ts +1 -1
  144. package/.bkit/core/engine/shared/package-manager.ts +9 -0
  145. package/.bkit/core/engine/shared/settings.ts +92 -17
  146. package/.bkit/core/engine/shared/timeouts.ts +2 -0
  147. package/.bkit/core/engine/tools/cli-doc.ts +111 -0
  148. package/.bkit/core/engine/tools/grammar-density.ts +1 -1
  149. package/.bkit/core/engine/tools/instructions-sources.ts +15 -17
  150. package/.bkit/core/engine/tools/instructions.ts +94 -43
  151. package/.bkit/core/hooks/antigravity-hook.js +25 -10
  152. package/.bkit/core/hooks/gateguard-engine.js +53 -29
  153. package/.bkit/core/hooks/guardrails-shell.js +4 -4
  154. package/.bkit/core/hooks/guardrails-tiers.js +3 -3
  155. package/.bkit/core/hooks/preflight-linear.sh +9 -9
  156. package/.bkit/core/hooks/preflight-rules.sh +8 -0
  157. package/.bkit/core/hooks/readguard-engine.js +29 -10
  158. package/.bkit/core/hooks/session-rules-advisory.js +61 -0
  159. package/.bkit/core/prompts/bkit-audit-generate.md +187 -116
  160. package/.bkit/core/prompts/bkit-build-challenge-1.md +56 -37
  161. package/.bkit/core/prompts/bkit-build-challenge-2.md +65 -45
  162. package/.bkit/core/prompts/bkit-build-install-skills.md +38 -29
  163. package/.bkit/core/prompts/bkit-build-plan-convert.md +43 -32
  164. package/.bkit/core/prompts/bkit-build-plan-current.md +49 -39
  165. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +79 -55
  166. package/.bkit/core/prompts/bkit-build-plan-tasks.md +149 -0
  167. package/.bkit/core/prompts/bkit-build-plan-tests.md +120 -0
  168. package/.bkit/core/prompts/bkit-build-plan-verify.md +87 -50
  169. package/.bkit/core/prompts/bkit-debug-abort-handover.md +36 -35
  170. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +96 -64
  171. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +54 -45
  172. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +42 -33
  173. package/.bkit/core/prompts/bkit-debug-failure-soak.md +53 -37
  174. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +35 -30
  175. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +34 -29
  176. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +32 -28
  177. package/.bkit/core/prompts/bkit-design-generate.md +68 -52
  178. package/.bkit/core/prompts/bkit-design-organise.md +73 -35
  179. package/.bkit/core/prompts/bkit-design-review-1.md +58 -54
  180. package/.bkit/core/prompts/bkit-design-review-2.md +54 -50
  181. package/.bkit/core/prompts/bkit-design-spike.md +54 -47
  182. package/.bkit/core/prompts/bkit-design-update.md +42 -31
  183. package/.bkit/core/prompts/bkit-plan-generate.md +76 -58
  184. package/.bkit/core/prompts/bkit-plan-review-1.md +63 -49
  185. package/.bkit/core/prompts/bkit-plan-review-2.md +60 -48
  186. package/.bkit/core/prompts/bkit-plan-scope-check.md +53 -46
  187. package/.bkit/core/prompts/bkit-plan-update.md +70 -52
  188. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +82 -50
  189. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +80 -45
  190. package/.bkit/core/prompts/bkit-ship-update-docs.md +35 -29
  191. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +55 -49
  192. package/.bkit/core/prompts/bkit-utility-update-decisions.md +76 -49
  193. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +70 -41
  194. package/.bkit/core/prompts/bkit-utility-update-documentation.md +33 -30
  195. package/.bkit/core/prompts/bkit-utility-update-failures.md +73 -43
  196. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +77 -50
  197. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +77 -45
  198. package/.bkit/core/prompts/bkit-utility-update-tracker.md +144 -68
  199. package/.bkit/core/workflows/bkit-auto.md +53 -30
  200. package/.bkit/core/workflows/bkit-build.md +635 -304
  201. package/.bkit/core/workflows/bkit-debug.md +301 -148
  202. package/.bkit/core/workflows/bkit-design.md +167 -95
  203. package/.bkit/core/workflows/bkit-plan.md +172 -84
  204. package/.bkit/core/workflows/bkit-ship.md +299 -152
  205. package/.bkit/shared/.agents/plugins/bkit/hooks.json +10 -0
  206. package/.bkit/shared/.claude/bkit-cloud.md +12 -10
  207. package/.bkit/shared/.claude/settings.json +3 -0
  208. package/.bkit/shared/.codex/bkit-cloud.md +98 -0
  209. package/.bkit/shared/.codex/hooks.json +20 -0
  210. package/.bkit/shared/.cursor/bkit-cloud.md +3 -3
  211. package/.bkit/shared/.opencode/opencode.json +1 -1
  212. package/.bkit/shared/CLAUDE.md +5 -1
  213. package/.bkit/shared/GEMINI.md +4 -1
  214. package/.bkit/shared/docs/architecture.md +4 -7
  215. package/.bkit/shared/docs/data-schema.md +4 -7
  216. package/.bkit/shared/docs/deployments.md +239 -166
  217. package/.bkit/shared/docs/design.md +11 -12
  218. package/.bkit/shared/docs/noise.md +8 -7
  219. package/.bkit/shared/docs/observability.md +5 -8
  220. package/.bkit/shared/docs/security.md +35 -17
  221. package/.bkit/shared/docs/setup.md +29 -18
  222. package/.bkit/shared/docs/technology.md +3 -6
  223. package/.bkit/shared/docs/testing.md +282 -176
  224. package/.bkit/shared/gitignore +6 -2
  225. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +15 -16
  226. package/.bkit/templates/.cursor/Dockerfile +12 -8
  227. package/.bkit/templates/.cursor/environment.json +1 -1
  228. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +10 -8
  229. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +24 -12
  230. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +3 -3
  231. package/.bkit/templates/.github/renovate.json5 +34 -6
  232. package/.bkit/templates/.github/workflows/bkit-ci.yml +53 -50
  233. package/.bkit/templates/.github/workflows/bkit-cloud.yml +13 -14
  234. package/.bkit/templates/.github/workflows/bkit-health.yml +97 -0
  235. package/.bkit/templates/.github/workflows/bkit-renovate.yml +5 -4
  236. package/.bkit/templates/.github/workflows/bkit-trivy.yml +5 -4
  237. package/.bkit/templates/.husky/pre-commit +2 -2
  238. package/.bkit/templates/.husky/pre-push +95 -35
  239. package/.bkit/templates/.prettierignore +6 -7
  240. package/.bkit/templates/.vale.ini +27 -27
  241. package/.bkit/templates/context/bkit-cloudrun.md +23 -15
  242. package/.bkit/templates/context/bkit-expo.md +70 -52
  243. package/.bkit/templates/context/bkit-github.md +93 -56
  244. package/.bkit/templates/context/bkit-inngest.md +21 -15
  245. package/.bkit/templates/context/bkit-maestro.md +22 -16
  246. package/.bkit/templates/context/bkit-playwright.md +23 -17
  247. package/.bkit/templates/context/bkit-resend.md +12 -10
  248. package/.bkit/templates/context/bkit-sentry.md +30 -20
  249. package/.bkit/templates/context/bkit-serena.md +8 -7
  250. package/.bkit/templates/context/bkit-stripe.md +14 -13
  251. package/.bkit/templates/context/bkit-supabase.md +16 -13
  252. package/.bkit/templates/context/bkit-tavily.md +14 -11
  253. package/.bkit/templates/context/bkit-vercel.md +27 -18
  254. package/.bkit/templates/docs/capabilities.md +15 -14
  255. package/.bkit/templates/scripts/ci/{check-accepted-divergences.mjs → bkit-check-accepted-divergences.mjs} +6 -3
  256. package/.bkit/templates/scripts/ci/{check-accepted-divergences.test.mjs → bkit-check-accepted-divergences.test.mjs} +3 -3
  257. package/.bkit/templates/scripts/ci/{check-capstone.mjs → bkit-check-capstone.mjs} +2 -2
  258. package/.bkit/templates/scripts/ci/{check-capstone.test.mjs → bkit-check-capstone.test.mjs} +4 -4
  259. package/.bkit/templates/scripts/ci/{check-dependency-audit.mjs → bkit-check-dependency-audit.mjs} +103 -18
  260. package/.bkit/templates/scripts/ci/{check-dependency-audit.test.mjs → bkit-check-dependency-audit.test.mjs} +31 -3
  261. package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +387 -0
  262. package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +75 -0
  263. package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +160 -0
  264. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.mjs → bkit-resolve-push-base.mjs} +3 -3
  265. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.test.mjs → bkit-resolve-push-base.test.mjs} +4 -4
  266. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +9 -1
  267. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +1 -1
  268. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +3 -3
  269. package/.bkit/templates/scripts/graphify/bkit-graph-embed.py +63 -0
  270. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +2 -2
  271. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +69 -18
  272. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -3
  273. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +1 -1
  274. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
  275. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +197 -126
  276. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +64 -41
  277. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +23 -7
  278. package/.bkit/templates/slop-scan.config.json +9 -2
  279. package/CHANGELOG.md +119 -0
  280. package/README.md +250 -76
  281. package/dist/checks/after/auth.js +36 -33
  282. package/dist/checks/after/ci-yml.js +52 -2
  283. package/dist/checks/after/index.js +12 -4
  284. package/dist/checks/after/tools.js +73 -33
  285. package/dist/checks/before/context-fetch.js +218 -33
  286. package/dist/checks/before/env.js +1 -1
  287. package/dist/checks/before/index.js +6 -2
  288. package/dist/checks/before/repo.js +35 -1
  289. package/dist/checks/status-holes.js +739 -114
  290. package/dist/checks/tips/catalogue.js +59 -17
  291. package/dist/checks/tips/detect.js +30 -0
  292. package/dist/checks/tips/index.js +48 -6
  293. package/dist/cli.js +222 -84
  294. package/dist/commands/analysis.js +77 -53
  295. package/dist/commands/ci/ci.js +302 -25
  296. package/dist/commands/ci/pins.js +142 -0
  297. package/dist/commands/ci/push-gate.js +194 -0
  298. package/dist/commands/install/uninstall.js +23 -27
  299. package/dist/commands/install/upgrade.js +21 -11
  300. package/dist/commands/land.js +126 -10
  301. package/dist/commands/lib.js +244 -5
  302. package/dist/commands/registry.js +6 -2
  303. package/dist/commands/setup/setup.js +1 -0
  304. package/dist/commands/stats.js +69 -30
  305. package/dist/commands/workflow/branches.js +1232 -111
  306. package/dist/commands/workflow/challenge.js +90 -37
  307. package/dist/commands/workflow/completeness.js +97 -0
  308. package/dist/commands/workflow/context.js +371 -51
  309. package/dist/commands/workflow/counters.js +206 -40
  310. package/dist/commands/workflow/decisions.js +60 -17
  311. package/dist/commands/workflow/disk.js +213 -55
  312. package/dist/commands/workflow/fids.js +18 -1
  313. package/dist/commands/workflow/issues.js +6 -0
  314. package/dist/commands/workflow/ledgers.js +372 -21
  315. package/dist/commands/workflow/locks.js +2 -0
  316. package/dist/commands/workflow/plan-blocks.js +78 -14
  317. package/dist/commands/workflow/plans.js +205 -0
  318. package/dist/commands/workflow/prs.js +12 -3
  319. package/dist/commands/workflow/repo.js +6 -0
  320. package/dist/commands/workflow/roadmap.js +50 -17
  321. package/dist/commands/workflow/run-facts.js +23 -28
  322. package/dist/commands/workflow/runs.js +530 -33
  323. package/dist/commands/workflow/runtime.js +3 -0
  324. package/dist/commands/workflow/skills.js +1 -0
  325. package/dist/commands/workflow/status.js +166 -19
  326. package/dist/commands/workflow/step-table.js +61 -29
  327. package/dist/commands/workflow/steps.js +542 -26
  328. package/dist/commands/workflow/summary-findings.js +117 -0
  329. package/dist/commands/workflow/summary.js +154 -41
  330. package/dist/commands/workflow/tasks.js +378 -0
  331. package/dist/commands/workflow/test-blocks.js +231 -0
  332. package/dist/commands/workflow/tests-changed.js +172 -0
  333. package/dist/commands/workflow/tests.js +1013 -321
  334. package/dist/commands/workflow/workflows.js +191 -38
  335. package/dist/commands/workflow/worktrees.js +310 -42
  336. package/dist/install/cloud-env.js +233 -99
  337. package/dist/install/context-ci-workflow.js +85 -0
  338. package/dist/install/manifest.js +57 -12
  339. package/dist/install/modules/antigravity.js +3 -2
  340. package/dist/install/modules/cloud.js +3 -3
  341. package/dist/install/modules/codex.js +12 -2
  342. package/dist/install/modules/core.js +851 -53
  343. package/dist/install/modules/cursor.js +6 -6
  344. package/dist/install/modules/opencode.js +11 -5
  345. package/dist/install/template-notes.js +116 -0
  346. package/dist/install/version-file.js +3 -2
  347. package/dist/ledgers/compact.js +87 -0
  348. package/dist/ledgers/journal.js +233 -0
  349. package/dist/ledgers/status.js +115 -5
  350. package/dist/ledgers/telemetry.js +121 -17
  351. package/dist/render/hosts.js +100 -14
  352. package/dist/shared/bkit-latest.js +26 -4
  353. package/dist/shared/dep-updater.js +49 -0
  354. package/dist/shared/egress.js +1 -1
  355. package/dist/shared/package-manager.js +6 -0
  356. package/dist/shared/settings.js +59 -10
  357. package/dist/shared/timeouts.js +2 -0
  358. package/dist/tools/cli-doc.js +97 -0
  359. package/dist/tools/grammar-density.js +1 -1
  360. package/dist/tools/instructions-sources.js +15 -16
  361. package/dist/tools/instructions.js +83 -39
  362. package/package.json +58 -42
  363. package/.bkit/core/.bkit/lite.md +0 -73
  364. package/.bkit/core/engine/commands/workflow/workstreams.ts +0 -172
  365. package/.bkit/core/prompts/bkit-build-plan-execute.md +0 -124
  366. package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +0 -194
  367. package/dist/commands/workflow/workstreams.js +0 -149
  368. /package/.bkit/templates/.vale/styles/{House → Bkit}/Filler.yml +0 -0
  369. /package/.bkit/templates/.vale/styles/{House → Bkit}/Hedging.yml +0 -0
  370. /package/.bkit/templates/.vale/styles/{House → Bkit}/LLMSlop.yml +0 -0
  371. /package/.bkit/templates/.vale/styles/{House → Bkit}/Verbose.yml +0 -0
  372. /package/.bkit/templates/scripts/ci/{accepted-advisories.json → bkit-accepted-advisories.json} +0 -0
  373. /package/.bkit/templates/scripts/ci/{accepted-divergences.json → bkit-accepted-divergences.json} +0 -0
  374. /package/.bkit/templates/scripts/launchd/{launchd.env.example → bkit-launchd.env.example} +0 -0
  375. /package/.bkit/templates/scripts/launchd/{ai.bkit.launchd.plist → bkit-launchd.plist} +0 -0
@@ -1,9 +1,9 @@
1
- <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. The report is stamped with a `bkit:anchor` block recording the audited commit (`baseSha`) and branch (`baseRef`); never hand-author or edit it. `@bkit-audit-generate` fills this template. -->
2
-
3
1
  <!-- bkit:start -->
4
2
 
5
3
  {{BKIT_MANAGED_MARKER}}
6
4
 
5
+ <!-- Note: @bkit-audit-generate fills this template. The report lives at `docs/audits/{YYYYMM}/{slug}.md`, where `{YYYYMM}` is the UTC month of the run and `{slug}` is this file's name without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md`, where `{TIMESTAMP}` is the output of `date -u +%Y%m%dT%H%M%SZ`. NEVER overwrite an earlier report. The report is stamped with a `bkit:anchor` block that records the audited commit (`baseSha`) and branch (`baseRef`). NEVER write or edit that block by hand. -->
6
+
7
7
  # Analytics Audit
8
8
 
9
9
  > [!CAUTION]
@@ -11,121 +11,175 @@
11
11
  >
12
12
  > **Rules:**
13
13
  >
14
- > - Name the field and where it lives; never copy a personal-data value into the report.
15
- > - Vendor consoles are read-only: NEVER publish a container, change a property, or send a live collection hit.
16
- > - Every container, property, and capture names the environment it ran against.
14
+ > - Name each field and where it lives.
15
+ > - NEVER copy a personal-data value into the report.
16
+ > - Use vendor consoles read-only.
17
+ > - NEVER publish a container, change a property or send a live collection hit.
18
+ > - Name the environment each container, property and capture ran against.
17
19
 
18
20
  ## Universal Instructions
19
21
 
20
22
  ### Context & Goals
21
23
 
22
- Tracking decays quietly: one-sided renames, funnel steps that stop after refactors, tags before consent, personal values in properties. Nothing errors; product still decides on the numbers. Code = tracking plan as implemented. Target failure: **a number the product trusts that the code no longer sends, or a payload that carries a person.** Personal scope, consent requirements, deletion reach → `bkit-audit-privacy`'s rules; this audit applies them to payloads and consent mode.
24
+ Tracking decays quietly: an event renamed on one side only, funnel steps that stop firing after a refactor, tags that load before consent, and personal values in properties. Nothing errors, and the product still decides on the numbers. The code is the tracking plan as implemented. The failure this audit targets is a number the product trusts that the code no longer sends, or a payload that carries a person. What counts as personal, what consent requires and how far deletion must reach are `bkit-audit-privacy`'s rules. This audit applies them to payloads and consent mode.
23
25
 
24
- **Applies when:** the product sends analytics events (SDK, tag snippet, or server collection call). None → one `N/A` row with evidence, never "clean".
26
+ **Applies when:** the product sends analytics events (an SDK, a tag snippet or a server collection call). **If** it sends none → write one `N/A` row with its evidence, and never report the surface as "clean".
25
27
 
26
- **Cadence:** quarterly. Extra pass after a change to a core flow, and on the run that first finds product tracking (mark baseline).
28
+ **Cadence:** Run once a quarter. Run an extra pass after a change to a core flow, and on the run that first finds product tracking (mark it baseline).
27
29
 
28
30
  **Anchor Standards:**
29
31
 
30
- - Product-analytics collection docs (e.g. GA4 developer guides, Analytics Help: collection/config limits, user-id, recommended events, Measurement Protocol, warehouse export). Record date read.
31
- - Tag-manager docs (e.g. GTM Help: workspaces, environments, preview, tag diagnostics). Record date read.
32
- - Tag-platform consent (e.g. Google Consent Mode v2 web/app; server-side tagging, first-party tag gateway). Record consent-mode version + date read.
33
- - Native analytics SDK (e.g. Firebase Analytics). Record SDK version in use.
34
- - Vendor consent policy (e.g. Google EU user consent policy). Record date read.
35
- - Privacy regimes for tracking identifiers (e.g. GDPR, ePrivacy Directive; national use/disclosure/cross-border principles). Interpretation → `bkit-audit-privacy`. Record compilation where applicable.
32
+ - Product-analytics collection docs (e.g., GA4 developer guides, Analytics Help: collection/config limits, user-id, recommended events, Measurement Protocol, warehouse export). Record the date read.
33
+ - Tag-manager docs (e.g., GTM Help: workspaces, environments, preview, tag diagnostics). Record the date read.
34
+ - Tag-platform consent (e.g., Google Consent Mode v2 web/app; server-side tagging, first-party tag gateway). Record the consent-mode version and the date read.
35
+ - Native analytics SDK (e.g., Firebase Analytics). Record the SDK version in use.
36
+ - Vendor consent policy (e.g., Google EU user consent policy). Record the date read.
37
+ - Privacy regimes for tracking identifiers (e.g., GDPR, ePrivacy Directive; national use/disclosure/cross-border principles). Their interpretation goes to `bkit-audit-privacy`. Record the compilation where one applies.
36
38
 
37
39
  ### Scope
38
40
 
39
- - Whether product tracking exists, and any doc that claims it does.
40
- - Event list against the measurement plan.
41
- - Collection wrapper, data layer, and snippet load order.
42
- - Tag-manager container: governance, environments, and custom tags.
43
- - Names, shapes, reserved names, collection limits, and client parity.
44
- - Core-flow start and completion; double fires.
45
- - Payloads + consent mode (`bkit-audit-privacy` rules): consent before load/send, defaults/lifecycle, ad-id collection, personal data in payloads/URLs/titles, vendor redaction, analytics purge on account deletion.
46
- - User id across login, logout, and clients.
47
- - What actually fires against the code.
48
- - Dashboards, data quality, alerts, and annotations.
49
- - Property settings: retention, filters, referrals, key events, custom definitions, automatic collection, and signals.
50
- - Server-sent events and the collection protocol.
51
- - Campaigns, attribution, and auth-redirect survival.
52
- - Integrations: search console, warehouse export, ads, and native-app streams.
41
+ - Check whether product tracking exists, and any doc that claims it does.
42
+ - Compare the event list with the measurement plan.
43
+ - Check the collection wrapper, the data layer and the snippet load order.
44
+ - Check the tag-manager container: governance, environments and custom tags.
45
+ - Check names, shapes, reserved names, collection limits and parity across clients.
46
+ - Check the start and completion of each core flow, and double fires.
47
+ - Check payloads and consent mode against `bkit-audit-privacy`'s rules: consent before load or send, defaults and lifecycle, ad-id collection, personal data in payloads, URLs and titles, vendor redaction, and the analytics purge on account deletion.
48
+ - Check the user id across login, logout and clients.
49
+ - Compare what actually fires with the code.
50
+ - Check dashboards, data quality, alerts and annotations.
51
+ - Check property settings: retention, filters, referrals, key events, custom definitions, automatic collection and signals.
52
+ - Check server-sent events and the collection protocol.
53
+ - Check campaigns, attribution, and whether parameters survive auth redirects.
54
+ - Check integrations: search console, warehouse export, ads and native-app streams.
53
55
 
54
56
  ### Out of Scope
55
57
 
56
58
  <!-- prettier-ignore -->
57
59
  | Excluded item | Why | Where it belongs |
58
60
  | --- | --- | --- |
59
- | Lawful basis, retention periods, processor-list interpretation | Privacy sweep owns the rules; this audit applies them | `bkit-audit-privacy` |
60
- | Error telemetry and crash reporting | Not product analytics | `bkit-audit-logs` |
61
- | Third-party scripts as an attack surface; container and property access review | Security sweep | `bkit-audit-security` |
62
- | Store privacy answers in depth, including advertising-id answers | Store sweep | `bkit-audit-app-store` |
63
- | Main-thread cost of tags | Performance sweep; payloads and consent stay here | `bkit-audit-app-performance` |
64
- | Rewriting a doc that describes tracking wrongly | Docs sweep; naming the claim stays here | `bkit-audit-documentation` |
65
- | Turning a check into a test or gate | Gates sweep | `bkit-audit-gates` |
66
- | Changing tracking code or analytics settings | Audit reports only | Plan from this report |
61
+ | Lawful basis, retention periods, processor-list interpretation | The privacy sweep owns the rules; this audit applies them | `bkit-audit-privacy` |
62
+ | Error telemetry and crash reporting | They are not product analytics | `bkit-audit-logs` |
63
+ | Third-party scripts as an attack surface; container and property access review | The security sweep owns them | `bkit-audit-security` |
64
+ | Store privacy answers in depth, including advertising-id answers | The store sweep owns them | `bkit-audit-app-store` |
65
+ | Main-thread cost of tags | The performance sweep owns it; payloads and consent stay here | `bkit-audit-app-performance` |
66
+ | Rewriting a doc that describes tracking wrongly | The docs sweep owns it; naming the claim stays here | `bkit-audit-documentation` |
67
+ | Turning a check into a test or gate | The gates sweep owns it | `bkit-audit-gates` |
68
+ | Changing tracking code or analytics settings | The audit only reports | A plan made from this report |
67
69
 
68
70
  ### Pre-Flight / Dependencies
69
71
 
70
72
  #### Core
71
73
 
72
- - [ ] **Permissions:** blocked calls recorded
73
- - [ ] **Web:** Step 18 — fetch anchor standards. Fallback: versions recorded as unread.
74
+ - [ ] **Permissions:** every blocked call is recorded.
75
+ - [ ] **Web:** Step 18 — fetch the anchor standards. Fallback: record the versions as unread.
74
76
 
75
77
  #### Conditional
76
78
 
77
- - [ ] **Request Capture:** Product tracking in code → Step 12 — browser network panel or a test-runner intercept, e.g. Playwright `page.route`, Cypress `intercept`. Fallback: code only; firing claims = hypotheses in `Not Checked`.
78
- - [ ] **Tag Manager:** A tag manager sits between app and vendor → Steps 5, 6, 10, 12 — container export, preview, and diagnostics, e.g. GTM JSON export, Tag Assistant. Fallback: code and network only; container diff `Not Checked`.
79
- - [ ] **Analytics Admin:** A hosted property exists → Steps 9, 11, 13, 14 — retention, filters, redaction, and user-deletion, e.g. GA4 Admin API, Firebase console, Amplitude settings. Fallback: none; settings `Not Checked`.
80
- - [ ] **Native Debug:** A native analytics SDK exists → Steps 10-12 — debug view, e.g. Firebase DebugView. Fallback: `Not Checked`. Confirm debug flags never ship in a release build.
81
- - [ ] **Warehouse:** An export is linked → Step 17 — row counts, e.g. BigQuery, Snowflake. Fallback: vendor-UI counts only; reconciliation `Not Checked`.
79
+ - [ ] **Request Capture:** **If** the code has product tracking → Step 12 — the browser network panel or a test-runner intercept (e.g., Playwright `page.route`, Cypress `intercept`). Fallback: read the code only, and record firing claims as hypotheses in `Not Checked`.
80
+ - [ ] **Tag Manager:** **If** a tag manager sits between the app and the vendor → Steps 5, 6, 10, 12 — the container export, preview and diagnostics (e.g., GTM JSON export, Tag Assistant). Fallback: read the code and network only, and mark the container diff `Not Checked`.
81
+ - [ ] **Analytics Admin:** **If** a hosted property exists → Steps 9, 11, 13, 14 — retention, filters, redaction and user deletion (e.g., GA4 Admin API, Firebase console, Amplitude settings). Fallback: none. Mark the settings `Not Checked`.
82
+ - [ ] **Native Debug:** **If** a native analytics SDK exists → Steps 10-12 — the debug view (e.g., Firebase DebugView). Fallback: `Not Checked`. Confirm that debug flags never ship in a release build.
83
+ - [ ] **Warehouse:** **If** an export is linked → Step 17 — row counts (e.g., BigQuery, Snowflake). Fallback: use vendor-UI counts only, and mark reconciliation `Not Checked`.
82
84
 
83
85
  ### 🔒 Gate 1: Prerequisites Check
84
86
 
85
- - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
86
- - [ ] **Gate 1 — Verified:** All Core items checked. All applicable Conditional items checked.
87
+ - [ ] **Gaps named:** every missing item names its fallback and its `Not Checked` entry.
88
+ - [ ] **Gate 1 — Verified:** every item above, every Core item and every applicable Conditional item is checked.
87
89
 
88
90
  ### Probe Steps
89
91
 
90
- - [ ] **Step 1 — Previous Run:** **Done when:** closure rate in `Previous Run`, or run marked baseline.
91
- - [ ] **Step 2 — Detect:** Find every analytics SDK, tag-manager snippet, and event call on web, native, and server — vendor packages, hosts, wrapper. Error-tracker SDKs are not product analytics. None → docs claiming tracking; unmet claim = finding → `bkit-audit-documentation`; then `N/A` and STOP. Record tools in `Checked`. **Done when:** surfaces in `Checked`, or `N/A` and **STOP**.
92
- - [ ] **Step 3 — Events:** Every code-sent event: name, fire site, property types = tracking plan as implemented. No written intended plan = finding (Step 4). **Done when:** `Events` lists every event and change since the previous run, or marked baseline.
93
- - [ ] **Step 4 — Plan:** Each business question: owner + map to named events, key events, custom dimensions. Event without question wastes limits = finding; question without event = gap. Intended plan `Events` compares to. **Done when:** `Plan` row per question: owner · events · verdict against `Events`.
94
- - [ ] **Step 5 — Data Layer:** Tag manager between app and vendor (e.g. GA4 through GTM) → (a) Push to data layer only via one typed wrapper; tag manager picks destinations. Direct vendor calls (e.g. `gtag(`), in-component SDK calls, bypass pushes = finding. (b) Layer retains keys across pushes → leak without reset; clear prior object before each commerce push (e.g. `ecommerce: null`). (c) One page view per navigation: non-full-load router sends `page_view` from history auto **or** manual virtual, never both; preview five routes → five hits with new location/title. (d) Snippet once from root layout, after Step 10 consent defaults, only after grant; each deploy loads `Container` environment expected. No tag manager → skip with evidence. **Done when:** `Data Layer` holds the five-route count and each breach = finding.
95
- - [ ] **Step 6 — Container:** Tag manager in use → (a) Export live container JSON each run → attach (or commit per owner) → diff vs previous export. (b) One naming convention (e.g. `GA4 – Event – sign_up`), folders; no unused/paused tags, triggers, variables; named published versions + notes; one workspace per change set; publish rights to named people only. (c) Each custom HTML/template: author, loads what, consent check, `unsafe-inline` CSP need; script risk → `bkit-audit-security`. (d) Non-prod: non-live snippet or none, never live container. (e) Diagnostics + coverage: untagged pages, silent tags, CSP blocks. (f) Container + property on company account; least privilege; leavers removed; access → `bkit-audit-security`. No tag manager → skip with evidence. **Done when:** `Container` holds the diff, governance, diagnostics, and ownership, or the skip.
96
- - [ ] **Step 7 — Names:** One convention (e.g. `object_action`, one case); same event + properties every client; no always-empty/same properties; consistent id types; rename/version changes, not silent reshapes. Prefer vendor recommended events (e.g. GA4 `sign_up`, `login`, `purchase`, `begin_checkout`, `share`, `generate_lead`). No reserved events or reserved-prefix params (e.g. `_`, `firebase_`, `ga_`, `google_`, `gtag.`). Record vendor collection limits (name length, params/event, value length, distinct names); silent over-limit drop → check longest name, widest event, longest values. **Done when:** convention and recorded limits in `Events`; each breach = finding.
97
- - [ ] **Step 8 — Coverage:** Each core flow: start + completion for drop-off; conversions defined; no double fires (re-renders, strict mode, client + server same action). De-duplication → `Server Events`; key events → `Property`. **Done when:** each core flow's start and completion are in `Events`; each double fire = finding.
98
- - [ ] **Step 9 — Consent:** Apply `bkit-audit-privacy`'s rules. (a) No tag/SDK load or send before consent where required; cross-app permission (e.g. iOS App Tracking Transparency) only when tracking crosses apps. (b) Native: advertising-id off unless app shows ads — no ad-id module/framework, vendor ad-id flag false; store answers must match → `bkit-audit-app-store`. (c) No personal data in properties, URLs, titles (email, name, free text, precise location). (d) Web streams: vendor redaction (e.g. GA4 data redaction) on for email + query params (auth codes, tokens, email); test redaction preview; without it auth/invite URLs leak location/referrer. Fields redaction skips (e.g. GA4: `Server Events` + page titles) → check dynamic titles (person/household/item names). Gap → `bkit-audit-privacy`. (e) Vendor IP handling + retention. (f) Vendor on processor list + privacy policy; list → `bkit-audit-privacy`. (g) Account deletion removes user analytics via vendor user-deletion API (user id + client/app instance id when known). Gap → `bkit-audit-privacy`. **Done when:** `Consent` row per item: met / finding / not applicable.
99
- - [ ] **Step 10 — Consent Mode:** Consent-mode tag platform (e.g. Google tags) → (a) Signals (e.g. `analytics_storage`, `ad_storage`, `ad_user_data`, `ad_personalization`) default denied before snippet runs; update on choice; regional defaults → record regions, check each. (b) Basic mode only: no vendor load/send before grant. Capture + preview: no choice → no vendor host request; deny → same. Advanced mode (preload + cookieless pings while denied) = finding; any pre-consent vendor request = finding. (c) No vendor cookies pre-choice; deny/withdraw clears/stops; choice survives reload, consistent across clients — preview consent tab + cookie jar dump per stage; names only, never identifying values. (d) Native defaults denied in platform config; native call matches web banner choice. (e) Ads/remarketing linked → CMP integrates consent mode (prefer vendor-certified); `ad_user_data` gates user-id/enhanced-conversion sharing. Wrong default/signal/lifecycle → `bkit-audit-privacy`. No consent mode → skip with evidence. **Done when:** `Consent` holds defaults, the no-choice capture, and the lifecycle, or the skip.
100
- - [ ] **Step 11 — Identity:** Login → internal user id only (never email/personal), via vendor's user-id mechanism only (e.g. GA4 `user_id` config parameter) — never event param, user property, or registered custom dimension; sent every page load while signed in. Logout → null, not `""`, `" "`, or `"null"`; never-signed-in → no user id. Native mirrors login/logout. One property stitches web+app (e.g. Blended/Observed); household model documented (e.g. low-cardinality user property). Never register per-household/per-user id as custom dimension. Verify sign-in/nav/sign-out in preview (web) + debug view (native); record user-id presence/shape, never value. Personal id or post-logout survival → plan from this report + `bkit-audit-privacy` if personal data left. **Done when:** `Identity` row per stage: signed out · signed in · after logout · never signed in.
101
- - [ ] **Step 12 — Firing:** Run each core flow (E2E or manual) → capture requests vs `Events`. Events in code that never fire = dead tracking; fire-not-in-code = auto-collection decision; payload mismatch = bug. Web: tag-manager preview + network. Per flow: tags + consent state, data layer per push, outgoing hits. Native: debug view; debug flags never in release. One screen view per screen (name/class match web routes) + auto events (e.g. `first_open`, `session_start`, Android `app_remove`). **Done when:** `Firing` row per core flow: expected · captured · verdict.
102
- - [ ] **Step 13 — Dashboards:** Vendor reports/conversions use existing events; internal/test filtered. Each run: unset page/landing shares, collapsed high-cardinality size, unassigned channel, self-referrals + delta vs previous run. Alert on core-flow key event → zero between runs. Tracking-changing releases annotated. Dashboard on dead event → owner with report + event. **Done when:** `Dashboards` holds quality shares, alerts, and annotations.
103
- - [ ] **Step 14 — Property:** Hosted property (e.g. GA4) → screenshot or admin API dump per setting; name property. (a) Deliberate retention (past short default) + reset-on-new-activity vs `bkit-audit-privacy` rules. (b) Internal/dev traffic filters active (not testing); permanent exclusions; app streams exclude at source (CI/synthetic/test). (c) Unwanted referrals: checkout, OAuth, auth hosts — else sign-in/purchase credit lost. (d) Each `Coverage` completion = key event (non-trivial); counting method chosen; within doc limit (record limit). (e) Report params registered as custom dims/metrics within limits; no high-cardinality ids. (f) Auto-collection toggles: SPA form noise; site-search param names; downloads may leak filenames (personal). (g) Signals/demographics threshold risk — record decision; off or device identity if core data hidden. (h) Granular location/device + user-provided data per region; user-provided off unless enhanced conversions. (i) TZ/currency match business; session/engaged timers; cross-domain if marketing != app domain. Other vendor → equivalent settings or skip. Undecided drift → owner + diff/screenshot. **Done when:** `Property` row per setting: value · decided · verdict.
104
- - [ ] **Step 15 — Server Events:** List server-protocol sends (e.g. webhook subscription lifecycle, inbound message, job outcomes). Reuse client id (web) or app instance id (native); session id only in vendor window. Validate via vendor debug endpoint; API secret in secrets store, rotated. No client twin or shared dedup key (e.g. `transaction_id`); subscription revenue from webhook, not client success page. Server strips personal data (redaction N/A). Document first-party script + same-origin path (e.g. `/metrics`) via host/CDN + server container strip; no decision = finding; if adopted check domain, prod instance count vs vendor guidance, strip rules. **Done when:** `Server Events` row per event: client id reused · deduped · personal data stripped · verdict.
105
- - [ ] **Step 16 — Campaigns:** Written UTM taxonomy: lowercase fixed source/medium vocabulary + campaign id matching vendor channel groups; no internal UTMs; invite/reply/reset links carry UTMs. Auth redirects preserve params (e.g. `utm_*`, `gclid`, `gbraid`, `wbraid`) through sign-up → confirm → callback → first landing; test tagged sign-up + first page view/sign-up hit. Record attribution model, key-event lookbacks, custom channel groups (incl. assistant-referrer for `bkit-audit-aio-seo`). Installs: store referrer, campaign links, deferred invite deep links → first open. Lost params/untagged email → plan, name flow. **Done when:** `Campaigns` row per item: written · tested · verdict.
106
- - [ ] **Step 17 — Integrations:** Search Console when public pages exist. Warehouse export → project observability stack, daily (+ streaming if needed), all streams; record region/expiry/cost; daily volume vs export limit (record limit; chronic exceed → pause risk). One processed day: vendor UI count vs warehouse rows (device id identity, matched TZ); doc gap (e.g. 2-5%) OK, more = finding. Ads + auto-tagging/enhanced conversions only if paid acquisition else "not linked". Link native projects + store billing if IAP. Missing link → owner. **Done when:** `Integrations` row per link: linked / not linked / not applicable.
107
- - [ ] **Step 18 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: row per consent signal, collection/config limit, user-id rule, tag-manager governance, server-protocol requirement → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
108
- - [ ] **Step 19 — Anything Else:** (a) Since previous commit, every tracking touch (events, data-layer wrapper, container, property/stream, consent banner/mode, native config, server events, auth redirects) → one-line verdict. (b) ~30 min senior pass + incidents/`bkit-audit-logs`/`docs/failures.jsonl`/vendor status since last run — gaps no step covers. **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
92
+ - [ ] **Step 1 — Previous Run:** **Done when:** `Previous Run` holds the closure rate, or the run is marked baseline.
93
+ - [ ] **Step 2 — Detect:** Find every analytics SDK, tag-manager snippet and event call on web, native and server: vendor packages, hosts and the wrapper. Error-tracker SDKs are not product analytics. Record the tools in `Checked`. **If** there are none:
94
+ - Look for docs that claim tracking. A claim with no tracking behind it is a finding for `bkit-audit-documentation`.
95
+ - Write `N/A`, and **STOP**.
96
+
97
+ **Done when:** `Checked` holds the surfaces, or `N/A` is recorded → **STOP**.
98
+
99
+ - [ ] **Step 3 — Events:** List every event the code sends, with its name, its fire site and its property types. This list is the tracking plan as implemented. **If** there is no written intended plan → that is a finding (Step 4). **Done when:** `Events` lists every event and each change since the previous run, or the run is marked baseline.
100
+ - [ ] **Step 4 — Plan:** For each business question, record its owner and map it to named events, key events and custom dimensions. An event that answers no question wastes limits and is a finding. A question with no event is a gap. This is the intended plan that `Events` is compared with. **Done when:** `Plan` holds one row per question: owner · events · verdict against `Events`.
101
+ - [ ] **Step 5 — Data Layer:** Run this step only when a tag manager sits between the app and the vendor (e.g., GA4 through GTM). **If** there is none → skip with evidence. (a) Check that the app pushes to the data layer only through one typed wrapper, and that the tag manager picks the destinations. Direct vendor calls (e.g., `gtag(`), SDK calls inside components and pushes that bypass the wrapper are findings. (b) The data layer keeps keys across pushes, so they leak without a reset: check that the prior object is cleared before each commerce push (e.g., `ecommerce: null`). (c) Check for one page view per navigation: a router that does not do full page loads sends `page_view` either from history automatically **or** as a manual virtual page view, never both. Preview five routes, and expect five hits, each with a new location and title. (d) Check that the snippet loads once from the root layout, after the Step 10 consent defaults and only after consent is granted, and that each deploy loads the `Container` environment it should. **Done when:** `Data Layer` holds the five-route count, and each breach is a finding.
102
+ - [ ] **Step 6 — Container:** Run this step only when a tag manager is in use. **If** there is none → skip with evidence. (a) Export the live container JSON on each run, attach it, and diff it against the previous export. **If** the owner chooses → commit the export as well. (b) Check governance: one naming convention (e.g., `GA4 – Event – sign_up`) and folders; no unused or paused tags, triggers or variables; published versions that are named and have notes; one workspace per change set; and publish rights for named people only. (c) For each custom HTML tag or template, record its author, what it loads, its consent check and whether it needs `unsafe-inline` in the CSP. Script risk goes to `bkit-audit-security`. (d) Check that non-production deploys load a non-live snippet or none, never the live container. (e) Read diagnostics and coverage: untagged pages, silent tags and CSP blocks. (f) Check that the container and property sit on a company account, with least privilege and leavers removed. Access review goes to `bkit-audit-security`. **Done when:** `Container` holds the diff, governance, diagnostics and ownership, or the skip.
103
+ - [ ] **Step 7 — Names:** Check for one naming convention (e.g., `object_action`, in one case); the same event and properties on every client; no property that is always empty or always the same; consistent id types; and renames or versioned changes rather than silent reshapes. Prefer the vendor's recommended events (e.g., GA4 `sign_up`, `login`, `purchase`, `begin_checkout`, `share`, `generate_lead`). Check that no event uses a reserved name, and no parameter a reserved prefix (e.g., `_`, `firebase_`, `ga_`, `google_`, `gtag.`). Record the vendor's collection limits (name length, parameters per event, value length, distinct names). Vendors drop over-limit data silently, so check the longest name, the widest event and the longest values against them. **Done when:** `Events` holds the convention and the recorded limits, and each breach is a finding.
104
+ - [ ] **Step 8 — Coverage:** For each core flow, check that both the start and the completion are tracked, so drop-off can be measured; that conversions are defined; and that nothing fires twice (re-renders, strict mode, or client and server sending the same action). De-duplication goes to `Server Events`, and key events go to `Property`. **Done when:** `Events` holds each core flow's start and completion, and each double fire is a finding.
105
+ - [ ] **Step 9 — Consent:** Apply `bkit-audit-privacy`'s rules.
106
+ - (a) Check that no tag or SDK loads or sends before consent where consent is required.
107
+ - Check that the app asks for cross-app permission (e.g., iOS App Tracking Transparency) only when tracking crosses apps.
108
+ - (b) Native: check that the advertising id is off unless the app shows ads, with no ad-id module or framework and the vendor's ad-id flag false. The store answers must match; that goes to `bkit-audit-app-store`.
109
+ - (c) Check that no personal data (email, name, free text, precise location) appears in properties, URLs or titles.
110
+ - (d) Web streams:
111
+ - Check that vendor redaction (e.g., GA4 data redaction) is on for email and for query parameters (auth codes, tokens, email). Without it, auth and invite URLs leak through the location and referrer.
112
+ - Test it in the redaction preview.
113
+ - Redaction skips some fields (e.g., GA4 skips `Server Events` and page titles), so check dynamic titles for names of people, households or items.
114
+ - A gap goes to `bkit-audit-privacy`.
115
+ - (e) Record the vendor's IP handling and retention.
116
+ - (f) Check that the vendor is on the processor list and in the privacy policy. The list goes to `bkit-audit-privacy`.
117
+ - (g) Check that account deletion removes the user's analytics through the vendor's user-deletion API, using the user id and the client or app instance id when known. A gap goes to `bkit-audit-privacy`.
118
+
119
+ **Done when:** `Consent` holds one row per item: met / finding / not applicable.
120
+
121
+ - [ ] **Step 10 — Consent Mode:** Run this step only when the tag platform has a consent mode (e.g., Google tags).
122
+ - **If** there is none → skip with evidence.
123
+ - (a) Check that the signals (e.g., `analytics_storage`, `ad_storage`, `ad_user_data`, `ad_personalization`) default to denied before the snippet runs, and update on the user's choice.
124
+ - **If** defaults differ by region → record the regions, and check each.
125
+ - (b) Check for basic mode only: nothing loads or sends to the vendor before consent is granted.
126
+ - Use capture and preview: with no choice made, no request goes to a vendor host, and the same holds after a deny.
127
+ - Advanced mode (preloading, and cookieless pings while denied) is a finding, and so is any vendor request before consent.
128
+ - (c) Check that no vendor cookie is set before the choice, that deny or withdraw clears them or stops them, and that the choice survives a reload and is consistent across clients.
129
+ - Use the preview consent tab and a cookie-jar dump at each stage, recording names only, never identifying values.
130
+ - (d) Native: check that defaults are denied in the platform config, and that the native call matches the choice made in the web banner.
131
+ - (e) **If** ads or remarketing are linked → check that the consent-management platform integrates consent mode (prefer a vendor-certified one), and that `ad_user_data` gates sharing of the user id and enhanced conversions.
132
+ - A wrong default, signal or lifecycle step goes to `bkit-audit-privacy`.
133
+
134
+ **Done when:** `Consent` holds the defaults, the no-choice capture and the lifecycle, or the skip.
135
+
136
+ - [ ] **Step 11 — Identity:** Check that login sets only an internal user id (never an email or other personal value), and only through the vendor's user-id mechanism (e.g., the GA4 `user_id` config parameter), never as an event parameter, user property or registered custom dimension. Check that it is sent on every page load while signed in. Check that logout sets it to null, not `""`, `" "` or `"null"`, and that a user who never signed in has no user id. Check that native mirrors login and logout. Check that one property stitches web and app (e.g., Blended or Observed identity), and that the household model is documented (e.g., as a low-cardinality user property). Never register a per-household or per-user id as a custom dimension. Verify sign-in, navigation and sign-out in preview (web) and the debug view (native), recording the user id's presence and shape, never its value. **If** the id is personal or survives logout → record a finding whose `Expected` routes it to a plan, and also to `bkit-audit-privacy` when personal data has left. **Done when:** `Identity` holds one row per stage: signed out · signed in · after logout · never signed in.
137
+ - [ ] **Step 12 — Firing:** Run each core flow (end-to-end or by hand), and compare the captured requests with `Events`. An event in code that never fires is dead tracking. An event that fires but is not in code is an auto-collection decision. A payload that does not match is a bug. On web, use the tag-manager preview and the network panel, and record for each flow the tags and consent state, the data layer at each push, and the outgoing hits. On native, use the debug view, and check that debug flags never ship in a release build. Check for one screen view per screen, with names or classes that match the web routes, and for the automatic events (e.g., `first_open`, `session_start`, Android `app_remove`). **Done when:** `Firing` holds one row per core flow: expected · captured · verdict.
138
+ - [ ] **Step 13 — Dashboards:** Check that vendor reports and conversions use events that exist, and that internal and test traffic is filtered out. On each run, record the share of unset pages and landing pages, the size of collapsed high-cardinality buckets, the unassigned channel and self-referrals, with the delta against the previous run. Check for an alert when a core-flow key event drops to zero between runs. Check that releases which change tracking are annotated. **If** a dashboard uses a dead event → record a finding whose `Expected` routes it to the owner, with the report and the event. **Done when:** `Dashboards` holds the quality shares, alerts and annotations.
139
+ - [ ] **Step 14 — Property:** Run this step only when there is a hosted property (e.g., GA4).
140
+ - Take a screenshot or an admin API dump for each setting, and name the property.
141
+ - (a) Check that retention is set deliberately (past the short default), along with reset-on-new-activity, against `bkit-audit-privacy`'s rules.
142
+ - (b) Check that internal and dev traffic filters are active (not in testing), that exclusions are permanent, and that app streams exclude CI, synthetic and test traffic at the source.
143
+ - (c) Check unwanted referrals: checkout, OAuth and auth hosts. Without them, sign-in and purchase credit is lost.
144
+ - (d) Check that each `Coverage` completion is a key event (and not a trivial one), that a counting method is chosen, and that the count is within the documented limit (record the limit).
145
+ - (e) Check that report parameters are registered as custom dimensions or metrics within limits, with no high-cardinality ids.
146
+ - (f) Check the automatic-collection toggles: form events cause noise in single-page apps, site-search parameter names must match, and download events may leak personal filenames.
147
+ - (g) Record the decision on signals and demographics, which risk thresholding.
148
+ - **If** thresholding hides core data → record that the fix is to turn them off or to use device identity.
149
+ - (h) Check granular location and device data, and user-provided data, per region. User-provided data stays off unless enhanced conversions are in use.
150
+ - (i) Check that the time zone and currency match the business, the session and engaged-session timers, and cross-domain tracking when the marketing domain differs from the app domain.
151
+ - **If** the vendor is not GA4 → check its equivalent settings, or skip.
152
+ - **If** a setting drifted and nobody decided it → record a finding whose `Expected` routes it to the owner, with the diff or screenshot.
153
+
154
+ **Done when:** `Property` holds one row per setting: value · decided · verdict.
155
+
156
+ - [ ] **Step 15 — Server Events:** List the events sent through the server protocol (e.g., subscription lifecycle webhooks, inbound messages, job outcomes). Check that each reuses the client id (web) or the app instance id (native), and sends a session id only within the vendor's window. Validate them through the vendor's debug endpoint. Check that the API secret is in the secrets store and rotated. Check that no event has a client twin unless both share a dedup key (e.g., `transaction_id`), and that subscription revenue comes from the webhook, not from a client success page. Check that the server strips personal data, because vendor redaction does not apply here. Check for a documented decision on a first-party script and a same-origin path (e.g., `/metrics`) through the host or CDN, with stripping in a server container. No decision is a finding. **If** it is adopted → check the domain, the production instance count against vendor guidance, and the strip rules. **Done when:** `Server Events` holds one row per event: client id reused · deduped · personal data stripped · verdict.
157
+ - [ ] **Step 16 — Campaigns:** Check for a written UTM taxonomy: a fixed lowercase vocabulary for source and medium, and a campaign id that matches the vendor's channel groups. Check that internal links carry no UTMs, and that invite, reply and reset links do. Check that auth redirects keep the parameters (e.g., `utm_*`, `gclid`, `gbraid`, `wbraid`) through sign-up → confirm → callback → first landing, and test a tagged sign-up through to its first page view or sign-up hit. Record the attribution model, the key-event lookback windows and the custom channel groups, including an assistant-referrer group for `bkit-audit-aio-seo`. For installs, check the store referrer, campaign links, and that deferred invite deep links reach the first open. **If** parameters are lost or email links are untagged → record a finding whose `Expected` routes it to a plan, and names the flow. **Done when:** `Campaigns` holds one row per item: written · tested · verdict.
158
+ - [ ] **Step 17 — Integrations:** **If** public pages exist → check that Search Console is linked. **If** a warehouse export exists → check that it goes to the project's observability stack, daily (plus streaming if needed), for all streams. Record its region, expiry and cost, and compare the daily volume with the export limit (record the limit), because chronically exceeding it risks a pause. For one processed day, compare the vendor UI count with the warehouse rows (device id identity, matched time zone). A gap within the documented range (e.g., 2-5%) is fine; a larger one is a finding. Check ads linking with auto-tagging and enhanced conversions only when there is paid acquisition; otherwise record "not linked". Check that native projects are linked, plus store billing when the app has in-app purchases. **If** a link is missing → record a finding whose `Expected` routes it to the owner. **Done when:** `Integrations` holds one row per link: linked / not linked / not applicable.
159
+ - [ ] **Step 18 — Standards:** Confirm the current version of each anchor standard, and read what changed since the previous report's version. Give `Standards Coverage` one row per consent signal, collection or config limit, user-id rule, tag-manager governance rule and server-protocol requirement, each marked checked (naming the step), not applicable (saying why) or finding. Mark each recommended practice the project does not apply as adopt (with a proposed step), reject (saying why) or not applicable. **Done when:** no row is empty.
160
+ - [ ] **Step 19 — Anything Else:** (a) Give a one-line verdict on each change since the previous report's commit that touches tracking: events, the data-layer wrapper, the container, the property or streams, the consent banner or mode, native config, server events or auth redirects. (b) In a bounded pass of about 30 minutes, note what a senior analytics engineer would flag that no step asks about. Read what happened since the previous run (incidents, `bkit-audit-logs` output, new `docs/failures.jsonl` rows, vendor status), and ask what no step would catch. **Done when:** `Beyond the Steps` holds both passes, or says `none`. **If** one class of issue is seen on 2 runs → propose a step for it in `Process Improvements`.
109
161
 
110
162
  ### 🔒 Gate 2: Probes Check
111
163
 
112
- - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
113
- - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
114
- - [ ] **No values:** no personal-data value anywhere in the report.
115
- - [ ] **Consoles untouched:** no container published, no property setting changed, no live collection hit sent.
116
- - [ ] **Gate 2 — Verified:** Every checkbox above independently verified and checked off.
164
+ - [ ] **Steps complete:** every step is `[x]`, or skipped with evidence that its surface is absent.
165
+ - [ ] **Evidence:** every finding cites evidence someone can check again, and the tool that produced it.
166
+ - [ ] **No values:** no personal-data value appears anywhere in the report.
167
+ - [ ] **No publish:** no container was published.
168
+ - [ ] **Property untouched:** no property setting changed.
169
+ - [ ] **No live hits:** no live collection hit was sent.
170
+ - [ ] **Gate 2 — Verified:** every item above holds.
117
171
 
118
172
  ## Findings
119
173
 
120
174
  <!-- prettier-ignore -->
121
175
  | Severity | Use |
122
176
  | --- | --- |
123
- | `CRITICAL` | Personal data already sent in an event, URL, or title; vendor request before any consent choice and no way to stop collection |
124
- | `HIGH` | Consent default not denied before the snippet; advanced consent mode; user id that is personal or survives logout; account deletion leaves analytics data; over-limit data dropped with no error; live container on a non-production deploy |
125
- | `MEDIUM` | Dead, duplicate, or misshapen event; client mismatch; no measurement plan; key event missing or trivial; filter left in testing; campaign parameters stripped; dashboard on a dead event |
126
- | `LOW` | Naming drift that changes no report; missing annotation; unused paused tag |
177
+ | `CRITICAL` | Personal data was already sent in an event, URL or title. A vendor request goes out before any consent choice, and there is no way to stop collection |
178
+ | `HIGH` | The consent default is not denied before the snippet. Advanced consent mode. A user id that is personal or survives logout. Account deletion leaves analytics data. Over-limit data dropped with no error. The live container on a non-production deploy |
179
+ | `MEDIUM` | A dead, duplicate or misshapen event. A mismatch between clients. No measurement plan. A key event missing or trivial. A filter left in testing. Campaign parameters stripped. A dashboard on a dead event |
180
+ | `LOW` | Naming drift that changes no report. A missing annotation. An unused paused tag |
127
181
 
128
- Within a severity: personal data / consent first. Personal data in an event, a tag that loads before consent, consent defaults that are not denied before the snippet, and a user id that is personal data are each at least `HIGH`. `Expected` names where it goes.
182
+ Within a severity, list personal-data and consent findings first. Each of these is at least `HIGH`: personal data in an event, a tag that loads before consent, consent defaults that are not denied before the snippet, and a user id that is personal data. Each finding's `Expected` names where it goes, from this table.
129
183
 
130
184
  <!-- prettier-ignore -->
131
185
  | Finding | Goes to |
@@ -151,7 +205,7 @@ Within a severity: personal data / consent first. Personal data in an event, a t
151
205
  | --- | --- | --- | --- | --- |
152
206
  | PENDING | PENDING | PENDING | PENDING | PENDING |
153
207
 
154
- Empty and clean → one row `None`.
208
+ **If** the run finds nothing → write one row: `None`.
155
209
 
156
210
  ## Report
157
211
 
@@ -240,13 +294,17 @@ PENDING
240
294
 
241
295
  ### 🔒 Gate 3: Report Check
242
296
 
243
- - [ ] **No placeholders:** no `PENDING` left
244
- - [ ] **Summary:** names count per severity, whether the audit applied, and the event-list change vs the previous run (or baseline).
245
- - [ ] **Series:** `Dashboards` shares and the `Container` diff beside previous report's, or marked baseline.
246
- - [ ] **Writes:** only this report, template `Project Instructions`, and ledger rows changed; throwaway worktrees / remote targets removed.
247
- - [ ] **Process Improvements:** `Universal` and `Project` filled
248
- - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID in exactly one row; every row has a `Next Step`.
249
- - [ ] **Gate 3 — Verified:** Every checkbox above independently verified and checked off.
297
+ - [ ] **No placeholders:** no `PENDING` is left.
298
+ - [ ] **Summary:** `Summary` gives the count per severity.
299
+ - [ ] **Applies:** `Summary` states whether the audit applied.
300
+ - [ ] **Event-list change:** `Summary` gives the event-list change against the previous run, or marks the run as baseline.
301
+ - [ ] **Series:** the `Dashboards` shares and the `Container` diff are shown beside the previous report's, or the run is marked baseline.
302
+ - [ ] **Writes:** this run changed only this report, the template's `Project Instructions` and its own `docs/failures.jsonl` rows.
303
+ - [ ] **Throwaways removed:** every throwaway worktree or remote target is removed.
304
+ - [ ] **Process Improvements:** `Universal` and `Project` are both filled.
305
+ - [ ] **Suggested Issues:** every `MEDIUM`+ finding ID is in exactly one `Suggested Issues` row.
306
+ - [ ] **Next Step:** every `Suggested Issues` row has a `Next Step`.
307
+ - [ ] **Gate 3 — Verified:** every item above holds.
250
308
 
251
309
  <!-- bkit:end -->
252
310