pi-verdict 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,12 +6,12 @@
6
6
  [![npm](https://img.shields.io/npm/v/pi-verdict)](https://www.npmjs.com/package/pi-verdict)
7
7
  [![pi extension](https://img.shields.io/badge/pi-extension-blueviolet)](https://pi.dev)
8
8
 
9
- **pi-verdict is a permission gate for [pi](https://pi.dev) in the style of Claude Code's auto mode: every tool call gets checked before it runs — allow, deny, or ask you first.**
9
+ **pi-verdict is a minimal permission gate for [pi](https://pi.dev) in the style of Claude Code's auto mode: every tool call gets checked before it runs — allow, deny, or ask you first.**
10
10
 
11
+ - Minimal — just a few hundred lines of code
11
12
  - Built-in danger rules and your own allow/deny rules settle the clear cases first, at zero latency
12
13
  - Everything else goes to a model classifier that sees the conversation context
13
14
  - Any uncertainty or failure fails closed; nothing ever runs silently
14
- - Minimal — just a few hundred lines of code
15
15
 
16
16
  ## The problem
17
17
 
@@ -48,7 +48,7 @@ pi --extension ./extensions/auto-mode.ts
48
48
  | `PI_AUTO_MODE_MODEL` | — | env form of the model flag |
49
49
  | `PI_AUTO_MODE_DEBUG=1` | off | env form of debug (flag wins) |
50
50
 
51
- ### User rules (`config/pi-verdict.json`)
51
+ ### User rules (`~/.pi/agent/config/pi-verdict.json`)
52
52
 
53
53
  ```json
54
54
  {
@@ -68,7 +68,7 @@ pi --extension ./extensions/auto-mode.ts
68
68
  - `toggleShortcut` rebinds the master-switch toggle key (any pi key combo, e.g. `ctrl+shift+x`; `null` or empty disables the shortcut; an invalid combo warns once at session start and skips registration). The toggle is semantically identical to `/automode on|off` — works mid-run, no confirmation, never persisted (persistence stays with the `--no-auto-mode` flag; the extension never writes its own protected config)
69
69
  - first run generates a template at `~/.pi/agent/config/pi-verdict.json` (honors `PI_CODING_AGENT_DIR`); changes apply to new sessions
70
70
 
71
- Why no built-in allowlist? Bypass testing of the rule layer ([writeup](research/rule-layer-security-audit.md)) showed that allowlist soundness requires shell AST analysis — every built-in "always allow" would be a security claim maintained by the author. The built-in layer only makes **deny** claims (the sound direction); allow claims are yours.
71
+ **Why no built-in allowlist?** Bypass testing of the rule layer ([writeup](research/rule-layer-security-audit.md)) showed that allowlist soundness requires shell AST analysis — every built-in "always allow" would be a security claim maintained by the author. The built-in layer only makes **deny** claims (the sound direction); allow claims are yours.
72
72
 
73
73
  ### Self-protection (the gate guards itself — [ADR-0001](docs/adr/0001-self-protection-layer.md))
74
74
 
package/README.zh-CN.md CHANGED
@@ -6,12 +6,12 @@
6
6
  [![npm](https://img.shields.io/npm/v/pi-verdict)](https://www.npmjs.com/package/pi-verdict)
7
7
  [![pi extension](https://img.shields.io/badge/pi-extension-blueviolet)](https://pi.dev)
8
8
 
9
- **pi-verdict 是 [pi](https://pi.dev) 的 Claude Code 的 Auto mode 式的权限门禁:每次工具调用执行前先过检查——放行、拦截,或先问你。**
9
+ **pi-verdict 是 [pi](https://pi.dev) 的 Claude Code 的 Auto mode 式的极简权限门禁:每次工具调用执行前先过检查——放行、拦截,或先问你。**
10
10
 
11
+ - 只有几百行的极简代码
11
12
  - 内置危险规则与你的 allow/deny 规则以零延迟先行裁决明确情形
12
13
  - 其余交给携带会话上下文的模型分类器
13
14
  - 任何不确定或失败一律 fail-closed, 绝不静默放行
14
- - 只有几百行的极简代码
15
15
 
16
16
  ## 问题
17
17
 
@@ -48,7 +48,7 @@ pi --extension ./extensions/auto-mode.ts
48
48
  | `PI_AUTO_MODE_MODEL` | — | 模型配置的环境变量形式 |
49
49
  | `PI_AUTO_MODE_DEBUG=1` | 关 | 调试的环境变量形式(flag 优先) |
50
50
 
51
- ### 用户自定义规则(`config/pi-verdict.json`)
51
+ ### 用户自定义规则(`~/.pi/agent/config/pi-verdict.json`)
52
52
 
53
53
  ```json
54
54
  {
@@ -68,7 +68,7 @@ pi --extension ./extensions/auto-mode.ts
68
68
  - `toggleShortcut` 重绑主开关快捷键(任意 pi 键组合,如 `ctrl+shift+x`;`null` 或空串禁用;非法组合在会话启动时一次性警告并跳过注册)。快捷键与 `/automode on|off` **语义等价**——运行中生效、无确认弹窗、不持久化(持久需求由 `--no-auto-mode` flag 承担;扩展运行时从不写自己的受保护配置)
69
69
  - 首次运行自动生成模板 `~/.pi/agent/config/pi-verdict.json`(尊重 `PI_CODING_AGENT_DIR`);修改后新会话生效
70
70
 
71
- 为什么没有内置白名单?对规则层的绕过测试(见 [`research/rule-layer-security-audit.md`](research/rule-layer-security-audit.md))证明白名单的健全性需要 shell AST 分析——每条内置「永远放行」都是作者维护的安全声明。因此内置层只做 **deny** 声明(方向健全),allow 声明归你。
71
+ **为什么没有内置白名单?**对规则层的绕过测试(见 [`research/rule-layer-security-audit.md`](research/rule-layer-security-audit.md))证明白名单的健全性需要 shell AST 分析——每条内置「永远放行」都是作者维护的安全声明。因此内置层只做 **deny** 声明(方向健全),allow 声明归你。
72
72
 
73
73
  ### 自保护(门禁守护自身——[ADR-0001](docs/adr/0001-self-protection-layer.md))
74
74
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-verdict",
3
- "version": "0.4.0",
4
- "description": "A permission gate for Pi in the style of Claude Code's auto mode",
3
+ "version": "0.4.1",
4
+ "description": "A minimal permission gate for Pi in the style of Claude Code's auto mode",
5
5
  "author": "Jesset (https://github.com/jesset)",
6
6
  "type": "module",
7
7
  "main": "extensions/auto-mode.ts",