dogfood + 信任同事白名单阶段 Step 4 完整 egress proxy 暂不做(沉淀为升级触发 信号:任一陌生用户注册 / 模型异常 outbound / 信任白名单出现非密切相识者 → 必上)。 本批 3 件: (A) 容器资源 yaml 化(可调不重 build): - agent.yaml 加 sandbox 段(memory/cpus/pids_limit) - SandboxPool ctor 加三字段,优先级 env > yaml > 默(2g/1.0/256) - setup_pool/init_pool 透传 sandbox_cfg - sandbox check 输出加 [info] 4 行给运维一眼对账 (B) 应用层磁盘配额(§7.5 #4 软配额): - migration 0008 user_disk_usage 单行 per user - core/storage/disk_quota.py:parse_bytes("5gb"/int)+ scan_user_dir (os.scandir 跳顶层 .zcbot_tmp / .memory)+ upsert ON CONFLICT + check_disk_quota + scan_all_users 串行 - lifespan _disk_scanner 后台 task(启动跑一次 + 默 15min 周期) - DockerExecutor write/edit 起手 gate 超额 [Error] 不调容器 - /v1/files/upload 同款 gate 超额 HTTP 413 - yaml `quotas.disk_bytes_per_user: 5gb` + `disk_scan_interval_seconds: 900` - race 接受:扫描间隙写入轻微突破(image/video 配额同款 race-tolerant); 外部用户开放前 OS 层 xfs prjquota 兜底 - 11 测试 covered parse_bytes / scan / 跳 dotfile (C) 网络放开 + 容器内源持久化: - network.py 去 --internal flag,容器走 docker bridge default 有 NAT outbound - 已存在 internal network 不自动 rm 仅 warn,RUN.md 给迁移命令(避免破现有容器) - iptables 红线段不动(169.254/127/10/172.16/192.168/100.64/PG_IP DROP), 挡 cloud metadata + 内网扫描 + loopback,基线不依赖 proxy - Dockerfile 加 /etc/pip.conf(global index-url + timeout 60) + /etc/npmrc (global registry),让运行时模型 `pip install foo` / `npm install bar` 也走 mirror(此前 --build-arg 只 build 时生效) unittest discover 46/46 PASS(原 35 + 新 11)。 DESIGN 不动(延后决策仍在 §7.7 Stage C 阶段语义内,触发信号沉淀进 PROGRESS / RUN);RUN.md 加 env 列表 + 网络迁移 + 配额 + 故障兜底 3 行。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| static | ||
| __init__.py | ||
| app.py | ||
| auth.py | ||
| broker.py | ||
| sinks.py | ||