Skip to content

dfycaly98931680/dsh-trajectory-governance

30Last commit Aug 14, 2026

dsh-trajectory-governance DSH plugin

Rebuilds flat session/event logs into structured multi-branch trajectory trees with observation-layer snapshots. Runs three temporal anomaly strategies (loop deadlock, invalid retry, goal drift) and presents results in an independent GUI tab. Operates via consume-only event subscription, zero kernel modification, and uses private SQLite storage.

How to install the dsh-trajectory-governance DSH plugin

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

This source command needs manual review. Copying does not run it.

dsh-trajectory-governance DSH plugin data source

dsh-trajectory-governance DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-trajectory-governance DSH plugin can do

  • Rebuilds flat event logs into structured multi-branch trajectory trees with parent/child and fork/subagent branches.
  • Detects loop deadlocks, invalid retries, and goal drifts with confidence scores and severity levels.
  • Provides an independent GUI tab (conversation.view slot) with tree visualization, snapshot marks, and anomaly highlights.
  • Supports one-click interrupt of looping agents via official agent.cancel API.
  • Generates waste attribution reports showing which sessions wasted tokens on which anomaly types.
  • Offers CLI scripts for inspecting sessions, dumping trees, and managing snapshots.

Where the dsh-trajectory-governance DSH plugin fits

  • Debugging long-running agent tasks with dozens of turns, subagents, and forks.
  • Identifying when an agent is stuck in a loop repeating the same tool call.
  • Detecting goal drift when the agent diverges from the original task after a follow-up.
  • Analyzing cost attribution: which sessions wasted tokens and on which anomalies.
  • Capturing checkpoints at any node to branch a new session for diagnosis-driven restart.

Who the dsh-trajectory-governance DSH plugin is for

  • DSH users developing or debugging complex multi-step agent workflows.
  • Agent operators who need visibility into historical agent behavior and anomaly patterns.

dsh-trajectory-governance DSH plugin limitations

  • Consume-only observation layer: cannot fork, resume, or rewind the agent (only interrupt via official cancel).
  • Requires DSH >= 0.1.0-rc.6; private SQLite storage does not integrate with host storage.
  • Preview API (SESSION_FORMAT_VERSION = 0) with no backward compatibility guarantee.
  • Snapshot is an index (nodeId + hash) only; context is rebuilt from event store, not a full state restore.

dsh-trajectory-governance DSH plugin: from the repository README

Quoted from the dfycaly98931680/dsh-trajectory-governance README, the upstream source of the dsh-trajectory-governance DSH plugin. Copyright remains with the original authors.

**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

Read the full READMERepository license: MIT

dsh-trajectory-governance DSH plugin questions

How do I install dsh-trajectory-governance?

You need DSH >= 0.1.0-rc.6. Use the command: `dsh plugin --profile web add github:dfycaly98931680/dsh-trajectory-governance#<commit-sha>`. If you install from source, you may need to allow the build in your profile's pnpm-workspace.yaml. Alternatively, you can use a built tarball with `pnpm pack` and install it without build permissions.

How to use the trajectory governance tab?

After installation, restart the DSH web app. You should see a log message confirming the plugin loaded. Run any agent task in the GUI, then open the '轨迹治理 / Trajectory Governance' tab. It will appear as a separate view entry alongside the official Trajectory tab. You can select a session to see the structured tree, anomalies, and snapshots.

What anomalies does the plugin detect?

It detects three types of temporal anomalies: loop deadlock (repeated identical tool calls), invalid retry (repeated tool calls with different content but no progress), and goal drift (agent diverging from the original task objective). Each anomaly is reported with a confidence score, severity, description, and suggestion.

Can I use it to roll back the agent to a previous state?

No, this plugin is a consume-only observation layer. It does not fork, resume, or rewind the agent. However, it offers a 'one-click interrupt' that calls the official agent.cancel API to stop a looping agent. For rollback, the README mentions the separate plugin dsh-turn-rewind that handles control-plane rewind.

How to generate a waste report?

You can use the CLI command `curl http://127.0.0.1:3080/trajectory-governance/api/report/waste` to get a Markdown + JSON report for all sessions. To get a specific session, add `?sessionId=<id>`. The report shows which sessions wasted tokens/cost and on which anomaly types. The GUI tab also has buttons to generate these reports.