Skip to content

docs: safer-sequences page (the improve path) + post-#50 clarifications - #51

Open
Kiran01bm wants to merge 3 commits into
mainfrom
kiran01bm/safer-sequences-doc
Open

docs: safer-sequences page (the improve path) + post-#50 clarifications#51
Kiran01bm wants to merge 3 commits into
mainfrom
kiran01bm/safer-sequences-doc

Conversation

@Kiran01bm

Copy link
Copy Markdown
Collaborator

Summary

Adds docs/safer-sequences.md — a human-first explanation of the improve path: why the planner's substituted sequence is safer than the submitted form, worked through on ADD CONSTRAINT … UNIQUE — and carries two small follow-up clarifications that missed the #50 merge.

Why

The improve path is the product's headline move, but nothing explains why the substitution is safer — the README demos show it happening, the reference doc has the per-operation matrix, and the contracts carry the machine shape, yet a reader who asks "these two forms end in the same catalog state, so what did I gain?" has no page. The answer (blocking risk traded for leftover-state risk, exclusive locks confined to catalog flips) is the argument that wins an evaluator.

What

  • docs/safer-sequences.md: the worked ADD CONSTRAINT … UNIQUE comparison — one-statement vs two-step across locking, duplicate-failure behavior, transactionality, and cost; what the engine adds over running the idiom by hand (budgets per step, typed verdicts, visible substitution); the substitution families shipped today; the typed caveats and the USING INDEX structural limits.
  • README (Improve paragraph) and docs/README.md index: link the page.
  • Follow-ups that missed the docs: add execution-model page (autocommit-each-step, committed prefix) #50 merge: the committed-prefix section gains a per-step table for the four-step SET NOT NULL sequence (purpose, lock profile, budget class), and both design docs disambiguate needs-rewrite — a PostgreSQL table rewrite (copy-and-swap's job), not a rewording of the submitted SQL.

Before / after

before                                      after
┌───────────────────────────────┐           ┌───────────────────────────────┐
│ "why is the substituted       │           │ README Improve ──▶            │
│  sequence safer?"             │           │   docs/safer-sequences.md     │
│                               │           │   one page:                   │
│ improve.gif shows it happens  │           │   - worked UNIQUE example     │
│ reference doc: per-op matrix  │           │   - same end state, different │
│ suggest-report: JSON caveats  │           │     path (comparison table)   │
│                               │           │   - engine vs by-hand         │
│ no page answers "why safer"   │           │   - substitutions today       │
│                               │           │   - typed caveats + limits    │
└───────────────────────────────┘           └───────────────────────────────┘

The committed-prefix section showed the four-step SET NOT NULL
sequence without saying what the original statement was or why it
decomposes that way — a per-step table now covers purpose, lock
profile, and budget class.

"Needs-rewrite" in both design docs read as if the submitted SQL
needed rewording; it means a PostgreSQL table rewrite (the
copy-and-swap executor's job) — safer-sequence substitution stays
on the native-safe path.
The improve path had no human-first explanation of why the substituted
sequence is safer — the ADD CONSTRAINT UNIQUE two-step is worked
through as the example (same end state, different locking, failure
modes, transactionality, cost), plus what the engine adds over running
the idiom by hand, the substitutions made today, and the typed caveats.
Linked from the README's Improve paragraph and the docs index.
@Kiran01bm
Kiran01bm marked this pull request as ready for review August 20, 2026 08:43
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant