Why DeepSeek Harness Uses a Cordis Plugin Tree
DeepSeek Harness assembles a Cordis plugin tree so profiles can compose and replace capabilities through ordered configuration layers while services, dependencies and cleanup govern the running result.
DeepSeek Harness: What is the tree?
The architecture reference says every product component is a plugin, including model adapters, the tool registry, Session logging and the agent loop. Plugins contribute services, typed events and reversible effects to a shared context. A running dsh is a tree assembled at startup, not a single fixed set of hard-coded components. The reference describes extension as mounting a plugin alongside others rather than patching a privileged core.
The Cordis primer explains the mechanisms behind that structure. A context holds services under stable keys; a plugin declares dependencies and can register effects or event listeners. The tree is a composition and lifecycle model. It is not a security guarantee about the code that is mounted.
DeepSeek Harness: How do profile and bundle layers fit?
A profile is a named assembly stored in Harness home. It lists bundles, stores out-of-tree plugins installed for that profile and retains its own cordis.patch.yml. Bundles distribute Cordis configuration entries and mounting code. The architecture reference says their package.json declarations use dsh.profile to list a profile's bundles and dsh.bundle to identify a bundle's patch.
| Layer or concept | Role |
|---|---|
| Bundle patches | Ordered contributions named by the profile |
| Profile patch | User changes for that profile |
| Home patch | Machine-local layer shared across profiles |
--patch overlays | Additional command-line layers applied in argument order |
| Runtime tree | Mounted plugins and their active services and effects |
Layers apply to an initially empty entry list. A patch targets an entry by id and replaces its entire config, or inserts a new entry. A preset patch applies these operations inside the target's config.plugins, using the same layer precedence. This means a later layer can alter a bundle contribution without editing the bundle itself. It also means replacing a row requires preserving any configuration values that should remain: the config is not deep-merged.
The architecture describes dsh-base as the shared first layer of the shipped web, headless, sdk and acp profiles. Their application bundles add different hosts. sdk-minimal is the documented exception: its single bundle contains an explicit SDK tree and does not apply dsh-base. The same framework can therefore assemble different products without implying identical capabilities in every profile.
DeepSeek Harness: How do services and dependencies shape activation?
The primer describes services at stable context keys such as ctx.tools, ctx.llm and ctx.sessions. Consumers use the key instead of importing a particular implementation. Plugins declare required services through inject; Cordis waits until those services are ready before starting the dependent plugin. That expresses an ordering relationship through dependencies rather than a manually maintained startup sequence.
Typed events provide another communication path. The primer names emit, waterfall, parallel, serial and bail for different dispatch patterns. It recommends events for interception and policy, and direct service methods for direct capability calls. A plugin registration can be an effect, not just a static configuration row: listeners, tool schemas and other contributions need lifetimes tied to their owner.
According to the primer, ctx.effect() or helpers such as ctx.on() support reversible registrations. Reload or teardown removes the associated effects. This makes replacement and lifecycle management possible, but a plugin must still correctly manage resources that require explicit cleanup. A declared dependency also does not install a missing service; it describes what must be available before activation.
DeepSeek Harness: How can I inspect my own composition?
-
Identify the profile you actually start. Its bundle list and patches determine the assembly; another profile can have a different tree.
-
Run the architecture reference's inspection command:
dsh --profile web --dump-config -
Trace the relevant entry and the layers that contributed or changed it. The config precedence guide explains why later layers replace the whole config for a targeted row.
-
Check the plugin's declared dependencies and the services in the composition before diagnosing a plugin that has not activated. Inspect actual startup errors for the environment at hand.
-
Change one relevant layer and verify the resulting behavior. Whether a file edit reloads depends on the selected composition; do not assume all profiles watch configuration.
The architecture says YAML controls HMR: base enables configuration watching, while Headless, SDK and ACP disable it and sdk-minimal does not include it. Profile patches can override defaults. A printed composition is useful evidence about selected entries; it is not proof that all plugins successfully activated or that their behavior is correct.
Consider a profile that includes a bundle and then changes one of its entries. The bundle supplies the initial row; the profile patch can target its id; the home patch and command-line overlays apply later. If a later layer supplies a replacement config, omitted keys are not inherited from the earlier row. This explains both the flexibility and the practical need to inspect the full effective configuration before editing a patch.
The runtime tree is distinct from the list of installed packages. Installation can put code where the profile can resolve it, but activation also depends on the selected entries, their configuration and required services. When an expected capability is absent, inspect each step separately: source resolution, configuration composition, service readiness and the resulting registration. A failure at one step should not be diagnosed solely from another step's success.
DeepSeek Harness: What are the limits and safety boundaries?
Composition makes replacement possible, but compatibility depends on the actual service contract and dependencies. A similarly named plugin is not automatically interchangeable. Check its implementation, configuration and expected service interface before replacing an entry. Whole-config replacement can remove values or expressions another layer depended on, so compare the effective row carefully.
A plugin can execute code and register side effects. Inspect the exact code and dependencies you intend to load, and test changes with appropriate data and permissions. A successful mount, reversible registration or plugin listing does not make a plugin safe. See the first plugin tutorial for the local development workflow.
DeepSeek Harness: Which terms matter?
- Cordis: the plugin framework underlying the Harness composition.
- Profile: a named assembly of bundles and profile-specific changes.
- Bundle: a distribution of configuration entries and mounting code.
- Service: a capability exposed at a context key for other plugins.
- Effect and disposer: a registration and its associated cleanup during removal.
Frequently asked questions
Are all profiles identical?
No. Profiles compose different bundles, and sdk-minimal is an explicit exception.
Does a patch deep-merge config?
No. A targeted row receives a whole config replacement.
Does inject install a service?
No. It declares a dependency that must be ready.
Sources
Every claim in this article was checked against the sources below. Community discussions are user reports, not official behavior.
This is an independent community article, not official DeepSeek documentation. Listing a plugin in the registry is not a security review.