refactor(sandbox-policy): remove capability family registries

This commit is contained in:
Tianyi Cui
2026-07-31 13:28:02 +08:00
parent e6407477a7
commit e088cfa59d
112 changed files with 260 additions and 403 deletions
+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/fs/fs-sandbox/README.md
README.md: a376f2c23dca9f0895525fa274a1ae0545823f63
README.zh.md: 4fa2deecb7d10124da8b7920997196b816457fcc
README.md: bce22feac8b6b4a31abc0cbfddd39681ad437062
README.zh.md: 0bb0190f5a0506f2d10f82a5f03370b977472aee
+2 -2
View File
@@ -26,7 +26,7 @@ A denial is a structured `FsError` (`FS_SANDBOX_DENIED`, carrying the effective
#### What the model sees
This backend contributes the write/edit family to the owner-rendered `sandbox:policy` section. Indirectly, `dsh-tool-fs` renders its `FS_SANDBOX_DENIED` refusals as the `[sandbox: file access denied under <mode> mode]` marker plus the same-turn escalation hint.
The policy owner contributes capability-neutral `sandbox:policy` context. Indirectly, `dsh-tool-fs` renders this backend's `FS_SANDBOX_DENIED` refusals as the `[sandbox: file access denied under <mode> mode]` marker plus the same-turn escalation hint.
#### Token effect
@@ -34,7 +34,7 @@ The current-policy clause adds a small fixed prefix while this backend is mounte
#### KV Cache effect
A standing-policy or family-composition change updates the owner-rendered request prefix; operation results remain append-only.
A standing-policy change updates the owner-rendered request prefix; operation results remain append-only.
## Known Limitations and Deferred Work
+2 -2
View File
@@ -26,7 +26,7 @@
#### 模型看到的内容
该后端会向归属方渲染的 `sandbox:policy` 段落贡献 write/edit 家族。作为间接影响,`dsh-tool-fs` 会把本后端的 `FS_SANDBOX_DENIED` 拒绝渲染为 `[sandbox: file access denied under <mode> mode]` 标记和同轮次升级提示。
策略归属方会贡献与具体能力无关的 `sandbox:policy` 上下文。作为间接影响,`dsh-tool-fs` 会把本后端的 `FS_SANDBOX_DENIED` 拒绝渲染为 `[sandbox: file access denied under <mode> mode]` 标记和同轮次升级提示。
#### Token 影响
@@ -34,7 +34,7 @@
#### KV Cache 影响
常驻策略或家族组合发生变化时,归属方渲染的请求前缀会更新;操作结果保持仅追加。
常驻策略发生变化时,归属方渲染的请求前缀会更新;操作结果保持仅追加。
## 已知限制与暂缓事项
+1 -2
View File
@@ -44,7 +44,7 @@ import { isPathUnder } from './containment.ts'
* Plugin config: the local backend's knobs, verbatim (only `cwd`, the resolve
* base for relative paths). The sandbox default (mode + `workspace-write`
* fallback root) is NOT here — `ctx.sandboxPolicy` resolves each calling
* session for both enforcing families.
* session for every enforcing capability.
*/
export type Config = LocalConfig
@@ -63,7 +63,6 @@ export class SandboxedFileSystem extends LocalFileSystem {
constructor(ctx: Context, config: Config) {
super(ctx, config)
this.defaultMode = ctx.sandboxPolicy.defaultMode
ctx.sandboxPolicy.registerEnforcedFamily('filesystem')
}
/** The deployment default mode — the capability fact the tool layer reads to advertise escalation. */