diff --git a/skills/auto-tmux/SKILL.md b/skills/auto-tmux/SKILL.md index 7113b2f..0cc4b06 100644 --- a/skills/auto-tmux/SKILL.md +++ b/skills/auto-tmux/SKILL.md @@ -174,6 +174,7 @@ skills/auto-tmux/scripts/auto-tmux.sh record stop -t :. skills/auto-tmux/scripts/record-summary.sh --dir /tmp/auto-tmux-records --out /tmp/auto-tmux-record-summary.md skills/auto-tmux/scripts/check-jsonl.sh /tmp/ai-swarm-results.jsonl --require-key type --require-key id --require-key status 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 ``` **等待 pane 出现完成信号** diff --git a/skills/auto-tmux/references/automation.md b/skills/auto-tmux/references/automation.md index 11504b8..5869d18 100644 --- a/skills/auto-tmux/references/automation.md +++ b/skills/auto-tmux/references/automation.md @@ -201,6 +201,7 @@ skills/auto-tmux/scripts/auto-tmux.sh record stop -t "$target" skills/auto-tmux/scripts/record-summary.sh --dir /tmp/auto-tmux-records --out /tmp/auto-tmux-record-summary.md skills/auto-tmux/scripts/check-jsonl.sh /tmp/ai-swarm-results.jsonl --require-key type --require-key id --require-key status 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 ``` ## AI 蜂群协作建议 diff --git a/skills/auto-tmux/references/iteration-roadmap.md b/skills/auto-tmux/references/iteration-roadmap.md index 3d99e07..93716d6 100644 --- a/skills/auto-tmux/references/iteration-roadmap.md +++ b/skills/auto-tmux/references/iteration-roadmap.md @@ -46,13 +46,14 @@ | 38 | `3b10fb6` | 结果摘要导出 | `swarm-results.sh --jsonl` | | 39 | `842cd2d` | JSONL 字段门禁 | `check-jsonl.sh` | | 40 | `2824c06` | JSONL 格式治理 | `jsonl-schema.md` | -| 41 | `本轮` | 交付包审计清单 | `review-checklist.sh` | +| 41 | `a74be2c` | 交付包审计清单 | `review-checklist.sh` | +| 42 | `本轮` | 审计清单结果门禁 | `review-checklist.sh --strict` | ## 后续候选方向 | 优先级 | 方向 | 说明 | |:---|:---|:---| -| P3 | 审计清单结果门禁 | 检查 report pack 必需文件缺失时输出 WARN/FAIL 摘要 | +| P3 | report pack 自检命令 | 为报告包新增一条统一 verify 命令 | ## 每轮验收清单 diff --git a/skills/auto-tmux/scripts/README.md b/skills/auto-tmux/scripts/README.md index 672307c..bc93c49 100644 --- a/skills/auto-tmux/scripts/README.md +++ b/skills/auto-tmux/scripts/README.md @@ -115,6 +115,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 # 启用当前 shell 的补全 source skills/auto-tmux/scripts/completion.bash diff --git a/skills/auto-tmux/scripts/review-checklist.sh b/skills/auto-tmux/scripts/review-checklist.sh index 9312678..efa6e3b 100755 --- a/skills/auto-tmux/scripts/review-checklist.sh +++ b/skills/auto-tmux/scripts/review-checklist.sh @@ -7,12 +7,13 @@ usage() { review-checklist: render a reviewer checklist for an auto-tmux report pack Usage: - review-checklist.sh --pack DIR [--out FILE] + review-checklist.sh --pack DIR [--out FILE] [--strict] Defaults: --out stdout This script is read-only for the report pack. It writes only when --out is set. +Use --strict to fail when required files are missing. EOF } @@ -23,6 +24,9 @@ die() { pack_dir="" out_file="" +strict="0" +missing_count=0 +required_files=(index.md manifest.json board.md deps.md timeline.md blockers.md results.md results.jsonl assign.md export/manifest.json) while [[ $# -gt 0 ]]; do case "$1" in @@ -34,6 +38,10 @@ while [[ $# -gt 0 ]]; do out_file="${2:-}" shift 2 ;; + --strict) + strict="1" + shift + ;; -h|--help) usage exit 0 @@ -56,6 +64,14 @@ exists_mark() { fi } +count_missing() { + local file + missing_count=0 + for file in "${required_files[@]}"; do + [[ -e "$pack_dir/$file" ]] || missing_count=$((missing_count + 1)) + done +} + render_checklist() { printf '# auto-tmux Report Review Checklist\n\n' printf -- '- pack_dir: `%s`\n' "$pack_dir" @@ -63,10 +79,13 @@ render_checklist() { printf '## Required Files\n\n' local file - for file in index.md manifest.json board.md deps.md timeline.md blockers.md results.md results.jsonl assign.md export/manifest.json; do + for file in "${required_files[@]}"; do printf -- '- [%s] `%s`\n' "$(exists_mark "$file")" "$file" done + printf '\n## Strict Summary\n\n' + printf -- '- missing_required_files: `%s`\n' "$missing_count" + printf '\n## Review Gates\n\n' printf -- '- [ ] `manifest.json` type is `auto-tmux-swarm-report-pack`.\n' printf -- '- [ ] `results.md` clearly lists DONE/FAIL/BLOCKED worker outcomes.\n' @@ -82,6 +101,8 @@ render_checklist() { printf '```\n' } +count_missing + if [[ -n "$out_file" ]]; then mkdir -p "$(dirname "$out_file")" render_checklist > "$out_file" @@ -89,3 +110,7 @@ if [[ -n "$out_file" ]]; then else render_checklist fi + +if [[ "$strict" == "1" && "$missing_count" -gt 0 ]]; then + die "strict review failed: missing required files=$missing_count" +fi diff --git a/skills/auto-tmux/scripts/swarm-report-pack.sh b/skills/auto-tmux/scripts/swarm-report-pack.sh index bdd4dfb..04b2a7f 100755 --- a/skills/auto-tmux/scripts/swarm-report-pack.sh +++ b/skills/auto-tmux/scripts/swarm-report-pack.sh @@ -177,7 +177,7 @@ cat > "$out_dir/index.md" </tmp/auto-tmux-review-check.log 2>&1; then + rm -rf "$tmp" + exit 1 + fi + 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 "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