@rt-tools/agent-kit 0.23.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/README.md +8 -2
  2. package/assets/agents/business-analyst.md +51 -50
  3. package/assets/agents/conscience.md +37 -35
  4. package/assets/agents/project-manager.md +49 -48
  5. package/assets/agents/prose-editor.md +31 -29
  6. package/assets/agents/qa-engineer.md +50 -48
  7. package/assets/agents/rules-reviewer.md +63 -58
  8. package/assets/agents/skill-curator.md +83 -78
  9. package/assets/agents/spec-critic.md +34 -29
  10. package/assets/agents/spec-writer.md +35 -32
  11. package/assets/agents/strict-teacher.md +39 -37
  12. package/assets/checks/archive-age.mjs +48 -28
  13. package/assets/checks/archive-prune.mjs +16 -14
  14. package/assets/checks/board-epics.github.mjs +75 -41
  15. package/assets/checks/board-folders.mjs +61 -0
  16. package/assets/checks/board-gh.github.mjs +35 -26
  17. package/assets/checks/board-long-work.github.mjs +24 -24
  18. package/assets/checks/board-paths.github.mjs +21 -16
  19. package/assets/checks/board-runs.github.mjs +45 -43
  20. package/assets/checks/board-titles.github.mjs +19 -17
  21. package/assets/checks/board.github.mjs +150 -128
  22. package/assets/checks/check-archive-age.mjs +23 -19
  23. package/assets/checks/check-board.github.mjs +179 -157
  24. package/assets/checks/check-descriptions.mjs +30 -29
  25. package/assets/checks/check-doc-paths.mjs +104 -82
  26. package/assets/checks/check-dupes.mjs +84 -80
  27. package/assets/checks/check-file-size.mjs +79 -70
  28. package/assets/checks/check-glossary.mjs +47 -37
  29. package/assets/checks/check-hook-scope.mjs +30 -27
  30. package/assets/checks/check-lib-layers.mjs +22 -21
  31. package/assets/checks/check-profile-drift.mjs +48 -43
  32. package/assets/checks/check-prose-style.mjs +125 -33
  33. package/assets/checks/check-push-gate.mjs +53 -50
  34. package/assets/checks/check-reuse.mjs +50 -40
  35. package/assets/checks/check-schema-drift.mjs +87 -83
  36. package/assets/checks/check-specs.mjs +155 -134
  37. package/assets/checks/check-state-next.mjs +66 -52
  38. package/assets/checks/check-states.mjs +32 -30
  39. package/assets/checks/check-styles.mjs +52 -51
  40. package/assets/checks/check-turn-map.mjs +54 -46
  41. package/assets/checks/lib-boundaries.mjs +32 -30
  42. package/assets/checks/lib-common.mjs +30 -29
  43. package/assets/checks/lib-domains.mjs +34 -34
  44. package/assets/checks/lib-manifests.mjs +17 -15
  45. package/assets/checks/lib-reexports.mjs +18 -18
  46. package/assets/checks/rt-kit-checks.config.mjs +174 -142
  47. package/assets/checks/signals.mjs +43 -39
  48. package/assets/checks/spec-anchors.mjs +114 -87
  49. package/assets/checks/spec-common.mjs +128 -84
  50. package/assets/checks/spec-contract.mjs +30 -30
  51. package/assets/checks/spec-proposed.mjs +27 -24
  52. package/assets/checks/spec-scenarios.mjs +51 -28
  53. package/assets/checks/task-new.github.mjs +85 -56
  54. package/assets/commands/feedback.md +65 -59
  55. package/assets/commands/next-session.md +64 -57
  56. package/assets/commands/skill-curator.md +83 -79
  57. package/assets/defaults/gate-map.sh +115 -91
  58. package/assets/defaults/project.sh +228 -178
  59. package/assets/defaults/shell.sh +85 -65
  60. package/assets/defaults/turn-map.md +45 -44
  61. package/assets/docs/GLOSSARY.md +142 -65
  62. package/assets/hooks/browser-device-id.sh +12 -12
  63. package/assets/hooks/browser-guard-device-id.sh +46 -14
  64. package/assets/hooks/browser-guard-no-asking.sh +5 -4
  65. package/assets/hooks/browser-guard-no-listing.sh +12 -11
  66. package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
  67. package/assets/hooks/browser-guard-require-select.sh +34 -23
  68. package/assets/hooks/claim-guard.sh +62 -56
  69. package/assets/hooks/commit-msg.sh +11 -10
  70. package/assets/hooks/conscience-guard.sh +91 -45
  71. package/assets/hooks/constitution-index.sh +16 -16
  72. package/assets/hooks/deny-tail.sh +28 -26
  73. package/assets/hooks/dev-server-guard.sh +46 -43
  74. package/assets/hooks/dispatch.sh +84 -39
  75. package/assets/hooks/docs-guard.sh +105 -86
  76. package/assets/hooks/exam-guard.sh +146 -84
  77. package/assets/hooks/git-guard-delivery-conflict.sh +38 -36
  78. package/assets/hooks/git-guard-delivery-draft.sh +85 -0
  79. package/assets/hooks/git-guard-delivery-folder.sh +50 -43
  80. package/assets/hooks/git-guard-delivery-signature.sh +88 -52
  81. package/assets/hooks/git-guard-delivery.sh +207 -253
  82. package/assets/hooks/git-guard-main.sh +65 -26
  83. package/assets/hooks/git-guard-push-tests.sh +133 -75
  84. package/assets/hooks/glossary-load.sh +23 -22
  85. package/assets/hooks/grill-gate-ask.sh +12 -11
  86. package/assets/hooks/grill-gate.sh +94 -87
  87. package/assets/hooks/guard-note.sh +20 -19
  88. package/assets/hooks/handoff-entry-guard.sh +26 -24
  89. package/assets/hooks/handoff-write.sh +74 -67
  90. package/assets/hooks/hook-input.sh +70 -50
  91. package/assets/hooks/lint-after-edit.sh +95 -61
  92. package/assets/hooks/observe.sh +28 -26
  93. package/assets/hooks/override-write-guard.sh +23 -21
  94. package/assets/hooks/postmortem-guard.sh +42 -39
  95. package/assets/hooks/profile-check.sh +22 -20
  96. package/assets/hooks/proposal-guard.sh +57 -49
  97. package/assets/hooks/prose-style-guard.sh +19 -17
  98. package/assets/hooks/qa-dataid-guard.sh +52 -49
  99. package/assets/hooks/rerun-guard.sh +31 -30
  100. package/assets/hooks/reuse-first-guard.sh +108 -87
  101. package/assets/hooks/roles.sh +14 -14
  102. package/assets/hooks/rule-article.sh +36 -34
  103. package/assets/hooks/rule-source-guard.sh +52 -36
  104. package/assets/hooks/skill-gate-layers.sh +59 -57
  105. package/assets/hooks/skill-gate-rearm.sh +15 -8
  106. package/assets/hooks/skill-gate.sh +89 -81
  107. package/assets/hooks/skill-loaded.sh +6 -6
  108. package/assets/hooks/sql-guard-parse.sh +68 -66
  109. package/assets/hooks/sql-guard-request.sh +48 -46
  110. package/assets/hooks/sql-guard-target.sh +57 -51
  111. package/assets/hooks/sql-guard-write.sh +84 -79
  112. package/assets/hooks/sql-guard.sh +52 -47
  113. package/assets/hooks/stand-login-guard.sh +104 -0
  114. package/assets/hooks/task-context-load.sh +60 -55
  115. package/assets/hooks/task-flow-context.sh +87 -69
  116. package/assets/hooks/task-flow-draft-guard.sh +55 -48
  117. package/assets/hooks/task-flow-guard.sh +67 -64
  118. package/assets/hooks/turn-entry-load.sh +39 -32
  119. package/assets/hooks/turn-exit-guard.sh +256 -204
  120. package/assets/hooks/turn-exit-patterns.sh +53 -0
  121. package/assets/hooks/utf8.sh +11 -11
  122. package/assets/hooks/waiting-turn-guard.sh +94 -94
  123. package/assets/hooks/window-fill-guard.sh +70 -62
  124. package/assets/hooks/work-start-guard.sh +52 -49
  125. package/assets/hooks/write-targets.sh +115 -30
  126. package/assets/laws/autonomous-work.md +29 -27
  127. package/assets/laws/code-structure.md +31 -30
  128. package/assets/laws/delivery.md +148 -137
  129. package/assets/laws/entity-editing.md +52 -50
  130. package/assets/laws/entity-models.md +14 -13
  131. package/assets/laws/frontend-application.md +39 -38
  132. package/assets/laws/lib-imports.md +27 -27
  133. package/assets/laws/lists.md +31 -29
  134. package/assets/laws/navigation.md +37 -37
  135. package/assets/laws/observability.md +41 -40
  136. package/assets/laws/project-documentation.md +106 -99
  137. package/assets/laws/reuse-first.md +31 -29
  138. package/assets/laws/shared-code.md +27 -27
  139. package/assets/laws/verifiability.md +131 -114
  140. package/assets/laws/work-conduct.md +250 -250
  141. package/assets/patterns/admin-lists-screen.md +72 -69
  142. package/assets/patterns/admin-nav-item.md +51 -46
  143. package/assets/patterns/angular-patterns-state.md +32 -31
  144. package/assets/patterns/api-layer-pair.md +33 -31
  145. package/assets/patterns/autonomous-work-run.md +50 -49
  146. package/assets/patterns/browser-verification-measure.md +143 -67
  147. package/assets/patterns/browser-verification-stand.md +181 -128
  148. package/assets/patterns/component-structure-new.md +51 -42
  149. package/assets/patterns/dependencies-upgrade.md +55 -39
  150. package/assets/patterns/doc-style-human.md +93 -0
  151. package/assets/patterns/doc-style-sweep.md +82 -79
  152. package/assets/patterns/doc-style-trace.md +87 -81
  153. package/assets/patterns/doc-style-write.md +130 -122
  154. package/assets/patterns/entity-aside.md +77 -63
  155. package/assets/patterns/entity-models-new.md +37 -37
  156. package/assets/patterns/entity-store.md +33 -33
  157. package/assets/patterns/git-workflow-commit.azure.md +94 -75
  158. package/assets/patterns/git-workflow-commit.github.md +153 -129
  159. package/assets/patterns/git-workflow-commit.gitlab.md +96 -78
  160. package/assets/patterns/git-workflow-docker.md +165 -147
  161. package/assets/patterns/git-workflow-freshness.md +45 -45
  162. package/assets/patterns/git-workflow-merge.md +99 -86
  163. package/assets/patterns/git-workflow-migration.md +54 -52
  164. package/assets/patterns/git-workflow-pr-ready.md +57 -56
  165. package/assets/patterns/git-workflow-pr.azure.md +126 -121
  166. package/assets/patterns/git-workflow-pr.github.md +179 -175
  167. package/assets/patterns/git-workflow-pr.gitlab.md +138 -131
  168. package/assets/patterns/git-workflow-restart.md +35 -31
  169. package/assets/patterns/git-workflow-secrets.md +80 -73
  170. package/assets/patterns/git-workflow-stack.md +131 -106
  171. package/assets/patterns/lib-layers-move.md +62 -53
  172. package/assets/patterns/lib-layers-new.md +59 -45
  173. package/assets/patterns/observability-record.md +72 -67
  174. package/assets/patterns/platform-access-di.md +31 -29
  175. package/assets/patterns/reuse-first-extend.md +66 -61
  176. package/assets/patterns/shared-code-new.md +39 -38
  177. package/assets/patterns/spec-driven-domain.md +161 -151
  178. package/assets/patterns/spec-driven-rule.md +179 -168
  179. package/assets/patterns/spec-driven-sweep.md +41 -39
  180. package/assets/patterns/status-report-table.github.md +37 -36
  181. package/assets/patterns/styling-bem-component.md +42 -42
  182. package/assets/patterns/styling-bem-layout.md +39 -34
  183. package/assets/patterns/styling-bem-sheet.md +59 -58
  184. package/assets/patterns/task-flow-archive.md +222 -215
  185. package/assets/patterns/task-flow-close.md +215 -203
  186. package/assets/patterns/task-flow-handoff.md +154 -145
  187. package/assets/patterns/task-flow-resume.md +138 -133
  188. package/assets/patterns/task-flow-start.md +204 -192
  189. package/assets/patterns/testing-e2e.md +103 -92
  190. package/assets/patterns/testing-unit.md +77 -70
  191. package/assets/patterns/ts-procedure.md +32 -29
  192. package/assets/patterns/turn-entry-map.md +50 -48
  193. package/assets/pitfalls/agent-kit.md +152 -141
  194. package/assets/pitfalls/doc-style.md +96 -91
  195. package/assets/pitfalls/git-workflow.azure.md +49 -46
  196. package/assets/pitfalls/git-workflow.github.md +264 -234
  197. package/assets/pitfalls/git-workflow.gitlab.md +49 -45
  198. package/assets/pitfalls/spec-driven.md +73 -71
  199. package/assets/pitfalls/styling-bem.md +46 -40
  200. package/assets/pitfalls/task-flow.md +262 -246
  201. package/assets/pitfalls/testing.md +99 -92
  202. package/assets/pitfalls/turn-conduct.md +96 -81
  203. package/assets/rules/angular-patterns.md +81 -80
  204. package/assets/rules/api-layer.md +77 -74
  205. package/assets/rules/autonomous-work.md +75 -74
  206. package/assets/rules/browser-verification.md +223 -188
  207. package/assets/rules/component-structure.md +72 -69
  208. package/assets/rules/dependencies.md +74 -67
  209. package/assets/rules/deploy-flow.azure.md +118 -108
  210. package/assets/rules/deploy-flow.github.md +145 -135
  211. package/assets/rules/deploy-flow.gitlab.md +120 -110
  212. package/assets/rules/doc-style.md +209 -148
  213. package/assets/rules/entity-conventions.needs-admin.md +81 -79
  214. package/assets/rules/entity-models.md +73 -70
  215. package/assets/rules/git-workflow.azure.md +224 -228
  216. package/assets/rules/git-workflow.github.md +250 -242
  217. package/assets/rules/git-workflow.gitlab.md +218 -217
  218. package/assets/rules/lib-layers.md +85 -86
  219. package/assets/rules/lists.md +101 -97
  220. package/assets/rules/navigation.md +78 -78
  221. package/assets/rules/observability.needs-app.md +165 -153
  222. package/assets/rules/platform-access.md +76 -75
  223. package/assets/rules/reuse-first.md +153 -137
  224. package/assets/rules/shared-code.md +82 -79
  225. package/assets/rules/spec-driven.md +272 -260
  226. package/assets/rules/status-report.md +55 -58
  227. package/assets/rules/styling-bem.md +83 -72
  228. package/assets/rules/task-flow.md +282 -270
  229. package/assets/rules/testing.md +224 -188
  230. package/assets/rules/turn-conduct.md +255 -258
  231. package/assets/rules/turn-entry.md +92 -87
  232. package/assets/rules/typescript-conventions.md +94 -88
  233. package/assets/samples/specs/_template/spec.md +47 -47
  234. package/assets/samples/tasks/_template/grill.md +20 -20
  235. package/assets/samples/tasks/_template/plan.md +32 -30
  236. package/assets/samples/tasks/_template/progress.md +16 -16
  237. package/assets/skills/agent-kit-extend.md +129 -113
  238. package/assets/skills/agent-kit.md +236 -222
  239. package/assets/skills/write-a-skill.md +76 -71
  240. package/assets/templates/findings.md +19 -19
  241. package/assets/templates/gate-map.sh +16 -14
  242. package/assets/templates/implementation.md +28 -27
  243. package/assets/templates/pattern.md +17 -17
  244. package/assets/templates/pitfalls.md +6 -6
  245. package/assets/templates/postmortem.md +24 -23
  246. package/assets/templates/project.sh +24 -24
  247. package/assets/templates/proposal.md +62 -60
  248. package/assets/templates/rule.md +38 -38
  249. package/assets/workflows/feature.js +46 -46
  250. package/assets/workflows/plan.js +54 -54
  251. package/lib/catalog.d.ts +2 -0
  252. package/lib/catalog.d.ts.map +1 -1
  253. package/lib/catalog.js +4 -3
  254. package/lib/catalog.js.map +1 -1
  255. package/lib/commands.d.ts.map +1 -1
  256. package/lib/commands.js +68 -4
  257. package/lib/commands.js.map +1 -1
  258. package/lib/companion.js +3 -2
  259. package/lib/companion.js.map +1 -1
  260. package/lib/enroll.d.ts +7 -1
  261. package/lib/enroll.d.ts.map +1 -1
  262. package/lib/enroll.js +13 -4
  263. package/lib/enroll.js.map +1 -1
  264. package/lib/observations.d.ts +10 -1
  265. package/lib/observations.d.ts.map +1 -1
  266. package/lib/observations.js +1 -0
  267. package/lib/observations.js.map +1 -1
  268. package/lib/override-marks.d.ts +24 -0
  269. package/lib/override-marks.d.ts.map +1 -0
  270. package/lib/override-marks.js +98 -0
  271. package/lib/override-marks.js.map +1 -0
  272. package/lib/plan.d.ts +11 -0
  273. package/lib/plan.d.ts.map +1 -1
  274. package/lib/plan.js +10 -1
  275. package/lib/plan.js.map +1 -1
  276. package/lib/ship.d.ts +0 -7
  277. package/lib/ship.d.ts.map +1 -1
  278. package/lib/ship.js +10 -2
  279. package/lib/ship.js.map +1 -1
  280. package/lib/shipment.d.ts.map +1 -1
  281. package/lib/shipment.js +7 -3
  282. package/lib/shipment.js.map +1 -1
  283. package/lib/sync.d.ts.map +1 -1
  284. package/lib/sync.js +45 -11
  285. package/lib/sync.js.map +1 -1
  286. package/package.json +1 -1
  287. package/rt-tools-agent-kit-0.26.0.tgz +0 -0
  288. package/rt-tools-agent-kit-0.23.0.tgz +0 -0
@@ -1,27 +1,30 @@
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
4
+ # Incident guard: a turn in which the executor admitted a miss does not end while there is no
5
+ # incident record. Stop.
6
6
  #
7
- # Зачем именно так. Происшествие — заход, в котором исполнитель сделал не то, а слой правил
8
- # этого не отбил, — исправляемого кода за собой не оставляет. Такой заход кончается извинением
9
- # в переписке: назавтра механизм промаха пересказывается уже приглаженно, остаются выводы, а из
10
- # выводов правило не выводится. Разбор случался только тогда, когда владелец требовал его вслух.
7
+ # Why exactly so. An incident — a session in which the executor did the wrong thing and the rules
8
+ # layer did not refuse it — leaves no code behind that could be fixed. Such a session ends with an
9
+ # apology in the chat: the next day the mechanism of the miss is retold already smoothed over,
10
+ # conclusions remain, and no rule follows from conclusions. An analysis happened only when the
11
+ # owner demanded it out loud.
11
12
  #
12
- # Ловится признание образцами, а не пониманием смысла: оценку «это был промах» назначал бы тот,
13
- # кому она мешает, и порог плыл бы. Набор образцов виден, пополняется правкой и промахивается
14
- # заметно — заход, признавший промах словами вне набора, гард пропускает, и это сказано вслух в
15
- # договорённости, а не считается закрытым.
13
+ # The admission is caught by patterns, not by understanding the meaning: the verdict "that was a
14
+ # miss" would be given by the one it inconveniences, and the threshold would drift. The pattern
15
+ # set is visible, is extended by an edit and misses noticeably — a session that admitted a miss
16
+ # in words outside the set is passed by the guard, and this is said out loud in the agreement
17
+ # rather than counted as closed.
16
18
  #
17
- # Ловится на завершении хода, а не на отправке реплики: к моменту признания промах уже случился,
18
- # и ловить раньше нечего. Этим он отличается от гарда разговора, у которого есть свой инструмент
19
- # — вопрос владельцу.
19
+ # It is caught at the end of the turn, not on sending the reply: by the moment of the admission
20
+ # the miss has already happened, and there is nothing to catch earlier. This sets it apart from
21
+ # the conversation guard, which has a tool of its own — a question to the owner.
20
22
  #
21
- # ОТКАЗ В ПОЛЬЗУ РАБОТЫ: при любой ошибке, отсутствии записи хода и повторном заходе ход
22
- # РАЗРЕШАЕТСЯ (exit 0). Сломанный гард не имеет права заклинить разговор.
23
+ # FAIL-OPEN: on any error, with no turn record and on a repeat pass the turn is ALLOWED (exit 0).
24
+ # A broken guard has no right to jam the conversation.
23
25
 
24
- # Своё имя в наблюдениях: отбой пишет общий хвост отказа, а не сам гард.
26
+ # Own name in the observations: the refusal is written by the shared refusal tail, not by the
27
+ # guard itself.
25
28
  RT_GUARD_NAME=postmortem-guard
26
29
 
27
30
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
@@ -33,7 +36,7 @@ input="$RT_HOOK_INPUT"
33
36
 
34
37
  command -v jq >/dev/null 2>&1 || exit 0
35
38
 
36
- # Повторный заход по тому же ходу не судится: гард сказал своё один раз и отпускает.
39
+ # A repeat pass over the same turn is not judged: the guard has said its word once and lets go.
37
40
  active="$(printf '%s' "$input" | jq -r '.stop_hook_active // false' 2>/dev/null)"
38
41
  [ "$active" = "true" ] && exit 0
39
42
 
@@ -43,11 +46,11 @@ transcript="$(printf '%s' "$input" | jq -r '.transcript_path // empty' 2>/dev/nu
43
46
 
44
47
  root="${CLAUDE_PROJECT_DIR:-.}"
45
48
 
46
- # Каталог записей у дерева свой, и называет его настройка дерева — тем же ключом, каким его
47
- # читает отправка груза. Одно имя на обе стороны: дерево, унёсшее каталог из истории, иначе
48
- # получало бы гард, ищущий записи по прежнему адресу, — и тот молчал бы всегда. Переменная
49
- # остаётся обходом на один запуск, а пустая строка в любой из двух — отказ дерева от требования:
50
- # дереву, которое записей не ведёт, гард не навязывается.
49
+ # The records directory is the tree's own, and the tree settings name it — by the same key the
50
+ # cargo dispatch reads it with. One name for both sides: a tree that moved the directory out of
51
+ # history would otherwise get a guard looking for records at the old address — and it would stay
52
+ # silent forever. The variable remains a bypass for one launch, and an empty string in either of
53
+ # the two is the tree's refusal of the demand: a tree that keeps no records is not forced to.
51
54
  if [ -n "${RT_POSTMORTEMS_DIR+set}" ]; then
52
55
  notes_dir="$RT_POSTMORTEMS_DIR"
53
56
  elif [ -f "$root/.claude/rt-kit.json" ]; then
@@ -58,14 +61,14 @@ fi
58
61
  [ -z "$notes_dir" ] && exit 0
59
62
  [ -d "$root/$notes_dir" ] || exit 0
60
63
 
61
- # Образцы признания промаха. Набор открыт и пополняется правкой: полнота его — открытый вопрос
62
- # договорённости, а не обещание.
64
+ # Patterns of admitting a miss. The set is open and is extended by an edit: its completeness is
65
+ # an open question of the agreement, not a promise.
63
66
  admitted_re='был неправ|был не прав|ошибс|моя ошибк|мой промах|промахнул|проглядел|не проверил|соврал|виноват|извин|прошу прощения|неверно утверждал|утверждение было ложн|принял на веру'
64
67
 
65
- # Ход — это всё, что записано после последнего настоящего ввода владельца. Ответ инструмента
66
- # приходит той же ролью, поэтому строки с `tool_result` вводом не считаются.
68
+ # The turn is everything recorded after the owner's last real input. A tool result arrives under
69
+ # the same role, so lines with `tool_result` do not count as input.
67
70
  #
68
- # Хвост в 400 строк: запись хода растёт всю сессию, а судится только последний ход.
71
+ # A tail of 400 lines: the turn record grows all session long, and only the last turn is judged.
69
72
  verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg re "$admitted_re" '
70
73
  def is_input:
71
74
  .type == "user"
@@ -78,8 +81,8 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg re "$admitted_
78
81
  | (if $i == null then . else .[$i + 1:] end) as $turn
79
82
  | [$turn[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "text") | .text] as $texts
80
83
  | [$turn[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "tool_use")] as $uses
81
- # Признак нечувствителен к регистру флагом, а не приведением: приведение знает только
82
- # латиницу, и «Был неправ» с большой буквы проходило бы мимо набора образцов молча.
84
+ # The sign is case-insensitive by a flag, not by lowercasing: lowercasing knows only Latin
85
+ # letters, and a capitalised "Был неправ" would slip past the pattern set silently.
83
86
  | (($texts | join("\n")) | test($re; "i")) as $admitted
84
87
  | ($uses | map(
85
88
  ((.name // "") | test("^(Write|Edit|MultiEdit)$"))
@@ -90,22 +93,22 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg re "$admitted_
90
93
 
91
94
  [ "$verdict" = "admit" ] || exit 0
92
95
 
93
- # Запись, сделанная за эту сессию, снимает требование и без правки в этом же ходе: разбор мог
94
- # лечь файлом ходом раньше — тем, в котором промах и признали.
96
+ # A record made during this session lifts the demand even without an edit in this same turn: the
97
+ # analysis may have landed as a file a turn earlier — the one in which the miss was admitted.
95
98
  if [ -n "$(find "$root/$notes_dir" -name '*.md' -newermt '-1 day' 2>/dev/null | head -1)" ]; then
96
99
  exit 0
97
100
  fi
98
101
 
99
- reason="BLOCKED by postmortem-guard: в ответе признан промах, а записи о происшествии в \`$notes_dir/\` за сегодня нет. Происшествие — заход, в котором исполнитель сделал не то, а слой правил этого не отбил, — записывается в тот же заход: назавтра механизм промаха пересказывается уже приглаженно, и правило из него не выводится.
102
+ reason="BLOCKED by postmortem-guard: a miss is admitted in the reply, and there is no record of the incident in \`$notes_dir/\` for today. An incident — a session in which the executor did the wrong thing and the rules layer did not refuse it — is written down in that same session: by the next day the mechanism of the miss is retold already smoothed over, and no rule comes out of it.
100
103
 
101
- Запись называет: механизм промаха по шагам, что было доступно до него, чем ловилось и что из этого ушло в слой правил. Без последней строки это жалоба, а не разбор.
104
+ The record names: the mechanism of the miss step by step, what was available before it, what caught it and what of this went into the rules layer. Without the last line it is a complaint, not an analysis.
102
105
 
103
- $notes_dir/<год>-<месяц>-<день>-<короткое имя>.md
106
+ $notes_dir/<year>-<month>-<day>-<short name>.md
104
107
 
105
- Гард судит один ход: следующий заход не отбивается."
108
+ The guard judges one turn: the next session is not refused."
106
109
 
107
- # Общий хвост отказа: два законных хода. Файл может быть не разложен — тогда хвоста нет,
108
- # а причина отказа остаётся прежней.
110
+ # The shared refusal tail: two lawful moves. The file may not be laid out — then there is no
111
+ # tail, and the reason for the refusal stays as it was.
109
112
  # shellcheck disable=SC1090
110
113
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
111
114
  && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
@@ -116,6 +119,6 @@ deny_tail_text="$(rt_deny_tail "")"
116
119
  ${deny_tail_text}"
117
120
 
118
121
  jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
119
- || printf '{"decision":"block","reason":"postmortem-guard: признан промах — запиши разбор происшествия."}\n'
122
+ || printf '{"decision":"block","reason":"postmortem-guard: a miss is admitted — write the analysis of the incident."}\n'
120
123
 
121
124
  exit 0
@@ -1,41 +1,43 @@
1
1
  #!/usr/bin/env bash
2
- # Нехватка функции профиля, сказанная вслух. НЕ гард: объявления `rt-hook:` у него нет, к
3
- # событиям агента он не подключается. Его источают сами гарды — тем же приёмом, каким гейт
4
- # источает карту, а гарды — запись наблюдений.
2
+ # A missing profile function, said out loud. NOT a guard: it has no `rt-hook:` declaration and hooks
3
+ # into no agent event. The guards source it themselves — the same way the gate sources the map and
4
+ # the guards source the observation record.
5
5
  #
6
- # Зачем он есть. Девять хуков пакета зовут функции профиля дерева, и у пяти проверка стоит до
7
- # всякого поведения: нет функции — выход с нулём, не сделав ничего. Такой гард хуже
8
- # отсутствующего: он лежит в дереве, стоит в настройке, виден в списке хуков и читается как
9
- # работающий. Тишина при этом означает разом три разных вещи — «нечего проверять», «проверять
10
- # нечем» и «всё в порядке», — и отличить их нечем.
6
+ # Why it exists. Nine hooks of the package call functions of the tree profile, and in five of them
7
+ # the check stands before any behaviour: no function — exit with zero, having done nothing. Such a
8
+ # guard is worse than a missing one: it lies in the tree, stands in the settings, shows in the hook
9
+ # list and reads as working. Its silence then means three different things at once — "nothing to
10
+ # check", "nothing to check with" and "all is well" — and there is no way to tell them apart.
11
11
  #
12
- # ЧТО ГОВОРИТСЯ. Имя функции и файл, в котором её определяют. Один раз за сессию: на каждый
13
- # вызов та же строка повторялась бы десятки раз за заход и перестала бы читаться.
12
+ # WHAT IS SAID. The function name and the file where it is defined. Once per session: on every call
13
+ # the same line would repeat dozens of times per session and stop being read.
14
14
  #
15
- # ДЕЙСТВИЕ ВСЁ РАВНО ПРОПУСКАЕТСЯ. Хук сообщает о своей неполноте, а не судит правку: судить её
16
- # нечем, и отбивать работу из-за ненастроенного дерева он не вправе.
15
+ # THE ACTION PASSES ANYWAY. The hook reports its own incompleteness and does not judge the edit:
16
+ # there is nothing to judge it with, and it has no right to refuse work because of an unconfigured
17
+ # tree.
17
18
 
18
- # Куда кладётся отметка «об этом уже сказано». Каталог временных файлов, а не дерево: отметка
19
- # живёт один заход и в историю не едет.
19
+ # Where the "already said" mark is put. The temporary files directory, not the tree: the mark lives
20
+ # one session and does not go into history.
20
21
  rt_needs_mark_dir() {
21
22
  printf '%s' "${TMPDIR:-/tmp}"
22
23
  }
23
24
 
24
- # Есть ли функция профиля. Успех — есть, и хук работает дальше. Отказ — нет, и об этом сказано.
25
+ # Is the profile function there. Success — it is, and the hook works on. Failure — it is not, and
26
+ # this has been said.
25
27
  #
26
28
  # rt_needs rt_is_app_code task-flow-guard "$sid"
27
29
  #
28
- # Третий параметр — признак сессии, если хук его знает. Не знает — отметка кладётся на день:
29
- # без признака «один раз за сессию» превратилось бы в «один раз за всю жизнь машины».
30
+ # The third parameter is the session id, if the hook knows it. If not, the mark is put for the day:
31
+ # without the id, "once per session" would turn into "once in the machine's lifetime".
30
32
  rt_needs() {
31
33
  command -v "$1" >/dev/null 2>&1 && return 0
32
34
 
33
35
  rt_needs_key="${3:-$(date +%Y%m%d 2>/dev/null || printf 'nosession')}"
34
36
  rt_needs_mark="$(rt_needs_mark_dir)/rt-kit-needs-$1-$rt_needs_key"
35
37
  if [ ! -f "$rt_needs_mark" ]; then
36
- printf '%s: нет функции %s — её определяют в .claude/rt-kit/project.sh, а умолчание везёт пакет в .claude/rt-kit/defaults/project.sh\n' \
37
- "${2:-хук}" "$1" >&2
38
- printf 'проверка не работает, действие пропущено\n' >&2
38
+ printf '%s: no function %s — it is defined in .claude/rt-kit/project.sh, and the default is carried by the package in .claude/rt-kit/defaults/project.sh\n' \
39
+ "${2:-hook}" "$1" >&2
40
+ printf 'the check does not work, the action is let through\n' >&2
39
41
  : >"$rt_needs_mark" 2>/dev/null || true
40
42
  fi
41
43
 
@@ -1,26 +1,29 @@
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
4
+ # Proposal guard: a turn in which the owner said to write or send a proposal to the rules layer
5
+ # does not end until the sending has happened. Stop.
6
6
  #
7
- # Зачем именно так. Написанное и не отправленное лежит в дереве неотличимо от отправленного:
8
- # своей записи в слое правил у него нет, и владелец читает работу сделанной, пока не спросит
9
- # прямо. Отправка при этом неудобна ровно в одном месте — она пишет отметки в файлы предложений и
10
- # делает дерево грязным, — и этим доводом исполнитель закрывает молчание правил.
7
+ # Why this way. What is written and not sent lies in the tree indistinguishable from what was
8
+ # sent: it has no record of its own in the rules layer, and the owner reads the work as done until
9
+ # they ask directly. Sending is inconvenient in exactly one place — it writes marks into the
10
+ # proposal files and makes the tree dirty — and with that argument the executor closes the
11
+ # silence of the rules.
11
12
  #
12
- # Ловится просьба образцами, а не пониманием смысла: оценку «владелец просил отправить» назначал
13
- # бы тот, кому она мешает. Глагол обязателен: «разбери пропозалы» — работа над уже приехавшими, и
14
- # отправкой она не кончается. Слово «предложение» само по себе не считается тоже — оно ходит в
15
- # каждом втором ходе о другом, и рядом с ним нужно слово о слое правил или о пакете.
13
+ # The request is caught by samples, not by understanding the meaning: the appraisal "the owner
14
+ # asked to send" would be assigned by whoever it hinders. The verb is mandatory: "go through the
15
+ # proposals" is work on what has already arrived, and it does not end with sending. The word
16
+ # "proposal" alone does not count either — it appears in every second turn about something else,
17
+ # and next to it a word about the rules layer or about the package is needed.
16
18
  #
17
- # Отправкой считается вызов команды пакета без сухого прогона, сделанный в том же ходе: сухой
18
- # прогон показывает, что уехало бы, ничего не заводит и следа наружу не оставляет.
19
+ # Sending is a call of the package command without a dry run, made in the same turn: a dry run
20
+ # shows what would leave, creates nothing and leaves no trace outside.
19
21
  #
20
- # ОТКАЗ В ПОЛЬЗУ РАБОТЫ: при любой ошибке, нехватке `jq`, отсутствии записи хода и повторном
21
- # заходе ход РАЗРЕШАЕТСЯ (exit 0). Сломанный гард не имеет права заклинить разговор.
22
+ # FAIL-OPEN: on any error, missing `jq`, missing turn transcript and a repeated pass, the turn is
23
+ # ALLOWED (exit 0). A broken guard has no right to jam the conversation.
22
24
 
23
- # Своё имя в наблюдениях: отбой пишет общий хвост отказа, а не сам гард.
25
+ # Its own name in the observations: the refusal is written by the shared deny tail, not by the
26
+ # guard itself.
24
27
  RT_GUARD_NAME=proposal-guard
25
28
 
26
29
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
@@ -32,7 +35,7 @@ input="$RT_HOOK_INPUT"
32
35
 
33
36
  command -v jq >/dev/null 2>&1 || exit 0
34
37
 
35
- # Повторный заход по тому же ходу не судится: гард сказал своё один раз и отпускает.
38
+ # A repeated pass over the same turn is not judged: the guard has said its word once and lets go.
36
39
  active="$(printf '%s' "$input" | jq -r '.stop_hook_active // false' 2>/dev/null)"
37
40
  [ "$active" = "true" ] && exit 0
38
41
 
@@ -40,37 +43,41 @@ transcript="$(printf '%s' "$input" | jq -r '.transcript_path // empty' 2>/dev/nu
40
43
  [ -z "$transcript" ] && exit 0
41
44
  [ -f "$transcript" ] || exit 0
42
45
 
43
- # Каталог предложений у дерева свой. Заданный пустым — отказ дерева от требования: дереву, не
44
- # берущему переносимый слой правил, гард не навязывается. Каталога нет на диске — то же самое:
45
- # дерево механизмом не пользуется, и стража ему не навязывают. Судить по одной переменной значило
46
- # бы требовать отправки там, где отправлять нечем и некуда.
46
+ # The proposals directory is the tree's own. Set to empty, it is the tree's opt-out from the
47
+ # requirement: a tree that does not take the portable rules layer gets no guard imposed on it. No
48
+ # directory on disk — the same: the tree does not use the mechanism, and the guard is not imposed
49
+ # on it. Judging by one variable alone would demand sending where there is nothing to send with
50
+ # and nowhere to send to.
47
51
  root="${CLAUDE_PROJECT_DIR:-.}"
48
52
  proposals_dir="${RT_PROPOSALS_DIR-.claude/rt-kit/proposals}"
49
53
  [ -z "$proposals_dir" ] && exit 0
50
54
  [ -d "$root/$proposals_dir" ] || exit 0
51
55
 
52
- # Просьба владельца. Набор открыт и пополняется правкой: полнота его — открытый вопрос
53
- # договорённости, а не обещание.
56
+ # The owner's request. The set is open and grows by editing: its completeness is an open question
57
+ # of the agreement, not a promise.
54
58
  #
55
- # Латиница читается наравне: заход, который владелец ведёт по-английски, отличается от русского
56
- # словами, а требование в нём то же. Своей ветки ей не заводится — обе пары стоят в одном
57
- # образце, иначе одну из них правили бы, забывая про вторую.
59
+ # Latin script is read on equal terms: a session the owner conducts in English differs from a
60
+ # Russian one by its words, and the requirement in it is the same. It gets no branch of its own —
61
+ # both pairs stand in one sample, otherwise one of them would be edited while the other is
62
+ # forgotten.
58
63
  asked_re='(завед|напиш|отправ|пошл|зашл|отошл|выгруз|send|file|open|submit|raise|report)[а-яёa-z]*[^.!?]{0,40}(пропозал|предложени|proposal)|(пропозал|предложени|proposal)[а-яёa-z]*[^.!?]{0,40}(завед|напиш|отправ|пошл|зашл|отошл|выгруз|send|file|open|submit|raise|report)'
59
64
 
60
- # Сосед, без которого слово «предложение» не считается просьбой о слое правил.
65
+ # The neighbour without which the word "proposal" does not count as a request about the rules
66
+ # layer.
61
67
  context_re='пропозал|слою правил|слоя правил|слой правил|пакет|agent-kit|наверх|proposal|rule layer|upstream|package'
62
68
 
63
- # Ход — это всё, что записано после последнего настоящего ввода владельца. Ответ инструмента
64
- # приходит той же ролью, поэтому строки с `tool_result` вводом не считаются.
69
+ # A turn is everything recorded after the owner's last real input. A tool result arrives under
70
+ # the same role, so lines with `tool_result` are not counted as input.
65
71
  #
66
- # Сводка сжатия — тоже не ввод, хотя приходит ролью владельца и ответом инструмента не является.
67
- # Она пересказывает ходы, которые уже кончились, и просьба, исполненная вчера, читается в ней как
68
- # сказанная сейчас: ход, где о предложениях не было сказано ни слова, отбивался на пересказе
69
- # чужой просьбы — каталог предложений при этом был пуст, и отправлять было нечего вовсе. По
70
- # словам сводка от речи владельца неотличима и богаче её, потому что пересказывает всю сессию
71
- # разом; узнаётся она признаком записи, а не текстом.
72
+ # A compaction summary is not input either, although it arrives under the owner's role and is not
73
+ # a tool result. It retells turns that have already ended, and a request fulfilled yesterday reads
74
+ # in it as said now: a turn in which not a word was said about proposals was refused on a retelling
75
+ # of someone else's request — the proposals directory was empty at the time, and there was nothing
76
+ # to send at all. By its words the summary is indistinguishable from the owner's speech and richer
77
+ # than it, because it retells the whole session at once; it is recognised by a mark on the record,
78
+ # not by the text.
72
79
  #
73
- # Хвост в 400 строк: запись хода растёт всю сессию, а судится только последний ход.
80
+ # A 400-line tail: the transcript grows all session long, and only the last turn is judged.
74
81
  verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg asked "$asked_re" --arg ctx "$context_re" '
75
82
  def is_input:
76
83
  .type == "user"
@@ -88,8 +95,8 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg asked "$asked_
88
95
  | (if $i == null then [] else .[$i:] end) as $turn
89
96
  | (if $i == null then "" else ($turn[0] | text_of) end) as $said
90
97
  | [$turn[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "tool_use")] as $uses
91
- # Признак нечувствителен к регистру флагом, а не приведением: приведение знает только
92
- # латиницу, и «Отправь Пропозал» с большой буквы проходило бы мимо набора образцов молча.
98
+ # The sign is case-insensitive by a flag, not by lowercasing: lowercasing knows Latin script
99
+ # only, and a capitalised "Send the Proposal" in Cyrillic would pass the sample set silently.
93
100
  | (($said | test($asked; "i")) and ($said | test($ctx; "i"))) as $wanted
94
101
  | ($uses | map(
95
102
  ((.name // "") | test("^Bash$"))
@@ -101,10 +108,11 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg asked "$asked_
101
108
 
102
109
  [ "$verdict" = "owe" ] || exit 0
103
110
 
104
- # Команда отправки называется той, которая в этом дереве исполняется. Дерево, поставившее пакет
105
- # зависимостью, зовёт бинарь из зависимостей; дерево, где пакет живёт исходниками, бинаря не
106
- # имеет вовсе — там зовут собранный bin. Названная наугад команда стоит исполнителю хода: отказ
107
- # читается как указание, и вызов `npx agent-kit` отвечает в таком дереве отказом установки.
111
+ # The sending command is named as the one that runs in this tree. A tree that installed the
112
+ # package as a dependency calls the binary from its dependencies; a tree where the package lives
113
+ # as sources has no binary at all — there the built bin is called. A command named at random
114
+ # costs the executor a turn: the refusal reads as an instruction, and a `npx agent-kit` call in
115
+ # such a tree answers with an installation refusal.
108
116
  if [ -x "$root/node_modules/.bin/agent-kit" ]; then
109
117
  propose_cmd="npx agent-kit propose"
110
118
  else
@@ -116,18 +124,18 @@ else
116
124
  fi
117
125
  fi
118
126
 
119
- reason="BLOCKED by proposal-guard: владелец сказал завести или отправить предложение слою правил, а отправки в этом ходе не было. Написанное и не отправленное лежит в дереве неотличимо от отправленного: своей записи в слое правил у него нет, и владелец читает работу сделанной, пока не спросит прямо.
127
+ reason="BLOCKED by proposal-guard: the owner said to create or send a proposal to the rules layer, and no sending happened in this turn. What is written and not sent lies in the tree indistinguishable from what was sent: it has no record of its own in the rules layer, and the owner reads the work as done until they ask outright.
120
128
 
121
- Предложение пишется файлом в \`$proposals_dir/\` и уезжает в тот же ход:
129
+ A proposal is written as a file in \`$proposals_dir/\` and leaves in the same turn:
122
130
 
123
131
  $propose_cmd
124
132
 
125
- Сухой прогон отправкой не является: он показывает, что уехало бы, и следа наружу не оставляет. Отправка пишет отметки в файлы предложений и делает дерево грязным — при открытом PR они ложатся вторым коммитом в ту же ветку, и это их место, а не повод отложить.
133
+ A dry run is not a sending: it shows what would have left and leaves no trace outward. The sending writes marks into the proposal files and makes the tree dirty — with an open PR they land as a second commit in the same branch, and that is their place, not a reason to postpone.
126
134
 
127
- Гард судит один ход: следующий заход не отбивается."
135
+ The guard judges one turn: the next session is not refused."
128
136
 
129
- # Общий хвост отказа: два законных хода. Файл может быть не разложен — тогда хвоста нет,
130
- # а причина отказа остаётся прежней.
137
+ # The shared deny tail: the two lawful moves. The file may not be laid out — then there is no
138
+ # tail, and the reason for the refusal stays the same.
131
139
  # shellcheck disable=SC1090
132
140
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
133
141
  && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
@@ -138,6 +146,6 @@ deny_tail_text="$(rt_deny_tail "")"
138
146
  ${deny_tail_text}"
139
147
 
140
148
  jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
141
- || printf '{"decision":"block","reason":"proposal-guard: владелец просил предложение — отправь его командой пакета."}\n'
149
+ || printf '{"decision":"block","reason":"proposal-guard: the owner asked for a proposal — send it by the command of the package."}\n'
142
150
 
143
151
  exit 0
@@ -1,18 +1,20 @@
1
1
  #!/usr/bin/env bash
2
2
  # rt-hook: PreToolUse Edit|Write|MultiEdit
3
- # Требует: checks/check-prose-style.mjs, hooks/deny-tail.sh
4
- # Гард слога: канцелярит и слова, которых в этом дереве не пишут, не уезжают в файл.
3
+ # Requires: checks/check-prose-style.mjs, hooks/deny-tail.sh
4
+ # Prose guard: officialese and words that are not written in this tree do not reach the file.
5
5
  #
6
- # Правило о текстах требует простых слов, а держалось это памятью того, кто пишет: ни одна
7
- # формулировочная договорённость не проверялась. Владелец читает написанное и видит машинный
8
- # слог там, где договорённость требует человеческого.
6
+ # The rule about texts demands plain words, and this was held only by the memory of whoever writes:
7
+ # not one wording convention was checked. The owner reads what was written and sees machine prose
8
+ # where the convention demands human prose.
9
9
  #
10
- # Судится только новый текст правки, а не файл целиком: накопленное чинится отдельной работой, и
11
- # отбивать за него правку соседней строки — значит сделать гард обходимым по необходимости.
10
+ # Only the new text of the edit is judged, not the whole file: what has accumulated is fixed by a
11
+ # separate piece of work, and refusing an edit of a neighbouring line because of it would make the
12
+ # guard bypassed out of necessity.
12
13
  #
13
- # FAIL-OPEN: нет узла, нет проверки, чужой инструмент, не `.md` → пропуск.
14
+ # FAIL-OPEN: no node, no check, a foreign tool, not `.md` → pass.
14
15
 
15
- # Своё имя в наблюдениях: отбой пишет общий хвост отказа, а не сам гард.
16
+ # Its own name in the observations: the refusal is recorded by the shared deny tail, not by the
17
+ # guard itself.
16
18
  RT_GUARD_NAME=prose-style-guard
17
19
 
18
20
  . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
@@ -36,8 +38,8 @@ case "$path" in
36
38
  *) exit 0 ;;
37
39
  esac
38
40
 
39
- # Описание прошлого и папки задач не судятся: архив не правится вовсе, а ход работы пишется
40
- # наспех и живёт до слияния.
41
+ # The archive and the task folders are not judged: the archive is not edited at all, and the
42
+ # progress is written in haste and lives until the merge.
41
43
  case "$path" in
42
44
  */docs/archive/* | */docs/tasks/*) exit 0 ;;
43
45
  esac
@@ -54,18 +56,18 @@ done
54
56
 
55
57
  tmp="$(mktemp -t prose)" || exit 0
56
58
  printf '%s\n' "$added" > "$tmp"
57
- found="$(node "$check" "$tmp" 2>&1 | grep -- '—' | sed 's|.*proba*[^:]*:| строка |' | head -8)"
59
+ found="$(node "$check" "$tmp" 2>&1 | grep -- '—' | sed 's|.*proba*[^:]*:| line |' | head -8)"
58
60
  rm -f "$tmp"
59
61
  [ -z "$found" ] && exit 0
60
62
 
61
- reason="BLOCKED by prose-style-guard: в новом тексте канцелярит или слово, которого в этом дереве не пишут.
63
+ reason="BLOCKED by prose-style-guard: the new text carries officialese or a word not written in this tree.
62
64
 
63
65
  ${found}
64
66
 
65
- Правь текст, а не обходи находку: замена названа у каждой. Слог — правило о текстах, и проверка видит перечисленные признаки, а не стиль вообще: чистый по ней абзац может быть плохим, но грязный плохой точно."
67
+ Edit the text instead of bypassing the finding: a replacement is named at each of them. Wording is a rule about texts, and the check sees the listed signs, not style at large: a paragraph clean by it may still be bad, a dirty one is bad for certain."
66
68
 
67
- # Общий хвост отказа: два законных хода и законная форма обхода, если она у отказа есть.
68
- # Файл может быть не разложен — тогда хвоста нет, а причина отказа остаётся прежней.
69
+ # The shared deny tail: the two lawful moves and the lawful form of bypass, if the refusal has one.
70
+ # The file may not be laid out — then there is no tail, and the refusal reason stays as it is.
69
71
  # shellcheck disable=SC1090
70
72
  [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
71
73
  && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
@@ -76,5 +78,5 @@ deny_tail_text="$(rt_deny_tail "")"
76
78
  ${deny_tail_text}"
77
79
 
78
80
  jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
79
- || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"prose-style-guard: канцелярит в новом тексте."}}\n'
81
+ || printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"prose-style-guard: officialese in the new text."}}\n'
80
82
  exit 0