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-executerule table, supporting allowlists and parameter regular expression matching. - Feedback correction:
tools/resultevents 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 statecybernetics_status: Status overviewcybernetics_check: Controllability checkcybernetics_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 5deep: threshold 4conservative: threshold 3
- Stability judgment:
- Escalation/de-escalation thresholds:
escalateAt(0.6) /deescalateAt(0.15) - De-escalation debounce:
deescalateStreak(5) - Divergence judgment:
divergenceStreak(3)
- Escalation/de-escalation thresholds:
- 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:
- Dependency symlinks: The host’s
node_modulesmust be symlinked into the plugin directory to avoid dependency copy conflicts. - waterfall listeners: You must explicitly
return next(); otherwise, the chain will be broken and subsequent tool scheduling will fail. - rc.6 defineTool signature: The parameter structure is
execute(args, exec), and the output structure isoutput:{schema, render}. The tool list should be obtained viactx.tools.schemas(). - HMR side effects: After modifying the plugin,
dsh webhot reload will roll back the side effects ofctx.tools.register;dsh webmust be restarted for changes to take effect. - Stabilizing valve defect: There is an integral saturation issue (the counter accumulates across rounds without resetting), which may cause the system to lock up.
- TRANSPORT error: The root cause is that the
tools/pre-executeinjected message violates the role-alternation constraint. It should be moved toagent/pre-stepand usecreateUserMessageto construct the message. - Parameter field names: In rc.6, the parameter field name is
argumentsrather thanargs. When reading parameters, prefer usingexecArgsTextto avoidexec.argsbeing undefined.
Validation and Debugging¶
After installation, you can verify the plugin status through the following steps:
- Syntax and tests:
node --check index.js && node --check core.mjs
node -e "import('./index.js').then(m => console.log(m.name, m.inject))"
- Runtime status:
cybernetics_status
- 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