dsh-agent-os-runtime

August 13, 2026 · View on GitHub

DeepSeek Harness 个人适配声明(Personal Adaptation Notice)

本项目是 DeepSeek Harness个人适配产物(personal adaptation)并非 DeepSeek Harness 官方文件(not an official DeepSeek Harness file)。随附功能、使用说明与个人产物,可与 DeepSeek Harness 搭配使用,也可独立使用。

This project is a personal adaptation for DeepSeek Harness, and is NOT an official DeepSeek Harness file. It is bundled with features, documentation, and personal artifacts, and 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

Agent OS 运行内核:把已批准路线图节点固化为不可变合同,哈希链 Ledger 作为恢复事实源,终态不可重派,completed 必须人工批准。

Agent OS runtime kernel: freezes approved roadmap nodes into immutable contracts with a hash-chained Ledger as the recovery source of truth.


Agent OS Runtime Kernel v0.1 / Agent OS 运行内核 v0.1

Agent OS 运行内核(AOS-001)把已批准的 Agent OS 路线图节点转换为可运行、可核验、可恢复的任务实例。内核只管理运行合同、生命周期、Ledger 和 Snapshot;它不自动创建后续任务,不自动完成任务,也不修改业务项目。

The Agent OS Runtime Kernel (AOS-001) turns approved Agent OS roadmap nodes into runnable, verifiable, recoverable task instances. The kernel only manages run contracts, lifecycle, Ledger, and Snapshot — it never auto-creates follow-up tasks, never auto-completes tasks, and never modifies business projects.

Features / 功能

  • 权威链验证:计划批准与执行授权分离,Initialize 前校验父计划哈希与执行授权文件 SHA-256。

  • 合同驱动生命周期created → ready → running → verifying → repairing → waiting_for_approval 状态机,终态后拒绝任何迁移。

  • 哈希链 Ledger:每条事件绑定合同哈希与前序哈希,损坏时立即 fail closed 并禁用派发。

  • 可恢复快照Recover 只从可信 Ledger 前缀重建缺失或过期的 Snapshot,绝不用不可信状态覆盖。

  • 用量与人工门:最多两次尝试、一次修正;进入 completed 必须显式 ApproveCompletion

  • 凭据模式检查:迁移原因、证据路径与合同文本在持久化前执行凭据扫描,命中即拒绝。

  • Authority-chain verification: plan approval and execution authorization are separated; Initialize validates the parent plan hash and authorization SHA-256 first.

  • Contract-driven lifecycle: created → ready → running → verifying → repairing → waiting_for_approval state machine; terminal states reject any transition.

  • Hash-chained Ledger: every event binds the contract hash and previous hash; corruption fails closed and disables dispatch.

  • Recoverable snapshots: Recover rebuilds missing or stale snapshots from the trusted Ledger prefix only, never overwriting with untrusted state.

  • Usage caps & human gate: at most two attempts and one repair; entering completed requires an explicit ApproveCompletion.

  • Credential scanning: reasons, evidence paths, and contract text are scanned for credential patterns before persistence; hits are rejected.

What's inside / 目录结构

dsh-agent-os-runtime/
├── README.md                      # 双语说明(本文件)
├── LICENSE                        # MIT
├── src/AgentOSRuntime.psm1        # 运行内核模块(合同、生命周期、Ledger、恢复)
├── runner/agent_os_runtime.ps1    # 唯一公开入口(Initialize/Transition/Inspect/Recover)
├── schemas/agent_os_runtime_task.schema.json   # 运行合同 Schema
├── specs/Agent-OS-Runtime-Kernel-v0.1.md       # AOS-001 规格
├── tests/AgentOSRuntime.Tests.ps1              # Pester 5 测试
└── .dsh/                          # DeepSeek Harness 衍生包

Quick start / 快速开始

# Initialize:验证父计划与执行授权,创建合同、Ledger 与 Snapshot
pwsh -File .\runner\agent_os_runtime.ps1 -Action Initialize `
  -PlanPath ".\plan.json" -PlanTaskId "AOS-001" `
  -AuthorizationPath ".\authorization.json" -AuthorizationSha256 "<sha256>" `
  -RuntimeRoot ".\runtime\agent_os_tasks" -AsJson

# Transition:执行一个合法状态迁移
pwsh -File .\runner\agent_os_runtime.ps1 -Action Transition `
  -TaskPath "<task_id>" -ToState running -Reason "start" -AsJson

# Inspect:从合同与 Ledger 计算当前可信状态
pwsh -File .\runner\agent_os_runtime.ps1 -Action Inspect -TaskPath "<task_id>" -AsJson

# Recover:验证完整哈希链并重建 Snapshot
pwsh -File .\runner\agent_os_runtime.ps1 -Action Recover -TaskPath "<task_id>" -AsJson

# 运行测试(Pester 5)
Invoke-Pester .\tests\AgentOSRuntime.Tests.ps1

DeepSeek Harness 衍生 / DSH Derivative

本项目附带 DeepSeek Harness 衍生包,位于 .dsh/ 目录:

  • preset.yml — Agent 预设元数据
  • agent.cordis.yml — Cordis 组装(基于 standard 预设,persona 已定制)
  • skills/dsh-agent-os-runtime/SKILL.md — 项目专属技能(skill)

安装与接入方式见 .dsh/README.md(双语)。

License / 许可证

MIT



这是 DeepSeek Harness 个人适配系列(共 31 个仓库)的完整导航。 / This is the complete navigation for the DeepSeek Harness personal-adaptation series (31 repos).

Agent OS 内核 / Kernel

dsh-agent-os-runtime(本仓库 / this repo) · 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 · dsh-sports-pipeline · dsh-motion-grammar

DSH 总集成 / Integration

dsh-integration · dsh-presets-pack · dsh-skills-pack · dsh-starter-kit