Files
codex-app-server/chv-guest/chv-gitea-worker.service
T
host 81e4eaf4db feat(chv): 对齐 Muse P6 privsep worker + 确定性安全检查层
- cloud/chv/privsep.py(新):Gitea worker 注册表(凭证白名单只含
  GITEA_TOKEN)+ 类型化请求/响应(request_id 绑定、64KB 上限)+
  Unix socket 客户端(超时/崩溃 -> 类型化失败 WorkerRefusal)+
  客户端白名单校验
- cloud/chv/safety.py(新):UntrustedData 来源标记 +
  InjectionScanner 确定性规则(block/flag/allow,中英)+
  redact_secrets + AuditLogger(只记指纹,不记值)+
  audit_inference_request/response
- chv-guest/chv-gitea-worker.py + .service(新):systemd 沙箱化
  worker(SO_PEERCRED 只放 root,仓限 ~/workspace,git 只配 authd
  helper,绝不持 token;输出先扫描再返回)
- chv-guest/chv-sync-worker-client.py(新):agent 侧薄 CLI
- chv-guest/chv-sync.sh:pull/push/status 有 socket 时走 worker,
  否则旧路径 + stderr 警告(过渡兼容)
- cloud/chv/executor.py:_run_guest 前后加推理边界审计钩子
  (best-effort)
- docs/chv-muse-p6-gap.md(新):差距表 + 覆盖边界 + 真机待验证清单
- docs/chv-production-readiness.md:§15
- cloud/tests/test_chv_muse_p6.py(新):43 项

测试:新测试 43/43;全量 cloud 套件 1910 OK(skipped=9);mypy
在新增文件上干净(剩余 4 处为基线旧错 executor.py:1396/1401、
marker_tools.py:142,未动)。
真机验证:未做,排队在 round-11 之后,清单见
docs/chv-muse-p6-gap.md §4。
2026-11-06 22:31:54 +00:00

33 lines
1.3 KiB
Desktop File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[Unit]
Description=CHV Gitea sync privsep worker (feat-chv-muse-p6)
After=network-online.target chv-authd.service
Wants=network-online.target
# authd 是可选依赖:worker 的 git 经 P3 helper 向 authd 取凭证;
# authd 没起来时 worker 的 git 调用直接拒绝,不静默用旧凭证。
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/chv-gitea-worker
Restart=on-failure
RestartSec=2
# systemd 沙箱(与 P3 authd 同款 root 单元外服务口径,再收紧):
# 只读系统、独立 /tmp、不许提权、不留 capability、只许 Unix 与
# inet 协议族、只许 @system-service 系统调用、读写路径只限工作区
# 与 worker 运行时目录。网络层强制(eBPF)是 P5 的范围,不在这里
# 冒充——出口收紧靠 Sentinel 评估(authd 放凭证前)+ 只配 helper
# 的 git(见 chv-gitea-worker.py)。
ProtectSystem=strict
PrivateTmp=yes
NoNewPrivileges=yes
CapabilityBoundingSet=
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
SystemCallFilter=@system-service
ReadWritePaths=/home/chv/workspace /run/chv-gitea /var/log/chv-gitea-worker.log
# worker 崩溃不拖垮 agent:broker/薄 CLI 收到类型化失败即返回,
# 不重试、不挂起;systemd 只负责拉起 worker 本身。
[Install]
WantedBy=multi-user.target