@rt-tools/agent-kit 0.29.4 → 0.30.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-epics.github.mjs +17 -2
- package/assets/checks/board-folders.mjs +40 -1
- package/assets/checks/check-board.github.mjs +2 -1
- package/assets/checks/check-prose-style.mjs +6 -2
- package/assets/checks/spec-anchors.mjs +5 -1
- package/assets/defaults/gate-map.sh +4 -1
- package/assets/defaults/shell.sh +6 -2
- package/assets/hooks/claim-guard.sh +42 -13
- package/assets/hooks/epic-stop-guard.sh +26 -1
- package/assets/hooks/git-guard-delivery-epic.sh +11 -1
- package/assets/hooks/git-guard-delivery-tree.sh +29 -0
- package/assets/hooks/git-guard-delivery.sh +6 -6
- package/assets/hooks/git-guard-push-tests.sh +10 -1
- package/assets/hooks/grill-gate-bypass.sh +61 -0
- package/assets/hooks/grill-gate.sh +143 -3
- package/assets/hooks/proposal-guard.sh +3 -0
- package/assets/hooks/turn-exit-guard.sh +3 -3
- package/assets/hooks/turn-exit-verdict.sh +18 -1
- package/assets/patterns/git-workflow-commit.azure.md +4 -0
- package/assets/patterns/git-workflow-commit.github.md +15 -0
- package/assets/patterns/git-workflow-commit.gitlab.md +4 -0
- package/assets/patterns/git-workflow-pr-body.github.md +4 -0
- package/assets/patterns/queue-audit-read.github.md +47 -0
- package/assets/patterns/spec-driven-rule.md +8 -2
- package/assets/patterns/task-flow-close.md +11 -9
- package/assets/patterns/task-flow-start.md +21 -22
- package/assets/pitfalls/doc-style.md +8 -0
- package/assets/pitfalls/turn-conduct.md +14 -0
- package/assets/rules/component-structure.md +4 -0
- package/assets/rules/doc-style.md +20 -3
- package/assets/rules/git-workflow.azure.md +4 -0
- package/assets/rules/git-workflow.github.md +7 -24
- package/assets/rules/git-workflow.gitlab.md +4 -0
- package/assets/rules/queue-audit.github.md +77 -0
- package/assets/rules/status-report.md +6 -0
- package/assets/rules/task-flow.md +18 -21
- package/assets/rules/testing.md +4 -0
- package/assets/rules/turn-conduct.md +22 -20
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +12 -2
- package/lib/commands.js.map +1 -1
- package/lib/hooks-map.d.ts +14 -0
- package/lib/hooks-map.d.ts.map +1 -1
- package/lib/hooks-map.js +55 -8
- package/lib/hooks-map.js.map +1 -1
- package/lib/sync.d.ts +9 -0
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +6 -1
- package/lib/sync.js.map +1 -1
- package/package.json +1 -1
- package/rt-tools-agent-kit-0.30.0.tgz +0 -0
- package/rt-tools-agent-kit-0.29.4.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Requires: hooks/deny-tail.sh
|
|
2
|
+
# Requires: hooks/deny-tail.sh, hooks/turn-exit-patterns.sh, hooks/grill-gate-bypass.sh
|
|
3
3
|
# rt-hook: Stop
|
|
4
4
|
# The conversation guard: the owner is not asked a question until the laws and rules have been read
|
|
5
5
|
# within the same turn. It judges two events, and that is not duplication; the second is declared
|
|
@@ -117,6 +117,17 @@ if command -v skill_for >/dev/null 2>&1 && [ -n "$rules_dir" ]; then
|
|
|
117
117
|
| map(select(. != "")) | unique | .[]
|
|
118
118
|
' 2>/dev/null)"
|
|
119
119
|
for path in $edited; do
|
|
120
|
+
# Only this tree's paths make up the area: a draft in the session scratch directory is not
|
|
121
|
+
# work of this tree, and the rule its kind maps to answers no question put to the owner. The
|
|
122
|
+
# rules gate stops at the same root check; a relative path is a path of the tree.
|
|
123
|
+
case "$path" in
|
|
124
|
+
/*)
|
|
125
|
+
case "$path" in
|
|
126
|
+
"${CLAUDE_PROJECT_DIR:-$PWD}"/*) ;;
|
|
127
|
+
*) continue ;;
|
|
128
|
+
esac
|
|
129
|
+
;;
|
|
130
|
+
esac
|
|
120
131
|
for rule in $(skill_for edit "$path" '' 2>/dev/null); do
|
|
121
132
|
case "|$need_re|" in
|
|
122
133
|
*"|$rule|"*) ;;
|
|
@@ -212,7 +223,9 @@ if [ -n "$tool" ]; then
|
|
|
212
223
|
else (. // "") end) as $said
|
|
213
224
|
| ([.[:$i][] | select(.type == "assistant") | (.message.content // [])[]
|
|
214
225
|
| select(.type == "tool_use") | select(.name == "AskUserQuestion")] | length) as $before
|
|
215
|
-
|
|
226
|
+
# A reply of fewer than five significant words is a command, not a decision: «take task
|
|
227
|
+
# N» shares the number and the words of the subject with any next question about it.
|
|
228
|
+
| if $before == 0 or (($said | words) | length) < 5 then "no" else
|
|
216
229
|
(($now | words) - (($now | words) - ($said | words))) as $common
|
|
217
230
|
| if ($common | length) >= 3 then "answered" else "no" end
|
|
218
231
|
end
|
|
@@ -293,6 +306,123 @@ ${deny_tail_text}"
|
|
|
293
306
|
fi
|
|
294
307
|
fi
|
|
295
308
|
|
|
309
|
+
# The fifth sign of the same guard: a question that offers to walk around a check does not leave.
|
|
310
|
+
#
|
|
311
|
+
# A red set was explained by a "foreign" cause, and the owner was asked whether to send it past the
|
|
312
|
+
# check. Such a question is a miss by itself, even when the owner answers "yes": a check is fixed at
|
|
313
|
+
# its cause or fixed itself, and a third option is not named. The sign reads the text the owner
|
|
314
|
+
# reads — the menu with its options, or the last reply when it ends with a question — and looks for
|
|
315
|
+
# the forms of a bypass: past the check, a bypass line, a disabled rule, a hook switched off.
|
|
316
|
+
#
|
|
317
|
+
# The sign lies in a file of its own next to the guard; without it the sign stays silent.
|
|
318
|
+
# shellcheck disable=SC1090
|
|
319
|
+
[ -f "$rt_hooks_dir/grill-gate-bypass.sh" ] && . "$rt_hooks_dir/grill-gate-bypass.sh" 2>/dev/null
|
|
320
|
+
command -v rt_grill_bypass >/dev/null 2>&1 && rt_grill_bypass && exit 0
|
|
321
|
+
|
|
322
|
+
# The fourth sign of the same guard: a question after a refusal carries what was done without the
|
|
323
|
+
# answer.
|
|
324
|
+
#
|
|
325
|
+
# A guard refused, the executor ran not one edit and brought the owner a choice "fix or wait". A
|
|
326
|
+
# question is a lawful exit of a turn, so no guard held it, and the owner asked why the work stopped.
|
|
327
|
+
# A refusal removes the step, not the task: the mechanical part of the blocker is done first. So a
|
|
328
|
+
# question after a refusal leaves only with the line the tree names, and with at least one working
|
|
329
|
+
# command after the last refusal — an edit of a file or a command by the work pattern of the exit
|
|
330
|
+
# guard. A read or a status command does not count: it looks like work and moves nothing.
|
|
331
|
+
#
|
|
332
|
+
# The menu and a question in prose are judged alike: one change of form would otherwise walk around
|
|
333
|
+
# the requirement. A turn without a refusal is not judged by this sign.
|
|
334
|
+
#
|
|
335
|
+
# The line is written in the language the tree speaks to its owner: the tree names it by
|
|
336
|
+
# `RT_DONE_WITHOUT_ANSWER` in its profile, and set empty it drops the sign.
|
|
337
|
+
#
|
|
338
|
+
# FAIL-OPEN: no turn record, no parser, no refusal in the turn — the sign stays silent.
|
|
339
|
+
done_marker="${RT_DONE_WITHOUT_ANSWER-Без ответа сделано:}"
|
|
340
|
+
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 '
|
|
341
|
+
# shellcheck disable=SC1090
|
|
342
|
+
[ -f "$rt_hooks_dir/turn-exit-patterns.sh" ] && . "$rt_hooks_dir/turn-exit-patterns.sh" 2>/dev/null
|
|
343
|
+
if [ -n "$done_marker" ]; then
|
|
344
|
+
after_refusal="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg work "$work_re" '
|
|
345
|
+
def is_input:
|
|
346
|
+
.type == "user"
|
|
347
|
+
and ((.isCompactSummary // false) | not)
|
|
348
|
+
and ((.isMeta // false) | not)
|
|
349
|
+
and (((.message.content // []) | if type == "array"
|
|
350
|
+
then ([.[] | select(.type == "tool_result")] | length)
|
|
351
|
+
else 0 end) == 0);
|
|
352
|
+
def refusal:
|
|
353
|
+
.type == "user" and ((.message.content // []) | if type == "array"
|
|
354
|
+
then any(.[]; .type == "tool_result" and (.is_error // false)
|
|
355
|
+
and ((.content | if type == "string" then . elif type == "array"
|
|
356
|
+
then (map(if type == "object" then (.text // "") else "" end) | join(" "))
|
|
357
|
+
else "" end) | test("BLOCKED|Refused|denied")))
|
|
358
|
+
else false end);
|
|
359
|
+
def working:
|
|
360
|
+
.type == "assistant" and ((.message.content // []) | any(.[];
|
|
361
|
+
.type == "tool_use" and (
|
|
362
|
+
((.name // "") | test("^(Edit|Write|NotebookEdit)$"))
|
|
363
|
+
or ((.name == "Bash") and ((.input.command // "") | test($work))))));
|
|
364
|
+
|
|
365
|
+
(map(is_input) | rindex(true)) as $i
|
|
366
|
+
| (if $i == null then . else .[$i + 1:] end) as $turn
|
|
367
|
+
| ($turn | map(refusal) | rindex(true)) as $r
|
|
368
|
+
| if $r == null then "none"
|
|
369
|
+
elif ($turn[$r + 1:] | map(working) | any) then "worked"
|
|
370
|
+
else "idle" end
|
|
371
|
+
' 2>/dev/null)"
|
|
372
|
+
|
|
373
|
+
if [ "$after_refusal" = "worked" ] || [ "$after_refusal" = "idle" ]; then
|
|
374
|
+
if [ -n "$tool" ]; then
|
|
375
|
+
question_text="$asked_text"
|
|
376
|
+
else
|
|
377
|
+
question_text="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r '
|
|
378
|
+
def is_input:
|
|
379
|
+
.type == "user"
|
|
380
|
+
and ((.isCompactSummary // false) | not)
|
|
381
|
+
and ((.isMeta // false) | not)
|
|
382
|
+
and (((.message.content // []) | if type == "array"
|
|
383
|
+
then ([.[] | select(.type == "tool_result")] | length)
|
|
384
|
+
else 0 end) == 0);
|
|
385
|
+
(map(is_input) | rindex(true)) as $i
|
|
386
|
+
| (if $i == null then . else .[$i + 1:] end)
|
|
387
|
+
| [.[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "text") | .text]
|
|
388
|
+
| join("\n")
|
|
389
|
+
' 2>/dev/null)"
|
|
390
|
+
fi
|
|
391
|
+
asks="no"
|
|
392
|
+
if [ -n "$tool" ]; then
|
|
393
|
+
asks="yes"
|
|
394
|
+
elif printf '%s\n' "$question_text" | grep -qE '\?[[:space:]]*$'; then
|
|
395
|
+
asks="yes"
|
|
396
|
+
fi
|
|
397
|
+
marked="no"
|
|
398
|
+
case "$question_text" in
|
|
399
|
+
*"$done_marker"*) marked="yes" ;;
|
|
400
|
+
esac
|
|
401
|
+
if [ "$asks" = "yes" ] && { [ "$marked" = "no" ] || [ "$after_refusal" = "idle" ]; }; then
|
|
402
|
+
reason="BLOCKED by grill-gate: a guard refused in this turn, and the question to the owner carries nothing done without the answer.
|
|
403
|
+
|
|
404
|
+
A refusal removes the step, not the task. Do the mechanical part of the blocker first — what the linter's fix mode repairs, what the refusal names as fixable — then ask only the decision that is left. The question leaves with the line «$done_marker …» naming the working commands of this turn after the last refusal: an edit of a file or a command that changes the tree. A read or a status command does not count."
|
|
405
|
+
|
|
406
|
+
# shellcheck disable=SC1090
|
|
407
|
+
[ -f "$rt_hooks_dir/deny-tail.sh" ] && . "$rt_hooks_dir/deny-tail.sh" 2>/dev/null
|
|
408
|
+
command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
|
|
409
|
+
deny_tail_text="$(rt_deny_tail "")"
|
|
410
|
+
[ -n "$deny_tail_text" ] && reason="${reason}
|
|
411
|
+
|
|
412
|
+
${deny_tail_text}"
|
|
413
|
+
|
|
414
|
+
if [ -n "$tool" ]; then
|
|
415
|
+
jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
|
|
416
|
+
|| printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"grill-gate: a question after a refusal carries what was done without the answer."}}\n'
|
|
417
|
+
else
|
|
418
|
+
jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
|
|
419
|
+
|| printf '{"decision":"block","reason":"grill-gate: a question after a refusal carries what was done without the answer."}\n'
|
|
420
|
+
fi
|
|
421
|
+
exit 0
|
|
422
|
+
fi
|
|
423
|
+
fi
|
|
424
|
+
fi
|
|
425
|
+
|
|
296
426
|
[ "$verdict" = "ask" ] || exit 0
|
|
297
427
|
|
|
298
428
|
if [ -n "$tool" ]; then
|
|
@@ -301,11 +431,21 @@ else
|
|
|
301
431
|
head="BLOCKED by grill-gate: the reply carries a question to the owner, and the laws and rules were not read in this turn."
|
|
302
432
|
fi
|
|
303
433
|
|
|
304
|
-
|
|
434
|
+
# The refusal names the action its own condition accepts. When the turn holds edits, only the rules
|
|
435
|
+
# of their area count, and the advice to search the directories sent the executor round in a
|
|
436
|
+
# circle: the search was made, the same refusal came back, and the executor stopped asking at all.
|
|
437
|
+
if [ -n "$need_re" ]; then
|
|
438
|
+
named="$(printf '%s' "$need_re" | tr '|' '\n' | sed 's/.*/«&»/' | paste -sd ',' - | sed 's/,/, /g')"
|
|
439
|
+
reason="$head A question whose answer is already written down is not asked of the owner — the rule of work conduct. The turn holds edits, and for them only the rules of their area count: $named. Load them by the tool Skill, or read them in $rules_dir, and answer from what is found; ask only what they do not cover.
|
|
440
|
+
|
|
441
|
+
A rule loaded before the owner's last message does not count: the guard judges one turn, and the next session is not refused."
|
|
442
|
+
else
|
|
443
|
+
reason="$head A question whose answer is already written down is not asked of the owner — the rule of work conduct. Run a search by the words of the subject and answer from what is found; ask only what the documents do not cover:
|
|
305
444
|
|
|
306
445
|
grep -rn -i \"<a word of the subject>\" $laws_dir $rules_dir $specs_dir $plans_dir $archive_dir
|
|
307
446
|
|
|
308
447
|
The guard judges one turn: the next session is not refused."
|
|
448
|
+
fi
|
|
309
449
|
|
|
310
450
|
# The shared deny tail: the two lawful moves and the lawful form of bypass, if the refusal has one.
|
|
311
451
|
# The file may not be laid out — then there is no tail, and the reason for the refusal stays as it
|
|
@@ -79,9 +79,12 @@ context_re='пропозал|слою правил|слоя правил|сло
|
|
|
79
79
|
#
|
|
80
80
|
# A 400-line tail: the transcript grows all session long, and only the last turn is judged.
|
|
81
81
|
verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg asked "$asked_re" --arg ctx "$context_re" '
|
|
82
|
+
# A report of a role and a loaded rule come in under the same role, marked `isMeta`: a role
|
|
83
|
+
# that called its findings «proposal» woke the guard as if the owner had asked for a sending.
|
|
82
84
|
def is_input:
|
|
83
85
|
.type == "user"
|
|
84
86
|
and ((.isCompactSummary // false) | not)
|
|
87
|
+
and ((.isMeta // false) | not)
|
|
85
88
|
and (((.message.content // []) | if type == "array"
|
|
86
89
|
then ([.[] | select(.type == "tool_result")] | length)
|
|
87
90
|
else 0 end) == 0);
|
|
@@ -53,7 +53,7 @@ rt_hook_read
|
|
|
53
53
|
rt_te_deny() {
|
|
54
54
|
# The end of an epic releases the turn whatever tier came here: the epic is read only on this road.
|
|
55
55
|
command -v rt_te_epic_over >/dev/null 2>&1 && rt_te_epic_over && exit 0
|
|
56
|
-
rt_te_reason="$1"
|
|
56
|
+
rt_te_reason="$(printf '%s\n\n%s' "$1" 'The owner said to stop — quote their word in the progress: `- **Waiting for the owner:** «<their words>»`. Where the task folder is gone, quote it in « » in the reply: the guard checks the quote against their message.')"
|
|
57
57
|
rt_te_short="$2"
|
|
58
58
|
# shellcheck disable=SC1090
|
|
59
59
|
[ -f "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/deny-tail.sh" ] \
|
|
@@ -443,12 +443,12 @@ fi
|
|
|
443
443
|
# sign is read without the network and stays silent where there is no reference at all — such
|
|
444
444
|
# branches are created for a trial too.
|
|
445
445
|
# Incident analysis — the record "2026-08-25-fifteen-branches-over-one-index" in the intake.
|
|
446
|
-
if [ "$worked" = "true" ] && [ "$handed_over" != "true" ]; then
|
|
446
|
+
if [ "$worked" = "true" ] && [ "$handed_over" != "true" ] && [ "${unpushed_named:-false}" != "true" ]; then
|
|
447
447
|
unpushed="$(git -C "$root" rev-list --count '@{u}..HEAD' 2>/dev/null)"
|
|
448
448
|
if [ -n "$unpushed" ] && [ "$unpushed" -gt 0 ] 2>/dev/null; then
|
|
449
449
|
reason="BLOCKED by turn-exit-guard: there was work in the turn, but it stayed in the working tree — commits not handed over: ${unpushed}.
|
|
450
450
|
|
|
451
|
-
The owner sees the former state and reads it as «nothing was done». Two moves from here: bring the work to the hosting — push the branch and open a request — or remove what was done if it is not needed. What is left in the tree is named with a reason — in the words of the owner, not as a list of leftovers.
|
|
451
|
+
The owner sees the former state and reads it as «nothing was done». Two moves from here: bring the work to the hosting — push the branch and open a request — or remove what was done if it is not needed. What is left in the tree is named with a reason — in the words of the owner, not as a list of leftovers: the line «Не отправлено: <reason>» in the reply releases this tier.
|
|
452
452
|
|
|
453
453
|
The guard judges one turn: the next session is not refused."
|
|
454
454
|
|
|
@@ -87,6 +87,23 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg work "$work_re
|
|
|
87
87
|
| ([$turn[] | select(.type == "assistant") | (.message.content // [])[]
|
|
88
88
|
| select(.type == "text") | (.text // "")] | last // "") as $last_say
|
|
89
89
|
| (($last_say | test("\\?[[:space:]]*$")) and $ask_denied) as $asked_in_prose
|
|
90
|
+
# The word of the owner about a stop said a turn earlier holds until a later message of theirs
|
|
91
|
+
# orders work. It is read from the whole session: read from this turn alone, it was lost, and
|
|
92
|
+
# the turn could leave only by a line in the progress of a folder already taken apart. Such a
|
|
93
|
+
# word releases the turn when the reply quotes it in « » and the quote stands in that message.
|
|
94
|
+
| ([.[] | select(is_input) | .message.content
|
|
95
|
+
| if type == "string" then . elif type == "array"
|
|
96
|
+
then (map(if type == "object" then (.text // "") else "" end) | join("\n")) else "" end]) as $owner_said
|
|
97
|
+
| ($owner_said | map(test("останов|стоп|хватит|подожди|не надо|прерв|отложи|не двигайся|не продолжай|прекрати") and (test($standing) | not)) | rindex(true)) as $stop_at
|
|
98
|
+
| (if $stop_at == null then null
|
|
99
|
+
elif ($owner_said[$stop_at + 1:] | map(test("продолжай|работай|делай|бери|давай|вперёд|можно")) | any) then null
|
|
100
|
+
else $owner_said[$stop_at] end) as $stop_word
|
|
101
|
+
| ([$last_say | match("«([^»]+)»"; "g") | .captures[0].string]) as $quotes
|
|
102
|
+
| ($stop_word != null and ($quotes | map(. as $q | $stop_word | contains($q)) | any)) as $quoted_stop
|
|
103
|
+
| ($told_stop or $quoted_stop) as $told_stop
|
|
104
|
+
# What is left in the tree is named with a reason, and the line «Не отправлено: <reason>» in
|
|
105
|
+
# the reply is that naming: without it the only lawful move was a push made to lift the refusal.
|
|
106
|
+
| ($last_say | test("Не отправлено:[[:space:]]*[^[:space:]]")) as $unpushed_named
|
|
90
107
|
# Waiting for the word of the owner, announced by the executor. That word is read from
|
|
91
108
|
# the owner: without his word in the turn and without a question to him through the tool, the
|
|
92
109
|
# phrase "waiting for your word" is a stop announced by the one it suits. The set of patterns is
|
|
@@ -110,6 +127,6 @@ verdict="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r --arg work "$work_re
|
|
|
110
127
|
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))
|
|
111
128
|
) | any) as $after_progress
|
|
112
129
|
| (($last_name == "Bash") and ($last | test($started)) and ($handed_over | not)) as $only_took
|
|
113
|
-
| { 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 }
|
|
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 }
|
|
114
131
|
' 2>/dev/null)"
|
|
115
132
|
}
|
|
@@ -177,4 +177,8 @@ Docs-skip: правка только в тестах хука, зеркала у
|
|
|
177
177
|
off whole at the first miss. The next `git commit --amend` then carries into the commit
|
|
178
178
|
everything left in the index. The commit contents are read by `git show --stat` right after it,
|
|
179
179
|
not at PR review.
|
|
180
|
+
- Two commits chained in one call: a commit refused by the message check leaves its files in the
|
|
181
|
+
index, and the next `git commit` takes them under its own subject. One commit is one call, and
|
|
182
|
+
its outcome is read before the next; a swallowed one is split by `git reset --soft HEAD~1` and two
|
|
183
|
+
commits anew.
|
|
180
184
|
- The owner's edit takes neither the token nor the variables — they are only for machine work.
|
|
@@ -74,6 +74,12 @@ body itself and prints the branch line from the branch of the epic; work outside
|
|
|
74
74
|
card is created. The epic itself is created by the same command with `--epic`. Author and assignee — the machine account; the command reads the token itself, from
|
|
75
75
|
a file outside the repository.
|
|
76
76
|
|
|
77
|
+
A task created under an epic that has closed since is taken outside the epic, not by reviving
|
|
78
|
+
the epic branch. The delivery guard reads the epic from the line in the task body, and for a closed
|
|
79
|
+
epic it demands a branch in the remote that nobody will send again. The line about the epic is
|
|
80
|
+
replaced in the body by `Работа вне эпика — <слово владельца>`, the shape `--outside-epic` writes,
|
|
81
|
+
and only then is the branch created.
|
|
82
|
+
|
|
77
83
|
The script under this command is created by the project — the package does not ship it. What it
|
|
78
84
|
does by `gh` calls:
|
|
79
85
|
|
|
@@ -269,4 +275,13 @@ Docs-skip: правка только в тестах хука, зеркала у
|
|
|
269
275
|
- `gh api graphql --paginate` on a query of board items goes into repeating the first page: the
|
|
270
276
|
cursor is taken from the answer by hand, and completeness is checked against
|
|
271
277
|
`items(first: 1) { totalCount }`.
|
|
278
|
+
- Two commits chained in one call: a commit refused by the message check leaves its files in the
|
|
279
|
+
index, and the next `git commit` takes them under its own subject. One commit is one call, and
|
|
280
|
+
its outcome is read before the next; a swallowed one is split by `git reset --soft HEAD~1` and two
|
|
281
|
+
commits anew.
|
|
282
|
+
- The push set listed by hand without the package defaults: the tree profile extends the package
|
|
283
|
+
one through the default function, and sourced alone it calls an undefined function. The error
|
|
284
|
+
goes to a stream nobody reads, and the list loses lint, unit tests, the build and the spec audit
|
|
285
|
+
with a zero exit. The defaults are sourced first, and the line count is compared with the last
|
|
286
|
+
push before the run.
|
|
272
287
|
- The owner's edit takes neither the token nor the variables — they are only for machine work.
|
|
@@ -183,4 +183,8 @@ Docs-skip: правка только в тестах хука, зеркала у
|
|
|
183
183
|
off whole at the first miss. The next `git commit --amend` then carries into the commit
|
|
184
184
|
everything left in the index. The commit contents are read by `git show --stat` right after it,
|
|
185
185
|
not at MR review.
|
|
186
|
+
- Two commits chained in one call: a commit refused by the message check leaves its files in the
|
|
187
|
+
index, and the next `git commit` takes them under its own subject. One commit is one call, and
|
|
188
|
+
its outcome is read before the next; a swallowed one is split by `git reset --soft HEAD~1` and two
|
|
189
|
+
commits anew.
|
|
186
190
|
- The owner's edit takes neither the token nor the variables — they are only for machine work.
|
|
@@ -159,3 +159,7 @@ the title. The sample is held by whoever writes the body — like the words said
|
|
|
159
159
|
- A `Closes` line in a PR whose base is not the main branch, in a tree without a closing pipeline:
|
|
160
160
|
the task looks attached and stays open after the merge. The body names the task in words, and
|
|
161
161
|
the cleanup step closes it by hand.
|
|
162
|
+
- Labels read with `join(",")` and split by a shell expansion: zsh does not split an unquoted
|
|
163
|
+
`${L//,/ }` into words, the REST call gets the whole line as one label, and the host creates a
|
|
164
|
+
label with that name. Each label goes as its own `-f 'labels[]=…'`, or is read one per line with
|
|
165
|
+
`--jq '.labels[].name'`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: queue-audit-read
|
|
3
|
+
kind: pattern
|
|
4
|
+
rule: queue-audit
|
|
5
|
+
description: Pattern of rule queue-audit. Load when the work queue audit has printed lines — running it, and the move that answers each kind of line.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Reading the work queue audit
|
|
9
|
+
|
|
10
|
+
Pattern of the rule `queue-audit`. What must be true — the law `docs/constitution/delivery.md`.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- The audit printed lines before a push, on taking a task or after a known merge.
|
|
15
|
+
- A line names a PR or a task, and the move for it is not obvious from the line.
|
|
16
|
+
|
|
17
|
+
## Running it
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm run check:board
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Exit code 0 and no lines — the queue matches. Exit code 1 — every line is a discrepancy, and each
|
|
24
|
+
names its own move. The summary lines at the end are not discrepancies: they count what was read
|
|
25
|
+
and what was filtered out.
|
|
26
|
+
|
|
27
|
+
## What answers which line
|
|
28
|
+
|
|
29
|
+
| The line says | The move |
|
|
30
|
+
| ---------------------------------------------------- | ------------------------------------------------------------- |
|
|
31
|
+
| a PR is open and its task is not in review | `npm run task:move -- <номер> in-review` |
|
|
32
|
+
| a task is in review and has no open PR | open the PR, or move the task back to work |
|
|
33
|
+
| the branch lags behind its base by N commits | merge the base into the branch and push |
|
|
34
|
+
| the PR conflicts with the main branch | merge the main branch in, resolve, push |
|
|
35
|
+
| no run on the tip | a new commit, or close and reopen the PR as the line says |
|
|
36
|
+
| a run pushed out of the queue | read that run's output, then rerun it — both commands are in the line |
|
|
37
|
+
| a draft with a green run | `gh pr ready <номер>` |
|
|
38
|
+
| the PR has no reviewer | request the reviewer by a REST call |
|
|
39
|
+
| the last run of the main branch is red | fix the main branch before new work |
|
|
40
|
+
| a task and its epic name each other one way only | link the task as a sub-issue, or name it in the epic plan |
|
|
41
|
+
|
|
42
|
+
## Common misses
|
|
43
|
+
|
|
44
|
+
- **A rerun instead of the move.** The second run prints the same line: a line is answered by its
|
|
45
|
+
move.
|
|
46
|
+
- **A summary line read as a discrepancy.** The count of PRs with a base other than the main branch
|
|
47
|
+
is not a discrepancy: it names what the host does not do for them.
|
|
@@ -122,8 +122,10 @@ description: Pattern of rule git-workflow. Load for … Not for … — that is
|
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
Sections: `## When to use` · ready-made code · `## Common misses`. A pattern has no binding:
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
there is nothing to check ready-made code against but itself. Its set of sections is checked all
|
|
126
|
+
the same — the suite of the package that ships the texts refuses a pattern without `## When to
|
|
127
|
+
use` and without the section of misses. A consumer tree does not see that refusal; the tree with
|
|
128
|
+
the package sources sees it in the set before a push.
|
|
127
129
|
|
|
128
130
|
## How the article itself is written
|
|
129
131
|
|
|
@@ -246,6 +248,10 @@ reference — it changes how a story is written.
|
|
|
246
248
|
unbound, and the spec audit is silent about it, because it looks for the line in the table.
|
|
247
249
|
The line's place is the same as its statement's in the rule: the order of both sides is kept
|
|
248
250
|
the same, otherwise the statement and its binding stop being found by one another.
|
|
251
|
+
- A binding line came out as one sentence of sixty words. The statement ends at its full stop
|
|
252
|
+
inside the bold, and everything after it — the dash, the anchor, the dash and the explanation —
|
|
253
|
+
is one more sentence to the wording check. The explanation after the anchor is written in
|
|
254
|
+
sentences of its own: the line stays one, the long sentence goes.
|
|
249
255
|
- The `description` does not say when **not** to load the pattern — the neighbouring pattern of
|
|
250
256
|
the same rule becomes indistinguishable.
|
|
251
257
|
- A block of ready-made code was accepted by its look, not by checking against the declaration.
|
|
@@ -117,7 +117,9 @@ the progress and into the PR body. The law file is edited after the answer. The
|
|
|
117
117
|
application laws: payments, locales and access are the same agreement, only about this application.
|
|
118
118
|
|
|
119
119
|
What was done at this step is written into the PR body: what was re-read, what was changed, and if
|
|
120
|
-
nothing was changed — why. The form of the section — pattern `git-workflow-pr-body`.
|
|
120
|
+
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.
|
|
121
123
|
|
|
122
124
|
**Next move:** the updated texts are committed, and in the same turn the task folder is taken apart
|
|
123
125
|
— by the last commit of the branch, pattern `task-flow-archive`.
|
|
@@ -175,19 +177,19 @@ second form: nothing is left to wait for, and the check standing behind it is th
|
|
|
175
177
|
```
|
|
176
178
|
|
|
177
179
|
The section heading and the words of both samples are written in the language of the PR, not the
|
|
178
|
-
language of the pattern. The
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
language of the pattern. The heading is named by the tree in its profile, `RT_PULL_BODY_SECTION`,
|
|
181
|
+
and is taken from there, not from the samples above. What is carried over whole is the order of
|
|
182
|
+
thoughts, not the words. The same holds for the messages to the owner below: they are samples of
|
|
183
|
+
**what** is said, not of which words.
|
|
182
184
|
|
|
183
185
|
The section is neither left empty nor removed altogether: a missing section and "no steps left" read
|
|
184
186
|
the same and mean different things. The full sample of a PR body — in the pattern for creating a
|
|
185
187
|
commit and a PR, if the tree laid it out.
|
|
186
188
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
Where the tree laid out the delivery guard, it reads the body straight from the opening command —
|
|
190
|
+
passed as an argument or as a file — and refuses the call together with everything else that does
|
|
191
|
+
not match. It judges the section by the heading the profile names; unnamed, the section is not
|
|
192
|
+
judged at all. Without the guard the section is held only by whoever writes the body.
|
|
191
193
|
The work queue audit still does not read the body: the miss is caught at the minute of opening, that
|
|
192
194
|
is, where one call still fixes it.
|
|
193
195
|
|
|
@@ -39,25 +39,22 @@ 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: the
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
and only then come the questions about techniques. The answer to "how is this done here" gives one
|
|
59
|
-
folder, and generalised into a map of the tree it lies: the neighbouring family of directories is
|
|
60
|
-
left out, and the owner finds the loss.
|
|
42
|
+
Exploration that found nothing is no permission to ask: the epic plan, the archive and past sessions
|
|
43
|
+
are reached first, and the question names where the search went.
|
|
44
|
+
|
|
45
|
+
Exploration ends with command output, not with a feeling: the root memo, `ls` of the directory at
|
|
46
|
+
hand, a search over the documentation and the rules.
|
|
47
|
+
|
|
48
|
+
A member added beside a list, not into it, is named at every reader of that list: each place that
|
|
49
|
+
walks the list knows only its members. The readers are found by a search of the list's symbol and go
|
|
50
|
+
into the agreement as places to touch; one the search did not return is found after the code.
|
|
51
|
+
|
|
52
|
+
Exploration over a created task ends with a reproduced symptom, not a found file: the body describes
|
|
53
|
+
the tree on the day of creation. Before the first edit the exploration repeats what the task
|
|
54
|
+
complains about; a symptom that did not reproduce closes the task as lapsed, and that is lawful.
|
|
55
|
+
|
|
56
|
+
A tree named as a sample is read as a layout whole — walking the directories two levels deep —
|
|
57
|
+
before questions about techniques: one folder generalised into a map leaves out its neighbours.
|
|
61
58
|
|
|
62
59
|
What was inferred is marked right in the list, together with what confirms it.
|
|
63
60
|
|
|
@@ -65,9 +62,8 @@ What was inferred is marked right in the list, together with what confirms it.
|
|
|
65
62
|
in the trees recorded as samples of its layout. The one found is read whole: it closes the questions
|
|
66
63
|
about the structure — the source of the numbers, the rows, the screen, the storage.
|
|
67
64
|
|
|
68
|
-
The six questions are asked minus those the exploration answered
|
|
69
|
-
|
|
70
|
-
whether the answer is in the tree; "the task seems clear" is no sign in either direction.
|
|
65
|
+
The six questions are asked minus those the exploration answered; the grill gets the line "taking
|
|
66
|
+
such-and-such answer, here is where from". The sign is whether the answer is in the tree.
|
|
71
67
|
|
|
72
68
|
**Next move:** the findings land in the grill, and in the same turn the first of the six questions
|
|
73
69
|
goes to the owner. The exploration ended — the state stayed the same, so did the turn.
|
|
@@ -285,6 +281,9 @@ Work that does not touch `apps/**` and `libs/**` needs no agreement:
|
|
|
285
281
|
|
|
286
282
|
An empty reason is not accepted.
|
|
287
283
|
|
|
284
|
+
The Specs line of the footprint is filled by the command that names the spec of a resource, run on
|
|
285
|
+
the files of the Code line, not from memory.
|
|
286
|
+
|
|
288
287
|
**Next move:** under the header the task footprint and the stages are written, the plan is
|
|
289
288
|
committed, and in the same turn the first stage begins.
|
|
290
289
|
|
|
@@ -92,6 +92,14 @@ The rule is `doc-style`; the articles that hold the law stand there.
|
|
|
92
92
|
shows it, usually later, by the headings of the assembled text. Text is edited with the edit
|
|
93
93
|
tool; and if a replacement is called anyway, the place it promised to change is reread right
|
|
94
94
|
after.
|
|
95
|
+
- **A one-liner in the shell is one sentence to the wording check.** The check takes the command
|
|
96
|
+
body whole: the pattern, the replacement and the path stand on one line with no full stop
|
|
97
|
+
between them. Three one-line replacements in a document were refused as sentences of 44, 46
|
|
98
|
+
and 88 words, while the text they wrote was short.
|
|
99
|
+
- **A stream-editor rollback without a line number reaches lines nobody meant.** A test made red
|
|
100
|
+
on purpose was rolled back by a replacement by pattern, the pattern matched neighbouring checks
|
|
101
|
+
too, and they were committed without a run. A rollback goes by the edit tool or by the line
|
|
102
|
+
number, then `git diff` shows what it touched, and any edit of a test is followed by a new run.
|
|
95
103
|
- **A number obtained from a command is not yet a measurement.** The requirement to recompute a
|
|
96
104
|
number by a command is met literally — there was a command — and nobody asks whether it
|
|
97
105
|
measured the number's subject. Output is false in different ways and silently: `grep -E` with
|
|
@@ -132,6 +132,20 @@ The rule is `turn-conduct`; the articles that hold the law stand there.
|
|
|
132
132
|
a wait. Now the last tool of the turn is judged: the agent tool or a command sent to the
|
|
133
133
|
background standing last gives the turn back, and work after the launch releases it.
|
|
134
134
|
|
|
135
|
+
- **"A promise to do the work in the next turn": an offer to object is part of it.** An offer to the
|
|
136
|
+
owner to object to the announced intent is not a question: a turn ends with a question when the
|
|
137
|
+
work does not go without the answer, and here it went.
|
|
138
|
+
- **"A plan stage is declared closed only after its check command": why from memory is not enough.**
|
|
139
|
+
A session later, a stage marked from memory cannot be told from one checked.
|
|
140
|
+
- **"A statement about the tree's state": why the previous turn does not count.** Yesterday's output
|
|
141
|
+
says nothing of today's tree.
|
|
142
|
+
- **"The actions the executor does not do without the owner's word": how an unnamed list leaks.**
|
|
143
|
+
"Do what the plan needs" became permission to push and edit shared documents along with the
|
|
144
|
+
commit.
|
|
145
|
+
- **"The sign of irreversibility is taken from the list": why an argument on top cancels it.** The
|
|
146
|
+
argument "it goes outside and cannot be rolled back" always comes, the list only when read; from
|
|
147
|
+
outside it looks like caution, not a skipped step.
|
|
148
|
+
|
|
135
149
|
## A single read of the run state taken for watching it
|
|
136
150
|
|
|
137
151
|
22 September 2026. An epic was handed over whole: nine tasks merged, the request of the epic opened
|
|
@@ -86,6 +86,10 @@ environment either — that is `Q-FA-1` in the law.
|
|
|
86
86
|
catalogue.
|
|
87
87
|
- **`qa-dataid` does not replace `aria-label` and roles:** accessibility separately, the anchor
|
|
88
88
|
separately. And it is not removed when the layout is edited — the specs hang on it.
|
|
89
|
+
- **Markup is edited by the edit tool, not by a script.** The anchor guard judges a shell command
|
|
90
|
+
by its whole body: the old markup in a find-and-replace pair counts as written, and an edit that
|
|
91
|
+
adds every anchor is refused for the lines it removes. The article in full is in the rule
|
|
92
|
+
`doc-style`.
|
|
89
93
|
- What the kit has ready is not written anew: own markup with `role="alert"`, `<table>`,
|
|
90
94
|
`role="dialog"`, `role="tablist"` or `role="tooltip"` means that `<prefix>-message`,
|
|
91
95
|
`<prefix>-table`, `<prefix>-dialog`, `<prefix>-tabs` or `<prefix>-tooltip` were bypassed. The rule
|
|
@@ -118,14 +118,25 @@ flowchart TD
|
|
|
118
118
|
`Docs-skip: <reason>` in the commit body; an empty reason is not accepted.
|
|
119
119
|
<!-- rt-when: *.md -->
|
|
120
120
|
|
|
121
|
+
- **A file of the tree is edited by the edit tool, not by a shell command.** A guard judges a
|
|
122
|
+
shell command by its whole body as new text: the pattern being replaced, the old markup, a loop
|
|
123
|
+
and the headers next to a heredoc. A one-liner is then one sentence of fifty words, and the
|
|
124
|
+
guard refuses the edit for lines it does not add. A post-edit hook does not see such a write at
|
|
125
|
+
all, and a replacement whose pattern matched nothing exits zero with the file untouched. A
|
|
126
|
+
command that must write a document gets it as a file written by the edit tool beforehand.
|
|
127
|
+
|
|
121
128
|
- **A document is no longer than the length limit.** A text that does not fit on one screen gets
|
|
122
129
|
appended to without rereading the beginning — that is how one document ends up with two answers
|
|
123
130
|
to one question. Text has its own limit, lower than code, counted the same way — all lines; a
|
|
124
131
|
spec that has outgrown it is split into subdomains, the boundary is not moved. Two numbers
|
|
125
132
|
instead of one exist because text needs its threshold earlier: code length is also watched by
|
|
126
|
-
the linter, prose only by this number. The
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
the linter, prose only by this number. The prose of the rules layer has a third number, in
|
|
134
|
+
characters: compressing an article removes characters and leaves the line count, and a split
|
|
135
|
+
that only brings the lines under the limit leaves the characters where they were. The numbers
|
|
136
|
+
stand in the checks settings, not in the text; a rule at the ceiling takes a new article only
|
|
137
|
+
by folding an argument next to it, or by a split. The description of the past is excluded
|
|
138
|
+
from the count: by design the archive lists what the tree no longer has, and the task folder
|
|
139
|
+
dies with the merge.
|
|
129
140
|
<!-- rt-when: *.md -->
|
|
130
141
|
|
|
131
142
|
- **A file leaving for the description of the past names its former address in its header.**
|
|
@@ -245,6 +256,12 @@ freshness of a number in the text. The last two the law leaves with the author e
|
|
|
245
256
|
open question is written in the same words as a promise, and a date and an id are numbers like
|
|
246
257
|
the ones that get recomputed.
|
|
247
258
|
|
|
259
|
+
The two columns of the glossary are judged at different minutes. The wording check carries a part
|
|
260
|
+
of the left column and the tree's own bans, and it fires on the edit. The whole section of words
|
|
261
|
+
not written here is read by the glossary check, and that one stands only in the set before a
|
|
262
|
+
push — a word it refuses already lies in a commit by then. A commit body is read by neither: it
|
|
263
|
+
is held by the article about the addressee, the same as a PR description.
|
|
264
|
+
|
|
248
265
|
No check reads the reply to the owner, and the misses in it are the same as in tree text: an
|
|
249
266
|
invented fact served alongside a verified one, and an appraisal of someone else's decision
|
|
250
267
|
instead of carrying it out. Only the owner catches them — that is, having already read. The rule
|
|
@@ -89,6 +89,10 @@ flowchart TD
|
|
|
89
89
|
- **A branch without a work item number gets no delivery conditions.** A local trial branch is
|
|
90
90
|
legitimate, and demanding a fresh base of it would refuse work that will not go to main: no PR
|
|
91
91
|
opens from such a branch.
|
|
92
|
+
- **A commit lands with its final content, and a later commit of the same branch does not correct
|
|
93
|
+
it.** It is made after the check against the mockup, the sample and the measurement; what is not
|
|
94
|
+
checked stays in the working tree. A third commit fixing the first shows the reviewer the miss
|
|
95
|
+
instead of the work, and rewriting history hides the trace, not the cause.
|
|
92
96
|
- **A code edit is handed to a person by an open PR, not by a pushed branch.** A branch is not shown
|
|
93
97
|
to them in the branch list, reaches no to-do list of theirs and has no discussion: before the PR
|
|
94
98
|
opens there is no edit for a person. It opens in the turn in which the executor says the work is
|