Files
felhom.eu/documentation/audits/night-2026-09-23/r612.py
T
admin 0030cbd1de
gates / gates (push) Successful in 26s
night 2026-09-23: evidence so far (Parts A, B, C in progress)
The records the catalog's ladder entries cite (apps/<app>/bench and
apps/<app>/verdict.json), the drill tools, the spike, R-626's run,
R-612/R-613 red-proofs, the chaos schedule (seed 20260923) drawn
BEFORE round 1. Docs and register follow at the end of the night.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-09-23 21:33:54 +02:00

50 lines
2.8 KiB
Python

#!/usr/bin/env python3
"""R-612 red-proof on 9202, through the product. argv[1] = before|after.
before: the drill template as live (128M). after: the drill template at 512M (the fix).
Observables: the controller's state; the container's own log (seed Killed / executed); a sign-up
through the app's own front door, and what the household is told."""
import sys, re, json, time, fcntl, subprocess
sys.path.insert(0, ".")
import walk as w
mode = sys.argv[1]
APP, SUB = "wishlist", "wishlist"
if mode == "after":
with open(f"{w.SC}/drill.lock", "w") as lk:
fcntl.flock(lk, fcntl.LOCK_EX)
w.sh(["git", "-C", w.DRILL, "pull", "-q", "--rebase", "origin", "main"], timeout=120)
p = f"{w.DRILL}/templates/wishlist/docker-compose.yml"
s = open(p).read().replace("memory: 128M", "memory: 512M"); open(p, "w").write(s)
w.sh(["git", "-C", w.DRILL, "commit", "-qam", "DRILL R-612: wishlist 512M"])
w.sh(["git", "-C", w.DRILL, "push", "-q", "origin", "main"], timeout=120)
w.login()
w.sync_rescan()
w.deploy(APP, SUB)
time.sleep(60)
st = w.stack(APP)
w.say(f"[{mode}] controller: deployed={st.get('deployed')} state={st.get('state')}")
logs = w.app_logs(APP, 200)
seed = [l for l in logs.splitlines() if re.search(r"seed|Killed|roles are|default group", l)]
w.say(f"[{mode}] container log, seed lines: {seed}")
lim = w.guest("docker inspect wishlist -f '{{.HostConfig.Memory}}'").strip()
w.say(f"[{mode}] memory limit on the container: {lim}")
# sign-up through the front door: GET the page, POST the form the page renders
rc, code, page = w.app_curl(SUB, "/signup")
names = sorted(set(re.findall(r'name="([a-zA-Z_]+)"', page)))
w.say(f"[{mode}] GET /signup -> {code}; form fields {names}")
import secrets
u = "drill" + secrets.token_hex(3)
form = f"name=Drill&username={u}&email={u}%40example.invalid&password=Drill-{secrets.token_hex(8)}&tokenId="
rc, code, body = w.app_curl(SUB, "/signup", "-H", "Content-Type: application/x-www-form-urlencoded",
"-H", "Origin: https://wishlist." + w.DOMAIN, "-H", "x-sveltekit-action: true",
method="POST", data=form)
w.say(f"[{mode}] POST /signup -> {code}: {body[:300]}")
told = "already exists" in body
w.say(f"[{mode}] household told 'already exists': {told}")
cl = w.guest("docker logs wishlist 2>&1 | grep -iE 'foreign key|constraint' | tail -3")
w.say(f"[{mode}] container log after sign-up: {cl.strip()!r}")
json.dump({"mode": mode, "state": st.get("state"), "seed_lines": seed, "limit": lim, "signup_http": code,
"signup_body": body[:500], "told_already_exists": told, "fk_log": cl.strip()},
open(f"apps/wishlist/r612-{mode}.json", "w"), indent=2, ensure_ascii=False)
w.remove(APP)
open(f"apps/wishlist/r612-{mode}.log", "w").write("\n".join(w.LOG) + "\n")