Back to home@Makoveli89

dsh-swarm

BSP coding swarm plugin for DeepSeek Harness: nested 3-tier swarms of 100+ concurrent DeepSeek V4 agents with barrier-synchronized phases, worktree isolation, guardrails, and cache-stable prefixes

Stars
0
Language
TypeScript
Created
Aug 19, 2026
Updated
Aug 19, 2026
GitHub repo

Introduction

dsh-swarm

BSP coding swarm plugin for DeepSeek Harness — nested, barrier-synchronized coding swarms of 100+ concurrent agents tiered across DeepSeek V4 models.

  • 1 root planner (deepseek-v4-pro) → 2–16 squad leads (deepseek-v4-pro) → 4–16 workers each (deepseek-v4-flash, default fan-out 10×10 = 100 workers)
  • Five BSP phases (partition → planning → execution → synthesis → integration), each closed by a barrier with a straggler deadline — no agent reads another agent's mid-phase output
  • Write isolation: one git worktree per squad + a tiered region-ownership map enforced by the sandbox policy
  • Guardrail permissions: in-grant actions auto-approve; out-of-grant escalate to the root planner; dangerous/budget actions escalate to you
  • Budget discipline: per-tier pricing (pro $1.32/M in, flash $0.0826/M in), 90% pre-escalation, hard mission cap
  • Cache-stable prefixes: byte-identical worker prefixes per squad ride one DeepSeek prefix-cache entry — a 100-worker mission lands at roughly $10–30
  • Checkpoint/resume at every barrier

Install

dsh plugin add github:Makoveli89/dsh-swarm

This runs pnpm in your DSH profile and reconciles the bundle layer: the five swarm rows (engine, context, worktree, guard, tool) join your profile's composition. It needs a profile whose base bundles provide the subagent spawn backend, the LLM route, and the token meter (the default DSH profile does).

Mount the mode

Copy the preset into your agent-presets directory:

mkdir -p "${DSH_HOME:-$HOME/.dsh}/.agent-presets/swarm"
cp preset.yml agent.cordis.yml "${DSH_HOME:-$HOME/.dsh}/.agent-presets/swarm/"

Then select the DeepSeek Coding Swarm preset for a session (or mount it as your standing preset). The session agent gains the swarm tool.

Use

swarm launch — repo: /absolute/path/to/repo, brief: "implement the TODOs in src/queue"
swarm status — missionId: <id>
swarm pause | resume | cancel | continue — missionId: <id>
swarm answer — escalationId: <id>, decision: <allow | reject | raise-cap>

Missions run asynchronously: after launch, monitor with swarm status and react to swarm/* events. Defaults: 10×10 fan-out, $30 hard budget cap, per- phase deadlines 5m/5m/20m/5m/5m — all overridable per launch or in the row config.

Packages

PackageRolectx key
@deepseek-ai/dsh-swarmService definition + engine (BSP barriers, region ownership, budget, checkpoints, swarm/* events)ctx.swarmEngine
@deepseek-ai/dsh-swarm-contextCache-stable prefix compositor + role personasctx.swarmContext
@deepseek-ai/dsh-swarm-worktreePer-squad git worktree leasesctx.swarmWorktree
@deepseek-ai/dsh-swarm-guardCapability grants + escalation verdictsctx.swarmGuard
@deepseek-ai/dsh-tool-swarmModel-facing mission toolregisters on ctx.tools

Verification

Developed in the harness monorepo (PR: deepseek-ai/deepseek-harness): 117 tests, 100% per-file coverage, host typecheck and oxlint clean, and a 100-concurrent-worker load run over the barrier. Live-mission acceptance (real-model cache-hit ratio and spend) is documented in the subsystem doc there.

License

MIT. The cache-stable-prefix doctrine and planner/executor tiering are adopted from DeepSeek-Reasonix (MIT); no code was imported.