@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
@@ -2,137 +2,143 @@
2
2
  name: browser-verification-stand
3
3
  kind: pattern
4
4
  rule: browser-verification
5
- description: Паттерн правила browser-verification. Брать, когда нужен честный стенд — прод-сборка сайта, стенд админки, стенд под настоящим nginx, вход в админку, разбор того, что висит на порту. Не брать для замеров вёрстки — это паттерн browser-verification-measure.
5
+ description: Pattern of rule browser-verification. Load when an honest stand is needed — the production build of the site, the admin stand, a stand behind real nginx, signing in to the admin, finding out what sits on a port. Not for layout measurements — that is pattern browser-verification-measure.
6
6
  ---
7
7
 
8
- # Честный стенд
8
+ # An honest stand
9
9
 
10
- Паттерн правила `browser-verification`. Что при этом должно быть верно — закон
10
+ Pattern of the rule `browser-verification`. What must be true — the law
11
11
  `docs/constitution/verifiability.md`.
12
12
 
13
- ## Когда брать
13
+ ## When to use
14
14
 
15
- - Проверяется то, чего на дев-сервере не видно: разметка от сервера, локали, кэш,
16
- перенаправления, заголовки, размер бандла.
17
- - Порт отвечает не тем, чего ждали.
18
- - Нужен вход в админку.
15
+ - What is checked is not visible on the dev server: server-side markup, locales, cache,
16
+ redirects, headers, bundle size.
17
+ - The port answers with something other than what was expected.
18
+ - Signing in to the admin is needed.
19
19
 
20
- ## Номера портов объявляет дерево, а не паттерн
20
+ ## Port numbers are declared by the tree, not by the pattern
21
21
 
22
- Команды ниже называют порты именами — `API_PORT`, `SITE_PORT`, `ADMIN_PORT`, `SSR_PORT`, порты
23
- стенда и порты прокси. Номеров у паттерна нет: раскладка стендов у каждого дерева своя, а дерево с
24
- одним приложением, обязанное назвать восемь чужих номеров, называет их выдуманными — и
25
- подстановки теряют смысл. Номера дерево объявляет своим профилем: в переменных окружения либо
26
- разделом надстройки при этом паттерне, где стоят его же готовые команды с именами целей раннера.
22
+ The commands below name the ports by name — `API_PORT`, `SITE_PORT`, `ADMIN_PORT`, `SSR_PORT`, the
23
+ stand ports and the proxy ports. The pattern has no numbers: every tree lays out its stands its own
24
+ way, and a tree with one application, obliged to name eight foreign numbers, names invented ones —
25
+ and the substitutions lose their meaning. The tree declares the numbers by its own profile: in
26
+ environment variables or in an override section of this pattern, where its own ready-made commands
27
+ stand with the names of the runner targets.
27
28
 
28
- Роль каждого имени — то, о чём говорит проза: порт приёмника, порт сайта, порт админки, порт
29
- сервера отрисовки. Дерево, у которого такого приложения нет, эти разделы не читает.
29
+ The role of each name is what the prose speaks of: the intake port, the site port, the admin port,
30
+ the rendering server port. A tree that has no such application does not read those sections.
30
31
 
31
- ## Сначала — что отвечает на порту
32
+ ## First — what answers on the port
32
33
 
33
- До первого запроса, а не после непонятного ответа:
34
+ Before the first request, not after a puzzling answer:
34
35
 
35
36
  ```bash
36
37
  lsof -nP -iTCP:$API_PORT -sTCP:LISTEN
37
38
  ```
38
39
 
39
- На порту приёмника регулярно висит собранный артефакт из прошлой сессии
40
- (`node -r dotenv/config dist/apps/api/main.js`): он отвечает 200 старым кодом, а процедуры,
41
- заведённой в ветке, у него нет вовсе. Таких процессов бывает несколько, и снимать надо все —
42
- по PID из `lsof`, каждый: `pkill` по шаблону `nx serve api` не попадает ни в один.
40
+ A built artifact from a past session regularly hangs on the intake port
41
+ (`node -r dotenv/config dist/apps/api/main.js`): it answers 200 with old code, and the procedure
42
+ created in the branch it does not have at all. There may be several such processes, and all of
43
+ them must be killed — by PID from `lsof`, each one: `pkill` by the pattern `nx serve api` hits none
44
+ of them.
43
45
 
44
- ## Прод-сборка сайта
46
+ ## Production build of the site
45
47
 
46
48
  ```bash
47
49
  npx nx build site
48
50
  PORT=$SITE_STAND_PORT node dist/apps/site/server/server.mjs
49
51
  ```
50
52
 
51
- Это не дев-сервер: гард ловит `nx|ng serve`, пакетные раннеры и статические серверы, а запуск
52
- собранного сервера пропускает.
53
+ This is not a dev server: the guard catches `nx|ng serve`, package runners and static servers, and
54
+ lets the launch of a built server through.
53
55
 
54
- Поведение, зависящее от хоста — адрес владельца, увод, разный ответ на разных именах, —
55
- проверяется прямо здесь одним запросом с заданным заголовком. Прокси с подменой для этого не
56
- нужен: он добавляет ещё один процесс, чьё поведение придётся отделять от проверяемого.
56
+ Behaviour that depends on the host — the owner's address, a redirect away, a different answer on
57
+ different names — is checked right here with one request carrying the given header. A proxy with
58
+ substitution is not needed for that: it adds one more process whose behaviour will have to be told
59
+ apart from the one under check.
57
60
 
58
- ## Стенд админки
61
+ ## Admin stand
59
62
 
60
63
  ```bash
61
64
  npx nx build admin --base-href=/
62
65
  ```
63
66
 
64
- Без `--base-href` стенд отдаёт пустую страницу без ошибок в консоли. Стенду, на котором нужен
65
- Angular DevTools, нужна ещё и dev-конфигурация (`--configuration=development`): прод-сборка не
66
- публикует `window.ng`. Выводы о размере бандла и минификации на такой сборке делать нельзя.
67
-
68
- Собранное отдаётся прокси дерева с его настоящим конфигом, а не статическим сервером. Причин
69
- две, и обе всплывают в первую минуту: приложение ходит за процедурами на свой же origin, а по
70
- глубокой ссылке статический сервер отвечает `404` — маршрутов одностраничного приложения он не
71
- знает и на его точку входа не откатывается. Гард дев-серверов такой сервер отбивает наравне с
72
- `nx serve`, и это указание на верный ход, а не помеха: готовый вызов — раздел «Стенд под
73
- настоящим nginx» ниже, он и отдаёт собранное, и проксирует процедуры.
74
-
75
- Вход делается формой, как у человека. Учётная запись местной базы разработки — не секрет
76
- владельца: её кладёт туда засев того же дерева, а пароль лежит в файле окружения рядом.
77
- Разрешения на неё не спрашивают — спрашивают про боевую запись, а её на местном стенде не
78
- бывает вовсе. Там, где приёмника рядом нет, ответ входа подменяет сам стенд: путь у приложения
79
- остаётся тот же, что у человека.
80
-
81
- Токен руками не подписывается и в хранилище браузера руками не кладётся: положенный так, он
82
- проверяет экран, миновав живой путь входа, — то есть отвечает не на тот вопрос. Просьба к
83
- человеку набрать пароль, открыть вкладку или нажать кнопку означает неверно выбранный путь, а
84
- не нехватку прав у исполнителя.
85
-
86
- **Спрашивают режим работы, а не ввод.** Ввод в поле пароля отбивает классификатор
87
- автоматического режима: он судит само действие и адресов не различает — стенд на местном порту
88
- выглядит для него боевым сайтом. Ход отсюда один: назвать владельцу отбитое действие, попросить
89
- обычный режим, заполнить форму парой засева самому и вернуться в автоматический режим. Просьба
90
- «войди сам» и «введи пароль» перекладывает на владельца работу агента и выглядит законной ровно
91
- потому, что перед ней стоит настоящее препятствие: отбитое поле, чужое расширение в браузере,
92
- отключившийся профиль. Препятствие остаётся препятствием агента.
93
-
94
- Пути, которыми препятствие снимается своими силами, — до всякой просьбы: подстановка значения
95
- инструментом формы по ссылке на элемент, выключение мешающего расширения в профиле браузера,
96
- подъём стенда на другом адресе. Второй драйвер полем пароля не оправдывается: он заполняет то же
97
- поле без классификатора, но обойдённый запрет снимается не с одного поля, а со всех сразу.
98
- Оставленный обычный режим снимает подтверждение и со всех последующих действий захода, поэтому
99
- возврат — часть входа, а не отдельная уборка.
100
-
101
- Стенд владельца запасным путём не бывает: он собирает главную ветку и о правке в рабочем дереве
102
- не говорит ничего.
103
-
104
- ## Стенд API
105
-
106
- Собранный артефакт поднимается на свободном порту, а не на порту приёмника: там отвечает приёмник
107
- владельца, и окружение у него не то, которое проверяется.
67
+ Without `--base-href` the stand serves an empty page with no errors in the console. A stand that
68
+ needs Angular DevTools also needs the dev configuration (`--configuration=development`): the
69
+ production build does not publish `window.ng`. No conclusions about bundle size and minification
70
+ may be drawn from such a build.
71
+
72
+ What was built is served by the tree's proxy with its real config, not by a static server. There are
73
+ two reasons, and both surface in the first minute. The application calls procedures on its own
74
+ origin, and on a deep link a static server answers `404`: it knows nothing of the single-page
75
+ application's routes and does not fall back to its entry point. The dev-server guard refuses such a
76
+ server the same as `nx serve`, and that is a pointer to the right move, not an obstacle. The
77
+ ready-made call is the section "A stand behind real nginx" below; it both serves what was built and
78
+ proxies the procedures.
79
+
80
+ Sign-in is done through the form, as a person does it. The account of the local development
81
+ database is not the owner's secret: the seed of the same tree puts it there, and the password lies
82
+ in the environment file next to it. Permission for it is not asked — permission is asked about a
83
+ production account, and there is never one on a local stand. Where there is no intake nearby, the
84
+ stand itself substitutes the sign-in answer: the application's path stays the same as a person's.
85
+
86
+ The token is not signed by hand and not put into browser storage by hand: put there so, it checks
87
+ the screen while bypassing the live sign-in path — that is, it answers the wrong question. Asking
88
+ a person to type a password, open a tab or press a button means a wrongly chosen path, not a lack
89
+ of rights on the executor's side.
90
+
91
+ **Ask for the work mode, not for the input.** Input into the password field is refused by the
92
+ classifier of automatic mode: it judges the action itself and does not tell addresses apart — a
93
+ stand on a local port looks to it like the production site. There is one move from here: name the
94
+ refused action to the owner, ask for normal mode, fill the form with the seed pair yourself and
95
+ return to automatic mode. The request "sign in yourself" and "type the password" shifts the
96
+ agent's work onto the owner and looks legitimate exactly because a real obstacle stands before
97
+ it: a refused field, a foreign extension in the browser, a profile that disconnected. The
98
+ obstacle stays the agent's obstacle.
99
+
100
+ The ways to lift the obstacle by one's own means come before any request. Substitute the value with
101
+ the form tool by a reference to the element; switch off the interfering extension in the browser
102
+ profile; raise the stand on another address. A second driver is not justified by the password field:
103
+ it fills the same field without the classifier, but the bypassed ban is lifted not from one field
104
+ but from all of them at once. Normal mode left on removes confirmation from every later action of
105
+ the session too, so the return is part of the sign-in, not a separate clean-up.
106
+
107
+ The owner's stand is never a fallback path: it builds the main branch and says nothing about the
108
+ edit in the working tree.
109
+
110
+ ## API stand
111
+
112
+ The built artifact is raised on a free port, not on the intake port: there the owner's intake
113
+ answers, and its environment is not the one under check.
108
114
 
109
115
  ```bash
110
116
  npx nx build api
111
117
  env -u JWT_SECRET NODE_ENV=production API_PORT=$API_STAND_PORT DATABASE_URL=… node dist/apps/api/main.js
112
118
  ```
113
119
 
114
- Переменные окружения задаются в самой команде, по одной на проверяемый случай. Отказ на
115
- старте — такой же результат проверки, как ответ 200: приложение, упавшее в фабрике
116
- провайдера, порт не слушает вовсе, и это видно по `lsof`, а не по тексту в консоли.
120
+ Environment variables are set in the command itself, one per case under check. A refusal at start-up
121
+ is as much a check result as a 200 answer. An application that fell in a provider factory does not
122
+ listen on the port at all, and that is seen by `lsof`, not by the text in the console.
117
123
 
118
- Процедура зовётся полным именем, как её объявляет контракт:
124
+ A procedure is called by its full name, as the contract declares it:
119
125
 
120
126
  ```bash
121
- curl -sS -X POST http://localhost:$API_STAND_PORT/<область>.v1.AuthService/GetMe \
127
+ curl -sS -X POST http://localhost:$API_STAND_PORT/<area>.v1.AuthService/GetMe \
122
128
  -H 'content-type: application/json' -H "authorization: Bearer $TOKEN" -d '{}'
123
129
  ```
124
130
 
125
- Токен подписывается руками только там, где проверяется сама подпись: доказать, что отладочный
126
- ключ принимается, другого пути не имеет. Во всех остальных случаях токен берётся у живого API
127
- входом — рукописный скрывает расхождение состава притязаний.
131
+ A token is signed by hand only where the signature itself is under check: proving that the debug
132
+ key is accepted has no other path. In every other case the token is taken from the live API by
133
+ signing in — a hand-written one hides a divergence in the set of claims.
128
134
 
129
- ## Стенд под настоящим nginx
135
+ ## A stand behind real nginx
130
136
 
131
- Кэш, перенаправления и заголовки живут в `deploy/nginx.conf`, а не в приложении. Любой вывод
132
- про `301`, `Cache-Control` и `X-Cache-Status` делается только здесь:
137
+ Cache, redirects and headers live in `deploy/nginx.conf`, not in the application. Any conclusion
138
+ about `301`, `Cache-Control` and `X-Cache-Status` is drawn only here:
133
139
 
134
140
  ```bash
135
- docker run -d --name <префикс>-stand-nginx \
141
+ docker run -d --name <prefix>-stand-nginx \
136
142
  --add-host api:host-gateway --add-host ssr:host-gateway \
137
143
  -p $PROXY_SITE_PORT:80 -p $PROXY_ADMIN_PORT:8081 \
138
144
  -v "$PWD/deploy/nginx/main.conf:/etc/nginx/nginx.conf:ro" \
@@ -141,61 +147,65 @@ docker run -d --name <префикс>-stand-nginx \
141
147
  nginx:1.27-alpine
142
148
  ```
143
149
 
144
- - Конфиг монтируется **каталогом**, а не одиночным файлом: редактор пересоздаёт файл,
145
- контейнеру остаётся обрезанная копия, и `nginx -t` внутри падает на «unexpected end of file»
146
- при целом файле снаружи. Лечится пересозданием контейнера, а не правкой конфига.
147
- - Главный конфиг подставляется отдельной строкой: он лежит в `deploy/nginx/`, а не рядом с
148
- `nginx.conf`, — файл с расширением `.conf` в смонтированном каталоге попал бы в `include`
149
- и уронил бы nginx на директиве `user`. Без него стенд поднимается на конфиге образа, и
150
- предел соединений на воркер там свой.
151
- - Чужой `Host` отбивает **дев-сервер**, а не собранное приложение: прод-сборка отвечает на него
152
- тем же, чем и на свой. За настоящим прокси запросы идут со своим заголовком ровно потому, что
153
- прокси стоит перед дев-сервером, — оттуда и `-H "Host: localhost"`.
154
- - Переменные окружения стенда обязаны смотреть на процессы стенда. `CACHE_REFRESH_URL`,
155
- направленный на порт сайта, сбрасывает кэш мимо того процесса, который держит справочник
156
- перенаправлений в памяти, — исправный механизм при этом выглядит сломанным.
157
-
158
- ## Стенд живёт ровно столько, сколько проверка
159
-
160
- Стенд поднят под один вывод и после него не нужен. Брошенный не мешает ничему и не подаёт сигнала:
161
- имя у него своё, порт свободный, места он почти не занимает — увидеть его можно только вызовом
162
- списка, а звать его незачем. Разбирать накопленное поэтому приходится человеку, и отличить
163
- брошенный от живого стенда соседнего дерева он по имени не может.
164
-
165
- Снос идёт тем же ходом, которым сделан вывод:
150
+ - The config is mounted **as a directory**, not as a single file: the editor recreates the file,
151
+ the container is left with a truncated copy, and `nginx -t` inside falls on "unexpected end of
152
+ file" while the file outside is whole. Cured by recreating the container, not by editing the
153
+ config.
154
+ - The main config is substituted by a separate line: it lies in `deploy/nginx/`, not next to
155
+ `nginx.conf` — a file with the `.conf` extension in the mounted directory would get into
156
+ `include` and bring nginx down on the `user` directive. Without it the stand comes up on the
157
+ image's config, and the connection limit per worker there is its own.
158
+ - A foreign `Host` is refused by the **dev server**, not by the built application: the production
159
+ build answers it the same as its own. Behind the real proxy requests go with their own header
160
+ exactly because the proxy stands in front of the dev server — hence `-H "Host: localhost"`.
161
+ - The stand's environment variables must point at the stand's processes. `CACHE_REFRESH_URL`
162
+ pointed at the site port resets the cache past the process that keeps the redirect table in
163
+ memory — and a working mechanism looks broken.
164
+
165
+ ## A stand lives exactly as long as the check
166
+
167
+ A stand is raised for one conclusion and is not needed after it. Abandoned, it hinders nothing and
168
+ gives no signal. It has its own name, a free port, it takes almost no room — it can be seen only by
169
+ a call to the list, and there is no reason to call it. So it is a person who has to take apart what
170
+ piled up, and they cannot tell an abandoned stand from a live one of a neighbouring tree by name.
171
+
172
+ Teardown goes by the same move the conclusion was made with:
166
173
 
167
174
  ```bash
168
- docker rm -f <имя стенда>
175
+ docker rm -f <stand name>
169
176
  ```
170
177
 
171
- Имя даётся по номеру задачи — так видно, чей стенд остался, если ход всё-таки оборвался.
178
+ The name is given by the task number — so it is visible whose stand was left if the move broke off
179
+ after all.
172
180
 
173
- ## Дерево для сравнения
181
+ ## A tree for comparison
174
182
 
175
- Сказать «это сломала правка» можно, только если видно, что до правки было иначе. Проверяют это
176
- вторым деревом, а не по памяти:
183
+ "The edit broke this" can be said only when it is visible that before the edit it was otherwise.
184
+ That is checked with a second tree, not from memory:
177
185
 
178
186
  ```bash
179
- git worktree add ../<префикс>-base <коммит> # ветка задачи не трогается
180
- pnpm install --frozen-lockfile # из ../<префикс>-base: node_modules у него свои
187
+ git worktree add ../<prefix>-base <commit> # the task branch is not touched
188
+ pnpm install --frozen-lockfile # from ../<prefix>-base: its node_modules are its own
181
189
  ```
182
190
 
183
- - Для сравнения берут не главную ветку, а последний коммит, на котором дерево собирается:
184
- главная бывает сломана, и тогда «до» и «после» различаются не из-за правки. Собирается ли
185
- коммит — проверяют сборкой, а не тем, что он в главной ветке.
186
- - Стенд второго дерева поднимают на своих портах: порты сайта, админки и приёмника заняты владельцем, а порт отрисовки
187
- занимать нельзя — стенд разработчика ходит по имени `ssr:<порт отрисовки>`.
188
- - Оба стенда держат поднятыми одновременно — ровно до конца сравнения: если сравнивать по памяти
189
- между двумя запусками, заметишь только то, что успел запомнить. Со сравнением стенд второго
190
- дерева гасится тем же ходом, а не оставляется до конца захода: оставленные стенды копятся
191
- заходами и держат соединения к хранилищу, и правило говорит об этом ловушкой. Снятие отбито —
192
- стенд называется владельцу в конце захода поимённо, с портом.
193
-
194
- ## Состояние портов снимается до первой сборки захода
195
-
196
- Серверы владельца ложатся и без твоего участия: сайт отдавал 404 на все свои адреса ещё до
197
- первой сборки захода, а API замолчало посреди него. Без замера «до» падение нельзя ни
198
- приписать своей сборке, ни снять с неё подозрение.
191
+ - For comparison take not the main branch but the last commit on which the tree builds: main is
192
+ sometimes broken, and then "before" and "after" differ not because of the edit. Whether a commit
193
+ builds is checked by building, not by its being in the main branch.
194
+ - The stand of the second tree is raised on its own ports: the site, admin and intake ports are
195
+ taken by the owner, and the rendering port must not be taken — the developer's stand goes by the
196
+ name `ssr:<rendering port>`.
197
+ - Both stands are kept up at the same time — exactly until the comparison ends: comparing from
198
+ memory between two launches, you notice only what you managed to remember. With the comparison
199
+ done, the stand of the second tree is torn down by the same move, not left until the end of the
200
+ session. Stands left behind pile up across sessions and hold connections to the storage, and the
201
+ rule says so in a pitfall. Teardown refused — the stand is named to the owner at the end of the
202
+ session by name, with the port.
203
+
204
+ ## The state of the ports is taken before the first build of the session
205
+
206
+ The owner's servers go down without your involvement: the site answered 404 on all its addresses
207
+ before the first build of the session, and the API fell silent in the middle of it. Without a
208
+ "before" measurement a fall can be neither attributed to your build nor cleared of suspicion.
199
209
 
200
210
  ```bash
201
211
  for u in http://localhost:$API_PORT/health http://localhost:$SITE_PORT/ http://localhost:$ADMIN_PORT/; do
@@ -203,30 +213,32 @@ for u in http://localhost:$API_PORT/health http://localhost:$SITE_PORT/ http://l
203
213
  done
204
214
  ```
205
215
 
206
- Замер — это ответ, а не `lsof`: порт бывает занят собранным артефактом прошлой сессии, и он
207
- отвечает 200 старым кодом.
208
-
209
- ## Частые промахи
210
-
211
- - **Одиночная сборка проекта серверы переживают, и отказываться от неё незачем.** Замерено
212
- ответом до и после: все порты остались за своими процессами. Осторожность здесь стоит дороже
213
- проверки — целый набор проверок разметки остался незапущенным ровно потому, что сборку
214
- сочли опасной, не замерив. Сборка из кэша замером не бывает: она не собирает вовсе, и видно
215
- это по её длительности.
216
- - Свой дев-сервер не поднимать: сайт, админка и приёмник уже подняты
217
- владельцем, и второй экземпляр отбивается гардом.
218
- - **Отбитый статический сервер читается как запрет проверки, а он указание на верный ход.**
219
- Отдавать собранное им нельзя не из осторожности: приложение ходит на свой origin, а глубокая
220
- ссылка отвечает `404`. Отсюда идут не к обходу гарда, а к прокси дерева с его настоящим
221
- конфигом.
222
- - **Дев-сервер владельца — место, где смотрят, а не место, где проверяют.** Вывод о том, что
223
- экран верен, делается на прод-сборке за настоящим прокси: разметка от сервера, локали, кэш,
224
- перенаправления и заголовки на дев-сервере либо другие, либо отсутствуют вовсе. Взгляд на
225
- поднятый дев-сервер годится, чтобы понять, что происходит на незнакомом экране, и не годится
226
- подтверждением: подтверждение — замер на стенде из прод-сборки.
227
- - **Общая сборка глушит все три дев-сервера владельца, а не только API.** После
228
- `nx run-many -t build` ложатся и сайт, и админка. Собирать надо то, что
229
- проверяешь (`npx nx build site`), а не всё дерево. Если серверы легли, поднять их обратно
230
- агент не может — мешает гард, поэтому владельцу говорят об этом сразу, а не в конце сессии.
231
- - Порт отрисовки занимать осторожно: стенд разработчика ходит по тому же имени `ssr:<порт отрисовки>`
232
- через `host-gateway`, и пока на нём висит чужой процесс, стенд отдаёт чужую сборку.
216
+ The measurement is the answer, not `lsof`: the port is sometimes taken by a built artifact from a
217
+ past session, and it answers 200 with old code.
218
+
219
+ ## Common misses
220
+
221
+ - **A single project build the servers survive, and there is no reason to give it up.** Measured
222
+ by the answer before and after: all ports stayed with their processes. Caution here costs more
223
+ than the check — a whole set of layout checks was left unrun exactly because the build was
224
+ deemed dangerous without measuring. A build from the cache is not a measurement: it builds
225
+ nothing at all, and that is visible by its duration.
226
+ - Do not raise your own dev server: the site, the admin and the intake are already up by the
227
+ owner, and a second instance is refused by the guard.
228
+ - **A refused static server is read as a ban on the check, while it is a pointer to the right
229
+ move.** It may not serve what was built not out of caution: the application calls its own
230
+ origin, and a deep link answers `404`. From here one goes not to bypass the guard but to the
231
+ tree's proxy with its real config.
232
+ - **The owner's dev server is a place to look, not a place to check.** The conclusion that the
233
+ screen is right is drawn on the production build behind the real proxy: server-side markup,
234
+ locales, cache, redirects and headers on the dev server are either different or absent
235
+ altogether. A look at the raised dev server is fit to understand what is going on on an
236
+ unfamiliar screen and unfit as confirmation: the confirmation is a measurement on a stand from
237
+ the production build.
238
+ - **A build of everything silences all three dev servers of the owner, not only the API.** After
239
+ `nx run-many -t build` both the site and the admin go down. Build what you check
240
+ (`npx nx build site`), not the whole tree. If the servers went down, the agent cannot bring them
241
+ back up — the guard is in the way, so the owner is told at once, not at the end of the session.
242
+ - Take the rendering port with care: the developer's stand goes by the same name
243
+ `ssr:<rendering port>` through `host-gateway`, and while a foreign process hangs on it, the
244
+ stand serves a foreign build.