Skip to content

feat(gate): DB boundary oracle — assert the plan's columns physically exist after db:push (P0b) - #206

Merged
agjs merged 1 commit into
mainfrom
fix/db-boundary-oracle
Jul 27, 2026
Merged

feat(gate): DB boundary oracle — assert the plan's columns physically exist after db:push (P0b)#206
agjs merged 1 commit into
mainfrom
fix/db-boundary-oracle

Conversation

@agjs

@agjs agjs commented Jul 27, 2026

Copy link
Copy Markdown
Owner

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:push proves 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. 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.

Contract (panel-adjudicated):

  • Expected columns 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 type families too coarse); name matching camel/snake-tolerant (userIduser_id). belongs to User → the existing user_id.
  • Inconclusive reads never block — a read failure right after a successful push is transient infra; final acceptance is the backstop. Only a successful read with a missing plan column reds. Table name identifier-guarded.
  • Wired into boringstackCommandStage after the db:push success check; surfaces a db-schema-mismatch error pointing at app.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 urldb-schema-mismatch) + live integration against valbuild27's Postgres (real bookmark{title,url} passes; expecting a missing column reds). Full suite 3149/0; typecheck + lint clean. Additive/gate-preserving.

… 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.
@agjs
agjs merged commit 691b202 into main Jul 27, 2026
8 checks passed
@agjs
agjs deleted the fix/db-boundary-oracle branch July 27, 2026 17:26
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