docs+lint: safer forms are not semantic equivalents - #13
Conversation
CREATE INDEX and CREATE INDEX CONCURRENTLY converge on the same declared end state but differ operationally: locking, transactionality, and failure modes (a failed CONCURRENTLY build leaves an INVALID index the executor must detect via pg_index.indisvalid and recover). Reword docs, API comments, and CLI output so recommendations read as advisory safer forms the engine owns executing, never as equivalents or instructions to run manually.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Review requested by Armand and performed by his agent — same two lenses used across this stack (#8, #9, #7, #2): pg-sprite as an OSS-first, best-in-class Postgres DDL tool, and pg-sprite as a clean integration target for an orchestrator. Reviewed at head This is a small PR making a distinction that most tools in this space never make at all, and it's the right one. "Converges on the same declared end state" and "is a semantic equivalent" are genuinely different claims, and collapsing them is how operators end up pasting a OSS lens
Integration lens
Verified solidThe sweep is thorough on the surfaces it targeted: I grepped the tree at this head and the remaining uses of "equivalent" are all either the new deliberate ones ("is not a semantic equivalent") or unrelated senses ("the PostgreSQL equivalent of MySQL's InnoDB Online DDL reference", "the equivalent of Spirit's TiDB parser"). This review was generated by Claude Code (claude-fable-5). |
|
🤖 Adversarial correctness review requested by Armand and performed by his agent — separate from the two-lens pass. Reviewed at head Findings, most severe first1. The JSON surfaces still hand out the sequence with none of the caveat. 2. Both new output strings cite a path that isn't present in an installed build. 3. // SaferSQL is the ordered native sequence to run instead of the
// submitted form, present only for safer-idiom decisions where the
// planner could construct it. It is a safer form, not a semantic
// equivalent: …The first sentence still says the thing the PR is removing everywhere else, and it's the definition a consumer reads first. Cosmetic, but it's the field the whole sweep is about. 4. The advice has no addressee while the executor doesn't exist. "Running it by hand forgoes the engine's execution-time guards (invalid-index detection after a concurrent build)" is true and useful — but at this head there is no executor, so an operator acting on a Probed and heldThe sweep is genuinely complete on the surfaces it aimed at: grepping the tree at this head, every remaining "equivalent" is either one of the new deliberate uses or an unrelated sense ( This review was generated by Claude Code (claude-fable-5). Findings are static analysis of the tree at this head; no runtime behavior changed in this PR. |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on Armand's behalf. My two-lens review and adversarial correctness pass are posted above — the findings there are for follow-up, not fix-before-merge blockers.
This approval was submitted by Claude Code (claude-fable-5) at Armand's direction.
Summary
CREATE INDEXandCREATE INDEX CONCURRENTLYconverge on the same declared end state butare not semantic equivalents — different locking, transactionality, and failure modes.
This PR sweeps docs, API comments, and CLI output so every safer-rewrite recommendation
reads as an advisory safer form the engine owns executing, never as an equivalent or an
instruction to run manually. No behavior change.
What
docs/design-principles.md,docs/high-level-design.md,docs/low-level-design.md:replace "native equivalent" / "safer equivalent" with "safer native form" and state the
operational differences (a failed
CONCURRENTLYbuild leaves anINVALIDindex theexecutor must detect via
pg_index.indisvalidand recover); the HLD advisory diagram nowsays
safer form:instead ofrun instead:.pkg/planner(Decision.SaferSQL) andpkg/lint(CodeBlockingIdiom,Finding.Suggestion) doc comments carry the same caveat.lintprintssafer form (not equivalent — see docs/postgres-online-ddl-reference.md);diffdry-run printssafer form the engine would run (not equivalent — …)instead ofthe engine would run instead:.Why
A recommendation that prints "run instead: CREATE INDEX CONCURRENTLY …" invites an operator
to paste it into
psql— bypassing the engine's execution-time guards (invalid-indexdetection and recovery) while implying identical semantics. The distinction is declarative
vs. operational: from a desired-state diff standpoint the end state is identical
(
CONCURRENTLYis not catalog state), but the execution paths fail differently, and onlythe engine owns the recovery. Wording everywhere now matches the execution-safety model in
docs/postgres-online-ddl-reference.md.