DSH Sessions Diagnosis

DSH stores each session as a directory, containing a single immutable file generated for each format. After upgrading to 0.1.5, the final step of the migration is a closed vocabulary audit: every message must carry source.kind, and that value must come from a fixed set of 15 values. Any deprecated value causes the entire migration to abort, making the session unopenable. Even if the session list renders normally, clicking to open it returns a generic gateway/internal error.

The dsh-sessions-diagnosis plugin addresses this by running DSH’s official migration chain within the CLI, an agent tool, or the DSH Web UI.

Core Features

The plugin offers three core capabilities:

  • Diagnose: Runs the official migration chain published by DSH, reporting the exact reasons the Harness encounters. It classifies each session as ok, unmigrated, repairable, unrepairable, and more, pinpointing the specific erroneous fields.
  • Repair: Generates valid current-format successors without modifying the original files. If DSH’s codec is unavailable, in-place repair is performed when rules match (with byte-level backup and the ability to roll back).
  • Visualize: Provides a dashboard in the DSH Web UI under Settings → Session diagnosis, showing verdicts and reasons for all sessions, and offering a “one-click repair” to preview remediation steps.

Installation and Activation

Add the plugin to your Web Profile using the official installation command:

dsh plugin --profile web add github:YouHui1/dsh-sessions-diagnosis

This command downloads prebuilt JavaScript; no build step or dependency installation is required. After installation, restart DSH and refresh your browser. The dashboard will appear under Settings → Session diagnosis.

Typical Usage

The plugin provides a command-line tool named dsh-session-doctor.

Scanning and Diagnosis

# Inspect what's in the session store
dsh-session-doctor scan

# Classify and diagnose all sessions
dsh-session-doctor diagnose

# Diagnose details for a specific session
dsh-session-doctor diagnose <id>

Repairing Sessions

# Dry-run repair on a specific session (no writes)
dsh-session-doctor repair <id>

# Apply the repair
dsh-session-doctor repair <id> --apply

# Repair all repairable sessions
dsh-session-doctor repair --all --apply

# Roll back a repair performed by this tool
dsh-session-doctor rollback <id>

# Validate all sessions using DSH's codec
dsh-session-doctor verify

Testing and Drills

# Create a simulated broken session (low-risk rule: deprecated source.kind)
dsh-session-doctor demo

# Create a simulated broken session (medium-risk rule: outdated descriptor version)
dsh-session-doctor demo --scenario descriptor

# Remove the demo session
dsh-session-doctor demo --remove --apply

Note: The demo command writes a fake broken session that does not enter your real session store. It uses a default storage directory at <tmp>/dsh-session-doctor-demo and refuses --root arguments pointing to a real store.

Applicable Scenarios and Considerations

  • No restart required: Repairing sessions does not require restarting DSH; DSH resolves generations on open, so a repaired session will open on the next click.
  • Data safety: Original files are never modified. Demo sessions are isolated in a separate store and do not pollute your session list.
  • Ecosystem context: This plugin follows DSH’s “everything is a plugin” philosophy and integrates via the Cordis patch mechanism. Review the source and license (MIT) before installation.

Summary

dsh-sessions-diagnosis is a diagnostic and remediation toolkit for session migration issues after upgrading DSH. It offers both CLI and Web UI workflows and ensures accuracy by reusing DSH’s official logic rather than guessing.

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

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

Xiaoye