@rt-tools/agent-kit 0.29.0 → 0.29.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 (48) hide show
  1. package/assets/checks/board-epic-plan.github.mjs +128 -9
  2. package/assets/checks/board-epics.github.mjs +6 -10
  3. package/assets/checks/board-folders.mjs +50 -0
  4. package/assets/checks/check-lib-layers.mjs +4 -2
  5. package/assets/checks/check-spec-coverage.mjs +65 -0
  6. package/assets/checks/check-work-steps.mjs +238 -0
  7. package/assets/checks/epic-table.github.mjs +15 -6
  8. package/assets/checks/lib-common.mjs +9 -4
  9. package/assets/checks/lib-domains.mjs +7 -4
  10. package/assets/checks/rt-kit-checks.config.mjs +1 -1
  11. package/assets/checks/task-new.github.mjs +6 -6
  12. package/assets/defaults/project.sh +15 -1
  13. package/assets/hooks/git-guard-delivery-epic.sh +8 -1
  14. package/assets/hooks/git-guard-delivery.sh +2 -1
  15. package/assets/hooks/git-guard-push-tests.sh +31 -8
  16. package/assets/hooks/grill-gate.sh +63 -2
  17. package/assets/hooks/prose-style-guard.sh +49 -3
  18. package/assets/hooks/turn-exit-epic.sh +39 -0
  19. package/assets/hooks/turn-exit-guard.sh +6 -4
  20. package/assets/hooks/turn-exit-patterns.sh +51 -0
  21. package/assets/hooks/turn-exit-verdict.sh +20 -1
  22. package/assets/hooks/waiting-turn-guard.sh +56 -1
  23. package/assets/hooks/write-targets.sh +23 -1
  24. package/assets/laws/work-conduct.md +22 -0
  25. package/assets/patterns/doc-style-human.md +6 -0
  26. package/assets/patterns/git-workflow-merge.md +1 -0
  27. package/assets/patterns/git-workflow-pr-body.github.md +10 -5
  28. package/assets/patterns/spec-driven-domain.md +4 -0
  29. package/assets/patterns/status-report-table.github.md +6 -0
  30. package/assets/patterns/task-flow-start.md +26 -22
  31. package/assets/patterns/testing-e2e.md +14 -0
  32. package/assets/pitfalls/turn-conduct.md +28 -0
  33. package/assets/rules/git-workflow.github.md +2 -1
  34. package/assets/rules/observability.needs-app.md +5 -0
  35. package/assets/rules/reuse-first.md +33 -11
  36. package/assets/rules/task-flow.md +30 -29
  37. package/assets/rules/testing.md +15 -0
  38. package/assets/rules/turn-conduct.md +44 -46
  39. package/assets/rules/typescript-conventions.md +8 -0
  40. package/assets/samples/tasks/_template/plan.md +7 -1
  41. package/assets/samples/tasks/_template/progress.md +13 -0
  42. package/lib/observations-cargo.d.ts +12 -0
  43. package/lib/observations-cargo.d.ts.map +1 -1
  44. package/lib/observations-cargo.js +18 -1
  45. package/lib/observations-cargo.js.map +1 -1
  46. package/package.json +1 -1
  47. package/rt-tools-agent-kit-0.29.1.tgz +0 -0
  48. package/rt-tools-agent-kit-0.29.0.tgz +0 -0
@@ -86,6 +86,23 @@ taken_path_re='/tasks/'
86
86
  # because the next task was taken instead of this, not on top of it.
87
87
  ready_re='pr[[:space:]]+ready|run[[:space:]]+(list|view|watch)|pr[[:space:]]+checks|check-runs|check:board|board\.mjs'
88
88
 
89
+ # A run started or rerun in the turn. Its outcome does not call by itself: a rerun went through in
90
+ # one line between other things, its state was read once — «queued» — and the turn ended by a lawful
91
+ # exit while the request stayed without watching; the owner found the green run before the
92
+ # executor. The sign is the pair: a starting command in the turn and no command that waits for the
93
+ # end in the same turn. A wait is a watching command of the hosting client, a loop until the end or
94
+ # the watching tool — in the background or blocking; a single read of the state is not a wait.
95
+ # Incident analysis — the record "2026-09-15-turn-idle-after-green-run" in the intake.
96
+ started_run_re='run[[:space:]]+rerun|workflow[[:space:]]+run|ci[[:space:]]+(retry|run)|pipeline[[:space:]]+(run|retry)|pipelines[[:space:]]+run'
97
+
98
+ # A run nobody started by hand: the pipeline wakes on an opened request by itself, and the tier
99
+ # above stays silent — there is no starting command in the turn at all. The sign is taken from the
100
+ # output rather than from the base of the request: which bases wake the pipeline the guard cannot
101
+ # know, and a demand by the bare fact of opening would refuse every request into an epic branch.
102
+ # So the pair is "the request is opened in the turn" and "its run is read as going".
103
+ going_run_re='queued|in_progress|"status"[[:space:]]*:[[:space:]]*"(queued|in_progress)"|status:[[:space:]]*(queued|in_progress)'
104
+ watched_run_re='run[[:space:]]+watch|pr[[:space:]]+checks[^|;&]*--watch|until[[:space:]][^\n]*sleep|while[[:space:]][^\n]*sleep|ci[[:space:]]+status[^|;&]*--live|pipelines[[:space:]]+runs[[:space:]]+show'
105
+
89
106
  # One's own named action. An empty turn that declared what it will do next gives itself away by
90
107
  # nothing: it opened no PR, read no run, and both earlier signs are silent. It is caught by form —
91
108
  # a set of future-tense patterns about one's own step — not by understanding the meaning; and no
@@ -99,7 +116,9 @@ vow_re='дальше беру|дальше возьму|дальше иду|сл
99
116
  # A 400-line tail: the turn record grows all session, and only the last turn is judged.
100
117
  verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r \
101
118
  --arg opened "$opened_re" --arg taken "$taken_re" --arg taken_path "$taken_path_re" \
102
- --arg read "$read_re" --arg red "$red_re" --arg ready "$ready_re" --arg vow "$vow_re" '
119
+ --arg read "$read_re" --arg red "$red_re" --arg ready "$ready_re" --arg vow "$vow_re" \
120
+ --arg started_run "$started_run_re" --arg watched_run "$watched_run_re" \
121
+ --arg going_run "$going_run_re" '
103
122
  def is_input:
104
123
  .type == "user"
105
124
  and ((.isCompactSummary // false) | not)
@@ -127,6 +146,11 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r \
127
146
  | (($ran | test($read; "i")) and ($out | test($red; "i"))) as $red_run
128
147
  | (($ran | test($taken; "i")) or ($wrote | test($taken_path; "i"))) as $went_on
129
148
  | ($ran | test($ready; "i")) as $checked
149
+ # The run started in the turn and the wait for its end: the watching tool counts as a wait too.
150
+ | ($ran | test($started_run; "i")) as $reran
151
+ # The run of the request opened in this turn: read as going and left without a wait.
152
+ | ($opened_pr and ($out | test($going_run; "i"))) as $own_run_going
153
+ | (($ran | test($watched_run; "i")) or ($uses | map(.name // "") | any(. == "Monitor"))) as $watched_run
130
154
  | ([$turn[] | select(.type == "assistant") | (.message.content // [])[]
131
155
  | select(.type == "text") | .text] | join("\n")) as $said
132
156
  | ($said | test($vow; "i")) as $announced
@@ -134,6 +158,7 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r \
134
158
  | if $opened_pr and ($went_on | not) and ($checked | not) then "owe:both"
135
159
  elif $opened_pr and ($went_on | not) then "owe:pr"
136
160
  elif $opened_pr and ($checked | not) then "owe:draft"
161
+ elif ($reran or $own_run_going) and ($watched_run | not) then "owe:watch"
137
162
  elif $went_on then "pass"
138
163
  elif $red_run then "owe:run"
139
164
  elif $announced and $tools == 0 then "owe:vow"
@@ -190,6 +215,36 @@ ${deny_tail_text}"
190
215
  exit 0
191
216
  fi
192
217
 
218
+ # A run started or rerun in the turn without a wait for its end. The next task taken does not lift
219
+ # this: the request stays without watching either way, and its outcome reaches the owner first.
220
+ if [ "$verdict" = "owe:watch" ]; then
221
+ reason="BLOCKED by waiting-turn-guard: a run of this turn was left without a wait for its end — started by hand, or started by the request opened here and read as going.
222
+
223
+ The outcome of a run does not call by itself: a state read once — «queued», «in_progress» — is a moment, not a result. Without a wait the request stays without watching, the draft is not lifted and the merge is not asked, and the owner finds the green run before the executor.
224
+
225
+ Put the wait in this same turn, in the background or blocking:
226
+
227
+ gh run watch <id> --exit-status & # returns the session to the request at the end
228
+ gh pr checks <number> --watch
229
+
230
+ The end of a run is learned from the return of such a command, not from a look at the page.
231
+
232
+ The guard judges one turn: the next session is not refused."
233
+
234
+ # shellcheck disable=SC1090
235
+ [ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
236
+ && . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" 2>/dev/null
237
+ command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
238
+ deny_tail_text="$(rt_deny_tail "")"
239
+ [ -n "$deny_tail_text" ] && reason="${reason}
240
+
241
+ ${deny_tail_text}"
242
+
243
+ jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
244
+ || printf '{"decision":"block","reason":"waiting-turn-guard: a run was started in the turn, and nothing waits for its end."}\n'
245
+ exit 0
246
+ fi
247
+
193
248
  # A draft left while the next task is taken is a separate refusal: there the demand is not about
194
249
  # the next task but about carrying the handed-in one to the end.
195
250
  if [ "$verdict" = "owe:draft" ]; then
@@ -42,8 +42,30 @@ rt_write_targets() {
42
42
  rt_wt_text="$(printf '%s' "$rt_wt_text" \
43
43
  | sed -E 's#(&|[0-9]*)>>?[[:space:]]*/dev/(null|stderr)##g; s#[0-9]*>&[0-9-]##g')"
44
44
 
45
+ # The bodies of the heredocs are cut out of the shell parse: they are data of the command, not
46
+ # the command. A markdown quote line inside a body — a caret and a path — read as a redirection,
47
+ # and an edit that wrote nothing into the tree was refused by the path standing in that quote.
48
+ # The bodies are parsed separately, by the interpreter branch below.
49
+ rt_wt_shell="$(printf '%s' "$rt_wt_text" | awk -v q="'" '
50
+ function trim(s) { sub(/^[ \t]+/, "", s); sub(/[ \t]+$/, "", s); return s }
51
+ tag != "" { if (trim($0) == tag) { tag = "" } ; next }
52
+ {
53
+ print
54
+ s = $0
55
+ re = "<<-?[ \t]*(\"[^\"]+\"|" q "[^" q "]+" q "|[A-Za-z_][A-Za-z0-9_]*)"
56
+ while (match(s, re)) {
57
+ t = substr(s, RSTART, RLENGTH)
58
+ s = substr(s, RSTART + RLENGTH)
59
+ sub(/^<<-?[ \t]*/, "", t)
60
+ gsub(/\"/, "", t)
61
+ gsub(q, "", t)
62
+ tag = t
63
+ }
64
+ }
65
+ ')"
66
+
45
67
  {
46
- printf '%s' "$rt_wt_text" \
68
+ printf '%s' "$rt_wt_shell" \
47
69
  | tr "\"'\`" ' ' \
48
70
  | sed -E 's/>>?/\n>/g' \
49
71
  | sed -nE '
@@ -90,6 +90,16 @@ one session and keeps its whole context and state when it passes to the next.
90
90
  check.
91
91
  - **Done work is marked in one place.** Two records of the same thing drift apart silently, and then
92
92
  neither shows what remains.
93
+ - **The steps of the work are written out in full before it starts, and each of them can be called
94
+ done or not done.** A plan of prose alone cannot say how much is left: whoever reads it counts by
95
+ eye and counts differently every time, so the work reads as nearly finished from the first step
96
+ onwards.
97
+ - **The step going on right now is marked at every minute of the work, and there is only ever one.**
98
+ A record that names the whole stage and not the step inside it says nothing about where the work
99
+ broke off, and the session that picks it up starts by guessing.
100
+ - **Work with a step that is not done is not finished, and a report about the done does not finish
101
+ it either.** A report ends the account, not the work: it looks like completeness better than
102
+ anything else, and the emptiness behind it is invisible to whoever wrote it.
93
103
  - **A decision made along the way is written down together with its reason.** Without a reason it
94
104
  reads as accidental and is revoked by the next session, and brought back by the third.
95
105
  - **The boundary of the work is named before it starts.** A boundary not named aloud does not exist:
@@ -190,6 +200,18 @@ one session and keeps its whole context and state when it passes to the next.
190
200
  being watched. While it runs, the next task is taken, and the check is returned to in the turn
191
201
  that reads its end. A session spent waiting costs as much as one with a task done, and yields
192
202
  nothing.
203
+ - **A check the work started is watched to its end, and watching goes beside the next task.** Not
204
+ waiting and not watching are different things: the first frees the executor, the second abandons
205
+ the work. The return is arranged in the turn that started the check, by something that comes back
206
+ by itself; a state read once is a moment, not an outcome.
207
+ - **A check is started by the work, not only by the command that names it.** Handing the work over
208
+ starts a check by itself where the machine is set up for that, and the executor answers for it as
209
+ for one started by hand.
210
+ - **A check that came back green is carried to the end by the one who handed the work over.** What
211
+ is left after it — a lock to lift, a mark to set — is the executor's step: the owner sees the lock
212
+ and reads it as work still going. A red one is fixed by the same executor, in the same work.
213
+ - **A check left with nobody watching is a miss and is analysed as one.** The work is finished and
214
+ nobody knows it; every minute until the owner asks is paid by them.
193
215
  - **A wait that does stop the work is named to the owner separately and directly.** Sometimes there
194
216
  is no way forward: the next task stands on one not yet reviewed, or the change waits for a
195
217
  decision only the owner has. Then the executor says three things — what stands still, what it
@@ -85,6 +85,12 @@ not choose.
85
85
 
86
86
  ## Pitfalls
87
87
 
88
+ - **An edit made by a shell command is judged by the whole command, the old version inside it
89
+ included.** The style check gets the body of the call, not the text that will end up in the
90
+ file: a rewrite carrying the previous wording inside a heredoc or an interpreter string is
91
+ refused by the words of that previous wording. The refusal repeats at the second attempt,
92
+ because the old text is still there. The new text is written by the edit tool — there only the
93
+ new text is judged — or inserted by line number, and the command is given the path.
88
94
  - **Shorter does not mean clearer.** A text in the layer's words comes out a third shorter and
89
95
  is useless to whoever decides whether the work is urgent.
90
96
  - **"Not X but Y" looks like an explanation and explains nothing.** The owner learns what was
@@ -47,6 +47,7 @@ technique, and different files of one merge are resolved differently.
47
47
  | a build from a description | rebuilt from the description after the description is resolved: a generator writes the lines of such a file, and sides joined by hand give a file it would never output |
48
48
  | a spec in `docs/specs/` | by keeping both sides, if both appended; a section removed by one side stays removed — rule `spec-driven`; after — `npm run check:specs` |
49
49
  | a rule's companion next to the rule | by keeping both sides — the same two additions to one table; after — `npm run check:specs` |
50
+ | the table of working-copy assignments | by the base's side whole. The owner fills it in the main branch, and a session does not write it: the branch's side can only be an older copy. After — the reading the session start prints |
50
51
  | the work list (`docs/BACKLOG.md`) | by the selection sign — pattern `doc-style-sweep` |
51
52
 
52
53
  ## A commit is carried over by a cherry-pick
@@ -25,13 +25,18 @@ The body starts with the link line — by it the board fills the linked PRs fiel
25
25
  assignee and labels are set by the same command, and a PR does not open without them:
26
26
 
27
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
- …'
28
+ GH_TOKEN="$TOKEN" gh pr create --title '[<КЛЮЧ>-86] Письмо владельцу с незаполненным адресом попадает в логи' \
29
+ --base <ветка эпика> --body-file <файл с телом> \
30
+ --reviewer <владелец> --assignee <бот> --label bug --label area:api
33
31
  ```
34
32
 
33
+ **The title stands first in the call, and the body comes in by a file.** The delivery guard reads
34
+ the title out of the command text and takes the first match of the short key: a body passed as a
35
+ line in the same call may itself hold a word after that key — a quoted command, a label, a run
36
+ line — and it becomes the title in the guard's eyes. The refusal then says the title does not
37
+ start with the task number while the real title is right, and the mistake is looked for where
38
+ there is none. A body in a file leaves the call one title and nothing else to match.
39
+
35
40
  The reviewer is always the owner: without a review request the PR does not show in their queue.
36
41
  The assignee is the same account the machine work goes from. Labels are taken from the task
37
42
  whole — both the kind of edit and all its areas; they are read from the task, not picked from
@@ -162,6 +162,10 @@ statement.
162
162
 
163
163
  ## Common misses
164
164
 
165
+ - A second table under the contract section: the audit reads every table there as the list of
166
+ procedures, and a set of refusal codes standing next to them comes back as that many
167
+ discrepancies at once — thirty-six on a spec that was right. Under the contract stands the table
168
+ of procedures alone; a set of codes goes into the data section.
165
169
  - A grown domain is split into new domains instead of subdomains: a new domain has to be entered
166
170
  in the index, audited against the code separately and explained as to why it is not a subdomain
167
171
  of its neighbour — while a subdomain stays in its domain and inherits its contract. A
@@ -71,6 +71,12 @@ into an interactive sign-in instead of an answer.
71
71
 
72
72
  ## Common misses
73
73
 
74
+ - **On the epic's own branch the number is asked as an argument.** Without an argument the
75
+ command takes the number from the branch and looks in that card's body for the line declaring
76
+ an epic. On a task branch that line is there; on the epic branch the card is the epic itself
77
+ and declares no other. The answer — "the task declares no epic" — then reads as a broken card
78
+ rather than as a question asked the wrong way.
79
+
74
80
  - **The task on the board is read by a request, not by the view subcommand.** The subcommand
75
81
  drags in boards of the old kind, the host answers with a refusal about them, and the call turns
76
82
  red whole, showing nothing. A direct request is taken.
@@ -39,16 +39,14 @@ lives only in that session's record: a search over them by the theme's word cost
39
39
  is found is written into the tree in the same turn — into the epic plan if it links tasks, into the
40
40
  progress if it concerns one.
41
41
 
42
- Exploration that found nothing is no permission to ask. First, where the search went is named; then
43
- the places missing from the list are reached — the epic plan, the archive, the records of past
44
- sessions. "Not found in such a place" speaks of the place, not of the tree, and the question names
45
- both ways in which the search went.
42
+ Exploration that found nothing is no permission to ask: the places not yet searched — the epic plan,
43
+ the archive, the records of past sessions — are reached first. "Not found in such a place" speaks of
44
+ the place, not of the tree, and the question names where the search went.
46
45
 
47
- Exploration ends with command output, not with a feeling. Before the first question to the owner the
48
- executor knows three things. How the repository is arranged (the root memo), what lies in the
49
- directory at hand (`ls`), and whether something is already written on the theme (a search over the
50
- documentation and the rules). Without a list of what counts as done, exploration runs as a mood: a
51
- read handover passes for it, and not one command runs over the tree.
46
+ Exploration ends with command output, not with a feeling. Before the first question the executor
47
+ knows three things. How the repository is arranged (the root memo), what lies in the directory at
48
+ hand (`ls`), and whether something is written on the theme (a search over the documentation and the
49
+ rules). Without such a list exploration runs as a mood, and a read handover passes for it.
52
50
 
53
51
  Exploration over a created task ends with a reproduced symptom, not a found file. The task body
54
52
  describes the tree on the day of creation, and exploration by the names from the body confirms only
@@ -62,9 +60,13 @@ and only then come the questions about techniques. The answer to "how is this do
62
60
  folder, and generalised into a map of the tree it lies: the neighbouring family of directories is
63
61
  left out, and the owner finds the loss.
64
62
 
65
- What was inferred is marked right in the list, together with what confirms it. A guess by a
66
- neighbouring case stands in one list with what was checked, and the owner reads the whole list as
67
- checked.
63
+ What was inferred is marked right in the list, together with what confirms it: a guess by a
64
+ neighbouring case next to what was checked reads as checked.
65
+
66
+ **A ready-made module of the same kind is looked for before the first question** — in this tree and
67
+ in the trees recorded as samples of its layout. The one found is read whole: it closes the questions
68
+ about the structure — the source of the numbers, the rows, the screen, the storage. A grill of five
69
+ menus about such a module was closed by the owner naming it; the search costs one listing.
68
70
 
69
71
  The six questions are asked minus those the exploration answered: instead of a question with a ready
70
72
  answer, the grill gets the line "taking such-and-such answer, here is where from". The sign is one —
@@ -96,18 +98,21 @@ included. It can be closed by an assumption too, when the answer is obvious —
96
98
  closed by assumption: <what is taken>": a wrong assumption costs an edit, a question about the
97
99
  obvious costs a session.
98
100
 
101
+ **Two answers «recommended» in a row close the remaining questions by assumption.** An owner who took
102
+ the recommended option twice running has shown that the decisions are not theirs. From the second
103
+ such answer the remaining questions go into the grill as decisions — what is taken and where from —
104
+ and the owner gets the list in one line, not a menu. The guard of the conversation refuses the third
105
+ menu itself; a menu goes out again only for a question no assumption closes, and says so first.
106
+
99
107
  The size of the work is never a ground for a question about boundaries: "this is big work" is the
100
- executor's judgement, "whether to do it whole" is the owner's, and they decided before the work
101
- began.
108
+ executor's judgement, "whether to do it whole" the owner's, decided before the work began.
102
109
 
103
110
  The form of a question is set by the owner's settings: where a menu is required, a menu is asked,
104
111
  and a free option is added to every question — a closed set has no line "wrong question".
105
112
 
106
- **The framing of a handed-over text is not carried onto the current tree.** A session handover, a
107
- proposals file and a spec describe the tree they were written in. Only the current tree knows about
108
- the current one, and a statement about the layout is checked by a command here. Confirmation finds
109
- itself — the signs of a tree that only installs the package stand on the one that writes and
110
- installs it too.
113
+ **The framing of a handed-over text is not carried onto the current tree.** A handover, a proposals
114
+ file and a spec describe the tree they were written in; a statement about the layout is checked by a
115
+ command here — the signs of a tree that only installs the package stand on the one that writes it too.
111
116
 
112
117
  The message with which the executor stops begins with what they wait for:
113
118
 
@@ -120,9 +125,8 @@ Under the question goes the table of the epic's position — the same as in the
120
125
  above: the stop is named by the first line, and the epic's position is what the owner decides from.
121
126
  Work outside an epic carries no table.
122
127
 
123
- Measurements, role findings and the list of decisions are by then written in the progress, and in
124
- the message to the owner they are superfluous. A report with a question at its end looks diligent
125
- exactly as reliably as the question drowns in it.
128
+ Measurements, role findings and the list of decisions are by then written in the progress and are
129
+ superfluous in the message: a report with a question at its end drowns the question.
126
130
 
127
131
  The answers are written into `docs/tasks/_draft-<slug>/grill.md` — the folder is still a draft,
128
132
  there is no number.
@@ -108,6 +108,20 @@ This knowledge is entered in the rule, not in the shared module of the suite. Wr
108
108
  it is known to whoever wrote it — the next test repeats the miss, because it reads the rule, not the
109
109
  code.
110
110
 
111
+ A click on closing a panel is not its disappearance either. While the panel leaves the screen it
112
+ keeps its fields, its buttons and its anchors: a test that filled a field in a panel already going
113
+ away stood until its time limit, and the trace showed the fill landing in a node nobody was going
114
+ to read. So the absence of the node is awaited before the next action:
115
+
116
+ ```ts
117
+ await qa(page, 'invite-create-close').click();
118
+ await expect(qa(page, 'invite-create-panel')).toHaveCount(0);
119
+ ```
120
+
121
+ The same holds for a popup that stays open after its item is chosen. It covers the screen, and the
122
+ click aimed at a button under it goes to the popup: the screen answers as if the button had not
123
+ been pressed at all. The popup is closed and its absence awaited by the same pair of lines.
124
+
111
125
  ## Common misses
112
126
 
113
127
  - **Take the rendering server port with care:** the developer's stand goes by the same name
@@ -121,3 +121,31 @@ The rule is `turn-conduct`; the articles that hold the law stand there.
121
121
  done.
122
122
  - **"A statement about the tree's state is watched by the statement guard": why a word has its own
123
123
  kind of command.** A general sign "there was a command" would confirm one thing by another.
124
+ - **A next step named and not begun.** Four stops of one shape: a stage closed and committed, a
125
+ full report, the next stage named in the progress and untouched. The last, on 17 September, came
126
+ after an epic with seven tasks, an agreement and a whole first stage — the more was done, the more
127
+ the report read as the end. The guard now reads the order of actions after the last edit of the
128
+ progress, and a turn that opened the PR passes that sign by itself.
129
+ - **A launch in the background as the last action.** A grill of five menus ended with the review
130
+ roles sent to the background and the line "the roles are working"; the owner read it as a stop.
131
+ The guard counted the launch as work — there were edits in the turn, and the last action was not
132
+ a wait. Now the last tool of the turn is judged: the agent tool or a command sent to the
133
+ background standing last gives the turn back, and work after the launch releases it.
134
+
135
+ ## A single read of the run state taken for watching it
136
+
137
+ 22 September 2026. An epic was handed over whole: nine tasks merged, the request of the epic opened
138
+ into the main branch as a draft. The pipeline woke by itself, and the turn held no starting command.
139
+
140
+ The executor read the state once — the run was going — and ended the turn with the words "I am not
141
+ waiting for the run". The run finished in 12 minutes 35 seconds, green. The draft stayed, the merge
142
+ button stayed locked, and the owner learned the work was ready forty minutes later, by asking what
143
+ the executor was busy with.
144
+
145
+ What confirmed the wrong decision: the waiting guard let the turn go. It demands that the state of
146
+ the handed-over work be asked, and the state was asked — while the run was still going. The guard
147
+ judged the fact of the question, not the end of the run, and its tier about a run started in the
148
+ turn knew only the commands that start one by hand.
149
+
150
+ What it cost: a ready request stood forty minutes under a green run; the owner checked the work
151
+ instead of the executor; two turns went on the conversation about why the work stood still.
@@ -88,7 +88,8 @@ flowchart TD
88
88
  own.** An edit made in it goes into `main` unreviewed: nobody opens a PR from that branch to it.
89
89
  - **The main branch is merged into the epic branch, and the epic branch into the branches of its
90
90
  tasks — while the work runs, not before the hand-over.** Otherwise the reviewer sees the edit mixed
91
- with someone else's, checked from a base that is gone.
91
+ with someone else's, checked from a base that is gone. A merge not sent yet answers by the base:
92
+ a task branch from the merged local epic branch is let through.
92
93
  - **A wave of branches off one epic branch is checked by a trial merge, not one by one:** each is
93
94
  green on its own, and they collide on what one branch cannot show.
94
95
  - **The next work's branch is taken from the previous one while the chain is unbroken.** `git
@@ -70,6 +70,11 @@ flowchart TD
70
70
  check that fired. On one level with breakages it floods the alarm with guests' typos.
71
71
  - **The cause of a failure is parsed in one place.** Otherwise the same error arrives in the logs
72
72
  in three different shapes.
73
+ - **A field added to the answer of a refusal is added where the answer is assembled, not where the
74
+ refusal is thrown.** The application parses failures in one place and builds the body there out
75
+ of what it knows: every throw may name the field, and the body carries none of them. Neither the
76
+ linter nor the tests next to the throws see it — the loss shows on the screen of whoever reads
77
+ the answer.
73
78
  - **The fields of a log line are always scrubbed, not at the discretion of whoever writes.**
74
79
  Deciding on every call whether the fields hold a secret means being wrong once.
75
80
  - **At startup the application writes what it came up with.** Half of the features are enabled by
@@ -14,7 +14,7 @@ the same; here — what that stands on in this tree and what it is called.
14
14
 
15
15
  | In the law | Here |
16
16
  | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
17
- | the ready-made | the kit components of `@rt-tools/ui-kit-v2` with the `rt-` prefix — over seventy today — and selectorless base classes inherited in a screen's `@Component` |
17
+ | the ready-made | the kit components of `@rt-tools/ui-kit-v2` with the `rt-` prefix and selectorless base classes inherited in a screen's `@Component` |
18
18
  | the layout of pages, forms and windows | `apps/<app>/src/styles/`, applied with the BEM directives |
19
19
  | styling of a part of the application | the `.scss` file next to the component |
20
20
  | a departure decided by the owner | the `native-ok` marker with an explanation — a comment on the line above or in the line itself |
@@ -112,13 +112,19 @@ flowchart TD
112
112
 
113
113
  ## What of the law is not here
114
114
 
115
- The same response of an input field to an error is held by the kit: nobody in this tree inherits
116
- `RtFormControlBase`, because fields are taken as its ready-made components. There is nothing here
117
- to bind this article of the law to.
115
+ Two articles of the law are counted by no check, and each of them is a number about a tree.
116
+ Whether a field of the application answers an error the way the ready-made one does; how many
117
+ places report a success or a failure by their own markup instead of the shared bus. A template or
118
+ styles inside the decorator is not a third of them: the package set carries a sign for that, and a
119
+ tree that declared the set gets a refusal on such an edit.
118
120
 
119
- An inline template stands on one component, and the same one has the only `styles:` — the admin
120
- header. `role="alert"` is written by hand in sixteen templates, and `rt-message` is called by one
121
- consumer. That is debt, not a permitted departure.
121
+ A number like that is not written into a text at all: it goes stale by itself, with no edit in the
122
+ tree, and a stale number reads as a current one. The companion of the rule writes the way to ask
123
+ it — the command, and what the answer of that command is a measurement of — and the answer stays
124
+ where it is true, in the tree.
125
+
126
+ The law's article about stopping a departure before the file is written is held in part, and the
127
+ part that is missing is named below, where the signs are described.
122
128
 
123
129
  ## Patterns
124
130
 
@@ -152,6 +158,11 @@ A sign names its scope: inheriting a base and a class decorator do not land in a
152
158
  sign judging them by the added text is always silent. A sign also names its cancel — a sample
153
159
  under which it does not fire: the base is already inherited, the ready-made is already called.
154
160
 
161
+ The boundary of a sign is the text by which it is recognised. A whole piece drawn by hand in place
162
+ of a ready-made component is assembled from ordinary markup nodes, and no sign names it: a screen
163
+ that drew its own feed of messages instead of the kit's passes the guard and the full check alike.
164
+ A declared set closes native controls, overlays and layout, and not that.
165
+
155
166
  ## Pitfalls
156
167
 
157
168
  - **A sample is searched for by the kit's names, not by what the kit is written on.** A search by
@@ -165,10 +176,21 @@ under which it does not fire: the base is already inherited, the ready-made is a
165
176
  changes its indent while staying the same code.
166
177
  - An answer given before reading the sample is overruled by the sample: the agreed shape of a list
167
178
  query was replayed together with the contract two questions after it was accepted.
168
- - **A set is declared by what the tree consumes, not by what the package ships.** A tree in which
169
- the kit is written, not called, having declared its set, gets advice to call the kit on the
170
- kit's own files: the sign is right but pointed the wrong way. Such a tree declares only the sets
171
- whose ready-made it takes from outside.
179
+ - **A set is declared by what the tree consumes, and a tree that consumes what it writes declares
180
+ it with an area.** A tree in which the kit is written, not called, having declared its set, gets
181
+ advice to call the kit on the kit's own files: the sign is right but pointed the wrong way. That
182
+ is no reason to leave the set undeclared where the same tree is also its consumer: undeclared, it
183
+ leaves the consumer's screens unjudged, and the silence there is read as order. The area stands
184
+ next to the name — in place of the bare name a pair of the name and the roots it holds over.
185
+
186
+ ```json
187
+ { "reuse": { "bundles": ["angular", { "name": "kit", "roots": ["apps/admin", "libs/admin"] }] } }
188
+ ```
189
+
172
190
  - **A guard that received no sign is indistinguishable from a guard with nothing to refuse.** It
173
191
  says so itself, and the first edit in a tree without declared sets shows it. Silence of the
174
192
  check does not count as a sign of order — first one looks whether it has anything to judge by.
193
+ - **A newly declared set lights up the code written before it, and none of that is new debt.**
194
+ Every place the set names arrives at once and as fresh, so the gate refuses a push for code
195
+ nobody touched. Either those places are closed by the same work, or the snapshot of what
196
+ accumulated is re-taken: the full check takes the key `--baseline` for exactly that.
@@ -122,8 +122,8 @@ flowchart TD
122
122
  - **Editing application code is refused until the work has reached a state in which code is
123
123
  edited.** The guard demands three things: a task folder by branch name, a plan in it and a
124
124
  declared state. The agreement has a guard of its own on the same events.
125
- - **The guard judges the declared transition, not the presence of files.** An empty plan lies the
126
- same as a written one, so the refusal is lifted by the declared state — `этап-идёт`,
125
+ - **The guard judges the declared transition, not the presence of files.** The refusal is lifted
126
+ by the declared state — `этап-идёт`,
127
127
  `этапы-кончились`, `разбор-кончился`. The fourth road is the branch history: a folder taken apart
128
128
  means handed-in work.
129
129
  - **A state line moved forward is the same declaration of intent, only machine-readable.** It is
@@ -147,15 +147,14 @@ flowchart TD
147
147
  justification under someone else's accepted decision reads as its appraisal. One exception:
148
148
  execution stopped by an obstacle — then the obstacle is named.
149
149
  - **The last run of the main branch is read first thing in a session and after every known
150
- merge.** A merge reads as the end of the work, and a red main branch after it lives until the
151
- owner notices. The start hook prints it; after a merge the command is called by hand, and a red
150
+ merge.** A red main branch after a merge lives until the owner notices. The start hook prints it; after a merge the command is called by hand, and a red
152
151
  or pushed-out run is fixed before new work is taken.
153
- - **A session does not start work by itself.** A start needs the owner's word in the same session:
154
- the handover, the state from the startup hook and an assigned epic say what to do, not whether to
155
- work. An empty message, one word or one path order no work.
156
- - **A refusal by an external limiter removes the way, not the task.** It is not the tree's guard and
157
- names no exit. The way is taken from the guard that already described this fix — a bypass with
158
- the reason in the commit body, a word to the owner — and the task stays the same.
152
+ - **A session does not start work by itself.** The handover, the state from the startup hook and an
153
+ assigned epic say what to do, not whether to work: a start needs the owner's word in the same
154
+ session. An empty message, one word or one path order no work.
155
+ - **A refusal by an external limiter removes the way, not the task.** It names no exit: the way is
156
+ taken from the guard that already described this fix — a bypass with the reason in the commit
157
+ body, a word to the owner — and the task stays the same.
159
158
  - **An instruction to work by the progress covers all its steps, including those that change
160
159
  history.** Questions are asked about what the progress lacks.
161
160
  - **A question written by a past session does not become a question to the owner.** It is addressed
@@ -166,8 +165,8 @@ flowchart TD
166
165
  - **An answer in the owner's message counts the same as an answer in a document.** A question
167
166
  already answered in the conversation is not asked again.
168
167
  - **The owner's word about the design is a task setting, not a decision.** What they named is
169
- usually already in the tree under that word — a name on a screen, a spec section, a model field —
170
- and is checked against them before the edit. Diverged — the owner is asked.
168
+ usually in the tree under that word — a name on a screen, a spec section, a model field — and is
169
+ checked against it before the edit. Diverged — the owner is asked.
171
170
  - **A task folder is created for any work, no exceptions.** An exception with even one lawful form
172
171
  is executed as permission. It goes in before the first edit.
173
172
  - **The task folder goes into the branch by a commit, not lives in one working tree.** Uncommitted,
@@ -182,9 +181,8 @@ flowchart TD
182
181
  base: folder taken apart and pushed → PR as a draft → run green → draft lifted → the request to
183
182
  merge, naming the number. Where it does not wake, the green push gate is the check, and opening
184
183
  the PR and asking to merge are one turn.
185
- - **A PR that waits for a run opens as a draft, and one that waits for nothing opens ready.** Before
186
- it opens the owner sees no edits, and an open PR reads as an invitation to merge. Which of the two
187
- applies is decided by the bases the pipeline wakes for, and that is read from its file.
184
+ - **A PR that waits for a run opens as a draft, and one that waits for nothing opens ready.** An
185
+ open PR reads as an invitation to merge. Which of the two applies is decided by the bases the pipeline wakes for, and that is read from its file.
188
186
  - **The plan guard is the lower bound of the requirement, not its limit.** It demands a folder only
189
187
  for an edit of application code; the article above — for any work.
190
188
  - **An instruction to work by a rule is an instruction to do its steps, including those that change
@@ -192,8 +190,7 @@ flowchart TD
192
190
  - **A taken task does not end a turn.** Creating the task, the branch, the column and the folder is
193
191
  preparation: the work moves to the written-plan state, where the action is different. The
194
192
  turn-exit guard names the first stage in its refusal.
195
- - **The stages of a plan cover its done-sign whole.** A sign written wider than the sum of the
196
- stages means a part of the order is given to no step at all: every stage closes, the run is
193
+ - **The stages of a plan cover its done-sign whole.** Otherwise every stage closes, the run is
197
194
  green, and half the order is not done. Either the stages are written up to the sign, or the sign
198
195
  is narrowed to what the stages give.
199
196
  - **A stage's readiness sign is taken from the output of a command run while the plan is written.**
@@ -208,6 +205,13 @@ flowchart TD
208
205
  filed as a task.
209
206
  - **Done work is marked only in the progress.** "Where we stand" is rewritten by every session, not
210
207
  appended: it is the first thing the next session reads.
208
+ - **The plan names the steps of every stage, and the progress mirrors them with a mark each.** The
209
+ plan is not edited after it is written, the marks change every turn; a line nobody can call done
210
+ is not a step.
211
+ - **The numbers and the names of the steps are copied from the plan, not reworded.** A check matches
212
+ the two lists: a reworded name reads as a different step.
213
+ - **Exactly one step carries the mark of going on right now, while any step is not done.** Marked on
214
+ none, the progress says the work stands; marked on two, it says nothing at all.
211
215
  - **A word for a new notion is looked up in the tree's glossary.** It goes into the context whole
212
216
  at session start, so "did not read it" is never a ground.
213
217
  - **The task folder is created as a draft and gets its number by a command.** Until the grill ends,
@@ -216,14 +220,13 @@ flowchart TD
216
220
  - **Work ordered in words becomes a task in the queue in the same turn.** Even if it will not be
217
221
  done now: a draft folder has no number, and one session knows of it. Postponed work names a
218
222
  date; postponed silently, it reads as done.
219
- - **Work begins with the epic, and a task outside one is not taken.** The epic names what the whole
220
- is, and the main branch takes that whole or does not take it. Work outside an epic exists only by
223
+ - **Work begins with the epic, and a task outside one is not taken.** The main branch takes the
224
+ whole or does not take it. Work outside an epic exists only by
221
225
  the owner's word about that work, said about that work.
222
226
  - **The epic branch is taken before the first task of the epic, not with it.** Taken later, it
223
- leaves the first task standing on the main branch, and the epic starts as half of itself already
224
- merged.
227
+ leaves the first task standing on the main branch.
225
228
  - **The epic card moves to in progress by the same turn that takes its first task.** The owner
226
- follows the epic by one card, and one left where the epic was declared reads as never started.
229
+ follows the epic by one card: left where it was declared, the card reads as never started.
227
230
  Nothing checks this yet: the rule `git-workflow` holds the move command and names the gap.
228
231
  - **The next task is taken from the epic plan, and the queue list is asked only where there is no
229
232
  epic.** By a list of numbers someone else's epic cannot be told from one's own.
@@ -242,9 +245,8 @@ flowchart TD
242
245
  arrangements: each branch from the epic branch, or a stack — each from the previous. The
243
246
  arrangement written in the plan is the epic's decision, not that of whoever creates the branch.
244
247
  - **The PR of the epic opens when its last folder is taken apart, and not a task earlier.** A folder
245
- left in the epic branch reaches the main branch with it: what one branch needed becomes the tree's
246
- for good. Until then the epic branch is not offered to a person at all — the merge button on it
247
- means the whole epic.
248
+ left in the epic branch reaches the main branch with it. Until then the epic branch is not
249
+ offered to a person at all — the merge button on it means the whole epic.
248
250
  - **The epic plan lies where it is found without the network and after the merge.** The card does
249
251
  not hold the task order, and the task folder dies with the merge; the directory — in the rule's
250
252
  companion. What the owner names along the way is appended there by the turn that accepted it.
@@ -259,12 +261,11 @@ flowchart TD
259
261
  - **The review's findings wait for the owner, and only the digest of observations leaves for the
260
262
  package.** A proposal sent unreviewed becomes the work of someone who did not order it. The digest
261
263
  is always sent: it says what was used and is never an opinion.
262
- - **The cheap closing step goes before the costly one, and the run — after the merge.** Merging the
263
- agreement and bringing the texts up to date cost minutes, the run costs the session window; a run
264
+ - **The cheap closing step goes before the costly one, and the run — after the merge.** A run
264
265
  before the merge checks what will not reach main.
265
266
  - **The agreement merges into the domain spec by one of the last commits of the branch, before the
266
- PR opens.** By then the code is written, the bindings are known, and the `proposed/` directory
267
- never appears in main. What is ready to merge is listed by `npm run check:specs`.
267
+ PR opens.** By then the bindings are known, and `proposed/` never appears in main. What is ready
268
+ to merge is listed by `npm run check:specs`.
268
269
  - **The folder of a closed task is taken apart, not moved whole.** What explains a decision goes to
269
270
  `docs/archive/`; the rest is deleted. One not taken apart is caught by the work queue audit.
270
271
  - **Opening the PR and lifting the draft are refused while the branch carries its task folder.** A