adversarial-reviewlisted
Install: claude install-skill ysys143/pg-extension-lab
# Adversarial Review (PostgreSQL extension edition)
**Thesis.** A review that shares the author's mental model only finds bugs the author could
also have found. To find the rest, stop checking whether the change is consistent with what the
PR *claims*, and instead compute the **difference** between:
- the model the author **stated** (PR body, header comments, docs, "verified" claims), and
- the model that is actually **enforced** by (1) the C/Rust as written, (2) every sibling
implementation and the in-tree Postgres precedent, (3) the full contract the Postgres backend
imposes (MVCC, memory contexts, locking, error handling, ABI), (4) the downstream consumers
— the planner, the executor, the SQL-level API, other extensions.
Every probe below is that diff applied to one surface. The more rigorous and self-critical the
PR looks, the more the rigor is camouflage — "looks thorough" is not "is complete".
## Operating rules (do these, in order)
1. **Never quote the PR's stated resolution/precedence order.** Re-derive it from source. If
the PR says a setting comes from a GUC, grep the actual resolver: is it
`GUC > reloption > compile-time default`, and does `_PG_init` register it before anything
reads it? The same rule applies to hook chains, cost-estimate paths, and version gates.
2. **For any "Postgres rejects X" or "this state cannot happen" gate, pull the FULL set** the
backend enforces and diff it against what the code checks. Typical under-enumerations: