@rt-tools/agent-kit 0.29.4 → 0.30.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.
- package/assets/checks/board-epics.github.mjs +17 -2
- package/assets/checks/board-folders.mjs +40 -1
- package/assets/checks/board-runs.github.mjs +7 -2
- package/assets/checks/board.github.mjs +23 -3
- 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/checks/task-new-queue.github.mjs +51 -0
- package/assets/checks/task-new.github.mjs +4 -41
- 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 +31 -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 +144 -4
- 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/hooks/write-targets.sh +69 -3
- package/assets/patterns/admin-nav-item.md +2 -1
- package/assets/patterns/browser-verification-stand.md +3 -0
- package/assets/patterns/doc-style-human.md +21 -0
- 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-docker.md +4 -2
- package/assets/patterns/git-workflow-merge.md +6 -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-domain.md +12 -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/patterns/testing-e2e.md +16 -2
- package/assets/patterns/testing-unit.md +4 -0
- package/assets/pitfalls/doc-style.md +8 -0
- package/assets/pitfalls/styling-bem.md +11 -0
- package/assets/pitfalls/turn-conduct.md +14 -0
- package/assets/rules/browser-verification.md +7 -5
- package/assets/rules/component-structure.md +8 -0
- package/assets/rules/deploy-flow.github.md +28 -2
- package/assets/rules/doc-style.md +20 -3
- package/assets/rules/git-workflow.azure.md +4 -0
- package/assets/rules/git-workflow.github.md +8 -25
- package/assets/rules/git-workflow.gitlab.md +4 -0
- package/assets/rules/lib-layers.md +2 -2
- package/assets/rules/queue-audit.github.md +77 -0
- package/assets/rules/reuse-first.md +7 -0
- package/assets/rules/shared-code.md +3 -0
- package/assets/rules/spec-driven.md +3 -1
- package/assets/rules/status-report.md +6 -0
- package/assets/rules/task-flow.md +18 -21
- package/assets/rules/testing.md +7 -1
- package/assets/rules/turn-conduct.md +27 -26
- 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/proposals.d.ts.map +1 -1
- package/lib/proposals.js +9 -1
- package/lib/proposals.js.map +1 -1
- package/lib/ship.d.ts +9 -0
- package/lib/ship.d.ts.map +1 -1
- package/lib/ship.js +16 -0
- package/lib/ship.js.map +1 -1
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.js +30 -29
- package/lib/shipment.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.29.4.tgz +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
|
|
3
|
+
# rt-hook-timeout: 1800
|
|
3
4
|
# Requires: hooks/profile-check.sh, hooks/deny-tail.sh
|
|
4
5
|
# The guard of the checks before a push. PreToolUse on the push call.
|
|
5
6
|
#
|
|
@@ -51,7 +52,8 @@ cmd="$(rt_hook_cmd)"
|
|
|
51
52
|
# request header are put between them by `-c` keys, and that is exactly the form pushed with here.
|
|
52
53
|
# While the sign was a substring, the whole gate set was not run at all on such a push, and the
|
|
53
54
|
# silence of the guard read as "green".
|
|
54
|
-
|
|
55
|
+
# A loop body starts after `do`, `then` or `else`: a push there is a push too.
|
|
56
|
+
printf '%s' "$cmd" | grep -qE "${RT_CMD_BOUND}git([[:space:]]|\$)|(^|[;&|[:space:]])(do|then|else)[[:space:]]+git[[:space:]]" || exit 0
|
|
55
57
|
|
|
56
58
|
# A stashed edit is never a push: `git stash push` puts the edit into the stash of this same
|
|
57
59
|
# machine and sends nothing outside. The word `push` in it stands separate, and without this line
|
|
@@ -100,6 +102,13 @@ if printf '%s' "$cmd" | grep -qE "${RT_CMD_BOUND}git[[:space:]]+(checkout|switch
|
|
|
100
102
|
push_deny "BLOCKED: switching the branch and pushing by one command. The gate set runs on the tree that lies there at the minute the command is parsed — that is, on the FORMER branch, not the one that leaves for the hosting. A green set then reads as a check of what left, though it checked something else. Split the calls: switch first, then push by a separate command."
|
|
101
103
|
fi
|
|
102
104
|
|
|
105
|
+
# Several pushes in one command, or a push inside a loop, are refused whole. The set runs once
|
|
106
|
+
# per call on the tree that lies there, and every other branch leaves unchecked.
|
|
107
|
+
pushes="$(printf '%s' "$probe" | grep -oE "${RT_CMD_BOUND}git([[:space:]]+-c[[:space:]]+[^[:space:]]+)*[[:space:]]+push([[:space:]]|\$)" | wc -l | tr -d ' ')"
|
|
108
|
+
if [ "${pushes:-0}" -gt 1 ] || printf '%s' "$probe" | grep -qE '(^|[;&|[:space:]])(do|then|else)[[:space:]]+git[[:space:]].*push'; then
|
|
109
|
+
push_deny "BLOCKED: several pushes by one command. The gate set runs once per call, on the tree that lies there — every other branch leaves for the hosting unchecked. Push each branch by a separate call, after switching to it."
|
|
110
|
+
fi
|
|
111
|
+
|
|
103
112
|
workdir="$(rt_hook_cwd)"
|
|
104
113
|
[ -z "$workdir" ] && workdir="${CLAUDE_PROJECT_DIR:-.}"
|
|
105
114
|
cd "$workdir" 2>/dev/null || exit 0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The fifth sign of the conversation guard: a question that offers to walk around a check does not
|
|
3
|
+
# leave. NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The
|
|
4
|
+
# conversation guard sources it — it was moved out when the guard crossed the file length limit.
|
|
5
|
+
#
|
|
6
|
+
# A red set was explained by a "foreign" cause, and the owner was asked whether to send it past the
|
|
7
|
+
# check. Such a question is a miss by itself, even when the owner answers "yes": a check is fixed at
|
|
8
|
+
# its cause or fixed itself, and a third option is not named. The sign reads the text the owner
|
|
9
|
+
# reads — the menu with its options, or the last reply when it ends with a question — and looks for
|
|
10
|
+
# the forms of a bypass: past the check, a bypass line, a disabled rule, a hook switched off.
|
|
11
|
+
#
|
|
12
|
+
# It expects `$tool`, `$asked_text`, `$transcript` and `$rt_hooks_dir` to be set; it prints the
|
|
13
|
+
# refusal and returns zero when the question offers a bypass, and stays silent otherwise.
|
|
14
|
+
#
|
|
15
|
+
# FAIL-OPEN: no text of a question — the sign stays silent.
|
|
16
|
+
|
|
17
|
+
rt_grill_bypass() {
|
|
18
|
+
local bypass_re offered_text reason deny_tail_text
|
|
19
|
+
bypass_re='мимо (проверк|гейт|хук)|в обход (проверк|гейт|хук)|обойти (проверк|гейт|хук)|bypass|--no-verify|Epic-stop-skip|Docs-skip|Task-folder-skip|# discard:|eslint-disable|stylelint-disable|отключ[а-я]* (проверк|правил|линтер|хук)|в список известных|allowlist'
|
|
20
|
+
if [ -n "$tool" ]; then
|
|
21
|
+
offered_text="$asked_text"
|
|
22
|
+
else
|
|
23
|
+
offered_text="$(tail -n 400 "$transcript" 2>/dev/null | jq -s -r '
|
|
24
|
+
def is_input:
|
|
25
|
+
.type == "user"
|
|
26
|
+
and ((.isCompactSummary // false) | not)
|
|
27
|
+
and ((.isMeta // false) | not)
|
|
28
|
+
and (((.message.content // []) | if type == "array"
|
|
29
|
+
then ([.[] | select(.type == "tool_result")] | length)
|
|
30
|
+
else 0 end) == 0);
|
|
31
|
+
(map(is_input) | rindex(true)) as $i
|
|
32
|
+
| (if $i == null then . else .[$i + 1:] end)
|
|
33
|
+
| [.[] | select(.type == "assistant") | (.message.content // [])[] | select(.type == "text") | .text]
|
|
34
|
+
| last // ""
|
|
35
|
+
| if test("\\?[[:space:]]*$") then . else "" end
|
|
36
|
+
' 2>/dev/null)"
|
|
37
|
+
fi
|
|
38
|
+
[ -n "$offered_text" ] || return 1
|
|
39
|
+
printf '%s' "$offered_text" | grep -qiE "$bypass_re" 2>/dev/null || return 1
|
|
40
|
+
|
|
41
|
+
reason="BLOCKED by grill-gate: the question offers the owner to walk around a check.
|
|
42
|
+
|
|
43
|
+
A question about a bypass is a miss by itself, even when the owner answers «yes». A red check is fixed at its cause — on the machine and in the tree — or the check itself is fixed when it is wrong. A third option is not named, and handing the owner a command to run by hand instead is the same bypass. Ask only the decision the fix needs."
|
|
44
|
+
|
|
45
|
+
# shellcheck disable=SC1090
|
|
46
|
+
[ -f "$rt_hooks_dir/deny-tail.sh" ] && . "$rt_hooks_dir/deny-tail.sh" 2>/dev/null
|
|
47
|
+
command -v rt_deny_tail >/dev/null 2>&1 || rt_deny_tail() { :; }
|
|
48
|
+
deny_tail_text="$(rt_deny_tail "")"
|
|
49
|
+
[ -n "$deny_tail_text" ] && reason="${reason}
|
|
50
|
+
|
|
51
|
+
${deny_tail_text}"
|
|
52
|
+
|
|
53
|
+
if [ -n "$tool" ]; then
|
|
54
|
+
jq -n --arg r "$reason" '{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$r}}' 2>/dev/null \
|
|
55
|
+
|| printf '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"grill-gate: a question does not offer a bypass of a check."}}\n'
|
|
56
|
+
else
|
|
57
|
+
jq -n --arg r "$reason" '{decision:"block",reason:$r}' 2>/dev/null \
|
|
58
|
+
|| printf '{"decision":"block","reason":"grill-gate: a question does not offer a bypass of a check."}\n'
|
|
59
|
+
fi
|
|
60
|
+
return 0
|
|
61
|
+
}
|
|
@@ -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
|
|
@@ -262,7 +275,7 @@ if [ -n "$tool" ]; then
|
|
|
262
275
|
| select(type == "array") | .[] | select(.type == "tool_result") | .content
|
|
263
276
|
| if type == "string" then . elif type == "array"
|
|
264
277
|
then (map(if type == "object" then (.text // "") else "" end) | join("\n")) else "" end
|
|
265
|
-
| select(test("^The user answered:"))];
|
|
278
|
+
| select(test("^(The user answered|Your questions have been answered):"))];
|
|
266
279
|
def recommended: ([match("\"=\"[^\"]*\""; "g")] | length) as $all
|
|
267
280
|
| ([match("\\((Recommended|Рекомендую|Рекомендован[^)]*)\\)\"(,|\\.|[[:space:]]|$)"; "g")] | length) as $marked
|
|
268
281
|
| $all > 0 and $all == $marked;
|
|
@@ -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. A search over the specs or over other rules does not lift this refusal. The area counts every edit since the owner's last message, the stretch before a context compaction included. 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
|
}
|
|
@@ -104,7 +104,7 @@ rt_write_targets() {
|
|
|
104
104
|
# data.
|
|
105
105
|
function emit_calls(s, rest, arg, name) {
|
|
106
106
|
rest = s
|
|
107
|
-
while (match(rest, /(open|writeFileSync|writeFile|appendFileSync|appendFile|
|
|
107
|
+
while (match(rest, /(open|writeFileSync|writeFile|appendFileSync|appendFile|copyfile|copy2|rename|symlink|mkdir|makedirs)[ \t]*\(/)) {
|
|
108
108
|
rest = substr(rest, RSTART + RLENGTH)
|
|
109
109
|
arg = rest
|
|
110
110
|
sub(/[,)].*$/, "", arg)
|
|
@@ -132,6 +132,72 @@ rt_write_targets() {
|
|
|
132
132
|
|| s ~ /(^|[|;&(]|[ \t])(tee|cp|mv|rm|touch|install|truncate)([ \t]|$)/
|
|
133
133
|
}
|
|
134
134
|
function trim(s) { sub(/^[ \t]+/, "", s); sub(/[ \t]+$/, "", s); return s }
|
|
135
|
+
# The index of the bracket that closes the call whose arguments start at `from`: the
|
|
136
|
+
# quotes are skipped, and a bracket inside a string closes nothing.
|
|
137
|
+
function args_end(s, from, i, c, depth, q) {
|
|
138
|
+
depth = 1
|
|
139
|
+
for (i = from; i <= length(s); i++) {
|
|
140
|
+
c = substr(s, i, 1)
|
|
141
|
+
if (q != "") {
|
|
142
|
+
if (c == q && substr(s, i - 1, 1) != "\\") { q = "" }
|
|
143
|
+
} else if (c == "\047" || c == "\"") {
|
|
144
|
+
q = c
|
|
145
|
+
} else if (c == "(") {
|
|
146
|
+
depth++
|
|
147
|
+
} else if (c == ")") {
|
|
148
|
+
depth--
|
|
149
|
+
if (depth == 0) { return i }
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return length(s) + 1
|
|
153
|
+
}
|
|
154
|
+
# The first argument of a call: everything up to a comma outside quotes and brackets.
|
|
155
|
+
function first_arg(a, i, c, depth, q) {
|
|
156
|
+
for (i = 1; i <= length(a); i++) {
|
|
157
|
+
c = substr(a, i, 1)
|
|
158
|
+
if (q != "") {
|
|
159
|
+
if (c == q && substr(a, i - 1, 1) != "\\") { q = "" }
|
|
160
|
+
} else if (c == "\047" || c == "\"") {
|
|
161
|
+
q = c
|
|
162
|
+
} else if (c == "(") {
|
|
163
|
+
depth++
|
|
164
|
+
} else if (c == ")") {
|
|
165
|
+
depth--
|
|
166
|
+
} else if (c == "," && depth == 0) {
|
|
167
|
+
return substr(a, 1, i - 1)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return a
|
|
171
|
+
}
|
|
172
|
+
# What the script writes or substitutes is the content of the write, not its target: a
|
|
173
|
+
# path inside the written string belongs to the content of that file. A script that
|
|
174
|
+
# edited a work file and named a laid-out copy in the text of a new line was refused by
|
|
175
|
+
# the name of a copy it never opened. The call stays and its first argument stays where
|
|
176
|
+
# that argument is the address (`writeFileSync(path, data)`); the data and the argument
|
|
177
|
+
# of `.write(`, `.write_text(`, `.write_bytes(` and of a string `.replace(` are cut.
|
|
178
|
+
# `os.replace(source, target)` is a transfer, and its arguments stay.
|
|
179
|
+
function strip_content(s, out, pre, name, from, endp, args) {
|
|
180
|
+
out = ""
|
|
181
|
+
while (match(s, /(\.write|\.write_text|\.write_bytes|\.replace|writeFileSync|appendFileSync|writeFile|appendFile)[ \t]*\(/)) {
|
|
182
|
+
pre = substr(s, 1, RSTART - 1)
|
|
183
|
+
name = substr(s, RSTART, RLENGTH)
|
|
184
|
+
from = RSTART + RLENGTH
|
|
185
|
+
if (name ~ /^\.replace/ && pre ~ /(^|[^A-Za-z0-9_])os$/) {
|
|
186
|
+
out = out pre name
|
|
187
|
+
s = substr(s, from)
|
|
188
|
+
continue
|
|
189
|
+
}
|
|
190
|
+
endp = args_end(s, from)
|
|
191
|
+
if (name ~ /^\./) {
|
|
192
|
+
out = out pre name ")"
|
|
193
|
+
} else {
|
|
194
|
+
args = substr(s, from, endp - from)
|
|
195
|
+
out = out pre name first_arg(args) ")"
|
|
196
|
+
}
|
|
197
|
+
s = substr(s, endp + 1)
|
|
198
|
+
}
|
|
199
|
+
return out s
|
|
200
|
+
}
|
|
135
201
|
# Paths are taken from the write lines, not from the whole body.
|
|
136
202
|
#
|
|
137
203
|
# Before, a body that writes anything at all gave away all its path-like words at once:
|
|
@@ -146,7 +212,7 @@ rt_write_targets() {
|
|
|
146
212
|
if (wrote) {
|
|
147
213
|
for (i = 1; i <= lines; i++) { note_var(line[i]) }
|
|
148
214
|
for (i = 1; i <= lines; i++) {
|
|
149
|
-
if (writes(line[i])) { emit(line[i]); emit_calls(line[i]) }
|
|
215
|
+
if (writes(line[i])) { emit(strip_content(line[i])); emit_calls(line[i]) }
|
|
150
216
|
}
|
|
151
217
|
}
|
|
152
218
|
for (i = 1; i <= lines; i++) { delete line[i] }
|
|
@@ -167,7 +233,7 @@ rt_write_targets() {
|
|
|
167
233
|
if ($0 ~ /(^|[|;&(]|[ \t])(python3?|node|ruby|perl|php|deno|bun)([ \t]|$)/ \
|
|
168
234
|
&& match($0, /[ \t]-[ce][ \t]/)) {
|
|
169
235
|
rest = substr($0, RSTART + RLENGTH)
|
|
170
|
-
if (writes(rest)) { note_var(rest); emit(rest); emit_calls(rest) }
|
|
236
|
+
if (writes(rest)) { note_var(rest); emit(strip_content(rest)); emit_calls(rest) }
|
|
171
237
|
}
|
|
172
238
|
# The heredoc body: the write path of the interpreter stands exactly there.
|
|
173
239
|
if (match($0, /<<-?[ \t]*[\047\"]?[A-Za-z_][A-Za-z0-9_]*/)) {
|
|
@@ -73,4 +73,5 @@ declaration: a domain section is named by the id of its item.
|
|
|
73
73
|
- An address move without editing the end-to-end tests: they walk by addresses, and the run goes
|
|
74
74
|
red.
|
|
75
75
|
- An icon picked as "similar": a missing one is added to the sprite and to
|
|
76
|
-
`<prefix>-icon-names.ts`.
|
|
76
|
+
`<prefix>-icon-names.ts`. The name of a present icon is copied from the kit icon file as is: some
|
|
77
|
+
names carry the `ico-` prefix and most do not.
|
|
@@ -239,6 +239,9 @@ past session, and it answers 200 with old code.
|
|
|
239
239
|
`nx run-many -t build` both the site and the admin go down. Build what you check
|
|
240
240
|
(`npx nx build site`), not the whole tree. If the servers went down, the agent cannot bring them
|
|
241
241
|
back up — the guard is in the way, so the owner is told at once, not at the end of the session.
|
|
242
|
+
The push gate is such a build too: its set runs the build of everything affected. So the
|
|
243
|
+
measurement is taken before the push or on a stand from the production build. The answer of the
|
|
244
|
+
server, not its port, tells whether it survived.
|
|
242
245
|
- Take the rendering port with care: the developer's stand goes by the same name
|
|
243
246
|
`ssr:<rendering port>` through `host-gateway`, and while a foreign process hangs on it, the
|
|
244
247
|
stand serves a foreign build.
|
|
@@ -83,8 +83,29 @@ The owner's language is the one they write in chat and on cards. An owner writin
|
|
|
83
83
|
gets an English task, and that is no miss: the miss is a text in a language the addressee did
|
|
84
84
|
not choose.
|
|
85
85
|
|
|
86
|
+
## A guide for an executor in another tree
|
|
87
|
+
|
|
88
|
+
Its reader has neither the author's memory nor the author's conversation, so the guide is checked
|
|
89
|
+
step by step before it is handed over: each step is done from the text alone. Addresses, access
|
|
90
|
+
and the state of name records are written in. A solution already found and verified goes in as a
|
|
91
|
+
recipe; "decide later" stands only where no way was verified. The ban on naming another tree covers
|
|
92
|
+
its name, not the infrastructure its reader needs.
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
✗ Шаг 1. Подготовьте узел. Адрес и доступ решим позже.
|
|
96
|
+
✓ Шаг 1. Узел — таблица «Где узел»: адрес, порт почты, вход по ключу. Запись DNS ставит владелец
|
|
97
|
+
домена, и в задаче она названа его действием.
|
|
98
|
+
```
|
|
99
|
+
|
|
86
100
|
## Pitfalls
|
|
87
101
|
|
|
102
|
+
- **A promise about the behaviour of an outside service names what backs it.** A host or a bot is
|
|
103
|
+
promised to do something only with a quote of its documentation or a run that did it; where it
|
|
104
|
+
cannot be checked before the merge, the text says exactly that.
|
|
105
|
+
- **What a text says about another record is read from that record in the same turn.** A release
|
|
106
|
+
note names a task by the title read in the tracker at that minute, and a commit without a task
|
|
107
|
+
number does not go into it: a number taken from memory lands on someone else's task.
|
|
108
|
+
|
|
88
109
|
- **An edit made by a shell command is judged by the whole command, the old version inside it
|
|
89
110
|
included.** The style check gets the body of the call, not the text that will end up in the
|
|
90
111
|
file: a rewrite carrying the previous wording inside a heredoc or an interpreter string is
|
|
@@ -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.
|
|
@@ -89,11 +89,13 @@ for v in $(docker volume ls -q -f dangling=true); do
|
|
|
89
89
|
[ -z "$(docker volume inspect "$v" --format '{{index .Labels "com.docker.compose.project"}}')" ] \
|
|
90
90
|
&& docker volume rm "$v"
|
|
91
91
|
done
|
|
92
|
-
docker builder prune --force --filter until=24h
|
|
92
|
+
docker builder prune --builder <name> --force --filter until=24h # yesterday's cache is nobody's, the fresh one the build needs
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
A threshold on the cache, not a full cleanup: removed whole, it makes the next build go from
|
|
96
|
-
scratch.
|
|
96
|
+
scratch. The cache is pruned with the builder named: without `--builder` the command prunes the
|
|
97
|
+
current builder, and a pipeline running on the same machine changes which one that is, so the cache
|
|
98
|
+
the pipeline builds with goes with it.
|
|
97
99
|
|
|
98
100
|
A pipeline run living on the owner's machine cleans up after itself, and does it in a step that
|
|
99
101
|
runs on failure too: space runs out exactly when the run fails, and a cleanup skipped on failure
|
|
@@ -181,6 +181,12 @@ one's own hand: it is removed by whoever's work it is, in their own branch.
|
|
|
181
181
|
|
|
182
182
|
- "Keep both sides" applied to all files alike: in a spec it is right, in code and in the work
|
|
183
183
|
list it is not.
|
|
184
|
+
- **A merge carries edits of files, not edits of an application.** A function switched on by one
|
|
185
|
+
line in the root of one application stays off in the second application of the tree: nobody
|
|
186
|
+
touched that root, so there is no conflict, and an optional dependency is allowed to be absent, so
|
|
187
|
+
no check turns red. After the merge the diff of the merged-in roots and shared layers is read for
|
|
188
|
+
every application of the tree: each added line is either carried over or named in the report as
|
|
189
|
+
not needed there.
|
|
184
190
|
- The merge command taken without the signature variables: the merge commit is signed by a
|
|
185
191
|
person, and the push set refuses it — at the step where all checks are already green. This is
|
|
186
192
|
fixed by rewriting the branch, not by editing one commit: conflict resolutions usually already
|
|
@@ -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'`.
|