@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,284 +2,317 @@
2
2
  name: task-flow
3
3
  kind: rule
4
4
  law: work-conduct
5
- description: Правило под «Закон о ведении работы» — ход работы от просьбы владельца до слияния. Брать в начале любой работы, при правке папок задач и договорённостей о продукте, при возвращении к незаконченной задаче. Паттерны: task-flow-start, -resume, -close, -archive. Конец хода — правило turn-conduct.
5
+ description: Rule under the work-conduct law — the course of work from the owner's request to the merge. Load at the start of any work, when editing task folders and product agreements, and when returning to an unfinished task. Patterns task-flow-start, -resume, -close, -archive. End of a turn — turn-conduct.
6
6
  ---
7
7
 
8
- # Ведение работы — как это устроено здесь
9
-
10
- Правило под закон `docs/constitution/work-conduct.md`. Закон говорит, что должно быть верно
11
- про ход работы; здесь — чем это названо в этом дереве, где лежит и что из закона у нас не
12
- проверяется.
13
-
14
- **Холодная часть:** `pitfalls.md` рядом — ловушки и поведение по разборам происшествий.
15
- Грузится по требованию, а не вместе с правилом: при обычном решении она не нужна — она нужна
16
- тому, кто разбирает промах или спорит с гардом.
17
-
18
- **Требует:** `hooks/task-flow-guard.sh`, `hooks/task-flow-draft-guard.sh`, `hooks/task-context-load.sh`, `hooks/grill-gate.sh`, `hooks/window-fill-guard.sh`, `hooks/turn-exit-guard.sh`, `hooks/work-start-guard.sh`
19
-
20
- ## Как это называется здесь
21
-
22
- | В законе | Здесь |
23
- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
24
- | просьба владельца | то, с чего начинается работа; разбирается командой `/grill-me` до первой правки |
25
- | понимание, записанное там, где идёт работа | `docs/tasks/<ветка>/grill.md` — просьба дословно, ответы владельца его словами, решения с доводами |
26
- | замысел | `docs/tasks/<ветка>/plan.md` — след задачи и этапы с признаками готовности; после написания не правится |
27
- | ход работы | `docs/tasks/<ветка>/progress.md` — «Где стоим», решения по ходу, записи заходов; единственное место, где отмечается сделанное |
28
- | договорённость о продукте, записанная до кода | `docs/specs/<домен>/proposed/<фича>/` — спек фичи; переживает мерж и вливается в спек домена |
29
- | эпик — работа шире одной ветки | карточка в очереди работ с меткой эпика и замысел рядом с ней: возможность, состав задач и порядок |
30
- | замысел эпика | запись вне папки задачи: та умирает с мержем, а эпик её переживает; каталог называет компаньон правила |
31
- | папка задачи до заведения задачи | `docs/tasks/_draft-<slug>/` — вне истории, пока номера нет |
32
- | разведка | заход `Explore` или `general-purpose` до первого вопроса владельцу |
33
- | разбор замысла ролями | `.claude/workflows/plan.js` — нужность, договорённость, критика, замысел |
34
-
35
- ## Где это лежит
36
-
37
- В этом дереве — таблица в `implementation.md` рядом. Пути живут там, а не здесь: правило
38
- переносится между репозиториями, раскладка — нет, и путь, названный в правиле, врёт в первом
39
- же дереве, которое держит код иначе.
40
-
41
- ## Состояния работы
42
-
43
- Единица работы — состояние, а не шаг. У состояния есть вход, обязательное действие и выход, и
44
- пока действие не сделано, работа стоит в том же состоянии.
45
-
46
- Состояние объявляется в разделе «Где стоим» хода работы машиночитаемой строкой
47
- ``- **Состояние:** `этап-идёт` `` и перезаписывается вместе с ним.
48
-
49
- | Состояние | Вход в него | Обязательное действие | Ведёт паттерн |
50
- | ------------------------- | ----------------------------------------------- | ------------------------------------------------------ | ------------------ |
51
- | `просьба-не-разобрана` | реплика владельца о новой работе | разведка по дереву, затем вопросы | `task-flow-start` |
52
- | `разбор-закрыт` | ответы владельца лежат на диске | договорённость о продукте либо причина её отсутствия | `task-flow-start` |
53
- | `договорённость-записана` | драфт лежит или причина названа | завести задачу, ветку и папку | `task-flow-start` |
54
- | `задача-взята` | задача в колонке работы, ветка по номеру, папка | написать замысел | `task-flow-start` |
55
- | `замысел-записан` | замысел лежит и после записи не правится | делать первый этап | `task-flow-start` |
56
- | `этап-идёт` | этап начат | доделать этап и отметить в ходе работы | `task-flow-resume` |
57
- | `этапы-кончились` | все этапы отмечены | влить договорённость, привести тексты, прогнать набор | `task-flow-close` |
58
- | `разбор-кончился` | набор зелёный, тексты приведены | разобрать папку последним коммитом | `task-flow-archive` |
59
- | `папка-разобрана` | папки в ветке нет, запись в архиве есть | открыть PR черновиком | `task-flow-close` |
60
- | `работа-отдана` | PR открыт черновиком | взять следующую задачу | `task-flow-resume` |
61
- | `влито` | PR слит человеком | разбор работы правилами и сверка очереди | `task-flow-archive` |
62
-
63
- Ни у одного состояния обязательное действие не звучит как «ждать»: ожидание чужого шага
64
- состоянием работы не считается, поэтому в `работа-отдана` обязательное действие — следующая
65
- задача, а не открытый PR. Блокированная задача следующей не считается: это то же ожидание под
66
- именем работы. Следующая берётся из очереди работ, а очередь спрашивается командой: «задач нет» —
67
- утверждение о дереве, и подтверждается оно выводом, а не памятью исполнителя. Заполнение окна
68
- захода состоянием тоже не бывает: заход кончается передачей, а работа остаётся там, где стояла.
69
- **Открытая карточка о взятости работы не говорит.** Карточку закрывает слияние, и в заходе без
70
- открытия заявок список открытых не убывает. Невзятой задачу делает отсутствие следа в дереве:
71
- открытые номера сверяются с описанием прошлого — на закрытую работу там лежит запись с её номером.
72
- Сверка стоит одной команды и отвечает про обе стороны, список открытых — ни про одну.
73
-
74
- Чем ход кончается — правило `turn-conduct` под тем же законом.
75
-
76
- Перечень показывается владельцу в начале работы, и на нём же отмечается, где стоим.
77
-
78
- Последние два состояния объявить на диске уже нечем: ход работы уезжает вместе с папкой, а папка
79
- разбирается раньше, чем открывается PR. Признак у них в истории ветки — коммит разбора папки, — и
80
- читает его гард, а не строка в файле.
81
-
82
- ## Ход
83
-
84
- Ход работы от просьбы владельца до закрытия: где стоит разбор, что требует гард и куда девается
85
- папка задачи.
8
+ # Work conduct — how it works here
9
+
10
+ Rule under the law `docs/constitution/work-conduct.md`. The law says what must be true about the
11
+ course of work; here — what it is called in this tree, where it lives and what is not checked here.
12
+
13
+ **Cold part:** `pitfalls.md` next to it — traps and conduct from incident analyses. Loaded on
14
+ demand, not with the rule: an ordinary decision does not need it — whoever analyses a miss or argues
15
+ with a guard does.
16
+
17
+ **Requires:** `hooks/task-flow-guard.sh`, `hooks/task-flow-draft-guard.sh`,
18
+ `hooks/task-context-load.sh`, `hooks/grill-gate.sh`, `hooks/window-fill-guard.sh`,
19
+ `hooks/turn-exit-guard.sh`, `hooks/work-start-guard.sh`
20
+
21
+ ## What it is called here
22
+
23
+ | In the law | Here |
24
+ | --- | --- |
25
+ | the owner's request | what work begins with; grilled by the `/grill-me` command before the first edit |
26
+ | understanding written where the work goes | `docs/tasks/<ветка>/grill.md` — the request verbatim, the owner's answers in their words, decisions with reasons |
27
+ | the plan | `docs/tasks/<ветка>/plan.md` — the task footprint and stages with readiness signs; not edited after it is written |
28
+ | the progress | `docs/tasks/<ветка>/progress.md` — "Where we stand", decisions along the way, session entries; the only place where done work is marked |
29
+ | the product agreement written before the code | `docs/specs/<домен>/proposed/<фича>/` — the feature spec; survives the merge and merges into the domain spec |
30
+ | an epic — the unit of delivery | a card in the work queue with the epic label, a branch of its own from the main branch and a plan next to it: the opportunity, the tasks, their order |
31
+ | the epic branch | `<КЛЮЧ>-<номер эпика>-<короткий-slug>`; the branches of its tasks are taken from it, and their PRs go into it |
32
+ | the epic plan | a record outside the task folder: the folder dies with the merge, the epic outlives it; the directory — in the rule's companion |
33
+ | the task folder before the task is created | `docs/tasks/_draft-<slug>/` — outside history while there is no number |
34
+ | exploration | an `Explore` or `general-purpose` session before the first question to the owner |
35
+ | the plan review by roles | `.claude/workflows/plan.js` — need, agreement, critique, plan |
36
+
37
+ ## Where it lives
38
+
39
+ In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
40
+ travels between repositories, the layout does not, and a path named in the rule lies in the first
41
+ tree that keeps its code differently.
42
+
43
+ ## Work states
44
+
45
+ The unit of work is a state, not a step. A state has an entry, a mandatory action and an exit, and
46
+ until the action is done the work stays in the same state.
47
+
48
+ The state is declared in the "Where we stand" section of the progress by the machine-readable line
49
+ ``- **State:** `этап-идёт` `` and is rewritten with it.
50
+
51
+ | State | Entry | Mandatory action | Pattern |
52
+ | --- | --- | --- | --- |
53
+ | `просьба-не-разобрана` | the owner's message about new work | exploration over the tree, then questions | `task-flow-start` |
54
+ | `эпик-заведён` | the epic card, all its tasks and its plan lie in the queue | take the epic branch from the main branch | `task-flow-start` |
55
+ | `разбор-закрыт` | the owner's answers lie on disk | a product agreement, or the reason there is none | `task-flow-start` |
56
+ | `договорённость-записана` | the draft lies, or the reason is named | create the task, the branch from the epic branch, and the folder | `task-flow-start` |
57
+ | `задача-взята` | task in the work column, branch by number, folder | write the plan | `task-flow-start` |
58
+ | `замысел-записан` | the plan lies and is not edited after writing | do the first stage | `task-flow-start` |
59
+ | `этап-идёт` | a stage is begun | finish the stage and mark it in the progress | `task-flow-resume` |
60
+ | `этапы-кончились` | all stages are marked | merge the agreement, bring texts up to date, run the suite | `task-flow-close` |
61
+ | `разбор-кончился` | the suite is green, texts are up to date | take the folder apart by the last commit | `task-flow-archive` |
62
+ | `папка-разобрана` | no folder in the branch, a record in the archive | open the PR as a draft | `task-flow-close` |
63
+ | `работа-отдана` | the PR is open as a draft into the epic branch | take the next task of the epic | `task-flow-resume` |
64
+ | `влито` | the PR merged by a person | rules review of the work and the work queue audit | `task-flow-archive` |
65
+ | `задачи-эпика-кончились` | every task of the epic is merged and its folder taken apart | open the PR of the epic into the main branch | `task-flow-close` |
66
+
67
+ No state has a mandatory action that sounds like "wait": waiting for someone else's step is not a
68
+ work state, so in `работа-отдана` the mandatory action is the next task, not the open PR. A blocked
69
+ task does not count as next: the same waiting under the name of work. The next is taken from the
70
+ work queue, and the queue is asked by a command: "no tasks" is a statement about the tree, backed by
71
+ output, not by the executor's memory. A filled session window is no state either: the session ends
72
+ with a handover, and the work stays where it stood. **An open card says nothing about whether the
73
+ work is taken.** A card is closed by the merge, and in a session that opens no PRs the list of open
74
+ ones does not shrink. A task is untaken when the tree holds no trace of it: open numbers are checked
75
+ against the archive — closed work has a record there with its number. The audit costs one command
76
+ and answers for both sides; the open list answers for neither.
77
+
78
+ What a turn ends with — rule `turn-conduct` under the same law.
79
+
80
+ The list is shown to the owner at the start of work, and where we stand is marked on it.
81
+
82
+ The last two states cannot be declared on disk: the progress leaves with the folder, and the folder
83
+ is taken apart before the PR opens. Their sign is in the branch history — the commit that takes the
84
+ folder apart — and a guard reads it, not a line in a file.
85
+
86
+ ## Flow
87
+
88
+ The course of work from the owner's request to closing: where the grill stands, what the guard
89
+ demands and where the task folder goes.
86
90
 
87
91
  ```mermaid
88
92
  flowchart TD
89
- A[Просьба владельца] --> B[Разведка по дереву — до первого вопроса]
90
- B --> C[Разбор просьбы: шесть обязательных вопросов, ответы ложатся на диск]
91
- C --> D{Правка задевает код приложения}
92
- D -->|Да| E[Пишется договорённость о продукте — до кода]
93
- D -->|Нет| F[В замысле стоит причина, по которой её нет]
94
- E --> Z{Из разбора вышло несколько задач}
93
+ A[The owner's request] --> B[Exploration over the tree — before the first question]
94
+ B --> C[Grill: six mandatory questions, the answers land on disk]
95
+ C --> D{The edit touches application code}
96
+ D -->|Yes| E[A product agreement is written — before the code]
97
+ D -->|No| F[The plan states the reason there is none]
98
+ E --> Z{The epic of this work exists}
95
99
  F --> Z
96
- Z -->|Да| Y[Серия объявляется эпиком: карточкой и замыслом, до первой задачи]
97
- Z -->|Нет| G[Задача, ветка, папка задачи по имени ветки]
100
+ Z -->|No| Y[The epic is declared: a card, all its tasks and a plan — then its branch from the main branch]
101
+ Z -->|Yes| G[Task, branch from the epic branch, task folder by branch name]
98
102
  Y --> G
99
- G --> H[Замысел с этапами; после записи он не правится]
100
- H --> I{Этап сделан}
101
- I -->|Да| J[Отметка в ходе работы — единственном месте, где отмечается сделанное]
103
+ G --> H[A plan with stages; not edited after it is written]
104
+ H --> I{Stage done}
105
+ I -->|Yes| J[A mark in the progress — the only place where done work is marked]
102
106
  J --> I
103
- I -->|Этапы кончились| T[Договорённость вливается в спек домена, тексты приводятся к сделанному, следом прогоняется набор]
104
- T --> N[Папка задачи разбирается последним коммитом: разбор просьбы — в описание прошлого, находки — к замыслу эпика, замысел — прочь]
105
- N --> S[Сверка очереди работ]
106
- S --> K[PR открывается черновиком; исполнитель называет номер, чего ждёт и что сделает следом]
107
- K --> W[Разбор закрытой работы правилами уходит в фон, находки ложатся на диск]
108
- W --> L[Пока PR ждёт разбора, берётся следующая задача]
109
- L --> M{Разбор и прогон кончились}
110
- M -->|Красный прогон или замечания| V[Чинится в той же ветке: замысла на диске уже нет, и признак работы гард берёт из истории ветки]
107
+ I -->|Stages are over| T[The agreement merges into the domain spec, texts are brought up to what was done, then the suite runs]
108
+ T --> N[The task folder is taken apart by the last commit: the grill — to the archive, findings — to the epic plan, the plan — away]
109
+ N --> S[Work queue audit]
110
+ S --> K[The PR opens as a draft; the executor names the number, what it waits for and what comes next]
111
+ K --> W[The rules review of the closed work goes to the background, findings land on disk]
112
+ W --> L[While the PR waits for review, the next task is taken]
113
+ L --> M{Review and run are over}
114
+ M -->|Red run or remarks| V[Fixed in the same branch: the plan is gone from disk, the guard takes the sign of work from the branch history]
111
115
  V --> M
112
- M -->|Зелено и замечаний нет| O[Черновик снимается, слияние нажимает человек]
116
+ M -->|Green and no remarks| O[The draft is lifted, a person presses merge into the epic branch]
117
+ O --> P{Tasks of the epic are left}
118
+ P -->|Yes| G
119
+ P -->|No| Q[The PR of the epic into the main branch opens: every folder is taken apart]
113
120
  ```
114
121
 
115
- ## Как закон применяется здесь
116
- - **Правка кода приложения отбивается, пока работа не дошла до состояния, в котором код
117
- правится.** Гард требует три вещи: папку задачи по имени ветки, замысел в ней и объявленное
118
- состояние. У договорённости о продукте свой гард на те же события.
119
- - **Гард судит объявленный переход, а не наличие файлов.** Пустой замысел лежит так же, как
120
- написанный, поэтому отказ снимает объявленное состояние — `этап-идёт`, `этапы-кончились`,
121
- `разбор-кончился`. Четвёртый путь — история ветки: папка, разобранная её коммитом, означает
122
- отданную работу.
123
- - **Строка состояния, переведённая вперёд, — то же объявление намерения, только машиночитаемое.**
124
- Состояние объявляется тем ходом, в котором его обязательное действие начато делом.
125
- - **Отказ по состоянию называет обязательное действие объявленного состояния.** Услышав только
126
- «не в том состоянии», исполнитель перепишет строку состояния вместо шага.
127
- - **Именем состояния считается только слово из перечня.** Своё слово не говорит ни о входе, ни о
128
- выходе, ни о действии.
129
- - **Два требования — два гарда, и снять одно можно, не теряя второго.** Судят порознь: строка о
130
- неизменном поведении снимает договорённость, а не требование дойти до правки кода.
131
- - **Влитая договорённость ветку не запирает.** После вливания директории «предложено» на диске
132
- нет, а замысел ссылается на неё до конца работы: влитое от незаведённого гард отличает по
133
- истории ветки.
134
- - **Договорённость требуется по путям правки, а не по оценке задачи.** `apps/**` и `libs/**` —
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
- - **Папка задачи разбирается последним коммитом до открытия PR, а не после одобрения.** Человек
163
- вливает, как только видит зелёное, и закрывающему коммиту места не остаётся.
164
- - **Открыв PR, исполнитель называет владельцу номер, чего ждёт и что сделает следом.** Ждёт он
165
- прогона, следом снимает черновик: зелёный прогон говорит, что не сломано, и молчит о
166
- заблокированной кнопке слияния.
167
- - **Просьба о слиянии — отдельный ход, и раньше зелёного прогона её не бывает.** Порядок один:
168
- папка разобрана и запушена → PR открыт черновиком → прогон зелёный → черновик снят →
169
- исполнитель просит влить, называя номер.
170
- - **PR открывается черновиком, а не в конце работы.** До открытия владелец правки не видит, а
171
- открытый PR читается как приглашение влить. Черновик снимается тем ходом, которым исполнитель
172
- говорит, что решение готово.
173
- - **Гард замысла — нижняя граница требования, а не его предел.** Он требует папку только под
174
- правку кода приложения, а статья выше — под любую работу.
175
- - **Указание работать по правилу — это указание делать его шаги, включая меняющие историю.**
176
- Отметка этапа, коммит, пуш и открытие заявки правилом предписаны.
177
- - **Взятая задача ходом не кончается.** Заведение задачи, ветки, колонки и папки — подготовка:
178
- работа переходит в состояние записанного замысла, где действие другое. Гард завершения хода
179
- называет в отказе первый этап.
180
- - **Ожидание одной части этапа остановкой этапа не бывает.** Независимые от ожидаемого части
181
- делаются тем же ходом, а владельцу называется, что сделано и что осталось на его шаг. Отбитая
182
- команда читается так же: сперва делается всё остальное.
183
- - **Находка, сделанная посреди этапа, сверяется с условиями выхода замысла до первой правки.**
184
- Соседство по предмету принадлежности не доказывает: работа над слоем правил и работа над
185
- командами, которые этот слой вызывает, откатываются порознь. Не названная ни одним условием
186
- выхода, находка идёт в раздел о том, чего работа не делает, и заводится задачей.
187
- - **Сделанное отмечается только в ходе работы.** «Где стоим» перезаписывается каждым заходом, а
188
- не дописывается: это первое, что читает следующий заход.
189
- - **Слово для нового понятия ищется в словаре дерева.** Общую часть везёт пакет, предметную
190
- дописывает дерево надстройкой; словарь уезжает в контекст на запуске сессии целиком, поэтому
191
- «не читал» основанием не бывает.
192
- - **Папка задачи заводится черновиком и получает номер командой.** До конца разбора неизвестно,
193
- сколько задач из него выйдет, поэтому номер не бывает первым. Команда переименовывает черновик,
194
- проставляет шапку замысла и снимает с копий шапку раскладки.
195
- - **Брошенный разбор виден.** Черновик старше недели перечисляет сверка очереди.
196
- - **Работа, заказанная словами, становится задачей в очереди тем же ходом.** Даже если делать её
197
- будут не сейчас. Черновик папки очередью не считается: номера нет, знает о нём один заход.
198
- Отложенная работа называет срок; отложенная молча читается как сделанная.
199
- - **Следующая задача берётся из замысла эпика, а список очереди работ спрашивается только там, где
200
- эпика нет.** По списку номеров первая задача чужого эпика неотличима от своей. Кончившийся эпик
201
- называется владельцу тем же ходом, которым берётся работа вне его.
202
- - **Эпик не закрывается по признаку, подтверждённому только чтением.** Проверяемое глазами
203
- называется проверенным лишь вместе с командой и её выводом.
204
- - **Задачи эпика заводятся все разом, тем же ходом, что и сам эпик.** Заведение по одной прячет
205
- объём. Номера возвращаются в раздел порядка той же правкой.
206
-
207
- - **Замысел эпика называет, как стоят ветки его задач, наравне с их порядком.** Расстановок две:
208
- каждая ветка от главной либо стопкой — каждая от предыдущей. Порядок задач об этом не говорит.
209
- Стопка стоит дороже, её цена перечислена в холодной части; записанная в замысле расстановка
210
- становится решением эпика, а не того, кто заводит ветку.
211
- - **Замысел эпика лежит там, где его найдут без сети и после мержа.** Карточка порядка задач не
212
- держит, а папка задачи держала бы его до слияния первой; каталог называет компаньон правила.
213
- Названное владельцем по ходу дописывается туда же тем ходом, каким принято.
214
- - **Сборка по образцу начинается с чтения самого образца, а не пересказа о нём.** Пересказ в
215
- разборе просьбы и в замысле эпика образцом не считается. Повторяемая часть открывается целиком,
216
- обходом каталогов.
217
- - **Что действует на дерево, а не на правку, лежит вне индекса.** Путь к образцу и разрешение
218
- работать вне эпика ветке не принадлежат и живут рядом с передачей захода.
219
- - **Закрытая работа разбирается правилами, и это шаг закрытия, а не отдельная просьба.** Что
220
- грузилось и чего не хватило, видно только заходу, который работу вёл. Разбор кончается правкой
221
- слоя правил или предложением наружу.
222
- - **Разбор закрытой работы уходит в фон, а исполнитель берёт следующую задачу.** Роль работает
223
- своим ходом; сводку собирают до запуска, находки принимают одним ходом.
224
- - **Находки разбора ждут владельца, а в пакет уезжает только сводка наблюдений.** Предложение —
225
- заготовка правки чужого дерева; отправленное без разбора, оно становится работой того, кто его
226
- не заказывал. Сводка отправляется всегда: она говорит, чем пользовались, и мнением не бывает.
227
- - **Дешёвый шаг закрытия идёт раньше дорогого, а прогон — после вливания.** Вливание
228
- договорённости и приведение текстов стоят минуты, прогон — окно захода; прогон до вливания
229
- проверяет то, что в главную не попадёт.
230
- - **Договорённость вливается в спек домена одним из последних коммитов ветки, до открытия PR.**
231
- К этому моменту код написан, привязки известны, и в главной ветке директория `proposed/` не
232
- появляется. Готовые к вливанию перечисляет `npm run check:specs`.
233
- - **Папка закрытой задачи разбирается, а не переносится целиком.** В `docs/archive/` уезжает то, что
234
- объясняет решение; остальное удаляется. Неразобранную ловит сверка очереди.
235
- - **Открытие PR и снятие черновика отбиваются, пока ветка везёт папку своей задачи.** Слияние
236
- нажимает человек на хостинге, где гардов нет: снятый черновик он читает как приглашение.
237
- Судится содержимое ветки, а не рабочее дерево.
238
- - **Ветка, снёсшая папку, обязана прибавить запись в архив.** Снести дешевле, чем разобрать, а
239
- первым уходит разбор просьбы — единственная запись слов владельца.
240
- - **Обход — строка `Task-folder-skip: <причина>` в PR или в самой команде.** Пустая причина обходом
241
- не считается, а сам обход снимает отказ, но не гасит строку сверки очереди.
242
-
243
- ## Чего из закона здесь нет
244
-
245
- Полноту записанного понимания не проверяет ничто: машине видно наличие записи, но не то, что в
246
- ней закрыты все пробелы. То же с вопросом, который стоило задать и не задали, — следа он не
247
- оставляет. Судит оба владелец.
248
-
249
- Гард судит по путям правки, а не по тому, меняет ли работа поведение на самом деле. Своего
250
- признака рефакторингу не заводится: оценку «поведение не меняется» назначал бы тот, кому она
251
- мешает.
252
-
253
- Ничто из самого разбора не проверяется. Разговор с владельцем — не вызов инструмента: гард
254
- видит правку файла и не знает ни о разведке до первого вопроса, ни о шести обязательных, ни об
255
- ответах на них. Пустая таблица проходит так же, как заполненная.
256
-
257
- Понимания текста у гарда разговора нет: второй его признак судит общие слова темы вопроса и
258
- последней реплики владельца, а не смысл. Отказ называет законный ход: назвать то, чего в прежнем
259
- ответе владельца нет.
260
-
261
- Неизменность замысла не стережёт ничто: правка по ходу отличима от первоначальной записи только
262
- по истории.
263
-
264
- Приведение текстов к сделанному не проверяет ничто: что устарело в правиле и в спеке, машине не
265
- видно. Держится это шагом закрытия и следом задачи в замысле. Правило и спек правятся в ветке,
266
- закон — нет: его статья приносится владельцу текстом, а работа идёт дальше без неё.
267
-
268
- Что именно перенесли в архив, не проверяется: гард видит, что папка уехала и что ветка что-то в
269
- архив добавила, а то ли это — судит владелец на ревью.
270
-
271
- Гард папки задачи судит вызов исполнителя, а не кнопку хостинга: человек, вливающий работу со
272
- своей стороны, проходит мимо него молча. На этой половине случаев требование держится оставшимся
273
- шагом, который стоит разделом в теле заявки и произносится вслух.
274
-
275
- Порядок отдачи работы дерево вправе перевернуть надстройкой, и тогда часть шагов пакета перестаёт
276
- исполняться. Какие именно — не считает ничто: шаг, чья механика сломалась тем же решением, в
277
- перечень отменяемого не попадает и продолжает читаться действующим. Держится это чтением обоих
278
- текстов подряд при каждой правке порядка отдачи.
279
-
280
- ## Паттерны
281
-
282
- - `task-flow-start` — разведка, разбор, договорённость, замысел, задача и ветка.
283
- - `task-flow-resume` — возвращение к незаконченной работе новым заходом.
284
- - `task-flow-close` — снятие черновика, вливание договорённости, приведение текстов.
285
- - `task-flow-archive` — разбор папки задачи, переезд в описание прошлого, разбор правилами.
122
+ ## How the law applies here
123
+ - **Editing application code is refused until the work has reached a state in which code is
124
+ edited.** The guard demands three things: a task folder by branch name, a plan in it and a
125
+ declared state. The product agreement has a guard of its own on the same events.
126
+ - **The guard judges the declared transition, not the presence of files.** An empty plan lies the
127
+ same as a written one, so the refusal is lifted by the declared state — `этап-идёт`,
128
+ `этапы-кончились`, `разбор-кончился`. The fourth road is the branch history: a folder taken apart
129
+ by its commit means handed-in work.
130
+ - **A state line moved forward is the same declaration of intent, only machine-readable.** A state
131
+ is declared by the turn in which its mandatory action is begun by deed.
132
+ - **A refusal by state names the mandatory action of the declared state.** Hearing only "wrong
133
+ state", the executor rewrites the state line instead of the step.
134
+ - **Only a word from the list counts as a state name.** A word of one's own says nothing about the
135
+ entry, the exit or the action.
136
+ - **Two requirements — two guards, and one can be lifted without losing the other.** They judge
137
+ apart: a line about unchanged behaviour lifts the agreement, not the requirement to reach the
138
+ code-editing state.
139
+ - **A merged agreement does not lock the branch.** After the merge the "proposed" directory is gone
140
+ from disk, while the plan refers to it to the end: the guard tells merged from never-created by
141
+ the branch history.
142
+ - **The agreement is required by the edit paths, not by an appraisal of the task.** `apps/**` and
143
+ `libs/**` are the sign; rules, texts, tooling and dependencies fall outside it. The bypass is the
144
+ line `**Behaviour:** unchanged — <the reason of the owner>` in the plan; an empty reason is not
145
+ accepted.
146
+ - **What needs the owner's word is taken from a list, not appraised on the spot.** The appraisal
147
+ "this is safe" is assigned by whoever finds it convenient.
148
+ - **A reply to the owner's order begins with the result, not with intent or its justification.** A
149
+ justification under someone else's accepted decision reads as its appraisal. One exception:
150
+ execution stopped by an obstacle — then the obstacle is named.
151
+ - **A session does not start work by itself.** A start needs the owner's word in the same session:
152
+ the handover, the state from the startup hook and an assigned epic say what to do, not whether to
153
+ work. The form of the message is judged: an empty message, one word or one path order no work.
154
+ - **A refusal by an external limiter removes the way, not the task.** It is not the tree's guard and
155
+ names no exit: read as the end of the road, it stops the work whole. The way is taken from the
156
+ guard that already described this fix — a bypass with the reason in the commit body, a mark in the
157
+ observations, a word to the owner — and the task stays the same.
158
+ - **An instruction to work by the progress covers all its steps, including those that change
159
+ history.** Questions are asked about what the progress lacks.
160
+ - **A question written by a past session does not become a question to the owner.** It is addressed
161
+ to the handover's author, and some such questions are closed by a work step.
162
+ - **The owner's instruction holds until they cancel it, and a new fact against it is a line in the
163
+ reply about the cost, not a new question.** Re-asked is what the instruction does not cover. A
164
+ menu where two options of three offer to cancel the owner's decision is that very cancellation.
165
+ - **An answer in the owner's message counts the same as an answer in a document.** A question
166
+ already answered in the conversation is not asked a second time.
167
+ - **The owner's word about the design is a task setting, not a decision.** What they named is
168
+ usually already in the tree under that word — a name on a screen, a spec section, a model field —
169
+ and is checked against them before the edit. Diverged — the owner is asked.
170
+ - **A task folder is created for any work, no exceptions.** An exception with even one lawful form
171
+ is executed as permission. It is created before the first edit.
172
+ - **The task folder goes into the branch by a commit, not lives in one working tree.** Uncommitted,
173
+ it passes edits without refusal, and the refusal comes at the end, when the plan is already gone.
174
+ Outside history one draft without a number is lawful.
175
+ - **The task folder is taken apart by the last commit before the PR opens, not after approval.** A
176
+ person merges as soon as they see green, and no room is left for a closing commit.
177
+ - **After opening the PR, the executor tells the owner the number, what it waits for and what comes
178
+ next.** It waits for the run; next the draft is lifted: a green run says nothing is broken and
179
+ nothing about the locked merge button.
180
+ - **A request to merge is a turn of its own, and it never comes before a green run.** One order:
181
+ folder taken apart and pushed → PR open as a draft → run green → draft lifted → the executor asks
182
+ to merge, naming the number.
183
+ - **The PR opens as a draft, not at the end of the work.** Before it opens the owner sees no edits,
184
+ and an open PR reads as an invitation to merge. The draft is lifted by the turn in which the
185
+ executor says the solution is ready.
186
+ - **The plan guard is the lower bound of the requirement, not its limit.** It demands a folder only
187
+ for an edit of application code; the article above — for any work.
188
+ - **An instruction to work by a rule is an instruction to do its steps, including those that change
189
+ history.** Marking a stage, a commit, a push and opening a PR are prescribed by the rule.
190
+ - **A taken task does not end a turn.** Creating the task, the branch, the column and the folder is
191
+ preparation: the work moves to the written-plan state, where the action is different. The
192
+ turn-exit guard names the first stage in its refusal.
193
+ - **Waiting for one part of a stage is never a stop of the stage.** The parts independent of what is
194
+ awaited are done in the same turn; the owner is told what is done and what is left for their step.
195
+ A refused command reads the same: everything else is done first.
196
+ - **A finding made mid-stage is checked against the plan's exit conditions before the first edit.**
197
+ Nearness of subject proves no belonging: work on the rules layer and work on the commands that
198
+ call it roll back apart. A finding named by no exit condition goes to the section on what the work
199
+ does not do, and is filed as a task.
200
+ - **Done work is marked only in the progress.** "Where we stand" is rewritten by every session, not
201
+ appended: it is the first thing the next session reads.
202
+ - **A word for a new notion is looked up in the tree's glossary.** The package carries the common
203
+ part, the tree appends the subject part by an override; the glossary goes into the context whole
204
+ at session start, so "did not read it" is never a ground.
205
+ - **The task folder is created as a draft and gets its number by a command.** Until the grill ends,
206
+ how many tasks come out is unknown, so the number never comes first. The command renames the
207
+ draft, fills the plan header and strips the layout header from the copies.
208
+ - **An abandoned grill is visible.** A draft older than a week is listed by the work queue audit.
209
+ - **Work ordered in words becomes a task in the queue in the same turn.** Even if it will not be
210
+ done now. A draft folder is not the queue: it has no number, and one session knows of it.
211
+ Postponed work names a date; postponed silently, it reads as done.
212
+ - **Work begins with the epic, and a task outside one is not taken.** Every change belongs to an
213
+ epic: the epic names what the whole is, and the main branch takes that whole or does not take it.
214
+ Work outside an epic exists only by the owner's word about that work, said about that work.
215
+ - **The epic branch is taken before the first task of the epic, not with it.** Taken later, it
216
+ leaves the first task standing on the main branch, and the epic starts as half of itself already
217
+ merged.
218
+ - **The next task is taken from the epic plan, and the work queue list is asked only where there is
219
+ no epic.** By a list of numbers the first task of someone else's epic cannot be told from one's
220
+ own. A finished epic is named to the owner by the same turn that takes work outside it.
221
+ - **An epic is not closed by a sign confirmed by reading alone.** What is checkable by eye is called
222
+ checked only together with a command and its output.
223
+ - **The tasks of an epic are created all at once, by the same turn as the epic itself.** Creating
224
+ them one at a time hides the volume. The numbers return to the order section by the same edit.
225
+ - **A task of an epic is linked to the epic card as a sub-issue, not only named in the plan.** The
226
+ plan and the task body are text, and the board reads neither: on the board a task of an epic looks
227
+ exactly like a task outside one, and the makeup and the share of what is done are assembled by
228
+ hand from the list of open cards. Closed tasks are linked too — the share counts them.
229
+
230
+ - **The epic plan names how the branches of its tasks stand, on a par with their order.** Two
231
+ arrangements, and both live inside the epic: each branch from the epic branch, or a stack — each
232
+ from the previous. The task order says nothing about this. The stack costs more, its price is
233
+ listed in the cold part; the arrangement written in the plan is the epic's decision, not that of
234
+ whoever creates the branch.
235
+ - **The PR of the epic opens when its last folder is taken apart, and not a task earlier.** A folder
236
+ left in the epic branch reaches the main branch with it: what one branch needed becomes the tree's
237
+ for good. Until then the epic branch is not offered to a person at all — the merge button on it
238
+ means the whole epic.
239
+ - **The epic plan lies where it is found without the network and after the merge.** The card does
240
+ not hold the task order, and the task folder would hold it only until the first merge; the
241
+ directory — in the rule's companion. What the owner names along the way is appended there by the
242
+ turn that accepted it.
243
+ - **Building by a sample begins with reading the sample itself, not a retelling of it.** A retelling
244
+ in the grill and in the epic plan is not the sample. The repeated part is opened whole, by walking
245
+ the directories.
246
+ - **What acts on the tree, not on the edit, lies outside the index.** The path to the sample and the
247
+ permission to work outside the epic do not belong to the branch and live next to the handover. A
248
+ number in the permitted list repeats the owner's word, not replaces it.
249
+ - **Closed work is reviewed by the rules, and this is a closing step, not a separate request.** What
250
+ was loaded and what was missing is seen only by the session that led the work. The review ends
251
+ with an edit of the rules layer or a proposal outward.
252
+ - **The review of closed work goes to the background, and the executor takes the next task.** The
253
+ role works in a turn of its own; the digest is gathered before the launch, the findings are
254
+ accepted in one turn.
255
+ - **The review's findings wait for the owner, and only the digest of observations leaves for the
256
+ package.** A proposal is a draft of an edit to someone else's tree; sent unreviewed, it becomes
257
+ the work of someone who did not order it. The digest is always sent: it says what was used and is
258
+ never an opinion.
259
+ - **The cheap closing step goes before the costly one, and the run — after the merge.** Merging the
260
+ agreement and bringing the texts up to date cost minutes, the run costs the session window; a run
261
+ before the merge checks what will not reach main.
262
+ - **The agreement merges into the domain spec by one of the last commits of the branch, before the
263
+ PR opens.** By then the code is written, the bindings are known, and the `proposed/` directory
264
+ never appears in main. What is ready to merge is listed by `npm run check:specs`.
265
+ - **The folder of a closed task is taken apart, not moved whole.** What explains a decision goes to
266
+ `docs/archive/`; the rest is deleted. One not taken apart is caught by the work queue audit.
267
+ - **Opening the PR and lifting the draft are refused while the branch carries its task folder.** A
268
+ person presses merge on the host, where there are no guards: a lifted draft reads to them as an
269
+ invitation. The branch content is judged, not the working tree.
270
+ - **A branch that removed the folder must add a record to the archive.** Removing is cheaper than
271
+ taking apart, and the grill leaves first — the only record of the owner's words.
272
+ - **The bypass is the line `Task-folder-skip: <reason>` in the PR or in the command itself.** An
273
+ empty reason is no bypass, and the bypass lifts the refusal but does not silence the work queue
274
+ audit line.
275
+
276
+ ## What of the law is not here
277
+
278
+ Nothing checks the completeness of the written understanding: the machine sees that a record exists,
279
+ not that it closes every gap. The same for a question worth asking and not asked — it leaves no
280
+ trace. The owner judges both.
281
+
282
+ The guard judges by the edit paths, not by whether the work changes behaviour. A refactoring gets no
283
+ sign of its own: the appraisal "behaviour does not change" would be assigned by whoever it hinders.
284
+
285
+ Nothing of the grill itself is checked. A conversation with the owner is not a tool call: the guard
286
+ sees a file edit and knows nothing of the exploration, the six mandatory questions or the answers.
287
+ An empty table passes the same as a filled one.
288
+
289
+ The conversation guard does not understand text: its second sign judges shared words between the
290
+ question's topic and the owner's last message, not meaning. The refusal names the lawful move: name
291
+ what the owner's earlier answer lacks.
292
+
293
+ Nothing watches the plan's immutability: an edit along the way is told from the original record only
294
+ by history.
295
+
296
+ Nothing checks that the texts match what was done: the machine cannot see what went stale in a rule
297
+ or a spec. This is held by the closing step and the task footprint in the plan. A rule and a spec
298
+ are edited in the branch, a law is not: its article goes to the owner as text, and the work goes on
299
+ without it.
300
+
301
+ What exactly went to the archive is not checked: the guard sees that the folder left and the branch
302
+ added something to the archive; whether it is the right thing the owner judges at review.
303
+
304
+ The task folder guard judges the executor's call, not the host's button: a person merging from their
305
+ side passes it in silence. On that half of the cases the requirement is held by the remaining step:
306
+ a section in the PR body, said aloud.
307
+
308
+ A tree may reverse the hand-in order by an override, and then some package steps stop being
309
+ executed. Which ones — nothing counts: a step whose mechanics broke by the same decision does not
310
+ enter the cancelled list and still reads as in force. This is held by reading both texts in a row on
311
+ every edit of the hand-in order.
312
+
313
+ ## Patterns
314
+
315
+ - `task-flow-start` — exploration, grill, agreement, plan, task and branch.
316
+ - `task-flow-resume` — returning to unfinished work in a new session.
317
+ - `task-flow-close` — lifting the draft, merging the agreement, bringing the texts up to date.
318
+ - `task-flow-archive` — taking the task folder apart, the move to the archive, review by the rules.