Files
Eric WagonerandClaude Fable 5.1 8eca078043 The reports desk: a slip for surprises, replies in the hall
A Report button in a room's masthead files what happened and what was
expected, with a screenshot if there is one, pinned to the room and the
turn and rung through Sentry. Reports and the keeper's replies live in
feedback.jsonl beside the ledgers; the hall shows each seat's reports
with the thread under them and a line to answer. pull-reports.sh mirrors
the desk locally, report-reply.sh answers, and a skill works the desk.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141G6xqLeNRYEtviLWSB5Up
2026-09-23 10:12:51 -04:00

16 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Answer a player's report; the reply appears under it in their hall.
# deploy/report-reply.sh <host> <reportId> <resolved|by-design|open> <text...>
set -euo pipefail
HOST="${1:?usage: report-reply.sh <host> <reportId> <status> <text...>}"
REPORT_ID="${2:?usage: report-reply.sh <host> <reportId> <status> <text...>}"
STATUS="${3:?usage: report-reply.sh <host> <reportId> <status> <text...>}"
shift 3
TEXT="$*"
case "$STATUS" in resolved|by-design|open) ;; *) echo "status must be resolved, by-design, or open" >&2; exit 1;; esac
case "$REPORT_ID" in *[!0-9a-f]*|"") echo "a report id is eight hex characters" >&2; exit 1;; esac
LINE=$(REPORT_ID="$REPORT_ID" STATUS="$STATUS" TEXT="$TEXT" python3 -c '
import json, os, datetime
print(json.dumps({"reportId": os.environ["REPORT_ID"], "at": datetime.datetime.now(datetime.timezone.utc).isoformat().replace("+00:00", "Z"), "status": os.environ["STATUS"], "text": os.environ["TEXT"]}))')
printf '%s\n' "$LINE" | ssh "root@$HOST" 'cat >> /var/lib/waving-hands/feedback.jsonl && chown waving-hands:waving-hands /var/lib/waving-hands/feedback.jsonl && tail -1 /var/lib/waving-hands/feedback.jsonl'