@rt-tools/agent-kit 0.37.0 → 0.37.1

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 (142) hide show
  1. package/assets/checks/board-pull-state.github.mjs +82 -13
  2. package/assets/checks/board.github.mjs +1 -1
  3. package/assets/checks/check-board.github.mjs +20 -12
  4. package/assets/checks/check-specs.mjs +2 -2
  5. package/assets/checks/epic-table.github.mjs +4 -3
  6. package/assets/checks/lib-common.mjs +10 -2
  7. package/assets/checks/lib-domains.mjs +1 -1
  8. package/assets/checks/lib-manifests.mjs +34 -2
  9. package/assets/checks/push-inputs.mjs +401 -0
  10. package/assets/checks/push-trace.mjs +108 -0
  11. package/assets/checks/rt-kit-checks.config.mjs +17 -2
  12. package/assets/checks/spec-anchors.mjs +4 -4
  13. package/assets/checks/spec-contract.mjs +5 -5
  14. package/assets/commands/next-session.md +3 -1
  15. package/assets/commands/night.md +28 -18
  16. package/assets/defaults/project.sh +37 -8
  17. package/assets/defaults/push.sh +23 -0
  18. package/assets/defaults/turn-map.md +10 -6
  19. package/assets/docs/GLOSSARY.md +1 -1
  20. package/assets/hooks/epic-stop-guard.sh +62 -15
  21. package/assets/hooks/git-guard-push-ahead.sh +31 -1
  22. package/assets/hooks/git-guard-push-marks.sh +173 -29
  23. package/assets/hooks/git-guard-push-tests.sh +22 -3
  24. package/assets/hooks/handoff-entry-guard.sh +2 -2
  25. package/assets/hooks/pre-push.sh +6 -0
  26. package/assets/hooks/push-set.sh +29 -4
  27. package/assets/hooks/task-flow-context.sh +15 -4
  28. package/assets/hooks/task-flow-guard.sh +4 -3
  29. package/assets/hooks/turn-exit-epic.sh +1 -1
  30. package/assets/hooks/turn-exit-guard.sh +8 -8
  31. package/assets/hooks/turn-exit-role.sh +45 -0
  32. package/assets/laws/work-conduct.md +9 -8
  33. package/assets/patterns/autonomous-work-run.md +35 -10
  34. package/assets/patterns/browser-verification-measure.md +10 -20
  35. package/assets/patterns/browser-verification-stand.md +30 -42
  36. package/assets/patterns/doc-style-human.md +0 -6
  37. package/assets/patterns/doc-style-sweep.md +7 -7
  38. package/assets/patterns/doc-style-trace.md +5 -4
  39. package/assets/patterns/doc-style-write.md +7 -7
  40. package/assets/patterns/epic-flow-declare.md +15 -8
  41. package/assets/patterns/git-workflow-commit.github.md +1 -1
  42. package/assets/patterns/git-workflow-freshness.md +12 -11
  43. package/assets/patterns/git-workflow-merge.md +14 -11
  44. package/assets/patterns/git-workflow-migration.md +4 -2
  45. package/assets/patterns/git-workflow-pr-body.github.md +1 -1
  46. package/assets/patterns/git-workflow-pr-ready.md +5 -4
  47. package/assets/patterns/git-workflow-pr.azure.md +91 -25
  48. package/assets/patterns/git-workflow-pr.github.md +17 -19
  49. package/assets/patterns/git-workflow-pr.gitlab.md +75 -29
  50. package/assets/patterns/git-workflow-restart.md +3 -2
  51. package/assets/patterns/git-workflow-stack.md +25 -21
  52. package/assets/patterns/lib-layers-new.md +7 -3
  53. package/assets/patterns/queue-audit-read.github.md +9 -3
  54. package/assets/patterns/spec-driven-domain.md +50 -48
  55. package/assets/patterns/spec-driven-rule.md +18 -19
  56. package/assets/patterns/status-report-table.github.md +1 -1
  57. package/assets/patterns/task-flow-archive.md +14 -34
  58. package/assets/patterns/task-flow-close.md +3 -2
  59. package/assets/patterns/task-flow-graph.needs-graph.md +4 -0
  60. package/assets/patterns/task-flow-handoff.md +4 -4
  61. package/assets/patterns/task-flow-resume.md +56 -20
  62. package/assets/patterns/task-flow-start.md +3 -4
  63. package/assets/patterns/testing-e2e.md +14 -18
  64. package/assets/patterns/testing-unit.md +9 -13
  65. package/assets/patterns/turn-entry-map.md +13 -3
  66. package/assets/pitfalls/autonomous-work.md +15 -0
  67. package/assets/pitfalls/doc-style.md +3 -3
  68. package/assets/pitfalls/git-workflow.github.md +5 -9
  69. package/assets/pitfalls/spec-driven.md +9 -7
  70. package/assets/pitfalls/task-flow.md +14 -25
  71. package/assets/pitfalls/testing.md +11 -12
  72. package/assets/pitfalls/turn-conduct.md +6 -6
  73. package/assets/rules/autonomous-work.md +37 -29
  74. package/assets/rules/browser-verification.md +27 -22
  75. package/assets/rules/dependencies.md +3 -3
  76. package/assets/rules/deploy-flow.azure.md +35 -12
  77. package/assets/rules/deploy-flow.github.md +10 -6
  78. package/assets/rules/deploy-flow.gitlab.md +40 -17
  79. package/assets/rules/doc-style.md +21 -17
  80. package/assets/rules/epic-flow.md +5 -3
  81. package/assets/rules/git-workflow.azure.md +140 -122
  82. package/assets/rules/git-workflow.github.md +7 -8
  83. package/assets/rules/git-workflow.gitlab.md +128 -117
  84. package/assets/rules/queue-audit.github.md +5 -3
  85. package/assets/rules/spec-driven.md +17 -25
  86. package/assets/rules/status-report.md +5 -3
  87. package/assets/rules/task-flow.md +26 -15
  88. package/assets/rules/testing.md +35 -32
  89. package/assets/rules/turn-conduct.md +26 -24
  90. package/assets/templates/rule.md +2 -2
  91. package/lib/cargo-prose.d.ts +2 -1
  92. package/lib/cargo-prose.d.ts.map +1 -1
  93. package/lib/cargo-prose.js.map +1 -1
  94. package/lib/companion.d.ts +0 -5
  95. package/lib/companion.d.ts.map +1 -1
  96. package/lib/companion.js +1 -1
  97. package/lib/companion.js.map +1 -1
  98. package/lib/cost.d.ts +0 -8
  99. package/lib/cost.d.ts.map +1 -1
  100. package/lib/cost.js +4 -4
  101. package/lib/cost.js.map +1 -1
  102. package/lib/hooks-map.d.ts +0 -12
  103. package/lib/hooks-map.d.ts.map +1 -1
  104. package/lib/hooks-map.js +2 -25
  105. package/lib/hooks-map.js.map +1 -1
  106. package/lib/observations-cargo.d.ts +1 -5
  107. package/lib/observations-cargo.d.ts.map +1 -1
  108. package/lib/observations-cargo.js +2 -2
  109. package/lib/observations-cargo.js.map +1 -1
  110. package/lib/observations.d.ts +0 -2
  111. package/lib/observations.d.ts.map +1 -1
  112. package/lib/observations.js.map +1 -1
  113. package/lib/order.d.ts +0 -2
  114. package/lib/order.d.ts.map +1 -1
  115. package/lib/order.js +0 -4
  116. package/lib/order.js.map +1 -1
  117. package/lib/outcomes.d.ts +2 -7
  118. package/lib/outcomes.d.ts.map +1 -1
  119. package/lib/outcomes.js +3 -3
  120. package/lib/outcomes.js.map +1 -1
  121. package/lib/proposals.d.ts +0 -1
  122. package/lib/proposals.d.ts.map +1 -1
  123. package/lib/proposals.js +1 -1
  124. package/lib/proposals.js.map +1 -1
  125. package/lib/shipment.d.ts +2 -11
  126. package/lib/shipment.d.ts.map +1 -1
  127. package/lib/shipment.fixture.d.ts +0 -3
  128. package/lib/shipment.fixture.d.ts.map +1 -1
  129. package/lib/shipment.fixture.js +3 -3
  130. package/lib/shipment.fixture.js.map +1 -1
  131. package/lib/shipment.js +2 -2
  132. package/lib/shipment.js.map +1 -1
  133. package/lib/traits.d.ts +0 -3
  134. package/lib/traits.d.ts.map +1 -1
  135. package/lib/traits.js +2 -2
  136. package/lib/traits.js.map +1 -1
  137. package/lib/variants.d.ts +0 -1
  138. package/lib/variants.d.ts.map +1 -1
  139. package/lib/variants.js +1 -1
  140. package/lib/variants.js.map +1 -1
  141. package/package.json +1 -1
  142. package/assets/checks/signals/ui-kit.json +0 -11
@@ -57,7 +57,7 @@ gathered by reading. A list is good for knowing where to look; a stage is closed
57
57
 
58
58
  ## Entry from a session handover
59
59
 
60
- The handover was written by a past session and lies outside the tree. It is read as an assignment —
60
+ The handover was written by a past session, and no check reads it. It is read as an assignment —
61
61
  and the work is taken up past the rule: the state is not checked, the rule is not loaded, the
62
62
  numbers are taken on trust. The entry from a handover differs from an ordinary session in one thing:
63
63
  everything written in it is checked against the tree, because it was written yesterday.
@@ -72,7 +72,7 @@ The order is short, four steps:
72
72
  3. **The numbers from the handover are recounted** on the current commit. The estimate "twice as
73
73
  much work" was never confirmed by a recount.
74
74
  4. **The next step is taken from the progress**, not from the handover's section about it: the
75
- progress is committed, the handover is not, and they manage to diverge within one session.
75
+ handover retells the progress as it stood at its minute, and the two diverge within one session.
76
76
 
77
77
  What is not in the handover and never will be: the owner's words — they are in the grill; decisions
78
78
  with reasons — they are in the progress; the plan — it is on disk. The handover retells, it does not
@@ -94,6 +94,20 @@ the code edit.
94
94
 
95
95
  ## State `этап-идёт`: the stage is done and marked in the progress
96
96
 
97
+ A large edit that crosses several layers — the contract, the storage, the applications — may be led
98
+ by the role pipeline:
99
+
100
+ ```
101
+ Workflow(name: "feature", args: { task: "<the plan stage>", grill: "docs/tasks/<ветка>/grill.md" })
102
+ ```
103
+
104
+ The pipeline makes a plan of its own, up to six steps: its points role reads the task and epic plans,
105
+ but its own steps do not come from `plan.md`. So it is given one stage of the plan, not the task,
106
+ and its steps are not new stages: the progress marks the steps of the plan as before, and the
107
+ pipeline's acceptance is the readiness sign of that stage. Its goal phase compares the result with
108
+ the whole request of the grill, so for one stage its verdict "goal not met" is expected and is not
109
+ the readiness sign.
110
+
97
111
  The "Where we stand" section is **rewritten**, not appended — it is the first thing the next session
98
112
  reads, and the only thing that survives trimming by size:
99
113
 
@@ -109,13 +123,13 @@ reads, and the only thing that survives trimming by size:
109
123
  - **PR:** not opened yet
110
124
  ```
111
125
 
112
- The PR line is mandatory from the minute the stages are over: between opening the PR and the merge a
113
- day or more passes, and that is where a session breaks off most often. Without it the next session
114
- reads "the last stage, all green" and learns of the open PR only from the branch history or from the
115
- owner — exactly the retelling all of this was set up to cancel:
126
+ The PR line is mandatory from the minute the stages are over and lives while the folder does. The
127
+ folder leaves by the commit before the PR opens, so the line names what the closing still has to do;
128
+ after the opening the PR state is read from the host by its number, and the number is asked of the
129
+ host by the branch. A PR reopened for remarks after the folder left keeps its state in the PR itself:
116
130
 
117
131
  ```markdown
118
- - **PR:** #1396, ждёт разбора · отвечено 3 замечания из 5 · не сделано: снятие черновика
132
+ - **PR:** не открыт · осталось: разбор папки, сверка очереди
119
133
  ```
120
134
 
121
135
  The waiting line carries the owner's standing word about a stop, quoted in « », when they gave
@@ -172,36 +186,58 @@ taken at once, by the same move with which the previous one went to review.
172
186
  Taken, not chosen: the order was assigned at planning and lies in the epic plan. A choice offered to
173
187
  the owner under an assigned order is a request to assign it anew.
174
188
 
175
- Work outside an epic has no plan with an order, and the next is taken from the work queue — by the
176
- same move and with the same ban on choosing aloud. The queue is asked by a command, not by memory of
177
- what the executor created themselves. An empty queue is a statement about the tree, and it is backed
178
- by command output.
189
+ Work outside an epic has no plan with an order, and the next work after it is named by the owner:
190
+ the turn asks them, it does not take a card. The queue is asked by a command, not by memory of what
191
+ the executor created themselves, and what it holds goes into the question. An empty queue is a
192
+ statement about the tree, and it is backed by command output.
179
193
 
180
194
  ```bash
181
195
  # what is assigned next — read in the epic plan, not asked
182
196
  # the state of the tasks — in the work queue: the plan does not know what is closed
183
197
  ```
184
198
 
185
- Only the window fill limit stops the session — then comes the handover, pattern `task-flow-handoff`.
186
- A finished epic is never a reason to stop. Work is taken outside it — from the work queue — and the
187
- owner is told in the same turn that it is the epic that ended, not one of its tasks. It is named
188
- together with the taken work, not instead of it.
199
+ Two things stop the session. The window fill limit — then comes the handover, pattern
200
+ `task-flow-handoff`. And the end of the epic: the turn shows the table of its tasks and waits for
201
+ the owner's word, rule `turn-conduct`. A card of the work queue outside the epic is not an order.
202
+ While the epic is assigned and open, no check refuses taking such a card — this article holds it;
203
+ after the epic's end the epic-end guard refuses it until the owner names the work.
189
204
 
190
205
  **Next move:** an action is done on the next task — a task, a branch or a folder is created. The
191
206
  turn ends after it, not after words about it.
192
207
 
208
+ ## State `влито`: the epic plan learns of the merge
209
+
210
+ A person merged the PR, and the epic plan still names the task as in work. The row moves to merged
211
+ in the branch of the next task, by its first commit: the epic branch carries no edits of its own. A
212
+ lesson the task left for the following ones goes into the section of the plan about what was learned
213
+ along the way, in the same commit. The last task of the epic has no next branch, and the epic branch
214
+ takes no edit of its own: its row stays "handed over", and the body of the epic PR into the main
215
+ branch names its merge.
216
+
217
+ Work begun from cargo that arrived moves its records to "done" in the turn that learns of the merge,
218
+ not at the folder's taking-apart: before the merge the edit is not in the tree, and the mark would
219
+ claim what does not yet lie in main. The keys are taken from the archive and passed whole, as the
220
+ intake read prints them:
221
+
222
+ ```bash
223
+ npm run cargo:mark -- --state fixed \
224
+ --proposal <полный ключ> --proposal <полный ключ> \
225
+ --fix '<чем исправлено: статья правила, гард, проверка, правка кода>'
226
+ ```
227
+
228
+ One fix per call, so the records go in batches by what closed them. The reply is read: "moved 0"
229
+ means nothing moved.
230
+
231
+ **Next move:** the work of the next task goes on — the merge needs no turn of its own.
232
+
193
233
  ## Common misses
194
234
 
195
- - **A session that ended in nothing is recorded too.** Otherwise the next one walks the same road:
196
- "we tried this — it did not work, because" costs one line and saves a whole session.
197
- - **The uncommitted is named outright.** Work lives in the tree for weeks; the line "what lies
198
- unsaved and why" is the only thing that makes it visible while there is no PR.
199
235
  - **Confirmation is command output or a measurement, not a retelling.** "Checked, it works" a
200
236
  session later cannot be told from "it seemed to work".
201
237
  - **A number from the handover and from "Where we stand" is recounted before it gets into any new
202
238
  text.** Not only before splitting the work. Carried into the grill or the progress, it is read by
203
239
  the next sessions as a measurement and checked by nobody else. The handover describes the day it
204
- was written, lies outside the tree, and no check reads it. A count taken unrecounted diverged from
240
+ was written, and no check reads it. A count taken unrecounted diverged from
205
241
  the tree by eight and was found by a counting script, not by reading. The estimate "twice as much
206
242
  work as the previous" costs the same — on the current commit the volumes were almost equal. A
207
243
  recount costs one command, and the text gets its own number.
@@ -167,7 +167,8 @@ first.
167
167
 
168
168
  ### State `договорённость-записана`: a series of tasks is declared an epic
169
169
 
170
- The grill ended with one task — the step is skipped. Several came out, and the order between them
170
+ The grill ended with one task — no epic is declared for it: it goes into the epic in work, or, by the
171
+ owner's word, outside any epic with `--outside-epic`. Several came out, and the order between them
171
172
  matters — the epic is declared and its branch is taken by the pattern `epic-flow-declare`, and the
172
173
  work comes back here with its first task.
173
174
 
@@ -269,7 +270,7 @@ window fill limit, a guard's refusal, a question to the owner or handed-in work
269
270
  begun; a pattern read to the end is not among them.
270
271
 
271
272
  **Next move:** the first stage is done in the same turn, and it is declared closed after its command
272
- from the "Checked by" line has passed.
273
+ from the "Verified by" line has passed.
273
274
 
274
275
  ## Common misses
275
276
 
@@ -281,8 +282,6 @@ from the "Checked by" line has passed.
281
282
  - **One grill produced several tasks — the common part leaves for the epic plan.** The task folder
282
283
  dies with the merge, and the task order outlives it; the directory is named by the rule's
283
284
  companion.
284
- - **The task is created by a command, not by four calls in a row.** The board is not bound to the
285
- repository, and the task gets onto it only by an explicit addition.
286
285
  - **The branch slug is taken from the terminology of the agreement, not from the words of the
287
286
  request.** The agreement is written before the branch, and that is exactly where it drops the
288
287
  owner's word. The task title and the PR title can be fixed; the branch name after the PR opens —
@@ -12,7 +12,7 @@ Pattern of the rule `testing`. What must be true — the law
12
12
 
13
13
  ## When to use
14
14
 
15
- - A test file in `apps/site-e2e/src` or `apps/admin-e2e/src` is being written or edited.
15
+ - A test file of an end-to-end suite of the tree is being written or edited.
16
16
  - A defect visible only on the production configuration needs reproducing.
17
17
  - A stand is being prepared for a run against nginx.
18
18
 
@@ -65,23 +65,22 @@ such a stand the run goes with `BASE_URL`, and with it the locale redirect check
65
65
 
66
66
  ```typescript
67
67
  const ALLOW_RENAME: boolean = process.env['E2E_ALLOW_SLUG_RENAME'] === '1';
68
- test.skip(!ALLOW_RENAME, 'меняет живой адрес объекта: включается E2E_ALLOW_SLUG_RENAME=1');
68
+ test.skip(!ALLOW_RENAME, 'changes the live address of a record: switched on by E2E_ALLOW_SLUG_RENAME=1');
69
69
  ```
70
70
 
71
71
  Switches come in two kinds, and only the first counts as coverage. **A switch by stand state**
72
72
  skips a case the stand never has by design — the scenario is closed, and it needs no mark. **A
73
- switch by environment variable** leaves the test unrun: the scenario behind it is listed as
74
- covered while nothing checks it, and such a scenario carries a partial-coverage mark with a
73
+ switch by environment variable** leaves the test unrun: nothing checks the scenario behind
74
+ it, and such a scenario carries a partial-coverage mark with a
75
75
  reason. Of the three below not one belongs to the first kind: all three are driven by a variable.
76
76
 
77
77
  - A test that irreversibly changes stand data is skipped by default and switched on by its own
78
78
  variable.
79
- - `BEHIND_NGINX` in `home.smoke.spec.ts` is `!!process.env['BASE_URL']`: with it the locale
80
- redirect checks wake. A bare page-serving server does not pass them, and two failures look like
81
- a regression.
82
- - `HAS_ADMIN_SESSION` in `sign-in.ts` — the pair `E2E_ADMIN_EMAIL` and `E2E_ADMIN_PASSWORD`.
83
- - `playwright/no-skipped-test` is switched off in `eslint.config.mjs`: the test switch here is a
84
- technique, not a forgotten `test.skip`.
79
+ - A behind-the-proxy switch is `!!process.env['BASE_URL']`: with it the redirect checks wake. A
80
+ bare page-serving server does not pass them, and the failures look like a regression.
81
+ - A session switch reads the pair of sign-in variables of the stand account.
82
+ - `playwright/no-skipped-test` is switched off in the linter config: the test switch here is a
83
+ technique, not a forgotten `test.skip`. The companion names the tree's switches.
85
84
 
86
85
  ## A redirect code is checked by the answer, not by following it
87
86
 
@@ -131,7 +130,7 @@ been pressed at all. The popup is closed and its absence awaited by the same pai
131
130
 
132
131
  A screen is ready when its data is, not when its heading is. A heading, a month title or a toolbar
133
132
  comes from the template and is drawn before the request answers. A check or a frame that waits for
134
- it reads an empty grid. The wait names a node that exists only with data: a row, a booking, a
133
+ it reads an empty grid. The wait names a node that exists only with data: a row, a record, a
135
134
  selected record.
136
135
 
137
136
  After a change of the window width, layout values come from different sources at different
@@ -149,16 +148,13 @@ polling the very value it measures; a wait for one value proves nothing about an
149
148
  of them. Adding tests pushes old ones into refusal (429): a run of one spec stays green, and only
150
149
  the full set shows it. Each test that opens a new record gets its own client address; the limit
151
150
  itself is not raised for the suite.
152
- - **Take the rendering server port with care:** the developer's stand goes by the same name
153
- `ssr:<rendering port>` through `host-gateway`, and while a foreign process hangs on it, the stand
154
- serves a foreign build.
151
+ - The rendering port and the proxy config mount have their traps — the pattern
152
+ `browser-verification-stand` names them.
155
153
  - There is one browser — chromium; narrow screen — `--project=mobile-chrome`. The error "Executable
156
- doesn't exist" is taken apart in the rule `testing`: the same one comes after a Playwright version
157
- change.
154
+ doesn't exist" is taken apart in the cold part of the rule `testing`: the same one comes after a
155
+ Playwright version change.
158
156
  - Admin tests without a session are skipped silently — the run looks successful, while less than
159
157
  half was checked.
160
- - The nginx config is mounted as a directory, not as a single file: the editor recreates the file,
161
- and the container is left with a truncated copy.
162
158
  - **Not only what the screen requests is substituted, but also what the header requests.** The
163
159
  unread counter is requested on every screen under the header. Without a substitution the real
164
160
  server answers that request, refuses the fake sign-in, the interceptor drops the session, and
@@ -27,12 +27,12 @@ import { describe, expect, it } from 'vitest';
27
27
 
28
28
  ## One `describe` per function
29
29
 
30
- The block name matches the function name word for word; the `it` titles are sentences in Russian,
31
- present tense, about behaviour, not about the internals:
30
+ The block name matches the function name word for word; the `it` titles are sentences in the tree's
31
+ language, present tense, about behaviour, not about the internals:
32
32
 
33
33
  ```typescript
34
34
  describe('applyDayClick', () => {
35
- it('SC-BK-19 — клик по занятому дню ничего не меняет', () => {
35
+ it('SC-BK-19 — a click on a taken day changes nothing', () => {
36
36
  expect(applyDayClick(day('2026-08-12'), selection)).toEqual(selection);
37
37
  });
38
38
  });
@@ -63,16 +63,14 @@ Shared constants (`PRICING`, `BUSY`) lie at the top of the file, at module scope
63
63
 
64
64
  ## A decision is moved into a pure function
65
65
 
66
- The dominant form in this tree: the logic moves into `*.logic.ts`, `*.util.ts` or
67
- `*.calculator.ts` and is checked by a call — without `TestBed`, without substituting dependencies.
68
- Samples — `libs/site/common/booking/util/src/lib/availability-calendar.logic.ts` and
69
- `libs/api/<quote domain>/util/src/lib/quote.calculator.ts`.
66
+ The dominant form: the logic moves into `*.logic.ts`, `*.util.ts` or `*.calculator.ts` and is
67
+ checked by a call — without `TestBed`, without substituting dependencies. The tree's samples are
68
+ named by the companion.
70
69
 
71
70
  ## A procedure is called directly
72
71
 
73
72
  The handler is the `handle` method of the procedure class in the `feature` layer of its domain. The
74
- database double is written by hand; the sample is `FakePrismaClient` in
75
- `libs/api/<booking domain>/feature/src/lib/link-booking.procedure.spec.ts`:
73
+ database double is written by hand; the tree's sample is named by the companion:
76
74
 
77
75
  ```typescript
78
76
  const prisma: FakePrismaClient = new FakePrismaClient();
@@ -127,8 +125,8 @@ nothing.
127
125
 
128
126
  ## Common misses
129
127
 
130
- - A lib without its own `vitest.config.mts`: `nx test <project>` passes green without running a
131
- single file. Before writing the first test in a lib, check that the config is next to it.
128
+ - Before writing the first test in a lib, check that its run config is next to it — why, the cold
129
+ part of the rule `testing` says.
132
130
  - **The compiler import goes into the harness file, not into the spec.** A lib that renders nothing
133
131
  still pulls the framework when its test imports a barrel with a framework service, and the first
134
132
  import fails on JIT. The import goes into the file named in `setupFiles` of the lib's run config:
@@ -137,5 +135,3 @@ nothing.
137
135
  the database and in what order. The double is written by hand.
138
136
  - Do not create your own helpers for assertions: `expect(...).toBe(...)` and `.toEqual(...)`
139
137
  directly.
140
- - A title with a scenario id that does not exist takes `npm run check:specs` down, while the tests
141
- themselves stay green.
@@ -39,9 +39,19 @@ done in such a place in general. Read first, the map answers a question the sess
39
39
  yet.
40
40
 
41
41
  ```bash
42
- # the handover — by the name of the current branch, not by picking from the directory
43
- handoff="$ROOT/${RT_HANDOFF_DIR:-.claude/handoff}/$(git branch --show-current).md"
44
- [ -r "$handoff" ] && { printf 'HANDOVER OF THE PAST SESSION\n\n'; cat "$handoff"; }
42
+ # the handover — by the name of the current branch, not by picking from the directory:
43
+ # first the section of the progress, the file outside the tree only where there is no section
44
+ branch="$(git branch --show-current)"
45
+ progress="$ROOT/${RT_TASKS_DIR:-docs/tasks}/$branch/progress.md"
46
+ handoff="$ROOT/${RT_HANDOFF_DIR:-.claude/handoff}/$branch.md"
47
+ section="$([ -r "$progress" ] && LC_ALL=C awk '$0 == "## Handover of the session" ||
48
+ $0 == "## Передача захода" { on = 1; next }
49
+ on && /^## / { on = 0 } on' "$progress")"
50
+ if [ -n "$section" ]; then
51
+ printf 'HANDOVER OF THE PAST SESSION\n\n%s\n' "$section"
52
+ elif [ -r "$handoff" ]; then
53
+ printf 'HANDOVER OF THE PAST SESSION\n\n'; cat "$handoff"
54
+ fi
45
55
 
46
56
  # the map — as its own file, not parsed out of the rule
47
57
  [ -r "$map" ] && { printf 'TURN MAP\n\n'; cat "$map"; }
@@ -0,0 +1,15 @@
1
+ # Autonomous work — cold part
2
+
3
+ Pitfalls: traps already stepped on. Loaded not with the rule but on demand — an ordinary
4
+ decision does not need it.
5
+
6
+ The rule is `autonomous-work`; the articles that hold the law stand there.
7
+
8
+ ## Pitfalls
9
+
10
+ - **A branch created from the base by habit is fixed by re-creating it while the work has not
11
+ gone far.** The pattern names the miss; later the branches collide in shared files.
12
+ - **A task postponed without a line in the list is lost.** In the morning it is seen neither on the
13
+ board nor in the branches: it looks simply not taken.
14
+ - **A default written in the commit body does not reach the owner.** They read the list and the task
15
+ folder, not the branch history.
@@ -12,8 +12,8 @@ The rule is `doc-style`; the articles that hold the law stand there.
12
12
  matches, and the executor names the difference — one line: "did it not the way you said, here
13
13
  is how and why". Silence holds exactly until the request has to be repeated, and the price is
14
14
  trust in the whole report.
15
- - **Remaining work is not written into a document; it is filed as a task.** `docs/BACKLOG.md`
16
- keeps only what never becomes a task: agreements and decisions that were decided not to change.
15
+ - **Remaining work is not written into a document; it is filed as a task.** A backlog file, where
16
+ the tree keeps one, holds only what never becomes a task: agreements and decisions that were decided not to change.
17
17
  The test — the statement stays if nobody intends to change it. "Do later" in a plan, a README or
18
18
  a spec is a second work list: it drifts from the board silently, and sorting it out later costs
19
19
  more than filing a task right away. Of a 1411-line document, 71 lines turned out to be current,
@@ -34,7 +34,7 @@ The rule is `doc-style`; the articles that hold the law stand there.
34
34
  written here" table is purged by grep over the whole tree, not by proofreading. The form is set precisely: "spec" — the
35
35
  document — also inflects into the other forms, and legitimate matches by the stem outnumber the
36
36
  violations; the search is for phrases ("no spec for …", "the spec checks"), not the stem.
37
- - **A dropped name is purged by one grep over the whole tree:** rules, their mirrors in skills,
37
+ - **A dropped name is purged by one grep over the whole tree:** rules, their companions,
38
38
  documents and comments. A description of what the code no longer has reads as a current
39
39
  instruction.
40
40
  - **A dropped word's second meaning is restored after the blanket replacement, not worked around
@@ -104,9 +104,9 @@ The rule is `git-workflow`; the articles that hold the law stand there.
104
104
  one was not checked by a single line: it has zero steps because it never started. Restarting
105
105
  such a run is refused by the guard until the step's output has been read in the same turn —
106
106
  which is why the audit line names reading the run first.
107
- - **The same merge of the main branch done a third time in one session stops the work.**
107
+ - **The same merge of the base done a third time in one session stops the work.**
108
108
  Branches that append a line to the same list drop each other into a conflict at every merge,
109
- and merging main round after round is a fix of the symptom. On the third round the cause is
109
+ and merging the base round after round is a fix of the symptom. On the third round the cause is
110
110
  named and the owner is asked, instead of a fourth round.
111
111
  - **An empty file sent as the PR body wipes the description of the work whole.** That is how an
112
112
  edit of the body assembled by a chain went: a change into the temporary files directory took
@@ -215,7 +215,7 @@ a guard.
215
215
  - **A set rewritten as lines looks complete.** In one tree six checks lay next to the ones being
216
216
  run and were run by neither the gate nor the pipeline: eight lines out of fourteen read as the
217
217
  whole set, and the difference showed only by comparison with the package default.
218
- - **The gate set is never narrower than the pipeline set.** Twice in a row an edit that passed the
218
+ - **A green gate read as "everything is green locally".** Twice in a row an edit that passed the
219
219
  gate whole was refused by the pipeline — and both times a green gate was read as "everything is
220
220
  green locally". Hence the requirement to refuse the push on a step missing from the set, rather
221
221
  than print a warning next to it.
@@ -225,8 +225,8 @@ a guard.
225
225
  not by memory.
226
226
  - **Union of the sides on the shared index file.** Before the declaration the same line was
227
227
  resolved six times in six branches in one session. One cannot promise "no more conflicts" by
228
- the declaration: there will be no manual work, but merging main into open branches after every
229
- merge will still be needed.
228
+ the declaration: there will be no manual work, but the host still marks such a branch conflicting. Whether
229
+ the dispute is real is checked by a merge without the driver — pattern `git-workflow-stack`.
230
230
  - **What was created is visible only to its creator.** Sixteen tasks were created twice this way,
231
231
  and a PR was named to the owner by a number that did not exist for him: the restricted account
232
232
  saw its own, and the hosting answered "not found" to everyone else.
@@ -261,10 +261,6 @@ a guard.
261
261
  package default loses exactly the checks the package will add in its next edition. One's own
262
262
  line instead of the default is lawful where it covers the same thing more strictly or calls the
263
263
  named script.
264
- - **A draft whose branch carries the task folder means work in progress, not abandoned work.**
265
- Both signs are needed together: a green run on the tip without the folder taken apart says the
266
- work is not handed over yet. A tree that named no machine account does not get this audit at
267
- all.
268
264
  - **The mergeability mark is not cleared even by a declared union of both sides.** The hosting
269
265
  counts the union as its own device and reads no merge settings: until the branch has absorbed
270
266
  main and that has reached the hosting, the PR stands conflicting with the divergence resolved
@@ -7,12 +7,13 @@ The rule is `spec-driven`; the articles that hold the law stand there.
7
7
 
8
8
  ## Pitfalls
9
9
 
10
- - **Do not create `tasks.md` in a spec.** Steps are a session artefact; their place is the branch
11
- or the PR description. As soon as "steps" appear in the directory, the spec becomes a plan
12
- again and dies after the merge.
10
+ - **Do not create `tasks.md` in a spec.** Steps are a session artefact; their place is the plan in
11
+ the task folder. As soon as "steps" appear in the directory, the spec becomes a plan
12
+ again and is out of date after the merge.
13
13
  - **A spec describes what is settled, not what is coming.** The only place where it speaks of the
14
- future is `proposed/<feature>/`. After the rollout its text merges into the domain spec, the
15
- directory is removed, the scenario identifiers do not change.
14
+ future is `proposed/<feature>/`. Its text merges into the domain spec by one of the last
15
+ commits of the branch, before the PR opens; the directory is removed, the scenario identifiers
16
+ do not change.
16
17
  - **Nothing checks the semantics of fields.** The check knows procedure names, failure codes and
17
18
  the link between scenarios and tests; what an empty field means, it does not know. So a
18
19
  `.proto` edit pulls in the specs of every domain whose procedures it touched, in the same
@@ -21,8 +22,9 @@ The rule is `spec-driven`; the articles that hold the law stand there.
21
22
  mention anywhere is enough for the symbol — in someone else's field with the same name, in a
22
23
  markup attribute. The place where the rule is actually carried out is confirmed only by
23
24
  reading the code.
24
- - **An anchor in `tools/*.mjs` is checked by almost nothing:** liveness is counted only for
25
- `.ts`, and the sources are walked over `apps`, `libs` and `prisma`. So a rule bound to a check
25
+ - **An anchor in `tools/*.mjs` is checked by almost nothing:** liveness is judged only for
26
+ a symbol declared in `.ts`; callers are looked for in `.ts` and `.html` under the roots the tree
27
+ names. So a rule bound to a check
26
28
  is read together with the check's body.
27
29
  - **A green check does not mean the structure is right.** Sidecars with bindings first lay next
28
30
  to the laws, and the check was green precisely because the structure matched what the check
@@ -22,9 +22,9 @@ The rule is `task-flow`; the articles that hold the law stand there.
22
22
  forbids the permitted work as many times as branches are created before the merge. The refusal
23
23
  names the file and is silent about the record belonging to the branch. While the permission lives
24
24
  in the repository, the number is appended in every new branch.
25
- - **The name of another tree is not written into repository files, but the path to a sample is.**
26
- Both things live next to the session handover for exactly that reason: a full path is lawful
27
- there, and in the repository — only a reference without the name.
25
+ - **The name of another tree is not written into repository files, and the full path to a sample
26
+ carries it.** So the full path lives in the directory of records that belong to no branch, where
27
+ it is lawful, and the repository holds only a reference without the name.
28
28
  - **The line "Waiting for the owner" in the progress outlives the reason it was written for.** It
29
29
  lies on disk, enters the context in the next session and reads as the current state — so it is
30
30
  removed in the same turn in which the owner answered. Otherwise the wait confirms itself: three
@@ -75,12 +75,6 @@ The rule is `task-flow`; the articles that hold the law stand there.
75
75
  session questions the owner anew. The draft got its name from the words of the request, the branch
76
76
  from the terminology of the agreement; the same words, yet not the same.
77
77
 
78
- - **Waiting on one part of a stage is never a stop of the stage.** The parts that do not depend on
79
- what is awaited are done in the same turn: to say "acceptance is pending" and touch nothing else
80
- is a stop of the whole work for a reason that applies to a tenth of it. The rule speaks of the
81
- task, and "one part is pending" is read by it as "the work is pending" — of five parts of a stage,
82
- one was waiting.
83
-
84
78
  - **A line with a path is never an assignment.** An address names a file, not an action; read as an
85
79
  instruction, it gives the session work the owner did not ask for. The same with any line without a
86
80
  verb: asking what to do with it is cheaper than writing fifty files past the request.
@@ -146,9 +140,9 @@ The rule is `task-flow`; the articles that hold the law stand there.
146
140
  prescribes it.
147
141
 
148
142
 
149
- - **The work queue does not end with the epic.** An epic occupied by other executors or finished
150
- means the next task from the queue, not a stop: "no free tasks in the epic" is never an answer to
151
- "what to do", because it is the queue that answers that question, not the epic. It is asked by the
143
+ - **A task of the epic that is not free is not the end of the epic.** Tasks taken by other executors
144
+ leave the epic going on, and the next free task of the same epic is taken; a finished epic is a
145
+ stop with the table of its tasks, rule `turn-conduct`. Which tasks are left is asked by the
152
146
  command, not recalled from the handover: a statement in the handed-over text describes the tree
153
147
  and the day it was written in.
154
148
  - **A closing step of the work does not count as taking the next task.** Moving the task being
@@ -161,9 +155,9 @@ The rule is `task-flow`; the articles that hold the law stand there.
161
155
  passes afterwards.
162
156
  - **A stack of branches costs more, and its price is named.** A PR into a neighbouring branch does
163
157
  not start the pipeline declared for the main base; merging the base closes the next PR as merged
164
- although its edits are not in main; a conflict is resolved anew in every branch of the stack.
165
- Tasks that follow one another in code lawfully live as branches from main, as long as the next
166
- edit does not rest on the code of the previous one.
158
+ although its edits are not in the epic branch; a conflict is resolved anew in every branch of the
159
+ stack. Tasks that follow one another in code lawfully live as branches from the epic branch, as
160
+ long as the next edit does not rest on the code of the previous one.
167
161
 
168
162
  - **A find in the middle of a stage feels like part of the current work when the subject is
169
163
  adjacent.** It has no sign of its own: before the first edit the find is not in the tree, and
@@ -171,10 +165,6 @@ The rule is `task-flow`; the articles that hold the law stand there.
171
165
  conditions is checked, not the feeling — otherwise the two pieces of work lose their separate
172
166
  rollback.
173
167
 
174
- ## Executor behaviour — from incident analyses
175
-
176
- Moves out of the rule in the next task of the epic.
177
-
178
168
  ## What stood in the articles
179
169
 
180
170
  Cases and numbers that used to stand next to the rule's articles. No edit decision rests on them:
@@ -248,11 +238,11 @@ they are for whoever investigates a miss or argues with a guard.
248
238
  - **A run placed as the first closing step eats the session window.** It costs more than all the
249
239
  other steps together: the one who spent it hit the fill threshold on four binding lines — on work
250
240
  that would have taken a minute had it come first.
251
- - **Permission to work outside the assigned epic belongs to the working tree, not to the branch.**
252
- Written into a repository file, it leaves with the branch: from a neighbouring one it is
253
- invisible, and the epic guard refuses exactly the work the owner permitted. Its place is next to
254
- the session handover. The list is filled by the executor and permitted by the owner: a number
255
- written in by oneself is not a permission.
241
+ - **Permission to work outside the assigned epic lies in the main branch, not in a task branch.**
242
+ Written into a task branch, it leaves with that branch: from a neighbouring one it is invisible,
243
+ and the epic guard refuses exactly the work the owner permitted. Its place is the table of
244
+ assignments in the main branch. The row repeats the owner's word: a number written in by oneself
245
+ is not a permission.
256
246
  - **A task moved to another epic is removed from the previous one's set in the same turn.** The move
257
247
  is two motions, and done by half it leaves the task in two sets at once: the epic looks unclosed
258
248
  with all its work done. The total is written where the set is edited: postponed, it is written
@@ -263,6 +253,5 @@ they are for whoever investigates a miss or argues with a guard.
263
253
  cards, one card at a time.
264
254
  - **The task order says nothing about how the branches stand**, and the numbers of the created
265
255
  tasks return to the order section by the same edit.
266
- - **A finished epic is named to the owner by the same turn that takes work outside it.**
267
256
  - **A retelling of a sample in the grill and in the epic plan is not the sample.**
268
257
  - **The review of closed work ends with an edit of the rules layer or a proposal outward.**
@@ -14,8 +14,9 @@ The rule is `testing`; the articles that hold the law stand there.
14
14
  decision was written for never fired once. The input shape is taken from the boundary where
15
15
  the decision is called — the procedure, the service, the handler — and checked against it, not
16
16
  invented next to the test.
17
- - **A green `nx test <project>` does not mean a single file was executed.** A lib without its own
18
- `vitest.config.mts` runs nothing — that is how the tests of the booking domain never ran once.
17
+ - **A green `nx test <project>` does not mean a single file was executed.** A lib with neither
18
+ its own `vitest.config.mts` nor a `test` target on the Angular builder runs nothing — that is
19
+ how the tests of one domain never ran once.
19
20
  A lib with a config but without a single `*.spec.ts` passes green because of
20
21
  `passWithNoTests: true`, which usually stands in every config of the tree, and by eye the two
21
22
  cases are indistinguishable: in both the run succeeds. The share of libs without a single test
@@ -23,7 +24,7 @@ The rule is `testing`; the articles that hold the law stand there.
23
24
  two thirds. Before an edit in an unfamiliar lib, check whether it has at least one
24
25
  `*.spec.ts`; if not, the first one is created by that same edit, not postponed: there is
25
26
  nothing to postpone from, the debt is already accumulated. The count:
26
- `for d in $(find libs -name vitest.config.mts -exec dirname {} \;); do
27
+ `for d in $(find libs -name project.json -exec dirname {} \;); do
27
28
  [ -z "$(find "$d" -name '*.spec.ts')" ] && echo "$d"; done | wc -l`.
28
29
  - **A green coverage summary does not mean the tests pass.** The audit reads test titles and
29
30
  matches them to the spec's scenarios; whether a test executes and how it ends, it does not know
@@ -37,28 +38,26 @@ The rule is `testing`; the articles that hold the law stand there.
37
38
  browser is installed for a specific version, and after a bump a repeated
38
39
  `npx playwright install chromium` is needed. Nine tests failed this way, and it looked like a
39
40
  regression of the upgrade.
40
- - **The first run right after installing the browser cannot be trusted.** Two failures of the
41
+ - **A failure in the first run after installing the browser is not written off to the install.** Two failures of the
41
42
  end-to-end set repeated neither in a separate run of the same tests nor in a second full one.
42
- Such a run is repeated, and conclusions are drawn from the second.
43
+ The output of the first run is read before anything else: a failure that does not repeat in a
44
+ separate run is still a flaky test, not a green one — the next pitfall.
43
45
  - **A rerun through the push gate repeats the whole set, not the failed test.** The gate runs
44
46
  what the tree's profile listed, whole and from scratch: for the end-to-end set that is minutes,
45
- and every push attempt costs them anew. The neighbouring pitfall holds exactly up to this
46
- point: repeating is cheap — through the gate it no longer is, and "repeat" turns into "push
47
+ and every push attempt costs them anew. A separate rerun of one test is cheap — through the gate
48
+ it no longer is, and "repeat" turns into "push
47
49
  until it passes". So the full set is run by hand before the push call, and the gate only
48
50
  confirms what is already known. A test that failed in the full set and passed in a separate
49
51
  run does not count as green: it is a flaky test, and it is filed as a task in the same turn.
50
52
  Running until green carries the sign away together with the failure, and the next session
51
53
  meets the same thing as news — with nothing to tell someone else's flakiness from its own
52
54
  regression: both cases look the same.
53
- - An end-to-end test that needs a login is skipped silently without credentials in the
54
- environment — in the summary it is listed as `skipped`, and the run looks successful. The
55
- variable names are with the tree.
56
55
  - **The flows reference creates no second scenarios.** `docs/E2E_<DOMAIN>_FLOWS.md` holds what is
57
56
  not and must not be in the domain spec: the elements' `qa-dataid`, markup states, stand
58
57
  pitfalls. Promised behaviour stays a scenario in `scenarios.md`: copied into a second place,
59
58
  the copies diverge silently — `npm run check:specs` will not see it.
60
- - `npx nx serve` does not count as a check: it is a step from the `browser-verification` rule,
61
- not a test.
59
+ - A dev server does not count as a check: the rule `browser-verification` checks on the
60
+ production build behind the tree's proxy.
62
61
  - **A frame that depends on machine load checks the machine, not the layout.** Waiting by a timer
63
62
  ends exactly there: on a free machine the set is green whole, on a busy one it fails, and which
64
63
  frame did not make it is a matter of chance. It is cured by waiting for an event, not by
@@ -74,12 +74,12 @@ The rule is `turn-conduct`; the articles that hold the law stand there.
74
74
  simple — a lawful question is about what the executor does not know, and this one is about
75
75
  what they do not feel like.
76
76
 
77
- - **The exit guard judges a change to the tree, not the remaining action.** It asks whether
78
- anything at all was done in the turn — and a turn in which half of a stage is closed and the
79
- other half dropped on a refused command is indistinguishable to it from full work: there are
80
- commits, the tree changed. It catches only a turn that ended in nothing. Whether the state
81
- still holds an action not depending on what the turn waits for is checked by the attention of
82
- whoever leads the turn.
77
+ - **The exit guard judges a change to the tree and the plan steps, not what the stage holds beyond
78
+ them.** It asks whether anything at all was done in the turn — and a turn in which half of a stage
79
+ is closed and the other half dropped on a refused command is indistinguishable to it from full
80
+ work: there are commits, the tree changed. It counts the plan steps not done, not what the stage
81
+ still holds outside them. Whether the state still holds an action not depending on what the turn
82
+ waits for is checked by the attention of whoever leads the turn.
83
83
  - **A refused permission is never someone else's step, and it does not stop the work.** The
84
84
  article about someone else's step is written about what runs by itself and ends without the
85
85
  executor: a run, a review, a merge. A permission refused by the environment does not end by