Introduction¶
In the DeepSeek Harness (dsh) ecosystem, plugins are the standard way to extend capabilities. Most existing code review tools remain at the stage of “observing diffs” and “adding comments”; they cannot block merge operations. review-gate bridges this gap by turning code review into a hard gate: code can be merged only after automatic rule evaluation, team approval quotas are met, and a compliance audit log is generated.
Plugin Positioning¶
This is a DeepSeek Harness (dsh) plugin package whose core value is to make code review process-oriented, standardized, and mandatory.
- Positioning: Hard code review gate plugin.
- Maintainer: JohnXu22786.
- Category: admin-security.
- License: MIT.
- Core Value: Deterministic severity rules, LLM-assisted findings, team approval quotas, compliance audit tracking.
Core Features¶
- Review Session: Supports reviewing the working tree, staged changes, a single commit, or any
base..headrange. Findings are classified assevere(critical),warning(warning), andsuggestion(suggestion). Classification is based on deterministic static rules (regex matching on newly added code, with no reliance on models) and optional LLM assistance (which only adds findings and never bypasses rule thresholds). - Gate Rules: Configurable pass thresholds (for example,
severe = 0,warning ≤ N). The decision logic is calculated entirely by deterministic rules, ensuring reproducible results. - Team Approval Process: Supports
approve(approve),request_changes(request changes), andreject(reject) votes. Approval quotas are configurable; the last writer wins, and re-reviewing refreshes the state. - Compliance Audit Tracking: All runs, votes, acknowledgments, and export operations are appended to an immutable audit log, recording the timestamp, operator, decision, and rule version.
- CI Integration: All tools and CLI commands output JSON and return the correct exit code (
gate-checkreturns a non-zero code when the code cannot be merged), so they can be integrated directly into GitHub Actions or hooks. - Lesson Library: Failed findings can be converted into reusable static rules.
- Toolchain: Provides dsh tools (such as
review_run) and a standalone CLI.
Installation and Setup¶
Environment Requirements¶
- Standalone CLI: Node.js >= 18.
- DSH Bundle Mode: DeepSeek Harness requires
^22.19.0 || >=24.0.0. - System Requirements: Git must be available in the system PATH, and the target directory must be a Git working tree.
Install the Standalone CLI¶
Install globally to use it in any Git repository:
npm install -g review-gate
Install as a DSH Bundle¶
Installing as a DSH plugin package requires adding the plugin and applying the patch configuration.
dsh plugin --profile <name> add ./review-gate
dsh --profile <name> --patch ./review-gate/cordis.patch.yml
Typical Usage¶
CLI Commands¶
Run in a Git repository directory:
# 审查工作区变更
review-gate run --json
# 查看审查状态
review-gate status --json
# 检查合并资格(只有在合并条件满足时退出码为 0)
review-gate gate-check --mode merge
Configuration File¶
Create .review-gate.config.json in the repository root or write it in the DSH profile configuration:
{
"cwd": "/absolute/path/to/repo",
"store": {
"root": ".review-gate",
"repoId": "github.com/acme/repo"
},
"gate": {
"severe": 0,
"warning": 0,
"suggestion": -1,
"requiredAcknowledge": []
},
"approvals": {
"required": 2
},
"llm": {
"enabled": false
},
"rules": {}
}
Initialize the configuration file:
review-gate init
Applicable Scenarios and Notes¶
Applicable Scenarios: Teams that need to enforce code review standards, require review outcomes to block merge operations, or need to retain complete compliance audit records.
Notes:
* The plugin runs with the permissions of the current DSH process; verify the source code and license (MIT) before installation.
* It depends on Git command-line tools for diff parsing and session locking.
Summary¶
review-gate turns code review from “optional discussion” into a “mandatory gate,” using deterministic rules and team voting mechanisms to ensure code quality. Combined with its immutable audit log, it is suitable for teams with high compliance requirements.