clippy: struct-bundle enqueue_iteration_with_topic + fix doc list warnings
ci / gates (push) Successful in 6s
ci / frontend (push) Successful in 40s
ci / rust (push) Successful in 3m58s
ci / e2e (push) Has been skipped
ci / publish (push) Successful in 4m12s

CI's clippy stage failed with -D warnings on three classes of lint:

1. map_clone in loops::recent_reorders — .map(|a| a.clone()) is the
   pattern clippy wants replaced by .cloned(). Trivial swap.

2. too_many_arguments on enqueue_iteration_with_topic (8 args, ceiling
   7). Refactored the caller-side surface into a new
   IterationEnqueue<'a> struct with fields for each column. Matches
   the pattern research::NewTopic + loops::NewLoop already use for
   the same clippy ceiling. Callers in loops.rs (routes) + the
   enqueue_iteration wrapper updated to build the struct literal.

3. doc_lazy_continuation + doc_list_indentation — two doc comment
   blocks used ambiguous list-like layouts:
   - compose_iteration_task's ASCII-art prepended-block preview:
     wrapped in a ```text fence so clippy stops parsing "RESEARCH
     ARTIFACT:" etc as list continuation.
   - fire_initial_burst_if_set's mention of `burst - 1`: rewrote so
     "- 1" doesn't start a line and get misread as list marker.

Purely a refactor + doc pass; no behavior change.
This commit is contained in:
Omar Sobh
2026-07-10 09:21:24 -07:00
parent c0c5fd7104
commit 51756d0e68
2 changed files with 64 additions and 39 deletions
+30 -24
View File
@@ -45,16 +45,20 @@ fn loop_state_root() -> std::path::PathBuf {
/// - Standalone loops (no source research topic bound): returns
/// `task_template` verbatim, matching legacy behavior.
/// - Loops bound to a research topic: fetches the topic's latest
/// research_outcome and prepends
/// RESEARCH ARTIFACT (integration plan you're executing):
/// <markdown>
/// ITERATION FOCUS: next unconsumed INT-XX in order. If prereqs are
/// unmet, work on the smallest unblocking INT-XX. Log
/// `COMPLETED: INT-<NN>` at the end so the loop can advance.
/// ORIGINAL TASK:
/// <task_template>
/// The topology_worker's completion hook (P3) parses the COMPLETED
/// marker to update `consumed_int_ids`.
/// research_outcome and prepends a block of the shape:
///
/// ```text
/// RESEARCH ARTIFACT (integration plan you're executing):
/// <markdown>
/// ITERATION FOCUS: next unconsumed INT-XX in order. If prereqs are
/// unmet, work on the smallest unblocking INT-XX. Log
/// COMPLETED: INT-<NN> at the end so the loop can advance.
/// ORIGINAL TASK:
/// <task_template>
/// ```
///
/// The topology_worker's completion hook (P3) parses the COMPLETED
/// marker to update `consumed_int_ids`.
/// One-shot compose + enqueue for a loop iteration. Reads the loop's
/// kind from the DB and dispatches: kind='exec' uses
/// compose_iteration_task (INT-consumption prepend); kind='research'
@@ -94,13 +98,15 @@ pub async fn compose_and_enqueue_iteration(
let task = compose_research_iteration_task(pool, topic_id, template_ref).await;
cm_db::repo::loops::enqueue_iteration_with_topic(
pool,
loop_id,
workspace_id,
&task,
graph,
iter,
parent_run_id,
Some(topic_id),
cm_db::repo::loops::IterationEnqueue {
loop_id,
workspace_id,
task: &task,
graph,
iteration: iter,
parent_run_id,
research_topic_id: Some(topic_id),
},
)
.await
} else {
@@ -432,13 +438,13 @@ pub async fn create_loop(
}
/// Fire the initial_burst if the loop's triggers request one. On the
/// first fire, ensures the per-loop container is spawned and
/// (for kind='research' loops) that the topic's repo is cloned and
/// the topic container is up. Sets `initial_burst_remaining = burst
/// - 1` so the completion hook can continue the chain. Best-effort:
/// a docker or DB hiccup on the FIRST fire logs but the loop row
/// still lives — cron / on_artifact_update / webhook can still fire
/// it later.
/// first fire, ensures the per-loop container is spawned and (for
/// kind='research' loops) that the topic's repo is cloned and the
/// topic container is up. Sets `initial_burst_remaining` to
/// `burst - 1` so the completion hook can continue the chain.
/// Best-effort: a docker or DB hiccup on the FIRST fire logs but the
/// loop row still lives — cron / on_artifact_update / webhook can
/// still fire it later.
pub async fn fire_initial_burst_if_set(
pool: &sqlx::PgPool,
workspace_id: Uuid,