@cbartens/bkit 5.2.4 → 5.4.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 (271) hide show
  1. package/.bkit/README.md +27 -11
  2. package/.bkit/core/.agents/context.md +1 -1
  3. package/.bkit/core/.agents/docs.md +1 -1
  4. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +1 -1
  5. package/.bkit/core/.agents/rules.md +18 -1
  6. package/.bkit/core/.bkit/README.md +26 -10
  7. package/.bkit/core/.bkit/cloud.md +40 -39
  8. package/.bkit/core/.bkit/comparison.md +68 -345
  9. package/.bkit/core/.bkit/install.md +16 -9
  10. package/.bkit/core/.bkit/lite.md +73 -0
  11. package/.bkit/core/.bkit/pipeline.md +346 -0
  12. package/.bkit/core/.bkit/prompts.md +90 -74
  13. package/.bkit/core/.bkit/providers.md +42 -23
  14. package/.bkit/core/.bkit/templates.md +138 -19
  15. package/.bkit/core/.bkit/trackers.md +49 -4
  16. package/.bkit/core/.bkit/workflows.md +144 -123
  17. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +1 -1
  18. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +7 -4
  19. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +8 -5
  20. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +3 -2
  21. package/.bkit/core/docs/templates/bkit-audit-adoption.md +2 -2
  22. package/.bkit/core/docs/templates/bkit-audit-agents.md +1 -1
  23. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +1 -1
  24. package/.bkit/core/docs/templates/bkit-audit-analytics.md +1 -1
  25. package/.bkit/core/docs/templates/bkit-audit-annotations.md +1 -1
  26. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +1 -1
  27. package/.bkit/core/docs/templates/bkit-audit-app-store.md +1 -1
  28. package/.bkit/core/docs/templates/bkit-audit-architecture.md +1 -1
  29. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +4 -2
  30. package/.bkit/core/docs/templates/bkit-audit-config.md +3 -2
  31. package/.bkit/core/docs/templates/bkit-audit-cost.md +3 -2
  32. package/.bkit/core/docs/templates/bkit-audit-coverage.md +1 -1
  33. package/.bkit/core/docs/templates/bkit-audit-database.md +3 -2
  34. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +5 -5
  35. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +1 -1
  36. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +26 -21
  37. package/.bkit/core/docs/templates/bkit-audit-documentation.md +1 -1
  38. package/.bkit/core/docs/templates/bkit-audit-duplication.md +2 -2
  39. package/.bkit/core/docs/templates/bkit-audit-failures.md +1 -1
  40. package/.bkit/core/docs/templates/bkit-audit-flakes.md +3 -2
  41. package/.bkit/core/docs/templates/bkit-audit-gates.md +5 -2
  42. package/.bkit/core/docs/templates/bkit-audit-issues.md +3 -2
  43. package/.bkit/core/docs/templates/bkit-audit-llm.md +22 -15
  44. package/.bkit/core/docs/templates/bkit-audit-logs.md +10 -6
  45. package/.bkit/core/docs/templates/bkit-audit-models.md +1 -1
  46. package/.bkit/core/docs/templates/bkit-audit-privacy.md +1 -1
  47. package/.bkit/core/docs/templates/bkit-audit-prompts.md +7 -7
  48. package/.bkit/core/docs/templates/bkit-audit-red-team.md +12 -9
  49. package/.bkit/core/docs/templates/bkit-audit-reliability.md +3 -2
  50. package/.bkit/core/docs/templates/bkit-audit-repo.md +1 -1
  51. package/.bkit/core/docs/templates/bkit-audit-security.md +14 -12
  52. package/.bkit/core/docs/templates/bkit-audit-slop.md +1 -1
  53. package/.bkit/core/docs/templates/bkit-audit-testing.md +10 -8
  54. package/.bkit/core/docs/templates/bkit-audit-usability.md +1 -1
  55. package/.bkit/core/docs/templates/bkit-plan.md +8 -6
  56. package/.bkit/core/engine/checks/after/auth.ts +9 -9
  57. package/.bkit/core/engine/checks/after/ci-yml.ts +14 -12
  58. package/.bkit/core/engine/checks/after/github.ts +29 -120
  59. package/.bkit/core/engine/checks/after/index.ts +2 -2
  60. package/.bkit/core/engine/checks/after/managed.ts +8 -28
  61. package/.bkit/core/engine/checks/after/tools.ts +3 -15
  62. package/.bkit/core/engine/checks/before/context-fetch.ts +1 -21
  63. package/.bkit/core/engine/checks/before/index.ts +7 -43
  64. package/.bkit/core/engine/checks/before/mcp.ts +17 -8
  65. package/.bkit/core/engine/checks/before/repo.ts +9 -12
  66. package/.bkit/core/engine/checks/status-holes.ts +4 -6
  67. package/.bkit/core/engine/checks/tips/catalogue.ts +76 -24
  68. package/.bkit/core/engine/checks/tips/detect.ts +45 -2
  69. package/.bkit/core/engine/checks/tips/index.ts +77 -26
  70. package/.bkit/core/engine/cli.ts +57 -27
  71. package/.bkit/core/engine/commands/analysis.ts +36 -26
  72. package/.bkit/core/engine/commands/comply.ts +42 -32
  73. package/.bkit/core/engine/commands/harvest.ts +12 -12
  74. package/.bkit/core/engine/commands/install/doctor.ts +57 -28
  75. package/.bkit/core/engine/commands/install/install.ts +73 -130
  76. package/.bkit/core/engine/commands/install/uninstall.ts +191 -33
  77. package/.bkit/core/engine/commands/install/upgrade.ts +49 -43
  78. package/.bkit/core/engine/commands/land.ts +156 -0
  79. package/.bkit/core/engine/commands/lib.ts +45 -18
  80. package/.bkit/core/engine/commands/registry.ts +2 -0
  81. package/.bkit/core/engine/commands/tips.ts +12 -5
  82. package/.bkit/core/engine/commands/workflow/branches.ts +386 -286
  83. package/.bkit/core/engine/commands/workflow/counters.ts +21 -12
  84. package/.bkit/core/engine/commands/workflow/disk.ts +556 -0
  85. package/.bkit/core/engine/commands/workflow/fids.ts +46 -0
  86. package/.bkit/core/engine/commands/workflow/issues.ts +73 -28
  87. package/.bkit/core/engine/commands/workflow/ledgers.ts +3 -1
  88. package/.bkit/core/engine/commands/workflow/locks.ts +38 -152
  89. package/.bkit/core/engine/commands/workflow/prs.ts +15 -4
  90. package/.bkit/core/engine/commands/workflow/repo.ts +2 -2
  91. package/.bkit/core/engine/commands/workflow/roadmap.ts +49 -53
  92. package/.bkit/core/engine/commands/workflow/runs.ts +8 -7
  93. package/.bkit/core/engine/commands/workflow/runtime.ts +3 -2
  94. package/.bkit/core/engine/commands/workflow/status.ts +33 -11
  95. package/.bkit/core/engine/commands/workflow/steps.ts +25 -15
  96. package/.bkit/core/engine/commands/workflow/tests.ts +17 -5
  97. package/.bkit/core/engine/commands/workflow/workflows.ts +436 -267
  98. package/.bkit/core/engine/commands/workflow/workstreams.ts +4 -2
  99. package/.bkit/core/engine/commands/workflow/worktrees.ts +24 -6
  100. package/.bkit/core/engine/install/cloud-env.ts +10 -31
  101. package/.bkit/core/engine/install/manifest.ts +14 -7
  102. package/.bkit/core/engine/install/modules/antigravity.ts +15 -26
  103. package/.bkit/core/engine/install/modules/claude.ts +20 -28
  104. package/.bkit/core/engine/install/modules/cloud.ts +5 -2
  105. package/.bkit/core/engine/install/modules/codex.ts +15 -29
  106. package/.bkit/core/engine/install/modules/core.ts +106 -70
  107. package/.bkit/core/engine/install/modules/cursor.ts +6 -20
  108. package/.bkit/core/engine/install/modules/index.ts +7 -1
  109. package/.bkit/core/engine/install/modules/opencode.ts +48 -70
  110. package/.bkit/core/engine/install/network-allowlist.ts +73 -0
  111. package/.bkit/core/engine/install/placeholders.ts +16 -35
  112. package/.bkit/core/engine/install/write.ts +59 -12
  113. package/.bkit/core/engine/ledgers/telemetry.ts +6 -4
  114. package/.bkit/core/engine/render/hosts.ts +47 -67
  115. package/.bkit/core/engine/render/models.ts +29 -11
  116. package/.bkit/core/engine/shared/branches.ts +13 -0
  117. package/.bkit/core/engine/shared/egress.ts +3 -3
  118. package/.bkit/core/engine/shared/json.ts +18 -1
  119. package/.bkit/core/engine/shared/package-json.ts +63 -0
  120. package/.bkit/core/engine/shared/package-roots.ts +0 -10
  121. package/.bkit/core/engine/shared/protected-paths.ts +5 -130
  122. package/.bkit/core/engine/shared/settings.ts +44 -0
  123. package/.bkit/core/engine/shared/timeouts.ts +8 -7
  124. package/.bkit/core/hooks/antigravity-hook.js +1 -0
  125. package/.bkit/core/hooks/guardrails-shell.js +186 -40
  126. package/.bkit/core/hooks/guardrails-tiers.js +5 -78
  127. package/.bkit/core/prompts/bkit-audit-generate.md +103 -7
  128. package/.bkit/core/prompts/bkit-build-challenge-1.md +1 -1
  129. package/.bkit/core/prompts/bkit-build-challenge-2.md +1 -1
  130. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +1 -1
  131. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +1 -1
  132. package/.bkit/core/prompts/bkit-build-challenge-tests.md +1 -1
  133. package/.bkit/core/prompts/bkit-build-install-skills.md +1 -1
  134. package/.bkit/core/prompts/bkit-build-plan-current.md +1 -1
  135. package/.bkit/core/prompts/bkit-build-plan-execute.md +4 -4
  136. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +1 -1
  137. package/.bkit/core/prompts/bkit-build-plan-verify.md +2 -2
  138. package/.bkit/core/prompts/bkit-debug-abort-handover.md +1 -1
  139. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +1 -1
  140. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +1 -1
  141. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +78 -0
  142. package/.bkit/core/prompts/bkit-debug-failure-soak.md +1 -1
  143. package/.bkit/core/prompts/bkit-debug-summary.md +3 -3
  144. package/.bkit/core/prompts/bkit-design-spike.md +1 -1
  145. package/.bkit/core/prompts/bkit-design-summary.md +2 -2
  146. package/.bkit/core/prompts/bkit-design-update.md +1 -1
  147. package/.bkit/core/prompts/bkit-plan-complexity-check.md +1 -1
  148. package/.bkit/core/prompts/bkit-plan-generate.md +1 -1
  149. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +1 -1
  150. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +1 -1
  151. package/.bkit/core/prompts/bkit-plan-summary.md +1 -1
  152. package/.bkit/core/prompts/bkit-plan-update.md +1 -1
  153. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +1 -1
  154. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +1 -1
  155. package/.bkit/core/prompts/bkit-ship-update-docs.md +1 -1
  156. package/.bkit/core/prompts/bkit-utility-update-decisions.md +9 -2
  157. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +9 -2
  158. package/.bkit/core/prompts/bkit-utility-update-documentation.md +2 -1
  159. package/.bkit/core/prompts/bkit-utility-update-failures.md +9 -2
  160. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +9 -2
  161. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +11 -4
  162. package/.bkit/core/workflows/bkit-auto.md +2 -2
  163. package/.bkit/core/workflows/bkit-build.md +10 -10
  164. package/.bkit/core/workflows/bkit-debug.md +80 -44
  165. package/.bkit/core/workflows/bkit-design.md +22 -13
  166. package/.bkit/core/workflows/bkit-plan.md +33 -16
  167. package/.bkit/core/workflows/bkit-ship.md +87 -98
  168. package/.bkit/shared/.claude/bkit-cloud.md +58 -25
  169. package/.bkit/shared/.claude/settings.json +19 -0
  170. package/.bkit/shared/.cursor/mcp.json +2 -1
  171. package/.bkit/shared/.opencode/opencode.json +19 -1
  172. package/.bkit/shared/docs/deployments.md +49 -29
  173. package/.bkit/shared/docs/security.md +8 -6
  174. package/.bkit/shared/docs/testing.md +9 -5
  175. package/.bkit/shared/gitignore +1 -2
  176. package/.bkit/templates/.cursor/Dockerfile +30 -16
  177. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +78 -0
  178. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +91 -0
  179. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +56 -0
  180. package/.bkit/templates/.github/renovate.json5 +91 -12
  181. package/.bkit/templates/.github/workflows/bkit-ci.yml +73 -55
  182. package/.bkit/templates/.github/workflows/bkit-cloud.yml +3 -1
  183. package/.bkit/templates/.github/workflows/bkit-renovate.yml +8 -1
  184. package/.bkit/templates/.github/workflows/bkit-trivy.yml +67 -0
  185. package/.bkit/templates/.husky/pre-commit +6 -0
  186. package/.bkit/templates/.husky/pre-push +15 -3
  187. package/.bkit/templates/.lintstagedrc.json +5 -1
  188. package/.bkit/templates/.oxlintrc.json +21 -0
  189. package/.bkit/templates/docs/capabilities.md +1 -1
  190. package/.bkit/templates/scripts/ci/check-capstone.mjs +176 -0
  191. package/.bkit/templates/scripts/ci/check-capstone.test.mjs +311 -0
  192. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.machine.mjs +197 -0
  193. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +164 -0
  194. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +2 -2
  195. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +43 -20
  196. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +33 -11
  197. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -2
  198. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +5 -5
  199. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +79 -19
  200. package/CHANGELOG.md +98 -3
  201. package/README.md +252 -122
  202. package/dist/checks/after/auth.js +10 -11
  203. package/dist/checks/after/ci-yml.js +11 -14
  204. package/dist/checks/after/github.js +32 -125
  205. package/dist/checks/after/index.js +3 -2
  206. package/dist/checks/after/managed.js +8 -24
  207. package/dist/checks/after/tools.js +3 -16
  208. package/dist/checks/before/context-fetch.js +1 -21
  209. package/dist/checks/before/index.js +6 -42
  210. package/dist/checks/before/mcp.js +14 -9
  211. package/dist/checks/before/repo.js +8 -11
  212. package/dist/checks/status-holes.js +5 -7
  213. package/dist/checks/tips/catalogue.js +65 -18
  214. package/dist/checks/tips/detect.js +41 -2
  215. package/dist/checks/tips/index.js +61 -25
  216. package/dist/cli.js +52 -26
  217. package/dist/commands/analysis.js +21 -5
  218. package/dist/commands/comply.js +40 -31
  219. package/dist/commands/harvest.js +12 -13
  220. package/dist/commands/install/doctor.js +55 -23
  221. package/dist/commands/install/install.js +72 -122
  222. package/dist/commands/install/uninstall.js +165 -31
  223. package/dist/commands/install/upgrade.js +46 -39
  224. package/dist/commands/land.js +129 -0
  225. package/dist/commands/lib.js +41 -16
  226. package/dist/commands/registry.js +2 -0
  227. package/dist/commands/tips.js +10 -3
  228. package/dist/commands/workflow/branches.js +303 -248
  229. package/dist/commands/workflow/counters.js +17 -7
  230. package/dist/commands/workflow/disk.js +452 -0
  231. package/dist/commands/workflow/fids.js +39 -0
  232. package/dist/commands/workflow/issues.js +63 -27
  233. package/dist/commands/workflow/ledgers.js +3 -1
  234. package/dist/commands/workflow/locks.js +35 -130
  235. package/dist/commands/workflow/prs.js +8 -5
  236. package/dist/commands/workflow/repo.js +2 -2
  237. package/dist/commands/workflow/roadmap.js +50 -57
  238. package/dist/commands/workflow/runs.js +5 -5
  239. package/dist/commands/workflow/runtime.js +3 -2
  240. package/dist/commands/workflow/status.js +32 -12
  241. package/dist/commands/workflow/steps.js +19 -11
  242. package/dist/commands/workflow/tests.js +16 -3
  243. package/dist/commands/workflow/workflows.js +390 -249
  244. package/dist/commands/workflow/workstreams.js +4 -2
  245. package/dist/commands/workflow/worktrees.js +15 -6
  246. package/dist/install/cloud-env.js +10 -23
  247. package/dist/install/manifest.js +14 -7
  248. package/dist/install/modules/antigravity.js +15 -26
  249. package/dist/install/modules/claude.js +17 -21
  250. package/dist/install/modules/cloud.js +6 -2
  251. package/dist/install/modules/codex.js +15 -29
  252. package/dist/install/modules/core.js +95 -63
  253. package/dist/install/modules/cursor.js +6 -9
  254. package/dist/install/modules/index.js +6 -1
  255. package/dist/install/modules/opencode.js +41 -72
  256. package/dist/install/network-allowlist.js +62 -0
  257. package/dist/install/placeholders.js +16 -35
  258. package/dist/install/write.js +55 -15
  259. package/dist/ledgers/telemetry.js +5 -4
  260. package/dist/render/hosts.js +30 -55
  261. package/dist/render/models.js +20 -9
  262. package/dist/shared/branches.js +11 -0
  263. package/dist/shared/egress.js +0 -2
  264. package/dist/shared/json.js +14 -0
  265. package/dist/shared/package-json.js +61 -0
  266. package/dist/shared/package-roots.js +0 -8
  267. package/dist/shared/protected-paths.js +5 -122
  268. package/dist/shared/settings.js +23 -1
  269. package/dist/shared/timeouts.js +8 -7
  270. package/package.json +21 -17
  271. package/.bkit/core/.agents/shortcuts.md +0 -73
@@ -11,8 +11,11 @@
11
11
  {
12
12
  $schema: "https://docs.renovatebot.com/renovate-schema.json",
13
13
 
14
- // `config:recommended` is Renovate's curated baseline (timezone-aware schedules,
15
- // dependency dashboard, etc.). Repo-specific rules go in this file.
14
+ // `config:best-practices` is Renovate's curated baseline: `config:recommended` plus
15
+ // digest pinning for Docker images and GitHub Actions, exact-version pinning of
16
+ // devDependencies, config-migration PRs, an abandoned-packages section on the
17
+ // dashboard, and a 3-day npm release-age gate (raised to 7 days in the first
18
+ // packageRule below). Repo-specific rules go in this file.
16
19
  // A `local>` preset with no `#` is read from the default branch. `useBaseBranchConfig`
17
20
  // does not change that fetch. Append the branch `baseBranchPatterns` names — a branch
18
21
  // after `#` works (branch, tag, or commit SHA):
@@ -20,7 +23,7 @@
20
23
  // The `extends` line itself is still read from the default branch, so `#dev` needs
21
24
  // one merge there before edits on `dev` apply.
22
25
  extends: [
23
- "config:recommended",
26
+ "config:best-practices",
24
27
  ":dependencyDashboard",
25
28
  ],
26
29
 
@@ -67,23 +70,40 @@
67
70
  minimumReleaseAge: "7 days",
68
71
 
69
72
  // Lockfile maintenance — picks up indirect-dependency updates that a
70
- // direct-dependency bump alone wouldn't catch. Same weekly slot.
73
+ // direct-dependency bump alone wouldn't catch. Monthly: it rewrites the whole
74
+ // lockfile, so a weekly PR is mostly churn.
71
75
  lockFileMaintenance: {
72
76
  enabled: true,
73
- schedule: ["before 6am on Monday"],
77
+ schedule: ["before 6am on the first day of the month"],
74
78
  },
75
79
 
76
- // Respect ignore paths from .gitignore + add common monorepo cruft.
80
+ // Rebase a Renovate PR only when it conflicts. The default re-bases every open PR
81
+ // each time the base branch moves, which re-runs CI on PRs that auto-merge.
82
+ rebaseWhen: "conflicted",
83
+
84
+ // A repo-level `ignorePaths` REPLACES the list from `:ignoreModulesAndTests`
85
+ // (pulled in by `config:best-practices`), so that preset's entries are repeated
86
+ // here. `docs/plans/**` holds archived plans and spike code, never live
87
+ // dependencies. `**/tests/**` and `**/__fixtures__/**` hold fixture manifests.
77
88
  // `.bkit/templates/**` and `.agents/skills/**` are bkit-owned and stay out of
78
89
  // the scan. To keep Renovate off a file entirely, list it here:
79
90
  // a packageRule `enabled: false` suppresses version bumps, but the github-actions
80
91
  // manager still scans the file and applies tag->SHA pinDigests. Workflows you
81
- // copied from `.bkit/templates/` (bkit-ci.yml, bkit-cloud.yml, bkit-renovate.yml) are yours —
92
+ // copied from `.bkit/templates/` (bkit-ci.yml, bkit-cloud.yml, bkit-renovate.yml,
93
+ // bkit-trivy.yml) are yours —
82
94
  // leave them out of ignorePaths so their action pins refresh.
83
95
  ignorePaths: [
84
96
  "**/node_modules/**",
97
+ "**/bower_components/**",
98
+ "**/vendor/**",
99
+ "**/examples/**",
100
+ "**/__tests__/**",
101
+ "**/test/**",
102
+ "**/tests/**",
103
+ "**/__fixtures__/**",
85
104
  "**/dist/**",
86
105
  "**/build/**",
106
+ "docs/plans/**",
87
107
  ".bkit/templates/**",
88
108
  ".agents/skills/**",
89
109
  ],
@@ -92,7 +112,62 @@
92
112
  prConcurrentLimit: 10,
93
113
  prHourlyLimit: 4,
94
114
 
115
+ // ─────────────────────────────────────────────────────────────────────
116
+ // Pinned CLIs and tools that live in no package manifest. A comment line
117
+ // # renovate: datasource=<datasource> depName=<name> [packageName=<n>] [versioning=<v>] [extractVersion=<regex>]
118
+ // directly above the pin tells Renovate what to look up. Forms matched:
119
+ // ARG NODE_VERSION=24.11.0 · GH_VERSION="2.83.0" (Dockerfile / shell)
120
+ // VALE_VERSION: "3.9.1" · renovate-version: "44.x.y" (workflow env / `with:` input)
121
+ // GRAPHIFY_SPEC="graphifyy[sql]==0.9.50" (pip spec in bkit-graphify.sh: value after `==`)
122
+ // npm install -g @opencode/cli@2.0.26 (npm global install)
123
+ // bash "$RUNNER_TEMP/download-actionlint.bash" 1.7.12 (installer-script version argument)
124
+ // Pins paired with a checksum (Vale, gh, jq, Node, actionlint) get the new VERSION
125
+ // from Renovate, but the sha256 beside it stays old: update it by hand in the same
126
+ // PR, or the install fails closed. See the NOTE in the docker images rule below.
127
+ // ─────────────────────────────────────────────────────────────────────
128
+ customManagers: [
129
+ {
130
+ customType: "regex",
131
+ managerFilePatterns: [
132
+ "/(^|/)Dockerfile$/",
133
+ "/(^|/)\\.claude/bkit-cloud\\.md$/",
134
+ "/(^|/)\\.github/workflows/[^/]+\\.ya?ml$/",
135
+ "/(^|/)scripts/graphify/bkit-graphify\\.sh$/",
136
+ ],
137
+ matchStrings: [
138
+ "# renovate: datasource=(?<datasource>[a-zA-Z0-9-._]+?) depName=(?<depName>\\S+?)(?: packageName=(?<packageName>\\S+?))?(?: versioning=(?<versioning>\\S+?))?(?: extractVersion=(?<extractVersion>\\S+?))?\\s+(?:(?:ARG|export)\\s+)?[\\w-]*(?:VERSION|version)[=:]\\s*\"?(?<currentValue>[^\"\\s]+)\"?",
139
+ "# renovate: datasource=(?<datasource>[a-zA-Z0-9-._]+?) depName=(?<depName>\\S+?)(?: packageName=(?<packageName>\\S+?))?(?: versioning=(?<versioning>\\S+?))?(?: extractVersion=(?<extractVersion>\\S+?))?\\s+\\w*_SPEC[=:]\\s*\"[^\"=\\s]+==(?<currentValue>[^\"\\s]+)\"",
140
+ "# renovate: datasource=(?<datasource>[a-zA-Z0-9-._]+?) depName=(?<depName>\\S+?)(?: packageName=(?<packageName>\\S+?))?(?: versioning=(?<versioning>\\S+?))?(?: extractVersion=(?<extractVersion>\\S+?))?\\s+npm install -g \\S+@(?<currentValue>[^\\s\"]+)",
141
+ "# renovate: datasource=(?<datasource>[a-zA-Z0-9-._]+?) depName=(?<depName>\\S+?)(?: packageName=(?<packageName>\\S+?))?(?: versioning=(?<versioning>\\S+?))?(?: extractVersion=(?<extractVersion>\\S+?))?\\s+bash \"[^\"]+\" (?<currentValue>[0-9][^\\s\"]*)",
142
+ ],
143
+ },
144
+ ],
145
+
95
146
  packageRules: [
147
+ // ─────────────────────────────────────────────────────────────────────
148
+ // `config:best-practices` sets a 3-day npm release-age gate as a packageRule,
149
+ // which beats the root-level `minimumReleaseAge: "7 days"` for npm packages.
150
+ // This rule restores 7 days. Rules in this file are applied after the preset's
151
+ // rules, so it wins; the preset's `internalChecksFilter: "strict"` stays on.
152
+ // ─────────────────────────────────────────────────────────────────────
153
+ {
154
+ matchDatasources: ["npm"],
155
+ minimumReleaseAge: "7 days",
156
+ },
157
+
158
+ // ─────────────────────────────────────────────────────────────────────
159
+ // `renovate-version` in bkit-renovate.yml. Renovate's github-actions manager
160
+ // finds it as a Docker image (ghcr.io/renovatebot/renovate), but ghcr.io tags
161
+ // carry no publish date, so `minimumReleaseAge` would hold every update as
162
+ // "pending" forever. That lookup is switched off; the `customManagers` entry
163
+ // below reads the same line through GitHub releases, which are dated.
164
+ // ─────────────────────────────────────────────────────────────────────
165
+ {
166
+ matchManagers: ["github-actions"],
167
+ matchDepNames: ["ghcr.io/renovatebot/renovate"],
168
+ enabled: false,
169
+ },
170
+
96
171
  // ─────────────────────────────────────────────────────────────────────
97
172
  // The bkit package itself — Renovate does not bump it.
98
173
  // Upgrade with `pnpm bkit upgrade --latest`, which bumps the pin and
@@ -111,7 +186,8 @@
111
186
  {
112
187
  matchManagers: ["npm"],
113
188
  matchUpdateTypes: ["minor", "patch"],
114
- matchDepTypes: ["devDependencies"],
189
+ // `packageManager` is the pnpm pin in package.json; its bumps join the group.
190
+ matchDepTypes: ["devDependencies", "packageManager"],
115
191
  groupName: "non-major dependencies",
116
192
  automerge: true,
117
193
  automergeType: "pr",
@@ -136,10 +212,12 @@
136
212
  automerge: false,
137
213
  },
138
214
 
139
- // Major bumps — always separate, never auto-merged.
215
+ // Major bumps — always separate, never auto-merged, and held until you tick
216
+ // the update on the Dependency Dashboard issue (no branch, PR or CI run before).
140
217
  {
141
218
  matchUpdateTypes: ["major"],
142
219
  automerge: false,
220
+ dependencyDashboardApproval: true,
143
221
  labels: ["dep-major"],
144
222
  },
145
223
 
@@ -206,9 +284,10 @@
206
284
  // comment, or the dockerfile manager can't map the digest to its tag.
207
285
  // Reviewed manually.
208
286
  // NOTE: version+checksum-paired installer fetches (e.g. the Vale tarball
209
- // sha256, the pinned actionlint download-script SHA in bkit-ci.yml) are NOT
210
- // Renovate-managed — it cannot recompute a tarball checksum — so bump those
211
- // version+sha pairs by hand. See docs/deployments.md § GitHub Actions pinning.
287
+ // sha256, the pinned actionlint download-script SHA in bkit-ci.yml) are only
288
+ // half Renovate-managed — the `customManagers` entry below bumps the version
289
+ // but cannot recompute a tarball checksum — so update those version+sha pairs
290
+ // by hand in the same PR. See docs/deployments.md § GitHub Actions pinning.
212
291
  // ─────────────────────────────────────────────────────────────────────
213
292
  {
214
293
  matchManagers: ["dockerfile"],
@@ -30,7 +30,7 @@ concurrency:
30
30
 
31
31
  jobs:
32
32
  # ── bkit-tests-static ────────────────────────────────────────────────────
33
- # Static-analysis lane: typecheck, format, prose lint, slop, actionlint,
33
+ # Static-analysis lane: typecheck, lint, format, prose lint, slop, actionlint,
34
34
  # bkit check. Runs on a CLEAN tree (no test artifacts). Parallel sibling of
35
35
  # bkit-tests-unit — wall-clock = MAX(lane).
36
36
  bkit-tests-static:
@@ -64,13 +64,13 @@ jobs:
64
64
  # Node/TS toolchain region. On a non-Node repo, replace these steps with your
65
65
  # stack's setup / install commands (and the typecheck / lint / test steps below with
66
66
  # its own). Replace `{{NODE_VERSION}}` with your Node major (`.bkit/templates.md`).
67
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
67
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
68
68
  with:
69
69
  node-version: {{NODE_VERSION}}
70
70
 
71
71
  # Pnpm version is resolved from the consumer's package.json#packageManager (single SoT).
72
72
  # Do NOT add `with: version:` here — pnpm/action-setup errors when both are set.
73
- - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
73
+ - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
74
74
 
75
75
  # Under [verbose ci]: propagate DEBUG to all subsequent steps via $GITHUB_ENV. Note
76
76
  # that steps with their own `env:` block override $GITHUB_ENV — those steps must
@@ -212,7 +212,7 @@ jobs:
212
212
  # Static checks first — they read the source tree and must scan it CLEAN.
213
213
  # Vitest/build run AFTER (below): they write coverage, dist/, and other
214
214
  # artifacts that would otherwise pollute the Slop Scan and bkit check inputs.
215
- # Keep this group (typecheck → prettier → vale → slop → bkit check) ahead of
215
+ # Keep this group (typecheck → lint → prettier → vale → slop → bkit check) ahead of
216
216
  # the test/build group if you reorder.
217
217
  - name: Run Typecheck
218
218
  if: steps.cache.outputs.skip != 'true'
@@ -220,6 +220,12 @@ jobs:
220
220
  TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
221
221
  run: pnpm typecheck
222
222
 
223
+ - name: Run Lint
224
+ if: steps.cache.outputs.skip != 'true'
225
+ env:
226
+ TURBO_FORCE: ${{ steps.detect.outputs.turbo_force }}
227
+ run: pnpm lint
228
+
223
229
  - name: Run Prettier
224
230
  if: steps.cache.outputs.skip != 'true'
225
231
  env:
@@ -232,6 +238,7 @@ jobs:
232
238
  - name: Install Vale
233
239
  if: steps.cache.outputs.skip != 'true'
234
240
  env:
241
+ # renovate: datasource=github-releases depName=errata-ai/vale
235
242
  VALE_VERSION: "3.9.1"
236
243
  # sha256 of vale_${VALE_VERSION}_Linux_64-bit.tar.gz (from the release's checksums.txt).
237
244
  # Bump alongside VALE_VERSION; verified before extract so a tampered/CDN-swapped tarball fails closed.
@@ -276,6 +283,7 @@ jobs:
276
283
  curl -sSfL --retry 3 --retry-all-errors https://raw.githubusercontent.com/rhysd/actionlint/914e7df21a07ef503a81201c76d2b11c789d3fca/scripts/download-actionlint.bash -o "$RUNNER_TEMP/download-actionlint.bash"
277
284
  # download-actionlint.bash fetches the binary from GitHub releases — retry to survive a transient CDN/network blip.
278
285
  for i in 1 2 3; do
286
+ # renovate: datasource=github-releases depName=rhysd/actionlint
279
287
  bash "$RUNNER_TEMP/download-actionlint.bash" 1.7.12 "$RUNNER_TEMP" && break
280
288
  [ "$i" = 3 ] && { echo "::error::actionlint download failed after 3 attempts"; exit 1; }
281
289
  echo "::warning::actionlint download attempt $i failed — retrying in 5s"; sleep 5
@@ -298,22 +306,21 @@ jobs:
298
306
  # docs/capabilities.md is not what this tree produces, so the register cannot drift
299
307
  # silently. Self-skips when the graphify wrapper is absent — a repo that did not adopt
300
308
  # scripts/graphify/ is a no-op. graphify is pinned because its output must match the
301
- # committed register to the byte: bump GRAPHIFY_SPEC and refresh the register together.
309
+ # committed register to the byte: bump GRAPHIFY_SPEC (bkit-graphify.sh) and refresh the register together.
302
310
  # Push events only — a pull_request checkout is the MERGE ref, whose tree (base + head)
303
311
  # can differ from the head the register was built against: a false red no author can clear.
304
312
  - name: Setup uv
305
313
  if: steps.cache.outputs.skip != 'true' && github.event_name == 'push' && hashFiles('scripts/graphify/bkit-graphify.sh') != ''
306
314
  uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
307
315
  with:
308
- version: "0.12.6"
316
+ version: "0.13.0"
309
317
 
310
318
  - name: Check Capability Register
311
319
  if: steps.cache.outputs.skip != 'true' && github.event_name == 'push' && hashFiles('scripts/graphify/bkit-graphify.sh') != ''
312
- env:
313
- # PyPI distribution is `graphifyy`; the CLI it exposes is `graphify`.
314
- GRAPHIFY_SPEC: "graphifyy[sql]==0.9.50"
320
+ # graphify release pinned once: GRAPHIFY_SPEC in bkit-graphify.sh. Same release here,
321
+ # in the pre-push gate and by hand.
315
322
  run: |
316
- uv tool install "$GRAPHIFY_SPEC"
323
+ uv tool install "$(bash scripts/graphify/bkit-graphify.sh spec)"
317
324
  # `uv tool install` drops the shim in ~/.local/bin, not on this step's PATH.
318
325
  export PATH="$HOME/.local/bin:$PATH"
319
326
  pnpm graph:check
@@ -341,11 +348,11 @@ jobs:
341
348
  # Full history needed for E2E / supabase stubs when enabled.
342
349
  fetch-depth: 0
343
350
 
344
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
351
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
345
352
  with:
346
353
  node-version: {{NODE_VERSION}}
347
354
 
348
- - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
355
+ - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
349
356
 
350
357
  # NODE_OPTIONS is a job-level `env:` key above, never a $GITHUB_ENV write — the runner
351
358
  # rejects that write and still reports success. See bkit-tests-static's block comment.
@@ -502,7 +509,7 @@ jobs:
502
509
  echo "::warning::test:integration script not found in package.json — skipping integration tests"
503
510
  fi
504
511
 
505
- # bkit-stub:coverage — Report vitest coverage on PRs via davelosert/vitest-coverage-report-action (free, runs entirely inside Actions with GITHUB_TOKEN — no third-party service, safe for private repos). Report-only by default: nothing fails the build until YOU set a threshold. PER-TIER: unit and integration are measured and commented SEPARATELY (a single merged number lets integration mask a hollow unit suite). To enable: make the edits below, uncomment the two steps, and delete this stub header.
512
+ # bkit-stub:coverage — Report vitest coverage on PRs and in every run's job summary via davelosert/vitest-coverage-report-action (free, runs entirely inside Actions with GITHUB_TOKEN — no third-party service, safe for private repos). Report-only by default: nothing fails the build until YOU set a threshold. PER-TIER: unit and integration are measured and commented SEPARATELY (a single merged number lets integration mask a hollow unit suite). To enable: make the edits below, uncomment the two steps, and delete this stub header.
506
513
  # 1. devDep + config. Add `@vitest/coverage-v8` (pin to your vitest major) and a coverage block in vitest.config:
507
514
  # coverage: {
508
515
  # provider: 'v8',
@@ -516,12 +523,20 @@ jobs:
516
523
  # Wire these into the "Run Unit Tests" step(s) above (or your test / test:integration scripts). Separate dirs
517
524
  # also avoid the clobber a second same-dir --coverage run would cause (last-writer-wins, not a merge).
518
525
  # 3. Thresholds (opt-in) live PER TIER, never merged:
519
- # UNIT = the gate. Set coverage.thresholds.branches in the config your UNIT run uses (branches is the
520
- # meaningful floor; line/statement % overstates confidence). Set it to your CURRENT coverage and
521
- # ratchet up. Example: --coverage.thresholds.branches=70. vitest coverage is per-RUN (root config),
522
- # NOT per-project — `projects` does NOT scope it, and a `thresholds` block in vitest.config reds BOTH
523
- # runs. Pass the floor as a CLI flag on the UNIT run only (it cannot leak to integration); reach for a
524
- # second vitest.<tier>.config.ts (run with -c) only if the per-run flags get unwieldy.
526
+ # UNIT = the gate. Put coverage.thresholds.branches in a vitest.unit.config.ts that ONLY your unit run loads
527
+ # (`vitest run -c vitest.unit.config.ts --coverage …`); branches is the meaningful floor (line/statement
528
+ # % overstates confidence). Set it to your CURRENT coverage and ratchet up:
529
+ # import { defineConfig, mergeConfig } from 'vitest/config'
530
+ # import base from './vitest.config'
531
+ # export default mergeConfig(base, defineConfig({ test: { coverage: { thresholds: {
532
+ # branches: 70,
533
+ # } } } }))
534
+ # vitest coverage is per-RUN (root config), NOT per-project — `projects` does NOT scope it, and a
535
+ # `thresholds` block in vitest.config reds BOTH runs. One file feeds both readers: vitest gates on it,
536
+ # and the Report Unit Coverage step's vite-config-path shows it as the 🎯 target. The action reads
537
+ # that file as raw TEXT and regex-matches `<metric>: <number>`: keep the floor on one unquoted line
538
+ # and write no other metric name + colon + number in the file, or the target silently goes wrong.
539
+ # A --coverage.thresholds.branches=<n> CLI flag also gates, but the report cannot read it.
525
540
  # INTEGRATION = REPORT-ONLY, no threshold. Gate integration on EXECUTION (the capstone's integration_ran > 0),
526
541
  # not a %: a whole-repo integration % is denominator-noise (it covers boundaries/flows, not pure logic,
527
542
  # and rarely drives every branch). For a real integration %, add --coverage.include='src/server/**'
@@ -537,26 +552,32 @@ jobs:
537
552
  # integration as its OWN lane (bkit-tests-integration — the shape bkit's own CI + consumer repos run; see the
538
553
  # FULL CI SCAFFOLD REFERENCE below), move the integration coverage run + its Report step + a pull-requests: write
539
554
  # permissions block into THAT lane instead. Each lane posts its own comment; the distinct name: keeps them apart.
540
- # Fork PRs: GITHUB_TOKEN is read-only for PRs from a fork, so the steps fail — the head.repo == repo guard in the
541
- # if: below skips them there (or adopt the action's workflow_run two-workflow pattern to support forks).
555
+ # Fork PRs: GITHUB_TOKEN is read-only for PRs from a fork, so commenting fails — the unit step sets comment-on: none
556
+ # there (its job summary still lands) and the integration step's head.repo == repo guard skips it (or adopt the
557
+ # action's workflow_run two-workflow pattern to comment on forks).
542
558
  # Monorepo: set working-directory so the action finds the right report. Base-branch delta (up/down vs the default
543
559
  # branch) needs the base's coverage-summary.json — see the action's json-summary-compare-path input (optional).
544
560
  # The action is SHA-pinned to a commit (# vX.Y.Z comment) per best practice; your updater (Renovate/Dependabot,
545
561
  # github-actions ecosystem) keeps the pin current — refresh the SHA if you enable this on a newer release.
546
562
  # A distinct name: keys each sticky comment so the two do not collide.
547
- # - name: Report Unit Coverage on PR
548
- # if: steps.cache.outputs.skip != 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
549
- # uses: davelosert/vitest-coverage-report-action@8b157684c6a6b259b97d45e72b44242865c0f6a5 # v2.12.2
563
+ # - name: Report Unit Coverage
564
+ # # Every event, including a red unit run (reportOnFailure keeps the summary): writes the coverage table, with
565
+ # # the floor as its target, to the job summary; comments on same-repo PRs only. No floor yet → drop
566
+ # # vite-config-path (a missing file only warns, on every run).
567
+ # if: ${{ !cancelled() && steps.cache.outputs.skip != 'true' && hashFiles('coverage/unit/coverage-summary.json') != '' }}
568
+ # uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
550
569
  # with:
551
570
  # name: unit
552
571
  # json-summary-path: coverage/unit/coverage-summary.json
553
572
  # json-final-path: coverage/unit/coverage-final.json
573
+ # vite-config-path: vitest.unit.config.ts # the file the floor lives in
554
574
  # file-coverage-mode: changes # per-file table limited to files changed in the PR
575
+ # comment-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) && 'pr' || 'none' }}
555
576
  # github-token: ${{ secrets.GITHUB_TOKEN }}
556
577
  # - name: Report Integration Coverage on PR
557
578
  # # hashFiles guard: skip cleanly when the repo has no integration tier (no coverage/integration report produced).
558
579
  # 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') != ''
559
- # uses: davelosert/vitest-coverage-report-action@8b157684c6a6b259b97d45e72b44242865c0f6a5 # v2.12.2
580
+ # uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
560
581
  # with:
561
582
  # name: integration
562
583
  # json-summary-path: coverage/integration/coverage-summary.json
@@ -648,7 +669,7 @@ jobs:
648
669
  # - name: Report E2E Coverage on PR
649
670
  # # Same gate as Run E2E Tests (coverage exists only if E2E ran); hashFiles skips repos that produced no E2E report.
650
671
  # 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') != ''
651
- # uses: davelosert/vitest-coverage-report-action@8b157684c6a6b259b97d45e72b44242865c0f6a5 # v2.12.2
672
+ # uses: davelosert/vitest-coverage-report-action@c4bbc33a89b7ace0e63d35f1f7d4bcee31155a73 # v2.13.0
652
673
  # with:
653
674
  # name: e2e
654
675
  # json-summary-path: coverage/e2e/coverage-summary.json
@@ -682,47 +703,39 @@ jobs:
682
703
  # always(): a concurrency cancel must not stamp a failure. Each lane must succeed; a failed,
683
704
  # skipped or cancelled lane reds it. A lane that writes an executed-test count must have run
684
705
  # more than 0 tests. Each lane you adopt from the reference below joins needs: and the assert.
706
+ # The assert is scripts/ci/check-capstone.mjs, required with this file (copy it from
707
+ # .bkit/templates/scripts/ci/); the step reds when the script is missing.
685
708
  bkit-tests-check:
686
709
  needs: [bkit-tests-static, bkit-tests-unit]
687
710
  if: ${{ !cancelled() }}
688
711
  runs-on: ubuntu-latest
689
712
  timeout-minutes: 2
690
713
  steps:
714
+ # Ungated checkout, never continue-on-error: it fetches the script below. A checkout
715
+ # gated on a plan value leaves some runs with no script, and the required check then
716
+ # exits on "cannot find module" instead of judging the lanes.
717
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
718
+
691
719
  - name: Assert Lanes Passed
720
+ # The verdict is scripts/ci/check-capstone.mjs (copy it with this file from
721
+ # .bkit/templates/scripts/ci/; check-capstone.test.mjs tests it). Every lane in LANES
722
+ # must succeed; a lane with a *_RAN variable must have run more than 0 tests unless
723
+ # cache_skip=true. EMPTY_COUNT=warn: a lane that writes no count yet warns instead of
724
+ # failing; delete it once every counted lane writes one. Add each lane you adopt to
725
+ # LANES and to its *_RESULT / *_RAN / *_CACHE_SKIP variables.
692
726
  env:
727
+ LANES: static,unit
728
+ EMPTY_COUNT: warn
693
729
  STATIC_RESULT: ${{ needs.bkit-tests-static.result }}
694
730
  UNIT_RESULT: ${{ needs.bkit-tests-unit.result }}
695
731
  UNIT_RAN: ${{ needs.bkit-tests-unit.outputs.tests_ran }}
696
732
  UNIT_CACHE_SKIP: ${{ needs.bkit-tests-unit.outputs.cache_skip }}
697
733
  run: |
698
- FAIL=0
699
- if [ "$STATIC_RESULT" != "success" ]; then
700
- echo "::error::bkit-tests-static result=$STATIC_RESULT (expected success)"
701
- FAIL=1
702
- fi
703
- if [ "$UNIT_RESULT" != "success" ]; then
704
- echo "::error::bkit-tests-unit result=$UNIT_RESULT (expected success)"
705
- FAIL=1
706
- fi
707
- # NON-HOLLOW: a real run (not a SHA-cache short-circuit) of a lane that writes a count
708
- # must have executed >0 tests. An empty count is a lane that writes none yet.
709
- if [ "$UNIT_RESULT" = "success" ] && [ "$UNIT_CACHE_SKIP" != "true" ]; then
710
- case "$UNIT_RAN" in
711
- '')
712
- echo "::warning::bkit-tests-unit writes no executed-test count — green does not prove tests ran (see its Run Unit Tests step)." ;;
713
- *[!0-9]*)
714
- echo "::error::bkit-tests-unit executed-test count is non-numeric ('$UNIT_RAN')."
715
- FAIL=1 ;;
716
- 0)
717
- echo "::error::bkit-tests-unit succeeded but executed 0 tests — vacuous green."
718
- FAIL=1 ;;
719
- esac
720
- fi
721
- if [ "$FAIL" = "1" ]; then
722
- echo "::error::bkit-tests-check FAILED — see above."
734
+ if [ ! -f scripts/ci/check-capstone.mjs ]; then
735
+ 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."
723
736
  exit 1
724
737
  fi
725
- echo "✅ bkit-tests-check passed (static=$STATIC_RESULT, unit=$UNIT_RESULT, unit tests executed=${UNIT_RAN:-unreported})."
738
+ node scripts/ci/check-capstone.mjs
726
739
 
727
740
  # bkit-stub:smoke — Post-CI smoke triggered by workflow_run on {{DEFAULT_BRANCH}}. To enable: copy the YAML below into .github/workflows/smoke.yml (separate file — workflow_run cannot share a file with push/pull_request) and delete this stub header.
728
741
  # name: Smoke
@@ -814,7 +827,9 @@ jobs:
814
827
  # bkit-tests-scope: runs-on: ubuntu-latest; timeout-minutes: 2; outputs: { plan: ${{ steps.scope.outputs.plan }} }
815
828
  # steps:
816
829
  # - name: Checkout Repository # [M] fetch-depth: 0 (turbo diffs need the base commit)
817
- # - name: Install Turbo # [M] npm i -g turbo@<ver> (bare, ~10-15s; no pnpm install)
830
+ # - name: Install Turbo # [M] bare global install, ~10-15s; no pnpm install. Version READ from
831
+ # # package.json, which pins turbo EXACTLY — never typed here, or this lane drifts from every
832
+ # # install-bearing lane: npm i -g "turbo@$(node -p "require('./package.json').devDependencies.turbo")"
818
833
  # - name: Resolve Base Ref # [M] push base = the branch's last green run; shipped:
819
834
  # # scripts/ci/lanes/resolve-push-base.mjs (falls back to github.event.before). deployments.md
820
835
  # # § One run per branch or pull request.
@@ -889,7 +904,7 @@ jobs:
889
904
  # # docs/testing.md § Schema-invariant DB checks.
890
905
  # - name: Run DB Tests (pgTAP) # [DB] if: schema invariants matter; runs supabase/tests/*.sql
891
906
  # - name: Run Unit Tests # [U] the one tier every repo has (source CI_ENV_FILE if needed)
892
- # - name: Report Coverage on PR # [U/PR] bkit-stub:coverage — davelosert/vitest-coverage-report-action posts a per-tier coverage comment (distinct name: unit|integration|e2e). With SEPARATE lanes each posts from its OWN lane: unit-cov here (gated on branches), integration-cov in bkit-tests-integration (report-only, gate-on-execution), e2e-cov in bkit-tests-e2e-web (bkit-stub:e2e-coverage, Monocart). Each lane needs job-level pull-requests: write + the json-summary/json reporters.
907
+ # - name: Report Coverage # [U/PR] bkit-stub:coverage — davelosert/vitest-coverage-report-action posts a per-tier coverage comment (distinct name: unit|integration|e2e); the unit report also writes its table, with the floor as target, to the job summary on every event. With SEPARATE lanes each posts from its OWN lane: unit-cov here (gated on branches), integration-cov in bkit-tests-integration (report-only, gate-on-execution), e2e-cov in bkit-tests-e2e-web (bkit-stub:e2e-coverage, Monocart). Each lane needs job-level pull-requests: write + the json-summary/json reporters.
893
908
  # - name: Build All Packages # moves to bkit-tests-build-web. Not this catalogue.
894
909
  # - name: Run Integration Tests # moves to bkit-tests-integration. Not this catalogue.
895
910
  # - name: Check Stale Test Data # [DB] continue-on-error. Lives in the lane that touches the shared resource.
@@ -1077,7 +1092,10 @@ jobs:
1077
1092
  # block queues on {{DEFAULT_BRANCH}} too. Runs BEFORE the E2E / @live lanes: each of those needs: it and
1078
1093
  # refuses unless production serves this run's build (by deployment id). Promotes the EXACT deployment_id
1079
1094
  # bkit-tests-build-web published. Does not look the deployment up again by SHA. A 409 is success only when
1080
- # the body says this id is already current production. A red job means the release did not happen; the
1095
+ # the body says this id is already current production. Before promoting it refuses, moving nothing, when
1096
+ # the id equals repo variable ROLLED_BACK_DEPLOYMENT_ID (set by the rollback) or when this commit is neither
1097
+ # production's commit nor a descendant of it (e.g. GitHub compare API status not ahead / identical), so a
1098
+ # re-run of an old run never moves production back. A red job means the release did not happen; the
1081
1099
  # previous deployment stays live. On a default-branch push the capstone needs: it, so a skipped or failed
1082
1100
  # deploy reds bkit-tests-check.
1083
1101
  # The host must not auto-build the default branch, and any "hold promotion until a check passes"
@@ -476,6 +476,7 @@ jobs:
476
476
  # SHA mirror bkit-ci.yml.
477
477
  - name: Install vale
478
478
  env:
479
+ # renovate: datasource=github-releases depName=errata-ai/vale
479
480
  VALE_VERSION: "3.9.1"
480
481
  VALE_SHA256: "fbc2eb47d0b8c50220ed1a2c5c611fbe0904ed567d638143d482016a18fd2db0"
481
482
  run: |
@@ -490,7 +491,7 @@ jobs:
490
491
  git config user.email 'bkit-auto@users.noreply.github.com'
491
492
 
492
493
  - name: Dispatch /bkit-auto on Claude Code runner
493
- uses: anthropics/claude-code-action@58985842b834ed26087302ba27d07bc24ca8697a # v1.0.244
494
+ uses: anthropics/claude-code-action@1d6de8cb0c237e7c15e9e1bdf973826ebae490cc # v1.0.248
494
495
  with:
495
496
  # Orchestrator contract: `/bkit-auto <phase> <arg>` where <arg> is the open
496
497
  # PR number (ship/debug) or the tracker issue number/id (design/plan/build).
@@ -542,6 +543,7 @@ jobs:
542
543
  # is v1.19.0), so the curl installer (https://opencode.ai/install downloads GitHub
543
544
  # release binaries) cannot fetch 2.0.26. npm's postinstall selects the runner's
544
545
  # platform binary.
546
+ # renovate: datasource=npm depName=@opencode/cli
545
547
  npm install -g @opencode/cli@2.0.26
546
548
  echo "$(npm prefix -g)/bin" >> "$GITHUB_PATH"
547
549
 
@@ -65,7 +65,7 @@ jobs:
65
65
  # app-id: ${{ secrets.RENOVATE_APP_ID }}
66
66
  # private-key: ${{ secrets.RENOVATE_APP_PRIVATE_KEY }}
67
67
  # then set `token: ${{ steps.app-token.outputs.token }}` below.
68
- - uses: renovatebot/github-action@dd5302ec17783b2fc721b19ae7209b57b1587765 # v46.1.17
68
+ - uses: renovatebot/github-action@230ce922b08968d0a4f6f70f295601daff09ef1d # v46.3.7
69
69
  with:
70
70
  # PAT secret (default). FINE-GRAINED repository permissions (this repo):
71
71
  # Contents: Read and write · Pull requests: Read and write ·
@@ -78,6 +78,13 @@ jobs:
78
78
  # lets Renovate use your verified email as the git author — org-owned tokens have no
79
79
  # such permission, so set RENOVATE_GIT_AUTHOR below instead.)
80
80
  token: ${{ secrets.BKIT_GH_TOKEN }}
81
+ # Exact Renovate image tag. Unset, the action runs the floating `renovate:<major>`
82
+ # tag, which can sit a major behind the latest. renovate.json5 `customManagers`
83
+ # reads the comment below and opens a PR when a newer release lands. The lookup
84
+ # uses GitHub releases (they carry publish dates, so `minimumReleaseAge` applies);
85
+ # the image tags on ghcr.io carry none.
86
+ # renovate: datasource=github-releases depName=renovatebot/renovate
87
+ renovate-version: "44.151.0"
81
88
  env:
82
89
  # Scope to THIS repo only — never org-wide autodiscover.
83
90
  RENOVATE_REPOSITORIES: ${{ github.repository }}
@@ -0,0 +1,67 @@
1
+ # Example Trivy scan. Copy it to `.github/workflows/bkit-trivy.yml` and own it.
2
+ # bkit install does not write this file and does not overwrite a copy.
3
+ #
4
+ # Fails on a HIGH or CRITICAL finding in any lockfile (every language Trivy reads), in
5
+ # config files (Dockerfile, Terraform, Kubernetes, Helm, CloudFormation) and in secrets
6
+ # committed to tracked files. Accept a finding in `.trivyignore.yaml`, each entry with a
7
+ # `statement` (why) and an `expired_at` (when it comes back). See
8
+ # `.bkit/templates.md` § Trivy.
9
+ #
10
+ # Runs the official image pinned by tag AND digest. Never reference
11
+ # `aquasecurity/trivy-action` or `setup-trivy` by tag: in March 2026 their tags were
12
+ # re-pointed at a credential stealer. This file is yours, so Renovate bumps the tag and
13
+ # digest together. Do NOT add this path to renovate.json5 `ignorePaths`.
14
+ name: Trivy
15
+
16
+ on:
17
+ workflow_dispatch:
18
+ push:
19
+ branches: [{{DEFAULT_BRANCH}}, dev]
20
+ pull_request:
21
+ branches: [{{DEFAULT_BRANCH}}, dev]
22
+ schedule:
23
+ # New advisories land without a code change; the daily run catches them.
24
+ - cron: "41 5 * * *"
25
+
26
+ # The scan reads the checkout and needs no secret and no write scope.
27
+ permissions:
28
+ contents: read
29
+
30
+ concurrency:
31
+ group: trivy-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref }}
32
+ cancel-in-progress: true
33
+
34
+ jobs:
35
+ trivy:
36
+ runs-on: ubuntu-latest # Edit this label in your copy.
37
+ timeout-minutes: 15
38
+ steps:
39
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40
+ with:
41
+ persist-credentials: false
42
+
43
+ # `scripts/ci/check-dependency-audit.mjs` (bkit-ci.yml `Check Dependency Audit`)
44
+ # already gates pnpm-lock.yaml against `accepted-advisories.json`; scanning it here
45
+ # too would need every acceptance twice. Without that gate, Trivy owns the lockfile.
46
+ - name: Plan Scan
47
+ id: plan
48
+ run: |
49
+ args=""
50
+ if [ -f scripts/ci/check-dependency-audit.mjs ]; then
51
+ args="$args --skip-files pnpm-lock.yaml"
52
+ fi
53
+ if [ -f .trivyignore.yaml ]; then
54
+ args="$args --ignorefile .trivyignore.yaml"
55
+ fi
56
+ echo "args=$args" >> "$GITHUB_OUTPUT"
57
+
58
+ # --include-dev-deps: without it Trivy drops every dev dependency from npm, yarn
59
+ # and pnpm lockfiles, and a repo of dev tooling scans zero packages and passes.
60
+ # --skip-dirs .bkit/templates: bkit rewrites those files; your adopted copies are
61
+ # scanned where they live.
62
+ - name: Run Trivy
63
+ uses: docker://ghcr.io/aquasecurity/trivy:0.75.0@sha256:af6acf9a6b85dfe389a1941505c0ce9efef52a4719635e1a962f022a3d855daa
64
+ with:
65
+ args: >-
66
+ fs --scanners vuln,misconfig,secret --severity HIGH,CRITICAL --exit-code 1
67
+ --include-dev-deps --skip-dirs .bkit/templates ${{ steps.plan.outputs.args }} .
@@ -14,3 +14,9 @@
14
14
  # extras BELOW this line.
15
15
  set -e
16
16
  pnpm bkit:gate:format
17
+
18
+ # disk prune — keep this block last. Starts your min cleanup steps (`bkit disk prune`,
19
+ # .bkit/templates.md § Disk prune) in the background, at most once a day; with no step
20
+ # files it does nothing. Not a gate: a failure warns and the commit goes on.
21
+ pnpm -s bkit disk prune --mode=min --auto < /dev/null > /dev/null ||
22
+ echo "[pre-commit] WARN: disk prune failed; commit continues" >&2
@@ -20,15 +20,20 @@ set -e
20
20
  # all-zero local sha. When EVERY line is a delete, the push carries no commits. A push
21
21
  # mixing a delete with a real update still gates, and so does an empty ref list. Reading
22
22
  # stdin here is safe: every later command redirects from /dev/null. `[ -t 0 ]` keeps a
23
- # hand-run hook from hanging.
23
+ # hand-run hook from hanging. The loop also sets PUSH_DEV_SHA (commit pushed to dev) for
24
+ # repo extras that gate only dev pushes (e.g. scripts/graphify/bkit-graph-pre-push.sh).
24
25
  PUSH_SAW_REF=0
25
26
  PUSH_HAS_COMMITS=0
27
+ PUSH_DEV_SHA=""
26
28
  if [ ! -t 0 ]; then
27
- while read -r _push_local_ref push_local_sha _push_remote_ref _push_remote_sha; do
29
+ while read -r _push_local_ref push_local_sha push_remote_ref _push_remote_sha; do
28
30
  [ -n "$push_local_sha" ] || continue
29
31
  PUSH_SAW_REF=1
30
32
  case "$push_local_sha" in
31
- *[!0]*) PUSH_HAS_COMMITS=1 ;;
33
+ *[!0]*)
34
+ PUSH_HAS_COMMITS=1
35
+ [ "$push_remote_ref" = "refs/heads/dev" ] && PUSH_DEV_SHA="$push_local_sha"
36
+ ;;
32
37
  esac
33
38
  done
34
39
  fi
@@ -96,3 +101,10 @@ fi
96
101
  # Outside the gate scripts: it validates the bkit install, not your source.
97
102
  # Fix: `pnpm bkit install`, stage the regenerated files, commit, push.
98
103
  pnpm bkit check < /dev/null
104
+
105
+ # disk prune — keep this block last, so it runs only once every gate above passed. Starts
106
+ # your max cleanup steps (`bkit disk prune`, .bkit/templates.md § Disk prune) in the
107
+ # background, at most once a day, or hourly while free disk is under bkit.disk.minFreeGb;
108
+ # with no step files it does nothing. Not a gate: a failure warns and the push goes on.
109
+ pnpm -s bkit disk prune --mode=max --auto < /dev/null > /dev/null ||
110
+ echo "[pre-push] WARN: disk prune failed; push continues" >&2
@@ -1,3 +1,7 @@
1
1
  {
2
- "*": "prettier --write --ignore-unknown"
2
+ "docs/{plans,audits}/**/*.md": [
3
+ "node scripts/prettier/bkit-insert-ignore.mjs",
4
+ "prettier --write --ignore-unknown"
5
+ ],
6
+ "!(docs/{plans,audits}/**/*.md)": "prettier --write --ignore-unknown"
3
7
  }