# Compatibility audit > **Method: the tests are the audit.** The probes in `tests/compat-invariants.test.ts`, > `tests/compat-interop.test.ts`, `tests/compat-gaps.test.ts` and > `tests/compat-tool-updates.test.ts`, together with `scripts/verify-host.mjs`, drive this > plugin's real execution paths through the DSH subsystems' **real consumer paths** (the > actual `@deepseek-ai/*` packages, not mocks) and assert the invariants below. A failing > probe is a finding. > > **Retention rule.** Only two things are recorded: behaviour the harness could offer better > and does not, or a defect this plugin must **not** compensate for. Correct-by-design > behaviour is not restated — the probes pin it, and > [Deliberate semantics](#deliberate-semantics-no-entry-kept) names it. Upstream references use > symbols and file names, never line numbers: line numbers rot. > > **Declared range:** `engines.dsh: ">=0.2.1-0 <0.3.1-0"`, mirrored on all sixteen > `@deepseek-ai/dsh-*` peer dependencies. **Verified baseline** (the targeted version): > `0.2.2-alpha.3`, the version every `@deepseek-ai/*` devDependency is pinned to. Release and > DSH alignment policy: [`docs/release/release.md`](../release/release.md). > > **Compatibility stance: adapt forward, never drop the range.** Moving the baseline forward > does not narrow the declared range — `0.2.2-alpha.2` and the `0.2.1-0` line stay admitted. > Forward adaptation and old-line support are one mechanism, not two: the new rules this plugin > needs are read from the runtime (`caps`, the settings/config-form surfaces) and absent ones > degrade, so the same code serves both the baseline and the lines below it. ## Verification method The plugin carries no separate audit script. Verification is layered, and every layer runs from `npm run check` (`typecheck` → `build` → `test` → `verify-host` → `npm pack --dry-run`): | Layer | What it drives | Where | | --- | --- | --- | | Unit suites | Pure planning, the on-disk store, history, locales, client helpers | the 42 `tests/*.test.ts` files | | Compatibility probes | Four consumer-facing probe suites — replayability, surface consistency, folds, compaction interop, client ordering, tool-update projection | `compat-invariants` · `compat-interop` · `compat-gaps` · `compat-tool-updates` | | End-to-end host run | The real host plugin over a real `Session`, a real command registry and a fake fs: 17 numbered groups (command registration → surface cut → checkpoint capture → restore → crash/recovery → compaction → cleanup → plan mode) | `scripts/verify-host.mjs` | | Publish layout | Bundle externals, export subpaths, tarball allowlist, engines/peer consistency | `tests/package-layout.test.ts` | | Capability probe | Which Host/Client capabilities the installed DSH line actually ships | `scripts/probe-caps.mjs` | The repository currently has **no `.github/workflows/`** directory, so `npm run check` is the gate rather than a CI run. `scripts/probe-caps.mjs` is the deployment-side counterpart: it reports `surfaceOp`, `rpc`, `toolsHooks`, `workspaceRegistry`, `settingsSection`, `configForms` and `uiConversationViews`, and prints `REFUSE-ENABLE (core capability missing)` when either core capability (`surfaceOp`, `rpc`) is absent. ## Version scope `engines.dsh` is the **sole admission criterion** on current hosts: when a manifest declares it, DSH reads no other range and admits the plugin only while the runtime satisfies it under `includePrerelease`. Older hosts ignore `engines.dsh` and read the peer ranges instead, which is why the two are kept identical. A runtime outside the declared range is refused at load rather than admitted into unadapted code. The declaration is not the verification record, which matters here because the declared range spans two lines: - **`0.2.2-alpha.3` — verified baseline.** Every `@deepseek-ai/*` devDependency is pinned to this version, and `npm run check` runs against it. Every invariant below is asserted at this baseline. - **`0.2.2-alpha.2` — previously verified, still admitted.** The same invariant set passed at `alpha.2` before the baseline moved; no invariant changed between the two patches, so the declared range keeps `alpha.2` admitted while the baseline follows the current patch. - **`0.2.1-0` line — admitted, not verified version-by-version.** It predates the current client settings surface, so what exists there is decided at **runtime capability detection**, not by a version branch: the client asks the host over the `/dsh-rewind` `caps` endpoint and degrades what is absent (see [U9](#u9--the-capability-surface-differs-across-the-declared-range)); `scripts/probe-caps.mjs` reports the same capability set before the plugin is even enabled. Core capabilities missing → the plugin refuses to be enabled; optional ones missing → the affected surface degrades and says so. The same detection covers the **`0.3.0` line**, which the range admits but no probe verifies (its packages were not available in the verification tree); the upper bound (`<0.3.1-0`) is where the next adaptation starts. ## Seams at the verified baseline The plugin reads one channel's shape only — no legacy host face branch, no feature-detected alternate API for the same seam. | Seam | Implementation | | --- | --- | | Host session log | `session.snapshotEvents()` for planning; `session.append('user/message', …, { surfaceOp, sourceEventSeqs })` for the cut | | Host working directory | `ctx.workingDirectory.ensure(agent)` — the base the fs tools resolve against | | Host RPC channel | `ctx.connection.rpc.handle('/dsh-rewind', handler)`, registered from the root context | | Client chat snapshot | the `uiConversation` `chat` view (`chatSnapshotOf`) | | Client composer refill | the `conversation.input` facade's `setDraft` + `focus` | | Client image restore | `SessionFace.readAttachment` (a complete durable reference), then `conversation.createDrafts(…, uploadImages)` + `input.for(scope).addAttachments(…)` | | Client settings surfaces | the `plugins.bundle.config` card staged over `ctx.configForms.get(entryId)`, plus the `settings.section` page (`id: 'rewind'`, `order: 60`) with its `caps` query | | Client seat-button DOM | structural locate of the copy-`