-
Notifications
You must be signed in to change notification settings - Fork 0
feat: cognitive-mesh handoff — delegate complex tasks via retort run cogmesh #490
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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 unreachableOr 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 statusGET /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: claudeAcceptance criteria
-
retort run cogmesh --workflow <name> --task <text>dispatches to CM HTTP API - Polls or streams task status until completion
- Writes result to
.claude/state/tasks/<id>/result.json - Escalation rules in
.retortconfigauto-route matching tasks - CM unreachable → falls back to configured
fallbackCLI -
--remoteflag writes result back to phoenix-flow (feat: cross-machine and cross-team orchestration via phoenix-flow MCP #489) - Plugin surfaces CM workflow status (retort-plugins)
Dependencies
- feat(cli): add
retort run— multi-CLI team dispatch with .retortconfig routing #487 —retort runCLI dispatch - feat(config): extend .retortconfig schema with cli-routing, mcp-servers, and worktree settings #488 —
.retortconfigschema extension - feat: cross-machine and cross-team orchestration via phoenix-flow MCP #489 — cross-machine orchestration (optional, for phoenix-flow write-back)
phoenixvc/cognitive-mesh— HTTP API must be deployed and accessible
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request