* feat(workspace): stop a Session's running work before archiving it Archiving was a pure visibility write, so a Session archived mid-turn kept running out of sight. The Workspace registry now owns archive admission through two Host events: `workspace/session-activity` reports what still runs and refuses the plain archive as `workspace/session-active`; `workspace/session-stop`, requested with `stopActivity`, stops that work the way the user's own stop actions do before the archive write. The API Session Controller reports and stops turns, subagent descendants, and owned jobs and rejects any model step for an archived Session; the Schedule plugin reports and deletes active reminders. The sidebar turns the refusal into a stop-and-archive confirmation listing the Host's answer. * test(workspace): pin the widened archive signature and prove child liveness by heartbeat The Client inspect catalog spec pins archiveSession's new options parameter, and the archive e2e reads the Bash child's liveness from a heartbeat file instead of a pid: the Linux sandbox runs the tool in its own PID namespace, so the pid it reports is not comparable from the test. * test(workspace): cover the archive-admission providers and dialog to the per-file gate Drop the provider's unused disposer and the dialog's unreachable confirm guard, read reminders without a catch that no composition can reach, and add the cases the coverage lane found missing: a stop without a jobs registry, a looping lineage, a descendant whose projections reject, the dialog's Escape guard and non-Error reason, and a family merged by another provider. * fix(workspace): write the archive before stopping, gate subagent lineage, and delete reminders under the schedule barriers Review round on #4765. The registry now writes the archive set before it dispatches `workspace/session-stop`, so the durable set already gates every wake the stops induce; the controller's `agent/pre-step` gate also blocks subagent descendants of an archived Session and contains each cancel or kill on its own. The Schedule plugin's stop listener runs as a management delete in the agent's transaction queue between the same two persistence barriers the `schedule_delete` tool uses. The confirm dialog selects singular or plural English lines and keys list rows by index. Docs: archive-admission section with type-equiv blocks on the workspace subsystem page, write-first order and residual windows in the READMEs and the Agent Note, and the missing zh reminders sentence. * test(web): scope the question composer's New Session wait to the Sessions tree The wide sidebar's New Session button carries the same visible label as a fresh session row, so the unscoped `getByText` either settled on the button before the row existed or hit a strict-mode violation once the row rendered first, which is how the snapshots lane failed on ece68c2ab5. Waiting inside the Sessions tree names the row alone. * fix(schedule): answer archive admission from the owned runtime's fold, not the projection registry The `sessionProjections.snapshot` API is the Client projection view and is not a Host read path (review on #4765). `ScheduleRuntime.activeRecords()` folds the live log the way every drive does, and the archive-admission listeners ask the owned runtime for that fold: a session without a live agent or without an owned runtime has nothing armed to fire, so it reports nothing and has nothing to stop. Covers the runtime-less agent, a fold that turns unreadable at the persistence barrier, and the stopping/faulted runtime answering nothing. * refactor(subagent): report and stop subagent descendants from the Subagent runtime The `subagent` family of archive admission moves out of the API Session Controller into `dsh-subagent`, which records the lineage at delegation and owns the descriptor (review on #4765): `SubagentRuntime` answers `workspace/session-activity` with the running descendants, labelled from each child's descriptor through a live Session observation, and `workspace/session-stop` by cancelling each of them with the parent cause. The controller keeps turns, owned jobs, and the lineage step gate, and composes its provider through `ctx.plugin(SessionActivityProvider)` with declared injections instead of a bare installer call. `dsh-workspace` becomes an optional type-only peer of `dsh-subagent`. * refactor(jobs): answer archive admission for owned jobs from the job registry seam The `job` family moves out of the API Session Controller into `dsh-jobs` (review on #4765): the seam's constructor installs the `workspace/session-activity` and `workspace/session-stop` listeners for every implementation through the abstract `list` and `kill` alone, so the controller no longer knows the jobs vocabulary and keeps only the turn family and the archived-lineage step gate. `dsh-workspace` becomes an optional type-only peer of `dsh-jobs`. * refactor(workspace): leave SessionActivityKindMap empty and let each provider merge its family The workspace package no longer names any activity family (review on #4765): `SessionActivityKindMap` is empty, and each provider merges its own key from a module both its faces import — `turn` in the API Session Controller's types, `job` in the job registry seam's view, `subagent` in the Subagent runtime's control types, `schedule` in the Schedule plugin's types. The confirm dialog imports those modules for its cases and keeps the generic line for any other key; the registry and controller suites merge test-owned families instead of borrowing the providers'. * refactor(agent): report and stop the running turn from the Agent registry The `turn` family moves out of the API Session Controller into `dsh-agent` (review on #4765): the registry's constructor installs the `workspace/session-activity` and `workspace/session-stop` listeners for every Agent it publishes, answering with its own lookup and cancelling the turn with the user cause, and merges the `turn` key from its client-safe types. The controller keeps only the archived-lineage step gate, renamed `ArchivedSessionGate`. `dsh-workspace` becomes an optional type-only peer of `dsh-agent`; the workspace package depends on none of the providers, so the edge stays acyclic. Since #3127 a foreground Bash command is a registered job from its start, so the archive dialog lists it beside the turn; the e2e and its ARIA golden expect that row, and the capture keeps the running job by design.
Subsystems
English | 中文
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.
| Page | Owns |
|---|---|
| boot.md | Current-profile plugin management and launcher reload coordination |
| core.md | how 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.md | the 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.md | immutable scalar and positional replay measurements with consumed-log revisions |
| scope.md | scoped registration identity, dispatch carriers, and the owned Scope context |
| typert.md | Remote invocation descriptors, lookup/Context declarations, Typert registries, and the Host Gateway/Client API boundaries |
| goal.md | persisted goal identity, lifecycle snapshots, activation, change records, and round attribution |
| schedule.md | Session-local reminder records, durable transitions, active views, and ordinary-conversation delivery |
| todo.md | the todo package's whole-list item type, durable event ownership, projection, and open-turn invariant |
| deliverables.md | what a turn hands to the user: PresentedFile deliveries from present and the Host-served WorkspaceChangesSummary of changed files from git snapshots |
| commands.md | the human-command registry service: definitions, adapter discovery, direct invocation, results, and parsing views |
| session.md | the full SessionEventMap variant catalog, TurnEndReason, deriveMessages(), execution enclosure, and standalone events |
| persistence.md | the durability seam: SessionPersistence, the JSONL provider, session/flush, crash recovery, SessionHeader |
| settings.md | the user-settings seam: SettingsNamespace registration, layered resolution (defaults → composition base → user document), owner scopes, hot commits |
| credentials.md | the credential seam: CredentialRef references (never values) in configuration, per-operation resolution, UI-safe CredentialInfo, provider source layers |
| session-query.md | logical records, bounded exact-event reads, relationship traces, semantic filters/documents, and full-text result pages |
| feedback.md | lifecycle-bound per-message feedback records, optimistic versions, sidecar persistence, and the Host Remote contract |
| session-title.md | durable title snapshots, cited source-message seqs, and the asynchronous provider contract |
| session-reference.md | structured cross-session references: SessionReferenceInput/Candidate, prepared message contexts, the stable error taxonomy |
| system-prompt.md | per-assembly context, tool-provider results, prompt sections, and cooperative assembly |
| tools.md | ToolDefinition full fields, the schema DSL, ToolExecution/ToolResult, tool-presentation UI types, and the guarded execution pipeline |
| mcp.md | external MCP connections, scoped tools and resources, server instructions, protocol results, and configuration ownership |
| user-questions.md | the UI-backed human question/answer seam: AskUserQuestionRequest, answer/options vocabulary, provider API, error taxonomy |
| approval.md | the one-shot user-approval seam: ApprovalRequest, ApprovalOutcome, per-session policy, audit events, and answerer contracts |
| office-to-pdf.md | authorized Office-to-PDF conversion, native/WASM engines, and bounded shared reuse |
| attachment.md | durable image identity and metadata, validation inputs, verified reads, and the AttachmentStore seam |
| shell.md | the shell executor seam: ShellExecRequest/Spec, ShellRunResult, background ShellProcess handles |
| subprocess.md | the subprocess seam: fully-explicit SubprocessSpawnSpec, offset-based output readers, unclassified SubprocessOutcome, and the managed DSH_* environment vocabulary |
| ssh.md | the POSIX SSH connection and remote filesystem, subprocess and sandbox providers |
| terminal.md | persistent terminal ids, backend/session contracts, send readiness, bounded reads, and owner-visible snapshots |
| sandbox.md | per-session policy resolution and the process-confinement seam: file-effect modes, execution/provider policies, ConfinedArgv, enforcement and fail-closed errors |
| ptc-runtime.md | the PTC execution seam: PtcRunRequest/Result, binding namespaces, captured logs, the PtcRunFailure taxonomy |
| computer-use.md | exclusive named computer-use provider registration and Cua Driver integration choices |
| browser-use.md | exclusive named browser-use registration, provider choices, and per-Session browser ownership |
| extensions.md | versioned dynamic Cordis Plugins and Packages, Host/Client activation, approval, runtime inspection, and lifecycle teardown |
| filesystem.md | the filesystem seam: FsTarget, read/write/edit outcomes, observed-file state, FsErrorCode |
| lsp.md | the LSP navigation seam: LspQueryRequest/Result, LspProvider/Service, four operations, LspError |
| skills.md | the skill service: discovery priority, SkillSummary/SkillDefinition, session-prefix catalog, model-facing skill loading |
| compaction.md | the compaction seam: the compaction/* session events, CompactionResult, the CompactionEngine interface |
| subagent.md | the subagent seam: the named-provider registry, SubagentStartRequest/Result/Run, the start-time-vs-runtime capability split |
| voice-input.md | experimental named recognizers, transient audio and revision-guarded draft insertion |
| agent-team.md | Agent Teams: implicit Lead identity, named continuable teammates, durable peer mailbox, and shared task DAG |
| web.md | the web access seam: WebSearchRequest/Result, WebFetchRequest/Result, WebFetchBody, provider availability, WebError |
| spill.md | the spill storage seam: SaveTextSpill, SpillOwner/SpillSource, SpillRef, the branded SpillLocator |
| workflow.md | the workflow seam: WorkflowStartRequest, WorkflowMeta, WorkflowRun/Result, the workflow/* event payloads, WorkflowError fatality |
| jobs.md | the background-job runtime: branded JobIds, the producer contract, consumer views, and ctx.jobs service behavior |
| permission-presets.md | the permission-preset layer: PresetSpec/PresetOption, the derived custom state, the log-only permission/preset event |
| plan.md | plan mode: the log-only plan/mode state, pending-selection flush, PlanModeConfig, the exit_plan_mode review arc |
| invariants.md | the runtime-invariant registry: selection Config, InvariantInstaller/InvariantFailure, the empty-companion contract |
| web-server.md | the HTTP carrier: WebRouteKind/WebRoute, match order, the claimable fallback seat, index taps |
| webhook.md | authenticated provider deliveries, arbitrary programmatic rules, and fire-and-forget Workspace Session creation |
| storage.md | the storage subsystem: the backend contract (StorageBackend), StorageForms, DomainSpec/Domain, domain/changed |
| workspace.md | the workspace registry: Workspace/WorkspaceId, registration and resolution, the session cwd relationship |
| web-client.md | the browser architecture: boot, Remote communication, paired Client models, UI adapters, Conversation assembly, Slots, and reconnect semantics |
| client-modules.md | the web plugin table: dsh.client declarations, WebBootGraph wire composition, the bundle route and index tap |
| slots.md | typed Web UI composition: declaration ownership, cardinality and scope, framework and feature injection, props derivation, and the shipped hierarchy |
| client-resources.md | the client resource model: dsh-resource://<type>/… addresses, protocol providers and ResourceProtocolMap, the useResource global hook and its states, pins and release |
| sidebar-right.md | the right Sidebar: resource and navigation addresses, tab-type registration and routing, the ctx.sidebarRight navigation service, the pane-tab slots and owner props, the resource model, and the Workspace Files service |
| conversation.md | target-neutral Session-event assembly: Context identity, Location data, replay paths, view builders, and target-owned render nodes |
| session-projection.md | the projection seam: SessionProjectionMap, the pure ProjectionDefinition unit, ProjectionSnapshot's consistent cut, the change feed |
| session-telemetry.md | the outbound session-reporting capability seam: SessionTelemetryRecord/SessionTelemetrySeverity, the SessionTelemetrySink contract, and the session-telemetry/record redact waterfall |
| product-telemetry.md | Explicit product analytics submission and OTLP/HTTP transport |
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-apiblocks preserve body-stripped public class declarations. Cordis services and events use each page's generated Cordis API section.