@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,10 +1,10 @@
1
1
  /**
2
- * Общее для всех предметов сверки спеков: что считается доменом, чем читается дерево и чем
3
- * режется документ на разделы и пункты.
2
+ * What is shared by every subject of the spec audit: what counts as a domain, how the tree is
3
+ * read and how a document is cut into sections and bullets.
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 with
7
+ * such a name the gate would run as a check of its own.
8
8
  */
9
9
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
10
10
  import { join } from 'node:path';
@@ -14,103 +14,136 @@ import { CONFIG, ROOT } from './rt-kit-checks.config.mjs';
14
14
  const SPECS_DIR = CONFIG.specsDir;
15
15
  const CONSTITUTION_DIR = 'docs/constitution';
16
16
  /**
17
- * Каталоги под `docs/specs`, доменами не являющиеся: шаблон содержит образцы с
18
- * плейсхолдерами, и обязательных разделов у них нет.
17
+ * Directories under `docs/specs` that are not domains: the template holds samples with
18
+ * placeholders, and it has no mandatory sections.
19
19
  */
20
20
  const NOT_DOMAINS = ['_template'];
21
21
  /**
22
- * Где ищутся тесты. Берётся из настройки дерева, а не из кода: зашитые здесь корни молча не
23
- * находили ни одного теста у дерева, которое держит код иначе, — и каждый сценарий выглядел
24
- * непокрытым, притом что тест на него был.
22
+ * Where tests are searched for. Taken from the setting of the tree, not from the code: roots
23
+ * hardwired here silently found no test at all in a tree that keeps its code differently — and
24
+ * every scenario looked uncovered while the test for it stood right there.
25
+ *
26
+ * Two lists, not one: the suites of a tree's own checks lie next to the tooling, outside the
27
+ * source roots, and a suite lying there was invisible while the roots were read from one setting.
28
+ * What came of that is indistinguishable from a real hole — the scenario stands as uncovered, the
29
+ * suite is written and green, and the list of the uncovered stops meaning anything.
30
+ *
31
+ * A root lying inside another named root is dropped: otherwise a tree that named both a source
32
+ * root and a suite directory inside it gets every reference twice.
25
33
  */
26
- const TEST_ROOTS = CONFIG.sourceRoots;
27
- /** Где ищется вызов символа из привязки. */
34
+ const TEST_ROOTS = [...new Set([...CONFIG.sourceRoots, ...CONFIG.testRoots])].filter(
35
+ (root, _index, roots) => !roots.some((other) => other !== root && root.startsWith(`${other}/`))
36
+ );
37
+ /** Where the call of a symbol from a binding is searched for. */
28
38
  const SOURCE_ROOTS = [...CONFIG.sourceRoots, ...(CONFIG.schemaFile ? [CONFIG.schemaFile.split('/')[0]] : [])];
29
39
  const SKIPPED_DIRS = CONFIG.skippedDirs;
30
40
 
31
41
  /**
32
- * `### SC-BK-03 — заявка на занятые даты`
42
+ * `### SC-BK-03 — a request for dates already taken`
33
43
  *
34
- * Номер принимается от одной цифры до трёх. Заголовок, не подошедший под шаблон, сценария не
35
- * заводит и отказа не даёт: дерево, пронумеровавшее сценарии с единицы, теряло бы первые
36
- * девять из них молча — ни в покрытии, ни в долгах, при зелёной сверке.
44
+ * The number is accepted from one digit to three. A heading that did not match the template starts
45
+ * no scenario and gives no refusal: a tree that numbered its scenarios from one would lose the
46
+ * first nine of them silently — neither in coverage nor in debts, with a green audit.
37
47
  */
38
48
  const SCENARIO_HEADING = /^###\s+(SC-([A-Z]{2,4})-(\d{1,3}))\s+—\s+(.+?)\s*$/;
39
- /** Отметка осознанно непокрытого сценария; причина обязательна */
40
- const UNCOVERED = /^Не покрыто:\s*\S/;
41
- /** Тест есть, но проверяет не всё обещанное или идёт другим путём */
42
- const PARTIAL = /^Покрытие:\s*частичное\s*—\s*\S/;
43
- /** Упоминание сценария в заголовке теста; номер той же длины, что и в заголовке сценария */
49
+ /**
50
+ * The keys of a spec are read under two names, English and the owner's. A tree translates its
51
+ * specs one domain at a time, and a key that moved instead of learning the second name takes the
52
+ * untranslated domains out of the audit silently: the heading is not found, the statements and the
53
+ * scenarios are not read, and the audit stays green about a domain it no longer sees.
54
+ */
55
+ /** The mark of a knowingly uncovered scenario; the reason is mandatory */
56
+ const UNCOVERED = /^(?:Not covered|Не покрыто):\s*\S/;
57
+ /** The test exists, but checks not everything promised or goes another way */
58
+ const PARTIAL = /^(?:Coverage:\s*partial|Покрытие:\s*частичное)\s*—\s*\S/;
59
+ /** A mention of the scenario in the title of a test; the number is as long as in the heading */
44
60
  const SCENARIO_REFERENCE = /\bSC-[A-Z]{2,4}-\d{1,3}\b/g;
45
- /** Строка обещания сценария; её продолжения идут с отступом */
46
- const PROMISE = /^Тогда\s+\S/;
61
+ /** The promise line of a scenario; its continuations go with an indent */
62
+ const PROMISE = /^(?:Then|Тогда)\s+\S/;
47
63
  /**
48
- * Человек перед экраном и его восприятие. Границы слова не ставятся: `\b` в JavaScript
49
- * считает буквой только латиницу, и `\bгость\b` не совпал бы ни разу.
64
+ * A person in front of the screen and their perception. Word boundaries are not set: `\b` in
65
+ * JavaScript counts only Latin letters as letters, and `\bгость\b` would not match once.
50
66
  */
51
- const ACTOR = /(гост[ьяию]|владел(?:ец|ьца|ьцу|ьцем)|сотрудник\w*|оператор\w*|пользовател\w+)/i;
52
- const PERCEIVES = /(вид(?:ит|ят|но)|чита(?:ет|ют)|смотр(?:ит|ят))/i;
53
- /** Сквозные тесты: только они идут тем же путём, что пользователь */
67
+ const ACTOR = /(гост[ьяию]|владел(?:ец|ьца|ьцу|ьцем)|сотрудник\w*|оператор\w*|пользовател\w+|\bguests?\b|\bowner\b|\bemployees?\b|\boperators?\b|\busers?\b)/i;
68
+ const PERCEIVES = /(вид(?:ит|ят|но)|чита(?:ет|ют)|смотр(?:ит|ят)|\bsees?\b|\breads?\b|\bis shown\b|\bare shown\b)/i;
69
+ /** End-to-end tests: only they go the same way the user does */
54
70
  const E2E_ROOTS = CONFIG.e2eRoots;
55
71
 
56
72
  /**
57
- * Якорь правила: `путь/к/файлу.ts:символ` в обратных кавычках. Расширение до восьми
58
- * букв — иначе `schema.prisma` не считается путём, и правило про умолчание колонки
59
- * выглядит как правило без якоря. Заглавные и десять букв нужны ради `api.Dockerfile`:
60
- * без них правило про режим исполнения образа считалось правилом с пустой привязкой,
61
- * а привязать его больше не к чему — режим объявлен ровно там.
73
+ * The anchor of a rule: `path/to/file.ts:symbol` in backticks. The extension goes up to eight
74
+ * letters — otherwise `schema.prisma` does not count as a path, and the rule about the default of
75
+ * a column looks like a rule without an anchor. Capitals and ten letters are needed for
76
+ * `api.Dockerfile`: without them the rule about the run mode of the image counted as a rule with
77
+ * an empty binding, and there is nothing else left to bind it to — the mode is declared exactly
78
+ * there.
62
79
  *
63
- * Символ — любая буква, а не только латинская: тексты, которые исполняет модель, написаны
64
- * своим языком, и латиницей в них называется ровно то, что утверждения не держит — имя поля
65
- * шапки, имя инструмента. Привязанное к имени поля утверждение остаётся зелёным, когда текст
66
- * переписан целиком. Алфавит не перечисляется диапазонами: перечисленные молча не покрывают
67
- * соседнего, и промах выглядит отсутствием привязки. Путь при этом остаётся латинским — он
68
- * адрес в дереве, а не слово текста.
80
+ * The symbol is any letter, not only a Latin one: the texts a model executes are written in their
81
+ * own language, and Latin in them names exactly what holds no statement — the name of a header
82
+ * field, the name of a tool. A statement bound to the name of a field stays green when the text is
83
+ * rewritten whole. The alphabet is not listed by ranges: the listed ones silently do not cover the
84
+ * neighbouring one, and the miss looks like an absent binding. The path stays Latin all the same —
85
+ * it is an address in the tree, not a word of the text.
69
86
  *
70
- * Решётка перед именем законна: приватное поле класса объявлено с ней, и записанное без неё имя
71
- * называет метод не тем именем, каким он объявлен. Проверка при этом остаётся зелёной — граница
72
- * слова перед решёткой есть, — поэтому промах не краснеет ни разу и виден только чтением.
87
+ * A hash before the name is lawful: a private field of a class is declared with it, and the name
88
+ * written without it calls the method by a name it was not declared with. The check stays green
89
+ * meanwhile — there is a word boundary before the hash — so the miss never turns red and is seen
90
+ * only by reading.
73
91
  */
74
- const ANCHOR = /`([\w./-]+\.[A-Za-z]{2,10}):(#?\p{L}[\p{L}\p{N}_-]*|#?_[\w-]*)`/gu;
92
+ // The symbol of a binding is also a line number or a class name with a dot in front: in markup
93
+ // there is nothing else to bind to — an element has neither a method nor a field. Before, such a
94
+ // binding did not match the template, and the audit said there was no binding at all; a session
95
+ // went on rewriting a table of bindings that was right.
96
+ const ANCHOR = /`([\w./-]+\.[A-Za-z]{2,10}):(#?\p{L}[\p{L}\p{N}_-]*|#?_[\w-]*|\d+|\.[\p{L}\p{N}_-]+)`/gu;
75
97
  /**
76
- * Явный вердикт вместо якоря: статья, которой в дереве исполняться негде. Так бывает
77
- * законно — правило говорит о службе, которой дерево не держит, или о движении человека,
78
- * до которого проверке не дотянуться: кнопку слияния нажимают в браузере, где хуков нет
79
- * вовсе. Якорь такой статье можно поставить только в файл, который её не исполняет, —
80
- * проверка примет, а читателю совратёт.
98
+ * An explicit verdict instead of an anchor: an article that has nowhere to be carried out in the
99
+ * tree. That happens lawfully — the rule speaks of a service the tree does not keep, or of a human
100
+ * movement the check cannot reach: the merge button is pressed in the browser, where there are no
101
+ * hooks at all. An anchor for such an article can only be put into a file that does not carry it
102
+ * out — the check would accept it, and the reader would be lied to.
103
+ *
104
+ * A verdict with a reason is accepted, not a single word: an empty one becomes a way to close any
105
+ * line, and in a month the table turns into a list of excuses. The length threshold is the same
106
+ * measure as the bypass of the document guard: a reason shorter than that does not count as a
107
+ * reason.
81
108
  *
82
- * Принимается вердикт с причиной, а не одно слово: пустой он становится способом закрыть
83
- * любую строку, и таблица за месяц превращается в список отговорок. Порог длины — та же
84
- * мера, что у обхода гарда документов: причина короче его причиной не считается.
109
+ * The end of the word is found by a negative lookahead, not by `\b`: JavaScript knows only Latin
110
+ * as a word boundary, and after a Cyrillic letter there is none at all — the verdict was not
111
+ * recognised once.
85
112
  *
86
- * Конец слова ищется отрицательным просмотром, а не `\b`: границей слова JavaScript знает
87
- * только латиницу, и после кириллической буквы её нет вовсе — вердикт не опознавался ни
88
- * разу.
113
+ * The verdict has two names: an English one in a companion written after the layer was translated,
114
+ * a Russian one in a companion written before it. Either is enough.
89
115
  */
90
- const VERDICT = /^\s*(?:\*\*)?Не (?:исполняется|применимо|проверяется)(?![\p{L}\p{N}_])/u;
116
+ const VERDICT =
117
+ /^\s*(?:\*\*)?(?:Not (?:carried out|applicable|checked)|Не (?:исполняется|применимо|проверяется))(?![\p{L}\p{N}_])/u;
91
118
  const VERDICT_MIN = 40;
92
- /** Строка шапки, объявляющая либы, чьи процедуры домен обслуживает */
93
- const PROCEDURE_ROOTS = /^\*\*Процедуры:\*\*\s*(.+)$/;
119
+ /** The header line declaring the libs whose procedures the domain serves */
120
+ const PROCEDURE_ROOTS = /^\*\*(?:Procedures|Процедуры):\*\*\s*(.+)$/;
94
121
  const BACKTICKED = /`([^`]+)`/g;
95
122
 
123
+ /**
124
+ * The mandatory sections of a spec, each under two names: the English one first, the owner's
125
+ * second. A spec carries one of the two, and a tree translating its specs domain by domain keeps a
126
+ * green audit all the while. The refusal names the first of the pair — the one a new spec is
127
+ * written by.
128
+ */
96
129
  const REQUIRED_HEADINGS = [
97
- '## Зачем',
98
- '## Терминология',
99
- '### Как это называется в интерфейсе',
100
- '## Правила',
101
- '## Что не входит',
102
- '## Контракт',
103
- '### Коды отказов',
104
- '## Данные',
105
- '## Экраны и состояния',
106
- '## Сквозные требования',
107
- '### Локали',
108
- '### SEO',
109
- '### Мобильная раскладка',
110
- '### Мультиобъектность',
111
- '## Решения',
112
- '## Открытые вопросы',
113
- '## История изменений',
130
+ ['## Why', '## Зачем'],
131
+ ['## Terminology', '## Терминология'],
132
+ ['### What it is called in the interface', '### Как это называется в интерфейсе'],
133
+ ['## Rules', '## Правила'],
134
+ ['## What is out of scope', '## Что не входит'],
135
+ ['## Contract', '## Контракт'],
136
+ ['### Refusal codes', '### Коды отказов'],
137
+ ['## Data', '## Данные'],
138
+ ['## Screens and states', '## Экраны и состояния'],
139
+ ['## Cross-cutting requirements', '## Сквозные требования'],
140
+ ['### Locales', '### Локали'],
141
+ ['### SEO'],
142
+ ['### Mobile layout', '### Мобильная раскладка'],
143
+ ['### Several objects', '### Мультиобъектность'],
144
+ ['## Decisions', '## Решения'],
145
+ ['## Open questions', '## Открытые вопросы'],
146
+ ['## History of changes', '## История изменений'],
114
147
  ];
115
148
 
116
149
  const problems = [];
@@ -142,7 +175,7 @@ function walk(dir, accept) {
142
175
  const read = (path) => readFileSync(join(ROOT, path), 'utf8');
143
176
  const exists = (path) => existsSync(join(ROOT, path));
144
177
 
145
- /** Директории доменов: `docs/specs/<домен>`, кроме шаблона. */
178
+ /** The directories of domains: `docs/specs/<domain>`, except the template. */
146
179
  function collectDomains() {
147
180
  try {
148
181
  return readdirSync(join(ROOT, SPECS_DIR), { withFileTypes: true })
@@ -154,14 +187,17 @@ function collectDomains() {
154
187
  }
155
188
 
156
189
  /**
157
- * Строки раздела: от его заголовка до следующего заголовка того же или более
158
- * высокого уровня. Подразделы в раздел входят — «Коды отказов» разбираются
159
- * отдельно, но остаются частью «Контракта».
190
+ * The lines of a section: from its heading to the next heading of the same or a higher level.
191
+ * Subsections belong to the section — the refusal codes are taken apart separately, but stay part
192
+ * of the contract.
160
193
  */
161
194
  function sectionOf(text, heading) {
162
- const level = heading.match(/^#+/)[0].length;
195
+ // The heading arrives as one name or as a list of names: a spec carries the English heading or
196
+ // the owner's one, and the section is the same section under either.
197
+ const names = Array.isArray(heading) ? heading : [heading];
198
+ const level = names[0].match(/^#+/)[0].length;
163
199
  const lines = text.split('\n');
164
- const start = lines.findIndex((line) => line.trimEnd() === heading);
200
+ const start = lines.findIndex((line) => names.includes(line.trimEnd()));
165
201
  if (start < 0) {
166
202
  return [];
167
203
  }
@@ -175,7 +211,15 @@ function sectionOf(text, heading) {
175
211
  return end < 0 ? rest : rest.slice(0, end);
176
212
  }
177
213
 
178
- /** Пункты списка верхнего уровня вместе с их продолжениями. */
214
+ /**
215
+ * The bullets of a top-level list together with their continuations.
216
+ *
217
+ * A heading inside the section does not end the list: the section is already cut by the level of
218
+ * its heading, and a `#` line in it is always deeper — a subheading by which the spec of a large
219
+ * domain groups its rules. A table ends the list as before; the line it ended on is handed over in
220
+ * the `stoppedAt` property, so that the refusal about an empty section names what stands in it
221
+ * instead of bullets.
222
+ */
179
223
  function bulletsOf(lines) {
180
224
  const bullets = [];
181
225
  for (const [index, line] of lines.entries()) {
@@ -183,10 +227,10 @@ function bulletsOf(lines) {
183
227
  bullets.push({ line: index, text: line });
184
228
  } else if (bullets.length && /^\s+\S/.test(line)) {
185
229
  bullets[bullets.length - 1].text += ` ${line.trim()}`;
186
- } else if (!line.trim()) {
230
+ } else if (!line.trim() || /^#/.test(line)) {
187
231
  continue;
188
- } else if (/^[#|]/.test(line)) {
189
- // таблица или заголовок — список кончился
232
+ } else if (/^\|/.test(line)) {
233
+ bullets.stoppedAt = line;
190
234
  break;
191
235
  }
192
236
  }
@@ -1,26 +1,26 @@
1
1
  /**
2
- * Контракт спека против того, что объявлено в коде: таблица процедур — против декораторов,
3
- * коды отказов — против точек броска.
2
+ * The spec contract against what the code declares: the procedure table against the decorators,
3
+ * the refusal codes against the throw points.
4
4
  */
5
5
  import { BACKTICKED, PROCEDURE_ROOTS, bulletsOf, read, report, sectionOf, walk } from './spec-common.mjs';
6
6
 
7
- // ── 2. Контракт против декораторов ────────────────────────────────────────────
7
+ // ── 2. The contract against the decorators ────────────────────────────────────
8
8
 
9
- /** Корни либ, чьи процедуры домен обслуживает; объявлены в шапке спека. */
9
+ /** The lib roots whose procedures the domain serves; declared in the spec header. */
10
10
  function procedureRootsOf(text) {
11
11
  const line = text.split('\n').find((candidate) => PROCEDURE_ROOTS.test(candidate));
12
12
  if (!line) {
13
13
  return null;
14
14
  }
15
15
  const value = line.match(PROCEDURE_ROOTS)[1];
16
- if (/^\s*нет\s*$/i.test(value.replace(/[`.]/g, ''))) {
16
+ if (/^\s*(?:none|нет)\s*$/i.test(value.replace(/[`.]/g, ''))) {
17
17
  return [];
18
18
  }
19
19
 
20
20
  return [...value.matchAll(BACKTICKED)].map(([, path]) => path);
21
21
  }
22
22
 
23
- /** Что объявлено в самих процедурах: метод контракта и право на него. */
23
+ /** What the procedures themselves declare: the contract method and the right to it. */
24
24
  function declaredProcedures(roots) {
25
25
  const found = new Map();
26
26
  for (const root of roots) {
@@ -45,10 +45,10 @@ function declaredProcedures(roots) {
45
45
  return found;
46
46
  }
47
47
 
48
- /** Строки таблицы «Контракта»: первая ячейка — процедура, вторая — право. */
48
+ /** Rows of the "Contract" table: the first cell is the procedure, the second is the right. */
49
49
  function contractRows(text) {
50
50
  const rows = [];
51
- for (const [index, line] of sectionOf(text, '## Контракт').entries()) {
51
+ for (const [index, line] of sectionOf(text, ['## Contract', '## Контракт']).entries()) {
52
52
  if (!line.startsWith('|') || /^\|[\s:|-]+\|$/.test(line)) {
53
53
  continue;
54
54
  }
@@ -64,12 +64,12 @@ function contractRows(text) {
64
64
  continue;
65
65
  }
66
66
  const permission = (cells[1].match(/`([^`]+)`/) || [])[1] || cells[1];
67
- // Строка с кодом отказа во второй ячейке процедурой не считается. Раздел «Контракта»
68
- // держит две разные таблицы: список процедур с правами и список кодов отказа с поводами,
69
- // — и по форме строки они неотличимы, обе несут значение в кавычках первой ячейкой.
70
- // Пока разбор брал любую, спек с объявленными процедурами получал свою таблицу кодов
71
- // прочитанной как список процедур: каждая её строка становилась процедурой, которой в
72
- // домене нет.
67
+ // A row with a refusal code in the second cell does not count as a procedure. The
68
+ // "Contract" section holds two different tables: the list of procedures with rights and
69
+ // the list of refusal codes with reasons — and by the shape of a row they are
70
+ // indistinguishable, both carry a value in backticks in the first cell. While the parse
71
+ // took any of them, a spec with declared procedures got its own table of codes read as a
72
+ // list of procedures: every row of it became a procedure the domain does not have.
73
73
  if (/^\d{3}$/.test(permission.trim())) {
74
74
  continue;
75
75
  }
@@ -81,7 +81,7 @@ function contractRows(text) {
81
81
 
82
82
  function checkContract(file, text, roots) {
83
83
  if (roots === null) {
84
- report(file, 'в шапке нет строки `**Процедуры:**` — нечем сверить таблицу «Контракта» с декораторами');
84
+ report(file, 'the header carries no line `**Процедуры:**` — there is nothing to check the table of «Контракт» against the decorators with');
85
85
 
86
86
  return;
87
87
  }
@@ -92,14 +92,14 @@ function checkContract(file, text, roots) {
92
92
  for (const row of rows) {
93
93
  const found = declared.get(row.short.toLowerCase());
94
94
  if (!found) {
95
- report(file, `в «Контракте» есть \`${row.name}\`, но процедуры с таким методом в ${roots.join(', ')} нет`);
95
+ report(file, `«Контракт» carries \`${row.name}\`, and there is no procedure with such a method in ${roots.join(', ')}`);
96
96
  continue;
97
97
  }
98
98
  described.add(row.short.toLowerCase());
99
99
  if (found.permission && row.permission !== found.permission) {
100
100
  report(
101
101
  file,
102
- `право у \`${row.name}\` разошлось: в спеке «${row.permission}», ` + `в \`${found.file}\` объявлено «${found.permission}»`
102
+ `the permission of \`${row.name}\` diverged: in the spec «${row.permission}», ` + `in \`${found.file}\` it is declared «${found.permission}»`
103
103
  );
104
104
  }
105
105
  }
@@ -108,29 +108,29 @@ function checkContract(file, text, roots) {
108
108
  if (!described.has(key)) {
109
109
  report(
110
110
  file,
111
- `процедура \`${found.service}.${found.method}\` (${found.file}) домену принадлежит, ` + 'но в таблице «Контракта» её нет'
111
+ `the procedure \`${found.service}.${found.method}\` (${found.file}) belongs to the domain, ` + 'and the table of «Контракт» does not carry it'
112
112
  );
113
113
  }
114
114
  }
115
115
  }
116
116
 
117
- // ── 3. Коды отказов ───────────────────────────────────────────────────────────
117
+ // ── 3. Refusal codes ──────────────────────────────────────────────────────────
118
118
 
119
119
  function checkRefusalCodes(file, text, roots) {
120
- const section = sectionOf(text, '### Коды отказов');
120
+ const section = sectionOf(text, ['### Refusal codes', '### Коды отказов']);
121
121
  const bullets = bulletsOf(section);
122
122
  /**
123
- * «Не применимо» — законный ответ и здесь. Домен, у которого есть процедуры,
124
- * но нет ни одного `Code.X`, иначе не описывался вовсе: пустой раздел
125
- * проверка отвергает, а любой выписанный код отвергает тем более — бросать
126
- * его в домене некому. Так живёт проверка живости: отказ она подаёт кодом
127
- * ответа, а не отказом процедуры.
123
+ * "Not applicable" is a lawful answer here too. A domain that has procedures but not a single
124
+ * `Code.X` could not be described otherwise at all: the check rejects an empty section, and it
125
+ * rejects any written-out code all the more — there is no one in the domain to throw it. This
126
+ * is how the liveness check lives: it gives its refusal by an answer code, not by a procedure
127
+ * refusal.
128
128
  */
129
- // Без `\b`: кириллица не входит в `\w`, и границы слова после «применимо» не возникает
130
- const notApplicable = section.some((line) => /^Не применимо/.test(line.trim()));
129
+ // Without `\b`: Cyrillic is not part of `\w`, so no word boundary arises after the word
130
+ const notApplicable = section.some((line) => /^(?:Not applicable|Не применимо)/.test(line.trim()));
131
131
  if (!bullets.length) {
132
132
  if (!notApplicable) {
133
- report(file, 'в разделе `### Коды отказов` нет ни одного кода и нет ответа «Не применимо»');
133
+ report(file, 'the section `### Refusal codes` carries no code at all and no answer «Not applicable»');
134
134
  }
135
135
 
136
136
  return;
@@ -149,11 +149,11 @@ function checkRefusalCodes(file, text, roots) {
149
149
  for (const bullet of bullets) {
150
150
  const code = (bullet.text.match(/`([A-Za-z]\w*)`/) || [])[1];
151
151
  if (!code) {
152
- report(file, `в «Кодах отказов» строка без кода в кавычках: «${bullet.text.slice(0, 60)}…»`);
152
+ report(file, `«Коды отказов» carries a line without a code in quotes: «${bullet.text.slice(0, 60)}…»`);
153
153
  continue;
154
154
  }
155
155
  if (!thrown.has(code)) {
156
- report(file, `код отказа \`${code}\` в домене нигде не бросается — либо он не отсюда, либо путь его не даёт`);
156
+ report(file, `the refusal code \`${code}\` is thrown nowhere in the domain — either it is not from here, or the path does not give it`);
157
157
  }
158
158
  }
159
159
  }
@@ -1,35 +1,35 @@
1
1
  /**
2
- * Договорённости, ждущие переезда в спек домена.
2
+ * Product agreements waiting to move into the domain spec.
3
3
  *
4
- * Договорённость, по которой код уже написан, вливается в спек домена, а её директория
5
- * удаляется. Оставленная в главной ветке, она читается как предложенное и не выкаченное — то
6
- * есть как ложь о работающем месяц приложении.
4
+ * A product agreement the code is already written by merges into the domain spec, and its directory
5
+ * is removed. Left in the main branch, it reads as proposed and not rolled out — that is, as a lie
6
+ * about an application that has been running for a month.
7
7
  *
8
- * Второй вопрос к ней — возраст. Привязка в договорённости стареет молча: объявление, на которое
9
- * она показывает, переезжает вместе с соседней работой, а сверять договорённость с кодом никто
10
- * не станет, пока она не вольётся. Три такие пролежали месяц, и промах нашёлся ровно при
11
- * вливании — то есть в тот час, когда чинить его дороже всего.
8
+ * The second question to it is age. A binding in a product agreement grows stale silently: the
9
+ * declaration it points at moves along with neighbouring work, and nobody will check the agreement
10
+ * against the code until it is merged. Three such lay for a month, and the miss was found exactly
11
+ * at the merge — that is, at the hour when fixing it costs the most.
12
12
  *
13
- * Ни то, ни другое падением не делается: на середине работы часть тестов уже есть, а сама работа
14
- * законно идёт неделями — красная сверка отбивала бы пуш каждой ветки, включая ту, которая
15
- * договорённость и дописывает.
13
+ * Neither of the two is made a failure: in the middle of the work part of the tests already exist,
14
+ * and the work itself lawfully runs for weeks — a red audit would refuse the push of every branch,
15
+ * including the one that is finishing the agreement.
16
16
  */
17
17
  import { execFileSync } from 'node:child_process';
18
18
 
19
19
  import { ROOT } from './rt-kit-checks.config.mjs';
20
20
  import { SPECS_DIR } from './spec-common.mjs';
21
21
 
22
- /** За сколько суток без правок договорённость считается залежавшейся. */
22
+ /** After how many days without edits a product agreement counts as stale. */
23
23
  const STALE_PROPOSED_DAYS = 30;
24
24
 
25
- /** Сутки в миллисекундах — считать возраст удобнее в них. */
25
+ /** A day in milliseconds — age is easier to count in them. */
26
26
  const DAY_MS = 24 * 60 * 60 * 1000;
27
27
 
28
28
  /**
29
- * Каталоги договорённостей со счётом их сценариев.
29
+ * The directories of product agreements with the count of their scenarios.
30
30
  *
31
- * Готовой считается та, у которой все сценарии закрыты тестами: пока хоть один помечен «Не
32
- * покрыто», фича не дописана.
31
+ * Ready is the one whose scenarios are all closed by tests: while at least one is marked "not
32
+ * covered", the feature is not finished.
33
33
  */
34
34
  export function proposedGroups(scenarios, references) {
35
35
  const proposed = new Map();
@@ -56,15 +56,15 @@ export function proposedGroups(scenarios, references) {
56
56
  }
57
57
 
58
58
  /**
59
- * Дата последнего коммита у каждого каталога договорённости.
59
+ * The date of the last commit for every product agreement directory.
60
60
  *
61
- * Один проход по истории вместо вызова на каталог: лог идёт новыми вперёд, поэтому первая
62
- * встреченная дата каталога и есть последняя. Каталог, которого в истории ещё нет, приехал этой
63
- * же веткой и старым быть не может.
61
+ * One pass over the history instead of a call per directory: the history goes newest first, so the
62
+ * first date met for a directory is its last one. A directory not yet in the history arrived by
63
+ * this very branch and cannot be old.
64
64
  *
65
- * Возраст меряется историей, а не временем файла на диске: свежий чекаут делает все каталоги
66
- * одновременными, а дня в тексте договорённости нет вовсе. Тот же довод стоит у возраста записей
67
- * описания прошлого.
65
+ * Age is measured by the history, not by the file time on disk: a fresh checkout makes all the
66
+ * directories simultaneous, and there is no day in the text of the agreement at all. The same
67
+ * reason stands behind the age of archive records.
68
68
  */
69
69
  function lastCommits(dirs) {
70
70
  if (dirs.length === 0) {
@@ -106,7 +106,10 @@ function lastCommits(dirs) {
106
106
  return dates;
107
107
  }
108
108
 
109
- /** Договорённости, лежащие без правок дольше срока: путь и возраст в сутках, старые впереди. */
109
+ /**
110
+ * Product agreements lying without edits longer than the term: the path and the age in days,
111
+ * the oldest first.
112
+ */
110
113
  export function staleProposed(dirs, now = Date.now()) {
111
114
  const dates = lastCommits(dirs);
112
115