diff --git a/.claude/skills/wizwar-reports/SKILL.md b/.claude/skills/wizwar-reports/SKILL.md index 0bb606f..295b009 100644 --- a/.claude/skills/wizwar-reports/SKILL.md +++ b/.claude/skills/wizwar-reports/SKILL.md @@ -90,6 +90,14 @@ For each unanswered report, in order: 6. **Report to Eric** when the desk is clear: one line per report — player, room, verdict, and what shipped if anything. +## Eric's local copy + +`bash deploy/pull-feedback.sh` mirrors the reports, the replies, and the +players' screenshots to `~/Desktop/wizwar-reports/` and writes +`reports.md` there, newest first, with each picture linked. Run it at +the end of every desk session so Eric can read the desk without the +droplet. + ## Standing rules - The player's lobby only shows reports for seats their browser still diff --git a/deploy/pull-feedback.sh b/deploy/pull-feedback.sh new file mode 100755 index 0000000..6351bce --- /dev/null +++ b/deploy/pull-feedback.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Mirror the player reports, the desk's replies, and the players' screenshots +# to a local folder, and write a digest beside them for reading. +# deploy/pull-feedback.sh [host] [folder] (default ~/Desktop/wizwar-reports) +set -euo pipefail +HOST="${1:-104.236.96.198}" +OUT="${2:-$HOME/Desktop/wizwar-reports}" +mkdir -p "$OUT/images" +scp -q "root@$HOST:/var/lib/wizwar/feedback.jsonl" "$OUT/feedback.jsonl" +rsync -aq "root@$HOST:/var/lib/wizwar/feedback-images/" "$OUT/images/" 2>/dev/null || true +python3 - "$OUT" <<'PY' +import json, sys, os +out = sys.argv[1] +reports, order = {}, [] +for raw in open(os.path.join(out, "feedback.jsonl"), encoding="utf8"): + raw = raw.strip() + if not raw: continue + line = json.loads(raw) + if "reportId" in line: + r = reports.get(line["reportId"]) + if not r: continue + if "image" in line: r["image"] = line["image"] + else: r.setdefault("replies", []).append(line) + continue + rid = line.get("id") or line.get("at") + reports[rid] = dict(line, replies=[]); order.append(rid) +lines = ["# Wiz-War reports", "", f"{len(order)} reports; newest first. Pictures are in `images/`.", ""] +for rid in reversed(order): + r = reports[rid] + lines.append(f"## {r.get('at','')[:16].replace('T',' ')} — {r.get('player','?')} in {r.get('roomId','?')} (round {r.get('round','?')}, move {r.get('seq','?')}, rev {r.get('deckRev','?')}) — id {rid}") + lines.append("") + lines.append(f"**What happened:** {r.get('happened','').strip()}") + if r.get("expected","").strip(): lines.append(f"**What they expected:** {r['expected'].strip()}") + if r.get("image"): lines.append(f"**Picture:** ![{r['image']}](images/{r['image']})") + for rep in r["replies"]: + lines.append(f"> **{rep.get('status','')}** ({rep.get('at','')[:16].replace('T',' ')}): {rep.get('text','').strip()}") + if not r["replies"]: lines.append("> _unanswered_") + lines.append("") +open(os.path.join(out, "reports.md"), "w", encoding="utf8").write("\n".join(lines)) +print(f"{len(order)} reports, {sum(1 for r in reports.values() if r.get('image'))} with pictures -> {out}/reports.md") +PY