summaryrefslogtreecommitdiff
path: root/makima/src/orchestration/directive.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-04-28 19:12:52 +0100
committerGitHub <noreply@github.com>2026-04-28 19:12:52 +0100
commitd1fdfb140cc440664f77a24886172f9976a05a31 (patch)
tree454739f80dde60fc6c1cd97acbaef3223ac041c6 /makima/src/orchestration/directive.rs
parent636694182fe9381479f2e9062229dda3838c5421 (diff)
downloadsoryu-d1fdfb140cc440664f77a24886172f9976a05a31.tar.gz
soryu-d1fdfb140cc440664f77a24886172f9976a05a31.zip
feat: revert broken directive PRs, re-implement Lexical document orchestrator (#98)
* feat: soryu-co/soryu - makima: Revert broken directive PRs and verify clean build * feat: soryu-co/soryu - makima: Re-implement frontend: Lexical document editor with feature flag and base components * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Add contract blocks, expandable log rows, and interaction controls * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: End-to-end build verification and integration polish
Diffstat (limited to 'makima/src/orchestration/directive.rs')
-rw-r--r--makima/src/orchestration/directive.rs99
1 files changed, 52 insertions, 47 deletions
diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs
index b9ff3fe..1e025c8 100644
--- a/makima/src/orchestration/directive.rs
+++ b/makima/src/orchestration/directive.rs
@@ -442,59 +442,64 @@ impl DirectiveOrchestrator {
let directives = repository::get_directives_needing_replanning(&self.pool).await?;
for directive in directives {
- tracing::info!(
- directive_id = %directive.id,
- title = %directive.title,
- "Directive goal updated — spawning re-planning task"
- );
+ if let Err(e) = async {
+ tracing::info!(
+ directive_id = %directive.id,
+ title = %directive.title,
+ "Directive goal updated — spawning re-planning task"
+ );
- // If directive already has a PR, remove completed steps that were included in it
- if directive.pr_url.is_some() || directive.pr_branch.is_some() {
- match remove_already_merged_steps(&self.pool, directive.id).await {
- Ok(count) if count > 0 => {
- tracing::info!(
- directive_id = %directive.id,
- removed = count,
- "Auto-removed completed steps already included in PR before replanning"
- );
- }
- Err(e) => {
- tracing::warn!(
- directive_id = %directive.id,
- error = %e,
- "Failed to auto-remove merged steps before replanning"
- );
+ // If directive already has a PR, remove completed steps that were included in it
+ if directive.pr_url.is_some() || directive.pr_branch.is_some() {
+ match remove_already_merged_steps(&self.pool, directive.id).await {
+ Ok(count) if count > 0 => {
+ tracing::info!(
+ directive_id = %directive.id,
+ removed = count,
+ "Auto-removed completed steps already included in PR before replanning"
+ );
+ }
+ Err(e) => {
+ tracing::warn!(
+ directive_id = %directive.id,
+ error = %e,
+ "Failed to auto-remove merged steps before replanning"
+ );
+ }
+ _ => {}
}
- _ => {}
}
- }
- let existing_steps =
- repository::list_directive_steps(&self.pool, directive.id).await?;
- let generation =
- repository::get_directive_max_generation(&self.pool, directive.id).await? + 1;
- let goal_history =
- repository::get_directive_goal_history(&self.pool, directive.id, 3).await?;
+ let existing_steps =
+ repository::list_directive_steps(&self.pool, directive.id).await?;
+ let generation =
+ repository::get_directive_max_generation(&self.pool, directive.id).await? + 1;
+ let goal_history =
+ repository::get_directive_goal_history(&self.pool, directive.id, 3).await?;
- let plan =
- build_planning_prompt(&directive, &existing_steps, generation, &goal_history);
+ let plan =
+ build_planning_prompt(&directive, &existing_steps, generation, &goal_history);
- if let Err(e) = self
- .spawn_orchestrator_task(
- directive.id,
- directive.owner_id,
- format!("Re-plan: {}", directive.title),
- plan,
- directive.repository_url.as_deref(),
- directive.base_branch.as_deref(),
- )
- .await
- {
- tracing::warn!(
- directive_id = %directive.id,
- error = %e,
- "Failed to spawn re-planning task"
- );
+ if let Err(e) = self
+ .spawn_orchestrator_task(
+ directive.id,
+ directive.owner_id,
+ format!("Re-plan: {}", directive.title),
+ plan,
+ directive.repository_url.as_deref(),
+ directive.base_branch.as_deref(),
+ )
+ .await
+ {
+ tracing::warn!(
+ directive_id = %directive.id,
+ error = %e,
+ "Failed to spawn re-planning task"
+ );
+ }
+ Ok::<(), anyhow::Error>(())
+ }.await {
+ tracing::warn!(directive_id = %directive.id, error = %e, "Error in re-planning directive — continuing");
}
}
Ok(())