@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
@@ -2,23 +2,23 @@
2
2
  name: entity-models-new
3
3
  kind: pattern
4
4
  rule: entity-models
5
- description: Паттерн правила entity-models. Брать при объявлении новой модели сущности и её маппера — готовый неймспейс I<Сущность> с Api, State и Draft, короткий и полный уровни, наследник BaseMapper с typeCast, что делать после правки .proto.
5
+ description: Pattern of rule entity-models. Load when declaring a new entity model and its mapper — the ready-made I<Entity> namespace with Api, State and Draft, short and full levels, a BaseMapper heir with typeCast, what to do after editing .proto.
6
6
  ---
7
7
 
8
- # Объявить модель сущности и её перевод
8
+ # Declaring an entity model and its translation
9
9
 
10
- Паттерн правила `entity-models`. Что при этом должно быть верно — закон
10
+ Pattern of the rule `entity-models`. What must be true — the law
11
11
  `docs/constitution/entity-models.md`.
12
12
 
13
- ## Когда брать
13
+ ## When to use
14
14
 
15
- - Заводится новая сущность админки.
16
- - У существующей появляется короткий уровень.
17
- - Правится маппер или контракт этой сущности.
15
+ - A new admin entity is created.
16
+ - An existing one gets a short level.
17
+ - The mapper or the contract of this entity is edited.
18
18
 
19
- ## Модель — неймспейс в `util` домена
19
+ ## The model — a namespace in the domain's `util`
20
20
 
21
- Файл `libs/<семья>/<домен>/util/src/lib/models/<сущность>.model.ts`:
21
+ The file `libs/<family>/<domain>/util/src/lib/models/<entity>.model.ts`:
22
22
 
23
23
  ```typescript
24
24
  export namespace IPromoCode {
@@ -35,13 +35,13 @@ export namespace IPromoCode {
35
35
 
36
36
  export interface State extends Short.State {
37
37
  readonly usageCount: number;
38
- /** Пусто = код действует на любой объект владельца */
38
+ /** Empty = the code applies to any property of the owner */
39
39
  readonly propertyId: string;
40
- /** 0 = без предела */
40
+ /** 0 = no limit */
41
41
  readonly usageLimit: number;
42
42
  }
43
43
 
44
- /** Что уходит на сервер при сохранении: id пуст — код новый */
44
+ /** What goes to the server on save: an empty id — the code is new */
45
45
  export interface Draft {
46
46
  readonly id: string;
47
47
  readonly code: string;
@@ -54,19 +54,19 @@ export enum EPromoDiscountKind {
54
54
  }
55
55
  ```
56
56
 
57
- Перечисления домена лежат в том же файле, но **вне** неймспейса. Глубже двух уровней
58
- вложенности не заводить: `IPromoCode.Short.State` читается, третий уровень уже нет.
57
+ The domain's enums lie in the same file, but **outside** the namespace. No deeper than two levels
58
+ of nesting: `IPromoCode.Short.State` reads, a third level no longer does.
59
59
 
60
- Псевдонимы выборки объявляются там же:
60
+ The query aliases are declared in the same place:
61
61
 
62
62
  ```typescript
63
63
  export type Query = IList.Query.State<EPromoCodeSortProperty, EPromoCodeFilterProperty>;
64
64
  export type ListResult = IList.Result.State<IPromoCode.State, EPromoCodeSortProperty, EPromoCodeFilterProperty>;
65
65
  ```
66
66
 
67
- ## Маппер — в `api` домена, свой на каждый уровень
67
+ ## The mapper — in the domain's `api`, one per level
68
68
 
69
- Файл `libs/<семья>/<домен>/api/src/lib/mappers/<сущность>-model.mapper.ts`:
69
+ The file `libs/<family>/<domain>/api/src/lib/mappers/<entity>-model.mapper.ts`:
70
70
 
71
71
  ```typescript
72
72
  export class PromoCodeModelMapper extends BaseMapper<IPromoCode.State> {
@@ -81,44 +81,44 @@ export class PromoCodeModelMapper extends BaseMapper<IPromoCode.State> {
81
81
  }
82
82
  ```
83
83
 
84
- Маппер без состояния и без DI:
84
+ The mapper has no state and no DI:
85
85
 
86
86
  ```typescript
87
87
  readonly #mapper: PromoCodeModelMapper = new PromoCodeModelMapper();
88
88
  ```
89
89
 
90
- На каждый уровень — свой класс: `PromoCodeShortModelMapper` и `PromoCodeModelMapper`.
90
+ One class per level: `PromoCodeShortModelMapper` and `PromoCodeModelMapper`.
91
91
 
92
- ## Строковое поле с конечным набором сверяется явно
92
+ ## A string field with a finite set is checked explicitly
93
93
 
94
- `getAsType` умолчания не принимает: значение вне набора он пишет в консоль и возвращает
95
- строкой `'unknown'`.
94
+ `getAsType` accepts no default: a value outside the set it writes to the console and returns as
95
+ the string `'unknown'`.
96
96
 
97
97
  ```typescript
98
98
  kind: promoDiscountKindOf(raw?.kind) ?? EPromoDiscountKind.Percent,
99
99
  ```
100
100
 
101
- ## После правки контракта
101
+ ## After editing the contract
102
102
 
103
103
  ```bash
104
104
  cd libs/common/proto && npx buf lint
105
105
  npm run proto:generate
106
106
  ```
107
107
 
108
- Ни `buf lint`, ни `buf breaking` не входят в `check:all` и в CI — гоняются руками.
109
- Сгенерированные типы лежат в репозитории, и без перегенерации расхождение вылезет сборкой
110
- чужого приложения.
108
+ Neither `buf lint` nor `buf breaking` is part of `check:all` or CI — they are run by hand. The
109
+ generated types lie in the repository, and without regeneration the divergence surfaces in the
110
+ build of another application.
111
111
 
112
- Снятое поле помечается `reserved` с его номером и именем.
112
+ A removed field is marked `reserved` with its number and name.
113
113
 
114
- ## Частые промахи
114
+ ## Common misses
115
115
 
116
- - `Api` переписан руками вместо псевдонима — разойдётся с контрактом молча.
117
- - `??` вместо `typeCast` — контракт отдаёт значения по умолчанию, и проверка на `undefined`
118
- не ловит ничего.
119
- - `as Type` в маппере — запрещено правилом `typescript-conventions`.
120
- - `null` или `undefined` в `State` — пустое выражается пустой строкой или нулём, а смысл нуля
121
- объясняется комментарием рядом с полем.
122
- - `readonly`-массив отдан в запрос: init-тип сообщения требует изменяемый, модель отдаётся
123
- копией.
124
- - Общий тип на админку и сайт — у гостя своя короткая форма записи.
116
+ - `Api` rewritten by hand instead of an alias — diverges from the contract silently.
117
+ - `??` instead of `typeCast` — the contract returns default values, and a check for `undefined`
118
+ catches nothing.
119
+ - `as Type` in a mapper — forbidden by rule `typescript-conventions`.
120
+ - `null` or `undefined` in `State` — empty is expressed by an empty string or zero, and the
121
+ meaning of zero is explained by a comment next to the field.
122
+ - A `readonly` array handed to a request: the message's init type demands a mutable one, the
123
+ model hands out a copy.
124
+ - A shared type for the admin and the site — the guest has its own short shape of the record.
@@ -2,20 +2,20 @@
2
2
  name: entity-store
3
3
  kind: pattern
4
4
  rule: entity-conventions
5
- description: Паттерн правила entity-conventions. Брать при заведении или правке стора админки — готовый наследник общей основы списочного стора, обвязка mutate, имена методов от действия, действие со своей занятостью. Не брать для панели — это паттерн entity-aside.
5
+ description: Pattern of rule entity-conventions. Load when creating or editing an admin store — the ready-made heir of the shared list store base, the mutate harness, method names from the action, an action with its own busy flag. Not for the panel — that is pattern entity-aside.
6
6
  ---
7
7
 
8
- # Стор сущности
8
+ # The entity store
9
9
 
10
- Паттерн правила `entity-conventions`. Что при этом должно быть верно — закон
10
+ Pattern of the rule `entity-conventions`. What must be true — the law
11
11
  `docs/constitution/entity-editing.md`.
12
12
 
13
- ## Когда брать
13
+ ## When to use
14
14
 
15
- - Заводится `<сущность>.store.ts`.
16
- - Правится метод загрузки или записи существующего стора.
15
+ - An `<entity>.store.ts` is created.
16
+ - The load or save method of an existing store is edited.
17
17
 
18
- ## Наследник объявляет своё в четырёх строках
18
+ ## The heir declares its own in four lines
19
19
 
20
20
  ```typescript
21
21
  @Injectable()
@@ -42,14 +42,15 @@ export class PromoCodesStore extends BaseListStoreService<
42
42
  }
43
43
  ```
44
44
 
45
- Конфиг решает, что уходит в выборку. Выключено всё — выборки нет вовсе, и сервер отдаёт список
46
- целиком. Из основы работают загрузка и перезапрос, смена страницы, порядка, условий отбора и
47
- строки поиска, догрузка следующей страницы, правка одной записи в списке и сброс выборки.
45
+ The config decides what goes into the query. With everything off there is no query at all, and
46
+ the server returns the whole list. From the base come loading and re-reading, changing the page,
47
+ the order, the filter conditions and the search string, loading the next page, editing one record
48
+ in the list and resetting the query.
48
49
 
49
- Файл называется `<сущность>.store.ts`: имя `<сущность>-store.service.ts` выводит его и из
50
- правила линтера, и из гейта скилов.
50
+ The file is called `<entity>.store.ts`: the name `<entity>-store.service.ts` takes it out of both
51
+ the linter rule and the rule gate.
51
52
 
52
- ## Метод правки отдаёт поток
53
+ ## The save method returns a stream
53
54
 
54
55
  ```typescript
55
56
  public save(draft: IPromoCode.Draft): Observable<IPromoCode.State | null> {
@@ -57,12 +58,11 @@ public save(draft: IPromoCode.Draft): Observable<IPromoCode.State | null> {
57
58
  }
58
59
  ```
59
60
 
60
- `mutate` держит занятость, гашение прежней ошибки, перечитывание списка после успеха и ключ
61
- отказа. Мутация завершается **перечитанным списком**, а не отправленным запросом: панель
62
- закрывается по значению потока, и список, перечитанный после закрытия, показал бы прежнее
63
- значение.
61
+ `mutate` holds the busy state, clearing the previous error, re-reading the list after success
62
+ and the refusal key. A mutation ends with a **re-read list**, not with a sent request: the panel
63
+ closes on the stream's value, and a list re-read after closing would show the previous value.
64
64
 
65
- ## Имена — от действия, а не от домена
65
+ ## Names — from the action, not from the domain
66
66
 
67
67
  | ✗ | ✓ |
68
68
  | ------------------------------------ | ---------- |
@@ -70,22 +70,22 @@ public save(draft: IPromoCode.Draft): Observable<IPromoCode.State | null> {
70
70
  | `deleteBooking()`, `removeFeed()` | `remove()` |
71
71
  | `loadBookings()`, `fetchFeeds()` | `load()` |
72
72
 
73
- Имя домена уже в имени стора и в его алиасе.
73
+ The domain name is already in the store name and in its alias.
74
74
 
75
- ## Действие со своей занятостью
75
+ ## An action with a busy state of its own
76
76
 
77
- Идёт мимо `mutate`: опрос подписки на календарь держит `pollingId`, потому что панель на минуту
78
- опроса не гасится, а ключ отказа кладёт `setErrorKey`.
77
+ Goes past `mutate`: calendar subscription polling keeps `pollingId`, because the panel is not
78
+ frozen for the minute of polling, and the refusal key is put by `setErrorKey`.
79
79
 
80
- ## Частые промахи
80
+ ## Common misses
81
81
 
82
- - Булев ответ у метода правки: он теряет и записанную запись, и причину отказа — панель узнаёт
83
- только «не вышло».
84
- - Своя обвязка занятости и ошибки вокруг вызова сервиса: всё это в `mutate`.
85
- - Свои сигналы записей, занятости и отказа: они в общей основе.
86
- - Подписка на сигнал отказа загрузки: сигнал делят список и панель, и один отказ показался бы
87
- дважды. Отказ загрузки идёт отдельным потоком.
88
- - Второе поле сортировки: порядок в выборке один — его не принимают ни таблица, ни контракт,
89
- ни разбор на сервере.
90
- - Хвост с `EMPTY`, приклеенный к мутации: он гасится `defaultIfEmpty`, иначе отказ приклеенного
91
- потока превращает удачную запись в вечный спиннер.
82
+ - A boolean answer from the save method: it loses both the saved record and the reason of the
83
+ refusal — the panel learns only "it did not work".
84
+ - An own busy-and-error harness around the service call: all of that is in `mutate`.
85
+ - Own signals of records, busy state and refusal: they are in the shared base.
86
+ - A subscription to the load refusal signal: the signal is shared by the list and the panel, and
87
+ one refusal would show twice. The load refusal goes as a separate stream.
88
+ - A second sort field: the query has one order — neither the table, nor the contract, nor the
89
+ parsing on the server accepts a second one.
90
+ - A tail with `EMPTY` glued to a mutation: it is handled by `defaultIfEmpty`, otherwise a refusal
91
+ of the glued stream turns a successful save into an endless spinner.
@@ -2,88 +2,97 @@
2
2
  name: git-workflow-commit
3
3
  kind: pattern
4
4
  rule: git-workflow
5
- description: Паттерн правила git-workflow. Брать на заведение рабочего элемента, ветки, коммит и пуш: элемент с областью и итерацией, перевод состояния, слияние двух задач в одну, работа от машинной записи, обход требования документа. Открытие PR — паттерн git-workflow-pr.
5
+ description: Pattern of rule git-workflow. Load for creating a work item and a branch, commit and push — an item with area and iteration, state transition, merging two tasks into one, working as the machine account, skipping the document requirement. Opening a PR — pattern git-workflow-pr.
6
6
  ---
7
7
 
8
- # Задача, ветка и коммит
8
+ # Task, branch and commit
9
9
 
10
- Паттерн правила `git-workflow`. Что при этом должно быть верно — закон
10
+ Pattern of the rule `git-workflow`. What must be true meanwhile — the law
11
11
  `docs/constitution/delivery.md`.
12
12
 
13
- ## Когда брать
13
+ ## When to use
14
14
 
15
- - Заводится рабочий элемент, с которого начинается правка.
16
- - Заводится ветка под него.
17
- - Готовится коммит или пуш.
18
- - Работа перешла на следующий шаг, и элемент переводится в другое состояние.
15
+ - A work item is being created, and the edit starts from it.
16
+ - A branch is being created for it.
17
+ - A commit or a push is being prepared.
18
+ - The work moved to the next step, and the item moves to another state.
19
19
 
20
- ## Сначала рабочий элемент, потом ветка
20
+ ## First the work item, then the branch
21
21
 
22
- Заведение состоит из четырёх шагов: элемент, номер в его заголовке, исполнитель, состояние
23
- `New`. Область и итерация ставятся тут же: элемент без них лежит в корне проекта и на доску
24
- команды не попадает — заведён, а в очереди работ его нет.
22
+ Creation is four steps: the item, the number in its title, the assignee, the state `New`. Area and
23
+ iteration are set right there: an item without them lies in the project root and does not reach
24
+ the team board — created, but not in the work queue.
25
25
 
26
- Все четыре делает одна команда дерева, а не рука: делить их значит забывать последний.
26
+ All four are done by one tree command, not by hand: splitting them means forgetting the last.
27
+
28
+ **A command that does not exist is not replaced by client calls in the pattern.** A tree that
29
+ takes the package for the first time gets the check files, but not the entries about them in its
30
+ manifest: the layout edits resources, and the consumer's manifest does not belong to it. Two ways
31
+ from here: create the command in the same turn, or repeat all its steps by name from the list
32
+ above. A bypass by client calls looks like execution up to the last step of the list: it is
33
+ forgotten first, because the previous ones have already given a visible result.
27
34
 
28
35
  ```bash
29
36
  npm run task:new -- --title 'Письма владельцу не уходят молча' \
30
37
  --type Bug --area '<проект>\<команда>' --slug mail-owner-silence < описание.md
31
38
  ```
32
39
 
33
- Скрипт под этой командой заводит проект — пакет её не везёт. Что он делает вызовами `az`:
40
+ The script under this command is created by the project — the package does not ship it. What it
41
+ does by `az` calls:
34
42
 
35
43
  ```bash
36
44
  az boards work-item create --type Bug --title '[<номер>] …' \
37
45
  --org https://dev.azure.com/<организация> --project <проект> \
38
46
  --assigned-to <бот> --area '<проект>\<команда>' --iteration '<проект>\<итерация>'
39
- az boards work-item update --id <номер> --title '[<номер>] …' # номер известен после создания
47
+ az boards work-item update --id <номер> --title '[<номер>] …' # the number is known after creation
40
48
  ```
41
49
 
42
- Номер в заголовок руками не пишется — он известен только после создания, и команда дописывает
43
- его сама.
50
+ The number is not written into the title by hand — it is known only after creation, and the
51
+ command appends it itself.
44
52
 
45
- Заведение кончается не выводом команды, а ответом очереди работ. Команда спрашивает её сама и
46
- печатает прочитанное — присутствие на доске, состояние, исполнителя; отсутствие кончает её
47
- ненулевым кодом. В комментарий, в тело PR и в замысел идёт этот ответ, а не напечатанный
48
- номер: номер говорит «вызов прошёл», а не «работа видна тому, кто по ней придёт».
53
+ Creation ends not with the command's output but with the work queue's answer. The command asks
54
+ it itself and prints what it read — presence on the board, the state, the assignee; absence ends
55
+ it with a non-zero code. That answer goes into the comment, the PR body and the plan, not the
56
+ printed number: the number says "the call went through", not "the work is visible to whoever
57
+ comes for it".
49
58
 
50
- Заведения, идущие подряд, проверяются не по последнему, а сверкой очереди целиком: промах у них
51
- общий, и по одному элементу он не виден.
59
+ Creations that go one after another are checked not by the last one but by an audit of the whole
60
+ queue: their miss is shared, and by one item it is invisible.
52
61
 
53
- Чем сверить, что очередь работ в порядке:
62
+ What to check the work queue with:
54
63
 
55
64
  ```bash
56
65
  npm run check:board
57
66
  ```
58
67
 
59
- Она смотрит только открытое: состояние, область и исполнителя у каждого открытого элемента, а
60
- у каждого открытого PR — номер в заголовке, привязанный элемент и то, что второго PR с тем же
61
- номером нет. Имя ветки не судит: у открытого PR его не переименовать.
68
+ It looks only at what is open: the state, the area and the assignee of every open item, and for
69
+ every open PR — the number in the title, the attached item and that there is no second PR with
70
+ the same number. It does not judge the branch name: an open PR cannot have it renamed.
62
71
 
63
- ## Две задачи, которые чинятся одной правкой
72
+ ## Two tasks fixed by one edit
64
73
 
65
- Если по ходу выяснилось, что правка закрывает и соседний элемент, — это одна задача, а не две.
66
- Слить их можно, пока правка не въехала в главную ветку:
74
+ If it turned out along the way that the edit closes the neighbouring item too — that is one task,
75
+ not two. They can be merged while the edit has not reached the main branch:
67
76
 
68
77
  ```bash
69
- # то, чего в поглотившем элементе не было, дописывается в его описание
78
+ # what the absorbing item lacked is appended to its description
70
79
  az boards work-item update --id <поглотивший> --description "$(cat тело.md)"
71
- # поглощённый связывается с ним как дубликат и закрывается
80
+ # the absorbed one is linked to it as a duplicate and closed
72
81
  az boards work-item relation add --id <поглощённый> --relation-type duplicate-of \
73
82
  --target-id <поглотивший>
74
83
  az boards work-item update --id <поглощённый> --state 'Removed'
75
84
  ```
76
85
 
77
- Связь ставится до закрытия: закрытый без неё элемент читается как сделанный, а сделан он не
78
- был. Состояние снятого зависит от процесса проекта — `Removed` есть в Agile и Scrum, в Basic
79
- его нет; какое здесь, сказано в `implementation.md`.
86
+ The link is set before closing: an item closed without it reads as done, and it was not done. The
87
+ state of a removed item depends on the project process — `Removed` exists in Agile and Scrum, and
88
+ Basic does not have it; which one is here, `implementation.md` says.
80
89
 
81
- После слияния ветки поглощения нет: она въехала, и откатывается целиком.
90
+ After the branch is merged there is no absorbing: it went in, and it is reverted whole.
82
91
 
83
- ## Ветка заводится отдельным вызовом
92
+ ## The branch is created by a separate call
84
93
 
85
- Гард главной ветки разбирает текст команды и смотрит ветку на момент запуска, поэтому
86
- составная команда отклоняется целиком — ветки в ней ещё нет:
94
+ The main branch guard parses the command text and looks at the branch at launch, so a compound
95
+ command is rejected whole — the branch does not exist in it yet:
87
96
 
88
97
  ```bash
89
98
  ✗ git checkout -b 85-guest-token && git commit -m 'feat(admin): …'
@@ -91,40 +100,42 @@ az boards work-item update --id <поглощённый> --state 'Removed'
91
100
  ✓ git commit -F -
92
101
  ```
93
102
 
94
- Имя несёт номер элемента, slug строчными латинскими через дефис; точная форма — в
95
- `implementation.md`. Гард поставки разбирает её на месте и отбивает промах до первого коммита,
96
- а по номеру спрашивает доску: элемент должен существовать, быть открытым и иметь исполнителя.
103
+ The name carries the item number, the slug in lowercase Latin letters joined by hyphens; the exact
104
+ form — in `implementation.md`. The delivery guard parses it on the spot and refuses a miss before
105
+ the first commit, and by the number it asks the board: the item must exist, be open and have an
106
+ assignee.
97
107
 
98
- Имя без номера (`feat/…`, `fix/…`) законно, пока ветка живёт локально — под пробу и разбор.
99
- PR с неё не откроется: правка, доезжающая до главной ветки, начинается с задачи.
108
+ A name without a number (`feat/…`, `fix/…`) is legitimate while the branch lives locally — for a
109
+ trial and an analysis. No PR opens from it: an edit that reaches the main branch starts with a
110
+ task.
100
111
 
101
- ## Состояние элемента двигается вместе с работой
112
+ ## The item state moves together with the work
102
113
 
103
- Ветка заведена — элемент уже не `New`, а `Active`. PR открыт — он ждёт разбора. Оба перевода
104
- делает одна команда, вторым вызовом сразу за тем, который его вызвал:
114
+ Branch created — the item is no longer `New` but `Active`. PR opened — it awaits review. Both
115
+ moves are done by one command, as a second call right after the one that caused it:
105
116
 
106
117
  ```bash
107
- npm run task:move -- 86 in-progress # сразу после git checkout -b 86-…
108
- npm run task:move -- 86 in-review # сразу после az repos pr create
118
+ npm run task:move -- 86 in-progress # right after git checkout -b 86-…
119
+ npm run task:move -- 86 in-review # right after az repos pr create
109
120
  ```
110
121
 
111
- Под ней — правка поля состояния:
122
+ Under it — an edit of the state field:
112
123
 
113
124
  ```bash
114
125
  az boards work-item update --id 86 --state 'Active'
115
126
  ```
116
127
 
117
- Имена состояний берутся у процесса проекта, а не назначаются правилом: Agile, Scrum и Basic
118
- называют одни и те же три шага по-разному, и перевод в состояние, которого в процессе нет,
119
- отвечает отказом на каждой задаче подряд.
128
+ State names are taken from the project process, not assigned by the rule: Agile, Scrum and Basic
129
+ call the same three steps differently, and a move to a state the process does not have answers
130
+ with a refusal on every task in a row.
120
131
 
121
- Перевод не откладывается на потом: очередь работ читают между шагами, а не после них.
132
+ The move is not put off for later: the work queue is read between steps, not after them.
122
133
 
123
- ## Коммит подписывается учётной записью машинной работы
134
+ ## The commit is signed by the machine account
124
135
 
125
- Токен читается в переменную и не печатается; автор и коммиттер задаются переменными той же
126
- команды. `git config` не годится — конфиг общий с основным деревом и переписал бы подпись
127
- владельцу:
136
+ The token is read into a variable and not printed; author and committer are set by variables of
137
+ the same command. `git config` will not do — the config is shared with the main tree and would
138
+ rewrite the signature to the owner:
128
139
 
129
140
  ```bash
130
141
  TOKEN=$(tr -d '\n' < ~/.config/<дерево>-bot-token)
@@ -134,28 +145,36 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<почта бота>" \
134
145
  git commit -F -
135
146
  ```
136
147
 
137
- Заголовок — `type(scope): description`. Типы: `feat`, `fix`, `refactor`, `docs`, `style`,
138
- `test`, `chore`, `perf`. Области — свои у дерева, они перечислены в `implementation.md`. Точка
139
- в конце заголовка не принимается.
148
+ The subject — `type(scope): description`. Types: `feat`, `fix`, `refactor`, `docs`, `style`,
149
+ `test`, `chore`, `perf`. Scopes are the tree's own, listed in `implementation.md`. A full stop
150
+ at the end of the subject is not accepted.
140
151
 
141
- Строка `AB#<номер>` в теле коммита привязывает его к рабочему элементу. Она не заменяет
142
- привязки самого PR: коммит связывается с элементом, а очередь работ читает связь PR.
152
+ The line `AB#<номер>` in the commit body attaches it to the work item. It does not replace the
153
+ attachment of the PR itself: the commit is linked to the item, and the work queue reads the PR's
154
+ link.
143
155
 
144
- ## Документ едет тем же коммитом
156
+ ## The document goes in the same commit
145
157
 
146
- `docs-guard` требует пару и называет её сам. Обход — строка в теле, причина обязательна:
158
+ `docs-guard` demands the pair and names it itself. The bypass — a line in the body, the reason
159
+ is mandatory:
147
160
 
148
161
  ```
149
162
  Docs-skip: правка только в тестах хука, зеркала у него нет
150
163
  ```
151
164
 
152
- ## Частые промахи
153
-
154
- - Область и итерация не заданы: элемент заведён, но на доску команды не попал.
155
- - Состояние взято не из процесса проекта: перевод отвечает отказом на каждой задаче, и это
156
- читается как сломанная команда, а не как неверное имя состояния.
157
- - `git add` с несколькими путями не добавляет ничего, если хоть один путь не существует:
158
- команда обрывается на первом промахе целиком. Следующий `git commit --amend` при этом уносит
159
- в коммит всё, что осталось в индексе. Состав коммита читается `git show --stat` сразу после
160
- него, а не на разборе PR.
161
- - Правка владельца ни токена, ни переменных не берёт — они только для машинной работы.
165
+ ## Common misses
166
+
167
+ - **An audit right after adding answers "no" when the card already stands.** The work queue gives
168
+ out a new item not in the same second it was created, and the last step reads it by the next
169
+ call. The answer to this is to reread the whole queue, not to create the card a second time: two
170
+ records about one task are removed only by an administrator. The creation command itself needs
171
+ an edit here: the state is read right after the mutation, without a retry, and a false refusal
172
+ here costs more than a delay.
173
+ - Area and iteration are not set: the item is created, but it did not reach the team board.
174
+ - The state is not taken from the project process: the move answers with a refusal on every task,
175
+ and this reads as a broken command, not as a wrong state name.
176
+ - `git add` with several paths adds nothing if even one path does not exist: the command breaks
177
+ off whole at the first miss. The next `git commit --amend` then carries into the commit
178
+ everything left in the index. The commit contents are read by `git show --stat` right after it,
179
+ not at PR review.
180
+ - The owner's edit takes neither the token nor the variables — they are only for machine work.