DSH / Atlas
2026-07-24implementedarchitecture

One harness home resolver

单一 harness home 解析器

The harness had two inconsistent conventions for "where does DeepSeek Harness user data live": - `@deepseek-ai/dsh-home` resolved `configured ?? $DSH_HOME ?? ~/.dsh`. - `@deepseek-ai/dsh-home-paths` shipped a **second** `resolveDshHome` with the same precedence plus tilde expansion — a near-duplicate of `dsh-home` that no gate flagged because the two lived in different packages and had already drifted (only one expan

English

Problem

The harness had two inconsistent conventions for "where does DeepSeek Harness user data live":

  • @deepseek-ai/dsh-home resolved configured ?? $DSH_HOME ?? ~/.dsh.
  • @deepseek-ai/dsh-home-paths shipped a second resolveDshHome with the same precedence plus tilde expansion — a near-duplicate of dsh-home that no gate flagged because the two lived in different packages and had already drifted (only one expanded tildes).

Two resolvers for the same cross-cutting fact meant there was no single home policy.

Decision

One resolver owns the harness home, in @deepseek-ai/dsh-home-paths, single-root:

explicit configured path  >  $DSH_HOME  >  ~/.dsh

An empty or whitespace-only $DSH_HOME is treated as unset; otherwise resolve('') would silently place the home at the current working directory. The harness keeps all user data under one root; there is no XDG config/data/cache split. dshHomePath(...segments) joins deployment-owned children onto that root, and dsh-app-boot exposes it to Loader !!js config expressions before mounting entries, so shipped compositions derive sessions and storages without copying the resolver. dshHomeDisplay() names a resolved root symbolically for user-facing paths — ~/.dsh for the default home, $DSH_HOME for any configured home — so the user-global AGENTS.md label never leaks an absolute machine path. It replaces agent-instructions's bespoke default-vs-$DSH_HOME check.

@deepseek-ai/dsh-home is deleted. Its three importers (dsh-tool-bash, dsh-skill-filesystem, dsh-agent-spine-demo) import resolveDshHome from dsh-home-paths.

dsh-telemetry and its separate home policy are absent under the SDK project toolchain removal, leaving this resolver as the sole home policy.

Alternatives considered

Leave the two resolveDshHome copies in place. They had already drifted (one expands tildes, one didn't) and encode the same cross-cutting fact twice. Consolidation is the point of the util/ layer; a duplicate resolver is a latent divergence bug.

Adopt XDG (honor $XDG_CONFIG_HOME, or split config/data/cache into separate trees). Considered and dropped in favor of one obvious root. A single $DSH_HOME || ~/.dsh ground truth matches ~/.claude / ~/.aws, needs no per-kind reclassification of every ~/.dsh consumer, and leaves no resolver asymmetry to reconcile.

Consequences

  • One home fact, one resolver. dsh-home-paths is the sole owner; the util/ group loses the home package.

中文

问题

对于"DeepSeek Harness 用户数据存放在哪里",harness 里存在两套互不一致的约定:

  • @deepseek-ai/dsh-homeconfigured ?? $DSH_HOME ?? ~/.dsh 解析。
  • @deepseek-ai/dsh-home-paths 又提供了第二个 resolveDshHome,优先级相同但额外做了波浪号展开——它几乎是 dsh-home 的重复实现,却没有任何门禁发现,因为两者分属不同的包,而且早已漂移(只有一个会展开波浪号)。

同一条横切事实有两个解析器,意味着不存在单一的 home 策略。

决策

由一个解析器统一掌管 harness home,落在 @deepseek-ai/dsh-home-paths,采用单一根目录:

explicit configured path  >  $DSH_HOME  >  ~/.dsh

空或仅含空白的 $DSH_HOME 被当作未设置处理;否则,resolve('') 会悄悄把 home 落在当前工作目录。harness 把所有用户数据都放在同一个根目录下;不存在 XDG 的 config/data/cache 拆分。dshHomePath(...segments) 将部署负责的子路径拼接到该根目录下,dsh-app-boot 在挂载条目前向 Loader !!js 配置表达式暴露它,因此出厂组合无需复制解析器即可派生 sessionsstoragesdshHomeDisplay() 为面向用户的路径以符号形式命名已解析的根目录——默认 home 显示为 ~/.dsh,任何已配置的 home 显示为 $DSH_HOME——这样用户全局的 AGENTS.md 标签就绝不会泄露机器上的绝对路径。它取代了 agent-instructions 中自定义的「默认值 vs $DSH_HOME」判断。

@deepseek-ai/dsh-home 被删除。它的三个引用方(dsh-tool-bashdsh-skill-filesystemdsh-agent-spine-demo)从 dsh-home-paths 导入 resolveDshHome

dsh-telemetry 及其独立 home 策略已随 SDK 项目工具链移除一并消失,因此该解析器是唯一的 home 策略。

备选方案

保留两份 resolveDshHome 副本。 它们早已漂移(一个展开波浪号,一个不展开),并把同一条横切事实编码了两遍。util/ 层的意义正是在于合并,重复的解析器是一个潜在的分歧 bug。

采用 XDG(遵从 $XDG_CONFIG_HOME,或把 config/data/cache 拆分到各自的目录树)。 经过考虑后放弃,转而采用一个显而易见的根目录。单一的 $DSH_HOME || ~/.dsh 基准事实与 ~/.claude / ~/.aws 一致,无需对每个 ~/.dsh 消费方按类别重新归类,也不留下任何需要协调的解析器不对称。

影响

  • 单一 home 事实,单一解析器。dsh-home-paths 是唯一归属方;util/ 组失去了 home 包。