跳到正文

dfycaly98931680/dsh-trajectory-governance

30最近提交 2026年8月14日

dsh-trajectory-governance DSH 插件

将扁平会话/事件日志重建为结构化多分支轨迹树,并保留观察层快照。运行三种时序异常检测策略(循环死锁、无效重试、目标漂移),结果在独立 GUI 标签中展示。通过只读事件订阅工作,零内核修改,使用私有 SQLite 存储。

如何安装 dsh-trajectory-governance DSH 插件

dsh plugin --profile web add github:dfycaly98931680/dsh-trajectory-governance#<commit-sha>

来源命令需要人工核对。复制不会执行命令。

dsh-trajectory-governance DSH 插件数据来源

dsh-trajectory-governance DSH 插件快照日期:2026年8月16日

discovered

dsh-trajectory-governance DSH 插件能做什么

  • 将扁平事件日志重建为结构化多分支轨迹树,包含父/子、子智能体/分支关系。
  • 检测循环死锁、无效重试和目标漂移,并给出置信度与严重等级。
  • 提供独立 GUI 标签(conversation.view 插槽),展示轨迹树、快照标记和异常高亮。
  • 支持一键中断循环智能体(通过官方 agent.cancel API)。
  • 生成浪费报告,明确哪些会话因哪种异常浪费了 token。
  • 提供 CLI 脚本用于检查会话、导出树和快照管理。

dsh-trajectory-governance DSH 插件适合哪些场景

  • 调试包含数十轮、子智能体和分支的复杂长期任务。
  • 识别智能体何时陷入重复同一工具调用的循环。
  • 检测智能体在收到无关后续指令后发生目标漂移。
  • 分析成本归因:哪些会话在哪些异常上浪费了 token。
  • 在任意节点创建快照,用于诊断驱动的会话分支重启。

dsh-trajectory-governance DSH 插件适合谁

  • 使用 DSH 开发或调试复杂多步智能体工作流的开发者。
  • 需要洞察智能体历史行为与异常模式的运维人员。

dsh-trajectory-governance DSH 插件的限制

  • 仅观察层,无法 fork、恢复或回滚智能体(只能通过官方 cancel 中断)。
  • 需要 DSH >= 0.1.0-rc.6;私有 SQLite 存储,不与宿主存储集成。
  • 预览 API(SESSION_FORMAT_VERSION = 0),不保证向后兼容。
  • 快照仅为索引(节点ID+哈希),上下文从事件存储重建,非完整状态恢复。

dsh-trajectory-governance DSH 插件的仓库 README 摘录

以下文字摘自 dsh-trajectory-governance DSH 插件的上游仓库 dfycaly98931680/dsh-trajectory-governance 的 README,版权归原作者,仅作引用。

**Agent trajectory governance & anomaly diagnosis for DeepSeek Harness (dsh).** Rebuilds the flat `session/event` log into a **structured, multi-branch trajectory tree**, keeps **observation-layer snapshots**, and runs **three temporal anomaly strategies** (loop deadlock / invalid retry / goal drift) with results mounted on tree nodes and surfaced in an **independent GUI tab**. > Zero kernel modification · consume-only event subscription · observation-layer > snapshots (no control-plane rollback) · independent SQLite storage · never > overwrites the official Trajectory view. --- ## Why The official Trajectory page is a **flat raw-event log**. For long-running agent tasks (dozens of turns, subagents, forks) you cannot see: - which tool call belongs to which sub-task / subagent / fork branch, - where the agent started drifting from the original goal, - whether it is looping in place burning tokens (deadlock / invalid retry). This plugin is an **upper observation & reasoning layer**: it consumes committed events and derives structure, snapshots, and diagnoses — it never steers, intercepts, or rolls back the agent. Both views coexist. | Aspect | Official Trajectory | dsh-trajec

阅读完整 README仓库许可: MIT

dsh-trajectory-governance DSH 插件常见问题

如何安装 dsh-trajectory-governance?

需要 DSH >= 0.1.0-rc.6。使用命令:`dsh plugin --profile web add github:dfycaly98931680/dsh-trajectory-governance#<commit-sha>`。如果从源码安装,需要在 profile 的 pnpm-workspace.yaml 中允许构建。也可以使用 `pnpm pack` 打包的 tarball 安装,无需构建权限。

如何使用轨迹治理标签页?

安装后重启 DSH web 应用,日志中应出现插件加载成功的消息。在 GUI 中运行任意智能体任务,然后打开“轨迹治理 / Trajectory Governance”标签页。它会作为独立视图出现在官方 Trajectory 标签页旁边。选择会话即可查看结构化轨迹树、异常和快照。

该插件能检测哪些异常?

它检测三种时序异常:循环死锁(重复相同工具调用)、无效重试(重复不同内容但无进展)和目标漂移(智能体偏离原始任务目标)。每种异常都会报告置信度、严重等级、描述和建议。

它能否回滚智能体到之前的状态?

不能,该插件是只读观察层,不执行 fork、恢复或回滚操作。但它提供“一键中断”功能,调用官方 agent.cancel API 来停止循环的智能体。如需回滚,README 推荐使用独立的插件 dsh-turn-rewind。

如何生成浪费报告?

可以使用 CLI 命令:`curl http://127.0.0.1:3080/trajectory-governance/api/report/waste`,返回 Markdown+JSON 格式的所有会话报告。如需特定会话,添加 `?sessionId=<id>`。GUI 标签页也有“浪费报告”和“本会话报告”按钮。