@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
@@ -125,7 +125,16 @@ function textVerb(ctx) {
125
125
  // labels
126
126
  // ---------------------------------------------------------------------------
127
127
  /** Mutually exclusive: setting one drops the others. */
128
- export const PHASE_LABELS = ["bkit:design", "bkit:plan", "bkit:build", "bkit:ship", "bkit:merged"];
128
+ export const PHASE_LABELS = [
129
+ "bkit:design",
130
+ "bkit:plan",
131
+ "bkit:build",
132
+ "bkit:debug",
133
+ "bkit:ship",
134
+ "bkit:merged",
135
+ ];
136
+ /** Prefix of the labels naming an issue's next best workflow; setting a phase drops them. */
137
+ export const NEXT_LABEL_PREFIX = "next:";
129
138
  /** The issue label that opts a feature into CI auto-routing. */
130
139
  export const AUTO_LABEL = "bkit:auto";
131
140
  /** Commit-subject suffix the CI auto-route gate matches; carried only while the issue has `AUTO_LABEL`. */
@@ -145,12 +154,15 @@ export function transitionLabels(current, t) {
145
154
  for (const l of have)
146
155
  if (PHASE_LABELS.includes(l) && l !== label)
147
156
  remove.add(l);
157
+ for (const l of have)
158
+ if (l.startsWith(NEXT_LABEL_PREFIX))
159
+ remove.add(l);
148
160
  want(label, true);
149
161
  }
150
- if (t.failed !== undefined)
151
- want("bkit:failed", t.failed);
152
- if (t.debug !== undefined)
153
- want("bkit:debug", t.debug);
162
+ // A phase starting supersedes any earlier Failure Path.
163
+ const failed = t.failed ?? (t.phase !== undefined ? false : undefined);
164
+ if (failed !== undefined)
165
+ want("bkit:failed", failed);
154
166
  return {
155
167
  add,
156
168
  remove: [...remove],
@@ -159,11 +171,11 @@ export function transitionLabels(current, t) {
159
171
  }
160
172
  /**
161
173
  * Linear's issue state for the same transition, as the workflows set it: a
162
- * shipped, failed or debugged issue waits on a human ("In Review"); a phase
174
+ * shipped or failed issue waits on a human ("In Review"); a phase
163
175
  * starting is "In Progress". Null when the transition sets no state.
164
176
  */
165
177
  export function linearState(t, board) {
166
- if (t.phase === "merged" || t.failed === true || t.debug === true)
178
+ if (t.phase === "merged" || t.failed === true)
167
179
  return "In Review";
168
180
  if (t.phase !== undefined)
169
181
  return "In Progress";
@@ -253,21 +265,16 @@ function boardPayload(ctx, status) {
253
265
  function labelsVerb(ctx) {
254
266
  const phase = str(ctx.flags.phase);
255
267
  if (phase !== undefined && !PHASE_LABELS.includes(`bkit:${phase}`)) {
256
- throw new CommandError(EXIT.USAGE, "--phase must be design, plan, build, ship, or merged");
257
- }
258
- let failed = onOff(ctx.flags.failed, "failed");
259
- const debug = onOff(ctx.flags.debug, "debug");
260
- // A merged issue must not keep a stale Failure Path marker.
261
- if (phase === "merged") {
262
- if (failed === true)
263
- throw new CommandError(EXIT.USAGE, "--phase=merged clears bkit:failed; drop --failed=on");
264
- failed = false;
268
+ throw new CommandError(EXIT.USAGE, "--phase must be design, plan, build, debug, ship, or merged");
265
269
  }
270
+ const failed = onOff(ctx.flags.failed, "failed");
271
+ if (phase !== undefined && failed === true)
272
+ throw new CommandError(EXIT.USAGE, "--phase clears bkit:failed; drop --failed=on");
266
273
  const board = str(ctx.flags.board);
267
274
  if (board !== undefined && BOARD_OPTION[board] === undefined) {
268
275
  throw new CommandError(EXIT.USAGE, "--board must be progress or review");
269
276
  }
270
- const t = { phase, failed, debug };
277
+ const t = { phase, failed };
271
278
  const { add, remove, labels } = transitionLabels(ctx.flags.label ?? [], t);
272
279
  const { board: payload, boardSkipped } = board === undefined ? { board: null, boardSkipped: null } : boardPayload(ctx, board);
273
280
  ctx.emit({
@@ -360,12 +367,33 @@ function links(o) {
360
367
  const ref = o.ref ?? o.tree;
361
368
  if (ref === undefined)
362
369
  throw new CommandError(EXIT.USAGE, "--artifact needs --ref (or --tree)");
363
- for (const a of artifacts)
364
- out.push(`[${path.basename(a)}](${gh}/blob/${ref}/${a.replace(/^\/+/, "")})`);
370
+ for (const a of artifacts) {
371
+ const hash = a.indexOf("#");
372
+ const file = (hash < 0 ? a : a.slice(0, hash)).replace(/^\/+/, "");
373
+ const heading = hash < 0 ? undefined : a.slice(hash + 1).trim();
374
+ if (heading === "")
375
+ throw new CommandError(EXIT.USAGE, `--artifact "${a}" has an empty #Heading`);
376
+ const url = `${gh}/blob/${ref}/${file}`;
377
+ out.push(heading === undefined
378
+ ? `[${path.basename(file)}](${url})`
379
+ : `[${path.basename(file)} § ${heading}](${url}#${headingAnchor(heading)})`);
380
+ }
365
381
  }
366
382
  return out;
367
383
  }
368
- const KINDS = ["step", "failure", "handover"];
384
+ /**
385
+ * GitHub's anchor for a markdown heading: lowercased, punctuation dropped,
386
+ * spaces to hyphens. A repeated heading's later copies take `-1`, `-2`; this
387
+ * names the first.
388
+ */
389
+ export function headingAnchor(heading) {
390
+ return heading
391
+ .trim()
392
+ .toLowerCase()
393
+ .replace(/[^\p{L}\p{M}\p{N}\p{Pc} -]/gu, "")
394
+ .replace(/ /g, "-");
395
+ }
396
+ const KINDS = ["step", "failure", "handover", "audit"];
369
397
  /** The exact comment body; files (`bodyFile`, `sections`, `stderrFile`, `errorFile`) resolve against `cwd`. */
370
398
  export function buildComment(cwd, o) {
371
399
  const kind = o.kind ?? "step";
@@ -406,6 +434,13 @@ export function buildComment(cwd, o) {
406
434
  lines.push("Stderr:", fenced(captured));
407
435
  }
408
436
  }
437
+ else if (kind === "audit") {
438
+ const slug = o.auditSlug;
439
+ if (slug === undefined || !/^[a-z0-9-]+$/.test(slug)) {
440
+ throw new CommandError(EXIT.USAGE, "--kind=audit needs --audit-slug=<template slug>");
441
+ }
442
+ lines.push([`### Audit Summary: ${slug}`, ...(o.fields ?? []).map(([k, v]) => `${k}: ${v}`)].join(" - "));
443
+ }
409
444
  else {
410
445
  lines.push("### Workflow Handover");
411
446
  }
@@ -436,11 +471,12 @@ export function commentBody(ctx) {
436
471
  }
437
472
  return buildComment(ctx.cwd, {
438
473
  kind: kind,
474
+ auditSlug: str(ctx.flags.auditSlug),
439
475
  workflow: str(ctx.flags.workflow),
440
476
  workflowHeading: ctx.flags.workflowHeading === true,
441
477
  stepNumber: str(ctx.flags.stepNumber),
442
478
  stepTitle: str(ctx.flags.stepTitle),
443
- fields: kind === "step" ? headerFields(ctx) : [],
479
+ fields: kind === "step" || kind === "audit" ? headerFields(ctx) : [],
444
480
  subStep: str(ctx.flags.subStep),
445
481
  error: str(ctx.flags.error),
446
482
  errorFile: str(ctx.flags.errorFile),
@@ -490,10 +526,9 @@ export const issuesCommand = {
490
526
  {
491
527
  name: "phase",
492
528
  type: "string",
493
- help: "set this phase: design | plan | build | ship | merged",
529
+ help: "set this phase: design | plan | build | debug | ship | merged (drops next:* and bkit:failed)",
494
530
  },
495
- { name: "failed", type: "string", help: "bkit:failed on | off (merged implies off)" },
496
- { name: "debug", type: "string", help: "bkit:debug on | off" },
531
+ { name: "failed", type: "string", help: "bkit:failed on | off (a phase implies off)" },
497
532
  {
498
533
  name: "board",
499
534
  type: "string",
@@ -515,9 +550,10 @@ export const issuesCommand = {
515
550
  run: labelsVerb,
516
551
  },
517
552
  comment: {
518
- summary: "The exact body of a ###### bkit:generated step, failure, or handover comment.",
553
+ summary: "The exact body of a ###### bkit:generated step, failure, handover, or audit comment.",
519
554
  flags: [
520
- { name: "kind", type: "string", help: "step (default) | failure | handover" },
555
+ { name: "kind", type: "string", help: "step (default) | failure | handover | audit" },
556
+ { name: "audit-slug", type: "string", help: "audit: template slug, e.g. security" },
521
557
  { name: "step-number", type: "string", help: "step number in the heading" },
522
558
  { name: "step-title", type: "string", help: "step title in the heading, e.g. Plan Verify" },
523
559
  { name: "workflow", type: "string", help: "design | plan | build | debug | ship | auto" },
@@ -548,7 +584,7 @@ export const issuesCommand = {
548
584
  name: "artifact",
549
585
  type: "string",
550
586
  repeatable: true,
551
- help: "link this repo path at --ref",
587
+ help: "link this repo path at --ref; path#Heading links that section",
552
588
  },
553
589
  { name: "ref", type: "string", help: "ref the --artifact links point at (default --tree)" },
554
590
  { name: "line", type: "string", repeatable: true, help: "a raw line after the links" },
@@ -68,7 +68,9 @@ function gitRaw(cwd, args) {
68
68
  env: gitEnv(),
69
69
  maxBuffer: 1 << 28,
70
70
  });
71
- return { status: res.status, stdout: res.stdout ?? "", stderr: (res.stderr ?? "").trim() };
71
+ // A spawn error is never a success: the child can exit 0 before ENOBUFS kills it.
72
+ const status = res.error && res.status === 0 ? 1 : res.status;
73
+ return { status, stdout: res.stdout ?? "", stderr: (res.stderr ?? "").trim() };
72
74
  }
73
75
  const nulList = (out) => out.split("\0").filter((p) => p !== "");
74
76
  function requireRepo(root) {
@@ -1,34 +1,28 @@
1
- // bkit locks acquire|release — the per-feature workflow lock and the dev lock.
1
+ // bkit locks acquire|release — the per-feature workflow lock.
2
2
  //
3
- // workflow `docs/plans/{month}/logs/{fid}/.lock`: one phase workflow per feature
4
- // at a time. A lock left behind is reclaimed as soon as its holder is
5
- // idle: its run is not IN_PROGRESS, or stepped no sooner than 30 minutes
6
- // ago. The lock file's own age is not checked.
7
- // dev `.bkit/.dev.lock` in the main checkout: held across every checkout /
8
- // commit / push of `dev` there. Acquire waits a bounded time; the shell
9
- // releases it from `trap ... EXIT`.
3
+ // `docs/plans/{month}/logs/{fid}/.lock` in the main checkout: one phase workflow
4
+ // per feature at a time. A lock left behind is reclaimed as soon as its holder is
5
+ // idle: its run is not IN_PROGRESS, or stepped no sooner than 30 minutes ago. The
6
+ // lock file's own age is not checked.
10
7
  //
11
- // Both write one line, `{at} {workflow} {fid} {token}`. Release removes only a lock
12
- // this caller owns (same token, else same workflow and feature), so a Failure Path
13
- // that never got the lock cannot delete the holder's.
8
+ // The lock holds one line, `{at} {workflow} {fid} {token}`. Release removes only a
9
+ // lock this caller owns (same token, else same workflow and feature), so a Failure
10
+ // Path that never got the lock cannot delete the holder's.
14
11
  import { randomBytes } from "node:crypto";
15
12
  import * as fs from "node:fs";
16
13
  import * as path from "node:path";
17
14
  import { fold, lastRun, statusTimestamp, } from "../../ledgers/status.js";
18
- import { CommandError, EXIT, git, parseJson, repoRoot, statusRelPath, utcMonth, } from "../lib.js";
19
- import { TIMEOUTS } from "../../shared/timeouts.js";
15
+ import { CommandError, EXIT, parseJson, repoRoot, statusRelPath, utcMonth, } from "../lib.js";
20
16
  import { str } from "./status.js";
21
17
  /** A workflow lock whose holder shows no sign of life for this long is stale. */
22
18
  export const WORKFLOW_LOCK_IDLE_S = 1800;
23
- /** Seconds between dev-lock attempts while it is busy. */
24
- export const DEV_LOCK_POLL_S = 5;
25
19
  /** Exit code: the feature has logs in more than one month bucket. */
26
20
  export const EXIT_SPLIT_BUCKET = 7;
27
21
  /** Exit code: the lock belongs to another owner and was left in place. */
28
22
  export const EXIT_NOT_OWNER = 4;
29
23
  /** Exit code: the lock file is still there after removing it. */
30
24
  export const EXIT_REMOVE_FAILED = 5;
31
- const KINDS = ["workflow", "dev"];
25
+ const KINDS = ["workflow"];
32
26
  // ---------------------------------------------------------------------------
33
27
  // Paths
34
28
  // ---------------------------------------------------------------------------
@@ -60,18 +54,8 @@ export function resolveMonth(root, fid, month) {
60
54
  }
61
55
  return buckets[0] ?? utcMonth();
62
56
  }
63
- /**
64
- * Root the workflow books its logs under: the main checkout, except ship in a
65
- * runtime that does not push to dev, which books on the branch being shipped.
66
- */
67
- export function lockRoot(cwd, workflow, devPushes) {
68
- const root = repoRoot(cwd);
69
- if (workflow !== "ship" || devPushes)
70
- return root;
71
- return git(cwd, ["rev-parse", "--show-toplevel"]) ?? root;
72
- }
73
- export const workflowLockPath = (bookRoot, month, fid) => path.join(bookRoot, "docs", "plans", month, "logs", fid, ".lock");
74
- export const devLockPath = (root) => path.join(root, ".bkit", ".dev.lock");
57
+ /** The feature's workflow lock, in the main checkout `root` (gitignored). */
58
+ export const workflowLockPath = (root, month, fid) => path.join(root, "docs", "plans", month, "logs", fid, ".lock");
75
59
  export function readHolder(file) {
76
60
  if (!fs.existsSync(file))
77
61
  return undefined;
@@ -80,7 +64,7 @@ export function readHolder(file) {
80
64
  return { line, at, workflow, fid, token };
81
65
  }
82
66
  /** Create `file` only if absent (`set -C`); false when someone else holds it. */
83
- function tryCreate(file, line) {
67
+ export function tryCreate(file, line) {
84
68
  fs.mkdirSync(path.dirname(file), { recursive: true });
85
69
  const fd = openExclusive(file);
86
70
  if (fd === undefined)
@@ -100,10 +84,6 @@ function openExclusive(file) {
100
84
  throw err;
101
85
  }
102
86
  }
103
- const ageSeconds = (file, now) => {
104
- const st = fs.statSync(file, { throwIfNoEntry: false });
105
- return st === undefined ? undefined : Math.floor((now - st.mtimeMs) / 1000);
106
- };
107
87
  const newToken = () => randomBytes(4).toString("hex");
108
88
  const lockLine = (workflow, fid, token) => `${statusTimestamp()} ${workflow} ${fid} ${token}`;
109
89
  /** The caller owns the lock: same token when it gave one, else same workflow and feature. */
@@ -113,10 +93,10 @@ export function owns(holder, who) {
113
93
  return holder.workflow === who.workflow && (holder.fid === undefined || holder.fid === who.fid);
114
94
  }
115
95
  /** Why a held workflow lock is still live, or why it may be reclaimed. */
116
- function liveReason(root, bookRoot, month, fid, holder, now) {
96
+ function liveReason(root, month, fid, holder, now) {
117
97
  const rel = statusRelPath(month, fid);
118
98
  const worktreeCopy = path.join(root, ".worktrees", fid, rel);
119
- const own = fs.existsSync(worktreeCopy) ? worktreeCopy : path.join(bookRoot, rel);
99
+ const own = fs.existsSync(worktreeCopy) ? worktreeCopy : path.join(root, rel);
120
100
  const run = holder.workflow === undefined ? undefined : lastRun(readRunsLenient(own), holder.workflow);
121
101
  const lastAt = run?.steps.at(-1)?.at;
122
102
  if (run?.status === "IN_PROGRESS" && lastAt) {
@@ -150,14 +130,13 @@ function readRunsLenient(file) {
150
130
  export function acquireWorkflowLock(opts) {
151
131
  const root = repoRoot(opts.cwd);
152
132
  const month = resolveMonth(root, opts.fid, opts.month);
153
- const bookRoot = lockRoot(opts.cwd, opts.workflow, opts.devPushes);
154
- const file = workflowLockPath(bookRoot, month, opts.fid);
133
+ const file = workflowLockPath(root, month, opts.fid);
155
134
  const token = newToken();
156
135
  const line = lockLine(opts.workflow, opts.fid, token);
157
136
  if (tryCreate(file, line))
158
137
  return { path: file, month, token, reclaimed: null };
159
138
  const holder = readHolder(file) ?? { line: "" };
160
- const verdict = liveReason(root, bookRoot, month, opts.fid, holder, Date.now());
139
+ const verdict = liveReason(root, month, opts.fid, holder, Date.now());
161
140
  if ("live" in verdict) {
162
141
  throw new CommandError(EXIT.NO, `workflow already running for ${opts.fid} (workflow=${holder.workflow ?? "?"}, ${verdict.live})`);
163
142
  }
@@ -167,36 +146,6 @@ export function acquireWorkflowLock(opts) {
167
146
  throw new CommandError(EXIT.NO, `lock contended for ${opts.fid}`);
168
147
  return { path: file, month, token, reclaimed: { holder: holder.line, reason: verdict.reason } };
169
148
  }
170
- // ---------------------------------------------------------------------------
171
- // Dev lock
172
- // ---------------------------------------------------------------------------
173
- const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
174
- export async function acquireDevLock(opts) {
175
- const file = devLockPath(repoRoot(opts.cwd));
176
- const token = newToken();
177
- const start = Date.now();
178
- const deadline = start + opts.deadlineS * 1000;
179
- let reclaimed = null;
180
- for (;;) {
181
- if (tryCreate(file, lockLine(opts.workflow, opts.fid, token))) {
182
- return { path: file, token, reclaimed, waitedS: Math.round((Date.now() - start) / 1000) };
183
- }
184
- const now = Date.now();
185
- const age = ageSeconds(file, now);
186
- if (age === undefined)
187
- continue; // released between the attempt and the stat
188
- if (age >= TIMEOUTS.SHIP_DEV_LOCK_STALE_S) {
189
- reclaimed = readHolder(file)?.line ?? "";
190
- opts.log(`reclaiming stale dev lock (${age}s old): ${reclaimed}`);
191
- fs.rmSync(file, { force: true });
192
- continue;
193
- }
194
- if (now >= deadline) {
195
- throw new CommandError(EXIT.NO, `dev lock held by: ${readHolder(file)?.line ?? "?"} — serialise this run or use a separate clone`);
196
- }
197
- await sleep(Math.min(DEV_LOCK_POLL_S * 1000, deadline - now));
198
- }
199
- }
200
149
  /**
201
150
  * Remove a lock this caller owns. Missing is fine (already released); another
202
151
  * owner's lock is left in place and reported.
@@ -219,7 +168,7 @@ const KIND_FLAG = {
219
168
  name: "kind",
220
169
  type: "string",
221
170
  required: true,
222
- help: "workflow (per-feature .lock) or dev (.bkit/.dev.lock)",
171
+ help: "workflow (the per-feature .lock)",
223
172
  };
224
173
  const LOCK_WORKFLOW_FLAG = {
225
174
  name: "workflow",
@@ -233,80 +182,39 @@ const MONTH_FLAG = {
233
182
  type: "string",
234
183
  help: "workflow kind: month bucket YYYYMM (default: the feature's bucket, else this UTC month)",
235
184
  };
236
- const DEV_PUSHES_FLAG = {
237
- name: "dev-pushes",
238
- type: "boolean",
239
- help: "ship only: this runtime pushes to dev (lock lives in the main checkout)",
240
- };
241
185
  function kindOf(ctx) {
242
186
  const kind = String(ctx.flags.kind);
243
187
  if (!KINDS.includes(kind))
244
- throw new CommandError(EXIT.USAGE, "--kind must be workflow or dev");
188
+ throw new CommandError(EXIT.USAGE, "--kind must be workflow");
245
189
  return kind;
246
190
  }
247
- function deadlineOf(ctx) {
248
- const raw = str(ctx.flags.deadline);
249
- if (raw === undefined)
250
- return TIMEOUTS.SHIP_DEV_LOCK_ACQUIRE_DEADLINE_S;
251
- if (!/^[0-9]+$/.test(raw))
252
- throw new CommandError(EXIT.USAGE, `--deadline must be whole seconds, got "${raw}"`);
253
- return Number(raw);
254
- }
255
191
  export const locksCommand = {
256
192
  noun: "locks",
257
- summary: "Acquire and release the per-feature workflow lock and the dev lock.",
193
+ summary: "Acquire and release the per-feature workflow lock.",
258
194
  verbs: {
259
195
  acquire: {
260
- summary: "Take a lock: workflow (reclaims a dead holder's) or dev (bounded wait).",
261
- flags: [
262
- KIND_FLAG,
263
- LOCK_WORKFLOW_FLAG,
264
- FID_FLAG,
265
- MONTH_FLAG,
266
- DEV_PUSHES_FLAG,
267
- {
268
- name: "deadline",
269
- type: "string",
270
- help: `dev kind: seconds to wait for a busy lock (default ${TIMEOUTS.SHIP_DEV_LOCK_ACQUIRE_DEADLINE_S})`,
271
- },
272
- ],
196
+ summary: "Take the workflow lock, reclaiming a dead holder's.",
197
+ flags: [KIND_FLAG, LOCK_WORKFLOW_FLAG, FID_FLAG, MONTH_FLAG],
273
198
  output: {
274
- kind: "workflow or dev",
199
+ kind: "workflow",
275
200
  path: "absolute path of the lock file",
276
201
  token: "this holder's token; pass it to release",
277
- month: "workflow kind: the month bucket (null for dev)",
278
- reclaimed: "workflow kind: {holder, reason: finished|stale|orphaned}; dev kind: the stale line; null when none",
279
- waitedS: "dev kind: seconds spent waiting (null for workflow)",
202
+ month: "the month bucket",
203
+ reclaimed: "{holder, reason: finished|stale|orphaned}; null when none",
280
204
  },
281
205
  exitCodes: {
282
- [EXIT_SPLIT_BUCKET]: "workflow kind: the feature has logs in more than one month bucket",
206
+ [EXIT_SPLIT_BUCKET]: "the feature has logs in more than one month bucket",
283
207
  },
284
- run: async (ctx) => {
208
+ run: (ctx) => {
285
209
  const kind = kindOf(ctx);
286
- const workflow = String(ctx.flags.workflow);
287
- const fid = String(ctx.flags.fid);
288
- if (kind === "workflow") {
289
- if (ctx.flags.deadline !== undefined)
290
- throw new CommandError(EXIT.USAGE, "--deadline applies to --kind=dev only");
291
- const lock = acquireWorkflowLock({
292
- cwd: ctx.cwd,
293
- workflow,
294
- fid,
295
- month: str(ctx.flags.month),
296
- devPushes: ctx.flags.devPushes === true,
297
- log: ctx.log,
298
- });
299
- ctx.emit({ kind, ...lock, waitedS: null });
300
- return EXIT.OK;
301
- }
302
- const lock = await acquireDevLock({
210
+ const lock = acquireWorkflowLock({
303
211
  cwd: ctx.cwd,
304
- workflow,
305
- fid,
306
- deadlineS: deadlineOf(ctx),
212
+ workflow: String(ctx.flags.workflow),
213
+ fid: String(ctx.flags.fid),
214
+ month: str(ctx.flags.month),
307
215
  log: ctx.log,
308
216
  });
309
- ctx.emit({ kind, ...lock, month: null });
217
+ ctx.emit({ kind, ...lock });
310
218
  return EXIT.OK;
311
219
  },
312
220
  },
@@ -317,7 +225,6 @@ export const locksCommand = {
317
225
  LOCK_WORKFLOW_FLAG,
318
226
  FID_FLAG,
319
227
  MONTH_FLAG,
320
- DEV_PUSHES_FLAG,
321
228
  {
322
229
  name: "token",
323
230
  type: "string",
@@ -325,14 +232,14 @@ export const locksCommand = {
325
232
  },
326
233
  ],
327
234
  output: {
328
- kind: "workflow or dev",
235
+ kind: "workflow",
329
236
  path: "absolute path of the lock file",
330
237
  existed: "a lock file was there",
331
238
  released: "this call removed it",
332
239
  heldBy: "the other owner's lock line when it was left in place, else null",
333
240
  },
334
241
  exitCodes: {
335
- [EXIT_SPLIT_BUCKET]: "workflow kind without --month: the feature has logs in more than one month bucket",
242
+ [EXIT_SPLIT_BUCKET]: "no --month and the feature has logs in more than one month bucket",
336
243
  [EXIT_NOT_OWNER]: "the lock belongs to another owner and was left in place",
337
244
  [EXIT_REMOVE_FAILED]: "the lock file is still there after removing it",
338
245
  },
@@ -344,9 +251,7 @@ export const locksCommand = {
344
251
  token: str(ctx.flags.token),
345
252
  };
346
253
  const root = repoRoot(ctx.cwd);
347
- const file = kind === "dev"
348
- ? devLockPath(root)
349
- : workflowLockPath(lockRoot(ctx.cwd, who.workflow, ctx.flags.devPushes === true), resolveMonth(root, who.fid, str(ctx.flags.month)), who.fid);
254
+ const file = workflowLockPath(root, resolveMonth(root, who.fid, str(ctx.flags.month)), who.fid);
350
255
  const { removeFailed, ...result } = releaseLock(file, who);
351
256
  ctx.emit({ kind, ...result });
352
257
  if (removeFailed) {
@@ -10,7 +10,7 @@ import * as fs from "node:fs";
10
10
  import * as path from "node:path";
11
11
  import { readBkitConfig } from "../../shared/settings.js";
12
12
  import { appendLine, statusTimestamp } from "../../ledgers/status.js";
13
- import { bodySkipToken, CommandError, EXIT, ghUnavailable, git, parseJson, repoRoot, runGh, runGit, SKIP_CI_TOKEN, } from "../lib.js";
13
+ import { bodySkipToken, CommandError, DEV, EXIT, ghUnavailable, git, isSharedBranch, parseJson, repoRoot, runGh, runGit, SKIP_CI_TOKEN, } from "../lib.js";
14
14
  import { AUTO_LABEL, AUTO_ROUTE_SUFFIX } from "./issues.js";
15
15
  import { EXIT_NO_STATUS, FILE_FLAG, readStatusRows, statusFile, str } from "./status.js";
16
16
  // ---------------------------------------------------------------------------
@@ -161,9 +161,9 @@ export function openPrFor(cwd, o, log) {
161
161
  log(`refusing: PR title carries the CI-suppressing token ${token[0]} — CI would never run`);
162
162
  return { code: EXIT_SKIP_CI_TITLE, out: null };
163
163
  }
164
- const base = refFlag(o.base ?? "dev", "base");
164
+ const base = refFlag(o.base ?? DEV, "base");
165
165
  const head = o.head === undefined ? currentBranch(cwd) : refFlag(o.head, "head");
166
- if (head === base || head === "dev" || head === "main") {
166
+ if (head === base || isSharedBranch(head)) {
167
167
  throw new CommandError(EXIT.USAGE, `refusing to open a PR from "${head}" into "${base}"`);
168
168
  }
169
169
  let plan = o.plan;
@@ -450,15 +450,18 @@ const TRANSPORTS = ["git", "gh", "mcp"];
450
450
  * a `git` close needs no `gh`, so a laptop that never ran `gh auth login` closes fine.
451
451
  */
452
452
  export function crossCheckFile(file, transport, log) {
453
+ return crossCheckRows(readStatusRows(file), file, transport, log);
454
+ }
455
+ /** crossCheckFile over rows already read; `label` names where they came from. */
456
+ export function crossCheckRows(rows, label, transport, log) {
453
457
  if (!TRANSPORTS.includes(transport)) {
454
458
  throw new CommandError(EXIT.USAGE, `--transport must be ${TRANSPORTS.join(", ")}`);
455
459
  }
456
- const rows = readStatusRows(file);
457
460
  const runtimeGithubCli = capability(lastRow(rows, "runtime-resolved")?.runtimeGithubCli);
458
461
  const fallbackRows = rows.filter((r) => r.type === "transport-fallback").length;
459
462
  const violated = runtimeGithubCli === false && transport === "mcp" && fallbackRows === 0;
460
463
  if (violated) {
461
- log(`runtime-resolved logged runtimeGithubCli=false and this close used transport mcp, but no transport-fallback row exists in ${file}`);
464
+ log(`runtime-resolved logged runtimeGithubCli=false and this close used transport mcp, but no transport-fallback row exists in ${label}`);
462
465
  }
463
466
  return { ok: !violated, runtimeGithubCli, transport, fallbackRows };
464
467
  }
@@ -9,7 +9,7 @@
9
9
  import * as fs from "node:fs";
10
10
  import * as path from "node:path";
11
11
  import { parseRemoteUrlToSlug } from "../../ledgers/telemetry.js";
12
- import { EXIT, git, repoRoot, runGit, runTool } from "../lib.js";
12
+ import { DEV, EXIT, git, repoRoot, runGit, runTool } from "../lib.js";
13
13
  import { bkitVersionStatus } from "../../shared/bkit-latest.js";
14
14
  /** Exit code: neither gh nor the origin remote named an owner/repo. */
15
15
  export const EXIT_NO_REPO = 3;
@@ -119,7 +119,7 @@ export const repoCommand = {
119
119
  },
120
120
  run: (ctx) => {
121
121
  if (ctx.flags.fetch === true) {
122
- const res = runGit(ctx.cwd, ["fetch", "origin", "dev"]);
122
+ const res = runGit(ctx.cwd, ["fetch", "origin", DEV]);
123
123
  if (!res.ok)
124
124
  ctx.log(`git fetch origin dev failed — behindDev is as of the last fetch: ${res.stderr}`);
125
125
  }