Introduction

A DeepSeek Harness (DSH) session is an append-only event log. If the scheduler throws an exception during a tool invocation, and tool/call is persisted but tool/result is not recorded, the session develops a “provider-visible transcript defect”. Subsequent model requests can fail due to protocol errors (such as missing tool results), and simply sending a new message cannot repair this corrupted history. A mechanism is needed to diagnose these defects and continue from a safe boundary.

Plugin Positioning

dsh-session-integrity is a plugin for diagnosing DeepSeek Harness session integrity failures and providing non-destructive recovery. It is intended to distinguish provider-visible transcript defects from original execution gaps hidden by compaction, and to find a safe recovery boundary.

  • Name: dsh-session-integrity
  • Owner: DON738110198
  • Category: Workflow
  • License: MIT

Core Features

The plugin provides the following capabilities:

  1. Session scanning: scans the live session on load and at the end of each turn.
  2. Offline diagnostics: inspects exported JSON or uncompressed JSONL via CLI without initiating model requests.
  3. Defect isolation: distinguishes provider-visible transcript defects from original execution gaps hidden by compaction.
  4. Privacy-preserving reports: uses hash references and omits prompts, tool arguments, and tool results.
  5. Recovery planning: finds the latest completed prefix that can still be safely sent to the provider.
  6. Web integration: adds “Continue from here” to historical assistant turns in the Web plugin. It creates a forked session while preserving the original session.
  7. Safe operations: the analyzer and planner are read-only. Recovery uses Harness’s public Fork API instead of rewriting persisted history.
  8. Safety contract: never mutates, destroys, deletes, or replaces events in the source session. Recovery creates a child session via the Fork API. It never retries tools or claims external side effects have been rolled back.

Installation and Enablement

Install it using the official plugin command. After installation, the plugin checks the session on load and again at the end of each turn.

dsh plugin --profile web add github:DON738110198/dsh-session-integrity#v0.2.1
dsh --profile web --dump-config
dsh --profile web

Typical Usage

The plugin is executed via CLI and supports scan and recovery modes.

Scan session integrity:

dsh plugin --profile web exec dsh-session-integrity ./session.l
dsh plugin --profile web exec dsh-session-integrity ./session.l -- > integrity-report.

Generate a recovery plan:

dsh plugin --profile web exec dsh-session-integrity recover ./session.l -- > recovery-plan.
dsh plugin --profile web exec dsh-session-integrity recover ./session.l --at 42

Note: recovery commands output a plan and do not modify source files or the live session.

Use Cases and Caveats

  • Use case: when model requests fail due to protocol errors (such as missing tool results) and session history is suspected to be corrupted.
  • Caveats:
    • The plugin runs with the current DSH process permissions.
    • The plugin does not implement hard deletion; the current public persistence services do not provide a backend-independent session deletion operation.
    • The package is not published to npm; therefore, npx dsh-session-integrity is not supported.
    • Zstandard logs are not decoded independently; use Harness exports or an uncompressed backend.
    • The plugin creates child sessions via Harness’s Fork API instead of rewriting history, so it does not commit to rolling back external side effects.

Ecosystem Background

The DeepSeek Harness philosophy is “everything is a plugin”. Community directories (such as SkillHub) provide plugin indexes but have no official affiliation with DeepSeek or High-Flyer. External contributions are currently routed through Discussions, plugins, and community support rather than external Pull Requests.

Short Conclusion

dsh-session-integrity provides primitives for diagnosing session defects and generating safe recovery plans without modifying the source session. It minimizes risk by using the Fork API, ensuring raw data remains intact. For more details, see the GitHub repository.