@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,164 +2,172 @@
2
2
  name: git-workflow-docker
3
3
  kind: pattern
4
4
  rule: deploy-flow
5
- description: Паттерн правила deploy-flow. Брать при работе с образами на своей машине: подъём и перезапуск демона, диагностика «висящей» команды, сборка под платформу прод-сервера, вход в реестр из службы. Команды прод-сервера — паттерн git-workflow-restart.
5
+ description: Pattern of rule deploy-flow. Load when working with images on your own machine — starting and restarting the daemon, diagnosing a hanging command, building for the production server platform, registry login from a service. Production server commands — pattern git-workflow-restart.
6
6
  ---
7
7
 
8
- # Образы на своей машине
8
+ # Images on one's own machine
9
9
 
10
- Паттерн правила `deploy-flow`. Что при этом должно быть верно — закон
10
+ Pattern of the rule `deploy-flow`. What must be true meanwhile — the law
11
11
  `docs/constitution/delivery.md`.
12
12
 
13
- Демон здесь чужой: на машине владельца в нём живут его хранилище разработки, его стенд и
14
- контейнеры других его работ. Любая команда пишется так, чтобы её отменяли, не спрашивая
15
- владельца, и чтобы она не задела ничего, кроме заведённого ею самой.
13
+ The daemon here is someone else's: on the owner's machine it holds their development storage,
14
+ their stand and the containers of their other works. Every command is written so that it can be
15
+ cancelled without asking the owner, and so that it touches nothing except what it created itself.
16
16
 
17
- ## Когда брать
17
+ ## When to use
18
18
 
19
- - Команда демона не отвечает, и надо понять почему.
20
- - Нужен одноразовый контейнер рядом с уже работающими.
21
- - Собирается образ, который поедет на прод-сервер.
22
- - Раннер конвейера на этой машине не может войти в реестр.
19
+ - A daemon command does not answer, and the reason must be found.
20
+ - A one-off container is needed next to those already running.
21
+ - An image is being built that will go to the production server.
22
+ - The pipeline runner on this machine cannot log in to the registry.
23
23
 
24
- ## Чужое не трогается
24
+ ## What is not yours is not touched
25
25
 
26
- Перед любым действием, которое задевает демон целиком, читается, что в нём живёт и переживёт
27
- ли оно перезапуск:
26
+ Before any action that touches the daemon whole, read what lives in it and whether it survives a
27
+ restart:
28
28
 
29
29
  ```bash
30
30
  docker ps --format '{{.Names}} | {{.Image}} | {{.Status}}'
31
31
  docker inspect <контейнер> --format '{{.Name}} restart={{.HostConfig.RestartPolicy.Name}}'
32
32
  ```
33
33
 
34
- `unless-stopped` поднимется сам, `no` — нет, и его возвращают руками сразу после подъёма
35
- демона. Стенд владельца обычно заведён с `no`: после перезапуска он остаётся лежать, а по его
36
- порту отвечает пустота — это выглядит поломкой стенда, а не следом перезапуска.
34
+ `unless-stopped` comes up by itself, `no` does not, and it is brought back by hand right after the
35
+ daemon comes up. The owner's stand is usually created with `no`: after a restart it stays down,
36
+ and its port answers with nothing — this looks like a broken stand, not like the trace of a
37
+ restart.
37
38
 
38
- Свои контейнеры именуются приставкой и снимаются по имени. `docker system prune`, `docker rm`
39
- по маске и `docker volume prune` не пишутся никогда: они уносят чужое молча.
39
+ One's own containers are named with a prefix and removed by name. `docker system prune`,
40
+ `docker rm` by a mask and `docker volume prune` are never written: they take away what is not
41
+ yours silently.
40
42
 
41
43
  ```bash
42
- docker rm -f <приставка>-ci-db >/dev/null 2>&1 || true # снять прошлый прогон
44
+ docker rm -f <приставка>-ci-db >/dev/null 2>&1 || true # remove the previous run
43
45
  ```
44
46
 
45
- Порт своего контейнера выбирается свободным: порт хранилища разработки занят, и попасть в него
46
- чужой миграцией нельзя.
47
+ The port of one's own container is chosen free: the development storage port is taken, and a
48
+ foreign migration must not land in it.
47
49
 
48
50
  ```bash
49
- lsof -nP -iTCP:<свободный порт> -sTCP:LISTEN # пусто — порт свободен
51
+ lsof -nP -iTCP:<свободный порт> -sTCP:LISTEN # empty — the port is free
50
52
  ```
51
53
 
52
- ## Место спрашивается до прогона
54
+ ## Space is asked before the run
53
55
 
54
- Диск виртуальной машины отдельный от диска хоста: на хосте свободно, внутри пусто, и видно это
55
- только изнутри.
56
+ The virtual machine's disk is separate from the host's disk: the host has room, inside it is
57
+ empty, and this is visible only from inside.
56
58
 
57
59
  ```bash
58
- docker system df # образы, тома и кэш сборки с долей многоразового
59
- docker run --rm alpine:3 df -h / # сколько осталось у самой виртуальной машины
60
+ docker system df # images, volumes and build cache with the reusable share
61
+ docker run --rm alpine:3 df -h / # how much the virtual machine itself has left
60
62
  ```
61
63
 
62
- Наружу нехватка выходит чужим лицом: контейнер поднимается и сразу гаснет, сверка схемы
63
- отвечает про ненакатываемую цепочку, гейт пуша краснеет целиком. По этим признакам чинят
64
- репозиторий, а причина в машине, — поэтому первое при любом из них `docker system df`.
64
+ The shortage surfaces wearing someone else's face: a container comes up and goes out at once, the
65
+ schema audit answers about a chain that does not apply, the push gate goes red whole. By these
66
+ signs the repository gets fixed, while the cause is in the machine — so the first thing on any of
67
+ them is `docker system df`.
65
68
 
66
- Диск хоста при этом остаётся свободным и говорит «места полно»: сквозной набор упал на
67
- `could not extend file … No space left on device`, когда на хосте было свободно 98 ГБ. Место
68
- меряется у докера, а не у машины.
69
+ The host disk meanwhile stays free and says "plenty of room": the end-to-end suite fell on
70
+ `could not extend file … No space left on device` with 98 GB free on the host. Space is measured
71
+ at docker, not at the machine.
69
72
 
70
- ## Мусор снимается отбором, и чужое из него исключается по метке
73
+ ## Garbage is removed by selection, and what is not yours is excluded by label
71
74
 
72
- Тома переживают свои контейнеры и накапливаются молча: `docker ps` их не показывает, а
73
- `docker system df` считает одной строкой. Копятся они по-разному — контейнер без `--rm`
74
- оставляет том всегда, а `docker run --rm` анонимный том снимает вместе с контейнером сам, и
75
- докручивать к нему `-v` не надо: у `docker run` этот флаг означает монтирование и без значения
76
- команду ломает. Снимает тома `-v` у `docker rm`, а не у `docker run`.
75
+ Volumes outlive their containers and pile up silently: `docker ps` does not show them, and
76
+ `docker system df` counts them as one line. They pile up differently — a container without `--rm`
77
+ always leaves its volume, while `docker run --rm` removes an anonymous volume together with the
78
+ container itself, and adding `-v` to it is not needed: for `docker run` that flag means a mount
79
+ and without a value breaks the command. Volumes are removed by `-v` of `docker rm`, not of
80
+ `docker run`.
77
81
 
78
- Признак своего — отсутствие метки состава: том, заведённый чьим-то `docker compose`, несёт
79
- `com.docker.compose.project` и принадлежит тому проекту, в том числе чужому.
82
+ The sign of one's own is the absence of the compose label: a volume created by someone's
83
+ `docker compose` carries `com.docker.compose.project` and belongs to that project, including
84
+ someone else's.
80
85
 
81
86
  ```bash
82
- docker volume ls -q -f dangling=true | wc -l # сколько накопилось неиспользуемых
87
+ docker volume ls -q -f dangling=true | wc -l # how many unused have piled up
83
88
  for v in $(docker volume ls -q -f dangling=true); do
84
89
  [ -z "$(docker volume inspect "$v" --format '{{index .Labels "com.docker.compose.project"}}')" ] \
85
90
  && docker volume rm "$v"
86
91
  done
87
- docker builder prune --force --filter until=24h # вчерашний кэш ничей, свежий нужен сборке
92
+ docker builder prune --force --filter until=24h # yesterday's cache is nobody's, the fresh one the build needs
88
93
  ```
89
94
 
90
- Порог у кэша, а не полная чистка: снятый целиком, он заставляет следующую сборку идти с нуля.
95
+ A threshold on the cache, not a full cleanup: removed whole, it makes the next build go from
96
+ scratch.
91
97
 
92
- Прогон конвейера, живущий на машине владельца, убирает за собой сам и делает это шагом,
93
- который идёт и при падении: место кончается ровно тогда, когда прогон падает, и уборка,
94
- пропущенная на падении, не случается в тот единственный раз, когда она была нужна.
98
+ A pipeline run living on the owner's machine cleans up after itself, and does it in a step that
99
+ runs on failure too: space runs out exactly when the run fails, and a cleanup skipped on failure
100
+ does not happen the one time it was needed.
95
101
 
96
- Освобождают отбором, а не общей чисткой: у сценария чистки образов сперва спрашивают, что он
97
- снял бы, и только потом дают снимать.
102
+ Space is freed by selection, not by a general cleanup: the image cleanup script is first asked
103
+ what it would remove, and only then allowed to remove.
98
104
 
99
- **Снятие образов отбивает не гейт, а режим захода.** В автоматическом режиме команда с
100
- необратимым удалением — снятие образа, чистка слоёв — отклоняется независимо от разрешений, и
101
- разрешающее правило на ту же команду отказа не снимает. Повторный вызов отбивается так же: отказ
102
- не зависит от того, как команда набрана, поэтому переформулировка тут не путь. Ходов отсюда два —
103
- освободить место тем, что удаления не требует, либо назвать это владельцу: режим переключает он,
104
- и снимает образы тоже он. Названное в конце захода стоит целого прогона: конвейер всё это время
105
- стоит красным по нехватке места.
105
+ **Removing images is refused not by the gate but by the session mode.** In the automatic mode a
106
+ command with an irreversible deletion — removing an image, cleaning layers — is rejected whatever
107
+ the permissions, and an allow rule on the same command does not lift the refusal. A repeated
108
+ call is refused the same way: the refusal does not depend on how the command is typed, so
109
+ rewording is not the way here. Two ways from here — free space by what needs no deletion, or name
110
+ it to the owner: they switch the mode, and they remove the images too. Named at the end of the
111
+ session it costs a whole run: the pipeline stays red all that time for lack of space.
106
112
 
107
- ## Демон поднимается своим CLI
113
+ ## The daemon is brought up by its own CLI
108
114
 
109
- Открытие приложения виртуальную машину не поднимает: приложение считается запущенным, а демон
110
- не отвечает часами. Поднимает только собственная команда клиента, а готовность проверяется
111
- самим демоном:
115
+ Opening the application does not bring up the virtual machine: the application counts as
116
+ running, and the daemon does not answer for hours. Only the client's own command brings it up,
117
+ and readiness is checked by the daemon itself:
112
118
 
113
119
  ```bash
114
120
  docker desktop restart
115
121
  until docker info >/dev/null 2>&1; do sleep 5; done
116
- docker version --format 'демон: {{.Server.Version}}'
122
+ docker version --format 'daemon: {{.Server.Version}}'
117
123
  ```
118
124
 
119
- Состояние, которое печатает приложение, говорит про приложение: оно отвечает «работает» и
120
- тогда, когда демон не принимает ни одной команды. Единственный признак живого демона — ответ
121
- `docker info`. Первые полминуты после подъёма он отвечает ошибкой и пишет в лог, что маршрута
122
- до виртуальной машины нет: это нормальный старт, а не поломка.
125
+ The state the application prints speaks about the application: it answers "running" even when
126
+ the daemon accepts not a single command. The only sign of a live daemon is the answer of
127
+ `docker info`. For the first half a minute after coming up it answers with an error and writes to
128
+ its log that there is no route to the virtual machine: that is a normal start, not a breakage.
123
129
 
124
- ## «Команда висит» — сначала проверяется, вправду ли висит
130
+ ## "The command hangs" — first check whether it really hangs
125
131
 
126
- Вывод не заворачивается в `tail`, `head` и не глушится тихим режимом: они держат его в буфере
127
- до конца команды, и идущая работа выглядит зависшей. Читается прямой вывод:
132
+ Output is not wrapped in `tail`, `head` and not muted by a quiet mode: they hold it in a buffer
133
+ until the command ends, and work in progress looks hung. The direct output is read:
128
134
 
129
135
  ```bash
130
- docker pull alpine:3 # прогресс виден построчно
136
+ docker pull alpine:3 # progress is visible line by line
131
137
  ```
132
138
 
133
- Скачивания не запускаются параллельно. Несколько одновременных забивают канал друг другу:
134
- образ, который тянется за три секунды, шёл полчаса — и это выглядело сломанным демоном, а было
135
- очередью, устроенной проверяющим.
139
+ Downloads are not started in parallel. Several at once choke the channel for each other: an
140
+ image that pulls in three seconds went for half an hour — and that looked like a broken daemon,
141
+ while it was a queue arranged by the one checking.
136
142
 
137
- ## Где рвётся: три яруса
143
+ ## Where it breaks: three tiers
138
144
 
139
- Ярусы проверяются по отдельности, иначе чинится не то. Каждый отвечает секундами:
145
+ The tiers are checked separately, otherwise the wrong thing gets fixed. Each answers in seconds:
140
146
 
141
147
  ```bash
142
- # 1. Сеть машины: реестр отдаёт манифест
143
- curl -s -m 30 -w '%{http_code} за %{time_total}s\n' -o /dev/null '<адрес токена реестра>'
148
+ # 1. The machine's network: the registry gives out the manifest
149
+ curl -s -m 30 -w '%{http_code} in %{time_total}s\n' -o /dev/null '<адрес токена реестра>'
144
150
 
145
- # 2. Сеть контейнеров: объём проходит внутрь
151
+ # 2. The containers' network: volume passes inside
146
152
  docker run --rm alpine:3 sh -c 'time wget -q -O /dev/null <адрес пробы канала>'
147
153
 
148
- # 3. Демон: тянет ли он сам
154
+ # 3. The daemon: does it pull by itself
149
155
  docker pull busybox:latest
150
156
  ```
151
157
 
152
- Хост тянет быстро, контейнер тянет быстро, а скачивание стоит — дело в демоне, и его
153
- перезапускают. Стоят все три — дело в сети машины, и демон ни при чём. Что делал сам демон,
154
- отвечают его логи: ходы к реестру, подъём и состояние, консоль виртуальной машины — три разных
155
- файла в каталоге данных клиента.
158
+ The host pulls fast, the container pulls fast, and the download stands — the daemon is the
159
+ matter, and it is restarted. All three stand — the machine's network is the matter, and the
160
+ daemon has nothing to do with it. What the daemon itself was doing, its logs answer: the calls to
161
+ the registry, the startup and state, the virtual machine console — three different files in the
162
+ client's data directory.
156
163
 
157
- ## Команда из службы: свой каталог настроек и явный адрес демона
164
+ ## A command from a service: its own settings directory and an explicit daemon address
158
165
 
159
- Раннер конвейера запущен службой, и вход в реестр из неё отказывает: пароль сохраняет
160
- системный помощник хранения ключей, а сеанса пользователя у службы нет. Свой каталог настроек
161
- с пустым помощником от этого не спасает — клиент подставляет помощника сам и переписывает
162
- пустое значение молча. Поэтому вход не зовётся вовсе, а пароль пишется в файл настроек прямо:
166
+ The pipeline runner is started as a service, and registry login from it refuses: the password is
167
+ saved by the system keychain helper, and a service has no user session. A settings directory of
168
+ its own with an empty helper does not save it — the client substitutes the helper itself and
169
+ rewrites the empty value silently. So login is not called at all, and the password is written
170
+ into the settings file directly:
163
171
 
164
172
  ```bash
165
173
  export DOCKER_CONFIG="$(mktemp -d)"
@@ -169,87 +177,97 @@ printf '{"auths":{"<реестр>":{"auth":"%s"}}}' "${auth}" > "${DOCKER_CONFIG
169
177
  chmod 600 "${DOCKER_CONFIG}/config.json"
170
178
  ```
171
179
 
172
- `DOCKER_HOST` здесь не для красоты: свой каталог уносит с собой и текущий контекст, а без него
173
- клиент идёт в общесистемный сокет, которого на машине с настольным клиентом нет вовсе, и
174
- отвечает «нет такого файла» на что угодно. Связь проверяется до сборки:
180
+ `DOCKER_HOST` here is not for decoration: a directory of one's own takes the current context with
181
+ it, and without it the client goes to the system-wide socket, which does not exist at all on a
182
+ machine with a desktop client, and answers "no such file" to anything. The connection is checked
183
+ before the build:
175
184
 
176
185
  ```bash
177
- docker info --format 'демон: {{.ServerVersion}}'
186
+ docker info --format 'daemon: {{.ServerVersion}}'
178
187
  ```
179
188
 
180
- Поле у `docker info` называется иначе, чем у `docker version`: имя из второй команды первая не
181
- понимает, и связь выглядит непроверенной, хотя демон отвечает.
189
+ The field in `docker info` is named differently from `docker version`: the first command does not
190
+ understand the name from the second, and the connection looks unchecked though the daemon
191
+ answers.
182
192
 
183
- Что пароль принят, видно по ответу реестра: анонимному он отвечает `401`, авторизованному —
184
- содержимым или `403`, но не `401`. Каталог снимается в конце — раннер живёт между прогонами, и
185
- пароль реестра остался бы лежать на диске владельца.
193
+ That the password is accepted is seen by the registry's answer: to an anonymous one it answers
194
+ `401`, to an authorised one — with content or `403`, but not `401`. The directory is removed at
195
+ the end — the runner lives between runs, and the registry password would stay lying on the
196
+ owner's disk.
186
197
 
187
- ## Права токена спрашиваются до того, как конвейер на них обопрётся
198
+ ## Token rights are asked before the pipeline leans on them
188
199
 
189
- Токен, которым ходят руками, и токен, которым ходит выкатка, — один и тот же ровно до первой
190
- записи в реестр образов: области у него могут кончаться на чтении. Узнаётся это отказом, когда
191
- весь путь выкатки уже написан, поэтому спрашивается раньше — и не догадкой, а заголовком ответа
192
- хостинга:
200
+ The token used by hand and the token the rollout uses are one and the same exactly until the
201
+ first write to the image registry: its scopes may end at reading. This is learned by a refusal
202
+ when the whole rollout path is already written, so it is asked earlier — and not by a guess but
203
+ by the host's answer header:
193
204
 
194
205
  ```bash
195
206
  curl -sI -H "Authorization: Bearer <токен>" '<адрес хостинга>' | grep -i '^x-oauth-scopes:'
196
207
  ```
197
208
 
198
- Первая выкатка, сделанная руками из-за такого отказа, путь выкатки не проверяет — она проверяет
199
- образы. Об этом говорится владельцу прямо: иначе зелёный прод читается как пройденный конвейер.
209
+ The first rollout done by hand because of such a refusal does not check the rollout path — it
210
+ checks the images. This is said to the owner directly: otherwise a green production reads as a
211
+ passed pipeline.
200
212
 
201
- ## Образ собирается под платформу прод-сервера
213
+ ## The image is built for the production server platform
202
214
 
203
- Машина владельца и прод-сервер бывают разной архитектуры. Без явной платформы собирается образ
204
- под сборщика: он уходит в реестр, оттуда на сервер и не стартует там вовсе.
215
+ The owner's machine and the production server can be of different architectures. Without an
216
+ explicit platform the image is built for the builder: it goes to the registry, from there to the
217
+ server and does not start there at all.
205
218
 
206
219
  ```bash
207
220
  docker buildx build --platform <платформа сервера> -f <файл сборки> --output type=cacheonly .
208
221
  ```
209
222
 
210
- `--output type=cacheonly` считает сборку, ничего не сохраняя, — этим замеряют время, не
211
- засоряя машину образом. Чужая платформа идёт эмуляцией, поэтому время сборки на машине и в
212
- облаке сравнивают числом, а не ожиданием.
223
+ `--output type=cacheonly` runs the build without saving anything — that is how time is measured
224
+ without littering the machine with an image. A foreign platform goes by emulation, so build time
225
+ on the machine and in the cloud is compared by a number, not by expectation.
213
226
 
214
- Сборщик с драйвером `docker-container` нужен для чужой платформы и заводится отдельно; его
215
- первый подъём тянет свой образ из реестра:
227
+ A builder with the `docker-container` driver is needed for a foreign platform and is created
228
+ separately; its first startup pulls its own image from the registry:
216
229
 
217
230
  ```bash
218
231
  docker buildx create --name <приставка>-ci-builder --driver docker-container
219
- docker buildx inspect <приставка>-ci-builder --bootstrap # покажет платформы и состояние
220
- docker buildx build --builder <приставка>-ci-builder … # сборщик владельца не переключается
232
+ docker buildx inspect <приставка>-ci-builder --bootstrap # shows the platforms and the state
233
+ docker buildx build --builder <приставка>-ci-builder … # the owner's builder is not switched
221
234
  ```
222
235
 
223
- Сборщик не сносится после прогона: в его кэше живут слои и хранилище пакетов, а без них
224
- следующая сборка тянет все зависимости заново. Флаг `--use` тоже не пишется — он переключает
225
- сборщик владельца; вместо него `--builder` у самой сборки. Объявления сборщиков лежат в
226
- каталоге настроек, поэтому под своим каталогом их не видно вовсе — оставить их на месте
227
- помогает `BUILDX_CONFIG` с адресом каталога владельца.
228
-
229
- Установка зависимостей внутри сборки ограничивается по числу запросов, иначе она роняет сборку
230
- целиком — и не потому, что канал медленный, а потому, что сотни запросов забивают его сами
231
- себе.
232
-
233
- ## Частые промахи
234
-
235
- - **Перезапуск демона объявлен сделанным по состоянию приложения.** Приложение говорит
236
- «работает», а `docker info` в это же время отвечает ошибкой.
237
- - **Стенд не возвращён после перезапуска.** У него политика `no`, и владелец находит мёртвый
238
- порт вместо стенда.
239
- - **Вывод команды заведён в `tail`** — и работающая команда объявлена зависшей.
240
- - **Несколько скачиваний разом** — и медленной объявлена машина, а не собственная очередь.
241
- - **Образ собран без указания платформы** — прод получает образ чужой архитектуры, и видно это
242
- только на перезапуске контейнеров.
243
- - **Свой контейнер занял порт хранилища разработки** — конвейер пишет в данные владельца.
244
- - **Вход в реестр из службы сделан командой входа** — пароль уходит в помощник хранения ключей
245
- даже из своего каталога настроек, и задание падает до сборки.
246
- - **Каталог настроек подменён, а адрес демона не задан** — и починка входа в реестр выглядит
247
- как упавший демон.
248
- - **Сборщик снесён после прогона** — вместе с кэшем, и следующая сборка идёт как первая.
249
- - **Общая чистка ради места** — уносит чужие образы и тома, и восстановить их нечем.
250
- - **Место освобождено сценарием выкатки целиком.** Сценарий писан для прод-сервера: там
251
- собирает конвейер, а сервер только тянет готовое, поэтому последним шагом сценарий сносит
252
- кэш сборщика. На машине владельца собирает раннер, и тот же шаг оставляет сборщика без кэша.
253
- Отбор самих образов у сценария годится и здесь — он идёт по имени своего реестра, оставляет
254
- три последних sha и обходит поднятые контейнеры, — а вот его хвост на этой машине запускают,
255
- только когда согласились ждать полную сборку.
236
+ The builder is not torn down after the run: its cache holds the layers and the package store, and
237
+ without them the next build pulls all dependencies anew. The `--use` flag is not written either —
238
+ it switches the owner's builder; instead of it `--builder` on the build itself. Builder
239
+ declarations lie in the settings directory, so under a directory of one's own they are not
240
+ visible at all — `BUILDX_CONFIG` with the address of the owner's directory helps leave them in
241
+ place.
242
+
243
+ Dependency installation inside the build is limited by the number of requests, otherwise it
244
+ brings the build down whole — and not because the channel is slow, but because hundreds of
245
+ requests choke it for themselves.
246
+
247
+ ## Common misses
248
+
249
+ - **The daemon restart is declared done by the application's state.** The application says
250
+ "running", and `docker info` at the same time answers with an error.
251
+ - **The stand is not brought back after the restart.** Its policy is `no`, and the owner finds a
252
+ dead port instead of the stand.
253
+ - **The command output is fed into `tail`** — and a working command is declared hung.
254
+ - **Several downloads at once** — and the machine is declared slow, not one's own queue.
255
+ - **The image is built without naming the platform** — production gets an image of a foreign
256
+ architecture, and this is visible only at the container restart.
257
+ - **One's own container took the development storage port** — the pipeline writes into the
258
+ owner's data.
259
+ - **Registry login from a service is done by the login command** — the password goes to the
260
+ keychain helper even from a settings directory of one's own, and the step fails before the
261
+ build.
262
+ - **The settings directory is substituted, and the daemon address is not set** — and fixing the
263
+ registry login looks like a fallen daemon.
264
+ - **The builder is torn down after the run** — together with the cache, and the next build goes as
265
+ the first.
266
+ - **A general cleanup for the sake of space** — takes away someone else's images and volumes, and
267
+ there is nothing to restore them with.
268
+ - **Space is freed by the rollout script whole.** The script is written for the production
269
+ server: there the pipeline builds, and the server only pulls the ready-made, so as the last step
270
+ the script tears down the builder cache. On the owner's machine the runner builds, and the same
271
+ step leaves the builder without a cache. The script's selection of the images themselves suits
272
+ here too — it goes by the name of its own registry, keeps the last three sha and skips running
273
+ containers — but its tail on this machine is run only when a full build wait was agreed to.