feat(gate): DB boundary oracle — assert the plan's columns physically exist after db:push (P0b) - #206
Merged
Merged
Conversation
… exist after db:push (P0b) Observable-gates plan P0b (4-model panel, unanimous #1 control). A green db:push proves the command RAN, not that Postgres holds the plan's schema (#200/#204: a swallowed crash exits 0, the DB never migrates, every runtime query 500s while the gate false-greens). New db-oracle.ts queries information_schema after a successful push and asserts the plan's columns are physically present — the observable end state, not the migration's story. - Expected columns derived from the PLAN (IEntityAcceptance.fields, which already includes parent-FK fields) + the scaffold set {id,user_id,created_at,updated_at}; NEVER from the model's schema file. - SUBSET-presence (never fail on extras); PRESENCE only (SQL types too coarse); name matching camel/snake-tolerant (Drizzle emits user_id; domain cols keep the field name). belongs-to-User → the existing user_id. - INCONCLUSIVE reads (DB unreachable/query error) NEVER block — a read failure right after a successful push is transient infra, and final acceptance is the backstop; only a successful read with a missing plan column reds. Identifier-guarded table. - Wired into boringstackCommandStage after the db:push success check; surfaces a db-schema-mismatch gate error pointing at app.schema.ts (short-circuits before the gate runs on a stale schema). Proven: 8 oracle unit tests (subset, camel/snake, inconclusive-non-blocking, unsafe table, missing-column) + a command-stage wiring test (push exit-0 + missing url → db-schema-mismatch) + LIVE integration against valbuild27's Postgres (real bookmark{title,url} passes; expecting a missing column reds). Full suite 3149/0.
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.
Observable-gates plan, P0b — the panel's unanimous #1 control (2-round consultation). Second in the false-green-hardening series after #205 (P0a).
A green
db:pushproves the command ran, not that Postgres holds the plan's schema. That gap is the #200/#204 class: a swallowed crash exits 0, the DB never migrates, every runtime query 500s (column "…" does not exist) while the gate false-greens. Newdb-oracle.tsqueriesinformation_schemaafter a successful push and asserts the plan's columns are physically present — the observable end state, not the migration's story.Contract (panel-adjudicated):
IEntityAcceptance.fields, which already includes parent-FK fields) + the scaffold set{id,user_id,created_at,updated_at}— never from the model's schema file.userId≡user_id).belongs to User→ the existinguser_id.boringstackCommandStageafter the db:push success check; surfaces adb-schema-mismatcherror pointing atapp.schema.ts, short-circuiting before the gate runs on a stale schema.Proven: 8 oracle unit tests (subset, camel/snake, inconclusive-non-blocking, unsafe-table, missing-column) + a command-stage wiring test (push exit-0 + missing
url→db-schema-mismatch) + live integration against valbuild27's Postgres (realbookmark{title,url}passes; expecting a missing column reds). Full suite 3149/0; typecheck + lint clean. Additive/gate-preserving.