research: extract setup helpers into research_setup.rs (fixes file-size gate)
research.rs hit 1446 lines with the wizard-fold + regression-fix
commits, tripping the CI file-size gate (limit 1250). Pure extraction
into a sibling module; no behavior change.
Moved to routes/research_setup.rs:
- RepoContext (now pub — used by build_coordinator_task)
- TopicSchedule (now pub — request body sub-struct)
- research_workspace_root (now pub)
- prepare_topic_runtime (already pub — used by loops iteration path)
- ensure_repo_workspace (now pub — used by start_topic + prepare)
- materialize_topic_loops (now pub — used by create_topic)
research.rs re-imports them via `use crate::routes::research_setup::{...}`
so the calling code reads identically.
New line counts:
research.rs 1127 lines (was 1446, limit 1250)
research_setup.rs 321 lines (new)
Also updated the loop-iteration callsite in routes/loops.rs to point
at the new path (crate::routes::research_setup::prepare_topic_runtime).
No API changes; migrations unaffected.
This commit is contained in:
@@ -90,7 +90,7 @@ pub async fn compose_and_enqueue_iteration(
|
||||
// repo files + an isolated daemon to hit. Idempotent — the
|
||||
// second iteration reattaches to the existing container. Runs
|
||||
// even when the topic has no repo (harmless no-op).
|
||||
crate::routes::research::prepare_topic_runtime(pool, workspace_id, topic_id).await;
|
||||
crate::routes::research_setup::prepare_topic_runtime(pool, workspace_id, topic_id).await;
|
||||
let task = compose_research_iteration_task(pool, topic_id, template_ref).await;
|
||||
cm_db::repo::loops::enqueue_iteration_with_topic(
|
||||
pool,
|
||||
|
||||
Reference in New Issue
Block a user