dsh-context-truth 0.3.2 → 0.3.3
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/CHANGELOG.md +15 -0
- package/README-en.md +15 -0
- package/README.md +30 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
* **README 记入权限模型带来的限制。** 交接档在 `$DSH_HOME/handoffs/…`,而模型的文件写入受会话权限沙箱约束
|
|
6
|
+
(`@deepseek-ai/dsh-fs-sandbox` 的 `checkedTarget`):
|
|
7
|
+
- `read-only`:拒绝一切写入,模型写不了档,handoff 退化为“只提醒、折不了”,最后由宿主压力折叠接管;
|
|
8
|
+
- `workspace-write`:只允许写进会话工作区与系统临时目录,因此仅当工作区是 `$DSH_HOME` 的祖先时交接档才写得进去,
|
|
9
|
+
工作区在别处会被 `FS_SANDBOX_DENIED` 拒绝,插件按预算重试后交给宿主;
|
|
10
|
+
- 两个规避:`handoffDir` 指向工作区内的绝对路径,或指向 `%TEMP%` 下的目录。
|
|
11
|
+
- 另记一条独立门槛:**自动审查(`auto` 预设 = `danger-full-access` + `ask`)下写档会被审查模型判为 medium**
|
|
12
|
+
并通常拒绝(medium 要求“当前用户或直接父级明确授权”,而写档指令来自插件注入的 runtime context);
|
|
13
|
+
`ask` 下转为一次人工审批,`never` 下终局失败。注册窄写根对该模式无效。
|
|
14
|
+
- 推荐统一规避:`handoffDir` = `<工作区>/.dsh-handoffs`(工作区内写入在两种受限模式下都算项目内写入,
|
|
15
|
+
自动审查判 low、必须放行),并加进 `.gitignore`。
|
|
16
|
+
中英 README 各一节,未改代码。
|
|
17
|
+
|
|
3
18
|
## 0.3.2
|
|
4
19
|
|
|
5
20
|
* **注入行按模式说明真正的触发点。** 以前三种模式都只说"宿主自动压缩点 X"——在 `handoff` 下这是错的
|
package/README-en.md
CHANGED
|
@@ -108,6 +108,21 @@ The chain is:
|
|
|
108
108
|
|
|
109
109
|
Guards: at most 3 reminders per cycle; if a round ends past the prep point with no note registered, the plugin **wakes** a round with `followup` to deliver the reminder (dynamic context is only read by requests that actually happen, and a round that ends issues no further request, so the reminder would otherwise wait for a human — measured, and that is why the wake exists); notes are temporary, recycled when the next handoff is created with a 7-day sweep; a registered note whose fold did not happen is kept and never activates a turn.
|
|
110
110
|
|
|
111
|
+
**Known limitation: session permissions can block the note write.** Notes live under `$DSH_HOME/handoffs/…`, and the host sandboxes model file writes per session permission (`checkedTarget` in `@deepseek-ai/dsh-fs-sandbox`, which checks the target against the writable roots of the resolved mode):
|
|
112
|
+
|
|
113
|
+
- **read-only**: every mutation is denied, so the model cannot write the note at all; handoff mode degrades to "remind, but never fold" and the host pressure fold takes over;
|
|
114
|
+
- **workspace-write**: writes are allowed only under the **session workspace**, plus the platform temp areas (`/tmp`, `%TEMP%`). The note path is writable only when the workspace is an ancestor of `$DSH_HOME` (for example a workspace of `C:\Users\Admin`); with a workspace elsewhere (`D:\mod`) the write is rejected with `FS_SANDBOX_DENIED`, the plugin re-reminds within its budget and wakes once more at the round end, and then leaves the fold to host pressure;
|
|
115
|
+
- **danger-full-access**: unrestricted.
|
|
116
|
+
|
|
117
|
+
Workarounds, both profile configuration:
|
|
118
|
+
|
|
119
|
+
1. **The general one: point `handoffDir` at an absolute path inside the workspace** (recommended: `<workspace>/.dsh-handoffs`, added to `.gitignore`). A write inside the workspace counts as an ordinary project-local write in both restricted modes: `workspace-write` allows it, and auto review rates it low, which the policy says **must be allowed** — no human confirmation needed. The cost is that notes live in the workspace, contradicting the "never the workspace" default.
|
|
120
|
+
2. **Only for `workspace-write`: point `handoffDir` at the platform temp area** (for example `%TEMP%\dsh-handoffs`) — temp is always writable there and the repository stays clean, but auto review still treats it as a write outside the project.
|
|
121
|
+
|
|
122
|
+
**Auto review (the `auto` preset) adds a separate gate.** That preset is `sandbox: danger-full-access` + `approval: ask`: there is no path sandbox at all; instead **every native tool call is reviewed by the same model before it runs**. The review policy rates ordinary project-local reads and writes as low (must be allowed) and non-sensitive writes outside the project as medium, and medium is allowed **only when the current user or a direct parent explicitly authorizes that exact target and scope** — the write instruction comes from the plugin's injected runtime context, not from the user, so it is usually denied: under `approval: ask` the denial turns into one human approval (approve it and the write proceeds), under `never` it is final. Registering a narrow writable root for the session (`sandboxPolicy.registerWritableRoot`) **does not help auto review**: under `danger-full-access` the sandbox never consults writable roots, and the review policy has no "granted directory" tier.
|
|
123
|
+
|
|
124
|
+
The plugin does not write the note for the model (`handoff_ready` only validates it), so this is a capability boundary of the permission model, not a switch.
|
|
125
|
+
|
|
111
126
|
**Switching modes takes effect immediately, with no restart**: `foldMode` is volatile config, the settings card writes straight into the running reference, and the plugin resolves its options per use (verified live: after the panel switched to `handoff`, the running instance acted on it on its next call). Switching does **not** trigger a fold by itself — the fold still waits for the reading to reach the point.
|
|
112
127
|
|
|
113
128
|
## Data sources (all host-measured — nothing is estimated)
|
package/README.md
CHANGED
|
@@ -165,6 +165,36 @@ this in as few commands as possible, then a short answer."。数字它读对了
|
|
|
165
165
|
再发请求,提醒会一直等人类开口——实测踩过);交接档是临时文件,下一次交接生成时回收旧的、7 天兜底清理;
|
|
166
166
|
登记了档但没折成(引擎拒绝、被别的东西先折了)时不会激活,档保留。
|
|
167
167
|
|
|
168
|
+
**已知限制:会话权限能挡住交接档写入。** 交接档在 `$DSH_HOME/handoffs/…`,而宿主按会话权限给模型的文件写入设了沙箱
|
|
169
|
+
(`@deepseek-ai/dsh-fs-sandbox` 的 `checkedTarget`:按权限模式判断目标是否落在可写根内):
|
|
170
|
+
|
|
171
|
+
- **仅查看**(`read-only`):拒绝**一切**写入 —— 模型写不了档,handoff 模式退化为“只提醒、折不了”,
|
|
172
|
+
最后由宿主压力折叠接管;
|
|
173
|
+
- **工作区内修改**(`workspace-write`):只允许写进**会话工作区**,外加系统临时目录(`/tmp`、`%TEMP%`)。
|
|
174
|
+
因此只有工作区是 `$DSH_HOME` 的祖先(例如工作区就是 `C:\Users\Admin`)时才写得进去;工作区在别处
|
|
175
|
+
(例如 `D:\mod`)时会被 `FS_SANDBOX_DENIED` 拒绝,插件随后按预算再提醒、轮末再唤醒一次,仍写不进去就
|
|
176
|
+
交给宿主压力折叠;
|
|
177
|
+
- **完全访问**(`danger-full-access`):不受限。
|
|
178
|
+
|
|
179
|
+
**规避办法**(都要改 profile 配置):
|
|
180
|
+
|
|
181
|
+
1. **最通用:把 `handoffDir` 设成工作区内的绝对路径**(推荐 `<工作区>/.dsh-handoffs`,并加进 `.gitignore`)。
|
|
182
|
+
工作区内的写入在两种受限模式下都算“项目内的普通写入”:`workspace-write` 的沙箱放行,自动审查里属于
|
|
183
|
+
low(策略规定 low **必须放行**),因此不需要人工确认。代价是交接档出现在工作区里(与“绝不进工作区”的
|
|
184
|
+
默认设计相反)。
|
|
185
|
+
2. **只对 `workspace-write` 有效:把 `handoffDir` 指到系统临时目录**(例如 `%TEMP%\dsh-handoffs`)——
|
|
186
|
+
临时目录在 `workspace-write` 下始终可写、也不污染仓库;但自动审查仍会把它看成项目外的写入。
|
|
187
|
+
|
|
188
|
+
**自动审查(`auto` 预设)另有一条独立的门槛。** 该预设是 `sandbox: danger-full-access` + `approval: ask`:
|
|
189
|
+
文件系统不做路径沙箱,改为**每个原生工具调用前由同一个模型审一次**。审查策略把“项目内的普通读写”定为
|
|
190
|
+
low(必须放行),把“项目外的非敏感写入”定为 medium,而 medium **只有在当前用户或直接父级明确授权了精确
|
|
191
|
+
目标与范围时才放行** —— 写档指令来自插件注入的 runtime context,不是用户指令,所以通常会被判为拒绝:
|
|
192
|
+
`approval: ask` 下会转成一次人工审批(你点批准就写得进去),`never` 下则是终局失败。给会话注册窄目录
|
|
193
|
+
可写根(`sandboxPolicy.registerWritableRoot`)**对自动审查无效**:`danger-full-access` 下沙箱根本不查
|
|
194
|
+
可写根,审查策略里也没有“已授权目录”这一档。
|
|
195
|
+
|
|
196
|
+
插件不替模型写这份档(`handoff_ready` 只做校验),所以这是权限模型带来的能力边界,不是开关。
|
|
197
|
+
|
|
168
198
|
**切换模式立即生效,不需要重启**:`foldMode` 是 volatile 配置,设置卡直接写进运行中的引用,
|
|
169
199
|
插件每次调用都重新解析选项(实测:面板切到 `handoff` 后,运行中的实例在下一次调用就按 handoff 执行)。
|
|
170
200
|
但切换本身**不会触发折叠**——折叠仍要等读数到点。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context-truth",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "DeepSeek Harness plugin: tells the model its real, host-measured context occupancy every turn — and keeps compaction summaries from carrying false \"context is nearly exhausted\" claims.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|