Files
zesdex/apps/infrastructure/src/workflow/hive_mind/synthesis.rs
T
asepharyana 802346f909 Refactor subagent and workflow domain models; migrate access tiers and events to domain module
- Moved `AccessTier` and `SubagentEvent` enums to `zesdex_domain::subagent`.
- Consolidated workflow-related types into `zesdex_domain::workflow`.
- Updated references across the codebase to use the new domain models.
- Refactored tool execution logic to utilize a new `ToolExecutor` trait.
- Enhanced `AgentTurnService` to handle tool calls and events more effectively.
- Adjusted API handlers and state management to align with new domain structure.
2026-07-21 06:42:53 +07:00

39 lines
1.1 KiB
Rust

//! Consensus synthesis — reconciles multiple node outputs into one assessment.
use anyhow::Result;
use tracing::info;
use crate::tools::ToolCtx;
use zesdex_domain::workflow::NodeOutput;
/// Synthesize a consensus from all node outputs.
///
/// Flow: combine node outputs → return consensus text.
/// Uses simple concatenation-based synthesis (avoids LLM call dependency).
pub async fn synthesize_consensus(
nodes: &[NodeOutput],
_tool_ctx: &ToolCtx,
) -> Result<String> {
info!("Synthesizing consensus from {} nodes", nodes.len());
let mut combined = String::new();
for node in nodes {
combined.push_str(&format!(
"\n## {}{}\n\n{}\n",
node.id, node.directive, node.output
));
}
Ok(format!(
"# Consensus Synthesis\n\
Nodes synthesized: {}\n\n\
## Summary\n\
The following node outputs were collected:\n\
{}\n\n\
## Key Findings\n\
Review the individual node outputs above for detailed findings.",
nodes.len(),
combined
))
}