DeepSeek Harness Incident Timeline Plugin

Introduction

In DeepSeek Harness (DSH) session logs, three categories of failures—user rejections, plugin/tool errors, and runtime HTTP status issues—can look superficially similar, yet their root causes are entirely different: the first is an approval denial, the second is a tool or model-stream error, and the third is a gateway-level HTTP failure. Treating them as one bucket risks misdiagnosing “approval rejected” as “plugin broken,” or mistaking a “gateway 413” for “user denied authorization.”

To properly review an incident, you need to group entries by failure type and trace each one back to its original log line number. The dsh-incident-timeline plugin is designed for exactly this purpose: it adds a read-only incident timeline layer on top of DSH session logs and exports the three failure categories into a citable Markdown table.

Plugin Overview

dingchenhui0618-arch/dsh-incident-timeline is a DSH incident-review plugin developed by dingchenhui0618-arch. It decodes DSH session logs, structures them into a SQLite projection database, and classifies entries into three incident labels (user-rejected / plugin-error / runtime-http). Every entry carries a session ID, step number, original log line number, timestamp, and an excerpt from the raw log, with support for time-window-filtered export.

Inspired by drscrewdriver/dsh-reference-session-collector (DRSC), but DRSC focuses on general-purpose session projection and retrieval. This project focuses on incident review: it independently implements multi-frame zstd decoding and the three incident labels, does not provide general-purpose retrieval features such as FTS5, but does offer citation export with physical line numbers.

Installation & Enablement

Before installing, make sure your environment meets the requirements: Node ≥ 22.16, DSH >=0.2.1-rc.2 <0.3.0. The plugin has zero runtime dependencies.

Use the official install command:

dsh plugin --profile <your-profile> add dsh-incident-timeline

You can also install directly from GitHub:

dsh plugin --profile <your-profile> add github:dingchenhui0618-arch/dsh-incident-timeline

Once installed, an “Incident Timeline” tab appears in the conversation view. The first time the panel is opened, it scans $DSH_HOME/sessions; subsequent opens use a 30-second freshness cache. Click “Rescan” to force a refresh.

Core Features

The plugin scans session files under $DSH_HOME/sessions (session.v*.jsonl.zstd / .jsonl), decompresses frame by frame, parses the JSONL, identifies the three incident labels, and writes them into the projection database projection.db. The only write target is the plugin’s own projection database (WAL mode); session files are strictly read-only. Tests verify the SHA-256 hash, mtime, and directory contents of session files before and after synchronization.

The CLI tool supports exporting to Markdown or JSON:

# All time, output Markdown
node bin/incident-timeline.mjs scan --out incident.md

# A single day, approval rejections only
node bin/incident-timeline.mjs scan \
  --since 2026-11-16T00:00:00Z --until 2026-11-17T00:00:00Z \
  --kind user-rejected --out rejected.md

# Machine-readable
node bin/incident-timeline.mjs scan --format json --quiet > timeline.json

Common parameters include:

  • --sessions-root <dir>: Session root directory (default $DSH_HOME/sessions)
  • --db <file>: Projection database path (default $DSH_HOME/incident-timeline/projection.db)
  • --out <file>: Output file; defaults to stdout
  • --format md\|json: Output format
  • --since / --until: ISO timestamp or millisecond epoch, inclusive range
  • --kind: Comma-separated list of the three labels
  • --session: Filter to a specific session
  • --limit: Maximum number of entries to export (1..5000)
  • --max-session-mb: Size cap for a single compressed session (default 64 MB)
  • --force / --prune / --no-sync / --quiet: Sync control flags

The Markdown output columns are fixed as follows:

| Label | Session ID | Step No. | Original Log Line No. | Time (UTC) | Object | Excerpt |

The line number is the physical line number in the decompressed JSONL (blank lines also consume a line number), not the seq value. The JSON export retains seq, turn, step, and detail for downstream processing.

HTTP Routes

The plugin exposes fenced routes under the prefix /dsh-incident-timeline. It shares the same browser-trust barrier as DSH’s own /api: non-local Host/Origin requests receive 403, and requests without a valid browser session cookie receive 401.

Common routes:

  • GET /state?since=&until=&kinds=&session=&limit=: Panel data (events, counts, session list, last sync time)
  • POST /sync: Force a full rescan
  • GET /export?format=md\|json&...: Export; download=1 adds attachment headers
  • GET /preview: Standalone preview page without the plugin (same CSS/API as the panel)

Example:

curl -b 'dsh-auth-XXXXXXXXXXXXXXXX=v1.…' \
  'http://127.0.0.1:3080/dsh-incident-timeline/export?format=md&since=2026-11-16T00:00:00Z'

The stats field in /state returns counts for the entire time window; events is bounded by limit, so even when the list is truncated, the total count remains accurate.

Use Cases & Caveats

This plugin is well suited for scenarios where you need to quickly locate three types of incidents (approval rejections, plugin/tool errors, runtime HTTP failures) in session logs and aggregate them chronologically—for example, incident post-mortems, log audits, and root-cause analysis.

Please keep the following in mind:

  • The plugin runs with the current DSH process permissions. Review the source code and license (MIT) before installing.
  • It only performs evidence aggregation; it does not prevent malicious code execution nor replace approval workflows.
  • Classification is heuristic: plugin-error covers tool/plugin/hook/model-stream errors; runtime-http matches only explicit HTTP/status shapes.
  • Oversized sessions are skipped (default threshold 64 MB); adjust with --max-session-mb.
  • Log rotation is not handled. Deleting a session retains its projection by default; use --prune to explicitly clean up.
  • Exports contain raw session content. Incident reports may include file paths, command output, or business data—review before sharing.

Summary

Building on the session projection layer provided by DRSC, dsh-incident-timeline adds three incident labels and citation export with physical line numbers, allowing DSH users to clearly see “who rejected, where the error occurred, and which endpoint failed,” and to jump quickly to the original log line. It does not replace general-purpose retrieval but focuses on the incident-review layer, and can coexist with DRSC.

  • Plugin directory: https://www.skillhub.cn/plugins/dingchenhui0618-arch/dsh-incident-timeline
  • GitHub repository: https://github.com/dingchenhui0618-arch/dsh-incident-timeline
羽毛球分组比赛记分
小程序二维码

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

Xiaoye