@rt-tools/agent-kit 0.32.0 → 0.34.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 (75) hide show
  1. package/README.md +8 -7
  2. package/assets/agents/goal-critic.md +67 -0
  3. package/assets/agents/product-strategist.md +90 -0
  4. package/assets/agents/qa-engineer.md +3 -0
  5. package/assets/checks/board.github.mjs +27 -0
  6. package/assets/checks/check-specs.mjs +11 -2
  7. package/assets/checks/rt-kit-checks.config.mjs +6 -0
  8. package/assets/checks/spec-common.mjs +6 -3
  9. package/assets/checks/spec-scenarios.mjs +9 -1
  10. package/assets/checks/task-new.github.mjs +6 -0
  11. package/assets/checks/tree-assignment.mjs +11 -3
  12. package/assets/defaults/project.sh +10 -81
  13. package/assets/defaults/push.sh +100 -0
  14. package/assets/docs/GLOSSARY.md +4 -0
  15. package/assets/hooks/browser-guard-no-other-drivers.sh +6 -3
  16. package/assets/hooks/claim-guard.sh +6 -6
  17. package/assets/hooks/dispatch.sh +56 -3
  18. package/assets/hooks/exam-guard.sh +1 -1
  19. package/assets/hooks/git-guard-delivery-body.sh +25 -3
  20. package/assets/hooks/git-guard-delivery-folder.sh +17 -1
  21. package/assets/hooks/git-guard-delivery-merged.sh +65 -0
  22. package/assets/hooks/git-guard-delivery-pipeline.sh +99 -0
  23. package/assets/hooks/git-guard-delivery.sh +22 -8
  24. package/assets/hooks/git-guard-main.sh +17 -4
  25. package/assets/hooks/git-guard-push-ahead.sh +89 -0
  26. package/assets/hooks/git-guard-push-marks.sh +99 -0
  27. package/assets/hooks/git-guard-push-tests.sh +101 -83
  28. package/assets/hooks/git-guard-tree-assignment.sh +1 -1
  29. package/assets/hooks/grill-gate-options.sh +50 -0
  30. package/assets/hooks/grill-gate.sh +9 -1
  31. package/assets/hooks/pre-push.sh +113 -0
  32. package/assets/hooks/push-set.sh +150 -0
  33. package/assets/hooks/push-sign.sh +433 -0
  34. package/assets/hooks/rerun-guard.sh +14 -6
  35. package/assets/hooks/turn-exit-guard.sh +2 -2
  36. package/assets/hooks/turn-exit-patterns.sh +4 -3
  37. package/assets/hooks/turn-exit-verdict.sh +18 -1
  38. package/assets/hooks/waiting-turn-guard.sh +2 -1
  39. package/assets/hooks/write-targets.sh +21 -0
  40. package/assets/patterns/dependencies-upgrade.md +5 -1
  41. package/assets/patterns/git-workflow-commit.github.md +14 -0
  42. package/assets/patterns/git-workflow-pr-body.github.md +20 -3
  43. package/assets/patterns/git-workflow-pr.azure.md +30 -0
  44. package/assets/patterns/git-workflow-pr.github.md +57 -1
  45. package/assets/patterns/git-workflow-pr.gitlab.md +33 -0
  46. package/assets/patterns/mockups-measure.needs-mockups.md +19 -3
  47. package/assets/patterns/reuse-first-extend.md +5 -0
  48. package/assets/patterns/task-flow-close.md +27 -16
  49. package/assets/patterns/task-flow-start.md +5 -4
  50. package/assets/pitfalls/task-flow.md +4 -0
  51. package/assets/rules/browser-verification.md +4 -0
  52. package/assets/rules/dependencies.md +3 -1
  53. package/assets/rules/deploy-flow.azure.md +5 -0
  54. package/assets/rules/deploy-flow.github.md +5 -0
  55. package/assets/rules/deploy-flow.gitlab.md +5 -0
  56. package/assets/rules/git-workflow.azure.md +15 -0
  57. package/assets/rules/git-workflow.github.md +15 -0
  58. package/assets/rules/git-workflow.gitlab.md +15 -0
  59. package/assets/rules/mockups.needs-mockups.md +13 -5
  60. package/assets/rules/reuse-first.md +3 -0
  61. package/assets/rules/task-flow.md +21 -16
  62. package/assets/rules/testing.md +5 -0
  63. package/assets/samples/tasks/_template/plan.md +7 -0
  64. package/assets/skills/interface-review-annotate.needs-mockups.md +142 -0
  65. package/assets/skills/interface-review-icons.needs-app.md +136 -0
  66. package/assets/skills/interface-review-motion-states.needs-app.md +230 -0
  67. package/assets/skills/interface-review-motion.needs-app.md +209 -0
  68. package/assets/skills/interface-review-performance.needs-app.md +110 -0
  69. package/assets/skills/interface-review-principles.needs-app.md +263 -0
  70. package/assets/skills/interface-review-surfaces.needs-app.md +249 -0
  71. package/assets/skills/interface-review.needs-app.md +199 -0
  72. package/assets/skills/write-a-skill.md +16 -3
  73. package/assets/workflows/feature.js +33 -5
  74. package/assets/workflows/plan.js +71 -4
  75. package/package.json +1 -1
@@ -17,7 +17,7 @@
17
17
  # of the two changes the tree, and to the pattern they were indistinguishable from writing to a
18
18
  # working file: it saw the arrow itself and did not ask where it led. What stays as the sign is an
19
19
  # edit of a file by the editing tool and the commands listed here.
20
- work_re='git (add|commit|push|checkout|merge|rm)|npm run|pnpm (run|exec)|nx (build|test|run)|gh (pr|issue|api|run)|task:(new|move)|mkdir|cp |mv |rm |sed -i|tee '
20
+ work_re='git (add|commit|push|checkout|merge|rm)|npm run|pnpm (run|exec)|nx (build|test|run)|gh (pr|issue|api|run)|glab (mr|ci|issue|api)|task:(new|move)|mkdir|cp |mv |rm |sed -i|tee '
21
21
 
22
22
  # Exploration. The same words as in the work pattern, but the subcommand is a reading one:
23
23
  # switching a branch, pulling, looking through the history, reading PRs and runs. The work pattern
@@ -29,7 +29,7 @@ work_re='git (add|commit|push|checkout|merge|rm)|npm run|pnpm (run|exec)|nx (bui
29
29
  # Exploration looks like work better than anything else: it has commands, numbers and exact answers.
30
30
  # That is what makes it dangerous — a turn stuffed with it reads as full both to the owner and to
31
31
  # the session itself.
32
- read_re='^[[:space:]]*(([^[:space:]]*/)?git[[:space:]]+(show|log|ls-tree|ls-files|ls-remote|diff|status|branch|tag|rev-parse|remote|describe|blame|fetch|pull|(checkout|switch)(?!([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-[bc][[:space:]]))|([^[:space:]]*/)?gh[[:space:]]+(pr|issue|run|repo)[[:space:]]+(list|view|status|checks|diff|download|logs))([[:space:]]|$)'
32
+ read_re='^[[:space:]]*(([^[:space:]]*/)?git[[:space:]]+(show|log|ls-tree|ls-files|ls-remote|diff|status|branch|tag|rev-parse|remote|describe|blame|fetch|pull|(checkout|switch)(?!([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-[bc][[:space:]]))|([^[:space:]]*/)?gh[[:space:]]+(pr|issue|run|repo)[[:space:]]+(list|view|status|checks|diff|download|logs)|([^[:space:]]*/)?glab[[:space:]]+(mr|issue|ci|repo)[[:space:]]+(list|view|status|diff|trace|get))([[:space:]]|$)'
33
33
 
34
34
  # The parts of a compound command are judged one by one: a turn gathers reading and work into one
35
35
  # line through `&&`, and judging it whole would release exploration on the very first changing part.
@@ -66,7 +66,8 @@ standing_work_re='работай[^.]{0,40}(без остановок|без па
66
66
 
67
67
  # Handing work over and starting the next. The rule calls handed-over work a lawful end of a turn —
68
68
  # but on a condition: the next one is started, and an ACTION has been done on it, not spoken.
69
- handover_re='gh[[:space:]]+pr[[:space:]]+create'
69
+ # The GitLab client opens a merge request — the same handing over.
70
+ handover_re='gh[[:space:]]+pr[[:space:]]+create|glab[^|;&]*mr[[:space:]]+create'
70
71
  started_re='task:new|task:move|board\.mjs[[:space:]]+move|git[[:space:]]+checkout([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-b|git[[:space:]]+switch([[:space:]]+-[A-Za-z-]+)*[[:space:]]+-c'
71
72
 
72
73
  # How many steps of the plan are not done yet. The progress mirrors the steps of the plan with a
@@ -42,6 +42,23 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg work "$work_re
42
42
  # depend on it is done while it runs — the turn does not end on the launch itself.
43
43
  | (($last_name | test("^(Agent|Task)$")) or (($last_name == "Bash") and ($last | test("&[[:space:]]*$")))) as $launched_last
44
44
  | (($last_name == "Bash") and ($last | test($wait))) as $waited
45
+ # A turn woken by a notification about an own background task. The notification is written under
46
+ # the role of the owner, and the turn it opens holds nothing to do while another own task still
47
+ # runs. The launches are read over the whole window; a launch ends with a notification naming its
48
+ # call, whether it woke a turn or arrived as an attachment in the middle of one. Such a turn
49
+ # gets no verdict at all, and the guard lets an empty verdict through: the guard has no room.
50
+ | (if $i == null then false else
51
+ ((.[$i].origin.kind // "") == "task-notification")
52
+ or ((.[$i].message.content // "") | if type == "string" then test("^[[:space:]]*<task-notification>") else false end)
53
+ end) as $woken
54
+ | ([.[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "tool_use")
55
+ | select(((.name // "") | test("^(Agent|Task)$")) or (((.name // "") == "Bash") and (.input.run_in_background // false)))
56
+ | (.id // empty)]) as $launches
57
+ | ([.[] | ((.message.content // "") | if type == "string" then . else "" end), (.attachment.prompt // "")
58
+ | select(test("<task-notification>"))
59
+ | select(test("<status>(completed|failed|killed|stopped)</status>"))
60
+ | (capture("<tool-use-id>(?<id>[^<]+)</tool-use-id>").id // empty)]) as $finished
61
+ | ($woken and (($uses | length) == 0) and (($launches - $finished) | length) > 0) as $woken_waiting
45
62
  # Handing the work over: the tail of the turn after the PR was opened. Everything before it was
46
63
  # done on the task handed in and says nothing about the next one.
47
64
  | ([$uses[] | select((.name // "") == "Bash") | (.input.command // "")]) as $cmds
@@ -127,6 +144,6 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg work "$work_re
127
144
  or (((.name // "") == "Bash") and ([(.input.command // "") | splits($part)] | map(test($work) and (test($read) | not) and (test("^[[:space:]]*([^[:space:]]*/)?git[[:space:]]+(add|commit|push)") | not)) | any))
128
145
  ) | any) as $after_progress
129
146
  | (($last_name == "Bash") and ($last | test($started)) and ($handed_over | not)) as $only_took
130
- | { promised: $promised, only_took: $only_took, asked: $asked, handed_by_hand: ($handed and (($asked or $denied or $told_stop) | not)), standing_work: $standing_work, worked: ($edited or $ran_work), released: ($asked or $denied or $handed or $told_stop), waited: $waited, handed_over: $handed_over, started_next: $started_next, ended_working: $ended_working, asked_in_prose: $asked_in_prose, awaits_word: $awaits_word, progress_edited: $progress_edited, after_progress: $after_progress, launched_last: $launched_last, ran: $ran, unpushed_named: $unpushed_named }
147
+ | if $woken_waiting then empty else { promised: $promised, only_took: $only_took, asked: $asked, handed_by_hand: ($handed and (($asked or $denied or $told_stop) | not)), standing_work: $standing_work, worked: ($edited or $ran_work), released: ($asked or $denied or $handed or $told_stop), waited: $waited, handed_over: $handed_over, started_next: $started_next, ended_working: $ended_working, asked_in_prose: $asked_in_prose, awaits_word: $awaits_word, progress_edited: $progress_edited, after_progress: $after_progress, launched_last: $launched_last, ran: $ran, unpushed_named: $unpushed_named } end
131
148
  ' 2>/dev/null)"
132
149
  }
@@ -84,7 +84,8 @@ taken_path_re='/tasks/'
84
84
  # Lifting the draft is the obvious case; reading the run is the one where there is nothing to lift
85
85
  # yet, but the executor looked instead of saying "waiting". Two ready PRs stood as drafts precisely
86
86
  # because the next task was taken instead of this, not on top of it.
87
- ready_re='pr[[:space:]]+ready|run[[:space:]]+(list|view|watch)|pr[[:space:]]+checks|check-runs|check:board|board\.mjs'
87
+ # The GitLab client lifts the draft by an update with a flag and reads the pipeline by `ci`.
88
+ ready_re='pr[[:space:]]+ready|run[[:space:]]+(list|view|watch)|pr[[:space:]]+checks|check-runs|check:board|board\.mjs|glab[^|;&]*mr[[:space:]]+update[^|;&]*(--ready|[[:space:]]-r)([[:space:]]|$)|glab[^|;&]*ci[[:space:]]+(status|view|list|trace|get)'
88
89
 
89
90
  # A run started or rerun in the turn. Its outcome does not call by itself: a rerun went through in
90
91
  # one line between other things, its state was read once — «queued» — and the turn ended by a lawful
@@ -64,6 +64,27 @@ rt_write_targets() {
64
64
  }
65
65
  ')"
66
66
 
67
+ # An arrow inside quotes is text of the command, not a redirection: `echo "a->b"` and the code
68
+ # of `node -e "[1].map(x => x)"` read as writes into `b` and `x)` and were refused as edits.
69
+ # The quote state is kept per line; a backslash outside single quotes escapes the next sign.
70
+ rt_wt_shell="$(printf '%s\n' "$rt_wt_shell" | awk -v sq="'" '
71
+ function drop_quoted_arrows(s, out, i, c, q, n) {
72
+ out = ""; q = ""; n = length(s)
73
+ for (i = 1; i <= n; i++) {
74
+ c = substr(s, i, 1)
75
+ if (c == "\\" && q != sq && i < n) { out = out c substr(s, i + 1, 1); i++; continue }
76
+ if (q != "") {
77
+ if (c == q) { q = "" } else if (c == ">") { continue }
78
+ } else if (c == "\"" || c == sq || c == "`") {
79
+ q = c
80
+ }
81
+ out = out c
82
+ }
83
+ return out
84
+ }
85
+ { print drop_quoted_arrows($0) }
86
+ ')"
87
+
67
88
  {
68
89
  printf '%s' "$rt_wt_shell" \
69
90
  | tr "\"'\`" ' ' \
@@ -31,7 +31,11 @@ stop the install.
31
31
  ## Order
32
32
 
33
33
  1. `package.json` — exact numbers, not a single `^` or `~`.
34
- 2. `pnpm install`; the snapshot goes in the same commit.
34
+ 2. `pnpm install`; the snapshot goes in the same commit. Then `pnpm install --frozen-lockfile`, in
35
+ every repository the edit goes to. Tests, the build and the linter run on modules already
36
+ installed and do not read the snapshot: a range in the declaration against an exact number in
37
+ the snapshot is found only by the strict install, and in a release pipeline that is after the
38
+ merge.
35
39
  3. The styling properties the tree reads from the package are checked against the new version by
36
40
  a command, not by a look: a removed property makes the declaration invalid, not wrong, and
37
41
  every check stays green. Every name from `var(--<prefix>-…)` in the tree is searched for in
@@ -169,6 +169,17 @@ A name without a number (`feat/…`, `fix/…`) is legitimate while the branch l
169
169
  trial and an analysis. No PR opens from it: an edit that reaches the main branch starts with a
170
170
  task.
171
171
 
172
+ **A local branch that continues an open PR under another name is tied to the PR's branch before
173
+ the first push.** Otherwise it has no upstream: the push goes nowhere by itself, and the turn-exit
174
+ guard counts every commit as not handed over while all of them already stand in the PR. The tie
175
+ and the push name the PR's branch:
176
+
177
+ ```bash
178
+ git branch --set-upstream-to=origin/<ветка PR>
179
+ git push origin HEAD:<ветка PR>
180
+ git rev-list --count @{u}..HEAD # 0 — everything is on the host
181
+ ```
182
+
172
183
  ## The task column moves together with the work
173
184
 
174
185
  Branch created — the task is no longer in `📋 Backlog` but in progress. PR opened — it awaits
@@ -289,3 +300,6 @@ as in `git commit -F -` with the text after it.
289
300
  with a zero exit. The defaults are sourced first, and the line count is compared with the last
290
301
  push before the run.
291
302
  - The owner's edit takes neither the token nor the variables — they are only for machine work.
303
+ - A commit into the branch of a merged PR reaches no one: the host deleted the branch, and a push
304
+ creates it anew with an answer `new branch`. The delivery guard refuses such a push and names the
305
+ merged PR. The commit moves to a new branch from the fresh base by `git cherry-pick`.
@@ -98,9 +98,14 @@ things about the tree, and the tree has changed since.
98
98
 
99
99
  ## PR body sample
100
100
 
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.
101
+ Six sections, and one order between them: the link line, what was done, the points, the goal, what
102
+ confirms it, the remaining step. A section with nothing to say says so in words — an empty heading
103
+ and a removed heading read alike and mean different things.
104
+
105
+ The table of points comes from the reply of the role `product-strategist`: a sign not run is
106
+ written as not run, and its point as not reached. The table of the goal comes from the reply of the
107
+ role `goal-critic`. Both go in word for word, and the critic reads the finished body against the
108
+ replies.
104
109
 
105
110
  ```markdown
106
111
  Closes #86
@@ -109,6 +114,18 @@ Closes #86
109
114
 
110
115
  - <правка, названная тем, что она меняет для читателя, а не тем, какие файлы задела>
111
116
 
117
+ ## Точки
118
+
119
+ | Точка | Признак | Результат |
120
+ | --- | --- | --- |
121
+ | <изменение, которое увидит человек> | <команда, страница или число> | <вывод признака: достигнута или промах> |
122
+
123
+ ## Цель
124
+
125
+ | Слова владельца | Что показывает результат | Итог |
126
+ | --- | --- | --- |
127
+ | <дословная цитата> | <что видно в результате> | <выполнено или нет> |
128
+
112
129
  ## Чем подтверждено
113
130
 
114
131
  - <проверка>: <её вывод одной строкой>
@@ -160,6 +160,36 @@ An open PR means the work item awaits review — the state is moved in the same
160
160
  npm run task:move -- 86 in-review
161
161
  ```
162
162
 
163
+ ## Answering under remarks
164
+
165
+ Remarks on a PR live in threads, and the client has no command for them, so they go through the
166
+ REST call of the same client. They are read at once, before the first edit:
167
+
168
+ ```bash
169
+ az devops invoke --area git --resource pullRequestThreads \
170
+ --route-parameters project=<проект> repositoryId=<репозиторий> pullRequestId=<номер> \
171
+ --api-version 7.1 --query "value[?comments[0].commentType=='text'].{id:id, text:comments[0].content}"
172
+ ```
173
+
174
+ The person is asked by the asking tool whether to answer under them, in the turn the remarks were
175
+ read. The answer holds for this PR. Silence is not a yes: a message on the host stays there, and
176
+ it goes out under an account the person answers for.
177
+
178
+ After a yes every thread gets its own answer, once the edit has reached the host: a commit named
179
+ before the push does not exist for the reader yet.
180
+
181
+ ```bash
182
+ az devops invoke --area git --resource pullRequestThreadComments --http-method POST \
183
+ --route-parameters project=<проект> repositoryId=<репозиторий> pullRequestId=<номер> threadId=<id> \
184
+ --in-file ответ.json --api-version 7.1
185
+ ```
186
+
187
+ The file holds `{"content": "<текст>", "commentType": 1}`.
188
+
189
+ An answer is written in the owner's language and names one of two things: the commit that closes
190
+ the remark, or why the remark is declined. The count of answers is compared with the count of
191
+ threads read at the start: a remark left without one is a remark the person checks again by hand.
192
+
163
193
  ## What is checked before the PR is published
164
194
 
165
195
  The pipeline sees only what was sent, and it is sent by a push. Linters, unit tests and hook
@@ -139,6 +139,25 @@ no longer on the server: the push will not update it but create it anew, and the
139
139
  stays outside the main branch. The push answer says this with a new-branch mark instead of a list
140
140
  of commits — otherwise it looks exactly like a successful push.
141
141
 
142
+ **After a push that carries a merge of the base, the PR's count is matched against the comparison
143
+ of the branches.** The host counts the commits and files of a PR from the base commit it stored
144
+ when the PR opened or was last retargeted, and a push does not always move it. The base merged into
145
+ the branch then shows inside the PR as its own work: a PR with 30 commits of its own read as 153
146
+ with 371 files, while the comparison of the same branches answered 30 at the same minute. The count
147
+ is asked from both sides:
148
+
149
+ ```bash
150
+ $GH api "repos/$REPO/pulls/321" --jq '{base: .base.sha[0:9], commits: .commits, files: .changed_files}'
151
+ $GH api "repos/$REPO/compare/<база>...<ветка>" --jq '{ahead: .ahead_by, behind: .behind_by}'
152
+ ```
153
+
154
+ `commits` other than `ahead` is cured by setting the same base again — the host recounts the PR in
155
+ the same answer:
156
+
157
+ ```bash
158
+ $GH api -X PATCH "repos/$REPO/pulls/321" -f base=<база> --jq '{base: .base.sha[0:9], commits: .commits}'
159
+ ```
160
+
142
161
  **The run's outcome is read by a separate call, not by the wait's return code.** The client
143
162
  command that waits for the run's end returns zero on red too: it waited for the end, not for
144
163
  success. Read as an outcome, this zero makes green what fell, and what was said to the owner
@@ -155,6 +174,42 @@ This is not written as bare GraphQL by project, item and field option ids: the c
155
174
  them itself, and a query assembled from memory silently sets the wrong column — the board has no
156
175
  refusal for that.
157
176
 
177
+ ## Answering under remarks
178
+
179
+ Remarks arrive on a PR in three places: a comment on a line, the text of a review and a comment in
180
+ the conversation. All three are read at once, before the first edit:
181
+
182
+ ```bash
183
+ gh api repos/<владелец>/<репозиторий>/pulls/<номер>/comments --paginate \
184
+ --jq '.[] | {id, user: .user.login, path, body}'
185
+ gh api repos/<владелец>/<репозиторий>/pulls/<номер>/reviews --paginate \
186
+ --jq '.[] | select(.body != "") | {id, user: .user.login, body}'
187
+ gh api repos/<владелец>/<репозиторий>/issues/<номер>/comments --paginate \
188
+ --jq '.[] | {id, user: .user.login, body}'
189
+ ```
190
+
191
+ The person is asked by the asking tool whether to answer under them, in the turn the remarks were
192
+ read. The answer holds for this PR. Silence is not a yes: a message on the host stays there, and
193
+ it goes out under an account the person answers for.
194
+
195
+ After a yes every remark gets its own answer, once the edit has reached the host: a commit named
196
+ before the push does not exist for the reader yet.
197
+
198
+ ```bash
199
+ gh api -X POST repos/<владелец>/<репозиторий>/pulls/<номер>/comments/<id>/replies \
200
+ -F body=@ответ.md
201
+ ```
202
+
203
+ The text of a review has no thread of its own, so the answer to it goes into the PR conversation:
204
+
205
+ ```bash
206
+ gh api -X POST repos/<владелец>/<репозиторий>/issues/<номер>/comments -F body=@ответ.md
207
+ ```
208
+
209
+ An answer is written in the owner's language and names one of two things: the commit that closes
210
+ the remark, or why the remark is declined. The count of answers is compared with the count of
211
+ remarks read at the start: a remark left without one is a remark the person checks again by hand.
212
+
158
213
  ## What is checked before the PR is published
159
214
 
160
215
  There are no checks on the PR itself: the rollout starts with a push into the main branch, and
@@ -195,7 +250,8 @@ push gate — below is what it does not know.
195
250
  12. **The work queue matches** — `npm run check:board`. The task is on the board, with an
196
251
  assignee and the number in the title; one PR per task, and it closes the task whole.
197
252
  13. **The PR state is read, not derived from return codes** — author `<бот>`, reviewer — the
198
- owner, labels the same as on the task. The owner is told what was read.
253
+ owner, labels the same as on the task, the commit count equal to `ahead_by` of the branch
254
+ comparison. The owner is told what was read.
199
255
  14. **The set is taken from the pipeline file, not assembled from memory.** The push gate is
200
256
  narrower by design: it stands between the command and the push, and everything longer than
201
257
  seconds is taken out of it. What the pipeline runs is written in its file — that list is
@@ -176,6 +176,39 @@ An open MR means the task awaits review — the list is moved in the same motion
176
176
  npm run task:move -- 86 in-review
177
177
  ```
178
178
 
179
+ ## Answering under remarks
180
+
181
+ Remarks on an MR live in discussions, a thread each: a note on a line and a single note in the
182
+ conversation are both among them. They are read at once, before the first edit:
183
+
184
+ ```bash
185
+ glab api projects/:id/merge_requests/<номер>/discussions --paginate \
186
+ | jq '.[] | {id, notes: [.notes[] | select(.system | not) | {author: .author.username, body}]}'
187
+ ```
188
+
189
+ The person is asked by the asking tool whether to answer under them, in the turn the remarks were
190
+ read. The answer holds for this MR. Silence is not a yes: a message on the host stays there, and
191
+ it goes out under an account the person answers for.
192
+
193
+ After a yes every discussion gets its own answer, once the edit has reached the host: a commit
194
+ named before the push does not exist for the reader yet.
195
+
196
+ ```bash
197
+ glab api -X POST projects/:id/merge_requests/<номер>/discussions/<id>/notes \
198
+ -f "body=$(cat ответ.md)"
199
+ ```
200
+
201
+ A comment outside a discussion has no thread of its own, so the answer to it goes under the MR:
202
+
203
+ ```bash
204
+ glab mr note <номер> --message "$(cat ответ.md)"
205
+ ```
206
+
207
+ An answer is written in the owner's language and names one of two things: the commit that closes
208
+ the remark, or why the remark is declined. The count of answers is compared with the count of
209
+ discussions read at the start: a remark left without one is a remark the person checks again by
210
+ hand.
211
+
179
212
  ## What is checked before the MR is published
180
213
 
181
214
  There are no checks on the MR itself until the pipeline is started, and a push starts it.
@@ -2,7 +2,7 @@
2
2
  name: mockups-measure
3
3
  kind: pattern
4
4
  rule: mockups
5
- description: Pattern of rule mockups. Load before the frames of a mockup are shown to the owner — reading the bounds of the sheet's frames and of the buttons inside them in one call, overlapping pairs and the distinct tops of a row. Not for checking a running page — that is the rule browser-verification.
5
+ description: Pattern of rule mockups. Load before frames are shown to the owner and when a design file is audited — reading the bounds of frames and buttons in one call, overlapping pairs, tops of a row, comparing a file page with the code. Not for a running application — that is the rule browser-verification.
6
6
  ---
7
7
 
8
8
  # Measuring a mockup
@@ -13,16 +13,32 @@ Pattern of the rule `mockups`. What must be true — the law `docs/constitution/
13
13
 
14
14
  - The frames of a sheet are about to be shown to the owner.
15
15
  - A row of cards, a toolbar or a form is drawn at a width other than the desktop one.
16
+ - A design file is audited.
16
17
 
17
18
  ## A mockup is measured by node coordinates
18
19
 
19
- A frame in a design tool makes a layout claim, just like a page. A look at its screenshot misses the
20
- same things: the buttons of a card row are off one line, or frames on the sheet overlap. Before the
20
+ A frame in a design tool makes a layout claim, just like a running screen. A look at its screenshot
21
+ misses the same things: the buttons of a card row are off one line, or frames on the sheet overlap. Before the
21
22
  frames are shown to the owner, one call reads the bounds of the sheet's top-level frames and of the
22
23
  buttons inside them. It prints the overlapping pairs and each row's distinct button tops. Two
23
24
  values in one row are the defect.
24
25
 
26
+ ## An audit compares every file page with the code
27
+
28
+ A file page is a page of the design file, never a page of the application. The audit starts with
29
+ one call that lists the file pages and the kit components each draws; a file page with several
30
+ components counts for each of them. That list opens the report, and a report without it closes
31
+ nothing. Each file page on the list is captured, and the picture is put next to the template and
32
+ styles of its components. The question for every file page is one: does the code draw this. Each
33
+ drawn shape is then read from the node properties — arc data, corner radii, variable modes — and
34
+ compared with the code by numbers. A defect found is searched for across the whole file: it repeats
35
+ on other file pages. The report marks every line of the list as compared or as not captured, and
36
+ with even one of the second kind the audit stays open.
37
+
25
38
  ## Common misses
26
39
 
27
40
  - **At the tablet width the buttons of a card row stood at different heights, and frames on the
28
41
  sheet overlapped.** The owner found both; one call reading node bounds would have shown them.
42
+ - **An audit was called finished by inputs, names and the list of variants.** The spinner arc stood
43
+ on four pictures as a sector and was called normal, because nobody asked whether the code draws
44
+ it so.
@@ -43,6 +43,11 @@ A clone written next to it takes the edits onto itself and diverges from the ori
43
43
  first one. A renamed file and a "similar but own" component are the same departure, only
44
44
  undeclared.
45
45
 
46
+ Before the kit PR is merged, the tree that ordered the edit runs its end-to-end suite against the
47
+ packed build of that branch. The build is unpacked over the installed package without touching the
48
+ declaration. The kit's own tests do not know the screen it stands on — a dialog over a side panel, a
49
+ button whose state the consumer binds — and a defect found after the merge costs a second release.
50
+
46
51
  ## One's own primitive — only with the owner's approval
47
52
 
48
53
  Asked before the first file is written. The same goes for one's own base and one's own inline
@@ -14,9 +14,9 @@ Pattern of the rule `task-flow`. What must be true meanwhile — the law
14
14
 
15
15
  - The stages of the plan are closed.
16
16
  - `npm run check:specs` listed the agreement in its "time to merge" section.
17
- - The spec is measured for length right after the merge: one that has grown is split by the same
18
- commit.
19
- - The domain texts are brought up to what the work did.
17
+ - The spec is measured for length before the merge and right after it: one already over the limit is
18
+ split by a commit of its own first, one that has grown is split by the same commit.
19
+ - The domain texts are up to date, and `product-strategist` reviews the work against its points.
20
20
  - The gate suite is run whole — after the merge and the texts, not before them.
21
21
  - The task folder is taken apart, and the PR opens — a draft or ready, by the base.
22
22
  - The run on the head is green, and the draft is lifted from the PR.
@@ -39,10 +39,17 @@ By one of the last commits of the branch, before the PR opens. By then the code
39
39
  npm run check:specs # the "time to merge" section names the ready directories
40
40
  ```
41
41
 
42
- **The spec is measured for length in the same turn.** Merging is a known move that grows a spec. One
43
- merge took it to 572 lines against a limit of 500, and the executor learned of it from the push
44
- guard's refusal — after the commit. One that has grown is split into subdomains right here, not on
45
- the push.
42
+ **The spec is measured for length before the merge, and again in the same turn after it.** Merging
43
+ is a known move that grows a spec. One merge took it to 572 lines against a limit of 500, and the
44
+ executor learned of it from the push guard's refusal — after the commit. One that has grown is split
45
+ into subdomains right here, not on the push.
46
+
47
+ A spec grows by direct edits too, and a measure taken only after the merge leaves that excess to
48
+ every next merge: one domain spec stood at 885 lines and its scenarios at 1293 before any of nine
49
+ waiting agreements. So the measure goes first: a spec already over the limit is split by a commit
50
+ of its own, and the agreement merges after it. The same holds for a rule or a scenario added to a
51
+ spec directly, with no agreement: the room is measured before the edit, not learned from the push
52
+ set after the work.
46
53
 
47
54
  The order of the move:
48
55
 
@@ -93,14 +100,12 @@ and all the rules need not be read.
93
100
  What is stale lies most often in four places, and all four are read whole:
94
101
 
95
102
  - **"What of the law is not here" in a rule.** The spec audit does not read this section, so an
96
- untruth lives there as long as it likes. For three tasks in a row a rule wrote that the tree
97
- lacked the needed mechanism — and it was there;
103
+ untruth lives there as long as it likes;
98
104
  - **"What is not included" in a domain spec.** A task boundary was written there, and the task is
99
105
  long closed;
100
106
  - **"Where it lives" in a rule.** Files move, the paths in the table stay;
101
- - **A statement of a companion about what the tree does not have.** It is written when the subject
102
- does not exist yet and lives on words about emptiness — no domain specs here, not a scenario
103
- created, six records. One piece of work creates the subject, and nobody rereads the companion.
107
+ - **A statement of a companion about what the tree does not have.** Written before the subject
108
+ exists, it lives on words about emptiness, and nobody rereads it once the subject appears.
104
109
 
105
110
  ```bash
106
111
  # where the rule and the specs speak of what the work touched
@@ -113,13 +118,19 @@ grep -rn -iE "(нет|ни одного|пока|всего|записей) [0-9
113
118
 
114
119
  **A law is not edited in the branch.** An article of a law is an agreement with the owner, and the
115
120
  owner changes it. The work diverged from it — the ready-made text of the article is written: into
116
- the progress and into the PR body. The law file is edited after the answer. The same with
117
- application laws: payments, locales and access are the same agreement, only about this application.
121
+ the progress and into the PR body. The law file is edited after the answer, an application law too.
118
122
 
119
123
  What was done at this step is written into the PR body: what was re-read, what was changed, and if
120
124
  nothing was changed — why. The form of the section — pattern `git-workflow-pr-body`. The body fits
121
- the host's length limit — Azure DevOps takes 4000 characters — so the report is one line per text,
122
- not prose: a body over the limit refuses the opening call, and it gets cut in a hurry.
125
+ the host's length limit — Azure DevOps takes 4000 characters — so the report is one line per text.
126
+
127
+ **The role `product-strategist` reviews the work while the folder still lies here.** It runs the sign
128
+ of each point in the plan and tries to prove the miss. A proved miss is fixed now or named in the PR
129
+ body next to the table of points. Before the PR of an epic the same call judges the milestone.
130
+
131
+ **The role `goal-critic` compares the result with the owner's words in the same state.** It gets the
132
+ words verbatim and the result, without the plan or an account of the work. A session calls it before
133
+ saying the work is done. Its reply is not reworded: a disagreement goes under it as a session line.
123
134
 
124
135
  **Next move:** the updated texts are committed, and in the same turn the task folder is taken apart
125
136
  — by the last commit of the branch, pattern `task-flow-archive`.
@@ -145,9 +145,9 @@ There will be no more questions — from here on, the roles:
145
145
  Workflow(name: "plan", args: "docs/tasks/_draft-<slug>")
146
146
  ```
147
147
 
148
- Need → the product agreement (`spec-writer`) → its adversarial review (`spec-critic`) → the plan and
149
- the breakdown (`project-manager`). Gaps the roles could not close return to the owner — the main
150
- agent carries them.
148
+ Need → the points (`product-strategist`) → the product agreement (`spec-writer`) → its adversarial
149
+ review (`spec-critic`) → the plan and the breakdown (`project-manager`) → `goal-critic`. Gaps the
150
+ roles could not close return to the owner — the main agent carries them, and the route's misses.
151
151
 
152
152
  The agreement that came out of the pipeline is checked against `grill.md` line by line before work
153
153
  by it. The role writes the text without seeing the owner and can turn their answer into its
@@ -178,7 +178,8 @@ npm run task:new -- --epic --title '<Возможность, которая ра
178
178
  The call puts the epic label on the card, lays a draft of the plan in the tree's directory of plans
179
179
  and writes the path to it into the body: the audit reads the plan by that path, and a card without
180
180
  it points into emptiness. Everything the epic cannot be created without is asked before the card is
181
- made — an administrator alone can take a made one off the board.
181
+ made — an administrator alone can take a made one off the board. What the call does not write — a
182
+ file of epics, an index of plans — the tree lists as hand steps of the same commit as the plan.
182
183
 
183
184
  The draft is filled in by hand, and three things in it are derived from nothing: the opportunity in
184
185
  one phrase, the makeup of the tasks in order, and how the branches of the tasks stand. A set without
@@ -7,6 +7,10 @@ The rule is `task-flow`; the articles that hold the law stand there.
7
7
 
8
8
  ## Pitfalls
9
9
 
10
+ - **A suspicion of a defect put off "until later" is postponed work, and the promise in the reply is
11
+ no record of it.** It goes into the queue as a task, or as a line «not checked» in the record of
12
+ the task where it was noticed. Each turn writes its summary anew: within three tasks the suspicion
13
+ about a menu turned into a remark about its look.
10
14
  - **A task picked into an epic by its body can be closed before the work starts.** Weeks pass
11
15
  between creating a task and taking it, and all that time the tree is edited by neighbouring work:
12
16
  two tasks of one epic had three parts out of four already done — the body described the tree of a
@@ -128,6 +128,10 @@ flowchart TD
128
128
  shown names the branch it was built from. One such showing cost two turns: the owner repeated a
129
129
  remark whose edit had long been made, and the executor set about explaining a defect already
130
130
  fixed.
131
+ - **An edit of a shared frame is checked on every screen under it.** A frame, a layout or a shell
132
+ edited for one page changes the rest under it, and those pages show in no diff. The list of screens
133
+ is read from what the frame shows, not from the page the task named, and the suite that walks them
134
+ runs before the push. The one page checked reads as the whole edit checked.
131
135
  - **The work branch keeps the tip of main merged in the whole time, not only before delivery.** A
132
136
  branch that has fallen behind builds into a stand with neither others' edits nor one's own
133
137
  neighbouring ones. What is shown on it describes a tree nobody has. The tip is pulled in when its
@@ -65,7 +65,9 @@ flowchart TD
65
65
  neither the linter, nor the build, nor the tests read styling properties, and the person at the
66
66
  screen sees the breakage. Gone into a shared update, such a raise is reverted only together with
67
67
  the others, and tying the breakage to it costs a separate investigation; its own branch is
68
- reverted alone.
68
+ reverted alone. A feature that needs a component several releases ahead raises the skipped ones
69
+ first, by that task of its own, and its branch takes only the last step: each skipped release
70
+ brings changes of its own, and in the feature branch they read as the feature's breakage.
69
71
 
70
72
  ## What of the law is not here
71
73
 
@@ -88,6 +88,11 @@ flowchart TD
88
88
  - **A PR is checked before the merge by the same pipeline as the main branch.** Checks and image
89
89
  builds go on the PR check pipeline, the rollout does not: it is held by the main-branch
90
90
  condition on its step, and a PR image does not leave for the registry.
91
+ - **A package the tree's own applications install is released from a tip their end-to-end suites
92
+ went green on.** Where the release pipeline runs none of these suites, a PR merged past the
93
+ pipeline reaches them first after the release. When a PR without a green run of its own entered
94
+ the main branch after the last green run of a PR merged into it, those suites must go green on
95
+ the tip of the main branch before the release.
91
96
  - **A divergence of production from the main branch is visible by the work queue audit.** A work
92
97
  item leaves the queue by a merge, but a merge is not yet production: a failed or unstarted rollout
93
98
  touches neither the item nor its state, and there is nowhere to notice it. The audit asks for
@@ -147,6 +147,11 @@ flowchart TD
147
147
  runner pays a whole run for every PR into an epic branch, and pays it for checks the push gate
148
148
  has already run on the same machine; a tree with runners to spare buys the earlier refusal. The
149
149
  answer is written in the pipeline file next to the trigger, together with what is lost by it.
150
+ - **A package the tree's own applications install is released from a tip their end-to-end suites
151
+ went green on.** Where the release pipeline runs none of these suites, a PR merged past the
152
+ pipeline reaches them first after the release. When a PR without a green run of its own entered
153
+ the main branch after the last green run of a PR merged into it, those suites must go green on
154
+ the tip of the main branch before the release.
150
155
  - **A divergence of production from the main branch is visible by the work queue audit.** A task
151
156
  leaves the queue by a merge, but a merge is not yet production: a failed or unstarted rollout
152
157
  touches neither the task nor its column, and there is nowhere to notice it. The audit asks for
@@ -90,6 +90,11 @@ flowchart TD
90
90
  - **A PR is checked before the merge by the same pipeline as the main branch.** Checks and image
91
91
  builds go on the MR pipeline, the rollout does not: it is held by the main-branch
92
92
  rule on its step, and a PR image does not leave for the registry.
93
+ - **A package the tree's own applications install is released from a tip their end-to-end suites
94
+ went green on.** Where the release pipeline runs none of these suites, an MR merged past the
95
+ pipeline reaches them first after the release. When an MR without a green pipeline of its own
96
+ entered the main branch after the last green pipeline of an MR merged into it, those suites must
97
+ go green on the tip of the main branch before the release.
93
98
  - **A divergence of production from the main branch is visible by the work queue audit.** A task
94
99
  leaves the queue by a merge, but a merge is not yet production: a failed or unstarted rollout
95
100
  touches neither the task nor its list, and there is nowhere to notice it. The audit asks for
@@ -113,6 +113,9 @@ flowchart TD
113
113
  - **A push into a branch that has an open PR is followed by rereading its body.** The statement
114
114
  about a green run names the tip by its sha, and moving the tip makes it false in silence: no check
115
115
  reads a PR body.
116
+ - **On remarks to a PR the person is asked whether to answer under them, and after a yes each one
117
+ gets an answer.** Edits alone leave the discussion silent, and the person reads the whole diff
118
+ again. The word holds for that PR, not for the next.
116
119
  - **The draft is lifted by a separate call — `az repos pr update --id <номер> --draft false`.** With
117
120
  it the executor answers for readiness: checks passed, no rework left, the work matches the work
118
121
  item. Lifting the draft and asking to merge are one turn, not two days.
@@ -181,6 +184,18 @@ flowchart TD
181
184
  assembly with: the "set before push" section prints it whole, one command per line, and names
182
185
  beside it what the default printed and the set did not take. A tree writing its override blind
183
186
  added a repeat to it.
187
+ - **A push is sent only by the path the push guard stands on.** A terminal, a process or a script
188
+ started outside the session carries the same command past the gate, unless the tree wired the
189
+ git hook `pre-push`: then git runs the set there too. A send cut off by the session's end is
190
+ asked of the host and repeated by the same path.
191
+ - **A review of a foreign branch starts with the gate set run on its tip.** Reading the diff misses
192
+ what the set judges by the whole tree: a word, a file limit. A check that stands only on an edit,
193
+ such as the wording one, is run over the changed texts apart. The output goes into the review,
194
+ and a later push into that branch is run again.
195
+ - **Where neither the session's push guard nor the git hook fires, the set is run whole, as read
196
+ at the minute of the run.** It is read from the state review or from the tree profile together with the package
197
+ default it calls. A list from memory, from a copy made earlier or from the profile alone drops
198
+ checks: the profile names the set, the task names only the work.
184
199
  - **An exclusion reason naming a task is judged on whether that task is alive.** A deferral with a
185
200
  term and one without look the same until someone asks the number; a dead number in the reason
186
201
  makes the exclusion perpetual without saying a line about it. Asked by the same tier as the task