Skip to content

Subsystems

One page per subsystem of the DeepSeek Harness: what it is, the data structures it moves, and — where a ctx service or event scope backs it — a generated Cordis API section carrying its service and event reference. The folder complements architecture.md, which describes behavior across subsystems (the service map, the session/turn/step lifecycle, the event taxonomy); each page here is the reference for one subsystem's vocabulary and wiring.

PageOwns
core.mdhow packages/core controls the agent loop: the package-by-package loop description, agent creation and ownership (AgentHandle), the Agent handle's delivery/cancellation/interception contracts, and the repo-wide type patterns (…Map → derived-union, branded ids)
llm-streaming.mdthe packages/llm conversation types — Message/ContentBlock, the assembled model request, the StreamChunk wire protocol and adapter contract, BlockAssembler, and the LlmAdapter provider contract
token-meter.mdimmutable scalar and positional replay measurements with consumed-log revisions
scope.mdscoped registration identity, dispatch carriers, and the owned Scope context
typert.mdRemote invocation descriptors, lookup/Context declarations, Typert registries, and the Host Gateway/Client API boundaries
goal.mdpersisted goal identity, lifecycle snapshots, activation, change records, and round attribution
schedule.mdSession-local reminder records, durable transitions, active views, and ordinary-conversation delivery
commands.mdthe human-command registry service: definitions, adapter discovery, direct invocation, results, and parsing views
session.mdthe full SessionEventMap variant catalog, TurnTrigger/TurnEndReason, deriveMessages(), execution enclosure, and standalone events
persistence.mdthe durability seam: SessionPersistence, JSONL + SQLite backends, session/flush, crash recovery, SessionHeader
settings.mdthe user-settings seam: SettingsNamespace registration, layered resolution (defaults → composition base → user document), owner scopes, hot commits
credentials.mdthe credential seam: CredentialRef references (never values) in configuration, per-operation resolution, UI-safe CredentialInfo, provider source layers
session-query.mdlogical records, bounded exact-event reads, relationship traces, semantic filters/documents, and full-text result pages
feedback.mdlifecycle-bound per-message feedback records, optimistic versions, sidecar persistence, and the Host Remote contract
session-title.mddurable title snapshots, cited source-message seqs, and the asynchronous provider contract
session-reference.mdstructured cross-session references: SessionReferenceInput/Candidate, prepared message contexts, the stable error taxonomy
system-prompt.mdper-assembly context, tool-provider results, prompt sections, and cooperative assembly
tools.mdToolDefinition full fields, the schema DSL, ToolExecution/ToolResult, tool-presentation UI types, and the guarded execution pipeline
user-questions.mdthe UI-backed human question/answer seam: AskUserQuestionRequest, answer/options vocabulary, provider API, error taxonomy
approval.mdthe one-shot user-approval seam: ApprovalRequest, ApprovalOutcome, per-session policy, audit events, and answerer contracts
attachment.mddurable image identity and metadata, validation inputs, verified reads, and the AttachmentStore seam
shell.mdthe bash executor seam: ShellExecRequest/Spec, ShellRunResult, background ShellProcess handles
subprocess.mdthe subprocess seam: fully-explicit SubprocessSpawnSpec, offset-based output readers, unclassified SubprocessOutcome, and the managed DSH_* environment vocabulary
terminal.mdpersistent terminal ids, backend/session contracts, send readiness, bounded reads, and owner-visible snapshots
sandbox.mdper-session policy resolution and the process-confinement seam: file-effect modes, execution/provider policies, ConfinedArgv, enforcement and fail-closed errors
code-runtime.mdthe code-execution seam: CodeRunRequest/Result, binding namespaces, captured logs, the CodeRunFailure taxonomy
extensions.mdversioned dynamic Cordis Plugins and Packages, Host/Client activation, approval, runtime inspection, and lifecycle teardown
filesystem.mdthe filesystem seam: FsTarget, read/write/edit outcomes, observed-file state, FsErrorCode
lsp.mdthe LSP navigation seam: LspQueryRequest/Result, LspProvider/Service, four operations, LspError
skills.mdthe skill service: discovery priority, SkillSummary/SkillDefinition, session-prefix catalog, model-facing skill loading
compaction.mdthe compaction seam: the compaction/* session events, CompactionResult, the CompactionEngine interface
subagent.mdthe subagent seam: the named-provider registry, SubagentStartRequest/Result/Run, the start-time-vs-runtime capability split
web.mdthe web access seam: WebSearchRequest/Result, WebFetchRequest/Result, WebFetchBody, provider availability, WebError
spill.mdthe spill storage seam: SaveTextSpill, SpillOwner/SpillSource, SpillRef, the branded SpillLocator
workflow.mdthe workflow seam: WorkflowStartRequest, WorkflowMeta, WorkflowRun/Result, the workflow/* event payloads, WorkflowError fatality
jobs.mdthe background-job runtime: branded JobIds, the producer contract, consumer views, and ctx.jobs service behavior
permission-presets.mdthe permission-preset layer: PresetSpec/PresetOption, the derived custom state, the log-only permission/preset event
plan.mdplan mode: the log-only plan/mode state, pending-selection flush, PlanModeConfig, the exit_plan_mode review arc
invariants.mdthe runtime-invariant registry: selection Config, InvariantInstaller/InvariantFailure, the empty-companion contract
web-server.mdthe HTTP carrier: WebRouteKind/WebRoute, match order, the claimable fallback seat, index taps
storage.mdthe storage subsystem: the backend contract (StorageBackend), StorageForms, DomainSpec/Domain, domain/changed
workspace.mdthe workspace registry: Workspace/WorkspaceId, registration and resolution, the session cwd relationship
client-modules.mdthe web plugin table: dsh.client declarations, WebBootGraph wire composition, the bundle route and index tap
session-projection.mdthe projection seam: SessionProjectionMap, the pure ProjectionDefinition unit, ProjectionSnapshot's consistent cut, the change feed
session-telemetry.mdthe outbound session-reporting capability seam: SessionTelemetryRecord/SessionTelemetrySeverity, the SessionTelemetrySink contract, and the session-telemetry/record redact waterfall

Type declarations and their JSDoc on these pages are source-equivalent and drift-checked by pnpm run verify-type-equiv (see development.md). Ordinary blocks preserve complete declarations; public-api blocks preserve body-stripped public class declarations. Cordis services and events use each page's generated Cordis API section.