changingwang/dsh-stage-gate
阶段门治理工具:模型可直接调用的 gate_open / gate_check / gate_list / gate_close,为多阶段工作提供内存态、按会话隔离的验收核对与通过/阻塞结论。
已收录
1
Tools
Bundle 已验证
预览
功能介绍
阶段门治理工具:模型可直接调用的 gate_open / gate_check / gate_list / gate_close,为多阶段工作提供内存态、按会话隔离的验收核对与通过/阻塞结论。
适合
- 执行多阶段工作、需要明确验收清单和 PASS/BLOCK 结论的 Agent。
- 希望模型自行创建、核验、列出和关闭阶段门的按会话工作流。
- 需要轻量治理、又不希望向 DSH 会话日志写入自定义事件的团队。
不适合
- 要求 Harness 重启后仍保留阶段门的工作流;全部状态仅存于内存并会重置。
- 非 Web profile,或低于 0.1.0-rc.5 的 DSH 版本。
- 要求审批结果持久化并由外部强制执行、而非由模型调用会话工具的合规流程。
README
dsh-stage-gate
Stage-gate governance tools for DeepSeek Harness.
Model-callable stage gates: create an acceptance checklist, verify it with evidence, and get a clear PASS / BLOCK conclusion — a governance layer for agents that run multi-phase work. State is in-memory, scoped per session.
| English | 中文 |
What it does
Registers four tools on ctx.tools:
| Tool | Purpose |
|---|---|
gate_open(gateId, title, stage?, items) |
Create a stage gate with its full acceptance checklist (status open). |
gate_check(gateId, items) |
Verify the gate: send the ENTIRE item list (whole-value replacement); each item carries met/unmet/n/a and optional evidence. The gate is blocked while any item is unmet, passed when all are met/n/a. |
gate_list() |
List every gate in the session with its lifecycle status. |
gate_close(gateId, reason?) |
Close a gate (closed). A closed gate rejects further gate_check unless allowReopen is set. |
Lifecycle
open → in_review → passed (all items met/n/a)
│ │
│ └── blocked (any item unmet) → (allowReopen) → open
└────────────────────────────→ closed (gate_close)
-
statuson the gate is the lifecycle state machine. -
conclusionon the latestgate/checkrecords the most recent verification result.
Install
dsh plugin --profile web add dsh-stage-gate
dsh web
The tools become model-visible in the Web UI. Model keys and a DeepSeek provider must already be configured (see the DeepSeek Harness Web UI guide).
Configuration
allowReopen (default true): whether a gate_check on a closed gate is accepted. When false, checking a closed gate throws Error: gate "<id>" is closed.
Override in your profile’s cordis.patch.yml:
- id: tool-stage-gate
config:
allowReopen: false
How it works
Gate state is kept in memory, scoped per agent session (gate_open /
gate_check / gate_close mutate an in-memory map keyed by session + gate id).
This package deliberately does not write custom session events
(gate/*). DeepSeek Harness’s session persistence refuses to reload a log
containing an event type outside its known-event whitelist unless the event is
marked ignorable, and Session.append has no API to set that marker. Custom
plugin events would make sessions unloadable after restart — see
docs/BUG-2026-08-17-session-log-pollution.md.
Trade-off: gate state resets when the harness restarts. This is the correct cost for an out-of-repo plugin until the harness opens a registration surface for downstream plugin events.
Development
pnpm install
pnpm test # vitest (14 tests)
pnpm typecheck # strict tsc
pnpm build # emit lib/
Compatibility
- Requires DeepSeek Harness
>=0.1.0-rc.5. - Web profile only (tools are model-facing).
- Gate state is in-memory and resets on harness restart (see How it works).
License
MIT © 2026 changingwang
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:changingwang/dsh-stage-gate。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。