@cbartens/bkit 5.5.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/.bkit/README.md +167 -154
  2. package/.bkit/core/.agents/context.md +95 -29
  3. package/.bkit/core/.agents/docs.md +18 -15
  4. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +1 -0
  5. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +6 -5
  6. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-readguard.cjs +1 -0
  7. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-rules.cjs +65 -0
  8. package/.bkit/core/.agents/rules.md +112 -102
  9. package/.bkit/core/.agents/skills.md +63 -15
  10. package/.bkit/core/.bkit/README.md +167 -154
  11. package/.bkit/core/.bkit/authoring.md +747 -0
  12. package/.bkit/core/.bkit/cli.md +407 -0
  13. package/.bkit/core/.bkit/cloud.md +283 -195
  14. package/.bkit/core/.bkit/comparison.md +45 -43
  15. package/.bkit/core/.bkit/install.md +166 -95
  16. package/.bkit/core/.bkit/jsonl.md +339 -196
  17. package/.bkit/core/.bkit/pipeline.md +142 -145
  18. package/.bkit/core/.bkit/prompts.md +295 -264
  19. package/.bkit/core/.bkit/providers.md +460 -277
  20. package/.bkit/core/.bkit/router.md +69 -0
  21. package/.bkit/core/.bkit/templates.md +530 -256
  22. package/.bkit/core/.bkit/trackers.md +116 -65
  23. package/.bkit/core/.bkit/workflows.md +742 -618
  24. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +2 -2
  25. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +3 -3
  26. package/.bkit/core/.claude/hooks/bkit-preflight.sh +45 -14
  27. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +3 -3
  28. package/.bkit/core/.codex/hooks/bkit-rules.cjs +57 -0
  29. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +7 -7
  30. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +47 -12
  31. package/.bkit/core/.opencode/plugin/bkit-rules.js +89 -0
  32. package/.bkit/core/AGENTS.md +6 -80
  33. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +128 -130
  34. package/.bkit/core/docs/templates/bkit-audit-adoption.md +104 -94
  35. package/.bkit/core/docs/templates/bkit-audit-agents.md +96 -98
  36. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +100 -103
  37. package/.bkit/core/docs/templates/bkit-audit-analytics.md +141 -107
  38. package/.bkit/core/docs/templates/bkit-audit-annotations.md +99 -97
  39. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +122 -121
  40. package/.bkit/core/docs/templates/bkit-audit-app-store.md +158 -101
  41. package/.bkit/core/docs/templates/bkit-audit-architecture.md +114 -96
  42. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +76 -97
  43. package/.bkit/core/docs/templates/bkit-audit-config.md +123 -101
  44. package/.bkit/core/docs/templates/bkit-audit-cost.md +86 -99
  45. package/.bkit/core/docs/templates/bkit-audit-coverage.md +76 -93
  46. package/.bkit/core/docs/templates/bkit-audit-database.md +102 -95
  47. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +165 -108
  48. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +115 -109
  49. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +265 -113
  50. package/.bkit/core/docs/templates/bkit-audit-documentation.md +119 -118
  51. package/.bkit/core/docs/templates/bkit-audit-duplication.md +140 -111
  52. package/.bkit/core/docs/templates/bkit-audit-failures.md +111 -106
  53. package/.bkit/core/docs/templates/bkit-audit-flakes.md +100 -99
  54. package/.bkit/core/docs/templates/bkit-audit-gates.md +107 -103
  55. package/.bkit/core/docs/templates/bkit-audit-issues.md +105 -105
  56. package/.bkit/core/docs/templates/bkit-audit-llm.md +134 -85
  57. package/.bkit/core/docs/templates/bkit-audit-logs.md +124 -125
  58. package/.bkit/core/docs/templates/bkit-audit-models.md +99 -78
  59. package/.bkit/core/docs/templates/bkit-audit-privacy.md +56 -76
  60. package/.bkit/core/docs/templates/bkit-audit-prompts.md +63 -78
  61. package/.bkit/core/docs/templates/bkit-audit-red-team.md +125 -93
  62. package/.bkit/core/docs/templates/bkit-audit-reliability.md +97 -96
  63. package/.bkit/core/docs/templates/bkit-audit-repo.md +170 -98
  64. package/.bkit/core/docs/templates/bkit-audit-security.md +207 -121
  65. package/.bkit/core/docs/templates/bkit-audit-slop.md +78 -95
  66. package/.bkit/core/docs/templates/bkit-audit-testing.md +163 -139
  67. package/.bkit/core/docs/templates/bkit-audit-usability.md +114 -96
  68. package/.bkit/core/docs/templates/bkit-plan.md +158 -281
  69. package/.bkit/core/engine/checks/after/auth.ts +40 -37
  70. package/.bkit/core/engine/checks/after/ci-yml.ts +104 -31
  71. package/.bkit/core/engine/checks/after/github.ts +95 -17
  72. package/.bkit/core/engine/checks/after/index.ts +21 -8
  73. package/.bkit/core/engine/checks/after/suppression.ts +8 -5
  74. package/.bkit/core/engine/checks/after/tools.ts +125 -123
  75. package/.bkit/core/engine/checks/before/context-fetch.ts +227 -33
  76. package/.bkit/core/engine/checks/before/env.ts +3 -3
  77. package/.bkit/core/engine/checks/before/files.ts +5 -4
  78. package/.bkit/core/engine/checks/before/index.ts +25 -1
  79. package/.bkit/core/engine/checks/before/repo.ts +208 -2
  80. package/.bkit/core/engine/checks/status-holes.ts +916 -123
  81. package/.bkit/core/engine/checks/tips/catalogue.ts +82 -20
  82. package/.bkit/core/engine/checks/tips/detect.ts +66 -0
  83. package/.bkit/core/engine/checks/tips/index.ts +52 -11
  84. package/.bkit/core/engine/cli.ts +251 -130
  85. package/.bkit/core/engine/commands/analysis.ts +282 -199
  86. package/.bkit/core/engine/commands/ci/ci.ts +363 -29
  87. package/.bkit/core/engine/commands/ci/pins.ts +172 -0
  88. package/.bkit/core/engine/commands/ci/push-gate.ts +223 -0
  89. package/.bkit/core/engine/commands/comply.ts +77 -103
  90. package/.bkit/core/engine/commands/install/doctor.ts +2 -2
  91. package/.bkit/core/engine/commands/install/install.ts +57 -18
  92. package/.bkit/core/engine/commands/install/uninstall.ts +86 -55
  93. package/.bkit/core/engine/commands/install/upgrade.ts +32 -15
  94. package/.bkit/core/engine/commands/land.ts +139 -18
  95. package/.bkit/core/engine/commands/lib.ts +381 -22
  96. package/.bkit/core/engine/commands/registry.ts +10 -2
  97. package/.bkit/core/engine/commands/setup/setup.ts +8 -7
  98. package/.bkit/core/engine/commands/stats.ts +260 -0
  99. package/.bkit/core/engine/commands/tips.ts +10 -5
  100. package/.bkit/core/engine/commands/workflow/branches.ts +2215 -176
  101. package/.bkit/core/engine/commands/workflow/challenge.ts +748 -0
  102. package/.bkit/core/engine/commands/workflow/completeness.ts +109 -0
  103. package/.bkit/core/engine/commands/workflow/context.ts +1249 -47
  104. package/.bkit/core/engine/commands/workflow/counters.ts +483 -95
  105. package/.bkit/core/engine/commands/workflow/decisions.ts +585 -0
  106. package/.bkit/core/engine/commands/workflow/disk.ts +238 -56
  107. package/.bkit/core/engine/commands/workflow/fids.ts +811 -33
  108. package/.bkit/core/engine/commands/workflow/issues.ts +413 -64
  109. package/.bkit/core/engine/commands/workflow/ledgers.ts +1333 -36
  110. package/.bkit/core/engine/commands/workflow/locks.ts +28 -2
  111. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +691 -0
  112. package/.bkit/core/engine/commands/workflow/plan-versions.ts +21 -0
  113. package/.bkit/core/engine/commands/workflow/plans.ts +257 -0
  114. package/.bkit/core/engine/commands/workflow/prs.ts +178 -33
  115. package/.bkit/core/engine/commands/workflow/repo.ts +66 -8
  116. package/.bkit/core/engine/commands/workflow/roadmap.ts +72 -22
  117. package/.bkit/core/engine/commands/workflow/run-facts.ts +492 -0
  118. package/.bkit/core/engine/commands/workflow/runs.ts +827 -79
  119. package/.bkit/core/engine/commands/workflow/runtime.ts +25 -1
  120. package/.bkit/core/engine/commands/workflow/skills.ts +1 -0
  121. package/.bkit/core/engine/commands/workflow/status.ts +329 -33
  122. package/.bkit/core/engine/commands/workflow/step-table.ts +381 -0
  123. package/.bkit/core/engine/commands/workflow/steps.ts +841 -105
  124. package/.bkit/core/engine/commands/workflow/summary-findings.ts +177 -0
  125. package/.bkit/core/engine/commands/workflow/summary.ts +544 -0
  126. package/.bkit/core/engine/commands/workflow/tasks.ts +409 -0
  127. package/.bkit/core/engine/commands/workflow/test-blocks.ts +254 -0
  128. package/.bkit/core/engine/commands/workflow/tests-changed.ts +201 -0
  129. package/.bkit/core/engine/commands/workflow/tests.ts +2124 -330
  130. package/.bkit/core/engine/commands/workflow/tracker.ts +1195 -0
  131. package/.bkit/core/engine/commands/workflow/workflows.ts +1197 -235
  132. package/.bkit/core/engine/commands/workflow/worktrees.ts +543 -24
  133. package/.bkit/core/engine/install/cloud-env.ts +251 -121
  134. package/.bkit/core/engine/install/context-ci-workflow.ts +102 -0
  135. package/.bkit/core/engine/install/manifest.ts +67 -17
  136. package/.bkit/core/engine/install/modules/antigravity.ts +3 -2
  137. package/.bkit/core/engine/install/modules/cloud.ts +24 -16
  138. package/.bkit/core/engine/install/modules/codex.ts +15 -2
  139. package/.bkit/core/engine/install/modules/core.ts +1196 -45
  140. package/.bkit/core/engine/install/modules/cursor.ts +6 -6
  141. package/.bkit/core/engine/install/modules/opencode.ts +18 -6
  142. package/.bkit/core/engine/install/template-notes.ts +130 -0
  143. package/.bkit/core/engine/install/version-file.ts +9 -4
  144. package/.bkit/core/engine/install/write.ts +5 -0
  145. package/.bkit/core/engine/ledgers/compact.ts +124 -0
  146. package/.bkit/core/engine/ledgers/journal.ts +291 -0
  147. package/.bkit/core/engine/ledgers/migrate.ts +92 -0
  148. package/.bkit/core/engine/ledgers/status.ts +249 -21
  149. package/.bkit/core/engine/ledgers/telemetry.ts +1397 -253
  150. package/.bkit/core/engine/render/hosts.ts +118 -14
  151. package/.bkit/core/engine/render/models.ts +12 -0
  152. package/.bkit/core/engine/shared/bkit-latest.ts +26 -4
  153. package/.bkit/core/engine/shared/branches.ts +4 -1
  154. package/.bkit/core/engine/shared/dep-updater.ts +60 -0
  155. package/.bkit/core/engine/shared/egress.ts +8 -1
  156. package/.bkit/core/engine/shared/json.ts +25 -7
  157. package/.bkit/core/engine/shared/package-manager.ts +9 -0
  158. package/.bkit/core/engine/shared/settings.ts +243 -31
  159. package/.bkit/core/engine/shared/text.ts +361 -0
  160. package/.bkit/core/engine/shared/timeouts.ts +2 -0
  161. package/.bkit/core/engine/tools/cli-doc.ts +111 -0
  162. package/.bkit/core/engine/tools/grammar-density.ts +215 -0
  163. package/.bkit/core/engine/tools/instructions-sources.ts +832 -0
  164. package/.bkit/core/engine/tools/instructions.ts +1802 -0
  165. package/.bkit/core/hooks/antigravity-hook.js +25 -10
  166. package/.bkit/core/hooks/gateguard-engine.js +54 -29
  167. package/.bkit/core/hooks/guardrails-shell.js +4 -5
  168. package/.bkit/core/hooks/guardrails-tiers.js +10 -4
  169. package/.bkit/core/hooks/preflight-linear.sh +9 -9
  170. package/.bkit/core/hooks/preflight-rules.sh +8 -0
  171. package/.bkit/core/hooks/readguard-engine.js +29 -10
  172. package/.bkit/core/hooks/session-rules-advisory.js +61 -0
  173. package/.bkit/core/prompts/bkit-audit-generate.md +202 -94
  174. package/.bkit/core/prompts/bkit-build-challenge-1.md +76 -34
  175. package/.bkit/core/prompts/bkit-build-challenge-2.md +85 -38
  176. package/.bkit/core/prompts/bkit-build-install-skills.md +50 -28
  177. package/.bkit/core/prompts/bkit-build-plan-convert.md +85 -0
  178. package/.bkit/core/prompts/bkit-build-plan-current.md +59 -36
  179. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +101 -36
  180. package/.bkit/core/prompts/bkit-build-plan-tasks.md +149 -0
  181. package/.bkit/core/prompts/bkit-build-plan-tests.md +120 -0
  182. package/.bkit/core/prompts/bkit-build-plan-verify.md +104 -43
  183. package/.bkit/core/prompts/bkit-debug-abort-handover.md +47 -32
  184. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +109 -57
  185. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +65 -39
  186. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +53 -31
  187. package/.bkit/core/prompts/bkit-debug-failure-soak.md +65 -34
  188. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +46 -31
  189. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +45 -31
  190. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +43 -30
  191. package/.bkit/core/prompts/bkit-design-generate.md +80 -46
  192. package/.bkit/core/prompts/bkit-design-organise.md +83 -32
  193. package/.bkit/core/prompts/bkit-design-review-1.md +70 -50
  194. package/.bkit/core/prompts/bkit-design-review-2.md +65 -46
  195. package/.bkit/core/prompts/bkit-design-spike.md +64 -40
  196. package/.bkit/core/prompts/bkit-design-update.md +53 -28
  197. package/.bkit/core/prompts/bkit-plan-generate.md +101 -29
  198. package/.bkit/core/prompts/bkit-plan-review-1.md +78 -41
  199. package/.bkit/core/prompts/bkit-plan-review-2.md +78 -35
  200. package/.bkit/core/prompts/bkit-plan-scope-check.md +116 -0
  201. package/.bkit/core/prompts/bkit-plan-update.md +86 -31
  202. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +94 -50
  203. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +91 -41
  204. package/.bkit/core/prompts/bkit-ship-update-docs.md +45 -24
  205. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +65 -49
  206. package/.bkit/core/prompts/bkit-utility-update-decisions.md +87 -42
  207. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +81 -37
  208. package/.bkit/core/prompts/bkit-utility-update-documentation.md +43 -25
  209. package/.bkit/core/prompts/bkit-utility-update-failures.md +84 -37
  210. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +88 -42
  211. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +92 -39
  212. package/.bkit/core/prompts/bkit-utility-update-tracker.md +159 -60
  213. package/.bkit/core/workflows/bkit-auto.md +89 -58
  214. package/.bkit/core/workflows/bkit-build.md +967 -517
  215. package/.bkit/core/workflows/bkit-debug.md +555 -387
  216. package/.bkit/core/workflows/bkit-design.md +319 -283
  217. package/.bkit/core/workflows/bkit-plan.md +319 -342
  218. package/.bkit/core/workflows/bkit-ship.md +525 -328
  219. package/.bkit/shared/.agents/plugins/bkit/hooks.json +10 -0
  220. package/.bkit/shared/.bkit/.env.example +2 -2
  221. package/.bkit/shared/.claude/bkit-cloud.md +12 -10
  222. package/.bkit/shared/.claude/settings.json +14 -0
  223. package/.bkit/shared/.codex/bkit-cloud.md +98 -0
  224. package/.bkit/shared/.codex/hooks.json +20 -0
  225. package/.bkit/shared/.cursor/bkit-cloud.md +3 -3
  226. package/.bkit/shared/.cursor/mcp.json +1 -1
  227. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +1 -1
  228. package/.bkit/shared/.gitattributes +1 -1
  229. package/.bkit/shared/.mcp.json +1 -1
  230. package/.bkit/shared/.opencode/opencode.json +12 -1
  231. package/.bkit/shared/CLAUDE.md +6 -2
  232. package/.bkit/shared/GEMINI.md +5 -2
  233. package/.bkit/shared/docs/architecture.md +4 -7
  234. package/.bkit/shared/docs/data-schema.md +4 -7
  235. package/.bkit/shared/docs/deployments.md +241 -168
  236. package/.bkit/shared/docs/design.md +11 -12
  237. package/.bkit/shared/docs/noise.md +8 -7
  238. package/.bkit/shared/docs/observability.md +5 -8
  239. package/.bkit/shared/docs/security.md +35 -17
  240. package/.bkit/shared/docs/setup.md +29 -18
  241. package/.bkit/shared/docs/technology.md +3 -6
  242. package/.bkit/shared/docs/testing.md +289 -174
  243. package/.bkit/shared/gitignore +6 -2
  244. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +15 -16
  245. package/.bkit/templates/.cursor/Dockerfile +12 -8
  246. package/.bkit/templates/.cursor/environment.json +1 -1
  247. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-bug.yml +10 -8
  248. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-change.yml +45 -12
  249. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +3 -3
  250. package/.bkit/templates/.github/renovate.json5 +34 -6
  251. package/.bkit/templates/.github/workflows/bkit-ci.yml +54 -51
  252. package/.bkit/templates/.github/workflows/bkit-cloud.yml +34 -33
  253. package/.bkit/templates/.github/workflows/bkit-health.yml +97 -0
  254. package/.bkit/templates/.github/workflows/bkit-renovate.yml +5 -4
  255. package/.bkit/templates/.github/workflows/bkit-trivy.yml +5 -4
  256. package/.bkit/templates/.husky/pre-commit +2 -2
  257. package/.bkit/templates/.husky/pre-push +96 -36
  258. package/.bkit/templates/.prettierignore +6 -0
  259. package/.bkit/templates/.vale.ini +27 -27
  260. package/.bkit/templates/context/bkit-cloudrun.md +23 -15
  261. package/.bkit/templates/context/bkit-expo.md +70 -52
  262. package/.bkit/templates/context/bkit-github.md +93 -56
  263. package/.bkit/templates/context/bkit-inngest.md +21 -15
  264. package/.bkit/templates/context/bkit-maestro.md +22 -16
  265. package/.bkit/templates/context/bkit-playwright.md +23 -17
  266. package/.bkit/templates/context/bkit-resend.md +12 -10
  267. package/.bkit/templates/context/bkit-sentry.md +30 -20
  268. package/.bkit/templates/context/bkit-serena.md +8 -7
  269. package/.bkit/templates/context/bkit-stripe.md +14 -13
  270. package/.bkit/templates/context/bkit-supabase.md +16 -13
  271. package/.bkit/templates/context/bkit-tavily.md +14 -11
  272. package/.bkit/templates/context/bkit-vercel.md +27 -18
  273. package/.bkit/templates/docs/capabilities.md +15 -14
  274. package/.bkit/templates/scripts/ci/{check-accepted-divergences.mjs → bkit-check-accepted-divergences.mjs} +6 -3
  275. package/.bkit/templates/scripts/ci/{check-accepted-divergences.test.mjs → bkit-check-accepted-divergences.test.mjs} +3 -3
  276. package/.bkit/templates/scripts/ci/{check-capstone.mjs → bkit-check-capstone.mjs} +2 -2
  277. package/.bkit/templates/scripts/ci/{check-capstone.test.mjs → bkit-check-capstone.test.mjs} +4 -4
  278. package/.bkit/templates/scripts/ci/{check-dependency-audit.mjs → bkit-check-dependency-audit.mjs} +103 -18
  279. package/.bkit/templates/scripts/ci/{check-dependency-audit.test.mjs → bkit-check-dependency-audit.test.mjs} +31 -3
  280. package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +387 -0
  281. package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +75 -0
  282. package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +160 -0
  283. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.mjs → bkit-resolve-push-base.mjs} +3 -3
  284. package/.bkit/templates/scripts/ci/lanes/{resolve-push-base.test.mjs → bkit-resolve-push-base.test.mjs} +4 -4
  285. package/.bkit/templates/scripts/cleanup/bkit-disk-prune.mjs +10 -2
  286. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +1 -1
  287. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +3 -3
  288. package/.bkit/templates/scripts/graphify/bkit-graph-embed.py +63 -0
  289. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +2 -2
  290. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +69 -18
  291. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +3 -3
  292. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +1 -1
  293. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
  294. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +197 -126
  295. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +64 -41
  296. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +23 -7
  297. package/.bkit/templates/slop-scan.config.json +9 -2
  298. package/CHANGELOG.md +231 -0
  299. package/README.md +278 -89
  300. package/dist/checks/after/auth.js +36 -33
  301. package/dist/checks/after/ci-yml.js +91 -30
  302. package/dist/checks/after/github.js +91 -17
  303. package/dist/checks/after/index.js +22 -11
  304. package/dist/checks/after/suppression.js +8 -5
  305. package/dist/checks/after/tools.js +111 -114
  306. package/dist/checks/before/context-fetch.js +218 -33
  307. package/dist/checks/before/env.js +3 -3
  308. package/dist/checks/before/files.js +5 -3
  309. package/dist/checks/before/index.js +20 -3
  310. package/dist/checks/before/repo.js +197 -2
  311. package/dist/checks/status-holes.js +739 -114
  312. package/dist/checks/tips/catalogue.js +70 -19
  313. package/dist/checks/tips/detect.js +62 -0
  314. package/dist/checks/tips/index.js +51 -9
  315. package/dist/cli.js +234 -124
  316. package/dist/commands/analysis.js +174 -141
  317. package/dist/commands/ci/ci.js +302 -25
  318. package/dist/commands/ci/pins.js +142 -0
  319. package/dist/commands/ci/push-gate.js +194 -0
  320. package/dist/commands/comply.js +54 -91
  321. package/dist/commands/install/doctor.js +2 -2
  322. package/dist/commands/install/install.js +50 -19
  323. package/dist/commands/install/uninstall.js +82 -55
  324. package/dist/commands/install/upgrade.js +21 -11
  325. package/dist/commands/land.js +137 -17
  326. package/dist/commands/lib.js +295 -21
  327. package/dist/commands/registry.js +10 -2
  328. package/dist/commands/setup/setup.js +8 -7
  329. package/dist/commands/stats.js +175 -0
  330. package/dist/commands/tips.js +7 -3
  331. package/dist/commands/workflow/branches.js +1873 -152
  332. package/dist/commands/workflow/challenge.js +609 -0
  333. package/dist/commands/workflow/completeness.js +97 -0
  334. package/dist/commands/workflow/context.js +1045 -46
  335. package/dist/commands/workflow/counters.js +385 -86
  336. package/dist/commands/workflow/decisions.js +484 -0
  337. package/dist/commands/workflow/disk.js +214 -56
  338. package/dist/commands/workflow/fids.js +706 -33
  339. package/dist/commands/workflow/issues.js +349 -59
  340. package/dist/commands/workflow/ledgers.js +1123 -37
  341. package/dist/commands/workflow/locks.js +26 -2
  342. package/dist/commands/workflow/plan-blocks.js +501 -0
  343. package/dist/commands/workflow/plan-versions.js +22 -0
  344. package/dist/commands/workflow/plans.js +205 -0
  345. package/dist/commands/workflow/prs.js +154 -35
  346. package/dist/commands/workflow/repo.js +58 -8
  347. package/dist/commands/workflow/roadmap.js +58 -23
  348. package/dist/commands/workflow/run-facts.js +421 -0
  349. package/dist/commands/workflow/runs.js +670 -72
  350. package/dist/commands/workflow/runtime.js +15 -1
  351. package/dist/commands/workflow/skills.js +1 -0
  352. package/dist/commands/workflow/status.js +282 -34
  353. package/dist/commands/workflow/step-table.js +308 -0
  354. package/dist/commands/workflow/steps.js +703 -96
  355. package/dist/commands/workflow/summary-findings.js +117 -0
  356. package/dist/commands/workflow/summary.js +388 -0
  357. package/dist/commands/workflow/tasks.js +378 -0
  358. package/dist/commands/workflow/test-blocks.js +231 -0
  359. package/dist/commands/workflow/tests-changed.js +172 -0
  360. package/dist/commands/workflow/tests.js +1695 -305
  361. package/dist/commands/workflow/tracker.js +983 -0
  362. package/dist/commands/workflow/workflows.js +1014 -222
  363. package/dist/commands/workflow/worktrees.js +432 -26
  364. package/dist/install/cloud-env.js +233 -99
  365. package/dist/install/context-ci-workflow.js +85 -0
  366. package/dist/install/manifest.js +64 -17
  367. package/dist/install/modules/antigravity.js +3 -2
  368. package/dist/install/modules/cloud.js +25 -16
  369. package/dist/install/modules/codex.js +12 -2
  370. package/dist/install/modules/core.js +1090 -48
  371. package/dist/install/modules/cursor.js +6 -6
  372. package/dist/install/modules/opencode.js +13 -7
  373. package/dist/install/template-notes.js +116 -0
  374. package/dist/install/version-file.js +9 -4
  375. package/dist/ledgers/compact.js +87 -0
  376. package/dist/ledgers/journal.js +233 -0
  377. package/dist/ledgers/migrate.js +81 -0
  378. package/dist/ledgers/status.js +176 -13
  379. package/dist/ledgers/telemetry.js +1010 -125
  380. package/dist/render/hosts.js +104 -14
  381. package/dist/render/models.js +12 -0
  382. package/dist/shared/bkit-latest.js +26 -4
  383. package/dist/shared/branches.js +3 -1
  384. package/dist/shared/dep-updater.js +49 -0
  385. package/dist/shared/egress.js +8 -1
  386. package/dist/shared/json.js +20 -7
  387. package/dist/shared/package-manager.js +6 -0
  388. package/dist/shared/settings.js +181 -24
  389. package/dist/shared/text.js +333 -0
  390. package/dist/shared/timeouts.js +2 -0
  391. package/dist/tools/cli-doc.js +97 -0
  392. package/dist/tools/grammar-density.js +183 -0
  393. package/dist/tools/instructions-sources.js +720 -0
  394. package/dist/tools/instructions.js +1623 -0
  395. package/package.json +156 -51
  396. package/.bkit/core/.bkit/lite.md +0 -73
  397. package/.bkit/core/engine/commands/harvest.ts +0 -459
  398. package/.bkit/core/engine/commands/workflow/workstreams.ts +0 -166
  399. package/.bkit/core/engine/tools/wording.ts +0 -748
  400. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +0 -69
  401. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +0 -71
  402. package/.bkit/core/prompts/bkit-build-challenge-tests.md +0 -74
  403. package/.bkit/core/prompts/bkit-build-plan-execute.md +0 -76
  404. package/.bkit/core/prompts/bkit-build-summary.md +0 -94
  405. package/.bkit/core/prompts/bkit-debug-summary.md +0 -96
  406. package/.bkit/core/prompts/bkit-design-summary.md +0 -107
  407. package/.bkit/core/prompts/bkit-plan-complexity-check.md +0 -67
  408. package/.bkit/core/prompts/bkit-plan-complexity-split.md +0 -88
  409. package/.bkit/core/prompts/bkit-plan-review-3.md +0 -93
  410. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +0 -85
  411. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +0 -85
  412. package/.bkit/core/prompts/bkit-plan-summary.md +0 -107
  413. package/.bkit/core/prompts/bkit-ship-summary.md +0 -78
  414. package/.bkit/templates/scripts/ci/bkit-local-stack-lock.sh +0 -194
  415. package/dist/commands/harvest.js +0 -353
  416. package/dist/commands/workflow/workstreams.js +0 -143
  417. package/dist/tools/wording.js +0 -680
  418. /package/.bkit/templates/.vale/styles/{House → Bkit}/Filler.yml +0 -0
  419. /package/.bkit/templates/.vale/styles/{House → Bkit}/Hedging.yml +0 -0
  420. /package/.bkit/templates/.vale/styles/{House → Bkit}/LLMSlop.yml +0 -0
  421. /package/.bkit/templates/.vale/styles/{House → Bkit}/Verbose.yml +0 -0
  422. /package/.bkit/templates/scripts/ci/{accepted-advisories.json → bkit-accepted-advisories.json} +0 -0
  423. /package/.bkit/templates/scripts/ci/{accepted-divergences.json → bkit-accepted-divergences.json} +0 -0
  424. /package/.bkit/templates/scripts/launchd/{launchd.env.example → bkit-launchd.env.example} +0 -0
  425. /package/.bkit/templates/scripts/launchd/{ai.bkit.launchd.plist → bkit-launchd.plist} +0 -0
@@ -35,7 +35,7 @@ REPORTS="$OUT/reports"
35
35
  # Report filenames — RENAME HERE AND NOWHERE ELSE. Each is referenced once
36
36
  # below, so a new name takes effect on the next run with no other edit. These
37
37
  # are all derived artifacts: renaming one never invalidates the graph, and the
38
- # old file is not cleaned up automatically — delete it or run `pnpm graph:clean`.
38
+ # old file is not cleaned up automatically — delete it or run `pnpm bkit:graph:clean`.
39
39
  R_REPORT="graph-report.md" # cluster-only's own report, moved here
40
40
  R_TREE="graph-tree.html" # collapsible folder tree
41
41
  R_FULL_GRAPHML="graph.graphml" # whole graph for Gephi
@@ -82,39 +82,48 @@ R_EAGER="graph-eager.json"
82
82
  # register carries its findings.
83
83
  REACH_MJS="scripts/ci/guards/assert-routes-reachable.mjs"
84
84
  R_REACH="graph-reachability.json"
85
+ # Docs that carry a copy of the register's packages diagram between the
86
+ # graph:packages markers, space-separated; empty = none. rollup, register and
87
+ # refresh rewrite each copy, and check fails on a stale one. Runs on system python.
88
+ EMBED_PY="scripts/graphify/bkit-graph-embed.py"
89
+ GRAPH_EMBED_DOCS=""
85
90
 
86
91
  usage() {
87
92
  cat <<'EOF'
88
- Usage: pnpm graph[:clean|:update|:rollup|:refresh|:check|:graphml|:tree|:scoped]
93
+ Usage: pnpm bkit:graph[:clean|:update|:rollup|:refresh|:check|:graphml|:tree|:scoped]
89
94
 
90
- graph Full repo: extract + cluster. ~2 min, 0 tokens.
91
- graph:clean Same, but deletes the output dir first. REQUIRED after any
95
+ bkit:graph Full repo: extract + cluster. ~2 min, 0 tokens.
96
+ bkit:graph:clean Same, but deletes the output dir first. REQUIRED after any
92
97
  tsconfig `paths` change — `--force` re-reads source files but
93
98
  NOT the module-resolution cache, so a graph built after an
94
99
  alias edit will silently keep the old, unresolved edges.
95
- graph:update Re-extract changed files only, then recluster.
96
- graph:check Rebuild from THIS tree; fail if the tracked register
97
- docs/capabilities.md differs from the rebuild. Writes nothing
98
- tracked. Reads uncommitted edits — `check-at` does not.
99
- graph:refresh Rebuild the register in a clean checkout of HEAD, copy it
100
- over docs/capabilities.md. Fixes a red gate; commit it.
100
+ bkit:graph:update Re-extract changed files only, then recluster.
101
+ bkit:graph:check Rebuild from THIS tree; fail if the tracked register
102
+ docs/capabilities.md differs from the rebuild, or a
103
+ GRAPH_EMBED_DOCS copy of its packages diagram differs from
104
+ the register. Writes nothing tracked. Reads uncommitted
105
+ edits — `check-at` does not.
106
+ bkit:graph:refresh Rebuild the register in a clean checkout of the STAGED
107
+ files (the index), copy it over docs/capabilities.md, and
108
+ rewrite the GRAPH_EMBED_DOCS copies. Stage your change
109
+ first. Fixes a red gate; commit it.
101
110
  check-at <rev> `check` in a throwaway checkout of <rev>. Pre-push runs it
102
- for every push to dev; CI runs `check` on every push to dev.
111
+ for every push to dev; CI runs it for every push and pull request.
103
112
  spec Print the pinned graphify release (pip spec).
104
- graph:rollup Collapse the symbol graph into a package view (~24 nodes, the
113
+ bkit:graph:rollup Collapse the symbol graph into a package view (~24 nodes, the
105
114
  architecture) and a module view (~133 nodes, the subsystems),
106
115
  as interactive HTML. Edge weight is the number of underlying
107
116
  symbol edges. Open these INSTEAD of the full graph; 9.8K nodes
108
117
  is a database, not a picture.
109
- graph:graphml OPT-IN, for Gephi / yEd only — nothing else produces GraphML.
118
+ bkit:graph:graphml OPT-IN, for Gephi / yEd only — nothing else produces GraphML.
110
119
  Writes all three views: the whole graph plus the two rollups.
111
120
  The CLI has no --graphml flag (it exists only on the /graphify
112
121
  skill, which this repo does not install), so the whole-graph
113
122
  export calls graphify's own to_graphml() through its bundled
114
123
  interpreter.
115
- graph:tree Collapsible folder tree with search and an outbound-edge
124
+ bkit:graph:tree Collapsible folder tree with search and an outbound-edge
116
125
  inspector.
117
- graph:scoped One subtree with a browsable graph.html.
126
+ bkit:graph:scoped One subtree with a browsable graph.html.
118
127
  Path defaults to apps/web/src; pass another as $2.
119
128
 
120
129
  Two directories, both gitignored and both rebuilt from source:
@@ -122,7 +131,7 @@ Two directories, both gitignored and both rebuilt from source:
122
131
  <out>/ RAW graph data — graph.json, manifest.json, cache/. graphify
123
132
  owns this layout; the read commands (affected, god-nodes,
124
133
  explain, path, query) all resolve <out>/graph.json.
125
- <out>/reports/ Every DERIVED view. Safe to delete wholesale; `pnpm graph`
134
+ <out>/reports/ Every DERIVED view. Safe to delete wholesale; `pnpm bkit:graph`
126
135
  plus the view command that made it rebuilds any of it.
127
136
 
128
137
  A whole-repo graph.html is never kept — 8.3 MB rendering ~9.8k nodes as a
@@ -164,14 +173,14 @@ graphify_python() {
164
173
  }
165
174
 
166
175
  require_graph() {
167
- [ -f "$OUT/graph.json" ] || { echo "[graph] no $OUT/graph.json — run 'pnpm graph' first" >&2; exit 1; }
176
+ [ -f "$OUT/graph.json" ] || { echo "[graph] no $OUT/graph.json — run 'pnpm bkit:graph' first" >&2; exit 1; }
168
177
  }
169
178
 
170
179
  # The ONE graphify release that builds and judges the register — here, in the pre-push gate
171
180
  # and in CI (installs `$(bash scripts/graphify/bkit-graphify.sh spec)`). Another release draws
172
181
  # different edges → drift no one else can reproduce. PyPI `graphifyy`, CLI `graphify`.
173
182
  # renovate: datasource=pypi depName=graphifyy
174
- GRAPHIFY_SPEC="graphifyy[sql]==0.9.70"
183
+ GRAPHIFY_SPEC="graphifyy[sql]==0.9.93"
175
184
  if [ "${1:-}" = "spec" ]; then
176
185
  printf '%s\n' "$GRAPHIFY_SPEC"
177
186
  exit 0
@@ -199,7 +208,7 @@ esac
199
208
  # The whole-repo graph.html is DELETED, never kept. --no-viz below stops
200
209
  # cluster-only writing one, but `graphify update` regenerates it on its own
201
210
  # ("regenerated missing or stale graph.html") before this function reclusters, so
202
- # the rm removes it. Use graph:rollup for something clickable, or Gephi on the
211
+ # the rm removes it. Use bkit:graph:rollup for something clickable, or Gephi on the
203
212
  # GraphML for metrics.
204
213
  cluster() {
205
214
  run_local cluster-only . --no-label --no-viz
@@ -267,28 +276,31 @@ capabilities() {
267
276
  --min-weight "$MMD_MIN_WEIGHT" --overlay "$REPORTS/$R_OVERLAY"
268
277
  }
269
278
 
270
- # Strip the three provenance stamps (one header line, two `%% Generated ... from
271
- # <sha>` comments) so `check` compares CONTENT: the graph is built at HEAD, a
272
- # committed register at the PARENT of the commit carrying it. Stamp staleness is
273
- # the freshness warning in .husky/pre-push.
274
- strip_stamps() {
275
- sed -E -e 's/(Diagrams from `graph\.json` @ `)[0-9a-f]+(`)/\1<sha>\2/' \
276
- -e 's/(Generated by bkit-graphify-rollup\.py from )[0-9a-f]+/\1<sha>/' "$1"
279
+ # Rewrite every GRAPH_EMBED_DOCS copy of the packages diagram from the tracked
280
+ # register; pass --check to fail on a stale copy instead.
281
+ embed() {
282
+ [ -n "$GRAPH_EMBED_DOCS" ] || return 0
283
+ local docs
284
+ read -r -a docs <<< "$GRAPH_EMBED_DOCS"
285
+ python3 "$EMBED_PY" "$CAPABILITIES_DOC" "${docs[@]}" "$@"
277
286
  }
278
287
 
279
288
  # Run this script's subcommands in a throwaway checkout of ONE commit: graphify reads the
280
289
  # working tree, so the build belongs to that commit, not to uncommitted edits here. Root
281
- # node_modules is linked in for the route scan. $1 = commit; rest = subcommands, in order.
282
- # $AT_DIR = the checkout.
290
+ # node_modules is linked in for the route scan. $1 = commit; an optional `--tree=<tree>`
291
+ # next replaces the checkout's files with that tree, deletions included, while HEAD stays
292
+ # the commit; rest = subcommands, in order. $AT_DIR = the checkout.
283
293
  at_commit() {
284
- local rev="$1" sha tmp sub
294
+ local rev="$1" tree="" sha tmp sub
285
295
  shift
296
+ case "${1:-}" in --tree=*) tree="${1#--tree=}"; shift ;; esac
286
297
  sha=$(git rev-parse --verify --quiet "$rev^{commit}") || { echo "[graph] not a commit: $rev" >&2; exit 2; }
287
298
  tmp=$(mktemp -d "${TMPDIR:-/tmp}/graph-at-XXXXXX")
288
299
  AT_DIR="$tmp/checkout"
289
300
  # shellcheck disable=SC2064 # expand now: $tmp is local and gone by the time EXIT fires
290
301
  trap "git worktree remove --force '$AT_DIR' >/dev/null 2>&1; rm -rf '$tmp'" EXIT
291
302
  git -c core.hooksPath=/dev/null worktree add --detach --quiet "$AT_DIR" "$sha"
303
+ if [ -n "$tree" ]; then git -C "$AT_DIR" read-tree -u --reset "$tree"; fi
292
304
  ln -s "$(git rev-parse --show-toplevel)/node_modules" "$AT_DIR/node_modules"
293
305
  for sub in "$@"; do
294
306
  (cd "$AT_DIR" && env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE \
@@ -301,6 +313,7 @@ case "${1:-build}" in
301
313
  clean) rm -rf "$OUT" && run_local extract . --code-only && repair && cluster ;;
302
314
  rollup)
303
315
  capabilities "$CAPABILITIES_DOC"
316
+ embed
304
317
  for lvl in packages modules; do
305
318
  run_scratch cluster-only "$REPORTS/.build/$lvl" --no-label >/dev/null 2>&1 || true
306
319
  done
@@ -319,7 +332,7 @@ case "${1:-build}" in
319
332
  echo "[graph] mermaid (paste into mermaid.live, or render per docs/setup.md):"
320
333
  echo " $REPORTS/$R_PACKAGES_MMD"
321
334
  echo " $REPORTS/$R_MODULES_MMD"
322
- echo "[graph] GraphML for Gephi is opt-in: pnpm graph:graphml"
335
+ echo "[graph] GraphML for Gephi is opt-in: pnpm bkit:graph:graphml"
323
336
  ;;
324
337
  tree)
325
338
  require_graph
@@ -340,15 +353,17 @@ case "${1:-build}" in
340
353
  ;;
341
354
  update) run_local update . && repair && cluster ;;
342
355
  check)
343
- # Gate on every push to dev: pre-push runs it via `check-at` in a clean
344
- # checkout of the pushed commit; CI runs it in its own clean checkout.
356
+ # Gate on every push to dev and every pull request: pre-push runs it via
357
+ # `check-at` in a clean checkout of the pushed commit; CI runs `check-at HEAD` on
358
+ # the checked-out commit: the pushed commit (push) or GitHub's test merge of the PR
359
+ # into its base (pull_request), the tree a squash merge lands.
345
360
  # Rebuild graph from this tree → regenerate register into a throwaway copy
346
361
  # → fail if it differs from the tracked file. Writes nothing tracked; fix a
347
- # red with `pnpm graph:refresh` plus a commit.
362
+ # red with `pnpm bkit:graph:refresh` plus a commit.
348
363
  #
349
364
  # By hand it reads the working tree, not the commit: uncommitted edits show
350
365
  # as drift nobody else can reproduce. After a tsconfig `paths` change run
351
- # `pnpm graph:clean` first: `update` keeps the stale module-resolution
366
+ # `pnpm bkit:graph:clean` first: `update` keeps the stale module-resolution
352
367
  # cache, and the drift reported would be the cache, not the register.
353
368
  if [ -n "$(git status --porcelain -- '*.ts' '*.tsx' 2>/dev/null)" ]; then
354
369
  echo "[graph] WARNING: uncommitted .ts/.tsx edits — graphify reads the WORKING TREE," >&2
@@ -363,12 +378,16 @@ case "${1:-build}" in
363
378
  cp "$CAPABILITIES_DOC" "$fresh"
364
379
  capabilities "$fresh" >/dev/null
365
380
  rm -rf "$REPORTS/.build"
366
- if diff -u <(strip_stamps "$CAPABILITIES_DOC") <(strip_stamps "$fresh") \
381
+ if diff -u "$CAPABILITIES_DOC" "$fresh" \
367
382
  --label "$CAPABILITIES_DOC (committed)" --label "rebuilt from $(git rev-parse --short HEAD)"; then
368
383
  echo "[graph] $CAPABILITIES_DOC matches a rebuild at $(git rev-parse --short HEAD)."
369
384
  else
370
385
  echo "[graph] DRIFT: $CAPABILITIES_DOC is not what this tree produces (diff above)." >&2
371
- echo "[graph] Fix: pnpm graph:refresh && git add $CAPABILITIES_DOC && git commit" >&2
386
+ echo "[graph] Fix: pnpm bkit:graph:refresh && git add $CAPABILITIES_DOC $GRAPH_EMBED_DOCS && git commit" >&2
387
+ exit 1
388
+ fi
389
+ if ! embed --check; then
390
+ echo "[graph] Fix: pnpm bkit:graph:refresh && git add $GRAPH_EMBED_DOCS && git commit" >&2
372
391
  exit 1
373
392
  fi
374
393
  ;;
@@ -376,6 +395,7 @@ case "${1:-build}" in
376
395
  # Tracked register only: `rollup` minus its HTML views (minutes of rendering `refresh`
377
396
  # does not need). Needs a built graph.
378
397
  capabilities "$CAPABILITIES_DOC"
398
+ embed
379
399
  ;;
380
400
  check-at)
381
401
  # `check` in a clean checkout of one commit (default HEAD); pre-push runs it for every
@@ -383,12 +403,15 @@ case "${1:-build}" in
383
403
  at_commit "${2:-HEAD}" check
384
404
  ;;
385
405
  refresh)
386
- # Rebuild the register in a clean checkout of HEAD → copy over the tracked file here.
387
- # Fixes a `check` / `check-at` red without baking in uncommitted edits, as
388
- # `graph:update && graph:rollup` would. Commit the result.
389
- at_commit HEAD build register
406
+ # Rebuild the register in a clean checkout of the staged files → copy over the tracked
407
+ # file here. Staged = the commit about to be made, so running it before that commit
408
+ # rebuilds the new state; unstaged edits stay out, as `bkit:graph:update && bkit:graph:rollup`
409
+ # would not. Fixes a `check` / `check-at` red. Commit the result.
410
+ staged=$(git write-tree) || { echo "[graph] the index has unmerged paths — resolve them first" >&2; exit 1; }
411
+ at_commit HEAD --tree="$staged" build register
390
412
  cp "$AT_DIR/$CAPABILITIES_DOC" "$CAPABILITIES_DOC"
391
- echo "[graph] $CAPABILITIES_DOC rebuilt from $(git rev-parse --short HEAD) — commit it"
413
+ embed
414
+ echo "[graph] $CAPABILITIES_DOC rebuilt from the staged files on $(git rev-parse --short HEAD) — commit it"
392
415
  ;;
393
416
  scoped)
394
417
  target="${2:-apps/web/src}"
@@ -11,9 +11,10 @@
11
11
  // Enforces docs/testing.md § "Validated means executed".
12
12
  //
13
13
  // Design notes:
14
- // - Zero imports. The only coupling to slop-scan is the finding object shape and
15
- // meta.apiVersion. apiVersion is hard-pinned (not imported); an engine API bump
16
- // fails at load.
14
+ // - Zero imports. Uses slop-scan's file.text / file.ast facts and finding shape.
15
+ // meta.apiVersion is hard-pinned (not imported); an engine API bump fails at load.
16
+ // - Test markers must start on an AST identifier, so literal fixtures are inert.
17
+ // Missing or invalid ASTs retain the conservative text/comment scan.
17
18
  // - `delta` is omitted: slop-scan then matches per location, so a pure line-shift
18
19
  // of a pre-existing hit nets to zero and only new hits register as added.
19
20
  // - Cast patterns use `\s+` (never a literal single space), and the directive
@@ -113,6 +114,18 @@ function collectMatches(text, regex, classify) {
113
114
  return out;
114
115
  }
115
116
 
117
+ /** Identifier locations exclude literal text while retaining executable template interpolations. */
118
+ function identifierStarts(sourceFile) {
119
+ if (!sourceFile || sourceFile.parseDiagnostics?.length) return null;
120
+ const starts = new Set();
121
+ const visit = (node) => {
122
+ if (typeof node.escapedText === "string") starts.add(node.getStart(sourceFile));
123
+ node.forEachChild(visit);
124
+ };
125
+ visit(sourceFile);
126
+ return starts;
127
+ }
128
+
116
129
  export default {
117
130
  meta: {
118
131
  name: "slop-scan-plugin-boundary",
@@ -209,7 +222,7 @@ export default {
209
222
  family: "boundary",
210
223
  severity: "medium",
211
224
  scope: "file",
212
- requires: ["file.text"],
225
+ requires: ["file.text", "file.ast"],
213
226
  supports(context) {
214
227
  return context.scope === "file" && Boolean(context.file);
215
228
  },
@@ -220,13 +233,16 @@ export default {
220
233
  return [];
221
234
  }
222
235
 
223
- // Test skip/focus markers — comment-skipped (a `.skip` named in a comment is inert).
236
+ // Match executable identifiers; missing or invalid ASTs retain the conservative text scan.
237
+ const identifiers = identifierStarts(
238
+ context.runtime.store.getFileFact(file.path, "file.ast"),
239
+ );
224
240
  const testMatches = [
225
241
  ...collectMatches(text, TEST_SUFFIX, (_t, _end, m) => `test-${m[1]}`),
226
242
  ...collectMatches(text, TEST_GLOBAL, (_t, _end, m) =>
227
243
  m[1] === "f" ? "test-only" : "test-skip",
228
244
  ),
229
- ];
245
+ ].filter((match) => identifiers === null || identifiers.has(match.index));
230
246
  // Blanket linter disables — NOT comment-skipped (they ARE comments).
231
247
  const lintMatches = collectMatches(text, BLANKET_LINT, () => "lint-blanket");
232
248
 
@@ -246,7 +262,7 @@ export default {
246
262
  };
247
263
 
248
264
  const hits = [
249
- ...testMatches.map((m) => toHit(m, true)),
265
+ ...testMatches.map((m) => toHit(m, identifiers === null)),
250
266
  ...lintMatches.map((m) => toHit(m, false)),
251
267
  ].filter(Boolean);
252
268
  if (hits.length === 0) {
@@ -81,7 +81,11 @@
81
81
  }
82
82
  },
83
83
  {
84
- "files": [".opencode/plugin/bkit-gateguard.js", ".opencode/plugin/bkit-readguard.js"],
84
+ "files": [
85
+ ".opencode/plugin/bkit-gateguard.js",
86
+ ".opencode/plugin/bkit-readguard.js",
87
+ ".opencode/plugin/bkit-rules.js"
88
+ ],
85
89
  "rules": {
86
90
  "defensive.empty-catch": {
87
91
  "enabled": false
@@ -99,7 +103,10 @@
99
103
  "**/.cursor/hooks/bkit-readguard.cjs",
100
104
  "**/.codex/hooks/bkit-readguard.cjs",
101
105
  "**/.agents/plugins/bkit/hooks/bkit-readguard.cjs",
102
- "**/.opencode/plugin/bkit-readguard.js"
106
+ "**/.opencode/plugin/bkit-readguard.js",
107
+ "**/.opencode/plugin/bkit-rules.js",
108
+ "**/.codex/hooks/bkit-rules.cjs",
109
+ "**/.agents/plugins/bkit/hooks/bkit-rules.cjs"
103
110
  ],
104
111
  "rules": {
105
112
  "structure.duplicate-function-signatures": {