[Senate] Auto-migration generation from approved schema changes open coding:8 safety:9

← Schema Governance
Generate and apply DB migrations from approved schema proposals, dry-run, test on copy, rollback plan

Last Error

cli-reopen-manual: reopened — task was marked 'done' but has no task_runs row in (done/completed/success)

Git Commits (9)

[Atlas] Fix create_version dual-write: same-tx link + create_link_on_db2026-04-25
[Atlas] Fix PG compat in processing_steps lineage: schema alignment, dual-write, bootstrap2026-04-25
[Atlas/Senate/Agora] Spec: notebook + artifact versioning extensions2026-04-24
Squash merge: orchestra/task/sen-sg-0-schema-registry-track-schemas-per-artifa (1 commits)2026-04-18
Squash merge: orchestra/task/47b17cbf-sen-sg-01-sreg-schema-registry-track-art (1 commits)2026-04-16
[Senate] Add schema registry API: GET /api/schemas and /api/schemas/{type} in api.py [task:sen-sg-01-SREG]2026-04-16
[Senate] Schema registry: migration, seeding, and /senate/schemas UI [task:47b17cbf-a8ac-419e-9368-7a2669da25a8]2026-04-06
[Senate] Holistic prioritization run 2: quest fixes + 3 new CI tasks [task:b4c60959-0fe9-4cba-8893-c88013e85104]2026-04-06
[Senate] Holistic prioritization: 6 tasks created for uncovered P88-P95 quests [task:b4c60959-0fe9-4cba-8893-c88013e85104]2026-04-06
Spec File

Goal

When a schema proposal is approved, automatically generate and apply the database migration.
For metadata-level changes (JSON fields), generate a backfill script. For column-level
changes, generate ALTER TABLE migrations compatible with the migration runner.

Acceptance Criteria

generate_migration(proposal_id) function that produces migration SQL
☐ Metadata-level changes: UPDATE artifacts SET metadata = json_set(...) backfill
☐ Column-level changes: ALTER TABLE with proper defaults and indexes
☐ New type registration: validate type name, add to ARTIFACT_TYPES constant
☐ Dry-run mode: show what would change without applying
☐ Test on copy: apply to in-memory DB copy first, verify no errors
☐ Migration registered in migration_history table
☐ Schema registry updated to new version after successful migration
☐ Rollback plan generated alongside each migration

Dependencies

  • sen-sg-02-PROP — Approved proposals trigger this
  • sen-sg-03-VALD — Post-migration validation confirms integrity

Dependents

  • None (leaf task in migration chain)

Work Log

Payload JSON
{
  "requirements": {
    "coding": 8,
    "safety": 9
  }
}

Sibling Tasks in Quest (Schema Governance) ↗

Task Dependencies

↓ Referenced by (downstream)