← Learnings Hub

dsh, Cordis, and software you can reshape

DeepSeek Harness is an open-source agent harness with no privileged core. The loop, the tool registry, the session log, the model adapters and the permission policies are all plugins on one Cordis context tree. Cordis supplies the effect and coeffect machinery that makes a plugin removable, and dsh runs a step-and-turn agent loop on top of it.

No model is called. The playground is a deterministic model of the mechanics described here. It needs no key or network and loads no plugin. Every count and state word is computed from the controls. What it leaves out is listed at the end of the playground section.

How dsh is built

1. What dsh is

DeepSeek Harness (dsh) is an open-source agent harness from DeepSeek AI. It is MIT-licensed, written in TypeScript, and in developer preview; the README says so in capitals: “THERE WILL BE COMPATIBILITY-BREAKING CHANGES.” npx @deepseek-ai/dsh web starts it and serves a Web UI on http://127.0.0.1:3080 by default. Everything here comes from a clone of github.com/deepseek-ai/deepseek-harness at commit fcc0ad4.

“It is built on an everything-is-a-plugin architecture and powered by [Cordis]” (README.md:7)

Cordis is vendored into the repository as nine packages (vendor/README.md). Two are foundation libraries: @deepseek-ai/cosmokit 1.9.0 and @deepseek-ai/schemastery 3.19.0. The rest are @deepseek-ai/cordis 4.1.0 and six plugin packages under the @deepseek-ai/cordis-plugin-* scope: loader, include, group, hmr and logger-console at 1.1.0, and timer at 1.2.0.

The stack uses the architecture doc's own terms. A profile is “a named composition stored in the Harness home… it lists the bundles it stacks, holds any out-of-tree plugins it installs, and keeps the user's own cordis.patch.yml”, and a bundle “is a distribution format for Cordis config rows and the code they mount, so whatever it inserts stays patchable by the layers above it” (docs/architecture.md). dsh-base is “the shared first layer of the web, headless, sdk, and acp profiles”.

2. Spatiotemporal composability

Cordis implements a paper by Yifan Shi, Wei Zhang and Tianyi Cui (Peking University and DeepSeek-AI): A Programming Paradigm for Spatiotemporal Composability (arXiv 2608.25512). The abstract defines both axes:

“temporal composability, the ability to completely revert a component's side effects upon removal, and spatial composability, the ability to declare and reactively manage inter-component dependencies.”

“we formalize revertible effects, in which every context transformation carries an inverse that the runtime holds, establishing temporal composability local to one component. We formalize reactive coeffects, in which every context change is classified against a component's coeffect specification to drive its activation and deactivation, establishing spatial composability local to one component.”

The paper then unifies the two:

“We then unify the effect context and the coeffect context into a single context type and mediate every effect and coeffect through it, yielding a discipline we call the context paradigm; the mediation induces an observational equivalence up to which the effects of distinct components interleave without disturbing one another.”

That is one system, not two: a single context type carries both halves. The effect context remembers what each component changed, so removal can invert it (time). The coeffect context holds each component's declared requirements and checks them against every change, so the component can be switched on and off (space). The abstract lists a calculus of dynamic composition and a metatheory carrying “spatiotemporal composability from a single component to a whole system of interleaved components”, and it describes Cordis as “a meta-framework of spatiotemporal composability that provides a core library with effect tracking and coeffect resolution, as well as a declarative component loader with configuration reconciliation and hot module replacement.”

AxisThe paper's wordWhat it buys a programWhere dsh shows it
Temporalrevertible effects: “every context transformation carries an inverse that the runtime holds”A component can be removed completely: its registrations, listeners and services go away because each carried an inverse.Unmounting a plugin, restarting a fiber, hot-swapping a module (§4, §8)
Spatialreactive coeffects: “every context change is classified against a component's coeffect specification to drive its activation and deactivation”A component declares what it needs. It activates when the requirement is met and deactivates when it is not, with no hand-written ordering.inject, ctx.<key> service claims, per-agent scopes (§3, §6)

Two misreadings. “Spatiotemporal” here is not sandboxing, and it is not replay. Sandboxing confines a process's file access, while the paper is about when a component may be active and how its departure is undone. Replay rebuilds a session from a log. The paper's temporal axis is something else: the runtime holds an inverse for each registration, and nothing re-runs history. dsh has sandboxes and an append-only session log too, and both are separate mechanisms from the one this word names. Only the paper's abstract was readable: the arXiv HTML view 404s, and the PDF's subset-encoded fonts did not extract to text. The formal claims above are quoted from the abstract, and no theorem statements are paraphrased. The mechanisms themselves can be checked in the vendored source (§4).

3. Context, Service, Plugin

ConceptThe source's own wordsWhat it is in practice
Context “Root and child dependency containers for Cordis plugins. A context is a proxy: normal property reads go through the service resolver, while extend(), isolate(), and intercept() create scoped child contexts without mutating their parent.” (vendor/cordis/src/context.ts) Every API is reached through ctx: ctx.tools, ctx.on(...), ctx.effect(...), ctx.plugin(...). There is one root context, and each child derives from it.
Service “Base class for services that expose a named API on ctx. Subclasses call super(ctx, name) from their constructor. The service is registered immediately and is automatically removed with the owning fiber.” (vendor/cordis/src/service.ts) A stable ctx.<key> that other plugins find by name: ctx.sessions, ctx.tools, ctx.llm, ctx.shell.
Plugin “A plugin is a object that implements Service. It can be a function with optional inject and apply(ctx) fields, or a Service subclass whose lifecycle Cordis mounts into the current context.” (docs/cordis-primer.md) The unit of distribution and of removal. A plugin loaded once is a fiber: “one loaded plugin instance: its lifecycle state, validated config, and registered effects” (docs/cordis-api/fiber.md).

The fourth of the primer's five ideas is a table of dispatch modes. The mode is part of an event's contract, not a detail of the call site:

ModeAwaited?Dispatch orderHas return value?
emitNolisteners observe in registration orderNo
waterfallNolisteners observe in registration orderYes
parallelYesall listeners observe the event in parallelNo
serialYeslisteners observe in registration orderYes
bailNolisteners observe in registration order until one bailsYes

A waterfall is around-middleware: “A listener receives (...args, next). Call next() to delegate the possibly wrapped result to the next service; return without next() to short-circuit.” That is how dsh can veto a claimed message from a plugin without the loop knowing the plugin exists.

The spatial axis in one line, from the bundle that composes the shipped product: “Row order carries no load semantics (activation is service-availability driven)” (packages/bundle/base/cordis.patch.yml). dsh-base's patch lists 99 rows in whatever order reads well. Each row declares the services it needs, and those decide when it activates, so there is no boot sequence to get right.

4. The runtime kernel

Everything below is from vendor/cordis/src/ at fcc0ad4, and each claim names its file.

Registration is an effect, and the effect holds the inverse

ctx.effect(execute, label) runs execute immediately and collects the disposer it produces. The method's doc comment:

“execute runs immediately; the disposers it produces are collected and run (in reverse order) either when the returned disposer is called or when the fiber unloads, whichever comes first. Calling the disposer twice is a no-op.” (vendor/cordis/src/fiber.ts, ctx.effect())

One effect's disposers are spliced out and walked in reverse, chained so an async teardown finishes before the next one starts.

for (const disposable of disposables.splice(0).reverse()) {
  if (task) task = task.then(() => runDisposable(disposable))
  else { … }
}

Is it LIFO? Within one fiber, yes. The fiber's own list comes back in reverse registration order: clear() in vendor/cordis/src/utils.ts ends with return values.reverse(), and the type doc says “Disposers run in reverse registration order when the owning fiber unloads”. It is not a single global stack, though:

  • Inside one effect, disposers run one after another, in reverse order (the chained task.then(...) above).
  • Across one fiber's top-level effects, the list is handed out in reverse order but started concurrently: _unload() does await Promise.all(this._disposables.clear().map(async (dispose) => …)). Reverse order, overlapping execution.
  • Across fibers, a provider waits: “Dependents are notified when this fiber leaves ACTIVE, but may still access its services during their own teardown, so the effects of this fiber are only disposed after every dependent has unloaded” (fiber.ts, _unload()). The order among sibling dependents is not promised anywhere.

Activation and deactivation share one code path

A fiber builds a dependency “epoch” from the uid of each implementation it injects. When that string changes, the same function reloads or unloads the fiber:

_refresh() {
  let epoch = `${this._revision}`
  for (const name of Object.keys(this.inject)) {
    const impl = this._store[name]
    if (!impl) { epoch = INACTIVE; break }
    epoch += ':' + impl.uid
  }
  this._setEpoch(epoch)
}

_setEpoch runs _reload() when the fiber was inactive and can now be satisfied, and _unload() in the other direction. This one function is the coeffect mechanism: “every context change is classified against a component's coeffect specification to drive its activation and deactivation.” The public form is ctx.inject(deps, callback), whose doc says the callback “is unloaded and re-run whenever a required service changes”.

A missing provider is not an error; the fiber sits in PENDING. The lifecycle states are PENDING (waiting for required services), LOADING (the callback is running), ACTIVE (loaded and providing), FAILED, UNLOADING (disposers are running) and DISPOSED (the fiber was removed and cannot restart).

Listeners are effects too

“The listener is removed automatically when the fiber unloads.” (vendor/cordis/src/events.ts, on())

register() wraps the listener install in this.ctx.fiber.effect(() => { hooks.push(...); return () => this.unregister(name, callback) }, label). A plugin cannot install a listener and forget it: the fiber that installed it owns it.

Timers get the same treatment only through the framework's timer service. cordis-plugin-timer implements ctx.timeout as an effect that returns () => clearTimeout(timer), and ctx.interval likewise.

The classic Node/JS plugin failureWhat Cordis does about itWhat it does not do
Lingering event listeners after a plugin is removedctx.on() is registered through ctx.fiber.effect() and returns the unregister call as its disposer; the fiber's teardown runs it.It does not track listeners registered outside a context. A module-level process.on is still yours to clean up.
Leaked singletons that outlive their ownerA Service registers itself in the constructor and “is automatically removed with the owning fiber”; the binding is a disposal, not a module-level variable.It does not stop a plugin from stashing a service in a module-scope variable; the object stays alive if you keep a reference.
Orphaned intervals/timeoutsctx.timeout() / ctx.interval() are effects whose disposer clears the timer, and a disposed pending ctx.timeout(delay) rejects rather than leaking.A bare setInterval is invisible to the kernel. “Use the timer service” is a convention the framework supports, not a sandbox it enforces.
Torn-down components still receiving workA provider's effects are disposed only after its dependents unload, and an INACTIVE_EFFECT error is thrown if a plugin tries to register on a dead context.In-flight async work is not cancelled for you; a plugin's own async body needs its own cancellation and its own disposer.

5. How dsh splits the agent runtime across the tree

“Every part of the product is a plugin, including the model adapter, the tool registry, the session log, and the agent loop itself, so each is replaceable from configuration.” (docs/architecture.md:9)

“There is no privileged core to patch: you extend dsh by mounting a plugin beside the others, and registrations are effects that unwind when their plugin unloads.” (docs/architecture.md:11)

Which plugin claims which key, from the architecture doc's core-package table and the generated capability graph:

Part of the productPackagectx keyWhat it owns
Agent execution loop@deepseek-ai/dsh-agent-loopctx.agentLoopthe default driver implementing the Agent interface: claims input, assembles, streams, executes tools, decides whether to stop
Live agent registry@deepseek-ai/dsh-agentctx.agentscreate/resume/dispose handles, agent/* events, per-agent scoped registrations
Tool registry@deepseek-ai/dsh-toolsctx.toolsthe scoped tool registry and the guarded execution pipeline (allow / deny / ask)
Session log@deepseek-ai/dsh-sessionctx.sessionsthe append-only SessionEvent log and the in-memory store; everything model-visible is logged
Prompt assembly@deepseek-ai/dsh-system-promptctx.systemPromptprompt sections and tool schemas, assembled per step
Model calls (the router)@deepseek-ai/dsh-llm + adapters such as dsh-llm-deepseek, dsh-llm-pi-ai, dsh-llm-replayctx.llmthe provider-neutral stream seam; each adapter registers a provider, and every caller talks to the seam
Permission policies@deepseek-ai/dsh-user-approval, @deepseek-ai/dsh-permission-presetsctx.approval, ctx.permissionPresetsask-before-risky-actions and the read-only / workspace-write / danger-full-access table; dsh-sandbox-policy is the config row that selects the sandbox mode those presets name

People assume the policies are welded in. In dsh-base's patch the approval policy is a config field on a row (policy: (process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask') and the presets are a table on another row. Changing the posture means changing a plugin's config, not editing the loop.

The architecture doc on what that buys: “Seams are why one provider swap changes the whole product. Filesystem and subprocess providers share one execution world, so pointing them at a remote sandbox moves Bash, PTY, and LSP with them, with no provider forks.”

Steps, turns and events

“A step is one model request plus the tools it calls. A turn is zero or more steps: it opens before its first input is claimed and closes once nothing is owed.” (docs/architecture.md)

The flow, cut down to the durable and interceptable points:

turn/start
  claim next-step input + one queued message
  assemble prompt sections + step-admitted tool schemas
  → agent/pre-step            reject | enter(messages)
  step/start
  agent/request → prepareCall()
  llm/stream → assistant/message
  tool/call → tools/pre-execute → tools/execute → tools/post-execute → tool/result
  step/end
  another request owed, or input arrived → next step
  → agent/turn-stopping
turn/end

Events fall into three domains, and the domain decides what a listener can do with one. Session events are durable: they are appended to the log and broadcast through session/event. Agent events (agent/*) carry a live Agent (inbox, step, status, request, validation, continuation) for work in flight. Capability events (fs/*, tools/*, telemetry/*) attach policy and adapters to a seam without importing the loop.

agent/pre-step, agent/request, llm/stream and the three tools/* events are waterfalls: their listeners must call next() to delegate. agent/turn-stopping is serial and has no next(). That is the difference between “you may veto or rewrite this” and “you may observe the decision that was made”.

On rejection the doc says: “agent/pre-step listeners accept, rewrite, or reject claimed messages; a rejected or empty first claim closes a durable turn without a step.” A turn that asks the model nothing is still a fact in the log, which is why the playground's rejection control grows the session while the step count stays at zero.

Above turns sits the goal. dsh-goal persists one objective across turns, resume, fork and restarts, and dsh-goal-round-driver “automatically continues an active goal in the same session while the agent is idle… Each round gives the model another turn toward the objective”, bounded by a round cap that defaults to 256. Exhausting it records the blocker code round-limit. So goal ⊃ rounds ⊃ turns ⊃ steps is a composition across four packages. The docs do not draw it as a hierarchy, and no single package nests another.

6. Scopes and lifetimes

It is tempting to picture every conversation, or every turn, as a child context with its own plugin lifetime. The source does not work that way. There is no ctx.fork() in the vendored framework: a case-insensitive search for fork over vendor/cordis/src/ returns nothing. Cordis has three child-context constructors and one ownership rule.

  • ctx.extend(meta): “Create a child context with extra metadata… The child prototypally inherits every property of this context… The parent is not mutated.”
  • ctx.isolate(name, label): “Create a child context with an independent service scope for name… a different implementation can be provided without affecting the parent scope.”
  • ctx.intercept(name, config): per-plugin config for plugins started below that context.
  • ctx.plugin(...) returns a fiber whose dispose() unwinds that plugin's registrations, after its dependents have unloaded (§4).

dsh-scope adds a scoped registration context: createScope(ctx, key) calls ctx.plugin(scope), then returns fiber.ctx.extend({ [kScope]: key }), so everything registered through it is “both scope-visible and scope-lifetime”. The registries in the core group build on it: “a tool registered through agent.ctx is visible only to that agent”.

EntityIs it a Cordis context?Lifetime
The applicationOne root Contextthe process
A pluginA fiber whose ctx is parent.extend({ fiber })mount → dispose; reload on config or code change
An agent preset's service rowAn isolate() child context: “a service row there needs an isolate realm” (docs/architecture.md)as long as the preset is composed
A profile's plugin setNot a child context: later bundles and cordis.patch.yml layers replace rows by id (§7)as long as the profile is composed
An agentYes, a scoped context minted per agent (createScope(loopCtx, this) in agent-loop/src/agent.ts), not a new rootctx.agents.create() / resume() → dispose(); the handle “stops the loop, unregisters, removes the session, unwinds the scope”
A turnNo. A durable sequence in one long-lived agent: turn/start … turn/end in the session logdata, not a context: it does not mount or unmount anything
A subagentA separate agent, so a separate scope, and possibly a separate process or productits own session and handle; providers range from spawn-in-process to ACP/Codex/Claude Code

A turn is not a Cordis subcontext with its own plugin lifetime. It is a durable data structure inside one agent's lifetime, and the unit that gets an isolated registration context is the agent. For extension design, per-turn behaviour belongs in an agent/* listener, not in a plugin mounted for the turn.

dsh-experimental-inspector publishes a CordisTreeSnapshot in which “every Fiber is a child of fiber.parent, owns exactly one Context child for fiber.ctx… Context-only extend(), isolate(), and intercept() layers remain direct Context descendants.”

Malleable programs

7. The swap surface

In a malleable program the important decisions are configuration, not code you cannot reach. Each of these capabilities is a seam with a declared interface, one or more provider packages, and consumers that name only the interface:

CapabilitySeam (definition)Providers you can swap betweenConsumer that does not change
Shell executiondsh-shell (ctx.shell)dsh-bash-local (the process's own authority) · dsh-bash-sandbox (confines every command via ctx.sandbox)dsh-tool-bash
Filesystemdsh-fs (ctx.fs)dsh-fs-local · dsh-fs-sandbox · dsh-fs-sshdsh-tool-fs
Confinementdsh-sandbox (ctx.sandbox)dsh-sandbox-local (bwrap, landlock, Seatbelt, Windows ACL) · dsh-sandbox-ssh · policy via dsh-sandbox-policyevery consumer that wraps argv before spawning
Model accessdsh-llm (ctx.llm)dsh-llm-deepseek · dsh-llm-pi-ai · dsh-llm-replaythe agent loop and compaction
Condensationdsh-compaction (backend)dsh-compaction-basic, plus image-offload and tool-result-pruner in front of itthe loop's pressure path
The loop itselfctx.agentLoopany package that registers an Agent factoryctx.agents, the UI, hooks, orchestrators

The patch layer is what makes a swap a user action: “A patch targets a row by id and replaces its whole config, or inserts new rows.” A profile's ordered bundles, its cordis.patch.yml, the home patch and then any --patch overlays are applied to an empty entry list. dsh --profile web --dump-config prints the result, and “any row it prints can be replaced by a patch of your own.”

At runtime, dsh-plugin-manager does the same job: “Enable or disable individual plugin entries, select installed bundles, and install or remove external bundles. With HMR enabled in YAML, configuration changes apply immediately; without HMR, the running composition remains until restart. Changes affect every session using the profile.”

8. Effect trees and hot swaps

A user-installed behaviour registers listeners, prompt sections, tools and adapters, each through ctx.effect() or ctx.on(), and unmounting takes them back in reverse order. It is the machinery from §4, with the same guarantees and no more:

  • Guaranteed: every registration made through the context has an owner (the fiber), disposal is a single code path, a fiber's own registrations come off in reverse registration order, a provider's effects are disposed only after its dependents unload, and double disposal is a no-op.
  • Not guaranteed: that the heap is empty afterwards. “Zero leaks” depends on the plugin: timers through ctx.timeout() / ctx.interval(), listeners through ctx.on, no module-level caches. The kernel does not enforce it. A plugin that keeps a global reference, a bare setInterval or an uncancelled promise leaks, and the framework will not notice.

The vendored HMR plugin (@deepseek-ai/cordis-plugin-hmr) “watches source files, traces Node's module graph, clears affected module caches, and reloads only the plugin entries that depend on changed application files”. dsh's own dsh-hmr is the same service under ctx.hmr, with one coordinated queue for module changes, Include refreshes and profile configuration. Profile recompositions “also replace plugins whose loaded files below the profile directory changed on disk… therefore takes effect without a restart at the next such recomposition”. A replacement that fails to load “stops the previous plugin and is reported as failed with its load error instead of as a restart”, so a plugin never half-loads.

What survives a swap is whatever lives in a different plugin. The session is the main case: “Model-visible means logged. Every model request must be reconstructable from the log”, and “Fork, resume, transcripts, telemetry, and persistence all derive from these durable settlements.” You can swap the loop, the shell provider or the compaction strategy. dsh-session owns the log and the transcript derives from it, so the conversation stays put. Anything the swapped plugin held in memory does not survive: in-flight async work, a queue built up inside the old loop, a cached summary that existed only as a field on the old instance. Those are re-derived or lost.

Where a restart is needed. HMR is config-only by default in dsh-base (config: { root: [] }: profile configuration reloads, module roots are opt-in). Headless, SDK and ACP bundles disable it in YAML, and source watching requires root: ["."]. Package installs run outside HMR's queue, and the boot docs say some resolution changes need a restart too: “Installation mappings and local overrides still require a restart.” Configuration and plugin code can change live. Package installation needs a restart, and a broken load needs a corrected file.

9. What to copy

  1. Every registration returns a disposer, and the runtime holds it. That is a return type, not a convention in a guide. If an API can add something, its return value should remove it, and the owner should be an object with a lifecycle (ctx.effect() here).
  2. Capabilities are seams with three roles. A definition, one or more providers, and consumers that name only the definition. A seam you cannot swap has been named, not designed.
  3. Dependencies are declared, not sequenced. “Load order is expressed through service requirements rather than manual boot sequencing.” If your plugin system needs a boot order, it is a dependency graph drawn by hand.
  4. Activation and deactivation are the same code path. Compute an epoch from what a component needs; reload when it changes, unload when it does not hold. That is the whole coeffect mechanism, in about 20 lines.
  5. State that must outlive a swap lives in a log, not in the component. Event-sourced state is what makes hot swapping safe. The component can be replaced because it never owned the record.
  6. Make the tree inspectable. dsh ships an inspector that exports the fiber tree as a snapshot; a plugin system whose composition cannot be printed is one you debug by restarting.

10. Playground

A. Mount and unmount plugins

The list is the current composition. Press a plugin to unmount it: the plugins that depended on a service it provided deactivate first, then its registrations come off the ledger one at a time, in reverse registration order. Press it again to mount it, and it re-registers at the end of the ledger.

Loading the composition…

B. The effect ledger

0 registrations are live. Each row is one place where a plugin changed the context, with the inverse the runtime holds for it. The count returns to zero when the last plugin is unmounted.

    Nothing has unwound yet.

      C. The services on the root context

      Which plugin currently claims each ctx key. A key with no provider is not a crash. Consumers that inject it go PENDING: mount dsh-tool-fs before its provider and it waits for ctx.fs.

      D. Swap the loop and the shell

      The loop is a plugin. Swapping its module unloads the current fiber, which unwinds every registration, and mounts the new generation in the same context. The session log does not move, because it belongs to dsh-session, not to the plugin being swapped. The shell control swaps ctx.shell between dsh-bash-local and dsh-bash-sandbox. Nobody edits dsh-tool-bash: it loses the service, unloads, sees the new provider and reloads, so its three rows jump to the end of the ledger.

        E. An isolated scope

        ctx.isolate("shell") gives a subtree its own ctx.shell without touching the root's. Mount a sandbox provider in that scope and unmount it: the root ledger is identical before and after. (There is no ctx.fork(). The three constructors and fiber ownership are the whole scoping API.)

            F. A turn and a rejection

            A step is one model request plus the tools it calls, and a turn is zero or more steps. Choose reject and run a turn: agent/pre-step refuses the claimed message and the turn closes durably with zero steps. The events are in the log, and nothing was asked.

              G. A goal and its round cap

              dsh-goal persists one objective across turns, and dsh-goal-round-driver continues it while the agent is idle, one round per turn, until the round allowance runs out. The shipped cap is 256 (defaultMaxGoalRounds). The slider sets a lower cap so you can watch it block. Running out of rounds is not an error: it records the blocker code round-limit.

              What the playground leaves out

              • The registration lists. Each plugin's one-to-three ledger rows and its inject list are examples written in the docs' vocabulary, not registrations traced from the clone. Every total the panel prints is arithmetic over that list, not a measurement of dsh. Three lists were checked against the source and follow it: dsh-tools injects systemPrompt, dsh-goal injects agents and sessionProjections, and dsh-agent-loop dispatches agent/pre-step (a waterfall) and agent/turn-stopping (serial) rather than listening for them.
              • Token counts. The per-tool schema sizes (bash 300, read 190, edit 220, write 200) are illustrative. The clone's schemas were not measured.
              • Concurrency. Cordis starts a fiber's top-level disposers in reverse order but concurrently (Promise.all). The animation is sequential, so it shows the order and not the overlap.
              • Sibling order. Cordis guarantees reverse order within a fiber and dependents before their provider. Among several dependents of one provider the order is not promised, and the model picks reverse activation order.
              • Module loading. The hot swap is one modelled generation boundary. No file is watched, no module graph is traced, no cache is cleared; dsh-hmr does all three.
              • Config, loader and patches. The composition is a mounted set here, not a profile of ordered bundle rows, cordis.patch.yml layers and !!js expressions.
              • Isolation. ctx.isolate is modelled for one service name; the real one can shadow any name. It resolves a service name and confines nothing, and neither does dsh-scope, whose README says the scoped-registration primitive “routes trusted same-process plugins; it is not a sandbox or an authority boundary”.
              • Real work. No command runs, no tool executes, no model is called, no session is persisted. The session log is a list of typed strings, not SessionEvent payloads.
              • The event vocabulary. The turn flow shows the documented sequence, not every event. request/header, request/context, assistant/attempt, the tools/* pipeline stages inside one tool call and the internal/* events are flattened or omitted.

              11. Easy to get wrong

              1. A turn is not a Cordis subcontext. Turns are durable records inside one long-lived agent. The isolated registration context belongs to the agent (§6), so per-turn behaviour is an agent/* listener, not a plugin mounted for a turn.
              2. There is no ctx.fork(). Cordis 4.1.0 as vendored has extend(), isolate() and intercept(). Scoping is a child context plus fiber ownership, which is what the playground's isolated scope shows.
              3. The sandbox covers file access. dsh-bash-sandbox's own summary says “network access and process visibility remain outside its guarantees”, and a command fails with SANDBOX_UNAVAILABLE rather than running unconfined. “Sandboxed” does not mean “contained”.
              4. The goal cap bounds continuation, not work. dsh-goal “stores goal state but does not schedule work”, and continuation permission is process-local, not durable. Blocking with round-limit is a policy outcome, not a failure.
              5. dsh is a developer preview. Its README promises compatibility-breaking changes, so every package name and file path here is pinned to commit fcc0ad4, not to a version.

              Where this comes from

              Read from a clone of github.com/deepseek-ai/deepseek-harness at commit fcc0ad4 (MIT). The files each claim rests on:

              ClaimFile
              everything-is-a-plugin; Cordis; MIT; developer previewREADME.md, LICENSE
              profiles, bundles, dsh-base, core packages, turn flow, three event domains, waterfallsdocs/architecture.md
              the five Cordis ideas, dispatch modes, waterfall semanticsdocs/cordis-primer.md
              ctx.effect, ctx.fiber, the dispose order, dependency epochs, listener ownershipvendor/cordis/src/fiber.ts, events.ts, context.ts, service.ts, utils.ts
              ctx.timeout / ctx.interval as effectsvendor/timer/src/index.ts
              seam definitions, providers and consumers; ctx.shell, ctx.fs, ctx.sandboxdocs/capability-seams.md, packages/shell/*, packages/fs/*, packages/sandbox/*
              what dsh-base mounts, and the permission posturepackages/bundle/base/cordis.patch.yml
              agent lifetimes, scoped contexts, createScopepackages/core/agent/README.md, packages/core/scope/src/index.ts, packages/core/agent-loop/src/agent.ts
              hot module replacement and configuration reconciliationpackages/boot/hmr/README.md, vendor/hmr/README.md
              goals, rounds, the cap and the round-limit blockerpackages/goal/goal/README.md, packages/goal/goal-round-driver/README.md
              the cordis tree snapshot the inspector publishespackages/experimental/inspector/README.md
              the two axes, revertible effects, reactive coeffectsarXiv 2608.25512, abstract

              The playground's arithmetic is in site/harness/runtime.js and its rendering in site/harness/app.js. A number that disagrees with a control is a bug in one of those files.