Files
Agent-System-Dev/.task/feature-layered-python-env.md
T
weichenandCursor 3d6de0c4ac Wire the layered Python environment into service startup
Why: The dependency layer already existed in the backend, but service startup never passed it, so the sandbox could not import the packages the host already had.
Evidence: SELF go tests recorded on the backend commit. svc.sh only exports the env root after env ensure leaves a current base layer, and a failed download does not block startup.
Impact: Instances share runtime/envs. Existing exec= lines are left as stored. Proposal, backend, and frontend gitlinks move to this branch.
Refs: .task/feature-layered-python-env.md
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-15 13:53:00 +00:00

2.2 KiB
Raw Blame History

feature/layered-python-env 任务卡

状态:实施已落在独立 worktree,未推送、未合入;owner:weichen

基线与授权

  • 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main
  • R0:64a50cf(origin/main,Merge PR #569)
  • 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-layered-python-env
  • 分支:feature/layered-python-env(父仓与 backend、frontend、documents 子仓同名)
  • 启动检查:/tmp/layered-python-env-precheck.json,退出码 2,结论 SHARED_WORKSPACE_BUSY。共享主检出有未提交 gitlink,且落后 origin/main 60 个提交。因此没有在共享检出写入,也没有运行 make task-start。
  • 授权:用户要求按已附方案实现全部分阶段,不改方案文件本身。不包含推送、合入或重启 8788。

目标

用不可变、按内容哈希命名的 Python 层,替换「每个工作区一个 venv」和「一个可变全局环境」。沙箱保持断网。安装只发生在宿主侧构建器。

本工作区已落地

  • 提案:modules/documents/docs/proposals/2026-10-15-layered-python-env.md(documents 945db35),状态仍是待评审。
  • P0:解释器不再解析到被沙箱遮蔽的 linuxbrew 路径;PATH 固定;工具文案和提示词不再要求 pip install --user;svc.sh 在产物支持时调用 env ensure,并把环境根与当前基础层经环境变量交给 serve。
  • P1:execenv 环境根、托管解释器(独立 CPython,失败则一份系统 venv)、锁、层、wheelhouse、agent-system env ensure|lock|gc|doctor|rebase|python。
  • P2:schema v35 的 exec_env_requests / exec_env_bindings、python_env 工具、白名单自动批准、其余走审批卡、pip 垫片、按会话挂载。
  • P3:管理区「Python 环境」页,以及回收、重建基础层、上传 wheel 的管理接口。
  • 测试(SELF,本机):execenv、tools、store、app、server、runmgr、config、cmd/agent-system 通过。含 sandbox 参数、离线解析、真实 bwrap、两个会话各一层,以及 housestyle.build 产出的 docx 通过结构自检。权威源仍是 CI,本次未推送。

非目标

不重启正在运行的 8788。不修改方案文件。不把项目角色加入审批人。