@rt-tools/agent-kit 0.24.0 → 0.27.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 (312) hide show
  1. package/assets/agents/business-analyst.md +51 -50
  2. package/assets/agents/cargo-writer.md +54 -0
  3. package/assets/agents/conscience.md +37 -35
  4. package/assets/agents/project-manager.md +49 -48
  5. package/assets/agents/prose-editor.md +31 -29
  6. package/assets/agents/qa-engineer.md +50 -48
  7. package/assets/agents/rules-reviewer.md +63 -58
  8. package/assets/agents/skill-curator.md +83 -78
  9. package/assets/agents/spec-critic.md +34 -29
  10. package/assets/agents/spec-writer.md +35 -32
  11. package/assets/agents/strict-teacher.md +39 -37
  12. package/assets/checks/archive-age.mjs +48 -28
  13. package/assets/checks/archive-prune.mjs +16 -14
  14. package/assets/checks/board-epic-link.github.mjs +29 -0
  15. package/assets/checks/board-epics.github.mjs +286 -49
  16. package/assets/checks/board-folders.mjs +61 -0
  17. package/assets/checks/board-gh.github.mjs +35 -26
  18. package/assets/checks/board-long-work.github.mjs +29 -25
  19. package/assets/checks/board-paths.github.mjs +21 -16
  20. package/assets/checks/board-pull-state.github.mjs +168 -0
  21. package/assets/checks/board-runs.github.mjs +45 -43
  22. package/assets/checks/board-task-dirs.github.mjs +98 -0
  23. package/assets/checks/board-titles.github.mjs +19 -17
  24. package/assets/checks/board.github.mjs +133 -194
  25. package/assets/checks/check-archive-age.mjs +23 -19
  26. package/assets/checks/check-board.github.mjs +131 -263
  27. package/assets/checks/check-descriptions.mjs +30 -29
  28. package/assets/checks/check-doc-paths.mjs +91 -88
  29. package/assets/checks/check-dupes.mjs +84 -80
  30. package/assets/checks/check-file-size.mjs +74 -71
  31. package/assets/checks/check-glossary.mjs +47 -37
  32. package/assets/checks/check-hook-scope.mjs +30 -27
  33. package/assets/checks/check-lib-layers.mjs +22 -21
  34. package/assets/checks/check-profile-drift.mjs +48 -43
  35. package/assets/checks/check-prose-style.mjs +138 -39
  36. package/assets/checks/check-push-gate.mjs +53 -50
  37. package/assets/checks/check-reuse.mjs +50 -40
  38. package/assets/checks/check-schema-drift.mjs +104 -84
  39. package/assets/checks/check-specs.mjs +155 -134
  40. package/assets/checks/check-state-next.mjs +66 -52
  41. package/assets/checks/check-states.mjs +32 -30
  42. package/assets/checks/check-styles.mjs +52 -51
  43. package/assets/checks/check-turn-map.mjs +54 -46
  44. package/assets/checks/epic-table.github.mjs +268 -0
  45. package/assets/checks/lib-boundaries.mjs +32 -30
  46. package/assets/checks/lib-common.mjs +30 -29
  47. package/assets/checks/lib-domains.mjs +34 -34
  48. package/assets/checks/lib-manifests.mjs +17 -15
  49. package/assets/checks/lib-reexports.mjs +18 -18
  50. package/assets/checks/rt-kit-checks.config.mjs +187 -142
  51. package/assets/checks/signals.mjs +43 -39
  52. package/assets/checks/spec-anchors.mjs +114 -87
  53. package/assets/checks/spec-common.mjs +128 -84
  54. package/assets/checks/spec-contract.mjs +30 -30
  55. package/assets/checks/spec-proposed.mjs +27 -24
  56. package/assets/checks/spec-scenarios.mjs +51 -28
  57. package/assets/checks/specs-for.mjs +214 -0
  58. package/assets/checks/task-new.github.mjs +315 -61
  59. package/assets/commands/feedback.md +65 -59
  60. package/assets/commands/next-session.md +64 -57
  61. package/assets/commands/night.md +115 -0
  62. package/assets/commands/skill-curator.md +83 -79
  63. package/assets/defaults/gate-map.sh +108 -97
  64. package/assets/defaults/project.sh +232 -185
  65. package/assets/defaults/shell.sh +73 -68
  66. package/assets/defaults/turn-map.md +47 -44
  67. package/assets/docs/GLOSSARY.md +142 -65
  68. package/assets/hooks/browser-device-id.sh +16 -12
  69. package/assets/hooks/browser-guard-device-id.sh +34 -28
  70. package/assets/hooks/browser-guard-no-asking.sh +5 -4
  71. package/assets/hooks/browser-guard-no-listing.sh +12 -11
  72. package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
  73. package/assets/hooks/browser-guard-require-select.sh +34 -23
  74. package/assets/hooks/claim-guard.sh +62 -56
  75. package/assets/hooks/commit-msg.sh +14 -10
  76. package/assets/hooks/conscience-guard.sh +91 -45
  77. package/assets/hooks/constitution-index.sh +16 -16
  78. package/assets/hooks/deny-tail.sh +28 -26
  79. package/assets/hooks/dev-server-guard.sh +50 -43
  80. package/assets/hooks/dispatch.sh +60 -46
  81. package/assets/hooks/docs-guard.sh +100 -91
  82. package/assets/hooks/epic-over.sh +49 -0
  83. package/assets/hooks/epic-stop-guard.sh +108 -0
  84. package/assets/hooks/exam-guard.sh +105 -93
  85. package/assets/hooks/git-guard-delivery-conflict.sh +41 -36
  86. package/assets/hooks/git-guard-delivery-draft.sh +48 -38
  87. package/assets/hooks/git-guard-delivery-epic.sh +167 -0
  88. package/assets/hooks/git-guard-delivery-folder.sh +50 -43
  89. package/assets/hooks/git-guard-delivery-signature.sh +119 -53
  90. package/assets/hooks/git-guard-delivery.sh +223 -183
  91. package/assets/hooks/git-guard-main.sh +38 -34
  92. package/assets/hooks/git-guard-push-tests.sh +99 -87
  93. package/assets/hooks/glossary-load.sh +23 -22
  94. package/assets/hooks/grill-gate-ask.sh +12 -11
  95. package/assets/hooks/grill-gate.sh +94 -87
  96. package/assets/hooks/guard-note.sh +20 -19
  97. package/assets/hooks/handoff-entry-guard.sh +45 -25
  98. package/assets/hooks/handoff-write.sh +74 -67
  99. package/assets/hooks/hook-input.sh +67 -58
  100. package/assets/hooks/lint-after-edit.sh +95 -61
  101. package/assets/hooks/observe.sh +28 -26
  102. package/assets/hooks/override-write-guard.sh +23 -21
  103. package/assets/hooks/postmortem-guard.sh +42 -39
  104. package/assets/hooks/profile-check.sh +22 -20
  105. package/assets/hooks/proposal-guard.sh +57 -49
  106. package/assets/hooks/prose-style-guard.sh +49 -24
  107. package/assets/hooks/qa-dataid-guard.sh +83 -58
  108. package/assets/hooks/rerun-guard.sh +31 -30
  109. package/assets/hooks/reuse-first-guard.sh +108 -87
  110. package/assets/hooks/roles.sh +14 -14
  111. package/assets/hooks/rule-article.sh +39 -34
  112. package/assets/hooks/rule-source-guard.sh +47 -42
  113. package/assets/hooks/skill-gate-layers.sh +63 -57
  114. package/assets/hooks/skill-gate-rearm.sh +15 -8
  115. package/assets/hooks/skill-gate.sh +89 -81
  116. package/assets/hooks/skill-loaded.sh +10 -6
  117. package/assets/hooks/sql-guard-parse.sh +71 -66
  118. package/assets/hooks/sql-guard-request.sh +51 -46
  119. package/assets/hooks/sql-guard-target.sh +60 -51
  120. package/assets/hooks/sql-guard-write.sh +87 -79
  121. package/assets/hooks/sql-guard.sh +52 -47
  122. package/assets/hooks/stand-login-guard.sh +43 -37
  123. package/assets/hooks/task-context-load.sh +60 -55
  124. package/assets/hooks/task-flow-context.sh +87 -69
  125. package/assets/hooks/task-flow-draft-guard.sh +55 -48
  126. package/assets/hooks/task-flow-guard.sh +67 -64
  127. package/assets/hooks/turn-entry-load.sh +39 -32
  128. package/assets/hooks/turn-exit-guard.sh +260 -204
  129. package/assets/hooks/turn-exit-patterns.sh +63 -0
  130. package/assets/hooks/utf8.sh +14 -11
  131. package/assets/hooks/waiting-turn-guard.sh +104 -94
  132. package/assets/hooks/window-fill-guard.sh +70 -62
  133. package/assets/hooks/work-start-guard.sh +52 -49
  134. package/assets/hooks/write-targets.sh +99 -44
  135. package/assets/laws/autonomous-work.md +29 -27
  136. package/assets/laws/code-structure.md +31 -30
  137. package/assets/laws/delivery.md +170 -137
  138. package/assets/laws/entity-editing.md +52 -50
  139. package/assets/laws/entity-models.md +14 -13
  140. package/assets/laws/frontend-application.md +39 -38
  141. package/assets/laws/lib-imports.md +27 -27
  142. package/assets/laws/lists.md +31 -29
  143. package/assets/laws/navigation.md +37 -37
  144. package/assets/laws/observability.md +41 -40
  145. package/assets/laws/project-documentation.md +106 -99
  146. package/assets/laws/reuse-first.md +31 -29
  147. package/assets/laws/shared-code.md +27 -27
  148. package/assets/laws/verifiability.md +131 -124
  149. package/assets/laws/work-conduct.md +250 -244
  150. package/assets/patterns/admin-lists-screen.md +72 -69
  151. package/assets/patterns/admin-nav-item.md +51 -46
  152. package/assets/patterns/angular-patterns-state.md +32 -31
  153. package/assets/patterns/api-layer-pair.md +33 -31
  154. package/assets/patterns/autonomous-work-run.md +50 -49
  155. package/assets/patterns/browser-verification-measure.md +124 -88
  156. package/assets/patterns/browser-verification-stand.md +169 -157
  157. package/assets/patterns/component-structure-new.md +51 -42
  158. package/assets/patterns/dependencies-upgrade.md +55 -39
  159. package/assets/patterns/doc-style-human.md +55 -37
  160. package/assets/patterns/doc-style-sweep.md +82 -79
  161. package/assets/patterns/doc-style-trace.md +87 -81
  162. package/assets/patterns/doc-style-write.md +130 -122
  163. package/assets/patterns/entity-aside.md +77 -63
  164. package/assets/patterns/entity-models-new.md +37 -37
  165. package/assets/patterns/entity-store.md +33 -33
  166. package/assets/patterns/git-workflow-commit.azure.md +94 -87
  167. package/assets/patterns/git-workflow-commit.github.md +160 -142
  168. package/assets/patterns/git-workflow-commit.gitlab.md +96 -90
  169. package/assets/patterns/git-workflow-docker.md +165 -147
  170. package/assets/patterns/git-workflow-freshness.md +45 -45
  171. package/assets/patterns/git-workflow-merge.md +102 -94
  172. package/assets/patterns/git-workflow-migration.md +54 -52
  173. package/assets/patterns/git-workflow-pr-ready.md +57 -56
  174. package/assets/patterns/git-workflow-pr.azure.md +127 -122
  175. package/assets/patterns/git-workflow-pr.github.md +186 -177
  176. package/assets/patterns/git-workflow-pr.gitlab.md +139 -132
  177. package/assets/patterns/git-workflow-restart.md +35 -31
  178. package/assets/patterns/git-workflow-secrets.md +80 -73
  179. package/assets/patterns/git-workflow-stack.md +136 -107
  180. package/assets/patterns/lib-layers-move.md +62 -53
  181. package/assets/patterns/lib-layers-new.md +59 -45
  182. package/assets/patterns/observability-record.md +72 -67
  183. package/assets/patterns/platform-access-di.md +31 -29
  184. package/assets/patterns/reuse-first-extend.md +66 -61
  185. package/assets/patterns/shared-code-new.md +39 -38
  186. package/assets/patterns/spec-driven-domain.md +161 -151
  187. package/assets/patterns/spec-driven-rule.md +179 -168
  188. package/assets/patterns/spec-driven-sweep.md +41 -39
  189. package/assets/patterns/status-report-table.github.md +48 -36
  190. package/assets/patterns/styling-bem-component.md +42 -42
  191. package/assets/patterns/styling-bem-layout.md +39 -34
  192. package/assets/patterns/styling-bem-sheet.md +59 -58
  193. package/assets/patterns/task-flow-archive.md +222 -215
  194. package/assets/patterns/task-flow-close.md +234 -203
  195. package/assets/patterns/task-flow-handoff.md +154 -145
  196. package/assets/patterns/task-flow-resume.md +138 -133
  197. package/assets/patterns/task-flow-start.md +228 -202
  198. package/assets/patterns/testing-e2e.md +102 -101
  199. package/assets/patterns/testing-unit.md +77 -70
  200. package/assets/patterns/ts-procedure.md +32 -29
  201. package/assets/patterns/turn-entry-map.md +50 -48
  202. package/assets/pitfalls/agent-kit.md +172 -142
  203. package/assets/pitfalls/doc-style.md +96 -91
  204. package/assets/pitfalls/git-workflow.azure.md +49 -46
  205. package/assets/pitfalls/git-workflow.github.md +270 -234
  206. package/assets/pitfalls/git-workflow.gitlab.md +49 -45
  207. package/assets/pitfalls/spec-driven.md +73 -71
  208. package/assets/pitfalls/styling-bem.md +46 -40
  209. package/assets/pitfalls/task-flow.md +262 -246
  210. package/assets/pitfalls/testing.md +99 -92
  211. package/assets/pitfalls/turn-conduct.md +96 -81
  212. package/assets/rules/angular-patterns.md +81 -80
  213. package/assets/rules/api-layer.md +77 -74
  214. package/assets/rules/autonomous-work.md +87 -74
  215. package/assets/rules/browser-verification.md +223 -214
  216. package/assets/rules/component-structure.md +72 -69
  217. package/assets/rules/dependencies.md +74 -67
  218. package/assets/rules/deploy-flow.azure.md +118 -108
  219. package/assets/rules/deploy-flow.github.md +145 -135
  220. package/assets/rules/deploy-flow.gitlab.md +120 -110
  221. package/assets/rules/doc-style.md +201 -173
  222. package/assets/rules/entity-conventions.needs-admin.md +81 -79
  223. package/assets/rules/entity-models.md +73 -70
  224. package/assets/rules/git-workflow.azure.md +224 -228
  225. package/assets/rules/git-workflow.github.md +268 -239
  226. package/assets/rules/git-workflow.gitlab.md +218 -217
  227. package/assets/rules/lib-layers.md +85 -86
  228. package/assets/rules/lists.md +101 -97
  229. package/assets/rules/navigation.md +78 -78
  230. package/assets/rules/observability.needs-app.md +165 -153
  231. package/assets/rules/platform-access.md +76 -75
  232. package/assets/rules/reuse-first.md +153 -143
  233. package/assets/rules/shared-code.md +82 -79
  234. package/assets/rules/spec-driven.md +279 -260
  235. package/assets/rules/status-report.md +62 -58
  236. package/assets/rules/styling-bem.md +81 -77
  237. package/assets/rules/task-flow.md +303 -270
  238. package/assets/rules/testing.md +224 -209
  239. package/assets/rules/turn-conduct.md +262 -258
  240. package/assets/rules/turn-entry.md +92 -87
  241. package/assets/rules/typescript-conventions.md +94 -88
  242. package/assets/samples/specs/_template/spec.md +47 -47
  243. package/assets/samples/tasks/_template/grill.md +20 -20
  244. package/assets/samples/tasks/_template/plan.md +32 -30
  245. package/assets/samples/tasks/_template/progress.md +16 -16
  246. package/assets/skills/agent-kit-extend.md +129 -113
  247. package/assets/skills/agent-kit.md +259 -233
  248. package/assets/skills/write-a-skill.md +76 -71
  249. package/assets/templates/findings.md +19 -19
  250. package/assets/templates/gate-map.sh +16 -14
  251. package/assets/templates/implementation.md +28 -27
  252. package/assets/templates/pattern.md +17 -17
  253. package/assets/templates/pitfalls.md +6 -6
  254. package/assets/templates/postmortem.md +24 -23
  255. package/assets/templates/project.sh +24 -24
  256. package/assets/templates/proposal.md +62 -60
  257. package/assets/templates/rule.md +38 -38
  258. package/assets/workflows/feature.js +46 -46
  259. package/assets/workflows/plan.js +54 -54
  260. package/bin/agent-kit.d.ts.map +1 -1
  261. package/bin/agent-kit.js +8 -1
  262. package/bin/agent-kit.js.map +1 -1
  263. package/lib/cargo-prose.d.ts +41 -0
  264. package/lib/cargo-prose.d.ts.map +1 -0
  265. package/lib/cargo-prose.js +88 -0
  266. package/lib/cargo-prose.js.map +1 -0
  267. package/lib/cargo.d.ts +12 -1
  268. package/lib/cargo.d.ts.map +1 -1
  269. package/lib/cargo.js +8 -2
  270. package/lib/cargo.js.map +1 -1
  271. package/lib/catalog.d.ts +2 -0
  272. package/lib/catalog.d.ts.map +1 -1
  273. package/lib/catalog.js +4 -3
  274. package/lib/catalog.js.map +1 -1
  275. package/lib/commands.d.ts.map +1 -1
  276. package/lib/commands.js +5 -2
  277. package/lib/commands.js.map +1 -1
  278. package/lib/companion.js +3 -2
  279. package/lib/companion.js.map +1 -1
  280. package/lib/enroll.d.ts +7 -1
  281. package/lib/enroll.d.ts.map +1 -1
  282. package/lib/enroll.js +12 -3
  283. package/lib/enroll.js.map +1 -1
  284. package/lib/fate.d.ts +29 -0
  285. package/lib/fate.d.ts.map +1 -0
  286. package/lib/fate.js +147 -0
  287. package/lib/fate.js.map +1 -0
  288. package/lib/override-marks.d.ts +7 -0
  289. package/lib/override-marks.d.ts.map +1 -1
  290. package/lib/override-marks.js +14 -0
  291. package/lib/override-marks.js.map +1 -1
  292. package/lib/plan.d.ts +11 -0
  293. package/lib/plan.d.ts.map +1 -1
  294. package/lib/plan.js +10 -1
  295. package/lib/plan.js.map +1 -1
  296. package/lib/ship.d.ts +29 -9
  297. package/lib/ship.d.ts.map +1 -1
  298. package/lib/ship.js +44 -2
  299. package/lib/ship.js.map +1 -1
  300. package/lib/shipment.d.ts.map +1 -1
  301. package/lib/shipment.fixture.d.ts +8 -1
  302. package/lib/shipment.fixture.d.ts.map +1 -1
  303. package/lib/shipment.fixture.js +9 -0
  304. package/lib/shipment.fixture.js.map +1 -1
  305. package/lib/shipment.js +38 -5
  306. package/lib/shipment.js.map +1 -1
  307. package/lib/sync.d.ts.map +1 -1
  308. package/lib/sync.js +45 -11
  309. package/lib/sync.js.map +1 -1
  310. package/package.json +1 -1
  311. package/rt-tools-agent-kit-0.27.0.tgz +0 -0
  312. package/rt-tools-agent-kit-0.24.0.tgz +0 -0
@@ -1,81 +1,77 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Общая работа с очередью работ: борда проекта, тикеты и их состояние.
3
+ * Shared work with the work queue: the project board, the tasks and their state.
4
4
  *
5
- * Один и тот же вопрос — «задача N в порядке?» — задают трое: команда заведения
6
- * задачи (tools/task-new.mjs), сверка очереди (tools/check-board.mjs) и гард
7
- * поставки (.claude/hooks/git-guard-delivery.sh). Пока ответ на него был записан
8
- * готовыми строками в паттерне, каждый из них отвечал по-своему: тикет заводился
9
- * без добавления на борду, и две задачи так и простояли вне очереди.
5
+ * One question — "is task N in order?" — is asked by three callers: the task creation command
6
+ * (tools/task-new.mjs), the queue audit (tools/check-board.mjs) and the delivery guard
7
+ * (.claude/hooks/git-guard-delivery.sh). While the answer stood as ready-made lines in a pattern,
8
+ * each answered its own way: two tasks were created outside the board that way.
10
9
  *
11
- * Борда к репозиторию не привязана — `projectsV2` у него пуст, — поэтому тикет
12
- * попадает на неё только явным вызовом, а не сам.
10
+ * The board is not bound to the repository — its `projectsV2` is empty — so a task lands on it
11
+ * only by an explicit call. The guard calls this file as a command: `node tools/board.mjs task
12
+ * <number>` prints the task state as one line of JSON; `move <number> <column>` moves its column,
13
+ * also `npm run task:move`.
13
14
  *
14
- * Гард зовёт этот файл как команду: `node tools/board.mjs task <номер>` печатает
15
- * состояние задачи одной строкой JSON. Колонку задачи двигает второй режим —
16
- * `node tools/board.mjs move <номер> <колонка>`, он же `npm run task:move`.
17
- *
18
- * Нет сети или нет токена — это не расхождение, а невозможность проверить:
19
- * функции возвращают `null`, командный режим печатает `{"offline":true}`.
15
+ * No network or no token is an inability to check, not a discrepancy: the functions return `null`,
16
+ * the command mode prints `{"offline":true}`.
20
17
  */
21
- import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
22
- import { join } from 'node:path';
23
-
24
18
  import { OfflineError, botToken, gh, ghJson, graphql } from './board-gh.mjs';
25
- import { CONFIG, ROOT } from './rt-kit-checks.config.mjs';
19
+ import { declaredEpicOf } from './board-epic-link.mjs';
20
+ export { numberFromTaskDir, taskDirs, unstampFolder } from './board-task-dirs.mjs';
21
+ import { CONFIG } from './rt-kit-checks.config.mjs';
26
22
 
27
- // Наружу клиент уезжает отсюда прежним именем: его зовут у борды три соседних модуля и команды
28
- // дерева, и переписывать их ради переезда объявления значило бы платить за деление файла дважды.
23
+ // The client leaves here under its old name: three neighbouring modules and the tree's commands
24
+ // call it from the board module, and rewriting them would mean paying for the split twice.
29
25
  export { OfflineError, botToken, gh, ghJson, graphql };
30
26
 
31
27
  /**
32
- * Адрес борды и её колонки живут в `.claude/rt-kit/checks.json`: идентификаторы проекта, поля
33
- * и вариантов выдаёт сам GitHub при заведении борды, и угадать их нельзя. Пустое значение
34
- * означает, что дерево борду не завело, — тогда работа с ней отказывается вслух, а не молча
35
- * правит чужую.
28
+ * The board address and its columns live in `.claude/rt-kit/checks.json`: the identifiers of the
29
+ * project, the fields and the options are issued by GitHub itself when the board is created, and
30
+ * they cannot be guessed. An empty value means the tree has not created a board — then work with
31
+ * it refuses out loud instead of silently editing someone else's.
36
32
  */
37
33
  const BOARD = CONFIG.board ?? {};
38
34
 
39
35
  export const OWNER = BOARD.owner ?? '';
40
36
  export const REPO = BOARD.repo ?? '';
41
37
  export const PROJECT_ID = BOARD.projectId ?? '';
42
- /** Поле «Status» борды — колонка, в которой задача стоит сейчас */
38
+ /** The board's "Status" field — the column the task stands in now */
43
39
  export const STATUS_FIELD_ID = BOARD.statusFieldId ?? '';
44
40
  /**
45
- * Колонки борды под своими короткими именами. Ход работы читается по ним, а не по
46
- * тому, есть ли у задачи ветка: ветки на борде не видно вовсе.
41
+ * The board columns under their short names. The progress is read by them, not by whether the
42
+ * task has a branch: branches are not visible on the board at all.
47
43
  */
48
44
  export const STATUS_OPTIONS = BOARD.statusOptions ?? {};
49
- /** Колонка вновь заведённой задачи */
45
+ /** The column of a newly created task */
50
46
  export const BACKLOG_OPTION_ID = STATUS_OPTIONS.backlog?.id ?? '';
51
- /** Колонка задачи, взятой в работу, и задачи, PR по которой ждёт разбора */
47
+ /** The column of a task taken into work, and of a task whose PR waits for review */
52
48
  export const IN_PROGRESS_STATUS = 'in-progress';
53
49
  export const IN_REVIEW_STATUS = 'in-review';
54
- /** Учётная запись машинной работы — та же, от которой идут коммиты */
50
+ /** The machine account — the same one the commits come from */
55
51
  export const BOT = BOARD.bot ?? '';
56
52
  /**
57
- * Ключ задач: даёт ветку `<КЛЮЧ>-<номер>-<slug>` и заголовок `[<КЛЮЧ>-<номер>]`.
53
+ * The task key: gives the branch `<KEY>-<number>-<slug>` and the title `[<KEY>-<number>]`.
58
54
  *
59
- * Единственное в форме имени, что дерево выбирает само, — и потому единственное, что закон о
60
- * поставке разрешает настраивать. Назвать его дерево обязано: из пустого ключа собирается
61
- * `[-317]`, и такой заголовок не совпадает ни с чем. Отказ поимённый, потому что молчание
62
- * здесь дороже: сверка очереди не падает, а помечает каждую задачу неправильно названной, и
63
- * настоящее расхождение тонет среди этих строк.
55
+ * The only thing in the name form that the tree chooses itself — and so the only thing the
56
+ * delivery law allows to configure. The tree must name it: an empty key assembles into `[-317]`,
57
+ * and such a title matches nothing. The refusal is by name, because silence costs more here: the
58
+ * queue audit does not fail but marks every task as wrongly named, and the real discrepancy drowns
59
+ * among those lines.
64
60
  */
65
61
  export const TASK_KEY = BOARD.taskKey ?? '';
66
62
  if (PROJECT_ID && !TASK_KEY) {
67
63
  console.error(
68
- 'board: ключ задач не назван — задать его ключом `board.taskKey` в .claude/rt-kit/checks.json.\n' +
69
- 'Из него собираются заголовок задачи `[<КЛЮЧ>-<номер>]` и имя ветки `<КЛЮЧ>-<номер>-<краткое-имя>`.'
64
+ 'board: the task key is not named — set it by the key `board.taskKey` in .claude/rt-kit/checks.json.\n' +
65
+ 'The task title `[<KEY>-<number>]` and the branch name `<KEY>-<number>-<short-name>` are assembled from it.'
70
66
  );
71
67
  process.exit(1);
72
68
  }
73
- /** Кого запрашивают на разбор: без ревьювера PR не попадает во входящие владельца. */
69
+ /** Who is requested for review: without a reviewer the PR does not reach the owner's inbox. */
74
70
  export const REVIEWER = BOARD.reviewer ?? '';
75
71
  /**
76
- * Тикеты, стоящие на борде, и элементы борды, тикетами не являющиеся. У каждого тикета —
77
- * его элемент борды и колонка: переставить задачу можно только по идентификатору элемента,
78
- * а не по номеру тикета, и берётся он здесь же, чтобы не спрашивать борду дважды.
72
+ * Tasks standing on the board, and board items that are not tasks. Each task has its board item
73
+ * and column: a task can be moved only by the item identifier, not by the task number, and it is
74
+ * taken right here so as not to ask the board twice.
79
75
  */
80
76
  export function fetchBoard(options) {
81
77
  const items = new Map();
@@ -95,7 +91,7 @@ export function fetchBoard(options) {
95
91
  if (content.__typename === 'Issue') {
96
92
  items.set(content.number, { itemId: node.id, status: node.status?.name ?? null });
97
93
  } else {
98
- foreign.push(content.__typename === 'PullRequest' ? `PR #${content.number}` : `черновик «${content.title}»`);
94
+ foreign.push(content.__typename === 'PullRequest' ? `PR #${content.number}` : `a draft «${content.title}»`);
99
95
  }
100
96
  }
101
97
  if (!page.pageInfo.hasNextPage) {
@@ -106,17 +102,17 @@ export function fetchBoard(options) {
106
102
  }
107
103
 
108
104
  /**
109
- * Перевод задачи в другую колонку. Состояние задачи на борде — единственное, по чему
110
- * видно ход работы: ветку и открытый PR борда сама не читает.
105
+ * Moving a task to another column. The task's state on the board is the only thing the progress
106
+ * is visible by: the board does not read the branch or the open PR itself.
111
107
  */
112
108
  export function moveTask(number, status, options) {
113
109
  const option = STATUS_OPTIONS[status];
114
110
  if (!option) {
115
- throw new Error(`неизвестная колонка «${status}» — есть ${Object.keys(STATUS_OPTIONS).join(', ')}`);
111
+ throw new Error(`an unknown column «${status}» — there are ${Object.keys(STATUS_OPTIONS).join(', ')}`);
116
112
  }
117
113
  const item = fetchBoard(options).items.get(number);
118
114
  if (!item) {
119
- throw new Error(`задачи #${number} нет на борде — заводится она командой npm run task:new`);
115
+ throw new Error(`the task #${number} is not on the board — it is created by the command npm run task:new`);
120
116
  }
121
117
  graphql(
122
118
  `mutation { updateProjectV2ItemFieldValue(input: {projectId: "${PROJECT_ID}", itemId: "${item.itemId}", fieldId: "${STATUS_FIELD_ID}", value: {singleSelectOptionId: "${option.id}"}}) { projectV2Item { id } } }`,
@@ -125,9 +121,22 @@ export function moveTask(number, status, options) {
125
121
  return { from: item.status, to: option.name };
126
122
  }
127
123
 
124
+ /**
125
+ * Whose eyes the state was taken with: `machine` — the call went with the machine account's
126
+ * token, `client` — as whoever the hosting client is logged in as. A task is read with the token,
127
+ * a PR without it, and from the output alone this cannot be told apart: a tree whose machine
128
+ * account was restricted by the hosting got a person's picture and took it as checked. The login
129
+ * is not printed here — it would take a second network request, and the guards read the answer
130
+ * without it.
131
+ */
132
+ export function viewerOf(options) {
133
+ return options?.token ? 'machine' : 'client';
134
+ }
135
+
128
136
  export function fetchIssues(state, options) {
129
- // Тело берётся вместе со списком, а не поштучным вызовом на задачу: связь с эпиком читается
130
- // как раз в нём, а четыреста вызовов вида «покажи одну задачу» стоили бы дороже всей сверки.
137
+ // The body is taken together with the list, not by a call per task: the link to an epic is
138
+ // read exactly there, and four hundred calls of the kind "show one task" would cost more than
139
+ // the whole audit.
131
140
  return ghJson(
132
141
  ['issue', 'list', '--state', state, '--limit', '400', '--json', 'number,title,state,assignees,labels,body'],
133
142
  options,
@@ -136,7 +145,7 @@ export function fetchIssues(state, options) {
136
145
 
137
146
  export function fetchIssue(number, options) {
138
147
  try {
139
- return ghJson(['issue', 'view', String(number), '--json', 'number,title,state,assignees,labels'], options);
148
+ return ghJson(['issue', 'view', String(number), '--json', 'number,title,state,assignees,labels,body'], options);
140
149
  } catch (error) {
141
150
  if (error instanceof OfflineError) {
142
151
  throw error;
@@ -146,16 +155,17 @@ export function fetchIssue(number, options) {
146
155
  }
147
156
 
148
157
  /**
149
- * Состояние заявки в терминах поставки: существует, черновик ли она и есть ли у неё разбор —
150
- * запрошенный ревьювер либо уже оставленный отзыв.
158
+ * The PR state in delivery terms: whether it exists, whether it is a draft and whether it has a
159
+ * review — a requested reviewer or a review already left.
151
160
  *
152
- * Ревьювера до этой правки не спрашивал никто: он жил прозой в паттерне о коммите и PR, и
153
- * запрос разбора на самого себя хостинг принимает молча — разбор при этом выглядит
154
- * запрошенным, а его нет.
161
+ * Before this edit nobody asked about the reviewer: it lived as prose in the pattern about the
162
+ * commit and the PR, and the hosting silently accepts a review request to oneself — the review
163
+ * then looks requested, and there is none.
155
164
  */
156
165
  export function pullState(ref, options) {
157
- // Ссылка на заявку необязательна: клиент хостинга без неё берёт заявку текущей ветки, и
158
- // это самая короткая форма вызова. Требовать номер значило бы молча пропускать её.
166
+ // The PR reference is optional: without it the hosting client takes the PR of the current
167
+ // branch, and that is the shortest form of the call. Requiring a number would mean silently
168
+ // skipping it.
159
169
  const target = ref === undefined || ref === null || `${ref}`.trim() === '' ? [] : [`${ref}`.trim()];
160
170
  let pull;
161
171
  try {
@@ -164,32 +174,34 @@ export function pullState(ref, options) {
164
174
  if (error instanceof OfflineError) {
165
175
  throw error;
166
176
  }
167
- return { exists: false };
177
+ return { exists: false, viewer: viewerOf(options) };
168
178
  }
169
179
  if (!pull) {
170
- return { exists: false };
180
+ return { exists: false, viewer: viewerOf(options) };
171
181
  }
172
182
  const requested = (pull.reviewRequests ?? []).map((entry) => entry.login ?? entry.name ?? '').filter(Boolean);
173
183
  const reviewed = (pull.latestReviews ?? []).map((entry) => entry.author?.login ?? '').filter(Boolean);
174
184
  const reviewers = [...new Set([...requested, ...reviewed])];
175
185
  return {
176
186
  exists: true,
187
+ viewer: viewerOf(options),
177
188
  number: pull.number ?? null,
178
189
  draft: pull.isDraft === true,
179
190
  author: pull.author?.login ?? null,
180
191
  reviewers,
181
192
  reviewed: reviewers.filter((login) => login !== (pull.author?.login ?? null)).length > 0,
182
- // Конфликт приезжает чужим слиянием, без единого действия автора заявки. Судится только
183
- // прямое «конфликтует»: `UNKNOWN` означает, что хостинг ещё считает, и читать его как
184
- // конфликт значило бы отбивать работу на каждой свежей вершине.
193
+ // A conflict arrives through someone else's merge, without a single action by the PR
194
+ // author. Only a direct "conflicting" is judged: `UNKNOWN` means the hosting is still
195
+ // computing, and reading it as a conflict would mean refusing work on every fresh head.
185
196
  conflicting: pull.mergeable === 'CONFLICTING',
186
197
  };
187
198
  }
188
199
 
189
200
  /**
190
- * На сколько коммитов ветка заявки позади главной. Гард судит основание в минуту открытия, а
191
- * заявка стоит днями: влитого за это время не видит ни он, ни зелёный прогон. Сравнить нечем —
192
- * ноль: сверка без доступа отбивала бы работу вместо промаха; без сети летит отказ, как везде.
201
+ * How many commits the PR branch is behind main. The guard judges the base at the minute of
202
+ * opening, and a PR stands for days: what was merged in that time is seen neither by it nor by a
203
+ * green run. Nothing to compare with — zero: an audit without access would refuse work instead
204
+ * of a miss; without network the refusal is thrown, as everywhere.
193
205
  */
194
206
  export function behindMain(branch, mainBranch, options) {
195
207
  if (!OWNER || !REPO || !branch || !mainBranch) {
@@ -209,8 +221,8 @@ export function behindMain(branch, mainBranch, options) {
209
221
  }
210
222
  }
211
223
 
212
- /** Вершина берётся вместе с остальным: по ней судят и папку задачи, и прогон, а спросить её
213
- * потом значило бы второй вызов на каждый PR. */
224
+ /** The head is taken together with the rest: both the task folder and the run are judged by it,
225
+ * and asking for it later would mean a second call per PR. */
214
226
  export function fetchOpenPulls(options) {
215
227
  return ghJson(
216
228
  ['pr', 'list', '--state', 'open', '--limit', '200', '--json', 'number,title,headRefName,headRefOid,isDraft,body,mergeable,baseRefName'],
@@ -219,17 +231,16 @@ export function fetchOpenPulls(options) {
219
231
  }
220
232
 
221
233
  /**
222
- * Свои открытые заявки, помеченные конфликтующими. Спрашивается это в минуту, когда берётся
223
- * новая работа: пока отданное конфликтует, влить его человек не может, и каждая следующая
224
- * заявка прибавляет к очереди ещё одну, которую придётся догонять.
234
+ * Own open PRs marked as conflicting. Asked at the minute new work is taken: while what was
235
+ * handed over conflicts, a person cannot merge it, and every next PR adds one more to the queue.
225
236
  *
226
- * Свои — значит открытые машинной записью дерева. Дерево, её не назвавшее, не спрашивается
227
- * вовсе: `@me` отвечал бы учётной записью, под которой залогинен клиент хостинга, а это чаще
228
- * всего владелец, и его заявки исполнителю не чинить.
237
+ * Own means opened by the tree's machine account. A tree that has not named it is not asked at
238
+ * all: `@me` would answer with the account the hosting client is logged in as — most often the
239
+ * owner, whose PRs are not the executor's to fix.
229
240
  *
230
- * Судится только прямое `CONFLICTING`. `UNKNOWN` означает, что хостинг ещё считает сливаемость
231
- * — он пересчитывает её после каждой правки главной ветки, — и читать его как конфликт значило
232
- * бы отбивать работу на каждой свежей вершине.
241
+ * Only a direct `CONFLICTING` is judged. `UNKNOWN` means the hosting is still computing
242
+ * mergeability — it recomputes it after every edit of the main branch — and reading it as a
243
+ * conflict would refuse work on every fresh head.
233
244
  */
234
245
  export function conflictingPulls(options) {
235
246
  if (!BOT) {
@@ -244,9 +255,9 @@ export function conflictingPulls(options) {
244
255
  .map((pull) => ({ number: pull.number ?? null, branch: pull.headRefName ?? '' }));
245
256
  }
246
257
 
247
- /** `[<КЛЮЧ>-<номер>]` в начале заголовка — единственная форма номера в названиях */
258
+ /** `[<KEY>-<number>]` at the start of the title — the only form of the number in names */
248
259
  export const TITLE_NUMBER = new RegExp(`^\\[${TASK_KEY}-(\\d+)\\]\\s+\\S`);
249
- /** `<КЛЮЧ>-<номер>-<slug>` — имя ветки, отведённой под задачу */
260
+ /** `<KEY>-<number>-<slug>` — the name of the branch set aside for the task */
250
261
  export const BRANCH_NUMBER = new RegExp(`^${TASK_KEY}-(\\d+)-[a-z0-9][a-z0-9-]*$`);
251
262
 
252
263
  export function numberFromTitle(title) {
@@ -254,89 +265,6 @@ export function numberFromTitle(title) {
254
265
  return match ? Number(match[1]) : null;
255
266
  }
256
267
 
257
- /**
258
- * Номер задачи по имени папки. Ключ впереди необязателен: имя ветки вида `chore/312-slug`
259
- * тоже законно, и папка под ним называется голым числом. Если сверка не распознает в имени
260
- * номер, папка будет лежать среди текущих сколько угодно — одну такую нашли грепом, а не
261
- * проверкой.
262
- */
263
- export function numberFromTaskDir(name) {
264
- // Ключ подставляем, только если дерево его задало: из пустого получилось бы `^(?:-)?`, и
265
- // папка с ключом в имени вообще перестала бы распознаваться.
266
- const prefix = TASK_KEY ? `(?:${TASK_KEY}-)?` : '';
267
- const match = new RegExp(`^${prefix}(\\d+)-`).exec(name ?? '');
268
- return match ? Number(match[1]) : null;
269
- }
270
-
271
- /**
272
- * Папки задач, включая вложенные. Путь повторяет имя ветки целиком, вместе с косой, поэтому
273
- * папка ветки `chore/312-slug` лежит на втором уровне — обход только по верхнему её не видит.
274
- *
275
- * Вглубь спускаемся ровно на один уровень: в имени ветки одна косая, а всё, что глубже, папкой
276
- * задачи уже не будет — зато туда попал бы архив, если дерево держит его внутри.
277
- */
278
- /** Шапка раскладки: по ней разложенную копию узнаёт и гард места правки. */
279
- const STAMP = /^<!-- rt-kit v[^\n]*-->\n/m;
280
-
281
- /**
282
- * Снять с копий образца шапку раскладки.
283
- *
284
- * Образец разложен пакетом и шапку несёт по праву: его кладёт и обновляет раскладка. Копия под
285
- * задачу — уже текст проекта, тем же доводом, каким пакет кладёт без шапки черновик компаньона:
286
- * с первой правки сверять в ней нечего.
287
- *
288
- * Оставленная в копии, шапка отбивает первую же правку разбора просьбы — то есть первое движение
289
- * любой работы, — и отказ уводит править образец пакета вместо копии под задачу. Снималась она
290
- * тремя строками руками, каждой работой заново.
291
- *
292
- * Возвращает имена файлов, с которых шапка снята: по ним сценарий и судит, что снятие работает,
293
- * а вызывающий — что папка собрана.
294
- */
295
- export function unstampFolder(folder) {
296
- const cleaned = [];
297
-
298
- if (!existsSync(folder)) {
299
- return cleaned;
300
- }
301
-
302
- for (const name of readdirSync(folder)) {
303
- if (!name.endsWith('.md')) {
304
- continue;
305
- }
306
-
307
- const path = join(folder, name);
308
- const before = readFileSync(path, 'utf8');
309
- const after = before.replace(STAMP, '');
310
-
311
- if (after !== before) {
312
- writeFileSync(path, after);
313
- cleaned.push(name);
314
- }
315
- }
316
-
317
- return cleaned;
318
- }
319
-
320
- export function taskDirs(dir = join(ROOT, CONFIG.tasksDir), prefix = '') {
321
- if (!existsSync(dir)) {
322
- return [];
323
- }
324
- const found = [];
325
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
326
- if (!entry.isDirectory() || entry.name === '_template') {
327
- continue;
328
- }
329
- const name = prefix ? `${prefix}/${entry.name}` : entry.name;
330
- if (entry.name.startsWith('_draft-') || numberFromTaskDir(entry.name) !== null) {
331
- found.push(name);
332
- continue;
333
- }
334
- if (!prefix) {
335
- found.push(...taskDirs(join(dir, entry.name), name));
336
- }
337
- }
338
- return found;
339
- }
340
268
 
341
269
  export function numberFromBranch(branch) {
342
270
  const match = BRANCH_NUMBER.exec(branch ?? '');
@@ -344,18 +272,19 @@ export function numberFromBranch(branch) {
344
272
  }
345
273
 
346
274
  /**
347
- * Состояние задачи в терминах закона: существует, стоит в очереди работ, у неё есть
348
- * исполнитель, она ещё не закрыта. Закрытая означает, что ветка под неё уже въехала
349
- * в главную, а у задачи ветка одна.
275
+ * The task state in the law's terms: it exists, it stands in the work queue, it has an executor,
276
+ * it is not yet closed. Closed means the branch under it has already gone into main, and a task
277
+ * has one branch.
350
278
  */
351
279
  export function taskState(number, options) {
352
280
  const issue = fetchIssue(number, options);
353
281
  if (!issue) {
354
- return { exists: false };
282
+ return { exists: false, viewer: viewerOf(options) };
355
283
  }
356
284
  const item = fetchBoard(options).items.get(issue.number);
357
285
  return {
358
286
  exists: true,
287
+ viewer: viewerOf(options),
359
288
  title: issue.title,
360
289
  open: issue.state === 'OPEN',
361
290
  onBoard: item !== undefined,
@@ -364,54 +293,60 @@ export function taskState(number, options) {
364
293
  assignees: issue.assignees.map((assignee) => assignee.login),
365
294
  numbered: numberFromTitle(issue.title) === issue.number,
366
295
  labels: issue.labels.map((label) => label.name),
296
+ epic: declaredEpicOf(issue.body) ?? null,
367
297
  };
368
298
  }
369
299
 
370
300
  /**
371
- * Ответ очереди работ о заведённой задаче, сложенный в строки, и приговор: обеспечена работа
372
- * или нет.
301
+ * The work queue's answer about a created task, folded into lines, and the verdict: secured or not.
373
302
  *
374
- * Отделено от вызовов сети намеренно. Заведение кончается не выводом команды, а ответом
375
- * очереди, и решение о том, что напечатать и чем кончиться, — это то самое место, где
376
- * шестнадцать задач подряд прошли как успешные, не попав в очередь ни одна. Внутри вызовов
377
- * сети оно проверяется только живой бордой, то есть не проверяется никогда.
303
+ * Separated from the network calls on purpose. Creation ends not with the command output but with
304
+ * the queue's answer, and the decision of what to print and how to end is exactly where sixteen
305
+ * tasks in a row passed as successful without one reaching the queue. Inside the network calls it
306
+ * is checked only by a live board, that is, never.
378
307
  *
379
- * `state` — то, что вернул `taskState`, либо `{ offline: <причина> }`, если спросить не удалось.
308
+ * `state` — what `taskState` returned, or `{ offline: <reason> }` if asking failed.
380
309
  */
381
310
  export function describeTaskState(number, state) {
382
311
  if (state?.offline) {
383
312
  return {
384
313
  ok: false,
385
314
  lines: [
386
- `в очереди работ: спросить не удалось — ${state.offline}`,
387
- 'состояние очереди неизвестно, и заведённым это не считается',
315
+ `in the work queue: could not be asked — ${state.offline}`,
316
+ 'the state of the queue is unknown, and that does not count as created',
388
317
  ],
389
318
  };
390
319
  }
391
320
  if (!state?.exists) {
392
- return { ok: false, lines: [`задачи #${number} у хостинга нет — заведение не состоялось`] };
321
+ return { ok: false, lines: [`the hosting has no task #${number} — the creation did not happen`] };
393
322
  }
394
323
  if (!state.onBoard) {
395
324
  return {
396
325
  ok: false,
397
- lines: [`в очереди работ: НЕТ`, 'задача, которой нет в очереди, работой не обеспечена — по ней никто не придёт'],
326
+ lines: [`in the work queue: NO`, 'a task that is not in the queue is backed by no work — nobody will come for it'],
398
327
  };
399
328
  }
400
329
 
401
- const column = state.status ? `колонка «${state.status}»` : 'колонки нет';
330
+ const column = state.status ? `the column «${state.status}»` : 'there is no column';
402
331
  if (!state.assigned) {
403
332
  return {
404
333
  ok: false,
405
- lines: [`в очереди работ: ${column}, исполнителя нет`, 'ничья задача стоит в очереди невидимой для того, кто её делает'],
334
+ lines: [`in the work queue: ${column}, no assignee`, 'a task belonging to nobody stands in the queue invisible to whoever does it'],
406
335
  };
407
336
  }
408
- return { ok: true, lines: [`в очереди работ: ${column}, исполнитель ${state.assignees.join(', ')}`] };
337
+ return { ok: true, lines: [`in the work queue: ${column}, assignee ${state.assignees.join(', ')}`] };
409
338
  }
410
339
 
411
340
  const isEntryPoint = process.argv[1] && import.meta.url === `file://${process.argv[1]}`;
341
+ // The machine account's token is substituted here too, as in the column move. Without it the
342
+ // client goes as whoever is logged in, and during a guard's turn nobody is logged in: the hosting
343
+ // answers that the repository does not exist at all, reading the task returns nothing, and "there
344
+ // was nothing to ask with" becomes indistinguishable from "the task does not exist". On such an
345
+ // answer the delivery guard refused opening a PR with five mutually exclusive reasons at once —
346
+ // no task, the task is closed, the task is not in the queue.
412
347
  if (isEntryPoint && process.argv[2] === 'task') {
413
348
  try {
414
- process.stdout.write(`${JSON.stringify(taskState(Number(process.argv[3])))}\n`);
349
+ process.stdout.write(`${JSON.stringify(taskState(Number(process.argv[3]), { token: botToken() ?? undefined }))}\n`);
415
350
  } catch (error) {
416
351
  if (error instanceof OfflineError) {
417
352
  process.stdout.write('{"offline":true}\n');
@@ -424,6 +359,10 @@ if (isEntryPoint && process.argv[2] === 'task') {
424
359
 
425
360
  if (isEntryPoint && process.argv[2] === 'pr') {
426
361
  try {
362
+ // There is no token here on purpose: the review fields need access to the organisation's
363
+ // accounts, which the machine account was not given, and a request with it is refused on
364
+ // rights entirely. A client without a token goes as whoever is logged in, and for a person
365
+ // it answers.
427
366
  process.stdout.write(`${JSON.stringify(pullState(process.argv[3]))}\n`);
428
367
  } catch (error) {
429
368
  if (error instanceof OfflineError) {
@@ -435,12 +374,12 @@ if (isEntryPoint && process.argv[2] === 'pr') {
435
374
  }
436
375
  }
437
376
 
438
- // Свои конфликтующие заявки одной строкой JSON: `{"conflicting":[{"number":…,"branch":…}]}`.
439
- // Зовёт её гард поставки перед тем, как пустить взятие новой работы. Дерево без машинной записи
440
- // отвечает пустым списком: спрашивать не о ком.
377
+ // Own conflicting PRs as one line of JSON: `{"conflicting":[{"number":…,"branch":…}]}`.
378
+ // The delivery guard calls it before letting new work be taken. A tree without a machine account
379
+ // answers with an empty list: there is nobody to ask about.
441
380
  if (isEntryPoint && process.argv[2] === 'conflicts') {
442
381
  try {
443
- process.stdout.write(`${JSON.stringify({ conflicting: conflictingPulls() ?? [] })}\n`);
382
+ process.stdout.write(`${JSON.stringify({ conflicting: conflictingPulls({ token: botToken() ?? undefined }) ?? [] })}\n`);
444
383
  } catch (error) {
445
384
  if (error instanceof OfflineError) {
446
385
  process.stdout.write('{"offline":true}\n');
@@ -451,26 +390,26 @@ if (isEntryPoint && process.argv[2] === 'conflicts') {
451
390
  }
452
391
  }
453
392
 
454
- // Перевод колонки правит борду. Токен машинной записи здесь необязателен: не назвавшее его
455
- // дерево правит борду учётной записью, под которой залогинен клиент хостинга. Требование
456
- // токена держало бы очередь работ у дерева, машинной записи не заводившего, и у дерева, чью
457
- // запись ограничил хостинг. Отсутствие связи при этом — по-прежнему отказ, а не пропуск:
458
- // непереставленная задача молча остаётся в прежней колонке, и расхождение всплывает только
459
- // сверкой очереди.
393
+ // The column move edits the board. The machine account's token is optional here: a tree that has
394
+ // not named it edits the board as the account the hosting client is logged in as. Requiring the
395
+ // token would hold the work queue back from a tree that created no machine account, and from a
396
+ // tree whose account the hosting restricted. No connection is still a refusal, not a skip: a task
397
+ // left unmoved silently stays in its old column, and the discrepancy surfaces only through the
398
+ // queue audit.
460
399
  if (isEntryPoint && process.argv[2] === 'move') {
461
400
  const number = Number(process.argv[3]);
462
401
  const status = process.argv[4];
463
402
  if (!Number.isInteger(number) || !status) {
464
- console.error(`board: нужен номер задачи и колонка — node tools/board.mjs move 263 ${IN_PROGRESS_STATUS}`);
403
+ console.error(`board: a task number and a column are needed — node tools/board.mjs move 263 ${IN_PROGRESS_STATUS}`);
465
404
  process.exit(1);
466
405
  }
467
406
  const token = botToken() ?? undefined;
468
407
  try {
469
408
  const moved = moveTask(number, status, { token });
470
- console.log(`#${number}: ${moved.from ?? 'вне колонок'} → ${moved.to}`);
409
+ console.log(`#${number}: ${moved.from ?? 'outside the columns'} → ${moved.to}`);
471
410
  } catch (error) {
472
- const reason = error instanceof OfflineError ? `нет связи с GitHub: ${error.message}` : String(error.message ?? error);
473
- console.error(`board: задача #${number} осталась на прежнем месте — ${reason}`);
411
+ const reason = error instanceof OfflineError ? `no connection to GitHub: ${error.message}` : String(error.message ?? error);
412
+ console.error(`board: the task #${number} stayed in its former place — ${reason}`);
474
413
  process.exit(1);
475
414
  }
476
415
  }