dsh-governance-kernel
August 13, 2026 · View on GitHub
DeepSeek Harness 个人适配声明(Personal Adaptation Notice)
本项目是 DeepSeek Harness 的个人适配产物(personal adaptation),并非 DeepSeek Harness 官方文件(not an official DeepSeek Harness file),随附功能、使用说明与个人产物(bundled with features, documentation, and personal artifacts),可与 DeepSeek Harness 搭配使用,也可独立使用。
This project is a personal adaptation for DeepSeek Harness, and is NOT an official DeepSeek Harness file, bundled with features, documentation, and personal artifacts. It can be used alongside DeepSeek Harness or standalone.
作者 / Author: h565656445
合作 / Collaboration: 如有项目可以一起合作,欢迎联系。微信:wohaishihenshuaide。If you have projects, let's collaborate. WeChat: wohaishihenshuaide.
用途 / What this is for
治理内核:Python 实现的哈希链治理引擎,提供 attestation、ledger、packet、状态机与 schema 校验,保证多方协作可审计。
Governance kernel: a Python hash-chained governance engine with attestation, ledger, packets, state machine and schema validation.
Hermes Governance Kernel / Hermes 治理内核
面向「不信任 Agent」的管线的强制内核:模型可以提案、Worker 可以产出、供应商可以成功、审查者可以接受——但只有契约、证据、门禁与账本合在一起才允许完成语义发生。五条纪律:完成权锁定(供应商成功 ≠ 完成)、异议裁决(决策记录必须含结构化异议)、哈希绑定交接(类型化数据包、摘要重算与上游引用核验)、独立核验(审查者必须自己重算变更回执摘要)、负效应证明与保审计迁移。零运行时依赖(仅 Python 标准库),fail-closed 由构造与测试双重保证。
An enforcement kernel for pipelines whose agents you do not trust. Models may propose, workers may produce, providers may succeed, reviewers may accept — but only the contract, the evidence, the gates and the ledger together allow completion semantics. Five disciplines: completion-authority lockdown (provider success is never completion), adjudicated dissent (decision records require structured objections), hash-bound handoff (typed packets, recomputed digests, upstream references re-verified), independent verification (reviewers must recompute change-receipt digests themselves), and negative-effect attestation & audit-preserving relocation. Zero runtime dependencies (Python stdlib only); fail-closed by construction and by proof.
Features / 功能
- 完成权锁定:没有协议合规的 Worker 产物能表达或触发终态;供应商成功只是数据,不是迁移 / Completion-authority lockdown: no protocol-conformant worker output can express or trigger a terminal state; provider "success" is data, never a transition
- 异议裁决:缺结构化异议(claim + disposition + response)的决策记录被拒 / Adjudicated dissent: decision records without structured objections are refused
- 哈希绑定交接与独立核验:数据包摘要重算、上游引用核验、审查者必须自行重算变更回执摘要 / Hash-bound handoff and independent verification with digest recomputation at every boundary
- 追加式哈希链账本:可重建状态与黑板投影,加载 fail-closed(含锚定防整尾截断)/ Append-only hash-chained ledger with state/blackboard rebuild and fail-closed loads (anchor-guarded against tail truncation)
- 负效应证明与保审计迁移:保护计数器必须显式证明,非零需要结构化人审绑定 / Negative-effect attestation and audit-preserving relocation with single-use structured human approvals
- 零运行时依赖、类型化异常与全状态快照不变式测试 / Zero runtime deps, typed exceptions, snapshot-invariant tests
What's inside / 目录结构
hermes_governance/ 内核(engine、packets、ledger、persistence、attestation、state_machine、schemas/)
docs/ 为什么“供应商成功”不等于“任务完成”
examples/ 演示:完整生命周期 + 13 种违规逐项拒绝、编排器接线示例
tests/ 完成权、异议、交接、核验、负效应、持久化测试
Quick start / 快速开始
# 演示:一个合法生命周期走到 CLOSED,再逐项拒绝 13 种违规
python examples/run_cycle.py
# 接线既有编排器:供应商说 SUCCEEDED,账本说 VERIFICATION
python examples/orchestrator_adapter.py
# 全量测试
python -m unittest discover -s tests -v
DeepSeek Harness 衍生 / DSH Derivative
本项目附带 DeepSeek Harness 衍生包,位于 .dsh/ 目录:
preset.yml— Agent 预设元数据agent.cordis.yml— Cordis 组装(基于 standard 预设,persona 已定制)skills/dsh-governance-kernel/SKILL.md— 项目专属技能(skill)
安装与接入方式见 .dsh/README.md(双语)。
License / 许可证
相关项目 / Related Projects
这是 DeepSeek Harness 个人适配系列(共 31 个仓库)的完整导航。 / This is the complete navigation for the DeepSeek Harness personal-adaptation series (31 repos).
Agent OS 内核 / Kernel
dsh-agent-os-runtime · dsh-agent-os-planning · dsh-agent-os-scheduler · dsh-agent-os-worker-protocol · dsh-agent-os-observability · dsh-agent-os-specs
Harness 基础设施 / Infrastructure
dsh-harness-core · dsh-graph-entry · dsh-async-job · dsh-file-identity · dsh-json-projection · dsh-manual-approval · dsh-observation-writer · dsh-provider-control · dsh-schema-negotiator · dsh-upgrade-governance
规格与文档 / Specs & Docs
dsh-harness-specs · dsh-novel-specs · dsh-architecture-guide · dsh-powershell-patterns · dsh-json-schema-driven-dev · dsh-llm-agent-harness-guide
适配器 / Adapters
dsh-short-story-engine · dsh-tutorial-video-state-machine · dsh-governance-kernel(本仓库 / this repo) · dsh-sports-pipeline · dsh-motion-grammar
DSH 总集成 / Integration
dsh-integration · dsh-presets-pack · dsh-skills-pack · dsh-starter-kit