Skip to content

Update to DSH 0.2.2-rc.5 contract; per-project MCP child (v0.2.3) - #1

Merged
Alex793x merged 2 commits into
syncable-dev:mainfrom
magalz:dsh-0.2.3
Nov 19, 2026
Merged

Alex793x merged 2 commits into
syncable-dev:mainfrom
magalz:dsh-0.2.3

Conversation

@magalz

@magalz magalz commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two commits bringing the plugin up to the current DeepSeek Harness release (0.2.2-rc.5) and replacing the MCP row with the per-project model. Everything was verified against the shipped DSH 0.2.2-rc.5 sources and against memtrace 1.2.21 at runtime; the full test suite is green.

  • 3ea8ceb — feat: update to the DSH 0.2.2-rc.5 plugin contract (v0.2.2)
  • 25f704d — feat!: per-project MCP child (v0.2.3)

Why these changes

  1. Install refusal on current DSH. Since 0.2.1-alpha.3, DSH decides plugin compatibility from the plugin's own engines.dsh range (falling back to the @deepseek-ai/dsh peer on older releases). This plugin declared neither, and its peer range stopped at <0.2.0-0, so dsh plugin add on 0.2.2-rc.5 refuses it.
  2. The bundle did not load on Windows. lib/parse-skill.js matched LF-only frontmatter; a Windows checkout (core.autocrlf) turns all 27 SKILL.md files CRLF, so apply() threw before registering anything.
  3. The old MCP row broke under the 0.2.x patch composer. The evaluated !!js that returned the args array arrived at dsh-mcp-client as {"[object Object]": [...]} and the config was rejected.

What changed, and which code does what

File Change
package.json engines.dsh: ">=0.1.0-rc.6 <0.3.0-0" + the same peer range for older DSH; dsh.manifestVersion: 1; top-level icon (the 0.2.x display field); version 0.2.3
lib/parse-skill.js FRONTMATTER and the body strip now tolerate \r\n (/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/), so CRLF checkouts load
test/parse-skill.test.js regression test for CRLF frontmatter
.gitattributes * text=auto eol=lf — future checkouts stay LF on every platform
(60 tracked files) working tree normalized to LF (the index was already LF; no content change)
cordis.patch.yml final row: literal args: [mcp], command pinned via a scalar expression (MEMTRACE_BIN, else memtrace on PATH), no workspace flag — memtrace mcp anchors on its working directory and opens the repo's own .memdb. The comment documents why args must stay literal and how to pin one project (cwd: restatement)
lib/resolve-memtrace-mcp.js split resolveMemtraceLaunch (binary resolution: MEMTRACE_BIN → memtrace on PATH → npx -y memtrace) out of resolveMemtraceMcpLaunch; added the memtraceOnPath() probe (where/which)
bin/memtrace-mcp.js launcher rebuilt on the shared resolution (same behavior, less duplication)
lib/register-skills.js / lib/ensure-workspace.js the interim dsh named-workspace ensure (created in 3ea8ceb) was removed in 25f704d: pre-creating the workspace made the store membership un-widenable and a stale owner lease left the live child dead. apply() is back to skills-only
README.md / README.zh.md / docs/02_architecture_constraints.md compatibility matrix (engines.dsh semantics, Node floors), the per-project store model, the per-project restatement recipe, and the explicit limitation that per-session cwd keying needs a host-side change
.github/workflows/verify.yml node matrix 22 + 24 (22 keeps the 0.1.x line honest; 24 matches current DSH hosts)
.gitignore .memdb/

How it was verified

  • Compatibility: ran the shipped DSH 0.2.2-rc.5 evaluator (dsh-app-boot's evaluatePluginCompatibility) against the new manifest — compatible with 0.2.2-rc.5 / 0.2.2 / 0.2.0 / 0.1.0-rc.6; refuses 0.1.0-rc.5 and 0.3.0-alpha.1 as intended.
  • Row composition: composed the patch with DSH's own loader (loadOptionalPatches + composeEntries) — args stays ["mcp"], command is the sanctioned scalar __jsExpr wrapper. The old corruption ({"[object Object]": [...]}) was reproduced first, then shown fixed.
  • Runtime (memtrace 1.2.21): a per-project child spawned with cwd = its repository opens that repo's own .memdb and serves tools; two concurrent children each got their own store and sidecar (127.0.0.1:50051 and an auto-allocated 127.0.0.1:65021, each store's daemon-state.json recording its own endpoint); index_directory through a per-project child starts that repo's first index in its own store.

Test coverage

node --test, 14/14 green (19 before the workspace machinery was removed; node 26 locally, CI covers 22 + 24):

Suite Covers
test/manifest.test.js bundle contract: dsh.bundle.patch, stable row ids, literal args, pinned command expression, no --workspace, engines.dsh mirrors the peer range, manifestVersion, shipped icon
test/parse-skill.test.js frontmatter parsing incl. the CRLF regression
test/load-skills.test.js, test/bundled-skills.test.js every shipped SKILL.md loads (27 skills, kebab-case, unique names)
test/register-skills.test.js apply() registers each skill with a directory resourceBase and disposes on unload
test/resolve-memtrace-mcp.test.js binary resolution precedence: MEMTRACE_BIN → PATH → npx -y memtrace mcp

Breaking notes

  • The MCP row now requires memtrace on PATH (or MEMTRACE_BIN); the zero-install npx fetch becomes a documented restatement instead of the default, so per-project children never multiply npx downloads.
  • Per-session cwd (one child per workspace, reaped with its sessions) needs a dsh-mcp-client/host change — 0.2.2-rc.5 keys one instance per row with a static cwd. Until then, the cwd: <repo root> restatement gives one project its own child and store.

- engines.dsh + widened peer range, dsh.manifestVersion 1, top-level icon

- fix CRLF frontmatter parsing (plugin failed to load on Windows checkouts); LF tree + .gitattributes

- static MCP row args (0.2.x composer mangles evaluated !!js arrays)

- anchor the MCP child on the dsh named workspace: memtrace mcp --workspace dsh, ensured at apply

- node --test 19/19 green on node 26
- drop the shared dsh named-workspace model: pre-creating the workspace made the store membership un-widenable and a stale owner lease blocked the live child

- row: memtrace mcp, command pinned (MEMTRACE_BIN, else memtrace on PATH), no workspace flag - the child anchors on its working directory and opens the repo's own .memdb

- remove lib/ensure-workspace.js and apply-time workspace creation; leave any existing dsh store untouched

- docs: per-project model; per-session cwd keying needs a dsh-mcp-client change (one child per row, static cwd, scope = global or agent preset)

- verified: two concurrent per-project children each auto-allocate their own loopback sidecar (50051 + 65021) and serve their own stores; suite 14/14
@blocksorg

blocksorg Bot commented Nov 19, 2026

Copy link
Copy Markdown

Mention Blocks like a regular teammate with your question or request:

@blocks review this pull request
@blocks make the following changes ...
@blocks create an issue from what was mentioned in the following comment ...
@blocks explain the following code ...
@blocks are there any security or performance concerns?

Run @blocks /help for more information.

Workspace settings | Disable this message

@magalz

magalz commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@blocks review this pull request

@blocksorg

blocksorg Bot commented Nov 19, 2026

Copy link
Copy Markdown

Unable to fulfill this request because your GitHub account is not associated with this workspace.

Link your account in workspace settings

@Alex793x Alex793x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @magalz looks good to me !

@Alex793x
Alex793x merged commit b6da0ad into syncable-dev:main Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants