@rt-tools/agent-kit 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/assets/agents/goal-critic.md +67 -0
- package/assets/agents/product-strategist.md +90 -0
- package/assets/agents/qa-engineer.md +3 -0
- package/assets/checks/board.github.mjs +27 -0
- package/assets/checks/check-specs.mjs +11 -2
- package/assets/checks/rt-kit-checks.config.mjs +6 -0
- package/assets/checks/spec-common.mjs +6 -3
- package/assets/checks/spec-scenarios.mjs +9 -1
- package/assets/checks/task-new.github.mjs +6 -0
- package/assets/checks/tree-assignment.mjs +11 -3
- package/assets/defaults/project.sh +10 -81
- package/assets/defaults/push.sh +100 -0
- package/assets/docs/GLOSSARY.md +4 -0
- package/assets/hooks/browser-guard-no-other-drivers.sh +6 -3
- package/assets/hooks/claim-guard.sh +6 -6
- package/assets/hooks/dispatch.sh +56 -3
- package/assets/hooks/exam-guard.sh +1 -1
- package/assets/hooks/git-guard-delivery-body.sh +25 -3
- package/assets/hooks/git-guard-delivery-folder.sh +17 -1
- package/assets/hooks/git-guard-delivery-merged.sh +65 -0
- package/assets/hooks/git-guard-delivery-pipeline.sh +99 -0
- package/assets/hooks/git-guard-delivery.sh +22 -8
- package/assets/hooks/git-guard-main.sh +17 -4
- package/assets/hooks/git-guard-push-ahead.sh +89 -0
- package/assets/hooks/git-guard-push-marks.sh +99 -0
- package/assets/hooks/git-guard-push-tests.sh +101 -83
- package/assets/hooks/git-guard-tree-assignment.sh +1 -1
- package/assets/hooks/grill-gate-options.sh +50 -0
- package/assets/hooks/grill-gate.sh +9 -1
- package/assets/hooks/pre-push.sh +113 -0
- package/assets/hooks/push-set.sh +150 -0
- package/assets/hooks/push-sign.sh +433 -0
- package/assets/hooks/rerun-guard.sh +14 -6
- package/assets/hooks/turn-exit-guard.sh +2 -2
- package/assets/hooks/turn-exit-patterns.sh +4 -3
- package/assets/hooks/turn-exit-verdict.sh +18 -1
- package/assets/hooks/waiting-turn-guard.sh +2 -1
- package/assets/hooks/write-targets.sh +21 -0
- package/assets/patterns/dependencies-upgrade.md +5 -1
- package/assets/patterns/git-workflow-commit.github.md +14 -0
- package/assets/patterns/git-workflow-pr-body.github.md +20 -3
- package/assets/patterns/git-workflow-pr.azure.md +30 -0
- package/assets/patterns/git-workflow-pr.github.md +57 -1
- package/assets/patterns/git-workflow-pr.gitlab.md +33 -0
- package/assets/patterns/mockups-measure.needs-mockups.md +19 -3
- package/assets/patterns/reuse-first-extend.md +5 -0
- package/assets/patterns/task-flow-close.md +27 -16
- package/assets/patterns/task-flow-start.md +5 -4
- package/assets/pitfalls/task-flow.md +4 -0
- package/assets/rules/browser-verification.md +4 -0
- package/assets/rules/dependencies.md +3 -1
- package/assets/rules/deploy-flow.azure.md +5 -0
- package/assets/rules/deploy-flow.github.md +5 -0
- package/assets/rules/deploy-flow.gitlab.md +5 -0
- package/assets/rules/git-workflow.azure.md +15 -0
- package/assets/rules/git-workflow.github.md +15 -0
- package/assets/rules/git-workflow.gitlab.md +15 -0
- package/assets/rules/mockups.needs-mockups.md +13 -5
- package/assets/rules/reuse-first.md +3 -0
- package/assets/rules/task-flow.md +21 -16
- package/assets/rules/testing.md +5 -0
- package/assets/samples/tasks/_template/plan.md +7 -0
- package/assets/skills/interface-review-annotate.needs-mockups.md +142 -0
- package/assets/skills/interface-review-icons.needs-app.md +136 -0
- package/assets/skills/interface-review-motion-states.needs-app.md +230 -0
- package/assets/skills/interface-review-motion.needs-app.md +209 -0
- package/assets/skills/interface-review-performance.needs-app.md +110 -0
- package/assets/skills/interface-review-principles.needs-app.md +263 -0
- package/assets/skills/interface-review-surfaces.needs-app.md +249 -0
- package/assets/skills/interface-review.needs-app.md +199 -0
- package/assets/skills/write-a-skill.md +16 -3
- package/assets/workflows/feature.js +33 -5
- package/assets/workflows/plan.js +71 -4
- package/package.json +1 -1
|
@@ -143,22 +143,22 @@ claims=(
|
|
|
143
143
|
# phrase was once said with not one run behind it.
|
|
144
144
|
'@проверк[аи] перед (push|пушем|отправкой)[^.]{0,30}(починен|исправлен)§git push|check:all|pnpm (run|exec)§прогон набора перед push — `git push` или `pnpm run check:all`'
|
|
145
145
|
'@запушен[аоы]?|@запушил[а]?|@пуш прошёл|@ветка уехала§git push§`git push`'
|
|
146
|
-
'(PR|правка|ветка|работа)[^.]{0,20}@(влит|слит|смержен)|@влит[оа] в|@слит[оа] в§git merge|gh pr merge§`git merge` или `
|
|
146
|
+
'(PR|правка|ветка|работа)[^.]{0,20}@(влит|слит|смержен)|@влит[оа] в|@слит[оа] в§git merge|gh pr merge|glab mr merge§`git merge`, `gh pr merge` или `glab mr merge`'
|
|
147
147
|
'(ветки|ветка|файлы|файл|папка|каталог)[^.]{0,40}@(снят|удал[её]н|удалил|почищен|почистил|вычищен|вычистил)|@снят[оыа] с§git branch|git push .*--delete|git rm|gh api|rm §команду удаления — `git branch -d`, `git push --delete` или `git rm`'
|
|
148
|
-
'@прогон (зелёный|прошёл|кончился)|@конвейер зелёный|@проверки на PR зелёные§gh run§`gh run list
|
|
149
|
-
'@(работа|правка|задача) готова|@можно вливать|@PR открыт|@черновик снят§gh pr §`gh pr create`, `gh pr view
|
|
148
|
+
'@прогон (зелёный|прошёл|кончился)|@конвейер зелёный|@проверки на PR зелёные§gh run|glab ci§`gh run list`, `gh run view` или `glab ci status`'
|
|
149
|
+
'@(работа|правка|задача) готова|@можно вливать|@PR открыт|@черновик снят§gh pr |glab mr §`gh pr create`, `gh pr view`, `gh pr ready` или `glab mr`'
|
|
150
150
|
# Waiting for someone else's step is a claim about the state too, and there is something in it
|
|
151
151
|
# to lie with: a run is green for an hour, and sometimes never starts at all. Said without a
|
|
152
152
|
# command, it leaves finished work a draft, and the owner learns of it last — that is exactly
|
|
153
153
|
# how it went twice in one day.
|
|
154
|
-
'@жд[уёя][^.]{0,20}прогон|@дожида[ею][^.]{0,20}прогон|@прогон[^.]{0,20}(ещё идёт|не встал|не кончился|не дошёл)|@черновик[^.]{0,30}(не снимаю|сниму|снимется)§gh run|gh pr checks|check-runs|check:board|board\.mjs§команду о прогоне — `gh run list`, `gh pr checks` или сверку очереди работ'
|
|
155
|
-
'@задача заведена|@задача (в|переведена в) колонк|@колонка переведена§gh issue|gh api|task:new|task:move|board\.mjs§команду очереди работ — заведение задачи или перевод колонки'
|
|
154
|
+
'@жд[уёя][^.]{0,20}прогон|@дожида[ею][^.]{0,20}прогон|@прогон[^.]{0,20}(ещё идёт|не встал|не кончился|не дошёл)|@черновик[^.]{0,30}(не снимаю|сниму|снимется)§gh run|gh pr checks|glab ci|check-runs|check:board|board\.mjs§команду о прогоне — `gh run list`, `gh pr checks` или сверку очереди работ'
|
|
155
|
+
'@задача заведена|@задача (в|переведена в) колонк|@колонка переведена§gh issue|gh api|glab issue|glab api|task:new|task:move|board\.mjs§команду очереди работ — заведение задачи или перевод колонки'
|
|
156
156
|
'(в дереве|в репозитории|здесь|такого файла|такой команды)[^.]{0,30}(нет|не бывает)|@не заводили|@нигде не встречается§grep|rg |ls |find |git ls-files|git grep|git log|cat §команду поиска — `grep`, `git ls-files` или обход каталога'
|
|
157
157
|
)
|
|
158
158
|
|
|
159
159
|
# A negated claim is a statement about the tree too, but the action command cannot show it: «not
|
|
160
160
|
# pushed» is shown by a read of the branch state, not by a push.
|
|
161
|
-
read_proof='git (status|log|ls-remote|branch|show|rev-parse|fetch|diff)|gh (pr|run|api|issue)|ls |grep|board\.mjs'
|
|
161
|
+
read_proof='git (status|log|ls-remote|branch|show|rev-parse|fetch|diff)|gh (pr|run|api|issue)|glab (mr|ci|api|issue)|ls |grep|board\.mjs'
|
|
162
162
|
|
|
163
163
|
for row in "${claims[@]}"; do
|
|
164
164
|
words="${row%%§*}"
|
package/assets/hooks/dispatch.sh
CHANGED
|
@@ -141,11 +141,64 @@ EOF
|
|
|
141
141
|
exit 0
|
|
142
142
|
fi
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
# Each answer is kept apart, as a JSON string per line: glued together, two objects are no longer
|
|
145
|
+
# one answer, and the merge at the end needs to know where one ends.
|
|
146
|
+
if [ -n "$branch_out" ]; then
|
|
147
|
+
answers="${answers:-}$(printf '%s' "$branch_out" | jq -Rsc . 2>/dev/null)
|
|
145
148
|
"
|
|
149
|
+
collected="${collected}${branch_out}
|
|
150
|
+
"
|
|
151
|
+
count=$((${count:-0} + 1))
|
|
152
|
+
fi
|
|
146
153
|
done
|
|
147
154
|
|
|
148
|
-
#
|
|
149
|
-
|
|
155
|
+
# The answers of several branches are merged into one object. Objects printed one after another are
|
|
156
|
+
# no longer one answer: the agent read them as raw text, and the laws and the handover of a session
|
|
157
|
+
# start arrived cut. The texts of the context and of the system message are joined by an empty line,
|
|
158
|
+
# the plain text of a branch goes into the context, the other fields are taken in the order of the
|
|
159
|
+
# branches. An event without a context field keeps the text in the system message.
|
|
160
|
+
rt_dispatch_merge() {
|
|
161
|
+
case "$event" in
|
|
162
|
+
SessionStart | UserPromptSubmit | PreToolUse | PostToolUse) with_context=true ;;
|
|
163
|
+
*) with_context=false ;;
|
|
164
|
+
esac
|
|
165
|
+
printf '%s' "$answers" | jq -sc --arg ev "$event" --argjson ctx "$with_context" '
|
|
166
|
+
map(. as $s | (try ($s | fromjson) catch null) as $j
|
|
167
|
+
| if ($j | type) == "object" then {obj: $j} else {text: ($s | sub("\\s+$"; ""))} end)
|
|
168
|
+
| [.[] | .obj // empty] as $objs
|
|
169
|
+
| ([$objs[] | .hookSpecificOutput.additionalContext // empty]
|
|
170
|
+
+ [.[] | .text // empty | select(length > 0)]) as $texts
|
|
171
|
+
| [$objs[] | .systemMessage // empty] as $sys
|
|
172
|
+
| (reduce $objs[] as $o ({};
|
|
173
|
+
. * ($o | del(.systemMessage)
|
|
174
|
+
| if (.hookSpecificOutput | type) == "object"
|
|
175
|
+
then .hookSpecificOutput |= del(.additionalContext) else . end))) as $base
|
|
176
|
+
| if $ctx then
|
|
177
|
+
$base
|
|
178
|
+
| if ($texts | length) > 0 then
|
|
179
|
+
.hookSpecificOutput = ((.hookSpecificOutput // {})
|
|
180
|
+
+ {hookEventName: $ev, additionalContext: ($texts | join("\n\n"))})
|
|
181
|
+
else . end
|
|
182
|
+
| if ($sys | length) > 0 then .systemMessage = ($sys | join("\n\n")) else . end
|
|
183
|
+
else
|
|
184
|
+
($base | del(.hookSpecificOutput))
|
|
185
|
+
| if (($sys + $texts) | length) > 0 then .systemMessage = (($sys + $texts) | join("\n\n"))
|
|
186
|
+
else . end
|
|
187
|
+
end
|
|
188
|
+
' 2>/dev/null
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
# Not one branch refused: what they printed is given out — hints and digests. A single answer goes
|
|
192
|
+
# out as it is; where the merge has no parser, the former glued output is better than silence.
|
|
193
|
+
if [ "${count:-0}" -gt 1 ]; then
|
|
194
|
+
merged="$(rt_dispatch_merge)"
|
|
195
|
+
if [ -n "$merged" ]; then
|
|
196
|
+
printf '%s\n' "$merged"
|
|
197
|
+
else
|
|
198
|
+
printf '%s' "$collected"
|
|
199
|
+
fi
|
|
200
|
+
elif [ -n "${collected:-}" ]; then
|
|
201
|
+
printf '%s' "$collected"
|
|
202
|
+
fi
|
|
150
203
|
|
|
151
204
|
exit 0
|
|
@@ -258,6 +258,6 @@ case "$verdict" in
|
|
|
258
258
|
deny "BLOCKED by exam-guard: the exam on the loaded rules is failed. Read the rule whole again — not the piece that was asked about — and call the role strict-teacher anew. The answer shown gives knowledge of one line, not of the rule. The way out through the list of switched-off roles requires removing the protection, and the runtime may forbid such an edit; the second way out does not require it — the bypass is declared by the line «Exam-skip: причина» in the body of the last commit of the branch."
|
|
259
259
|
;;
|
|
260
260
|
*)
|
|
261
|
-
deny "BLOCKED by exam-guard: there was no exam on the loaded rules in this session. Call the role strict-teacher, hand it the list of loaded rules, answer its questions from memory and return the answers to it — the verdict it gives by the line «ЭКЗАМЕН: сдано N из 5». It counts from the answer of the role in whatever form the host delivered it, but not from the output of the shell and not from your own text: printing that line as an echo does not release the guard. The role was already called and the verdict received — then it arrived in a form the guard does not see: that is a defect of the guard, and an edit of
|
|
261
|
+
deny "BLOCKED by exam-guard: there was no exam on the loaded rules in this session. Call the role strict-teacher, hand it the list of loaded rules, answer its questions from memory and return the answers to it — the verdict it gives by the line «ЭКЗАМЕН: сдано N из 5». It counts from the answer of the role in whatever form the host delivered it, but not from the output of the shell and not from your own text: printing that line as an echo does not release the guard. The role was already called and the verdict received — then it arrived in a form the guard does not see: that is a defect of the guard, and an edit of «.claude/rt-kit.json» is taken out from under it. A loaded rule and a read rule are different things, and the price of that difference is paid by the owner."
|
|
262
262
|
;;
|
|
263
263
|
esac
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# The body of a PR being opened, for the delivery guard: the section about the remaining step
|
|
3
|
-
# line that closes the task.
|
|
2
|
+
# The body of a PR being opened, for the delivery guard: the section about the remaining step, the
|
|
3
|
+
# table of points and the line that closes the task.
|
|
4
4
|
#
|
|
5
5
|
# NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The delivery guard
|
|
6
6
|
# sources it — one tier of its verdict, moved out when the guard reached its length limit. It uses
|
|
@@ -15,7 +15,9 @@ rt_delivery_pull_body() {
|
|
|
15
15
|
# without a body is checked by the guard elsewhere. The flag is recognised only as a separate
|
|
16
16
|
# word: the tail `-b` of a branch name in the base argument read as the body flag, and the next
|
|
17
17
|
# word of the command became the body.
|
|
18
|
-
|
|
18
|
+
local pull_goal_section="${RT_PULL_GOAL_SECTION:-}"
|
|
19
|
+
[ -z "$pull_body_section" ] && [ -z "$pull_points_section" ] && [ -z "$pull_goal_section" ] \
|
|
20
|
+
&& [ -z "$pull_closes_line" ] && return 0
|
|
19
21
|
command -v perl >/dev/null 2>&1 || return 0
|
|
20
22
|
|
|
21
23
|
local body body_file closes
|
|
@@ -38,6 +40,26 @@ rt_delivery_pull_body() {
|
|
|
38
40
|
fault "the body of the request carries no section about the remaining step. The merge button is pressed by a person on the hosting, where there are no guards, and they merge as soon as they see green: all that holds the requirement there is what the owner read on the page. The section stands last and says exactly one thing — whether anything is left before the merge; it is rewritten by the same call that edits the body."
|
|
39
41
|
fi
|
|
40
42
|
|
|
43
|
+
# The table of points: without it the owner learns whether the work reached its point only after
|
|
44
|
+
# the merge. The guard sees the heading, not whether the signs were run.
|
|
45
|
+
if [ -n "$pull_points_section" ] && ! printf '%s' "$body" | grep -qE "$pull_points_section"; then
|
|
46
|
+
fault "the body of the request carries no section with the table of points. The owner decides on the request page whether the work reached its point. Run the role product-strategist and put its table of points into the body; a sign not run is written as not run."
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# The table of the critic: the session's own points prove nothing about what the owner asked for.
|
|
50
|
+
# A heading alone is not a table: a header, a divider and one row make three lines.
|
|
51
|
+
if [ -n "$pull_goal_section" ]; then
|
|
52
|
+
local goal_rows
|
|
53
|
+
goal_rows="$(printf '%s\n' "$body" | awk -v head="$pull_goal_section" '
|
|
54
|
+
$0 ~ head { inside = 1; next }
|
|
55
|
+
/^## / { inside = 0 }
|
|
56
|
+
inside && /^\|/ { rows++ }
|
|
57
|
+
END { print rows + 0 }
|
|
58
|
+
')"
|
|
59
|
+
[ "$goal_rows" -ge 3 ] \
|
|
60
|
+
|| fault "the body of the request carries no section with the table of the critic. Give the role goal-critic the owner's words verbatim and the result, and put its table into the body word for word."
|
|
61
|
+
fi
|
|
62
|
+
|
|
41
63
|
# The line that closes the task. Without it the merged task stays open on the board, and the
|
|
42
64
|
# work queue audit names that only after the merge — three PRs of one epic went out so, and the
|
|
43
65
|
# owner closed their tasks by hand. The number is the branch's, not the one the executor
|
|
@@ -68,9 +68,15 @@ rt_delivery_open_folder() {
|
|
|
68
68
|
return 0
|
|
69
69
|
fi
|
|
70
70
|
|
|
71
|
-
[ -n "$archive_dir" ] || return 0
|
|
72
71
|
_base="$(git merge-base "$main_branch" HEAD 2>/dev/null)"
|
|
73
72
|
[ -z "$_base" ] && return 0
|
|
73
|
+
|
|
74
|
+
# SC-AK-1249: the draft the plan named, still lying in the branch, would reach main unmerged.
|
|
75
|
+
_draft="$(rt_branch_plan_draft "$_folder" "$_base")"
|
|
76
|
+
[ -n "$_draft" ] && [ -n "$(git ls-tree -d --name-only HEAD -- "${_draft%/}" 2>/dev/null)" ] \
|
|
77
|
+
&& fault "the branch carries the unmerged agreement «${_draft}» its plan named — merge its rules and scenarios into the domain spec, remove the directory by a commit and repeat. If the work is merged in parts, put the comment «# Task-folder-skip: <reason>» into the command."
|
|
78
|
+
|
|
79
|
+
[ -n "$archive_dir" ] || return 0
|
|
74
80
|
rt_folder_was_in_branch "$_base" "$_folder" || return 0
|
|
75
81
|
|
|
76
82
|
_gained="$(git diff --name-only --diff-filter=A "$_base" HEAD -- "$archive_dir" 2>/dev/null | head -1)"
|
|
@@ -78,6 +84,16 @@ rt_delivery_open_folder() {
|
|
|
78
84
|
&& fault "the task folder was deleted, but the branch added nothing to «${archive_dir}». Deleting is cheaper than taking apart — and together with the folder the analysis of the request is gone, the only record of the words of the owner. Move what explains the decisions taken as one file with a telling name and repeat."
|
|
79
85
|
}
|
|
80
86
|
|
|
87
|
+
# The draft agreement the plan of the branch named by the line `**Draft:** \`path\``. The plan is
|
|
88
|
+
# read from the history: by the time the PR opens the folder is taken apart, and the last commit
|
|
89
|
+
# touching the plan is the one that removed it — then its parent still holds the plan.
|
|
90
|
+
rt_branch_plan_draft() {
|
|
91
|
+
_commit="$(git log -1 --format=%H "$2..HEAD" -- "$1/plan.md" 2>/dev/null)"
|
|
92
|
+
[ -n "$_commit" ] || return 0
|
|
93
|
+
{ git show "$_commit:$1/plan.md" 2>/dev/null || git show "$_commit^:$1/plan.md" 2>/dev/null; } \
|
|
94
|
+
| sed -nE 's/^\*\*Draft:\*\*[[:space:]]*`([^`]+)`.*/\1/p' | head -1
|
|
95
|
+
}
|
|
96
|
+
|
|
81
97
|
# Condition for leaving draft: the same subject between opening and merging. The owner reads a PR
|
|
82
98
|
# out of draft as an invitation to merge, and presses the button without waiting for the cleanup
|
|
83
99
|
# commit: the merge guard does not reach here at all — a person on the hosting presses it. Three
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The push into a branch whose PR is merged, for the delivery guard.
|
|
3
|
+
#
|
|
4
|
+
# NOT a guard: it has no `rt-hook:` declaration and hooks into no agent event. The delivery guard
|
|
5
|
+
# sources it after `deny` — one tier of its verdict, kept apart because the guard is at its length
|
|
6
|
+
# limit.
|
|
7
|
+
#
|
|
8
|
+
# The owner merged a PR, the host deleted its branch, and minutes later the executor committed an
|
|
9
|
+
# incident analysis into the same branch and pushed it. The host answered `new branch`: the branch
|
|
10
|
+
# came back with one commit over the merged work, and no PR would ever merge it. The pattern of the
|
|
11
|
+
# commit already asked for the PR state before such a push, and only memory held it.
|
|
12
|
+
#
|
|
13
|
+
# What is judged is the branch the push sends: the destination of the last refspec, or the checked
|
|
14
|
+
# out branch when the command names none. The branch has a merged PR and no open one — the push is
|
|
15
|
+
# refused. A branch reopened by a new PR after the merge is lawful work and passes.
|
|
16
|
+
#
|
|
17
|
+
# It expects `$cmd` and `$root` to be set and `deny` to be declared.
|
|
18
|
+
#
|
|
19
|
+
# FAIL-OPEN: no profile function, no network, a dry run, a command that is not a push — silence.
|
|
20
|
+
|
|
21
|
+
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/utf8.sh" 2>/dev/null || true
|
|
22
|
+
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/hook-input.sh" 2>/dev/null || true
|
|
23
|
+
|
|
24
|
+
# The number of the merged PR of a branch that has no open PR; empty output means "not merged". A
|
|
25
|
+
# tree on another host declares the function in its profile; this default asks the work queue
|
|
26
|
+
# helper. It lives here because the defaults file is at its length limit. No node, no helper, no
|
|
27
|
+
# network — a failing exit code, and the push is not judged.
|
|
28
|
+
command -v rt_pull_merged >/dev/null 2>&1 || rt_pull_merged() {
|
|
29
|
+
local _state
|
|
30
|
+
command -v node >/dev/null 2>&1 || return 1
|
|
31
|
+
[ -f "${RT_BOARD_HELPER:-tools/board.mjs}" ] || return 1
|
|
32
|
+
_state="$(node "${RT_BOARD_HELPER:-tools/board.mjs}" merged "$1" 2>/dev/null)" || return 1
|
|
33
|
+
printf '%s' "$_state" | jq -e 'has("merged")' >/dev/null 2>&1 || return 1
|
|
34
|
+
printf '%s' "$_state" | jq -r '.merged // empty'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
rt_delivery_merged() {
|
|
38
|
+
local _rest _target _merged
|
|
39
|
+
printf '%s' "$cmd" | grep -qE "${RT_CMD_BOUND}git([[:space:]]|\$)" || return 0
|
|
40
|
+
printf '%s' "$cmd" | grep -q -- '--dry-run' && return 0
|
|
41
|
+
_rest="$(printf '%s' "$cmd" | sed -E 's/git[[:space:]]+stash[[:space:]]+push/git stash/g' \
|
|
42
|
+
| sed -nE 's/.*(^|[[:space:]])push([[:space:]]+(.*))?$/\3/p' | head -1)"
|
|
43
|
+
printf '%s' "$cmd" | sed -E 's/git[[:space:]]+stash[[:space:]]+push/git stash/g' \
|
|
44
|
+
| grep -qE '(^|[[:space:]])push([[:space:]]|$)' || return 0
|
|
45
|
+
# The words after `push` up to the end of the call: options are skipped, the first word is the
|
|
46
|
+
# remote, the second — the refspec, whose destination is the branch.
|
|
47
|
+
_target="$(printf '%s' "$_rest" | sed -E 's/[;&|].*$//' | awk '{
|
|
48
|
+
n = 0
|
|
49
|
+
for (i = 1; i <= NF; i++) {
|
|
50
|
+
if ($i ~ /^-/) continue
|
|
51
|
+
n++
|
|
52
|
+
if (n == 2) { spec = $i }
|
|
53
|
+
}
|
|
54
|
+
sub(/^\+/, "", spec); sub(/^.*:/, "", spec); sub(/^refs\/heads\//, "", spec)
|
|
55
|
+
print spec
|
|
56
|
+
}')"
|
|
57
|
+
[ -n "$_target" ] && [ "$_target" != HEAD ] || _target="$(git -C "$root" branch --show-current 2>/dev/null)"
|
|
58
|
+
[ -n "$_target" ] || return 0
|
|
59
|
+
[ "$_target" = "${main_branch:-main}" ] && return 0
|
|
60
|
+
|
|
61
|
+
_merged="$(cd "$root" && rt_pull_merged "$_target" 2>/dev/null)" || return 0
|
|
62
|
+
[ -n "$_merged" ] || return 0
|
|
63
|
+
|
|
64
|
+
deny "BLOCKED: the PR #${_merged} of the branch «${_target}» is merged, and the branch has no open PR. The host deleted the branch with the merge, and this push recreates it with commits nobody will merge. Take a new branch from the fresh base and move the commits there: git fetch origin && git checkout -b <new branch> origin/<base> && git cherry-pick <commits>."
|
|
65
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A draft on a base the pipeline does not wake for, for the delivery guard. NOT a guard: it has no
|
|
3
|
+
# `rt-hook:` declaration and hooks into no agent event. The delivery guard sources it and calls
|
|
4
|
+
# `rt_delivery_pull_draft` with the command text on a PR opening.
|
|
5
|
+
#
|
|
6
|
+
# A draft waits for a run. Where no run comes it waits for nothing, and the owner sees a locked
|
|
7
|
+
# merge button and a PR that reads as unfinished: one such draft stood half an hour waiting for a
|
|
8
|
+
# check that would never start. The rule said so in words; nothing held it.
|
|
9
|
+
#
|
|
10
|
+
# The bases are read from the pipeline file the tree already named for the push gate, not from a
|
|
11
|
+
# list of their own: a second list drifts from the file the first day the trigger changes.
|
|
12
|
+
#
|
|
13
|
+
# FAIL-OPEN: no settings, no pipeline file, a trigger without a branch filter, a pipeline of another
|
|
14
|
+
# host — not judged. A wrong refusal here would forbid a lawful draft, and silence costs half an hour.
|
|
15
|
+
|
|
16
|
+
# The pipeline file the tree named. Printed empty where there is none.
|
|
17
|
+
rt_pipeline_file() {
|
|
18
|
+
local settings="${CLAUDE_PROJECT_DIR:-.}/.claude/rt-kit/checks.json" file
|
|
19
|
+
[ -f "$settings" ] || return 0
|
|
20
|
+
file="$(jq -r '.pushGate.pipelineFile // empty' "$settings" 2>/dev/null)"
|
|
21
|
+
[ -n "$file" ] && [ -f "${CLAUDE_PROJECT_DIR:-.}/$file" ] && printf '%s' "${CLAUDE_PROJECT_DIR:-.}/$file"
|
|
22
|
+
return 0
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# The branch patterns of the `pull_request` trigger, one per line. Prints nothing where the trigger
|
|
26
|
+
# has no such list: then the pipeline wakes for every base, or the file is of another host. Both the
|
|
27
|
+
# list form and the inline form are read; `branches-ignore` and `pull_request_target` are not.
|
|
28
|
+
rt_pipeline_pull_bases() {
|
|
29
|
+
awk '
|
|
30
|
+
function indent(line) { match(line, /^ */); return RLENGTH }
|
|
31
|
+
function clean(word) {
|
|
32
|
+
sub(/[[:space:]]*#.*$/, "", word)
|
|
33
|
+
gsub(/^[[:space:]"\047]+|[[:space:]"\047]+$/, "", word)
|
|
34
|
+
return word
|
|
35
|
+
}
|
|
36
|
+
!trigger {
|
|
37
|
+
if ($0 ~ /^[[:space:]]*pull_request:[[:space:]]*(#.*)?$/) { trigger = 1; trigger_at = indent($0) }
|
|
38
|
+
next
|
|
39
|
+
}
|
|
40
|
+
/^[[:space:]]*(#.*)?$/ { next }
|
|
41
|
+
indent($0) <= trigger_at { exit }
|
|
42
|
+
!list {
|
|
43
|
+
if ($0 ~ /^[[:space:]]*branches:/) {
|
|
44
|
+
line = $0
|
|
45
|
+
sub(/^[[:space:]]*branches:[[:space:]]*/, "", line)
|
|
46
|
+
if (line ~ /^\[/) {
|
|
47
|
+
gsub(/[][]/, "", line)
|
|
48
|
+
count = split(line, words, ",")
|
|
49
|
+
for (i = 1; i <= count; i++) if (clean(words[i]) != "") print clean(words[i])
|
|
50
|
+
exit
|
|
51
|
+
}
|
|
52
|
+
list = 1
|
|
53
|
+
list_at = indent($0)
|
|
54
|
+
}
|
|
55
|
+
next
|
|
56
|
+
}
|
|
57
|
+
indent($0) <= list_at && $0 !~ /^[[:space:]]*-/ { exit }
|
|
58
|
+
/^[[:space:]]*-/ { line = $0; sub(/^[[:space:]]*-[[:space:]]*/, "", line); print clean(line) }
|
|
59
|
+
' "$1" 2>/dev/null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# Quoted text is cut first: a title may mention the flag.
|
|
63
|
+
rt_pull_asks_draft() {
|
|
64
|
+
printf '%s' "$1" | sed -E "s/\"[^\"]*\"//g; s/'[^']*'//g" \
|
|
65
|
+
| grep -qE '(^|[[:space:]])(--draft(=true)?|-d)([[:space:]]|$)'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
rt_delivery_pull_draft() {
|
|
69
|
+
local command_text="$1" file bases base pattern
|
|
70
|
+
rt_pull_asks_draft "$command_text" || return 0
|
|
71
|
+
|
|
72
|
+
file="$(rt_pipeline_file)"
|
|
73
|
+
[ -n "$file" ] || return 0
|
|
74
|
+
bases="$(rt_pipeline_pull_bases "$file")"
|
|
75
|
+
[ -n "$bases" ] || return 0
|
|
76
|
+
|
|
77
|
+
# The base named by the command. Absent — the host takes the default branch.
|
|
78
|
+
base=''
|
|
79
|
+
if command -v perl >/dev/null 2>&1; then
|
|
80
|
+
base="$(printf '%s' "$command_text" | perl -0ne '
|
|
81
|
+
if (/(?:^|\s)(?:--base|-B)(?:=|\s+)(?:"((?:[^"\\]|\\.)*)"|\x27([^\x27]*)\x27|(\S+))/s) {
|
|
82
|
+
print defined $1 ? $1 : (defined $2 ? $2 : $3);
|
|
83
|
+
}
|
|
84
|
+
' 2>/dev/null)"
|
|
85
|
+
fi
|
|
86
|
+
base="${base:-${main_branch:-main}}"
|
|
87
|
+
|
|
88
|
+
while IFS= read -r pattern; do
|
|
89
|
+
[ -z "$pattern" ] && continue
|
|
90
|
+
# shellcheck disable=SC2254
|
|
91
|
+
case "$base" in
|
|
92
|
+
$pattern) return 0 ;;
|
|
93
|
+
esac
|
|
94
|
+
done <<EOF
|
|
95
|
+
$bases
|
|
96
|
+
EOF
|
|
97
|
+
|
|
98
|
+
fault "a draft into «${base}»: the pipeline «${file##*/}» wakes for a request only into $(printf '%s' "$bases" | tr '\n' ' ' | sed 's/ $//'), so no run will come and the draft will wait for nothing. Open the request ready, without --draft, and set the reviewer in the same call."
|
|
99
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# rt-hook: PreToolUse Bash|mcp__webstorm__execute_terminal_command|mcp__webstorm__execute_tool
|
|
3
|
-
# Requires: hooks/git-guard-delivery-
|
|
3
|
+
# Requires: hooks/git-guard-delivery-merged.sh, hooks/git-guard-delivery-folder.sh,hooks/git-guard-delivery-epic.sh, hooks/git-guard-delivery-pipeline.sh, hooks/git-guard-tree-assignment.sh, hooks/git-guard-delivery-conflict.sh, hooks/profile-check.sh, hooks/deny-tail.sh, hooks/guard-note.sh
|
|
4
4
|
# Delivery guard. PreToolUse on creating a branch, on the push and on opening a PR.
|
|
5
5
|
#
|
|
6
6
|
# The delivery law demands three things nothing usually checks: an edit starts from a task visible
|
|
@@ -117,6 +117,7 @@ pull_token_hint="${RT_PULL_TOKEN_HINT:-}"
|
|
|
117
117
|
# the pattern is named by the tree, not by the package: the package does not know someone else's
|
|
118
118
|
# words, and an invented default would match nothing.
|
|
119
119
|
pull_body_section="${RT_PULL_BODY_SECTION:-}"
|
|
120
|
+
pull_points_section="${RT_PULL_POINTS_SECTION:-}"
|
|
120
121
|
# The line that closes the task on the merge, with `{number}` in place of the task number. Its keyword
|
|
121
122
|
# belongs to the hosting, so the sample is named by the tree, as the section above.
|
|
122
123
|
pull_closes_line="${RT_PULL_CLOSES_LINE:-}"
|
|
@@ -298,9 +299,16 @@ if [ -n "$branch_arg" ]; then
|
|
|
298
299
|
# The signature: the address of the machine account is declared by the tree, and the working
|
|
299
300
|
# copy does not know it — which means the very first commit will travel under someone else's
|
|
300
301
|
# signature, and after the push that is fixed only by a force push.
|
|
302
|
+
#
|
|
303
|
+
# A person the tree named in RT_HUMAN_EMAILS signs with their own mail lawfully: the push
|
|
304
|
+
# accepts it, and refusing it here left such a person no way to start a branch at all.
|
|
301
305
|
if [ -n "$commit_email" ]; then
|
|
302
306
|
tree_email="$(git config user.email 2>/dev/null)"
|
|
303
|
-
|
|
307
|
+
human_email=''
|
|
308
|
+
for one in ${RT_HUMAN_EMAILS:-}; do
|
|
309
|
+
[ "$tree_email" = "$one" ] && human_email=1 && break
|
|
310
|
+
done
|
|
311
|
+
[ -n "$tree_email" ] && [ "$tree_email" != "$commit_email" ] && [ -z "$human_email" ] \
|
|
304
312
|
&& fault "the working copy signs commits as «${tree_email}», while the tree declared the email of the machine account «${commit_email}». The very first commit leaves under a foreign signature: git config user.email \"${commit_email}\"."
|
|
305
313
|
fi
|
|
306
314
|
|
|
@@ -315,20 +323,23 @@ fi
|
|
|
315
323
|
# the length limit, and the signature is the most separate of its subjects. No helper — the
|
|
316
324
|
# signature is not judged, and the work goes on: the same fail-open as with the other conditions.
|
|
317
325
|
# shellcheck disable=SC1090
|
|
318
|
-
[ -f "$rt_hooks_dir/git-guard-delivery-signature.sh" ]
|
|
319
|
-
&& . "$rt_hooks_dir/git-guard-delivery-signature.sh" 2>/dev/null
|
|
326
|
+
[ -f "$rt_hooks_dir/git-guard-delivery-signature.sh" ] && . "$rt_hooks_dir/git-guard-delivery-signature.sh" 2>/dev/null
|
|
320
327
|
command -v rt_delivery_signature >/dev/null 2>&1 && rt_delivery_signature
|
|
321
328
|
|
|
329
|
+
# --- the push into a merged branch -----------------------------------------------------------
|
|
330
|
+
# The helper next door — `git-guard-delivery-merged.sh`. No helper — the push is not judged by it.
|
|
331
|
+
# shellcheck disable=SC1090
|
|
332
|
+
[ -f "$rt_hooks_dir/git-guard-delivery-merged.sh" ] && . "$rt_hooks_dir/git-guard-delivery-merged.sh" 2>/dev/null
|
|
333
|
+
command -v rt_delivery_merged >/dev/null 2>&1 && rt_delivery_merged
|
|
334
|
+
|
|
322
335
|
# --- leaving draft ---------------------------------------------------------------------------
|
|
323
336
|
# The subject lives in a helper next door — `git-guard-delivery-draft.sh`, by the same technique as
|
|
324
337
|
# the signature. No helper — leaving draft is not judged, and the work goes on.
|
|
325
338
|
# shellcheck disable=SC1090
|
|
326
|
-
[ -f "$rt_hooks_dir/git-guard-delivery-draft.sh" ]
|
|
327
|
-
&& . "$rt_hooks_dir/git-guard-delivery-draft.sh" 2>/dev/null
|
|
339
|
+
[ -f "$rt_hooks_dir/git-guard-delivery-draft.sh" ] && . "$rt_hooks_dir/git-guard-delivery-draft.sh" 2>/dev/null
|
|
328
340
|
command -v rt_delivery_draft_ready >/dev/null 2>&1 && rt_delivery_draft_ready
|
|
329
341
|
|
|
330
342
|
# --- merging a PR --------------------------------------------------------------------------
|
|
331
|
-
#
|
|
332
343
|
# The second line of the same condition that stands at the opening of a PR: it catches a merge going
|
|
333
344
|
# by command. We look for the command from the start of the line or after a separator, not anywhere
|
|
334
345
|
# in the text. Otherwise the guard refuses a message where `gh pr merge` is merely mentioned in
|
|
@@ -397,9 +408,12 @@ if [ -n "$title" ]; then
|
|
|
397
408
|
fi
|
|
398
409
|
fi
|
|
399
410
|
|
|
411
|
+
# A draft into a base the pipeline does not wake for waits for nothing. No helper — not judged.
|
|
412
|
+
[ -f "$rt_hooks_dir/git-guard-delivery-pipeline.sh" ] && . "$rt_hooks_dir/git-guard-delivery-pipeline.sh" 2>/dev/null
|
|
413
|
+
command -v rt_delivery_pull_draft >/dev/null 2>&1 && rt_delivery_pull_draft "$cmd"
|
|
414
|
+
|
|
400
415
|
# The main branch is merged in before the PR opens: otherwise the reviewer sees someone else's edit
|
|
401
416
|
# mixed in with his own, and the checks run from an outdated base.
|
|
402
|
-
#
|
|
403
417
|
# There are two tiers. The first reads the local tip and works without the network. The second asks
|
|
404
418
|
# the remote reference: without it, silence means only "the local reference is not older than the
|
|
405
419
|
# branch", while it reads as "the main branch is merged in". No answer from the network — a silent
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
# on them entirely — rule `git-workflow`. A direct commit there is almost always a miss: "stayed on
|
|
8
8
|
# main after merging the previous PR".
|
|
9
9
|
#
|
|
10
|
-
# The name of the main branch is not hard-wired as a string: first
|
|
11
|
-
#
|
|
12
|
-
# the end `main` is taken.
|
|
10
|
+
# The name of the main branch is not hard-wired as a string: first `RT_MAIN_BRANCH` of the tree
|
|
11
|
+
# profile is read, then the pointer of the remote repository is asked, then the existing
|
|
12
|
+
# `origin/main` and `origin/master` are tried, and only at the end `main` is taken.
|
|
13
13
|
#
|
|
14
14
|
# FAIL-OPEN: not a repository, no git, a detached HEAD, broken input — pass. A broken guard must not
|
|
15
15
|
# get in the way of work.
|
|
@@ -99,7 +99,20 @@ git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 0
|
|
|
99
99
|
branch="$(git branch --show-current 2>/dev/null)"
|
|
100
100
|
[ -z "$branch" ] && exit 0 # a detached HEAD is not about this case
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
# The name is read from the tree's own profile — the one the commit runs in — as the other delivery
|
|
103
|
+
# guards read it. Not through the package default: that one always says `main`, and a tree on
|
|
104
|
+
# `master` that named nothing would lose the guessing below. The profile is loaded in a subshell, so
|
|
105
|
+
# nothing it declares leaks into the guard.
|
|
106
|
+
top="$(git rev-parse --show-toplevel 2>/dev/null)"
|
|
107
|
+
declared="$(
|
|
108
|
+
# shellcheck disable=SC1090,SC1091
|
|
109
|
+
[ -n "$top" ] && [ -f "$top/.claude/rt-kit/project.sh" ] \
|
|
110
|
+
&& . "$top/.claude/rt-kit/project.sh" >/dev/null 2>&1 </dev/null
|
|
111
|
+
printf '%s' "${RT_MAIN_BRANCH:-}"
|
|
112
|
+
)"
|
|
113
|
+
|
|
114
|
+
default="$declared"
|
|
115
|
+
[ -z "$default" ] && default="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##')"
|
|
103
116
|
if [ -z "$default" ]; then
|
|
104
117
|
for candidate in main master; do
|
|
105
118
|
if git show-ref --verify --quiet "refs/remotes/origin/$candidate" 2>/dev/null; then
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# The push set run ahead of the push: every check of `rt_push_checks <base>`, a green mark for each
|
|
3
|
+
# that passed. The push guard then reads the marks instead of running the steps again.
|
|
4
|
+
#
|
|
5
|
+
# NOT a guard: it has no `rt-hook:` declaration and is called by hand or by the agent —
|
|
6
|
+
# `bash .claude/hooks/git-guard-push-ahead.sh`, in the background. The guard cannot run a step
|
|
7
|
+
# longer than its hook limit, and a guard cut by the limit lets the call through with no verdict;
|
|
8
|
+
# here no limit cuts the run.
|
|
9
|
+
#
|
|
10
|
+
# The base, the profile and the marks are the guard's own — the helper `git-guard-push-marks.sh`
|
|
11
|
+
# and the same profile files — so a mark written here answers exactly the line the guard asks
|
|
12
|
+
# about. A check already green on this tree and base is not run again.
|
|
13
|
+
#
|
|
14
|
+
# Exit codes: 0 — the set is green; 1 — a check is red; 3 — the run did not start (no profile, no
|
|
15
|
+
# repository, edits outside the index). Not 2: to a hook that code means "refuse", and this command
|
|
16
|
+
# refuses nothing.
|
|
17
|
+
not_started=3
|
|
18
|
+
|
|
19
|
+
rt_hooks_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
20
|
+
|
|
21
|
+
root="$(git rev-parse --show-toplevel 2>/dev/null)" || {
|
|
22
|
+
printf 'push ahead: not a repository\n' >&2
|
|
23
|
+
exit "$not_started"
|
|
24
|
+
}
|
|
25
|
+
cd "$root" || exit "$not_started"
|
|
26
|
+
|
|
27
|
+
for profile in "$rt_hooks_dir/../rt-kit/defaults/project.sh" "$rt_hooks_dir/../defaults/project.sh" "$root/.claude/rt-kit/defaults/project.sh" "$root/.claude/rt-kit/project.sh"; do
|
|
28
|
+
# shellcheck disable=SC1090
|
|
29
|
+
[ -f "$profile" ] && . "$profile" 2>/dev/null
|
|
30
|
+
done
|
|
31
|
+
# shellcheck disable=SC1090
|
|
32
|
+
. "$rt_hooks_dir/git-guard-push-marks.sh" 2>/dev/null || {
|
|
33
|
+
printf 'push ahead: the helper git-guard-push-marks.sh is not laid out\n' >&2
|
|
34
|
+
exit "$not_started"
|
|
35
|
+
}
|
|
36
|
+
command -v rt_push_checks >/dev/null 2>&1 || {
|
|
37
|
+
printf 'push ahead: the tree profile declares no rt_push_checks\n' >&2
|
|
38
|
+
exit "$not_started"
|
|
39
|
+
}
|
|
40
|
+
command -v rt_push_check_heavy >/dev/null 2>&1 || rt_push_check_heavy() { return 1; }
|
|
41
|
+
|
|
42
|
+
# A mark vouches for the tree of the head, and the checks run over the working copy: with edits
|
|
43
|
+
# outside the index the run would write marks for content that does not leave.
|
|
44
|
+
rt_push_mark_clean || {
|
|
45
|
+
printf 'push ahead: the working copy holds edits outside the index — commit first, the marks are written only for a clean copy\n' >&2
|
|
46
|
+
exit "$not_started"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
base="$(rt_push_base "${RT_MAIN_BRANCH:-main}")"
|
|
50
|
+
skip_code="${RT_SKIP_CODE:-7}"
|
|
51
|
+
printf 'push ahead: base %s, tree %s\n' "${base:-none}" "$(git rev-parse --short 'HEAD^{tree}')"
|
|
52
|
+
|
|
53
|
+
red=""
|
|
54
|
+
while IFS= read -r check; do
|
|
55
|
+
[ -z "$check" ] && continue
|
|
56
|
+
if rt_push_mark_has "$check" "$base"; then
|
|
57
|
+
printf '= green already: %s\n' "$check"
|
|
58
|
+
continue
|
|
59
|
+
fi
|
|
60
|
+
# After a red check a heavy one is not started: the push is refused anyway.
|
|
61
|
+
if [ -n "$red" ] && rt_push_check_heavy "$check"; then
|
|
62
|
+
printf '· held after red: %s\n' "$check"
|
|
63
|
+
continue
|
|
64
|
+
fi
|
|
65
|
+
key_before="$(rt_push_mark_key "$check" "$base")"
|
|
66
|
+
started="$(date +%s)"
|
|
67
|
+
out="$(eval "$check" 2>&1)"
|
|
68
|
+
status=$?
|
|
69
|
+
took=$(($(date +%s) - started))
|
|
70
|
+
if [ "$status" -eq 0 ]; then
|
|
71
|
+
rt_push_mark_put "$check" "$base" "$key_before"
|
|
72
|
+
printf '+ green in %ss: %s\n' "$took" "$check"
|
|
73
|
+
elif [ "$status" -eq "$skip_code" ]; then
|
|
74
|
+
printf '~ nothing to look at: %s\n' "$check"
|
|
75
|
+
else
|
|
76
|
+
red="${red}${red:+
|
|
77
|
+
}${check}"
|
|
78
|
+
printf '✗ red in %ss: %s\n%s\n' "$took" "$check" "$(printf '%s' "$out" | tail -n 25)"
|
|
79
|
+
fi
|
|
80
|
+
done <<EOF
|
|
81
|
+
$(rt_push_checks "$base")
|
|
82
|
+
EOF
|
|
83
|
+
|
|
84
|
+
if [ -n "$red" ]; then
|
|
85
|
+
printf '\npush ahead: red —\n%s\n' "$red"
|
|
86
|
+
exit 1
|
|
87
|
+
fi
|
|
88
|
+
printf '\npush ahead: the set is green, the push passes from the marks\n'
|
|
89
|
+
exit 0
|