Tom DeepSeek Harness Workflow
Core Principle
One source checkout, two planes: edit and run $DSH_SOURCE_CHECKOUT as the source plane while the global installed dsh stays the untouched stable fallback.
When to Use / NOT
- Use when: working on Tom's DeepSeek Harness source checkout, updating from Tom's remote, editing safely, building, running the source web app.
- NOT when: doing normal work with the installed
dsh distribution (that is the installed plane, not source work), or repairing OpenViking (a separate workflow per the Two-plane rule).
Two-plane rule
- Source plane: edit and run
$DSH_SOURCE_CHECKOUT with pnpm dsh web.
- Installed plane: the global
dsh remains the stable installed distribution. Do not replace it with a local build while source work is in progress.
- OpenViking repairs are a separate workflow; do not change its service or Python environment as part of a harness edit unless explicitly requested.
Workflow
- Orient.
DSH_SOURCE_CHECKOUT="${DSH_SOURCE_CHECKOUT:-$HOME/work/harness/deepseek-harness}"
export DSH_SOURCE_CHECKOUT
cd "$DSH_SOURCE_CHECKOUT"
git status --short --branch
git remote -v
Confirm the worktree and remote before touching files. Preserve unrelated changes.
- Update safely.
git fetch origin --prune
git switch -c work/<short-name> # once, if still on master
git rebase origin/master
Fetch never changes the worktree. Commit a WIP save point before rebasing; stash only when a commit is not appropriate.
- Install and build.
pnpm install --frozen-lockfile
pnpm run build
Do not edit generated dist/ artifacts by hand. Rebuild after source changes.
- Run source without disturbing the installed app.
pnpm dsh web --no-open --host 127.0.0.1 --port 43127
The web process is intentionally long-lived; a timeout is not a test failure if the HTTP probe is healthy. Restart it after rebuilding.
- Verify before claiming success.
git diff --check
pnpm exec vitest run --config vitest.e2e.config.ts apps/cli/tests/built-bin.e2e.ts
git status --short --branch
Add focused tests for the changed package when available.
- Integrate. Commit only reviewed files, then rebase again before pushing. Never force-push shared branches. Use the reference workflow for conflict recovery, profile mismatches, and the stable/source update loop.
Red Flags
- Sibling clones or a renamed checkout; source commands run from
${DSH_SOURCE_CHECKOUT%/*} itself (HARD-GATE).
- Replacing the installed
dsh with a local build while source work is in progress (Two-plane rule).
- Hand-editing generated
dist/ artifacts instead of rebuilding (Workflow step 3).
- Rebasing without a WIP save point commit; stashing when a commit is not inappropriate (Workflow step 2).
- Force-pushing shared branches (Workflow step 6).
- Treating the long-lived web process timeout as a test failure while the HTTP probe is healthy (Workflow step 4).
Verification
git diff --check is clean; pnpm exec vitest run --config vitest.e2e.config.ts apps/cli/tests/built-bin.e2e.ts passes; git status --short --branch shows only reviewed changes (Workflow step 5).
- For a running source app: the HTTP probe on port 43127 is healthy (Workflow step 4); verify long-running commands with
curl on the chosen port (references/update-while-editing.md).
- The result-contract report is complete: checkout path, branch and base commit, update action, files changed, build/test evidence, running port, and any uncommitted or unrelated changes.
Result contract
Report: checkout path, branch and base commit, update action, files changed, build/test evidence, running port, and any uncommitted or unrelated changes.
References
references/update-while-editing.md, the update-while-editing loop: fetch-during-edit safety, save-point/stash discipline before rebase, the release/update boundary (no global installs mid-edit), and recovery rules for wrong-repo/dirty-worktree/build-failure/pending-plugin cases.
1---2name: tom-deepseek-harness3description: Use when working on Tom's DeepSeek Harness source checkout: update from Tom's remote, edit safely, build, run the source web app, and keep the installed DSH separate.4---56# Tom DeepSeek Harness Workflow78<HARD-GATE>9Use the checkout selected by `$DSH_SOURCE_CHECKOUT` (default: `$HOME/work/harness/deepseek-harness`). Do not create sibling clones or run source commands from its parent directory. The expected origin is `https://github.com/monotykamary/deepseek-harness.git`.10</HARD-GATE>1112## Core Principle1314One source checkout, two planes: edit and run `$DSH_SOURCE_CHECKOUT` as the source plane while the global installed `dsh` stays the untouched stable fallback.1516## When to Use / NOT1718- **Use when:** working on Tom's DeepSeek Harness source checkout, updating from Tom's remote, editing safely, building, running the source web app.19- **NOT when:** doing normal work with the installed `dsh` distribution (that is the installed plane, not source work), or repairing OpenViking (a separate workflow per the Two-plane rule).2021## Two-plane rule2223- **Source plane:** edit and run `$DSH_SOURCE_CHECKOUT` with `pnpm dsh web`.24- **Installed plane:** the global `dsh` remains the stable installed distribution. Do not replace it with a local build while source work is in progress.25- OpenViking repairs are a separate workflow; do not change its service or Python environment as part of a harness edit unless explicitly requested.2627## Workflow28291. **Orient.**30 ```bash31 DSH_SOURCE_CHECKOUT="${DSH_SOURCE_CHECKOUT:-$HOME/work/harness/deepseek-harness}"32 export DSH_SOURCE_CHECKOUT33 cd "$DSH_SOURCE_CHECKOUT"34 git status --short --branch35 git remote -v36 ```37 Confirm the worktree and remote before touching files. Preserve unrelated changes.38392. **Update safely.**40 ```bash41 git fetch origin --prune42 git switch -c work/<short-name> # once, if still on master43 git rebase origin/master44 ```45 Fetch never changes the worktree. Commit a WIP save point before rebasing; stash only when a commit is not appropriate.46473. **Install and build.**48 ```bash49 pnpm install --frozen-lockfile50 pnpm run build51 ```52 Do not edit generated `dist/` artifacts by hand. Rebuild after source changes.53544. **Run source without disturbing the installed app.**55 ```bash56 pnpm dsh web --no-open --host 127.0.0.1 --port 4312757 ```58 The web process is intentionally long-lived; a timeout is not a test failure if the HTTP probe is healthy. Restart it after rebuilding.59605. **Verify before claiming success.**61 ```bash62 git diff --check63 pnpm exec vitest run --config vitest.e2e.config.ts apps/cli/tests/built-bin.e2e.ts64 git status --short --branch65 ```66 Add focused tests for the changed package when available.67686. **Integrate.** Commit only reviewed files, then rebase again before pushing. Never force-push shared branches. Use the reference workflow for conflict recovery, profile mismatches, and the stable/source update loop.6970## Red Flags7172- Sibling clones or a renamed checkout; source commands run from `${DSH_SOURCE_CHECKOUT%/*}` itself (HARD-GATE).73- Replacing the installed `dsh` with a local build while source work is in progress (Two-plane rule).74- Hand-editing generated `dist/` artifacts instead of rebuilding (Workflow step 3).75- Rebasing without a WIP save point commit; stashing when a commit is not inappropriate (Workflow step 2).76- Force-pushing shared branches (Workflow step 6).77- Treating the long-lived web process timeout as a test failure while the HTTP probe is healthy (Workflow step 4).7879## Verification8081- `git diff --check` is clean; `pnpm exec vitest run --config vitest.e2e.config.ts apps/cli/tests/built-bin.e2e.ts` passes; `git status --short --branch` shows only reviewed changes (Workflow step 5).82- For a running source app: the HTTP probe on port 43127 is healthy (Workflow step 4); verify long-running commands with `curl` on the chosen port (`references/update-while-editing.md`).83- The result-contract report is complete: checkout path, branch and base commit, update action, files changed, build/test evidence, running port, and any uncommitted or unrelated changes.8485## Result contract8687Report: checkout path, branch and base commit, update action, files changed, build/test evidence, running port, and any uncommitted or unrelated changes.8889## References9091- `references/update-while-editing.md`, the update-while-editing loop: fetch-during-edit safety, save-point/stash discipline before rebase, the release/update boundary (no global installs mid-edit), and recovery rules for wrong-repo/dirty-worktree/build-failure/pending-plugin cases.