mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-18 21:38:05 +00:00
feat: skills - export auto-tmux results jsonl
This commit is contained in:
@@ -135,6 +135,7 @@ skills/auto-tmux/scripts/swarm-export.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm
|
||||
skills/auto-tmux/scripts/swarm-timeline.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-timeline.md
|
||||
skills/auto-tmux/scripts/swarm-blockers.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-blockers.md
|
||||
skills/auto-tmux/scripts/swarm-results.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-results.md
|
||||
skills/auto-tmux/scripts/swarm-results.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-results.md --jsonl /tmp/ai-swarm-results.jsonl
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --session ai-hub --out /tmp/ai-swarm-report-pack
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-report-pack --attach /tmp/auto-tmux-remote
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-report-pack --tar
|
||||
@@ -292,7 +293,7 @@ skills/auto-tmux/scripts/swarm-dispatch.sh --role worker --target <session>:<win
|
||||
- `scripts/swarm-export.sh`: 导出任务、依赖和锁的 JSONL 状态包
|
||||
- `scripts/swarm-timeline.sh`: 渲染 `status.log` 的 Markdown 时间线
|
||||
- `scripts/swarm-blockers.sh`: 聚合 BLOCKED/FAIL 任务、锁和最近异常状态
|
||||
- `scripts/swarm-results.sh`: 汇总 DONE/FAIL/BLOCKED worker 结果
|
||||
- `scripts/swarm-results.sh`: 汇总 DONE/FAIL/BLOCKED worker 结果,支持 JSONL 导出
|
||||
- `scripts/swarm-report-pack.sh`: 聚合 board、依赖图、时间线、阻塞清单、分配建议、附件、`manifest.json` 和可选 tar.gz
|
||||
- `scripts/swarm-assign.sh`: 根据 ready tasks 和 worker pane 生成只读分配建议
|
||||
- `scripts/swarm-health.sh`: 汇总 tmux 与 swarm state 的只读健康检查报告包
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
| `swarm-export.sh` | 导出 JSONL 状态包 | 只读读取 state,写显式输出目录 |
|
||||
| `swarm-timeline.sh` | 渲染状态日志时间线 | 只读生成 Markdown |
|
||||
| `swarm-blockers.sh` | 聚合阻塞、失败、锁和异常状态 | 只读生成 Markdown |
|
||||
| `swarm-results.sh` | 汇总 DONE/FAIL/BLOCKED worker 结果 | 只读生成 Markdown |
|
||||
| `swarm-results.sh` | 汇总 DONE/FAIL/BLOCKED worker 结果 | 只读生成 Markdown 和 JSONL |
|
||||
| `swarm-report-pack.sh` | 聚合多个只读报告、附件与 JSONL 导出 | 生成 `index.md` 和 `manifest.json` |
|
||||
| `swarm-assign.sh` | 生成 ready task 到 worker pane 的分配建议 | 只读,不 claim,不发送 |
|
||||
| `swarm-health.sh` | 汇总 tmux 与 swarm state 健康报告 | 只读,不自动修复 |
|
||||
@@ -117,6 +117,7 @@ skills/auto-tmux/scripts/swarm-export.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm
|
||||
skills/auto-tmux/scripts/swarm-timeline.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-timeline.md
|
||||
skills/auto-tmux/scripts/swarm-blockers.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-blockers.md
|
||||
skills/auto-tmux/scripts/swarm-results.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-results.md
|
||||
skills/auto-tmux/scripts/swarm-results.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-results.md --jsonl /tmp/ai-swarm-results.jsonl
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --session ai-hub --out /tmp/ai-swarm-report-pack
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-report-pack --attach /tmp/auto-tmux-remote
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-report-pack --tar
|
||||
|
||||
@@ -42,13 +42,14 @@
|
||||
| 34 | `5677df3` | 报告附件索引 | `swarm-report-pack.sh --attach` |
|
||||
| 35 | `7a2ff13` | 报告包 manifest | `swarm-report-pack.sh` 输出根级 `manifest.json` |
|
||||
| 36 | `9eac52f` | 报告包压缩 | `swarm-report-pack.sh --tar` |
|
||||
| 37 | `本轮` | worker 结果收敛 | `swarm-results.sh` |
|
||||
| 37 | `ab6d8f2` | worker 结果收敛 | `swarm-results.sh` |
|
||||
| 38 | `本轮` | 结果摘要导出 | `swarm-results.sh --jsonl` |
|
||||
|
||||
## 后续候选方向
|
||||
|
||||
| 优先级 | 方向 | 说明 |
|
||||
|:---|:---|:---|
|
||||
| P3 | 结果摘要导出 | 为 `swarm-results.sh` 增加 JSONL 导出 |
|
||||
| P3 | 结果摘要校验 | 对 `swarm-results.sh` 输出做 schema-like 字段检查 |
|
||||
|
||||
## 每轮验收清单
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ skills/auto-tmux/scripts/swarm-blockers.sh --dir /tmp/ai_swarm --out /tmp/ai-swa
|
||||
|
||||
# 汇总 worker 结果
|
||||
skills/auto-tmux/scripts/swarm-results.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-results.md
|
||||
skills/auto-tmux/scripts/swarm-results.sh --dir /tmp/ai_swarm --out /tmp/ai-swarm-results.md --jsonl /tmp/ai-swarm-results.jsonl
|
||||
|
||||
# 生成完整报告包
|
||||
skills/auto-tmux/scripts/swarm-report-pack.sh --dir /tmp/ai_swarm --session ai-hub --out /tmp/ai-swarm-report-pack
|
||||
|
||||
@@ -91,7 +91,7 @@ run_report "board" "$script_dir/swarm-board.sh" --dir "$swarm_dir" --out "$out_d
|
||||
run_report "dependency graph" "$script_dir/swarm-deps-graph.sh" --dir "$swarm_dir" --out "$out_dir/deps.md"
|
||||
run_report "timeline" "$script_dir/swarm-timeline.sh" --dir "$swarm_dir" --out "$out_dir/timeline.md"
|
||||
run_report "blockers" "$script_dir/swarm-blockers.sh" --dir "$swarm_dir" --out "$out_dir/blockers.md"
|
||||
run_report "results" "$script_dir/swarm-results.sh" --dir "$swarm_dir" --out "$out_dir/results.md"
|
||||
run_report "results" "$script_dir/swarm-results.sh" --dir "$swarm_dir" --out "$out_dir/results.md" --jsonl "$out_dir/results.jsonl"
|
||||
run_report "export" "$script_dir/swarm-export.sh" --dir "$swarm_dir" --out "$out_dir/export"
|
||||
|
||||
if [[ -n "$session" ]]; then
|
||||
@@ -144,6 +144,7 @@ cat > "$out_dir/manifest.json" <<EOF
|
||||
"timeline.md",
|
||||
"blockers.md",
|
||||
"results.md",
|
||||
"results.jsonl",
|
||||
"assign.md",
|
||||
"export/manifest.json"
|
||||
],
|
||||
@@ -167,6 +168,7 @@ cat > "$out_dir/index.md" <<EOF
|
||||
- [timeline.md](./timeline.md)
|
||||
- [blockers.md](./blockers.md)
|
||||
- [results.md](./results.md)
|
||||
- [results.jsonl](./results.jsonl)
|
||||
- [assign.md](./assign.md)
|
||||
- [manifest.json](./manifest.json)
|
||||
- [export/manifest.json](./export/manifest.json)
|
||||
|
||||
@@ -7,11 +7,12 @@ usage() {
|
||||
swarm-results: summarize DONE/FAIL/BLOCKED worker results
|
||||
|
||||
Usage:
|
||||
swarm-results.sh [--dir DIR] [--out FILE] [--limit N]
|
||||
swarm-results.sh [--dir DIR] [--out FILE] [--jsonl FILE] [--limit N]
|
||||
|
||||
Defaults:
|
||||
--dir AUTO_TMUX_SWARM_DIR or /tmp/ai_swarm
|
||||
--out stdout
|
||||
--jsonl optional JSONL output for terminal results
|
||||
--limit 80 result rows
|
||||
|
||||
This script is read-only. It does not mutate swarm state.
|
||||
@@ -23,8 +24,19 @@ die() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
json_escape() {
|
||||
local value="$1"
|
||||
value="${value//\\/\\\\}"
|
||||
value="${value//\"/\\\"}"
|
||||
value="${value//$'\n'/\\n}"
|
||||
value="${value//$'\r'/\\r}"
|
||||
value="${value//$'\t'/\\t}"
|
||||
printf '%s' "$value"
|
||||
}
|
||||
|
||||
swarm_dir="${AUTO_TMUX_SWARM_DIR:-/tmp/ai_swarm}"
|
||||
out_file=""
|
||||
jsonl_file=""
|
||||
limit=80
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
@@ -37,6 +49,10 @@ while [[ $# -gt 0 ]]; do
|
||||
out_file="${2:-}"
|
||||
shift 2
|
||||
;;
|
||||
--jsonl)
|
||||
jsonl_file="${2:-}"
|
||||
shift 2
|
||||
;;
|
||||
--limit)
|
||||
limit="${2:-}"
|
||||
shift 2
|
||||
@@ -110,6 +126,27 @@ render_results() {
|
||||
fi
|
||||
}
|
||||
|
||||
write_jsonl() {
|
||||
local created_at id status owner text result
|
||||
created_at="$(date -Is)"
|
||||
mkdir -p "$(dirname "$jsonl_file")"
|
||||
while IFS=$'\t' read -r id status owner text result; do
|
||||
[[ "$id" == "id" ]] && continue
|
||||
case "$status" in
|
||||
DONE|FAIL|BLOCKED)
|
||||
printf '{"type":"swarm-result","created_at":"%s","swarm_dir":"%s","id":"%s","status":"%s","owner":"%s","text":"%s","result":"%s"}\n' \
|
||||
"$(json_escape "$created_at")" \
|
||||
"$(json_escape "$swarm_dir")" \
|
||||
"$(json_escape "$id")" \
|
||||
"$(json_escape "$status")" \
|
||||
"$(json_escape "$owner")" \
|
||||
"$(json_escape "$text")" \
|
||||
"$(json_escape "$result")"
|
||||
;;
|
||||
esac
|
||||
done < "$tasks_tsv" > "$jsonl_file"
|
||||
}
|
||||
|
||||
if [[ -n "$out_file" ]]; then
|
||||
mkdir -p "$(dirname "$out_file")"
|
||||
render_results > "$out_file"
|
||||
@@ -117,3 +154,8 @@ if [[ -n "$out_file" ]]; then
|
||||
else
|
||||
render_results
|
||||
fi
|
||||
|
||||
if [[ -n "$jsonl_file" ]]; then
|
||||
write_jsonl
|
||||
printf 'swarm results jsonl written: %s\n' "$jsonl_file"
|
||||
fi
|
||||
|
||||
@@ -139,6 +139,17 @@ run_gate "swarm-export help" "$script_dir/swarm-export.sh" --help
|
||||
run_gate "swarm-timeline help" "$script_dir/swarm-timeline.sh" --help
|
||||
run_gate "swarm-blockers help" "$script_dir/swarm-blockers.sh" --help
|
||||
run_gate "swarm-results help" "$script_dir/swarm-results.sh" --help
|
||||
run_gate "swarm-results jsonl" bash -c '
|
||||
tmp="$(mktemp -d)"
|
||||
mkdir -p "$tmp/swarm/results"
|
||||
printf "id\tstatus\towner\ttext\tresult\n" > "$tmp/swarm/tasks.tsv"
|
||||
printf "t1\tDONE\tai-hub:1.0\tRun tests\tpassed\n" >> "$tmp/swarm/tasks.tsv"
|
||||
printf "passed\n" > "$tmp/swarm/results/t1.txt"
|
||||
"$1" --dir "$tmp/swarm" --out "$tmp/results.md" --jsonl "$tmp/results.jsonl" >/dev/null
|
||||
grep -Fq "t1" "$tmp/results.md"
|
||||
grep -Fq "\"type\":\"swarm-result\"" "$tmp/results.jsonl"
|
||||
rm -rf "$tmp"
|
||||
' _ "$script_dir/swarm-results.sh"
|
||||
run_gate "swarm-report-pack help" "$script_dir/swarm-report-pack.sh" --help
|
||||
run_gate "swarm-report-pack attachment" bash -c '
|
||||
tmp="$(mktemp -d)"
|
||||
@@ -148,6 +159,7 @@ run_gate "swarm-report-pack attachment" bash -c '
|
||||
"$1" --dir "$tmp/swarm" --out "$tmp/out" --attach "$tmp/remote" >/dev/null
|
||||
grep -Fq "attachments.md" "$tmp/out/index.md"
|
||||
grep -Fq "results.md" "$tmp/out/index.md"
|
||||
grep -Fq "results.jsonl" "$tmp/out/index.md"
|
||||
grep -Fq "manifest.json" "$tmp/out/index.md"
|
||||
grep -Fq "\"type\": \"auto-tmux-swarm-report-pack\"" "$tmp/out/manifest.json"
|
||||
grep -Fq "\"attachments\"" "$tmp/out/manifest.json"
|
||||
|
||||
Reference in New Issue
Block a user