Skip to content
MyDSHMy DSH Field Notes
中文
Independently maintained; not affiliated with DeepSeek. No association with mydsh.dev or other MyDSH sites.

Home/Models, permissions & security/Workspace isolation & backup

Recovering an overwritten config: run the drill once

After an upgrade, a version swap, or a careless edit to cordis.patch.yml, behaviour changed and you cannot say what was lost.

VerifiedVersion and environmentChecked 2026-11-14
Host version
0.1.2-alpha.5
Target
~/.dsh/profiles
Checked
2026-11-14

Copyable command

cd ~/.dsh && tar -czf ~/dsh-profiles-$(date +%Y%m%d).tgz profiles

Recovery has exactly two states: with a backup, ten minutes; without one, reconfigure from scratch. The drill exists to confirm which state you are in before it matters.

Back up now (one minute)

cd ~/.dsh && tar -czf ~/dsh-profiles-$(date +%Y%m%d).tgz profiles
ls -lh ~/dsh-profiles-*.tgz

profiles is around 1 MB. There is no excuse.

Drill: break it on purpose, then restore

  1. Confirm it works now: dsh --profile web --dump-config | head
  2. Add a line of invalid content to ~/.dsh/profiles/web/cordis.patch.yml and confirm startup fails. This teaches you what broken looks like.
  3. Extract the backup over the directory.
  4. Run dump again and confirm recovery.
cd ~/.dsh && tar -xzf ~/dsh-profiles-20261114.tgz && dsh --profile web --dump-config | head

Careful: cordis.yml is not the file to edit

The header in the local cordis.yml says it plainly:

# dsh profile root — an empty entry list. The tree is composed as patches:
# each bundle in package.json's dsh.profile.bundles, then cordis.patch.yml, then any
# --patch overlays. Edit cordis.patch.yml, not this file.
[]

Composition order: bundles from package.json, then cordis.patch.yml, then command-line --patch. Edits to cordis.yml are effectively discarded by later layers while you believe they applied.

This is the easiest trap in a recovery drill: you think you changed the config, but that copy is rewritten or overridden on every boot. After recovering, confirm you are editing the patch layer.

If there is no backup

  • dsh --dump-default-config prints the default tree without the user layer; diff against it to find your extra edits.
  • Rebuild a profile by copying one that still works, then re-add changes from memory.
  • The bundles list lives in package.json — the easiest item to forget when rebuilding.

What counts as working

Check every line. All of them pass or the job is not done.

  • The archive exists and extracts
  • The deliberate break did cause a startup failure
  • dump-config runs after restore
  • You know to edit cordis.patch.yml, not cordis.yml

Where it fails

Symptom, cause, what to do — written in the order it actually happens.

SymptomCauseWhat to do
Edited cordis.yml and nothing changedOverridden by bundles and the patch layer; the header says not to edit itEdit cordis.patch.yml
Still failing after restoreThe backup itself was taken while brokenDiff against --dump-default-config to find the bad entry, or copy a working profile

Sources

Verified means measured here. Compiled means every line carries a source.