← Thinking Thinking

DeepSeek Harness Architecture Design Analysis: When 'Everything Is a Plugin' Goes from Slogan to Source Code

Source-code-level architecture analysis. Nine architectural decisions point to one verdict: DSH is building an agent operating system layer. But this OS can…

2026-08-13Thinking25 min read

DeepSeek Harness Architecture Design Analysis: When 'Everything Is a Plugin' Goes from Slogan to Source Code

Source-code-level architecture analysis. Nine architectural decisions point to one verdict: DSH is building an agent operating system layer. But this OS can only execute, not learn—the architecture provides every interface for evolution, but the feedback loop is empty.

The leaked report framed DSH as a "model-bound Harness competitor." The source code tells a different story.

Prologue: What We Missed

24 hours ago, we wrote a competitive landscape analysis of DSH based on the leaked report. Our judgment then: DSH was "model-bound"—like ZCode, betting on deep model-Harness synergy. We placed it in a "three-route divergence" framework, opposed to the "model-agnostic" camp of Qoder/WorkBuddy.

Then DSH went open source.

The source code demolished that framework. DSH didn't pick a side on the "model-bound vs. model-agnostic" axis—it ignored the axis entirely. Its architecture points to a more fundamental question: What should the Harness layer actually look like?

The answer isn't "a product." It's "a runtime."

The analytical logic of this article: examine each of the nine architectural decisions DSH made. Each has source code evidence. Each implies a strategic intent. Connect them, and you see a coherent judgment—DSH wants to be the operating system layer for Agents, not an Agent itself.


Decision 1: Vendored Cordis Fork—Betting on a Programming Paradigm, Not a Framework

DSH's README states the relationship clearly in its first sentence:

"It uses an architecture where everything is a plugin, and is powered by Cordis, whose design is described in A Programming Paradigm for Spatiotemporal Composability."

Note "described in"—Cordis's design paper wasn't written by DSH. It was independently published by the cordiverse organization. The DSH team didn't "pick an off-the-shelf framework." They built a product around a programming paradigm.

The AGENTS.md repository layout confirms: Cordis source code is vendored via vendor/—a fork, not a dependency. Meanwhile, @deepseek-ai/cordis is published as a peerDependency—the vendored fork is re-scoped and exposed externally, so external plugin developers can depend on the same Cordis runtime.

What does this decision imply? DSH isn't "using a framework to quickly build a product." It's investing in a programming paradigm. Cordis's core concepts—registration is an effect, unmount is rollback—aren't tool features. They're runtime semantics. DSH is betting that these semantics are the correct foundation for an Agent runtime.


Decision 2: No Privileged Core—This Is a Microkernel Design, Not a Modular Product

The key declaration from architecture.md:

"Every part of the product is a plugin, including the model adapter, the tool registry, the session log, and the agent loop itself, so every part is replaceable from configuration. There is no privileged core to patch."

"No privileged core"—in most "extensible architectures," the core loop (agent loop) is hardcoded, and plugins can only extend the periphery. DSH makes the agent loop itself a plugin.

The mermaid diagram in composition.md lists all 78 plugin lines in the base bundle. Every capability—LLM calls, bash execution, session persistence, approval policies, filesystem—is a replaceable plugin. No capability is hardcoded into the core.

What does this decision imply? DSH's design is closer to a microkernel operating system than an "extensible coding agent." In a microkernel, process scheduling, memory management, and filesystem are all replaceable services outside the kernel. DSH applies the same principle to the Agent domain: tool registry, model adapter, session storage are all "user-space services." The kernel only manages plugin lifecycles.


Decision 3: Three-Plane Separation—Multi-Tenancy as Day-One Design Foundation

This isn't "multi-session support added later." The separation of Host / Agent Preset / Client into three planes is DSH's foundation.

Host Plane owns process-level singletons—ctx.tools (tool registry), ctx.llm (model adapter), ctx.sessions (session storage), ctx.fs (filesystem), ctx.sandbox (sandbox backend). These are "kernel services."

Agent Preset Plane owns per-session tool instances and prompt sections. Each preset is a cordis.yml, mounted at session creation. isolate: true creates an entry-local realm—when multiple sessions coexist in the same process, their respective compaction, workflow, and terminal instances are fully isolated.

Client Plane injects React components into the browser UI via ctx.slots.inject().

The dual-aggregate TypeScript compilation (tsconfig.host.json and tsconfig.client.json) isn't an architectural preference—it's a language-level constraint. The Host and Client sides declaration-merge the same Context interface but register different services; placing them in the same program would cause key conflicts.

What does this decision imply? Multi-tenancy isn't a feature; it's a design premise. Multiple sessions within the same process each hold private tool sets, prompts, and state—this isn't "a single-user tool with multi-session support added on," but "designed as a multi-tenant runtime from the start."


Decision 4: Agent Lifecycle Is an Event Stream, Not a Function Call

This is the key to understanding DSH—the agent isn't a linear program that "calls a model then executes tools." It's an event-driven state machine.

Complete Lifecycle

Boot: Profile composes the plugin tree. This isn't "loading a config file"—it's stacking patch layers: bundle → profile → home → CLI overlay—each layer can replace any line or insert new ones. FiberState.boot() mounts the final plugin tree. The same DSH installation with different profiles produces completely different runtimes.

Input: All input enters the same inbox. User messages are "wakeup-type" (trigger immediately); context injected via agent.inject() is "queued-type" (waits for the next wakeup message to be claimed). This prevents injected context from triggering uncontrollable model requests.

Turn Flow—one Turn is the complete cycle of processing a single user input:

turn/start
  claim input + queued messages
  assemble prompt sections + tool schemas
  → agent/pre-step                reject | enter(messages)
     step/start
     derive model history from log
     agent/request → llm/stream → assistant/chunk* → assistant/message
     tool/call* → tools/pre-execute → tools/execute → tools/post-execute → tool/result*
     step/end
     more tools owed or new input → next step
  → agent/turn-stopping
turn/end

Six phases, each with extension points:

agent/pre-step is the most important valve—a waterfall event where multiple listeners chain together and can rewrite what the model sees or directly reject execution. Even when rejected, a durable turn is still recorded—permanent evidence that "the agent attempted but was blocked."

The tool execution pipeline is a three-stage waterfall: pre-execute (approval/permissions) → execute (actual run) → post-execute (redaction/truncation). Any listener can block execution.

Multi-step chaining: After a step ends, if the model still owes tool calls or new input has arrived in the inbox, the driver claims the next step. A "conversation round" from the user's perspective might contain 5-10 internal steps.

Three Event Types

Type Behavior Persisted Examples
Waterfall Listeners must call next(); failure to do so halts the chain No agent/pre-step, tools/*
Serial Executed in order No agent/turn-stopping
Durable Appended to session log Yes turn/*, assistant/*, tool/*

What does this decision imply? Policy, security, and audit aren't "shells bolted on the outside"—they're listeners on the event stream. You don't need to modify the agent loop to add an approval policy—you register a tools/pre-execute listener. This is a thorough separation of policy from mechanism.


Decision 5: Session Log as the Single Source of Truth—Financial-Grade Event Sourcing

DSH sessions aren't "conversation histories." They're append-only event logs.

The core invariant:

"Model-visible means logged. Anything that reaches a model request must be reconstructable from the log, and a runtime invariant asserts it."

This isn't a convention—there's a runtime assertion enforcing it. Any input reaching the model must be reconstructable from the log. Adding a new model-visible input requires adding a new SessionEvent type.

deriveMessages() is a projection function—it derives the model-visible message sequence from the raw event stream. The same log simultaneously serves six consumers: model context, UI rendering, JSONL persistence, OpenTelemetry telemetry, deterministic replay (including streaming chunks), and fork/resume.

Event versioning uses a fail-loud strategy: unrecognized event types are rejected by default unless explicitly marked ignorable: true.

What does this decision imply? This is Jane Street-style financial systems thinking—the transaction log is the single source of truth; all views (positions, P&L, audit) are projections. DSH applies the same principle to the Agent domain. Fork, resume, replay, and audit all come naturally, requiring no special persistence logic.

The architecture diagram illustrates this directly:

DSH Three-Plane Architecture and Turn Flow
DSH Three-Plane Architecture and Turn Flow

Decision 6: Four Presets Reveal the Product Roadmap

DSH isn't "one product." The four presets form a capability spectrum.

Minimal: Two tools (bash + str_replace_editor), persona exclusively owns the system prompt (complete: true), runtime context disabled. Purpose-built for benchmarks—per media reports, V4-Flash's TerminalBench score of 82.7 runs on this preset (the repo's BENCHMARK.md only documents the methodology, not the scores).

Standard: Full coding agent. bash/pwsh, filesystem, background tasks, skill system, sub-agents (spawn/fork), workflows, plan mode, context compaction, goal system, web search.

Code: Superset of Standard. Instead of calling tools one by one, the model writes TypeScript programs executed in one shot (run_code). Five tool round-trips compressed into one.

Cordis: The agent edits its own runtime. The cordis preset's declaration:

"It exists so a person can ask an agent to author another agent."

"TRUST: cordis_mount evaluates model-written JavaScript against the live runtime... Treat a session on this preset as shell access."

The agent can read the current plugin tree, mount temporary JavaScript into the live runtime, and write new cordis.yml files as presets for other sessions. This isn't a future plan—it's implemented in v0.1.

What do these four presets imply? They're not "four feature tiers." They're a progressive spectrum from sandbox to metaprogramming. Minimal is "locked-down tools." Cordis is "tools that can rewrite themselves." No other Harness (Claude Code, Codex, Cursor) has anything equivalent to the cordis preset.

But the Cordis Preset ≠ Harness Self-Evolution

This is where we need to apply the brakes. The "self-modification" capability showcased by the cordis preset is genuinely impressive, but equating it with "Harness self-evolution" conflates two distinct layers.

Three layers of evolutionary capability, clearly distinguished:

Layer Capability DSH v0.1 Status Source Evidence
Human-directed change User instructs agent to edit cordis.yml ✅ Implemented cordis preset + dsh-tool-cordis
Agent self-directed change Agent decides which plugins to mount on its own ⚠️ Partially implemented self-modification/ package exists, but AGENTS.md only describes "inspects/mounts its own plugins"—no decision logic
System learning from patterns Harness automatically analyzes execution history, optimizes toolchains, generates new skills ❌ Does not exist grep for auto.*learn / feedback.*loop / pattern.*recogn / reinforce across source code returns zero results

The critical gap is here: DSH has Event Sourcing (complete execution history), Telemetry (OpenTelemetry export), and a Plugin System (mutable mechanism)—together, these form the raw materials for self-evolution, but they lack a consumer.

The session log records every tool call, every model request, every error and recovery. These event streams are read by six consumers—model context projection, UI rendering, persistence, telemetry, replay, and fork. But there is no seventh consumer: no component that extracts patterns from history. No component that tallies "this user's bash commands are 80% git operations; we should pre-load a git skill." No component that discovers "this toolchain takes three steps every time to complete a file search; we should merge it into one."

In other words, DSH's architecture leaves all necessary interfaces open for Harness self-evolution—event streams, plugin hot-reloading, skill system, context injection—but v0.1 doesn't implement the feedback loop. It's like a city that built the power plant and the transmission grid but hasn't connected any appliances.

This is an important judgment boundary:

  • If DeepSeek plans to close this loop in subsequent versions—say, a plugin that analyzes session logs and auto-generates skills—then DSH's architectural foundation is correct
  • If they don't plan to—then the cordis preset is merely "a fancy UI for manually editing config," not true Harness evolution

The source code doesn't give a definitive answer. But there's an indirect signal: self-modification/ exists as an independent package group (peer to core/ and llm/), indicating the DSH team treats self-modification as a first-order capability domain, not an appendage of a preset. This package currently has only "inspects/mounts" capability, but its position implies greater ambition.


Decision 7: Competitors Aren't Threats—They're Plugins

The most unexpected finding in standard/agent.cordis.yml:

- id: tool-subagent-codex
  name: '@deepseek-ai/dsh-tool-subagent'
  disabled: true
  config:
    provider: codex

- id: tool-subagent-claude-code
  name: '@deepseek-ai/dsh-tool-subagent'
  disabled: true
  config:
    provider: claude-code

DSH ships OpenAI Codex and Anthropic Claude Code as built-in sub-agent providers, disabled by default. Once enabled in a user's preset, DeepSeek V4 can act as the lead orchestrator, delegating subtasks to GPT-5.5 or Claude Opus for execution.

CI configuration further confirms: .github/workflows/pi-ai-provider-e2e.yml tests GPT-5.5 (Azure OpenAI) and Claude Opus 4.8 (Anthropic) via the llm-pi-ai adapter. If media reports of "supporting nearly 40 model providers" hold, the most likely path is through llm-pi-ai (in our obtained source code, the packages/ directory is incomplete; we couldn't verify the full provider list file by file).

What does this decision imply? DSH doesn't position itself as a competitor to Claude Code. It positions itself as Claude Code's orchestration layer. Competitor models aren't threats—they're pluggable components in DSH's toolchain. This posture completely contradicts the "model-bound" framing.


Decision 8: 100% Coverage + ts type-equiv—Infrastructure-Grade Engineering Discipline

From AGENTS.md:

"test:coverage, not test, is the CI coverage gate."

Per-file 100% on packages/*/*/src. This isn't a goal; it's a gate (note: AGENTS.md declares the project is in pre-release with SESSION_FORMAT_VERSION = 0 with no compatibility promise; this 100% gate may be an extreme pre-release standard).

ts type-equiv is a mechanism unique to DSH: type declarations pasted in documentation are marked with ```ts type-equiv, and the verify-type-equiv gate extracts declarations from source code and runs them through a TypeScript parser to assert documentation matches source. Source types change, the documentation gate fails.

package.json contains over 40 verify-* / gen-* scripts—ranging from Markdown line-ending checks to runtime closure verification to Cordis config directory validation. knip --treat-config-hints-as-errors—even configuration hints are treated as errors.

Every non-trivial change must include an Agent Note (design decision record) in the same PR.

According to public records, Cui Tianyi worked at Jane Street for nine years. This engineering discipline carries clear financial-system DNA—high-frequency trading systems don't run full regressions locally, but CI runs full coverage every time. Locally, you run only the relevant checks (AGENTS.md: "Never default to the full suite"); CI handles comprehensive coverage.

What does this decision imply? These aren't startup-level quality standards. If DSH only wanted to build a coding agent MVP, it wouldn't need 40 verify gates and ts type-equiv. This level of engineering discipline is only worthwhile when you're building infrastructure that others will depend on.


Decision 9: MIT License—Competing for Standard, Not Market

DSH chose MIT—the most permissive open-source license. It allows commercial use, modification, and re-licensing, requiring only that the copyright notice be retained.

Compared to Claude Code (closed-source commercial product) and Codex (closed-source API service), MIT open source is a radical choice.

What does this decision imply? MIT maximizes community adoption. Enterprises can deploy and modify internally; cloud providers can offer hosted services; competitors can draw architectural inspiration. DSH is betting that: competition at the Harness layer isn't product competition—it's standard competition. Whoever controls the open-source standard controls the distribution channel between developers and models.


Nine Decisions Point to the Same Judgment

Connect the nine decisions:

  1. Investing in a programming paradigm → Not building a product, building infrastructure
  2. No privileged core → Microkernel, not modular product
  3. Three-plane separation → Multi-tenancy as design premise
  4. Event-driven lifecycle → Thorough separation of policy from mechanism
  5. Event Sourcing → Financial-system-grade state management
  6. Four-mode spectrum → Complete spectrum from sandbox to metaprogramming
  7. Competitors as plugins → Not competing, orchestrating
  8. Infrastructure-grade engineering discipline → Preparing for others to depend on it
  9. MIT license → Competing for standard, not market

DSH isn't building "China's Claude Code." It's building the operating system layer for Agents.

But this operating system currently only executes—it doesn't learn. The architecture provides every interface needed for evolution—event streams, plugin hot-reloading, skill system—but the feedback loop is empty. The session log records everything, yet no component learns from it.

If DeepSeek closes this loop in subsequent versions—a plugin that automatically extracts patterns from execution history, generates skills, and optimizes toolchains—then DSH won't just be an Agent operating system. It'll be the first Agent operating system that grows.

If they don't—then "everything is a plugin" and the cordis preset's self-modification capability will ultimately be just a very good manual configuration system.


Risks

First: Long-term technical debt from the Cordis base. A vendored fork means every upstream update requires a manual merge. As DSH and Cordis each evolve independently, the diff will only grow.

Second: Security surface of the cordis preset. cordis_mount executes model-written JavaScript—equivalent to shell access. v0.1's candor is commendable, but production environments need sandboxing.

Third: Contributor barrier. ts type-equiv, 40+ verify gates, 100% coverage—the entry barrier for external contributors is non-trivial. MIT lowers the legal barrier, but engineering gates raise the technical barrier.

Fourth: The distance from v0.1 to v1.0. Architectural design can lead, but plugin ecosystem, community adoption, cross-platform stability, and production-grade reliability—each requires time. Many of the 78 plugin lines are still iterating rapidly (AGENTS.md: "THERE WILL BE COMPATIBILITY-BREAKING CHANGES").


Data Sources

  • DeepSeek Harness repository source code v0.1 developer preview (github.com/deepseek-ai/deepseek-harness)
  • AGENTS.md (monorepo structure, engineering discipline, CI standards)
  • docs/architecture.md (architecture design document, obtained via GitHub raw)
  • docs/development.md (development guide, TypeScript dual-aggregate design)
  • apps/cli/composition.md (base composition plugin diagram)
  • apps/cli/config/agent-presets/ (complete YAML for 4 presets)
  • .github/workflows/ (CI configuration, including pi-ai-provider-e2e)
  • package.json (monorepo workspace, scripts)

Constraint statement: This article is based on the DSH v0.1 developer preview repository's complete apps/ directory source code, AGENTS.md, docs/architecture.md (obtained via GitHub raw), docs/development.md, composition.md, complete YAML for all 4 agent presets, CI configuration, and package.json. The packages/ directory was not fully obtained due to tarball truncation; some conclusions involving packages/ are inferred from the AGENTS.md package list and composition.md plugin lines. All paragraphs quoting architecture.md verbatim originate from the file obtained via GitHub raw and could not be verified word-by-word in the local repository.

This article does not constitute investment advice. Analysis date: 2026-08-13.