@rt-tools/agent-kit 0.23.0 → 0.26.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 (288) hide show
  1. package/README.md +8 -2
  2. package/assets/agents/business-analyst.md +51 -50
  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-epics.github.mjs +75 -41
  15. package/assets/checks/board-folders.mjs +61 -0
  16. package/assets/checks/board-gh.github.mjs +35 -26
  17. package/assets/checks/board-long-work.github.mjs +24 -24
  18. package/assets/checks/board-paths.github.mjs +21 -16
  19. package/assets/checks/board-runs.github.mjs +45 -43
  20. package/assets/checks/board-titles.github.mjs +19 -17
  21. package/assets/checks/board.github.mjs +150 -128
  22. package/assets/checks/check-archive-age.mjs +23 -19
  23. package/assets/checks/check-board.github.mjs +179 -157
  24. package/assets/checks/check-descriptions.mjs +30 -29
  25. package/assets/checks/check-doc-paths.mjs +104 -82
  26. package/assets/checks/check-dupes.mjs +84 -80
  27. package/assets/checks/check-file-size.mjs +79 -70
  28. package/assets/checks/check-glossary.mjs +47 -37
  29. package/assets/checks/check-hook-scope.mjs +30 -27
  30. package/assets/checks/check-lib-layers.mjs +22 -21
  31. package/assets/checks/check-profile-drift.mjs +48 -43
  32. package/assets/checks/check-prose-style.mjs +125 -33
  33. package/assets/checks/check-push-gate.mjs +53 -50
  34. package/assets/checks/check-reuse.mjs +50 -40
  35. package/assets/checks/check-schema-drift.mjs +87 -83
  36. package/assets/checks/check-specs.mjs +155 -134
  37. package/assets/checks/check-state-next.mjs +66 -52
  38. package/assets/checks/check-states.mjs +32 -30
  39. package/assets/checks/check-styles.mjs +52 -51
  40. package/assets/checks/check-turn-map.mjs +54 -46
  41. package/assets/checks/lib-boundaries.mjs +32 -30
  42. package/assets/checks/lib-common.mjs +30 -29
  43. package/assets/checks/lib-domains.mjs +34 -34
  44. package/assets/checks/lib-manifests.mjs +17 -15
  45. package/assets/checks/lib-reexports.mjs +18 -18
  46. package/assets/checks/rt-kit-checks.config.mjs +174 -142
  47. package/assets/checks/signals.mjs +43 -39
  48. package/assets/checks/spec-anchors.mjs +114 -87
  49. package/assets/checks/spec-common.mjs +128 -84
  50. package/assets/checks/spec-contract.mjs +30 -30
  51. package/assets/checks/spec-proposed.mjs +27 -24
  52. package/assets/checks/spec-scenarios.mjs +51 -28
  53. package/assets/checks/task-new.github.mjs +85 -56
  54. package/assets/commands/feedback.md +65 -59
  55. package/assets/commands/next-session.md +64 -57
  56. package/assets/commands/skill-curator.md +83 -79
  57. package/assets/defaults/gate-map.sh +115 -91
  58. package/assets/defaults/project.sh +228 -178
  59. package/assets/defaults/shell.sh +85 -65
  60. package/assets/defaults/turn-map.md +45 -44
  61. package/assets/docs/GLOSSARY.md +142 -65
  62. package/assets/hooks/browser-device-id.sh +12 -12
  63. package/assets/hooks/browser-guard-device-id.sh +46 -14
  64. package/assets/hooks/browser-guard-no-asking.sh +5 -4
  65. package/assets/hooks/browser-guard-no-listing.sh +12 -11
  66. package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
  67. package/assets/hooks/browser-guard-require-select.sh +34 -23
  68. package/assets/hooks/claim-guard.sh +62 -56
  69. package/assets/hooks/commit-msg.sh +11 -10
  70. package/assets/hooks/conscience-guard.sh +91 -45
  71. package/assets/hooks/constitution-index.sh +16 -16
  72. package/assets/hooks/deny-tail.sh +28 -26
  73. package/assets/hooks/dev-server-guard.sh +46 -43
  74. package/assets/hooks/dispatch.sh +84 -39
  75. package/assets/hooks/docs-guard.sh +105 -86
  76. package/assets/hooks/exam-guard.sh +146 -84
  77. package/assets/hooks/git-guard-delivery-conflict.sh +38 -36
  78. package/assets/hooks/git-guard-delivery-draft.sh +85 -0
  79. package/assets/hooks/git-guard-delivery-folder.sh +50 -43
  80. package/assets/hooks/git-guard-delivery-signature.sh +88 -52
  81. package/assets/hooks/git-guard-delivery.sh +207 -253
  82. package/assets/hooks/git-guard-main.sh +65 -26
  83. package/assets/hooks/git-guard-push-tests.sh +133 -75
  84. package/assets/hooks/glossary-load.sh +23 -22
  85. package/assets/hooks/grill-gate-ask.sh +12 -11
  86. package/assets/hooks/grill-gate.sh +94 -87
  87. package/assets/hooks/guard-note.sh +20 -19
  88. package/assets/hooks/handoff-entry-guard.sh +26 -24
  89. package/assets/hooks/handoff-write.sh +74 -67
  90. package/assets/hooks/hook-input.sh +70 -50
  91. package/assets/hooks/lint-after-edit.sh +95 -61
  92. package/assets/hooks/observe.sh +28 -26
  93. package/assets/hooks/override-write-guard.sh +23 -21
  94. package/assets/hooks/postmortem-guard.sh +42 -39
  95. package/assets/hooks/profile-check.sh +22 -20
  96. package/assets/hooks/proposal-guard.sh +57 -49
  97. package/assets/hooks/prose-style-guard.sh +19 -17
  98. package/assets/hooks/qa-dataid-guard.sh +52 -49
  99. package/assets/hooks/rerun-guard.sh +31 -30
  100. package/assets/hooks/reuse-first-guard.sh +108 -87
  101. package/assets/hooks/roles.sh +14 -14
  102. package/assets/hooks/rule-article.sh +36 -34
  103. package/assets/hooks/rule-source-guard.sh +52 -36
  104. package/assets/hooks/skill-gate-layers.sh +59 -57
  105. package/assets/hooks/skill-gate-rearm.sh +15 -8
  106. package/assets/hooks/skill-gate.sh +89 -81
  107. package/assets/hooks/skill-loaded.sh +6 -6
  108. package/assets/hooks/sql-guard-parse.sh +68 -66
  109. package/assets/hooks/sql-guard-request.sh +48 -46
  110. package/assets/hooks/sql-guard-target.sh +57 -51
  111. package/assets/hooks/sql-guard-write.sh +84 -79
  112. package/assets/hooks/sql-guard.sh +52 -47
  113. package/assets/hooks/stand-login-guard.sh +104 -0
  114. package/assets/hooks/task-context-load.sh +60 -55
  115. package/assets/hooks/task-flow-context.sh +87 -69
  116. package/assets/hooks/task-flow-draft-guard.sh +55 -48
  117. package/assets/hooks/task-flow-guard.sh +67 -64
  118. package/assets/hooks/turn-entry-load.sh +39 -32
  119. package/assets/hooks/turn-exit-guard.sh +256 -204
  120. package/assets/hooks/turn-exit-patterns.sh +53 -0
  121. package/assets/hooks/utf8.sh +11 -11
  122. package/assets/hooks/waiting-turn-guard.sh +94 -94
  123. package/assets/hooks/window-fill-guard.sh +70 -62
  124. package/assets/hooks/work-start-guard.sh +52 -49
  125. package/assets/hooks/write-targets.sh +115 -30
  126. package/assets/laws/autonomous-work.md +29 -27
  127. package/assets/laws/code-structure.md +31 -30
  128. package/assets/laws/delivery.md +148 -137
  129. package/assets/laws/entity-editing.md +52 -50
  130. package/assets/laws/entity-models.md +14 -13
  131. package/assets/laws/frontend-application.md +39 -38
  132. package/assets/laws/lib-imports.md +27 -27
  133. package/assets/laws/lists.md +31 -29
  134. package/assets/laws/navigation.md +37 -37
  135. package/assets/laws/observability.md +41 -40
  136. package/assets/laws/project-documentation.md +106 -99
  137. package/assets/laws/reuse-first.md +31 -29
  138. package/assets/laws/shared-code.md +27 -27
  139. package/assets/laws/verifiability.md +131 -114
  140. package/assets/laws/work-conduct.md +250 -250
  141. package/assets/patterns/admin-lists-screen.md +72 -69
  142. package/assets/patterns/admin-nav-item.md +51 -46
  143. package/assets/patterns/angular-patterns-state.md +32 -31
  144. package/assets/patterns/api-layer-pair.md +33 -31
  145. package/assets/patterns/autonomous-work-run.md +50 -49
  146. package/assets/patterns/browser-verification-measure.md +143 -67
  147. package/assets/patterns/browser-verification-stand.md +181 -128
  148. package/assets/patterns/component-structure-new.md +51 -42
  149. package/assets/patterns/dependencies-upgrade.md +55 -39
  150. package/assets/patterns/doc-style-human.md +93 -0
  151. package/assets/patterns/doc-style-sweep.md +82 -79
  152. package/assets/patterns/doc-style-trace.md +87 -81
  153. package/assets/patterns/doc-style-write.md +130 -122
  154. package/assets/patterns/entity-aside.md +77 -63
  155. package/assets/patterns/entity-models-new.md +37 -37
  156. package/assets/patterns/entity-store.md +33 -33
  157. package/assets/patterns/git-workflow-commit.azure.md +94 -75
  158. package/assets/patterns/git-workflow-commit.github.md +153 -129
  159. package/assets/patterns/git-workflow-commit.gitlab.md +96 -78
  160. package/assets/patterns/git-workflow-docker.md +165 -147
  161. package/assets/patterns/git-workflow-freshness.md +45 -45
  162. package/assets/patterns/git-workflow-merge.md +99 -86
  163. package/assets/patterns/git-workflow-migration.md +54 -52
  164. package/assets/patterns/git-workflow-pr-ready.md +57 -56
  165. package/assets/patterns/git-workflow-pr.azure.md +126 -121
  166. package/assets/patterns/git-workflow-pr.github.md +179 -175
  167. package/assets/patterns/git-workflow-pr.gitlab.md +138 -131
  168. package/assets/patterns/git-workflow-restart.md +35 -31
  169. package/assets/patterns/git-workflow-secrets.md +80 -73
  170. package/assets/patterns/git-workflow-stack.md +131 -106
  171. package/assets/patterns/lib-layers-move.md +62 -53
  172. package/assets/patterns/lib-layers-new.md +59 -45
  173. package/assets/patterns/observability-record.md +72 -67
  174. package/assets/patterns/platform-access-di.md +31 -29
  175. package/assets/patterns/reuse-first-extend.md +66 -61
  176. package/assets/patterns/shared-code-new.md +39 -38
  177. package/assets/patterns/spec-driven-domain.md +161 -151
  178. package/assets/patterns/spec-driven-rule.md +179 -168
  179. package/assets/patterns/spec-driven-sweep.md +41 -39
  180. package/assets/patterns/status-report-table.github.md +37 -36
  181. package/assets/patterns/styling-bem-component.md +42 -42
  182. package/assets/patterns/styling-bem-layout.md +39 -34
  183. package/assets/patterns/styling-bem-sheet.md +59 -58
  184. package/assets/patterns/task-flow-archive.md +222 -215
  185. package/assets/patterns/task-flow-close.md +215 -203
  186. package/assets/patterns/task-flow-handoff.md +154 -145
  187. package/assets/patterns/task-flow-resume.md +138 -133
  188. package/assets/patterns/task-flow-start.md +204 -192
  189. package/assets/patterns/testing-e2e.md +103 -92
  190. package/assets/patterns/testing-unit.md +77 -70
  191. package/assets/patterns/ts-procedure.md +32 -29
  192. package/assets/patterns/turn-entry-map.md +50 -48
  193. package/assets/pitfalls/agent-kit.md +152 -141
  194. package/assets/pitfalls/doc-style.md +96 -91
  195. package/assets/pitfalls/git-workflow.azure.md +49 -46
  196. package/assets/pitfalls/git-workflow.github.md +264 -234
  197. package/assets/pitfalls/git-workflow.gitlab.md +49 -45
  198. package/assets/pitfalls/spec-driven.md +73 -71
  199. package/assets/pitfalls/styling-bem.md +46 -40
  200. package/assets/pitfalls/task-flow.md +262 -246
  201. package/assets/pitfalls/testing.md +99 -92
  202. package/assets/pitfalls/turn-conduct.md +96 -81
  203. package/assets/rules/angular-patterns.md +81 -80
  204. package/assets/rules/api-layer.md +77 -74
  205. package/assets/rules/autonomous-work.md +75 -74
  206. package/assets/rules/browser-verification.md +223 -188
  207. package/assets/rules/component-structure.md +72 -69
  208. package/assets/rules/dependencies.md +74 -67
  209. package/assets/rules/deploy-flow.azure.md +118 -108
  210. package/assets/rules/deploy-flow.github.md +145 -135
  211. package/assets/rules/deploy-flow.gitlab.md +120 -110
  212. package/assets/rules/doc-style.md +209 -148
  213. package/assets/rules/entity-conventions.needs-admin.md +81 -79
  214. package/assets/rules/entity-models.md +73 -70
  215. package/assets/rules/git-workflow.azure.md +224 -228
  216. package/assets/rules/git-workflow.github.md +250 -242
  217. package/assets/rules/git-workflow.gitlab.md +218 -217
  218. package/assets/rules/lib-layers.md +85 -86
  219. package/assets/rules/lists.md +101 -97
  220. package/assets/rules/navigation.md +78 -78
  221. package/assets/rules/observability.needs-app.md +165 -153
  222. package/assets/rules/platform-access.md +76 -75
  223. package/assets/rules/reuse-first.md +153 -137
  224. package/assets/rules/shared-code.md +82 -79
  225. package/assets/rules/spec-driven.md +272 -260
  226. package/assets/rules/status-report.md +55 -58
  227. package/assets/rules/styling-bem.md +83 -72
  228. package/assets/rules/task-flow.md +282 -270
  229. package/assets/rules/testing.md +224 -188
  230. package/assets/rules/turn-conduct.md +255 -258
  231. package/assets/rules/turn-entry.md +92 -87
  232. package/assets/rules/typescript-conventions.md +94 -88
  233. package/assets/samples/specs/_template/spec.md +47 -47
  234. package/assets/samples/tasks/_template/grill.md +20 -20
  235. package/assets/samples/tasks/_template/plan.md +32 -30
  236. package/assets/samples/tasks/_template/progress.md +16 -16
  237. package/assets/skills/agent-kit-extend.md +129 -113
  238. package/assets/skills/agent-kit.md +236 -222
  239. package/assets/skills/write-a-skill.md +76 -71
  240. package/assets/templates/findings.md +19 -19
  241. package/assets/templates/gate-map.sh +16 -14
  242. package/assets/templates/implementation.md +28 -27
  243. package/assets/templates/pattern.md +17 -17
  244. package/assets/templates/pitfalls.md +6 -6
  245. package/assets/templates/postmortem.md +24 -23
  246. package/assets/templates/project.sh +24 -24
  247. package/assets/templates/proposal.md +62 -60
  248. package/assets/templates/rule.md +38 -38
  249. package/assets/workflows/feature.js +46 -46
  250. package/assets/workflows/plan.js +54 -54
  251. package/lib/catalog.d.ts +2 -0
  252. package/lib/catalog.d.ts.map +1 -1
  253. package/lib/catalog.js +4 -3
  254. package/lib/catalog.js.map +1 -1
  255. package/lib/commands.d.ts.map +1 -1
  256. package/lib/commands.js +68 -4
  257. package/lib/commands.js.map +1 -1
  258. package/lib/companion.js +3 -2
  259. package/lib/companion.js.map +1 -1
  260. package/lib/enroll.d.ts +7 -1
  261. package/lib/enroll.d.ts.map +1 -1
  262. package/lib/enroll.js +13 -4
  263. package/lib/enroll.js.map +1 -1
  264. package/lib/observations.d.ts +10 -1
  265. package/lib/observations.d.ts.map +1 -1
  266. package/lib/observations.js +1 -0
  267. package/lib/observations.js.map +1 -1
  268. package/lib/override-marks.d.ts +24 -0
  269. package/lib/override-marks.d.ts.map +1 -0
  270. package/lib/override-marks.js +98 -0
  271. package/lib/override-marks.js.map +1 -0
  272. package/lib/plan.d.ts +11 -0
  273. package/lib/plan.d.ts.map +1 -1
  274. package/lib/plan.js +10 -1
  275. package/lib/plan.js.map +1 -1
  276. package/lib/ship.d.ts +0 -7
  277. package/lib/ship.d.ts.map +1 -1
  278. package/lib/ship.js +10 -2
  279. package/lib/ship.js.map +1 -1
  280. package/lib/shipment.d.ts.map +1 -1
  281. package/lib/shipment.js +7 -3
  282. package/lib/shipment.js.map +1 -1
  283. package/lib/sync.d.ts.map +1 -1
  284. package/lib/sync.js +45 -11
  285. package/lib/sync.js.map +1 -1
  286. package/package.json +1 -1
  287. package/rt-tools-agent-kit-0.26.0.tgz +0 -0
  288. package/rt-tools-agent-kit-0.23.0.tgz +0 -0
@@ -1,32 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Сверка очереди работ с тем, что закон о поставке требует от задачи и её PR.
3
+ * Audit of the work queue against what the delivery law requires of a task and its PR.
4
4
  *
5
- * Гард поставки отбивает промах в момент, когда его совершают, но действует только
6
- * на команды агента: тикет, заведённый мимо него, и PR, открытый руками, он не
7
- * видит. Эта сверка отвечает на другой вопрос — «а вся ли очередь в порядке
8
- * сейчас», — и потому смотрит на состояние, а не на команду.
5
+ * The delivery guard refuses a miss at the moment it is made, but it acts only on the agent's
6
+ * commands: a task created past it and a PR opened by hand it does not see. This audit answers
7
+ * a different question — "is the whole queue in order right now" — and so it looks at the state,
8
+ * not at the command.
9
9
  *
10
- * Судит только открытое. Закрытые задачи и влитые PR — это история: из сорока
11
- * последних влитых PR тридцать шесть пришли с веток, за которыми задачи не стояло,
12
- * и красная навсегда проверка ничем не отличалась бы от её отсутствия.
10
+ * It judges only what is open. Closed tasks and merged PRs are history: of the last forty merged
11
+ * PRs, thirty-six came from branches with no task behind them, and a check that is red forever
12
+ * would be no different from no check at all.
13
13
  *
14
- * Имя ветки не судит. У открытого PR его не переименовать — это новая ветка и новый
15
- * PR, — а проверка, требующая невыполнимого, обходится, а не исполняется. Имя ветки
16
- * стережёт гард в момент `git checkout -b` и `gh pr create`.
14
+ * It does not judge the branch name. An open PR cannot have its branch renamed — that is a new
15
+ * branch and a new PR — and a check that demands the impossible gets bypassed, not carried out.
16
+ * The branch name is watched by the guard at the moment of `git checkout -b` and `gh pr create`.
17
17
  *
18
- * Колонку задачи судит по её PR: открытый PR означает разбор, отсутствие — нет.
19
- * Момент, когда задачу берут в работу, отсюда не виден вовсе — ветки на борде нет, —
20
- * и «In progress» здесь не требуется ни от кого.
18
+ * The task's column is judged by its PR: an open PR means review, none means no review. The
19
+ * moment a task is taken into work is not visible from here at all — the board has no branch —
20
+ * and "In progress" is required of nobody here.
21
21
  *
22
- * Прогон на вершине спрашивает тоже она: страница PR без прогона выглядит так же, как
23
- * страница с зелёным, — цвета у неё нет ни там, ни там, — и вершина, за которой прогон
24
- * не встал, узнаётся только тем, что кто-то открыл список прогонов руками.
22
+ * The run on the head is asked by this audit too: a PR page without a run looks the same as a
23
+ * page with a green one — it has no colour in either case — and a head with no run behind it is
24
+ * found only when someone opens the list of runs by hand.
25
25
  *
26
- * Нет сети или нет токена — код возврата ноль: проверка, падающая в самолёте,
27
- * перестаёт что-либо значить.
26
+ * No network or no token — exit code zero: a check that fails on a plane stops meaning anything.
28
27
  *
29
- * Ненулевой код возврата и перечень расхождений.
28
+ * A non-zero exit code and the list of discrepancies.
30
29
  */
31
30
  import { existsSync, readFileSync, statSync } from 'node:fs';
32
31
  import { join } from 'node:path';
@@ -50,6 +49,7 @@ import {
50
49
  taskDirs,
51
50
  } from './board.mjs';
52
51
  import { onlyIgnoredPaths } from './board-paths.mjs';
52
+ import { checkBranchFolders } from './board-folders.mjs';
53
53
  import { checkLongWork } from './board-long-work.mjs';
54
54
  import { HAS_PIPELINE, deployLag, evictedOnHead, headCommittedAt, lastDeploy, runsOnHead, verdictOnHead } from './board-runs.mjs';
55
55
  import { checkEpicLinks } from './board-epics.mjs';
@@ -58,30 +58,31 @@ import { CONFIG, ROOT } from './rt-kit-checks.config.mjs';
58
58
 
59
59
  const IN_REVIEW = STATUS_OPTIONS[IN_REVIEW_STATUS].name;
60
60
  const TASKS_DIR = join(ROOT, CONFIG.tasksDir);
61
- /** Возраст брошенного черновика, после которого он перестаёт выглядеть начатым сегодня. */
61
+ /** Age of an abandoned draft after which it stops looking like one started today. */
62
62
  const DRAFT_DAYS = 7;
63
63
  /**
64
- * Сколько времени вершине даётся на то, чтобы прогон за ней встал. Событие доходит до хостинга
65
- * не мгновенно, и сверка, позванная сразу после пуша, иначе краснела бы на здоровой ветке.
64
+ * How long a head is given for a run to start behind it. The event does not reach the hosting
65
+ * instantly, and an audit called right after a push would otherwise go red on a healthy branch.
66
66
  */
67
67
  const RUN_GRACE_MINUTES = 10;
68
68
  /**
69
- * Конвейер дерева. Прогоны спрашиваются только там, где ему есть откуда взяться: дерево без
70
- * конвейера получило бы строку на каждый открытый PR, и не о чём.
69
+ * The tree's pipeline. Runs are asked for only where they have somewhere to come from: a tree
70
+ * without a pipeline would get a line for every open PR, and about nothing.
71
71
  */
72
72
  /**
73
- * Рабочий поток выкатки и ветка, с которой прод сравнивают. Не назвав потока, дерево сверки
74
- * прода не получает — и сверка говорит об этом вслух: молчание читалось бы как «прод сошёлся».
73
+ * The rollout workflow and the branch production is compared with. A tree that names no workflow
74
+ * gets no production audit — and the audit says so out loud: silence would read as "production
75
+ * matches".
75
76
  */
76
77
  /**
77
- * Метки, которыми в очереди работ помечен груз — присланные деревьями разборы происшествий и
78
- * предложения. Задачами они не являются: заголовок у них без номера, исполнителя нет, на борде
79
- * их нет, — и сверка печатала на каждую по три строки, среди которых настоящее расхождение уже
80
- * не читалось. Заводить такие записи в очередь перестали, а заведённые прежним порядком оттуда
81
- * никуда не денутся: закрывать их — решение владельца, а не сверки.
78
+ * Labels that mark cargo in the work queue — incident analyses and proposals sent by trees. They
79
+ * are not tasks: their title has no number, they have no executor, they are not on the board — and
80
+ * the audit printed three lines for each, among which a real discrepancy could no longer be read.
81
+ * Such records are no longer created in the queue, and those created the old way are not going
82
+ * anywhere: closing them is the owner's decision, not the audit's.
82
83
  *
83
- * Имя метки называет дерево: у каждого оно своё, а выдуманное умолчание не совпало бы ни с чем
84
- * и молча выключило бы отсев. Дерево, метки не назвавшее, судится как прежде.
84
+ * The label name names the tree: each has its own, and an invented default would match nothing
85
+ * and silently switch the filtering off. A tree that names no label is judged as before.
85
86
  */
86
87
  const CARGO_LABELS = new Set(CONFIG.board?.cargoLabels ?? []);
87
88
 
@@ -92,10 +93,10 @@ const problems = [];
92
93
  const report = (message) => problems.push(message);
93
94
 
94
95
  /**
95
- * Разбор просьбы владельца идёт до заведения задачи и лежит в `_draft-<slug>`. Заглохший на
96
- * середине, он остаётся на диске вне истории и выглядит так же, как начатый сегодня: второй
97
- * заход берётся за то же самое заново. Возраст здесь — единственный доступный признак:
98
- * задачи за черновиком ещё нет, и спросить о нём некого.
96
+ * The grill of the owner's request goes before the task is created and lives in `_draft-<slug>`.
97
+ * Abandoned halfway, it stays on disk outside history and looks the same as one started today:
98
+ * the second session takes up the same thing anew. Age is the only sign available here: there is
99
+ * no task behind the draft yet, and nobody to ask about it.
99
100
  */
100
101
  function checkDrafts() {
101
102
  const now = Date.now();
@@ -105,34 +106,35 @@ function checkDrafts() {
105
106
  }
106
107
  const age = Math.floor((now - statSync(join(TASKS_DIR, name)).mtimeMs) / 86400000);
107
108
  if (age >= DRAFT_DAYS) {
108
- report(`${CONFIG.tasksDir}/${name}/: разбор брошен ${age} дн. назад — заведи задачу или удали папку`);
109
+ report(`${CONFIG.tasksDir}/${name}/: the grill was abandoned ${age} days ago — create the task or delete the folder`);
109
110
  }
110
111
  }
111
112
  }
112
113
 
113
114
  /**
114
- * Значимые слова заголовка: ключ задачи и короткие служебные слова выброшены.
115
+ * The meaningful words of a title: the task key and short function words are thrown out.
115
116
  *
116
- * Разбор нарочно грубый — совпадение слов здесь не приговор, а повод посмотреть: точное
117
- * сравнение заголовков не находит ничего, потому что дубль пишут другими словами.
117
+ * The parsing is deliberately rough — a match of words here is not a verdict but a reason to
118
+ * look: exact comparison of titles finds nothing, because a duplicate is written in other words.
118
119
  */
119
120
  function closesNumbers(body) {
120
121
  return [...String(body ?? '').matchAll(/\bCloses\s+#(\d+)\b/gi)].map((match) => Number(match[1]));
121
122
  }
122
123
 
123
124
  /**
124
- * Строка обхода в теле PR. Форма та же, что читает гард поставки: строку она начинает и
125
- * подстановки не принимает — иначе текст, называющий эту строку, снимает требование сам собой.
125
+ * The bypass line in the PR body. The form is the same one the delivery guard reads: it starts
126
+ * the line and accepts no placeholders — otherwise a text that names this line would lift the
127
+ * requirement by itself.
126
128
  */
127
129
  const FOLDER_SKIP = /^[ \t]*Task-folder-skip:[ \t]*[^\s<"'][^\s"']{2,}/im;
128
130
 
129
131
  /**
130
- * Везёт ли ветка PR папку своей задачи.
132
+ * Whether the PR branch carries its task folder.
131
133
  *
132
- * Спрашивается ветка, а не рабочее дерево: папка, снесённая на машине и не закоммиченная,
133
- * въедет вместе с веткой. Локальных ссылок тут мало — ветка PR может быть не подтянута
134
- * сюда вовсе, — поэтому содержимое берётся у хостинга. Отказ «нет такого пути» означает, что
135
- * папки нет; всё остальное поднимается выше и разбирается как отсутствие связи.
134
+ * The branch is asked, not the working tree: a folder removed on the machine and not committed
135
+ * arrives together with the branch. Local references are of little use here — the PR branch may
136
+ * not be fetched here at all — so the contents are taken from the hosting. The refusal "no such
137
+ * path" means there is no folder; everything else goes up and is treated as no connection.
136
138
  */
137
139
  function folderInBranch(branch, options) {
138
140
  const path = `${CONFIG.tasksDir}/${branch}`;
@@ -149,23 +151,23 @@ function folderInBranch(branch, options) {
149
151
  }
150
152
 
151
153
  /**
152
- * Прогон на вершине открытого PR.
154
+ * The run on the head of an open PR.
153
155
  *
154
- * Молчание страницы и зелёный прогон читаются одинаково, а событие до хостинга доходит не
155
- * всегда: в час его отказов пуш прошёл, а прогона за ним не встало. Сверка называет такую
156
- * вершину, пока PR ещё открыт, — после слияния об этом узнавать поздно.
156
+ * A silent page and a green run read the same, and the event does not always reach the hosting:
157
+ * in the hour of its failures the push went through and no run started behind it. The audit names
158
+ * such a head while the PR is still open — after the merge it is too late to learn about it.
157
159
  *
158
- * Считается сам факт прогона, а не его цвет. Идущий и упавший прогон видны на странице PR оба;
159
- * невидимо только отсутствие, и говорит сверка ровно о нём.
160
+ * What counts is the fact of a run, not its colour. A running and a failed run are both visible
161
+ * on the PR page; only absence is invisible, and the audit speaks of exactly that.
160
162
  *
161
- * Свежая вершина не судится: между пушем и прогоном проходит время, и красная строка на этом
162
- * промежутке значила бы «подожди», а не «чини».
163
+ * A fresh head is not judged: time passes between the push and the run, and a red line in that
164
+ * gap would mean "wait", not "fix".
163
165
  *
164
- * У конфликтующей заявки прогона не бывает вовсе, и причина не в потерянном событии: конвейер
165
- * проверяет слияние ветки с базой, а слияния при конфликте нет. Совет вернуть событие
166
- * выполняется буквально и не помогает — за один заход заявка перезакрывалась дважды подряд, и
167
- * прогон встал только после вливания главной ветки. Строка поэтому называет ту причину, которая
168
- * чинится.
166
+ * A conflicting PR gets no run at all, and the cause is not a lost event: the pipeline checks the
167
+ * merge of the branch with its base, and under a conflict there is no merge. The advice to bring
168
+ * the event back is followed literally and does not help — in one session a PR was closed and
169
+ * reopened twice in a row, and the run started only after the main branch was merged in. So the
170
+ * line names the cause that can be fixed.
169
171
  */
170
172
  function checkHeadRun(pull, options) {
171
173
  if (checkEvicted(pull, options)) {
@@ -188,35 +190,52 @@ function checkHeadRun(pull, options) {
188
190
 
189
191
  if (pull.mergeable === 'CONFLICTING') {
190
192
  report(
191
- `PR #${pull.number}: на вершине ${pull.headRefOid.slice(0, 8)} прогона нет и не будет, пока она конфликтует — ` +
192
- `конвейер проверяет слияние ветки с базой, а слияния при конфликте нет; влей главную ветку и запушь, ` +
193
- `перезакрытие PR тут не помогает`
193
+ `PR #${pull.number}: there is no run on the tip ${pull.headRefOid.slice(0, 8)} and there will be none while it conflicts — ` +
194
+ `the pipeline checks the merge of the branch with the base, and there is no merge while it conflicts; merge the main branch in and push, ` +
195
+ `reopening the PR does not help here`
196
+ );
197
+
198
+ return;
199
+ }
200
+
201
+ // A PR on top of a neighbouring one gets no run: the workflow listens for PRs into the main
202
+ // branch and does not see events with another base. The line about a lost event is wrong
203
+ // here twice: the event was not lost, and closing and reopening will not bring it back — the
204
+ // advice is followed literally, no run starts, and on the second try the breakage is looked
205
+ // for in the hosting.
206
+ if (pull.baseRefName && pull.baseRefName !== MAIN_BRANCH) {
207
+ report(
208
+ `PR #${pull.number}: there is no run on the tip ${pull.headRefOid.slice(0, 8)} and there will be none — ` +
209
+ `the request is opened into the branch «${pull.baseRefName}», and the workflow listens to requests into the main one; ` +
210
+ `move the base to «${MAIN_BRANCH}» once the lower request is merged`
194
211
  );
195
212
 
196
213
  return;
197
214
  }
198
215
 
199
216
  report(
200
- `PR #${pull.number}: на вершине ${pull.headRefOid.slice(0, 8)} прогона нет, а лежит она ${minutes} мин — ` +
201
- `конвейер события не получил; верни его новым коммитом либо перезакрытием PR ` +
217
+ `PR #${pull.number}: there is no run on the tip ${pull.headRefOid.slice(0, 8)}, and it has lain there ${minutes} min — ` +
218
+ `the pipeline received no event; bring it back by a new commit or by reopening the PR ` +
202
219
  `(gh pr close ${pull.number} && gh pr reopen ${pull.number})`
203
220
  );
204
221
  }
205
222
 
206
223
  /**
207
- * Прогон вершины, вытесненный из очереди конвейера.
224
+ * A head run evicted from the pipeline queue.
208
225
  *
209
- * Группа очереди бережёт идущий прогон и не бережёт ждущего: хостинг держит в группе один
210
- * ждущий, и следующий встающий вытесняет прежний. Ветка за таким прогоном не проверялась ни
211
- * строчкой, а по очереди работ выглядит проверенной — прогон на вершине есть, и сверка считает
212
- * именно факт.
226
+ * The queue group protects a running run and does not protect a waiting one: the hosting keeps
227
+ * one waiting run per group, and the next one to start evicts the previous. The branch behind
228
+ * such a run was not checked by a single line, yet by the work queue it looks checked — there is
229
+ * a run on the head, and the audit counts exactly the fact.
213
230
  *
214
- * Судится раньше отсутствия прогона и раньше цвета: иначе одна вершина получает две строки об
215
- * одном. Отвечает `true`, когда строка сказана, и остальные проверки вершины пропускаются.
231
+ * Judged before the absence of a run and before the colour: otherwise one head gets two lines
232
+ * about one thing. Returns `true` when the line has been said, and the other head checks are
233
+ * skipped.
216
234
  *
217
- * Строка называет обе команды и в том порядке, в каком их зовут. Перезапуск отбивает гард, пока
218
- * за тот же ход не читался журнал этого задания, и порядок в строке выполняет требование сам:
219
- * исполнитель зовёт написанное и не упирается в отказ на втором шаге.
235
+ * The line names both commands, in the order they are called. The guard refuses a rerun until the
236
+ * output of that step has been read within the same turn, and the order in the line meets the
237
+ * requirement by itself: the executor calls what is written and does not hit a refusal on the
238
+ * second step.
220
239
  */
221
240
  function checkEvicted(pull, options) {
222
241
  const evicted = evictedOnHead(pull.headRefOid, options);
@@ -226,23 +245,23 @@ function checkEvicted(pull, options) {
226
245
 
227
246
  const run = evicted[0];
228
247
  report(
229
- `PR #${pull.number}: прогон ${run} на вершине ${pull.headRefOid.slice(0, 8)} вытеснен из очереди конвейера — ` +
230
- `заданий у него ноль, ветка не проверялась, а в списке он выглядит упавшим; ` +
231
- `прочитай прогон и перезапусти его (gh run view ${run} && gh run rerun ${run})`
248
+ `PR #${pull.number}: the run ${run} on the tip ${pull.headRefOid.slice(0, 8)} was pushed out of the pipeline queue — ` +
249
+ `it has zero steps, the branch was not checked, and in the list it looks failed; ` +
250
+ `read the run and restart it (gh run view ${run} && gh run rerun ${run})`
232
251
  );
233
252
  return true;
234
253
  }
235
254
 
236
255
  /**
237
- * Готовая работа, оставленная черновиком.
256
+ * Finished work left as a draft.
238
257
  *
239
- * У черновика кнопка слияния заблокирована самим хостингом, поэтому зелёная страница PR
240
- * владельцу ничего не разрешает: список, в котором всё серое, читается как «работа не сделана».
241
- * Гард снятия черновика сюда не достаёт — он судит один ход и молчит, пока ветка везёт папку
242
- * своей задачи; сверка же смотрит на состояние очереди целиком.
258
+ * On a draft the merge button is blocked by the hosting itself, so a green PR page allows the
259
+ * owner nothing: a list in which everything is grey reads as "the work is not done". The
260
+ * draft-lifting guard does not reach here — it judges one turn and stays silent while the branch
261
+ * carries its task folder; the audit looks at the state of the whole queue.
243
262
  *
244
- * Четыре PR так и простояли черновиками двое суток — разбор
245
- * запись «2026-08-18-ready-work-left-in-drafts» в приёме.
263
+ * Four PRs stood as drafts for two days — the analysis is the record
264
+ * "2026-08-18-ready-work-left-in-drafts" in the intake.
246
265
  */
247
266
  function checkReadyDraft(pull, options) {
248
267
  if (pull.isDraft !== true) {
@@ -253,21 +272,23 @@ function checkReadyDraft(pull, options) {
253
272
  }
254
273
 
255
274
  report(
256
- `PR #${pull.number}: прогон на вершине ${pull.headRefOid.slice(0, 8)} зелёный, а PR черновик — ` +
257
- `разбери папку задачи и сними черновик (gh pr ready ${pull.number}) либо скажи владельцу, чего ждёшь`
275
+ `PR #${pull.number}: the run on the tip ${pull.headRefOid.slice(0, 8)} is green, and the PR is a draft — ` +
276
+ `take the task folder apart and lift the draft (gh pr ready ${pull.number}) or tell the owner what you are waiting for`
258
277
  );
259
278
  }
260
279
 
261
280
  /**
262
- * Заявка, конфликтующая с главной веткой.
281
+ * A PR that conflicts with the main branch.
263
282
  *
264
- * Конфликт приезжает в отданную заявку чужим слиянием, без единого действия её автора: основание,
265
- * проверенное на открытии, устаревает в ту минуту, когда владелец влил соседнюю работу. Гард
266
- * снятия черновика сюда не достаёт — он судит один ход, а заявка стоит в очереди днями.
283
+ * A conflict arrives in a handed-over PR through someone else's merge, without a single action by
284
+ * its author: the base checked at opening goes stale the minute the owner merges a neighbouring
285
+ * piece of work. The draft-lifting guard does not reach here — it judges one turn, and a PR stands
286
+ * in the queue for days.
267
287
  *
268
- * Судится только прямое «конфликтует»: `UNKNOWN` означает, что хостинг сливаемость ещё считает,
269
- * и строка о нём краснела бы на каждой свежей вершине. Две заявки так и ушли в разбор с
270
- * конфликтом — разбор запись «2026-08-20-drafts-cleared-without-re-reading-pr-state» в приёме.
288
+ * Only a direct "conflicting" is judged: `UNKNOWN` means the hosting is still computing
289
+ * mergeability, and a line about it would go red on every fresh head. Two PRs went to review with
290
+ * a conflict this way — the analysis is the record
291
+ * "2026-08-20-drafts-cleared-without-re-reading-pr-state" in the intake.
271
292
  */
272
293
  function checkConflicting(pull) {
273
294
  if (pull.mergeable !== 'CONFLICTING') {
@@ -275,15 +296,16 @@ function checkConflicting(pull) {
275
296
  }
276
297
 
277
298
  report(
278
- `PR #${pull.number}: конфликтует с главной веткой — влей её в ветку задачи, разбери конфликт и запушь; ` +
279
- `слить эту заявку владелец не может, а по странице это видно только внутри неё`
299
+ `PR #${pull.number}: it conflicts with the main branch — merge it into the task branch, resolve the conflict and push; ` +
300
+ `the owner cannot merge this request, and on the page that shows only inside it`
280
301
  );
281
302
  }
282
303
 
283
304
  let checked = { issues: 0, pulls: 0, cargo: 0 };
284
305
 
285
- // Черновики судятся по диску и потому проверяются всегда: связи для этого не нужно.
306
+ // Drafts are judged by the disk and so are checked always: no connection is needed for that.
286
307
  checkDrafts();
308
+ checkBranchFolders(report, MAIN_BRANCH);
287
309
 
288
310
  let offline = false;
289
311
  try {
@@ -291,28 +313,28 @@ try {
291
313
  const board = fetchBoard(options);
292
314
  const issues = fetchIssues('all', options);
293
315
  const allOpen = issues.filter((issue) => issue.state === 'OPEN');
294
- // Отсев идёт один раз и до всех проверок задачи: помеченная запись не задача целиком, а не
295
- // наполовину, — её не судят ни заголовком, ни исполнителем, ни бордой, ни сводкой совпавших
296
- // заголовков, ни связью с эпиком.
316
+ // Filtering happens once and before all task checks: a labelled record is not a task as a
317
+ // whole, not by half — it is judged neither by title, nor by executor, nor by the board, nor
318
+ // by the digest of matching titles, nor by the link to an epic.
297
319
  const open = CARGO_LABELS.size === 0 ? allOpen : allOpen.filter((issue) => !(issue.labels ?? []).some((label) => CARGO_LABELS.has(label.name)));
298
320
  const pulls = fetchOpenPulls(options);
299
321
  checked = { issues: issues.length, pulls: pulls.length, cargo: allOpen.length - open.length };
300
322
 
301
323
  for (const item of board.foreign) {
302
- report(`борда: ${item} — на борде стоят задачи, а не PR о них`);
324
+ report(`the board: ${item} — the board holds tasks, not PRs about them`);
303
325
  }
304
- // Борду проверяем только у открытых задач. Закрытая ушла из очереди мержем, и колонки под
305
- // неё у борды нет: строку о ней нечем закрыть. Шесть таких строк висели в каждом прогоне и
306
- // заглушали собой настоящую задачу, которая на борду не попала.
326
+ // The board is checked only for open tasks. A closed one left the queue by a merge, and the
327
+ // board has no column for it: a line about it has nothing to close it with. Six such lines
328
+ // hung in every run and drowned out the real task that never made it to the board.
307
329
  for (const issue of open) {
308
330
  if (!board.issues.has(issue.number)) {
309
- report(`#${issue.number}: задачи нет на борде — за ней никто не следит`);
331
+ report(`#${issue.number}: the task is not on the board — nobody watches it`);
310
332
  }
311
333
  if (numberFromTitle(issue.title) !== issue.number) {
312
- report(`#${issue.number}: заголовок не начинается с [${TASK_KEY}-${issue.number}] — «${issue.title}»`);
334
+ report(`#${issue.number}: the title does not start with [${TASK_KEY}-${issue.number}] — «${issue.title}»`);
313
335
  }
314
336
  if (issue.assignees.length === 0) {
315
- report(`#${issue.number}: у задачи нет исполнителя — по очереди работ не видно, кто её взял`);
337
+ report(`#${issue.number}: the task has no assignee — by the work queue there is no seeing who took it`);
316
338
  }
317
339
  }
318
340
 
@@ -325,40 +347,40 @@ try {
325
347
  for (const pull of pulls) {
326
348
  const titleNumber = numberFromTitle(pull.title);
327
349
  if (titleNumber === null) {
328
- report(`PR #${pull.number}: заголовок не начинается с [${TASK_KEY}-<номер>] — «${pull.title}»`);
350
+ report(`PR #${pull.number}: the title does not start with [${TASK_KEY}-<number>] — «${pull.title}»`);
329
351
  continue;
330
352
  }
331
353
  if (!closesNumbers(pull.body).includes(titleNumber)) {
332
- report(`PR #${pull.number}: в теле нет строки «Closes #${titleNumber}» — на борде он не прикрепится к задаче`);
354
+ report(`PR #${pull.number}: the body carries no line «Closes #${titleNumber}» — on the board it will not attach to the task`);
333
355
  }
334
356
  if (!openNumbers.has(titleNumber)) {
335
- report(`PR #${pull.number}: задачи #${titleNumber} нет среди открытых — у задачи одна ветка`);
357
+ report(`PR #${pull.number}: the task #${titleNumber} is not among the open ones — a task has one branch`);
336
358
  }
337
359
  if (claimed.has(titleNumber)) {
338
- report(`PR #${pull.number}: задачу #${titleNumber} уже закрывает PR #${claimed.get(titleNumber)} — у задачи одна ветка`);
360
+ report(`PR #${pull.number}: the task #${titleNumber} is already closed by PR #${claimed.get(titleNumber)} — a task has one branch`);
339
361
  } else {
340
362
  claimed.set(titleNumber, pull.number);
341
363
  }
342
364
 
343
- // Папка задачи, лежащая в ветке открытого PR, — расхождение с первой минуты заявки:
344
- // уборка стоит до её открытия, и открытие с лежащей папкой отбивает гард поставки.
345
- // Дошедшая сюда папка означает обход — либо заявку, открытую мимо гарда. Сказанная
346
- // после слияния, эта строка уже не чинится тем же PR: работа перешла дальше, и на
347
- // разбор заводится вторая задача.
365
+ // A task folder lying in the branch of an open PR is a discrepancy from the PR's first
366
+ // minute: the clean-up comes before it opens, and opening with the folder in place is
367
+ // refused by the delivery guard. A folder that got this far means a bypass — or a PR
368
+ // opened past the guard. Said after the merge, this line is no longer fixed by the same
369
+ // PR: the work has moved on, and a second task is created for the clean-up.
348
370
  if (HAS_PIPELINE && pull.headRefOid) {
349
371
  checkHeadRun(pull, options);
350
372
  }
351
373
 
352
374
  checkConflicting(pull);
353
375
 
354
- // Отставание заявки от главной ветки: гард судит основание один раз, в минуту открытия,
355
- // а заявка стоит днями. Влитая с отставанием, она везёт в главную сочетание, которого не
356
- // проверял никто, — и по странице заявки этого не видно: прогон на ней зелёный.
376
+ // The PR falling behind the main branch: the guard judges the base once, at the minute of
377
+ // opening, and a PR stands for days. Merged while behind, it carries into main a
378
+ // combination nobody checked — and the PR page does not show this: the run on it is green.
357
379
  const behind = behindMain(pull.headRefName, MAIN_BRANCH, options);
358
380
  if (behind > 0) {
359
381
  report(
360
- `PR #${pull.number}: ветка отстала от «${MAIN_BRANCH}» на ${behind} коммитов — прогон шёл от основания, ` +
361
- `которого в главной ветке уже нет. Влей главную, пересмотри набор проверок по тому, что ветка везёт теперь, и прогони заново`
382
+ `PR #${pull.number}: the branch lags «${MAIN_BRANCH}» by ${behind} commits — the run went from a base ` +
383
+ `the main branch no longer carries. Merge the main branch in, revise the check set by what the branch carries now, and run again`
362
384
  );
363
385
  }
364
386
 
@@ -366,45 +388,45 @@ try {
366
388
  const folder = folderInBranch(pull.headRefName, options);
367
389
  if (folder !== null) {
368
390
  report(
369
- `PR #${pull.number}: ветка везёт папку задачи «${folder}/» — заявка открывается после уборки. Разбери её этим же PR или поставь в тело строку «Task-folder-skip: <причина>»`
391
+ `PR #${pull.number}: the branch carries the task folder «${folder}/» — the request opens after the folder is taken apart. Take it apart by this same PR or put the line «Task-folder-skip: <reason>» into the body`
370
392
  );
371
393
  }
372
394
  }
373
395
  }
374
396
 
375
- // Колонка задачи и её PR сверяются в обе стороны: открытый PR при задаче в «Backlog»
376
- // читается как работа, к которой не приступали, а «In review» без открытого PR — как
377
- // разбор, которого никто не ждёт.
397
+ // The task's column and its PR are audited both ways: an open PR with the task in "Backlog"
398
+ // reads as work not yet started, and "In review" without an open PR as a review nobody is
399
+ // waiting for.
378
400
  for (const issue of open) {
379
401
  const status = board.items.get(issue.number)?.status ?? null;
380
402
  const pull = claimed.get(issue.number);
381
403
  if (pull !== undefined && status !== IN_REVIEW) {
382
404
  report(
383
- `#${issue.number}: PR #${pull} открыт, а задача стоит «${status ?? 'вне колонок'}» — npm run task:move -- ${issue.number} ${IN_REVIEW_STATUS}`
405
+ `#${issue.number}: PR #${pull} is open, and the task stands at «${status ?? 'outside the columns'}» — npm run task:move -- ${issue.number} ${IN_REVIEW_STATUS}`
384
406
  );
385
407
  }
386
408
  if (pull === undefined && status === IN_REVIEW) {
387
- report(`#${issue.number}: задача ждёт разбора, но открытого PR за ней нет — колонка отстала от работы`);
409
+ report(`#${issue.number}: the task awaits review, and there is no open PR behind it — the column lags the work`);
388
410
  }
389
411
  }
390
412
 
391
- // Папка задачи умирает вместе с задачей: то, что объясняет состоявшееся решение, уезжает
392
- // в `docs/archive/`, остальное удаляется. Оставленная рядом с текущими, она читается как
393
- // текущая — тем убедительнее, чем старше.
413
+ // The task folder dies with the task: what explains a settled decision moves to
414
+ // `docs/archive/`, the rest is deleted. Left next to the current ones, it reads as current —
415
+ // the more convincingly, the older it is.
394
416
  for (const name of taskDirs()) {
395
417
  const number = numberFromTaskDir(name.split('/').pop());
396
418
  if (number === null || openNumbers.has(number)) {
397
419
  continue;
398
420
  }
399
421
  if (issues.some((issue) => issue.number === number)) {
400
- report(`${CONFIG.tasksDir}/${name}/: задача #${number} закрыта, а папка лежит среди текущих — разбери её`);
422
+ report(`${CONFIG.tasksDir}/${name}/: the task #${number} is closed, and the folder lies among the current ones — take it apart`);
401
423
  }
402
424
  }
403
425
  } catch (error) {
404
426
  if (error instanceof OfflineError) {
405
- // Очередь работ без связи не проверить, а папки на диске — проверить: молчать про
406
- // них значило бы терять единственное, что здесь ещё можно сказать.
407
- console.log(`check-board: очередь работ пропущена, проверять нечем — ${error.message}`);
427
+ // The work queue cannot be checked without a connection, but the folders on disk can:
428
+ // staying silent about them would mean losing the only thing that can still be said here.
429
+ console.log(`check-board: the work queue is skipped, there is nothing to check with — ${error.message}`);
408
430
  offline = true;
409
431
  } else {
410
432
  console.error(`check-board: ${String(error.message ?? error)}`);
@@ -412,60 +434,60 @@ try {
412
434
  }
413
435
  }
414
436
 
415
- // Прод сверяется с главной веткой по последней успешной выкатке. Задача уходит из очереди
416
- // слиянием, но слияние — ещё не прод: там, где выкатку запускают рукой, между ними может лечь
417
- // сколько угодно коммитов, и заметить это неоткуда.
437
+ // Production is audited against the main branch by the last successful rollout. A task leaves the
438
+ // queue by a merge, but a merge is not yet production: where the rollout is started by hand, any
439
+ // number of commits may lie between them, and there is nowhere to notice this from.
418
440
  if (!offline && DEPLOY_WORKFLOW) {
419
441
  try {
420
442
  const token = botToken() ?? undefined;
421
443
  const lag = deployLag(DEPLOY_WORKFLOW, MAIN_BRANCH, { token });
422
444
  if (lag === null) {
423
- report(`выкаток по «${DEPLOY_WORKFLOW}» не было ни одной — сравнить прод не с чем`);
445
+ report(`there was not a single rollout by «${DEPLOY_WORKFLOW}» — there is nothing to compare production against`);
424
446
  } else if (lag.behind > 0) {
425
447
  report(
426
- `прод отстал от «${MAIN_BRANCH}» на ${lag.behind} коммитов: последняя выкатка — ${lag.sha.slice(0, 8)} от ${String(lag.at).slice(0, 10)}`
448
+ `production lags «${MAIN_BRANCH}» by ${lag.behind} commits: the last rollout is ${lag.sha.slice(0, 8)} of ${String(lag.at).slice(0, 10)}`
427
449
  );
428
450
  }
429
451
 
430
- // Отчего прод отстал, отставание не говорит: оно считается по последней УСПЕШНОЙ
431
- // выкатке, и «не запускали» с «упала» выглядят через него одинаково. Ведут они к
432
- // разному — первую запускают, вторую читают журналом и чинят.
452
+ // Why production fell behind, the lag does not say: it is counted by the last SUCCESSFUL
453
+ // rollout, and "not started" and "failed" look the same through it. They lead to different
454
+ // things — the first is started, the second is read by its output and fixed.
433
455
  const deploy = lastDeploy(DEPLOY_WORKFLOW, { token });
434
456
  if (deploy.verdict === 'failure') {
435
457
  report(
436
- `выкатка «${DEPLOY_WORKFLOW}» упала на ${String(deploy.sha).slice(0, 8)} от ${String(deploy.at).slice(0, 10)}: ` +
437
- `главная ветка впереди прода, и слияния поверх уедут туда же — ${deploy.url}`
458
+ `the rollout «${DEPLOY_WORKFLOW}» failed on ${String(deploy.sha).slice(0, 8)} of ${String(deploy.at).slice(0, 10)}: ` +
459
+ `the main branch is ahead of production, and merges on top will travel the same way — ${deploy.url}`
438
460
  );
439
461
  }
440
462
  } catch (error) {
441
463
  if (error instanceof OfflineError) {
442
- console.log(`check-board: прод не сверялся — ${error.message}`);
464
+ console.log(`check-board: production was not checked — ${error.message}`);
443
465
  } else {
444
466
  throw error;
445
467
  }
446
468
  }
447
469
  }
448
470
 
449
- // Непроверенное называется вслух: молчание о прогонах читалось бы как «прогоны на месте».
471
+ // What was not checked is named out loud: silence about runs would read as "the runs are there".
450
472
  if (!offline && !DEPLOY_WORKFLOW) {
451
- console.log('check-board: прод с главной веткой не сверялся — рабочий поток выкатки в настройке дерева не назван');
473
+ console.log('check-board: production was not checked against the main branch — the rollout workflow is not named in the tree config');
452
474
  }
453
475
 
454
- // Отсеянное называется числом: молчаливый отсев неотличим от сломанной сверки — метка,
455
- // названная с опечаткой, выключила бы проверку целиком и не сказала бы об этом.
476
+ // What was filtered out is named by number: silent filtering is indistinguishable from a broken
477
+ // audit — a label named with a typo would switch the check off entirely and say nothing about it.
456
478
  if (!offline && checked.cargo > 0) {
457
- console.log(`check-board: записей груза в очереди ${checked.cargo} — задачами они не судятся`);
479
+ console.log(`check-board: cargo records in the queue ${checked.cargo} — they are not judged as tasks`);
458
480
  }
459
481
 
460
482
  if (!offline && !HAS_PIPELINE) {
461
- console.log('check-board: прогоны на вершинах не спрашивались — файла конвейера в дереве нет');
483
+ console.log('check-board: the runs on the tips were not asked — the tree has no pipeline file');
462
484
  }
463
485
 
464
486
  if (problems.length > 0) {
465
- console.error(`check-board: расхождений ${problems.length}\n`);
487
+ console.error(`check-board: divergences ${problems.length}\n`);
466
488
  problems.forEach((problem) => console.error(` ${problem}`));
467
- console.error('\nЗадача заводится командой npm run task:new — она делает все четыре шага сразу.');
468
- console.error('Папка задачи и её разбор — скил task-flow.');
489
+ console.error('\nA task is created by the command npm run task:new — it does all four steps at once.');
490
+ console.error('The task folder and taking it apart — the rule task-flow.');
469
491
  process.exit(1);
470
492
  }
471
493
 
@@ -473,4 +495,4 @@ if (offline) {
473
495
  process.exit(0);
474
496
  }
475
497
 
476
- console.log(`check-board: задач ${checked.issues}, открытых PR ${checked.pulls}, расхождений нет`);
498
+ console.log(`check-board: tasks ${checked.issues}, open PRs ${checked.pulls}, no divergences`);