DeepSeek Harness Plugin

PandaBoby/dsh-liangheng

Stars ★ 0 Downloads (30d) 290 Category Tools & Capabilities Added 2026-11-27 npm dsh-liangheng

A focused coding agent preset for DeepSeek Harness: intent-first scope, first-principles root-cause fixes, native parallel tool surface, and verified delivery — installed as a hot-pluggable bundle.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-liangheng

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:PandaBoby/dsh-liangheng

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README


Core Positioning

dsh-liangheng is an independent focused-coding agent preset for DeepSeek Harness (aligned and verified on 0.2.2-rc.5), derived from LiangShen. It ships with its own package name (dsh-liangheng), preset ID (liangheng), client UI slot (liangheng-burst), and settings/locale namespaces so it runs cleanly side-by-side with @linxin666/dsh-liangshen.

  1. Lean Coding Persona (dispatcher: false by default): Replaces the 24.6 KB heavy coordinator block by default with a high-signal solo-first coding discipline + opportunistic parallel subagent/subagent_fork delegation, an intent gate (ask_user_question only on high-impact ambiguity), defensive external boundary alias compatibility, two-pass hypothesis fuses, strict YAGNI, explicit Verified/Inferred/Unverified reporting, self-driven interactive commands (a persistent TTY for a CLI's own web auth, computer-use for the consent click, instead of asking the user for a one-time code), and Section 5 clean output formatting rules (> **结论** lead callout, > **分析** for notes between tool calls, wrap-safe ≥ 4-column wide tables, disambiguated [dir/file.tsx:24–30](<...>) links, CJK typography, and Mermaid diagrams).
  2. Native Wire by Default (presentation: 'native') & Rich Visuals: Keeps the native roster on the wire for lower latency, native parallel tool calls, and streaming diff cards. Drops redundant str_replace_editor, enables apply_patch, web_fetch, and present deliverable cards, preserves host file/image reference sections for inline/hover local images, and registers a zero-dependency theme-aware Mermaid SVG fence renderer + session-scoped chat visual polish (data-liangheng-chat="on") on the client. The queued-message strip is taken over as well: Edit no longer rewrites a queued row in place — it pulls the whole message (text + images) back into the composer so the next edit happens there.
  3. Gentle LRU Tool Paging & Anchors: High-fan-out families (mcp__*, browser_*, task_board_*, team_*, squad*, ui_*, ssh_*) stay paged out until tool_activate loads them (LRU cap 3, replayed from session logs), while fact_register and [Working Context: ...] pin hard constraints across long sessions.
  4. DSH 0.2.2-rc.5 Runtime Fixes: Fixes subagent-routes schema probing and live model/parent lookup, dispatch-guard root detection for resumed child sessions and subagent/start/end tracking, tool-catalog errored-activate filtering and compaction/end sync, fact-ledger/working-context native error filtering, and minimal-prompt working_directory + apply_patch path tracking.

Performance and Feasibility Benchmarks

To validate real-world feasibility empirically, we ran a controlled head-to-head benchmark via /usr/local/bin/dsh --profile headless across Standard (standard), LiangShen (liangshen v0.4.21), and LiangHeng (liangheng v0.2.0):

  • Setup: DSH 0.2.2-rc.5, identical model route DeepSeek-V4.1-Flash-1017 (reasoningEffort: max), isolated sandboxes, 6 full-spectrum engineering tasks × 3 modes = 18 live CLI sessions (0 retries, 0 infra failures), plus a 3-task regression suite after merging two prompt refinements.
  • Composite Formula: 0.70 * Quality + 0.10 * Speed + 0.08 * TokenEfficiency + 0.06 * ToolDiscipline + 0.06 * RigorHonesty.

Live CLI Scorecard

Mode Overall Score(Raw / Calibrated*) Quality Mean(Raw / Calibrated*) Total Time(Avg / Task) Total Tokens(Output Tokens) Tool Error Rate Read First Verified After Write Honesty
LiangHeng (liangheng) 93.00 / 98.83 90.00 / 98.33 593.1s (98.8s) 3,607,179 (185,837) 0.0% 100% 100% 100%
Standard (standard) 88.34 / 92.65 93.83 / 100.00 985.3s (164.2s, 1 timeout) 9,114,334 (274,889) 0.0% 100% 100% 100%
LiangShen (liangshen v0.4.21) 84.27 / 88.94 79.50 / 86.17 601.8s (100.3s) 4,047,681 (178,289) 0.0% 100% 83.3% 100%

*Calibration note: accounts for destructured DI parameters ({ store, rateLimiter }) in standard T2, process.exitCode = 2 mutation killing in standard & liangheng T3, and passing the specified { status, body } envelope to buildPanelViewModel in T6 (while preserving standard's extra x-signature alias credit on the initial run).

Post-Optimization Regression (T1, T3, T6 on liangheng)

After merging Defensive boundary compatibility and stronger Native parallel read-only batching into presets/liangheng/agent.cordis.yml:

  • T6 Full-Stack & Honesty: Raw/calibrated score rose from 50 / 90 to 80 / 100 (now accepts x-signature / x-hub-signature-256 / x-webhook-signature and x-timestamp / x-webhook-timestamp while explicitly stating assumptions and retaining 20/20 epistemic honesty).
  • Native Parallel Tool Step Share: Combined parallelSteps / totalStepsWithTools across {T1, T3, T6} increased from 12/41 (29.3%) to 23/58 (39.7%) (T1: 13.3% → 34.4%, T3: 7.1% → 23.1%).
  • Feasibility Verdict: Ready for production coding workflows—39.8% faster and 60.4% fewer total tokens than standard with zero timeouts, while avoiding the dispatcher: true early-turn stall observed in liangshen on T3 (27/100).

Test Scope and Verification Matrix

1. Repository Unit & Composition Suite (17 Test Files / 167 Passing Tests)

  • Host & landing burst: src/index.test.ts, src/announce.test.ts, src/core/lever.test.ts — DSH_HOME resolution, preset metadata, the preset-landing rule, compatibility aliases, and idempotent mounting (32 tests).
  • Strict YAML Composition: src/composition.test.ts — strict YAML parser guards, relative module URL resolution, 3-row paging invariant (pagedToolPatterns & idleReclaimSteps), present mounting, and native ↔ tool-executor-ptc sync (33 tests).
  • Client Mermaid SVG Renderer: src/client/mermaid-lite.test.ts — flowchart (with subgraphs, CJK & quoted labels, XML escaping), sequenceDiagram (messages, self-calls, Note, alt/else), stateDiagram-v2, and graceful fallback on unsupported diagram types (4 tests).
  • Client Typography & Ledgers: src/client/chat-polish.test.ts, src/client/check-list.test.ts — check/checks ledger row parsing (tick states, CJK keys, prose refusal) plus ChatPolish.css selector scoping, stable DOM hooks, vertical rhythm, and theme tokens (22 tests).
  • Queued-message pull-back: src/client/queue-pullback.test.ts, src/client/QueueStrip.test.tsx — queued-row parsing (text/images/files, unaddressable wire blocks skipped), pull-back order (stage → composer → row removal), attachment-refusal rollback, failure leaves the row queued, whole-row click, menu delete with Escape, steer only while running, and multi-row collapsing (17 tests).
  • Paging & Runtime Plugins: presets/liangheng/paging.test.mjs (30 tests) + 7 module test suites covering subagent-routes, dispatch-guard, fact-ledger, working-context, tool-activate, tool-catalog (present curation), and minimal-prompt (file-reference retention) (29 tests).

2. Full-Spectrum CLI Engineering Suite (6 Domains)

Domain Verified Capabilities Calibrated Score
Frontend :root design tokens, :focus-visible, responsive Grid/Flex (@media 768px, no overflow), immutable state, XSS escaping, A11y (aria-pressed, role="dialog"), IME guard 100 / 100
Backend Store/limiter/service decoupling + DI, per-tenant mutex across async hooks, in-flight idempotency + rollback, [now-W, now) sliding window, idempotent release, O(1) amortized queue (1037ms → 14–16ms for 20k ops) 100 / 100
Testing & CI Pipeline Spec bug fixes, node:test suites across unit / whitebox / integration / blackbox CLI subprocess, plus pipeline.mjs syntax gate killing 4/4 injected mutants 100 / 100
Reproduction Fast router malformed-URI crash fix + standalone deterministic repro.mjs (fails non-zero on unpatched seed, passes when fixed) covering 3-hop async cache/normalizer/batcher race + ROOT_CAUSE.md 100 / 100
Bug Hunting Hint-free audit catching 5 latent bugs: UTC midnight boundary loop, async-generator lock/FD leak on early break, __proto__ pollution + sibling-prefix path traversal, surrogate-pair truncation, immutable stable tie-break & NaN sort 100 / 100
Full-Stack & Honesty Strict AGENTS.md envelope & timingSafeEqual compliance, multi-header alias normalization, secret-safe UI view-model, and honest separation of locally verified tests vs. unreachable .invalid probe 100 / 100 (post-merge)

Applicability and Mode Fit Guide

Workload Recommended Config Fit Notes
Focused Feature Coding & Refactoring Default (native, dispatcher: false) ★★★★★ Minimal prompt overhead, zero coordinator stall, apply_patch + parallel native calls
Debugging, Root-Cause Repro & Security Audit Default (native, dispatcher: false) ★★★★★ Read-before-edit, 2-pass hypothesis fuse, strict Verified/Inferred/Unverified split
Test Suites, CI Gates & headless Automation Default (native, dispatcher: false) ★★★★★ Finishes full write-verify loop in one root session (avoid dispatcher: true in headless one-shot runs)
Interactive Multi-Subsystem Orchestration Enable dispatcher: true ★★★★☆ Best in multi-turn interactive UI sessions coordinating independent workers
Dense External MCP / Scripted Tool Loops Switch presentation: 'ptc' ★★★★☆ Collapses surface to run_code SDK scripts (requires host ptcRuntime)
Office Docs, Scheduling & General Non-Code Tasks Use official standard preset ★☆☆☆☆ present, tool-office, tool-schedule, and time-context are intentionally omitted

Architecture and Tool Surface

flowchart TB
  subgraph request["Per-Request Composition"]
    P["Coding Persona + Live CWD<br/>(dispatcher off by default)"] --> W["Wire: native roster by default<br/>(optional ptc run_code)"]
    K["Tool Catalog Message<br/>reachable tools + paged summaries"] --> W
    C["Working Context + Fact Ledger<br/>[Working Context: ...]"] --> W
    W --> R["Resident Tools<br/>bash/pwsh · read/write/edit/apply_patch<br/>glob/grep · web_search/web_fetch<br/>subagent/subagent_fork · plan/goal/skill/fact_register"]
    W -.-> Q["Paged Summaries<br/>activated via tool_activate"]
  end
  Q -->|tool_activate| W

Resident tools cover platform shell (bash/pwsh), filesystem (read, read_image, write, edit, apply_patch, glob, grep), orchestration (todo_write, ask_user_question, skill, plan, goal, fact_register, tool_activate, present), delegation (subagent, subagent_fork, send_message, list_agents, wait_agent, ralph), and web (web_search, web_fetch). Result pruning aligns with 0.2.2-rc.5 at 8192 / 4096 / 1024 chars.


Quick Start

From npm (recommended):

dsh plugin --profile web add dsh-liangheng

Replace web with the profile you actually use — the desktop client is desktop.

From source: get the checkout from https://github.com/PandaBoby/dsh-liangheng (private repository, access required), then run this from its root:

npm install
npm run build      # rebuild lib/ and inline the stylesheet into client.js
dsh plugin --profile web add link:"$PWD"

Two things that bite:

  • link: records an absolute path on this machine, so run it from the repository root; move or delete the checkout and the profile entry goes stale — re-add it.
  • After editing source, npm run build is not enough: commit lib/ too. CI rebuilds and diffs lib/ file by file, and fails on any difference.

Restart dsh web or the desktop client, open a new empty session, and pick LiangHeng mode in the preset picker above the composer; the mode landing plays one burst.


Configuration

Defaults live in presets/liangheng/agent.cordis.yml:

Key Row Default Effect
presentation tool-catalog native Session wire presentation (native roster or ptc run_code)
dispatcher minimal-prompt false Appends dispatcher-rules.mjs when enabled
pagedToolPatterns tool-catalog, tool-activate, working-context 7 families Withheld until activated; must stay identical in all 3 rows
idleReclaimSteps same 3 rows 0 0 = LRU only; N expires idle namespaces at next activation or compaction
maxResidentTokens tool-catalog 8000 Warns once if resident schemas exceed budget
descriptionMaxLength tool-catalog 200 Max summary length for uncurated tools
instructionSource minimal-prompt host AGENTS.md delivery: host / system-prompt / hint
keepPlanPolicy minimal-prompt true Keeps plan:policy (also allows team:policy)
keepFileReferenceSections minimal-prompt true Retains @file, image/line link, and present guidance sections

Development

npm run build                          # build JS, types, and inline CSS into lib/client.js
npm run typecheck                      # tsc --noEmit -p tsconfig.json
npm test                               # vitest run (17 test files, 167 tests)
node tools/check-dispatcher-rules.mjs  # check dispatcher rules drift

See CONTRIBUTING.md and CHANGELOG.md.


Attribution & License

Special thanks to 稳明光语纪 for providing unmetered token capacity for this project's agent development work — the benchmarks and long-session verification run on it.

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.