@hy-sde-org/dsh-git
Host-plane ctx.git service for the DeepSeek Harness: a thin wrapper around
the git CLI through the ctx.subprocess seam, configured pooled-worktree
operations, and the diff-parsing and split-commit primitives the model-facing
tools need. Consumed by @hy-sde-org/dsh-tool-git; never called by the model
directly.
GitService — run / status / diffText / diffStat /
stagedFiles / resetIndex / stageHunks / commit / log /
currentBranch / isWorktree, plus push with remote/branch/upstream
options and root for the review gate.
parseFileDiffs / parseNumstat / computeDependencyOrder /
LOCK_FILES — pure diff + topo-sort + lock-file primitives.
vcs — TS contract port of omp's native pi-vcs surface (error taxonomy,
repo discovery, newline-safe joinPatches, HEAD stat-poll watch).
withRepoLock — in-process per-repository mutation queue (repo-lock).
ctx.git.worktrees — configured acquire / acquireOwned / release /
list / verify / sweep / prune / destroy operations over one
durable-lease pool. acquireOwned atomically adopts a stable owner across
restarts while preserving the pool's random lease id. New slots use
copy-on-write filesystem clones by default when APFS clonefile or Linux
reflink support is available; worktreeCoWShare can warm gitignored
directories into the shared template.
conventional — llm-git canonical commit-type vocabulary plus commit
message normalization / validation (scopes, summaries, bodies, pep-595
length rules).
apply(ctx, config) registers ctx.git (subprocess seam required).
Port of omp (oh-my-pi)'s git layer — see LICENSE. One host instance serves
every Session; pooled-worktree state remains on disk under the configured root,
while each calling agent's Session cwd selects the repository.
Worktree configuration
Configure the host Git row once under config.worktrees. The model-facing tool
has no pool settings, so tools and orchestration always use the same root,
branch, fetch, lock, capacity, sweep, and CoW policy:
- name: '@hy-sde-org/dsh-git'
config:
worktrees:
root: ~/.treehouse
baseBranch: main
maxSlots: 8
autoPrune: true
Install & mount
See the repo README.md — as a plugin:
dsh plugin --profile web add @hy-sde-org/dsh-git
The bundle cordis.patch.yml inserts the git row into the profile's base
composition (stock INSERT patch form, safe on official releases). The tools
mount from any user preset that copies examples/agent-preset/.
Development
pnpm install
pnpm run check # tsc --noEmit
pnpm run build # tsc -p tsconfig.build.json → dist/
pnpm run test # vitest: conventional/repo-lock/vcs/worktree/service/unit on real temp repos