@rt-tools/agent-kit 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/assets/checks/board-epic-link.github.mjs +13 -1
  2. package/assets/checks/board-runs.github.mjs +102 -2
  3. package/assets/checks/check-board.github.mjs +63 -3
  4. package/assets/checks/main-run.github.mjs +69 -0
  5. package/assets/checks/rt-kit-checks.config.mjs +15 -0
  6. package/assets/checks/tree-assignment.mjs +169 -0
  7. package/assets/hooks/end-conversation-guard.sh +59 -0
  8. package/assets/hooks/epic-over.sh +11 -2
  9. package/assets/hooks/git-guard-delivery-epic.sh +7 -0
  10. package/assets/hooks/git-guard-delivery.sh +2 -1
  11. package/assets/hooks/git-guard-tree-assignment.sh +77 -0
  12. package/assets/hooks/hook-input.sh +8 -1
  13. package/assets/hooks/main-run-context.sh +45 -0
  14. package/assets/hooks/tree-assignment-guard.sh +101 -0
  15. package/assets/hooks/turn-exit-epic.sh +110 -0
  16. package/assets/hooks/turn-exit-guard.sh +34 -20
  17. package/assets/hooks/turn-exit-patterns.sh +0 -9
  18. package/assets/hooks/turn-exit-verdict.sh +20 -8
  19. package/assets/laws/delivery.md +6 -0
  20. package/assets/laws/work-conduct.md +4 -0
  21. package/assets/patterns/git-workflow-merge.md +13 -0
  22. package/assets/patterns/git-workflow-pr-body.github.md +156 -0
  23. package/assets/patterns/git-workflow-pr.github.md +6 -104
  24. package/assets/patterns/git-workflow-stack.md +19 -2
  25. package/assets/patterns/task-flow-close.md +1 -1
  26. package/assets/patterns/task-flow-resume.md +8 -0
  27. package/assets/pitfalls/git-workflow.github.md +6 -0
  28. package/assets/pitfalls/turn-conduct.md +18 -0
  29. package/assets/rules/doc-style.md +3 -2
  30. package/assets/rules/git-workflow.github.md +35 -37
  31. package/assets/rules/task-flow.md +33 -33
  32. package/assets/rules/turn-conduct.md +31 -32
  33. package/assets/samples/tasks/_template/progress.md +1 -1
  34. package/bin/agent-kit.d.ts.map +1 -1
  35. package/bin/agent-kit.js +2 -1
  36. package/bin/agent-kit.js.map +1 -1
  37. package/lib/cargo.d.ts +49 -1
  38. package/lib/cargo.d.ts.map +1 -1
  39. package/lib/cargo.js +9 -2
  40. package/lib/cargo.js.map +1 -1
  41. package/lib/observations-cargo.d.ts +20 -0
  42. package/lib/observations-cargo.d.ts.map +1 -0
  43. package/lib/observations-cargo.js +88 -0
  44. package/lib/observations-cargo.js.map +1 -0
  45. package/lib/shipment.d.ts +8 -20
  46. package/lib/shipment.d.ts.map +1 -1
  47. package/lib/shipment.js +22 -39
  48. package/lib/shipment.js.map +1 -1
  49. package/lib/tree-mark.d.ts +17 -0
  50. package/lib/tree-mark.d.ts.map +1 -0
  51. package/lib/tree-mark.js +41 -0
  52. package/lib/tree-mark.js.map +1 -0
  53. package/package.json +1 -1
  54. package/rt-tools-agent-kit-0.29.0.tgz +0 -0
  55. package/rt-tools-agent-kit-0.28.0.tgz +0 -0
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: git-workflow-pr-body
3
+ kind: pattern
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.
6
+ ---
7
+
8
+ # The PR body and the link to the task
9
+
10
+ Pattern of the rule `git-workflow`. What must be true — the law
11
+ `docs/constitution/delivery.md`. Opening the PR, the draft and its state — pattern
12
+ `git-workflow-pr`; a chain of branches — `git-workflow-stack`.
13
+
14
+ ## When to use
15
+
16
+ - The body of a PR is written or rewritten — at the opening, after a merge into the branch, in
17
+ the turn that lifts the draft.
18
+ - The base of the PR is an epic branch or the previous branch of a chain, and it has to be said
19
+ how the task closes.
20
+ - Reviewer, assignee and labels are set on an already open PR.
21
+
22
+ ## The PR is attached to the task
23
+
24
+ The body starts with the link line — by it the board fills the linked PRs field. Reviewer,
25
+ assignee and labels are set by the same command, and a PR does not open without them:
26
+
27
+ ```bash
28
+ GH_TOKEN="$TOKEN" gh pr create --base <ветка эпика> --title '[<КЛЮЧ>-86] Письмо владельцу с незаполненным адресом попадает в логи' \
29
+ --reviewer <владелец> --assignee <бот> --label bug --label area:api \
30
+ --body 'Closes #86
31
+
32
+ …'
33
+ ```
34
+
35
+ The reviewer is always the owner: without a review request the PR does not show in their queue.
36
+ The assignee is the same account the machine work goes from. Labels are taken from the task
37
+ whole — both the kind of edit and all its areas; they are read from the task, not picked from
38
+ memory:
39
+
40
+ ```bash
41
+ /opt/homebrew/bin/gh issue view 86 --json labels --jq '.labels | map(.name) | join(",")'
42
+ ```
43
+
44
+ The line `Closes #<номер>` is mandatory: without it the PR is not attached to the task, and the
45
+ queue audit finds this. It also means the task closes whole — half a task is not rolled out by
46
+ one PR: work that does not fit one branch is split into tasks before the branch is created.
47
+
48
+ **The host reads the line only on a merge into the default branch.** A PR into an epic branch or
49
+ into the previous branch of a chain merges, and its task stays open: two chain PRs promised a
50
+ closing this way, and the board column lagged the work until a person noticed. So the body of a
51
+ PR with such a base says how the task closes, and the tree decides which of the two it is:
52
+
53
+ - the tree closes such tasks by a pipeline of its own on the merge of a PR — the `Closes` line
54
+ stays, and the body names the pipeline; where it is named for this tree is said by the
55
+ override next to this pattern;
56
+ - the tree has no such pipeline — the body names the task in words, «Задача #86 закрывается
57
+ рукой после слияния череды», and the cleanup step after the merge closes it with a comment
58
+ naming the PR: pattern `git-workflow-stack`.
59
+
60
+ The queue audit reads the `Closes` line as the link between the PR and the task on every base;
61
+ a PR without it is named a divergence whichever way the task closes.
62
+
63
+ A refusal about an exceeded query-language quota (`API rate limit already exceeded`) creates no
64
+ PR at all; the opening then goes by a REST call — `$GH api -X POST "repos/$REPO/pulls" -f head=… -f
65
+ base=… -f title=… -F body=@<файл>` — and labels and reviewer are set after it. The text of such
66
+ a refusal reads as temporary, but the account's quota is not exhausted — it equals zero: there
67
+ is nothing to wait for.
68
+
69
+ On an already open PR the same is set by three REST calls. `gh pr edit` will not do here: it
70
+ queries Projects (classic) cards, gets a refusal about a removed API and never reaches the edit.
71
+
72
+ ```bash
73
+ GH=/opt/homebrew/bin/gh
74
+ REPO=<владелец>/<репозиторий>
75
+
76
+ $GH api -X POST "repos/$REPO/issues/205/labels" -f 'labels[]=bug' -f 'labels[]=area:api'
77
+ $GH api -X POST "repos/$REPO/issues/205/assignees" -f 'assignees[]=<бот>'
78
+ $GH api -X POST "repos/$REPO/pulls/205/requested_reviewers" -f 'reviewers[]=<владелец>'
79
+ ```
80
+
81
+ The same call edits the body itself: `-f body=` rewrites it whole, so the line
82
+ `Closes #<номер>` is written anew together with the rest of the text.
83
+
84
+ ```bash
85
+ $GH api -X PATCH "repos/$REPO/pulls/205" -f body="$(cat тело.md)"
86
+ ```
87
+
88
+ The body is reread whenever something merged into the branch after publishing: the PR states
89
+ things about the tree, and the tree has changed since.
90
+
91
+ ## PR body sample
92
+
93
+ Four sections, and one order between them: the link line, what was done, what confirms it, the
94
+ remaining step. A section with nothing to say says so in words — an empty heading and a removed
95
+ heading read alike and mean different things.
96
+
97
+ ```markdown
98
+ Closes #86
99
+
100
+ ## Что сделано
101
+
102
+ - <правка, названная тем, что она меняет для читателя, а не тем, какие файлы задела>
103
+
104
+ ## Чем подтверждено
105
+
106
+ - <проверка>: <её вывод одной строкой>
107
+ - Не гонялось: <что в набор не вошло и почему>
108
+
109
+ ## Оставшийся шаг
110
+
111
+ Папка задачи разобрана коммитом `<sha>` — за работой убрано. Осталось дождаться прогона и снять
112
+ черновик; до этого кнопка слияния заблокирована хостингом.
113
+ ```
114
+
115
+ With a base other than the main branch the link line carries the way the task closes — one of
116
+ the two, by the tree's decision:
117
+
118
+ ```markdown
119
+ Closes #86 — задача закрывается конвейером дерева при слиянии в ветку эпика.
120
+ ```
121
+
122
+ ```markdown
123
+ Задача #86 — закрывается рукой после слияния череды, с комментарием со ссылкой на этот PR.
124
+ ```
125
+
126
+ The "Remaining step" section stands last and is rewritten by the same call as the rest of the
127
+ body — in the turn that lifts the draft:
128
+
129
+ ```markdown
130
+ ## Оставшийся шаг
131
+
132
+ Не осталось: прогон зелёный, черновик снят. Можно вливать.
133
+ ```
134
+
135
+ It stands there because the merge decision is made on that page, not in the conversation: what
136
+ was said to the owner aloud lives until the next reply, and the body lies right by the button.
137
+ One does not cancel the other — the order of both messages to the owner is described by the
138
+ pattern for closing work.
139
+
140
+ There is nothing to check the body by machine: no audit reads it, and the host asks only about
141
+ the title. The sample is held by whoever writes the body — like the words said aloud.
142
+
143
+ ## Common misses
144
+
145
+ - A second `Closes` line in one PR no longer closes a task: two tasks in one branch roll back
146
+ only together. Either it is one task — and the second is absorbed — or two branches.
147
+ - Half a task that left by its own PR is a miss too: the body of such a PR starts with the words
148
+ `Часть #<номер>` instead of `Closes`, and the task stays open. Work that does not fit one
149
+ branch is split into tasks before the branch is created.
150
+ - Labels set by the PR title, not read from the task: the area is lost, and the board does not
151
+ show that the edit touched the site too.
152
+ - The task closed not in full, but the labels carried over whole: the task stays open, and the
153
+ PR body says so instead of implying it by a `Closes` line.
154
+ - A `Closes` line in a PR whose base is not the main branch, in a tree without a closing pipeline:
155
+ the task looks attached and stays open after the merge. The body names the task in words, and
156
+ the cleanup step closes it by hand.
@@ -2,7 +2,7 @@
2
2
  name: git-workflow-pr
3
3
  kind: pattern
4
4
  rule: git-workflow
5
- description: Pattern of rule git-workflow. Load for opening a PR and everything around it — title format, draft and leaving it, the link to the task, reviewer and labels, a body sample, reading the PR state, the checklist. Creating the task and committing — pattern git-workflow-commit.
5
+ description: Pattern of rule git-workflow. Load for opening a PR and everything around it — title format, draft and leaving it, reading the PR state, the checklist. The link to the task, reviewer, labels and the body sample — pattern git-workflow-pr-body; creating the task and committing — git-workflow-commit.
6
6
  ---
7
7
 
8
8
  # The PR
@@ -96,100 +96,11 @@ Lifting the draft and asking to merge go in one turn: a lifted draft nobody told
96
96
  waits for review just like one not lifted. A PR opened without the draft key needs no such call,
97
97
  and the request to merge goes in the turn that opened it.
98
98
 
99
- ## The PR is attached to the task
99
+ ## The link to the task and the body
100
100
 
101
- The body starts with the link line — by it the board fills the linked PRs field. Reviewer,
102
- assignee and labels are set by the same command, and a PR does not open without them:
103
-
104
- ```bash
105
- GH_TOKEN="$TOKEN" gh pr create --base <ветка эпика> --title '[<КЛЮЧ>-86] Письмо владельцу с незаполненным адресом попадает в логи' \
106
- --reviewer <владелец> --assignee <бот> --label bug --label area:api \
107
- --body 'Closes #86
108
-
109
- …'
110
- ```
111
-
112
- The reviewer is always the owner: without a review request the PR does not show in their queue.
113
- The assignee is the same account the machine work goes from. Labels are taken from the task
114
- whole — both the kind of edit and all its areas; they are read from the task, not picked from
115
- memory:
116
-
117
- ```bash
118
- /opt/homebrew/bin/gh issue view 86 --json labels --jq '.labels | map(.name) | join(",")'
119
- ```
120
-
121
- The line `Closes #<номер>` is mandatory: without it the PR is not attached to the task, and the
122
- queue audit finds this. It also means the task closes whole — half a task is not rolled out by
123
- one PR: work that does not fit one branch is split into tasks before the branch is created.
124
-
125
- A refusal about an exceeded query-language quota (`API rate limit already exceeded`) creates no
126
- PR at all; the opening then goes by a REST call — `$GH api -X POST "repos/$REPO/pulls" -f head=… -f
127
- base=… -f title=… -F body=@<файл>` — and labels and reviewer are set after it. The text of such
128
- a refusal reads as temporary, but the account's quota is not exhausted — it equals zero: there
129
- is nothing to wait for.
130
-
131
- On an already open PR the same is set by three REST calls. `gh pr edit` will not do here: it
132
- queries Projects (classic) cards, gets a refusal about a removed API and never reaches the edit.
133
-
134
- ```bash
135
- GH=/opt/homebrew/bin/gh
136
- REPO=<владелец>/<репозиторий>
137
-
138
- $GH api -X POST "repos/$REPO/issues/205/labels" -f 'labels[]=bug' -f 'labels[]=area:api'
139
- $GH api -X POST "repos/$REPO/issues/205/assignees" -f 'assignees[]=<бот>'
140
- $GH api -X POST "repos/$REPO/pulls/205/requested_reviewers" -f 'reviewers[]=<владелец>'
141
- ```
142
-
143
- The same call edits the body itself: `-f body=` rewrites it whole, so the line
144
- `Closes #<номер>` is written anew together with the rest of the text.
145
-
146
- ```bash
147
- $GH api -X PATCH "repos/$REPO/pulls/205" -f body="$(cat тело.md)"
148
- ```
149
-
150
- The body is reread whenever something merged into the branch after publishing: the PR states
151
- things about the tree, and the tree has changed since.
152
-
153
- ## PR body sample
154
-
155
- Four sections, and one order between them: the link line, what was done, what confirms it, the
156
- remaining step. A section with nothing to say says so in words — an empty heading and a removed
157
- heading read alike and mean different things.
158
-
159
- ```markdown
160
- Closes #86
161
-
162
- ## Что сделано
163
-
164
- - <правка, названная тем, что она меняет для читателя, а не тем, какие файлы задела>
165
-
166
- ## Чем подтверждено
167
-
168
- - <проверка>: <её вывод одной строкой>
169
- - Не гонялось: <что в набор не вошло и почему>
170
-
171
- ## Оставшийся шаг
172
-
173
- Папка задачи разобрана коммитом `<sha>` — за работой убрано. Осталось дождаться прогона и снять
174
- черновик; до этого кнопка слияния заблокирована хостингом.
175
- ```
176
-
177
- The "Remaining step" section stands last and is rewritten by the same call as the rest of the
178
- body — in the turn that lifts the draft:
179
-
180
- ```markdown
181
- ## Оставшийся шаг
182
-
183
- Не осталось: прогон зелёный, черновик снят. Можно вливать.
184
- ```
185
-
186
- It stands there because the merge decision is made on that page, not in the conversation: what
187
- was said to the owner aloud lives until the next reply, and the body lies right by the button.
188
- One does not cancel the other — the order of both messages to the owner is described by the
189
- pattern for closing work.
190
-
191
- There is nothing to check the body by machine: no audit reads it, and the host asks only about
192
- the title. The sample is held by whoever writes the body — like the words said aloud.
101
+ The `Closes #<номер>` line, the reviewer, the assignee and the labels set by the opening call,
102
+ the four sections of the body and how the task closes when the base is not the main branch —
103
+ pattern `git-workflow-pr-body`. The pattern was split out of this one by the length limit.
193
104
 
194
105
  ## The PR state is read, not guessed
195
106
 
@@ -313,16 +224,7 @@ is trust in the section: once read as complete, from then on it is rechecked who
313
224
  ## Common misses
314
225
 
315
226
  Misses about creating the task, the branch and the commit — pattern
316
- `git-workflow-commit`.
227
+ `git-workflow-commit`; about the link line, the labels and the body — `git-workflow-pr-body`.
317
228
 
318
- - A second `Closes` line in one PR no longer closes a task: two tasks in one branch roll back
319
- only together. Either it is one task — and the second is absorbed — or two branches.
320
- - Half a task that left by its own PR is a miss too: the body of such a PR starts with the words
321
- `Часть #<номер>` instead of `Closes`, and the task stays open. Work that does not fit one
322
- branch is split into tasks before the branch is created.
323
229
  - A PR opened without a reviewer: it never reaches the owner's inbox at all, and the queue stands
324
230
  while looking as if it works. That is how sixteen PRs waited for a review nobody had requested.
325
- - Labels set by the PR title, not read from the task: the area is lost, and the board does not
326
- show that the edit touched the site too.
327
- - The task closed not in full, but the labels carried over whole: the task stays open, and the
328
- PR body says so instead of implying it by a `Closes` line.
@@ -65,8 +65,25 @@ gh api repos/<владелец>/<дерево>/pulls/<номер наследн
65
65
  ```
66
66
 
67
67
  From the browser the same is done by editing the PR heading, where the base stands as a dropdown.
68
- The miss turns red nowhere: the PR looks merged, the task closes by its `Closes` line, and the work
69
- is not where it was meant to go.
68
+ The miss turns red nowhere: the PR looks merged, and the work is not where it was meant to go.
69
+
70
+ **The `Closes` line of a chain PR is read by nobody at the host.** The host closes a task only
71
+ on a merge into the default branch; a chain PR merges into the neighbour, and the task stays
72
+ open with the column lagging the work. Which of the two the tree has — a pipeline of its own that
73
+ closes the task on such a merge, or the hand — stands in the PR body by the sample of the pattern
74
+ `git-workflow-pr-body`. The tasks of a chain are asked after every merge, not assumed closed:
75
+
76
+ ```bash
77
+ # right after a merge — the task of the merged PR, then the rest of the chain
78
+ gh issue view <номер> --json state --jq .state
79
+ # still open — closed by hand, with a comment naming the PR that merged
80
+ gh issue comment <номер> --body 'Влита в ветку <основание> — PR #<номер PR>.'
81
+ gh issue close <номер> --reason completed
82
+ ```
83
+
84
+ This is the cleanup step after the last merge of the chain: the branches are listed, the tasks
85
+ of the chain are asked, and what is still open is closed with the comment. A task closed in
86
+ silence, without the PR named, cannot be told from one closed by mistake.
70
87
 
71
88
  The merge order stands in every PR body as the line "stands on #<number>, merge after it": the
72
89
  owner merges by the list, and branch kinship is invisible in the list.
@@ -117,7 +117,7 @@ the progress and into the PR body. The law file is edited after the answer. The
117
117
  application laws: payments, locales and access are the same agreement, only about this application.
118
118
 
119
119
  What was done at this step is written into the PR body: what was re-read, what was changed, and if
120
- nothing was changed — why. The form of the section — pattern `git-workflow-pr`.
120
+ nothing was changed — why. The form of the section — pattern `git-workflow-pr-body`.
121
121
 
122
122
  **Next move:** the updated texts are committed, and in the same turn the task folder is taken apart
123
123
  — by the last commit of the branch, pattern `task-flow-archive`.
@@ -118,6 +118,14 @@ owner — exactly the retelling all of this was set up to cancel:
118
118
  - **PR:** #1396, ждёт разбора · отвечено 3 замечания из 5 · не сделано: снятие черновика
119
119
  ```
120
120
 
121
+ The waiting line carries the owner's standing word about a stop, quoted in « », when they gave
122
+ one. The exit guard reads their word from this line, not a retelling; a line without a quote
123
+ releases nothing. The quote holds until the owner cancels it, and the line is rewritten then.
124
+
125
+ ```markdown
126
+ - **Waiting for the owner:** «эпик чата пока откладываем» — сказано вчера, работа стоит до его слова.
127
+ ```
128
+
121
129
  With the PR opened the state becomes `работа-отдана`, and its mandatory action is different — the
122
130
  next task, not waiting for review. By that minute there is nothing left to declare it with on disk:
123
131
  the progress left with the folder, and the tail of the work is led by pattern `task-flow-close`.
@@ -305,9 +305,15 @@ neighbour with rights to one repository reads its task as nonexistent, and from
305
305
  the miss is invisible — the answer is an ordinary "not found". That is why the account is
306
306
  substituted per call and never made active, even when the active one is already right.
307
307
 
308
+ - **What closes the card of an epic.** The merge of its request closes the card by the host's rule
309
+ on a closed item: nothing moves it to the closing column by hand. The two moves of the card that
310
+ the rule demands are the first one and the one at the opening of the request.
308
311
  - **Why a neighbouring runner rewrites a ready-made step's default.** On a machine with several
309
312
  runners any path from the home directory is shared, so the version a neighbouring run installs
310
313
  lands under the same path and is picked up by the next run of any project.
314
+ - **By which tier the freshness of main's tip is asked.** By the second one — the same technique as
315
+ the task state. The first tier works offline: the local ref answers whether the branch lags what
316
+ lies in the tree, the remote one — whether the ref itself went stale.
311
317
  - **What the second tier of the delivery guard cannot ask without a network.** Task, column,
312
318
  assignee and review live at the hosting: with no network and no token that tier is skipped, and
313
319
  the skip is silent.
@@ -103,3 +103,21 @@ The rule is `turn-conduct`; the articles that hold the law stand there.
103
103
  phrase: the guard's general refusal returned the turn, the executor made one step and ended
104
104
  the turn with the same phrase. Now the guard names it by name; the lawful exit when a decision
105
105
  is needed is a question through the tool.
106
+ - **"Turn exits": the price of a question that holds independent work.** A session stood a night
107
+ and a morning naming the owner one and the same step while three independent tasks lay untaken.
108
+ - **"A guard's refusal ends the turn": why a bypass costs more than a refusal.** A guard refuses one
109
+ file; a bypassed guard lifts the requirement from the whole tree and says nothing. Not memory
110
+ alone holds this — the guards also judge the shell command that writes the file.
111
+ - **"The owner's answer is sought in their own messages": what the conversation guard does not
112
+ see.** It counts loading a rule and searching it as reading, and a message leaves no trace. A
113
+ question that answers itself in the owner's words devalues those asked next to it.
114
+ - **"A taken task is not yet begun work": what the guard's tier covers.** A branch without a task
115
+ number is not under it; an assembled folder template lifts it.
116
+ - **"Exploration does not end a turn": why it passes for work.** It looks like work better than
117
+ anything else: commands, exact numbers, checkable answers.
118
+ - **"A reply to the owner is not an action": why the report takes the place of the work.** The
119
+ reverse order — work, report, end — stands behind every analysed stop: a report is a form of
120
+ completeness, and an appended summary reads as the turn's end the more convincingly the more was
121
+ done.
122
+ - **"A statement about the tree's state is watched by the statement guard": why a word has its own
123
+ kind of command.** A general sign "there was a command" would confirm one thing by another.
@@ -228,8 +228,9 @@ written in.
228
228
  the tree's documents are written in English: a session reads them, and English text costs it a
229
229
  fifth less with the same articles. A task in the queue, a PR description, a commit body and a
230
230
  chat reply are written in the owner's language: the owner reads them, and the rules layer does
231
- not. A text written in the other side's language is a miss of the same kind as a layer word in
232
- a task: its addressee will not read it.
231
+ not. So are an incident analysis and a record of closed work: the owner reads them as the account
232
+ of what happened. A text written in the other side's language is a miss of the same kind as a
233
+ layer word in a task: its addressee will not read it.
233
234
  <!-- rt-when: любой текст -->
234
235
 
235
236
  ## What of the law is not here
@@ -27,7 +27,7 @@ with the rule.
27
27
  | separate branch | `<КЛЮЧ>-<номер задачи>-<короткий-slug>`, taken from the epic branch. A name without a number (`feat/…`, `fix/…`) is legitimate locally: no PR opens from it |
28
28
  | task | a repository issue `[<КЛЮЧ>-<номер>] <Что не так>`, assignee the machine account; attached PR: `Closes #<номер>` in its body |
29
29
  | work queue | a GitHub Projects board, not bound to the repository: its `projectsV2` is empty, and a task lands on it only when added |
30
- | task state in the work queue | a board column ("Status"): created, in progress, in review; names in `implementation.md`. A closed task leaves by merge, not by column |
30
+ | task state in the work queue | a board column ("Status"): created, in progress, in review; names in `implementation.md`. A closed task leaves by merge, not by column. The epic card stands in the same columns and moves with its first task and its own PR |
31
31
  | PR about a task | PR title `[<КЛЮЧ>-<номер>] <Что сделано>` — the task's number and title turned into the done; commit type and scope stay out |
32
32
  | discussion of an edit | PR review: reviewer — the repository owner, assignee — the machine account, labels — the same as on the task |
33
33
  | record of an edit | `type(scope): description`, types `feat`, `fix`, `refactor`, `docs`, `style`, `test`, `chore`, `perf`; scopes: `implementation.md` |
@@ -50,7 +50,7 @@ flowchart TD
50
50
  Z -->|No| Y[The epic is created together with its tasks, and its branch is taken from main]
51
51
  Z -->|Yes| B[A command creates the task and it enters the work queue]
52
52
  Y --> B
53
- B --> C[The branch is named by the task number and taken from the epic branch; the column moves in the same motion]
53
+ B --> C[The branch is named by the task number and taken from the epic branch; the column moves in the same motion — the epic card too, on its first task]
54
54
  C --> D{The edit is ready}
55
55
  D -->|No| C
56
56
  D -->|Yes| E[Main is merged in, the gate set is run whole]
@@ -93,11 +93,10 @@ flowchart TD
93
93
  green on its own, and they collide on what one branch cannot show.
94
94
  - **The next work's branch is taken from the previous one while the chain is unbroken.** `git
95
95
  checkout -b <КЛЮЧ>-<номер>-<slug> <предыдущая ветка>`; from the epic branch — only the chain's
96
- first work. A chain stands inside one epic, where the next task edits what the previous wrote.
96
+ first work.
97
97
  - **A PR in a chain has the previous branch as its base, not main.** `gh pr create --base
98
- <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it. The host
99
- retargets a merged lower base only when its branch is deleted, so the base is retargeted by the
100
- same motion that merges the lower one — the call is in the pattern.
98
+ <предыдущая ветка>` — otherwise the review shows the edit mixed with all under it. The base is
99
+ retargeted by the same motion that merges the lower one — the call is in the pattern.
101
100
  - **A chain is merged bottom-up, and the order stands in every PR body.** Branch kinship is
102
101
  invisible in the list, and the line "stands on #<number>" is the only place it is read.
103
102
  - **`--hard` is not taken to drop a commit — that is `--soft`.** `reset --hard`, `checkout --
@@ -112,9 +111,8 @@ flowchart TD
112
111
  once: everything unmet is known on the first call.
113
112
  - **A condition known at the start of work is asked at the start.** Creating a branch refuses a base
114
113
  without main's tip and a foreign signature email: at push time the fix costs more.
115
- - **The form of a branch name is judged by the tree the command runs in.** A session works in a
116
- neighbouring tree by the owner's word, and the task key there is its own; a tree with no profile
117
- is not judged at all. A refusal on a lawful name has no bypass and stops the work whole.
114
+ - **The form of a branch name is judged by the tree the command runs in.** The task key of a
115
+ neighbouring tree is its own; a tree with no profile is not judged at all.
118
116
  - **The base judged is the one named by the command, not the tip of the working copy.** A branch is
119
117
  also created straight from `origin/main`, and that command takes the base fresh; a base the tree
120
118
  knows nothing of is not judged.
@@ -136,8 +134,15 @@ flowchart TD
136
134
  something to ask with.
137
135
  - **The task column moves in the same motion as the work.** Branch created — the task is in
138
136
  progress, PR opened — awaiting review; the move command does it, not GraphQL calls from memory.
137
+ - **The epic card moves by the same command, on the epic number, at two moments.** First task
138
+ taken — the epic is in progress; the PR of the epic into `main` opens — the epic awaits review.
139
+ `npm run task:move -- <номер эпика> in-progress`. Left in the first column while its tasks merge,
140
+ the epic reads as never started.
139
141
  - **A task left in the first column opens no PR.** By the work queue it reads as not taken, though
140
142
  the work is done and published. The tree names the first column itself; unnamed — not judged.
143
+ - **An open task standing in a closing column is a discrepancy.** That column says the work is
144
+ merged, and a merge closes the task itself: by the board such work reads as finished. The tree
145
+ names its closing columns itself; unnamed — not judged.
141
146
  - **The board holds tasks, not PRs about them.** A PR card has no column and never leaves the queue.
142
147
  The queue audit finds such cards, a line each.
143
148
  - **A lagging column is found by the queue audit, not by eye.** It judges the column by the PR both
@@ -153,12 +158,14 @@ flowchart TD
153
158
  does not split is marked.
154
159
  - **The tip of an open PR without a run is seen by the work queue audit, unless the pipeline does
155
160
  not wake for its base.** A page without a run looks the same as with a green one; where no run
156
- comes at all, its absence tells nothing and the audit is silent about that PR.
161
+ comes at all, the audit is silent about that PR.
157
162
  - **What checks a PR whose base is not the main branch is asked before the first PR of an epic
158
163
  opens.** The trigger either wakes for it as for one into main, or does not, and then the push
159
164
  gate is the only check behind the work — pattern `git-workflow-stack`.
160
165
  - **A run pushed out of the pipeline queue gets a separate audit line.** It looks failed though it
161
166
  never checked the branch, and the step count tells them apart.
167
+ - **The last run of the main branch is judged by the audit too: red and pushed out get lines of
168
+ their own.** The merge itself is checked by nobody; a pipeline asleep on a push to main is named.
162
169
  - **A draft with a green run on its tip is an audit discrepancy.** A green page permits nothing: the
163
170
  host locks the button.
164
171
  - **One's own drafts are judged all at once, not only the checked-out branch's.** Two signs — a
@@ -166,13 +173,12 @@ flowchart TD
166
173
  - **Opening a PR is refused while the branch carries its task folder.** Opening is the last point
167
174
  where the executor still sees the refusal.
168
175
  - **One's own open PRs are reread in three places: before a push, on taking a task and after every
169
- known merge.** A PR goes stale with no action by its author: a neighbouring work merged, and the
170
- rest lagged that second. Technique — `git-workflow-freshness`.
176
+ known merge.** A neighbouring merge stales the rest that second. Technique —
177
+ `git-workflow-freshness`.
171
178
  - **One's own conflicting PR is fixed by the turn's first action, and no new work is taken before
172
179
  that.** Work here means creating a task or a branch, moving the column and opening a PR.
173
180
  - **A conflicting PR of a neighbouring session is not one's own.** One's own branch is the one this
174
- working copy led — the machine account is shared and tells nothing apart. A neighbour's PR is
175
- named to the owner, and work is taken as usual.
181
+ working copy led; a neighbour's PR is named to the owner, and work is taken as usual.
176
182
  - **A conflicting open PR is a work queue audit discrepancy.** The conflict arrives with someone
177
183
  else's merge, and the host shows the mark only inside the PR.
178
184
  - **A document goes in the same commit as the edit.** The bypass is the line `Docs-skip: <reason>`
@@ -201,8 +207,7 @@ flowchart TD
201
207
  - **The main branch is taken by the remote ref — in words and in actions.** The local one is
202
208
  yesterday's snapshot and silent about it: by it a merged branch counts as unmerged.
203
209
  - **A code edit is handed to a person by an open PR, not by a pushed branch.** A branch reaches no
204
- inbox and has no discussion, and the PR opens in the turn the executor says the work is handed
205
- over.
210
+ inbox; the PR opens in the turn the work is said handed over.
206
211
  - **What is not ready to merge opens as a draft — `gh pr create --draft`.** The host locks a draft's
207
212
  merge button: everything waiting for a run, a rework or an answer goes as a draft.
208
213
  - **A PR the pipeline does not wake for opens ready, without `--draft`.** Which bases it wakes for
@@ -224,24 +229,20 @@ flowchart TD
224
229
  owner's words, not a list of leftovers.
225
230
  - **The working tree is emptied before the PR opens, not after.** `git status --porcelain` is asked
226
231
  in the same turn as the opening: what is uncommitted goes to the host by a commit before it, or
227
- is named. A push after the opening moves the tip past the green run the body names, and for that
228
- stretch the PR invites merging a tip nothing has checked.
232
+ is named. A push after the opening moves the tip past the green run the body names.
229
233
  - **A push into a branch that has an open PR is followed by rereading its body.** The statement
230
234
  about a green run names the tip by its sha, and moving the tip makes it false in silence: no check
231
235
  reads a PR body.
232
236
  - **The draft is not lifted while the PR has no review.** The guard reads the requested reviewer and
233
- the review left: a lifted draft reads as "may be merged", and there is nobody to merge. A call
234
- without a number is judged too — the client takes the PR of the current branch.
237
+ the review left: a lifted draft reads as "may be merged", and there is nobody to merge.
235
238
  - **The PR merge is pressed by a person, not by the work's executor.** Button and merge call are
236
- equal: one ban covers both. The executor merges their own PR only when a person said so about this
237
- PR; said about one, it does not carry to the next, and silence is never permission.
239
+ equal. The executor merges their own PR only when a person said so about this PR; said about
240
+ one, it does not carry to the next.
238
241
  - **The identity of the call opening a PR is guarded by the delivery guard, not by the executor's
239
- memory.** It shows in the command text only by an explicit token substitution. Judged is the clash
240
- with the reviewer, not the account name; where the author cannot be learnt, the substitution is
241
- demanded outright.
242
+ memory.** It shows in the command text only by an explicit token substitution; judged is the
243
+ clash with the reviewer, not the account name.
242
244
  - **The host client's active account is chosen per machine, not per tree; the machine account is
243
- substituted per call, never made active.** A login as the machine account hijacks every
244
- neighbouring session on the machine. Substitution is mandatory even with an active account.
245
+ substituted per call, never made active.** A login as it hijacks every neighbouring session.
245
246
 
246
247
  - **The PR author cannot be its reviewer.** GitHub accepts a self review request and silently does
247
248
  not create it. Only a request and a review not from the author count.
@@ -252,7 +253,7 @@ flowchart TD
252
253
  - **The board is edited by a GraphQL query by the board id, not by the owner's name.**
253
254
  - **The machine commit's email is copied from the companion, not typed from memory.** The address
254
255
  `<число>+<логин>@users.noreply.github.com` matches by the number: with a foreign one the commit
255
- leaves signed by a stranger. The guard refuses the push over it.
256
+ leaves signed by a stranger.
256
257
  - **The identity of the machine account is confirmed by the host's answer:** asked with the token,
257
258
  login and number come together.
258
259
  - **Guard scenarios set the git settings themselves, not take them from the machine.** Author, email
@@ -265,11 +266,10 @@ flowchart TD
265
266
  - **The author of an open PR and whether it has a reviewer are audited by the work queue.** Before the
266
267
  merge neither miss shows: a PR opened by a person never gets a reviewer.
267
268
  - **Reviewers are asked by a REST call, not by the client's selection.** Its fields come from GraphQL,
268
- which the account has no rights to: "matched" is not told from "nothing to ask with".
269
+ where the account has no rights.
269
270
 
270
271
  - **A second working copy is for reading, and the call goes from the copy the session stands in.**
271
- The gate runs its set where the session was started: someone else's uncommitted work refuses the
272
- call, and its own contribution passes unchecked.
272
+ The gate runs its set where the session was started, and a neighbour's uncommitted work refuses it.
273
273
  - **The working tree is not emptied for a tool run.** The comparison goes on a second copy: stashing
274
274
  takes uncommitted work where neither the tree state nor the audit sees it.
275
275
 
@@ -281,16 +281,14 @@ audit never judges the branch name.
281
281
 
282
282
  The guard does not move a task to in progress: it does not edit the board at all. The move is held
283
283
  by memory and the task creation command's hint; a task left in the first column the guard names at
284
- PR opening, other column discrepancies the queue audit finds.
285
-
286
- The freshness of main's tip the guard asks by the second tier — the same technique as the task
287
- state. The first tier works offline: the local ref answers whether the branch lags what lies in the
288
- tree, the remote one — whether the ref itself went stale.
284
+ PR opening, other column discrepancies the queue audit finds. The epic card is held by memory
285
+ alone: no guard reads its column at branch creation, and the queue audit does not judge it.
289
286
 
290
287
  ## Patterns
291
288
 
292
289
  - `git-workflow-commit` — task, branch, commit and push as the machine account.
293
- - `git-workflow-pr` — opening a PR, the draft and lifting it, the body, reviewer, labels, state.
290
+ - `git-workflow-pr` — opening a PR, the draft and lifting it, state, the checklist.
291
+ - `git-workflow-pr-body` — the link to the task, the body sample, how the task closes off main.
294
292
  - `git-workflow-merge` — the base merged into the branch standing on it, the conflict resolved.
295
293
  - `git-workflow-stack` — a chain of branches: branching from the previous, the PR base, the handover
296
294
  order.