Summary
Extend retort run to delegate complex, multi-step tasks to cognitive-mesh via its HTTP API — the deep-research analog for the phoenixvc agent ecosystem.
Motivation
Simple tasks suit local CLI dispatch (claude, codex, cursor). Some tasks warrant structured multi-perspective reasoning, ethics/compliance checks, or cross-repo RAG — capabilities that cognitive-mesh already provides through its TaskRouter, IComplexityEscalationPort, and ISandboxFanOutPort ports.
How it works
retort run cogmesh --task "Analyse auth architecture across retort, sluice, mcp-org" \
--workflow structured-reasoning \
--context .agentkit/spec/
│
▼
cognitive-mesh TaskRouter
├─ WorkflowEngine (multi-step sequential reasoning)
└─ MultiAgentOrchestration (parallel agent fan-out + synthesis)
│
├─ StructuredReasoning (ConclAIve — Debate & Vote)
├─ SecurityReasoning / EthicalReasoning
├─ EnhancedRAGSystem (cross-repo knowledge index)
└─ ISandboxFanOutPort (isolated parallel passes)
│
▼
Result written to:
.claude/state/tasks/<id>/result.json (local)
phoenix-flow task update (if --remote, see #489)
Escalation trigger
Tasks can be routed to CM automatically via the .retortconfig escalation rules:
escalation:
rules:
- if: complexity >= high
to: cogmesh
workflow: structured-reasoning
- if: tags contains security or compliance
to: cogmesh
workflow: security-review
- if: scope contains cross-repo
to: cogmesh
workflow: rag-synthesis
fallback: claude # if CM unreachable
Or explicitly:
retort run cogmesh --workflow structured-reasoning --task "..."
retort run cogmesh --workflow security-review --task "..."
retort run cogmesh --workflow rag-synthesis --task "..."
Cognitive-mesh entry points
CM already exposes:
POST /api/cogmesh/tasks — submit a task (workflow + context)
GET /api/cogmesh/tasks/{id} — poll status
GET /api/cogmesh/tasks/{id}/result — fetch structured result
- SignalR hub for real-time progress events
IMCPToolPort — CM can itself call mcp-org and phoenix-flow as tools during execution
Plugin surface
The retort-plugins IDE panel should show:
- Active CM workflows with progress (see retort-plugins#X)
- Escalation history (which tasks were sent to CM and why)
- CM health badge (reachable / unreachable / degraded)
.retortconfig extension (builds on #488)
cogmesh:
endpoint: ${COGMESH_URL}
secret: ${COGMESH_API_SECRET}
defaultWorkflow: structured-reasoning
timeout: 300s
fallback: claude
Acceptance criteria
Dependencies
Summary
Extend
retort runto delegate complex, multi-step tasks to cognitive-mesh via its HTTP API — the deep-research analog for the phoenixvc agent ecosystem.Motivation
Simple tasks suit local CLI dispatch (claude, codex, cursor). Some tasks warrant structured multi-perspective reasoning, ethics/compliance checks, or cross-repo RAG — capabilities that cognitive-mesh already provides through its
TaskRouter,IComplexityEscalationPort, andISandboxFanOutPortports.How it works
Escalation trigger
Tasks can be routed to CM automatically via the
.retortconfigescalation rules:Or explicitly:
Cognitive-mesh entry points
CM already exposes:
POST /api/cogmesh/tasks— submit a task (workflow + context)GET /api/cogmesh/tasks/{id}— poll statusGET /api/cogmesh/tasks/{id}/result— fetch structured resultIMCPToolPort— CM can itself call mcp-org and phoenix-flow as tools during executionPlugin surface
The retort-plugins IDE panel should show:
.retortconfigextension (builds on #488)Acceptance criteria
retort run cogmesh --workflow <name> --task <text>dispatches to CM HTTP API.claude/state/tasks/<id>/result.json.retortconfigauto-route matching tasksfallbackCLI--remoteflag writes result back to phoenix-flow (feat: cross-machine and cross-team orchestration via phoenix-flow MCP #489)Dependencies
retort run— multi-CLI team dispatch with .retortconfig routing #487 —retort runCLI dispatch.retortconfigschema extensionphoenixvc/cognitive-mesh— HTTP API must be deployed and accessible