mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-20 22:38:04 +00:00
feat: skills - verify auto-tmux report packs
This commit is contained in:
@@ -26,6 +26,7 @@ scripts/
|
||||
├── record-summary.sh # 汇总 pipe-pane 录制日志
|
||||
├── check-jsonl.sh # 轻量 JSONL 字段门禁
|
||||
├── review-checklist.sh # report pack reviewer 审计清单
|
||||
├── verify-report-pack.sh # report pack 统一验证入口
|
||||
├── completion.bash # Bash completion
|
||||
├── safety-check.sh # 发送/粘贴/分发前的 payload 安全预检
|
||||
├── render-swarm-prompt.sh # commander/worker/reviewer 提示词渲染
|
||||
@@ -59,6 +60,7 @@ scripts/
|
||||
- 录制摘要脚本只读 record 日志,输出默认脱敏,不修改日志源文件。
|
||||
- JSONL 检查脚本只能做轻量字段门禁,不替代完整 JSON parser。
|
||||
- 审计清单脚本只读报告包目录,不修改报告源文件。
|
||||
- 报告包验证脚本只组合本目录已有只读门禁,不修改报告包内容。
|
||||
- completion 文件只能定义 shell completion,不执行 tmux 写操作。
|
||||
- 安全预检脚本只能读取文本或文件,不控制 tmux,不写状态目录。
|
||||
- 状态脚本只能写入显式状态目录,不保存密钥、Token、密码或私密项目内容。
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
- [`record-summary.sh`](./record-summary.sh) - 汇总 `record start` 产生的 pane 日志,生成复盘摘要。
|
||||
- [`check-jsonl.sh`](./check-jsonl.sh) - 轻量检查 JSONL 行和必需字段。
|
||||
- [`review-checklist.sh`](./review-checklist.sh) - 为 report pack 生成 reviewer 审计清单。
|
||||
- [`verify-report-pack.sh`](./verify-report-pack.sh) - 统一验证 report pack 的 manifest、JSONL 和审计清单。
|
||||
- [`completion.bash`](./completion.bash) - Bash completion,补全 `auto-tmux.sh` 和 `swarm-state.sh` 子命令。
|
||||
- [`safety-check.sh`](./safety-check.sh) - 发送、粘贴或分发前检查危险命令、敏感信息和过大 payload。
|
||||
- [`render-swarm-prompt.sh`](./render-swarm-prompt.sh) - commander、worker、reviewer 提示词渲染。
|
||||
@@ -116,6 +117,7 @@ skills/auto-tmux/scripts/check-jsonl.sh /tmp/ai-swarm-results.jsonl --require-ke
|
||||
# 生成 report pack 审计清单
|
||||
skills/auto-tmux/scripts/review-checklist.sh --pack /tmp/ai-swarm-report-pack --out /tmp/ai-swarm-report-pack/review-checklist.md
|
||||
skills/auto-tmux/scripts/review-checklist.sh --pack /tmp/ai-swarm-report-pack --strict
|
||||
skills/auto-tmux/scripts/verify-report-pack.sh --pack /tmp/ai-swarm-report-pack
|
||||
|
||||
# 启用当前 shell 的补全
|
||||
source skills/auto-tmux/scripts/completion.bash
|
||||
|
||||
@@ -153,7 +153,7 @@ cmd_doctor() {
|
||||
status_line "WARN" "tmux server has no reachable session yet"
|
||||
fi
|
||||
|
||||
for script in auto-tmux.sh swarm-state.sh swarm-brief.sh swarm-watch.sh swarm-archive.sh swarm-board.sh swarm-deps-graph.sh swarm-export.sh swarm-timeline.sh swarm-blockers.sh swarm-results.sh swarm-report-pack.sh swarm-assign.sh swarm-health.sh remote-readonly.sh record-summary.sh check-jsonl.sh review-checklist.sh safety-check.sh render-swarm-prompt.sh swarm-dispatch.sh auto-tmux-smoke-test.sh validate-auto-tmux.sh; do
|
||||
for script in auto-tmux.sh swarm-state.sh swarm-brief.sh swarm-watch.sh swarm-archive.sh swarm-board.sh swarm-deps-graph.sh swarm-export.sh swarm-timeline.sh swarm-blockers.sh swarm-results.sh swarm-report-pack.sh swarm-assign.sh swarm-health.sh remote-readonly.sh record-summary.sh check-jsonl.sh review-checklist.sh verify-report-pack.sh safety-check.sh render-swarm-prompt.sh swarm-dispatch.sh auto-tmux-smoke-test.sh validate-auto-tmux.sh; do
|
||||
if [[ -x "$script_dir/$script" ]]; then
|
||||
status_line "OK" "script executable: $script"
|
||||
else
|
||||
|
||||
@@ -116,6 +116,7 @@ scripts=(
|
||||
"$script_dir/record-summary.sh"
|
||||
"$script_dir/check-jsonl.sh"
|
||||
"$script_dir/review-checklist.sh"
|
||||
"$script_dir/verify-report-pack.sh"
|
||||
"$script_dir/safety-check.sh"
|
||||
"$script_dir/render-swarm-prompt.sh"
|
||||
"$script_dir/swarm-dispatch.sh"
|
||||
@@ -168,10 +169,11 @@ run_gate "swarm-report-pack attachment" bash -c '
|
||||
grep -Fq "\"type\": \"auto-tmux-swarm-report-pack\"" "$tmp/out/manifest.json"
|
||||
grep -Fq "\"attachments\"" "$tmp/out/manifest.json"
|
||||
grep -Fq "remote-tmux.txt" "$tmp/out/attachments/remote/remote-tmux.txt"
|
||||
"$2" --pack "$tmp/out" >/dev/null
|
||||
"$1" --dir "$tmp/swarm" --out "$tmp/out-tar" --attach "$tmp/remote" --tar >/dev/null
|
||||
test -f "$tmp/out-tar.tar.gz"
|
||||
rm -rf "$tmp"
|
||||
' _ "$script_dir/swarm-report-pack.sh"
|
||||
' _ "$script_dir/swarm-report-pack.sh" "$script_dir/verify-report-pack.sh"
|
||||
run_gate "swarm-assign help" "$script_dir/swarm-assign.sh" --help
|
||||
run_gate "swarm-health help" "$script_dir/swarm-health.sh" --help
|
||||
run_gate "remote-readonly help" "$script_dir/remote-readonly.sh" --help
|
||||
@@ -195,6 +197,7 @@ run_gate "review-checklist strict failure" bash -c '
|
||||
grep -Fq "missing required files" /tmp/auto-tmux-review-check.log
|
||||
rm -rf "$tmp" /tmp/auto-tmux-review-check.log
|
||||
' _ "$script_dir/review-checklist.sh"
|
||||
run_gate "verify-report-pack help" "$script_dir/verify-report-pack.sh" --help
|
||||
run_gate "safety-check help" "$script_dir/safety-check.sh" --help
|
||||
run_gate "safety-check clean text" "$script_dir/safety-check.sh" --text "make test"
|
||||
if "$script_dir/safety-check.sh" --text "rm -rf /tmp/example" >/tmp/auto-tmux-validate-gate.log 2>&1; then
|
||||
@@ -222,6 +225,7 @@ require_contains "$skill_dir/SKILL.md" "scripts/remote-readonly.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/record-summary.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/check-jsonl.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/review-checklist.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/verify-report-pack.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/completion.bash"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/safety-check.sh"
|
||||
require_contains "$skill_dir/SKILL.md" "scripts/swarm-dispatch.sh"
|
||||
@@ -256,6 +260,7 @@ require_contains "$script_dir/README.md" "metadata.jsonl"
|
||||
require_contains "$script_dir/README.md" "record-summary.sh"
|
||||
require_contains "$script_dir/README.md" "check-jsonl.sh"
|
||||
require_contains "$script_dir/README.md" "review-checklist.sh"
|
||||
require_contains "$script_dir/README.md" "verify-report-pack.sh"
|
||||
require_contains "$script_dir/README.md" "completion.bash"
|
||||
require_contains "$script_dir/README.md" "safety-check.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "validate-auto-tmux.sh"
|
||||
@@ -275,6 +280,7 @@ require_contains "$script_dir/AGENTS.md" "remote-readonly.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "record-summary.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "check-jsonl.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "review-checklist.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "verify-report-pack.sh"
|
||||
require_contains "$script_dir/AGENTS.md" "completion.bash"
|
||||
require_contains "$script_dir/AGENTS.md" "safety-check.sh"
|
||||
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# verify-report-pack: verify an auto-tmux report pack with local gates.
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
verify-report-pack: verify an auto-tmux report pack
|
||||
|
||||
Usage:
|
||||
verify-report-pack.sh --pack DIR
|
||||
|
||||
Checks:
|
||||
- required report pack files via review-checklist --strict
|
||||
- root manifest type
|
||||
- results.jsonl required fields
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
printf 'error: %s\n' "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
pack_dir=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--pack)
|
||||
pack_dir="${2:-}"
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
die "unknown option: $1"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -n "$pack_dir" ]] || die "missing --pack"
|
||||
[[ -d "$pack_dir" ]] || die "pack dir not found: $pack_dir"
|
||||
|
||||
"$script_dir/review-checklist.sh" --pack "$pack_dir" --strict >/dev/null
|
||||
grep -Fq '"type": "auto-tmux-swarm-report-pack"' "$pack_dir/manifest.json" || die "invalid manifest type"
|
||||
"$script_dir/check-jsonl.sh" "$pack_dir/results.jsonl" --require-key type --require-key id --require-key status >/dev/null
|
||||
|
||||
printf 'report pack ok: %s\n' "$pack_dir"
|
||||
Reference in New Issue
Block a user