Skip to content

feat(sandbox): add Linux Bubblewrap protection and approval integration - #496

Merged
tallcode merged 32 commits into
mainfrom
sandbox
Sep 4, 2026
Merged

tallcode merged 32 commits into
mainfrom
sandbox

Conversation

@tallcode

@tallcode tallcode commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

概要

  • 新增 Linux Bubblewrap 沙盒执行后端、系统探测与诊断,最低支持 0.9.0;网络保持开放。
  • 完成保护规则编译、缺失目标处理、受限 glob 扫描、匿名参数与私有完成报告传输,并加固启动及重试异常分支。
  • 对接 Desktop Linux 沙盒选项、不可用原因、主动/被动审批标题与路径展示;同步 Mobile 审批显示。
  • EBUSY 使用不依赖命令形式或路径解析的输出启发式;保留私有报告门禁和用户审批。提示模型保留必要操作的错误状态,并避免向用户复述内部检测细节。
  • 新增 Linux 开发启动及真机验收脚本,将沙盒文档收敛至 COMMON / LINUX / MACOS / WINDOWS,记录平台差异与已接受缺口。

范围与边界

  • 已合并最新 origin/main(1188a4d1);skills 与 main 一致,不包含额外子模块变更。
  • Linux 不新增 seccomp,不承诺检测缺失敏感路径创建期间的全部访问;事后检查不是阻止或回滚。
  • 拒绝识别仍是启发式。成功退出或错误输出被吞掉可能漏判;没有增加成功退出后的诊断提示,也没有增加自动脱沙盒执行。

验证

  • PASS:Rust 1.97.0 workspace fmt / Clippy(all targets,warnings denied)。
  • PASS:Desktop Tauri 独立 fmt / Clippy(all targets,warnings denied)。
  • PASS:Desktop lint / TypeScript / stylelint、四份多语言 JSON lint。
  • PASS:Mobile lint / TypeScript、变更文件 Prettier。
  • PASS:Linux 脚本 bash 语法检查、完整 PR diff whitespace 检查。
  • 既有非阻塞警告:Desktop 3 条 Tailwind 写法;Mobile 26 条测试文件导入警告,均不在本次改动文件中。
  • NOT RUN:本轮本地测试套件、Linux/Windows 原生运行验证;测试交给 GitHub Actions。用户已反馈 Linux 真机主流程可运行,不将该反馈等同于完整安全验证。

合并

Ready for review;按项目流程开启 squash auto-merge,不等待 CI 完成。

tallcode and others added 30 commits September 2, 2026 19:39
bwrap --args only expands OPTIONS from the fd payload; the '--'/COMMAND
written into the args file was discarded by bubblewrap's recursive parser,
leaving it without a command (usage + exit 1). COMMAND is now real argv on
the bwrap command line while the mount plan stays in the anonymous file.

Missing protected targets are no longer mounted at all: bwrap creates the
mount point with a host-visible mkdir (EROFS under read-only parents, host
residue under writable ones). The plan omits such mounts and carries the
target list in the request; the outer helper re-checks each path after the
command and reports creation as a detection-only MissingProtectedCreated
violation, matching the existing glob semantics.

Adds a production-path smoke test compiling real default rules through
prepare -> helper -> bwrap, a detection smoke test, and updates the Linux
sandbox failure review document. Moves tempfile to shared dependencies
(the Linux helper uses it for anonymous request/args files).
Use private helper reports, bound post-command scans and resources, and reject legacy missing mounts. Consolidate shared and platform documentation, preserve accepted limitations, and restore the unrelated skills submodule revision.
Recognize EBUSY only for exact launch-time protection targets with valid private completion evidence. Preserve detection-only retry gates, add regression coverage and diagnostics, and document separate create/read calls.
@tallcode
tallcode enabled auto-merge (squash) September 4, 2026 10:04
@tallcode
tallcode merged commit e91db57 into main Sep 4, 2026
12 checks passed
@tallcode
tallcode deleted the sandbox branch September 4, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants