send-post: take reviewed_by from the post file's top-level sign-off

An unsigned file (empty or the <please sign...> placeholder) is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 5457@bnt-lap001
Assistant-Session: 792bf84a-3783-4f5d-a811-cded61dd2012
This commit is contained in:
tegwick 2026-10-08 10:33:31 +02:00
parent 91c1155461
commit 122bee140a

View file

@ -32,9 +32,9 @@ export GOCACHE=${GOCACHE:-$realhome/.cache/go-build}
read -r want reviewed < <(python3 -c '
import sys, yaml
d = yaml.safe_load(open(sys.argv[1]))
print(d["channel"], d["request"].get("reviewed_by") or "-")' "$post")
[ "$want" = "$channel" ] || { echo "post is for channel '$want', not '$channel'" >&2; exit 2; }
[ "$reviewed" != "-" ] || { echo "request.reviewed_by is empty; a person reviews before sending" >&2; exit 2; }
r = str(d.get("reviewed_by") or "").strip()
print(d["channel"], r if r and not r.startswith("<") else "-")' "$post")
[ "$reviewed" != "-" ] || { echo "reviewed_by is not signed; a person reviews and signs before sending" >&2; exit 2; }
TELEGRAM_CHANNEL_ID=$(go run ./cmd/provision adapter-config --spec "$spec" --channel "$channel" \
| sed -n 's/^TELEGRAM_CHANNEL_ID=//p')
@ -56,6 +56,7 @@ import json, os, subprocess, sys, yaml
post, channel, tmp, hall, forge = sys.argv[1:]
d = yaml.safe_load(open(post))
req = d["request"]
req["reviewed_by"] = str(d["reviewed_by"]).strip() # the file's sign-off is the review
if not req.get("visual_url"):
cmd = [f"{tmp}/compose", "visual", "--hall-dir", hall,
"--hall-raw-base", f"{forge}/hall-of-helix/raw/branch/main",