@rt-tools/agent-kit 0.27.0 → 0.28.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.
- package/assets/checks/board-epic-plan.github.mjs +86 -0
- package/assets/checks/board-epics.github.mjs +12 -67
- package/assets/checks/board-pull-state.github.mjs +6 -11
- package/assets/checks/check-glossary.mjs +10 -2
- package/assets/checks/check-lib-layers.mjs +24 -1
- package/assets/checks/check-reuse.mjs +26 -2
- package/assets/checks/check-specs.mjs +8 -1
- package/assets/checks/lib-boundaries.mjs +2 -2
- package/assets/checks/lib-common.mjs +46 -0
- package/assets/checks/lib-manifests.mjs +18 -13
- package/assets/checks/rt-kit-checks.config.mjs +6 -0
- package/assets/checks/signals.mjs +39 -5
- package/assets/checks/spec-anchors.mjs +48 -4
- package/assets/checks/spec-common.mjs +40 -6
- package/assets/checks/spec-contract.mjs +33 -7
- package/assets/checks/spec-scenarios.mjs +24 -1
- package/assets/checks/task-new.github.mjs +9 -3
- package/assets/defaults/gate-map.sh +20 -5
- package/assets/defaults/project.sh +6 -0
- package/assets/hooks/dev-server-guard.sh +61 -32
- package/assets/hooks/exam-guard.sh +10 -10
- package/assets/hooks/git-guard-delivery-conflict.sh +53 -1
- package/assets/hooks/git-guard-delivery-draft.sh +7 -6
- package/assets/hooks/git-guard-delivery-tree.sh +50 -0
- package/assets/hooks/git-guard-delivery.sh +43 -23
- package/assets/hooks/git-guard-discard.sh +144 -0
- package/assets/hooks/git-guard-push-tests.sh +36 -16
- package/assets/hooks/reuse-first-guard.sh +29 -4
- package/assets/hooks/rule-source-guard.sh +17 -2
- package/assets/hooks/skill-gate.sh +7 -0
- package/assets/hooks/sql-guard-write.sh +18 -2
- package/assets/hooks/turn-exit-guard.sh +50 -66
- package/assets/hooks/turn-exit-patterns.sh +18 -1
- package/assets/hooks/turn-exit-verdict.sh +84 -0
- package/assets/laws/delivery.md +14 -6
- package/assets/laws/verifiability.md +22 -4
- package/assets/patterns/git-workflow-pr.github.md +39 -18
- package/assets/patterns/git-workflow-stack.md +21 -2
- package/assets/patterns/task-flow-close.md +65 -78
- package/assets/patterns/ts-procedure.md +6 -0
- package/assets/pitfalls/git-workflow.github.md +38 -0
- package/assets/pitfalls/task-flow.md +25 -23
- package/assets/rules/browser-verification.md +8 -0
- package/assets/rules/deploy-flow.github.md +6 -0
- package/assets/rules/doc-style.md +6 -0
- package/assets/rules/git-workflow.azure.md +10 -0
- package/assets/rules/git-workflow.github.md +119 -119
- package/assets/rules/git-workflow.gitlab.md +10 -0
- package/assets/rules/lib-layers.md +11 -0
- package/assets/rules/spec-driven.md +10 -1
- package/assets/rules/task-flow.md +59 -56
- package/assets/rules/testing.md +7 -0
- package/assets/rules/turn-conduct.md +23 -3
- package/assets/samples/tasks/_template/plan.md +4 -1
- package/assets/skills/agent-kit.md +17 -4
- package/bin/agent-kit.js +1 -1
- package/bin/agent-kit.js.map +1 -1
- package/lib/commands.d.ts +1 -1
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +59 -2
- package/lib/commands.js.map +1 -1
- package/lib/hooks-map.d.ts +5 -0
- package/lib/hooks-map.d.ts.map +1 -1
- package/lib/hooks-map.js +9 -3
- package/lib/hooks-map.js.map +1 -1
- package/lib/plan.d.ts +2 -0
- package/lib/plan.d.ts.map +1 -1
- package/lib/plan.js +8 -0
- package/lib/plan.js.map +1 -1
- package/lib/proposals.d.ts +25 -0
- package/lib/proposals.d.ts.map +1 -1
- package/lib/proposals.js +43 -1
- package/lib/proposals.js.map +1 -1
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.js +8 -11
- package/lib/shipment.js.map +1 -1
- package/package.json +1 -1
- package/rt-tools-agent-kit-0.28.0.tgz +0 -0
- package/rt-tools-agent-kit-0.27.0.tgz +0 -0
|
@@ -162,72 +162,12 @@ next_step=""
|
|
|
162
162
|
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/turn-exit-patterns.sh" 2>/dev/null || exit 0
|
|
163
163
|
[ -n "${work_re:-}" ] || exit 0
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
else 0 end) == 0);
|
|
172
|
-
|
|
173
|
-
(map(is_input) | rindex(true)) as $i
|
|
174
|
-
| (if $i == null then [] else .[$i:] end) as $turn
|
|
175
|
-
| [$turn[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "tool_use")] as $uses
|
|
176
|
-
# An edit of a file is work by definition, whatever tool it goes through.
|
|
177
|
-
| ($uses | map(.name // "") | any(test("^(Edit|Write|MultiEdit|NotebookEdit)$"))) as $edited
|
|
178
|
-
| ($uses | map(.name // "") | any(test("AskUserQuestion"))) as $asked
|
|
179
|
-
| ($uses | map((.input.command // "")) | join("\n")) as $ran
|
|
180
|
-
# Work is a part of the command that matched the work pattern and did not match the exploration
|
|
181
|
-
# pattern: switching a branch and reading history in the same turn do not become work.
|
|
182
|
-
| ([$ran | splits($part)] | map(test($work) and (test($read) | not)) | any) as $ran_work
|
|
183
|
-
# The last action of the turn. Waiting for a step by anyone else is never the end of a turn,
|
|
184
|
-
# however much work there was before: the work stays exactly where it stood.
|
|
185
|
-
| ([$uses[] | select((.name // "") == "Bash") | (.input.command // "")] | last // "") as $last
|
|
186
|
-
| ($last | test($wait)) as $waited
|
|
187
|
-
# Handing the work over: the tail of the turn after the PR was opened. Everything before it was
|
|
188
|
-
# done on the task handed in and says nothing about the next one.
|
|
189
|
-
| ([$uses[] | select((.name // "") == "Bash") | (.input.command // "")]) as $cmds
|
|
190
|
-
| (($cmds | map(test($handover)) | index(true))) as $handover_at
|
|
191
|
-
| ($handover_at != null) as $handed_over
|
|
192
|
-
| (if $handover_at == null then [] else $cmds[$handover_at:] end) as $tail
|
|
193
|
-
| (($tail | map(test($started)) | any)
|
|
194
|
-
or ($uses | map(.name // "") | any(test("^(Edit|Write|MultiEdit|NotebookEdit)$")))) as $started_next
|
|
195
|
-
# THE LAST ACTION OF THE TURN is the shared sign, and the particular tiers below only derive an
|
|
196
|
-
# understandable refusal from it. Nine incident analyses in a day describe nine different stops,
|
|
197
|
-
# and in all nine the last action of the turn was a text to the owner: a report, a summary, an
|
|
198
|
-
# announcement of intent. A tier for every kind of stop is an endless race: there are as many
|
|
199
|
-
# kinds as there are reasons to start talking. Hence one sign — the LAST action must be work.
|
|
200
|
-
| ([$uses[] | (.name // "")] | last // "") as $last_tool
|
|
201
|
-
| (($last_tool | test("^(Edit|Write|MultiEdit|NotebookEdit)$"))
|
|
202
|
-
or ([$last | splits($part)] | map(test($work) and (test($read) | not)) | any)) as $ended_working
|
|
203
|
-
# A guard refusal and a session handover — both end the turn by the rule.
|
|
204
|
-
| ([$turn[] | select(.type == "user") | .message.content // [] | select(type == "array") | .[]
|
|
205
|
-
| select(.type == "tool_result") | .content
|
|
206
|
-
| if type == "string" then .
|
|
207
|
-
elif type == "array" then (map(if type == "object" then (.text // "") else tostring end) | join("\n"))
|
|
208
|
-
else tostring end] | join("\n")) as $out
|
|
209
|
-
| (($out | test("BLOCKED by|Refused by the rules gate|Отбито гейтом")) or ($ran | test("BLOCKED by"))) as $denied
|
|
210
|
-
| ($ran | test("handoff")) as $handed
|
|
211
|
-
# The word of the owner about stopping: the reply itself is judged, not its retelling.
|
|
212
|
-
| ([$turn[] | select(.type == "user") | .message.content
|
|
213
|
-
| if type == "string" then . elif type == "array"
|
|
214
|
-
then (map(if type == "object" then (.text // "") else "" end) | join("\n")) else "" end] | join("\n")) as $said
|
|
215
|
-
| ($said | test("останов|стоп|хватит|подожди|не надо|прерв|отложи")) as $told_stop
|
|
216
|
-
# A question refused by the conversation guard, and a question appended as prose at the end of
|
|
217
|
-
# the reply. The conversation guard judges the call of the question tool and does not see prose
|
|
218
|
-
# at all: a refused question came back in the same wording one turn later and passed freely.
|
|
219
|
-
| ($out | test("BLOCKED by grill-gate")) as $ask_denied
|
|
220
|
-
| ([$turn[] | select(.type == "assistant") | (.message.content // [])[]
|
|
221
|
-
| select(.type == "text") | (.text // "")] | last // "") as $last_say
|
|
222
|
-
| (($last_say | test("\\?[[:space:]]*$")) and $ask_denied) as $asked_in_prose
|
|
223
|
-
# Waiting for the word of the owner, announced by the executor. That word is read from
|
|
224
|
-
# the owner: without his word in the turn and without a question to him through the tool, the
|
|
225
|
-
# phrase "waiting for your word" is a stop announced by the one it suits. The set of patterns is
|
|
226
|
-
# named and closed.
|
|
227
|
-
| (($last_say | test("[Жж]ду (твоего|вашего|его|её) (слова|указани|решени|ответа|команды|отмашки)|[Жж]ду слова владельца|[Жж]ду, что скаж|[Оо]стаюсь ждать|[Бб]уду ждать (твоего|вашего)"))
|
|
228
|
-
and (($asked or $told_stop or $handed) | not)) as $awaits_word
|
|
229
|
-
| { 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, ran: $ran }
|
|
230
|
-
' 2>/dev/null)"
|
|
165
|
+
# The parsing of the turn record lies in a neighbouring file: the guard crossed the file length
|
|
166
|
+
# limit, and the parsing reads apart from the tiers that apply its answer. Without the file the
|
|
167
|
+
# guard stays silent — fail-open, as on any breakage of its own.
|
|
168
|
+
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/turn-exit-verdict.sh" 2>/dev/null || exit 0
|
|
169
|
+
command -v rt_te_verdict >/dev/null 2>&1 || exit 0
|
|
170
|
+
rt_te_verdict
|
|
231
171
|
|
|
232
172
|
[ -z "$verdict" ] && exit 0
|
|
233
173
|
|
|
@@ -261,10 +201,54 @@ fi
|
|
|
261
201
|
# Incident analysis — the record
|
|
262
202
|
# "2026-09-04-hod-konchalsya-ozhidaniem-pri-deystvuyushchem-ukazanii" in the intake.
|
|
263
203
|
awaits_word="$(printf '%s' "$verdict" | jq -r '.awaits_word // false' 2>/dev/null)"
|
|
204
|
+
standing_work="$(printf '%s' "$verdict" | jq -r '.standing_work // false' 2>/dev/null)"
|
|
205
|
+
promised="$(printf '%s' "$verdict" | jq -r '.promised // false' 2>/dev/null)"
|
|
206
|
+
only_took="$(printf '%s' "$verdict" | jq -r '.only_took // false' 2>/dev/null)"
|
|
207
|
+
|
|
208
|
+
# A promise to do the work in the next turn. The same announcement of intent as a command named and
|
|
209
|
+
# not run: the tier stands before the lawful exits, because the promise most often stands next to a
|
|
210
|
+
# report about what was done, and by the fullness of the turn it is indistinguishable from a finish.
|
|
211
|
+
if [ "$promised" = "true" ] && [ "$released" != "true" ]; then
|
|
212
|
+
rt_te_deny "BLOCKED by turn-exit-guard: the reply ends with a promise to do the work in the next turn.
|
|
213
|
+
|
|
214
|
+
A promise is the same announcement of intent as a command named and not run, and it only sounds politer. An offer to the owner to object to the announced intent is part of the promise, not a question: a turn ends with a question when the work does not go without the answer.
|
|
215
|
+
|
|
216
|
+
Do the promised in this same turn, and the account of it can come after.
|
|
217
|
+
|
|
218
|
+
The next step is written in the progress: ${next_step}
|
|
219
|
+
|
|
220
|
+
The guard judges one turn: the next session is not refused." "the turn ended with a promise to do the work in the next turn."
|
|
221
|
+
fi
|
|
222
|
+
|
|
223
|
+
# Taking a task as the last action of the turn. Creating the task, the branch and the move of the
|
|
224
|
+
# column is preparation, and the work of the taken task did not begin. Taking it after handed-over
|
|
225
|
+
# work is a lawful end: there the taking answers for the handed-over one.
|
|
226
|
+
if [ "$only_took" = "true" ] && [ "$released" != "true" ]; then
|
|
227
|
+
rt_te_deny "BLOCKED by turn-exit-guard: the last action of the turn is taking a task, and the work of the taken task was not begun.
|
|
228
|
+
|
|
229
|
+
Creating the task, the branch and moving the column is preparation for work, not work. To the owner a report about a taken task is indistinguishable from a stop: they see the executor standing still.
|
|
230
|
+
|
|
231
|
+
Write the plan and begin its first stage in this same turn.
|
|
232
|
+
|
|
233
|
+
The guard judges one turn: the next session is not refused." "the turn ended with taking a task."
|
|
234
|
+
fi
|
|
264
235
|
# At the end of an epic waiting for the word of the owner is the work itself: the reading of that
|
|
265
236
|
# lies with the patterns and is shared with the guard of the stop.
|
|
266
237
|
[ "$awaits_word" = "true" ] && rt_te_epic_over && awaits_word=false
|
|
267
238
|
|
|
239
|
+
# The owner said to work without stops and did not cancel it. Their word holds until they cancel
|
|
240
|
+
# it, and a turn ending with waiting for that same word invents the cancellation. Judged whether or
|
|
241
|
+
# not there was work in the turn: the work stood three turns in a row, and each of them was full.
|
|
242
|
+
if [ "$standing_work" = "true" ] && [ "$awaits_word" = "true" ]; then
|
|
243
|
+
rt_te_deny "BLOCKED by turn-exit-guard: the turn ended with waiting for the word of the owner, and the owner said in this session to work without stops and did not cancel it.
|
|
244
|
+
|
|
245
|
+
Their word holds until they cancel it themselves, and a new fact against it is a line about the price in the reply, not waiting. A decision the tree does not hold is needed — then ask the question by the tool.
|
|
246
|
+
|
|
247
|
+
The next step is written in the progress: ${next_step}
|
|
248
|
+
|
|
249
|
+
The guard judges one turn: the next session is not refused." "the turn ended with waiting under the standing word of the owner to work."
|
|
250
|
+
fi
|
|
251
|
+
|
|
268
252
|
if [ "$awaits_word" = "true" ]; then
|
|
269
253
|
rt_te_deny "BLOCKED by turn-exit-guard: the turn ended with words about waiting for the word of the owner, and the word about stopping the guard reads from the owner: in this turn they announced no stop, and no question was put to them by the tool.
|
|
270
254
|
|
|
@@ -45,7 +45,24 @@ part_re='&&|\|\||;|\n'
|
|
|
45
45
|
# resolved, a commit and a push were made, and the last action became a loop until the run was ready
|
|
46
46
|
# passed it whole — there was work, and plenty. It is exactly that fullness that deceives: the
|
|
47
47
|
# emptiness behind such a turn is not visible.
|
|
48
|
-
|
|
48
|
+
# Two more kinds of last action were added after an analysis. The first is a run of the checks
|
|
49
|
+
# started in the background: the guard is given the background sign appended to the command, and on
|
|
50
|
+
# the foreground the same command stays work — it holds the turn to its own end. The second is a
|
|
51
|
+
# read of a background task's log: the run was started, the log was read, a report was written, and
|
|
52
|
+
# the tree did not change by a single sign; such a turn stands exactly as long as an empty one.
|
|
53
|
+
wait_re='gh[[:space:]]+(run[[:space:]]+watch|pr[[:space:]]+checks[^|]*--watch)|until[[:space:]].*sleep|while[[:space:]].*sleep|^[[:space:]]*sleep[[:space:]]|(nx[[:space:]]+(affected|run-many|test|build|lint|e2e)|npm[[:space:]]+run[[:space:]]+(lint|test|check:|e2e)|pnpm[[:space:]]+run|playwright[[:space:]]+test|vitest|jest|bash[[:space:]].*tests?/)[^&]*&[[:space:]]*$|(cat|tail|head|less|grep)[^|]*\.(log|output)([[:space:]]|$)|tasks/[A-Za-z0-9]+\.output'
|
|
54
|
+
|
|
55
|
+
# A promise to do the work in the next turn. The same announcement of intent as a command named and
|
|
56
|
+
# not run, only it sounds politer and is therefore recognised as a stop less often. An offer to the
|
|
57
|
+
# owner to object to the announced intent is part of the promise, not a question: a turn ends with a
|
|
58
|
+
# question when the work does not go without the answer, and here it did go.
|
|
59
|
+
promise_re='следующим ходом|в следующий раз|дальше возьму|дальше допишу|допишу остальн|доделаю остальн|доделаю в следующ|продолжу в следующ|беру[^.]{0,40}следующим|возьму[^.]{0,40}следующим'
|
|
60
|
+
|
|
61
|
+
# The owner's standing word to work without stops. It holds until they cancel it, and a turn that
|
|
62
|
+
# ended with waiting for their word invents that cancellation. Without this the word about a stop
|
|
63
|
+
# was read out of it by the piece «останов» in «без остановок» — the instruction to work was taken
|
|
64
|
+
# for its opposite.
|
|
65
|
+
standing_work_re='работай[^.]{0,40}(без остановок|без пауз|сам)|не останавливайся|продолжай[^.]{0,40}(без остановок|без пауз)|работай дальше'
|
|
49
66
|
|
|
50
67
|
# Handing work over and starting the next. The rule calls handed-over work a lawful end of a turn —
|
|
51
68
|
# but on a condition: the next one is started, and an ACTION has been done on it, not spoken.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The parsing of the turn record for the turn-exit guard. NOT a guard: it has no `rt-hook:`
|
|
3
|
+
# declaration and hooks into no agent event. The guard sources it right after the patterns —
|
|
4
|
+
# it was moved out when the guard crossed the file length limit, and the parsing reads apart
|
|
5
|
+
# from the tiers that apply its answer.
|
|
6
|
+
#
|
|
7
|
+
# It expects the patterns to be sourced already and `$transcript` to be set; it prints nothing
|
|
8
|
+
# and leaves the answer in `$verdict`.
|
|
9
|
+
|
|
10
|
+
rt_te_verdict() {
|
|
11
|
+
verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg work "$work_re" --arg read "$read_re" --arg part "$part_re" --arg wait "$wait_re" --arg handover "$handover_re" --arg started "$started_re" --arg promise "$promise_re" --arg standing "$standing_work_re" '
|
|
12
|
+
def is_input:
|
|
13
|
+
.type == "user"
|
|
14
|
+
and ((.isCompactSummary // false) | not)
|
|
15
|
+
and (((.message.content // []) | if type == "array"
|
|
16
|
+
then ([.[] | select(.type == "tool_result")] | length)
|
|
17
|
+
else 0 end) == 0);
|
|
18
|
+
|
|
19
|
+
(map(is_input) | rindex(true)) as $i
|
|
20
|
+
| (if $i == null then [] else .[$i:] end) as $turn
|
|
21
|
+
| [$turn[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "tool_use")] as $uses
|
|
22
|
+
# An edit of a file is work by definition, whatever tool it goes through.
|
|
23
|
+
| ($uses | map(.name // "") | any(test("^(Edit|Write|MultiEdit|NotebookEdit)$"))) as $edited
|
|
24
|
+
| ($uses | map(.name // "") | any(test("AskUserQuestion"))) as $asked
|
|
25
|
+
| ($uses | map((.input.command // "")) | join("\n")) as $ran
|
|
26
|
+
# Work is a part of the command that matched the work pattern and did not match the exploration
|
|
27
|
+
# pattern: switching a branch and reading history in the same turn do not become work.
|
|
28
|
+
| ([$ran | splits($part)] | map(test($work) and (test($read) | not)) | any) as $ran_work
|
|
29
|
+
# The last action of the turn. Waiting for a step by anyone else is never the end of a turn,
|
|
30
|
+
# however much work there was before: the work stays exactly where it stood.
|
|
31
|
+
| ([$uses[] | select((.name // "") == "Bash") | ((.input.command // "") + (if (.input.run_in_background // false) then " &" else "" end))] | last // "") as $last
|
|
32
|
+
| ([$uses[] | (.name // "")] | last // "") as $last_name
|
|
33
|
+
| (($last_name == "Bash") and ($last | test($wait))) as $waited
|
|
34
|
+
# Handing the work over: the tail of the turn after the PR was opened. Everything before it was
|
|
35
|
+
# done on the task handed in and says nothing about the next one.
|
|
36
|
+
| ([$uses[] | select((.name // "") == "Bash") | (.input.command // "")]) as $cmds
|
|
37
|
+
| (($cmds | map(test($handover)) | index(true))) as $handover_at
|
|
38
|
+
| ($handover_at != null) as $handed_over
|
|
39
|
+
| (if $handover_at == null then [] else $cmds[$handover_at:] end) as $tail
|
|
40
|
+
| (($tail | map(test($started)) | any)
|
|
41
|
+
or ($uses | map(.name // "") | any(test("^(Edit|Write|MultiEdit|NotebookEdit)$")))) as $started_next
|
|
42
|
+
# THE LAST ACTION OF THE TURN is the shared sign, and the particular tiers below only derive an
|
|
43
|
+
# understandable refusal from it. Nine incident analyses in a day describe nine different stops,
|
|
44
|
+
# and in all nine the last action of the turn was a text to the owner: a report, a summary, an
|
|
45
|
+
# announcement of intent. A tier for every kind of stop is an endless race: there are as many
|
|
46
|
+
# kinds as there are reasons to start talking. Hence one sign — the LAST action must be work.
|
|
47
|
+
| ([$uses[] | (.name // "")] | last // "") as $last_tool
|
|
48
|
+
| (($last_tool | test("^(Edit|Write|MultiEdit|NotebookEdit)$"))
|
|
49
|
+
or ([$last | splits($part)] | map(test($work) and (test($read) | not)) | any)) as $ended_working
|
|
50
|
+
# A guard refusal and a session handover — both end the turn by the rule.
|
|
51
|
+
| ([$turn[] | select(.type == "user") | .message.content // [] | select(type == "array") | .[]
|
|
52
|
+
| select(.type == "tool_result") | .content
|
|
53
|
+
| if type == "string" then .
|
|
54
|
+
elif type == "array" then (map(if type == "object" then (.text // "") else tostring end) | join("\n"))
|
|
55
|
+
else tostring end] | join("\n")) as $out
|
|
56
|
+
| (($out | test("BLOCKED by|Refused by the rules gate|Отбито гейтом")) or ($ran | test("BLOCKED by"))) as $denied
|
|
57
|
+
| ($ran | test("handoff")) as $handed
|
|
58
|
+
# The word of the owner about stopping: the reply itself is judged, not its retelling.
|
|
59
|
+
| ([$turn[] | select(.type == "user") | .message.content
|
|
60
|
+
| if type == "string" then . elif type == "array"
|
|
61
|
+
then (map(if type == "object" then (.text // "") else "" end) | join("\n")) else "" end] | join("\n")) as $said
|
|
62
|
+
| ([.[] | select(.type == "user") | .message.content
|
|
63
|
+
| if type == "string" then . elif type == "array"
|
|
64
|
+
then (map(if type == "object" then (.text // "") else "" end) | join("\n")) else "" end] | join("\n")) as $session_said
|
|
65
|
+
| ($session_said | test($standing)) as $standing_work
|
|
66
|
+
| (($said | test("останов|стоп|хватит|подожди|не надо|прерв|отложи")) and ($said | test($standing) | not)) as $told_stop
|
|
67
|
+
# A question refused by the conversation guard, and a question appended as prose at the end of
|
|
68
|
+
# the reply. The conversation guard judges the call of the question tool and does not see prose
|
|
69
|
+
# at all: a refused question came back in the same wording one turn later and passed freely.
|
|
70
|
+
| ($out | test("BLOCKED by grill-gate")) as $ask_denied
|
|
71
|
+
| ([$turn[] | select(.type == "assistant") | (.message.content // [])[]
|
|
72
|
+
| select(.type == "text") | (.text // "")] | last // "") as $last_say
|
|
73
|
+
| (($last_say | test("\\?[[:space:]]*$")) and $ask_denied) as $asked_in_prose
|
|
74
|
+
# Waiting for the word of the owner, announced by the executor. That word is read from
|
|
75
|
+
# the owner: without his word in the turn and without a question to him through the tool, the
|
|
76
|
+
# phrase "waiting for your word" is a stop announced by the one it suits. The set of patterns is
|
|
77
|
+
# named and closed.
|
|
78
|
+
| (($last_say | test("[Жж]ду (твоего|вашего|его|её) (слова|указани|решени|ответа|команды|отмашки)|[Жж]ду слова владельца|[Жж]ду, что скаж|[Оо]стаюсь ждать|[Бб]уду ждать (твоего|вашего)"))
|
|
79
|
+
and (($asked or $told_stop or $handed) | not)) as $awaits_word
|
|
80
|
+
| ($last_say | test($promise)) as $promised
|
|
81
|
+
| (($last_name == "Bash") and ($last | test($started)) and ($handed_over | not)) as $only_took
|
|
82
|
+
| { promised: $promised, only_took: $only_took, 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, ran: $ran }
|
|
83
|
+
' 2>/dev/null)"
|
|
84
|
+
}
|
package/assets/laws/delivery.md
CHANGED
|
@@ -135,16 +135,24 @@ application stops responding, and the reason is found from the history.
|
|
|
135
135
|
PR is open, the work does not count as done: there is no review of it, and the person does not
|
|
136
136
|
know about it. The PR is opened in the same turn in which the executor says the work is handed
|
|
137
137
|
over — not in the next session and not on a reminder.
|
|
138
|
-
- **A PR
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
- **A PR that waits for something is marked as a draft, and one that waits for nothing opens
|
|
139
|
+
ready.** An open PR reads as an invitation to merge, and a person presses merge without asking
|
|
140
|
+
whether the work is finished. The draft separates two states that otherwise look the same: the
|
|
141
|
+
change is put up for viewing — and the change is ready to go to the main branch. It is set on
|
|
142
|
+
what waits for a run, for rework or for an answer to a question; the question is asked in the PR
|
|
143
|
+
itself, not kept in the executor's head. Where there is nothing to wait for, a draft costs an
|
|
144
|
+
extra turn and a locked button, and it shows the owner work in progress where the work is done.
|
|
145
|
+
- **Where the run comes from is part of the order of handing in, and the tree names it.** The
|
|
146
|
+
draft holds because the run is had on the PR itself: to get it the PR must be opened, and an
|
|
147
|
+
opened one already reads as an invitation. A tree whose pipeline wakes earlier — or does not wake
|
|
148
|
+
on this kind of PR at all — has nothing for the draft to wait for there, and the PR opens ready.
|
|
149
|
+
A law that named one source of the run would promise the other tree an order it cannot carry out.
|
|
143
150
|
- **Lifting the draft is a separate turn, and with it the executor answers for readiness.** The
|
|
144
151
|
draft is lifted when the checks have passed, no rework remains and the work matches what the task
|
|
145
152
|
was created for. While it stands, the executor's silence means "not ready yet", and the person has
|
|
146
153
|
to ask nothing; after it is lifted, silence means "can be merged", and the price of a mistake here
|
|
147
|
-
is a change in the main branch.
|
|
154
|
+
is a change in the main branch. A PR opened ready carries the same answer, given at the minute of
|
|
155
|
+
opening.
|
|
148
156
|
- **A PR about what was done stays true until the merge itself.** It describes the tree on the day
|
|
149
157
|
it was written, and waits for review for days. In that time the main branch is merged into the
|
|
150
158
|
branch, and the PR's statement about neighbouring files becomes false silently — no check reads PR
|
|
@@ -78,11 +78,18 @@ that "should work" and code that was checked look the same in the history.
|
|
|
78
78
|
tool's settings, not bypassed in every place.** The bypass has to be repeated as many times as
|
|
79
79
|
there are such places, and none of them says why: from outside it looks like the author's mistake,
|
|
80
80
|
not a decision.
|
|
81
|
+
- **A check and a guard outrank the executor's judgement of their own work.** The executor judges
|
|
82
|
+
their own code with an interest: they remember the intent and see it instead of the result, while
|
|
83
|
+
the check reads only the result. A divergence is closed by an edit of the code, and the
|
|
84
|
+
executor's argument that the check is wrong is no argument at all — neither in their own decision
|
|
85
|
+
nor in a question to the owner.
|
|
81
86
|
- **A red check means wrong code, not a wrong check.** A place taken out from under the check so
|
|
82
87
|
that it goes quiet fixes the reading, not what the check pointed at: the code stays the same, and
|
|
83
|
-
nobody has a signal about it any more.
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
nobody has a signal about it any more. There is one move out of a red check — fix what it pointed
|
|
89
|
+
at. Stopping the work and a question to the owner are not a move: the question names them a
|
|
90
|
+
choice that does not exist, and it costs as much as the fix. The known list is accumulated by the
|
|
91
|
+
day the check is created and only shrinks — it is not added to by the executor's decision, nor by
|
|
92
|
+
the word of the owner: a line in it silences the signal about code that stayed the same.
|
|
86
93
|
- **The usefulness of a rule is confirmed by observing how it is used, not by an opinion about it.**
|
|
87
94
|
A rule that was never opened and a rule half the work rests on look the same in the text — and
|
|
88
95
|
what gets edited first is usually what was remembered, not what gets in the way. Observation is
|
|
@@ -98,6 +105,16 @@ that "should work" and code that was checked look the same in the history.
|
|
|
98
105
|
the analysis — how many lines, of what kind, how their falsity is proven — and fixes the check
|
|
99
106
|
itself. The known list is not used for this: it holds what was accepted, not the results of a
|
|
100
107
|
broken check.
|
|
108
|
+
- **A check that did not find what to compare says so and does not count as matched.** An empty
|
|
109
|
+
input is three different states — there is no subject at all, the subject is declared and not
|
|
110
|
+
found, the declaration was not parsed — and merged into one they give a green where nothing was
|
|
111
|
+
compared. The lawful answer "there is nothing to compare" is said by a word in the text being
|
|
112
|
+
checked, not derived from an empty parse.
|
|
113
|
+
- **A declaration read by a check as text is written as a literal in the place of the
|
|
114
|
+
declaration.** What is moved into a constant or assembled by an expression such a check does not
|
|
115
|
+
see at all: the application works, the check is silent, and the miss shows itself by nothing.
|
|
116
|
+
Where a value has to be a literal, that is said in the same place where it is said what declares
|
|
117
|
+
it.
|
|
101
118
|
- **A decision that depends on the current moment gets the moment from outside.** Otherwise it can
|
|
102
119
|
be checked only by turning the clock, and a turned clock acts on everything that happens to be
|
|
103
120
|
nearby: the check starts depending on what has no relation to it.
|
|
@@ -124,7 +141,8 @@ that "should work" and code that was checked look the same in the history.
|
|
|
124
141
|
indistinguishable from one the tree never had at all: the run is green because nobody called it.
|
|
125
142
|
The neighbouring article judges a place taken out from under the check — here it is not a place
|
|
126
143
|
that is taken out but the whole check, and no trace remains in the code. The discrepancy is closed
|
|
127
|
-
by what the check pointed at
|
|
144
|
+
by what the check pointed at: the check is returned to the set, and the discrepancy under it is
|
|
145
|
+
fixed.
|
|
128
146
|
- **A change to the look is checked at every layout threshold, not at one width.** Thresholds are
|
|
129
147
|
the places where the layout changes, and a slip lives exactly there: on either side of the
|
|
130
148
|
threshold the layout is assembled differently, and in the middle it looks correct. A change
|
|
@@ -48,24 +48,41 @@ Type and scope — `fix(site):`, `docs(common):` — do not go into the PR title
|
|
|
48
48
|
subject format, and `commitlint` checks it there. In the PR list it takes room and adds nothing:
|
|
49
49
|
the kind of edit and the area are already visible by the labels.
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## A draft where a run is waited for, ready where it is not
|
|
52
52
|
|
|
53
53
|
A code edit is handed to a person by an open PR: a pushed branch is shown to them nowhere. An
|
|
54
54
|
open PR reads as an invitation to merge, so unfinished work opens it as a draft — the host locks
|
|
55
|
-
a draft's merge button itself
|
|
55
|
+
a draft's merge button itself.
|
|
56
|
+
|
|
57
|
+
**Which bases the pipeline wakes for is read from its file, not from memory.** That one line decides
|
|
58
|
+
which of the two orders applies, and taking the wrong one means either waiting for a run that never
|
|
59
|
+
comes or handing over unchecked work as finished:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# the bases the checks wake for; nothing printed means every base
|
|
63
|
+
sed -n '/^on:/,/^[a-z]/p' .github/workflows/<файл конвейера>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
A base the pipeline wakes for — the PR opens as a draft, and the draft is lifted on the green run:
|
|
56
67
|
|
|
57
68
|
```bash
|
|
58
69
|
GH_TOKEN="$TOKEN" gh pr create --draft --base <ветка эпика> --title '[<КЛЮЧ>-86] …' --body-file тело.md
|
|
59
70
|
```
|
|
60
71
|
|
|
72
|
+
A base it does not wake for — nothing to wait for, and the PR opens without the draft key. The push
|
|
73
|
+
gate is then the only blocking check behind the work, green before the branch is sent:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
GH_TOKEN="$TOKEN" gh pr create --base <ветка эпика> --title '[<КЛЮЧ>-86] …' --body-file тело.md
|
|
77
|
+
```
|
|
78
|
+
|
|
61
79
|
**The base is the epic branch, and it is named by the command.** Without `--base` the host takes
|
|
62
|
-
the default branch
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
the repository's default branch: the request then carries the task past the epic, and the epic
|
|
81
|
+
branch stays a copy nobody merges. The epic's own request is the only one based on the main branch,
|
|
82
|
+
and it opens when the last folder of its tasks is taken apart.
|
|
65
83
|
|
|
66
|
-
Everything waiting for a pipeline run, a rework or an answer
|
|
67
|
-
|
|
68
|
-
the session's conversation.
|
|
84
|
+
Everything waiting for a pipeline run, a rework or an answer goes as a draft, and the question is
|
|
85
|
+
asked in the PR itself: a person reads the PR, not the session's conversation.
|
|
69
86
|
|
|
70
87
|
The draft is lifted by a separate call, and that is the very turn in which the executor says the
|
|
71
88
|
solution is ready:
|
|
@@ -75,8 +92,9 @@ GH_TOKEN="$TOKEN" gh pr ready 86
|
|
|
75
92
|
```
|
|
76
93
|
|
|
77
94
|
Before the lifting the executor's silence means "not ready yet", after — "may be merged".
|
|
78
|
-
Lifting the draft and asking to merge go in one turn: a lifted draft nobody told the person
|
|
79
|
-
|
|
95
|
+
Lifting the draft and asking to merge go in one turn: a lifted draft nobody told the person about
|
|
96
|
+
waits for review just like one not lifted. A PR opened without the draft key needs no such call,
|
|
97
|
+
and the request to merge goes in the turn that opened it.
|
|
80
98
|
|
|
81
99
|
## The PR is attached to the task
|
|
82
100
|
|
|
@@ -272,10 +290,14 @@ push gate — below is what it does not know.
|
|
|
272
290
|
the showcase snapshots: since the merge the pipeline runs them on its code, and the red
|
|
273
291
|
comes to its PR.
|
|
274
292
|
|
|
275
|
-
|
|
276
|
-
while work goes on, the person is shown what
|
|
277
|
-
Items 1–15 are passed before `gh pr ready`, and an unmet item means the draft
|
|
278
|
-
that the PR does not open.
|
|
293
|
+
Where the pipeline wakes for this base, the list is about lifting the draft: the PR opens as a
|
|
294
|
+
draft earlier, while work goes on, and the person is shown what exists together with what is
|
|
295
|
+
still missing. Items 1–15 are then passed before `gh pr ready`, and an unmet item means the draft
|
|
296
|
+
is not lifted — not that the PR does not open.
|
|
297
|
+
|
|
298
|
+
Where it does not wake, the same list is about opening: there is no second state to hold the work
|
|
299
|
+
in, so an unmet item means the PR does not open yet. Item 1 changes with it — no run is asked for,
|
|
300
|
+
and its place is taken by the push gate, green before the sending.
|
|
279
301
|
|
|
280
302
|
Right after publishing the task is moved to review — `npm run task:move -- <номер>
|
|
281
303
|
in-review` — and `npm run check:board` is run once more: before the PR opens it does not judge
|
|
@@ -284,10 +306,9 @@ the column, after the opening it sees the discrepancy.
|
|
|
284
306
|
What was done by reasoning and what was done by measurement are told apart plainly in the PR
|
|
285
307
|
body: the unchecked named as checked, the reviewer takes as checked.
|
|
286
308
|
|
|
287
|
-
**The "What confirms it" section names what was not run too.** A list of one run cannot be told
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
it is rechecked whole.
|
|
309
|
+
**The "What confirms it" section names what was not run too.** A list of one run cannot be told from
|
|
310
|
+
the full set, and by it the reviewer decides what need not be rechecked. The price of a mistake here
|
|
311
|
+
is trust in the section: once read as complete, from then on it is rechecked whole.
|
|
291
312
|
|
|
292
313
|
## Common misses
|
|
293
314
|
|
|
@@ -52,8 +52,21 @@ gh pr create --base <предыдущая ветка> --title '[<КЛЮЧ>-<но
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Neither the main branch nor the epic branch is set as the base here: the review then shows the own
|
|
55
|
-
edit mixed with all under it.
|
|
56
|
-
|
|
55
|
+
edit mixed with all under it.
|
|
56
|
+
|
|
57
|
+
**The base of the heir is retargeted by hand, by the same motion that merges the lower one.** The
|
|
58
|
+
host does it itself only when the merged branch is deleted; a branch is usually left after the
|
|
59
|
+
merge, and then the heir keeps standing on it — the upper PR merges into the neighbour and not into
|
|
60
|
+
the epic branch. A chain of nine went through this: the base moved by itself in none of the nine.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# right after the lower PR is merged — the base of the heir moves to where the lower one stood
|
|
64
|
+
gh api repos/<владелец>/<дерево>/pulls/<номер наследника> -X PATCH -f base=<основание нижней>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
From the browser the same is done by editing the PR heading, where the base stands as a dropdown.
|
|
68
|
+
The miss turns red nowhere: the PR looks merged, the task closes by its `Closes` line, and the work
|
|
69
|
+
is not where it was meant to go.
|
|
57
70
|
|
|
58
71
|
The merge order stands in every PR body as the line "stands on #<number>, merge after it": the
|
|
59
72
|
owner merges by the list, and branch kinship is invisible in the list.
|
|
@@ -79,6 +92,12 @@ gh pr list --state open --json number,headRefName,baseRefName \
|
|
|
79
92
|
upward.
|
|
80
93
|
- **A chain is not merged from the middle.** One merged out of order drags along everything
|
|
81
94
|
under it — and the review of that work never happens.
|
|
95
|
+
- **A branch whose base was merged past it is looked for by hand.** The host counts the lower
|
|
96
|
+
branch merged, closes its PR and offers nothing about the upper ones: their edits are in main,
|
|
97
|
+
their own commits on top are not, and nobody is told. Such a branch is alive only while
|
|
98
|
+
somebody remembers it — two pieces of work stayed in branches like that and were found by a
|
|
99
|
+
list of branches, not by a list of PRs. After a merge out of order the branches of the chain
|
|
100
|
+
are listed and each is either rebased onto main anew or closed by word.
|
|
82
101
|
- **Ready branches are not hoarded.** A chain does not cancel that the unit of work is a merged
|
|
83
102
|
PR: it only makes safe the length that has piled up anyway.
|
|
84
103
|
|