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-tool-provenance

v0.2.1

Published

Provenance guard for agent actions: classify each proposed action's parameters by source (user-stated / derived / invented) before acting, based on the ProvenanceGuard (ASE 2026) parameter-provenance and underspecification checks.

Readme

dsh-tool-provenance

指令溯源审查插件。把 CMU ProvenanceGuard(ASE 2026, arXiv:2607.01236)的 step9 参数溯源 + step10 欠规范检查做成 硬闸门,防止"幻觉指令"。

事故背景

2026-11-12:用户只说"用 ComfyUI 做控制器",agent 脑补"画蓝色胖鱼"并出图。用户:"你是从哪看到的指令?"

架构(v0.2:硬闸门 + 三层防线)

v0.2 起插件在 tools/pre-execute 瀑布上装监听器——每次工具调用必经此处,模型绕不过(v0.1 只有模型自愿调用的软门,是审计指出的结构性缺陷):

agent 调用任何工具
  │
  ├─ 只读白名单(read/grep/glob/查询类/provenance 自身)
  │     → 直接放行,零延迟
  │
  └─ 可能改环境的动作(写文件/发消息/出图/安装/删除/花钱/改配置…)
        │
        ├─ 证据采集(harness 供数,模型无法粉饰)
        │     用户原话 ← 会话事件日志(source.kind=user 的文本块,最近 12 条)
        │     参数     ← 真实 exec.arguments(不是模型自报)
        │     工具历史 ← 之前 tool/call 事件(最近 10 条)
        │
        ├─ 1. 本地规则(纯 JS,不依赖模型)
        │     用户原话里有否定词("没有要求/脑补/否认")且参数值出现在否定句中 → 强制 red
        │
        ├─ 2. 独立检查者(3B 模型,≠ 执行者)
        │     没参与对话、没有"创作冲动",只看用户原话和参数
        │     路由:omlx/Qwen2.5-3B-Instruct-4bit(可配置)
        │     temperature=0 + few-shot 校准(判定 12/12 稳定)
        │     延迟 0.3-0.5s,内存 1.6GB(并发友好)
        │     调用:宿主 llm 服务 → HTTP 直连 omlx(回退)
        │
        └─ 3. 保守覆盖(代码层强制一致性)
              params 里有 invented 但 provenance 没标 red → 强制 red
              本地规则命中但模型说 green → 强制 red
              模型不可用 + 本地规则未命中 → "未审查"放行(显式标注)
              red → 拦截:ask(默认,用户拍板)或 deny(配置)

设计原则:宁可多问(false positive),不可漏拦(false negative)。最终拍板权永远在用户。

同时保留 provenance 工具:模型可主动预检(与闸门共享同一判定函数),只读动作不必调用。

配置(cordis.patch.yml)

- insert:
    - id: tool-provenance
      name: dsh-tool-provenance
      config:
        judgeProvider: omlx
        judgeModel: Qwen2.5-3B-Instruct-4bit
        redAction: ask          # red 时 ask(默认,用户拍板)或 deny(直接拦截)
        gateEnabled: true       # 硬闸门开关(false 退回纯软门)
        notifyPet: true         # red 时桌宠弹泡提醒(宠物不在线则静默跳过)
        petUrl: "http://127.0.0.1:58200"

文件

lib/index.js        插件主体(硬闸门 + 三层防线 + provenance 工具)
cordis.patch.yml    加载补丁
locale/en.json      英文界面文案
locale/zh.json      中文界面文案
icon.svg            图标
docs/DETAIL.md      详情页文档