@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,27 +1,36 @@
1
1
  /**
2
- * Связь задачи с эпиком. Живёт своим файлом: сверка очереди работ и без неё стоит у предела
3
- * длины, а читают эти две проверки порознь.
2
+ * The link between a task and an epic. Lives in a file of its own: the work queue audit stands at
3
+ * the length limit even without it, and these two checks are read separately.
4
4
  */
5
5
  import { existsSync, readFileSync } from 'node:fs';
6
6
  import { join } from 'node:path';
7
7
 
8
- import { TASK_KEY } from './board.mjs';
8
+ import { declaredEpicOf } from './board-epic-link.mjs';
9
+ import { ghJson, numberFromTitle, OfflineError, OWNER, REPO, TASK_KEY } from './board.mjs';
9
10
  import { CONFIG, ROOT } from './rt-kit-checks.config.mjs';
10
11
 
11
12
  /**
12
- * Метка карточки эпика. Не названа — связь не судится: отличить карточку эпика от обычной
13
- * задачи станет нечем.
13
+ * The label of an epic card. Not named — the link is not judged: there would be nothing left to
14
+ * tell an epic card from an ordinary task by.
14
15
  */
16
+ // Чтение объявления переехало в свой модуль, а звали его отсюда: имя оставлено на прежнем месте,
17
+ // чтобы соседям не пришлось знать о переезде.
18
+ export { declaredEpicOf };
19
+
15
20
  const EPIC_LABEL = CONFIG.board?.epicLabel ?? '';
16
21
 
22
+ /** The labels of the cargo of the trees: those records are not tasks and are not judged as such. */
23
+ const CARGO_LABELS = CONFIG.board?.cargoLabels ?? [];
24
+
17
25
  /**
18
- * Строки состава эпика — те, что стоят в таблице с колонкой «Задача».
26
+ * The rows of the epic makeup — those standing in the table with the task column.
19
27
  *
20
- * Замысел эпика держит и другие таблицы: источники находок, состав семей, счёт пунктов. Номера,
21
- * взятые из всего текста и даже из всех таблиц, делали бы задачей эпика всё, что он упомянул, —
22
- * прошлый эпик, из находок которого он вырос, разбор, задачу соседнего дерева.
28
+ * The epic plan holds other tables too: the sources of findings, the makeup of families, the count
29
+ * of items. Numbers taken from the whole text, and even from all the tables, would make an epic
30
+ * task out of everything it mentioned — the previous epic its findings grew from, a review, a task
31
+ * of a neighbouring tree.
23
32
  */
24
- function planRows(plan) {
33
+ export function planRows(plan) {
25
34
  const rows = [];
26
35
  let inside = false;
27
36
  for (const line of plan.split('\n')) {
@@ -31,9 +40,11 @@ function planRows(plan) {
31
40
  continue;
32
41
  }
33
42
  if (!inside) {
34
- // Граница слова здесь не годится: `\b` знает только латиницу, и с кириллицей она не
35
- // совпадает никогда — проверка молчала бы на любом замысле.
36
- inside = /\|[^|]*Задача/.test(line);
43
+ // The column has two names, English and the owner's: a tree translates its plans one at
44
+ // a time, and one name would take the untranslated epics out of the check silently. A
45
+ // word boundary is no good here either: `\b` knows only Latin letters and never matches
46
+ // Cyrillic — the check would stay silent on any plan.
47
+ inside = /\|[^|]*(?:Task|Задача)/.test(line);
37
48
  continue;
38
49
  }
39
50
  rows.push(line);
@@ -42,27 +53,61 @@ function planRows(plan) {
42
53
  }
43
54
 
44
55
  /**
45
- * Связь задачи с эпиком, прочитанная в обе стороны.
46
- *
47
- * Задача, заведённая под эпик, называет его в теле, а замысел эпика называет её со своей
48
- * стороны. Односторонняя привязка выглядит целой ровно так же, как двусторонняя: читатель
49
- * приходит то от замысла эпика, то от его карточки, и вторая сторона существует только для одного из
50
- * них. Держалась она подражанием — пока тело писали с образца соседней задачи того же эпика,
51
- * строка ехала вместе с формой, а задача, заведённая посреди работы находкой, писалась не с
52
- * образца.
53
- *
54
- * Путь к замыслу берётся из тела карточки эпика: называть его она обязана и так, а настройка
55
- * каталога завела бы второй источник правды. Путём считается написание с каталогом — голое имя
56
- * файла в теле встречается прозой и уводило бы проверку на первое же упоминание. Замысла нет на
57
- * диске — это своё расхождение: карточка ссылается в пустоту.
58
- *
59
- * Судится только открытое, как и вся остальная сверка: закрытая задача эпика — история, и
60
- * строку о ней нечем закрыть.
56
+ * The plan of an epic named by its own card, and the reason there is none.
57
+ *
58
+ * The plan is the document that carries the makeup, not the first path in the body. A card names
59
+ * its decision next to its plan, and the decision has no table of tasks: read as the plan, it made
60
+ * the makeup empty and every open task of the epic read as not belonging to it — fourteen false
61
+ * lines at once, and the true ones drowned among them.
62
+ *
63
+ * A path counts as a spelling with a directory: a bare file name occurs in the body in prose and
64
+ * would lead the reader to the very first mention.
65
+ */
66
+ export function planPathOf(body) {
67
+ const named = [...String(body ?? '').matchAll(/(?:^|[\s(`])([\w.-]+(?:\/[\w.-]+)+\.md)/g)].map((match) => match[1]);
68
+ if (named.length === 0) {
69
+ return { path: null, why: 'the epic card names no path to the plan — there is nowhere to read what the epic holds' };
70
+ }
71
+
72
+ const onDisk = named.filter((path) => existsSync(join(ROOT, path)));
73
+ if (onDisk.length === 0) {
74
+ return { path: null, why: `the epic plan «${named[0]}» is not on disk — the card points into emptiness` };
75
+ }
76
+
77
+ const carrying = onDisk.find((path) => planRows(readFileSync(join(ROOT, path), 'utf8')) !== '') ?? null;
78
+ if (carrying === null) {
79
+ return {
80
+ path: null,
81
+ why: `none of the documents the card names carries the makeup of the epic — «${onDisk.join('», «')}». The makeup is a table with a task column`,
82
+ };
83
+ }
84
+
85
+ return { path: carrying, why: '' };
86
+ }
87
+
88
+ /**
89
+ * The link between a task and an epic, read in both directions.
90
+ *
91
+ * A task created under an epic names it in its body, and the epic plan names the task from its own
92
+ * side. A one-sided binding looks whole exactly as a two-sided one does: the reader comes now from
93
+ * the epic plan, now from its card, and the second side exists only for one of them. It held by
94
+ * imitation — while a body was written from the sample of a neighbouring task of the same epic, the
95
+ * line travelled with the shape, and a task created in the middle of work out of a finding was not
96
+ * written from a sample.
97
+ *
98
+ * The path to the plan is taken from the body of the epic card: it has to name it anyway, and a
99
+ * directory setting would create a second source of truth. A path counts as a spelling with a
100
+ * directory — a bare file name in the body occurs in prose and would lead the check to the very
101
+ * first mention. A plan absent from disk is a discrepancy of its own: the card points into
102
+ * emptiness.
103
+ *
104
+ * Only what is open is judged, as in the rest of the audit: a closed task of an epic is history,
105
+ * and there is nothing to close a line about it with.
61
106
  */
62
107
  export function checkEpicLinks(open, report) {
63
- // Метка не названа — карточку эпика отличить от обычной задачи нечем, и проверка молчит.
64
- // Молчит именно так, а не «эпиков нет»: дерево без эпиков и дерево, не назвавшее метки,
65
- // здесь неразличимы.
108
+ // The label is not named — there is nothing to tell an epic card from an ordinary task by, and
109
+ // the check stays silent. Silent exactly so, not "there are no epics": a tree without epics and
110
+ // a tree that has not named the label are indistinguishable here.
66
111
  if (!EPIC_LABEL) {
67
112
  return;
68
113
  }
@@ -70,24 +115,20 @@ export function checkEpicLinks(open, report) {
70
115
  const byNumber = new Map(open.map((issue) => [issue.number, issue]));
71
116
  const epics = open.filter((issue) => (issue.labels ?? []).some((label) => label.name === EPIC_LABEL));
72
117
  const listedBy = new Map();
73
- // Эпики, состав которых прочитать не вышло. Их задачи обратной стороной не судятся: о
74
- // непрочитанном замысле уже сказано своей строкой, и четыре строки «задачи нет в замысле»
75
- // рядом с ней говорят о том же промахе ещё раз, называя виноватыми чужие задачи.
118
+ // Epics whose makeup could not be read. Their tasks are not judged from the other side: an
119
+ // unread plan has already been reported by a line of its own, and four lines "the task is not in
120
+ // the plan" beside it speak of the same miss again, naming other tasks as guilty.
76
121
  const unreadable = new Set();
77
122
 
78
123
  for (const epic of epics) {
79
- const planPath = String(epic.body ?? '').match(/(?:^|[\s(`])([\w.-]+(?:\/[\w.-]+)+\.md)/)?.[1] ?? null;
80
- if (planPath === null) {
81
- report(`#${epic.number}: карточка эпика не называет путь к замыслу — состав эпика читать негде`);
82
- unreadable.add(epic.number);
83
- continue;
84
- }
85
- if (!existsSync(join(ROOT, planPath))) {
86
- report(`#${epic.number}: замысла эпика «${planPath}» нет на диске — карточка ссылается в пустоту`);
124
+ const found = planPathOf(epic.body);
125
+ if (found.path === null) {
126
+ report(`#${epic.number}: ${found.why}`);
87
127
  unreadable.add(epic.number);
88
128
  continue;
89
129
  }
90
130
 
131
+ const planPath = found.path;
91
132
  const plan = readFileSync(join(ROOT, planPath), 'utf8');
92
133
  const mentions = planRows(plan).matchAll(new RegExp(`(?:#|${TASK_KEY}-)(\\d+)`, 'g'));
93
134
  const numbers = new Set([...mentions].map((match) => Number(match[1])));
@@ -97,27 +138,223 @@ export function checkEpicLinks(open, report) {
97
138
  }
98
139
  listedBy.set(number, epic.number);
99
140
  const body = String(byNumber.get(number).body ?? '');
100
- if (!new RegExp(`(?:#|${TASK_KEY}-)${epic.number}\\b`).test(body)) {
141
+ if (!declaredEpicOf(body, epic.number)) {
101
142
  report(
102
- `#${number}: замысел эпика #${epic.number} задачу называет, а её тело эпика — нет. Допиши строку «Задача эпика #${epic.number}, замысел — ${planPath}»`
143
+ `#${number}: the plan of the epic #${epic.number} names the task, and its body does not name the epic. Add the line «Задача эпика #${epic.number}, замысел — ${planPath}»`
103
144
  );
104
145
  }
105
146
  }
106
147
  }
107
148
 
108
- // Обратная сторона: тело назвало эпик, а замысел эпика этой задачи не знает. Читается
109
- // это как задача под эпиком, но «взять следующую» её не отдаст никогда.
149
+ // The other side: the body named the epic, and the epic plan does not know this task. It reads
150
+ // as a task under an epic, but "take the next one" will never hand it out.
110
151
  const epicNumbers = new Set(epics.map((issue) => issue.number));
111
152
  for (const issue of open) {
112
153
  if (epicNumbers.has(issue.number)) {
113
154
  continue;
114
155
  }
115
- const named = String(issue.body ?? '').match(new RegExp(`эпика?\\s+(?:#|${TASK_KEY}-)(\\d+)`, 'i'))?.[1];
156
+ const named = declaredEpicOf(String(issue.body ?? ''));
116
157
  if (named === undefined || !epicNumbers.has(Number(named)) || unreadable.has(Number(named))) {
117
158
  continue;
118
159
  }
119
160
  if (listedBy.get(issue.number) !== Number(named)) {
120
- report(`#${issue.number}: тело называет эпик #${named}, а в его замысле задачи нет — «взять следующую» её не отдаст`);
161
+ report(`#${issue.number}: the body names the epic #${named}, and its plan does not carry the task — «take the next one» will not give it out`);
162
+ }
163
+ }
164
+
165
+ checkTasksOutsideEpics(open, epicNumbers, report);
166
+ }
167
+
168
+ /**
169
+ * The word by which a task declares itself as work outside an epic. It is written by the creating
170
+ * command from the word of the owner, and the audit reads exactly that shape: work outside an epic
171
+ * is lawful, and only the owner names it as such.
172
+ */
173
+ const OUTSIDE_EPIC = /работа\s+вне\s+эпика/i;
174
+
175
+ /**
176
+ * A task belonging to no epic and carrying no word of the owner about work outside one.
177
+ *
178
+ * The delivery guard refuses such a task at the creating command, and only there: a card made
179
+ * through the web goes past every guard, and one created before this order came in has neither
180
+ * line. By the queue it reads as ordinary work, and that nothing stands behind it shows nowhere —
181
+ * the audit is the only reader that comes for exactly this.
182
+ *
183
+ * The cargo of the trees is not judged: those records are not tasks at all — they have no title
184
+ * with a number, no executor and no place on the board, and never will.
185
+ */
186
+ function checkTasksOutsideEpics(open, epicNumbers, report) {
187
+ for (const issue of open) {
188
+ if (epicNumbers.has(issue.number)) {
189
+ continue;
190
+ }
191
+ if ((issue.labels ?? []).some((label) => CARGO_LABELS.includes(label.name))) {
192
+ continue;
193
+ }
194
+ const body = String(issue.body ?? '');
195
+ if (declaredEpicOf(body) !== undefined || OUTSIDE_EPIC.test(body)) {
196
+ continue;
197
+ }
198
+ report(
199
+ `#${issue.number}: the task names no epic, and no word of the owner about work outside one. Add the line «Задача эпика #<номер>, замысел — <путь>» or «Работа вне эпика — <слово владельца>»`
200
+ );
201
+ }
202
+ }
203
+
204
+ /**
205
+ * The tasks of an epic linked to its card as sub-issues.
206
+ *
207
+ * The plan of the epic holds the makeup, and the body of a task names the epic — but both are
208
+ * text, and the board reads neither. On the board a task of an epic looks exactly like a task
209
+ * outside one: the epic card shows no list of its tasks, no count of the done ones, and whoever
210
+ * looks at the board assembles both by hand from the list of open cards.
211
+ *
212
+ * A sub-issue is the hosting's own link between two cards, and it fills all three at once: the
213
+ * epic card gets the list, the task card gets the line about its parent, and the board card gets
214
+ * the "done of total" bar.
215
+ *
216
+ * The list of the epic's tasks is taken from its plan, as everywhere in this audit — the plan is
217
+ * the makeup. Closed tasks are judged too, unlike the rest of the audit: the bar counts them, and
218
+ * an epic whose closed tasks are not linked shows a share lower than the true one.
219
+ *
220
+ * Arguments: the open cards, the reporting function, the call options of the hosting client.
221
+ */
222
+ export function checkEpicSubIssues(open, report, options) {
223
+ if (!EPIC_LABEL || !OWNER || !REPO) {
224
+ return;
225
+ }
226
+
227
+ const epics = open.filter((issue) => (issue.labels ?? []).some((label) => label.name === EPIC_LABEL));
228
+ for (const epic of epics) {
229
+ const found = planPathOf(epic.body);
230
+ if (found.path === null) {
231
+ // The unread plan has already been reported by a line of its own in the link check.
232
+ continue;
121
233
  }
234
+
235
+ const rows = planRows(readFileSync(join(ROOT, found.path), 'utf8'));
236
+ const named = new Set([...rows.matchAll(new RegExp(`(?:#|${TASK_KEY}-)(\\d+)`, 'g'))].map((match) => Number(match[1])));
237
+ named.delete(epic.number);
238
+ if (named.size === 0) {
239
+ continue;
240
+ }
241
+
242
+ let linked;
243
+ try {
244
+ linked = new Set(ghJson(['api', `repos/${OWNER}/${REPO}/issues/${epic.number}/sub_issues`, '--jq', '[.[].number]'], options));
245
+ } catch (error) {
246
+ if (error instanceof OfflineError) {
247
+ throw error;
248
+ }
249
+ // The hosting has no such link at all, or the call is refused: this is not a
250
+ // discrepancy of the tree, and a line about it would repeat every run.
251
+ continue;
252
+ }
253
+
254
+ const missing = [...named].filter((number) => !linked.has(number)).sort((left, right) => left - right);
255
+ if (missing.length > 0) {
256
+ report(
257
+ `#${epic.number}: the plan names tasks that are not sub-issues of the epic card — ${missing.map((number) => `#${number}`).join(', ')}. On the board the epic then shows neither its makeup nor how much of it is done`
258
+ );
259
+ }
260
+ }
261
+ }
262
+
263
+ /**
264
+ * The base of an open request about a task of an epic.
265
+ *
266
+ * The delivery guard judges this at the opening, and only there: a request opened by a person from
267
+ * the hosting page goes past it, and one opened before this order came in carries the base it was
268
+ * opened with. In the list of requests the base is not shown at all — the reader sees the title and
269
+ * the branch, and a request going into the main branch past its epic looks like every other.
270
+ *
271
+ * The branch of the epic is recognised by its number in the name, not by a list of refs: the audit
272
+ * reads the queue and does not go to the tree, and a base carrying the number of the epic is its
273
+ * branch — a task and its epic never share a number.
274
+ */
275
+ export function checkEpicPullBase(open, pulls, report) {
276
+ if (!EPIC_LABEL) {
277
+ return;
278
+ }
279
+
280
+ const epicOf = new Map();
281
+ for (const issue of open) {
282
+ const named = declaredEpicOf(String(issue.body ?? ''));
283
+ if (named !== undefined) {
284
+ epicOf.set(issue.number, Number(named));
285
+ }
286
+ }
287
+
288
+ for (const pull of pulls) {
289
+ const number = numberFromTitle(pull.title);
290
+ if (number === null || !epicOf.has(number)) {
291
+ continue;
292
+ }
293
+ const epic = epicOf.get(number);
294
+ const base = String(pull.baseRefName ?? '');
295
+ if (base.startsWith(`${TASK_KEY}-${epic}-`)) {
296
+ continue;
297
+ }
298
+ report(
299
+ `PR #${pull.number}: the task #${number} belongs to the epic #${epic}, and the base of the request is «${base}». A request past the epic takes the task out of it: the epic is handed in without it`
300
+ );
122
301
  }
123
302
  }
303
+
304
+ /**
305
+ * Two states of an epic that nothing sees.
306
+ *
307
+ * **An epic without a branch.** Its branch is taken before the first of its tasks, and one that was
308
+ * not taken leaves every task standing on the main branch: the epic is then merged piece by piece,
309
+ * and there is nothing left to hand in whole. The card says nothing about a branch, and the list of
310
+ * requests shows none while no request is open from it.
311
+ *
312
+ * **An epic whose tasks are over.** Its request into the main branch opens when the last folder is
313
+ * taken apart, and until it opens the work of the whole epic lies outside the main branch while
314
+ * looking finished: every task is closed, the board is empty, and only the epic card stays open.
315
+ *
316
+ * Both are read by the same two things: the open tasks of the epic and the open requests. The
317
+ * branch of the epic is recognised by its number in the name — the audit reads the queue and does
318
+ * not go to the tree.
319
+ */
320
+ export function checkEpicState(open, pulls, report) {
321
+ if (!EPIC_LABEL) {
322
+ return;
323
+ }
324
+
325
+ const epics = open.filter((issue) => (issue.labels ?? []).some((label) => label.name === EPIC_LABEL));
326
+ if (epics.length === 0) {
327
+ return;
328
+ }
329
+
330
+ const claimed = new Map();
331
+ for (const issue of open) {
332
+ const named = declaredEpicOf(String(issue.body ?? ''));
333
+ if (named !== undefined) {
334
+ claimed.set(issue.number, Number(named));
335
+ }
336
+ }
337
+
338
+ for (const epic of epics) {
339
+ const prefix = `${TASK_KEY}-${epic.number}-`;
340
+ const fromEpic = pulls.filter((pull) => String(pull.headRefName ?? '').startsWith(prefix));
341
+ const intoEpic = pulls.filter((pull) => String(pull.baseRefName ?? '').startsWith(prefix));
342
+ const tasksLeft = [...claimed.entries()].filter(([, number]) => number === epic.number);
343
+
344
+ // A branch of the epic shows in a request either way: one from it, or one into it. Neither
345
+ // — and there is nothing in the queue to say the branch exists at all.
346
+ if (fromEpic.length === 0 && intoEpic.length === 0) {
347
+ report(
348
+ `#${epic.number}: the epic has no branch in the requests — neither one from it nor one into it. The branch of an epic is taken before its first task, and without it every task stands on the main branch`
349
+ );
350
+ continue;
351
+ }
352
+
353
+ if (tasksLeft.length === 0 && fromEpic.length === 0) {
354
+ report(
355
+ `#${epic.number}: the tasks of the epic are over, and no request from its branch is open. Until it opens, the work of the whole epic lies outside the main branch while looking finished`
356
+ );
357
+ }
358
+ }
359
+ }
360
+
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Task branches that have not carried their folder in by a single commit — a part of the work queue
4
+ * audit.
5
+ *
6
+ * Moved into a file of its own because the audit itself has grown to the length limit: it has many
7
+ * subjects, and this one stands apart — it is the only one that reads the local repository and does
8
+ * without the network and without the hosting.
9
+ */
10
+ import { execFileSync } from 'node:child_process';
11
+
12
+ import { TASK_KEY } from './board.mjs';
13
+ import { CONFIG, ROOT } from './rt-kit-checks.config.mjs';
14
+
15
+ /**
16
+ * The plan guard asks the folder from the disk, so an uncommitted one lets edits through for the
17
+ * whole of the work, and the refusal comes at the very end: the turn exit guard takes the sign of
18
+ * handed-over work from the branch history, and there is no folder there. At that minute there is
19
+ * nothing left to fix with — the folder was taken apart by one's own hands, and one assembled anew
20
+ * gives two extra commits in a ready PR.
21
+ *
22
+ * The branch history is judged, not its tip: the folder is taken apart by the last commit before
23
+ * the PR is opened, and the tip of finished work lawfully carries no folder.
24
+ *
25
+ * Read from the local repository, without the network: branches of other machines are not visible
26
+ * from here, and this check says nothing about them.
27
+ */
28
+ export function checkBranchFolders(report, mainBranch) {
29
+ const git = (args) => execFileSync('git', args, { cwd: ROOT, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });
30
+
31
+ let branches;
32
+ try {
33
+ branches = git(['branch', '--format=%(refname:short)', '--list', `${TASK_KEY}-*`]).split('\n');
34
+ } catch {
35
+ return;
36
+ }
37
+
38
+ // A branch without a task number is lawful and lives locally — for a trial and a grill; it is
39
+ // due no folder, and demanding one would mean refusing work that will not go into the main
40
+ // branch.
41
+ const numbered = new RegExp(`^${TASK_KEY}-\\d+-`);
42
+
43
+ for (const branch of branches.map((one) => one.trim()).filter((one) => numbered.test(one))) {
44
+ try {
45
+ // The branch contribution is empty — nothing to judge: a folder is put in by the very
46
+ // first commit, not by creating it.
47
+ if (!git(['log', '--format=%h', '-1', `${mainBranch}..${branch}`]).trim()) {
48
+ continue;
49
+ }
50
+ if (git(['log', '--format=%h', '-1', branch, '--', `${CONFIG.tasksDir}/${branch}`]).trim()) {
51
+ continue;
52
+ }
53
+ } catch {
54
+ continue;
55
+ }
56
+ report(
57
+ `${branch}: the task folder never travelled into the branch — commit ${CONFIG.tasksDir}/${branch}/, ` +
58
+ `otherwise the refusal arrives at the exit of a turn, when there is nothing left to fix`
59
+ );
60
+ }
61
+ }
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Вызов клиента хостинга: как его находят, чем подписывают и что считается временным отказом.
3
+ * The call to the hosting client: how it is found, what it is signed with and what counts as a
4
+ * temporary refusal.
4
5
  *
5
- * Отделено от работы с очередью работ потому, что предмет здесь другой — не задача и не колонка,
6
- * а сам вызов: где взять исполняемый файл, каким токеном его подписать, что читать как «сети
7
- * нет» и что повторить. Вместе с очередью это переросло предел длины файла.
6
+ * Separated from the work with the work queue because the subject here is another one — not a task
7
+ * and not a column, but the call itself: where to get the executable, which token to sign it with,
8
+ * what to read as "there is no network" and what to repeat. Together with the queue this outgrew
9
+ * the file length limit.
8
10
  */
9
11
  import { execFileSync } from 'node:child_process';
10
12
  import { existsSync, readFileSync } from 'node:fs';
@@ -16,8 +18,8 @@ const BOARD = CONFIG.board ?? {};
16
18
  const BOT_TOKEN_FILE = BOARD.tokenPath ? BOARD.tokenPath.replace(/^~/, homedir()) : '';
17
19
 
18
20
  /**
19
- * `gh` у владельца подменён обёрткой менеджера паролей, и вызов по имени уходит в неё.
20
- * Поэтому сначала пробуется настоящий исполняемый файл, и только потом имя из PATH.
21
+ * The owner's `gh` is substituted by a password manager wrapper, and a call by name goes into it.
22
+ * So the real executable is tried first, and only then the name from PATH.
21
23
  */
22
24
  function ghBinary() {
23
25
  if (process.env.GH_BIN) {
@@ -28,9 +30,14 @@ function ghBinary() {
28
30
  }
29
31
 
30
32
  /**
31
- * Токен машинной записи лежит вне репозитория и в вывод не попадает. Его отсутствие — не отказ:
32
- * дерево, не назвавшее токена в `board.tokenPath`, работает с очередью учётной записью, под
33
- * которой залогинен клиент хостинга.
33
+ * The machine account token lies outside the repository and does not get into the output. Its
34
+ * absence is not a refusal: a tree that has not named a token in `board.tokenPath` works with the
35
+ * queue under the account the hosting client is signed in as.
36
+ *
37
+ * The token is supplied by reading a task, moving a column and listing one's own PRs in dispute.
38
+ * Reading a PR goes without it deliberately: the review fields need rights to the organisation
39
+ * accounts, which the machine account was not given, and a request with the token is refused
40
+ * entirely. Whose eyes the answer was taken by is told by the `viewer` field in it.
34
41
  */
35
42
  export function botToken() {
36
43
  if (!existsSync(BOT_TOKEN_FILE)) {
@@ -43,9 +50,9 @@ export function botToken() {
43
50
  export class OfflineError extends Error {}
44
51
 
45
52
  /**
46
- * Отказ сети от отказа по существу отличается только текстом: `gh` на оба отвечает
47
- * ненулевым кодом. Сюда попадает то, после чего проверять нечем, — а не то, что
48
- * проверено и оказалось не так.
53
+ * A network refusal differs from a refusal on the merits only by its text: `gh` answers
54
+ * both with a non-zero code. What lands here is what leaves nothing to check by — not
55
+ * what was checked and turned out wrong.
49
56
  */
50
57
  function isOffline(stderr) {
51
58
  return /dial tcp|no such host|network is unreachable|timeout|TLS handshake|connection refused|Bad credentials|authentication|not logged/i.test(
@@ -54,25 +61,26 @@ function isOffline(stderr) {
54
61
  }
55
62
 
56
63
  /**
57
- * Отказ, который проходит сам: хостинг ответил, но не смог.
64
+ * A refusal that passes by itself: the hosting answered but could not.
58
65
  *
59
- * Отличается от отказа по существу тем, что повтор его снимает: пятисотые коды, шлюз и его
60
- * таймаут. Отказ по праву, по несуществующей записи и по незнакомой колонке сюда не попадают —
61
- * они не пройдут и на третий раз, а ждать заставят.
66
+ * It differs from a refusal on the merits in that a repeat lifts it: the five-hundred codes, the
67
+ * gateway and its timeout. A refusal by right, by a non-existent record and by an unknown column do
68
+ * not land here — they will not pass on the third try either, and would make one wait.
62
69
  */
63
70
  function isUnavailable(stderr) {
64
71
  return /HTTP 50[0234]\b|Bad Gateway|Service Unavailable|Gateway Time-?out|Server Error/i.test(stderr);
65
72
  }
66
73
 
67
- /** Сколько раз пробовать вызов, который отбит недоступностью хостинга. */
74
+ /** How many times to try a call refused by the hosting being unavailable. */
68
75
  const TRIES = 3;
69
76
 
70
77
  /**
71
- * Пауза перед следующей попыткой, вдвое длиннее прежней. Синхронная: вызов хостинга здесь тоже
72
- * синхронный, и уводить его в обещание пришлось бы вместе со всеми, кто его зовёт.
78
+ * The pause before the next attempt, twice as long as the previous one. Synchronous: the hosting
79
+ * call here is synchronous too, and moving it into a promise would mean moving everyone who calls
80
+ * it along with it.
73
81
  *
74
- * Число берётся из окружения ради проб: своей паузы им не нужно, а ждать три секунды на каждый
75
- * сценарий они не обязаны.
82
+ * The number is taken from the environment for the sake of the tests: they need no pause of their
83
+ * own, and are not obliged to wait three seconds for every scenario.
76
84
  */
77
85
  const PAUSE_MS = Number(process.env.RT_GH_RETRY_MS ?? 1000) || 0;
78
86
 
@@ -95,17 +103,18 @@ export function gh(args, { token } = {}) {
95
103
  } catch (error) {
96
104
  const stderr = String(error.stderr ?? error.message ?? '');
97
105
  if (error.code === 'ENOENT' || isOffline(stderr)) {
98
- throw new OfflineError(stderr.trim() || 'gh недоступен');
106
+ throw new OfflineError(stderr.trim() || 'gh is unavailable');
99
107
  }
100
- // Правило требует двигать колонку тем же движением, что и работу, а хостинг отвечал
101
- // недоступностью час подряд: без повтора исполнитель либо крутит вызов руками, либо
102
- // оставляет колонку отставшей — и находит это сверка уже после открытия заявки.
108
+ // The rule demands moving the column by the same motion as the work, and the hosting
109
+ // answered with unavailability for an hour straight: without a repeat the executor
110
+ // either turns the call by hand or leaves the column behind — and the audit finds that
111
+ // only after the PR is opened.
103
112
  if (isUnavailable(stderr) && attempt < TRIES) {
104
113
  pause(waited);
105
114
  waited *= 2;
106
115
  continue;
107
116
  }
108
- const failure = new Error(stderr.trim() || `gh ${args[0]} завершился с ошибкой`);
117
+ const failure = new Error(stderr.trim() || `gh ${args[0]} finished with an error`);
109
118
  failure.stderr = stderr;
110
119
  throw failure;
111
120
  }