Introduction

DeepSeek Harness (DSH) agents typically execute git commands through the bash tool. This approach has two main problems: first, the model may blindly commit changes without inspecting them; second, parsing command output (such as Chinese paths and Windows line endings) is unreliable. dsh-git-seam aims to solve these two problems by providing deterministic porcelain parsing and enforcing a “diff-before-commit” review policy.

Plugin Positioning

This is a client-side plugin (category: client), maintained by qt-11564. It provides DSH agents with six structured git tools, plus a policy layer that enforces review before allowing commits.

Installation and Enablement

Install it with the official command:

dsh plugin --profile web add github:qt-11564/dsh-git-seam

After installation, restart the profile. Verify the installation:

dsh --profile web --dump-config

In the conversation, the six git_* tools will automatically appear.

Configuration

Add the following content to the configuration file:

- id: git-seam
  name: dsh-git-seam
  config:
    maxBytes: 32768              # 输出字节预算,超限会截断并提示
    requireDiffBeforeCommit: true # 开启 diff-before-commit 门禁
    requireCommitApproval: true   # 将 git_commit 路由至审批服务
    timeoutMs: 30000              # 单命令超时时间

Core Features

The plugin provides the following six tools:

Tool Input Output
git_status cwd? Branch information, ahead/behind status, staged/unstaged/untracked file lists, clean flag
git_diff spec? (worktree/–staged/A..B), path? File statistics (+N/-M) + concatenated diff
git_log range?, path? Commit records: hash, author, date, subject
git_show ref (required), path? Commit metadata + statistics + concatenated diff
git_branch cwd? Current branch + all local branches
git_commit message (required), paths? New hash + summary (subject to gating and approval)

Diff-Before-Commit Gate Mechanism

git_commit checks in the tools/pre-execute phase:
1. The previous step must be a successful git_diff in the same session (earlier diffs do not count, and failed diffs do not count).
2. Files involved in the commit must be included in the diff’s coverage set (pathless commits check the staging area; path-specified commits check the specified paths).
3. Untracked files are exempt (because diff cannot display them).
4. After a successful commit, the next commit requires a fresh diff.

On rejection, the violating files are explicitly identified, and the model is prompted to rerun git_diff.

Applicable Scenarios and Limitations

Applicable scenarios: scenarios where an agent needs to manage local Git repositories safely, and changes must be mandatorily reviewed before committing.

Known limitations:
- Destructive history operations are not supported (reset, checkout, revert, merge, rebase).
- stash, remote operations (push/pull/fetch), or submodules are not supported.
- blame, GPG signing, or LFS are not supported.
- Remote providers (GitHub/GitLab REST) are not yet supported; local git only.
- The gate validates file coverage only, not content freshness (editing and then committing after a diff still passes).
- Commits can still be bypassed via bash commands; the gate protects the tool path rather than the sandbox.

Conclusion

This plugin reduces the risk of agent-driven Git operations by using deterministic parsing and a mandatory commit gate. It is suitable for DSH workflows with strict requirements for commit review.