Introduction

The Cordis plugin for DeepSeek Harness (DSH), authored by boomzikazita. This plugin is based on the mechanisms of Engineering Cybernetics and implements an observer, feedforward, feedback control loops, a stabilizing valve, and controllability checks. It aims to provide agents with dynamic stability regulation capabilities similar to physical systems.

Core Mechanisms

This plugin operates through a classic control loop:

  • Observer: Memory state is partitioned by session and persisted in JSONL format to ~/.dsh/cybernetics/state_log.ndjson.
  • Feedforward control: Tool calls are intercepted via the tools/pre-execute rule table, supporting allowlists and parameter regular expression matching.
  • Feedback correction: tools/result events are captured, delta values are calculated, and an EMA (exponential moving average) filter is applied. Tier adaptation and divergence/oscillation detection are triggered based on the failure rate.
  • Actuator: Provides the following commands for external invocation:
    • cybernetics_snap: Snapshot state
    • cybernetics_status: Status overview
    • cybernetics_check: Controllability check
    • cybernetics_sandbox_mode: Sandbox mode control

Installation and Enablement

Install it as a bundle; the standard command is recommended:

dsh plugin --profile web add /home/boom/Deepseek/dsh-cybernetics

Key constraint: The node_modules directory in the plugin directory must be symlinked to DSH’s global host directory. It is strictly prohibited to run pnpm install inside the plugin directory itself. Otherwise, a TOOL_RUNTIME_SCHEDULER Symbol mismatch may occur, causing scheduling crashes.

Parameter Configuration

Core parameters are located in cordis.patch.yml, mainly controlling feedback filtering and threshold judgment:

  • EMA filtering: alpha (default 0.2)
  • Tier thresholds:
    • fast: threshold 5
    • deep: threshold 4
    • conservative: threshold 3
  • Stability judgment:
    • Escalation/de-escalation thresholds: escalateAt (0.6) / deescalateAt (0.15)
    • De-escalation debounce: deescalateStreak (5)
    • Divergence judgment: divergenceStreak (3)
  • Oscillation and redundancy:
    • oscillationWindow / oscillationRatio (10 / 0.7)
    • redundantWindow (20)
  • Entropy alerts:
    • entropyWarnAt / entropyRecoverAt (1.0 / 1.5)

Development Notes

Based on v4.2 and development experience, pay special attention to the following issues:

  1. Dependency symlinks: The host’s node_modules must be symlinked into the plugin directory to avoid dependency copy conflicts.
  2. waterfall listeners: You must explicitly return next(); otherwise, the chain will be broken and subsequent tool scheduling will fail.
  3. rc.6 defineTool signature: The parameter structure is execute(args, exec), and the output structure is output:{schema, render}. The tool list should be obtained via ctx.tools.schemas().
  4. HMR side effects: After modifying the plugin, dsh web hot reload will roll back the side effects of ctx.tools.register; dsh web must be restarted for changes to take effect.
  5. Stabilizing valve defect: There is an integral saturation issue (the counter accumulates across rounds without resetting), which may cause the system to lock up.
  6. TRANSPORT error: The root cause is that the tools/pre-execute injected message violates the role-alternation constraint. It should be moved to agent/pre-step and use createUserMessage to construct the message.
  7. Parameter field names: In rc.6, the parameter field name is arguments rather than args. When reading parameters, prefer using execArgsText to avoid exec.args being undefined.

Validation and Debugging

After installation, you can verify the plugin status through the following steps:

  1. Syntax and tests:
    node --check index.js && node --check core.mjs
    node -e "import('./index.js').then(m => console.log(m.name, m.inject))"
  1. Runtime status:
    cybernetics_status
  1. Log checks:
    • Check the boot recovery log:
        grep boot-recover ~/.dsh/cybernetics/state_log.ndjson | tail -1
*   Check redundant event aggregation (after the A1 fix takes effect, the redundancy count should no longer drop sharply):
        grep redundant-burst ~/.dsh/cybernetics/state_log.ndjson | tail -1

References

  • GitHub: https://github.com/boomzikazita/dsh-cybernetics
  • Directory page: https://www.skillhub.cn/plugins/boomzikazita/dsh-cybernetics