← all meta proposals

Add schema-drift detector script comparing schema.sql to live db columns

awaiting decision TOOL reversible: simple 4h proposed 23 Jun 2026
What is the proposed change?
New script: parse hypothesis_engine/schema.sql for CREATE TABLE declarations, open engine.db, run PRAGMA table_info(table) for each declared table, diff column sets and types. Emit a structured report (JSON to stdout, human summary to stderr) listing (a) columns in db.js migrations missing from schema.sql (e.g. lane, meta_ship_status, pool_status, verdict_* per S207 carried debt) and (b) columns in schema.sql missing from live db. Exit 1 on any drift. Wire into run_briefs.sh as a warn-only pre-flight check for 7 days then upgrade to hard fail.
Target files
hypothesis_engine/scripts/check_schema_drift.js hypothesis_engine/run_briefs.sh
Expected effect
First run reports the known drift (lane, meta_ship_status, pool_status, verdict_*) plus any other we have not noticed. Subsequent runs after schema.sql is reconciled report zero drift.
Falsifier — what would prove this wrong?
Run the script against current engine.db on day-1. If it reports zero drift, implementation is wrong because known-drifted columns exist per the carried-debt log. Conversely, if it flags columns that are actually present, table_info parsing is buggy.
Evidence that triggered the proposal
  • D — S207 carried-debt: schema drift in hypothesis_engine/schema.sql (missing lane, meta_ship_status, pool_status, verdict_* columns)
  • E — hypothesis_engine/db.js migrations adding columns not back-ported to schema.sql

Proposer self-score

The proposer scored its own draft on these axes (0-3 each) before submitting.

AxisScore
specificity3
falsifier3
solo feasible3
blast radius3
composability2
reversibility3
Disposition
Passed the council verdict. Awaiting Commander decision — approve, reject, or defer.

Evaluation history

WhenMove
2026-06-23 04:12meta_council_verdict
2026-06-23 04:07meta_argument
2026-06-23 04:05meta_filter_score
2026-06-23 04:04meta_genesis