npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-session-eval

v0.4.1

Published

Retrospective agent-session evaluation for DeepSeek Harness: deterministic grade cards from persisted session logs, cross-session regression diffs, era comparison — no benchmark runs, no LLM judges.

Readme

dsh-session-eval

English | 中文

npm npm downloads tests license

DeepSeek Harness 会话的回溯式评测:对已经发生的会话做确定性等级评定,跨会话回归对比,回答"换了插件 / prompt / 模型之后,我的 agent 是变好了还是变差了?"

不需要编写基准测试集,没有 LLM 裁判,不需要跑新任务。所有等级 = 持久化会话日志上的固定公开阈值——完全可复现。

安装

环境要求:Node.js 20 或 22 · 挂载了 commands 与 sessionQuery 服务的 DeepSeek Harness profile(官方 web / agent profile 均满足)。

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

或从 GitHub:

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

bundle 覆盖层会挂上 /eval、/eval-diff、/eval-history。若你维护自己的 cordis.patch.yml,请保留这一行:

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

试一次

在 DeepSeek Harness 里:

/eval
Session eval — a1b2c3d4… (dsh-session-eval v0.2.2)
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.

会话工具链的评测层

| 插件 | 层 | 回答的问题 | |---|---|---| | dsh-session-export | 证据层 | "这个会话到底发生了什么?" | | dsh-session-recall | 记忆层 | "我以前做过什么,在哪?" | | dsh-session-eval | 评测层 | "刚才的会话好不好?趋势在变好吗?" |

三者都通过同一个可信的 ctx.sessionQuery 缝读取,JSONL / SQLite 等任何持久化后端均可使用。

证据联动闭环(#8)

/eval --report 直接从 dsh-session-export 已写出的产物评分——不用抄会话 id,会话从存储中删除后依然可评:

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 ZIP(内嵌 archive.zip 原始 JSONL)与裸 /archive ZIP。里面的 JSONL 就是权威事件日志——与 readSession 返回的是同一份字节——所以 --report 与 /eval --id 评分完全一致(用真实 dsh-session-export 写入器做过往返测试)。--id 与 --report 互斥。

贡献

  • 本地开发:npm ci && npm run typecheck && npm test && npm run bundle(Node 20 或 22)。
  • 源码入口:src/grade.ts(阈值与等级卡)、src/metrics.ts(指标提取)、src/trend.ts(/eval-history 趋势逻辑)。源码地图与第一次 PR 建议见 CONTRIBUTING.md。
  • 当前缺口:#1(阈值可配置)与 #2(/eval-history --since)已在 v0.3.0 落地——或浏览 good first issue 标签。
  • 规矩:行为变更必须带测试;文档必须 README.md 与 README.zh.md 同步改;版本发布由维护者执行。详见 CONTRIBUTING.md。

与基准式评测(dsh-eval)的区别

| | dsh-eval(基准) | dsh-session-eval(本插件) | |---|---|---| | 评什么 | 预先发起的运行 | 已经发生的会话 | | 准备 | 编写基准 YAML + 用例 | 零——直接读存量日志 | | 裁判 | 跨 trial 的指标折叠 | 固定阈值,确定性 | | 擅长 | 上线前基准 | 真实工作的回归追踪 |

两者互补而非竞争:基准测你预测到的场景,回溯评测看实际发生的工作。

命令

| 命令 | 效果 | |---|---| | /eval | 当前会话等级卡 | | /eval --id <会话ID> | 指定会话 | | /eval --json | 机器可读指标 + 等级卡 | | /eval-diff <前ID> <后ID> | 回归对比(带噪声带) | | /eval-diff … --json | 机器可读趋势报告 | | /eval-history [N] | 本工作区最近 N 个会话成绩单 + 首末趋势 | | /eval-history … --json | 机器可读历史报告 | | /eval-history --since 7d | 只评窗口内有活动的会话(也支持 24h、30d) |

--since 按最新活动时间过滤,而非创建时间:很久前打开但一小时前还活跃的会话留在窗口内;刚创建但一直沉默的会被排除。--since 7d 下趋势对比的是窗口内首末两个会话;窗口为空时打印明确提示而不是崩溃。不加该参数时行为与从前完全一致(最近 N 个)。

使用 /eval-history --out report.md 将终端卡片保存为 Markdown,添加 --json 则保存 JSON。相对路径基于当前会话工作目录(缺失时使用进程工作目录)。父目录必须已存在;写入失败会返回错误,不会创建目录。已存在的输出文件会被覆盖。

/eval-history 通过与 /archive 相同的 sessionQuery 接缝自动找到会话(按当前工作区 cwd 过滤),逐个评级,并把首尾两个会话做趋势对比——不用再手动挑 id。已经知道两个关键 id 时用 /eval-diff。

典型用法:换插件或 prompt 前后各评十个会话;Reliability 持续回归 = 改动伤害了真实工作的早期预警。

配置等级阈值

阈值是默认值而非铁律。在插件配置节点下(天然按 profile 区分)加 gradeBands 块即可覆盖任意维度——值为 A–D 各档上限、升序:

session-eval:
  gradeBands:
    reliability: [4, 8, 15, 30]   # 工具错误率百分比
    reask: [0, 2, 4, 8]           # 每 10 个用户轮次的纠错次数
    toolLoad: [0.1, 0.5, 8, 20]   # 每轮工具调用数:[lowC, lowB, highC, highD]

可只覆盖部分维度;未列出的保持文档默认值。未知键、元素个数不对、非数字、负数或非升序,都会在插件加载时以可读错误快速失败——绝不会对着没人选过的阈值评级。

维度与阈值(确定性,无裁判)

| 维度 | 指标 | A | B | C | D | E | |---|---|---|---|---|---|---| | Reliability | 工具错误率 | ≤5% | ≤10% | ≤20% | ≤35% | >35% | | Re-ask | 每 10 轮纠正信号¹ | 0 | <1 | <2 | <4 | ≥4 | | Tool load | 每轮工具调用 | 0.5–8 | 0.1–0.5 | <0.1 或 8–20 | >20 | — |

¹ 纠正信号 = 连续用户消息中多出的那条(agent 还没回复用户就重问)——"第一次没做对"的行为学代理指标。

总评 = 最差维度(保守设计)。阈值是 src/grade.ts 中的常量;可配置化在路线图上(见 issue)。

Diff 判定带噪声带(错误率 ±2pp、Re-ask ±0.5、工具负载 ±1),微小抖动不会误报回归。

确定性保证

同样的日志进 → 同样的等级出。没有模型在环、没有采样、指标不含时钟依赖(wall time 只报告不评级)。这是 /eval-diff 能作为回归信号被信任的原因。

开发

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

许可

MIT

社区