Repository navigation
Releases: huanlin-labs/dsh-isolation-gate
Releases · huanlin-labs/dsh-isolation-gate
Release list
v1.13.9 - D 段四项(临时授权 / 审计统计 / 拒绝提示 / 子目录粒度)
1.13.9 — 2026-11-04
- 新增
gate grant <名字> --for 30m [--level full](临时授权,D-1):把某个受管对象临时调到指定级别,到期自动回落到授权前的级别——不需要任何后台进程,靠读取时惰性判定(expiresAt+baseLevel存在状态文件里)。配套gate grant --list(看剩多少分钟)与gate grant <名字> --revoke(立刻撤销)。手改级别(set)会清掉临时授权,避免"以为撤了其实还挂着"。 - 新增回归套件
test/run-grant.mjs(14 项断言:非法时长、授权期内放行、到期自动拒、撤销回原级、无授权时撤销报错),全量 19/19 套件通过。 - 新增
gate stats [--days 7] [--top 10](审计统计,D-2):一条命令看清"放行/拒绝比例、最常被碰的对象、操作分布、通道分布、按天趋势"。只读——不写、不改、不删审计日志(有测试逐字节校验)。--json给机器用,人类输出带拒绝率。 - 新增回归套件
test/run-stats.mjs(14 项断言:计数口径、--days时间窗、人类输出关键字段、只读不改文件、空日志不报错),全量 20/20 套件通过。 - 拒绝提示可操作(D-3):每条拒绝不再只说"不行",而是直接给出能照抄执行的下一步——①
gate grant --name "X" --for 10m --level read(临时放开,到期自动回原级别)② GUI「门禁」里拨开关(长期)③gate status/gate stats自查。名单不可用时另给恢复指引(名单格式 + 改完不必重启 dsh)。级别不够(只读却要写/删)时提示的--level自动变成full。 - 新增回归套件
test/run-deny-hint.mjs(12 项断言:禁级提示、只读做删除提示、名单不可用提示),全量 21/21 套件通过。 - 子目录粒度(D-4):新增
gate set --path "<目录>" --level deny|read|full(也支持--name)。受管父目录下可以只把某个子目录放开到可读写删、或单独收紧为禁——判定按路径段最长前缀命中,子目录规则覆盖父目录(同级不叠加),且父目录其余部分不受影响。该命令会自动把路径补进名单(先 deny 再设级),无需手改名单。 - 新增回归套件
test/run-subdir.mjs(13 项断言:父只读+子 full、父写仍拒、子写放行、未设置子目录仍拒、子目录收紧后父仍只读、非法级别/缺目标报错),全量 22/22 套件通过。
v1.13.0 - 第一个公开里程碑
门禁 1.13.0 · 第一个公开里程碑
给 AI 用的「隔离区授权台」:默认禁 + 名单制 + 点一下生效 + 可审计 + agent 自己能查。
三分钟上手
npx dsh-isolation-gate doctor --fix # 接线 7 个 harness
npx dsh-isolation-gate doctor # 复查,应为 7/7
npx dsh-isolation-gate ui # 打开本机设置页,点开关改级别
这一版包含什么
- 三档级别:
deny/read/full,最长前缀优先 - 两种对象:盘根一级目录(如
Zcode)或任意绝对路径 - 两道闸:受管 CLI
gate+ 宿主ctx.tools.guard()工具前置拦截 - 7 个 harness 接线:Claude Code / ZCode / pi / Gemini CLI / opencode / Codex / MCP
- 可审计:每次判定落 JSONL;
gate log直接看 - agent 自查:
gate status/gate check/gate policy
验证(不是自吹)
| 项 | 结果 |
|---|---|
| 本机测试套件 | 15/15 通过 |
npm run verify:install |
打包 → 空目录真装 → 0/7 → 7/7 → 复查 7/7 |
| CI | Ubuntu / macOS / Windows × Node 20/22/24 |
| 作者机实测 | profile link 装本仓源码;真实拦下过调用;doctor 7/7 |
细节:docs/EXAMPLES.md(一页走通)、docs/VERIFY.md(逐项状态)。
诚实说明
- Codex / Cursor / Windsurf 只能走 MCP = 提示级,不能硬拦
- opencode / Gemini 接线已实现并通过单测,未在登录态下跑完整会话
- 只支持 DSH 宿主;不声称兼容未验证的版本
v1.12.11 - prepublish guard
v1.12.11
prepublish-check.mjs+prepublishOnly: refuses to publish unless version matcheslib/index.js, CHANGELOG has the entry, every README image exists, and the tree actually differs from the previous tag (staged or committed).- Trigger: 1.12.9 shipped a no-op change because a regex silently missed.
v1.12.10 - banner dedupe fix
v1.12.10
- Remove the leftover duplicate SVG banner (1.12.9 regex missed the full-width text). Verified: README now references exactly one banner.
v1.12.8 - one-page walkthrough
v1.12.8
- docs/EXAMPLES.md: real captured output for install, wiring, three levels, denial text, troubleshooting.
- Corrected the doc: level changes go through
gate ui(there is nosetcommand).
v1.12.7 - install verification
v1.12.7
npm run verify:install: pack the repo, install the tarball in a clean temp dir, then rundoctor(expect 0/7) →doctor --fix(7/7) → re-check (7/7).- CI runs it on Ubuntu / macOS / Windows.
v1.12.4 - POSIX root fix
v1.12.4
- fix: POSIX root separator in
listRootDirs(macOS/Linux were building/tmp\) - CI now runs the data-layer suite on all three OS
v1.12.3 - verify:publish
v1.12.3
npm run verify:publish: poll the registry raw JSON until the version appears (prevents silent publish failures)- v1.12.1 release marked prerelease: it never reached npm
v1.12.2 - doctor --json
v1.12.2
doctor --json: machine-readable wiring report for CI- version noted: 1.12.1 never reached the registry; this release is the first to carry its fixes