Repository navigation
DSH: .zshrc and ~/.vim/ recursively deleted from $HOME on macOS
#13139
Replies: 1 comment
|
I audited the shipped 0.2.2-rc.2 source for any routine that touches these two paths. The harness does not delete them:
So the deletion is not coming from a "reset shell config" routine inside the harness. The repeating shape is much more likely a destructive command executed through a shell/terminal tool (or an external process or third-party plugin) whose target resolved into Evidence that would actually pin it, cheapest first:
On guards: the installable plugin from #9173 ( Two honest limits: I could not reproduce this on the Linux host that produced this analysis, and the |
Uh oh!
There was an error while loading. Please reload this page.
Suggested issue title: DSH:
.zshrcand~/.vim/recursively deleted from$HOMEon macOSSummary
While working on macOS, I found that
~/.zshrcand the entire~/.vim/directory (recursively) had disappeared from my home directory, with no action taken by me to remove them. This happened a first time (silently, noticed only when my shell lost its oh-my-zsh config and prompt), and then a second time while working inside thedeepseek-harnessrepo checked out at tagdsh-v0.2.2-rc.1(➜ deepseek-harness git:(dsh-v0.2.2-rc.1)). The second time I had backups, so damage was limited, but the recurrence is what prompted this report — this does not look like a one-off fluke.This looks like the same class of bug already reported for DSH on Windows (recursive deletion of the real user home via a
$home/$HOMEPowerShell variable collision — see Related reports below), but observed here on macOS/zsh, where that specific case-insensitivity mechanism doesn't apply. That suggests the underlying issue may be broader than a PowerShell-only quirk.What was observed
~/.zshrcdid not exist. oh-my-zsh (~/.oh-my-zsh) was still installed and intact, but never got sourced since the file referencing it was gone. No crash, no error shown at the time — it was just silently absent.~/.vim/(the whole directory, not just a file) was gone, including~/.vim/bundle/Vundle.vimand all plugins declared in~/.vimrc.~/.vimrcitself (a plain file directly in$HOME) survived both times — only the directory tree under it was wiped.$HOMEwas untouched:.ssh,.gitconfig,.config,.docker,.kube, all project directories, shell history, etc. all remained intact. This is a selective/scoped deletion, not a blanketrm -rf $HOME.~/.Trash, no third-party backup tool installed.Investigation performed (and what it ruled out)
zshrc→ zero hits. No OS-level record of the deletion.$HOMEdotfiles on this machine.~/.dsh/sessions/*/session-*.v4.jsonl.zstd, decompressed and inspected). Only two sessions exist locally, both created the same day I was investigating this —~/.dsh(the session/log store itself) has a fresh creation timestamp from that day. Both logged sessions contain only read-only commands (ls,grep,cat,sed,findagainst DSH's own repo and~/.dsh) — norm -rf, no destructive call, nothing touching.zshrcor.vim.~/Documents/deepseek-harness/default-workspace/) has been in continuous, undisturbed use since Nov 8 — daily automated scraper output (one JSON/CSV/report set per day, Nov 3 through Nov 11) sitting there untouched. So specifically~/.dsh's session/log store got reset/recreated at some point, while the real workspace content was not touched. I inspected every script living in that workspace (install.sh,install_memoris_preset.sh,patch_global_opencode.py,germany_new_companies.py) — all are benign (config patchers that write timestamped.bakbackups before any change, or a scraper with no filesystem cleanup logic at all). None reference.zshrc,.vim,rm -rf, or any path that could fall back to$HOME.~/.dshstore reset. This does not clear DSH of the issue; it just means I have no further forensic trail to hand you from this machine.So: I cannot show you an exact command the way the Windows reporter could (they had a retained PowerShell stderr log). I also can't be 100% certain of timing. What I can say with confidence: the deletion scope (two specific dotfile paths directly under
$HOME, nothing else) recurred identically on a second occasion, on the same OS, while DSH was in active use on this machine.Related reports
I'm aware of and cross-referencing a related report:
if (Test-Path $home) { Remove-Item $home -Recurse -Force }; New-Item -ItemType Directory $home | Out-Null— attributed to a likely$home/$HOMEPowerShell automatic-variable collision (PowerShell variable names are case-insensitive, so an attempt to repurpose$homeas a scratch/workspace variable can silently collide with the real, read-only$HOME).$home,导致对用户主目录发起递归删除" (DeepSeek 在 DSH 中误用 PowerShell `$home`,导致对用户主目录发起递归删除 #9173), "三次误删 .dsh 目录之后" (三次误删 .dsh 目录之后:插件验收 profile 隔离提案,兼一份事故复盘 #8537), "DSH + deepseek-flash 删除了我的用户目录" (DSH + deepseek-flash 删除了我的用户目录!!! #9468).This macOS case cannot share the exact PowerShell mechanism (bash/zsh variables are case-sensitive, so there's no
$home/$HOMEcollision possible). If these are related, the shared root cause is more likely upstream of the shell — e.g. in how DSH computes/initializes a temporary or "workspace home" path that falls back to the literal user home directory on some failure path, with the specific paths targeted (.zshrc,.vim/) suggesting this might go through a "reset shell config" / "clean profile" style routine rather than a blanketrm -rf $HOME.Environment
deepseek-harnesschecked out at tagdsh-v0.2.2-rc.1Requested follow-up
~/.dsh/sessions/*.jsonl.zstdclient log) covering the actual incident window, since the locally retained session logs here don't go back far enough..zshrc,.vim/) were the only things removed, it would help to search the codebase for any routine that explicitly deletes/recreates these specific paths (shell config reset, dev-environment bootstrap, "clean slate" setup, etc.), rather than treating this purely as a genericrm -rf $HOMEcase.$HOME) is the same even without the PowerShell-specific trigger.I'm happy to provide additional local artifacts (decompressed session logs, timestamps, etc.) if that helps triage.
All reactions