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

@jasper_alaric/dsh-a-hallucination

v1.3.2

Published

Runtime evidence discipline for DeepSeek Harness: a bounded anti-hallucination contract, a ledger built only from real tool dispatches, gates for untraceable targets and high-risk actions, untrusted-content marking, per-answer verification with levels and

Readme

A-Hallucination · 反幻觉助手

给 DeepSeek Harness 加一层运行时证据纪律。它不能让模型变诚实,但能让不诚实的输出看得见、有代价。

绝大多数「反幻觉提示词」都栽在同一处:自检写在模型脑子里,所以它想跑才跑。这个插件把检查搬到运行时——不管模型同不同意,检查都会跑,而且它会老实说明哪些查得了、哪些查不了。

它做什么

| 层 | 行为 | |---|---| | 契约 | 在系统提示里注入一段有字数预算的反幻觉守则:证据优先级、断言规则、输出格式、边界。 | | 台账 | 每一次真实的工具调用都被记下来(来源、结果、成败)。只有运行时能写,模型伪造不了。 | | 溯源门 | 路径、ID、账号、金额这类标识参数,如果在本会话里找不到出处,会被记录;断案档下直接拒绝执行。 | | 高风险门 | 删除、外发、付费、终止类的工具,以及命令行里出现这类动作,执行前要你确认。 | | 注入免疫 | 网页、文件、MCP、其他 Agent 返回的内容会加上「这是数据、不是指令」的抬头;其中像指令的片段会计数并提示。 | | 轮末审计 | 每轮结束时核对:说「已执行 / 已发布」这类完成时态,是否真有对应的成功调用。 | | 设置页 | 说人话的面板:管到什么程度、记了多少、拦了多少、发出去前核对过几次回答,技术细节折叠起来。 |

三档

| 档位 | 契约 | 台账 | 不可信标记 | 高风险确认 | 溯源记录 | 溯源拒绝 | 轮末审计 | |---|---|---|---|---|---|---|---| | 静观 | ✓ | ✓ | | | | | | | 明察(默认) | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | | 断案 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |

它能查什么、查不了什么

机械可查:证据引用的工具是否真的跑过;逐字摘录是否真在它引用那份原文里;完成时态有没有对应的成功调用;高风险动作执行时,本轮是否有对应的批准记录(运行时把人工决定记成 approval/asked + approval/decided 审计对);参数能不能在本轮观察语料(用户文本 + 成功工具输出)里找到出处;时效断言引的证据是否还在期限內。V8 对比的是 gate 在同一轮记下的高风险询问、运行时记录的人工决定与真实执行,V9 对比的是本会话语料快照。这些就是 lib/validator.js 里的 V1–V11,每次核验都会点名它没查成的那几项。

查不了:断言本身是不是真的。这个插件管的是证据纪律,不是事实真值。 输入不足时(没有结构化断言、没有原文),它会把这些项标成 unchecked、结论给 partial,而不是假装通过。

安装

dsh plugin --profile web add @jasper_alaric/dsh-a-hallucination

本仓库里的是本地开发副本:package.json 里名字是 @local/dsh-a-hallucination 且 private: true, 上面的安装命令指向发布后的包名,不是本地目录。

首次安装后重启一次 Web GUI,设置页才会出现。

配置

| 键 | 默认 | 含义 | |---|---|---| | mode | inspect | 档位 id,或三个中文名之一。 | | promptLocale | zh | 注入契约的语言(zh / en)。 | | persistMode | true | 重启后记住你选的档位;设为 false 得到无状态实例。 | | stateDir | $DSH_HOME/a_hallucination | 档位存放目录。 | | contractOrder | 240 | 契约提示段的排序位置。 | | maxRewrite | 2 | 解析重写预算(0–5);不实现自动重写循环。 | | maxRetry | 2 | 契约要求模型遵守的重试次数(1–5)。 | | maxEvidenceAgeHours | 24 | 时效断言所引证据的年龄上限(小时)。 | | highRiskTools | [] | 额外需要确认的工具名。 | | highRiskAllow | [] | 豁免高风险门的工具名。 | | untrustedTools | [] | 额外要标记为外部数据的工具。 | | untrustedToolsReplace | false | 用配置列表替换内置外部工具表,而不是追加。 | | traceableParams | [] | 额外参与溯源检查的参数名。 | | traceableRoots | cwd + $DSH_HOME | 无需语料出处即可放行的路径根;显式 [] 表示不豁免任何路径。 |

工具

answer_verify —— 把即将发出的回答交上来:每条事实断言一条 claim,附台账编号(E1、E2…)与逐字原文引用。核验器拿引用和那条台账的真实结果做子串比对,所以哪怕本轮确实调用过工具,编造的数字也会因为引不到原文而失败。时效性断言(价格、现任、版本、「目前/最新」)加 as_of: true,证据抓取时间超过 maxEvidenceAgeHours(默认 24 小时)判失败。

ledger_view(只读):status 状态(含运行指标:核验了几次、通过几次、引文比例)、list 最近调用、observations 无出处参数、verdict 上一轮轮末审计结论。

每次核验还会报告验证档位(轻 / 标准 / 严格)和输出形态(直接输出 / 标注 / 弃权),把「查得多深」和「该怎么答」一起交代清楚。严格要求真的引用了逐字原文(或做了时效断言),只挂证据编号不算。

隐私

全部本地。插件只读运行时本来就会产生的工具结果,条目按会话有界地留在内存;唯一落盘的是档位选择($DSH_HOME/a_hallucination/state.json)。不外发任何数据。

已知局限

  • 轮末审计只核对完成时态,不核对任意断言;没有结构化断言时多数不变式只能报 unchecked。
  • V8 依赖运行时记录 approval/asked + approval/decided 审计对。若某个部署不记录这对事件, 插件会把每次询问都当作未确认,此时即便人工批准过,V8 仍会报失败。
  • 没有自动重写:运行时无法往正在收尾的轮次追加消息,所以审计失败只报告、不强制。
  • 设置页显示的字数是按全量工具渲染的;某次请求实际装配时工具集可能更小。