@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,7 +18,7 @@ out in that tree.
18
18
  ## When to use
19
19
 
20
20
  - The PR is marked conflicting, and it must be brought back to a mergeable state.
21
- - The base of the branch moved ahead, and the branch must be caught up before the checks: for a
21
+ - The base of the branch moved ahead, and the branch must be caught up before its PR opens: for a
22
22
  task branch the base is the branch of its epic, for an epic branch the main one.
23
23
  - The main branch moved ahead, and the whole epic must be caught up: the main branch is merged
24
24
  into the epic branch, and the epic branch into the branches of its unfinished tasks.
@@ -36,7 +36,8 @@ git diff --name-only --diff-filter=U # what ended up in conflict
36
36
 
37
37
  The signature stands in the command itself: that command creates the merge commit, not a
38
38
  separate `git commit`, and there is nothing to change its signature with later — a merge that
39
- left with a person's signature is refused at push and fixed by rebasing onto the main branch.
39
+ left with a person's signature is refused at push and is made again before the push: the unsent
40
+ merge commit is dropped and the merge repeated with the signature.
40
41
 
41
42
  The conflict list is read whole before the first resolution: the file kind decides the
42
43
  technique, and different files of one merge are resolved differently.
@@ -62,7 +63,8 @@ GIT_COMMITTER_NAME="<бот>" GIT_COMMITTER_EMAIL="<номер>+<бот>@users.n
62
63
 
63
64
  The signature variables stand on the carry-over command itself. A cherry-pick keeps the commit's
64
65
  author and sets as committer whoever calls it — that is, a person; the check set before a push
65
- reads the committer, and this is then fixed by a rebase, not by editing one commit.
66
+ reads the committer, and the unsent carry-over is then made again with the signature, not
67
+ edited commit by commit.
66
68
 
67
69
  The fallen-off branch is removed on both sides in the same turn — otherwise it stands in the
68
70
  list as unclosed work.
@@ -73,7 +75,7 @@ A conflict marker shows the place, not the edit: the branch's side in it is its
73
75
  together with everything that lay in the file before it.
74
76
 
75
77
  ```bash
76
- git diff "$(git merge-base origin/main HEAD)" HEAD -- docs/BACKLOG.md
78
+ git diff "$(git merge-base origin/<база> HEAD)" HEAD -- docs/BACKLOG.md
77
79
  ```
78
80
 
79
81
  ## What the branch appended is checked against the work queue, not carried over by default
@@ -157,19 +159,20 @@ is closed by hand with a comment naming the PR — the calls are in the pattern
157
159
  gh issue view <номер> --json state --jq .state
158
160
  ```
159
161
 
160
- ## A green run ages together with the main branch
162
+ ## A green run ages together with the base
161
163
 
162
- A run speaks about the base it went on. While it goes and the PR awaits review, the main branch
164
+ A run speaks about the base it went on. While it goes and the PR awaits review, the base
163
165
  lives its own life, and the local ref is silent about it: it describes the day it was pulled.
164
166
  Before a PR is called ready to merge, the lag is asked from the host:
165
167
 
166
168
  ```bash
167
- /opt/homebrew/bin/gh api repos/<владелец>/<репозиторий>/compare/<главная>...<ветка> --jq .behind_by
169
+ /opt/homebrew/bin/gh api repos/<владелец>/<репозиторий>/compare/<база>...<ветка> --jq .behind_by
168
170
  ```
169
171
 
170
- Zero — the PR is ready. Above zero — main is merged in, the check set is revised by what the
171
- branch now carries, and the run goes anew: green steps of the past run mean nothing after the
172
- merge.
172
+ The base is the one the PR goes into: the epic branch for a task, the previous branch in a chain,
173
+ main for an epic. Zero — the PR is ready. Above zero — the host is asked whether the branch
174
+ conflicts: a lag without a conflict it merges itself, and a conflicting branch takes the base in,
175
+ the check set is revised by what the branch now carries, and the run goes anew.
173
176
 
174
177
  ## Other people's task folders arrive with the main branch
175
178
 
@@ -180,7 +183,7 @@ them apart from here.
180
183
 
181
184
  The merge button is pressed by a person, and where they do it there are no hooks: the guard
182
185
  watching the folder's taking apart does not reach that path. So the work queue audit is run
183
- right after merging main, not before the push:
186
+ right after merging the base, not before the push:
184
187
 
185
188
  ```bash
186
189
  npm run check:board
@@ -19,7 +19,7 @@ Pattern of the rule `deploy-flow`. What must be true meanwhile — the law
19
19
  ## The chain is run by one command
20
20
 
21
21
  Local `lint`, `test`, `check:all` and the builds do not touch the migration order at all, and the
22
- step `Migrations match schema` in `.github/workflows/deploy.yml` goes after the merge. The check
22
+ schema check of the pipeline goes after the push. The check
23
23
  stands as a push gate and is called by hand:
24
24
 
25
25
  ```bash
@@ -29,7 +29,9 @@ npm run check:schema
29
29
  It applies the chain to a shadow database — the same as the working one, with the suffix
30
30
  `_gate_shadow` — compares it with the schema and tears it down. One's own database is not
31
31
  touched: an audit against it would judge the state of the machine, not of the repository. A
32
- stopped docker and a production address the check skips silently.
32
+ production address the check skips. A stopped docker it skips only where the branch did not touch
33
+ the storage; a branch that edited the schema or the migrations is refused, and the refusal names
34
+ how to bring the database up — rule `deploy-flow`.
33
35
 
34
36
  When there is no database at hand at all, the same chain is run on a one-off container:
35
37
 
@@ -2,7 +2,7 @@
2
2
  name: git-workflow-pr-body
3
3
  kind: pattern
4
4
  rule: git-workflow
5
- description: Pattern of rule git-workflow. Load when the PR body is written or edited — the Closes line and how the task closes when the base is not the main branch, reviewer, assignee and labels by the opening call, the four sections of the body. Opening the PR itself — pattern git-workflow-pr.
5
+ description: Pattern of rule git-workflow. Load when the PR body is written or edited — the Closes line and how the task closes when the base is not the main branch, reviewer, assignee and labels by the opening call, the six sections of the body. Opening the PR itself — pattern git-workflow-pr.
6
6
  ---
7
7
 
8
8
  # The PR body and the link to the task
@@ -45,7 +45,7 @@ gh run list --commit "$(gh pr view <номер> --json headRefOid --jq .headRefO
45
45
 
46
46
  ## Finish the handed-over first, then take new work
47
47
 
48
- An open PR is work in flight: its run ages, its branch lags behind main, its body describes the
48
+ An open PR is work in flight: its run ages, its branch lags behind its base, its body describes the
49
49
  tree on the day it was written. All of this is cheap to fix today and expensive three tasks later.
50
50
 
51
51
  So the queue is this:
@@ -60,9 +60,10 @@ not have: they see a list of "being done", not a list of "done".
60
60
  ## The state is read at once
61
61
 
62
62
  What it is read with and how each field is read — pattern `git-workflow-freshness`; here only
63
- what is done with what was read. An empty run is handled on a par with a red one: a chain PR's
64
- base is not the main branch, and the base filter does not let such an event through to the
65
- pipeline.
63
+ what is done with what was read. An empty run means two different things. On a base the
64
+ pipeline wakes for it is handled on a par with a red one: the run is due and did not come. On a
65
+ base it does not wake for — a chain PR, a task PR into its epic branch — no run is due, and the
66
+ green push gate on the tip stands for it.
66
67
 
67
68
  ## A red run is analysed by step, not by PR
68
69
 
@@ -44,14 +44,21 @@ open PR reads as an invitation to merge, so unfinished work opens it as a draft
44
44
  a draft's completion itself:
45
45
 
46
46
  ```bash
47
- AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr create --draft true --title '[<КЛЮЧ>-86] …' \
47
+ AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr create --draft true --title '[86] …' \
48
+ --target-branch <ветка эпика> --work-items 86 --reviewers <владелец> \
48
49
  --description "$(cat тело.md)"
49
50
  ```
50
51
 
51
52
  The check pipeline does not start on a draft by default: a run's silence is not taken for a
52
53
  green run, and the set is run on one's own machine or by a manual start.
53
54
 
54
- Everything waiting for a pipeline run, a rework or an answer to a question goes as a draft. The
55
+ A PR the pipeline does not wake for opens ready, without `--draft true`: the branch policies name
56
+ the target branches that carry a build validation, and where no run comes a draft waits for nothing and costs a locked button and a second turn. The reviewer is set in
57
+ the same turn, and the push gate is then the only check behind the work. Without
58
+ `--target-branch` the host takes the default branch, and the work goes into `main` past its epic.
59
+
60
+ A rework or an unanswered question goes as a draft; a PR that waits only for the run opens
61
+ ready, because the run does not start on a draft. The
55
62
  question is asked in the PR itself, not kept in the executor's head: a person reads the PR, not
56
63
  the session's conversation.
57
64
 
@@ -62,9 +69,9 @@ solution is ready:
62
69
  AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr update --id 86 --draft false
63
70
  ```
64
71
 
65
- Before the lifting the executor's silence means "not ready yet", after — "may be merged".
66
- Lifting the draft and asking to merge go in one turn: a lifted draft nobody told the person
67
- about waits for review just like one not lifted.
72
+ Lifting the draft starts the run where a build validation stands on the target, and the merge is
73
+ asked in the turn the run is read green. Where none stands, lifting and asking go in one turn: a
74
+ lifted draft nobody told the person about waits for review just like one not lifted.
68
75
 
69
76
  ## The PR is bound to the work item at creation
70
77
 
@@ -81,6 +88,11 @@ AZURE_DEVOPS_EXT_PAT="$TOKEN" az repos pr create \
81
88
 
82
89
  Before the target branch is named, its presence on the host is checked: `git ls-remote --heads origin <ветка>`. An empty answer means the base was merged and removed; the request then takes the next branch up the chain as its base.
83
90
 
91
+ The target branch is the epic branch, and in a chain the previous branch; into `main` goes only the
92
+ PR of the epic itself. Completing a PR closes the bound work item on any target
93
+ branch when the person leaves the option "Complete associated work items after merging" checked in
94
+ the Complete dialog.
95
+
84
96
  The reviewer is always the owner: without a review request the PR does not show in their queue.
85
97
  One PR closes the work item whole — half a task is not rolled out by one PR: a task has one
86
98
  branch, and work that does not fit it is split into tasks before the branch is created.
@@ -98,9 +110,14 @@ the branch after publishing: the PR states things about the tree, and the tree h
98
110
 
99
111
  ## PR body sample
100
112
 
101
- Four sections, and one order between them: the link line, what was done, what confirms it, the
102
- remaining step. A section with nothing to say says so in words — an empty heading and a removed
103
- heading read alike and mean different things.
113
+ Six sections, and one order between them: the link line, what was done, the points, the goal, what
114
+ confirms it, the remaining step. A section with nothing to say says so in words — an empty heading
115
+ and a removed heading read alike and mean different things.
116
+
117
+ The table of points comes from the reply of the role `product-strategist`: a sign not run is
118
+ written as not run, and its point as not reached. The table of the goal comes from the reply of the
119
+ role `goal-critic`. Both go in word for word, and the critic reads the finished body against the
120
+ replies.
104
121
 
105
122
  ```markdown
106
123
  Закрывает рабочий элемент 86.
@@ -109,6 +126,18 @@ heading read alike and mean different things.
109
126
 
110
127
  - <правка, названная тем, что она меняет для читателя, а не тем, какие файлы задела>
111
128
 
129
+ ## Точки
130
+
131
+ | Точка | Признак | Результат |
132
+ | --- | --- | --- |
133
+ | <изменение, которое увидит человек> | <команда, страница или число> | <вывод признака: достигнута или промах> |
134
+
135
+ ## Цель
136
+
137
+ | Слова владельца | Что показывает результат | Итог |
138
+ | --- | --- | --- |
139
+ | <дословная цитата> | <что видно в результате> | <выполнено или нет> |
140
+
112
141
  ## Чем подтверждено
113
142
 
114
143
  - <проверка>: <её вывод одной строкой>
@@ -116,19 +145,27 @@ heading read alike and mean different things.
116
145
 
117
146
  ## Оставшийся шаг
118
147
 
119
- Папка задачи разобрана коммитом `<sha>` — за работой убрано. Осталось дождаться прогона и снять
120
- черновик; до этого кнопка слияния заблокирована хостингом.
148
+ Папка задачи разобрана коммитом `<sha>` — за работой убрано. Осталось дождаться прогона
149
+ проверки; сливать после зелёного. В окне Complete оставить отметку «Complete associated work items
150
+ after merging»: рабочий элемент 86 закрывается этим запросом.
121
151
  ```
122
152
 
153
+ The link line says the work item closes with this PR, and the "Remaining step" section names the
154
+ option for the one who presses Complete: the dialog remembers the last choice of that person.
155
+
123
156
  The "Remaining step" section stands last and is rewritten by the same call as the rest of the
124
- body — in the turn that lifts the draft:
157
+ body — in the turn the run is read green:
125
158
 
126
159
  ```markdown
127
160
  ## Оставшийся шаг
128
161
 
129
- Не осталось: прогон зелёный, черновик снят. Можно вливать.
162
+ Не осталось: прогон зелёный. Можно вливать, отметка «Complete associated work items after
163
+ merging» в окне Complete остаётся.
130
164
  ```
131
165
 
166
+ Where no build validation stands on the target, the section says from the opening that nothing is
167
+ left and names the push gate as the only check, not a green run.
168
+
132
169
  It stands there because the merge decision is made on that page, not in the conversation: what
133
170
  was said to the owner aloud lives until the next reply, and the body lies right by the button.
134
171
  One does not cancel the other — the order of both messages to the owner is described by the
@@ -195,40 +232,40 @@ threads read at the start: a remark left without one is a remark the person chec
195
232
  The pipeline sees only what was sent, and it is sent by a push. Linters, unit tests and hook
196
233
  scenarios are taken by the push gate — below is what it does not know.
197
234
 
198
- 1. **The main branch is merged into this branch** — `git fetch origin && git merge origin/main`.
235
+ 1. **The base is merged into this branch** — `git fetch origin && git merge origin/<база>`: for a
236
+ work item branch that is the epic branch, for an epic branch the main one.
199
237
  Everything checked below is checked from this base: a PR from a diverged branch shows the
200
238
  reviewer the edit mixed with someone else's. Order and conflict resolution — pattern
201
239
  `git-workflow-merge`.
202
- 2. **The branch holds only the edit it was created for** — `git diff main...HEAD --stat`. A
240
+ 2. **The branch holds only the edit it was created for** — `git diff origin/<база>...HEAD --stat`. A
203
241
  foreign domain in the file list means the edit has spread, and it must be brought back within
204
242
  its bounds.
205
- 3. **No mock, no substituted response, no debug line** — `git diff main...HEAD` is read whole,
243
+ 3. **No mock, no substituted response, no debug line** — `git diff origin/<база>...HEAD` is read whole,
206
244
  not by file names. They go to production silently and corrupt real data.
207
245
  4. **The document goes in the same commit.** `docs-guard` names the pair, but it does not know
208
246
  the domain spec and an edit of its behaviour — that stays with the author.
209
247
  5. **Text and layout checks are green** — those the tree created in `tools/`. Which ones exist
210
248
  here — the rule's `implementation.md`.
211
- 6. **All applications of the tree build** — `nx build` for each. The push gate does not run the
212
- build.
249
+ 6. **All applications of the tree build** — `nx build` for each; the push gate runs the build of
250
+ what the branch touched, and an application nothing touched is built here.
213
251
  7. **Visible text is entered in all translation locales** — by the dictionary completeness test,
214
252
  if the tree is translated.
215
253
  8. **A layout edit is confirmed by a measurement**, not by a look, and captured on a narrow
216
254
  screen — pattern `browser-verification-measure`.
217
255
  9. **A markup edit of the public site is checked on the production build in all translation
218
256
  locales** — the search visibility rule of the tree that has one.
219
- 10. **The PR is bound to the work item**, reviewer and assignee are set, and the body is
220
- assembled by the sample — the sections "What was done", "What confirms it" and "Remaining
221
- step". By this moment the remaining step section says no steps are left: the draft is
222
- lifted after the folder is taken apart, not before.
257
+ 10. **The PR is bound to the work item**, the reviewer is set, and the body is
258
+ assembled by the sample — the sections "What was done", "Points", "Goal", "What confirms it" and "Remaining
259
+ step". By this moment the remaining step section names what is left: the run, where a build
260
+ validation stands on the target, or nothing. The folder is taken apart before the PR opens.
223
261
  11. **The PR title carries the work item number and names the work done:** `[<номер>] <Что
224
262
  сделано>`, with the same number as the work item and the branch name.
225
263
  12. **The work queue matches** — `npm run check:board`.
226
264
  13. **The PR state is read, not derived from return codes.**
227
265
  14. **The set is taken from the pipeline file, not assembled from memory.** The push gate is
228
- narrower by design: it stands between the command and the push, and everything longer than
229
- seconds is taken out of it. What the pipeline runs is written in its file — that list is
230
- repeated locally; a green gate is not completeness of the set.
231
- 15. **The set is revised after merging the main branch in.** It is chosen by what the branch now
266
+ never narrower than the pipeline, and a check judges that. The declared exclusions of
267
+ the set are read in its settings and run by hand.
268
+ 15. **The set is revised after merging the base in.** It is chosen by what the branch now
232
269
  carries, not by what the author edited. A branch that touched no line of the showcase runs
233
270
  the showcase snapshots: since the merge the pipeline runs them on its code, and the red
234
271
  comes to its PR.
@@ -244,6 +281,35 @@ from the full set, and by it the reviewer decides what need not be rechecked. Th
244
281
  mistake here is not a red pipeline but trust in the section: once read as complete, from then on
245
282
  it is rechecked whole.
246
283
 
284
+ The list is about opening: a PR that waits only for the run opens ready, so the items are passed
285
+ before the opening, and an unmet item means the PR does not open yet. The run is then waited for on
286
+ the open PR. A draft stands only for a rework or a question, and the same items are passed before
287
+ `az repos pr update --id <номер> --draft false`. Where no build validation stands on the target, no
288
+ item asks for a run: its place is taken by the push gate, green before the sending.
289
+
290
+ ## A chain of branches: the calls of this host
291
+
292
+ The order is the pattern `git-workflow-stack`, with one difference: here the upper PR is retargeted
293
+ before the lower one completes, not after. The calls:
294
+
295
+ ```bash
296
+ # the upper PR, before the lower one completes; the file holds {"targetRefName": "refs/heads/<ветка эпика>"}
297
+ az devops invoke --area git --resource pullRequests --http-method PATCH \
298
+ --route-parameters project=<проект> repositoryId=<репозиторий> pullRequestId=87 \
299
+ --in-file цель.json --api-version 7.1
300
+ az repos pr show --id 87 --query targetRefName -o tsv # reread: the call finds its resource by name
301
+ az repos pr show --id 87 --query mergeStatus -o tsv # whether the PR can be completed
302
+ az boards work-item update --id 86 --state <закрытое состояние> # an item the host did not move itself
303
+ ```
304
+
305
+ `az repos pr update` has no flag for the target branch, so the retargeting goes through the REST
306
+ call. It goes first because completing with `--delete-source-branch true` removes the branch the
307
+ upper PR targets.
308
+
309
+ The host takes no PR description longer than 4000 characters, so the length is counted before the
310
+ call. When the two tables do not fit, their rows stay and the cells are shortened to the verdict;
311
+ the word-for-word replies of the roles go into the first comment.
312
+
247
313
  ## Common misses
248
314
 
249
315
  Misses about creating the task, the branch and the commit — pattern
@@ -103,7 +103,7 @@ and the request to merge goes in the turn that opened it.
103
103
  ## The link to the task and the body
104
104
 
105
105
  The `Closes #<номер>` line, the reviewer, the assignee and the labels set by the opening call,
106
- the four sections of the body and how the task closes when the base is not the main branch —
106
+ the six sections of the body and how the task closes when the base is not the main branch —
107
107
  pattern `git-workflow-pr-body`. The pattern was split out of this one by the length limit.
108
108
 
109
109
  ## The PR state is read, not guessed
@@ -212,28 +212,28 @@ remarks read at the start: a remark left without one is a remark the person chec
212
212
 
213
213
  ## What is checked before the PR is published
214
214
 
215
- There are no checks on the PR itself: the rollout starts with a push into the main branch, and
216
- before the merge nobody runs anything. Linters, unit tests and hook scenarios are taken by the
217
- push gate — below is what it does not know.
215
+ Where the pipeline wakes for the base, it checks the PR before the merge; where it does not, the
216
+ push gate is the only check. Linters, unit tests, the build and hook scenarios are taken by the
217
+ push gate either way — below is what it does not know.
218
218
 
219
- 1. **The base is merged into this branch** — for a task branch that is the epic branch, for an epic branch the main one: `git fetch origin && git merge origin/<база>`.
219
+ 1. **The base is merged into this branch before the PR opens** — for a task branch that is the epic branch, for an epic branch the main one: `git fetch origin && git merge origin/<база>`.
220
220
  Base freshness is not inherited between branches of one session: the second and the third
221
221
  are taken after their own `fetch`, not from the ref under the first. While work goes on, main
222
222
  moves ahead — most often by the same executor's own PR. Everything checked below is checked
223
223
  from this base: a PR from a diverged branch shows the reviewer the edit mixed with someone
224
224
  else's. Order and conflict resolution — pattern `git-workflow-merge`.
225
- 2. **The branch holds only the edit it was created for** — `git diff main...HEAD --stat`. A
225
+ 2. **The branch holds only the edit it was created for** — `git diff origin/<база>...HEAD --stat`. A
226
226
  foreign domain in the file list means the edit has spread, and it must be brought back within
227
227
  its bounds.
228
- 3. **No mock, no substituted response, no debug line** — `git diff main...HEAD` is read whole,
228
+ 3. **No mock, no substituted response, no debug line** — `git diff origin/<база>...HEAD` is read whole,
229
229
  not by file names. They go to production silently and corrupt real data.
230
230
  4. **The document goes in the same commit.** `docs-guard` names the pair, but it does not know
231
231
  the domain spec and an edit of its behaviour — that stays with the author.
232
232
  5. **Text and layout checks are green** — those the tree created in `tools/`: scenarios against
233
233
  tests, paths in documents, lib layout, duplicates and classes without a rule. Which ones
234
234
  exist here — the rule's `implementation.md`.
235
- 6. **All applications of the tree build** — `nx build` for each. The push gate does not run the
236
- build: it is longer than anything it can do between the command and the push.
235
+ 6. **All applications of the tree build** — `nx build` for each; the push gate runs the build of
236
+ what the branch touched, and an application nothing touched is built here.
237
237
  7. **Visible text is entered in all translation locales** — by the dictionary completeness test,
238
238
  if the tree is translated.
239
239
  8. **A layout edit is confirmed by a measurement**, not by a look, and captured on a narrow
@@ -241,9 +241,9 @@ push gate — below is what it does not know.
241
241
  9. **A markup edit of the public site is checked on the production build in all translation
242
242
  locales** — the search visibility rule of the tree that has one.
243
243
  10. **The PR body is assembled by the sample** — starts with the line `Closes #<номер>`, carries
244
- the sections "What was done", "What confirms it" and "Remaining step", and labels, reviewer
244
+ the six sections of pattern `git-workflow-pr-body` — the points and the goal tables among them — and labels, reviewer
245
245
  and assignee are set. By this moment the remaining step section says no steps are left: the
246
- draft is lifted after the folder is taken apart, not before.
246
+ folder is taken apart before the PR opens.
247
247
  11. **The PR title carries the task number and names it done:** `[<КЛЮЧ>-<номер>] <Что сделано>`,
248
248
  with the same number as the task and the branch name. The infinitive of the task does not
249
249
  carry into it, nor do the commit type and scope.
@@ -253,22 +253,20 @@ push gate — below is what it does not know.
253
253
  owner, labels the same as on the task, the commit count equal to `ahead_by` of the branch
254
254
  comparison. The owner is told what was read.
255
255
  14. **The set is taken from the pipeline file, not assembled from memory.** The push gate is
256
- narrower by design: it stands between the command and the push, and everything longer than
257
- seconds is taken out of it. What the pipeline runs is written in its file — that list is
258
- repeated locally; a green gate is not completeness of the set.
259
- 15. **The set is revised after merging the main branch in.** It is chosen by what the branch now
256
+ never narrower than the pipeline, and a check judges that. The declared exclusions of
257
+ the set are read in its settings and run by hand.
258
+ 15. **The set is revised after merging the base in.** It is chosen by what the branch now
260
259
  carries, not by what the author edited. A branch that touched no line of the showcase runs
261
260
  the showcase snapshots: since the merge the pipeline runs them on its code, and the red
262
261
  comes to its PR.
263
262
 
264
263
  Where the pipeline wakes for this base, the list is about lifting the draft: the PR opens as a
265
- draft earlier, while work goes on, and the person is shown what exists together with what is
266
- still missing. Items 1–15 are then passed before `gh pr ready`, and an unmet item means the draft
264
+ draft after the task folder is taken apart and waits for the run. Items 1–15 are then passed before `gh pr ready`, and an unmet item means the draft
267
265
  is not lifted — not that the PR does not open.
268
266
 
269
267
  Where it does not wake, the same list is about opening: there is no second state to hold the work
270
- in, so an unmet item means the PR does not open yet. Item 1 changes with it — no run is asked for,
271
- and its place is taken by the push gate, green before the sending.
268
+ in, so an unmet item means the PR does not open yet. No item asks for a run there: its place is
269
+ taken by the push gate, green before the sending.
272
270
 
273
271
  Right after publishing the task is moved to review — `npm run task:move -- <номер>
274
272
  in-review` — and `npm run check:board` is run once more: before the PR opens it does not judge
@@ -46,24 +46,26 @@ open MR reads as an invitation to merge, so unfinished work opens it as a draft
46
46
  a draft's merge button itself:
47
47
 
48
48
  ```bash
49
- GITLAB_TOKEN="$TOKEN" glab mr create --draft --title '[<КЛЮЧ>-86] …' --description "$(cat тело.md)"
49
+ GITLAB_TOKEN="$TOKEN" glab mr create --draft --title '[<КЛЮЧ>-86] …' \
50
+ --target-branch <ветка эпика> --description "$(cat тело.md)"
50
51
  ```
51
52
 
52
53
  The draft sign here is the `Draft:` prefix in the MR title, and it is edited together with it:
53
54
  rewriting the title by hand lifts the draft without anyone noticing.
54
55
 
55
- Everything waiting for a pipeline run, a rework or an answer to a question goes as a draft. The
56
- question is asked in the MR itself, not kept in the executor's head: a person reads the MR, not
57
- the session's conversation.
56
+ An MR the pipeline does not wake for opens ready, without `--draft`: the pipeline file names the
57
+ target branches it wakes for, and where no run comes a draft waits for nothing and costs a locked button and a second turn. The reviewer is set in
58
+ the same turn, and the push gate is then the only check behind the work. Without
59
+ `--target-branch` the host takes the default branch, and the work goes into `main` past its epic.
58
60
 
59
- The draft is lifted by a separate call, and that is the very turn in which the executor says the
60
- solution is ready:
61
+ Everything waiting for a pipeline run, a rework or an answer to a question goes as a draft, and
62
+ the question is asked in the MR itself: a person reads the MR, not the session's conversation.
63
+ The draft is lifted by a separate call, in the turn in which the executor says the work is ready:
61
64
 
62
65
  ```bash
63
66
  GITLAB_TOKEN="$TOKEN" glab mr update 86 --ready
64
67
  ```
65
68
 
66
- Before the lifting the executor's silence means "not ready yet", after — "may be merged".
67
69
  Lifting the draft and asking to merge go in one turn: a lifted draft nobody told the person
68
70
  about waits for review just like one not lifted.
69
71
 
@@ -84,6 +86,11 @@ GITLAB_TOKEN="$TOKEN" glab mr create \
84
86
 
85
87
  Before the target branch is named, its presence on the host is checked: `git ls-remote --heads origin <ветка>`. An empty answer means the base was merged and removed; the request then takes the next branch up the chain as its base.
86
88
 
89
+ The target branch is the epic branch, and in a chain the previous branch; into `main` goes only the
90
+ MR of the epic itself. The host closes the task by the `Closes` line only on a merge into the
91
+ default branch: with another target the tree closes it by its pipeline or by hand, and the link
92
+ line says which.
93
+
87
94
  The reviewer is always the owner: without a review request the MR does not show in their queue.
88
95
  The assignee is the same account the machine work goes from. Labels are read from the task, not
89
96
  picked from memory:
@@ -110,9 +117,14 @@ branch after publishing: the MR states things about the tree, and the tree has c
110
117
 
111
118
  ## MR description sample
112
119
 
113
- Four sections, and one order between them: the link line, what was done, what confirms it, the
114
- remaining step. A section with nothing to say says so in words — an empty heading and a removed
115
- heading read alike and mean different things.
120
+ Six sections, and one order between them: the link line, what was done, the points, the goal, what
121
+ confirms it, the remaining step. A section with nothing to say says so in words — an empty heading
122
+ and a removed heading read alike and mean different things.
123
+
124
+ The table of points comes from the reply of the role `product-strategist`: a sign not run is
125
+ written as not run, and its point as not reached. The table of the goal comes from the reply of the
126
+ role `goal-critic`. Both go in word for word, and the critic reads the finished description against the
127
+ replies.
116
128
 
117
129
  ```markdown
118
130
  Closes #86
@@ -121,6 +133,18 @@ Closes #86
121
133
 
122
134
  - <правка, названная тем, что она меняет для читателя, а не тем, какие файлы задела>
123
135
 
136
+ ## Точки
137
+
138
+ | Точка | Признак | Результат |
139
+ | --- | --- | --- |
140
+ | <изменение, которое увидит человек> | <команда, страница или число> | <вывод признака: достигнута или промах> |
141
+
142
+ ## Цель
143
+
144
+ | Слова владельца | Что показывает результат | Итог |
145
+ | --- | --- | --- |
146
+ | <дословная цитата> | <что видно в результате> | <выполнено или нет> |
147
+
124
148
  ## Чем подтверждено
125
149
 
126
150
  - <проверка>: <её вывод одной строкой>
@@ -132,6 +156,17 @@ Closes #86
132
156
  черновик; до этого кнопка слияния заблокирована хостингом.
133
157
  ```
134
158
 
159
+ With a target other than the default branch the link line carries the way the task closes —
160
+ one of the two, by the tree's decision:
161
+
162
+ ```markdown
163
+ Closes #86 — задача закрывается конвейером дерева при слиянии в ветку эпика.
164
+ ```
165
+
166
+ ```markdown
167
+ Closes #86 — закрывается рукой после слияния череды: хостинг читает строку только при слиянии в ветку по умолчанию.
168
+ ```
169
+
135
170
  The "Remaining step" section stands last and is rewritten by the same call as the rest of the
136
171
  description — in the turn that lifts the draft:
137
172
 
@@ -141,14 +176,8 @@ description — in the turn that lifts the draft:
141
176
  Не осталось: прогон зелёный, черновик снят. Можно вливать.
142
177
  ```
143
178
 
144
- It stands there because the merge decision is made on that page, not in the conversation: what
145
- was said to the owner aloud lives until the next reply, and the description lies right by the
146
- button. One does not cancel the other — the order of both messages to the owner is described by
147
- the pattern for closing work.
148
-
149
- There is nothing to check the description by machine: no audit reads it, and the host asks only
150
- about the title. The sample is held by whoever writes the description — like the words said
151
- aloud.
179
+ It stands there because the merge decision is made on that page, not in the conversation. No
180
+ audit reads the description: the sample is held by whoever writes it.
152
181
 
153
182
  ## The MR state is read, not guessed
154
183
 
@@ -215,21 +244,22 @@ There are no checks on the MR itself until the pipeline is started, and a push s
215
244
  Linters, unit tests and hook scenarios are taken by the push gate — below is what it does not
216
245
  know.
217
246
 
218
- 1. **The main branch is merged into this branch** — `git fetch origin && git merge origin/main`.
247
+ 1. **The base is merged into this branch** — `git fetch origin && git merge origin/<база>`: for a
248
+ task branch that is the epic branch, for an epic branch the main one.
219
249
  Everything checked below is checked from this base: an MR from a diverged branch shows the
220
250
  reviewer the edit mixed with someone else's. Order and conflict resolution — pattern
221
251
  `git-workflow-merge`.
222
- 2. **The branch holds only the edit it was created for** — `git diff main...HEAD --stat`. A
252
+ 2. **The branch holds only the edit it was created for** — `git diff origin/<база>...HEAD --stat`. A
223
253
  foreign domain in the file list means the edit has spread, and it must be brought back within
224
254
  its bounds.
225
- 3. **No mock, no substituted response, no debug line** — `git diff main...HEAD` is read whole,
255
+ 3. **No mock, no substituted response, no debug line** — `git diff origin/<база>...HEAD` is read whole,
226
256
  not by file names. They go to production silently and corrupt real data.
227
257
  4. **The document goes in the same commit.** `docs-guard` names the pair, but it does not know
228
258
  the domain spec and an edit of its behaviour — that stays with the author.
229
259
  5. **Text and layout checks are green** — those the tree created in `tools/`. Which ones exist
230
260
  here — the rule's `implementation.md`.
231
- 6. **All applications of the tree build** — `nx build` for each. The push gate does not run the
232
- build.
261
+ 6. **All applications of the tree build** — `nx build` for each; the push gate runs the build of
262
+ what the branch touched, and an application nothing touched is built here.
233
263
  7. **Visible text is entered in all translation locales** — by the dictionary completeness test,
234
264
  if the tree is translated.
235
265
  8. **A layout edit is confirmed by a measurement**, not by a look, and captured on a narrow
@@ -237,18 +267,17 @@ know.
237
267
  9. **A markup edit of the public site is checked on the production build in all translation
238
268
  locales** — the search visibility rule of the tree that has one.
239
269
  10. **The MR description is assembled by the sample** — starts with the line `Closes #<номер>`,
240
- carries the sections "What was done", "What confirms it" and "Remaining step", and labels,
270
+ carries the sections "What was done", "Points", "Goal", "What confirms it" and "Remaining step", and labels,
241
271
  reviewer and assignee are set. By this moment the remaining step section says no steps are
242
- left: the draft is lifted after the folder is taken apart, not before.
272
+ left: the folder is taken apart before the MR opens.
243
273
  11. **The MR title carries the task number and names it done:** `[<КЛЮЧ>-<номер>] <Что
244
274
  сделано>`, with the same number as the task and the branch name.
245
275
  12. **The work queue matches** — `npm run check:board`.
246
276
  13. **The MR state is read, not derived from return codes.**
247
277
  14. **The set is taken from the pipeline file, not assembled from memory.** The push gate is
248
- narrower by design: it stands between the command and the push, and everything longer than
249
- seconds is taken out of it. What the pipeline runs is written in its file — that list is
250
- repeated locally; a green gate is not completeness of the set.
251
- 15. **The set is revised after merging the main branch in.** It is chosen by what the branch now
278
+ never narrower than the pipeline, and a check judges that. The declared exclusions of
279
+ the set are read in its settings and run by hand.
280
+ 15. **The set is revised after merging the base in.** It is chosen by what the branch now
252
281
  carries, not by what the author edited. A branch that touched no line of the showcase runs
253
282
  the showcase snapshots: since the merge the pipeline runs them on its code, and the red
254
283
  comes to its MR.
@@ -264,6 +293,23 @@ from the full set, and by it the reviewer decides what need not be rechecked. Th
264
293
  mistake here is not a red pipeline but trust in the section: once read as complete, from then on
265
294
  it is rechecked whole.
266
295
 
296
+ Where the pipeline wakes for this target, the list is about lifting the draft: the MR opens as a
297
+ draft after the task folder is taken apart and waits for the run. The items are then passed before
298
+ `glab mr update <номер> --ready`, and an unmet item means the draft is not lifted.
299
+
300
+ Where it does not wake, the same list is about opening: an unmet item means the MR does not open
301
+ yet. No item asks for a run there: its place is taken by the push gate, green before the sending.
302
+
303
+ ## A chain of branches: the calls of this host
304
+
305
+ The order is the pattern `git-workflow-stack`; its calls here:
306
+
307
+ ```bash
308
+ glab mr update 87 --target-branch <ветка эпика> # the upper MR, where the host did not retarget it
309
+ glab mr view 87 --output json | jq -r '.detailed_merge_status' # whether the button can be pressed
310
+ glab issue close 86 # a task the host did not close itself
311
+ ```
312
+
267
313
  ## Common misses
268
314
 
269
315
  Misses about creating the task, the branch and the commit — pattern