@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,46 +1,47 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
3
- # Требует: hooks/git-guard-delivery-folder.sh, hooks/git-guard-delivery-conflict.sh, hooks/profile-check.sh, hooks/deny-tail.sh, hooks/guard-note.sh
4
- # Гард поставки. PreToolUse на заведении ветки, пуше и открытии заявки на слияние.
3
+ # Requires: hooks/git-guard-delivery-folder.sh, hooks/git-guard-delivery-conflict.sh, hooks/profile-check.sh, hooks/deny-tail.sh, hooks/guard-note.sh
4
+ # Delivery guard. PreToolUse on creating a branch, on the push and on opening a PR.
5
5
  #
6
- # Закон о поставке требует трёх вещей, которых обычно не проверяет ничто: правка начинается с
7
- # задачи, видимой в очереди работ; задача, ветка и PR несут один номер; у задачи есть
8
- # исполнитель. Держатся они памятью — и не удерживаются: задачи стоят вне очереди, исполнитель
9
- # не проставлен, а большинство влитых заявок приходит с веток, за которыми задачи не стояло
10
- # вовсе.
6
+ # The delivery law demands three things nothing usually checks: an edit starts from a task visible
7
+ # in the work queue; the task, the branch and the PR carry one number; the task has an assignee.
8
+ # They are held by memory — and they do not hold: tasks stand outside the queue, the assignee is
9
+ # not set, and most merged PRs come from branches that had no task behind them at all.
11
10
  #
12
- # Гард стоит в трёх точках, и в каждой требует того, что в этот момент исправимо:
11
+ # The guard stands at three points, and at each of them it demands what is fixable at that moment:
13
12
  #
14
- # заведение ветки — имя с номером разбирается на месте; имя без номера пропускается:
15
- # локальная ветка под пробу законна, в главную она не поедет, потому что заявка с неё
16
- # не откроется;
17
- # пуш — подпись машинного коммита ещё переписывается на месте; после пуша её чинит только
18
- # силовая отправка;
19
- # открытие заявки — ветка обязана нести номер, заголовок обязан начинаться с того же номера,
20
- # а задача — быть открытой, стоять в очереди работ и иметь исполнителя.
13
+ # creating a branch — a name with a number is parsed on the spot; a name without a number is let
14
+ # through: a local branch for a trial is lawful, it will not travel into the main branch,
15
+ # because no PR opens from it;
16
+ # the push — the signature of a machine commit is still rewritten on the spot; after the push
17
+ # only a force push fixes it;
18
+ # opening a PR — the branch must carry a number, the title must start with the same number, and
19
+ # the task must be open, stand in the work queue and have an assignee.
21
20
  #
22
- # Два яруса. Формат — номер в имени ветки, номер в заголовке, их совпадение — читается из
23
- # текста команды и работает всегда. Состояние задачи требует сети: нет её, нет помощника или
24
- # нет токена — ярус пропускается, потому что проверять нечем.
21
+ # Two tiers. The format — the number in the branch name, the number in the title, their match — is
22
+ # read from the command text and always works. The state of the task needs the network: no network,
23
+ # no client or no token — the tier is skipped, because there is nothing to check with.
25
24
  #
26
- # Что здесь чем зовётся, знает профиль дерева:
27
- # rt_task_branch_ok — форма имени ветки под задачу;
28
- # rt_task_branch_number — номер задачи из этого имени: приставкой бывает и род правки;
29
- # RT_TASK_TITLE_RE — форма номера в заголовке заявки;
30
- # rt_task_state — состояние задачи одним объектом (existsize, open, onBoard, assigned,
31
- # numbered); молчание значит «спросить некого»;
32
- # RT_TASK_NEW_CMD — чем заводится задача;
33
- # RT_BOARD_CHECK_CMD — чем сверяется очередь работ;
34
- # RT_TASK_BOT — учётная запись, которую ставят исполнителем; ею же открывается заявка;
35
- # RT_PULL_TOKEN_VAR — переменная, которой вызову подставляют её токен;
36
- # RT_PULL_TOKEN_HINT — готовая подстановка этого токена, целиком;
37
- # RT_COMMIT_EMAIL — почта, которой подписан машинный коммит; её же левой частью он и
38
- # опознаётся.
39
- # Отказ называет и то, что не так, и чем это чинится: отказ без действия обходят, а не исполняют.
25
+ # What is called what here is known by the tree profile:
26
+ # rt_task_branch_ok — the form of a branch name for a task;
27
+ # rt_task_branch_number — the task number out of that name: the prefix can be the kind of edit too;
28
+ # RT_TASK_TITLE_RE — the form of the number in the PR title;
29
+ # rt_task_state — the state of the task as one object (existsize, open, onBoard, assigned,
30
+ # numbered); silence means "there is nobody to ask";
31
+ # RT_TASK_NEW_CMD — what a task is created with;
32
+ # RT_BOARD_CHECK_CMD — what the work queue is audited with;
33
+ # RT_TASK_BOT — the account put as the assignee; the PR is opened by it as well;
34
+ # RT_PULL_TOKEN_VAR — the variable through which its token is substituted into the call;
35
+ # RT_PULL_TOKEN_HINT — the ready-made substitution of that token, whole;
36
+ # RT_COMMIT_EMAIL — the address a machine commit is signed with; by its left part the commit
37
+ # is recognised as well.
38
+ # The refusal names both what is wrong and what fixes it: a refusal without an action is bypassed,
39
+ # not carried out.
40
40
  #
41
- # ОТКАЗ В ПОЛЬЗУ РАБОТЫ: не репозиторий, нет разборщика, битый ввод, нет профиля — пропуск.
41
+ # FAIL-OPEN: not a repository, no parser, broken input, no profile — let through.
42
42
 
43
- # Своё имя в наблюдениях: отбой пишет общий хвост отказа, а не сам гард.
43
+ # Its own name in the observations: the refusal is written by the shared deny tail, not by the
44
+ # guard itself.
44
45
  RT_GUARD_NAME=git-guard-delivery
45
46
 
46
47
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
@@ -54,7 +55,7 @@ command -v jq >/dev/null 2>&1 || exit 0
54
55
  tool="$(rt_hook_tool)"
55
56
  sid="$(printf '%s' "$input" | jq -r '.session_id // "nosession"' 2>/dev/null)"
56
57
  case "$tool" in
57
- # Терминал среды и универсальный исполнитель кладут команду в то же поле.
58
+ # The environment terminal and the universal executor put the command in the same field.
58
59
  Bash | mcp__webstorm__execute_terminal_command | mcp__webstorm__execute_tool) ;;
59
60
  *) exit 0 ;;
60
61
  esac
@@ -62,8 +63,8 @@ esac
62
63
  cmd="$(rt_hook_cmd)"
63
64
  [ -z "$cmd" ] && exit 0
64
65
 
65
- # Универсальный исполнитель передаёт настоящую команду вложенной строкой. Разбирать надо её,
66
- # а не обёртку.
66
+ # The universal executor passes the real command as a nested string. It is that string that has to
67
+ # be parsed, not the wrapper.
67
68
  if [ "$tool" = "mcp__webstorm__execute_tool" ] && command -v perl >/dev/null 2>&1; then
68
69
  inner="$(printf '%s' "$cmd" | perl -0ne '
69
70
  if (/--command(?:=|\s+)(?:"((?:[^"\\]|\\.)*)"|\x27([^\x27]*)\x27|(.+))/s) {
@@ -80,18 +81,18 @@ git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 0
80
81
 
81
82
  root="${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel 2>/dev/null)}"
82
83
 
83
- # Профиль дерева: сперва умолчание пакета, поверх него — надстройка проекта, если она есть.
84
- # Объявленная в надстройке функция замещает умолчание целиком и вправе позвать его обратно
85
- # суффиксом `_default`. Нет ни того ни другого — хук пропускает: пустой гард лучше гарда,
86
- # отбивающего наугад.
84
+ # The tree profile: first the package default, and the project override on top of it, if there is
85
+ # one. A function declared in the override replaces the default whole and may call it back through
86
+ # the `_default` suffix. Neither one nor the other — the hook lets through: an empty guard is
87
+ # better than a guard that refuses at random.
87
88
  rt_hooks_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88
89
  for profile in "$rt_hooks_dir/../rt-kit/defaults/project.sh" "$rt_hooks_dir/../defaults/project.sh" "$root/.claude/rt-kit/defaults/project.sh" "$root/.claude/rt-kit/project.sh"; do
89
90
  # shellcheck disable=SC1090
90
91
  [ -f "$profile" ] && . "$profile" 2>/dev/null
91
92
  done
92
93
 
93
- # Слово о нехватке функции профиля: хук, вышедший молча, неотличим от работающего. Файл может
94
- # быть не разложен — тогда остаётся прежнее поведение, молчаливое.
94
+ # A word about a missing profile function: a hook that left silently is indistinguishable from a
95
+ # working one. The file may be not laid out — then the previous behaviour stays, the silent one.
95
96
  # shellcheck disable=SC1090
96
97
  [ -f "$rt_hooks_dir/profile-check.sh" ] && . "$rt_hooks_dir/profile-check.sh"
97
98
  command -v rt_needs >/dev/null 2>&1 || rt_needs() { command -v "$1" >/dev/null 2>&1; }
@@ -102,55 +103,57 @@ title_re="${RT_TASK_TITLE_RE:-^\[[A-Za-z]+-[0-9]+\][[:space:]]+[^[:space:]]}"
102
103
  task_new="${RT_TASK_NEW_CMD:-npm run task:new}"
103
104
  board_check="${RT_BOARD_CHECK_CMD:-npm run check:board}"
104
105
  task_move="${RT_TASK_MOVE_CMD:-npm run task:move}"
105
- # Первая колонка очереди работ — та, из которой задача уходит, когда её берут. Умолчания у неё
106
- # нет: имена колонок дерево называет своими словами, а выдуманное имя не совпало бы ни с чем и
107
- # молча выключило бы проверку.
106
+ # The first column of the work queue is the one a task leaves when it is taken. It has no default:
107
+ # a tree names its columns in its own words, and an invented name would match nothing and would
108
+ # silently switch the check off.
108
109
  backlog_column="${RT_BOARD_BACKLOG:-}"
109
110
  task_bot="${RT_TASK_BOT:-}"
110
- # Личность вызова приходит окружением, а не словом в строке: из текста команды видно только то,
111
- # подставлен ли токен явно. Дерево, не назвавшее переменной, автора заявки не судит вовсе —
112
- # у него может не быть отдельной машинной записи.
111
+ # The identity of the call arrives through the environment, not as a word in the line: from the
112
+ # command text only one thing is visible — whether the token is substituted explicitly. A tree that
113
+ # named no variable does not judge the PR author at all — it may have no separate machine account.
113
114
  pull_token_var="${RT_PULL_TOKEN_VAR:-}"
114
115
  pull_token_hint="${RT_PULL_TOKEN_HINT:-}"
115
- # Раздел, который тело заявки обязано нести с минуты открытия. Кнопку слияния нажимает человек
116
- # на хостинге, куда гард не достаёт: всё, чем требование там держится, — то, что владелец увидел
117
- # на странице. Заголовок раздела пишется языком заявки, поэтому образец называет дерево, а не
118
- # пакет: чужих слов пакет не знает, и выдуманное умолчание не совпало бы ни с чем.
116
+ # The section the PR body must carry from the minute it opens. The merge button is pressed by a
117
+ # person on the hosting, where the guard does not reach: everything the requirement holds by there
118
+ # is what the owner saw on the page. The section heading is written in the language of the PR, so
119
+ # the pattern is named by the tree, not by the package: the package does not know someone else's
120
+ # words, and an invented default would match nothing.
119
121
  pull_body_section="${RT_PULL_BODY_SECTION:-}"
120
122
  commit_email="${RT_COMMIT_EMAIL:-}"
121
123
  tasks_dir="${RT_TASKS_DIR:-}"
122
124
  archive_dir="${RT_ARCHIVE_DIR:-}"
123
125
  main_branch="${RT_MAIN_BRANCH:-main}"
124
126
 
125
- # Обход требования: строка с причиной. Причина видна тому, кто вливает, поэтому обход законен.
126
- # Без причины это просто молчаливый пропуск, поэтому она обязательна. Порог в три знака — тот
127
- # же, что у гарда документа: если сделать по-разному, две формы одного обхода разойдутся.
127
+ # The bypass of the requirement: a line with a reason. The reason is seen by whoever merges, so the
128
+ # bypass is allowed; without a reason it is a silent skip. The threshold of three characters is the
129
+ # same as in the document guard.
128
130
  #
129
- # Строка обхода начинает строку — свою в теле PR или комментарий в конце команды — и
130
- # подстановки не принимает. Без этих двух условий текст, который ОБЪЯСНЯЕТ, что обход называется
131
- # так-то, от самого обхода неотличим: тело PR со строкой-примером снимало требование само
132
- # собой, и тот же пример гард печатает в своём отказе ниже. Нашлось это приёмкой такого же
133
- # признака — прогон обязан был покраснеть на настоящем нарушении и остался зелёным.
131
+ # The bypass line stands at the start of a line — its own in the PR body, or of a comment at the end
132
+ # of the command — and takes no substitutions. Otherwise the text explaining what the bypass is
133
+ # called is indistinguishable from the bypass itself: a PR body with a sample line lifted the
134
+ # requirement by itself.
134
135
  folder_skip_re='(^|#)[[:space:]]*Task-folder-skip:[[:space:]]*[^[:space:]<"'"'"'][^[:space:]"'"'"']{2,}'
135
136
 
136
137
  deny() {
137
- # Отказ гарда — наблюдение: гард, отбивающий чаще прочих, говорит, какое место поставки раз
138
- # за разом делают не так. Текст отказа туда не идёт: в нём номера задач и имена веток дерева.
138
+ # A guard refusal is an observation: the guard that refuses more often than the rest says which
139
+ # place of the delivery is done wrong time after time. The refusal text does not go there: it
140
+ # holds the task numbers and the branch names of the tree.
139
141
 
140
- # Хвост отказа: два законных хода и форма обхода вторым параметром.
142
+ # The refusal tail: the two lawful moves and the form of the bypass as the second parameter.
141
143
  # shellcheck disable=SC1090
142
144
  [ -f "$rt_hooks_dir/deny-tail.sh" ] && . "$rt_hooks_dir/deny-tail.sh" 2>/dev/null
143
145
  reason="$1"
144
146
  command -v rt_deny_tail >/dev/null 2>&1 && reason="$1 $(rt_deny_tail "$2")"
145
147
 
146
148
  jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
147
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Гард поставки."}}\n'
149
+ || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"The delivery guard."}}\n'
148
150
  exit 0
149
151
  }
150
152
 
151
- # Несошедшиеся условия копятся и называются разом: отказ по первому промаху заставляет чинить их
152
- # по одному — правка основания, повтор, заголовок, снова повтор, задача, — хотя всё несошедшееся
153
- # известно уже на первом круге. Готовность к поставке — одно состояние, и называется оно целиком.
153
+ # Conditions that did not come together pile up and are named all at once: a refusal on the first
154
+ # miss makes them fixed one at a time — the base, a repeat, the title, another repeat, the task —
155
+ # although everything that did not come together is known already on the first round. Readiness for
156
+ # delivery is one state, and it is named whole.
154
157
  faults=''
155
158
 
156
159
  fault() {
@@ -158,24 +161,26 @@ fault() {
158
161
  }— $1"
159
162
  }
160
163
 
161
- # Условия о папке задачи вынесены соседним файлом: у папки свой предмет, свой обход и своя
162
- # запись в архиве, а вместе с разбором команды и очередью работ они переросли предел длины.
163
- # Подключается он после `deny` и `fault` — обе зовутся изнутри.
164
+ # The conditions about the task folder are moved out into a neighbouring file: the folder has a
165
+ # subject of its own, a bypass of its own and a record of its own in the archive, and together with
166
+ # the command parsing and the work queue they outgrew the length limit. It is sourced after `deny`
167
+ # and `fault` — both are called from inside it.
164
168
  # shellcheck disable=SC1090
165
169
  [ -f "$rt_hooks_dir/git-guard-delivery-folder.sh" ] && . "$rt_hooks_dir/git-guard-delivery-folder.sh" 2>/dev/null
166
170
 
167
- # Конфликтующая своя заявка: тот же приём, что у папки и подписи. Зовётся помощник до всех ярусов
168
- # ниже и судит не готовность этой работы, а право брать следующую: пока отданное конфликтует, его
169
- # чинят первым действием хода. Нет помощника — ярус не судится, а работа идёт дальше.
171
+ # A conflicting PR of one's own: the same technique as with the folder and the signature. The helper
172
+ # is called before all the tiers below and judges not the readiness of this work but the right to
173
+ # take the next one: while what was handed over conflicts, it is fixed by the first action of the
174
+ # turn. No helper — the tier is not judged, and the work goes on.
170
175
  # shellcheck disable=SC1090
171
176
  [ -f "$rt_hooks_dir/git-guard-delivery-conflict.sh" ] && . "$rt_hooks_dir/git-guard-delivery-conflict.sh" 2>/dev/null
172
177
  command -v rt_delivery_conflict >/dev/null 2>&1 && rt_delivery_conflict
173
178
 
174
- # Отказ по накопленному. Пусто — вызывающая сторона идёт дальше.
179
+ # The refusal on what has piled up. Empty — the calling side goes on.
175
180
  deny_faults() {
176
181
  [ -z "$faults" ] && return 0
177
- deny "BLOCKED: работа к поставке не готова. Несошедшееся названо целиком — чтобы чинить его
178
- одним заходом, а не по одному промаху на круг:
182
+ deny "BLOCKED: the work is not ready for delivery. Everything unmet is named whole — so that it
183
+ is fixed in one session, not one miss per round:
179
184
 
180
185
  ${faults}"
181
186
  }
@@ -183,200 +188,142 @@ ${faults}"
183
188
  check_task() {
184
189
  number="$1"
185
190
  where="$2"
186
- # Колонку спрашивают там, где она уже должна быть переставлена. На заведении ветки её ещё
187
- # не двигали — паттерн работы переставляет колонку следующей командой, — и требование здесь
188
- # отбивало бы первую же команду работы вместе с той, которая его и снимает.
189
- judge_column="${3:-нет}"
191
+ # The column is asked about where it should already have been moved. At branch creation it has
192
+ # not been moved yet — the work pattern moves the column with the next command — and the
193
+ # requirement here would refuse the very first command of the work together with the one that
194
+ # lifts it.
195
+ judge_column="${3:-no}"
190
196
  rt_needs rt_task_state git-guard-delivery || return 0
191
197
  state="$(cd "$root" && rt_task_state "$number" 2>/dev/null)" || return 0
192
198
  [ -z "$state" ] && return 0
193
199
 
194
200
  printf '%s' "$state" | jq -e '.exists' >/dev/null 2>&1 \
195
- || fault "${where} ссылается на задачу #${number}, которой нет. Проверь номер или заведи задачу — ${task_new}."
201
+ || fault "${where} refers to the task #${number}, which does not exist. Check the number or create the task — ${task_new}."
196
202
  printf '%s' "$state" | jq -e '.open' >/dev/null 2>&1 \
197
- || fault "задача #${number} закрыта, а у задачи одна ветка. Работа за закрытой задачей заводится новой задачей — ${task_new}."
203
+ || fault "the task #${number} is closed, and a task has one branch. Work behind a closed task is created as a new task — ${task_new}."
198
204
  printf '%s' "$state" | jq -e '.onBoard' >/dev/null 2>&1 \
199
- || fault "задачи #${number} нет в очереди работ — правка за ней не видна. Очередь к репозиторию не привязана и задачу сама не забирает; добавь её и сверь — ${board_check}."
205
+ || fault "the task #${number} is not in the work queue — the edit behind it is invisible. The queue is not bound to the repository and does not take a task by itself; add it and check — ${board_check}."
200
206
  printf '%s' "$state" | jq -e '.assigned' >/dev/null 2>&1 \
201
- || fault "у задачи #${number} нет исполнителя — по очереди работ не видно, кто её взял. Поставь исполнителя${task_bot:+: }${task_bot}."
207
+ || fault "the task #${number} has no assignee — by the work queue there is no seeing who took it. Set the assignee${task_bot:+: }${task_bot}."
202
208
  printf '%s' "$state" | jq -e '.numbered' >/dev/null 2>&1 \
203
- || fault "заголовок задачи #${number} не начинается с её номера — одну работу придётся узнавать по тексту названия. Поправь заголовок и сверь очередь — ${board_check}."
209
+ || fault "the title of the task #${number} does not start with its number — one work would have to be recognised by the text of the title. Fix the title and check the queue — ${board_check}."
204
210
 
205
- # Колонка задачи. Ответ очереди работ отдаёт её давно, и не читал её никто: колонку судила
206
- # только сверка очереди, то есть уже после того, как PR открыт. Задача, оставшаяся в первой
207
- # колонке, читается по очереди как невзятая — работа при этом сделана и выложена.
208
- if [ -n "$backlog_column" ] && [ "$judge_column" = "да" ]; then
211
+ # The task column. The work queue answer has been giving it for a long time, and nobody read it:
212
+ # the column was judged only by the queue audit, that is, already after the PR is opened. A task
213
+ # left in the first column reads through the queue as not taken — while the work is done and put
214
+ # out.
215
+ if [ -n "$backlog_column" ] && [ "$judge_column" = "yes" ]; then
209
216
  column="$(printf '%s' "$state" | jq -r '.status // empty' 2>/dev/null)"
210
217
  [ "$column" = "$backlog_column" ] \
211
- && fault "задача #${number} стоит в колонке «${column}» — по очереди работ она не взята, хотя работа по ней идёт. Переставь её: ${task_move}."
218
+ && fault "the task #${number} stands in the column «${column}» — by the work queue it is not taken, though the work on it is going. Move it: ${task_move}."
212
219
  fi
213
220
 
214
221
  return 0
215
222
  }
216
223
 
217
- # --- заведение ветки ---------------------------------------------------------------------
224
+ # --- creating a branch -------------------------------------------------------------------
218
225
  branch_arg=''
219
- if printf '%s' "$cmd" | grep -qE '(^|[;&|[:space:]])git[[:space:]]+(checkout[[:space:]]+-b|switch[[:space:]]+-c)[[:space:]]'; then
220
- branch_arg="$(printf '%s' "$cmd" | sed -nE 's/.*git[[:space:]]+(checkout[[:space:]]+-b|switch[[:space:]]+-c)[[:space:]]+([^[:space:];&|]+).*/\2/p' | head -1)"
226
+ if printf '%s' "$cmd" | grep -qE '(^|[;&|[:space:]])git[[:space:]]+(checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c)[[:space:]]'; then
227
+ branch_arg="$(printf '%s' "$cmd" | sed -nE 's/.*git[[:space:]]+(checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c)[[:space:]]+([^[:space:];&|]+).*/\4/p' | head -1)"
221
228
  branch_arg="${branch_arg%\'}"; branch_arg="${branch_arg#\'}"
222
229
  branch_arg="${branch_arg%\"}"; branch_arg="${branch_arg#\"}"
223
230
  fi
224
231
 
225
232
  if [ -n "$branch_arg" ]; then
226
- # Имя, притворяющееся веткой под задачу, но не совпадающее с формой, — это промах в имени,
227
- # а не осознанная беззадачная ветка. Ловится до первого коммита.
228
- # Номер вынимает профиль: своя регулярка знала одну приставку — ключ задач, — и ветка вида
229
- # `feat/88-slug`, законная по форме того же профиля, номера не давала вовсе. Проверка формы
230
- # при заведении не срабатывала на ней ни разу, а сверка номеров пропускалась молча.
233
+ # A name pretending to be a branch for a task but not matching the form is a miss in the name,
234
+ # not a deliberate task-less branch. Caught before the first commit.
235
+ # The number is extracted by the profile: with its own regex the branch `feat/88-slug` gave no
236
+ # number at all.
231
237
  number_arg="$(rt_task_branch_number "$branch_arg")"
232
238
  if [ -n "$number_arg" ]; then
233
239
  rt_task_branch_ok "$branch_arg" \
234
- || deny "BLOCKED: имя ветки «${branch_arg}» не той формы, что принята здесь. Номер у ветки тот же, что у задачи и у заголовка заявки на слияние."
235
- check_task "$number_arg" "ветка «${branch_arg}»"
240
+ || deny "BLOCKED: the branch name «${branch_arg}» is not of the form accepted here. The branch number is the same as the number of the task and of the title of the merge request."
241
+ check_task "$number_arg" "the branch «${branch_arg}»"
236
242
 
237
- # Условия поставки, известные уже здесь, спрашиваются здесь. Прежде их спрашивали на
238
- # пуше и на открытии PR — то есть после того, как работа сделана: основание чинится
239
- # мержем с разбором конфликта, а подпись коммитов — переписыванием всей ветки. В
240
- # начале работы обе стоят одну команду.
243
+ # The delivery conditions already known here are checked here. After the work is done, the
244
+ # base is fixed by a merge with conflict resolution, and the commit signature by rewriting
245
+ # the branch; at the start of the work both cost one command.
241
246
  #
242
- # Основание: вершина главной ветки обязана лежать в том, от чего растёт новая ветка.
243
- # Ветка, заведённая от вчерашнего основания, узнаёт об этом на открытии PR — и узнаёт
244
- # так, что владелец видит её конфликтующей.
245
- #
246
- # Судится названное основание, а не вершина рабочей копии: команда, которой основание
247
- # как раз и берут свежим — `git checkout -b <ветка> origin/<главная>`, — иначе
248
- # отбивалась бы наравне с той, у которой основание вчерашнее.
249
- base_arg="$(printf '%s' "$cmd" | sed -nE 's/.*git[[:space:]]+(checkout[[:space:]]+-b|switch[[:space:]]+-c)[[:space:]]+[^[:space:];&|]+[[:space:]]+([^[:space:];&|-][^[:space:];&|]*).*/\2/p' | head -1)"
247
+ # The base: the tip of the main branch must lie in what the new branch grows from. The named
248
+ # base is checked, not the tip of the working copy: otherwise the command that takes the
249
+ # base fresh — `git checkout -b <branch> origin/<main>` — would be forbidden.
250
+ base_arg="$(printf '%s' "$cmd" | sed -nE 's/.*git[[:space:]]+(checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c)[[:space:]]+[^[:space:];&|]+[[:space:]]+([^[:space:];&|-][^[:space:];&|]*).*/\4/p' | head -1)"
250
251
  base_ref="${base_arg:-HEAD}"
251
252
  if git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" >/dev/null 2>&1 \
252
253
  && git rev-parse --verify --quiet "$base_ref" >/dev/null 2>&1 \
253
254
  && ! git merge-base --is-ancestor "origin/${main_branch}" "$base_ref" 2>/dev/null; then
254
255
  behind="$(git rev-list --count "${base_ref}..origin/${main_branch}" 2>/dev/null)"
255
- fault "ветка вырастет из основания, в котором нет вершины «${main_branch}» — она ушла вперёд на ${behind:-несколько} коммитов. Возьми свежее основание: git fetch origin && git checkout -b ${branch_arg} origin/${main_branch}."
256
+ fault "the branch will grow from a base that does not carry the tip of «${main_branch}» — it has moved ahead by ${behind:-several} commits. Take a fresh base: git fetch origin && git checkout -b ${branch_arg} origin/${main_branch}."
256
257
  fi
257
258
 
258
- # Второй ярус: локальная ссылка на главную ветку сама могла протухнуть, и тогда молчание
259
- # первого яруса значит «основание не старше моей ссылки», а не «основание свежее».
260
- # Ответа нет — ярус молчит, как и везде, где гард ходит в сеть.
259
+ # The second tier: the local reference to the main branch could itself have gone stale, and
260
+ # then the silence of the first tier means "the base is not older than my reference", not
261
+ # "the base is fresh". No answer — the tier stays silent, as everywhere the guard goes to
262
+ # the network.
261
263
  remote_head="$(GIT_HTTP_LOW_SPEED_LIMIT=1000 GIT_HTTP_LOW_SPEED_TIME=5 GIT_TERMINAL_PROMPT=0 \
262
264
  git ls-remote origin "refs/heads/${main_branch}" 2>/dev/null | cut -f1)"
263
265
  local_head="$(git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" 2>/dev/null)"
264
266
  if [ -n "$remote_head" ] && [ -n "$local_head" ] && [ "$remote_head" != "$local_head" ]; then
265
- fault "твоя ссылка origin/${main_branch} отстала от удалённой — ${local_head:0:8} против ${remote_head:0:8}. Ветка вырастет из вчерашнего дерева, и увидит это владелец на открытии заявки. Подтяни и повтори: git fetch origin."
267
+ fault "your ref origin/${main_branch} lags behind the remote one — ${local_head:0:8} against ${remote_head:0:8}. The branch will grow from yesterday tree, and the owner sees that at the opening of the request. Pull and repeat: git fetch origin."
266
268
  fi
267
269
 
268
- # Подпись: почта машинной записи объявлена деревом, а рабочая копия её не знает —
269
- # значит первый же коммит уедет за чужой подписью, и чинить это придётся после пуша
270
- # силовой отправкой.
270
+ # The signature: the address of the machine account is declared by the tree, and the working
271
+ # copy does not know it — which means the very first commit will travel under someone else's
272
+ # signature, and after the push that is fixed only by a force push.
271
273
  if [ -n "$commit_email" ]; then
272
274
  tree_email="$(git config user.email 2>/dev/null)"
273
275
  [ -n "$tree_email" ] && [ "$tree_email" != "$commit_email" ] \
274
- && fault "рабочая копия подписывает коммиты как «${tree_email}», а дерево объявило почтой машинной записи «${commit_email}». Первый же коммит уедет за чужой подписью: git config user.email \"${commit_email}\"."
276
+ && fault "the working copy signs commits as «${tree_email}», while the tree declared the email of the machine account «${commit_email}». The very first commit leaves under a foreign signature: git config user.email \"${commit_email}\"."
275
277
  fi
276
278
 
277
279
  deny_faults
278
280
  fi
279
- # Ветка без номера законна и живёт локально: заявка с неё не откроется.
281
+ # A branch without a number is lawful and lives locally: no PR opens from it.
280
282
  exit 0
281
283
  fi
282
284
 
283
- # --- подпись машинного коммита ------------------------------------------------------------
284
- # Предмет живёт помощником рядом — `git-guard-delivery-signature.sh`: гард дорос до предела
285
- # длины, и подпись среди его предметов самая отдельная. Нет помощника — подпись не судится, а
286
- # работа идёт дальше: это тот же отказ в пользу работы, что и у остальных условий.
285
+ # --- the machine commit signature ----------------------------------------------------------
286
+ # The subject lives in a helper next door — `git-guard-delivery-signature.sh`: the guard grew up to
287
+ # the length limit, and the signature is the most separate of its subjects. No helper — the
288
+ # signature is not judged, and the work goes on: the same fail-open as with the other conditions.
287
289
  # shellcheck disable=SC1090
288
290
  [ -f "$rt_hooks_dir/git-guard-delivery-signature.sh" ] \
289
291
  && . "$rt_hooks_dir/git-guard-delivery-signature.sh" 2>/dev/null
290
292
  command -v rt_delivery_signature >/dev/null 2>&1 && rt_delivery_signature
291
293
 
292
- # --- снятие черновика --------------------------------------------------------------------
293
- #
294
- # Ревьювера до этой правки не спрашивал никто. Он стоял прозой в правиле, а хостинг запрос
295
- # разбора на самого себя принимает молча и не создаёт: разбор при этом выглядит запрошенным.
296
- # Раньше снятия черновика спросить негде — до открытия заявки ревьювера нет вовсе, — а само
297
- # снятие и есть тот ход, которым работа объявляется готовой.
298
- #
299
- # Ярус сетевой, и молчит он так же, как ярус состояния задачи: нет ответа — нет требования.
300
- #
301
- # Возврат заявки в черновик под требование не подпадает: он делает ровно то, чего гард и
302
- # добивается, — снимает с работы вид готовой.
303
- if printf '%s' "$cmd" | grep -qE "${RT_CMD_BOUND}(gh[[:space:]]+pr[[:space:]]+ready|glab[[:space:]]+mr[[:space:]]+update[^|;&]*--ready)([[:space:]]|\$)" \
304
- && ! printf '%s' "$cmd" | grep -q -- '--undo'; then
305
- # Ссылка на заявку необязательна: без неё клиент берёт заявку текущей ветки, и это самая
306
- # короткая форма вызова. Требовать номер значило бы снимать всё требование одним пробелом.
307
- # Поэтому берётся первый довод, каким бы он ни был — номер, адрес или имя ветки, — а его
308
- # отсутствие означает «спроси про текущую ветку».
309
- pull_ref="$(printf '%s' "$cmd" | sed -nE 's/.*(gh[[:space:]]+pr[[:space:]]+ready|glab[[:space:]]+mr[[:space:]]+update)[[:space:]]+([^[:space:];&|-][^[:space:];&|]*).*/\2/p' | head -1)"
310
- if rt_needs rt_pull_state git-guard-delivery; then
311
- pull="$(cd "$root" && rt_pull_state "$pull_ref" 2>/dev/null)" || pull=''
312
- if [ -n "$pull" ] && printf '%s' "$pull" | jq -e '.exists' >/dev/null 2>&1; then
313
- # Номер берётся из ответа, а если его там нет — из самой команды: заявка,
314
- # названная адресом или именем ветки, в отказе должна остаться узнаваемой.
315
- pull_name="$(printf '%s' "$pull" | jq -r '.number // empty' 2>/dev/null)"
316
- # Номер пишется с решёткой, а имя ветки или адрес — в кавычках: решётка перед
317
- # адресом читается как опечатка, а не как ссылка на заявку.
318
- [ -z "$pull_name" ] && pull_name="$pull_ref"
319
- case "$pull_name" in
320
- '') ;;
321
- *[!0-9]*) pull_name=" «${pull_name}»" ;;
322
- *) pull_name=" #${pull_name}" ;;
323
- esac
324
- printf '%s' "$pull" | jq -e '.reviewed' >/dev/null 2>&1 \
325
- || fault "у заявки${pull_name} нет разбора: ревьювер не запрошен и отзыва никто не оставлял. Снятый черновик читается как «можно вливать», а вливать некому — назначь ревьювера и повтори."
326
-
327
- # Конфликт приезжает в отданную заявку чужим слиянием, без единого действия её
328
- # автора: основание, проверенное на открытии, к моменту снятия черновика уже
329
- # вчерашнее. Снятый черновик читается как «можно вливать», а вливать нечего —
330
- # владелец открывает заявку и находит там конфликт. Молчание при неизвестной
331
- # сливаемости остаётся: хостинг считает её заново после каждой правки главной ветки,
332
- # и «ещё не посчитано» — не «конфликтует».
333
- printf '%s' "$pull" | jq -e '.conflicting' >/dev/null 2>&1 \
334
- && fault "заявка${pull_name} конфликтует с главной веткой. Влей её в свою ветку, разбери конфликт и повтори: снятый черновик читается как «можно вливать», а слить эту заявку нельзя."
335
-
336
- # Автор заявки. На открытии судить было нечем, кроме текста команды: личность вызова
337
- # приходит окружением. Здесь она уже названа хостингом, и это последний ход, где
338
- # промах ещё исправим — после снятия черновика заявку вливают, а переоткрыть влитую
339
- # нельзя. Дерево, не назвавшее машинной записи, автора не судит.
340
- if [ -n "$task_bot" ]; then
341
- pull_author="$(printf '%s' "$pull" | jq -r '.author // empty' 2>/dev/null)"
342
- [ -n "$pull_author" ] && [ "$pull_author" != "$task_bot" ] \
343
- && fault "заявку${pull_name} открыла запись «${pull_author}», а не машинная «${task_bot}». Автор заявки её ревьювером не бывает, и разбор ей назначить нечем. Автора не сменить — закрой заявку и открой заново${pull_token_hint:+, подставив токен: ${pull_token_hint} …}."
344
- fi
345
- fi
346
- fi
347
-
348
- # Папка задачи: тот же предмет, что на открытии и на слиянии, третьим рубежом. Условие
349
- # местное — оно читает ветку, а не хостинг, — и потому стоит вне сетевого яруса выше.
350
- command -v rt_delivery_ready_folder >/dev/null 2>&1 && rt_delivery_ready_folder
351
-
352
- deny_faults
353
- fi
294
+ # --- leaving draft ---------------------------------------------------------------------------
295
+ # The subject lives in a helper next door — `git-guard-delivery-draft.sh`, by the same technique as
296
+ # the signature. No helper — leaving draft is not judged, and the work goes on.
297
+ # shellcheck disable=SC1090
298
+ [ -f "$rt_hooks_dir/git-guard-delivery-draft.sh" ] \
299
+ && . "$rt_hooks_dir/git-guard-delivery-draft.sh" 2>/dev/null
300
+ command -v rt_delivery_draft_ready >/dev/null 2>&1 && rt_delivery_draft_ready
354
301
 
355
- # --- слияние заявки ----------------------------------------------------------------------
302
+ # --- merging a PR --------------------------------------------------------------------------
356
303
  #
357
- # Второй рубеж того же условия, что стоит на открытии заявки: он ловит слияние, идущее командой.
358
- # Команду ищем от начала строки или после разделителя, а не где угодно в тексте. Иначе гард
359
- # отбивает сообщение, где `gh pr merge` просто упомянут в кавычках, — так он и сработал на
360
- # правке этого же текста. Полностью подстроку в кавычках так не отсечь, но случайное упоминание
361
- # внутри слова или пути мимо уже не пройдёт.
304
+ # The second line of the same condition that stands at the opening of a PR: it catches a merge going
305
+ # by command. We look for the command from the start of the line or after a separator, not anywhere
306
+ # in the text. Otherwise the guard refuses a message where `gh pr merge` is merely mentioned in
307
+ # quotes — that is how it fired on an edit of this very text. A quoted substring cannot be cut off
308
+ # entirely this way, but an accidental mention inside a word or a path no longer gets through.
362
309
  if printf '%s' "$cmd" | grep -qE "${RT_CMD_BOUND}(gh[[:space:]]+pr[[:space:]]+merge|glab[[:space:]]+mr[[:space:]]+merge|az[[:space:]]+repos[[:space:]]+pr[[:space:]]+update)([[:space:]]|\$)"; then
363
310
  rt_delivery_merge_folder
364
311
  fi
365
312
 
366
- # --- открытие заявки на слияние ----------------------------------------------------------
367
- # Команду ищем от начала строки или после разделителя — по той же причине, что и слияние:
368
- # упоминание в кавычках командой не является.
313
+ # --- opening a PR --------------------------------------------------------------------------
314
+ # We look for the command from the start of the line or after a separator — for the same reason as
315
+ # with the merge: a mention in quotes is not a command.
369
316
  printf '%s' "$cmd" \
370
317
  | grep -qE "${RT_CMD_BOUND}(gh[[:space:]]+pr[[:space:]]+create|glab[[:space:]]+mr[[:space:]]+create|az[[:space:]]+repos[[:space:]]+pr[[:space:]]+create)([[:space:]]|\$)" \
371
318
  || exit 0
372
319
 
373
320
  branch="$(git branch --show-current 2>/dev/null)"
374
- [ -z "$branch" ] && exit 0 # открепившийся HEAD — не про этот случай
321
+ [ -z "$branch" ] && exit 0 # a detached HEAD is not about this case
375
322
 
376
- # Локальная ветка без номера законна, а заявка с неё — уже нет: правка, доезжающая до главной
377
- # ветки, начинается с задачи. Это единственное место, где беззадачная ветка упирается.
323
+ # A local branch without a number is lawful, and a PR from it is not: an edit that travels to the
324
+ # main branch starts from a task. This is the only place where a task-less branch runs into a wall.
378
325
  rt_task_branch_ok "$branch" \
379
- || deny "BLOCKED: заявка с ветки «${branch}», за которой не стоит задачи. Правка начинается с задачи, видимой в очереди работ: заведи её — ${task_new} — и перенеси работу в ветку с её номером."
326
+ || deny "BLOCKED: a request from the branch «${branch}», with no task standing behind it. An edit begins with a task visible in the work queue: create it — ${task_new} — and move the work into a branch with its number."
380
327
 
381
328
  number="$(rt_task_branch_number "$branch")"
382
329
 
@@ -391,84 +338,94 @@ fi
391
338
 
392
339
  if [ -n "$title" ]; then
393
340
  printf '%s' "$title" | grep -qE "$title_re" \
394
- || fault "заголовок заявки не начинается с номера задачи. В списке заявок тела не видно, а строка связи живёт именно там — без номера в заголовке PR с задачей не сопоставить."
395
- # Номер вынимается из той части заголовка, которую признала сама форма, а не второй
396
- # регуляркой рядом. Своя регулярка знает только пакетную форму: дерево, замостившее форму
397
- # своей, получало пустой номер — и сверка номера заголовка с номером ветки молча не
398
- # выполнялась вовсе, выглядя при этом сошедшейся.
341
+ || fault "the title of the request does not start with the number of the task. In the list of requests the body is invisible, and the line of the link lives exactly there — without the number in the title the PR cannot be matched to the task."
342
+ # The number is extracted from the part of the title the form itself recognised, not by a second
343
+ # regex next to it. The own regex knows only the package form: a tree that paved the form over
344
+ # with its own got an empty number — and the check of the title number against the branch number
345
+ # silently did not run at all, while looking as if it had come together.
399
346
  title_matched="$(printf '%s' "$title" | grep -oE "$title_re" | head -1)"
400
347
  title_number="$(printf '%s' "$title_matched" | grep -oE '[A-Za-z]+-[0-9]+' | head -1 | sed -E 's/^[A-Za-z]+-//')"
401
348
  if [ -n "$number" ] && [ -n "$title_number" ]; then
402
349
  [ "$title_number" = "$number" ] \
403
- || fault "в заголовке заявки номер ${title_number}, у ветки — ${number}. Задача, ветка и PR несут один и тот же номер."
350
+ || fault "the title of the request carries the number ${title_number}, the branch — ${number}. The task, the branch and the PR carry one and the same number."
404
351
  fi
405
352
  fi
406
353
 
407
- # Главная ветка влита до открытия PR. PR от разошедшейся ветки показывает ревьюверу свою
408
- # правку вперемешку с чужой, а проверки на нём гоняются от устаревшего основания.
409
- #
410
- # Ярусов два, и порядок между ними такой же, как у проверки задачи. Первый читает локальную
411
- # вершину и работает без сети. Второй спрашивает удалённую ссылку — без него молчание гарда
412
- # значит лишь «твоя ссылка не старше твоей ветки», а читается как «главная ветка влита»: ровно
413
- # так открытый PR и оказался конфликтующим, и узнал об этом владелец.
354
+ # The main branch is merged in before the PR opens: otherwise the reviewer sees someone else's edit
355
+ # mixed in with his own, and the checks run from an outdated base.
414
356
  #
415
- # Сеть здесь допустима по той же причине, по которой её зовёт проверка очереди работ ниже:
416
- # отсутствие ответа пропускается молча, и проверка, падающая в самолёте, не отбивает работу.
417
- # Предел ожидания задаётся переменными самого git — внешний `timeout` есть не на всякой машине.
357
+ # There are two tiers. The first reads the local tip and works without the network. The second asks
358
+ # the remote reference: without it, silence means only "the local reference is not older than the
359
+ # branch", while it reads as "the main branch is merged in". No answer from the network — a silent
360
+ # skip; the waiting limit is set by git variables, an external `timeout` is not on every machine.
418
361
  if git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" >/dev/null 2>&1 \
419
362
  && ! git merge-base --is-ancestor "origin/${main_branch}" HEAD 2>/dev/null; then
420
363
  behind="$(git rev-list --count "HEAD..origin/${main_branch}" 2>/dev/null)"
421
- fault "«${main_branch}» ушла вперёд на ${behind:-несколько} коммитов, а в ветку не влита. PR от разошедшейся ветки показывает ревьюверу правку вперемешку с чужой, а проверки на нём идут от устаревшего основания. Влей и повтори: git fetch origin && git merge origin/${main_branch} — порядок и разбор конфликта в паттерне git-workflow-merge."
364
+ fault "«${main_branch}» has moved ahead by ${behind:-several} commits and is not merged into the branch. A PR from a diverged branch shows the reviewer the edit mixed with someone else, and the checks on it run from a stale base. Merge it in and repeat: git fetch origin && git merge origin/${main_branch} — the order and the resolving of the conflict are in the pattern git-workflow-merge."
422
365
  fi
423
366
 
424
- # Второй ярус: локальная ссылка сама могла протухнуть. Ответа нет — ярус молчит.
367
+ # The second tier: the local reference could itself have gone stale. No answer — the tier stays
368
+ # silent.
425
369
  remote_main="$(GIT_HTTP_LOW_SPEED_LIMIT=1000 GIT_HTTP_LOW_SPEED_TIME=5 GIT_TERMINAL_PROMPT=0 \
426
370
  git ls-remote origin "refs/heads/${main_branch}" 2>/dev/null | cut -f1)"
427
371
  local_main="$(git rev-parse --verify --quiet "refs/remotes/origin/${main_branch}" 2>/dev/null)"
428
372
  if [ -n "$remote_main" ] && [ -n "$local_main" ] && [ "$remote_main" != "$local_main" ]; then
429
- # Возраст ссылки — то, чего исполнитель не видит вовсе, и именно он отличает «ветка
430
- # отстала» от «я не знаю, отстала ли». Формат `stat` на BSD и на GNU разный, поэтому
431
- # спрашиваются оба, а не угадывается система.
373
+ # The age of the reference is what the executor does not see at all, and it is exactly what
374
+ # tells "the branch is behind" from "I do not know whether it is behind". The `stat` format
375
+ # differs on BSD and on GNU, so both are asked instead of guessing the system.
432
376
  fetch_head="$(git rev-parse --git-dir 2>/dev/null)/FETCH_HEAD"
433
377
  fetched_at="$(stat -f %m "$fetch_head" 2>/dev/null || stat -c %Y "$fetch_head" 2>/dev/null)"
434
378
  age=''
435
379
  if [ -n "$fetched_at" ]; then
436
- age=" Последний git fetch — $(( ( $(date +%s) - fetched_at ) / 60 )) мин. назад."
380
+ age=" The last git fetch was $(( ( $(date +%s) - fetched_at ) / 60 )) min ago."
437
381
  fi
438
- fault "твоя ссылка origin/${main_branch} отстала от удалённой — ${local_main:0:8} против ${remote_main:0:8}.${age} Гард сравнивает ветку с тем, что лежит в дереве, поэтому молчание первого яруса значит «ссылка не старше ветки», а не «главная ветка влита». Влей и повтори: git fetch origin && git merge origin/${main_branch}."
382
+ fault "your ref origin/${main_branch} lags behind the remote one — ${local_main:0:8} against ${remote_main:0:8}.${age} The guard compares the branch with what lies in the tree, so silence of the first tier means «the ref is not older than the branch», not «the main branch is merged in». Merge it in and repeat: git fetch origin && git merge origin/${main_branch}."
439
383
  fi
440
384
 
441
- # Личность вызова. Клиент хостинга держит две записи сразу — залогиненную и ту, чей токен стоит
442
- # в окружении вызова, — и какая из них откроет заявку, из текста команды не видно ничем, кроме
443
- # явной подстановки. Читающие вызовы идут от залогиненной и работают, поэтому пишущий выглядит
444
- # таким же обычным; промах всплывает шагом позже, на назначении ревьювера: автор заявки её
445
- # ревьювером не бывает. Чинится это только переоткрытием — автора у заявки не сменить.
385
+ # The identity of the call. The hosting client holds two accounts — the logged-in one and the one
386
+ # whose token stands in the call environment; which of them opens the PR is visible from the command
387
+ # only through an explicit substitution. The miss surfaces on assigning the reviewer: the author of
388
+ # a PR is never its reviewer, and the author cannot be changed.
446
389
  #
447
- # Судится текст команды, а не ответ хостинга: спросить, чьим токеном пойдёт вызов, до его
448
- # исполнения нельзя. Дерево, не назвавшее переменной токена, требования не получает.
390
+ # The command text is checked. A tree that named no token variable gets no requirement.
449
391
  if [ -n "$pull_token_var" ] \
450
392
  && ! printf '%s' "$cmd" | grep -qE "(^|[;&|(]|&&|\|\||[[:space:]])${pull_token_var}="; then
451
- fault "заявка открывается без токена машинной записи: в команде нет подстановки «${pull_token_var}». Открытая залогиненной записью, она выйдет от владельца — ревьювером его тогда не назначить, и чинится это только переоткрытием.${pull_token_hint:+ Подставь токен: ${pull_token_hint} …}"
393
+ fault "the request is opened without the token of the machine account: the command carries no substitution of «${pull_token_var}». Opened by the logged-in account, it comes out from the owner — they cannot be set as the reviewer then, and this is fixed only by reopening.${pull_token_hint:+ Substitute the token: ${pull_token_hint} …}"
452
394
  fi
453
395
 
454
- # Тело заявки несёт раздел об оставшемся шаге, и несёт его с минуты открытия. Требование
455
- # записано было и прежде — прозой в паттерне закрытия работы, ниже того места, где описано само
456
- # открытие: читающий доходил до открытия, открывал и раздела ещё не прочитал. Так заявка и
457
- # уехала без него, а владелец влил её кнопкой, пока шёл прогон.
396
+ # The second tier of the same identity: who actually arrives under this token. A substitution speaks
397
+ # of the intent, not of the result: it read a file that is not on the machine, the client took an
398
+ # empty string for an unset token, and the PR came out from the owner under a command that looked
399
+ # right.
458
400
  #
459
- # Судится текст команды: тело приходит доводом либо файлом, и оба вида читаются здесь же. Файл
460
- # читается с диска — к моменту разбора он уже написан. Ни того ни другого в команде нет —
461
- # требования нет: заявка без тела вовсе судится строкой выше, а не этой.
401
+ # The hosting is asked by the tree, not by the package: the hosting, the client and the path to the
402
+ # token are each their own. An empty answer means "asking did not work out": the call is let through,
403
+ # and this is reported — a silent skip is indistinguishable from a check that came together.
404
+ if [ -n "$task_bot" ] && command -v rt_pull_token_login >/dev/null 2>&1; then
405
+ token_login="$(rt_pull_token_login 2>/dev/null)"
406
+ if [ -z "$token_login" ]; then
407
+ printf 'the delivery guard: who arrives by the token could not be asked — the check against the answer of the hosting is skipped.\n' >&2
408
+ elif [ "$token_login" != "$task_bot" ]; then
409
+ fault "by the token of the call the hosting answers with the account «${token_login}», not the machine one «${task_bot}»: the substitution is in the command, but the value is empty or foreign — that is how a request comes out from the owner. Check that the token file is in place and readable${pull_token_hint:+: ${pull_token_hint}}."
410
+ fi
411
+ fi
412
+
413
+ # The PR body carries the section about the remaining step from the minute it opens: without it the
414
+ # owner merges the PR by the button while the run is still going. The body arrives either as an
415
+ # argument or as a file, both are read here; by the time of the parse the file is already written.
416
+ # Neither one nor the other — there is no requirement: a PR without a body is checked by the line
417
+ # above. The flag is recognised only as a separate word: the tail `-b` of a branch name in the base
418
+ # argument read as the body flag, and the next word of the command became the body.
462
419
  if [ -n "$pull_body_section" ]; then
463
420
  body=''
464
421
  if command -v perl >/dev/null 2>&1; then
465
422
  body="$(printf '%s' "$cmd" | perl -0ne '
466
- if (/(?:--body|-b)(?:=|\s+)(?:"((?:[^"\\]|\\.)*)"|\x27([^\x27]*)\x27|(\S+))/s) {
423
+ if (/(?:^|\s)(?:--body|-b)(?:=|\s+)(?:"((?:[^"\\]|\\.)*)"|\x27([^\x27]*)\x27|(\S+))/s) {
467
424
  print defined $1 ? $1 : (defined $2 ? $2 : $3);
468
425
  }
469
426
  ' 2>/dev/null)"
470
427
  body_file="$(printf '%s' "$cmd" | perl -0ne '
471
- if (/(?:--body-file|-F)(?:=|\s+)(?:"((?:[^"\\]|\\.)*)"|\x27([^\x27]*)\x27|(\S+))/s) {
428
+ if (/(?:^|\s)(?:--body-file|-F)(?:=|\s+)(?:"((?:[^"\\]|\\.)*)"|\x27([^\x27]*)\x27|(\S+))/s) {
472
429
  print defined $1 ? $1 : (defined $2 ? $2 : $3);
473
430
  }
474
431
  ' 2>/dev/null)"
@@ -476,23 +433,20 @@ if [ -n "$pull_body_section" ]; then
476
433
  fi
477
434
 
478
435
  if [ -n "$body" ] && ! printf '%s' "$body" | grep -qE "$pull_body_section"; then
479
- fault "в теле заявки нет раздела об оставшемся шаге. Кнопку слияния нажимает человек на хостинге, где гардов нет, и вливает он, как только видит зелёное: всё, чем требование там держится, — то, что владелец прочитал на странице. Раздел стоит последним и говорит ровно одно — осталось ли что-то до слияния; переписывается он тем же вызовом, которым правится тело."
436
+ fault "the body of the request carries no section about the remaining step. The merge button is pressed by a person on the hosting, where there are no guards, and they merge as soon as they see green: all that holds the requirement there is what the owner read on the page. The section stands last and says exactly one thing — whether anything is left before the merge; it is rewritten by the same call that edits the body."
480
437
  fi
481
438
  fi
482
439
 
483
- check_task "$number" "заявка с ветки «${branch}»" да
440
+ check_task "$number" "the request from the branch «${branch}»" yes
484
441
 
485
- # Папка задачи разбирается до открытия заявки, а не после одобрения. Прежде здесь стояло
486
- # напоминание, а требование — на слиянии: считалось, что папка нужна на диске всё время
487
- # разбора, потому что правку по замечаниям без замысла отбивает гард хода работы. Владелец же
488
- # вливает, как только видит зелёное, и закрывающему коммиту места не остаётся — трижды подряд
489
- # папка уехала в главную неразобранной, а гард слияния этого не видел вовсе: кнопку нажимает
490
- # человек на хостинге, и до него гард не достаёт. Разбор переехал сюда, а замысел после уборки
491
- # гард хода работы берёт из истории ветки, а не с диска.
442
+ # The task folder is taken apart before the PR opens, not after the approval: the owner merges as
443
+ # soon as he sees green, and no room is left for a closing commit — three times in a row the folder
444
+ # travelled into the main branch without being taken apart. After the cleanup the progress guard
445
+ # takes the plan from the branch history.
492
446
  rt_delivery_open_folder
493
447
 
494
- # Всё несошедшееся названо здесь, разом: до этой строки собирались условия, каждое из которых
495
- # прежде отбивало вызов в одиночку.
448
+ # Everything that did not come together is named here, all at once: up to this line the conditions
449
+ # were being collected, each of which used to refuse the call on its own.
496
450
  deny_faults
497
451
 
498
452
  exit 0