Introduction

DeepSeek Harness (DSH) uses a “everything is a plugin” architecture. As the number of plugins grows, issues such as duplicate service registration and version drift can cause conflicts and lead to DSH crashes. DSH Conflict Manager (P2M) is used to automatically intercept such conflicts, sort plugins by cumulative usage duration, isolate the offending plugins, and provide unified plugin enable/disable and priority management.

What It Is

dsh-p2m is a DSH plugin conflict manager maintained by GiantAxeint. It belongs to the admin-security category and is licensed under the MIT License.

The core functions of P2M are:
1. Automatic interception: Intercept conflicts that cause DSH crashes, such as duplicate service registration and version drift.
2. Priority and isolation: Sort by usage duration and isolate the offending plugins.
3. Unified management: Manage plugin enable/disable and dynamically maintain priorities.

Core Capabilities

Based on verified facts, this plugin provides the following capabilities:

  1. Automatic interception and isolation: Automatically intercept conflicts such as duplicate service registration and version drift, sort by usage duration, and isolate the offending plugins.
  2. Trial gate: Before a new plugin is enabled, it is test-run in a child process; if it crashes, it offers the options “Cancel enabling” or “Continue despite risk”.
  3. Pre-launch health check: Perform peer version checks and static scanning of the full patch layer before launch.
  4. Zero runtime dependencies: The plugin itself has no runtime dependencies; even the YAML parser is built in.
  5. Unified management: Manage plugin enable/disable and dynamically maintain priorities.

Installation and Activation

Environment requirements: DSH (CLI globally installed), Node ≥ 18.

Install using the official CLI:

dsh plugin --profile web add github:GiantAxeint/DSH-P2M

After installation, P2M works automatically. Its Entry ID is fixed as p2m, and the Guard self-healing mechanism depends on this ID; do not modify it.

Working Mechanism

P2M uses a tiered priority mechanism:
* Tier 0: DSH itself (identification rule: name starts with @deepseek-ai/, or configured coreEntryIds).
* Tier 1: P2M itself (Entry ID is p2m).
* Tier 2: Other plugins (sorted in descending order by cumulative usage milliseconds in usage.json).

Decision rules:
* No decision ever disables Tier 0 or Tier 1.
* Conflicts within the same tier sacrifice the one with shorter usage time.

Data and Logs

P2M stores its data in <DSH_HOME>/p2m/ (default ~/.dsh/p2m/).

Key files:
* plugin-guard.yml: The only guard file, containing the persistent list of banned plugins.
* usage.json: Cumulative usage duration ledger for each plugin.
* incidents.jsonl: Flow log for conflicts, isolation, and recovery.
* state.json: P2M’s own state.

Log example:
Each time DSH starts and loads P2M, one line appears in the log:

[p2m] boot #11 | guard=<...> | autoIsolate=true

boot #N indicates the Nth successful execution of the boot routine on this machine.

API Calls

During DSH runtime, you can call the following methods through ctx.p2m:

  • List and status: ctx.p2m.list(), ctx.p2m.status()
  • Ledger and flow log: ctx.p2m.usage(), ctx.p2m.incidents(n)
  • Conflict management: ctx.p2m.scanConflicts(), ctx.p2m.enable(id), ctx.p2m.disable(id)
  • Health check and gate: ctx.p2m.preflight(), ctx.p2m.trial(id)

Notes

  • Fixed Entry ID: P2M’s entry id is fixed as p2m, and the Guard self-healing mechanism depends on it.
  • Decision boundary: Decisions involving DSH itself and P2M always only report and do not automatically disable.
  • Installation limitation: The official dsh plugin add is a “download and restart” flow, and P2M cannot intervene in that flow before restart.

Summary

P2M is a tool that provides conflict detection, isolation, and priority management for the DSH plugin system. Through trial gates and pre-launch health checks, it reduces the risk of crashes caused by plugin conflicts, making it suitable for users who need to manage a large number of DSH plugins.

Plugin Directory | GitHub Repository