docs: fixes and refresh architecture map - #47
Merged
Conversation
New-user-facing walkthrough in architecture.md: why execute-and-introspect beats reimplementing PostgreSQL's DDL semantics in Go, and the steps a declarative diff actually takes (parse, scratch schema, execute, introspect, roll back, diff model-vs-model, re-enter parse -> classify). Also corrects the pipeline diagram: diff output chains back through the parse boundary before classification (diffplan canonicalizes and classifies via pkg/statement), rather than feeding classify directly. Adds a table of contents matching the house style of the other design docs.
New-user-facing walkthrough in architecture.md: why execute-and-introspect beats reimplementing PostgreSQL's DDL semantics in Go, and the steps a declarative diff actually takes (parse, scratch schema, execute, introspect, roll back, diff model-vs-model, re-enter parse -> classify). Also corrects the pipeline diagram: diff output chains back through the parse boundary before classification (diffplan canonicalizes and classifies via pkg/statement), rather than feeding classify directly. Adds a table of contents, a per-stage "Live DB?" column noting only Introspect needs a connection, and refreshes the package map (suggest command and pkg/suggest, preflight's privilege and partition gates).
Kiran01bm
marked this pull request as ready for review
August 19, 2026 07:02
Kiran01bm
requested review from
JashLal,
aparajon,
eeSeeGee,
jayjanssen,
jemiahw and
morgo
as code owners
August 19, 2026 07:02
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
aparajon
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new-user pass over
docs/architecture.md: adds a "Why introspect?" section explaining why pg-sprite derives schema models by execute-and-introspect rather than by transforming parsed DDL into an in-memory model, and brings the surrounding sections (pipeline diagram, stage table, package map) up to date with the code.What
difftakes — parse for admission, scratch schema in a transaction, execute the desired DDL, introspect the catalogs, roll back, model-vs-model diff, re-enter parse → classify → lint. Closes with the honest limit (an empty scratch table says nothing about rewrite/lock cost, so the classifier still predicts) and links the recorded decision inlow-level-design.md.lint/suggest/fmtrun fully offline;diff/dry-runconnect for facts;migratefor facts and execution).pkg/suggest, lists thesuggestcommand, and replacespkg/preflight's stale phase note with the gates that exist today (size guard, tiered privilege checks, partition support).Why
The INTROSPECT box in the pipeline diagram and the one-line rationale in the stage table state what happens but not why the alternative loses. New readers coming from tools that do AST-based diffing keep asking this; the answer deserves a scannable, step-by-step home in the architecture doc. Whether a command needs a live connection is the first practical question a new user hits, and the package map had fallen behind the code.