dsh-2origin: Providing 2Origin State Projection, Semantic Diff, and Immutable Freeze for DeepSeek Harness

Preface

In the plugin-based workflow of DeepSeek Harness (DSH), chat history itself is not suitable as authoritative evidence for task handoff. What truly needs to be inspected, compared, and preserved is typically a structured task.origin.json state file.

dsh-2origin is a plugin designed for DSH that treats the 2Origin state file as an evidence object: first, it examines the state projection, then performs a read-only semantic diff on the full candidate JSON, and finally freezes the observed version as an immutable snapshot.

DeepSeek Harness emphasizes plugin-based extensibility; here, dsh-2origin is a third-party plugin extension and is not equivalent to an official app store listing.

What This Is

The positioning of dsh-2origin is: Evidence-first 2Origin state projection, diff and immutable freeze for DeepSeek Harness.

It is maintained by dongsheng123132 and is licensed under MIT. v0.2 provides a formal Codex plugin surface, along with a standalone proof-only MCP surface.

It addresses three primary problems:

  • State inspection: Outputs a compact projection, counts, verified-fact count, and recorded-vs-computed hash consistency.
  • Semantic comparison: Performs a read-only diff on the full candidate JSON document, without mistaking version, time, actor, or storage hashes for content changes.
  • Immutable freeze: Creates content-addressed snapshots based on the just-observed hash, requiring exclusive creation and read-back verification.

It is not a general-purpose memory store, a plugin trust scanner, or an activity log.

Core Features

The following describes the main capabilities exposed by the plugin.

State Projection

dsh_2origin_status is used to view summary information about the current 2Origin state.

It provides:

  • compact projection
  • counts
  • verified-fact count
  • recorded-vs-computed hash integrity

The purpose of this step is to confirm whether the current state is readable and whether hashes are consistent before any subsequent diff or freeze.

Semantic Diff

dsh_2origin_diff performs a read-only semantic diff on the full candidate JSON document.

Its comparison target is semantic content, not a mechanical comparison of all fields. Content hashing is compatible with 2origin/0.2: SHA-256 is computed over stable canonical JSON, excluding the following fields:

  • version
  • updated_at
  • content_hash
  • actor

This prevents provenance metadata from causing “false changes.”

Immutable Freeze

dsh_2origin_freeze is the only write action.

It performs the following:

  • Requires the hash just observed from status to be passed in
  • Rejects stale states
  • Creates a content-addressed snapshot
  • Uses exclusive creation
  • Reads back the written content for verification
  • Remains idempotent for duplicate identical requests

The target of freeze is an independent snapshot directory; it does not update live state.

CLI

The plugin provides three CLI commands:

  • status
  • diff
  • freeze

These three commands correspond to state inspection, candidate comparison, and version freezing, respectively.

Codex and MCP Surfaces

The repository includes a formal Codex plugin surface, which contains .codex-plugin/plugin.json.

It also provides a standalone stdio MCP server exposing two tools:

  • state_proof: Validates a bounded inline state document, returning only integrity, hashes, counts, and violations.
  • state_diff_proof: Compares two bounded inline documents, returning changed fields along with content-addressed value/item hashes.

This MCP server does not read or write the filesystem, rejects secret-shaped keys, limits each document to 1 MiB, and does not echo state prose.

The MCP surface also deliberately does not expose freeze. Filesystem writes remain confined to the explicitly configured DSH/CLI surface.

Installation and Enablement

The runtime environment requires Node.js >=22.

Installation command:

dsh plugin --profile <name> add github:dongsheng123132/dsh-2origin

After installation, the workspace must be explicitly configured. Configuration items include:

workspaceRoot: <absolute project path>
stateFile: <relative state path>
freezeDir: <relative snapshot directory>

All configured file paths are relative to workspaceRoot. Path traversal and symlink escapes are rejected.

@deepseek-ai/dsh-tools is declared as an optional peer dependency.

Typical Usage

The following examples use state paths relative to workspaceRoot.

First, inspect the state:

dsh-2origin status --root C:/project --state demo/task/task.origin.json

This step confirms the current state’s readability, counts, verified-fact count, and hash consistency.

Next, compare a candidate document:

dsh-2origin diff --root C:/project --state demo/task/task.origin.json --candidate next.json

This performs a read-only semantic diff against next.json.

Finally, freeze the currently observed version:

dsh-2origin freeze --root C:/project --state demo/task/task.origin.json --expect <sha256>

The <sha256> should come from the hash observed in the preceding status command. freeze writes to an independent snapshot directory rather than modifying live state.

Use Cases and Cautions

Suitable for:

  • Teams that need to inspect 2origin/0.2 task states within DSH agents or the CLI
  • Scenarios requiring comparison of full candidate JSON and freezing of observed versions
  • Scenarios where state files should be treated as evidence objects rather than relying on chat context as handoff credentials

Not suitable for:

  • Scenarios requiring general-purpose memory storage
  • Scenarios requiring plugin trust scanning or activity logging
  • Scenarios expecting the plugin to directly maintain business-state lifecycles or replace the original system’s live-state writer

Important notes:

  • The plugin runs with the privileges of the current dsh process. Source code, licenses, and dependencies should be reviewed before installation.
  • Licensed under MIT.
  • The plugin does not update live state.
  • freeze is the only write action and writes only to an independent snapshot directory.
  • The MCP surface is for proof purposes only and does not expose freeze.
  • This document does not reference unverified star counts or classification information.

Conclusion

The value of dsh-2origin is in restoring task.origin.json from “context text” to a verifiable evidence object: first status, then diff, and finally using freeze to preserve the exact version.

GitHub: https://github.com/dongsheng123132/dsh-2origin

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

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

Xiaoye