@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,27 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Сверка карты хода: её размер и её полнота.
3
+ * The check of the turn map: its size and its completeness.
4
4
  *
5
- * Карту кладёт в контекст хук входа в заход — целиком, до первой реплики. Тем она и
6
- * отличается от правила: правило исполнитель читает сам и платит за это ходом, карта
7
- * приходит даром. Даром — пока она короткая: карта, выросшая до правила, съедает то
8
- * самое окно, ради которого её и заводили, и заметить это нечем — она продолжает
9
- * приходить и продолжает быть верной.
5
+ * The map is put into the context by the hook of entry into the session — whole, before the first
6
+ * reply. That is what tells it from a rule: a rule the executor reads himself and pays a turn for
7
+ * it, the map comes for free. For free — while it is short: a map grown to the size of a rule eats
8
+ * the very window it was started for, and there is nothing to notice that with — it keeps coming
9
+ * and keeps being right.
10
10
  *
11
- * Второе, чего не видно без сверки: состояние, заведённое в правиле и забытое в карте.
12
- * Заход тогда получает карту, не находит в ней своего состояния и идёт читать правило —
13
- * то есть карта работает ровно до первого нового состояния.
11
+ * The second thing that is not seen without the check: a state started in the rule and forgotten in
12
+ * the map. The session then gets the map, does not find its state in it and goes to read the rule —
13
+ * that is, the map works exactly up to the first new state.
14
14
  *
15
- * Сверяются три вещи:
16
- * размер — байты разложенной карты против объявленного предела;
17
- * состояния — имена из таблицы правила против имён в карте, в обе стороны;
18
- * выходы — все четыре выхода хода названы.
15
+ * Three things are checked:
16
+ * the size — the bytes of the laid-out map against the declared limit;
17
+ * the states — the names from the table of the rule against the names in the map, both ways;
18
+ * the exits — all four exits of a turn are named.
19
19
  *
20
- * FAIL-OPEN: карты в дереве нет — сверять нечего, нулевой код. Дерево может её не
21
- * раскладывать. Пустая таблица состояний в карте отказом считается: это не «нечего
22
- * сверять», а «карта сломана».
20
+ * FAIL-OPEN: there is no map in the tree — nothing to check, a zero code. The tree may leave it
21
+ * unlaid. An empty table of states in the map counts as a refusal: that is not «there is nothing
22
+ * to check» but «the map is broken».
23
23
  *
24
- * Ненулевой код возврата и перечень расхождений.
24
+ * A non-zero exit code and the list of discrepancies.
25
25
  */
26
26
  import { existsSync, readFileSync, statSync } from 'node:fs';
27
27
  import { join } from 'node:path';
@@ -31,26 +31,26 @@ const MAP = join(ROOT, '.claude/rt-kit/defaults/turn-map.md');
31
31
  const RULE = join(ROOT, '.claude/skills/task-flow/SKILL.md');
32
32
 
33
33
  /**
34
- * Предел размера карты в байтах.
34
+ * The size limit of the map in bytes.
35
35
  *
36
- * Число одно и живёт здесь: карта приходит в каждый заход целиком, и предел ей — свойство
37
- * приёма, а не дерева. Шесть килобайт взяты замером, а не на глаз: карта в день заведения
38
- * весит 4495 байт, правило, из которого она выжата, — 63803. Запас в полтора килобайта —
39
- * это два-три новых состояния; выйдя за него, карта перестаёт быть выжимкой, и делить её
40
- * тогда надо, а не поднимать предел.
36
+ * The number is one and lives here: the map comes into every session whole, and the limit for it is
37
+ * a property of the technique, not of the tree. Six kilobytes are taken by measurement, not by eye:
38
+ * on the day it was started the map weighs 4495 bytes, and the rule it is squeezed out of 63803.
39
+ * The spare of a kilobyte and a half is two or three new states; going past it, the map stops being
40
+ * a squeeze, and then it is to be split, not the limit raised.
41
41
  */
42
42
  const LIMIT_BYTES = 6144;
43
43
 
44
44
  /**
45
- * Имена состояний: строка таблицы, у которой первая ячейка стоит в обратных кавычках, — а для
46
- * карты хода ещё и строка списка «- `имя` — действие; ведёт `паттерн`». В правиле список так не
47
- * читается: тем же видом там записаны паттерны, и они попали бы в состояния.
48
- * у которой первая ячейка стоит в обратных кавычках.
45
+ * The names of the states: a row of a table whose first cell stands in backticks — and for the turn
46
+ * map a list line «- `имя` — действие; ведёт `паттерн`» as well. In the rule a list is not read this
47
+ * way: patterns are written there in the same form, and they would get into the states.
48
+ * whose first cell stands in backticks.
49
49
  *
50
- * Обе формы читаются намеренно. Список дешевле таблицы на треть — форматтер добивает столбцы
51
- * пробелами до общей ширины, и эти пробелы едут в контекст каждого захода, ничего не значая;
52
- * таблица при этом остаётся законной, и дерево, которое её не переписывало, работает как
53
- * прежде.
50
+ * Both forms are read on purpose. A list is a third cheaper than a table — the formatter pads the
51
+ * columns with spaces up to a common width, and those spaces travel into the context of every
52
+ * session meaning nothing; the table meanwhile stays lawful, and a tree that has not rewritten it
53
+ * works as before.
54
54
  */
55
55
  function statesOf(text, { listed: readListed = false } = {}) {
56
56
  const states = [];
@@ -86,12 +86,20 @@ function statesOf(text, { listed: readListed = false } = {}) {
86
86
  return states;
87
87
  }
88
88
 
89
- /** Выходы хода, названные законом. Ищутся по началу строки таблицы, а не по всему тексту. */
90
- const EXITS = ['вопрос владельцу', 'отказ гарда', 'заполненное окно', 'работа отдана'];
89
+ /**
90
+ * The exits of a turn named by the law. Each has two names: the English one is brought by the
91
+ * package, the Russian one is held by a tree whose map is still its own. Either of the two is enough.
92
+ */
93
+ const EXITS = [
94
+ ['a question to the owner', 'вопрос владельцу'],
95
+ ['a guard refusal', 'отказ гарда'],
96
+ ['the window filled', 'заполненное окно'],
97
+ ['work handed over', 'работа отдана'],
98
+ ];
91
99
 
92
100
  function main() {
93
101
  if (!existsSync(MAP)) {
94
- console.log('check-turn-map: карты хода в дереве нет — сверять нечего');
102
+ console.log('check-turn-map: the tree has no turn map — there is nothing to check');
95
103
 
96
104
  return 0;
97
105
  }
@@ -101,18 +109,18 @@ function main() {
101
109
  const faults = [];
102
110
 
103
111
  if (bytes > LIMIT_BYTES) {
104
- faults.push(`карта выросла: ${bytes} байт при пределе ${LIMIT_BYTES}`);
112
+ faults.push(`the map has grown: ${bytes} bytes at a limit of ${LIMIT_BYTES}`);
105
113
  }
106
114
 
107
115
  const inMap = statesOf(text, { listed: true });
108
116
 
109
117
  if (inMap.length === 0) {
110
- faults.push('в карте нет ни одного состояния — таблица сломана');
118
+ faults.push('the map carries no state at all — the table is broken');
111
119
  }
112
120
 
113
121
  for (const state of inMap) {
114
122
  if (!state.rest[0]) {
115
- faults.push(`${state.name}: в карте нет обязательного действия`);
123
+ faults.push(`${state.name}: the map carries no mandatory action`);
116
124
  }
117
125
  }
118
126
 
@@ -123,38 +131,38 @@ function main() {
123
131
 
124
132
  for (const state of ruleNames) {
125
133
  if (!mapNames.has(state)) {
126
- faults.push(`${state}: состояние объявлено правилом и забыто в карте`);
134
+ faults.push(`${state}: the state is declared by the rule and forgotten in the map`);
127
135
  }
128
136
  }
129
137
 
130
138
  for (const state of mapNames) {
131
139
  if (!ruleNames.has(state)) {
132
- faults.push(`${state}: состояние стоит в карте, а правило его не объявляет`);
140
+ faults.push(`${state}: the state stands in the map, and the rule does not declare it`);
133
141
  }
134
142
  }
135
143
  }
136
144
 
137
- for (const exit of EXITS) {
138
- if (!text.includes(exit)) {
139
- faults.push(`выход хода «${exit}» в карте не назван`);
145
+ for (const names of EXITS) {
146
+ if (!names.some((name) => text.includes(name))) {
147
+ faults.push(`the turn exit «${names[0]}» is not named in the map`);
140
148
  }
141
149
  }
142
150
 
143
151
  if (faults.length > 0) {
144
- console.log(`check-turn-map: расхождений ${faults.length}, размер ${bytes} байт при пределе ${LIMIT_BYTES}\n`);
152
+ console.log(`check-turn-map: divergences ${faults.length}, size ${bytes} bytes at a limit of ${LIMIT_BYTES}\n`);
145
153
 
146
154
  for (const fault of faults) {
147
155
  console.log(` ${fault}`);
148
156
  }
149
157
 
150
- console.log('\nКарта короче правила — этим она и полезна. Выросшая, она съедает то окно, ради');
151
- console.log('которого её кладут в контекст. Правится она в ресурсе пакета, а не в разложенной копии.');
158
+ console.log('\nThe map is shorter than the rule — that is what makes it useful. Grown, it eats the very');
159
+ console.log('window it is put into the context for. It is edited in the package resource, not in the laid-out copy.');
152
160
 
153
161
  return 1;
154
162
  }
155
163
 
156
164
  console.log(
157
- `check-turn-map: ${inMap.length} состояний, ${EXITS.length} выхода хода, ` + `${bytes} байт при пределе ${LIMIT_BYTES} — сошлось`
165
+ `check-turn-map: ${inMap.length} states, ${EXITS.length} turn exits, ` + `${bytes} bytes at a limit of ${LIMIT_BYTES} — it matches`
158
166
  );
159
167
 
160
168
  return 0;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Границы и теги: где либа описана как источник, чей список зависимостей обязан оставаться
3
- * пустым и что видно основанию семейства. Все три предмета читают одни и те же файлы
4
- * `eslint/boundaries/domains/`, и врозь их не разложить.
2
+ * Boundaries and tags: where a lib is described as a source, whose dependency list must stay empty
3
+ * and what the family base sees. All three subjects read the same files
4
+ * `eslint/boundaries/domains/`, and they cannot be laid out apart.
5
5
  *
6
- * Имя не начинается с `check-`: перебором таких имён умолчание пакета собирает набор гейта
7
- * пуша, и помощник с ним гейт стал бы гонять как отдельную проверку.
6
+ * The name does not begin with `check-`: by walking such names the package default assembles the
7
+ * push gate set, and a helper with one would be run by the gate as a check of its own.
8
8
  */
9
9
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
10
10
  import { join } from 'node:path';
@@ -13,14 +13,14 @@ import { BOUNDARIES_DIR, FAMILIES, isDir, projectTag, report } from './lib-commo
13
13
  import { CONFIG, ROOT } from './rt-kit-checks.config.mjs';
14
14
 
15
15
  /**
16
- * Либа должна быть описана ровно одним `sourceTag` и ровно в одном файле границ:
17
- * описанная дважды либа означает два разных allowlist'а на неё, и какой победит —
18
- * вопрос порядка сборки. В чужих allowlist'ах тег, наоборот, встречается сколько
19
- * угодно раз: это перечисление тех, кому либа видна.
16
+ * A lib must be described by exactly one `sourceTag` and in exactly one boundaries file:
17
+ * a lib described twice means two different allowlists for it, and which one wins is a
18
+ * matter of the build order. In other allowlists the tag, on the contrary, occurs as many
19
+ * times as needed: that is the enumeration of those the lib is visible to.
20
20
  */
21
21
  function checkBoundaries(libs) {
22
22
  if (!isDir(BOUNDARIES_DIR)) {
23
- report(BOUNDARIES_DIR, 'каталога с файлами границ нет');
23
+ report(BOUNDARIES_DIR, 'there is no directory with boundary files');
24
24
 
25
25
  return;
26
26
  }
@@ -38,20 +38,21 @@ function checkBoundaries(libs) {
38
38
  });
39
39
 
40
40
  if (owners.length === 0) {
41
- report(libPath, `тег ${tag} не описан ни в одном файле ${BOUNDARIES_DIR}/`);
41
+ report(libPath, `the tag ${tag} is described in no file of ${BOUNDARIES_DIR}/`);
42
42
  } else if (owners.length > 1) {
43
- report(libPath, `тег ${tag} описан ${owners.length} раза: ${owners.join(', ')}`);
43
+ report(libPath, `the tag ${tag} is described ${owners.length} times: ${owners.join(', ')}`);
44
44
  }
45
45
  }
46
46
  }
47
47
 
48
48
  /**
49
- * Либы, у которых список зависимостей обязан оставаться пустым. Барель такой либы
50
- * уезжает в бандл бэкенда, а сборка API идёт без tree-shaking: любая зависимость
51
- * расходится оттуда по всему графу.
49
+ * Libs whose dependency list must stay empty. The barrel of such a lib travels
50
+ * into the backend bundle, and the API build runs without tree-shaking: any dependency
51
+ * spreads from there across the whole graph.
52
52
  *
53
- * Теги называет дерево: имя тега — его собственное слово, и зашитое здесь требовало бы описания
54
- * границ под либу, которой в дереве нет вовсе. Пусто — таких либ дерево не держит.
53
+ * The tags are named by the tree: a tag name is its own word, and one hard-coded here would demand
54
+ * a boundaries description for a lib the tree does not have at all. Empty — the tree keeps no such
55
+ * libs.
55
56
  */
56
57
  const NO_DEPENDENCY_TAGS = CONFIG.noDependencyTags;
57
58
 
@@ -79,42 +80,43 @@ function checkNoDependencyLibs() {
79
80
  const opensAt = rest.indexOf('[', listAt);
80
81
  const closesAt = rest.indexOf(']', opensAt);
81
82
  if (listAt === -1 || opensAt === -1 || closesAt === -1) {
82
- report(`${BOUNDARIES_DIR}/${name}`, `у ${tag} не найден список зависимостей`);
83
+ report(`${BOUNDARIES_DIR}/${name}`, `${tag} has no list of dependencies`);
83
84
  continue;
84
85
  }
85
86
 
86
87
  const dependencies = rest.slice(opensAt + 1, closesAt).trim();
87
88
  if (dependencies.length > 0) {
88
- report(`${BOUNDARIES_DIR}/${name}`, `${tag} ни от кого не зависит, а его список непуст: ${dependencies}`);
89
+ report(`${BOUNDARIES_DIR}/${name}`, `${tag} depends on nobody, and its list is not empty: ${dependencies}`);
89
90
  }
90
91
  }
91
92
 
92
93
  if (!described) {
93
- report(BOUNDARIES_DIR, `тег ${tag} не описан ни в одном файле границ`);
94
+ report(BOUNDARIES_DIR, `the tag ${tag} is described in no boundary file`);
94
95
  }
95
96
  }
96
97
  }
97
98
 
98
99
  /**
99
- * Основание семейства видит `common/util` и слои `util` общих доменов своей
100
- * семьи. Всё сверх этого названо строкой здесь: основание зовут все домены, и
101
- * любая его зависимость становится общей для всей семьи.
100
+ * The family base sees `common/util` and the `util` layers of the shared domains of its
101
+ * own family. Everything beyond that is named by a line here: the base is called by every
102
+ * domain, and any dependency of it becomes shared by the whole family.
102
103
  */
103
104
  const CORE_EXCEPTIONS = {
104
- // Транспорт Connect в admin-transport.provider.ts: дескриптор логина и токен транспорта
105
+ // The Connect transport in admin-transport.provider.ts: the sign-in descriptor and the
106
+ // transport token
105
107
  'scope:admin-core': ['scope:common-proto', 'scope:common-connect'],
106
108
  };
107
109
 
108
- /** `scope:<семья>-common-<домен>-util` — слой `util` общего домена той же семьи */
110
+ /** `scope:<family>-common-<domain>-util` — the `util` layer of a shared domain of the same family */
109
111
  const isFamilyCommonUtil = (tag, family) => new RegExp(`^scope:${family}-common-[a-z0-9-]+-util$`).test(tag);
110
112
 
111
113
  async function checkCoreLibs() {
112
- // Свод границ есть не у всякого дерева с доменной сеткой: он собирается отдельным файлом, и
113
- // пока его отсутствие не обрабатывалось, проверка падала на импорте — то есть отвечала
114
- // поломкой на дерево, где границы объявлены иначе.
114
+ // Not every tree with a domain grid has a boundaries index: it is assembled by a separate file,
115
+ // and while its absence was not handled the check fell on the import — that is, it answered a
116
+ // tree where boundaries are declared differently with a breakage.
115
117
  const boundaries = join(ROOT, 'eslint/boundaries/index.mjs');
116
118
  if (!existsSync(boundaries)) {
117
- console.log('пропущено: свода границ eslint/boundaries/index.mjs в дереве нет');
119
+ console.log('skipped: the tree has no boundary digest eslint/boundaries/index.mjs');
118
120
 
119
121
  return;
120
122
  }
@@ -134,7 +136,7 @@ async function checkCoreLibs() {
134
136
  }
135
137
  report(
136
138
  `${BOUNDARIES_DIR}/${family}-core.config.mjs`,
137
- `${tag} видит ${dependency}: основанию семейства доступны только scope:common-util и scope:${family}-common-*-util`
139
+ `${tag} sees ${dependency}: the base of a family may reach only scope:common-util and scope:${family}-common-*-util`
138
140
  );
139
141
  }
140
142
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Общее для всех предметов сверки раскладки либ: состав слоёв каждой формы домена, чтение
3
- * дерева, список принятых долгов и то, как из пути либы получаются её имя, тег и алиас.
2
+ * Common to every subject of the lib layout audit: the layer set of each domain form, reading the
3
+ * tree, the list of accepted debts and how a lib path yields its name, tag and alias.
4
4
  *
5
- * Модуль назван не `check-*`, и это не украшение: умолчание пакета собирает набор гейта пуша
6
- * перебором имён `check-<что>.mjs` в каталоге проверок, и помощник с таким именем гейт стал бы
7
- * гонять как отдельную проверку.
5
+ * The module is not named `check-*`, and that is not decoration: the package default assembles the
6
+ * push gate set by walking the names `check-<what>.mjs` in the checks directory, and a helper under
7
+ * such a name would be run by the gate as a check of its own.
8
8
  */
9
9
  import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
10
10
  import { join } from 'node:path';
@@ -13,29 +13,30 @@ import { CONFIG, ROOT, parseAllowlist } from './rt-kit-checks.config.mjs';
13
13
 
14
14
  const FAMILIES = CONFIG.families;
15
15
  /**
16
- * Корень либ и семья бэкенда берутся из настройки дерева, а не из кода: у дерева, которое
17
- * держит либы под другим именем, обход шёл мимо кода и проверка зеленела на пустом каталоге —
18
- * то есть отвечала «нарушений нет» там, где она не смотрела вовсе.
16
+ * The lib root and the backend family come from the tree settings, not from the code: in a tree
17
+ * that keeps its libs under another name the walk went past the code and the check went green on an
18
+ * empty directory — that is, it answered "no violations" where it had not looked at all.
19
19
  */
20
20
  const LIBS_ROOT = CONFIG.libsRoot;
21
21
  const API_FAMILY = CONFIG.apiFamily;
22
22
  /**
23
- * Приставка селекторов, обязательная либам фронта. Слово принадлежит дереву целиком; пусто —
24
- * приставка здесь ничего не значит, и проверка о ней молчит.
23
+ * The selector prefix mandatory for frontend libs. The word belongs to the tree entirely; empty
24
+ * means the prefix means nothing here, and the check says nothing about it.
25
25
  */
26
26
  const LIB_PREFIX = CONFIG.libPrefix;
27
27
  /**
28
- * Имена, под которыми в этом дереве лежит барель. Их несколько: публикуемый пакет зовёт свой
29
- * `public-api.ts`, а либа доменной сетки — `index.ts`, и оба живут в одном дереве. Имя, не
30
- * названное здесь, барелем не считается, и собственный файл в нём читается реэкспортом.
28
+ * The names under which a barrel lies in this tree. There are several: a published package calls
29
+ * its own `public-api.ts`, while a lib of the domain grid calls it `index.ts`, and both live in one
30
+ * tree. A name not listed here does not count as a barrel, and its own file inside it is read as a
31
+ * re-export.
31
32
  */
32
33
  const BARREL_FILES = CONFIG.barrelFiles;
33
34
  const FLAT_LAYERS = ['api', 'data-access', 'ui', 'util'];
34
35
  const FEATURE_DOMAIN_LAYERS = [...FLAT_LAYERS, 'feature', 'shell'].sort();
35
36
  const COMMON_DOMAIN_LAYERS = [...FLAT_LAYERS, 'feature'].sort();
36
- /** У бэкенда нет `ui` и `shell`: отдавать разметку и роутиться ему нечем */
37
+ /** The backend has no `ui` and no `shell`: it renders no markup and does no routing */
37
38
  const API_DOMAIN_LAYERS = ['api', 'data-access', 'feature', 'util'];
38
- /** Где ищутся либы, оказавшиеся вне доменной сетки */
39
+ /** Where libs that ended up outside the domain grid are looked for */
39
40
  const LIB_ROOTS = [...FAMILIES, API_FAMILY].map((family) => `${LIBS_ROOT}/${family}`);
40
41
  const REQUIRED_FILES = ['project.json', 'tsconfig.json', 'vitest.config.mts', 'src/index.ts'];
41
42
  const BOUNDARIES_DIR = 'eslint/boundaries/domains';
@@ -56,13 +57,13 @@ const dirsIn = (path) =>
56
57
  const isLib = (path) => existsSync(join(ROOT, path, 'project.json'));
57
58
 
58
59
  /**
59
- * Список принятых долгов. Читается помощником настроек, а не напрямую: файла в свежем дереве
60
- * нет вовсе, и прямое чтение роняло проверку отказом «нет такого файла» — то есть первая же
61
- * установка получала поломку вместо отчёта о том, что долгов нет.
60
+ * The list of accepted debts. Read through the settings helper, not directly: in a fresh tree the
61
+ * file does not exist at all, and a direct read dropped the check with a "no such file" refusal —
62
+ * that is, the very first install got a breakage instead of a report that there are no debts.
62
63
  */
63
- // `flatLibRoots` стоит в перечне наравне с остальными: сбор плоских либ читает эту сторону, а
64
- // разбор её не собирал — значение выходило пустым и подставлялось пустым списком молча. Дерево с
65
- // непустым набором плоских корней получало ноль плоских либ и зелёную проверку.
64
+ // `flatLibRoots` stands in the list alongside the rest: the collection of flat libs reads this side,
65
+ // and the parse did not gather it — the value came out empty and was silently substituted with an
66
+ // empty list. A tree with a non-empty set of flat roots got zero flat libs and a green check.
66
67
  const allowlist = parseAllowlist('lib-layers', [
67
68
  'notDomains',
68
69
  'legacyDomains',
@@ -74,7 +75,7 @@ const allowlist = parseAllowlist('lib-layers', [
74
75
  ]);
75
76
  const pathsOf = (key) => [...allowlist[key].keys()];
76
77
 
77
- /** Паттерн `<корень>/x/*` покрывает и сам каталог `<корень>/x`: исключение снимается целиком */
78
+ /** The pattern `<root>/x/*` covers the `<root>/x` directory itself: the exception is lifted whole */
78
79
  const matches = (patterns, path) =>
79
80
  patterns.some((pattern) => {
80
81
  if (!pattern.endsWith('/*')) {
@@ -85,19 +86,19 @@ const matches = (patterns, path) =>
85
86
  return path === prefix || path.startsWith(`${prefix}/`);
86
87
  });
87
88
 
88
- /** Каталог, который доменом не является вовсе: основание семейства, общие либы, бэкенд */
89
+ /** A directory that is not a domain at all: the family base, the shared libs, the backend */
89
90
  const isNotDomain = (path) => matches(pathsOf('notDomains'), path);
90
91
 
91
- /** Домен старой раскладки: не проверяется ни как домен, ни как набор либ — уезжает целиком */
92
+ /** A domain of the old layout: checked neither as a domain nor as a set of libs — it leaves whole */
92
93
  const isLegacyDomain = (path) => matches(pathsOf('legacyDomains'), path);
93
94
 
94
- /** Либа старой раскладки внутри живого домена: домен проверяется, сама либа — нет */
95
+ /** A lib of the old layout inside a live domain: the domain is checked, the lib itself is not */
95
96
  const isLegacyLib = (path) => matches(pathsOf('legacyLibs'), path);
96
97
 
97
- /** Домен, которому один заполненный слой разрешён: причина названа в списке исключений */
98
+ /** A domain allowed one filled layer: the reason is named in the exceptions list */
98
99
  const isSingleLayerDomain = (path) => matches(pathsOf('singleLayerDomains'), path);
99
100
 
100
- /** Пути, которые обход либ обязан пропустить */
101
+ /** Paths the lib walk must skip */
101
102
  const isIgnoredLib = (path) => isNotDomain(path) || isLegacyDomain(path) || isLegacyLib(path);
102
103
 
103
104
  const projectName = (libPath) => libPath.replace(/^libs\//, '').replaceAll('/', '-');
@@ -105,8 +106,8 @@ const projectTag = (libPath) => `scope:${projectName(libPath)}`;
105
106
  const importAlias = (libPath) => `${CONFIG.importScope}/${libPath.slice(`${LIBS_ROOT}/`.length)}`;
106
107
 
107
108
  /**
108
- * Файлы либы, кроме бареля: барель есть у пустого слоя так же, как у заполненного, и
109
- * пустой слой от заполненного по нему не отличить.
109
+ * The files of a lib, except the barrel: an empty layer has a barrel just as a filled one does, and
110
+ * an empty layer cannot be told from a filled one by it.
110
111
  */
111
112
  function sourceCount(libPath) {
112
113
  const inside = (dir) => {