@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
@@ -18,31 +18,44 @@ Pattern of the rule `autonomous-work`. What must be true — the law
18
18
 
19
19
  ## The chain of branches
20
20
 
21
- The first work branches from main, each next one — from the previous:
21
+ The first work branches from the epic branch — or from main where the work has no epic — each
22
+ next one from the previous:
22
23
 
23
24
  ```bash
24
- git checkout -b <КЛЮЧ>-<номер-1>-<slug> main # the first of the night
25
+ git checkout -b <КЛЮЧ>-<номер-1>-<slug> <база> # the first of the night
25
26
  git checkout -b <КЛЮЧ>-<номер-2>-<slug> <КЛЮЧ>-<номер-1>-<slug>
26
27
  git checkout -b <КЛЮЧ>-<номер-3>-<slug> <КЛЮЧ>-<номер-2>-<slug>
27
28
  ```
28
29
 
29
30
  The merge order is from the bottom up, and it is named in the morning list by numbers. A branch
30
- created from main in the middle of the chain will collide with its neighbour in shared files —
31
+ created from the base in the middle of the chain will collide with its neighbour in shared files —
31
32
  indexes, counters, journals — and the owner will be the one to sort it out.
32
33
 
33
34
  ```bash
34
- git log --oneline --graph --decorate main..HEAD | head -20 # what the chain stands on now
35
+ git log --oneline --graph --decorate <база>..HEAD | head -20 # what the chain stands on now
35
36
  git branch --list '<КЛЮЧ>-*' --format='%(refname:short) %(upstream:short)'
36
37
  ```
37
38
 
39
+ The base moved during the night — it is merged into the previous branch locally, and only then the
40
+ next one is created. Taking the base fresh instead breaks the chain:
41
+
42
+ ```bash
43
+ git fetch origin
44
+ git merge-base --is-ancestor origin/<база> <прошлая ветка> || {
45
+ git checkout <прошлая ветка> && git merge origin/<база>
46
+ }
47
+ git checkout -b <КЛЮЧ>-<номер>-<slug> <прошлая ветка>
48
+ ```
49
+
38
50
  ## The cycle of one piece of work
39
51
 
40
52
  ```bash
41
53
  npm run task:move -- <номер> in-progress # taken
42
54
  git checkout -b <КЛЮЧ>-<номер>-<slug> <прошлая ветка> # a chain, not a fan
43
- cp -r docs/tasks/_template docs/tasks/<КЛЮЧ>-<номер>-<slug>
55
+ dir="${RT_TASKS_DIR:-docs/tasks}/<КЛЮЧ>-<номер>-<slug>"
56
+ mkdir -p "$dir" && cp "${RT_TASKS_DIR:-docs/tasks}"/_template/*.md "$dir"/
44
57
  # the grill with defaults, the plan, the state «этап-идёт»
45
- git add docs/tasks/<КЛЮЧ>-<номер>-<slug> && git commit # the folder goes into history at once
58
+ git add "$dir" && git commit # the folder goes into history at once
46
59
  # work by stages: each ends with a commit and a run of the readiness sign
47
60
  # the folder is taken apart into the archive by the last commit
48
61
  ```
@@ -69,7 +82,19 @@ A task that needs the owner's word is not taken: its state on the board stays as
69
82
  line goes into the morning list.
70
83
 
71
84
  ```markdown
72
- - **RT-<номер> — <заголовок>.** Отложена: <какой вопрос и почему умолчания у него нет>.
85
+ - **<КЛЮЧ>-<номер> — <заголовок>.** Отложена: <какой вопрос и почему умолчания у него нет>.
86
+ ```
87
+
88
+ A task stopped halfway — by red that cannot be fixed or by a question — goes back to its former
89
+ column, and its line says the branch is not merged:
90
+
91
+ ```bash
92
+ npm run task:move -- <номер> <прежняя колонка>
93
+ ```
94
+
95
+ ```markdown
96
+ - **<КЛЮЧ>-<номер> — <заголовок>.** Остановлена: <что красное или какой вопрос>. Ветка
97
+ `<ветка>` не вливается; следующая работа идёт от `<последняя зелёная>`.
73
98
  ```
74
99
 
75
100
  ## The morning list
@@ -79,7 +104,7 @@ Appended along the way, after each closed piece of work, not assembled at the en
79
104
  ```markdown
80
105
  | Работа | Ветка | Чем подтверждена | Чего ждёт |
81
106
  | ------ | ----- | ---------------- | --------- |
82
- | RT-… — <что сделано> | `<ветка>` (на `<предыдущей>`) | `<команда>` — <вывод> | заявки и слияния |
107
+ | <КЛЮЧ>-… — <что сделано> | `<ветка>` (на `<предыдущей>`) | `<команда>` — <вывод> | заявки и слияния |
83
108
  ```
84
109
 
85
110
  The order of rows is the merge order. Below the list — the postponed tasks with their questions.
@@ -96,8 +121,8 @@ night ends with work, not with an argument with the guard.
96
121
 
97
122
  ## Common misses
98
123
 
99
- - **The branch was created from main by habit.** The chain breaks silently, and the cost surfaces
100
- for the owner at the second merge.
124
+ - **The branch was created from the base by habit.** The chain breaks silently, and the cost
125
+ surfaces for the owner at the second merge.
101
126
  - **A default was taken and not written down.** In the morning it cannot be told from knowledge,
102
127
  and the owner learns of it only when the work was done wrong.
103
128
  - **A task was taken and postponed halfway.** On the board it is in progress, in the branch — half
@@ -22,10 +22,8 @@ Pattern of the rule `browser-verification`. What must be true — the law
22
22
  `getComputedStyle`, `getBoundingClientRect`, contrast, matching centres, landing in the viewport.
23
23
  "Looks fine" is never a check result.
24
24
 
25
- A measurement answers only the question asked. A match on the listed properties says nothing about a
26
- rule that is not in the measured list. The rows of the profile popup matched the reference by
27
- padding, font size and rounding, while the reference paints no hover background there at all — a
28
- full-width highlight held on for two rounds with correct numbers. If the reference sources are
25
+ A measurement answers only the question asked: a match on the listed properties says nothing about
26
+ a rule that is not in the measured list — the case is in the rule. If the reference sources are
29
27
  available, the divergence is found by reading, and the measurement stays a check of the result.
30
28
 
31
29
  The look of an element that today is visible on no screen is not confirmed by a measurement, and a
@@ -86,7 +84,10 @@ is not one value but the number of nodes with an unexpected one.
86
84
 
87
85
  A measurement at one width per call gives numbers from different minutes: between calls the page
88
86
  is redrawn, and they cannot be compared. So the widths are run as a batch in one pass — each lives
89
- in its own frame, and the measurement is taken from all of them at once:
87
+ in its own frame, and the measurement is taken from all of them at once. The widths are the tree's
88
+ layout thresholds, both sides of each; the numbers below are a sample, not the set. A sweep that
89
+ will be repeated goes into an end-to-end test — the rule says why; the driver looks at a screen
90
+ once:
90
91
 
91
92
  ```javascript
92
93
  await (async (address, widths, row) => {
@@ -136,9 +137,6 @@ side of itself in the frame.
136
137
  iframe of the needed width — inside it `matchMedia` counts from the frame; at `width: 375px` and
137
138
  `border: 2px` the inner `innerWidth` equals 371.
138
139
 
139
- Changing the number of elements in a container is a layout edit: it is checked at 375, not only by
140
- response codes.
141
-
142
140
  ## An input event is not replaced by a faked value
143
141
 
144
142
  **Scrolling set by assignment gives no event.** The scroll value changes, but the subscriber does
@@ -177,9 +175,10 @@ The order is this: the call puts the walk into a page variable and ends at once,
177
175
  calls ask that same variable whether it is done.
178
176
 
179
177
  ```javascript
178
+ const THRESHOLDS = [/* the tree's layout thresholds, both sides of each */];
180
179
  globalThis.__probe = { done: false, rows: [] };
181
180
  (async () => {
182
- for (const w of [375, 480, 481, 768, 769, 1080, 1081, 1380]) {
181
+ for (const w of THRESHOLDS) {
183
182
  globalThis.__probe.rows.push(await measureWidth(w));
184
183
  }
185
184
  globalThis.__probe.done = true;
@@ -193,18 +192,9 @@ summary looks not cut off but absent — output gathered in one pass and printed
193
192
  shorter than it is. So what was gathered stays in the variable whole, and is printed in slices by
194
193
  index.
195
194
 
196
- ## Router behaviour is reproduced by clicks
197
-
198
- Substituting the address, `history.pushState` with `popstate` and entering by a direct link raise
199
- the application anew, and it has no accumulated state — no open outlet, no guard of the previous
200
- panel. A clean pass over the addresses reads as "the defect is not confirmed": the event feed panel
201
- got stuck on the very first click from the menu and passed the check by addresses three times.
202
-
203
195
  ## Common misses
204
196
 
205
197
  - A comment in a config is a hypothesis like any other. A claim about eviction of a cache record
206
198
  held on through three rounds of adversarial code review and was refuted by one `curl`.
207
- - The conclusion "no defect, it is the cache" closes the investigation, so it is accepted only
208
- after a check on a clean build.
209
- - A defect in a client chunk from a compilation before the edit looks like a defect in the code:
210
- the sign of a dev build is bundle names without a hash.
199
+ - Router behaviour checked by addresses, a cache taken for the cause, a stale client chunk — the
200
+ rule's pitfalls name all three.
@@ -2,10 +2,10 @@
2
2
  name: browser-verification-stand
3
3
  kind: pattern
4
4
  rule: browser-verification
5
- description: Pattern of rule browser-verification. Load when an honest stand is needed — the production build of the site, the admin stand, a stand behind real nginx, signing in to the admin, finding out what sits on a port. Not for layout measurements — that is pattern browser-verification-measure.
5
+ description: Pattern of rule browser-verification. Load when a stand from the production build is needed — the build of the site, the admin stand, a stand behind real nginx, signing in to the admin, finding out what sits on a port. Not for layout measurements — that is pattern browser-verification-measure.
6
6
  ---
7
7
 
8
- # An honest stand
8
+ # A stand from the production build
9
9
 
10
10
  Pattern of the rule `browser-verification`. What must be true — the law
11
11
  `docs/constitution/verifiability.md`.
@@ -37,17 +37,14 @@ Before the first request, not after a puzzling answer:
37
37
  lsof -nP -iTCP:$API_PORT -sTCP:LISTEN
38
38
  ```
39
39
 
40
- A built artifact from a past session regularly hangs on the intake port
41
- (`node -r dotenv/config dist/apps/api/main.js`): it answers 200 with old code, and the procedure
42
- created in the branch it does not have at all. There may be several such processes, and all of
43
- them must be killed — by PID from `lsof`, each one: `pkill` by the pattern `nx serve api` hits none
44
- of them.
40
+ A built artifact from a past session on the intake port answers 200 with old code — the rule's
41
+ pitfall names it; it is killed by PID from `lsof`, each process, not by a command-name pattern.
45
42
 
46
43
  ## Production build of the site
47
44
 
48
45
  ```bash
49
- npx nx build site
50
- PORT=$SITE_STAND_PORT node dist/apps/site/server/server.mjs
46
+ npx nx build <site project>
47
+ PORT=$SITE_STAND_PORT node <built site server entry>
51
48
  ```
52
49
 
53
50
  This is not a dev server: the guard catches `nx|ng serve`, package runners and static servers, and
@@ -61,7 +58,7 @@ apart from the one under check.
61
58
  ## Admin stand
62
59
 
63
60
  ```bash
64
- npx nx build admin --base-href=/
61
+ npx nx build <admin application> --base-href=/
65
62
  ```
66
63
 
67
64
  Without `--base-href` the stand serves an empty page with no errors in the console. A stand that
@@ -84,9 +81,7 @@ production account, and there is never one on a local stand. Where there is no i
84
81
  stand itself substitutes the sign-in answer: the application's path stays the same as a person's.
85
82
 
86
83
  The token is not signed by hand and not put into browser storage by hand: put there so, it checks
87
- the screen while bypassing the live sign-in path — that is, it answers the wrong question. Asking
88
- a person to type a password, open a tab or press a button means a wrongly chosen path, not a lack
89
- of rights on the executor's side.
84
+ the screen while bypassing the live sign-in path — that is, it answers the wrong question.
90
85
 
91
86
  **Ask for the work mode, not for the input.** Input into the password field is refused by the
92
87
  classifier of automatic mode: it judges the action itself and does not tell addresses apart — a
@@ -104,7 +99,7 @@ it fills the same field without the classifier, but the bypassed ban is lifted n
104
99
  but from all of them at once. Normal mode left on removes confirmation from every later action of
105
100
  the session too, so the return is part of the sign-in, not a separate clean-up.
106
101
 
107
- The owner's stand is never a fallback path: it builds the main branch and says nothing about the
102
+ The owner's stand is never a fallback path: it builds its own branch and says nothing about the
108
103
  edit in the working tree.
109
104
 
110
105
  ## API stand
@@ -113,8 +108,8 @@ The built artifact is raised on a free port, not on the intake port: there the o
113
108
  answers, and its environment is not the one under check.
114
109
 
115
110
  ```bash
116
- npx nx build api
117
- env -u JWT_SECRET NODE_ENV=production API_PORT=$API_STAND_PORT DATABASE_URL=… node dist/apps/api/main.js
111
+ npx nx build <api project>
112
+ env -u JWT_SECRET NODE_ENV=production API_PORT=$API_STAND_PORT DATABASE_URL=… node <built api entry>
118
113
  ```
119
114
 
120
115
  Environment variables are set in the command itself, one per case under check. A refusal at start-up
@@ -134,16 +129,17 @@ signing in — a hand-written one hides a divergence in the set of claims.
134
129
 
135
130
  ## A stand behind real nginx
136
131
 
137
- Cache, redirects and headers live in `deploy/nginx.conf`, not in the application. Any conclusion
138
- about `301`, `Cache-Control` and `X-Cache-Status` is drawn only here:
132
+ Cache, redirects and headers live in the tree's proxy config, not in the application; the
133
+ companion names its files. Any conclusion about `301`, `Cache-Control` and `X-Cache-Status` is
134
+ drawn only here:
139
135
 
140
136
  ```bash
141
137
  docker run -d --name <prefix>-stand-nginx \
142
138
  --add-host api:host-gateway --add-host ssr:host-gateway \
143
139
  -p $PROXY_SITE_PORT:80 -p $PROXY_ADMIN_PORT:8081 \
144
- -v "$PWD/deploy/nginx/main.conf:/etc/nginx/nginx.conf:ro" \
145
- -v "$PWD/deploy:/etc/nginx/conf.d:ro" \
146
- -v "$PWD/dist/apps/admin/browser:/usr/share/nginx/html/admin:ro" \
140
+ -v "$PWD/<main proxy config>:/etc/nginx/nginx.conf:ro" \
141
+ -v "$PWD/<proxy config directory>:/etc/nginx/conf.d:ro" \
142
+ -v "$PWD/<built admin directory>:/usr/share/nginx/html/admin:ro" \
147
143
  nginx:1.27-alpine
148
144
  ```
149
145
 
@@ -151,8 +147,8 @@ docker run -d --name <prefix>-stand-nginx \
151
147
  the container is left with a truncated copy, and `nginx -t` inside falls on "unexpected end of
152
148
  file" while the file outside is whole. Cured by recreating the container, not by editing the
153
149
  config.
154
- - The main config is substituted by a separate line: it lies in `deploy/nginx/`, not next to
155
- `nginx.conf` — a file with the `.conf` extension in the mounted directory would get into
150
+ - The main config is substituted by a separate line and lies outside the mounted directory — a
151
+ file with the `.conf` extension in the mounted directory would get into
156
152
  `include` and bring nginx down on the `user` directive. Without it the stand comes up on the
157
153
  image's config, and the connection limit per worker there is its own.
158
154
  - A foreign `Host` is refused by the **dev server**, not by the built application: the production
@@ -162,7 +158,7 @@ docker run -d --name <prefix>-stand-nginx \
162
158
  pointed at the site port resets the cache past the process that keeps the redirect table in
163
159
  memory — and a working mechanism looks broken.
164
160
 
165
- ## A stand lives exactly as long as the check
161
+ ## A stand is stopped when the check ends
166
162
 
167
163
  A stand is raised for one conclusion and is not needed after it. Abandoned, it hinders nothing and
168
164
  gives no signal. It has its own name, a free port, it takes almost no room — it can be seen only by
@@ -188,17 +184,16 @@ git worktree add ../<prefix>-base <commit> # the task branch is not touched
188
184
  pnpm install --frozen-lockfile # from ../<prefix>-base: its node_modules are its own
189
185
  ```
190
186
 
191
- - For comparison take not the main branch but the last commit on which the tree builds: main is
192
- sometimes broken, and then "before" and "after" differ not because of the edit. Whether a commit
193
- builds is checked by building, not by its being in the main branch.
187
+ - For comparison take not the tip of the base branch but the last commit of it on which the tree
188
+ builds: the base is sometimes broken, and then "before" and "after" differ not because of the
189
+ edit. Whether a commit builds is checked by building, not by its being in the base.
194
190
  - The stand of the second tree is raised on its own ports: the site, admin and intake ports are
195
191
  taken by the owner, and the rendering port must not be taken — the developer's stand goes by the
196
192
  name `ssr:<rendering port>`.
197
193
  - Both stands are kept up at the same time — exactly until the comparison ends: comparing from
198
194
  memory between two launches, you notice only what you managed to remember. With the comparison
199
195
  done, the stand of the second tree is torn down by the same move, not left until the end of the
200
- session. Stands left behind pile up across sessions and hold connections to the storage, and the
201
- rule says so in a pitfall. Teardown refused — the stand is named to the owner at the end of the
196
+ session — why, the rule says in a pitfall. Teardown refused — the stand is named to the owner at the end of the
202
197
  session by name, with the port.
203
198
 
204
199
  ## The state of the ports is taken before the first build of the session
@@ -223,25 +218,18 @@ past session, and it answers 200 with old code.
223
218
  than the check — a whole set of layout checks was left unrun exactly because the build was
224
219
  deemed dangerous without measuring. A build from the cache is not a measurement: it builds
225
220
  nothing at all, and that is visible by its duration.
226
- - Do not raise your own dev server: the site, the admin and the intake are already up by the
227
- owner, and a second instance is refused by the guard.
228
- - **A refused static server is read as a ban on the check, while it is a pointer to the right
229
- move.** It may not serve what was built not out of caution: the application calls its own
230
- origin, and a deep link answers `404`. From here one goes not to bypass the guard but to the
231
- tree's proxy with its real config.
221
+ - Do not raise your own dev server where the tree says the owner raises them: the applications are
222
+ already up, and a second instance is refused by the guard.
232
223
  - **The owner's dev server is a place to look, not a place to check.** The conclusion that the
233
224
  screen is right is drawn on the production build behind the real proxy: server-side markup,
234
225
  locales, cache, redirects and headers on the dev server are either different or absent
235
226
  altogether. A look at the raised dev server is fit to understand what is going on on an
236
227
  unfamiliar screen and unfit as confirmation: the confirmation is a measurement on a stand from
237
228
  the production build.
238
- - **A build of everything silences all three dev servers of the owner, not only the API.** After
239
- `nx run-many -t build` both the site and the admin go down. Build what you check
240
- (`npx nx build site`), not the whole tree. If the servers went down, the agent cannot bring them
241
- back up — the guard is in the way, so the owner is told at once, not at the end of the session.
229
+ - **A build of everything stops every dev server of the owner, not only the API.** After
230
+ `nx run-many -t build` the client applications go down too. Build what you check
231
+ (`npx nx build <application>`), not the whole tree. If the servers went down, the agent cannot bring them
232
+ back up — the guard refuses it, so the owner is told at once, not at the end of the session.
242
233
  The push gate is such a build too: its set runs the build of everything affected. So the
243
234
  measurement is taken before the push or on a stand from the production build. The answer of the
244
235
  server, not its port, tells whether it survived.
245
- - Take the rendering port with care: the developer's stand goes by the same name
246
- `ssr:<rendering port>` through `host-gateway`, and while a foreign process hangs on it, the
247
- stand serves a foreign build.
@@ -106,12 +106,6 @@ its name, not the infrastructure its reader needs.
106
106
  note names a task by the title read in the tracker at that minute, and a commit without a task
107
107
  number does not go into it: a number taken from memory lands on someone else's task.
108
108
 
109
- - **An edit made by a shell command is judged by the whole command, the old version inside it
110
- included.** The style check gets the body of the call, not the text that will end up in the
111
- file: a rewrite carrying the previous wording inside a heredoc or an interpreter string is
112
- refused by the words of that previous wording. The refusal repeats at the second attempt,
113
- because the old text is still there. The new text is written by the edit tool — there only the
114
- new text is judged — or inserted by line number, and the command is given the path.
115
109
  - **Shorter does not mean clearer.** A text in the layer's words comes out a third shorter and
116
110
  is useless to whoever decides whether the work is urgent.
117
111
  - **"Not X but Y" looks like an explanation and explains nothing.** The owner learns what was
@@ -41,16 +41,16 @@ without a single bullet, and a pass over `- ` would not have seen it.
41
41
 
42
42
  ```bash
43
43
  # how much of what is in the file: items, paragraphs, sections
44
- grep -c '^- ' docs/BACKLOG.md
45
- grep -c '^## ' docs/BACKLOG.md
44
+ grep -c '^- ' <backlog file>
45
+ grep -c '^## ' <backlog file>
46
46
  ```
47
47
 
48
48
  A paragraph is judged by the same sign as an item.
49
49
 
50
50
  ## A task number stands in three places
51
51
 
52
- Before counting "items without a task", all the forms of writing it must be known. In this tree
53
- there are three:
52
+ Before counting "items without a task", all the forms of writing it must be known. A tree
53
+ usually has three:
54
54
 
55
55
  ```markdown
56
56
  ## Section — #149 ← in the heading
@@ -69,7 +69,7 @@ An item has a task — that does not yet mean the task carries its content. Befo
69
69
  coverage is measured: how many of the item's significant words occur in the body of its task.
70
70
 
71
71
  ```bash
72
- /opt/homebrew/bin/gh issue list --state all --limit 400 --json number,title,body,state > /tmp/issues.json
72
+ <host client> issue list --state all --limit 400 --json number,title,body,state > /tmp/issues.json
73
73
  ```
74
74
 
75
75
  An item covered by the body half or less is read by eye and sorted into three outcomes:
@@ -91,7 +91,7 @@ skills gate was done and covered by scenarios.
91
91
 
92
92
  ```bash
93
93
  # check what you are about to call "not done"
94
- grep -rn '<symbol>' libs apps .claude/hooks
94
+ grep -rn '<symbol>' <source roots>
95
95
  grep -n '<name>' node_modules/<package>/types/*.d.ts
96
96
  ```
97
97
 
@@ -125,7 +125,7 @@ The document is not the only place promising that the work lives in it. A remove
125
125
  by one grep, including agent descriptions, skills, READMEs and code comments:
126
126
 
127
127
  ```bash
128
- grep -rn 'BACKLOG' --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=archive .
128
+ grep -rn '<removed name>' --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=archive .
129
129
  ```
130
130
 
131
131
  ## Common misses
@@ -20,17 +20,18 @@ Pattern of the rule `doc-style`. What must be true — the law
20
20
  ## A pass from the side of the text does not find what was not written
21
21
 
22
22
  It reads what is written and judges every statement; a statement that does not exist is not in
23
- the pass either. From the side of the work there are ten times more findings: in the first part
24
- seven findings out of eight landed where there was no text at all, not where it was stale.
23
+ the pass either. In one measured pass from the side of the work seven findings out of eight
24
+ landed where there was no text at all, not where it was stale.
25
25
 
26
26
  ## The selection sign — the branch added code and touched no text
27
27
 
28
28
  Selected by the machine, no reading required. What the branch really added is answered by
29
29
  history, not by the task folder: the folder is taken apart at closing, and the task footprint
30
- table never reaches the main branch at all.
30
+ table never reaches the main branch at all. The merges are read on the branch the tasks merged
31
+ into: the epic branch for the tasks of an epic, the main branch for the epic itself.
31
32
 
32
33
  ```bash
33
- git log --merges --format='%H %s' <main branch> | grep -E 'from [^/]+/<task key>-[0-9]+-'
34
+ git log --merges --format='%H %s' <base branch> | grep -E 'from [^/]+/<task key>-[0-9]+-'
34
35
  git diff --name-only <merge>^1 <merge>
35
36
  ```
36
37
 
@@ -48,14 +48,14 @@ directly, because the pitfall is the very place where people step on it.
48
48
 
49
49
  "Not planned", "will not be", "a separate feature on request" — that is the owner's intention,
50
50
  not a property of the system. What is not done — yes; why not — yes; what will never be done —
51
- no. Instead of a verdict — an open question `Q-<law letter>-<number>` with what the decision would
52
- change.
51
+ no. Instead of a verdict — an open question, `Q-<law letters>-<number>` in a law and `Q-<number>` in a
52
+ spec, with what the decision would change.
53
53
 
54
54
  The error is silent: a claim about the future has nothing to be checked against, it passes any
55
55
  check. That is how "there is no online payment and none is planned" got into the first live spec,
56
56
  while payment was in the plans.
57
57
 
58
- Hence also: what is not in `docs/PRD.md`, the product document does not claim. A guess made while
58
+ Hence also: what is not in the product document, the product document does not claim. A guess made while
59
59
  retelling sounds more convincing than the source — it is shorter and more categorical.
60
60
 
61
61
  ## In plain words
@@ -143,7 +143,7 @@ task document and was reported to the owner as fact. Caught by a rebase, that is
143
143
 
144
144
  ```bash
145
145
  git fetch origin
146
- git show origin/main:<path to file>
146
+ git show origin/<base branch>:<path to file>
147
147
  ```
148
148
 
149
149
  **A statement "all N such-and-such" is written after listing the routes by which a value reaches
@@ -166,10 +166,10 @@ in the same turn the text is written.
166
166
 
167
167
  ## Do not retell what has a source
168
168
 
169
- - contract types and fields — `libs/common/proto/proto/<area>/v1/`, by link;
170
- - columns and indexes — `prisma/schema.prisma`;
169
+ - contract types and fields — the contract description, by link;
170
+ - columns and indexes — the storage schema;
171
171
  - numbers the owner edits (base price, min-nights, capacity) — only how they are applied;
172
- - layers and class names — the rule `lib-layers` and the code itself.
172
+ - layers and class names — the code itself and, where it is laid out, the rule `lib-layers`.
173
173
 
174
174
  ## Code comments
175
175
 
@@ -17,7 +17,7 @@ Pattern of the rule `epic-flow`. What must be true meanwhile — the law
17
17
 
18
18
  ## State `договорённость-записана`: a series of tasks is declared an epic
19
19
 
20
- The grill ended with one task — the step is skipped. Several came out, and the order between them
20
+ The grill ended with one task — no epic is declared for it, pattern `task-flow-start`. Several came out, and the order between them
21
21
  matters — the epic is declared here, before the first of them, and twice. As a card in the work
22
22
  queue with the epic label, and as a plan next to it.
23
23
 
@@ -31,18 +31,25 @@ it points into emptiness. Everything the epic cannot be created without is asked
31
31
  made — an administrator alone can take a made one off the board. What the call does not write — a
32
32
  file of epics, an index of plans — the tree lists as hand steps of the same commit as the plan.
33
33
 
34
- The draft is filled in by hand, and three things in it are derived from nothing: the opportunity in
34
+ The draft is filled in by hand, and three things in it are derived from nothing: the capability in
35
35
  one phrase, the makeup of the tasks in order, and how the branches of the tasks stand. A set without
36
36
  an order is no order: two tasks whose order rested on understanding went into work the other way
37
37
  round, and the second was redone under the first. The assigned order holds to the end of the epic; a
38
38
  revision is the owner's decision.
39
39
 
40
- The cards for all the tasks are created at once, right here — by the same call with `--epic-of`, for
41
- every row of the makeup. The issued numbers return to the same table: "take the next" answers with a
42
- number from now on.
40
+ The row of the table of assignments that gives the epic to this working copy is the owner's, and it
41
+ is asked for right after the epic card is created, before the task cards: the assignment guard
42
+ counts a call with `--epic-of` as taking work and refuses a number other than the assigned epic.
43
+ The guard reads the table of the working copy, and the epic branch is taken from the main branch:
44
+ the row lies in the main branch before the epic branch is taken, otherwise every branch of the
45
+ epic reads the old epic.
43
46
 
44
- **Next move:** the declared epic is committed together with the task numbers, and in the same turn
45
- its branch is taken.
47
+ When the row stands, the cards for all the tasks are created at once — by the same call with
48
+ `--epic-of`, for every row of the makeup. The issued numbers return to the same table: "take the
49
+ next" answers with a number from now on.
50
+
51
+ **Next move:** the branch of the epic is taken, and the declared plan with the task numbers is
52
+ committed into it — a commit on the main branch is refused.
46
53
 
47
54
  ## State `эпик-заведён`: the branch of the epic
48
55
 
@@ -53,7 +60,7 @@ git checkout -b <КЛЮЧ>-<номер эпика>-<slug> origin/main
53
60
  The branch is taken before the first task of the epic, not with it: taken later, it leaves the first
54
61
  task standing on the main branch, and the epic starts as half of itself already merged.
55
62
 
56
- The plan of the epic is committed into it and the branch is pushed at once — the branches of the
63
+ The plan of the epic is committed into it right after it is taken, and the branch is pushed at once — the branches of the
57
64
  tasks are taken from it, and one that exists only on the machine is a base nobody else has. The card
58
65
  names the branch: the reader comes to the epic from the queue, and the queue holds no branches.
59
66
 
@@ -216,7 +216,7 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<номер>+<бот>@users.n
216
216
  ```
217
217
 
218
218
  The subject — `type(scope): description`. Types: `feat`, `fix`, `refactor`, `docs`, `style`,
219
- `test`, `chore`, `perf`. Scopes: `site`, `admin`, `api`, `common`, `proto`, `deploy`. A full stop
219
+ `test`, `chore`, `perf`. Scopes are the tree's own, named in `implementation.md` by the commit check setting that lists them. A full stop
220
220
  at the end of the subject is not accepted; the length — up to 150 characters. The letter case is checked as well, by the `subject-case` rule of the commit check: a word in capitals, such as a file name, can trip it, so the allowed case is read in the commit check settings before the subject is written.
221
221
 
222
222
  ```
@@ -15,7 +15,7 @@ of branches from one base — `git-workflow-stack`.
15
15
 
16
16
  Three places, and in each the reading is mandatory:
17
17
 
18
- - before a push — main's tip may have moved while the work went on;
18
+ - before a push — the base's tip may have moved while the work went on;
19
19
  - when taking a new task — the earlier PRs stayed open and will not remind of themselves;
20
20
  - after every merge that became known — it made all the others lag at once.
21
21
 
@@ -31,7 +31,7 @@ By one command over all one's own open PRs, not the one whose branch is checked
31
31
  | Field | What it says |
32
32
  | -------------------- | --------------------------------------------------------------------------------- |
33
33
  | `mergeable` | `MERGEABLE` — the button can be pressed; `CONFLICTING` — it cannot; `UNKNOWN` — not counted yet |
34
- | `mergeStateStatus` | `BEHIND` — lags behind main; `DIRTY` — a dispute in files; `BLOCKED` — awaits review |
34
+ | `mergeStateStatus` | `BEHIND` — lags behind its base; `DIRTY` — a dispute in files; `BLOCKED` — awaits review |
35
35
  | `isDraft` | a draft: the host locks the merge button whatever the run's colour |
36
36
  | `statusCheckRollup` | the run on the tip: an empty list means no run at all, not "green" |
37
37
 
@@ -45,24 +45,25 @@ merge, and it answers offline:
45
45
 
46
46
  ```bash
47
47
  git fetch origin
48
- git merge-tree "$(git merge-base origin/main <ветка>)" origin/main <ветка> | grep -c '^<<<<<<<'
48
+ git merge-tree "$(git merge-base origin/<база> <ветка>)" origin/<база> <ветка> | grep -c '^<<<<<<<'
49
49
  ```
50
50
 
51
- Zero — the branch merely lags, and merging main in cures it. Above zero — a dispute in files,
51
+ Zero — the branch merely lags, and the host merges it itself. Above zero — a dispute in files,
52
52
  and each is resolved by file kind: pattern `git-workflow-merge`.
53
53
 
54
54
  ## What is done with what was found
55
55
 
56
56
  | Found | What is done |
57
57
  | -------------------------------------- | ------------------------------------------------------------------ |
58
- | lagging, no dispute | main is merged into the branch and pushed in the same turn |
58
+ | lagging, no dispute, the PR is open | nothing: the host merges it itself — pattern `git-workflow-stack` |
59
59
  | a dispute in files | resolution by file kind, then a push |
60
- | no run on the tip | the tip is rerun or waited for — neither one has a colour |
60
+ | no run on the tip, the base wakes it | the tip is rerun or waited for — neither one has a colour |
61
+ | no run, the base does not wake it | nothing to wait for: the green push gate on the tip stands for it |
61
62
  | a draft with a green run | the draft is lifted — its merge button is locked |
62
63
  | the PR opened by a person, not by the machine | it can no longer get a reviewer: it is created anew by the machine account |
63
64
 
64
- Within one branch the order is one: merge main in → run the gate set → push → reread the state
65
- from the host. Rereading is part of the work, not a report on it.
65
+ For a branch with a dispute the order is one: merge the base in → run the gate set → push → reread
66
+ the state from the host. Rereading is part of the work, not a report on it.
66
67
 
67
68
  ## The local tip is checked against the one on the host
68
69
 
@@ -81,7 +82,7 @@ Diverged — the push is not done, and that is the first thing fixed.
81
82
  - The PR state read from memory of the previous turn: between turns a person merged a neighbouring work.
82
83
  - `UNKNOWN` read as "no conflicts" — the host was still counting.
83
84
  - The PR of the current branch was read, and the abandoned ones stayed lagging: all one's own open ones are asked.
84
- - Main merged in the working tree and not pushed: from outside that is "nothing done".
85
- - Lag was cured by resolving a conflict: there was no dispute in files at all, a merge would have sufficed.
85
+ - The base merged in the working tree and not pushed: from outside that is "nothing done".
86
+ - Lag was cured by resolving a conflict: there was no dispute in files at all, and the host merges such a branch itself.
86
87
  - A dispute resolved by choosing one side whole: the file kind decides the technique, and its sides differ.
87
- - The catch-up round started at a person's shout, not on its own: by that minute all PRs had already lagged.
88
+ - The round of resolving started at a person's shout, not on its own: by that minute the PRs already conflicted.