Correctness pass done. I looked for SQL built from strings, file paths taken from requests, ignored git and gpg failures, and writes whose failure goes unnoticed.
One real bug, fixed in PR #162: ./v3 purge-history didn't check its journal writes. If the list of refs failed to save (a full disk, say), the purge kept going. A later restore then put back zero refs, deleted the journal and reported success, so every old branch and tag was lost. A failed phase write could also leave an already pruned repository marked as restorable. Both writes now stop the purge, and restore refuses to run on an empty record.
Everything else came back clean:
58 queries put values into SQL text. Every value is a fixed fragment, a placeholder list, an integer or checked against a short allowed list.
Every file read driven by a request is guarded. The source viewer only serves known record paths, image names must be hashes that match the file, and docs downloads refuse ".." and encoded slashes.
Every git and gpg call whose result matters checks the exit code or fails closed.
Details are in the findings file (PR #163).