[PR #2461] [MERGED] fix(setup): resolve DeepSeek Harness home overrides #5244

Closed
opened 2026-10-31 01:05:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2461
Author: @saya-ch
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/dsh-home-path-resolution


📝 Commits (1)

  • c266ad2 fix(setup): resolve DeepSeek Harness home overrides

📊 Changes

4 files changed (+190 additions, -11 deletions)

View changed files

📝 docs/client-configuration.md (+9 -2)
📝 src/application/SupportedClients.ts (+21 -2)
📝 tests/acceptance/setup/dshClientSetup.test.ts (+106 -1)
📝 tests/boundary/filesystem/dshClientConfiguration.test.ts (+54 -6)

📄 Description

Summary

DeepSeek Harness users who set DSH_HOME="" or DSH_HOME="~/selected harness" can have REA register its MCP server in a directory Harness never reads. The same mismatch affects skill installation through DSH_AGENTS_HOME.

Resolve both roots using Harness's home-paths semantics so setup, doctor and uninstall agree with the client. Related to the integration in #1929. No separate issue is linked: this was reproduced while checking that integration, and searches for open DSH_HOME / DSH_AGENTS_HOME reports and PRs found no matching path fix.

Problem and expected behavior

REA used the environment values directly with ?? and join. An empty override selected cordis.patch.yml or skills under the working directory; whitespace selected a literal whitespace directory; ~/... remained a literal tilde directory. Harness ignores blank overrides, expands the current user's tilde prefix, and resolves relative roots against cwd.

The source contract is Harness's root resolver. trim() determines whether a value is blank; nonblank values retain their original spaces. Both ~/ and ~\ expand, while ~someone stays a literal relative directory. The shared agents root is independent of the Harness home.

Change and scope

  • Give the two DSH roots one resolver in SupportedClients.ts; config paths, detection markers and skill destinations consume its absolute result.
  • Add a boundary input matrix and three public CLI journeys with separate temporary HOME/cwd directories: blank defaults, independent tilde roots and independent relative roots.
  • Document the root selection and same-cwd requirement for relative overrides.

This is an ordinary correction to the existing client configuration integration. The contribution-scope maintainer decision for new providers or target-execution capabilities is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: DSH root resolution in SupportedClients.ts, before filesystem inspection or setup planning.
  • CLI and MCP/tool-catalog contract: existing commands and flags; corrected absolute configuration/skill destinations in setup plans.
  • Provider, bridge, target-format, or platform compatibility: matches the client-owned path contract on the host's native Node path implementation. Other client resolvers are untouched.
  • Evidence, artifact, provenance, or reconstruction contract: no analysis contract changes.
  • Authority and cleanup: existing approval, backup, atomic replacement and uninstall ownership behavior apply at the correctly resolved locations. No model request or target execution capability is added.
  • Generated metadata, package and installation impact: no package/version/lockfile changes; generated outputs remain ignored. DSH registration and skill paths now follow the selected roots.

Expected effects of the existing configuration workflow touched here:

  • Read existing client configuration.
  • Change client configuration and installed skill files after existing setup approval.

This change does not add target attachment, instrumentation, protection recovery or network access.

Evidence and regression coverage

  • Before the production fix, the focused DSH filesystem suite reported 8 failed / 79 passed: blank, tilde and absolute-path projection regressions failed.
  • After the fix, the DSH filesystem and CLI setup suites report 96 passed.
  • CLI journeys inspect the exact dry-run destinations, confirm no dry-run mutation, apply setup, preserve the caller patch and first backup, check doctor --client dsh --skill, repeat setup without changes, then uninstall from the same roots while retaining the caller entry.
  • Existing DSH CLI/MCP launcher verification remains in the same acceptance suite. These checks do not establish a real Harness chat session, live DeepSeek API or native analysis-provider behavior.

Validation performed

Windows x64, pinned Node 24.18.0 and npm 11.16.0:

  • npm ci — passed.
  • npm run test:focused -- tests/boundary/filesystem/dshClientConfiguration.test.ts tests/acceptance/setup/dshClientSetup.test.ts — 96 passed.
  • npm run check — passed: typecheck, lint, formatting, dependency/metadata checks, module boundaries, knip and architecture guards.
  • npm run docs:check — passed, including 2 README consistency cases.
  • npm run verify:test-discovery — passed; 1,008 files discovered exactly once.
  • npm run jscpd — passed at 2.98%, below the unchanged 3.0% threshold.
  • npm pack --dry-run --json — passed; 1,511 package entries.
  • git diff --check — passed.
  • npm run verify:package — not completed on Windows. Its unchanged repository-skill verifier calls execFile("npm", ...) and fails with spawn npm ENOENT before package verification starts. The runtime build and package dry-run above passed; they do not replace the full package verifier.

Compatibility, safety, and release

  • Breaking changes or migration: no API change. Blank/tilde overrides now point at the same directories Harness uses; a registration previously written to a literal wrong directory is not migrated or removed automatically.
  • Real OS coverage: Windows x64 public REA CLI and SDK MCP transport. POSIX behavior is covered by host-neutral source cases for CI; a local POSIX run was not performed.
  • Real Harness, live DeepSeek API and Hopper/Ghidra coverage: not run for this path-only change.
  • Publication: this PR adds no release or publication action.

Before merge

  • This PR addresses a concrete configuration problem.
  • Scope and authority remain within the existing client integration.
  • The title follows fix(setup): ... and the diff has one focused outcome.
  • Related integration is linked and the absence of a separate issue is explained.
  • Tests cover observable behavior, preserved caller data and repeated setup/uninstall.
  • Owning documentation is updated.
  • CLI behavior and verification limits are recorded.
  • The final diff was checked for secrets, generated outputs, unrelated changes and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2461 **Author:** [@saya-ch](https://github.com/saya-ch) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/dsh-home-path-resolution` --- ### 📝 Commits (1) - [`c266ad2`](https://github.com/morluto/rea/commit/c266ad2340ec09e4dc3fb212a6b5495229e8a028) fix(setup): resolve DeepSeek Harness home overrides ### 📊 Changes **4 files changed** (+190 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/client-configuration.md` (+9 -2) 📝 `src/application/SupportedClients.ts` (+21 -2) 📝 `tests/acceptance/setup/dshClientSetup.test.ts` (+106 -1) 📝 `tests/boundary/filesystem/dshClientConfiguration.test.ts` (+54 -6) </details> ### 📄 Description ## Summary DeepSeek Harness users who set `DSH_HOME=""` or `DSH_HOME="~/selected harness"` can have REA register its MCP server in a directory Harness never reads. The same mismatch affects skill installation through `DSH_AGENTS_HOME`. Resolve both roots using Harness's home-paths semantics so setup, doctor and uninstall agree with the client. Related to the integration in #1929. No separate issue is linked: this was reproduced while checking that integration, and searches for open `DSH_HOME` / `DSH_AGENTS_HOME` reports and PRs found no matching path fix. ## Problem and expected behavior REA used the environment values directly with `??` and `join`. An empty override selected `cordis.patch.yml` or `skills` under the working directory; whitespace selected a literal whitespace directory; `~/...` remained a literal tilde directory. Harness ignores blank overrides, expands the current user's tilde prefix, and resolves relative roots against cwd. The source contract is [Harness's root resolver](https://github.com/deepseek-ai/deepseek-harness/blob/d743267388641bc76f17c45ce8b4c231aed1d32c/packages/util/home-paths/src/index.ts#L101). `trim()` determines whether a value is blank; nonblank values retain their original spaces. Both `~/` and `~\` expand, while `~someone` stays a literal relative directory. The shared agents root is independent of the Harness home. ## Change and scope - Give the two DSH roots one resolver in `SupportedClients.ts`; config paths, detection markers and skill destinations consume its absolute result. - Add a boundary input matrix and three public CLI journeys with separate temporary HOME/cwd directories: blank defaults, independent tilde roots and independent relative roots. - Document the root selection and same-cwd requirement for relative overrides. This is an ordinary correction to the existing client configuration integration. The contribution-scope maintainer decision for new providers or target-execution capabilities is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: DSH root resolution in `SupportedClients.ts`, before filesystem inspection or setup planning. - CLI and MCP/tool-catalog contract: existing commands and flags; corrected absolute configuration/skill destinations in setup plans. - Provider, bridge, target-format, or platform compatibility: matches the client-owned path contract on the host's native Node path implementation. Other client resolvers are untouched. - Evidence, artifact, provenance, or reconstruction contract: no analysis contract changes. - Authority and cleanup: existing approval, backup, atomic replacement and uninstall ownership behavior apply at the correctly resolved locations. No model request or target execution capability is added. - Generated metadata, package and installation impact: no package/version/lockfile changes; generated outputs remain ignored. DSH registration and skill paths now follow the selected roots. Expected effects of the existing configuration workflow touched here: - [x] Read existing client configuration. - [x] Change client configuration and installed skill files after existing setup approval. This change does not add target attachment, instrumentation, protection recovery or network access. ## Evidence and regression coverage - Before the production fix, the focused DSH filesystem suite reported **8 failed / 79 passed**: blank, tilde and absolute-path projection regressions failed. - After the fix, the DSH filesystem and CLI setup suites report **96 passed**. - CLI journeys inspect the exact dry-run destinations, confirm no dry-run mutation, apply setup, preserve the caller patch and first backup, check `doctor --client dsh --skill`, repeat setup without changes, then uninstall from the same roots while retaining the caller entry. - Existing DSH CLI/MCP launcher verification remains in the same acceptance suite. These checks do not establish a real Harness chat session, live DeepSeek API or native analysis-provider behavior. ## Validation performed Windows x64, pinned Node **24.18.0** and npm **11.16.0**: - `npm ci` — passed. - `npm run test:focused -- tests/boundary/filesystem/dshClientConfiguration.test.ts tests/acceptance/setup/dshClientSetup.test.ts` — **96 passed**. - `npm run check` — passed: typecheck, lint, formatting, dependency/metadata checks, module boundaries, knip and architecture guards. - `npm run docs:check` — passed, including 2 README consistency cases. - `npm run verify:test-discovery` — passed; 1,008 files discovered exactly once. - `npm run jscpd` — passed at 2.98%, below the unchanged 3.0% threshold. - `npm pack --dry-run --json` — passed; 1,511 package entries. - `git diff --check` — passed. - `npm run verify:package` — **not completed** on Windows. Its unchanged repository-skill verifier calls `execFile("npm", ...)` and fails with `spawn npm ENOENT` before package verification starts. The runtime build and package dry-run above passed; they do not replace the full package verifier. ## Compatibility, safety, and release - Breaking changes or migration: no API change. Blank/tilde overrides now point at the same directories Harness uses; a registration previously written to a literal wrong directory is not migrated or removed automatically. - Real OS coverage: Windows x64 public REA CLI and SDK MCP transport. POSIX behavior is covered by host-neutral source cases for CI; a local POSIX run was not performed. - Real Harness, live DeepSeek API and Hopper/Ghidra coverage: not run for this path-only change. - Publication: this PR adds no release or publication action. ## Before merge - [x] This PR addresses a concrete configuration problem. - [x] Scope and authority remain within the existing client integration. - [x] The title follows `fix(setup): ...` and the diff has one focused outcome. - [x] Related integration is linked and the absence of a separate issue is explained. - [x] Tests cover observable behavior, preserved caller data and repeated setup/uninstall. - [x] Owning documentation is updated. - [x] CLI behavior and verification limits are recorded. - [x] The final diff was checked for secrets, generated outputs, unrelated changes and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5244
No description provided.