@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,97 +2,98 @@
2
2
  name: platform-access
3
3
  kind: rule
4
4
  law: frontend-application
5
- description: Правило под «Закон о фронтовом приложении». Брать, когда правка задевает глобальный объект или среду исполнения — window, globalThis, PLATFORM_ID, localStorage. Называет токены DI и подводные камни отдачи страницы сервером. Под libs/api и apps/api не действует. Паттерн platform-access-di.
5
+ description: Rule under the frontend-application law. Load when an edit touches the global object or the runtime — window, globalThis, PLATFORM_ID, localStorage. Names the DI tokens and the pitfalls of server-side page rendering. Does not apply under libs/api and apps/api. Pattern platform-access-di.
6
6
  ---
7
7
 
8
- # Окружение браузера — как это устроено здесь
8
+ # Browser environment — how it works here
9
9
 
10
- Правило под закон `docs/constitution/frontend-application.md`. Закон говорит, что должно быть
11
- верно; здесь — чем в этом дереве заменяется прямое обращение к глобальному объекту. Состояние
12
- — `angular-patterns`, файл компонента — `component-structure`, стили — `styling-bem`, слой
13
- обращения к серверу — `api-layer`. Все пять под одним законом.
10
+ Rule under the law `docs/constitution/frontend-application.md`. The law says what must be true; here
11
+ — what replaces a direct call to the global object in this tree. State — `angular-patterns`, the
12
+ component file — `component-structure`, styles — `styling-bem`, the server access layer —
13
+ `api-layer`. All five under one law.
14
14
 
15
- Правило про фронт: `libs/api/**` и `apps/api/**` — это NestJS, там своя среда, и ничего из
16
- перечисленного не применяется.
15
+ The rule is about the front end: `libs/api/**` and `apps/api/**` are NestJS, the environment there
16
+ is its own, and nothing of the listed applies.
17
17
 
18
- ## Как это называется здесь
18
+ ## What it is called here
19
19
 
20
- | Прямое обращение | Здесь |
21
- | ---------------------------------------- | -------------------------------------------------- |
22
- | `globalThis.open(...)`, `window.open()` | `inject(WINDOW).open(...)` |
23
- | `globalThis.crypto.randomUUID()` | `inject(WINDOW).crypto.randomUUID()` |
24
- | `isPlatformBrowser(inject(PLATFORM_ID))` | `inject(PlatformService).isPlatformBrowser` |
25
- | `document.defaultView` | `inject(WINDOW)` |
26
- | прямой `document` | `inject(DOCUMENT)` из `@angular/common` — как было |
27
- | инициализация DOM после отрисовки | `afterNextRender()` |
20
+ | Direct call | Here |
21
+ | ---------------------------------------- | ----------------------------------------------------- |
22
+ | `globalThis.open(...)`, `window.open()` | `inject(WINDOW).open(...)` |
23
+ | `globalThis.crypto.randomUUID()` | `inject(WINDOW).crypto.randomUUID()` |
24
+ | `isPlatformBrowser(inject(PLATFORM_ID))` | `inject(PlatformService).isPlatformBrowser` |
25
+ | `document.defaultView` | `inject(WINDOW)` |
26
+ | direct `document` | `inject(DOCUMENT)` from `@angular/common` — as before |
27
+ | DOM initialisation after rendering | `afterNextRender()` |
28
28
 
29
- `WINDOW`, `PlatformService` и `StorageService` приходят из `@rt-tools/core`.
29
+ `WINDOW`, `PlatformService` and `StorageService` come from `@rt-tools/core`.
30
30
 
31
- ## Где это лежит
31
+ ## Where it lives
32
32
 
33
- В этом дереве — таблица в `implementation.md` рядом. Пути живут там, а не здесь: правило
34
- переносится между репозиториями, раскладка — нет, и путь, названный в правиле, врёт в первом
35
- же дереве, которое держит код иначе.
33
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
34
+ travels between repositories, the layout does not, and a path named in the rule lies in the first
35
+ tree that keeps its code differently.
36
36
 
37
- ## Ход
37
+ ## Flow
38
38
 
39
- Ход обращения к среде исполнения: чем берётся глобальный объект, где проверяется среда и что
40
- делается в файле без внедрения зависимостей.
39
+ The flow of reaching the runtime: how the global object is taken, where the environment is checked
40
+ and what is done in a file without dependency injection.
41
41
 
42
42
  ```mermaid
43
43
  flowchart TD
44
- A[Коду нужен глобальный объект или среда] --> B{Где он лежит}
45
- B -->|Класс с внедрением зависимостей| C[Глобальный объект приходит токеном, а не берётся напрямую]
46
- B -->|Чистая функция| D[Окно принимается параметром: внедрения там нет]
47
- C --> E{Нужно знать, где исполняется код}
44
+ A[Code needs the global object or the environment] --> B{Where it lies}
45
+ B -->|A class with dependency injection| C[The global object comes by a token, not taken directly]
46
+ B -->|A pure function| D[The window is taken as a parameter: there is no injection there]
47
+ C --> E{It matters where the code runs}
48
48
  D --> E
49
- E -->|Да| F[Спрашивается служба платформы, а не наличие имени в окружении]
50
- E -->|Нет| G[Работа идёт]
49
+ E -->|Yes| F[The platform service is asked, not the presence of a name in the environment]
50
+ E -->|No| G[Work goes on]
51
51
  F --> G
52
- G --> H{Класс создаётся на подъёме приложения}
53
- H -->|Да| I[Проверяется и отдача страницы сервером: линтер этого не видит]
54
- H -->|Нет| J[Готово]
52
+ G --> H{The class is created at application startup}
53
+ H -->|Yes| I[Server-side page rendering is checked too: the linter does not see it]
54
+ H -->|No| J[Done]
55
55
  I --> J
56
56
  ```
57
57
 
58
- ## Как закон применяется здесь
59
-
60
- - **Глобальный объект приходит токеном `WINDOW`, а не берётся напрямую.** Тип уточняется
61
- приведением к `Window & typeof globalThis`: конструкторы вроде `IntersectionObserver`
62
- объявлены на глобальном объекте, а не на интерфейсе `Window`.
63
- - **Среда проверяется через `PlatformService`, а не через `typeof window`.** Проверка по
64
- наличию глобала верна случайно и ломается на первой же среде, где глобал подставлен.
65
- - **Прямое обращение к глобальному объекту отбивает линтер.** Шестнадцать имён окружения
66
- браузера запрещены на фронтовых деревьях; три места, где прямой доступ осознан, выведены
67
- из-под запрета списком в конфиге, а не отключением в строке.
68
-
69
- ## Чего из закона здесь нет
70
-
71
- Запрет действует на имена, а не на пути к ним: `this.#document.defaultView` линтер пропускает,
72
- потому что глобального имени в такой строке нет. Такое обращение законно — окно там уже пришло
73
- внедрением, — но и настоящий обход выглядел бы так же, и увидеть его можно только чтением.
74
-
75
- Прямой доступ остаётся в трёх местах, и это осознанно: встроенный скрипт против мелькания темы
76
- в `apps/site/src/index.html` (работает до подъёма приложения), обработчик отказа подъёма в
77
- `apps/*/src/main.ts`, и код внутри `page.evaluate` в сквозных спеках — он исполняется в
78
- странице, вне DI. Новое место в этот список не добавляется без явного согласования владельца.
79
-
80
- ## Паттерны
81
-
82
- - `platform-access-di` — готовые инжекты, приведение типа, чистые функции, проверка среды.
83
-
84
- ## Ловушки
85
-
86
- - **Фабрика токена бросает `Window is not available`, если у документа нет `defaultView`.**
87
- Под отдачей страницы сервером `defaultView` есть, и инжект полем класса в root-сервисе
88
- безопасен, но сервис, обязанный работать без DOM вообще, берёт окно внутри метода под
89
- проверкой среды.
90
- - **После правки, добавляющей `WINDOW` в сервис, который создаётся на подъёме, нужна не только
91
- сборка, но и поднятый сервер отдачи страниц.** Сайт — настоящий SSR, и падение видно только
92
- там.
93
- - **Вокруг хранилища проверка среды не нужна:** `StorageService` и так уходит в память вне
94
- браузера, и лишний `if (!isBrowser)` вокруг чтения и записи — мёртвый код.
95
- - **В `*.logic.ts` и `*.util.ts` нет DI:** окно принимается параметром, а инжектит его
96
- вызывающий компонент.
97
- - **Подготавливать состояние сквозной спеки записью в хранилище нельзя:** спека проходит те же
98
- шаги, что и пользователь.
58
+ ## How the law applies here
59
+
60
+ - **The global object comes by the `WINDOW` token, not taken directly.** The type is narrowed by a
61
+ cast to `Window & typeof globalThis`: constructors like `IntersectionObserver` are declared on the
62
+ global object, not on the `Window` interface.
63
+ - **The environment is checked through `PlatformService`, not through `typeof window`.** A check by
64
+ the presence of a global is right by accident and breaks on the first environment where the global
65
+ is stubbed.
66
+ - **A direct call to the global object is refused by the linter.** Sixteen browser environment names
67
+ are banned on the front-end trees; the three places where direct access is deliberate are taken
68
+ out from under the ban by a list in the config, not by a disable on the line.
69
+
70
+ ## What of the law is not here
71
+
72
+ The ban acts on names, not on paths to them: the linter lets `this.#document.defaultView` through,
73
+ because there is no global name in such a line. Such a call is lawful — the window there already
74
+ came by injection — but a real bypass would look the same, and it can be seen only by reading.
75
+
76
+ Direct access remains in three places, and deliberately: the inline script against theme flicker in
77
+ `apps/site/src/index.html` (it runs before the application starts), the startup failure handler in
78
+ `apps/*/src/main.ts`, and the code inside `page.evaluate` in the end-to-end specs — it runs in the
79
+ page, outside DI. A new place is not added to this list without the owner's explicit agreement.
80
+
81
+ ## Patterns
82
+
83
+ - `platform-access-di` — ready-made injects, the type cast, pure functions, the environment check.
84
+
85
+ ## Pitfalls
86
+
87
+ - **The token factory throws `Window is not available` if the document has no `defaultView`.** Under
88
+ server-side page rendering `defaultView` exists, and an inject as a class field in a root service
89
+ is safe, but a service that must work without a DOM at all takes the window inside a method under
90
+ an environment check.
91
+ - **After an edit that adds `WINDOW` to a service created at startup, not only the build is needed
92
+ but also a running page-rendering server.** The site is real SSR, and the failure shows only
93
+ there.
94
+ - **No environment check is needed around storage:** `StorageService` falls back to memory outside
95
+ the browser anyway, and an extra `if (!isBrowser)` around a read and a write is dead code.
96
+ - **There is no DI in `*.logic.ts` and `*.util.ts`:** the window is taken as a parameter, and the
97
+ calling component injects it.
98
+ - **Preparing the state of an end-to-end spec by writing to storage is not allowed:** the spec walks
99
+ the same steps as the user.
@@ -2,163 +2,173 @@
2
2
  name: reuse-first
3
3
  kind: rule
4
4
  law: reuse-first
5
- description: Правило под «Закон о единообразии приложения». Брать перед заведением любого нового экрана, компонента, поля, стора, сервиса, маппера или процедуры: на что опираться и по каким признакам видно, что готовое обошли. Паттерн reuse-first-extend.
5
+ description: Rule under the reuse-first law. Load before creating any new screen, component, field, store, service, mapper or procedure — what to build on, and by which signs it is visible that something ready-made was bypassed. Pattern reuse-first-extend.
6
6
  ---
7
7
 
8
- # Единообразие — как это устроено здесь
8
+ # Uniformity — how it works here
9
9
 
10
- Правило под закон `docs/constitution/reuse-first.md`. Закон говорит, что одинаковые вещи ведут
11
- себя одинаково; здесь — на чём это стоит в этом дереве и чем названо.
10
+ Rule under the law `docs/constitution/reuse-first.md`. The law says that the same things behave
11
+ the same; here — what that stands on in this tree and what it is called.
12
12
 
13
- ## Как это называется здесь
13
+ ## What it is called here
14
14
 
15
- | В законе | Здесь |
16
- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
- | готовое | компоненты кита `@rt-tools/ui-kit-v2` с префиксом `rt-` — сегодня их больше семидесяти — и базовые классы без селектора, наследуемые в `@Component` экрана |
18
- | раскладка страниц, форм и окон | `apps/<app>/src/styles/`, применяется директивами BEM |
19
- | оформление части приложения | файл `.scss` рядом с компонентом |
20
- | отступление, решённое владельцем | маркер `native-ok` с объяснением — комментарием строкой выше или в самой строке |
15
+ | In the law | Here |
16
+ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
17
+ | the ready-made | the kit components of `@rt-tools/ui-kit-v2` with the `rt-` prefix — over seventy today — and selectorless base classes inherited in a screen's `@Component` |
18
+ | the layout of pages, forms and windows | `apps/<app>/src/styles/`, applied with the BEM directives |
19
+ | styling of a part of the application | the `.scss` file next to the component |
20
+ | a departure decided by the owner | the `native-ok` marker with an explanation — a comment on the line above or in the line itself |
21
21
 
22
- ## Где это лежит
22
+ ## Where it lives
23
23
 
24
- В этом дереве — таблица в `implementation.md` рядом. Пути живут там, а не здесь: правило
25
- переносится между репозиториями, раскладка — нет, и путь, названный в правиле, врёт в первом
26
- же дереве, которое держит код иначе.
24
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
25
+ travels between repositories, the layout does not, and a path named in the rule lies in the
26
+ first tree that keeps its code differently.
27
27
 
28
- ## Ход
28
+ ## Flow
29
29
 
30
- Ход заведения нового: с чего начинается работа, где проходит граница между расширением готового
31
- и своим, и чем эта граница держится.
30
+ The flow of creating something new: where the work starts, where the border runs between
31
+ extending the ready-made and writing one's own, and what holds that border.
32
32
 
33
33
  ```mermaid
34
34
  flowchart TD
35
- A[Нужен новый экран, компонент или поле] --> B[Читается готовое: набор приложения, общие основы, соседний экран]
36
- B --> C{Готовое подходит}
37
- C -->|Да| D[Берётся как есть]
38
- C -->|Почти| E[Расширяется там, где живёт, а не клонируется рядом]
39
- C -->|Нет| F{Владелец одобрил своё}
40
- F -->|Да| G[Заводится своё, и это записано решением]
41
- F -->|Нет| H[Спрашивается: свой примитив без слова владельца не заводится]
42
- E --> I[Компонент объявляется тремя файлами, сообщения идут общей шиной]
35
+ A[A new screen, component or field is needed] --> B[The ready-made is read: the application's kit, the shared bases, a neighbouring screen]
36
+ B --> C{The ready-made fits}
37
+ C -->|Yes| D[Taken as is]
38
+ C -->|Almost| E[Extended where it lives, not cloned next to it]
39
+ C -->|No| F{The owner approved one's own}
40
+ F -->|Yes| G[One's own is created, and that is recorded as a decision]
41
+ F -->|No| H[Asked: one's own primitive is not created without the owner's word]
42
+ E --> I[The component is declared in three files, messages go through the shared bus]
43
43
  D --> I
44
44
  G --> I
45
45
  H --> I
46
46
  ```
47
47
 
48
- ## Как закон применяется здесь
49
-
50
- - **Источник вида выбирается по приложению, а не по привычке.** У каждого приложения дерева
51
- своя опора: у публичного сайта — его дизайн-система, у остальных — кит. Перепутанный источник
52
- приносит на экран форму, которой в этом приложении больше нигде нет. Какое приложение на что
53
- опирается, названо в именах дерева.
54
- - **Работа начинается с чтения готового, а не с чистого файла.** Сначала находится опора —
55
- компонент кита, базовый класс, образец в соседнем домене, — потом пишется своё поверх неё.
56
- - **Ограничение, придуманное на месте, проверяется поиском по дереву прежде, чем стать доводом.**
57
- «Так делать нельзя» — утверждение о дереве наравне с прочими, и дерево, где приём уже применён,
58
- отвечает на него одной командой. Названное владельцу до поиска, оно закрывает путь, которым
59
- дерево пользуется каждый день, и вызывает перебор ненужных вариантов: решение «править класс
60
- чужого набора из приложения нельзя» не проверялось, пока образец такой правки лежал в том же
61
- файле — с доводом в соседней строке.
62
- - **Значение интеграции берётся тем же путём, что и соседнее значение той же интеграции.**
63
- Половина интеграции, сделанная как положено, — готовый образец, и стоит он не в чужом домене,
64
- а строкой выше: рядом с зашитым в код идентификатором карты жил её же ключ, приходящий
65
- внедрением. Расхождение соседей — это вопрос «почему один параметр сделан, а второй нет», а не
66
- выбор между тремя способами починить второй. Не ловится оно ничем: значение синтаксически
67
- исправно, линт и сборка зелены, а сверка повторов пару констант под свои признаки не берёт.
68
- - **Свой примитив и своя основа заводятся только с явного одобрения владельца.** Спрашивается
69
- это до того, как написан первый файл.
70
- - **Панель правки записи наследует общую основу, а не собирается своей разметкой.** Тогда она
71
- открывается, закрывается и спрашивает про несохранённое одинаково во всех разделах.
72
- - **Об удаче и об отказе сообщает общая шина, а не своя разметка на экране.** Своё сообщение
73
- расходится с соседним видом, местом и временем показа. Готовое сообщение набора, поставленное
74
- на экран, — та же своя разметка: правило говорит про место показа, а не про тег, и замена
75
- своего абзаца на готовый компонент нарушения не снимает — она снимает признак.
76
- - **Инлайновое сообщение законно там, где панель правки записи остаётся открытой после отказа.**
77
- Держит его основа панели; экран, список и публичная страница к этому месту не относятся.
78
- - **Маркер отступления ставится после чтения инвентаря готового, и прочитанное называется рядом.**
79
- Объяснение при маркере называет компонент кита и то, чего в нём не хватает. Маркер без этого —
80
- не отступление, а глушитель: он снимает признак, ничего не доказав.
81
- - **Проверка не снимается с гейта ради того, чтобы пуш прошёл.** Расхождение закрывается готовым
82
- либо объявляется отступлением в самом коде; надстройка профиля для этого не средство.
83
- - **Компонент объявляется тремя файлами: `.ts`, `.html`, `.scss`.** `template:` и `styles:` в
84
- декораторе, атрибут `style=` и правка размеров через `[ngStyle]` — это стили, до которых не
85
- дотянется ни кит, ни `stylelint`.
86
- - **У компонента экрана вне кита файл стилей по умолчанию пустой.** Раскладка объявлена один
87
- раз в общем слое приложения, а экран её только применяет теми же директивами BEM.
88
- - **Готовое расширяется, а не клонируется рядом.** Недостающий вариант заводится в ките или в
89
- базовом классе, и его видят остальные экраны.
90
- - **Накопленное до гарда сосчитано сплошной проверкой и в список только не растёт.** Признаки у
91
- неё те же, что у гарда, потому что оба читают одни и те же объявленные наборы, а смотрит она
92
- файл целиком: гейт падает на новом месте, старое остаётся числом в сводке.
93
- - **Признаки объявляются деревом, а не зашиты в проверку.** Дерево берёт из rt-tools не всё, и
94
- признак о готовом из пакета, которого здесь нет, отвечает ложно ровно так же, как имя чужого
95
- приложения.
96
- - **Второе значение той же интеграции повторяет свой род, а не соседа по файлу.** У внешней
97
- службы редко один параметр: рядом с ключом стоит идентификатор, рядом с адресом — область, и
98
- первый обычно сделан как положено, а второй остаётся зашитым. Спрашивается при этом не сосед,
99
- а род: где значения этого рода заводят, кто их правит, каким путём они доезжают до сборки.
100
- Сосед бывает сам не переехавшим, и повторение разносит устаревший способ дальше; ближайший
101
- сосед берётся образцом, только когда такого рода в дереве нет вовсе. Зашитое значение не
102
- отбивают ни линтер, ни сборка, ни тест: оно синтаксически исправно и просто не принадлежит
103
- этому дереву — так демонстрационное значение из документации поставщика уезжает в прод-сборку.
104
-
105
- ## Чего из закона здесь нет
106
-
107
- Одинаковый ответ поля ввода на ошибку держит кит: `RtFormControlBase` в этом дереве не
108
- наследует никто, потому что поля берутся его готовыми компонентами. Привязать эту статью
109
- закона здесь не к чему.
110
-
111
- Инлайновый шаблон стоит у одного компонента, и у него же единственный `styles:` — это шапка
112
- админки. `role="alert"` написан руками в шестнадцати шаблонах, а `rt-message` зовёт один
113
- потребитель. Это долг, а не разрешённое отступление.
114
-
115
- ## Паттерны
116
-
117
- - `reuse-first-extend` — что делать, когда готового не хватило: расширить кит, объявить
118
- отступление маркером, снять его.
119
-
120
- ## Признаки, по которым видно, что готовое обошли
121
-
122
- Списком их здесь нет: признак — это запись в файле, а не текст правила и не код проверки. Наборы лежат
123
- при пакете, по файлу на пакет rt-tools, и в каждом только то, что везёт он сам. Дерево называет
124
- нужные ему наборы ключом `reuse.bundles` в настройке проверок и дописывает свои признаки файлом,
125
- названным ключом `reuse.signals`; совпавший ключ замещает пакетный, новый дописывается. Там же
126
- дерево называет директивы своей дизайн-системы — ключом `reuse.kitDirectives`: нативный тег,
127
- несущий такую директиву, из признаков вырезается, потому что источник вида в дереве бывает не
128
- один. Гард на
129
- правке и сплошная проверка читают отсюда оба — разойтись им нечем.
130
-
131
- Что бывает признаком:
132
-
133
- - нативный контрол в шаблоне там, где кит везёт свой;
134
- - отказ, предупреждение или ожидание, собранные руками вместо готового, — признак называет тег,
135
- а решение принимается по месту показа: готовое сообщение на экране закрывает признак, не
136
- закрывая нарушения;
137
- - наложение поверх страницы, объявленное своими стилями, — подложка, порядок слоёв, вращение;
138
- - раскладка, объявленная в файле стилей экрана, а не применённая директивами из общего слоя;
139
- - своя реализация того, что даёт основа кита, вместо наследования;
140
- - имя файла, повторяющее имя китового примитива, вне кита.
141
-
142
- Признак называет свою область: наследование основы и метка класса в точечную правку не попадают,
143
- и признак, судящий их по добавленному тексту, молчит всегда. Признак называет и отмену — образец,
144
- при котором он не срабатывает: основа уже унаследована, готовое уже позвано.
145
-
146
- ## Ловушки
147
-
148
- - **Образец ищется по именам кита, а не по тому, на чём кит написан.** Поиск по именам
149
- библиотеки, поверх которой кит собран, не находит ни одного файла: наложение, портал и окно
150
- закрыты китом и зовутся его именами. Обратное тоже бывает: библиотека стоит прямой
151
- зависимостью, и то, чего кит не закрывает, зовётся в дереве её собственным именем. Прежде чем
152
- решать, что имени в дереве нет, его ищут — переделок из-за этого выходит по две на приём.
153
- - Перенос переизобретением не считается: строку, которая уже лежит в файле, гард из
154
- проверяемого текста вычёркивает, а сверка идёт без отступов — при переезде блок меняет
155
- отступ, оставаясь тем же кодом.
156
- - Ответ, сказанный до чтения образца, образец отменяет: согласованная форма выборки списка
157
- переигрывалась вместе с контрактом через два вопроса после того, как была принята.
158
- - **Набор объявляется по тому, что дерево потребляет, а не по тому, что пакет везёт.** Дерево, в
159
- котором кит написан, а не позван, объявив его набор, получает советы звать кит на файлах самого
160
- кита: признак верен, но обращён не туда. Такое дерево объявляет только те наборы, чьё готовое
161
- оно берёт со стороны.
162
- - **Гард, не получивший ни одного признака, неотличим от гарда, которому нечего отбивать.** Он
163
- говорит об этом сам, и первая же правка в дереве без объявленных наборов это показывает.
164
- Молчание проверки признаком порядка не считается — сначала смотрят, есть ли ей чем судить.
48
+ ## How the law applies here
49
+
50
+ - **The source of look is chosen by application, not by habit.** Every application of the tree
51
+ has its own base: the public site — its design system, the rest — the kit. A mixed-up source
52
+ brings to the screen a shape that exists nowhere else in this application. Which application
53
+ rests on what is named in the tree's names.
54
+ - **Work starts with reading the ready-made, not with a blank file.** First the base is found — a
55
+ kit component, a base class, a sample in a neighbouring domain — then one's own is written on
56
+ top of it.
57
+ - **A restriction invented on the spot is checked by a search over the tree before it becomes an
58
+ argument.** "This is not allowed" is a statement about the tree like any other, and a tree
59
+ where the technique is already applied answers it with one command. Named to the owner before
60
+ the search, it closes a road the tree uses every day and sets off a walk through needless
61
+ options: the decision "a class of a foreign kit cannot be edited from the application" went
62
+ unchecked while a sample of exactly that edit lay in the same file — with the argument on the
63
+ next line.
64
+ - **A value of an integration is taken the same way as the neighbouring value of the same
65
+ integration.** The half of the integration done properly is a ready-made sample, and it stands
66
+ not in a foreign domain but one line above: next to a map id hardcoded in the code lived that
67
+ map's own key, arriving by injection. A divergence between neighbours is the question "why is
68
+ one parameter done and the other not", not a choice between three ways to fix the second.
69
+ Nothing catches it: the value is syntactically valid, lint and build are green, and the
70
+ duplicate audit does not take a pair of constants under its signs.
71
+ - **One's own primitive and one's own base are created only with the owner's explicit approval.**
72
+ This is asked before the first file is written.
73
+ - **The record edit panel inherits the shared base, not its own markup.** Then it opens, closes
74
+ and asks about unsaved edits the same way in every section.
75
+ - **Success and failure are reported by the shared bus, not by one's own markup on the screen.**
76
+ One's own message diverges from the neighbouring one in look, place and time of showing. A
77
+ ready-made kit message placed on the screen is the same own markup: the rule speaks of the
78
+ place of showing, not the tag, and replacing one's own paragraph with a ready-made component
79
+ does not lift the violation — it lifts the sign.
80
+ - **An inline message is lawful where the record edit panel stays open after a failure.** The
81
+ panel base holds it; a screen, a list and a public page have no claim to that place.
82
+ - **The departure marker is set after reading the inventory of the ready-made, and what was read
83
+ is named next to it.** The explanation at the marker names the kit component and what it
84
+ lacks. A marker without that is not a departure but a silencer: it lifts the sign having proved
85
+ nothing.
86
+ - **A check is not taken off the gate so that the push goes through.** A divergence is closed by
87
+ the ready-made or declared as a departure in the code itself; a profile override is no means
88
+ for that.
89
+ - **A component is declared in three files: `.ts`, `.html`, `.scss`.** `template:` and `styles:`
90
+ in the decorator, the `style=` attribute and resizing through `[ngStyle]` are styles that
91
+ neither the kit nor `stylelint` reaches.
92
+ - **A screen component outside the kit has an empty styles file by default.** The layout is
93
+ declared once in the shared layer of the application, and the screen only applies it with the
94
+ same BEM directives.
95
+ - **The ready-made is extended, not cloned next to it.** The missing variant is created in the kit
96
+ or in the base class, and the other screens see it.
97
+ - **What accumulated before the guard is counted by the full check, and the list may only not
98
+ grow.** Its signs are the same as the guard's, because both read the same declared sets, but it
99
+ looks at the whole file: the gate falls on a new place, the old stays a number in the digest.
100
+ - **Signs are declared by the tree, not hardcoded in the check.** The tree does not take
101
+ everything from rt-tools, and a sign about the ready-made of a package that is not here answers
102
+ falsely exactly like the name of a foreign application.
103
+ - **The second value of the same integration follows its own kind, not its neighbour in the
104
+ file.** An external service rarely has one parameter: next to the key stands an id, next to the
105
+ address — a scope, and the first is usually done properly while the second stays hardcoded.
106
+ What is asked is not the neighbour but the kind: where values of this kind are created, who
107
+ edits them, by what road they reach the build. The neighbour may itself be unmoved, and
108
+ repeating it spreads the stale way further; the nearest neighbour is taken as the sample only
109
+ when the tree has no such kind at all. A hardcoded value is refused by neither linter, build nor
110
+ test: it is syntactically valid and simply does not belong to this tree — that is how a demo
111
+ value from the vendor's documentation leaves for the production build.
112
+
113
+ ## What of the law is not here
114
+
115
+ The same response of an input field to an error is held by the kit: nobody in this tree inherits
116
+ `RtFormControlBase`, because fields are taken as its ready-made components. There is nothing here
117
+ to bind this article of the law to.
118
+
119
+ An inline template stands on one component, and the same one has the only `styles:` — the admin
120
+ header. `role="alert"` is written by hand in sixteen templates, and `rt-message` is called by one
121
+ consumer. That is debt, not a permitted departure.
122
+
123
+ ## Patterns
124
+
125
+ - `reuse-first-extend` — what to do when the ready-made was not enough: extend the kit, declare a
126
+ departure with the marker, remove it.
127
+
128
+ ## Signs by which it is visible that the ready-made was bypassed
129
+
130
+ They are not listed here: a sign is a record in a file, not the text of the rule and not the code
131
+ of the check. The sets live with the package, one file per rt-tools package, and each holds only
132
+ what that package ships. The tree names the sets it needs with the key `reuse.bundles` in the
133
+ checks settings and appends its own signs in a file named by the key `reuse.signals`; a matching
134
+ key replaces the package one, a new one is appended. There the tree also names the directives of
135
+ its design system — with the key `reuse.kitDirectives`: a native tag carrying such a directive is
136
+ cut out of the signs, because the source of look in a tree is not always one. The guard on an
137
+ edit and the full check both read from here — they have nothing to diverge by.
138
+
139
+ What counts as a sign:
140
+
141
+ - a native control in a template where the kit ships its own;
142
+ - a failure, a warning or a wait assembled by hand instead of the ready-made — the sign names the
143
+ tag, and the decision is made by the place of showing: a ready-made message on the screen
144
+ closes the sign without closing the violation;
145
+ - an overlay above the page declared with one's own styles — backdrop, layer order, rotation;
146
+ - a layout declared in the screen's styles file instead of applied with directives from the
147
+ shared layer;
148
+ - one's own implementation of what the kit base gives, instead of inheritance;
149
+ - a file name repeating the name of a kit primitive, outside the kit.
150
+
151
+ A sign names its scope: inheriting a base and a class decorator do not land in a spot edit, and a
152
+ sign judging them by the added text is always silent. A sign also names its cancel — a sample
153
+ under which it does not fire: the base is already inherited, the ready-made is already called.
154
+
155
+ ## Pitfalls
156
+
157
+ - **A sample is searched for by the kit's names, not by what the kit is written on.** A search by
158
+ the names of the library the kit is built on finds not one file: the overlay, the portal and the
159
+ window are covered by the kit and called by its names. The reverse happens too: the library is a
160
+ direct dependency, and what the kit does not cover is called in the tree by the library's own
161
+ name. Before deciding that a name is not in the tree, it is searched for — this costs two
162
+ reworks per technique.
163
+ - A move does not count as reinvention: a line already lying in a file is struck out of the
164
+ checked text by the guard, and the comparison goes without indentation — on a move a block
165
+ changes its indent while staying the same code.
166
+ - An answer given before reading the sample is overruled by the sample: the agreed shape of a list
167
+ query was replayed together with the contract two questions after it was accepted.
168
+ - **A set is declared by what the tree consumes, not by what the package ships.** A tree in which
169
+ the kit is written, not called, having declared its set, gets advice to call the kit on the
170
+ kit's own files: the sign is right but pointed the wrong way. Such a tree declares only the sets
171
+ whose ready-made it takes from outside.
172
+ - **A guard that received no sign is indistinguishable from a guard with nothing to refuse.** It
173
+ says so itself, and the first edit in a tree without declared sets shows it. Silence of the
174
+ check does not count as a sign of order — first one looks whether it has anything to judge by.