chunsi-w/dsh-trajectory-governor 预览 preview

chunsi-w/dsh-trajectory-governor

DeepSeek Harness的闭环轨迹策略平面

Project Overview项目介绍

This repository is a closed-loop agent trajectory control plane built natively exclusively for DeepSeek Harness. It does not add extra persona prompts or split conversations into fixed sections, instead it tracks the full real event flow of agent tasks to maintain structured context. It supports multiple core functions, from task episode continuity tracking and work phase management to verification debt recording, performance regression checking and local decision ledger storage. It is a full clean-sheet rewrite of the older dsh-mode-boost project, with no dependencies on external preset forks or third-party injectors.

To install the plugin, you need Node.js version ^22.19.0 or >=24.0.0, and it is compatible with all DeepSeek Harness versions from 0.1.0-rc.5 up to before 0.2.0. The recommended installation method is via the official DSH CLI, running dsh plugin --profile web add @chunsi-m/dsh-trajectory-governor then dumping the config to complete setup. It can also be installed from local source code after building with npm. All configuration is done via a cordis patch file, and new users are advised to test functionality in shadow mode first before enabling active mode.

The plugin ships with a read-only status tool that returns all current context of the active agent session, including episode relation, work phase, risk level, open verification debt, and current benchmark status. It stores a local append-only decision ledger that only holds hashed summaries of user input, not full original text, and rotates old files automatically when they reach the configured size limit. It is released under the permissive MIT open source license, and it currently relies on deterministic rules rather than machine learning for task classification, so it cannot support automatic workspace rollback without external evaluation tools.

dsh-trajectory-governor 是专为 DeepSeek Harness 开发的原生闭环 Agent 轨迹控制平面插件,它围绕 Agent 任务的真实事件流进行管理,核心能力涵盖维护任务片段与连续性关系、跟踪当前工作阶段、记录结构化信息增益、管理修改后的验证债务、保存工作区版本、判断带容差的性能回归、过滤重复无信息调用、管控范围化工具能力、设置任务完成门限、支持可选自适应推理,同时存储本地不可见的决策账本。它是 dsh-mode-boost 的全量重构,不依赖预设分支或超级注入工具。

安装需要 Node.js 版本不低于 22.19.0 或 24.0.0,支持 DeepSeek Harness 0.1.0-rc.5 到 0.2.0 版本,官方推荐通过 npm 直接安装,也支持从本地源码编译安装。插件会通过 DSH 的 bundle 层注入,用户可通过配置文件调整运行模式、推理策略、验证规则、基准测试参数等多项内容,推荐先以影子模式运行验证功能,再切换到激活模式。

它提供状态查询工具供用户查看当前任务的片段、关系、风险、验证债务、基准测试状态等信息,决策账本默认存储在 DSH_HOME 目录下,仅存储摘要信息不保存原始用户输入,满足轮转大小后自动归档不会删除历史。插件当前使用确定性规则而非学习分类器,不提供工作区自动回滚,需要外部评估工具提供还原机制,采用 MIT 许可开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 12 stars - an early-stage project星标 12,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add @chunsi-m/dsh-trajectory-governor

把 chunsi-w/dsh-trajectory-governor 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-trajectory-governor

面向 DeepSeek Harness 的闭环 Agent 轨迹控制平面。它不是继续增强一句 persona,也不是把会话永久分成 spec/react,而是围绕真实事件流维护:

  • Task Episode 与连续性关系;
  • 当前工作阶段;
  • 结构化信息增益;
  • 修改后的验证债务;
  • workspace revision 与完整 benchmark 证据;
  • 同规格、带容差的性能回归判断;
  • 重复调用与无新信息轨迹;
  • scoped 工具能力面;
  • 显式 finish 与自然结束的完成门;
  • 可选的自适应 reasoning effort;
  • 本地、非模型可见的决策账本。

本项目是对 dsh-mode-boost 的 clean-sheet 重构,不依赖 preset fork,也不依赖 super-injector。

已实现的闭环

真人消息被 inbox claim
  -> 在第一次 prompt assembly 前建立 Task Contract
  -> 判断 new / continuation / extension / correction / review / conversation
  -> 必要时通过 agent.ctx.tools.restrict() 暂时隐藏 write/edit
  -> agent/pre-step 在同一个请求内追加可重建的近场 policy message
  -> Native tool 或 Code Mode SDK 子调用产生 durable 事件
  -> 计算 observation novelty / mutation / verification
  -> 修改产生 Verification Debt
  -> readback + test/build/check 清偿当前 revision 的债务
  -> 可选 benchmark gate 只接受当前 revision 的完整、可解析结果
  -> 同 query count / concurrency / warmup 才比较 QPS,容差内不误判噪声
  -> finish guard 与 turn-stopping 阻止无证据结束
  -> 有限续步耗尽后要求模型明确报告 blocker

安装

要求:

  • Node.js ^22.19.0 || >=24.0.0;
  • DeepSeek Harness 0.1.0-rc.7(开发与集成测试基线);peer range 兼容 0.1.0-rc.5 至 <0.2.0。

从当前目录安装:

npm run build
dsh plugin --profile web add .
dsh --profile web --dump-config

从 npm 安装(推荐):

dsh plugin --profile web add @chunsi-m/dsh-trajectory-governor
dsh --profile web --dump-config

如需固定版本:

dsh plugin --profile web add @chunsi-m/dsh-trajectory-governor@0.2.0

安装 tarball:

npm run pack:release
dsh plugin --profile web add ./chunsi-m-dsh-trajectory-governor-0.2.0.tgz

包已经声明正式的:

{
  "dsh": {
    "bundle": {
      "patch": "./cordis.patch.yml"
    }
  }
}

所以 dsh plugin --profile web add ... 会把它加入 web profile 的 bundle 层,而不是只安装成无效普通依赖。

配置

cordis.patch.yml 默认配置:

- insert:
    - id: trajectory-governor
      name: '@chunsi-m/dsh-trajectory-governor'
      config:
        mode: active
        adaptiveReasoning: false
        restrictBeforeEvidence: true
        autoVerify: true
        maxAutomaticContinuations: 1
        exposeStatusTool: true
        ledger: true
        maxLedgerBytes: 10485760
        benchmarkRequired: false
        benchmarkToolNames: [run_benchmark]
        verificationToolNames: [build_project, run_correctness_test]
        finishToolNames: [finish]
        fullBenchmarkMinQueries: 10000
        fullBenchmarkMinRecall: 0.95
        benchmarkScoreTolerancePercent: 2
        maxActionsWithoutBenchmark: 8
        maxStagnantFullBenchmarks: 2
        stopRetryOnDeterministicErrors: true

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-a2a 下一个 Next awesome-dsh-plugins →