Introduction

In the development practice of DeepSeek Harness (DSH), directly using large models to handle all tasks is expensive, while relying entirely on small models makes it difficult to guarantee output quality. The dsh-cortex plugin resolves this contradiction by introducing an architecture where the primary model acts as a Supervisor and sub-Agents or small models act as Executors. It uses the strong model for planning, decomposition, and acceptance, while assigning execution tasks to lower-cost sub-models, thereby reducing costs while maintaining task quality.

What It Is

dsh-cortex is a DSH workflow plugin designed to provide low-cost, high-quality recursive task orchestration, model evaluation, and intelligent routing. It is maintained by iguowz and released under the MIT License.

Core Features

This plugin provides a complete set of capabilities spanning task decomposition, execution, evaluation, and governance:

  • Task intelligence and recursive decomposition
    Tasks are profiled, matched to strategies, and recursively decomposed through cortex_start and cortex_decompose. The system supports DAG structures (depends_on) with safety limits: maximum depth 6, total node count 50, subtasks per node 10, and maximum replanning count 3.

  • Dynamic routing and four-level quality gating
    cortex_execute performs dynamic routing and selects a model based on a comprehensive utility score combining quality, success rate, risk, and cost. The system has built-in four-level quality gates (Gate0-Gate3.5); Gate3.5 includes red-team adversarial testing to intercept high-risk or high-quality outputs that still contain defects.

  • Budget control and price overrides
    The engine has four built-in budget pools (10/70/10/10) and supports MQC upgrade gating. Through the cortex_models command or UI, effective model prices can be configured, with priority: model/official > user-configured > default.

  • Model evaluation and registry
    cortex_evaluate provides scoring across 7 dimensions and supports dynamic capability registration and drift monitoring. cortex_models manages static YAML configurations and dynamically discovered models, and supports routing score previews.

  • Organization mode and governance
    cortex_start.organization_mode enables organization mode, with 8 built-in Probes (requirements, engineering, testing, security, etc.), supports permission hierarchies (P0-P4) and rule-based governance, and records all decisions in governance.jsonl.

  • Recovery and correction
    The cortex_recover engine supports retries, switching, escalation, or manual intervention based on failure classification. The soft-defect correction feature allows in-place correction within max_delegations (default 3).

  • Web console and self-tuning
    The plugin includes a built-in Web console (/cortex ui) with views such as trends, matrices, and learning chains. Self-tuning generates parameter suggestions based on execution evidence and requires user confirmation before applying them.

Installation and Dependencies

No direct installation command is provided in the available materials. This plugin requires Node.js version >= 20 and the following peerDependencies:

@deepseek-ai/cordis (>= 4.0.1)
@deepseek-ai/dsh-subagent (>= 0.1.1-rc.2)
@deepseek-ai/dsh-llm (>= 0.1.1-rc.2)
@deepseek-ai/dsh-agent (>= 0.1.1-rc.2)
@deepseek-ai/dsh-client-runtime (>= 0.1.1-rc.2)

Among them, dsh-llm and dsh-tools are optional dependencies.

Typical Usage

The following are examples of core tool calls provided by the plugin:

# 启动任务,进行策略匹配与画像
cortex_start

# 递归拆解任务树
cortex_decompose

# 递归执行任务,支持自动调度与门控
cortex_execute recursive

# 执行任务(非递归模式或控制平面)
cortex_execute control

# 质量验收
cortex_review

# 恢复与重试
cortex_recover

# 模型评估
cortex_evaluate

# 查看模型注册表与价格
cortex_models

# 组织模式启动
cortex_start.organization_mode

# 生成 KPI 报告
cortex_report

Applicable Scenarios and Notes

This plugin is suitable for scenarios that require balancing the planning capability of large models with the execution efficiency of small models, especially projects involving complex task decomposition, multi-model routing selection, and strict quality gating.

Note: The DeepSeek Harness community catalog (such as SkillHub) has no official affiliation with DeepSeek or High-Flyer. Before using a plugin, it is recommended to check the source code and license, and ensure that the required peerDependencies are correctly configured.

Conclusion

dsh-cortex provides a complete “Supervisor + Executor” orchestration solution for the DSH ecosystem. Through dynamic routing, quality gating, and budget control, it helps developers reduce costs and improve quality. For more details, refer to the project’s GitHub repository.