dsh-promote-deployment
Skill1 starsChanged 3 months agoMITView on GitHub
Use when promoting the running DSH deployment to a new release, building or switching a release mirror, restarting the supervisor that serves it, or diagnosing a deployment that reports a new version while serving old behavior. Covers the mirror build, the profile guard's acceptance step, and the runtime package versions that prove a promotion actually happened.
- Sends data out
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/notes/AGENTS.mdAGENTS.md
- .agents/notes/archived/AGENTS.mdAGENTS.md
- .agents/notes/implemented/AGENTS.mdAGENTS.md
- benchmarks/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- packages/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- snapshots/AGENTS.mdAGENTS.md
- vendor/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- .agents/notes/implemented/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- packages/CLAUDE.mdCLAUDE.md
- vendor/CLAUDE.mdCLAUDE.md
- dsh-archive-agent-notesSkill
- dsh-ci-test-reliabilitySkill
- dsh-code-reviewSkill
- dsh-docSkill
- dsh-find-simplificationsSkill
- dsh-merging-stacked-prsSkill
- dsh-plugin-ownership-and-distributionSkill
- dsh-pre-push-checksSkill
- dsh-prose-standardSkill
- dsh-speed-up-perfSkill
- dsh-translate-docsSkill
- dsh-trim-cot-leakageSkill
- record-browser-gifSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Run it before dsh-plus-mirror create.
- Very specific: line 71
Build the mirror: Check out the new official revision in a release mirror, keep the previous mirror as the rollback anchor, apply this …
- Very specific: line 93
Every one must name the new official revision.
- Distinctive: line 103
Run the checks in the order the interlock runs them, because each answers a question the next cannot:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DSH Deployment Promotion
Use this skill to move a running deployment onto a new release. The deployment is not the repository checkout: it is a release mirror under the DSH home, with its own sources, build outputs, and profile. Changing a version in the profile does not change what the runtime executes.
Find the tools before writing any step
The deployment already owns this procedure. Read these before running anything, and call them rather than re-deriving their contents:
| Command | Owns |
dsh-plus-build <mirror> | pnpm install twice (a patch that adds a dependency changes the graph, and only a second install links it), then pnpm run build --profile official, then verify the brand record and that no workspace with dependencies lacks node_modules. |
dsh-plus-switch | Move the served release to another mirror, tracking phases. |
dsh-plus-refresh rebuild | accept | restart | all | Rebuild the mirror, record the profile as accepted, restart, or all three in that order. |
dsh-plus-mirror create --tag <official-tag> --mirror <path> --runtime <version> | Extract an official tag into a fresh mirror, apply this repository's reviewed patches, typecheck them, regenerate the standalone manifests, build, create the profile, write the compatibility exemptions, relink the scope, and repair shadowed packages. dsh-plus-mirror check --mirror <path> reports the scope verdict. |
dsh-plus-exemptions --runtime <version> [--out <path>] | Derive the profile's compatibility.json: every plugin whose published peer ranges cannot match the runtime. |
repair-shadowed-scope.mjs --release <mirror> | Replace real directories that shadow a release package with links to its source. |
dsh-3080-restart | Restart through the supervisor: repair profile scope, prove module uniqueness, re-accept the fingerprint, restart, then verify the client modules and the connection surface. |
relink-release.mjs --release <mirror> | Restore the @deepseek-ai scope links a pnpm install inside the mirror rewrote. |
check-profile-scope.mjs --release <mirror> | Report duplicate @deepseek-ai packages and unresolvable dependencies; both break every tool call while HTTP stays 200. |
Writing a second, partial copy of any of these is the mistake this skill exists to prevent. A hand-written promotion that edits only the profile's distribution version reports success, passes an HTTP check, and serves the previous release: the runtime packages resolve from the mirror's sources, which the promotion never touched.
The step a promotion cannot skip
Plus does not install the official packages directly. Its profile's overrides redirect 27 of them to this repository's republished builds:
"@deepseek-ai/dsh-api-gateway": npm:@sparkelf/dsh-api-gateway@0.1.7-rc.2Those republished packages carry the patches, and they are the runtime. A profile whose overrides still name the previous revision installs the previous runtime beside a mirror built from the new source, and the result passes an HTTP check while serving the old release.
So promoting onto a new official revision has a prerequisite the mirror build cannot satisfy:
node scripts/release/republish-patched-official.mjs --source <mirror> --version <official-version>This packages each patched official workspace, verifies the packaged output against the workspace it came from, and publishes. It is one command because those steps must not be separated — every reported defect came from a package that packaged cleanly and was verified against a list its author had written rather than against its source.
Run it before dsh-plus-mirror create. Without it the promotion has no runtime to point at, and dsh-plugin-backup-style peer mismatches are the least of the symptoms.
Driving the Windows desktop from a WSL deployment
computer-use has no desktop of its own: the provider spawns an installed driver over stdio, and the driver owns the connection to the desktop. A deployment running under WSL drives the Windows desktop because WSL interop can execute a Windows executable directly, so the provider's command is the /mnt/<drive>/... path of cua-driver.exe — the C:\ form is not an executable that process can spawn. The Windows daemon reaches the interactive session through a named pipe, so it must already be running there.
/root/.dsh/dsh-plus-cua --profile <profile dir>The tool discovers the executable under /mnt/c/Users/*/AppData/Local/Programs/Cua, proves it answers an MCP initialize, and writes the command into the profile's computer-use-cua-driver-mcp row. --check reports without writing. A layer that carries the row with no command activates the provider and then fails discovery, which reads as a plugin defect rather than a missing path.
The provider exposes the driver's own tools, including list_windows, click, type_text, and verify_state. The driver's agent-cursor overlay is part of it: a window named Cua.AgentCursorOverlay.default in list_windows means the virtual cursor is live.
Where a hand-written row belongs
The profile has one user layer, <profile>/cordis.patch.yml, and a capability change rewrites it. The rewrite keeps rows it does not own, but the file is still the layer that changes: a deployment's own configuration belongs in $DSH_HOME/cordis.patch.yml instead, which the loader applies last and nothing rewrites.
# $DSH_HOME/cordis.patch.yml
- id: llm-pi-ai
name: "@deepseek-ai/dsh-llm-pi-ai"
config:
providers: ...Measured 2026-09-29: a hand-written model provider, permission presets, theme, and welcome-notice version lived in the profile layer; one capability change from the GUI emptied the 9.6 kB file to 318 bytes. Restoring them into the home layer is what made the configuration survive the next capability change.
One command
dsh-plus-mirror create performs the whole sequence below. Each of its steps was added after a promotion failed on it: a hunk that applied but stopped compiling, a standalone manifest whose peer overrides no longer matched, a profile install the compatibility gate rejected, and a scope the check reported DEFECTIVE because real directories shadowed it. The step-by-step sections that follow explain what each one does and how to diagnose it; run them by hand only to repair a mirror the command could not finish.
Promotion order
- Build the mirror. Check out the new official revision in a release mirror, keep the previous mirror as the rollback anchor, apply this repository's patches, then run
dsh-plus-build <mirror>. - Point the profile at the matching republished packages. The overrides live in the profile's
pnpm-workspace.yaml. Two version sequences meet here and they are not the same number: the distribution releases as0.2.0-rc.N, while a republished official package carries the official revision it was built from,0.1.7-rc.1. Read the range from the version being promoted, never from the installed one — the installed copy names the base being left. - Write the manifest last, after acceptance. A running supervisor rewrites its manifest on every progress phase —
announce()callswriteStatus(), not onlystop()— so a manifest written before a multi-second acceptance step is the supervisor's own older copy by the time anything reads it. Measured: the manifest named the new mirror, acceptance ran for seconds, and the reload adopted the previous mirror.dsh-plus-switchorders its stepslink → accept → manifest → reload → verifyfor this reason. - Record the profile closure. The supervisor's profile guard refuses to start when the accepted closure changed without a new acceptance.
dsh-plus-refresh acceptdoes this; a bare restart does not, and the guard then rolls the profile back while the unit retries untilStartLimitBursttrips, leaving one bare exit code in the journal. - Restart through the supervisor, not the service manager. The unit runs the supervisor and the web process is its child;
systemctl restartkills both, so the control socket disappears and every connection is refused during the restart. Usedsh-3080-restartordsh-plus-refresh restart. - Verify the runtime, not the distribution version. See below: this is the step whose absence makes a failed promotion look successful.
Verify the runtime package versions
The distribution version is a wrapper. What executes is the mirror's own sources, linked into the profile's @deepseek-ai scope, so a promotion is complete only when those report the new revision:
# The mirror's sources, which the profile links to:
cd <mirror> && git rev-parse --short HEAD
# The versions the runtime actually resolves:
for p in dsh-session dsh-tools dsh-host-webserver; do
node -p "require('<profile>/node_modules/@deepseek-ai/$p/package.json').version"
doneEvery one must name the new official revision. A distribution version of 0.2.0-rc.N beside @deepseek-ai/dsh-tools@0.1.6-alpha.2 is a promotion that changed the wrapper and left the runtime behind, and it will pass an HTTP check and a client-module check while serving the old release.
The mirror also records what it was built from, which is the fastest way to date it:
node -p "require('<mirror>/.dsh-build/client-build-environment.json').environment"Diagnose a restart that will not start
Run the checks in the order the interlock runs them, because each answers a question the next cannot:
check-profile-scope.mjs --release <mirror>— duplicate@deepseek-aipackages (two module instances, two scheduler Symbols, every tool call failing withreading 'prepare') and release packages whose dependencies do not resolve. A previous source sync that moved rather than copied packagenode_modulestrees causes this;repair-profile-scope.mjsreplaces the shadows with links, andrestore-nested-modules.mjsbrings the nested trees back.check-plugin-imports.mjs— every bundle imports.profile-guard.mjs guard --state <accepted-profile.json>— the accepted closure still matches.
preflight-start.mjs runs all three and repairs what it can; it is the unit's ExecStartPre, so a restart issued through the supervisor's runtime command skips it.
A registry mirror lags the registry
An image or mirror that installs from registry.npmmirror.com cannot resolve a release published minutes ago, and the failure names a version that plainly exists — because it does, upstream. Before concluding that packaging is broken, ask both registries:
curl -s https://registry.npmjs.org/<encoded-name> | grep -c '"<version>"'
curl -s https://registry.npmmirror.com/<encoded-name> | grep -c '"<version>"'Served by the mirror: build. Served upstream only: trigger a sync with curl -X PUT https://registry.npmmirror.com/-/package/<encoded-name>/syncs, or point the build at the upstream registry. Served nowhere: the release did not publish, and no retry fixes it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

