-- Bind a research topic to a workspace repo + the on-disk path where -- `start_topic` clones a working copy. Both nullable so pre-existing -- topics don't need backfill and topics without a repo still work. -- -- repo_id — the repo the user picked in the wizard. ON DELETE SET -- NULL so removing the connection doesn't cascade-nuke the topic. -- -- repo_workspace_path — absolute path on the API host where -- `start_topic` executed `git clone --depth 1`. Set once when the -- clone succeeds; a subsequent start can reuse it (skip re-clone). -- Feeds the coordinator prompt so agents know where the files live. ALTER TABLE research_topics ADD COLUMN repo_id UUID REFERENCES repos (id) ON DELETE SET NULL, ADD COLUMN repo_workspace_path TEXT; CREATE INDEX research_topics_repo_idx ON research_topics (repo_id) WHERE repo_id IS NOT NULL;