@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
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env bash
2
+ # The patterns of the turn-exit guard. NOT a guard: it has no `rt-hook:` declaration and hooks into
3
+ # no agent event. The turn-exit guard sources it — the same way guards source the shared reading of
4
+ # the input and the deny tail. It was moved out when the guard outgrew the file length limit: the
5
+ # patterns and the reasons beside them read apart from the tiers that apply them.
6
+ #
7
+ # Every pattern is a shell variable; the guard passes them as arguments to the parsing of the turn
8
+ # record.
9
+
10
+ # A command that changes the tree or its state. Reading and searching are deliberately not included
11
+ # here: they are exactly what a stalled turn is filled with.
12
+ #
13
+ # Output redirection is not here, and it was taken out after an analysis: the guard refused two
14
+ # turns out of the seven that stood without work, and counted five as work by that very sign. The
15
+ # body of a future PR was written into the session's temporary directory — outside the working tree
16
+ # — and one of the waits carried only a diversion of the error stream into the null device. Neither
17
+ # of the two changes the tree, and to the pattern they were indistinguishable from writing to a
18
+ # working file: it saw the arrow itself and did not ask where it led. What stays as the sign is an
19
+ # edit of a file by the editing tool and the commands listed here.
20
+ work_re='git (add|commit|push|checkout|merge|rm)|npm run|pnpm (run|exec)|nx (build|test|run)|gh (pr|issue|api|run)|task:(new|move)|mkdir|cp |mv |rm |sed -i|tee '
21
+
22
+ # Exploration. The same words as in the work pattern, but the subcommand is a reading one:
23
+ # switching a branch, pulling, looking through the history, reading PRs and runs. The work pattern
24
+ # calls them work, because it knows only the first word — `git` and `gh` stand in it whole — and a
25
+ # turn in which the executor switched to the main branch, read the history and wrote the owner a
26
+ # report left here with a zero. The analysis is the record
27
+ # "2026-08-25-read-only-turn-counted-as-work" in the intake.
28
+ #
29
+ # Exploration looks like work better than anything else: it has commands, numbers and exact answers.
30
+ # That is what makes it dangerous — a turn stuffed with it reads as full both to the owner and to
31
+ # the session itself.
32
+ read_re='^[[:space:]]*(([^[:space:]]*/)?git[[:space:]]+(show|log|ls-tree|ls-files|ls-remote|diff|status|branch|tag|rev-parse|remote|describe|blame|fetch|pull|(checkout|switch)(?!([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-[bc][[:space:]]))|([^[:space:]]*/)?gh[[:space:]]+(pr|issue|run|repo)[[:space:]]+(list|view|status|checks|diff|download|logs))([[:space:]]|$)'
33
+
34
+ # The parts of a compound command are judged one by one: a turn gathers reading and work into one
35
+ # line through `&&`, and judging it whole would release exploration on the very first changing part.
36
+ part_re='&&|\|\||;|\n'
37
+
38
+ # Waiting for someone else's step. A run, the owner's review and a merge go on without the executor
39
+ # and do not get faster from being looked at — the rule says outright that this is never a work
40
+ # state. Only the LAST action of the turn is judged: waiting in the middle is lawful, and starting
41
+ # work in the background stays work. The analysis is the record "2026-08-25-turn-ended-on-waiting"
42
+ # in the intake.
43
+ #
44
+ # The former sign asked one thing: was there work during the turn. A turn where a conflict was
45
+ # resolved, a commit and a push were made, and the last action became a loop until the run was ready
46
+ # passed it whole — there was work, and plenty. It is exactly that fullness that deceives: the
47
+ # emptiness behind such a turn is not visible.
48
+ wait_re='gh[[:space:]]+(run[[:space:]]+watch|pr[[:space:]]+checks[^|]*--watch)|until[[:space:]].*sleep|while[[:space:]].*sleep|^[[:space:]]*sleep[[:space:]]'
49
+
50
+ # Handing work over and starting the next. The rule calls handed-over work a lawful end of a turn —
51
+ # but on a condition: the next one is started, and an ACTION has been done on it, not spoken.
52
+ handover_re='gh[[:space:]]+pr[[:space:]]+create'
53
+ started_re='task:new|task:move|board\.mjs[[:space:]]+move|git[[:space:]]+checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|git[[:space:]]+switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c'
54
+
55
+ # The end of an epic: there waiting for the word of the owner is the work itself, and the guard of
56
+ # the stop refuses taking the next task. The reading lies apart and is shared by the three guards;
57
+ # it goes to the hosting, so the guard asks it right before a refusal, not on every turn.
58
+ rt_te_epic_over() {
59
+ # shellcheck disable=SC1090
60
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/epic-over.sh" 2>/dev/null || return 1
61
+ command -v rt_epic_over >/dev/null 2>&1 || return 1
62
+ rt_epic_over
63
+ }
@@ -1,18 +1,21 @@
1
1
  #!/usr/bin/env bash
2
- # Локаль исполнения гарда. Подключается первой строкой тела: `. "<каталог гардов>/utf8.sh"`.
2
+ # The locale a guard runs in. Sourced as the first line of the body: `. "<guards directory>/utf8.sh"`.
3
3
  #
4
- # Образцы гардов написаны словами того языка, на котором говорит дерево, и совпадение с ними
5
- # зависит от локали процесса. В локали C складывание регистра работает только для латиницы:
6
- # «В дереве этого нет» под образцом `(в дереве|здесь)…` не находится вовсе, гард выходит нулём
7
- # и пропускает ход, который обязан был вернуть. Счёт `{0,30}` там же считает байты, а не буквы,
8
- # и буква вне латиницы весит два.
4
+ # NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The guards source it
5
+ # as the first line of their body: the locale is one for all of them.
9
6
  #
10
- # Заметить это на своей машине нечем: терминал разработчика идёт в UTF-8, а служба, запускающая
11
- # ту же работу, наследует пустую локаль. Три сценария так и падали в конвейере, проходя на
12
- # машине, где их писали.
7
+ # Guard patterns are written in the words of the language the tree speaks, and matching against
8
+ # them depends on the process locale. In the C locale case folding works only for Latin letters:
9
+ # «В дереве этого нет» is not found under the pattern `(в дереве|здесь)…` at all, the guard exits
10
+ # with zero and lets through the turn it was bound to return. The `{0,30}` count there counts bytes,
11
+ # not letters, and a non-Latin letter weighs two.
13
12
  #
14
- # FAIL-OPEN: локали UTF-8 в системе не нашлось — ничего не объявляется, и гард работает как
15
- # прежде. Отобрать у него работу из-за отсутствия локали хуже, чем оставить прежнее поведение.
13
+ # There is nothing to notice this with on one's own machine: the developer's terminal runs in UTF-8,
14
+ # while the service that runs the same work inherits an empty locale. Three scenarios failed in the
15
+ # pipeline exactly so, passing on the machine where they were written.
16
+ #
17
+ # FAIL-OPEN: no UTF-8 locale found in the system — nothing is declared, and the guard works as
18
+ # before. Taking its work away over a missing locale is worse than keeping the old behaviour.
16
19
 
17
20
  rt_use_utf8_locale() {
18
21
  case "${LC_ALL:-${LC_CTYPE:-${LANG:-}}}" in
@@ -1,37 +1,38 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: Stop
3
- # Требует: hooks/deny-tail.sh
4
- # Гард ожидания: ход, сообщающий владельцу о чужом шаге, не заканчивается, пока в нём не было ни
5
- # одного действия по следующей задаче. Stop.
3
+ # Requires: hooks/deny-tail.sh, hooks/epic-over.sh
4
+ # Waiting guard: a turn that tells the owner about someone else's step does not end until it holds
5
+ # at least one action on the next task. Stop.
6
6
  #
7
- # Зачем именно так. Статья «ожидание прогона работой не занимают» держится памятью исполнителя, и
8
- # держится плохо: образец сообщения владельцу кончается фразой о следующей задаче, а фраза
9
- # исполняется как обещание — заход произносит её и кончает ход. Ход, в котором не сделано ничего,
10
- # ничем себя не выдаёт: ни правкой файла, ни командой, — и промах виден только владельцу, только
11
- # по тому, что работа не двигается, и только когда он спросит прямо.
7
+ # Why this way. The article "waiting for a run is not what work is spent on" is held by the
8
+ # executor's memory, and held badly: the sample message to the owner ends with a phrase about the
9
+ # next task, and the phrase is carried out as a promise — the session says it and ends the turn. A
10
+ # turn in which nothing was done gives itself away by nothing: no file edit, no command — and the
11
+ # miss is seen only by the owner, only by the work not moving, and only when they ask directly.
12
12
  #
13
- # Чужой шаг узнаётся по двум признакам, и оба берутся из хода, а не из сети. Первый — открытие
14
- # PR: работа отдана, и дальше её двигает владелец. Второй — прочитанный красный прогон: чинить
15
- # его надо, но ход, в котором его прочитали и не сделали ничего, — та же пустота. Само чтение
16
- # прогона признаком не является: конец прогона читают и затем, чтобы пойти чинить; значит
17
- # красный ответ, а он лежит в выводе команды — там же, в записи хода.
13
+ # Someone else's step is known by two signs, and both are taken from the turn, not from the
14
+ # network. The first is a PR opened: the work is handed in, and from there the owner moves it. The
15
+ # second is a red run read: it has to be fixed, but a turn that read it and did nothing is the same
16
+ # emptiness. Reading the run is not a sign by itself: the end of a run is also read to go and fix
17
+ # it; the sign is a red answer, and it lies in the command output — in the same turn record.
18
18
  #
19
- # Спросить хостинг было бы точнее, но сетевой вызов на завершении хода падает вместе со связью и
20
- # отбивал бы работу вместо промаха.
19
+ # Asking the hosting would be more precise, but a network call at the end of a turn fails together
20
+ # with the connection and would refuse the work instead of the miss.
21
21
  #
22
- # Что считается действием: заведение задачи, заведение ветки, перевод задачи в колонку работы,
23
- # заведение папки задачи. Перевод в колонку разбора и снятие папки сюда не входят — это шаги
24
- # закрытия прежней работы, а не начало следующей. Набор открыт и пополняется правкой — полнота
25
- # его открытый вопрос, а не обещание.
22
+ # What counts as an action: creating a task, creating a branch, moving the task to the work column,
23
+ # creating the task folder. Moving to the review column and removing the folder are not in it —
24
+ # those are steps of closing the previous work, not the start of the next. The set is open and
25
+ # grows by edits — its completeness is an open question, not a promise.
26
26
  #
27
- # Чего гард не судит. Ход, в котором о чужом шаге не сказано ничего, — здесь он молчит: пустой
28
- # ход неотличим от хода, которому нечего было делать. Это известная его граница. Зелёный прогон
29
- # он тоже не судит: за ним идёт своя работа — уборка и снятие черновика, — а не чужой шаг.
27
+ # What the guard does not judge. A turn that says nothing about someone else's step — here it stays
28
+ # silent: an empty turn cannot be told from a turn that had nothing to do. This is its known
29
+ # boundary. A green run it does not judge either: after it comes work of one's own — cleanup and
30
+ # lifting the draft — not someone else's step.
30
31
  #
31
- # ОТКАЗ В ПОЛЬЗУ РАБОТЫ: при любой ошибке, нехватке `jq`, отсутствии записи хода и повторном
32
- # заходе ход РАЗРЕШАЕТСЯ (exit 0). Сломанный гард не имеет права заклинить разговор.
32
+ # FAIL-OPEN: on any error, missing `jq`, missing turn record or a repeated call on the same turn
33
+ # the turn is ALLOWED (exit 0). A broken guard has no right to jam the conversation.
33
34
 
34
- # Своё имя в наблюдениях: отбой пишет общий хвост отказа, а не сам гард.
35
+ # Its own name in observations: the refusal is written by the shared deny tail, not by the guard.
35
36
  RT_GUARD_NAME=waiting-turn-guard
36
37
 
37
38
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
@@ -43,7 +44,7 @@ input="$RT_HOOK_INPUT"
43
44
 
44
45
  command -v jq >/dev/null 2>&1 || exit 0
45
46
 
46
- # Повторный заход по тому же ходу не судится: гард сказал своё один раз и отпускает.
47
+ # A repeated call on the same turn is not judged: the guard said its word once and lets go.
47
48
  active="$(printf '%s' "$input" | jq -r '.stop_hook_active // false' 2>/dev/null)"
48
49
  [ "$active" = "true" ] && exit 0
49
50
 
@@ -51,52 +52,51 @@ transcript="$(printf '%s' "$input" | jq -r '.transcript_path // empty' 2>/dev/nu
51
52
  [ -z "$transcript" ] && exit 0
52
53
  [ -f "$transcript" ] || exit 0
53
54
 
54
- # Открытие PR у каждого хостинга своё, и гард переносится между ними целиком: набор называет все
55
- # три формы, а не ту, что стоит в этом дереве. Правка тела PR сюда не входит — она не открывает
56
- # ничего.
55
+ # Opening a PR differs per hosting, and the guard moves between them whole: the set names all
56
+ # three forms, not the one this tree uses. Editing the PR body is not in it — it opens nothing.
57
57
  opened_re='gh[^|;&]*pr[[:space:]]+create|api[^|;&]*-X[[:space:]]+POST[^|;&]*/pulls|glab[^|;&]*mr[[:space:]]+create|az[[:space:]]+repos[[:space:]]+pr[[:space:]]+create'
58
58
 
59
- # Чтение прогона — второй случай чужого шага. Сам по себе он ничего не значит: конец прогона
60
- # читают и затем, чтобы пойти чинить. Значит красный ответ, а он лежит не в команде, а в её
61
- # выводе — там же, в записи хода, и сети для этого не нужно.
59
+ # Reading a run is the second case of someone else's step. By itself it means nothing: the end of
60
+ # a run is also read to go and fix it. The sign is a red answer, and it lies not in the command
61
+ # but in its output — in the same turn record, and no network is needed for that.
62
62
  read_re='run[[:space:]]+(list|view|watch)|pipelines[[:space:]]+runs'
63
63
  red_re='completed[[:space:]]+failure|"conclusion"[[:space:]]*:[[:space:]]*"failure"|conclusion:[[:space:]]*failure|completed with .failure.|run[[:space:]]+failed'
64
64
 
65
- # Первое действие по следующей задаче. Перечисляется то, чем взятие БЫВАЕТ, а не то, что
66
- # действием считается: список шагов закрытия работы открыт и растёт, а список действий по
67
- # следующей задаче закрыт — у перечня «что бывает» дыры закрывающего шага нет.
65
+ # The first action on the next task. Listed is what taking a task CAN BE, not what counts as an
66
+ # action: the list of work-closing steps is open and grows, while the list of actions on the next
67
+ # task is closed — a list of "what it can be" has no hole for a closing step.
68
68
  #
69
- # Перевода закрываемой задачи в колонку разбора и снятия её папки здесь нет намеренно: оба —
70
- # обязательные шаги закрытия работы, и оба стоят в том же ходе, которым открыт PR. Пока признак
71
- # перечислял их наравне со взятием, он совпадал всегда, и гард отпускал ход, ради которого
72
- # заведён, — работа так вставала трижды за один заход.
69
+ # Moving the closed task to the review column and removing its folder are left out on purpose:
70
+ # both are mandatory steps of closing work, and both stand in the same turn that opened the PR.
71
+ # While the sign listed them alongside taking a task, it always matched, and the guard let through
72
+ # the very turn it was made for — work stopped three times in one session that way.
73
73
  #
74
- # Правка кода в ветке того же PR действием по следующей задаче не считается — она чинит
75
- # прежнюю, а не двигает работу дальше.
76
- taken_re='task:new|checkout[[:space:]]+-b|task:move[^|;&]*in-progress|(cp|mkdir)[^|;&]*/tasks/'
74
+ # A code edit in the branch of the same PR does not count as an action on the next task — it fixes
75
+ # the previous one and does not move the work on.
76
+ taken_re='task:new|checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|task:move[^|;&]*in-progress|(cp|mkdir)[^|;&]*/tasks/'
77
77
 
78
- # Заведение папки задачи идёт и не оболочкой: инструмент правки файла пишет её первым файлом, и
79
- # командной строки за этим нет вовсе. Поэтому рядом с командами судится путь правки — у него
80
- # свой образец, потому что имени команды в нём нет.
78
+ # The task folder is also created without the shell: the file-editing tool writes its first file,
79
+ # and no command line stands behind that. So next to the commands the edit path is judged — with a
80
+ # pattern of its own, since no command name is in it.
81
81
  taken_path_re='/tasks/'
82
82
 
83
- # Чем ход показывает, что отданную работу он довёл до конца, а не бросил черновиком. Снятие
84
- # черновика — очевидный случай; чтение прогона — тот, где снимать ещё нечего, но исполнитель
85
- # посмотрел, а не сказал «жду». Две готовые заявки простояли черновиками именно потому, что
86
- # следующая задача была взята вместо этого, а не сверх этого.
83
+ # How the turn shows it carried the handed-in work to the end rather than leaving it a draft.
84
+ # Lifting the draft is the obvious case; reading the run is the one where there is nothing to lift
85
+ # yet, but the executor looked instead of saying "waiting". Two ready PRs stood as drafts precisely
86
+ # because the next task was taken instead of this, not on top of it.
87
87
  ready_re='pr[[:space:]]+ready|run[[:space:]]+(list|view|watch)|pr[[:space:]]+checks|check-runs|check:board|board\.mjs'
88
88
 
89
- # Своё названное действие. Пустой ход, объявивший, что сделает дальше, ничем себя не выдаёт:
90
- # заявку он не открывал, прогона не читал, и оба прежних признака молчат. Ловится он формой —
91
- # набором образцов будущего времени о собственном шаге, — а не пониманием смысла; за словами
92
- # при этом не должно стоять ни одного вызова, иначе объявление сказано по ходу работы, а не
93
- # вместо неё.
89
+ # One's own named action. An empty turn that declared what it will do next gives itself away by
90
+ # nothing: it opened no PR, read no run, and both earlier signs are silent. It is caught by form —
91
+ # a set of future-tense patterns about one's own step — not by understanding the meaning; and no
92
+ # call may stand behind the words, otherwise the declaration was said along the work, not instead
93
+ # of it.
94
94
  vow_re='дальше беру|дальше возьму|дальше иду|следующим шагом|следующий шаг:|затем сделаю|затем возьму|потом сделаю|после этого сделаю|далее беру'
95
95
 
96
- # Ход — это всё, что записано после последнего настоящего ввода владельца. Ответ инструмента
97
- # приходит той же ролью, поэтому строки с `tool_result` вводом не считаются.
96
+ # The turn is everything recorded after the owner's last real input. A tool result arrives under
97
+ # the same role, so lines with `tool_result` do not count as input.
98
98
  #
99
- # Хвост в 400 строк: запись хода растёт всю сессию, а судится только последний ход.
99
+ # A 400-line tail: the turn record grows all session, and only the last turn is judged.
100
100
  verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r \
101
101
  --arg opened "$opened_re" --arg taken "$taken_re" --arg taken_path "$taken_path_re" \
102
102
  --arg read "$read_re" --arg red "$red_re" --arg ready "$ready_re" --arg vow "$vow_re" '
@@ -111,13 +111,13 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r \
111
111
  | (if $i == null then [] else .[$i:] end) as $turn
112
112
  | [$turn[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "tool_use")] as $uses
113
113
  | ($uses | map((.input.command // "")) | join("\n")) as $ran
114
- # Путь правки — второй способ завести папку задачи. Судятся только инструменты письма: у
115
- # чтения путь тот же, а работой оно не является.
114
+ # The edit path is the second way to create a task folder. Only the writing tools are judged:
115
+ # reading has the same path and is not work.
116
116
  | ($uses | map(select(.name == "Write" or .name == "Edit" or .name == "MultiEdit")
117
117
  | (.input.file_path // "")) | join("\n")) as $wrote
118
- # Ответ инструмента берётся текстом, а не в записи JSON: у той таб и кавычка уезжают
119
- # экранированными, и образец по ним не попадает вовсе. Приходит он и строкой, и списком
120
- # блоков — обе формы сводятся к одному тексту.
118
+ # The tool result is taken as text, not as the JSON record: there a tab and a quote leave
119
+ # escaped, and the pattern misses them entirely. It arrives both as a string and as a list of
120
+ # blocks — both forms are brought to one text.
121
121
  | ([$turn[] | select(.type == "user") | .message.content // [] | select(type == "array") | .[]
122
122
  | select(.type == "tool_result") | .content
123
123
  | if type == "string" then .
@@ -140,18 +140,18 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r \
140
140
  else "pass" end
141
141
  ' 2>/dev/null)"
142
142
 
143
- # Ни одного из двух действий: отказ называет оба разом. Прежде он называл только первое, и
144
- # снимался тоже первым — исполнитель брал следующую задачу, признак открытой заявки уходил
145
- # вместе с ходом, и второе требование испарялось, ни разу не прозвучав.
143
+ # Neither of the two actions: the refusal names both at once. Before, it named only the first and
144
+ # was lifted by the first too — the executor took the next task, the open-PR sign left with the
145
+ # turn, and the second demand evaporated without ever sounding.
146
146
  if [ "$verdict" = "owe:both" ]; then
147
- reason="BLOCKED by waiting-turn-guard: в этом ходе открыт PR, а по отданной работе не сделано ни одного из двух действий — ни состояние её не спрошено, ни следующая задача не взята.
147
+ reason="BLOCKED by waiting-turn-guard: a PR was opened in this turn, and neither of the two actions was done about the handed-over work — its state was not asked, and the next task was not taken.
148
148
 
149
- Действий именно два, и снять отказ одним нельзя: отданное доводится до снятого черновика тем, кто его отдал, а следующая берётся сверх этого, а не вместо. Взятая следующая уносит признак открытой заявки с собой — второе требование после неё не прозвучит уже никогда.
149
+ There are exactly two actions, and one of them does not lift the refusal: what was handed over is brought to a lifted draft by the one who handed it over, and the next task is taken on top of that, not instead. A taken next task carries the sign of the open request away with it — the second requirement will never sound after it.
150
150
 
151
151
  gh run list # состояние отданного
152
152
  npm run task:new -- <заголовок> # следующая работа
153
153
 
154
- Гард судит один ход: следующий заход не отбивается."
154
+ The guard judges one turn: the next session is not refused."
155
155
 
156
156
  # shellcheck disable=SC1090
157
157
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
@@ -163,18 +163,18 @@ if [ "$verdict" = "owe:both" ]; then
163
163
  ${deny_tail_text}"
164
164
 
165
165
  jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
166
- || printf '{"decision":"block","reason":"waiting-turn-guard: по отданной работе не сделано ни одного из двух действий."}\n'
166
+ || printf '{"decision":"block","reason":"waiting-turn-guard: neither of the two actions was done about the handed-over work."}\n'
167
167
  exit 0
168
168
  fi
169
169
 
170
- # Ход, объявивший своё следующее действие и не сделавший по нему ничего. Отказ называет само
171
- # объявление: исполнитель, которому сказано «ход пуст», перепишет слова, а не сделает шаг.
170
+ # A turn that declared its next action and did nothing on it. The refusal names the declaration
171
+ # itself: an executor told "the turn is empty" will rewrite the words rather than take the step.
172
172
  if [ "$verdict" = "owe:vow" ]; then
173
- reason="BLOCKED by waiting-turn-guard: за ход не сделано ни одной правки и не позвана ни одна команда, а следующее действие названо словами — «дальше беру», «следующим шагом», «затем сделаю».
173
+ reason="BLOCKED by waiting-turn-guard: not a single edit was made in the turn and not a single command was called, while the next action is named in words — «дальше беру», «следующим шагом», «затем сделаю».
174
174
 
175
- Объявление своего же шага работой не бывает: оно точнее всякого обещания и пустоты за ним не видно никому. Сделай названное этим же ходом — либо скажи владельцу, что работу останавливает, и назови, чем именно.
175
+ An announcement of your own step is never work: it is more precise than any promise, and the emptiness behind it is visible to nobody. Do what is named in this same turn — or tell the owner what stops the work, and name exactly what.
176
176
 
177
- Гард судит один ход: следующий заход не отбивается."
177
+ The guard judges one turn: the next session is not refused."
178
178
 
179
179
  # shellcheck disable=SC1090
180
180
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
@@ -186,22 +186,22 @@ if [ "$verdict" = "owe:vow" ]; then
186
186
  ${deny_tail_text}"
187
187
 
188
188
  jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
189
- || printf '{"decision":"block","reason":"waiting-turn-guard: следующее действие названо словами, а за ход не сделано ничего."}\n'
189
+ || printf '{"decision":"block","reason":"waiting-turn-guard: the next action is named in words, and nothing was done in the turn."}\n'
190
190
  exit 0
191
191
  fi
192
192
 
193
- # Черновик, оставленный при взятой следующей задаче, — отдельный отказ: там требование не про
194
- # следующую задачу, а про доведение отданной.
193
+ # A draft left while the next task is taken is a separate refusal: there the demand is not about
194
+ # the next task but about carrying the handed-in one to the end.
195
195
  if [ "$verdict" = "owe:draft" ]; then
196
- reason="BLOCKED by waiting-turn-guard: в этом ходе открыт PR, следующая задача взята, а состояние отданной работы не спрошено ни одной командой.
196
+ reason="BLOCKED by waiting-turn-guard: a PR was opened in this turn, the next task is taken, and the state of the handed-over work was asked by no command.
197
197
 
198
- Черновик читается владельцем как «работа не кончена»: кнопка слияния у него заблокирована самим хостингом, и по списку заявок готовое от недоделанного не отличить — серое и там и там. Довести отданное до снятого черновика обязан тот, кто его отдал.
198
+ A draft is read by the owner as «the work is not finished»: its merge button is locked by the hosting itself, and in the list of requests the ready cannot be told from the unfinished — grey in both. Bringing what was handed over to a lifted draft is owed by the one who handed it over.
199
199
 
200
- Спроси прогон на вершине этим же ходом — `gh run list`, `gh pr checks` или сверку очереди работ — и сними черновик, когда он зелёный, а ветка сливается. Прогон ещё идёт — так и скажи владельцу, назвав его вывод.
200
+ Ask the run on the tip in this same turn — `gh run list`, `gh pr checks` or the audit of the work queue — and lift the draft when it is green and the branch merges. The run is still going — then say so to the owner, naming its output.
201
201
 
202
- Следующая задача берётся сверх этого, а не вместо: обе готовые заявки простояли черновиками ровно на такой подмене.
202
+ The next task is taken on top of that, not instead: both ready requests stood as drafts on exactly this substitution.
203
203
 
204
- Гард судит один ход: следующий заход не отбивается."
204
+ The guard judges one turn: the next session is not refused."
205
205
 
206
206
  # shellcheck disable=SC1090
207
207
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
@@ -213,31 +213,41 @@ if [ "$verdict" = "owe:draft" ]; then
213
213
  ${deny_tail_text}"
214
214
 
215
215
  jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
216
- || printf '{"decision":"block","reason":"waiting-turn-guard: отданная работа осталась черновиком — спроси прогон и сними черновик."}\n'
216
+ || printf '{"decision":"block","reason":"waiting-turn-guard: the handed-over work stayed a draft — ask the run and lift the draft."}\n'
217
217
  exit 0
218
218
  fi
219
219
 
220
220
  case "$verdict" in
221
- owe:pr) said="в этом ходе открыт PR" ;;
222
- owe:run) said="в этом ходе прочитан красный прогон" ;;
221
+ owe:pr) said="a PR was opened in this turn" ;;
222
+ owe:run) said="a red run was read in this turn" ;;
223
223
  *) exit 0 ;;
224
224
  esac
225
225
 
226
- reason="BLOCKED by waiting-turn-guard: ${said}, а действия по следующей задаче в нём нет ни одного. Ожидание чужого шага заходом не занимают: прогон, разбор и слияние идут на стороне и быстрее от взгляда не становятся.
226
+ # The end of an epic: there the next task is exactly what is not taken — the guard of the stop
227
+ # refuses taking it — and demanding it here would leave the turn with no lawful end. The reading is
228
+ # shared with that guard and is asked right before the refusal: it goes to the hosting, and every
229
+ # turn must not pay for it.
230
+ # shellcheck disable=SC1090
231
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/epic-over.sh" 2>/dev/null || true
232
+ if command -v rt_epic_over >/dev/null 2>&1 && rt_epic_over; then
233
+ exit 0
234
+ fi
235
+
236
+ reason="BLOCKED by waiting-turn-guard: ${said}, and there is not a single action about the next task in it. Waiting for someone else's step is not what a session is spent on: the run, the review and the merge go on elsewhere and do not get faster from being watched.
227
237
 
228
- Сказать «беру следующую задачу» — не то же самое, что взять её: фраза живёт до конца хода, а работа не двигается, и заметить это может только владелец.
238
+ Saying «беру следующую задачу» is not the same as taking it: the phrase lives to the end of the turn while the work does not move, and only the owner can notice that.
229
239
 
230
- Тем же ходом делается первое действие по следующей задаче — заведение задачи, ветки или папки:
240
+ The first action about the next task is done in this same turn — creating the task, the branch or the folder:
231
241
 
232
242
  npm run task:new -- --title '<Что не так>' --slug <slug>
233
- git checkout -b <КЛЮЧ>-<номер>-<slug>
243
+ git checkout -b <KEY>-<number>-<slug>
234
244
 
235
- Конец прогона узнаётся возвратом фоновой команды, а не взглядом на страницу.
245
+ The end of a run is learned from the return of a background command, not from a look at the page.
236
246
 
237
- Гард судит один ход: следующий заход не отбивается."
247
+ The guard judges one turn: the next session is not refused."
238
248
 
239
- # Общий хвост отказа: два законных хода. Файл может быть не разложен — тогда хвоста нет,
240
- # а причина отказа остаётся прежней.
249
+ # The shared deny tail: two lawful moves. The file may not be laid out — then there is no tail,
250
+ # and the reason for the refusal stays as it was.
241
251
  # shellcheck disable=SC1090
242
252
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
243
253
  && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
@@ -248,6 +258,6 @@ deny_tail_text="$(rt_deny_tail "")"
248
258
  ${deny_tail_text}"
249
259
 
250
260
  jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
251
- || printf '{"decision":"block","reason":"waiting-turn-guard: PR открыт — тем же ходом берётся следующая задача."}\n'
261
+ || printf '{"decision":"block","reason":"waiting-turn-guard: a PR is open — the next task is taken in the same turn."}\n'
252
262
 
253
263
  exit 0