feat(sandbox-policy): describe enforced file families

This commit is contained in:
NI0317
2026-07-30 18:51:29 +08:00
parent d3323494ba
commit 87a4aaa32e
48 changed files with 623 additions and 140 deletions

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/pty/pty-local/README.md
README.md: de17c1e56108726daf4009492012caaa79155eca
README.zh.md: 95d8350716da685381333187d534d696873db605
README.md: 5ad2c94f7c3e8e8bda5b7b432b3d0529a30f2b4e
README.zh.md: 0ab3f4a485315e6037d862f423f9e25b6200a63e

View File

@@ -14,19 +14,19 @@ Send cancellation resolves the current foreground process group and delivers a r
## Model Experience
### Indirect consumer
### Current file policy and indirect consumer
#### What the model sees
Nothing directly. Through `@deepseek-ai/dsh-tool-pty`, the model may receive bounded MOTD, send deltas, scrollback pages, readiness reasons, and cleanup errors.
This backend contributes the terminal family to the owner-rendered `sandbox:policy` section. Through `@deepseek-ai/dsh-tool-pty` or another PTY consumer, the model may also receive bounded MOTD, send deltas, scrollback pages, readiness reasons, and cleanup errors.
#### Token effect
None until a consumer returns bounded backend output. Retained PTY scrollback is not placed in model history by this package.
The current-policy clause is present while this backend is mounted. Retained PTY scrollback is not placed in model history until a consumer returns bounded output.
#### KV Cache effect
No direct invalidation; the consumer owns prompts, schemas, and appended results.
A standing-policy or terminal-family change updates the owner-rendered request prefix; consumer results remain append-only.
## Known Limitations and Deferred Work

View File

@@ -14,19 +14,19 @@ Linux 的就绪检测结合以下机制:由前台状态验证的私有 bash
## 模型体验
### 间接消费方
### 当前文件策略与间接消费方
#### 模型看到的内容
没有直接可见内容。模型通过 `@deepseek-ai/dsh-tool-pty` 可能收到有界的 MOTD、发送增量、scrollback 页、就绪原因和清理错误。
该后端会向归属方渲染的 `sandbox:policy` 段落贡献终端家族。模型通过 `@deepseek-ai/dsh-tool-pty` 或其他 PTY 消费方还可能收到有界的 MOTD、发送增量、scrollback 页、就绪原因和清理错误。
#### Token 影响
消费方返回有界的后端输出前没有影响。此包package不会把保留的 PTY scrollback 入模型历史。
装载该后端期间,当前策略子句会一直存在。消费方返回有界输出前,保留的 PTY scrollback 不会进入模型历史。
#### KV Cache 影响
不会直接使 KV Cache 失效提示词、schema 与追加结果由消费方负责
常驻策略或终端家族发生变化时,归属方渲染的请求前缀会更新;消费方结果保持仅追加
## 已知限制与暂缓事项

View File

@@ -129,5 +129,6 @@ export class LocalPtyBackend implements PtyBackend {
export function apply(ctx: Context, config: Config): void {
validateConfig(config)
const inspector = createProcessInspector()
ctx.sandboxPolicy.registerEnforcedFamily('terminal')
ctx.pty.registerBackend(new LocalPtyBackend(ctx, config, inspector))
}