-- Slice 9 cleanup: retire the legacy research/loops surface. -- -- The missions arc (Slices 1–9) fully replaced these tables. The -- one-time backfill in 0047 copied every row into missions; no new -- writes have hit these tables since the UI cutover in 4663348. -- -- Drop order matters: children first, then parents. `research_topics` -- has children `research_topic_agents`, `research_outcomes`, -- `research_publish_approvals`. `loops` has children `loop_agents`, -- `loop_orgs`, `loop_teams`. -- -- topology_runs.research_topic_id / .loop_id / .iteration go too — -- Slice 5 added mission_id + mission_phase_id which now own -- attribution. `parent_run_id` (also from 0031) stays; recursive_exec -- still uses it. BEGIN; ALTER TABLE topology_runs DROP COLUMN IF EXISTS research_topic_id, DROP COLUMN IF EXISTS loop_id, DROP COLUMN IF EXISTS iteration; -- Loop-side children. DROP TABLE IF EXISTS loop_agents; DROP TABLE IF EXISTS loop_orgs; DROP TABLE IF EXISTS loop_teams; -- Research-side children. DROP TABLE IF EXISTS research_publish_approvals; DROP TABLE IF EXISTS research_outcomes; DROP TABLE IF EXISTS research_topic_agents; -- Parents. DROP TABLE IF EXISTS loops; DROP TABLE IF EXISTS research_topics; COMMIT;