@cbartens/bkit 6.1.0 → 6.2.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 (317) hide show
  1. package/.bkit/README.md +14 -12
  2. package/.bkit/core/.agents/docs.md +1 -11
  3. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-gateguard.cjs +30 -9
  4. package/.bkit/core/.agents/plugins/bkit/hooks/bkit-guardrails.cjs +25 -27
  5. package/.bkit/core/.agents/rules.md +22 -9
  6. package/.bkit/core/.bkit/README.md +13 -11
  7. package/.bkit/core/.bkit/authoring.md +58 -13
  8. package/.bkit/core/.bkit/cli.md +43 -33
  9. package/.bkit/core/.bkit/cloud.md +93 -30
  10. package/.bkit/core/.bkit/install.md +55 -16
  11. package/.bkit/core/.bkit/jsonl.md +24 -7
  12. package/.bkit/core/.bkit/pipeline.md +8 -8
  13. package/.bkit/core/.bkit/prompts.md +160 -43
  14. package/.bkit/core/.bkit/providers.md +99 -36
  15. package/.bkit/core/.bkit/templates.md +167 -37
  16. package/.bkit/core/.bkit/trackers.md +39 -6
  17. package/.bkit/core/.bkit/workflows.md +344 -136
  18. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +50 -27
  19. package/.bkit/core/.claude/hooks/bkit-preflight.sh +11 -11
  20. package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +13 -8
  21. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +14 -25
  22. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +20 -9
  23. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +8 -8
  24. package/.bkit/core/.opencode/plugin/bkit-gateguard.js +14 -4
  25. package/.bkit/core/.opencode/plugin/bkit-guardrails.js +114 -0
  26. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +1 -1
  27. package/.bkit/core/docs/templates/bkit-audit-adoption.md +30 -6
  28. package/.bkit/core/docs/templates/bkit-audit-agents.md +1 -1
  29. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +1 -1
  30. package/.bkit/core/docs/templates/bkit-audit-analytics.md +1 -1
  31. package/.bkit/core/docs/templates/bkit-audit-annotations.md +1 -1
  32. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +1 -1
  33. package/.bkit/core/docs/templates/bkit-audit-app-store.md +1 -1
  34. package/.bkit/core/docs/templates/bkit-audit-architecture.md +1 -1
  35. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +2 -2
  36. package/.bkit/core/docs/templates/bkit-audit-config.md +3 -2
  37. package/.bkit/core/docs/templates/bkit-audit-cost.md +1 -1
  38. package/.bkit/core/docs/templates/bkit-audit-coverage.md +1 -1
  39. package/.bkit/core/docs/templates/bkit-audit-database.md +3 -3
  40. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +1 -1
  41. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +1 -1
  42. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +3 -3
  43. package/.bkit/core/docs/templates/bkit-audit-documentation.md +32 -2
  44. package/.bkit/core/docs/templates/bkit-audit-duplication.md +1 -1
  45. package/.bkit/core/docs/templates/bkit-audit-failures.md +1 -1
  46. package/.bkit/core/docs/templates/bkit-audit-flakes.md +2 -2
  47. package/.bkit/core/docs/templates/bkit-audit-gates.md +5 -3
  48. package/.bkit/core/docs/templates/bkit-audit-issues.md +1 -1
  49. package/.bkit/core/docs/templates/bkit-audit-llm.md +2 -2
  50. package/.bkit/core/docs/templates/bkit-audit-logs.md +1 -1
  51. package/.bkit/core/docs/templates/bkit-audit-models.md +2 -2
  52. package/.bkit/core/docs/templates/bkit-audit-privacy.md +1 -1
  53. package/.bkit/core/docs/templates/bkit-audit-prompts.md +1 -1
  54. package/.bkit/core/docs/templates/bkit-audit-red-team.md +2 -2
  55. package/.bkit/core/docs/templates/bkit-audit-reliability.md +3 -2
  56. package/.bkit/core/docs/templates/bkit-audit-repo.md +1 -1
  57. package/.bkit/core/docs/templates/bkit-audit-security.md +1 -1
  58. package/.bkit/core/docs/templates/bkit-audit-slop.md +1 -1
  59. package/.bkit/core/docs/templates/bkit-audit-testing.md +3 -2
  60. package/.bkit/core/docs/templates/bkit-audit-usability.md +1 -1
  61. package/.bkit/core/docs/templates/bkit-plan.md +38 -8
  62. package/.bkit/core/engine/checks/after/auth.ts +118 -47
  63. package/.bkit/core/engine/checks/after/github.ts +161 -37
  64. package/.bkit/core/engine/checks/after/index.ts +18 -3
  65. package/.bkit/core/engine/checks/after/tools.ts +245 -1
  66. package/.bkit/core/engine/checks/before/files.ts +59 -1
  67. package/.bkit/core/engine/checks/before/index.ts +8 -0
  68. package/.bkit/core/engine/checks/status-holes.ts +20 -26
  69. package/.bkit/core/engine/checks/tips/catalogue.ts +107 -10
  70. package/.bkit/core/engine/checks/tips/detect.ts +36 -3
  71. package/.bkit/core/engine/checks/tips/index.ts +1 -1
  72. package/.bkit/core/engine/cli.ts +13 -13
  73. package/.bkit/core/engine/commands/ci/ci.ts +124 -19
  74. package/.bkit/core/engine/commands/ci/push-gate.ts +101 -43
  75. package/.bkit/core/engine/commands/install/doctor.ts +5 -5
  76. package/.bkit/core/engine/commands/install/install.ts +28 -25
  77. package/.bkit/core/engine/commands/install/uninstall.ts +42 -30
  78. package/.bkit/core/engine/commands/install/upgrade.ts +14 -2
  79. package/.bkit/core/engine/commands/land.ts +2 -3
  80. package/.bkit/core/engine/commands/lib.ts +394 -39
  81. package/.bkit/core/engine/commands/registry.ts +1 -1
  82. package/.bkit/core/engine/commands/workflow/branches.ts +351 -78
  83. package/.bkit/core/engine/commands/workflow/challenge.ts +63 -14
  84. package/.bkit/core/engine/commands/workflow/context.ts +71 -10
  85. package/.bkit/core/engine/commands/workflow/counters.ts +298 -23
  86. package/.bkit/core/engine/commands/workflow/decisions.ts +260 -125
  87. package/.bkit/core/engine/commands/workflow/disk.ts +2 -1
  88. package/.bkit/core/engine/commands/workflow/feature-base.ts +66 -0
  89. package/.bkit/core/engine/commands/workflow/issues.ts +312 -17
  90. package/.bkit/core/engine/commands/workflow/junit.ts +204 -0
  91. package/.bkit/core/engine/commands/workflow/ledgers.ts +904 -99
  92. package/.bkit/core/engine/commands/workflow/locks.ts +186 -29
  93. package/.bkit/core/engine/commands/workflow/loops.ts +87 -0
  94. package/.bkit/core/engine/commands/workflow/open-decision.ts +251 -0
  95. package/.bkit/core/engine/commands/workflow/plan-blocks.ts +8 -0
  96. package/.bkit/core/engine/commands/workflow/plans.ts +1 -1
  97. package/.bkit/core/engine/commands/workflow/prs.ts +311 -16
  98. package/.bkit/core/engine/commands/workflow/repo.ts +1 -1
  99. package/.bkit/core/engine/commands/workflow/run-facts.ts +6 -0
  100. package/.bkit/core/engine/commands/workflow/runs.ts +877 -174
  101. package/.bkit/core/engine/commands/workflow/runtime.ts +12 -4
  102. package/.bkit/core/engine/commands/workflow/status.ts +324 -11
  103. package/.bkit/core/engine/commands/workflow/step-table.ts +41 -15
  104. package/.bkit/core/engine/commands/workflow/steps.ts +604 -29
  105. package/.bkit/core/engine/commands/workflow/summary-findings.ts +1 -1
  106. package/.bkit/core/engine/commands/workflow/summary.ts +314 -8
  107. package/.bkit/core/engine/commands/workflow/tasks.ts +400 -27
  108. package/.bkit/core/engine/commands/workflow/tests-base.ts +319 -0
  109. package/.bkit/core/engine/commands/workflow/tests-changed.ts +138 -74
  110. package/.bkit/core/engine/commands/workflow/tests-jump.ts +93 -0
  111. package/.bkit/core/engine/commands/workflow/tests.ts +815 -182
  112. package/.bkit/core/engine/commands/workflow/tracker.ts +1134 -137
  113. package/.bkit/core/engine/commands/workflow/workflows.ts +100 -72
  114. package/.bkit/core/engine/commands/workflow/worktrees.ts +421 -57
  115. package/.bkit/core/engine/install/cloud-env.ts +38 -10
  116. package/.bkit/core/engine/install/managed-block.ts +105 -0
  117. package/.bkit/core/engine/install/manifest.ts +7 -1
  118. package/.bkit/core/engine/install/modules/claude.ts +6 -2
  119. package/.bkit/core/engine/install/modules/cloud.ts +84 -95
  120. package/.bkit/core/engine/install/modules/codex.ts +10 -2
  121. package/.bkit/core/engine/install/modules/core.ts +202 -26
  122. package/.bkit/core/engine/install/modules/opencode.ts +18 -23
  123. package/.bkit/core/engine/install/network-allowlist.ts +8 -3
  124. package/.bkit/core/engine/install/project-docs.ts +650 -0
  125. package/.bkit/core/engine/install/template-copies.ts +58 -5
  126. package/.bkit/core/engine/install/write.ts +128 -7
  127. package/.bkit/core/engine/ledgers/journal.ts +18 -10
  128. package/.bkit/core/engine/ledgers/migrate.ts +20 -8
  129. package/.bkit/core/engine/ledgers/status.ts +604 -8
  130. package/.bkit/core/engine/ledgers/telemetry.ts +115 -13
  131. package/.bkit/core/engine/render/trackers.ts +46 -11
  132. package/.bkit/core/engine/shared/package-manager.ts +7 -3
  133. package/.bkit/core/engine/shared/settings.ts +12 -1
  134. package/.bkit/core/engine/shared/text.ts +14 -0
  135. package/.bkit/core/engine/tools/instructions-sources.ts +1 -0
  136. package/.bkit/core/engine/tools/instructions.ts +116 -20
  137. package/.bkit/core/hooks/antigravity-hook.js +20 -4
  138. package/.bkit/core/hooks/gateguard-edit-payload.js +8 -5
  139. package/.bkit/core/hooks/gateguard-engine.js +249 -23
  140. package/.bkit/core/hooks/guardrails-deny.js +167 -0
  141. package/.bkit/core/hooks/guardrails-read.js +3 -3
  142. package/.bkit/core/hooks/guardrails-shell.js +1122 -167
  143. package/.bkit/core/hooks/guardrails-tiers.js +247 -176
  144. package/.bkit/core/hooks/preflight-tracker.sh +219 -0
  145. package/.bkit/core/prompts/bkit-audit-generate.md +23 -6
  146. package/.bkit/core/prompts/bkit-build-challenge-1.md +5 -4
  147. package/.bkit/core/prompts/bkit-build-challenge-2.md +6 -5
  148. package/.bkit/core/prompts/bkit-build-install-skills.md +2 -2
  149. package/.bkit/core/prompts/bkit-build-plan-convert.md +21 -7
  150. package/.bkit/core/prompts/bkit-build-plan-current.md +5 -4
  151. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +22 -17
  152. package/.bkit/core/prompts/bkit-build-plan-tasks.md +16 -12
  153. package/.bkit/core/prompts/bkit-build-plan-tests.md +14 -10
  154. package/.bkit/core/prompts/bkit-build-plan-verify.md +21 -8
  155. package/.bkit/core/prompts/bkit-debug-abort-handover.md +10 -5
  156. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +22 -6
  157. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +19 -3
  158. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +22 -6
  159. package/.bkit/core/prompts/bkit-debug-failure-soak.md +10 -7
  160. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +3 -3
  161. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +4 -4
  162. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +3 -3
  163. package/.bkit/core/prompts/bkit-design-generate.md +6 -4
  164. package/.bkit/core/prompts/bkit-design-organise.md +4 -3
  165. package/.bkit/core/prompts/bkit-design-review-1.md +5 -4
  166. package/.bkit/core/prompts/bkit-design-review-2.md +6 -5
  167. package/.bkit/core/prompts/bkit-design-spike.md +4 -3
  168. package/.bkit/core/prompts/bkit-design-update.md +6 -4
  169. package/.bkit/core/prompts/bkit-plan-generate.md +35 -14
  170. package/.bkit/core/prompts/bkit-plan-review-1.md +9 -7
  171. package/.bkit/core/prompts/bkit-plan-review-2.md +9 -7
  172. package/.bkit/core/prompts/bkit-plan-scope-check.md +8 -6
  173. package/.bkit/core/prompts/bkit-plan-update.md +22 -8
  174. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +11 -8
  175. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +9 -5
  176. package/.bkit/core/prompts/bkit-ship-update-docs.md +26 -4
  177. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +3 -3
  178. package/.bkit/core/prompts/bkit-utility-update-decisions.md +10 -7
  179. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +8 -5
  180. package/.bkit/core/prompts/bkit-utility-update-documentation.md +31 -7
  181. package/.bkit/core/prompts/bkit-utility-update-failures.md +8 -5
  182. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +10 -7
  183. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +4 -4
  184. package/.bkit/core/prompts/bkit-utility-update-tracker.md +4 -4
  185. package/.bkit/core/workflows/bkit-auto.md +23 -11
  186. package/.bkit/core/workflows/bkit-build.md +331 -100
  187. package/.bkit/core/workflows/bkit-debug.md +135 -64
  188. package/.bkit/core/workflows/bkit-design.md +58 -32
  189. package/.bkit/core/workflows/bkit-plan.md +73 -45
  190. package/.bkit/core/workflows/bkit-ship.md +233 -167
  191. package/.bkit/shared/.agents/plugins/bkit/hooks.json +1 -1
  192. package/.bkit/shared/.bkit/.env.example +5 -0
  193. package/.bkit/shared/.claude/bkit-cloud.md +7 -7
  194. package/.bkit/shared/.claude/settings.json +5 -1
  195. package/.bkit/shared/.cursor/bkit-cloud.md +1 -1
  196. package/.bkit/shared/.cursor/hooks.json +1 -1
  197. package/.bkit/shared/.opencode/opencode.json +11 -2
  198. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +27 -0
  199. package/.bkit/templates/.cursor/Dockerfile +7 -7
  200. package/.bkit/templates/.github/ISSUE_TEMPLATE/bkit-idea.yml +1 -1
  201. package/.bkit/templates/.github/dependabot.yml +5 -0
  202. package/.bkit/templates/.github/renovate.json5 +5 -3
  203. package/.bkit/templates/.github/workflows/bkit-ci.yml +11 -11
  204. package/.bkit/templates/.github/workflows/bkit-cloud.yml +525 -161
  205. package/.bkit/templates/.github/workflows/bkit-renovate.yml +2 -2
  206. package/.bkit/templates/.husky/pre-push +123 -6
  207. package/.bkit/templates/context/bkit-serena.md +1 -1
  208. package/.bkit/templates/context/bkit-vercel.md +103 -59
  209. package/.bkit/templates/docs/architecture.md +98 -0
  210. package/.bkit/templates/docs/capabilities.md +33 -37
  211. package/.bkit/templates/docs/components.md +142 -0
  212. package/.bkit/templates/docs/data-schema.md +87 -0
  213. package/.bkit/{shared → templates}/docs/deployments.md +128 -142
  214. package/.bkit/templates/docs/design.md +117 -0
  215. package/.bkit/templates/docs/noise.md +54 -0
  216. package/.bkit/templates/docs/observability.md +99 -0
  217. package/.bkit/templates/docs/security.md +137 -0
  218. package/.bkit/templates/docs/setup.md +93 -0
  219. package/.bkit/templates/docs/technology.md +70 -0
  220. package/.bkit/{shared → templates}/docs/testing.md +200 -87
  221. package/.bkit/templates/scripts/ci/bkit-check-accepted-divergences.mjs +1 -6
  222. package/.bkit/templates/scripts/ci/bkit-machine-lock.sh +511 -103
  223. package/.bkit/templates/scripts/ci/bkit-test-awake.mjs +314 -28
  224. package/.bkit/templates/scripts/ci/bkit-test-awake.test.mjs +500 -1
  225. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +1 -1
  226. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +91 -62
  227. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +59 -11
  228. package/.bkit/templates/slop-scan.config.json +2 -0
  229. package/CHANGELOG.md +79 -0
  230. package/DETAILS.md +661 -0
  231. package/README.md +73 -604
  232. package/dist/checks/after/auth.js +114 -46
  233. package/dist/checks/after/github.js +138 -35
  234. package/dist/checks/after/index.js +16 -4
  235. package/dist/checks/after/tools.js +224 -1
  236. package/dist/checks/before/files.js +59 -1
  237. package/dist/checks/before/index.js +7 -1
  238. package/dist/checks/status-holes.js +20 -21
  239. package/dist/checks/tips/catalogue.js +99 -10
  240. package/dist/checks/tips/detect.js +35 -3
  241. package/dist/checks/tips/index.js +1 -1
  242. package/dist/cli.js +13 -13
  243. package/dist/commands/ci/ci.js +113 -20
  244. package/dist/commands/ci/push-gate.js +79 -44
  245. package/dist/commands/install/doctor.js +5 -5
  246. package/dist/commands/install/install.js +23 -22
  247. package/dist/commands/install/uninstall.js +36 -30
  248. package/dist/commands/install/upgrade.js +10 -2
  249. package/dist/commands/land.js +2 -3
  250. package/dist/commands/lib.js +323 -25
  251. package/dist/commands/workflow/branches.js +312 -72
  252. package/dist/commands/workflow/challenge.js +66 -13
  253. package/dist/commands/workflow/context.js +46 -10
  254. package/dist/commands/workflow/counters.js +231 -23
  255. package/dist/commands/workflow/decisions.js +221 -106
  256. package/dist/commands/workflow/disk.js +2 -1
  257. package/dist/commands/workflow/feature-base.js +60 -0
  258. package/dist/commands/workflow/issues.js +243 -15
  259. package/dist/commands/workflow/junit.js +137 -0
  260. package/dist/commands/workflow/ledgers.js +726 -112
  261. package/dist/commands/workflow/locks.js +150 -29
  262. package/dist/commands/workflow/loops.js +67 -0
  263. package/dist/commands/workflow/open-decision.js +199 -0
  264. package/dist/commands/workflow/plan-blocks.js +6 -0
  265. package/dist/commands/workflow/plans.js +1 -1
  266. package/dist/commands/workflow/prs.js +272 -16
  267. package/dist/commands/workflow/repo.js +1 -1
  268. package/dist/commands/workflow/run-facts.js +6 -0
  269. package/dist/commands/workflow/runs.js +747 -155
  270. package/dist/commands/workflow/runtime.js +8 -4
  271. package/dist/commands/workflow/status.js +259 -13
  272. package/dist/commands/workflow/step-table.js +41 -15
  273. package/dist/commands/workflow/steps.js +530 -26
  274. package/dist/commands/workflow/summary-findings.js +1 -1
  275. package/dist/commands/workflow/summary.js +289 -8
  276. package/dist/commands/workflow/tasks.js +294 -27
  277. package/dist/commands/workflow/tests-base.js +266 -0
  278. package/dist/commands/workflow/tests-changed.js +130 -56
  279. package/dist/commands/workflow/tests-jump.js +77 -0
  280. package/dist/commands/workflow/tests.js +608 -131
  281. package/dist/commands/workflow/tracker.js +920 -112
  282. package/dist/commands/workflow/workflows.js +80 -59
  283. package/dist/commands/workflow/worktrees.js +387 -58
  284. package/dist/install/cloud-env.js +32 -10
  285. package/dist/install/managed-block.js +101 -0
  286. package/dist/install/manifest.js +7 -1
  287. package/dist/install/modules/claude.js +6 -2
  288. package/dist/install/modules/cloud.js +73 -86
  289. package/dist/install/modules/codex.js +9 -2
  290. package/dist/install/modules/core.js +190 -27
  291. package/dist/install/modules/opencode.js +18 -23
  292. package/dist/install/network-allowlist.js +8 -3
  293. package/dist/install/project-docs.js +551 -0
  294. package/dist/install/template-copies.js +55 -5
  295. package/dist/install/write.js +117 -5
  296. package/dist/ledgers/journal.js +10 -8
  297. package/dist/ledgers/migrate.js +20 -9
  298. package/dist/ledgers/status.js +461 -8
  299. package/dist/ledgers/telemetry.js +71 -13
  300. package/dist/render/trackers.js +21 -12
  301. package/dist/shared/package-manager.js +7 -2
  302. package/dist/shared/settings.js +8 -0
  303. package/dist/shared/text.js +13 -0
  304. package/dist/tools/instructions-sources.js +1 -0
  305. package/dist/tools/instructions.js +97 -24
  306. package/package.json +23 -15
  307. package/.bkit/core/hooks/preflight-linear.sh +0 -73
  308. package/.bkit/shared/docs/architecture.md +0 -16
  309. package/.bkit/shared/docs/data-schema.md +0 -16
  310. package/.bkit/shared/docs/design.md +0 -38
  311. package/.bkit/shared/docs/noise.md +0 -20
  312. package/.bkit/shared/docs/observability.md +0 -22
  313. package/.bkit/shared/docs/security.md +0 -62
  314. package/.bkit/shared/docs/setup.md +0 -52
  315. package/.bkit/shared/docs/technology.md +0 -15
  316. /package/.bkit/templates/{.lintstagedrc.json → lintstagedrc.example.json} +0 -0
  317. /package/.bkit/templates/{.prettierignore → prettierignore.example} +0 -0
@@ -16,10 +16,12 @@ const GATE_CONFIG_PATTERNS = [
16
16
  /^\.prettierrc(\.(json|js|cjs|mjs|ya?ml|toml))?$/,
17
17
  /^prettier\.config\.[mc]?js$/,
18
18
  /^\.prettierignore$/,
19
+ /^prettierignore\.example$/,
19
20
  /^biome\.jsonc?$/,
20
21
  /^\.vale\.ini$/,
21
22
  /^slop-scan\.config\.json$/,
22
23
  /^\.lintstagedrc(\.(json|js|cjs|mjs|ya?ml))?$/,
24
+ /^lintstagedrc\.example\.json$/,
23
25
  /^lint-staged\.config\.[mc]?js$/,
24
26
  /^ruff\.toml$/,
25
27
  /^\.ruff\.toml$/,
@@ -107,6 +109,27 @@ function docAuthoringAdvisory() {
107
109
  );
108
110
  }
109
111
 
112
+ // Agent-read files: the files below `.agents/`, `.bkit/` and `docs/` plus the root agent
113
+ // files, matching the scope `.bkit/authoring.md` states. Plan artifacts under `docs/plans/`
114
+ // keep their own template contract and get no general reminder.
115
+ const AGENT_READ_ROOT_FILES = new Set(["AGENTS.md", "CLAUDE.md", "GEMINI.md"]);
116
+
117
+ function isAgentReadPath(filePath) {
118
+ const p = filePath.replace(/\\/g, "/");
119
+ if (AGENT_READ_ROOT_FILES.has(p.split("/").pop() || "")) return true;
120
+ if (p.startsWith("docs/plans/") || p.includes("/docs/plans/")) return false;
121
+ return ["docs/", ".agents/", ".bkit/"].some((d) => p.startsWith(d) || p.includes("/" + d));
122
+ }
123
+
124
+ // The one general authoring reminder, identical for every edit channel and host.
125
+ function authoringReminder() {
126
+ return (
127
+ `[bkit GateGuard] Agent-read file. Before you edit it:\n` +
128
+ `- Find this file in \`.bkit/authoring.md\` § Which Sections Apply, and read the sections its row lists.\n` +
129
+ `- Follow those rules in the edit.`
130
+ );
131
+ }
132
+
110
133
  function configAdvisory(filePath) {
111
134
  const base = path.basename(filePath);
112
135
  return (
@@ -138,6 +161,13 @@ function inProcessKey(sessionId, filePath) {
138
161
  return JSON.stringify([sessionId, filePath]);
139
162
  }
140
163
 
164
+ // Normalized warning identity: an absolute path resolved against the call's effective
165
+ // directory, so a relative, absolute or `..` spelling of one file shares one record.
166
+ function normalizeIdentity(filePath, cwd) {
167
+ const base = typeof cwd === "string" && cwd ? cwd : process.cwd();
168
+ return path.resolve(base, filePath);
169
+ }
170
+
141
171
  // Dedup scope: the session, narrowed to one agent when the host names it. A Claude Code
142
172
  // subagent shares its parent's session_id and carries its own agent_id.
143
173
  function dedupKey(sessionId, agentId) {
@@ -151,12 +181,17 @@ function stateFile(sessionId) {
151
181
  }
152
182
 
153
183
  // Returns the per-session warned-file map. Absent state file is the NORMAL
154
- // first-touch case (guarded, no throw); a corrupt file throws to the top-level
155
- // fail-open boundary and that one call no-ops.
184
+ // first-touch case (guarded, no throw); a corrupt file reads as empty.
156
185
  function readState(sessionId) {
157
186
  const file = stateFile(sessionId);
158
187
  if (!fs.existsSync(file)) return { files: {} };
159
- const parsed = JSON.parse(fs.readFileSync(file, "utf-8"));
188
+ let parsed;
189
+ try {
190
+ parsed = JSON.parse(fs.readFileSync(file, "utf-8"));
191
+ } catch {
192
+ // Unparseable state is treated as empty; the in-process set still prevents a deny loop.
193
+ return { files: {} };
194
+ }
160
195
  if (parsed && typeof parsed === "object" && parsed.files && typeof parsed.files === "object") {
161
196
  return parsed;
162
197
  }
@@ -168,10 +203,13 @@ function alreadyWarned(sessionId, filePath) {
168
203
  return Boolean(readState(sessionId).files[filePath]);
169
204
  }
170
205
 
171
- function markWarned(sessionId, filePath) {
206
+ // `spelling` is the path as the host wrote it; it is recorded beside the normalized key so
207
+ // state readers that look a file up by its original spelling still find it.
208
+ function markWarned(sessionId, filePath, spelling) {
172
209
  fs.mkdirSync(stateDir(), { recursive: true });
173
210
  const state = readState(sessionId);
174
211
  state.files[filePath] = true;
212
+ if (typeof spelling === "string" && spelling) state.files[spelling] = true;
175
213
  fs.writeFileSync(stateFile(sessionId), JSON.stringify(state), "utf-8");
176
214
  }
177
215
 
@@ -190,39 +228,227 @@ function gcOldState() {
190
228
  }
191
229
  }
192
230
 
193
- // The advisory for the first touch of `filePath` this session, or null when GateGuard
194
- // is off, the path is unusable, or this session was already warned about it. Records
195
- // the touch. `isNewFile` picks the reuse checklist over the read-this-file checklist.
196
- // Fail-open: a state-file write error still returns the checklist and the process
197
- // remembers it, as advisory only — a deny no later call can see was given would block
198
- // every retry of the edit.
199
- function firstTouchAdvice(filePath, sessionId, isNewFile) {
231
+ // Host-declared: true when the hook process outlives one call (the opencode plugin), so a
232
+ // deny whose state file cannot be written is still remembered in process and cannot loop.
233
+ function processPersists() {
234
+ return typeof GATEGUARD_PROCESS_PERSISTS !== "undefined" && GATEGUARD_PROCESS_PERSISTS === true;
235
+ }
236
+
237
+ // Pure preparation: the advice for the first touch of `filePath` this session, or null when
238
+ // GateGuard is off, the path is unusable, or the session was already warned about it.
239
+ // Writes nothing; `acknowledgeAdvice` records the touch once the advice is delivered.
240
+ // `isNewFile` picks the reuse checklist over the read-this-file checklist.
241
+ function prepareAdvice(filePath, sessionId, isNewFile, cwd) {
200
242
  const mode = process.env.BKIT_GATEGUARD;
201
243
  if (mode === "off") return null;
202
244
  if (!filePath || typeof filePath !== "string") return null;
203
245
 
204
246
  const sid = typeof sessionId === "string" ? sessionId : "no-session";
247
+ const key = normalizeIdentity(filePath, cwd);
205
248
 
206
249
  // Warn once per (session, file).
207
- if (alreadyWarned(sid, filePath)) return null;
250
+ if (alreadyWarned(sid, key)) return null;
208
251
 
209
- const gated = isGateConfig(filePath) && process.env.BKIT_ALLOW_CONFIG_EDIT !== "1";
252
+ const gated = isGateConfig(key) && process.env.BKIT_ALLOW_CONFIG_EDIT !== "1";
210
253
  const baseContext = gated
211
- ? configAdvisory(filePath)
254
+ ? configAdvisory(key)
212
255
  : isNewFile
213
- ? reuseChecklist(filePath)
214
- : investigationChecklist(filePath);
215
- const context = isDocsPath(filePath)
216
- ? `${baseContext}\n\n${docAuthoringAdvisory()}`
217
- : baseContext;
256
+ ? reuseChecklist(key)
257
+ : investigationChecklist(key);
258
+ const parts = [baseContext];
259
+ if (isDocsPath(key)) parts.push(docAuthoringAdvisory());
260
+ if (isAgentReadPath(key)) parts.push(authoringReminder());
261
+
262
+ return {
263
+ sid,
264
+ key,
265
+ mode: mode === "deny" ? "deny" : "advisory",
266
+ context: parts.join("\n\n"),
267
+ spelling: filePath,
268
+ agentRead: isAgentReadPath(key),
269
+ };
270
+ }
218
271
 
272
+ // Records a prepared touch. Fail-open: a state-file write error remembers the touch in
273
+ // this process and returns false (not durable). Only a durable record, or a process that
274
+ // outlives the call, can back a deny: a deny no later call can see was given would block
275
+ // every retry of the edit.
276
+ function acknowledgeAdvice(prepared) {
219
277
  try {
220
- markWarned(sid, filePath);
278
+ markWarned(prepared.sid, prepared.key, prepared.spelling);
221
279
  gcOldState();
280
+ return true;
222
281
  } catch {
223
- warnedInProcess.add(inProcessKey(sid, filePath));
224
- return { mode: "advisory", context };
282
+ warnedInProcess.add(inProcessKey(prepared.sid, prepared.key));
283
+ return false;
284
+ }
285
+ }
286
+
287
+ // The advisory for the first touch of `filePath` this session, or null. Prepares and
288
+ // acknowledges in one step, for callers that deliver the advice themselves.
289
+ function firstTouchAdvice(filePath, sessionId, isNewFile, cwd) {
290
+ const prepared = prepareAdvice(filePath, sessionId, isNewFile, cwd);
291
+ if (!prepared) return null;
292
+ const durable = acknowledgeAdvice(prepared);
293
+ const mode = durable || processPersists() ? prepared.mode : "advisory";
294
+ return { mode, context: prepared.context };
295
+ }
296
+
297
+ // Conservative per-host output budgets for delivered advice (reviewed under decision
298
+ // `787-conservative-host-advisory-budgets`; complete-block visibility is unverified).
299
+ const ADVICE_BUDGETS = {
300
+ claude: { limit: 8000, unit: "chars" },
301
+ codex: { limit: 2000, unit: "bytes" },
302
+ cursor: { limit: 2000, unit: "bytes" },
303
+ antigravity: { limit: 2000, unit: "bytes" },
304
+ opencode: { limit: 8000, unit: "chars" },
305
+ };
306
+ const ADVICE_NOTICE_RESERVE = 512;
307
+
308
+ function adviceSize(text, unit) {
309
+ return unit === "bytes" ? Buffer.byteLength(text, "utf-8") : text.length;
310
+ }
311
+
312
+ // Selects prepared advice blocks inside `budget`: only whole blocks, in order, with
313
+ // `ADVICE_NOTICE_RESERVE` units kept for the omitted-target notice. Pure: acknowledges
314
+ // nothing. `fixedCost` is the size (in the budget's unit) of text the caller adds around
315
+ // the blocks, so the whole composed advice fits. Returns `{ selected, context }`
316
+ // (`context` includes the omitted-target notice).
317
+ function selectAdvice(blocks, budget, fixedCost = 0) {
318
+ const sep = "\n\n";
319
+ const pick = (room) => {
320
+ const selected = [];
321
+ const omitted = [];
322
+ let used = 0;
323
+ for (const b of blocks) {
324
+ const cost = adviceSize(b.context, budget.unit) + (selected.length > 0 ? sep.length : 0);
325
+ if (used + cost <= room) {
326
+ selected.push(b);
327
+ used += cost;
328
+ } else {
329
+ omitted.push(b);
330
+ }
331
+ }
332
+ return { selected, omitted };
333
+ };
334
+ const omittedNotice = (omitted) => {
335
+ const reminder = omitted.some((b) => b.agentRead)
336
+ ? " Agent-read files: see `.bkit/authoring.md` § Which Sections Apply."
337
+ : "";
338
+ return `[bkit GateGuard] ${omitted.length} target${omitted.length === 1 ? "" : "s"} omitted (output limit); they stay unacknowledged and are advised on a later edit.${reminder}`;
339
+ };
340
+ let { selected, omitted } = pick(
341
+ budget.limit - (fixedCost > 0 ? 0 : ADVICE_NOTICE_RESERVE) - fixedCost,
342
+ );
343
+ if (fixedCost > 0 && omitted.length > 0) {
344
+ // Composed advice counts its own text, so the omitted-target notice is sized exactly
345
+ // (worst case: every block omitted) instead of by the fixed reserve.
346
+ const noticeRoom = adviceSize(omittedNotice(blocks), budget.unit) + sep.length;
347
+ ({ selected, omitted } = pick(budget.limit - fixedCost - noticeRoom));
348
+ }
349
+ const texts = selected.map((b) => b.context);
350
+ if (omitted.length > 0) texts.push(omittedNotice(omitted));
351
+ return { selected, context: texts.join(sep) };
352
+ }
353
+
354
+ // Records the selected blocks once their route has delivered them. Returns the mode to
355
+ // report: a deny only when every record is durable (or the process outlives the call).
356
+ function acknowledgeSelected(selected) {
357
+ if (selected.length === 0) return "advisory";
358
+ let durable = true;
359
+ for (const b of selected) if (!acknowledgeAdvice(b)) durable = false;
360
+ return durable || processPersists() ? selected[0].mode : "advisory";
361
+ }
362
+
363
+ // Delivers prepared advice blocks inside `budget` (see `selectAdvice`). Acknowledges exactly
364
+ // the selected blocks, and only when `verified` says the route reaches the model. Returns
365
+ // `{ mode, context }` or null when there is nothing to say.
366
+ function deliverAdvice(blocks, budget, verified, fixedCost = 0) {
367
+ if (blocks.length === 0) return null;
368
+ const { selected, context } = selectAdvice(blocks, budget, fixedCost);
369
+ return { mode: verified ? acknowledgeSelected(selected) : "advisory", context };
370
+ }
371
+
372
+ // Prepared per-file blocks for the exact targets of a shell edit. Shell targets are
373
+ // relative to the evidence root (`ctx.root`, else `ctx.cwd`); they normalize to the same
374
+ // absolute identity the edit tools record, so both channels share one warning. A shell
375
+ // edit is advisory only and never a new-file reuse check: the file may not exist yet.
376
+ function shellTargetBlocks(targets, ctx, sessionId, agentId) {
377
+ const base = (ctx && (ctx.root || ctx.cwd)) || process.cwd();
378
+ const sid = dedupKey(sessionId, agentId);
379
+ const blocks = [];
380
+ const seen = new Set();
381
+ for (const t of targets || []) {
382
+ const prepared = prepareAdvice(t, sid, false, base);
383
+ if (!prepared || seen.has(prepared.key)) continue;
384
+ seen.add(prepared.key);
385
+ // The record carries only the normalized path: the relative spelling is shell-local.
386
+ prepared.spelling = prepared.key;
387
+ blocks.push(prepared);
225
388
  }
389
+ return blocks;
390
+ }
391
+
392
+ // The name each host's guardrails advice carries in its deny line.
393
+ const ADVICE_HOST_LABELS = {
394
+ claude: "Claude Code",
395
+ codex: "Codex",
396
+ cursor: "Cursor",
397
+ antigravity: "Antigravity",
398
+ opencode: "OpenCode",
399
+ };
400
+ // The most characters of a command the advice echoes back.
401
+ const ADVICE_COMMAND_CHARS = 300;
226
402
 
227
- return { mode: mode === "deny" ? "deny" : "advisory", context };
403
+ // `command` cut to `ADVICE_COMMAND_CHARS` whole characters, marked when cut.
404
+ function adviceCommand(command) {
405
+ const chars = Array.from(String(command || ""));
406
+ if (chars.length <= ADVICE_COMMAND_CHARS) return chars.join("");
407
+ return `${chars.slice(0, ADVICE_COMMAND_CHARS).join("")} [cut]`;
408
+ }
409
+
410
+ // The guardrails advice for one shell verdict (`classifyShell`): one text for every host
411
+ // apart from the host name in the deny line and the Codex-only line that its ask and secret
412
+ // tiers ran without a prompt. `budget` is the host's `ADVICE_BUDGETS` entry; `call` is
413
+ // `{ command, ctx, session, agent, reserve }`, where `reserve` is the size of any text the
414
+ // host adds after the advice. Returns `{ text, selected }`: `selected` are the per-file
415
+ // blocks in the text, which the caller acknowledges (`acknowledgeSelected`) once its route
416
+ // has delivered them.
417
+ function composeAdvice(v, host, budget, call = {}) {
418
+ const label = ADVICE_HOST_LABELS[host] || host;
419
+ const shown = adviceCommand(call.command);
420
+ const noPrompt =
421
+ host === "codex"
422
+ ? "\nIt runs without confirmation, because Codex cannot prompt for one. Tell the user that you ran it."
423
+ : "";
424
+ switch (v.tier) {
425
+ case "deny":
426
+ return { text: `Blocked by bkit ${label} guardrails: ${v.what}. ${v.fix}`, selected: [] };
427
+ case "ask":
428
+ return {
429
+ text: `bkit guardrails: this is a destructive or privileged command (${v.what}). It is on the PROHIBITED list in every bkit workflow.${noPrompt}\nIf the user did not ask for this exact command, NEVER run it.\n\`git clean\` and \`git checkout -- .\` destroy untracked files and uncommitted work, which no reflog can recover.\nCommand: ${shown}`,
430
+ selected: [],
431
+ };
432
+ case "secret":
433
+ return {
434
+ text: `bkit guardrails: this command reads ${v.path}, an env, secrets or private-key file, which may expose secrets.${noPrompt}\nNEVER print secret values.\nPrefer direnv or documented non-secret examples.\nCommand: ${shown}`,
435
+ selected: [],
436
+ };
437
+ default:
438
+ break;
439
+ }
440
+ const fetchNote =
441
+ v.tier === "fetch"
442
+ ? `bkit guardrails: outbound fetch to a host that is not on this repo's network allowlist (.agents/context.md § allowed-domains, plus bkit's shipped tooling hosts).\nConfirm the destination is intended before you rely on the result.\nIf the host is a standing dependency, add it to allowed-domains.\nCommand: ${shown}`
443
+ : "";
444
+ const notice = v.edits ? shellEditAdvisory(v.edits) : "";
445
+ const fixed = [fetchNote, notice].filter(Boolean).join("\n\n");
446
+ const blocks = v.edits
447
+ ? shellTargetBlocks(v.edits.targets, call.ctx, call.session, call.agent)
448
+ : [];
449
+ if (blocks.length === 0) return { text: fixed, selected: [] };
450
+ const sep = "\n\n";
451
+ const fixedCost = adviceSize(fixed, budget.unit) + sep.length + (call.reserve || 0);
452
+ const { selected, context } = selectAdvice(blocks, budget, fixedCost);
453
+ return { text: `${fixed}${sep}${context}`, selected };
228
454
  }
@@ -0,0 +1,167 @@
1
+ // --- Shell deny tier: identical in every host's guardrails hook (bkit renders it from one
2
+ // source). Reads the parsed commands `shellCommands` (`guardrails-shell.js`) returns, and
3
+ // splits their words with `operands` from the same file.
4
+ //
5
+ // git commands are classified by their parsed words — subcommand, flag set (any order,
6
+ // short clusters such as `-fdx` expanded), positionals, `+refspec` — never by a literal
7
+ // prefix, so `git reset -q --hard` and `git push origin +dev` land in the same tier as
8
+ // `git reset --hard` and `git push --force`.
9
+
10
+ /** git global options that take the next word as their value (`git -C dir push`). */
11
+ const GIT_GLOBAL_VALUE_OPTS = new Set([
12
+ "-C",
13
+ "-c",
14
+ "--git-dir",
15
+ "--work-tree",
16
+ "--namespace",
17
+ "--config-env",
18
+ "--super-prefix",
19
+ ]);
20
+
21
+ /**
22
+ * Per subcommand, the options that take a value: `short` letters consume the rest of their
23
+ * cluster or the next word, `long` names consume the next word when written without `=`.
24
+ * A value is never read as a flag or a positional (`git commit -m "drop -n"`).
25
+ */
26
+ const GIT_VALUE_OPTS = {
27
+ push: { short: "o", long: ["--push-option", "--repo", "--receive-pack", "--exec"] },
28
+ clean: { short: "e", long: ["--exclude"] },
29
+ checkout: { short: "bB", long: ["--orphan"] },
30
+ restore: { short: "s", long: ["--source"] },
31
+ rebase: { short: "xsXC", long: ["--onto", "--exec", "--strategy", "--strategy-option"] },
32
+ commit: {
33
+ short: "mFCct",
34
+ long: [
35
+ "--message",
36
+ "--file",
37
+ "--author",
38
+ "--date",
39
+ "--reuse-message",
40
+ "--reedit-message",
41
+ "--fixup",
42
+ "--squash",
43
+ "--template",
44
+ "--cleanup",
45
+ "--trailer",
46
+ ],
47
+ },
48
+ };
49
+
50
+ /**
51
+ * A git invocation's parsed words, or null when `words` does not run git:
52
+ * `{ sub, long: Set<"--name">, short: Set<letter>, args: string[] }`. Words after `--`
53
+ * are positionals.
54
+ */
55
+ function parseGit(words) {
56
+ if ((words[0] || "").replace(/^.*\//, "") !== "git") return null;
57
+ let i = 1;
58
+ while (i < words.length && words[i].startsWith("-")) {
59
+ i += GIT_GLOBAL_VALUE_OPTS.has(words[i]) ? 2 : 1;
60
+ }
61
+ const sub = words[i];
62
+ if (!sub) return null;
63
+ const spec = GIT_VALUE_OPTS[sub] || { short: "", long: [] };
64
+ const long = new Set();
65
+ const short = new Set();
66
+ const args = [];
67
+ let positionalOnly = false;
68
+ for (let j = i + 1; j < words.length; j++) {
69
+ const w = words[j];
70
+ if (positionalOnly || w === "-" || !w.startsWith("-")) {
71
+ args.push(w);
72
+ } else if (w === "--") {
73
+ positionalOnly = true;
74
+ } else if (w.startsWith("--")) {
75
+ const name = w.split("=")[0];
76
+ long.add(name);
77
+ if (!w.includes("=") && spec.long.includes(name)) j++;
78
+ } else {
79
+ for (let k = 1; k < w.length; k++) {
80
+ short.add(w[k]);
81
+ if (spec.short.includes(w[k])) {
82
+ if (k === w.length - 1) j++;
83
+ break;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ return { sub, long, short, args };
89
+ }
90
+
91
+ /** `{ what, fix }` when a parsed command's words force-push with git, else null. */
92
+ function gitDenyRule(words) {
93
+ const g = parseGit(words);
94
+ if (!g || g.sub !== "push") return null;
95
+ if (g.long.has("--force") || g.short.has("f") || g.args.some((a) => a.startsWith("+"))) {
96
+ return {
97
+ what: "git force-push",
98
+ fix: "NEVER force-push (--force, -f or a +refspec). Use a normal push, or --force-with-lease only when the user explicitly asks for it on a personal branch.",
99
+ };
100
+ }
101
+ return null;
102
+ }
103
+
104
+ /**
105
+ * A filesystem root an operand names: `/` (also `//`, `/.`), or `~`, `$HOME` or `${HOME}` bare
106
+ * or followed by such slashes and dots, with an optional trailing `*`.
107
+ */
108
+ const ROOT_OPERAND = /^(?:\/[/.]*|(?:~|\$HOME|\$\{HOME\})(?:\/[/.]*)?)\*?$/;
109
+
110
+ /** The system root itself: `/`, `//`, `/.`, `/*`. */
111
+ const SYSTEM_ROOT = /^\/[/.]*\*?$/;
112
+
113
+ /** A chmod mode that makes a file world-writable: octal `777` / `0777` / `666`, or `a+w` / `o=rwx`. */
114
+ function worldWritable(mode) {
115
+ if (/^[0-7]{3,4}$/.test(mode)) return /[2367]$/.test(mode);
116
+ return mode.split(",").some((clause) => /^[ugoa]*[ao][ugoa]*[+=][rwxXst]*w/.test(clause));
117
+ }
118
+
119
+ /** The short letters and long names of the options before `--`, and the operands, of `words`. */
120
+ function optionsAndOperands(words) {
121
+ const args = words.slice(1);
122
+ const end = args.includes("--") ? args.indexOf("--") : args.length;
123
+ const opts = args.slice(0, end).filter((w) => w.length > 1 && w.startsWith("-"));
124
+ return {
125
+ short: new Set(opts.filter((w) => w[1] !== "-").flatMap((w) => [...w.slice(1)])),
126
+ long: new Set(opts.filter((w) => w[1] === "-").map((w) => w.split("=")[0])),
127
+ operands: operands(args),
128
+ };
129
+ }
130
+
131
+ /**
132
+ * Deny tier — matches Claude's settings.json deny rows and OpenCode's bash deny map.
133
+ * `cmds` are the parsed commands (`shellCommands`). `{ what, fix }` for a blocked
134
+ * command, else null.
135
+ */
136
+ function denyRule(cmds) {
137
+ for (const c of cmds) {
138
+ const denied = gitDenyRule(c.words);
139
+ if (denied) return denied;
140
+ const { short, long, operands } = optionsAndOperands(c.words);
141
+ // rm with both -r and -f (-rf, -fr, -Rf, -r -f, --recursive --force) on /, ~ or $HOME
142
+ // itself. A path below them (~/projects/x) is not matched.
143
+ if (
144
+ c.program === "rm" &&
145
+ (short.has("r") || short.has("R") || long.has("--recursive")) &&
146
+ (short.has("f") || long.has("--force")) &&
147
+ operands.some((o) => ROOT_OPERAND.test(o))
148
+ ) {
149
+ return {
150
+ what: "recursive delete of a filesystem root",
151
+ fix: "NEVER run rm -rf against /, ~, or $HOME. Narrow the path to the target directory.",
152
+ };
153
+ }
154
+ if (
155
+ c.program === "chmod" &&
156
+ (short.has("R") || long.has("--recursive")) &&
157
+ worldWritable(operands[0] || "") &&
158
+ operands.slice(1).some((o) => SYSTEM_ROOT.test(o))
159
+ ) {
160
+ return {
161
+ what: "world-writable chmod -R on the filesystem root",
162
+ fix: "NEVER make the filesystem root world-writable.",
163
+ };
164
+ }
165
+ }
166
+ return null;
167
+ }
@@ -1,11 +1,11 @@
1
1
  // --- Secret-file read tier: identical in the Cursor and Google Antigravity guardrails hooks
2
- // (bkit renders it from one source). Same policy as Claude's settings.json `Read(...)` deny /
3
- // ask rows and opencode's `permission.read` map; each host maps a tier to its own output
2
+ // (bkit renders it from one source). Claude's settings.json `Read(...)` rows and opencode's
3
+ // `permission.read` map list fewer key names; each host maps a tier to its own output
4
4
  // shape and wording. Needs `secretFileKind` from `guardrails-tiers.js` above it.
5
5
 
6
6
  /**
7
7
  * The read tier for a file path (`/` or `\` separated), first match wins:
8
- * `{ tier: "deny", path }` — private-key material: `*.pem`, `*.p12`, `id_rsa`;
8
+ * `{ tier: "deny", path }` — a private-key file (`mayNameKeyFile`);
9
9
  * `{ tier: "ask", path }` — an env / secrets file: `.env`, `.env.*` except `.env.example`;
10
10
  * null — nothing to say.
11
11
  */