deploy/pull-feedback.sh mirrors reports, replies, and screenshots to the Desktop with a digest
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
071e7ce988
commit
ffbca5bfb9
@@ -90,6 +90,14 @@ For each unanswered report, in order:
|
|||||||
6. **Report to Eric** when the desk is clear: one line per report —
|
6. **Report to Eric** when the desk is clear: one line per report —
|
||||||
player, room, verdict, and what shipped if anything.
|
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
|
## Standing rules
|
||||||
|
|
||||||
- The player's lobby only shows reports for seats their browser still
|
- The player's lobby only shows reports for seats their browser still
|
||||||
|
|||||||
Executable
+41
@@ -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
|
||||||
Reference in New Issue
Block a user