dsh-driftwatch: DeepSeek Harness Behavior Drift Comparison Tool

Introduction

DeepSeek Harness (DSH) logs everything, but manually reading 50,000 lines of logs is not a viable workflow. Existing tools (such as dsh-replay or dsh-eval-harness) are typically used for debugging or assertions, answering “What happened?” or “Did it follow the rules?”. dsh-driftwatch specifically answers: How did the path differ between this run and the last? It generates structured behavioral change reports without the need for assertions or trace rendering.

Core Features

Session Comparison & Reporting
Compare two session logs to identify behavioral changes. Generate drift reports with scores and thresholds to help determine if the run status is stable.

Agent Tools
Upon installation, the agent gains access to two tools:
- drift_compare: Compares two sessions and reports drift inline.
- drift_list: Lists available sessions for baseline selection.

Behavioral Metrics
The plugin measures specific behavioral metrics:
- Tool sequences and mixing (using LCS alignment)
- File targets
- Reasoning volume
- Retries and timing
- Metrics such as record count, turns, and steps

Technical Features
- Zero dependencies (only runtime dependency is @edge-echo/dsh-ledger)
- CI-ready
- Defensive log reading (ignores unknown types, tolerates missing fields)

Installation & Enablement

Add the plugin using the official installation command.

dsh plugin --profile web add dsh-driftwatch

Typical Usage

  1. List available sessions
   npx dsh-driftwatch list
  1. Compare two runs
   npx dsh-driftwatch compare session-b6c2dcf3 session-b130e75b
  1. CI Gating & Export
    In a CI pipeline, fail when drift reaches a threshold (e.g., 35/100) and generate a Markdown report.
   npx dsh-driftwatch compare before after --fail-on-drift 35 --markdown drift.md

Implementation Details

Log Parsing
Session-log record types are handled via defensive reading: unknown types are ignored, and missing fields are tolerated. This ensures reports do not crash in the event of format variations.

Sequence Alignment
Sequence alignment utilizes an exact LCS (Longest Common Subsequence) algorithm, supporting up to 4M units. Beyond this limit, it falls back to multi-set overlap and reports accordingly.

Comparison Dimensions
DriftWatch compares behavior, not correctness. A stable run may be wrong, and a drifting run may be better.

Use Cases

  • Need to compare a current run against a known-good run.
  • Need CI gating to detect behavioral regressions before writing assertions.
  • Need to quantify specific changes in “feels different” (tool calls, file operations, reasoning time).

Conclusion

dsh-driftwatch provides a structured way to observe changes in agent behavior. It does not decide if drift is acceptable; instead, it provides scores and thresholds for you to make the judgment.

  • Plugin Directory: https://www.skillhub.cn/plugins/Edge-Echo/dsh-driftwatch
  • GitHub: https://github.com/Edge-Echo/dsh-driftwatch
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye