すべてのプラグイン

dsh-session-eval

dsh-session-eval · バージョン 0.5.0 · 2026/11/29 更新

プラグイン、プロンプト、モデルの変更後にエージェントの性能が上がったか下がったかを確認できます。固定の閾値で過去のセッションを採点し、セッション間で比較します。テストセットを作ったりセッションを再実行したりせず、結果を再現できます。

  • バージョンごとに審査
  • セッションとメッセージ
  • MIT
  • 0回ダウンロード

説明

以下はプラグイン作者による原文です。

dsh-session-eval

English | 中文

npm npm downloads tests license

Retrospective evaluation for DeepSeek Harness agent sessions — deterministic grade cards computed from sessions that already happened, plus cross-session regression diffs that answer "did my agent get better or worse after that plugin / prompt / model change?"

No benchmark suites to author. No LLM judges. No new runs. Every grade is a fixed, documented threshold over persisted session logs — fully reproducible.

Install

Requirements: Node.js 20 or 22 · a DeepSeek Harness profile that mounts the commands and sessionQuery services (the shipped web / agent profiles qualify).

sole plugin --profile web add dsh-session-eval

Or from GitHub:

sole plugin --profile web add github:kittimzhe/dsh-session-eval

The bundle overlay mounts /eval, /eval-diff, /eval-history, and /eval-baseline. If you maintain your own cordis.patch.yml, keep this row:

- insert:
    - id: session-eval
      name: 'dsh-session-eval'

Try it once

In DeepSeek Harness:

/eval
Session eval — a1b2c3d4… (dsh-session-eval v0.4.3)
Overall: A
  Reliability   A    2/87 tool results errored (2.3%)
  Re-ask        A    1 re-ask signal(s) over 23 turns (0.4/10 turns)
  Tool load     B    3.8 tool calls per turn
Notes:
  • Wall time 41.2 min over 23 turns.

The measurement layer of the session toolchain

PluginLayerAnswers
dsh-session-exportEvidence"What exactly happened in this session?"
dsh-session-recallMemory"What did I do before, and where is it?"
dsh-session-evalMeasurement"Was that session good? Is the trend improving?"

All three read through the same trusted ctx.sessionQuery seam, so any persistence backend (JSONL or SQLite) works without touching raw artifacts.

Evidence-handoff closure (#8)

/eval --report grades straight from an artifact dsh-session-export already wrote — no session id to copy, and it works after the session is gone from the store:

recall "resume template font"
→ session session-ca62e005-… · report /proj/dsh-transcripts/bundle-ca62e005-20261104-120000.zip

/eval --report /proj/dsh-transcripts/bundle-ca62e005-20261104-120000.zip

Bundle ZIPs (the nested archive.zip raw JSONL) and raw /archive ZIPs are both accepted. The JSONL inside is the canonical event log — the same bytes readSession returns — so --report grades identically to /eval --id (verified by a round-trip test against the real dsh-session-export writer). --id and --report are mutually exclusive.

Baselines & format guardrails

/eval-baseline pins grade cards per workspace and compares later sessions against them:

/eval-baseline set            # grade the current session, save it as the baseline
/eval-baseline compare        # grade the current session, diff vs the latest baseline
/eval-baseline list 10        # newest-first list of saved records (default 5)
/eval-baseline clear          # delete the store (prints how many records it removed)

set and compare accept --id <sessionId> to grade another session, with the same default-to-current-session semantics as /eval. Records live in <session cwd>/.dsh-evals/baseline.jsonl — one JSON line per record, append-only. Each record carries the timestamp, session id, full metrics, the complete grade card, the generator version (dsh-session-eval v…), the session format version, and a fingerprint of the grade bands that were active when it was written (sha256 over version + bands, 16 hex — a gradeBands config change is therefore visible to compare). The store is read defensively: unparseable lines are skipped and counted, never fatal.

compare reuses /eval-diff's noise-tolerant comparison, so a ±2pp error-rate wiggle is flat, not a regression; per-dimension verdicts come with the signed delta against the baseline (percentage points for Reliability, raw metric units for the others).

Three guardrails keep the numbers honest:

  • Version stamping: /eval --json and --id outputs carry a top-level sessionFormatVersion read from the session header (null when unavailable — including every --report grade, since an archived JSONL has no header).
  • Zero-projection warning: when a raw log has events but none of them project into the evaluation vocabulary, the card says so — "Projected 0 events from a non-empty log; session format may have drifted from what this version understands" — instead of silently grading zeros.
  • Cross-version comparison warning: /eval-baseline compare prints "baseline recorded under …, current …; comparison crosses versions" before its verdict whenever the recorded generator version, bands fingerprint, or session format version differs from the current run — the comparison still runs, but you can't mistake it for an apples-to-apples one.

Contributing

  • Local dev: npm ci && npm run typecheck && npm test && npm run bundle (Node 20 or 22).
  • Start in the source: src/grade.ts (thresholds, grade cards), src/metrics.ts (metric extraction), src/trend.ts (/eval-history trend logic). See CONTRIBUTING.md for the source map and first-PR suggestions.
  • Open gaps: #1 (configurable thresholds) and #2 (/eval-history --since) shipped in v0.3.0 — browse issues labeled good first issue.
  • Rules: behavior changes need tests; doc changes must update README.md and README.zh.md in sync; version releases belong to the maintainer. Details: CONTRIBUTING.md.

How it differs from benchmark-style evaluation

dsh-eval (benchmark)dsh-session-eval (this)
EvaluatesRuns you launch ahead of timeSessions that already happened
SetupAuthor benchmark YAML + casesNone — read existing logs
JudgeMetric folding over trialsFixed thresholds, deterministic
Best atPre-deploy benchmarksRegression tracking over real work

Both are useful; they don't compete. Benchmarks test what you predicted; retrospective evaluation watches what actually happened.

Commands

CommandEffect
/evalGrade card for the current session
/eval --id <sessionId>Grade a specific session
/eval --report <bundle-or-archive.zip>Grade from an exported artifact (works after the session is gone from the store)
/eval --jsonMachine-readable metrics + card, with sessionFormatVersion
/eval-diff <beforeId> <afterId>Regression comparison, noise-tolerant
/eval-diff … --jsonMachine-readable trend report
/eval-history [N]Grade the last N sessions in this workspace and show the trend
/eval-history … --jsonMachine-readable history report
/eval-history --since 7dGrade only sessions with activity inside the window (24h, 30d also parse)
/eval-baseline set [--id <sessionId>]Save the current (or given) session's grade card as this workspace's baseline
/eval-baseline compare [--id <sessionId>]Diff the current (or given) session against the latest baseline, with signed deltas
/eval-baseline list [N]List the last N baseline records, newest first (default 5)
/eval-baseline clearDelete the baseline store, reporting how many records it removed

--since filters by each session's latest activity, not its creation time: a session opened long ago but active an hour ago stays in the window; a freshly created but silent one drops out. With --since 7d the trend compares the first and last of the in-window set, and an empty window prints a clear message instead of a crash. Without the flag, behavior is exactly as before (last N sessions).

Use /eval-history --out report.md to save the terminal card as Markdown, or add --json to save the JSON payload. Relative paths resolve against the current session workspace (the process working directory when unavailable). Parent directories must already exist; file errors are reported without creating directories. Existing output files are overwritten.

/eval-history finds the sessions for you via the same sessionQuery seam /archive uses (scoped to the current workspace's cwd), grades each, and diffs the first against the last. /eval-diff remains the tool when you already know the two ids that matter.

Configuring grade bands

The thresholds are defaults, not laws. A gradeBands block under the plugin's config node (naturally per-profile) overrides any dimension — values are the A–D upper bounds, ascending:

session-eval:
  gradeBands:
    reliability: [4, 8, 15, 30]   # tool error-rate percent
    reask: [0, 2, 4, 8]           # corrections per 10 user turns
    toolLoad: [0.1, 0.5, 8, 20]   # tool calls per turn: [lowC, lowB, highC, highD]

Any subset may be overridden; unlisted dimensions keep the documented defaults. Unknown keys, wrong arity, non-numeric, negative, or non-ascending values fail fast at plugin load with a readable error — sessions are never graded against bands nobody chose.

Typical use: grade the ten sessions before and after a plugin or prompt change; a persistent Reliability regression is an early warning that the change hurt real work, not just benchmarks.

Dimensions & thresholds

All grades derive from three deterministic metrics. n/a when the session lacks the relevant activity.

DimensionMetricABCDE
Reliabilitytool error rate≤5%≤10%≤20%≤35%>35%
Re-askcorrections per 10 turns¹0≤1≤2≤4>4
Tool loadtool calls per turn0.5–80.1–0.5 or just above 8<0.1 or 8–20>20—

¹ A correction signal is each extra user message inside a consecutive-user run — the human re-asking before any assistant reply, a behavioral proxy for "the agent didn't get it right the first time."

Overall is the worst graded dimension — conservative by design. Thresholds are constants in src/grade.ts; making them configurable is on the roadmap (see issues).

Diff verdicts include a noise band (±2pp error rate, ±0.5 re-ask, ±1 tool load) so trivial jitter doesn't cry regression.

Determinism guarantee

Same session logs in → same grade card out, every time, forever. There is no model in the loop, no sampling, no clock dependence in the metrics (wall time is reported, never graded). This is what makes /eval-diff trustworthy as a regression signal.

Development

npm ci
npm run typecheck   # tsc --noEmit
npm test            # vitest run
npm run bundle      # tsdown → lib/

License

MIT

Community

バージョン履歴

  • 0.5.02026/11/29 · 85 KB