dsh-turnscope: Turn-by-Turn Code Review and Security Traceback for DeepSeek Harness

Preface

The core philosophy of DeepSeek Harness (DSH) is “Everything is a plugin.” In scenarios involving code generation and modification by agents, a single interaction may involve changes to numerous files and the execution of commands. When an error occurs at a certain step, developers urgently need clear answers: Which files were modified specifically? Which command failed? How to roll back without losing subsequent work or unrelated code?

Addressing these pain points, dsh-turnscope provides per-turn file diff analysis, deterministic safety warnings, and a “Preview-first” safe rollback mechanism for DSH coding sessions.

Plugin Introduction

zhaolianghz/dsh-turnscope is a DeepSeek Harness plugin. By natively integrating with conversation.view, it displays a detailed per-turn timeline within the DSH interface. The plugin not only provides file diffs and metrics statistics but also enables safe rollback operations through a “Preview-Apply” workflow.

Core Capabilities

  1. Per-Turn Timeline and Status
    The plugin provides statuses such as Running, Completed, Failed, or Output Limited. Each turn displays duration, tool call counts, error counts, and activity lists, helping developers quickly locate problematic nodes.

  2. Detailed File Changes
    It provides command results for each turn, summaries of changed files, and specific file diffs. It also supports viewing files that were already dirty (modified) at the start of the current turn.

  3. Safe Rollback

    • Preview: Drafts a change plan without writing to the workspace.
    • Apply: Commits the change plan using atomic renames and file logs. If a crash occurs during the application process, it automatically rolls back to the byte state prior to application upon the next startup.
  4. Drift Guard
    Drift Guard prevents unsafe operations when the workspace has changed after a preview.

  5. Privacy and Storage
    Adopts local storage (managed with root, permissions 0o600), contains no telemetry data, and does not execute git reset --hard operations.

Installation and Activation

Currently, no standard dsh plugin add installation command has been found, so local loading via source code build is required. The plugin requires Node.js 22.19 or newer, and pnpm 11.7.

Environment Preparation

corepack enable
pnpm install
pnpm build

Verification and Loading

After the build is complete, use DSH 0.2.0-rc.2 for local loading. GitHub provides the smoke:dsh script for quick installation verification:

pnpm smoke:dsh

Typical Usage

In the DSH conversation view, the plugin renders a Turns panel.

  1. View the file change summary and diff for the current turn.
  2. Click the Preview button to view the upcoming change plan; no actual modifications will occur in the workspace at this time.
  3. After confirming everything is correct, click the Apply button to commit the changes.
  4. If a crash occurs during the Apply process, the files will automatically roll back to the byte state prior to Apply when DSH restarts.

Use Cases and Notes

This plugin is suitable for developers who require fine-grained control over the code change process and prioritize auditing and safe rollbacks.

  • Environment Requirements: Requires Node.js 22.19+, pnpm 11.7, and DSH 0.2.0-rc.2.
  • Permission Notes: The plugin runs with the permissions of the current DSH process. Please inspect the source code before installation.
  • Limitations: The current version does not support Forked retry (planned for V0.3), and only supports read-only behavior on the browser side.
  • License: The specific license name has not been verified, only the existence of a LICENSE file is confirmed.

Conclusion

dsh-turnscope reduces the risks associated with agent code modification by providing deterministic safety warnings and a preview-based rollback mechanism. To learn more details or obtain the source code, please visit the plugin directory or the GitHub repository.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye