@rt-tools/agent-kit 0.24.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/assets/agents/business-analyst.md +51 -50
  2. package/assets/agents/cargo-writer.md +54 -0
  3. package/assets/agents/conscience.md +37 -35
  4. package/assets/agents/project-manager.md +49 -48
  5. package/assets/agents/prose-editor.md +31 -29
  6. package/assets/agents/qa-engineer.md +50 -48
  7. package/assets/agents/rules-reviewer.md +63 -58
  8. package/assets/agents/skill-curator.md +83 -78
  9. package/assets/agents/spec-critic.md +34 -29
  10. package/assets/agents/spec-writer.md +35 -32
  11. package/assets/agents/strict-teacher.md +39 -37
  12. package/assets/checks/archive-age.mjs +48 -28
  13. package/assets/checks/archive-prune.mjs +16 -14
  14. package/assets/checks/board-epic-link.github.mjs +29 -0
  15. package/assets/checks/board-epics.github.mjs +286 -49
  16. package/assets/checks/board-folders.mjs +61 -0
  17. package/assets/checks/board-gh.github.mjs +35 -26
  18. package/assets/checks/board-long-work.github.mjs +29 -25
  19. package/assets/checks/board-paths.github.mjs +21 -16
  20. package/assets/checks/board-pull-state.github.mjs +168 -0
  21. package/assets/checks/board-runs.github.mjs +45 -43
  22. package/assets/checks/board-task-dirs.github.mjs +98 -0
  23. package/assets/checks/board-titles.github.mjs +19 -17
  24. package/assets/checks/board.github.mjs +133 -194
  25. package/assets/checks/check-archive-age.mjs +23 -19
  26. package/assets/checks/check-board.github.mjs +131 -263
  27. package/assets/checks/check-descriptions.mjs +30 -29
  28. package/assets/checks/check-doc-paths.mjs +91 -88
  29. package/assets/checks/check-dupes.mjs +84 -80
  30. package/assets/checks/check-file-size.mjs +74 -71
  31. package/assets/checks/check-glossary.mjs +47 -37
  32. package/assets/checks/check-hook-scope.mjs +30 -27
  33. package/assets/checks/check-lib-layers.mjs +22 -21
  34. package/assets/checks/check-profile-drift.mjs +48 -43
  35. package/assets/checks/check-prose-style.mjs +138 -39
  36. package/assets/checks/check-push-gate.mjs +53 -50
  37. package/assets/checks/check-reuse.mjs +50 -40
  38. package/assets/checks/check-schema-drift.mjs +104 -84
  39. package/assets/checks/check-specs.mjs +155 -134
  40. package/assets/checks/check-state-next.mjs +66 -52
  41. package/assets/checks/check-states.mjs +32 -30
  42. package/assets/checks/check-styles.mjs +52 -51
  43. package/assets/checks/check-turn-map.mjs +54 -46
  44. package/assets/checks/epic-table.github.mjs +268 -0
  45. package/assets/checks/lib-boundaries.mjs +32 -30
  46. package/assets/checks/lib-common.mjs +30 -29
  47. package/assets/checks/lib-domains.mjs +34 -34
  48. package/assets/checks/lib-manifests.mjs +17 -15
  49. package/assets/checks/lib-reexports.mjs +18 -18
  50. package/assets/checks/rt-kit-checks.config.mjs +187 -142
  51. package/assets/checks/signals.mjs +43 -39
  52. package/assets/checks/spec-anchors.mjs +114 -87
  53. package/assets/checks/spec-common.mjs +128 -84
  54. package/assets/checks/spec-contract.mjs +30 -30
  55. package/assets/checks/spec-proposed.mjs +27 -24
  56. package/assets/checks/spec-scenarios.mjs +51 -28
  57. package/assets/checks/specs-for.mjs +214 -0
  58. package/assets/checks/task-new.github.mjs +315 -61
  59. package/assets/commands/feedback.md +65 -59
  60. package/assets/commands/next-session.md +64 -57
  61. package/assets/commands/night.md +115 -0
  62. package/assets/commands/skill-curator.md +83 -79
  63. package/assets/defaults/gate-map.sh +108 -97
  64. package/assets/defaults/project.sh +232 -185
  65. package/assets/defaults/shell.sh +73 -68
  66. package/assets/defaults/turn-map.md +47 -44
  67. package/assets/docs/GLOSSARY.md +142 -65
  68. package/assets/hooks/browser-device-id.sh +16 -12
  69. package/assets/hooks/browser-guard-device-id.sh +34 -28
  70. package/assets/hooks/browser-guard-no-asking.sh +5 -4
  71. package/assets/hooks/browser-guard-no-listing.sh +12 -11
  72. package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
  73. package/assets/hooks/browser-guard-require-select.sh +34 -23
  74. package/assets/hooks/claim-guard.sh +62 -56
  75. package/assets/hooks/commit-msg.sh +14 -10
  76. package/assets/hooks/conscience-guard.sh +91 -45
  77. package/assets/hooks/constitution-index.sh +16 -16
  78. package/assets/hooks/deny-tail.sh +28 -26
  79. package/assets/hooks/dev-server-guard.sh +50 -43
  80. package/assets/hooks/dispatch.sh +60 -46
  81. package/assets/hooks/docs-guard.sh +100 -91
  82. package/assets/hooks/epic-over.sh +49 -0
  83. package/assets/hooks/epic-stop-guard.sh +108 -0
  84. package/assets/hooks/exam-guard.sh +105 -93
  85. package/assets/hooks/git-guard-delivery-conflict.sh +41 -36
  86. package/assets/hooks/git-guard-delivery-draft.sh +48 -38
  87. package/assets/hooks/git-guard-delivery-epic.sh +167 -0
  88. package/assets/hooks/git-guard-delivery-folder.sh +50 -43
  89. package/assets/hooks/git-guard-delivery-signature.sh +119 -53
  90. package/assets/hooks/git-guard-delivery.sh +223 -183
  91. package/assets/hooks/git-guard-main.sh +38 -34
  92. package/assets/hooks/git-guard-push-tests.sh +99 -87
  93. package/assets/hooks/glossary-load.sh +23 -22
  94. package/assets/hooks/grill-gate-ask.sh +12 -11
  95. package/assets/hooks/grill-gate.sh +94 -87
  96. package/assets/hooks/guard-note.sh +20 -19
  97. package/assets/hooks/handoff-entry-guard.sh +45 -25
  98. package/assets/hooks/handoff-write.sh +74 -67
  99. package/assets/hooks/hook-input.sh +67 -58
  100. package/assets/hooks/lint-after-edit.sh +95 -61
  101. package/assets/hooks/observe.sh +28 -26
  102. package/assets/hooks/override-write-guard.sh +23 -21
  103. package/assets/hooks/postmortem-guard.sh +42 -39
  104. package/assets/hooks/profile-check.sh +22 -20
  105. package/assets/hooks/proposal-guard.sh +57 -49
  106. package/assets/hooks/prose-style-guard.sh +49 -24
  107. package/assets/hooks/qa-dataid-guard.sh +83 -58
  108. package/assets/hooks/rerun-guard.sh +31 -30
  109. package/assets/hooks/reuse-first-guard.sh +108 -87
  110. package/assets/hooks/roles.sh +14 -14
  111. package/assets/hooks/rule-article.sh +39 -34
  112. package/assets/hooks/rule-source-guard.sh +47 -42
  113. package/assets/hooks/skill-gate-layers.sh +63 -57
  114. package/assets/hooks/skill-gate-rearm.sh +15 -8
  115. package/assets/hooks/skill-gate.sh +89 -81
  116. package/assets/hooks/skill-loaded.sh +10 -6
  117. package/assets/hooks/sql-guard-parse.sh +71 -66
  118. package/assets/hooks/sql-guard-request.sh +51 -46
  119. package/assets/hooks/sql-guard-target.sh +60 -51
  120. package/assets/hooks/sql-guard-write.sh +87 -79
  121. package/assets/hooks/sql-guard.sh +52 -47
  122. package/assets/hooks/stand-login-guard.sh +43 -37
  123. package/assets/hooks/task-context-load.sh +60 -55
  124. package/assets/hooks/task-flow-context.sh +87 -69
  125. package/assets/hooks/task-flow-draft-guard.sh +55 -48
  126. package/assets/hooks/task-flow-guard.sh +67 -64
  127. package/assets/hooks/turn-entry-load.sh +39 -32
  128. package/assets/hooks/turn-exit-guard.sh +260 -204
  129. package/assets/hooks/turn-exit-patterns.sh +63 -0
  130. package/assets/hooks/utf8.sh +14 -11
  131. package/assets/hooks/waiting-turn-guard.sh +104 -94
  132. package/assets/hooks/window-fill-guard.sh +70 -62
  133. package/assets/hooks/work-start-guard.sh +52 -49
  134. package/assets/hooks/write-targets.sh +99 -44
  135. package/assets/laws/autonomous-work.md +29 -27
  136. package/assets/laws/code-structure.md +31 -30
  137. package/assets/laws/delivery.md +170 -137
  138. package/assets/laws/entity-editing.md +52 -50
  139. package/assets/laws/entity-models.md +14 -13
  140. package/assets/laws/frontend-application.md +39 -38
  141. package/assets/laws/lib-imports.md +27 -27
  142. package/assets/laws/lists.md +31 -29
  143. package/assets/laws/navigation.md +37 -37
  144. package/assets/laws/observability.md +41 -40
  145. package/assets/laws/project-documentation.md +106 -99
  146. package/assets/laws/reuse-first.md +31 -29
  147. package/assets/laws/shared-code.md +27 -27
  148. package/assets/laws/verifiability.md +131 -124
  149. package/assets/laws/work-conduct.md +250 -244
  150. package/assets/patterns/admin-lists-screen.md +72 -69
  151. package/assets/patterns/admin-nav-item.md +51 -46
  152. package/assets/patterns/angular-patterns-state.md +32 -31
  153. package/assets/patterns/api-layer-pair.md +33 -31
  154. package/assets/patterns/autonomous-work-run.md +50 -49
  155. package/assets/patterns/browser-verification-measure.md +124 -88
  156. package/assets/patterns/browser-verification-stand.md +169 -157
  157. package/assets/patterns/component-structure-new.md +51 -42
  158. package/assets/patterns/dependencies-upgrade.md +55 -39
  159. package/assets/patterns/doc-style-human.md +55 -37
  160. package/assets/patterns/doc-style-sweep.md +82 -79
  161. package/assets/patterns/doc-style-trace.md +87 -81
  162. package/assets/patterns/doc-style-write.md +130 -122
  163. package/assets/patterns/entity-aside.md +77 -63
  164. package/assets/patterns/entity-models-new.md +37 -37
  165. package/assets/patterns/entity-store.md +33 -33
  166. package/assets/patterns/git-workflow-commit.azure.md +94 -87
  167. package/assets/patterns/git-workflow-commit.github.md +160 -142
  168. package/assets/patterns/git-workflow-commit.gitlab.md +96 -90
  169. package/assets/patterns/git-workflow-docker.md +165 -147
  170. package/assets/patterns/git-workflow-freshness.md +45 -45
  171. package/assets/patterns/git-workflow-merge.md +102 -94
  172. package/assets/patterns/git-workflow-migration.md +54 -52
  173. package/assets/patterns/git-workflow-pr-ready.md +57 -56
  174. package/assets/patterns/git-workflow-pr.azure.md +127 -122
  175. package/assets/patterns/git-workflow-pr.github.md +186 -177
  176. package/assets/patterns/git-workflow-pr.gitlab.md +139 -132
  177. package/assets/patterns/git-workflow-restart.md +35 -31
  178. package/assets/patterns/git-workflow-secrets.md +80 -73
  179. package/assets/patterns/git-workflow-stack.md +136 -107
  180. package/assets/patterns/lib-layers-move.md +62 -53
  181. package/assets/patterns/lib-layers-new.md +59 -45
  182. package/assets/patterns/observability-record.md +72 -67
  183. package/assets/patterns/platform-access-di.md +31 -29
  184. package/assets/patterns/reuse-first-extend.md +66 -61
  185. package/assets/patterns/shared-code-new.md +39 -38
  186. package/assets/patterns/spec-driven-domain.md +161 -151
  187. package/assets/patterns/spec-driven-rule.md +179 -168
  188. package/assets/patterns/spec-driven-sweep.md +41 -39
  189. package/assets/patterns/status-report-table.github.md +48 -36
  190. package/assets/patterns/styling-bem-component.md +42 -42
  191. package/assets/patterns/styling-bem-layout.md +39 -34
  192. package/assets/patterns/styling-bem-sheet.md +59 -58
  193. package/assets/patterns/task-flow-archive.md +222 -215
  194. package/assets/patterns/task-flow-close.md +234 -203
  195. package/assets/patterns/task-flow-handoff.md +154 -145
  196. package/assets/patterns/task-flow-resume.md +138 -133
  197. package/assets/patterns/task-flow-start.md +228 -202
  198. package/assets/patterns/testing-e2e.md +102 -101
  199. package/assets/patterns/testing-unit.md +77 -70
  200. package/assets/patterns/ts-procedure.md +32 -29
  201. package/assets/patterns/turn-entry-map.md +50 -48
  202. package/assets/pitfalls/agent-kit.md +172 -142
  203. package/assets/pitfalls/doc-style.md +96 -91
  204. package/assets/pitfalls/git-workflow.azure.md +49 -46
  205. package/assets/pitfalls/git-workflow.github.md +270 -234
  206. package/assets/pitfalls/git-workflow.gitlab.md +49 -45
  207. package/assets/pitfalls/spec-driven.md +73 -71
  208. package/assets/pitfalls/styling-bem.md +46 -40
  209. package/assets/pitfalls/task-flow.md +262 -246
  210. package/assets/pitfalls/testing.md +99 -92
  211. package/assets/pitfalls/turn-conduct.md +96 -81
  212. package/assets/rules/angular-patterns.md +81 -80
  213. package/assets/rules/api-layer.md +77 -74
  214. package/assets/rules/autonomous-work.md +87 -74
  215. package/assets/rules/browser-verification.md +223 -214
  216. package/assets/rules/component-structure.md +72 -69
  217. package/assets/rules/dependencies.md +74 -67
  218. package/assets/rules/deploy-flow.azure.md +118 -108
  219. package/assets/rules/deploy-flow.github.md +145 -135
  220. package/assets/rules/deploy-flow.gitlab.md +120 -110
  221. package/assets/rules/doc-style.md +201 -173
  222. package/assets/rules/entity-conventions.needs-admin.md +81 -79
  223. package/assets/rules/entity-models.md +73 -70
  224. package/assets/rules/git-workflow.azure.md +224 -228
  225. package/assets/rules/git-workflow.github.md +268 -239
  226. package/assets/rules/git-workflow.gitlab.md +218 -217
  227. package/assets/rules/lib-layers.md +85 -86
  228. package/assets/rules/lists.md +101 -97
  229. package/assets/rules/navigation.md +78 -78
  230. package/assets/rules/observability.needs-app.md +165 -153
  231. package/assets/rules/platform-access.md +76 -75
  232. package/assets/rules/reuse-first.md +153 -143
  233. package/assets/rules/shared-code.md +82 -79
  234. package/assets/rules/spec-driven.md +279 -260
  235. package/assets/rules/status-report.md +62 -58
  236. package/assets/rules/styling-bem.md +81 -77
  237. package/assets/rules/task-flow.md +303 -270
  238. package/assets/rules/testing.md +224 -209
  239. package/assets/rules/turn-conduct.md +262 -258
  240. package/assets/rules/turn-entry.md +92 -87
  241. package/assets/rules/typescript-conventions.md +94 -88
  242. package/assets/samples/specs/_template/spec.md +47 -47
  243. package/assets/samples/tasks/_template/grill.md +20 -20
  244. package/assets/samples/tasks/_template/plan.md +32 -30
  245. package/assets/samples/tasks/_template/progress.md +16 -16
  246. package/assets/skills/agent-kit-extend.md +129 -113
  247. package/assets/skills/agent-kit.md +259 -233
  248. package/assets/skills/write-a-skill.md +76 -71
  249. package/assets/templates/findings.md +19 -19
  250. package/assets/templates/gate-map.sh +16 -14
  251. package/assets/templates/implementation.md +28 -27
  252. package/assets/templates/pattern.md +17 -17
  253. package/assets/templates/pitfalls.md +6 -6
  254. package/assets/templates/postmortem.md +24 -23
  255. package/assets/templates/project.sh +24 -24
  256. package/assets/templates/proposal.md +62 -60
  257. package/assets/templates/rule.md +38 -38
  258. package/assets/workflows/feature.js +46 -46
  259. package/assets/workflows/plan.js +54 -54
  260. package/bin/agent-kit.d.ts.map +1 -1
  261. package/bin/agent-kit.js +8 -1
  262. package/bin/agent-kit.js.map +1 -1
  263. package/lib/cargo-prose.d.ts +41 -0
  264. package/lib/cargo-prose.d.ts.map +1 -0
  265. package/lib/cargo-prose.js +88 -0
  266. package/lib/cargo-prose.js.map +1 -0
  267. package/lib/cargo.d.ts +12 -1
  268. package/lib/cargo.d.ts.map +1 -1
  269. package/lib/cargo.js +8 -2
  270. package/lib/cargo.js.map +1 -1
  271. package/lib/catalog.d.ts +2 -0
  272. package/lib/catalog.d.ts.map +1 -1
  273. package/lib/catalog.js +4 -3
  274. package/lib/catalog.js.map +1 -1
  275. package/lib/commands.d.ts.map +1 -1
  276. package/lib/commands.js +5 -2
  277. package/lib/commands.js.map +1 -1
  278. package/lib/companion.js +3 -2
  279. package/lib/companion.js.map +1 -1
  280. package/lib/enroll.d.ts +7 -1
  281. package/lib/enroll.d.ts.map +1 -1
  282. package/lib/enroll.js +12 -3
  283. package/lib/enroll.js.map +1 -1
  284. package/lib/fate.d.ts +29 -0
  285. package/lib/fate.d.ts.map +1 -0
  286. package/lib/fate.js +147 -0
  287. package/lib/fate.js.map +1 -0
  288. package/lib/override-marks.d.ts +7 -0
  289. package/lib/override-marks.d.ts.map +1 -1
  290. package/lib/override-marks.js +14 -0
  291. package/lib/override-marks.js.map +1 -1
  292. package/lib/plan.d.ts +11 -0
  293. package/lib/plan.d.ts.map +1 -1
  294. package/lib/plan.js +10 -1
  295. package/lib/plan.js.map +1 -1
  296. package/lib/ship.d.ts +29 -9
  297. package/lib/ship.d.ts.map +1 -1
  298. package/lib/ship.js +44 -2
  299. package/lib/ship.js.map +1 -1
  300. package/lib/shipment.d.ts.map +1 -1
  301. package/lib/shipment.fixture.d.ts +8 -1
  302. package/lib/shipment.fixture.d.ts.map +1 -1
  303. package/lib/shipment.fixture.js +9 -0
  304. package/lib/shipment.fixture.js.map +1 -1
  305. package/lib/shipment.js +38 -5
  306. package/lib/shipment.js.map +1 -1
  307. package/lib/sync.d.ts.map +1 -1
  308. package/lib/sync.js +45 -11
  309. package/lib/sync.js.map +1 -1
  310. package/package.json +1 -1
  311. package/rt-tools-agent-kit-0.27.0.tgz +0 -0
  312. package/rt-tools-agent-kit-0.24.0.tgz +0 -0
@@ -1,15 +1,17 @@
1
1
  #!/usr/bin/env bash
2
- # Профиль дерева: чем здесь проверяется правка и что считается переизобретением.
2
+ # Tree profile: what checks an edit here and what counts as reinvention.
3
3
  #
4
- # Умолчание пакета. Всё, что общего у деревьев этой мастерской, живёт здесь: запускатель Nx,
5
- # линтер кода, линтер стилей, набор образцов переизобретения. Своё дерево дописывает
6
- # надстройкой — `.claude/rt-kit/project.sh`: она грузится второй, объявляет ту же функцию
7
- # заново и вправе позвать отсюда её же с суффиксом `_default`.
4
+ # The package default. Everything the trees of this workshop have in common lives here: the Nx
5
+ # runner, the code linter, the style linter, the set of reinvention samples. A tree adds its own by
6
+ # an override — `.claude/rt-kit/project.sh`: it loads second, declares the same function anew and
7
+ # may call the same one from here with the `_default` suffix.
8
8
  #
9
- # Каждая функция вправе промолчать. Молчание значит «правила на это нет», и хук пропускает.
9
+ # Every function may stay silent. Silence means "there is no rule for this", and the hook lets it
10
+ # through.
10
11
 
11
- # Запускатель пакетов — по локфайлу, а не по договорённости: деревья с pnpm и с npm лежат в
12
- # одной мастерской, и зашитый здесь `npm` в первом же из них печатал бы команду, которой нет.
12
+ # The package runner — by the lockfile, not by agreement: trees with pnpm and with npm lie in one
13
+ # workshop, and an `npm` hardwired here would, in the first of them, print a command that does not
14
+ # exist.
13
15
  rt_runner() {
14
16
  root="${CLAUDE_PROJECT_DIR:-.}"
15
17
  if [ -f "$root/pnpm-lock.yaml" ]; then
@@ -21,47 +23,51 @@ rt_runner() {
21
23
  fi
22
24
  }
23
25
 
24
- # Где подняты приложения. Идёт в текст отказа, когда кто-то поднимает второй экземпляр.
25
- # Порты у каждого дерева свои, поэтому умолчание молчит: назвать чужой порт хуже, чем не назвать.
26
+ # Where the applications are up. Goes into the refusal text when someone raises a second instance.
27
+ # Ports differ from tree to tree, so the default stays silent: naming someone else's port is worse
28
+ # than naming none.
26
29
  RT_STANDS="${RT_STANDS:-}"
27
30
 
28
- # Где лежат проверки дерева и набор сценариев его гардов. Проверку, которой в дереве нет, гейт
29
- # пуша не зовёт: список печатается по тому, что лежит на диске.
31
+ # Where the tree's checks and the scenario set of its guards lie. A check the tree does not have is
32
+ # not called by the push gate: the list is printed from what lies on disk.
30
33
  RT_CHECKS_DIR="${RT_CHECKS_DIR:-tools}"
31
34
  RT_HOOKS_TESTS="${RT_HOOKS_TESTS:-.claude/hooks/tests/run.sh}"
32
35
 
33
- # Команды, которые обязаны пройти перед пушем. По одной на строку; первая упавшая отбивает пуш.
34
- # Линтер стилей отдельной строкой: линтер кода файлы стилей не читает вовсе.
36
+ # The commands that must pass before a push. One per line; the first one that fails refuses the
37
+ # push. The style linter on a separate line: the code linter does not read style files at all.
35
38
  #
36
- # Первый параметр — база: ветка, относительно которой считается вклад. Пустая означает, что
37
- # удалённого нет, и тогда гоняется всё: набор строже нужного безопасен, набор уже нужного — нет.
39
+ # The first parameter is the base: the branch against which the contribution is counted. Empty means
40
+ # there is no remote, and then everything runs: a set stricter than needed is safe, a set narrower
41
+ # than needed is not.
38
42
  #
39
- # Сборка идёт наравне с линтом и спеками. Линтер типов не читает, а спеки читают только то, что
40
- # кто-то ввёз в них импортом: ошибка типов в непокрытом коде доживает до сборки образа, то есть
41
- # до слияния. Стоит это мало — дальше работает кэш прогонщика.
43
+ # The build runs alongside the lint and the specs. The linter does not read types, and the specs
44
+ # read only what someone brought into them by an import: a type error in uncovered code lives until
45
+ # the image build, that is, until the merge. It costs little — beyond that the runner cache works.
42
46
  #
43
- # Заведённая проверка встаёт сюда, а не только в общий прогон, который никто не зовёт сам:
44
- # новая строка в её списке известного уезжает в главную ветку молча, а список при этом читается
45
- # как действующая охрана.
47
+ # A newly created check goes here, not only into the general run that nobody calls by themselves. A
48
+ # new line in its list of known cases leaves for the main branch silently, while the list is read as
49
+ # a working guard.
46
50
  #
47
- # Сверка раскладки идёт первой строкой и по двум причинам. Она стоит секунды, поэтому отбивает
48
- # раньше, чем начнётся долгий прогон. И до неё расхождение разложенного с пакетом не отбивало
49
- # ничего: правка, положенная в разложенную копию мимо источника, ничего не ломает в день, когда
50
- # её делают, а всплывает на чужой работе — раскладка отказывает по правленому файлу целиком и не
51
- # кладёт ни одного другого. Признак — сама настройка раскладки: дерево без неё пакета не ставит,
52
- # и звать в нём нечего.
53
- # Тронула ли ветка только тексты. Нулевой код — только тексты, иначе — код.
51
+ # The layout audit goes as the first line, for two reasons. It costs seconds, so it refuses before
52
+ # the long run begins. And before it, a drift of the laid-out copy from the package refused nothing.
53
+ # An edit put into the laid-out copy past the source breaks nothing on the day it is made, and
54
+ # surfaces on someone else's work: the layout refuses on the whole edited file and lays down not one
55
+ # other. The sign is the layout settings themselves: a tree without them does not install the
56
+ # package, and there is nothing to call in it.
54
57
  #
55
- # Признак нужен тому дереву, которое дописало в набор гейта тяжёлый шаг: стенд, снимки витрин,
56
- # сборку образов. Без него такой шаг идёт подряд, чем бы ветка ни была, и пуш коммита, менявшего
57
- # одну строку в таблице markdown, занимает минуты — за которые владелец успевает прочитать его
58
- # как зависший и отбить. Правило поставки требует того же от конвейера: ветка, не тронувшая ни
59
- # строки кода, не поднимает стенда, не снимает кадров и не собирает образов.
58
+ # Whether the branch touched only texts. Zero code — only texts, otherwise — code.
60
59
  #
61
- # Текстовой считается ветка, у которой каждый задетый файл — либо `.md`, либо лежит под каталогом
62
- # текстов. Всё остальное, включая обвязку и настройки, считается кодом: признак обязан ошибаться
63
- # в сторону лишнего прогона, а не пропущенного. Пустая база означает, что сравнивать не с чем, —
64
- # тогда признак молчит и гоняется всё.
60
+ # The sign is needed by the tree that added a heavy step to the gate set: a stand, showcase
61
+ # snapshots, image builds. Without it such a step runs every time, whatever the branch is, and the
62
+ # push of a commit that changed one line in a markdown table takes minutes. In those minutes the
63
+ # owner manages to read it as hung and refuse it. The delivery rule demands the same from the
64
+ # pipeline: a branch that touched not one line of code raises no stand, takes no frames and builds
65
+ # no images.
66
+ #
67
+ # A branch counts as textual when every touched file is either `.md` or lies under the texts
68
+ # directory. Everything else, including the harness and settings, counts as code: the sign must err
69
+ # towards an extra run, not a missed one. An empty base means there is nothing to compare with —
70
+ # then the sign stays silent and everything runs.
65
71
  rt_push_docs_only_default() {
66
72
  [ -z "$1" ] && return 1
67
73
  changed="$(git diff --name-only "$1"...HEAD 2>/dev/null)"
@@ -82,8 +88,9 @@ rt_push_checks_default() {
82
88
  fi
83
89
  [ -f "$root/stylelint.config.js" ] && printf '%s\n' "$runner stylelint \"**/*.scss\" --max-warnings 0"
84
90
 
85
- # Сценарии гардов — такой же код, как всё остальное: на них держится и разбор ветки, и
86
- # уверенность, что обвязка ещё работает. Прогон занимает секунды: он ничего не собирает.
91
+ # The guard scenarios are the same code as everything else: both the branch review and the
92
+ # confidence that the harness still works rest on them. The run takes seconds: it builds
93
+ # nothing.
87
94
  [ -x "$root/$RT_HOOKS_TESTS" ] && printf '%s\n' "bash $RT_HOOKS_TESTS"
88
95
 
89
96
  for check in check-doc-paths check-specs check-file-size check-dupes check-styles \
@@ -95,25 +102,26 @@ rt_push_checks_default() {
95
102
  return 0
96
103
  }
97
104
 
98
- # Какой документ обязан ехать тем же коммитом, что и этот файл. Печатает образец пути или молчит.
105
+ # Which document must travel by the same commit as this file. Prints a path pattern or stays silent.
99
106
  rt_docs_pair_for_default() {
100
107
  case "$1" in
101
- # Тест — не описание кода: он его проверяет.
108
+ # A test is not a description of the code: it checks it.
102
109
  *.spec.ts) return 0 ;;
103
- # Контракт правится вместе со спеком домена: разошедшись, они врут оба.
110
+ # The contract is edited together with the domain spec: having drifted apart, both lie.
104
111
  *.proto) printf '%s' 'docs/specs/.*/spec\.md' ;;
105
- # Правило и его спутник здесь не называются: их пару держит сам гард, и держит точнее —
106
- # он сверяет раздел с утверждениями, а не факт правки файла.
107
- # Хук и набор его сценариев: гард разбирает текст команд, и уточнение шаблона обычно
108
- # смещает границу, а не сужает.
112
+ # A rule and its sidecar are not named here: their pair is held by the guard itself, and
113
+ # held more precisely — it checks the section against the statements, not the fact of a file
114
+ # edit. A hook and its scenario set: the guard parses the text of commands, and a refinement
115
+ # of the pattern usually shifts the border rather than narrows it.
109
116
  .claude/hooks/*.sh) printf '%s' '.claude/hooks/tests/.*' ;;
110
117
  esac
111
118
  }
112
119
 
113
- # Чем линтуется этот файл сразу после правки. Печатает команду или молчит.
120
+ # What this file is linted with right after the edit. Prints a command or stays silent.
114
121
  #
115
- # Путь подставляется здесь, а не оставляется позиционным параметром: хук исполняет напечатанное
116
- # вычислением строки, и `$1` в нём разрешился бы в параметр самого хука, то есть в пустоту.
122
+ # The path is substituted here rather than left as a positional parameter: the hook executes what is
123
+ # printed by evaluating the string, and `$1` in it would resolve to the hook's own parameter, that
124
+ # is, to nothing.
117
125
  rt_lint_for_default() {
118
126
  runner="$(rt_runner)"
119
127
  case "$1" in
@@ -122,49 +130,52 @@ rt_lint_for_default() {
122
130
  esac
123
131
  }
124
132
 
125
- # Каталог папок задач. Пусто — ведения работы папкой в дереве нет, и гард замысла молчит.
126
- # Каталог текстов проекта: по нему признак состава правки отличает текстовую ветку от кодовой.
133
+ # The directory of task folders. Empty — there is no conduct of work by a folder in the tree, and
134
+ # the plan guard stays silent. The directory of the project's texts: by it the edit composition sign
135
+ # tells a text branch from a code branch.
127
136
  RT_DOCS_DIR="${RT_DOCS_DIR:-docs}"
128
137
 
129
138
  RT_TASKS_DIR="${RT_TASKS_DIR:-docs/tasks}"
130
139
 
131
- # Каталог записей о законченных работах. Туда переносят то, что объясняет решения закрытой
132
- # задачи. Гард поставки требует, чтобы ветка, удалившая папку задачи, что-то сюда добавила:
133
- # удалить проще, чем разобрать, а слова владельца больше нигде не записаны.
140
+ # The directory of records about finished work. What explains the decisions of a closed task is
141
+ # moved there. The delivery guard demands that a branch which removed a task folder add something
142
+ # here: removing is easier than taking apart, and the owner's words are written nowhere else.
134
143
  RT_ARCHIVE_DIR="${RT_ARCHIVE_DIR:-docs/archive}"
135
144
 
136
- # Размер окна захода в токенах и пороги стража. Пусто — стража нет: считать долю не от чего, а
137
- # выведенный из записи захода размер врал бы — модель записана там без пометки о расширенном
138
- # окне. Дерево задаёт его в настройке агента, переменной окружения того же имени.
145
+ # The size of the session window in tokens and the guard thresholds. Empty — there is no guard:
146
+ # there is nothing to count the share from, and a size derived from the session record would lie —
147
+ # the model is written there without a mark about the extended window. The tree sets it in the agent
148
+ # settings, by an environment variable of the same name.
139
149
  #
140
- # Теми же двумя числами задаётся порог, на котором инструмент сжимает контекст сам, — а значит и
141
- # порог, на котором пишется передача захода. В настройке агента им отвечает пара: размер окна
142
- # автосжатия и доля в процентах, при которой оно приходит. Разъехавшись, они дают заход, который
143
- # либо сжимается до того, как передача написана, либо доживает до предела окна. Сведены они или
144
- # нет — говорит разбор состояния раскладки; здесь у пакета своих значений нет, потому что окно
145
- # принадлежит дереву, а не ему.
150
+ # The same two numbers set the threshold at which the tool compacts the context itself — and so the
151
+ # threshold at which the session handover is written. In the agent settings they are answered by a
152
+ # pair: the autocompaction window size and the percentage share at which it comes. Having drifted
153
+ # apart, they give a session that either compacts before the handover is written or lives up to the
154
+ # window limit. Whether they are aligned is told by the layout status review; here the package has
155
+ # no values of its own, because the window belongs to the tree, not to it.
146
156
  #
147
- # Сведёнными считаются не совпавшие числа, а разведённые. Порог сжатия обязан стоять НИЖЕ порога
148
- # остановки: первым срабатывает то, что заход продолжает, а не то, что его останавливает.
149
- # Совпавшая пара — гонка, и выигрывает её страж: он стоит на вызове инструмента, а сжатие
150
- # приходит между ходами. Ровно так заход и вставал на пороге вместо того, чтобы продолжиться
151
- # сжатым, — при том что сверка обе стороны считала настроенными.
157
+ # Aligned means not matching numbers but spread ones. The compaction threshold must stand BELOW the
158
+ # stop threshold: what continues the session fires first, not what stops it. A matching pair is a
159
+ # race, and the guard wins it: it stands on the tool call, while compaction comes between turns.
160
+ # Exactly so the session halted at the threshold instead of continuing compacted — while the audit
161
+ # counted both sides as configured.
152
162
  #
153
- # Насколько ниже — своё число дерева: сжатие идёт не мгновенно, и разница в один процент
154
- # требование «ниже» удовлетворяет, а работу не спасает. Запас объявляется, а не выводится
155
- # разницей.
163
+ # How much lower is the tree's own number: compaction is not instant, and a difference of one
164
+ # percent satisfies the "below" requirement without saving the work. The margin is declared, not
165
+ # derived from the difference.
156
166
  RT_WINDOW_TOKENS="${RT_WINDOW_TOKENS:-}"
157
167
  RT_WINDOW_WARN_PCT="${RT_WINDOW_WARN_PCT:-40}"
158
168
  RT_WINDOW_STOP_PCT="${RT_WINDOW_STOP_PCT:-50}"
159
169
  RT_WINDOW_MARGIN_PCT="${RT_WINDOW_MARGIN_PCT:-5}"
160
170
 
161
- # Куда кладётся передача захода. Вне дерева: состояние работы живёт в ходе работы и коммитится,
162
- # а передача его пересказывает для вставки в новый заход и в историю не едет.
171
+ # Where the session handover is put. Outside the tree: the work state lives in the progress and is
172
+ # committed, while the handover retells it for pasting into a new session and does not travel into
173
+ # history.
163
174
  RT_HANDOFF_DIR="${RT_HANDOFF_DIR:-.claude/handoff}"
164
175
 
165
- # Команды, которые проходят после порога остановки: ими заход закрывается. Отбить их значило бы
166
- # отобрать у него единственный способ закончиться. Вызов считается по началу строки или сразу за
167
- # разделителем — упоминание команды в тексте командой не является.
176
+ # The commands that pass after the stop threshold: the session closes with them. Refusing them would
177
+ # take away its only way to end. A call counts by the start of the line or right after a separator —
178
+ # a mention of a command in text does not count as a command.
168
179
  rt_handoff_allowed_cmd_default() {
169
180
  case "$1" in
170
181
  git\ * | *[\;\&\|]\ *git\ * | *\$\(git\ *) return 0 ;;
@@ -175,43 +186,46 @@ rt_handoff_allowed_cmd_default() {
175
186
  return 1
176
187
  }
177
188
 
178
- # Где лежат тексты, которые читают до вопроса владельцу: законы, правила и договорённости о
179
- # продукте. По ним гард разговора судит, читалось ли за ход хоть что-то, и их же называет в
180
- # подсказке. Пусто у законов и правил разом — дерево этого требования не получает: читать
181
- # нечего.
189
+ # Where the texts read before a question to the owner lie: laws, rules and product agreements. By
190
+ # them the conversation guard judges whether anything at all was read during the turn, and it names
191
+ # them in the hint. Empty for laws and rules at once — the tree does not get this requirement: there
192
+ # is nothing to read.
182
193
  RT_LAWS_DIR="${RT_LAWS_DIR:-docs/constitution}"
183
194
  RT_RULES_DIR="${RT_RULES_DIR:-.claude/skills}"
184
195
  RT_SPECS_DIR="${RT_SPECS_DIR:-docs/specs}"
185
196
 
186
- # Каталог замыслов, переживающих одну задачу: порядок задач эпика лежит там, а не в правилах.
197
+ # The directory of plans that outlive one task: the order of an epic's tasks lies there, not in the
198
+ # rules.
187
199
  RT_PLANS_DIR="${RT_PLANS_DIR:-docs/plans}"
188
200
 
189
- # Главная ветка. Гарду она нужна, чтобы найти общего предка и понять, что ветка сделала с
190
- # папкой задачи и с архивом. Если общего предка нет, сравнивать не с чем — проверка молчит.
201
+ # The main branch. The guard needs it to find the common ancestor and understand what the branch did
202
+ # with the task folder and with the archive. If there is no common ancestor, there is nothing to
203
+ # compare with — the check stays silent.
191
204
  RT_MAIN_BRANCH="${RT_MAIN_BRANCH:-main}"
192
205
 
193
- # Имя клиента хостинга в строке запуска. По нему гард перезапуска узнаёт вызов: у каждого вида
194
- # хостинга свой клиент, и угаданное имя не совпадает ни с чем. Умолчание записано под самый
195
- # распространённый вид; дерево с другим хостингом называет своё.
206
+ # The name of the hosting client in the launch line. By it the restart guard recognises the call:
207
+ # each kind of hosting has its own client, and a guessed name matches nothing. The default is
208
+ # written for the most common kind; a tree with other hosting names its own.
196
209
  RT_HOST_CLI="${RT_HOST_CLI:-gh}"
197
210
 
198
- # Тело PR по его номеру. Обход требования пишут в PR, а в команде слияния его нет — там только
199
- # номер. Пустой ответ значит «спросить не у кого»: тогда обход ищется только в тексте команды.
211
+ # The PR body by its number. A bypass of a requirement is written in the PR, and the merge command
212
+ # does not carry it — only the number is there. An empty reply means "nobody to ask": then the
213
+ # bypass is looked for only in the command text.
200
214
  rt_report_body_default() {
201
215
  command -v gh >/dev/null 2>&1 || return 1
202
216
  gh pr view "$1" --json body -q '.body' 2>/dev/null
203
217
  }
204
218
 
205
- # Код приложения ли это. Успех — да, и тогда правка требует замысла на диске.
219
+ # Whether this is application code. Success — yes, and then the edit demands a plan on disk.
206
220
  #
207
- # Признак — путь, а не оценка на глаз: оценку назначает тот, кому она мешает, и порог плывёт.
208
- # Правила, тексты, обвязка и зависимости под требование не попадают — иначе разбор задачи
209
- # нельзя было бы вести до заведения ветки.
221
+ # The sign is the path, not a judgement by eye: the judgement is made by the one it hinders, and the
222
+ # threshold drifts. Rules, texts, the harness and dependencies do not fall under the requirement —
223
+ # otherwise the grill of a task could not be conducted before the branch is created.
210
224
  #
211
- # Судится путь относительно корня дерева: каталог со словом `projects` в имени встречается и
212
- # вне репозитория, а правка файла вне корня замыслом этой ветки не распоряжается вовсе. Гарды
213
- # отдают сюда абсолютный путь целиком, и образец по подстроке совпадал бы с домашним каталогом
214
- # агента ровно так же, как с кодом дерева.
225
+ # The path is judged relative to the tree root. A directory with the word `projects` in its name
226
+ # occurs outside the repository too, and an edit of a file outside the root does not dispose of this
227
+ # branch's plan at all. The guards hand the whole absolute path here, and a substring pattern would
228
+ # match the agent's home directory exactly as it matches the tree's code.
215
229
  rt_is_app_code_default() {
216
230
  root="${CLAUDE_PROJECT_DIR:-$PWD}"
217
231
  case "$1" in
@@ -225,123 +239,154 @@ rt_is_app_code_default() {
225
239
  esac
226
240
  }
227
241
 
228
- # Разбор команды оболочки — пишет ли она и какие пути называет — живёт соседним файлом:
229
- # вдвоём с ним профиль перерастал предел длины, а читают эти две функции порознь.
242
+ # Parsing a shell command — whether it writes and which paths it names — lives in a neighbouring
243
+ # file: together with it the profile outgrew the length limit, and these two functions are read
244
+ # apart.
230
245
  # shellcheck disable=SC1090
231
246
  [ -f "$(dirname "${BASH_SOURCE[0]}")/shell.sh" ] && . "$(dirname "${BASH_SOURCE[0]}")/shell.sh"
232
247
 
233
- # Имя ветки, с которой разрешено открывать заявку на слияние: в имени стоит номер задачи.
234
- # Приставка — либо род правки, либо метка очереди работ: обе формы носят номер, а он и нужен.
248
+ # The name of a branch from which a PR may be opened: the task number stands in the name. The prefix
249
+ # is either the kind of edit or the work queue label: both forms carry the number, and that is what
250
+ # is needed.
235
251
  #
236
- # Хвост после номера — строчными и через дефис. Имя ветки читают глазами в списке и набирают
237
- # руками, а регистр в нём различает две ветки, отличающиеся только им, — и та, что нужна, при
238
- # переключении находится не с первого раза.
252
+ # The tail after the number is lowercase and hyphenated. A branch name is read by eye in a list and
253
+ # typed by hand, and case in it distinguishes two branches that differ only by it — and the one
254
+ # needed is not found at the first switch.
239
255
  rt_task_branch_ok_default() {
240
256
  printf '%s' "$1" \
241
257
  | grep -qE '^([A-Z]+-)?[0-9]+-[a-z0-9][a-z0-9-]*$|^(feat|fix|refactor|docs|chore|style|perf|test|build|ci)/[0-9]+-[a-z0-9][a-z0-9-]*$'
242
258
  }
243
259
 
244
- # Номер задачи из имени ветки. Второй вопрос к тому же имени: форма отвечает «годится ли»,
245
- # а это — «какой он», и свести их в одно нельзя: одна возвращает код, другой строку.
260
+ # The task number from the branch name. A second question to the same name: the form answers "is it
261
+ # fit", this one — "what is it", and they cannot be folded into one: one returns a code, the other a
262
+ # string.
246
263
  #
247
- # Формы те же, что знает проверка формы выше: приставкой стоит либо ключ задач через дефис,
248
- # либо род правки через косую черту, либо её нет вовсе. Разойдясь с ней, разбор оставит форму
249
- # законной, а номер пустым — и сверка номера ветки с номером заголовка заявки пропустится молча,
250
- # выглядя при этом сошедшейся.
264
+ # The forms are the same the form check above knows: the prefix is either the task key with a
265
+ # hyphen, or the kind of edit with a slash, or there is none at all. Having drifted from it, the
266
+ # parse would leave the form lawful and the number empty — and the check of the branch number
267
+ # against the PR title number would be skipped silently while looking matched.
251
268
  #
252
- # Хвост после номера здесь не судится намеренно: `RT-9_guest` — это промах в разделителе, а не
253
- # осознанно беззадачная ветка, и номер из неё вынуть надо, чтобы форму имени было с чем сверить.
254
- # Требование дефиса оставляло такое имя без номера, и гард пропускал его как ветку под пробу.
269
+ # The tail after the number is deliberately not judged here. `RT-9_guest` is a miss in the
270
+ # separator, not a deliberately taskless branch, and the number has to be taken out of it so that
271
+ # the name form has something to be checked against. Requiring the hyphen left such a name without a
272
+ # number, and the guard let it through as a trial branch.
255
273
  rt_task_branch_number_default() {
256
274
  printf '%s' "$1" | sed -nE 's#^([A-Za-z]+[-/])?([0-9]+).*#\2#p'
257
275
  }
258
276
 
259
- # Адрес боевого хранилища: образец, по которому его узнают в командной строке — порт туннеля,
260
- # хост, домен. Любая запись по нему отбивается совсем, и опт-аут не действует. Умолчание
261
- # молчит: чужой адрес здесь опаснее неназванного — он отбивал бы работу с локальной базой.
277
+ # The address of the production storage: the pattern by which it is recognised on the command line —
278
+ # the tunnel port, the host, the domain. Any write by it is refused outright, and the opt-out does
279
+ # not apply. The default stays silent: someone else's address here is more dangerous than an unnamed
280
+ # one — it would refuse work with the local database.
262
281
  RT_PROD_DSN="${RT_PROD_DSN:-}"
263
282
 
264
- # Подключения среды разработки в лицо: по одному тексту запроса бой от локальной копии не
265
- # отличить, база выбирается идентификатором подключения. Идентификаторы локальны для машины.
283
+ # The dev environment connections by sight: by the query text alone production cannot be told from a
284
+ # local copy, the database is chosen by the connection identifier. The identifiers are local to the
285
+ # machine.
266
286
  RT_PROD_CONNECTIONS="${RT_PROD_CONNECTIONS:-}"
267
287
  RT_LOCAL_CONNECTIONS="${RT_LOCAL_CONNECTIONS:-}"
268
288
 
269
- # Порты одноразовых баз: по ним вопрос не задаётся. Не назван — исключения нет вовсе.
289
+ # The ports of one-off databases: no question is asked about them. Not named — there is no exception
290
+ # at all.
270
291
  RT_SCRATCH_PORT_RE="${RT_SCRATCH_PORT_RE:-}"
271
292
 
272
- # Форма номера в заголовке заявки на слияние. Тот же номер стоит у задачи и у ветки.
293
+ # The form of the number in the PR title. The same number stands on the task and on the branch.
273
294
  RT_TASK_TITLE_RE="${RT_TASK_TITLE_RE:-^\[[A-Za-z]+-[0-9]+\][[:space:]]+[^[:space:]]}"
274
295
 
275
- # Чем заводится задача и чем сверяется очередь работ. Идут в текст отказа гарда поставки:
276
- # отказ без действия обходят, а не исполняют.
296
+ # What creates a task and what audits the work queue. They go into the refusal text of the delivery
297
+ # guard: a refusal without an action is bypassed, not carried out.
277
298
  RT_TASK_NEW_CMD="${RT_TASK_NEW_CMD:-npm run task:new}"
278
299
  RT_BOARD_CHECK_CMD="${RT_BOARD_CHECK_CMD:-npm run check:board}"
279
300
 
280
- # Учётная запись, которую ставят исполнителем и которой открывают заявку. Умолчание молчит: у
281
- # каждого дерева она своя, а у иного её нет вовсе.
301
+ # What removes the archive records that outstayed their term. The progress guard does not judge this
302
+ # command. Records age by the calendar, and the term step goes red by itself, without a single edit
303
+ # in the branch. That includes a branch into which work is brought by merges and where no task
304
+ # folders are created at all. Demanding a plan for such a cleanup would leave the PR red with no way
305
+ # out. Empty — the command is not named, and there is no exit from under the guard.
306
+ RT_ARCHIVE_PRUNE_CMD="${RT_ARCHIVE_PRUNE_CMD:-}"
307
+
308
+ # The account that is set as the assignee and that opens the PR. The default stays silent: every
309
+ # tree has its own, and some have none at all.
282
310
  RT_TASK_BOT="${RT_TASK_BOT:-}"
283
311
 
284
- # Чем вызову подставляют токен машинной записи и как эта подстановка выглядит целиком. Клиент
285
- # хостинга держит две записи сразу — залогиненную и ту, чей токен стоит в окружении вызова, — и
286
- # из текста команды видно только явную подстановку. Оба умолчания молчат: дерево без отдельной
287
- # машинной записи автора заявки не судит вовсе.
312
+ # The emails of the people who commit into this tree by hand, separated by spaces. By naming them
313
+ # the tree turns on the second half of the signature check: the machine account and these people are
314
+ # known, everything else is refused. Empty — only a commit that called itself the machine account is
315
+ # judged, and a commit under someone else's account passes silently.
316
+ RT_HUMAN_EMAILS="${RT_HUMAN_EMAILS:-}"
317
+
318
+ # What substitutes the machine account token into a call and how that substitution looks in full.
319
+ # The hosting client holds two accounts at once — the logged-in one and the one whose token stands
320
+ # in the call environment — and only the explicit substitution is visible from the command text.
321
+ # Both defaults stay silent: a tree without a separate machine account does not judge the PR author
322
+ # at all.
288
323
  RT_PULL_TOKEN_VAR="${RT_PULL_TOKEN_VAR:-}"
289
324
  RT_PULL_TOKEN_HINT="${RT_PULL_TOKEN_HINT:-}"
290
325
 
291
- # Кто придёт к хостингу по этому токену. Подстановка в команде говорит только о намерении: она
292
- # читает файл, а файла на машине может не быть — тогда значение пустое, клиент отвечает от
293
- # залогиненной записи, и заявка выходит от владельца при верной с виду команде. Спросить это
294
- # стоит одного вызова, но как спрашивать, знает только дерево: хостинг, клиент и путь к токену
295
- # у каждого свои. Умолчание молчит: дерево, не объявившее функции, второго яруса не получает.
326
+ # Who will come to the hosting by this token. The substitution in the command speaks only of intent:
327
+ # it reads a file, and the file may be missing on the machine. Then the value is empty, the client
328
+ # answers from the logged-in account, and the PR comes out from the owner with a command that looks
329
+ # right. Asking this costs one call, but only the tree knows how to ask: the hosting, the client and
330
+ # the token path are each tree's own. The default stays silent: a tree that did not declare the
331
+ # function does not get the second tier.
296
332
  #
297
- # Контракт: печатает логин, под которым уйдёт пишущий вызов. Пустой вывод означает «спросить не
298
- # удалось» — гард пропускает вызов и сообщает об этом.
333
+ # The contract: prints the login under which the writing call will go. Empty output means "could not
334
+ # ask" — the guard lets the call through and reports it.
299
335
  rt_pull_token_login() { :; }
300
336
 
301
- # Раздел, который тело заявки обязано нести с минуты открытия: решение о слиянии принимается на
302
- # её странице, где переписки нет вовсе, и сказанного вслух там не остаётся. Умолчание молчит —
303
- # заголовок пишется языком заявки, а чужих слов пакет не знает: не названный деревом, раздел не
304
- # судится вовсе.
337
+ # The section the PR body must carry from the minute it is opened: the merge decision is made on its
338
+ # page, where there is no conversation at all, and what was said aloud does not remain there. The
339
+ # default stays silent — the heading is written in the PR's language, and the package does not know
340
+ # foreign words: a section not named by the tree is not judged at all.
305
341
  RT_PULL_BODY_SECTION="${RT_PULL_BODY_SECTION:-}"
306
342
 
307
- # Команда перевода задачи между колонками очереди работ и имя первой колонки — той, из которой
308
- # задача уходит, когда её берут в работу. Имя без умолчания: колонки дерево называет своими
309
- # словами, а выдуманное не совпало бы ни с чем и молча выключило бы проверку колонки.
343
+ # The command that moves a task between the columns of the work queue, and the name of the first
344
+ # column — the one the task leaves when it is taken into work. The name has no default: the tree
345
+ # names the columns in its own words, and an invented one would match nothing and silently turn off
346
+ # the column check.
310
347
  RT_TASK_MOVE_CMD="${RT_TASK_MOVE_CMD:-npm run task:move}"
311
348
  RT_BOARD_BACKLOG="${RT_BOARD_BACKLOG:-}"
312
349
 
313
- # Почта, которой подписан коммит машинной учётной записи. Целым значением, а не образцом:
314
- # служебный адрес хостинга состоит из числа, логина и домена, а сопоставляется по числу — логин
315
- # рядом с ним не сверяет никто. Образец «число, плюс, логин» прошёл бы с чужим числом, то есть
316
- # ровно с тем промахом, ради которого гард поставки подпись и читает.
350
+ # The label of an epic card: by it the guard tells the branch of an epic from the branch of a task,
351
+ # and the branch of an epic is judged by other conditions — its request goes into the main branch,
352
+ # and it opens only when the folders of all its tasks are taken apart. The word is each tree's own,
353
+ # and the default is empty: a tree that has not named it keeps no epics, and the conditions about
354
+ # them are not judged at all.
355
+ RT_BOARD_EPIC_LABEL="${RT_BOARD_EPIC_LABEL:-}"
356
+
357
+ # The email the machine account's commit is signed with. As a whole value, not a pattern: the
358
+ # hosting's service address consists of a number, a login and a domain, and is matched by the number
359
+ # — nobody checks the login next to it. A "number, plus, login" pattern would pass with someone
360
+ # else's number, that is, with exactly the miss for which the delivery guard reads the signature.
317
361
  #
318
- # Отсюда же он берёт логин машинной записи — левой частью адреса, до собаки и после плюса.
319
- # Вторым свойством логин не объявляется: два объявления одного имени разошлись бы молча.
320
- # Исполнитель задачи для этого не годится — там, где хостинг ограничил машинную запись,
321
- # исполнителем ставят человека, а коммит остаётся машинным.
362
+ # From here it also takes the machine account's login — the left part of the address, before the at
363
+ # sign and after the plus. The login is not declared as a second property: two declarations of one
364
+ # name would drift apart silently. The task assignee is not fit for this — where the hosting has
365
+ # restricted the machine account, a person is set as the assignee, and the commit stays the
366
+ # machine's.
322
367
  #
323
- # Умолчание молчит, и тогда подпись не судится: своей машинной записи у пакета нет, а выдуманная
324
- # отбивала бы работу в чужом дереве.
368
+ # The default stays silent, and then the signature is not judged: the package has no machine account
369
+ # of its own, and an invented one would refuse work in someone else's tree.
325
370
  RT_COMMIT_EMAIL="${RT_COMMIT_EMAIL:-}"
326
371
 
327
- # Состояние задачи одним объектом: exists, open, onBoard, assigned, numbered. Спрашивает
328
- # помощника очереди работ — того же, которым пользуются сверка и команда заведения, чтобы
329
- # гард и очередь одинаково понимали «задача в порядке». Нет узла, нет помощника, нет сети —
330
- # молчание, и ярус состояния пропускается: проверять нечем.
372
+ # The task state as one object: exists, open, onBoard, assigned, numbered. Asks the work queue
373
+ # helper — the same one the audit and the create command use, so that the guard and the queue
374
+ # understand "the task is in order" alike. No node, no helper, no network — silence, and the state
375
+ # tier is skipped: there is nothing to check with.
331
376
  rt_task_state_default() {
332
377
  command -v node >/dev/null 2>&1 || return 1
333
378
  [ -f "${RT_BOARD_HELPER:-tools/board.mjs}" ] || return 1
334
379
  state="$(node "${RT_BOARD_HELPER:-tools/board.mjs}" task "$1" 2>/dev/null)" || return 1
335
380
  [ -z "$state" ] && return 1
336
- # Ответ с меткой «сети не было» состоянием не является: по нему нельзя отличить задачу,
337
- # которой нет, от задачи, о которой не спросили.
381
+ # A reply marked "there was no network" is never a state: by it a task that does not exist
382
+ # cannot be told from a task that was not asked about.
338
383
  printf '%s' "$state" | jq -e 'has("offline") | not' >/dev/null 2>&1 || return 1
339
384
  printf '%s' "$state"
340
385
  }
341
386
 
342
- # Состояние заявки одним объектом: exists, draft, author, reviewers, reviewed. Спрашивает того
343
- # же помощника очереди работ, что и состояние задачи, — чтобы гард и сверка одинаково понимали
344
- # «у заявки есть разбор». Нет узла, нет помощника, нет сети — молчание, и ярус пропускается.
387
+ # The PR state as one object: exists, draft, author, reviewers, reviewed. Asks the same work queue
388
+ # helper as the task state — so that the guard and the audit understand "the PR has a review" alike.
389
+ # No node, no helper, no network — silence, and the tier is skipped.
345
390
  rt_pull_state_default() {
346
391
  command -v node >/dev/null 2>&1 || return 1
347
392
  [ -f "${RT_BOARD_HELPER:-tools/board.mjs}" ] || return 1
@@ -351,11 +396,10 @@ rt_pull_state_default() {
351
396
  printf '%s' "$state"
352
397
  }
353
398
 
354
- # Свои открытые заявки, помеченные конфликтующими, — по строке на заявку: «#номер ветка».
355
- # Спрашивает того же помощника очереди работ, что и два соседа выше. Пусто на выходе значит
356
- # «конфликтующих нет», отказ кода возврата — «спросить некого», и ярус гарда пропускается:
357
- # отбивать работу на молчании сети значило бы останавливать её всякий раз, когда её не с чем
358
- # сверить.
399
+ # One's own open PRs marked as conflicting — one line per PR: "#number branch". Asks the same work
400
+ # queue helper as the two neighbours above. Empty output means "no conflicting ones", a failing exit
401
+ # code — "nobody to ask", and the guard tier is skipped: refusing work on the silence of the network
402
+ # would stop it every time there is nothing to check it against.
359
403
  rt_conflicting_pulls_default() {
360
404
  command -v node >/dev/null 2>&1 || return 1
361
405
  command -v jq >/dev/null 2>&1 || return 1
@@ -366,12 +410,13 @@ rt_conflicting_pulls_default() {
366
410
  printf '%s' "$state" | jq -r '.conflicting[]? | "#\(.number) \(.branch)"'
367
411
  }
368
412
 
369
- # Что в этом дереве считается переизобретением. По строке «образец<таб>чем заменить».
370
- # Образцы узкие намеренно: гард сверяет только НОВЫЙ текст, и широкий образец отбивал бы
371
- # правку, которая ничего нового не заводит.
413
+ # What counts as reinvention in this tree. One line per "pattern<tab>replacement". The patterns are
414
+ # narrow on purpose: the guard checks only NEW text, and a wide pattern would refuse an edit that
415
+ # creates nothing new.
372
416
  rt_reinvented_in_default() {
373
- # Четыре поля через табуляцию: над чем, образец, образец отмены, чем заменить. Пустое поле
374
- # пишется пустым — их читают по одному, и схлопывание третьего уносило совет в отмену.
417
+ # Four tab-separated fields: what over, the pattern, the cancel pattern, the replacement. An
418
+ # empty field is written empty — they are read one by one, and collapsing the third carried the
419
+ # advice into the cancel.
375
420
  case "$1" in
376
421
  *.ts)
377
422
  printf '%s\t%s\t%s\t%s\n' 'added' 'get [a-zA-Z]+\(\)[[:space:]]*(:|\{)' '' 'computed(): производное значение сигналом, а не геттером'
@@ -382,27 +427,28 @@ rt_reinvented_in_default() {
382
427
  esac
383
428
  }
384
429
 
385
- # Где лежат наборы признаков единообразия — они раскладываются рядом с проверками, а раскладка
386
- # проверок у каждого дерева своя. Читают их и гард на правке, и сплошная сверка.
430
+ # Where the uniformity signal sets lie — they are laid out next to the checks, and the layout of
431
+ # checks is each tree's own. Both the guard on an edit and the full audit read them.
387
432
  RT_REUSE_SIGNALS_DIR="${RT_REUSE_SIGNALS_DIR:-tools/signals}"
388
433
 
389
- # Где якорь для спек не требуется. Витрина, корневая разметка и сборка — общее у всех деревьев;
390
- # своё дерево дописывает надстройкой.
434
+ # Where an anchor for the specs is not required. The showcase, the root markup and the build are
435
+ # common to all trees; a tree adds its own by an override.
391
436
  RT_QA_SKIP_RE="${RT_QA_SKIP_RE:-/node_modules/|/dist/|\.stories\.html\$|/src/index\.html\$}"
392
437
 
393
- # По какому имени тег опознаётся компонентом этого дерева. Умолчание — составной тег: имя с
394
- # дефисом принадлежит компоненту, а не разметке, и это верно везде, где есть свои компоненты.
438
+ # By which name a tag is recognised as a component of this tree. The default is a compound tag: a
439
+ # hyphenated name belongs to a component, not to markup, and that is true wherever there are
440
+ # components of one's own.
395
441
  RT_QA_COMPONENT_RE="${RT_QA_COMPONENT_RE:--}"
396
442
 
397
- # Теги, которые спека не нажимает: оформление, разметка страницы, индикаторы. Перечисляются
398
- # именами через пробел. Умолчание молчит: у каждого кита свои, а чужое имя здесь глушило бы
399
- # проверку на теге, которого в этом дереве нет.
443
+ # The tags the spec does not press: styling, page markup, indicators. Listed by name, separated by
444
+ # spaces. The default stays silent: every kit has its own, and a foreign name here would silence the
445
+ # check on a tag this tree does not have.
400
446
  rt_qa_decorative_default() {
401
447
  return 0
402
448
  }
403
449
 
404
- # Умолчания под общими именами. Надстройка проекта объявит любое из них заново — и позовёт
405
- # отсюда то же имя с суффиксом `_default` для всего, чего не назвала сама.
450
+ # Defaults under the shared names. The project override will declare any of them anew — and call the
451
+ # same name from here with the `_default` suffix for everything it did not name itself.
406
452
  rt_push_checks() { rt_push_checks_default "$@"; }
407
453
  rt_push_docs_only() { rt_push_docs_only_default "$@"; }
408
454
 
@@ -412,9 +458,10 @@ rt_task_branch_ok() { rt_task_branch_ok_default "$@"; }
412
458
  rt_task_branch_number() { rt_task_branch_number_default "$@"; }
413
459
  rt_reinvented_in() { rt_reinvented_in_default "$@"; }
414
460
  rt_is_app_code() { rt_is_app_code_default "$@"; }
415
- # Каталог источников пакета правил в этом дереве, от корня. Пусто — дерево пакета не везёт, и
416
- # адрес правки у него один: надстройка. Дерево, которое пакет и разрабатывает, называет каталог
417
- # сам — иначе гард места правки посылал бы его в надстройку вместо источника.
461
+ # The directory of the rules package sources in this tree, from the root. Empty — the tree does not
462
+ # carry the package, and it has one edit address: the override. The tree that develops the package
463
+ # itself names the directory — otherwise the edit-place guard would send it to the override instead
464
+ # of the source.
418
465
  rt_kit_sources_dir_default() { printf ''; }
419
466
 
420
467
  rt_shell_writes() { rt_shell_writes_default "$@"; }