@cbartens/bkit 5.5.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/.bkit/README.md +30 -20
  2. package/.bkit/core/.agents/docs.md +1 -0
  3. package/.bkit/core/.agents/rules.md +51 -26
  4. package/.bkit/core/.bkit/README.md +29 -19
  5. package/.bkit/core/.bkit/authoring.md +117 -0
  6. package/.bkit/core/.bkit/cloud.md +11 -11
  7. package/.bkit/core/.bkit/comparison.md +5 -5
  8. package/.bkit/core/.bkit/install.md +20 -20
  9. package/.bkit/core/.bkit/jsonl.md +202 -122
  10. package/.bkit/core/.bkit/lite.md +1 -1
  11. package/.bkit/core/.bkit/pipeline.md +49 -52
  12. package/.bkit/core/.bkit/prompts.md +106 -167
  13. package/.bkit/core/.bkit/providers.md +29 -32
  14. package/.bkit/core/.bkit/templates.md +44 -18
  15. package/.bkit/core/.bkit/trackers.md +60 -28
  16. package/.bkit/core/.bkit/workflows.md +399 -359
  17. package/.bkit/core/AGENTS.md +16 -22
  18. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +14 -38
  19. package/.bkit/core/docs/templates/bkit-audit-adoption.md +16 -40
  20. package/.bkit/core/docs/templates/bkit-audit-agents.md +19 -43
  21. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +16 -40
  22. package/.bkit/core/docs/templates/bkit-audit-analytics.md +14 -38
  23. package/.bkit/core/docs/templates/bkit-audit-annotations.md +11 -35
  24. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +15 -39
  25. package/.bkit/core/docs/templates/bkit-audit-app-store.md +12 -36
  26. package/.bkit/core/docs/templates/bkit-audit-architecture.md +16 -40
  27. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +16 -40
  28. package/.bkit/core/docs/templates/bkit-audit-config.md +18 -42
  29. package/.bkit/core/docs/templates/bkit-audit-cost.md +16 -40
  30. package/.bkit/core/docs/templates/bkit-audit-coverage.md +15 -39
  31. package/.bkit/core/docs/templates/bkit-audit-database.md +16 -40
  32. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +15 -39
  33. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +15 -38
  34. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +16 -40
  35. package/.bkit/core/docs/templates/bkit-audit-documentation.md +11 -35
  36. package/.bkit/core/docs/templates/bkit-audit-duplication.md +18 -42
  37. package/.bkit/core/docs/templates/bkit-audit-failures.md +13 -37
  38. package/.bkit/core/docs/templates/bkit-audit-flakes.md +12 -36
  39. package/.bkit/core/docs/templates/bkit-audit-gates.md +14 -38
  40. package/.bkit/core/docs/templates/bkit-audit-issues.md +15 -39
  41. package/.bkit/core/docs/templates/bkit-audit-llm.md +16 -40
  42. package/.bkit/core/docs/templates/bkit-audit-logs.md +14 -38
  43. package/.bkit/core/docs/templates/bkit-audit-models.md +12 -36
  44. package/.bkit/core/docs/templates/bkit-audit-privacy.md +12 -36
  45. package/.bkit/core/docs/templates/bkit-audit-prompts.md +15 -39
  46. package/.bkit/core/docs/templates/bkit-audit-red-team.md +15 -39
  47. package/.bkit/core/docs/templates/bkit-audit-reliability.md +15 -39
  48. package/.bkit/core/docs/templates/bkit-audit-repo.md +12 -36
  49. package/.bkit/core/docs/templates/bkit-audit-security.md +13 -37
  50. package/.bkit/core/docs/templates/bkit-audit-slop.md +14 -38
  51. package/.bkit/core/docs/templates/bkit-audit-testing.md +12 -36
  52. package/.bkit/core/docs/templates/bkit-audit-usability.md +16 -40
  53. package/.bkit/core/docs/templates/bkit-plan.md +97 -226
  54. package/.bkit/core/engine/checks/after/ci-yml.ts +39 -30
  55. package/.bkit/core/engine/checks/after/github.ts +101 -72
  56. package/.bkit/core/engine/checks/after/index.ts +10 -12
  57. package/.bkit/core/engine/checks/after/suppression.ts +8 -5
  58. package/.bkit/core/engine/checks/after/tools.ts +47 -92
  59. package/.bkit/core/engine/checks/before/env.ts +2 -2
  60. package/.bkit/core/engine/checks/before/files.ts +5 -4
  61. package/.bkit/core/engine/checks/before/index.ts +18 -1
  62. package/.bkit/core/engine/checks/before/repo.ts +168 -2
  63. package/.bkit/core/engine/checks/tips/catalogue.ts +16 -5
  64. package/.bkit/core/engine/checks/tips/detect.ts +34 -0
  65. package/.bkit/core/engine/checks/tips/index.ts +10 -7
  66. package/.bkit/core/engine/cli.ts +20 -53
  67. package/.bkit/core/engine/commands/analysis.ts +171 -140
  68. package/.bkit/core/engine/commands/ci/ci.ts +6 -6
  69. package/.bkit/core/engine/commands/comply.ts +77 -103
  70. package/.bkit/core/engine/commands/install/doctor.ts +2 -2
  71. package/.bkit/core/engine/commands/install/install.ts +57 -18
  72. package/.bkit/core/engine/commands/install/uninstall.ts +65 -28
  73. package/.bkit/core/engine/commands/land.ts +18 -12
  74. package/.bkit/core/engine/commands/lib.ts +79 -17
  75. package/.bkit/core/engine/commands/registry.ts +4 -0
  76. package/.bkit/core/engine/commands/setup/setup.ts +7 -7
  77. package/.bkit/core/engine/commands/stats.ts +204 -0
  78. package/.bkit/core/engine/commands/tips.ts +10 -5
  79. package/.bkit/core/engine/commands/workflow/branches.ts +741 -62
  80. package/.bkit/core/engine/commands/workflow/challenge.ts +673 -0
  81. package/.bkit/core/engine/commands/workflow/context.ts +853 -29
  82. package/.bkit/core/engine/commands/workflow/counters.ts +267 -84
  83. package/.bkit/core/engine/commands/workflow/decisions.ts +541 -0
  84. package/.bkit/core/engine/commands/workflow/disk.ts +2 -2
  85. package/.bkit/core/engine/commands/workflow/fids.ts +793 -33
  86. package/.bkit/core/engine/commands/workflow/issues.ts +427 -105
  87. package/.bkit/core/engine/commands/workflow/ledgers.ts +884 -27
  88. package/.bkit/core/engine/commands/workflow/locks.ts +26 -2
  89. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +582 -0
  90. package/.bkit/core/engine/commands/workflow/plan-versions.ts +21 -0
  91. package/.bkit/core/engine/commands/workflow/prs.ts +166 -30
  92. package/.bkit/core/engine/commands/workflow/repo.ts +59 -7
  93. package/.bkit/core/engine/commands/workflow/roadmap.ts +16 -7
  94. package/.bkit/core/engine/commands/workflow/run-facts.ts +501 -0
  95. package/.bkit/core/engine/commands/workflow/runs.ts +179 -49
  96. package/.bkit/core/engine/commands/workflow/runtime.ts +22 -1
  97. package/.bkit/core/engine/commands/workflow/status.ts +142 -29
  98. package/.bkit/core/engine/commands/workflow/step-table.ts +339 -0
  99. package/.bkit/core/engine/commands/workflow/steps.ts +213 -88
  100. package/.bkit/core/engine/commands/workflow/summary.ts +398 -0
  101. package/.bkit/core/engine/commands/workflow/tests.ts +1013 -148
  102. package/.bkit/core/engine/commands/workflow/tracker.ts +1195 -0
  103. package/.bkit/core/engine/commands/workflow/workflows.ts +984 -207
  104. package/.bkit/core/engine/commands/workflow/workstreams.ts +11 -5
  105. package/.bkit/core/engine/commands/workflow/worktrees.ts +276 -22
  106. package/.bkit/core/engine/install/manifest.ts +11 -9
  107. package/.bkit/core/engine/install/modules/cloud.ts +21 -13
  108. package/.bkit/core/engine/install/modules/core.ts +325 -7
  109. package/.bkit/core/engine/install/modules/opencode.ts +2 -2
  110. package/.bkit/core/engine/install/version-file.ts +6 -2
  111. package/.bkit/core/engine/ledgers/migrate.ts +92 -0
  112. package/.bkit/core/engine/ledgers/status.ts +92 -15
  113. package/.bkit/core/engine/ledgers/telemetry.ts +1261 -254
  114. package/.bkit/core/engine/render/hosts.ts +4 -0
  115. package/.bkit/core/engine/render/models.ts +12 -0
  116. package/.bkit/core/engine/shared/branches.ts +4 -1
  117. package/.bkit/core/engine/shared/egress.ts +7 -0
  118. package/.bkit/core/engine/shared/json.ts +25 -7
  119. package/.bkit/core/engine/shared/settings.ts +202 -33
  120. package/.bkit/core/engine/shared/text.ts +361 -0
  121. package/.bkit/core/engine/tools/grammar-density.ts +215 -0
  122. package/.bkit/core/engine/tools/instructions-sources.ts +834 -0
  123. package/.bkit/core/engine/tools/instructions.ts +1751 -0
  124. package/.bkit/core/hooks/gateguard-engine.js +24 -23
  125. package/.bkit/core/hooks/guardrails-shell.js +2 -3
  126. package/.bkit/core/hooks/guardrails-tiers.js +7 -1
  127. package/.bkit/core/hooks/readguard-engine.js +2 -2
  128. package/.bkit/core/prompts/bkit-audit-generate.md +62 -25
  129. package/.bkit/core/prompts/bkit-build-challenge-1.md +40 -17
  130. package/.bkit/core/prompts/bkit-build-challenge-2.md +44 -17
  131. package/.bkit/core/prompts/bkit-build-install-skills.md +26 -13
  132. package/.bkit/core/prompts/bkit-build-plan-convert.md +74 -0
  133. package/.bkit/core/prompts/bkit-build-plan-current.md +26 -13
  134. package/.bkit/core/prompts/bkit-build-plan-execute.md +74 -26
  135. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +64 -23
  136. package/.bkit/core/prompts/bkit-build-plan-verify.md +57 -33
  137. package/.bkit/core/prompts/bkit-debug-abort-handover.md +30 -14
  138. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +34 -14
  139. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +34 -17
  140. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +26 -13
  141. package/.bkit/core/prompts/bkit-debug-failure-soak.md +31 -16
  142. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +21 -11
  143. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +20 -11
  144. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +20 -11
  145. package/.bkit/core/prompts/bkit-design-generate.md +33 -13
  146. package/.bkit/core/prompts/bkit-design-organise.md +25 -12
  147. package/.bkit/core/prompts/bkit-design-review-1.md +31 -15
  148. package/.bkit/core/prompts/bkit-design-review-2.md +28 -13
  149. package/.bkit/core/prompts/bkit-design-spike.md +30 -13
  150. package/.bkit/core/prompts/bkit-design-update.md +33 -19
  151. package/.bkit/core/prompts/bkit-plan-generate.md +75 -19
  152. package/.bkit/core/prompts/bkit-plan-review-1.md +50 -27
  153. package/.bkit/core/prompts/bkit-plan-review-2.md +59 -28
  154. package/.bkit/core/prompts/bkit-plan-scope-check.md +109 -0
  155. package/.bkit/core/prompts/bkit-plan-update.md +61 -24
  156. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +27 -15
  157. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +31 -16
  158. package/.bkit/core/prompts/bkit-ship-update-docs.md +30 -15
  159. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +24 -14
  160. package/.bkit/core/prompts/bkit-utility-update-decisions.md +32 -14
  161. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +29 -14
  162. package/.bkit/core/prompts/bkit-utility-update-documentation.md +28 -13
  163. package/.bkit/core/prompts/bkit-utility-update-failures.md +31 -14
  164. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +33 -14
  165. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +38 -17
  166. package/.bkit/core/prompts/bkit-utility-update-tracker.md +43 -20
  167. package/.bkit/core/workflows/bkit-auto.md +54 -46
  168. package/.bkit/core/workflows/bkit-build.md +577 -458
  169. package/.bkit/core/workflows/bkit-debug.md +348 -333
  170. package/.bkit/core/workflows/bkit-design.md +201 -237
  171. package/.bkit/core/workflows/bkit-plan.md +210 -321
  172. package/.bkit/core/workflows/bkit-ship.md +328 -278
  173. package/.bkit/shared/.bkit/.env.example +2 -2
  174. package/.bkit/shared/.claude/settings.json +11 -0
  175. package/.bkit/shared/.cursor/mcp.json +1 -1
  176. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +1 -1
  177. package/.bkit/shared/.gitattributes +1 -1
  178. package/.bkit/shared/.mcp.json +1 -1
  179. package/.bkit/shared/.opencode/opencode.json +11 -0
  180. package/.bkit/shared/CLAUDE.md +2 -2
  181. package/.bkit/shared/GEMINI.md +2 -2
  182. package/.bkit/shared/docs/architecture.md +1 -1
  183. package/.bkit/shared/docs/data-schema.md +1 -1
  184. package/.bkit/shared/docs/deployments.md +16 -28
  185. package/.bkit/shared/docs/design.md +1 -1
  186. package/.bkit/shared/docs/noise.md +1 -1
  187. package/.bkit/shared/docs/observability.md +2 -2
  188. package/.bkit/shared/docs/security.md +1 -1
  189. package/.bkit/shared/docs/setup.md +1 -1
  190. package/.bkit/shared/docs/technology.md +1 -1
  191. package/.bkit/shared/docs/testing.md +27 -10
  192. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +1 -1
  193. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +26 -5
  194. package/.bkit/templates/.github/workflows/bkit-ci.yml +22 -84
  195. package/.bkit/templates/.github/workflows/bkit-cloud.yml +21 -19
  196. package/.bkit/templates/.husky/pre-push +52 -13
  197. package/.bkit/templates/.prettierignore +7 -0
  198. package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +194 -0
  199. package/.bkit/templates/scripts/ci/check-capstone.mjs +2 -4
  200. package/.bkit/templates/scripts/ci/check-capstone.test.mjs +4 -23
  201. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +104 -23
  202. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +103 -6
  203. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +1 -1
  204. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +3 -1
  205. package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +49 -29
  206. package/CHANGELOG.md +142 -0
  207. package/README.md +58 -34
  208. package/dist/checks/after/ci-yml.js +39 -29
  209. package/dist/checks/after/github.js +99 -72
  210. package/dist/checks/after/index.js +11 -13
  211. package/dist/checks/after/suppression.js +8 -5
  212. package/dist/checks/after/tools.js +40 -83
  213. package/dist/checks/before/env.js +2 -2
  214. package/dist/checks/before/files.js +5 -3
  215. package/dist/checks/before/index.js +15 -2
  216. package/dist/checks/before/repo.js +163 -2
  217. package/dist/checks/tips/catalogue.js +14 -5
  218. package/dist/checks/tips/detect.js +32 -0
  219. package/dist/checks/tips/index.js +7 -5
  220. package/dist/cli.js +19 -47
  221. package/dist/commands/analysis.js +109 -100
  222. package/dist/commands/ci/ci.js +6 -6
  223. package/dist/commands/comply.js +54 -91
  224. package/dist/commands/install/doctor.js +2 -2
  225. package/dist/commands/install/install.js +50 -19
  226. package/dist/commands/install/uninstall.js +59 -28
  227. package/dist/commands/land.js +16 -12
  228. package/dist/commands/lib.js +51 -16
  229. package/dist/commands/registry.js +4 -0
  230. package/dist/commands/setup/setup.js +7 -7
  231. package/dist/commands/stats.js +136 -0
  232. package/dist/commands/tips.js +7 -3
  233. package/dist/commands/workflow/branches.js +656 -56
  234. package/dist/commands/workflow/challenge.js +556 -0
  235. package/dist/commands/workflow/context.js +709 -30
  236. package/dist/commands/workflow/counters.js +208 -75
  237. package/dist/commands/workflow/decisions.js +441 -0
  238. package/dist/commands/workflow/disk.js +2 -2
  239. package/dist/commands/workflow/fids.js +689 -33
  240. package/dist/commands/workflow/issues.js +362 -99
  241. package/dist/commands/workflow/ledgers.js +762 -27
  242. package/dist/commands/workflow/locks.js +24 -2
  243. package/dist/commands/workflow/plan-blocks.js +437 -0
  244. package/dist/commands/workflow/plan-versions.js +22 -0
  245. package/dist/commands/workflow/prs.js +142 -32
  246. package/dist/commands/workflow/repo.js +52 -7
  247. package/dist/commands/workflow/roadmap.js +9 -7
  248. package/dist/commands/workflow/run-facts.js +426 -0
  249. package/dist/commands/workflow/runs.js +144 -43
  250. package/dist/commands/workflow/runtime.js +12 -1
  251. package/dist/commands/workflow/status.js +130 -29
  252. package/dist/commands/workflow/step-table.js +276 -0
  253. package/dist/commands/workflow/steps.js +171 -80
  254. package/dist/commands/workflow/summary.js +275 -0
  255. package/dist/commands/workflow/tests.js +834 -136
  256. package/dist/commands/workflow/tracker.js +983 -0
  257. package/dist/commands/workflow/workflows.js +834 -195
  258. package/dist/commands/workflow/workstreams.js +11 -5
  259. package/dist/commands/workflow/worktrees.js +221 -22
  260. package/dist/install/manifest.js +11 -9
  261. package/dist/install/modules/cloud.js +22 -13
  262. package/dist/install/modules/core.js +326 -7
  263. package/dist/install/modules/opencode.js +2 -2
  264. package/dist/install/version-file.js +6 -2
  265. package/dist/ledgers/migrate.js +81 -0
  266. package/dist/ledgers/status.js +61 -8
  267. package/dist/ledgers/telemetry.js +905 -124
  268. package/dist/render/hosts.js +4 -0
  269. package/dist/render/models.js +12 -0
  270. package/dist/shared/branches.js +3 -1
  271. package/dist/shared/egress.js +7 -0
  272. package/dist/shared/json.js +20 -7
  273. package/dist/shared/settings.js +147 -26
  274. package/dist/shared/text.js +333 -0
  275. package/dist/tools/grammar-density.js +183 -0
  276. package/dist/tools/instructions-sources.js +721 -0
  277. package/dist/tools/instructions.js +1579 -0
  278. package/package.json +114 -23
  279. package/.bkit/core/engine/commands/harvest.ts +0 -459
  280. package/.bkit/core/engine/tools/wording.ts +0 -748
  281. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
  282. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
  283. package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
  284. package/.bkit/core/prompts/bkit-build-summary.md +0 -94
  285. package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
  286. package/.bkit/core/prompts/bkit-design-summary.md +0 -107
  287. package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
  288. package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
  289. package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
  290. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
  291. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
  292. package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
  293. package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
  294. package/.bkit/templates/scripts/ci/lanes/check-tree-cache.mjs +0 -138
  295. package/.bkit/templates/scripts/ci/lanes/check-tree-cache.test.mjs +0 -181
  296. package/dist/commands/harvest.js +0 -353
  297. package/dist/tools/wording.js +0 -680
@@ -83,29 +83,7 @@ jobs:
83
83
  echo "🔊 [verbose ci] marker active — escalating log detail"
84
84
  echo "DEBUG=vercel:*,supabase:*" >> "$GITHUB_ENV"
85
85
 
86
- # Pull requests only: the suite skips when this PR's files already passed a push run
87
- # (scripts/ci/lanes/check-tree-cache.mjs). A push or dispatch run always runs it, and so
88
- # does [force build] / [force cache] in the PR title.
89
- - name: Check Tree Cache
90
- id: cache
91
- env:
92
- GH_TOKEN: ${{ github.token }}
93
- REPO: ${{ github.repository }}
94
- EVENT_NAME: ${{ github.event_name }}
95
- JOB: ${{ github.job }}
96
- # User-controlled text (PR title) arrives via env: (runtime expansion,
97
- # injection-safe) — never inlined into the run: body.
98
- PR_TITLE: ${{ github.event.pull_request.title }}
99
- run: |
100
- if [ -f scripts/ci/lanes/check-tree-cache.mjs ]; then
101
- node scripts/ci/lanes/check-tree-cache.mjs >> "$GITHUB_OUTPUT"
102
- else
103
- echo "skip=false" >> "$GITHUB_OUTPUT"
104
- echo "::notice::scripts/ci/lanes/check-tree-cache.mjs not copied — running the suite."
105
- fi
106
-
107
86
  - name: Detect Direct Push
108
- if: steps.cache.outputs.skip != 'true'
109
87
  id: detect
110
88
  env:
111
89
  GH_TOKEN: ${{ github.token }}
@@ -176,7 +154,7 @@ jobs:
176
154
  # pre-planner shape (pull_request only). Once bkit-tests-scope exists, run this on every event
177
155
  # against the planner base. deployments.md § One run. To enable: uncomment and delete this header.
178
156
  # - name: Assert Migrations Immutable
179
- # if: github.event_name == 'pull_request' && steps.cache.outputs.skip != 'true'
157
+ # if: github.event_name == 'pull_request'
180
158
  # run: |
181
159
  # git fetch origin "${{ github.base_ref }}" --depth=50 2>/dev/null || true
182
160
  # CHANGED=$(git diff --name-only "origin/${{ github.base_ref }}..HEAD" -- supabase/migrations/ 2>/dev/null || true)
@@ -190,7 +168,6 @@ jobs:
190
168
  # exit $EXIT
191
169
 
192
170
  - name: Install Dependencies
193
- if: steps.cache.outputs.skip != 'true'
194
171
  run: pnpm install --frozen-lockfile
195
172
 
196
173
  # Static checks first — they read the source tree and must scan it CLEAN.
@@ -199,19 +176,16 @@ jobs:
199
176
  # Keep this group (typecheck → lint → prettier → vale → slop → bkit check) ahead of
200
177
  # the test/build group if you reorder.
201
178
  - name: Run Typecheck
202
- if: steps.cache.outputs.skip != 'true'
203
179
  env:
204
180
  TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
205
181
  run: pnpm typecheck
206
182
 
207
183
  - name: Run Lint
208
- if: steps.cache.outputs.skip != 'true'
209
184
  env:
210
185
  TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
211
186
  run: pnpm lint
212
187
 
213
188
  - name: Run Prettier
214
- if: steps.cache.outputs.skip != 'true'
215
189
  env:
216
190
  TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
217
191
  run: pnpm format:check
@@ -220,7 +194,6 @@ jobs:
220
194
  # `pnpm lint:prose` guard-skips (write-good missing) and the prose gate is silently
221
195
  # dead. Pinned tarball + `vale sync` (else E100: write-good missing).
222
196
  - name: Install Vale
223
- if: steps.cache.outputs.skip != 'true'
224
197
  env:
225
198
  # renovate: datasource=github-releases depName=errata-ai/vale
226
199
  VALE_VERSION: "3.9.1"
@@ -240,18 +213,16 @@ jobs:
240
213
  done
241
214
 
242
215
  - name: Run Vale Prose Lint
243
- if: steps.cache.outputs.skip != 'true'
244
216
  run: pnpm lint:prose
245
217
 
246
218
  - name: Run Slop Scan
247
- if: steps.cache.outputs.skip != 'true'
248
219
  run: pnpm lint:slop
249
220
 
250
221
  # The ENFORCING slop gate (lint:slop above is an advisory full-scan that never fails).
251
222
  # PR-only: materialises the PR base as a worktree and fails on findings this PR ADDS or
252
223
  # WORSENS vs base. Needs fetch-depth: 0 (set on checkout) so the base SHA is present.
253
224
  - name: Run Slop Delta
254
- if: steps.cache.outputs.skip != 'true' && github.event_name == 'pull_request'
225
+ if: github.event_name == 'pull_request'
255
226
  env:
256
227
  BASE_SHA: ${{ github.event.pull_request.base.sha }}
257
228
  run: pnpm slop:delta "$BASE_SHA"
@@ -260,7 +231,6 @@ jobs:
260
231
  # (${{ }} expression syntax, shellcheck on run: blocks). A YAML linter accepts
261
232
  # workflows that are valid YAML but invalid GHA; actionlint catches that class.
262
233
  - name: Run actionlint
263
- if: steps.cache.outputs.skip != 'true'
264
234
  run: |
265
235
  # Script pinned to the v1.7.12 commit SHA (the git tag is mutable/forgeable); the binary version
266
236
  # is pinned separately via the 1.7.12 arg passed to the script below.
@@ -275,7 +245,6 @@ jobs:
275
245
  "$RUNNER_TEMP/actionlint" -color
276
246
 
277
247
  - name: Run bkit Check
278
- if: steps.cache.outputs.skip != 'true'
279
248
  run: pnpm bkit check
280
249
 
281
250
  # Dependency-audit gate: fails on a high or critical advisory in the lockfile that
@@ -283,7 +252,7 @@ jobs:
283
252
  # Self-skips when the guard is absent — a repo that did not adopt
284
253
  # scripts/ci/check-dependency-audit.mjs is a no-op. deployments.md § Dependency updaters.
285
254
  - name: Check Dependency Audit
286
- if: steps.cache.outputs.skip != 'true' && hashFiles('scripts/ci/check-dependency-audit.mjs') != ''
255
+ if: hashFiles('scripts/ci/check-dependency-audit.mjs') != ''
287
256
  run: node scripts/ci/check-dependency-audit.mjs
288
257
 
289
258
  # Capability-register freshness gate: rebuild the graph with graphify and fail when
@@ -294,13 +263,13 @@ jobs:
294
263
  # Push events only — a pull_request checkout is the MERGE ref, whose tree (base + head)
295
264
  # can differ from the head the register was built against: a false red no author can clear.
296
265
  - name: Setup uv
297
- if: steps.cache.outputs.skip != 'true' && github.event_name == 'push' && hashFiles('scripts/graphify/bkit-graphify.sh') != ''
266
+ if: github.event_name == 'push' && hashFiles('scripts/graphify/bkit-graphify.sh') != ''
298
267
  uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
299
268
  with:
300
269
  version: "0.13.0"
301
270
 
302
271
  - name: Check Capability Register
303
- if: steps.cache.outputs.skip != 'true' && github.event_name == 'push' && hashFiles('scripts/graphify/bkit-graphify.sh') != ''
272
+ if: github.event_name == 'push' && hashFiles('scripts/graphify/bkit-graphify.sh') != ''
304
273
  # graphify release pinned once: GRAPHIFY_SPEC in bkit-graphify.sh. Same release here,
305
274
  # in the pre-push gate and by hand.
306
275
  run: |
@@ -314,10 +283,8 @@ jobs:
314
283
  # and remote db push move out of this job when you adopt the scaffold below.
315
284
  bkit-tests-unit:
316
285
  runs-on: ubuntu-latest
317
- # bkit-tests-check reads both: cache_skip (a tree-cache short-circuit asserts no count)
318
- # and tests_ran (the executed-test count the Run Unit Tests step writes).
286
+ # bkit-tests-check reads tests_ran (the executed-test count the Run Unit Tests step writes).
319
287
  outputs:
320
- cache_skip: ${{ steps.cache.outputs.skip }}
321
288
  tests_ran: ${{ steps.unit.outputs.ran }}
322
289
  # Env vars duplicated from bkit-tests-static's job-level `env:`.
323
290
  # See the comment above that `env:` in bkit-tests-static — NODE_OPTIONS is a
@@ -346,29 +313,7 @@ jobs:
346
313
  echo "🔊 [verbose ci] marker active — escalating log detail"
347
314
  echo "DEBUG=vercel:*,supabase:*" >> "$GITHUB_ENV"
348
315
 
349
- # Pull requests only: the suite skips when this PR's files already passed a push run
350
- # (scripts/ci/lanes/check-tree-cache.mjs). A push or dispatch run always runs it, and so
351
- # does [force build] / [force cache] in the PR title.
352
- - name: Check Tree Cache
353
- id: cache
354
- env:
355
- GH_TOKEN: ${{ github.token }}
356
- REPO: ${{ github.repository }}
357
- EVENT_NAME: ${{ github.event_name }}
358
- JOB: ${{ github.job }}
359
- # User-controlled text (PR title) arrives via env: (runtime expansion,
360
- # injection-safe) — never inlined into the run: body.
361
- PR_TITLE: ${{ github.event.pull_request.title }}
362
- run: |
363
- if [ -f scripts/ci/lanes/check-tree-cache.mjs ]; then
364
- node scripts/ci/lanes/check-tree-cache.mjs >> "$GITHUB_OUTPUT"
365
- else
366
- echo "skip=false" >> "$GITHUB_OUTPUT"
367
- echo "::notice::scripts/ci/lanes/check-tree-cache.mjs not copied — running the suite."
368
- fi
369
-
370
316
  - name: Detect Direct Push
371
- if: steps.cache.outputs.skip != 'true'
372
317
  id: detect
373
318
  env:
374
319
  GH_TOKEN: ${{ github.token }}
@@ -395,7 +340,7 @@ jobs:
395
340
 
396
341
  # bkit-stub:auto-force-e2e — Auto-trigger the full lane (E2E etc.) for PRs touching sensitive paths. Orthogonal to the [force full] marker (sets needs_e2e, OR'd with should_run_full at the e2e gate). To enable: uncomment the step below and delete this stub header.
397
342
  # - name: Auto Force E2E for Sensitive Paths
398
- # if: github.event_name == 'pull_request' && steps.cache.outputs.skip != 'true'
343
+ # if: github.event_name == 'pull_request'
399
344
  # id: e2e-paths
400
345
  # run: |
401
346
  # git fetch origin "${{ github.base_ref }}" --depth=1 2>/dev/null || true
@@ -408,7 +353,6 @@ jobs:
408
353
  # done
409
354
 
410
355
  - name: Install Dependencies
411
- if: steps.cache.outputs.skip != 'true'
412
356
  run: pnpm install --frozen-lockfile
413
357
 
414
358
  # bkit-stub:supabase-migrate — REMOTE `db push` belongs in `bkit-tests-migration`, NOT here
@@ -419,7 +363,7 @@ jobs:
419
363
  # legacy single-job shape only (no migration lane yet): uncomment below, set SUPABASE_*
420
364
  # secrets, delete this stub header — then migrate the step into bkit-tests-migration ASAP.
421
365
  # - name: Apply Supabase Migrations to Dev
422
- # if: github.event_name == 'push' && github.ref == 'refs/heads/dev' && steps.cache.outputs.skip != 'true'
366
+ # if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
423
367
  # env:
424
368
  # SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
425
369
  # SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DEV_DB_PASSWORD }}
@@ -438,14 +382,12 @@ jobs:
438
382
  # * @live catalog-RPC (JOB 3) — validates the REAL deployed schema in bkit-tests-live-web. Recommended default once you have a deploy + @live tier (RLS/tenancy especially: a passing fixture check is not evidence prod is locked down).
439
383
  # To enable pgTAP: uncomment, add pgTAP files under supabase/tests/, delete this stub header.
440
384
  # - name: Run DB Tests (pgTAP)
441
- # if: steps.cache.outputs.skip != 'true'
442
385
  # run: pnpm dlx supabase db test # spins up the local DB and runs supabase/tests/*.sql via pg_prove
443
386
  # @live route: a SECURITY DEFINER, service_role-only catalog RPC (e.g. public.rls_coverage_gaps()) called over
444
387
  # REST — direct port-5432 from CI runners is IPv4-flaky. Home: bkit-tests-live-web. docs/testing.md § Schema-invariant DB checks.
445
388
 
446
389
  # bkit-stub:test-presence — Warn on packages with a test script but zero *.test.ts files. To enable: uncomment the step below and delete this stub header.
447
390
  # - name: Check Test Presence
448
- # if: steps.cache.outputs.skip != 'true'
449
391
  # run: |
450
392
  # for pkg in $(jq -r '.workspaces // [] | .[]' package.json 2>/dev/null) $(ls -d packages/*/ apps/*/ 2>/dev/null); do
451
393
  # [ -f "$pkg/package.json" ] || continue
@@ -457,7 +399,6 @@ jobs:
457
399
 
458
400
  - name: Run Unit Tests
459
401
  id: unit
460
- if: steps.cache.outputs.skip != 'true'
461
402
  env:
462
403
  TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
463
404
  # Write the executed-test count as the step output `ran` so bkit-tests-check can
@@ -467,7 +408,6 @@ jobs:
467
408
  run: pnpm test
468
409
 
469
410
  - name: Run Integration Tests
470
- if: steps.cache.outputs.skip != 'true'
471
411
  env:
472
412
  TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
473
413
  run: |
@@ -510,10 +450,9 @@ jobs:
510
450
  # and rarely drives every branch). For a real integration %, add --coverage.include='src/server/**'
511
451
  # (a CLI flag on the integration run, same idiom as --exclude above) to scope it to the integration
512
452
  # surface THEN set a floor, or ratchet from current — never a picked number. See docs/testing.md § Coverage on PRs.
513
- # 4. JOB-LEVEL permissions on bkit-tests-unit. Job-level REPLACES the workflow-level block (not additive), and the
514
- # Check Tree Cache step reads runs and jobs, so you MUST re-include actions: read or the cache step breaks:
453
+ # 4. JOB-LEVEL permissions on bkit-tests-unit. Job-level REPLACES the workflow-level block (not additive), so
454
+ # re-include contents: read or the checkout breaks:
515
455
  # permissions:
516
- # actions: read
517
456
  # contents: read
518
457
  # pull-requests: write # required to post/update the sticky PR coverage comments
519
458
  # SEPARATE LANES: this stub wires both reports into bkit-tests-unit (the combined starter). If you run
@@ -532,7 +471,7 @@ jobs:
532
471
  # # Every event, including a red unit run (reportOnFailure keeps the summary): writes the coverage table, with
533
472
  # # the floor as its target, to the job summary; comments on same-repo PRs only. No floor yet → drop
534
473
  # # vite-config-path (a missing file only warns, on every run).
535
- # if: ${{ !cancelled() && steps.cache.outputs.skip != 'true' && hashFiles('coverage/unit/coverage-summary.json') != '' }}
474
+ # if: ${{ !cancelled() && hashFiles('coverage/unit/coverage-summary.json') != '' }}
536
475
  # uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
537
476
  # with:
538
477
  # name: unit
@@ -544,7 +483,7 @@ jobs:
544
483
  # github-token: ${{ secrets.GITHUB_TOKEN }}
545
484
  # - name: Report Integration Coverage on PR
546
485
  # # hashFiles guard: skip cleanly when the repo has no integration tier (no coverage/integration report produced).
547
- # if: steps.cache.outputs.skip != 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && hashFiles('coverage/integration/coverage-summary.json') != ''
486
+ # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && hashFiles('coverage/integration/coverage-summary.json') != ''
548
487
  # uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
549
488
  # with:
550
489
  # name: integration
@@ -557,7 +496,7 @@ jobs:
557
496
  # Once bkit-tests-build-web publishes deployment_url, E2E reads TEST_URL from that output and this stub stays off.
558
497
  # To enable the pre-split shape: uncomment, set the host secrets, delete this header.
559
498
  # - name: Await Vercel Preview
560
- # if: github.event_name == 'pull_request' && steps.cache.outputs.skip != 'true'
499
+ # if: github.event_name == 'pull_request'
561
500
  # id: vercel
562
501
  # env:
563
502
  # VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
@@ -599,7 +538,7 @@ jobs:
599
538
  # surfaces them.
600
539
  # - name: Run E2E Tests
601
540
  # id: e2e
602
- # if: (steps.detect.outputs.should_run_full == 'true' || steps.e2e-paths.outputs.needs_e2e == 'true') && steps.cache.outputs.skip != 'true'
541
+ # if: (steps.detect.outputs.should_run_full == 'true' || steps.e2e-paths.outputs.needs_e2e == 'true')
603
542
  # env:
604
543
  # TARGET_URL: ${{ steps.vercel.outputs.target_url || 'http://localhost:3000' }}
605
544
  # run: |
@@ -630,13 +569,13 @@ jobs:
630
569
  # entryFilter/sourceFilter to the surface E2E is meant to cover, THEN ratchet from current — never a picked number.
631
570
  # See docs/testing.md § E2E coverage on PRs.
632
571
  # Permissions/forks/pin: this step runs in the SAME bkit-tests-unit job as bkit-stub:coverage, so it REUSES that
633
- # stub's job-level permissions block (pull-requests: write + actions: read + contents: read) — if you enable
572
+ # stub's job-level permissions block (pull-requests: write + contents: read) — if you enable
634
573
  # e2e-coverage WITHOUT the unit/integration coverage, add that same job-level block or the comment cannot post.
635
574
  # The head.repo == repo guard skips fork PRs (read-only GITHUB_TOKEN); the action is SHA-pinned to a commit
636
575
  # (# vX.Y.Z comment) per best practice, kept current by your updater (Renovate/Dependabot).
637
576
  # - name: Report E2E Coverage on PR
638
577
  # # Same gate as Run E2E Tests (coverage exists only if E2E ran); hashFiles skips repos that produced no E2E report.
639
- # if: (steps.detect.outputs.should_run_full == 'true' || steps.e2e-paths.outputs.needs_e2e == 'true') && steps.cache.outputs.skip != 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && hashFiles('coverage/e2e/coverage-summary.json') != ''
578
+ # if: (steps.detect.outputs.should_run_full == 'true' || steps.e2e-paths.outputs.needs_e2e == 'true') && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && hashFiles('coverage/e2e/coverage-summary.json') != ''
640
579
  # uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
641
580
  # with:
642
581
  # name: e2e
@@ -666,7 +605,7 @@ jobs:
666
605
  # ── bkit-tests-check ──────────────────────────────────────────────────────
667
606
  # Capstone and sole branch-protection required check. `bkit runs gate` (/bkit-ship) merges
668
607
  # only when this job is present and green at the head; `bkit setup protect-main` requires
669
- # it. Its name is `package.json` `bkit.capstoneJob` (default bkit-tests-check).
608
+ # it. Its name is `package.json` `bkit.testing.ciCapstone` (default bkit-tests-check).
670
609
  # needs: every lane — a lane missing here cannot red the capstone. if: !cancelled(), never
671
610
  # always(): a concurrency cancel must not stamp a failure. Each lane must succeed; a failed,
672
611
  # skipped or cancelled lane reds it. A lane that writes an executed-test count must have run
@@ -687,17 +626,16 @@ jobs:
687
626
  - name: Assert Lanes Passed
688
627
  # The verdict is scripts/ci/check-capstone.mjs (copy it with this file from
689
628
  # .bkit/templates/scripts/ci/; check-capstone.test.mjs tests it). Every lane in LANES
690
- # must succeed; a lane with a *_RAN variable must have run more than 0 tests unless
691
- # cache_skip=true. EMPTY_COUNT=warn: a lane that writes no count yet warns instead of
692
- # failing; delete it once every counted lane writes one. Add each lane you adopt to
693
- # LANES and to its *_RESULT / *_RAN / *_CACHE_SKIP variables.
629
+ # must succeed; a lane with a *_RAN variable must have run more than 0 tests.
630
+ # EMPTY_COUNT=warn: a lane that writes no count yet warns instead of failing; delete it
631
+ # once every counted lane writes one. Add each lane you adopt to LANES and to its
632
+ # *_RESULT / *_RAN variables.
694
633
  env:
695
634
  LANES: static,unit
696
635
  EMPTY_COUNT: warn
697
636
  STATIC_RESULT: ${{ needs.bkit-tests-static.result }}
698
637
  UNIT_RESULT: ${{ needs.bkit-tests-unit.result }}
699
638
  UNIT_RAN: ${{ needs.bkit-tests-unit.outputs.tests_ran }}
700
- UNIT_CACHE_SKIP: ${{ needs.bkit-tests-unit.outputs.cache_skip }}
701
639
  run: |
702
640
  if [ ! -f scripts/ci/check-capstone.mjs ]; then
703
641
  echo "::error::scripts/ci/check-capstone.mjs is missing. Copy it from .bkit/templates/scripts/ci/ into scripts/ci/; without it bkit-tests-check cannot tell a green lane from a lane that ran no tests."
@@ -887,7 +825,7 @@ jobs:
887
825
  # (own checkout/setup/install); gate heavy steps on web_affected; emit integration_ran; the
888
826
  # bkit-stub:coverage integration report (report-only, name: integration) posts from HERE, not bkit-tests-unit.
889
827
  # bkit-tests-integration: needs:[bkit-tests-scope]; if: run_level != 'none'; timeout-minutes: 20
890
- # # own job-level permissions: { actions: read, contents: read, pull-requests: write } for the coverage comment.
828
+ # # own job-level permissions: { contents: read, pull-requests: write } for the coverage comment.
891
829
  # steps: Checkout / Setup pnpm+Node / Install → Build (if needed) → Run Integration Tests
892
830
  # (id: vitest; --continue so one failure doesn't mask the rest; --reporter=json → integration_ran) →
893
831
  # Report Integration Coverage on PR (davelosert, name: integration). Step detail: JOB 2 catalogue above.
@@ -18,7 +18,7 @@ name: bkit-cloud
18
18
  # - workflow_run (CI completion on feat/**): success -> ship, failure -> debug
19
19
  # - workflow_run (CI completion on dev): success -> no-op (regression check passed),
20
20
  # failure -> /bkit-debug {FID} (FID recovered from squash-merge commit scope;
21
- # loop-bounded by MAX_DEV_DISPATCH_ATTEMPTS). [skip ci] close commits never trigger CI.
21
+ # capped at debug fix + soak maxAttempts dispatches). [skip ci] close commits never trigger CI.
22
22
  # - workflow_dispatch: pick ANY phase (ship|debug|design|plan|build) for an issue.
23
23
  # design/plan/build have no tracker-event trigger; they run only via dispatch.
24
24
  #
@@ -83,11 +83,6 @@ concurrency:
83
83
  # `dev-dispatch-dropped` row to the job summary + a `::warning::`.
84
84
  cancel-in-progress: ${{ github.event.workflow_run.head_branch != 'dev' }}
85
85
 
86
- # Cap on dev-triggered debug dispatches per FID (distinct failed dev CI SHAs).
87
- # A bkit test holds it equal to MAX_DEV_DISPATCH_ATTEMPTS in `bkit counters max`.
88
- env:
89
- MAX_DEV_DISPATCH_ATTEMPTS: 3
90
-
91
86
  jobs:
92
87
  # ---------------------------------------------------------------------------
93
88
  # context job — checks which runner secrets are set and resolves phase + arg ONCE
@@ -192,9 +187,9 @@ jobs:
192
187
  set -euo pipefail
193
188
  # Cloud runs serve the GitHub tracker only: Linear cloud runs start from Cursor's
194
189
  # Linear integration, and Jira runs locally only. Unset tracker → continue.
195
- TRACKER=$(sed -n 's/.*"issueTracker"[[:space:]]*:[[:space:]]*"\([a-z]*\)".*/\1/p' package.json 2>/dev/null | head -1 || true)
190
+ TRACKER=$(jq -r '.bkit.tracker.default // empty | strings' package.json 2>/dev/null || true)
196
191
  if [ -n "$TRACKER" ] && [ "$TRACKER" != "github" ]; then
197
- echo "::notice::bkit.issueTracker is '$TRACKER' — bkit-cloud.yml serves the GitHub tracker only; no-op exit."
192
+ echo "::notice::bkit.tracker.default is '$TRACKER' — bkit-cloud.yml serves the GitHub tracker only; no-op exit."
198
193
  echo "skip=true" >> "$GITHUB_OUTPUT"; exit 0
199
194
  fi
200
195
  if [ "$EVENT" = "workflow_dispatch" ]; then
@@ -216,8 +211,12 @@ jobs:
216
211
  # bkit_dev_dispatch_guard <FID> <HEAD_SHA> — cap-check +
217
212
  # counter-write + fail-closed-verify for the post-merge debug
218
213
  # surface (dev CI failure). One post-feat/** debug budget per FID.
219
- # Returns 1 (caller must skip) once the FID has MAX_DEV_DISPATCH_
220
- # ATTEMPTS distinct failed-CI SHAs recorded, or if the counter row
214
+ # Returns 1 (caller must skip) once the FID has DEBUG_CAP distinct
215
+ # failed-CI SHAs recorded — DEBUG_CAP = package.json
216
+ # bkit.workflows.debug fix + soak maxAttempts (2 each when unset or
217
+ # not a whole number of 1 or more; the engine falls back the same
218
+ # way) — every debug run makes at least one attempt, so more
219
+ # dispatches could never run one — or if the counter row
221
220
  # cannot be durably landed on origin/dev (fail-closed: one push
222
221
  # retry against a re-fetched dev, then VERIFY landing before
223
222
  # proceeding). Returns 0 to proceed to dispatch.
@@ -235,11 +234,14 @@ jobs:
235
234
  # The caller invokes this function as `... || { skip }`, which
236
235
  # suppresses `set -e` for the whole body. An explicit test, not
237
236
  # `${VAR:?}`: the `:?` expansion exits the whole shell even from
238
- # inside a `|| {}`-guarded function. Fail closed when the
239
- # workflow-level env does not define a whole-number cap.
240
- case "${MAX_DEV_DISPATCH_ATTEMPTS:-}" in
237
+ # inside a `|| {}`-guarded function. Fail closed when the cap
238
+ # cannot be read as a whole number.
239
+ local debug_cap
240
+ debug_cap=$(jq -r 'def lim($p): ((if ($p | type) == "object" then $p.maxAttempts else null end) // 2) | if type == "number" and . >= 1 and floor == . then . else 2 end;
241
+ (.bkit.workflows.debug // {}) as $d | lim($d.fix // {}) + lim($d.soak // {})' package.json 2>/dev/null || true)
242
+ case "${debug_cap:-}" in
241
243
  '' | *[!0-9]*)
242
- echo "::notice::MAX_DEV_DISPATCH_ATTEMPTS is not set to a whole number — refusing to dispatch uncounted (fail-closed)."
244
+ echo "::notice::package.json bkit.workflows.debug limits are unreadable — refusing to dispatch uncounted (fail-closed)."
243
245
  return 1
244
246
  ;;
245
247
  esac
@@ -265,8 +267,8 @@ jobs:
265
267
  return 1
266
268
  fi
267
269
  fi
268
- if [ "$dev_count" -ge "$MAX_DEV_DISPATCH_ATTEMPTS" ]; then
269
- echo "::notice::FID $guard_fid exhausted $MAX_DEV_DISPATCH_ATTEMPTS dev-triggered debug dispatches — operator review required (delete dev-dispatch rows in status.jsonl to reset)."
270
+ if [ "$dev_count" -ge "$debug_cap" ]; then
271
+ echo "::notice::FID $guard_fid exhausted $debug_cap dev-triggered debug dispatches — operator review required (delete dev-dispatch rows in status.jsonl to reset)."
270
272
  return 1
271
273
  fi
272
274
  parent_sha=$(git -C "$GITHUB_WORKSPACE" rev-parse origin/dev 2>/dev/null || echo "")
@@ -441,9 +443,9 @@ jobs:
441
443
  fi
442
444
  fi
443
445
 
444
- # feat/** is NOT capped by MAX_DEV_DISPATCH_ATTEMPTS: pre-merge,
445
- # PR-scoped, bounded by the in-session MAX_DEBUG_ATTEMPT /
446
- # MAX_NORMAL_ATTEMPT counters. The dev arm above is the only
446
+ # feat/** is NOT capped here: pre-merge, PR-scoped, bounded by
447
+ # the debug workflow's fix and soak limits, which count across
448
+ # every debug run of the FID. The dev arm above is the only
447
449
  # capped surface.
448
450
  fi
449
451
  fi
@@ -14,7 +14,7 @@
14
14
  # Revert-branch bypass: on a revert branch the unit and integration tiers are skipped; lint +
15
15
  # typecheck still run.
16
16
  #
17
- # Min push: every changed file matches `bkit.minPushPaths` (package.json; default plan logs,
17
+ # Min push: every changed file matches `bkit.testing.minPushPaths` (package.json; default plan logs,
18
18
  # ledgers) → `bkit:gate:min` replaces the full gate; MIN_PUSH=1 for repo extras. Files decide,
19
19
  # never `[skip ci]`.
20
20
  set -e
@@ -91,7 +91,7 @@ case "$BRANCH" in
91
91
  esac
92
92
 
93
93
  # Min push: `bkit ci min-push` exits 0 only when every file changed since each pushed
94
- # commit left origin/dev (else origin/main) matches `bkit.minPushPaths`. Anything else
94
+ # commit left origin/dev (else origin/main) matches `bkit.testing.minPushPaths`. Anything else
95
95
  # (code, no files, unreadable range, no refs) → MIN_PUSH=0, full gate: a skip on no
96
96
  # evidence reads as a pass.
97
97
  MIN_PUSH=0
@@ -111,13 +111,58 @@ for push_sha in $PUSH_SHARED_SHAS; do
111
111
  if pnpm -s bkit ci skip-token --ref="$push_sha" < /dev/null > /dev/null; then
112
112
  if [ "$MIN_PUSH" != "1" ] &&
113
113
  ! pnpm -s bkit ci min-push --ref="$push_sha" < /dev/null > /dev/null; then
114
- echo "[pre-push] BLOCKED: $push_sha carries a CI-suppressing token and changes files outside bkit.minPushPaths — that code would land on dev / main with no CI run." >&2
114
+ echo "[pre-push] BLOCKED: $push_sha carries a CI-suppressing token and changes files outside bkit.testing.minPushPaths — that code would land on dev / main with no CI run." >&2
115
115
  echo "[pre-push] Add a clean trigger commit and re-push: git commit --allow-empty -m \"chore: trigger CI\" && git push" >&2
116
116
  exit 1
117
117
  fi
118
118
  fi
119
119
  done
120
120
 
121
+ # Fast blocking checks run BEFORE the gates: each reads only git and the tree, so a failure
122
+ # stops the push in seconds instead of after the full gate. Paste fast repo extras that can
123
+ # block (seconds to ~30s, needing nothing the gates build) here too. Slow extras go below
124
+ # the gates.
125
+ #
126
+ # bkit mirror-drift gate — fails if `.agents/*` was edited without `bkit install`
127
+ # regenerating the `.claude/*`/`.cursor/*` mirrors (same check CI runs).
128
+ # Outside the gate scripts: it validates the bkit install, not your source.
129
+ # Fix: `pnpm bkit install`, stage the regenerated files, commit, push.
130
+ pnpm bkit check < /dev/null
131
+
132
+ # Slop base on a dev push — the commit CI's slop scan compares against: the head of the last
133
+ # green CI push run on dev, else origin/dev (scripts/ci/lanes/resolve-push-base.mjs, the
134
+ # script CI's planner runs, in local mode). Exported as SLOP_BASE_REF, which `bkit ci slop`
135
+ # reads, so a finding a red push already landed on dev fails here as it does in CI. Other
136
+ # branches keep the merge-base default. Skipped until scripts/ci/lanes/ holds the script.
137
+ if [ -n "$PUSH_DEV_SHA" ] && [ -f scripts/ci/lanes/resolve-push-base.mjs ]; then
138
+ PUSH_BASE_SOURCE_FILE=$(mktemp)
139
+ CI_PUSH_BASE=$(SOURCE_FILE="$PUSH_BASE_SOURCE_FILE" node scripts/ci/lanes/resolve-push-base.mjs \
140
+ --local --branch=dev --head="$PUSH_DEV_SHA" < /dev/null || echo "")
141
+ CI_PUSH_BASE_SOURCE=$(cat "$PUSH_BASE_SOURCE_FILE" 2>/dev/null || echo "unknown")
142
+ rm -f "$PUSH_BASE_SOURCE_FILE"
143
+ case "$CI_PUSH_BASE_SOURCE" in
144
+ *failed*)
145
+ echo "[pre-push] WARNING: could not read CI's last green run on dev (reason above)." >&2
146
+ echo "[pre-push] Slop compares against origin/dev, not CI's base: a finding an earlier red" >&2
147
+ echo "[pre-push] push landed passes here and still reds CI. Fix gh (gh auth status), push again." >&2
148
+ ;;
149
+ esac
150
+ if [ -n "$CI_PUSH_BASE" ]; then
151
+ export SLOP_BASE_REF="$CI_PUSH_BASE"
152
+ echo "[pre-push] slop base: $CI_PUSH_BASE ($CI_PUSH_BASE_SOURCE) — the base CI uses" >&2
153
+ else
154
+ echo "[pre-push] WARNING: no slop base resolved ($CI_PUSH_BASE_SOURCE) — slop uses its merge-base default" >&2
155
+ fi
156
+ fi
157
+
158
+ # Capability register (graphify, .bkit/templates.md § graphify) — blocks a push to dev when
159
+ # docs/capabilities.md is not what the pushed commit builds (~30s); warn-only on other
160
+ # branches. Skipped until scripts/graphify/ holds the script, and on a min push: it changes
161
+ # no source the register is built from.
162
+ if [ "$MIN_PUSH" != "1" ] && [ -f scripts/graphify/bkit-graph-pre-push.sh ]; then
163
+ PUSH_DEV_SHA="$PUSH_DEV_SHA" IS_REVERT="$IS_REVERT" bash scripts/graphify/bkit-graph-pre-push.sh < /dev/null
164
+ fi
165
+
121
166
  # tmp/ prune — deletes files under tmp/ untouched for 7+ days. Not a gate: a failed
122
167
  # prune warns and the push goes on. Skipped until scripts/cleanup/ holds the script.
123
168
  if [ -f scripts/cleanup/bkit-tmp-prune.mjs ]; then
@@ -127,7 +172,7 @@ fi
127
172
 
128
173
  # WHAT each gate runs lives in package.json, not here — the same `bkit:gate*` scripts
129
174
  # the bkit agent workflows and prompts dispatch through. Edit the scripts, not this
130
- # hook. Repo-specific extras go BELOW this block.
175
+ # hook. Fast repo extras go ABOVE, with `bkit check`; slow ones BELOW.
131
176
  # Min push: `bkit:gate:min` only. Revert path drops the suite only: prose
132
177
  # and slop:delta still run. Otherwise the deepest push gate package.json declares.
133
178
  if [ "$MIN_PUSH" = "1" ]; then
@@ -142,19 +187,13 @@ else
142
187
  pnpm bkit:gate:static-unit < /dev/null
143
188
  fi
144
189
 
145
- # bkit mirror-drift gate — fails fast if `.agents/*` was edited without `bkit install`
146
- # regenerating the `.claude/*`/`.cursor/*` mirrors (same check CI runs).
147
- # Outside the gate scripts: it validates the bkit install, not your source.
148
- # Fix: `pnpm bkit install`, stage the regenerated files, commit, push.
149
- pnpm bkit check < /dev/null
150
-
151
- # Repo extras go here, above the disk prune. Slow ones (Docker, database, build) skip a
152
- # min push:
190
+ # Slow repo extras go here, above the disk prune. Ones that need Docker, a database or a
191
+ # build skip a min push:
153
192
  # if [ "$MIN_PUSH" != "1" ]; then pnpm <slow-script> < /dev/null; fi
154
193
 
155
194
  # disk prune — keep this block last, so it runs only once every gate above passed. Starts
156
195
  # your max cleanup steps (`bkit disk prune`, .bkit/templates.md § Disk prune) in the
157
- # background, at most once a day, or hourly while free disk is under bkit.disk.minFreeGb;
196
+ # background, at most once a day, or hourly while free disk is under bkit.workflows.minFreeGb;
158
197
  # with no step files it does nothing. Not a gate: a failure warns and the push goes on.
159
198
  pnpm -s bkit disk prune --mode=max --auto < /dev/null > /dev/null ||
160
199
  echo "[pre-push] WARN: disk prune failed; push continues" >&2
@@ -39,6 +39,13 @@ pnpm-lock.yaml
39
39
  # never be byte-equal to what the renderer emits and every close would carry a
40
40
  # formatting-only diff. The fold's output is the source of truth.
41
41
  docs/roadmap.md
42
+ # Raw gate output — `bkit tests run` logs that workflows commit as `.md` beside
43
+ # a run's artifacts. The text is command output, not markdown; prettier would
44
+ # escape and reflow it, and a gate's own format check would fail on it.
45
+ docs/plans/*/logs/*/run-tests-*.md
46
+ docs/plans/*/logs/*/build-group-gate-*.md
47
+ docs/plans/*/logs/*/build-subplan-gate-*.md
48
+ docs/plans/*/logs/*/context-tests-local-*.md
42
49
  # bkit's reference copies of its templates — refreshed by `bkit upgrade`, never
43
50
  # formatted by this repo.
44
51
  .bkit/templates/