Recursive deploy ladder: Company + Org tiers, mesh mark, two-tier rail
Completes the scale ladder (single → team → company → org). Every tier is a
topology whose nodes are the tier below; running a parent recursively runs each
child's sub-topology down to the leaf claws.
Backend:
- migration 0011: companies/company_teams, orgs/org_companies, topology_runs.tier
- cm-db repos for companies + orgs (mirror teams)
- TurnRequest.attrs (forwarded from node.attrs) for child-id binding
- SubTopologyExecutor (recursive_exec.rs): a parent "turn" runs the child's
sub-topology; durability via parent updated_at keepalive + cancel propagation
+ depth cap; boxed future breaks the org→company recursion
- topology_worker selects executor by job.tier
- routes: /api/companies, /api/orgs (create/list/get/run) + unified
/api/structure/{level}/{id} for the zoom canvas
Frontend:
- MeshMark: node-mesh brand glyph (replaces the claw PNG), tier variants
- TopologyGraphView: optional onNodeClick/nodeMeta + dark-token theming
- StructureCanvas + Breadcrumb: one recursive zoom view for every tier
(drill down on node click, breadcrumb up); TeamRunPanel extracted + shared
- two-tier Discord-style rail: StructureRail (mesh mark + org/company/team
glyphs + tools popover + deploy + user) | RosterColumn (selected group's
children, or your claws); SecondaryNav for cross-cutting tools
- ComposeWizard (company/org) wired into DeployWizard; /companies + /orgs pages
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
bba18a4687
commit
3eca4ed70c
@@ -33,10 +33,22 @@ fn node(id: &str, role: &str) -> Node {
|
||||
fn hierarchical() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Hierarchical,
|
||||
vec![node("lead", "coordinator"), node("w1", "researcher"), node("w2", "writer")],
|
||||
vec![
|
||||
Edge { from: "lead".into(), to: "w1".into(), kind: EdgeKind::DelegatesTo },
|
||||
Edge { from: "lead".into(), to: "w2".into(), kind: EdgeKind::DelegatesTo },
|
||||
node("lead", "coordinator"),
|
||||
node("w1", "researcher"),
|
||||
node("w2", "writer"),
|
||||
],
|
||||
vec![
|
||||
Edge {
|
||||
from: "lead".into(),
|
||||
to: "w1".into(),
|
||||
kind: EdgeKind::DelegatesTo,
|
||||
},
|
||||
Edge {
|
||||
from: "lead".into(),
|
||||
to: "w2".into(),
|
||||
kind: EdgeKind::DelegatesTo,
|
||||
},
|
||||
],
|
||||
)
|
||||
.unwrap()
|
||||
@@ -45,10 +57,22 @@ fn hierarchical() -> TopologyGraph {
|
||||
fn pipeline() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Pipeline,
|
||||
vec![node("a", "researcher"), node("b", "analyst"), node("c", "writer")],
|
||||
vec![
|
||||
Edge { from: "a".into(), to: "b".into(), kind: EdgeKind::PipesTo },
|
||||
Edge { from: "b".into(), to: "c".into(), kind: EdgeKind::PipesTo },
|
||||
node("a", "researcher"),
|
||||
node("b", "analyst"),
|
||||
node("c", "writer"),
|
||||
],
|
||||
vec![
|
||||
Edge {
|
||||
from: "a".into(),
|
||||
to: "b".into(),
|
||||
kind: EdgeKind::PipesTo,
|
||||
},
|
||||
Edge {
|
||||
from: "b".into(),
|
||||
to: "c".into(),
|
||||
kind: EdgeKind::PipesTo,
|
||||
},
|
||||
],
|
||||
)
|
||||
.unwrap()
|
||||
@@ -57,7 +81,11 @@ fn pipeline() -> TopologyGraph {
|
||||
fn swarm() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Swarm,
|
||||
vec![node("a", "writer"), node("b", "writer"), node("lead", "coordinator")],
|
||||
vec![
|
||||
node("a", "writer"),
|
||||
node("b", "writer"),
|
||||
node("lead", "coordinator"),
|
||||
],
|
||||
vec![],
|
||||
)
|
||||
.unwrap()
|
||||
@@ -66,11 +94,27 @@ fn swarm() -> TopologyGraph {
|
||||
fn mesh() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Mesh,
|
||||
vec![node("a", "analyst"), node("b", "analyst"), node("c", "analyst")],
|
||||
vec![
|
||||
Edge { from: "a".into(), to: "b".into(), kind: EdgeKind::PeersWith },
|
||||
Edge { from: "b".into(), to: "c".into(), kind: EdgeKind::PeersWith },
|
||||
Edge { from: "a".into(), to: "c".into(), kind: EdgeKind::PeersWith },
|
||||
node("a", "analyst"),
|
||||
node("b", "analyst"),
|
||||
node("c", "analyst"),
|
||||
],
|
||||
vec![
|
||||
Edge {
|
||||
from: "a".into(),
|
||||
to: "b".into(),
|
||||
kind: EdgeKind::PeersWith,
|
||||
},
|
||||
Edge {
|
||||
from: "b".into(),
|
||||
to: "c".into(),
|
||||
kind: EdgeKind::PeersWith,
|
||||
},
|
||||
Edge {
|
||||
from: "a".into(),
|
||||
to: "c".into(),
|
||||
kind: EdgeKind::PeersWith,
|
||||
},
|
||||
],
|
||||
)
|
||||
.unwrap()
|
||||
@@ -79,7 +123,11 @@ fn mesh() -> TopologyGraph {
|
||||
fn debate() -> TopologyGraph {
|
||||
TopologyGraph::new(
|
||||
TopologyKind::Debate,
|
||||
vec![node("proposer", "proposer"), node("critic", "critic"), node("judge", "judge")],
|
||||
vec![
|
||||
node("proposer", "proposer"),
|
||||
node("critic", "critic"),
|
||||
node("judge", "judge"),
|
||||
],
|
||||
vec![],
|
||||
)
|
||||
.unwrap()
|
||||
@@ -87,16 +135,17 @@ fn debate() -> TopologyGraph {
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let (provider, model): (Arc<dyn LlmProvider>, String) =
|
||||
match std::env::var("ANTHROPIC_API_KEY") {
|
||||
Ok(key) if !key.is_empty() => {
|
||||
(Arc::new(cm_llm::AnthropicProvider::new(key)), "claude-sonnet-4-6".to_string())
|
||||
}
|
||||
_ => (
|
||||
Arc::new(cm_llm::ScriptedProvider::from_toml("").unwrap()),
|
||||
"scripted".to_string(),
|
||||
),
|
||||
};
|
||||
let (provider, model): (Arc<dyn LlmProvider>, String) = match std::env::var("ANTHROPIC_API_KEY")
|
||||
{
|
||||
Ok(key) if !key.is_empty() => (
|
||||
Arc::new(cm_llm::AnthropicProvider::new(key)),
|
||||
"claude-sonnet-4-6".to_string(),
|
||||
),
|
||||
_ => (
|
||||
Arc::new(cm_llm::ScriptedProvider::from_toml("").unwrap()),
|
||||
"scripted".to_string(),
|
||||
),
|
||||
};
|
||||
|
||||
let executor = ProviderExecutor::new(provider, model.clone(), 512);
|
||||
let task = "Draft a go-to-market launch plan for a new product.";
|
||||
@@ -128,7 +177,10 @@ async fn main() {
|
||||
println!("best quality: {:?}", cmp.results[i].kind);
|
||||
}
|
||||
if let Some(i) = cmp.best_value {
|
||||
println!("best value: {:?} (quality per token)", cmp.results[i].kind);
|
||||
println!(
|
||||
"best value: {:?} (quality per token)",
|
||||
cmp.results[i].kind
|
||||
);
|
||||
}
|
||||
|
||||
// Workflow of topologies: brainstorm (swarm) → execute (hierarchical) → review (debate).
|
||||
|
||||
Reference in New Issue
Block a user