Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
fix(dsh): support current release candidates without dropping rc.6 (#5006)
t0saki688f78e923d2
diff --git a/examples/dsh-memory-plugin/README.md b/examples/dsh-memory-plugin/README.mdindex 0d9a8cb09..485e4a0ec 100644--- a/examples/dsh-memory-plugin/README.md+++ b/examples/dsh-memory-plugin/README.md@@ -32,7 +32,7 @@ tree's realpath rather than from the profile.## Requirements-- `@deepseek-ai/dsh` `0.1.0-rc.6` or newer in the `0.1.x` release line+- `@deepseek-ai/dsh` `0.1.0-rc.6`, `0.1.5-rc.1`, or `0.1.5-rc.2`; stable `0.1.x` releases are also admitted by the peer range- Node.js `^22.19.0` or `>=24`- A reachable OpenViking server@@ -40,17 +40,62 @@ The bundle has no runtime npm dependencies. Its message structures come from`createUserMessage` (`@deepseek-ai/dsh-llm`), its tool surface from`@deepseek-ai/dsh-mcp-client`, and its skill provider from`@deepseek-ai/dsh-skill-filesystem` — peerDependencies that DSH itself already-installs, so there is nothing extra to add to a profile. The supported peer-range starts at `0.1.0-rc.6` and stops before `0.2.0`, allowing current DSH-releases whose core packages resolve to newer release candidates. The local-devDependencies and `overrides` stay pinned to rc.6 so CI continues to exercise-the minimum supported contract.+installs. Keep those packages in the host installation rather than adding+individual DSH core packages to the profile. DSH initializes profiles with+`nodeLinker: hoisted` and `autoInstallPeers: false`, then makes the host packages+available through its module fallback at boot. A missing-peer warning during+`dsh plugin add` alone does not prove startup is broken.++The peer range is `>=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1`. The second clause+explicitly admits the `0.1.5` release candidates: semver does not include them+in the first clause merely because they compare above `0.1.0-rc.6`. Other+pre-release series need separate verification. Local devDependencies and+`overrides` stay pinned to rc.6 to exercise the minimum supported contract.Everything under `shared/` and `skills/` is generated by`node examples/memory-plugin-shared/sync.mjs` — edit`examples/memory-plugin-shared/lib/` and `examples/skills/`, never the vendoredcopies.+## Troubleshooting startup++If startup reports that `@deepseek-ai/dsh-llm` does not export `assertNever`,+inspect the affected profile before changing dependencies:++```bash+dsh --version+dsh plugin --profile web why @deepseek-ai/dsh-skill+dsh plugin --profile web why @deepseek-ai/dsh-skill-filesystem+dsh plugin --profile web why @deepseek-ai/dsh-llm+```++Replace `web` with the affected profile name. Check its `package.json`,+`pnpm-lock.yaml`, and `pnpm-workspace.yaml` under+`${DSH_HOME:-$HOME/.dsh}/profiles/<profile>/`, including dependency overrides.+`[email protected]` imports `assertNever` from the old location. A profile-local+copy can shadow the newer host package and break both DSH's own skill loader+and this plugin. As of 2026-09-14, the skill and skill-filesystem npm `latest`+tags still point to `0.0.1` release candidates; installing either without a+version is not an upgrade strategy.++If these old packages are direct profile dependencies added only to satisfy+this plugin, remove those constraints and let DSH supply its matching packages:++```bash+dsh plugin --profile web remove @deepseek-ai/dsh-skill @deepseek-ai/dsh-skill-filesystem+dsh plugin --profile web add @openviking/dsh-memory-plugin@latest+dsh --profile web+```++If another plugin requires them, update that plugin's constraints instead of+removing them blindly. Keep `autoInstallPeers: false` and `nodeLinker: hoisted`+in the profile's pnpm settings. Do not patch the import in `node_modules`: a+mixed DSH package family can have other incompatible interfaces. Updating this+memory plugin alone does not remove conflicting profile-local packages.++Use `dsh --profile <profile>` to start a named profile. `dsh web` is an alias for+the stock `web` profile, not a subcommand to append after `--profile`.+## Design notes### Why injection uses pre-step user messages, not the system prompt@@ -97,9 +142,11 @@ lifecycle registration, so a proxy that cannot start holds up nothing above it.### Why the skill gets its own provider`skills.mjs` registers a second `ctx.skills` provider with-`includeDefaultRoots: false`, serving only `skills/`. DSH already mounts a-`filesystem` provider over the project and user skill roots; an isolated-provider adds the bundle's skill without shadowing or duplicating that catalog.+`includeDefaultRoots: false` and `bundledSkillDir` pointing at `skills/`. DSH+reads this host-owned bundle directly rather than asking a workspace filesystem+to resolve a path outside its root. Its existing `filesystem` provider still+owns the project and user skill roots; the bundle does not duplicate that+catalog or override higher-priority project skills.## Configuration@@ -182,6 +229,20 @@ npm run check # syntax check every shipped module + package/PLUGIN_VERSION agrnpm test # node --test *.test.mjs — runs in the repo's PR workflow```+The `0.3.2` compatibility check installed the packed bundle through+`dsh plugin add` in isolated profiles and exercised DSH `0.1.0-rc.6`,+`0.1.5-rc.1`, and `0.1.5-rc.2` with matching core packages. It covered Web startup+and browser loading, skill discovery/read, MCP tool calls, profile/recall+injection, user/assistant capture, resume deduplication, threshold commits, and+disposal commits. The check used a local HTTP/MCP fixture and a deterministic+model adapter on macOS with Node.js 26.5.0; it verifies harness integration, not+real-server memory extraction. The rc.2 CLI also exited cleanly on SIGTERM.++The startup failure from issue #4944 was reproduced by adding the reported+old skill packages to an rc.2 profile; removing those direct dependencies and+reinstalling the bundle restored the same integration checks. A clean rc.2+profile with the published `0.3.0` bundle did not reproduce that import error.+`live-recall.test.mjs` is an opt-in end-to-end gate against a real OpenVikingserver: it stores a sentinel memory through a session commit, waits forextraction, and asserts recall returns that sentinel — the property no stubdiff --git a/examples/dsh-memory-plugin/bundle.test.mjs b/examples/dsh-memory-plugin/bundle.test.mjsindex a6331c52e..16e932e6f 100644--- a/examples/dsh-memory-plugin/bundle.test.mjs+++ b/examples/dsh-memory-plugin/bundle.test.mjs@@ -3,6 +3,8 @@ import { readFile, readdir } from "node:fs/promises";import { dirname, join, relative } from "node:path";import test from "node:test";import { fileURLToPath } from "node:url";+import semver from "semver";+import { PLUGIN_VERSION } from "./config.mjs";const PLUGIN_DIR = dirname(fileURLToPath(import.meta.url));const FORBIDDEN_IDENTIFIER = ["tra", "ex"].join("");@@ -17,12 +19,13 @@ test("bundle uses neutral DSH naming, bounded peers, and an isolated service", aassert.equal(manifest.name, "@openviking/dsh-memory-plugin");assert.equal(manifest.dependencies, undefined);- // DSH rc releases intentionally float their core packages within 0.1.x.- // Accept that host range while keeping CI pinned to the oldest supported- // contract so a newer local install cannot silently raise our minimum.- const supportedPeerRange = ">=0.1.0-rc.6 <0.2.0";- for (const [name, version] of Object.entries(manifest.peerDependencies)) {- assert.equal(version, supportedPeerRange, `${name} must use the bounded 0.1.x range`);+ for (const [name, range] of Object.entries(manifest.peerDependencies)) {+ for (const version of ["0.1.0-rc.6", "0.1.5-rc.1", "0.1.5-rc.2", "0.1.5"]) {+ assert.ok(semver.satisfies(version, range), `${name} must accept ${version}`);+ }+ for (const version of ["0.0.1-rc.3", "0.1.0-rc.5", "0.1.5-alpha.2", "0.2.0-rc.1", "0.2.0"]) {+ assert.ok(!semver.satisfies(version, range), `${name} must reject ${version}`);+ }assert.equal(manifest.devDependencies[name], "0.1.0-rc.6", `${name} must test the minimum`);}assert.ok(manifest.peerDependencies["@deepseek-ai/dsh-mcp-client"]);@@ -42,6 +45,14 @@ test("bundle uses neutral DSH naming, bounded peers, and an isolated service", aassert.doesNotMatch(patch, FORBIDDEN_PATTERN);});+test("the runtime and package lock report the published package version", async () => {+ const manifest = JSON.parse(await readFile(new URL("./package.json", import.meta.url), "utf8"));+ const lock = JSON.parse(await readFile(new URL("./package-lock.json", import.meta.url), "utf8"));+ assert.equal(PLUGIN_VERSION, manifest.version);+ assert.equal(lock.version, manifest.version);+ assert.equal(lock.packages[""].version, manifest.version);+});+test("plugin source tree contains no product-specific identifier", async () => {for (const file of await sourceFiles(PLUGIN_DIR)) {const path = relative(PLUGIN_DIR, file);diff --git a/examples/dsh-memory-plugin/config.mjs b/examples/dsh-memory-plugin/config.mjsindex dae07de1c..0c70462f8 100644--- a/examples/dsh-memory-plugin/config.mjs+++ b/examples/dsh-memory-plugin/config.mjs@@ -1,7 +1,7 @@import { buildUserAgent, resolveOpenVikingCredentials } from "./shared/credentials.mjs";import { resolveEffectivePeerId } from "./shared/workspace-peer.mjs";-export const PLUGIN_VERSION = "0.3.0";+export const PLUGIN_VERSION = "0.3.2";/*** Namespace for the bridged OpenViking MCP tools. DSH publishes every MCP tooldiff --git a/examples/dsh-memory-plugin/package-lock.json b/examples/dsh-memory-plugin/package-lock.jsonindex fb573980e..77057e810 100644--- a/examples/dsh-memory-plugin/package-lock.json+++ b/examples/dsh-memory-plugin/package-lock.json@@ -1,26 +1,27 @@{"name": "@openviking/dsh-memory-plugin",- "version": "0.3.1",+ "version": "0.3.2","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@openviking/dsh-memory-plugin",- "version": "0.3.1",+ "version": "0.3.2","license": "Apache-2.0","devDependencies": {"@deepseek-ai/dsh-llm": "0.1.0-rc.6","@deepseek-ai/dsh-mcp-client": "0.1.0-rc.6","@deepseek-ai/dsh-skill-filesystem": "0.1.0-rc.6",- "@deepseek-ai/dsh-tools": "0.1.0-rc.6"+ "@deepseek-ai/dsh-tools": "0.1.0-rc.6",+ "semver": "7.8.5"},"engines": {"node": "^22.19.0 || >=24"},"peerDependencies": {- "@deepseek-ai/dsh-llm": ">=0.1.0-rc.6 <0.2.0",- "@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6 <0.2.0",- "@deepseek-ai/dsh-skill-filesystem": ">=0.1.0-rc.6 <0.2.0"+ "@deepseek-ai/dsh-llm": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1",+ "@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1",+ "@deepseek-ai/dsh-skill-filesystem": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1"}},"node_modules/@deepseek-ai/cordis": {@@ -1397,6 +1398,19 @@"dev": true,"license": "MIT"},+ "node_modules/semver": {+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },"node_modules/send": {"version": "1.2.1","resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",diff --git a/examples/dsh-memory-plugin/package.json b/examples/dsh-memory-plugin/package.jsonindex b1f230bb3..d0a026fb3 100644--- a/examples/dsh-memory-plugin/package.json+++ b/examples/dsh-memory-plugin/package.json@@ -1,6 +1,6 @@{"name": "@openviking/dsh-memory-plugin",- "version": "0.3.1",+ "version": "0.3.2","description": "OpenViking memory and context bundle for DeepSeek Harness","type": "module","main": "index.mjs",@@ -35,15 +35,16 @@"prepublishOnly": "npm run check && npm test"},"peerDependencies": {- "@deepseek-ai/dsh-llm": ">=0.1.0-rc.6 <0.2.0",- "@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6 <0.2.0",- "@deepseek-ai/dsh-skill-filesystem": ">=0.1.0-rc.6 <0.2.0"+ "@deepseek-ai/dsh-llm": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1",+ "@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1",+ "@deepseek-ai/dsh-skill-filesystem": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1"},"devDependencies": {"@deepseek-ai/dsh-llm": "0.1.0-rc.6","@deepseek-ai/dsh-mcp-client": "0.1.0-rc.6","@deepseek-ai/dsh-skill-filesystem": "0.1.0-rc.6",- "@deepseek-ai/dsh-tools": "0.1.0-rc.6"+ "@deepseek-ai/dsh-tools": "0.1.0-rc.6",+ "semver": "7.8.5"},"overrides": {"@deepseek-ai/dsh-agent": "0.1.0-rc.6",diff --git a/examples/dsh-memory-plugin/runtime.mjs b/examples/dsh-memory-plugin/runtime.mjsindex 0449b2b67..8f1b428bf 100644--- a/examples/dsh-memory-plugin/runtime.mjs+++ b/examples/dsh-memory-plugin/runtime.mjs@@ -418,7 +418,9 @@ function pluginMessage(content, form) {function hasStartupProfile(agent) {const session = agent.session;- const ownEvents = (session?.events || []).slice(session?.header?.seedLength ?? 0);+ const ownEvents = typeof session?.ownEvents === "function"+ ? session.ownEvents()+ : (session?.events || []).slice(session?.header?.seedLength ?? 0);const inHistory = ownEvents.some(event => (event?.type === "user/message" && isStartupProfile(event.data)));diff --git a/examples/dsh-memory-plugin/runtime.test.mjs b/examples/dsh-memory-plugin/runtime.test.mjsindex 517a089d4..52ac9faeb 100644--- a/examples/dsh-memory-plugin/runtime.test.mjs+++ b/examples/dsh-memory-plugin/runtime.test.mjs@@ -269,6 +269,43 @@ test("persisted profile delivery survives dispose and re-seed", async () => {);});+test("profile delivery uses current DSH session-owned history on resume and fork", async () => {+ const profile = {+ type: "user/message",+ data: {+ role: "user",+ content: [{ type: "text", text: "stored profile" }],+ source: { kind: "plugin", plugin: "openviking-memory", form: "instructions" },+ },+ };+ for (const [id, ownEvents, expected] of [+ ["resumed", [profile], null],+ ["forked", [], "instructions"],+ ["forked-resumed", [profile], null],+ ]) {+ const runtime = new OpenVikingRuntime({}, config(), { debug() {} });+ let historyReads = 0;+ const session = {+ id,+ header: { cwd: "/workspace", isSeeded: id !== "resumed" },+ ownEvents() {+ historyReads += 1;+ return ownEvents;+ },+ };+ const state = runtime.stateFor(session);+ state.ready = true;+ state.profileBlock = "current profile";++ const message = await runtime.profileMessage({ session });++ assert.equal(message?.source?.form ?? null, expected, id);+ assert.equal(historyReads, 1, id);+ assert.equal(state.profileDelivered, true, id);+ assert.equal(await runtime.profileMessage({ session }), null, id);+ }+});+test("disposeAll drains every live session", async () => {const committed = [];const runtime = new OpenVikingRuntime({diff --git a/examples/dsh-memory-plugin/skills.mjs b/examples/dsh-memory-plugin/skills.mjsindex 4cdba74b0..897ddddb0 100644--- a/examples/dsh-memory-plugin/skills.mjs+++ b/examples/dsh-memory-plugin/skills.mjs@@ -10,11 +10,8 @@ export const SKILLS_DIR = fileURLToPath(new URL("./skills", import.meta.url));export function buildSkillsConfig() {return {providerName: SKILL_PROVIDER_NAME,- // Isolated: this provider serves only the bundle's own skill, so it never- // shadows or duplicates what DSH's default filesystem provider discovers- // under the project and user skill roots.includeDefaultRoots: false,- customSkillDirs: [SKILLS_DIR],+ bundledSkillDir: SKILLS_DIR,};}diff --git a/examples/dsh-memory-plugin/skills.test.mjs b/examples/dsh-memory-plugin/skills.test.mjsindex 6507b4cf1..41b6c499a 100644--- a/examples/dsh-memory-plugin/skills.test.mjs+++ b/examples/dsh-memory-plugin/skills.test.mjs@@ -2,7 +2,7 @@ import assert from "node:assert/strict";import { readFileSync } from "node:fs";import { join } from "node:path";import test from "node:test";-import { Config } from "@deepseek-ai/dsh-skill-filesystem";+import { Config, FileSystemSkillProvider } from "@deepseek-ai/dsh-skill-filesystem";import { apply } from "./index.mjs";import { buildSkillsConfig, mountOpenVikingSkills, SKILLS_DIR } from "./skills.mjs";@@ -13,7 +13,34 @@ test("the provider config validates against the pinned provider's own schema", (// Isolated roots: DSH already mounts a `filesystem` provider over the project// and user skill dirs, and this one must not duplicate that catalog.assert.equal(parsed.includeDefaultRoots, false);- assert.deepEqual(parsed.customSkillDirs, [SKILLS_DIR]);+ assert.deepEqual(parsed.customSkillDirs, []);+ assert.equal(parsed.bundledSkillDir, SKILLS_DIR);+});++test("the bundled skill stays readable outside a restricted workspace filesystem", async () => {+ const filesystem = {+ async resolve() {+ throw new Error("Path is outside the workspace filesystem");+ },+ };+ const provider = new FileSystemSkillProvider({+ get: name => name === "fs" ? filesystem : undefined,+ logger: { warn() {} },+ }, {+ signal: new AbortController().signal,+ invalidate() {},+ }, { ...buildSkillsConfig(), watch: false });+ try {+ const candidates = await provider.list({ cwd: "/workspace" });+ assert.equal(candidates.length, 1);+ assert.equal(candidates[0].name, "openviking-memory");+ assert.equal(candidates[0].source, "bundled");+ assert.equal(candidates[0].provider, "openviking");+ const skill = await provider.get(candidates[0], {});+ assert.match(skill.content, /mcp__openviking__/);+ } finally {+ await provider.dispose();+ }});test("the vendored skill ships at the served path", () => {