Skip to content

Latest commit

 

History

History
160 lines (122 loc) · 60.7 KB

compatibility.md

File metadata and controls

160 lines (122 loc) · 60.7 KB

Compatibility

Rules dsh-context holds on every supported @deepseek-ai/dsh release, and the evidence for each. Unmarked paths are in this repo; dsh: paths are in the harness tree read at the staged baseline tag (dsh-v0.2.0-rc.2, dsh-v0.2.1-rc.2, dsh-v0.2.2-rc.1, dsh-v0.2.2-rc.3) unless another tag is named. A .../ prefix continues the preceding path's directory. Source wins over this page.

Last verified: 2026-11-28 (dsh-context 0.88.0; dsh floors 0.2.0-rc.2, 0.2.1-rc.2, 0.2.2-rc.1, plus the staged 0.2.2-rc.3 release and the 0.2.1-rc.2…rc.5 and 0.2.2/master diffs).

1 · Supported set

  1. Support dsh 0.2.0-rc.2+, 0.2.1-rc.2+, 0.2.2-rc.1+, 0.2.2-rc.3+. The first three are the per-line floors; 0.2.2-rc.3+ stages the 0.2.2 line's current release above its floor, so the matrix covers both the pre-refactor rc.1 shapes and the post-refactor shapes staged at rc.3 (identical between rc.2 and rc.3 for the staged seams). engines.dsh and the dsh peers declare only the per-line floors as a union of >= terms, so the gate's effective floor is the lowest term, 0.2.0-rc.2 — adding a line term never raises it, and dropping a line means removing its term. Every staged baseline lives in dsh.compatibility.dshReleases (declaration-only; nothing in dsh reads it) and tests/baselines.ts; §9 keeps the four in lockstep.
  2. The 0.1.7 line is dropped — refused by the gate where it runs, or §2's fallback with an upgrade prompt; never a fold.
  3. Limitation — unstaged releases: the matrix stages the floors and 0.2.2-rc.3. Every other above-floor release — the above-floor patches 0.2.1-rc.3…rc.5 and 0.2.2-rc.2, later lines, and sub-floor spellings such as 0.2.2-alpha.3 — is admitted and must keep working on the same path, without per-release staging evidence.

2 · Admission

  1. The harness gate refuses an unmet manifest before install and before profile import — it first ships at dsh-v0.1.7-rc.1, and earlier builds have none. From 0.2.1-alpha.4 and on the 0.2.2 line a declared engines.dsh decides alone; the 0.2.0 line, gated 0.1.7 builds and pre-alpha.4 0.2.1 read only the @deepseek-ai/dsh* peers (includePrerelease: true). Keep both declarations — peers are the only gate on 0.2.0, engines on 0.2.1-alpha.4+ and 0.2.2 — so 0.1.7 is refused without an exemption. (dsh: packages/boot/app-boot/src/plugin-compatibility.ts, .../compatibility-preflight.ts, .../profile.ts, packages/boot/plugin-manager/src/operations.ts)
  2. Enforce the floor again at runtime: pre-gate builds and exempted force-loads below 0.2.0-rc.2 get zeroed fallback units plus the upgrade modal, never a fold. (src/host/version.ts, src/host/fallback.ts, src/client/components/upgradeGate.tsx)
  3. Detect from the running module tree first; an undetectable version FAILS OPEN into the real units, and the home probe (the installed profile tree under DSH_HOME) answers only when the running tree yields no witness. (src/host/version.ts, src/shared/version.ts)
  4. Feature-detect .volatile() so one bundle also loads, preferences inert, on a below-floor schemastery. (src/host/config.ts)

3 · Fold

Durable events → projection state, host-side.

  1. One shape-driven fold path; the fold never branches on a detected harness version. (src/host/fold.ts, src/host/logShapes.ts)
  2. Trust the migration guarantee; carry no legacy readers — every read path migrates pre-V4 logs to V4; an unconvertible log is refused with SessionFormatUnsupportedError, never served raw. (dsh: packages/session/session-format-v3-to-v4, packages/session/session-persistence/src/errors.ts)
  3. developer/message folds into injected context — never human inputs; an empty-content event keeps a zero-token surface node where deriveEventMessage projects null. (dsh: packages/core/session/src/surface.ts, packages/core/agent-loop/src/agent.ts; src/host/fold.ts)
  4. Tool-result errors come from message.isError alone — dsh admits data.error only alongside it, so a hostile envelope-only row degrades to unflagged, never a throw. (dsh: packages/core/session/src/types.ts, .../surface.ts; src/host/fold.ts)
  5. The command log folds tool/call + tool/result on every line and job/registered / job/settled only where they exist. The 0.2.0 line logs none, so exit/timing derive from envelopes and result-text markers (derived: true); the 0.2.1+ job events replace that. A background hand-off ack (started background job … / [still running after …; moved to background job …]) is no outcome: without job events the run stays running and its runs/ms wait for a terminal transition. (dsh: packages/jobs/jobs/src/types.ts (0.2.1+), packages/shell/tool-bash/src/render.ts, packages/shell/tool-bash-persistent/src/index.ts, packages/shell/tool-pwsh/src/render.ts; src/shared/commands.ts, src/host/fold.ts)
  6. Fleet delegations parse subagent/catalog by shape, never by payload version — every catalog version carries childId/childCreatedAt/mode, so a version gate would drop a future catalog. Modes are one-shot | continuable | external | unknown (unknown = the v3→v4 migration's mode-less records); continuable without a label drops. (dsh: packages/subagent/subagent/src/catalog.ts, packages/session/session-format-v3-to-v4/src/migration.ts; src/host/fleet.ts)
  7. Folds are TOTAL — unknown types return state unchanged, malformed events drop whole, and no undefined-valued property is materialized. The registry has no error boundary: one throw stalls the unit's cells and push feed, one undefined property fails every projection-cache write for the session. (src/host/fold.ts; tests/compat/matrix.spec.ts)
  8. Backfill ids for decision messages that would persist unidentified — a message event without a non-empty id makes the harness refuse the whole session at its next load; the prepended agent/pre-step guard mints dshctx- ids and fails open. (src/host/stepIdentity.ts; dsh: packages/core/session/src/index.ts assertMessageEventShape)
  9. Attribute a tool to the use site of the tool-service access behind its registration, keep the static map for first-party boot tools, and forward every tools.register argument — a traced-view call carries the use-site ctx.fiber that ToolsService.register scopes by, and that plugin display name outranks the last internal/get reader and the pinned package map; untraced receivers use the reader, while root/self use sites or readers and a missing reader use the caller stack. Schedule tools belong to @deepseek-ai/dsh-schedule on 0.2.0 and @deepseek-ai/dsh-tool-schedule on 0.2.1+; 0.2.2's options.when gate must survive the wrapper. (dsh: vendor/cordis/src/utils.ts createTraceable/createShadow/createShadowMethod, vendor/cordis/src/reflect.ts ReflectService.get, packages/core/tools/src/index.ts this.layers.effect(this.ctx, ...); options.when at dsh-v0.2.2-rc.1:packages/core/tools/src/contracts.ts; src/host/toolSources.ts, src/host/attribution.ts, tests/host/attachment.spec.ts)
  10. Limitation — image offload: the harness records image/offload events and projects a placeholder message; the fold reads raw durable events, so an offloaded message keeps its pre-offload count and price until compaction removes it. (dsh: packages/compaction/compaction-image-offload/src/image-offload.ts, packages/core/session/src/known-event-types.ts)
  11. Context-event agent labels are shape-derived, never version-gated — agent-message / subagent-settled text carries the model-facing agent name only from dsh-v0.2.2-rc.2 (agentAddress, dsh: dsh-v0.2.2-rc.2:packages/subagent/subagent/src/continuation-messages.ts, .../names.ts); the floors carry the sender Session id, so the fold falls back to the parent log's subagent/catalog.name (v3, 0.2.2-rc.2+), then team/member.name (packages/experimental/agent-team/src/types.ts on the floors; dsh-v0.2.2-rc.2:packages/team/agent-team/src/types.ts), then subagent/catalog.label, and omits an unresolvable name instead of printing an id. team-message.senderName and session-reference.references[].label are stable across the floors. The alias map holds 512 ids and each stored name is bounded to 120 chars. The resolved label also rides the inject surface node (SurfaceNode.agent, additive-optional per §6.1 — no stateVersion bump; persisted head rows stay slim without it) so detail/facts/delta full folds label browser inject rows regardless of the maxEvents window; the client appends it to the row preview. (src/host/fold.ts, src/host/foldInjections.ts, src/shared/types.ts, src/client/components/browserRows.ts; dsh: dsh-v0.2.2-rc.2:packages/subagent/subagent/src/catalog.ts, packages/context/session-reference/src/types.ts)
  12. PTC sub-calls fold through their tool/ptc-dispatch-start / tool/ptc-dispatch pair, keyed by subCallId — they never emit tool/call/tool/result, and deriveMessages() ignores both events, so the pair prices the real tool run and its name while the enclosing run_code stays a transport row: it keeps its per-tool row but adds no toolCalls/toolsMs, and a program with zero dispatches keeps its own envelope as the run. An unpaired or unreadable start marks nothing as transport, so no run is silently dropped; an unpaired settle still tallies the name but books no time, and pending starts cap at 200. A successful skill dispatch books the loaded name from arguments.name, falling back to the <skill_content> wrapper; it stays out of the context surface because the content reaches the program, not the model. (dsh: packages/core/tool-executor-ptc/src/types.ts, .../ptc.ts; src/host/activity.ts, src/host/fold.ts)
  13. Subagent creation is a folded context milestone — every subagent/catalog with a shape-derived name or label pushes kind: 'agent', form: 'spawn' (name, label as detail, a known mode as sub); team/member stays alias-only, and agent messages/settled notices remain inject events with an agent label. Head-only folds keep the cumulative event count but drop the row list. (src/host/fold.ts, src/shared/types.ts; dsh: packages/subagent/subagent/src/catalog.ts)
  14. Goal, todo, team-task and user-question events are folded workflow milestones — goal/change create/complete emits goal-create/goal-complete from goal.objective; todo/write diffs the whole todos snapshot into todo-add (a bare new-content count) and todo-done (up to 8 completed contents), keyed by content; team/task emits a bare team-task-create count for an unseen non-deleted task and team-task-complete with the subject on a non-completed → completed transition, keyed by id; a tool/call named ask_user_question emits ask with the full question count and up to 8 stored question texts from its JSON arguments. Ids/names cap at 120 chars, todo maps at 128 and task maps at 256; head-only folds keep both maps and the cumulative count so transitions survive the retained window. Requests, events, milestone rows, surface nodes, archive, file ops and spans page through the full retained log; commands use the ordered POST api/dsh-context/commands page route, which auto-fills older rows without a manual cap. TIMELINE_STATE_VERSION 47 adds these events and the agent-spawn events above. (src/host/foldWorkflow.ts, src/host/history.ts, src/host/fold.ts, src/shared/types.ts; dsh: packages/goal/goal/src/domain.ts, packages/todo/tool-todo/src/types.ts, packages/team/agent-team/src/types.ts, packages/interaction/user-questions/src/projection.ts)
  15. Full-history pages are serve-time only — history folds with historyBounds (no request, turn, event, node, archive, file or span cap; commands stay on their own full page route), serves seq-keyed request/event/milestone pages and index-keyed node/archive/file/span pages, and keeps a byte-budgeted cold fold cache with one materialized part per entry; nothing is persisted, so the projection row stays head-only at version 47. Event pages carry a per-row ordinal and never split a same-seq run. The client loads requests/events first, then nodes when the browser card mounts, files/archive when the below-fold card group mounts, and spans when the timing card becomes visible; it merges seq pages by (seq, ordinal), appends index pages over a stable prefix, closes revision gaps across as many pages as needed, retries a failed or null page, leaves an unchanged collection untouched, and reloads surface/archive together when an archive removal changes the surface order. (src/host/history.ts, src/host/config.ts, src/host/foldState.ts, src/client/detailStore.ts, src/client/historyPaging.ts, src/client/timelineWire.ts)

4 · Metering parity

Figures the plugin prints that the harness also prints.

  1. Mirror, don't import. Re-fit when a supported line moves an implementation; scripts/diff-fold.ts pins the composition against the harness's own contextBreakdown on real logs.
Plugin site dsh source mirrored
src/shared/estimate.ts estimateSystemTokens / estimateSystemContent dsh: packages/llm/token-meter/src/estimate.ts estimateSystemMessage — text density, JSON fallback and role framing
src/host/pricing.ts estimateReasoningTokens / estimateAnswerTokens / estimateCallTokens dsh: packages/llm/token-meter/src/estimate.ts — reasoning/text/tool-call arms of estimateContent
src/shared/fileTokens.ts (attachment chip) dsh: packages/llm/llm/src/content.ts fileHandleText — handle text, never bytes; the chip cannot know the resolvable-path sentence, so it is a lower bound
src/client/components/statsTiming.tsx TPS chip dsh: packages/llm/llm/src/assistant-stream.ts assistantStreamFirstTokenTime
src/client/headline.ts occupancyPercent dsh: packages/client/ui-conversation/src/client/context-occupancy.ts contextOccupancy — the plugin mirrors the clamped ratio and prints one decimal; kernel-internal, hence mirrored
src/client/reserve.ts dsh: packages/compaction/compaction-basic/src/config.ts — shipped defaults only (0.8 / 65536); a non-positive budget is refused (TargetPressureConfigError), so the bar paints no masks
  1. Image blocks use DeepSeek's published v41 image conversion (1024-token cap, 544²-pixel floor), mirrored from dsh's packages/llm/llm-deepseek/src/image-tokens.ts, not the meter's structural heuristic; an attachment without finite dimensions keeps the structural price. The durable attachment carries its normalized dimensions while dsh prices the projected request dimensions, so a sent-dimension rounding or a route pixel budget can move the count; provider usage stays authoritative, and scripts/diff-fold.ts documents the meter delta. A route declaring imagePixelBudget: 'low' prices 184–194 tokens for the tested sizes where the mirror prices 317–1001; an offloaded image keeps its pre-offload price and still counts. (src/shared/imageTokens.ts, src/host/pricing.ts; dsh: packages/llm/llm-deepseek/src/request-pricing.ts)
  2. Anchor the timing card's wait/decode boundary at the harness's first token — ttftMs ends at the first non-empty delta assistantStreamFirstTokenTime reports (the instant sessionStats uses); earlier block-start markers stay in the wait, and decode spans/buckets clip there so no window double-counts. (src/host/fold.ts; dsh: packages/session/session-stats/src/projection.ts)
  • Limitation — thinking splits: no in-tree DeepSeek route reports reasoning/answer/tool-call buckets, so splits follow the meter's block prices, with a provider reasoningTokens count winning for thinking. (src/client/categories.ts; dsh: packages/llm/llm-deepseek/src/translate.ts)
  • Limitation — spanless blocks: a block with no positive-width decode span adds no split time or block count; a pre-token window stays in the wait. (src/host/fold.ts)
  • Limitation — slimmed list rows (from 0.2.2): contextHeaders/contextTimeline/contextActivity declare wire.summary: false and the harness excludes contextPressure/contextBreakdown, so list rows carry none of the five; the fleet derives occupancy from head fetches, the insights page reads aggregates through the batched snapshot route, and attached Sessions keep live values. The older registries ignore the mark and still carry everything. (src/host/{headers,timeline,activity}.ts; dsh: packages/api/session-controller/src/list.ts summaryKeys())
  • Limitation — tool slice: the card attributes the per-step busy union (toolBusyMs), so a parallel batch prices once and a run outside every step window prices no busy time; the tooltip shows the fold's own per-call toolsMs when it exceeds the displayed union. (src/host/fold.ts, src/client/components/statsTiming.tsx; dsh: packages/session/session-stats/src/projection.ts)
  • Limitation — counts: counters cover the full session (steps = every folded assistant message, turns = turn-label changes with an absent label read as 0, injects/compactions/prunes cumulative, events = every folded context event, modelSwitches = cumulative model switches, skills = distinct loaded names capped at 500), so a step that assembled no message is omitted where sessionStats counts step/end, a non-adjacent repeat of a turn label counts again, and the harness StatsPills show the larger step figure. (src/host/fold.ts, src/host/foldWire.ts; dsh: packages/session/session-stats/src/projection.ts)
  • Limitation — idle carve: active time is step wall minus idle — eventless residue gaps ≥ 2 min (log-only subagent/catalog / team/member events never break a gap) plus approval/ask_user_question waits of any length, only after the step's response; a quiet running tool stays busy, and a step past the 1,024-beat cap skips the residue carve. Idle paints no span. The overview's active-time KPI bills the daily ledger's step wall (no per-day idle) and is range-scoped; the timing card keeps the carved lifetime figure. (src/host/fold.ts, src/host/foldMetering.ts, src/host/activity.ts, src/client/services.ts)
  • Limitation — daily ledger: every overview aggregate (KPI tokens/cost/turns, card usage/cost, the tool and time cells, the day chart) bills contextActivity days for all scopes, so a wider range always contains a narrower one; the token KPI is that ledger total while the donut is its category split (a member without a timeline composition still counts in the total, not the split). contextTimeline.cost remains the per-session detail figure and prices at settlement, so a tariff-boundary step splits peak/off differently between the detail page and the overview; a session counts as priced only when every provider/model in its usage resolves a price. The ledger keeps 400 days, so overview totals exclude usage older than that; it caps 64 names a day, books a tool only when its call start is retained, and counts a command on dispatch where the Command Executions card waits for settlement; a retained PTC start books its dispatch, and a lost start still books the skill name from a successful settle. (src/host/activity.ts, src/host/overviewCorpus.ts activityTotalsOf, src/host/overviewAggregate.ts summaryOf)
  • Limitation — statutory holidays: no holiday calendar, so a holiday-weekday request in the peak windows prices at peak; the tooltip states the weekday/weekend rule. (src/host/foldMetering.ts isBeijingPeak)
  • Limitation — superseded system prompts: DeepSeek routes append a system/message when the prompt changes, but the plugin classifies only the latest surviving prompt as system tokens and omits superseded prompts from the composition and request totals where the harness counts them inside messageTokens; a mid-session prompt edit therefore undercounts until the next replacement. No supported real log has more than one surviving prompt. (src/host/fold.ts, src/host/foldWire.ts; dsh: packages/llm/token-meter/src/breakdown-projection.ts withTotals)
  • Limitation — inherited-seed cost reset: for an inherited fork seed (session/end-seed with inherited: true) the plugin resets cost and the generated counters and clears the daily ledger at the seed cut, while the harness tokenUsage folds the whole log; the reset keeps the inherited prefix from being billed in both parent and child, so the plugin's per-session cost is not comparable to a tokenUsage consumer. (src/host/fold.ts, src/host/activity.ts; dsh: packages/llm/token-meter/src/usage-projection.ts)

5 · Client surface

What the browser half may rely on.

Seams

  1. Every capability rides an OPTIONAL seam — only slots/locale are hard-injected; other faces use deferred ctx.inject, re-proved and guarded, with dsh.client.inject naming providers that must arrive first (package ordering, not service waiting). One-shot reads use ctx.get per call. No service → no capability, no pending fiber, no throw. (src/client/services.ts, src/client/index.ts)
  2. Mount at most once per page — a static bundle plus a later activation of the same package can mount twice; the client-plugin runner force-assigns a fresh shadowing priority to every dynamic registration, so the slot registry's duplicate guard never fires. apply() reads the raw ledger (ctx.slots.entries) and mounts nothing when context-jump is seated; an absent or shape-shifted face reports unseated. (dsh: packages/extensions/cordis-client-runner/src/client/guard.ts, packages/client/ui-renderer/src/client/registry.ts; probe ledger)
  3. Session jump uses uiWorkspace.openSession(SessionTarget), never a sessions-service open(id) (absent on every supported line). (dsh: packages/client/ui-workspace/src/client/navigation.ts; probe sessionNav)
  4. The member card's open prefers the right Sidebar's subagent chat (kind subagentchat, preferNewPane); an absent face or an unclaimed address keeps rule 3's jump. (dsh: packages/client/ui-subagent/src/client/sidebar-chat/, packages/client/ui-sidebar-right/src/client/service.ts)
  5. The member card's enter pre-seeds the view — merge-write dsh.conversation.<sessionId> (the draft included) before the jump; the shell re-reads it on every session binding and falls back to chat for an unregistered id. (dsh: packages/client/ui-conversation/src/client/stores.ts readConversationViewPreference, .../apply.ts; src/client/services.ts)
  6. The settings and update-prompt jumps use pluginNavigation.openBundle(packageName), never a DOM walk: the 0.2.1+ plugins.tab slot remembers its selection and the navigator resets it to Installed; the 0.2.0 line has no contributed tabs. The npm update dialog itself is the page's internal state (openUpdate needs the page's registry version check) and no supported line exposes it cross-plugin, so the prompts land on the bundle's detail page and the release-notes link survives as the fallback where the navigator is absent. (dsh: packages/client/ui-plugin-manager/src/client/index.ts, .../manager-store.ts; probe pluginsNav)
  7. Locale switches ride the LocaleFace subscribe/getLocale pair, degrading to the boot locale when absent. (dsh: packages/client/locale/src/client/index.ts; src/client/viewkit.ts)
  • Limitation — language selection: ja/es/fr/de/ru/pt are selectable only where the harness client registers those packs (the 0.2.2 line from rc.1; the built-in addLanguage loop first appears at 0.2.2-alpha.2). The 0.2.0/0.2.1 clients register only the baseline zh/en (LOCALE_IDS), so their selector offers Chinese/English and the six dictionaries resolve as English. (dsh: packages/client/locale/src/client/index.ts, packages/client/locale/src/locale-settings.ts)
  • Limitation — plugin detail document: meta.detail is honored only from dsh-v0.2.2-alpha.2 (dsh: dsh-v0.2.2-alpha.2:packages/util/plugin-detail/src/document.ts); the 0.2.0/0.2.1 floors ignore the extra locale key and render no detail document, only the localized title and description.

Boundary

  1. Re-prove at the boundary; isolate every read's failure — an absent whole value renders loading, not an error; hostile shapes degrade field-by-field and skip bad elements; every async read yields data or a retry note; a revision decrease resets the detail ledger. (src/client/services.ts, src/client/timelineSource.ts)
  2. Fetch routes stay browser-relative — never root-absolute /api/..., so a path-prefixed reverse proxy keeps its prefix. (src/client/apiRoutes.ts)
  3. Only a 'subagent'-origin row draws a family edge — a fork is an ordinary Session: older lines record parentSession with no origin, the 0.2.2 line records no lineage. (dsh: packages/api/session-controller/src/list.ts, packages/api/session-controller/src/commands.ts; src/client/agentTree.ts)
  4. Every history read carries the session's own durable address — a subagent child read under a plain session address is refused (session/agent-busy), so name the direct parent: sessions.subagentAddress(id) first, else the 'subagent'-origin list row's parentId as mode unknown; resolve per read so a refused attempt heals its retry. (dsh: packages/api/session-controller/src/history.ts, .../client/sessions/manager.ts; src/client/services.ts)
  5. Command coloring rides the primitives' lazy shiki highlighter — bash (pre-warmed shellscript) and pwsh (lazy powershell); run_code stays plain. Lines past 1,000 UTF-16 units render plain, the plugin's own guard (the harness cap starts only on 0.2.1). (dsh: packages/client/ui-primitives/src/code-highlighting.ts, .../markdown/highlight.ts; src/client/commandHighlight.ts)
  6. The right Sidebar's body gates on the optional useTabInfo hook — an invisible tab mounts no cards and parks its subscription, and without the hook the body keeps its IntersectionObserver fallback. (dsh: packages/client/ui-sidebar-right/src/client/tab-info.ts; src/client/components/contextView.tsx)
  7. Call every seat unconditionally, key seat-reading entries by their selection, and read seats through value selectors — seatOf always invokes, seatKeyOf remounts when the selection changes instead of shifting hook order, and the overview's sessions seat projects a primitive current-id/cwd key so the selector's Object.is bailout skips unrelated store churn. (src/client/services.ts, src/client/overviewModel.ts; tests/client/seatGuards.spec.ts, tests/client/components/overviewPanel.spec.ts)
  8. The /context overlay portals to document.body — from 0.2.2-rc.1 the composer seat declares will-change: transform, making it the containing block for position: fixed descendants, so a fixed overlay mounted inside the composer overlay measures and paints inside the composer instead of covering the viewport; the below-floor upgrade gate keeps rendering inline because it only appears on builds without that declaration. (src/client/components/contextModal.tsx; dsh: packages/client/ui-conversation/src/client/conversation/ConversationRoot.module.css)
  9. The current-session anchor reads the ui-workspace persisted selection — dsh.sessions.current ({sessionId, subagentAddress?}) is the selected Session on every supported line; the sessions list store carries no current field. A missing, malformed or storage-less selection degrades to no anchor, and cwd comes from the list snapshot by id. (dsh: packages/client/ui-workspace/src/client/navigation.ts createSnapshotStore(..., { persist: { name: 'dsh.sessions.current' } }), packages/api/session-controller/src/client/sessions/service.ts SessionListState; src/client/overviewModel.ts; tests/client/overviewSupport.spec.ts)
  10. The fleet's team view synthesizes its roster when the agentTeam projection carries no members — every release through 0.2.2-rc.1 publishes members ({members, tasks, failure}); from rc.2 (including the staged rc.3) the view is {enabled, tasks, failure} and membership rides the Lead's subagentCatalog continuable entries, whose catalog v3 rows carry name unique among siblings, while team/member and team/message/* became historical records, team/mode joined the vocabulary, and tasks capture ownerName as the agent path (dsh: dsh-v0.2.2-rc.1:packages/experimental/agent-team/src/types.ts; dsh-v0.2.2-rc.2:packages/team/agent-team/src/{types,projection,journal}.ts, dsh-v0.2.2-rc.2:packages/subagent/subagent/src/{catalog,names}.ts, dsh-v0.2.2-rc.3:packages/team/agent-team/src/types.ts; dsh-v0.2.2-rc.2:packages/client/ui-agent-team/src/client/TeamBoard.tsx treats any catalog row as membership). The client synthesizes the carrier Lead plus its named continuable catalog children — one-shot, external and unnamed rows stay plain subagents — merges the fleet summary's named continuable facts, which name historical team/member teammates the new projection ignores, resolves task owner paths by first segment, and keeps the plain fleet whenever enabled is false or the projection is absent. A Team Lead's ordinary continuable subagents therefore join the roster on rc.2+, matching the ID-only semantics where any continuable child may own tasks. (src/client/fleetTeam.ts, src/client/fleetModel.ts, src/client/components/fleetView.tsx)
  • Limitation — complete prompt sections: a deployment registering a complete system-prompt section keeps only that section; promptPrefix/promptSuffix are dropped. (dsh: packages/core/system-prompt/src/index.ts)
  • Limitation — settlement split: an unmarked provider diagnostic appended after the closing text stays inside the closing report, and an unknown summary renders raw. (dsh: packages/subagent/subagent/src/continuation-messages.ts; src/host/fleet.ts)

6 · Projection cache

How fold-state changes reach existing installations.

  1. Bump a unit's stateVersion iff later events cannot backfill the change — running totals, per-step collections flushed at step/end, materialized envelopes. Serve-time-derivable fields and additive-optional wire fields need none: a pre-field row serves without them and the client degrades per §5. From 0.2.2-rc.2 (unchanged at rc.3) the registry states the same contract explicitly and requires the old-checkpoint suffix replay to match a full replay before a version is retained. (src/host/timeline.ts, src/host/activity.ts, src/host/headers.ts; dsh: dsh-v0.2.2-rc.2:packages/session/session-projection/src/index.ts stateVersion)
  2. Persist the contextTimeline head only — aggregates, slim surface/request/command records (no text/cmd) and the fold's working memory; spans/fileOps/archived stay empty and detail refolds through the detail route. stateVersion 47 adds agent-spawn and workflow milestones plus the bounded todo/task transition maps; 45 moves no folded shape: it discards rows an interim totals.models counter wrote under 44 (a same-version shape drift left them unseedable); 44 adds the cumulative model-switch count behind counts.modelSwitches; 43 added the cumulative full-session event total behind counts.events; 42 added PTC sub-dispatch entries to the head's timing, per-tool tallies and skill-name set, plus the bounded pending-start map that trimming cannot backfill; 41 added cumulative full-session counters (turns, steps, injects, compactions, prunes, distinct skills) plus cumulative tool/program tallies and per-session command stats (40 added the first counter set); older rows are discarded. The head-only persisted row keeps only the last requests, running command rows and the trimmed command-call ledger: events, archived nodes, file ops, spans and settled commands are refold-only and must be served by the detail/facts routes, never assumed present in a cached row (the facts route serves the same complete facts as the detail route: full request series, turn/step-enriched events, and windows derived from the configured fold bounds; cached head rows never back them, and cold caches key on the persistence service's stable identity because the service wrapper is re-bound per request); a boot sweep rewrites ver-36 rows in place to the 37 head-only shape (a pure derivation, no refold), and they still refold on first read, so the sweep saves disk only. (src/host/timeline.ts, src/host/foldState.ts, src/host/sweep.ts)
  3. Live detail rides a per-session shadow fold — seeded via sessionQuery.observeSession (projectionMode: 'none'), advanced by committed events, bounded to 8 sessions with a 512-event seed buffer replayed past the seeded cut, folded with full request/event/turn/node/archive/file/span bounds (commands stay at the configured transport window), and evicted oldest-first by an estimated 64 MiB byte budget; dropped when the session is disposed; every observation it opens is disposed on success, eviction and error. head: true reads serve the live snapshot; cold sessions use the revision-keyed payload cache (4 rows). The handle path applies where register is awaitable (the 0.2.2 line); older lines use the registry's keyed stateOf. (src/host/detail.ts, src/host/detailShadow.ts)
  4. Complete add/remove deltas ride a host fold — POST api/dsh-context/delta assembles both boundaries from the full shadow (or cold-folded) surface/archive and returns every added node, per-category removed counts/tokens, and the complete selected view. maxArchiveNodes is a detail-payload transport bound only; the delta and history folds keep every removal until it precedes the oldest retained request and record the dropped floor, so the delta covers every selectable step and archive pages reach the first removal. The persisted head-only row still carries none, and cold delta folds reuse a revision-keyed state cache. If the route is unavailable the browser falls back to the archive-window diff and flags approximation. Compaction events also carry grossTokens, so the card's net figure reconciles with the delta's gross removal. (src/host/delta.ts, src/shared/delta.ts, src/host/foldState.ts, src/host/foldWire.ts)
  5. Stale rows refold from the durable log — production warm-up first validates the plugin's canonical v3 materialization by durable identity, fold versions and resolved fold config; a changed/rebuild id always refolds. With no trustworthy event count, projection presence alone never certifies a cold row on that path. The legacy no-own-cache embedding retains the old presence probe, including the stat().eventCount watermark check when available. (src/host/backfill.ts, src/host/overviewCache.ts; dsh: packages/session/session-persistence-jsonl/src/index.ts stat)
  6. Every cold fold passes the host-wide gate — one at a time, foreground requests overtake queued background work while each priority stays FIFO, at most 64 reads wait, only while the V8 heap is strictly below two-thirds of its ceiling; a skipped read takes the caller's no-data path, never a failure. The skills route's observeSession read is gated too and runs with projectionMode: 'none': its cwd and agentPreset come from the durable session header (present on every supported floor), so no projection folds for it. (src/host/coldRead.ts, src/host/skills.ts)
  7. The warm-up folds sessions over 2,000 events in in-memory slices through sessionProjections.restore/hydrate, sessions.prepare, and sessionProjectionCache.write, with one write-back at the durable log end; a missing face leaves the session on the single-shot path. The slice size adapts to the measured per-slice cost against a 150 ms budget (floored at 128 events), because a slice's synchronous block grows with the accumulated fold state. Sessions over 30,000 events fold in a worker thread (src/host/foldWorker.ts — an eval worker booting the plugin's own bundle and driving the timeline/activity definitions over 2,000-event chunks, so no registry re-parse reaches the host event loop) and land in the plugin's overview cache (§7.3): the harness projection cache stays cold for them, but snapshot/heads reuse the materialized head while facts/fleet/detail still read those sessions cold until a session goes live; one active worker drains a bounded FIFO and each 2,000-event chunk waits for an acknowledgement; an idle worker terminates after 20 s and lazy-spawns on the next fold, while synchronous startup failures reject only the active job and recover the queue; the path is gated on sessionPersistence.stat (identity-keyed rows) and a present overview cache, and worker absence or failure falls back to the sliced path. A sliced write-back lands the ordinary session/end-seed resume marker that the prepared (non-stored) session constructor appends, one seq above the durable end: the marker has no projection effect on this plugin's units and a later live load appends the same marker, so rows match a single-shot coldSnapshot up to that one-seq watermark, the warm-up treats the one-ahead cut as warm, and any further lead refolds; crash-repair closers are never folded into a cache write. (src/host/backfill.ts; dsh: packages/core/session/src/index.ts constructor, packages/session/session-projection-cache/src/index.ts write barrier)
  • Procedure — force one session's refold: rm ~/.dsh/storages/session_projcache/sessions/<session-id>.json; a derived cache, rebuilt from the durable log.

7 · Host data plane

Where data comes from, where computation happens, and how the browser stays current.

  1. External catalogues are host-owned and purpose-split. The npm latest-version lookup and the models.dev price catalogue are fetched by the host (src/host/catalog.ts) with an injectable fetcher, a 1 h TTL, a single-flight promise and a compact price book (provider → model → four rates, plus canonical ids) that is matched on demand and memoized per (book, provider, model) instead of pre-indexed; the browser never calls registry.npmjs.org or models.dev and never receives the price table. The update check has its own purpose-specific endpoint, POST api/dsh-context/version ({ready, failed, checkedAt, current, updateAvailable, latest?}) — updateAvailable is the host-side isNewerRelease compare (src/shared/version.ts), the single comparison model; while it is cold or failing the reply stays ready:false and the UI shows no update pill, never a fabricated version. The price book refreshes on its 1 h TTL and reports a prices version the overview revision includes, so a changed book invalidates unchanged replies once. After every successful fetch the distilled source (cost fields and canonical ids only, ~1.1 MB) is persisted to $DSH_HOME/storages/dsh-context/price-book.v1.json; a cost serve loads it before any network call, serves a stale copy while refreshing behind it, and ignores an unusable file. The sponsor recom list is host-persisted too (recoms.v1.json): the first request answers from disk and always refreshes behind it, with a deliberate 30-day usability window, and a failed refresh keeps the last good list. Cost availability is implicit in the data plane: a cost-bearing timeline carries costRead.ready:false while the catalogue is cold, the host starts the price fetch lazily on the first cost-bearing serve (with a 30 s failure backoff, so an air-gapped host does not refetch on every serve), and the client schedules bounded invalidate('pricing') retries (1.5 s / 4 s / 10 s, one shared ladder; a read that turned ready resets the ladder but never cancels another source's pending refresh) plus a projection refresh on each retry, so money appears without a reload. Per-(provider, model) price resolutions are memoized per price book (src/shared/pricing.ts), so repeated usd() reads across rows and days resolve once per book. The plugin host runs in the dsh web server process, so outbound calls do not depend on the browser origin. Evidence: measurement matrix (before: models.dev + npm browser calls; after: none), tests/host/{catalog,stepIdentity,headsRoute,cost,recoms}.spec.ts, tests/client/{cost,treemap}.spec.ts.
  2. Money is computed host-side and the price table is never shipped. Every timeline a host route serves carries costRead?: {usd, ready, faces?, misses?} (projection wire view, detail, facts, snapshot) computed by src/host/cost.ts from the same price resolution the plugin used before (src/shared/pricing.ts, moved verbatim from the client book; src/shared/priceIdentity.ts). faces/misses are resolved per-model rate facts for the tooltip only — never the catalogue. It is a serve-time wire field, never fold state, so projection-cache rows (§6) are unaffected and a catalogue change needs no stateVersion bump. The client only converts currency (1 CNY = 0.15 USD), formats, and sums host-provided USD across a family; it holds no price book (the @opencode-ai/models dependency and src/client/modelPrices.ts are gone). POST api/dsh-context/heads resolves each id through the live snapshot, then a validated materialized head, then the projection-cache row of its sessionPersistence.stat header, then a gated durable-log head fold (with cost) — so a subagent whose cache row or live snapshot is unavailable still serves its head; the client additionally falls back to one per-id head detail read for every id missing from a batch (up to one full 64-id batch).
  3. Overview works on a pre-aggregated API with a revision protocol and a disk-backed row cache. POST api/dsh-context/overview ({part:'summary'|'days'|'page'|'tally'|'projects', revision?, scope?, sort?, page?, tally?, pick?}) aggregates summary/KPI, heatmap days, the 12-card page, tally lists, and per-project token distributions over the full corpus on the host (src/host/overview*.ts); the same revision answers {revision, unchanged:true} with no row work, serialization or compaction; a client part sends revision only for the request key whose payload it still holds, so unchanged always leaves painted data in place and a remount or scope switch fetches cold; the revision covers per-session identities, workspace, backfill coverage and the price-book version, so coverage progress, completion and price refreshes reach the client even while rows are unchanged. A served request key quantizes a relative range's resolved window to the local day, so a clock crossing local midnight re-serves that scope once instead of holding yesterday's rows; absolute scopes keep their keys. Scope is explicit and complete per part: summary applies range+day+coverage+group+query, days applies coverage only, tally and projects apply range+day+coverage, page applies the full filter set with scopeTotal/groups for pre-group chip counts; a missing or unknown range resolves to the 30d preset. A scope may carry both the legacy absolute range and {calendar:{from,to}}; the host resolves calendar day keys first and summary returns the resolved absolute window plus host day keys, so a remote browser's timezone cannot diverge from aggregate filtering. The client keeps only view state and does no price/KPI/day/timing computation: the KPI tool/time cells ride the host's range-scoped windowTiming, while timing stays the lifetime breakdown for the StatsTiming card. The legacy snapshot route remains for session rows and gains the same revision skip (src/host/snapshotRoute.ts). Resident-memory model. Cold rows live in $DSH_HOME/storages/dsh-context/overview-cache.v3/ (otherwise ~/.dsh/...) as 64 stable session-id shards, each atomically replaced. A record is exactly {materialization, identity, versions}; strict HeaderFacts and signature live inside materialization, costRead is stripped, and a warm load derives one HostSession sharing the validated activity/current/timing objects instead of persisting a second graph. v1/v2 are never warm sources or merge inputs and are removed best-effort after a successful v3 flush; shard corruption never falls back to them. Saves coalesce by id into serialized descriptors bounded to 256 records/8 MiB with a 5 s capacity timeout, one active and one pending batch, and a 2 s debounce that continuous saves cannot extend. save() awaits acceptance (not durability), later loads observe accepted overlays, rejection leaves the current full response intact and requests another backfill; flush/dispose waits for all accepted batches unless a shard write fails, in which case the failed active and newer pending batches remain observable and a later save/flush/dispose retries. Full-corpus saves prune deleted ids only from changed shards. The in-memory sessions/rows maps release after 20 s without a request while the retained revision still answers unchanged polls. A cached row requires a matching durable JSONL identity (path + size + mtime from sessionPersistence.stat), matching timeline/activity/config versions, and valid timeline/activity materialization; changed/missing/unvalidatable rows rebuild from the projection cache, and a one-sided snapshot is never written back. Startup backfill uses probe() for the same validation without deriving HostSession graphs. backfill.foldedSince(marker) dirties only folded ids; overflow forces a full plugin-cache reload so worker-only rows cannot be replaced by missing projections. The first paint on an empty cache answers from a full build and seeds identity capture in the background; later restarts validate with fs.stat. Backfill prewarms the same materialization through warm(), concurrent warms/parts share one materialize lock and 5 s corpus scan, and one fresh scan validates identities once. The same 20 s idle sweep releases facts/fleet/detail/command-page caches. Without sessionPersistence.stat the earlier in-memory semantics apply; without a writable path it rebuilds.
  4. Freshness is push-on-invalidation, not polling-only. The client reacts to invalidate('pricing'|'overview'|'sessions'|'heads') (src/client/invalidation.ts); visible views poll at 30 s and the revision makes an unchanged poll tiny. A still-unpriced timeline arms the bounded cost ladder (see item 1), and the subagent-cost seat drops unpriced landed heads on pricing so the heads batch re-reads instead of keeping a stale ready:false forever. Backfill starts without a browser after the optional appReady commit (or the dependency-ready fallback), coalesces startup/manual/session/disposed triggers, and retries heap pauses/transient failures in the host with exponential backoff and a 10-attempt no-progress budget; it reports {complete, remaining, failed, running, total, covered, unsupported, unreadable} plus bounded {id, reason} detail lists for host-refused (unreadableSessions) and failed folds (failedSessions); the pass counters refresh as sessions are covered, while running and complete bracket the pass. A log the host refuses to open (corruption) counts as unreadable, never as a fold failure: it carries a bounded {id, reason} detail list, does not block completion, and stays out of the fast path so the next pass retries it (a host-side fix self-heals without a plugin change). A stalled pill or an unreadable count is a button that posts POST api/dsh-context/backfill to start one fresh pass; that is the only user-driven pass, its tooltip lists the bounded detail (marking a capped list with the shown/total counts), and a poisoned projection-cache row survives it until the offending unit's stateVersion moves. The client never drives normal backfill: incomplete coverage only schedules overview re-reads, and unknown values paint as '—', never 0. (src/host/backfill.ts, src/client/overviewSource.ts, src/client/components/overviewPanel.tsx).
  5. Fleet details are host-paged. POST api/dsh-context/fleet keeps the single-session preview/full/history shapes byte-identical and adds summary ({rootId, rootCreatedAt?, detail, members, familySize, counts} from the root session's log only — no child log reads, plus a bounded per-root counts cache lifecycle-keyed by the root header.createdAt) and batch ({batch:{ids, mode, rootId?}} → up to 16 ids per call, sequentially inside one shared cold-read admission, per-id failure isolated into missing). The client paints from the summary + sessions snapshot first, then auto-continues 16-id batches in updatedAt order with no user action; exact family totals come from a compact facts ledger (host counts + each child's own messagesTotal/delegations), never from the retention-capped payload slice, and any unreadable member shows a failure note + retry with —, never 0. A host without the new kinds degrades to the legacy single-session protocol. (src/host/fleet.ts, src/client/fleetDetail.ts, src/client/fleetModel.ts)
  6. The balance capsule reads the signed-in account and the API key side by side. POST api/dsh-context/balance asks the optional deepseekAccount service (getBalance, packages/credentials/deepseek-account) and the configured DeepSeek API key's /user/balance independently and serves {account, api}, each a source's balances or null. The account arm maps its recharge wallets (value) to toppedUp, bonusWallets to granted, and their sum to total; the API arm derives granted/toppedUp from balance_infos. Only a source that answered is offered: a signed-out or unreadable account is null, and only a resolvable key the platform accepts yields an API arm. The balanceSource preference names the arm the capsule shows (account by default) and falls back to the other available arm. The account call carries the detected harness version as x-client-version; the provider sends the request headers and cookies, and no credential or platform endpoint is duplicated here. The 0.2.2 line merged the service definition and its platform provider: rc.1 ships the deepseek-account service plus the deepseek-account-platform package in its bundle entry, while rc.2+ ships one deepseek-account package whose DeepSeekAccount.getBalance is the remote face and whose bundle entry names @deepseek-ai/dsh-deepseek-account. (src/host/balance.ts, src/client/balance.ts, src/client/components/balanceCapsule.tsx; dsh: dsh-v0.2.2-rc.1:packages/credentials/deepseek-account-platform/src/details.ts get_user_summary and dsh-v0.2.2-rc.1:packages/bundle/base/cordis.patch.yml deepseek-account-platform; dsh-v0.2.2-rc.3:packages/credentials/deepseek-account/src/{index,details}.ts and the base bundle's @deepseek-ai/dsh-deepseek-account)
  • Limitation — air-gapped hosts: without egress to npm/models.dev the catalogue stays cold: no update pill and no money figures (faces/misses absent), while token/timing/context data keeps working. A previously persisted price book still prices after a restart; only a host that never fetched has no book. No proxy configuration is offered.

  • Limitation — catalogue staleness: prices and the latest version are at most 1 h old (TTL); a catalogue refresh changes money values without touching fold state. A failed refresh keeps serving the last book (in memory or persisted), so figures can run older than the TTL while the network is down.

  • Limitation — balance sources: the two arms can belong to different DeepSeek accounts, so the API arm may differ from the signed-in account's; token rejection (401/40003) removes the signed-in grant through the provider's own expiry path, and a negative wallet makes the account snapshot unreadable (the plugin's wire shape is non-negative). Each arm reports one currency — the locale's display currency (CNY for zh, USD otherwise), else its first entry. A failed or unreadable arm is served as absent, so a transient read failure hides that arm (both failing hides the capsule) instead of painting stale figures; the next successful read replaces the remembered report.

  • Limitation — scan freshness: session created/disposed events reset the corpus scan immediately; a cold-log-only change inside the 5 s listing window is reflected by the next request after it expires (a visible page also polls every 30 s). (src/host/overview.ts; tests/host/overview.spec.ts)

  • Limitation — one-time cache seeding: an empty cache requires a full projection-row scan and durable-stat sweep, so startup cost scales with the complete corpus rather than a cached prefix; later restarts use fs.stat validation. A backend without location.path/sizeBytes, or an unwritable cache directory, degrades to the cold path forever.

  • Limitation — desktop file sink level: the desktop shell's host log file records warn/error only (the shell owns the file sink; cordis LoggerService delivers to exporters), so the backfill's success-path info lines — pacing pauses and the folded-count summary — never reach logs/host/*.log; progress is observable through the backfill route's coverage reply, and failures still warn through. (dsh: vendored @deepseek-ai/cordis lib/index.js LoggerService)

  • Limitation — full-history memory: reading the 84,467-event benchmark session (16,457 requests, 32,914 surface nodes, 61,466 spans) raises host idle heap by about 82 MB over a capped view. The durable JSONL backend memoizes the parsed event array, and the history fold materializes every page collection; the plugin keeps one folded state per session (2-entry/64 MiB cache) and one materialized part per cold entry. (src/host/history.ts; dsh: packages/session/session-persistence-jsonl/src/index.ts coldLogMemo)

  • Limitation — overview cache validity: a cold row is keyed by log path+size+mtime; a rewrite that preserves both is invisible, and a hard crash before an accepted shard flush can leave a stale row until its log identity changes. Unvalidatable identities (backends without location.path/sizeBytes) get no warm-reuse benefit but still rebuild correctly, and the fold epoch is per process, so the first paint after a plugin restart may return one full payload before the revision stabilizes.

  • Measurement — cache v3: on dsh's deterministic 64-session corpus (107,169 events), seven AB/BA pairs with complete semantic parity report median cold peak 652,136,448→626,610,176 B, idle RSS 235,520,000→132,853,760 B, and idle heap 126,974,672→45,507,456 B; cache bytes 171,178→123,468 B and largest file 171,178→5,680 B. Cold first-complete and warm overview/snapshot deltas cross zero; cold heads is 2.71→7.74 ms, warm heads 4.15→4.92 ms and page 1.39→1.75 ms, while warm idle heap rises 104,216 B. The cache-I/O pass writes 171,178→123,468 B for cold seeding and 85,109→22,066 B for a 64→32-record prune. Fresh Chrome 157.0.8103.79 reports first-screen heap 27,086,512→27,093,760 B and repeated-mount heap 28,927,672→28,968,804 B (v2→v3), identical 1,859-node unmounted DOM, no server errors, and a passing /context. Reproduce with scripts/memory-bench/paired.mjs and scripts/memory-bench/browser.mjs.

8 · Packaging

Dependency declarations that look dead and are not.

  1. Declare @deepseek-ai/dsh-client-ui-primitives' bare imports as this plugin's own devDependencies — its lib/index.js imports shiki/core, @shikijs/langs/*, katex, the mdast-util-*/micromark-* chain, anser, clsx, diff and simple-icons, all listed only as the package's own devDependencies; the client test project inlines that dist (vitest.config.ts server.deps.inline), so pnpm must resolve each from this package. The bundle never carries primitives (a platform external); drop an entry when a primitives release stops importing it.
  2. Declare @deepseek-ai/dsh-client-store, @deepseek-ai/dsh-util-code-language, and their zustand + immer — same reason, reached only through the primitives dist.
  3. Never add tailwindcss directly — @tailwindcss/node depends on it at its own exact version, so a direct declaration at another range resolves a second framework copy beside the compiler this build imports; use @tailwindcss/node + @tailwindcss/oxide only.
  4. Ship zod at or above the 4.6.6 security floor — GHSA-mrhx-c7xc-m3w5 (oversized arrays exhaust memory) is patched only there, while the supported lines carry 4.4.3 (0.2.0 as ^4.4.3, 0.2.1/0.2.2-rc.1 exact) and 0.2.2-rc.2+ moved to 4.6.6. The plugin declares ^4.6.6 and accepts a second copy beside the harness's: the registry only calls .parse() on the schemas this plugin registers, so schema identity never crosses the boundary and the security floor outranks copy dedupe. pnpm-workspace.yaml overrides collapses the dev tree's ^4.4.3 holders to the same patched copy. (dsh: packages/session/session-projection/src/index.ts stateSchema.parse/viewSchema.parse; per-package zod pins; packages/boot/app-boot/src/profile.ts hoisted linker)

9 · Verification

How every claim above is proven.

  • Check — supported-set lockstep: tests/compat/bundle.spec.ts fails unless dshReleases, tests/baselines.ts and both CI workflows' fetched tags name the same staged releases, the ranges admit every staged release, each line final and 0.2.2-alpha.3 while refusing 0.1.7* and 0.2.0-rc.1, and BASELINE_DSH_VERSION equals the lowest floor.
  • Check — seam matrix (the compat vitest project; every CI pnpm test): per baseline it stages selected REAL harness sources (registry + types, values, known-event types, platform module table, admission module) on the tag's cordis version, boots the BUILT plugin, probes host behaviour, the client faces and the retired seams (settings register, settings get(ns), sessions open(id)), re-runs the tag's admission evaluator, asserts every fold-switch event family is covered by some baseline and known to the tag's durable vocabulary, and checks the sliced-fold faces. Const-enum members are inlined as tsc compiles them (the 0.2.2 registry imports FiberState, absent from the published cordis build). Needs a dsh checkout (DSH_REPO, default ~/dev/deepseek-harness) and a built lib/; a missing checkout or built lib/ skips with a printed reason on a dev box (CI fails), while a missing tag or a failing probe fails everywhere.
  • Check — differential fold (manual): bun scripts/diff-fold.ts <session.jsonl>... (needs a bun runtime, not a package dependency) replays token-meter's own contextBreakdown from the dsh source checkout against the plugin's composition (system/tools/message tokens, the documented image delta excepted; exit 0 = match). No other metering figure has a differential check. Surface order and replacement position are pinned separately: the host suite folds the same events through both implementations and requires identical node order.
  • Check — install: automated in release.yml via dsh-plugin-checker against npm latest only, so it covers one line at a time. For every supported line — and both staged 0.2.2 releases — run the manual pass: a disposable DSH_HOME, that release's CLI, dsh plugin add dsh-context → exactly one dsh-context row in --dump-config → dsh plugin remove → none. Pin the exact just-published plugin version — pnpm's minimumReleaseAge can hold a fresh release back.
  • Check — host data plane: tests/host/{catalog,versionRoute,cost,overview,overviewPage,overviewProjects,overviewMemory,overviewCache,overviewCacheShards,overviewMaterialization,materializedSnapshot,headsRoute,history,backfill,backfill-unreadable,backfill-failed,foldPool,coldRead,fleet}.spec.ts and tests/client/{versionSource,costRefresh,overviewSource,historySource,historyCollections,historyPaging,route,wireCost,fleetDetail,fleetModel,retention,invalidation}.spec.ts cover the catalogue TTL/failure paths, the purpose-split version endpoint, the lazy pricing bootstrap + bounded cost retries, the cost wire decoders, the overview revision/unchanged replies, the host page/tally aggregates, the fleet summary/batch contract, and the invalidation hooks. A browser measurement pass on a real dsh web server asserts zero external requests from the page, records overview/snapshot payload bytes, fleet request counts, client heap and narrow-width DOM before/after, and compares the context-tab cost faces byte-for-byte.
  • Measurement — full history (2026-11-21, single run): host 84,467-event session (16,457 requests, 32,914 nodes, 61,466 spans): pre-phase1+2 warm peak WS 442 MB / idle heap 92 MB; full-history warm 786 MB / idle heap 174 MB; an empty history route idles at 92 MB and fold-then-discard at 173 MB, locating the residual in the persistence parsed-log memo. Browser smoke max (16.5k steps): context heap 36.7→53.3 MB, 74 history requests / 853 KB / 248 ms, context DOM 3,343→5,309 and stable, long tasks 2→6 with the same 302 ms maximum, /context modal passes, no server errors. (scripts/memory-bench/host.mjs, scripts/memory-bench/browser.mjs)
  • Check — hostile fixtures: every guard is exercised with hostile input — wrong types, absent fields, throwing accessors — not only a happy path.
  • Procedure — add a baseline: one Baseline entry in tests/baselines.ts (tag, vendored cordis, faces) plus the tag in both workflows' fetch step; run pnpm test; the lockstep test fails until the fetch lists match.
  • Limitation — scope: these checks prove source-level seam compatibility, the contextBreakdown differential, and install/uninstall for the checked line(s) — not full web-app runtime acceptance on a real profile.