Commit Graph
100 Commits
Author SHA1 Message Date
host 3cdfd0f79e fix(ci): runner 补 py3-yaml/py3-pillow/procps
ci / test (push) Successful in 37m11s
CI run 198 红:cloud 套件 5 失败 + 12 错误,根因全是
runner 环境缺包(本地全绿):
- No module named 'yaml':test_chv_gaps /
  test_chv_gitea_sync 模块导入失败 + test_chv_v3_fixes
  GuestEnvV4Test 两例(4 错误)。
- No module named 'PIL':阶段 4 diff_shot 逐像素裁剪
  走 Pillow,ComputeDiffTest 5 错误 + DiffShotTest
  3 错误 + 4 失败(Counters/DiffShot/ForbiddenOps
  皆为缺 PIL 后的下游失败)。
- busybox ps 不支持 --ppid:阶段 5 ExecdKillGroupTest
  用 ps --ppid 找组内子 sleep,10 秒等不到而失败。
2026-11-08 11:13:15 +00:00
host 738982ce10 fix: rebase 合入修复(#215 已合并 + 执行器文案 + server 重导出)
ci / test (push) Failing after 30m37s
- cloud/server.py:重导出 handler_support._chv_vm_dead_from_row,
  沿用 main 的 split 重导出约定(test_chv_arch_maint_fe 从
  cloud.server 导入该名)。
- cloud/tests/test_coverage85_server2.py:执行器非法值文案期望
  跟随分支行为(valid 列表已含 cloud-hypervisor,main 新增
  的该用例原先按旧文案断言)。
- cloud/chv/compat215.py + test_chv_arch_maint_fe.py:#215
  (facc2a2)已合入 main,四模块已存在,替换清单本身未动;
  钉住项由“模块不存在”翻为“模块已存在”,tmpfs_isolated
  扫描白名单加 canonical 定义 cloud/sandbox_policy.py。
  R1/R2 替换本身未做(属合并后工作):语义已核对,
  gates.resolve_inside 与本地版逐行一致,
  sandbox_policy.tmpfs_isolated 对 cloud-hypervisor
  同样返回 False,未触发 R2 的停手条件。
2026-11-08 10:22:51 +00:00
host dba5620e29 fix(chv): execd codex 白名单补 SUB2API_/XCM_ 前缀,网关 key 得进单元
chv-cell 的 FORWARD_ENV_ALLOWLIST 早已接受 SUB2API_API_KEY /
SUB2API_BASE_URL / XCM_API_KEY,但 execd _codex_env 的前缀白名单
没有这两项,调用方传了也被丢弃,单元内 codex 永远拿不到网关
key(假值探针实证:三者全被丢弃,只有 OPENAI_* 能通过)。
host.py sub2api provider 直读进程 env,缺 key 即调不到模型。
补前缀 + 扩展 test_codex_env_allowlist;GITEA_TOKEN 仍被丢弃。
真实 turn 仍待安全测试 key(另见 KEY-PIPELINE 报告),本次
只修链路不断言 live。
2026-11-08 09:45:00 +00:00
host 6466ea6024 feat(chv): 阶段 5 多会话并行——具名会话独立 context + storage-state 落盘 + execd 组杀 2026-11-08 09:45:00 +00:00
host f723eb8a88 feat(chv): 阶段 4 截图三级管线——a11y 角色解析 + diff_shot 逐像素裁剪 + verify_shot 全屏校验
- snapshot 纯字符串解析 a11y 角色计数/interactive/字符数/hash
  (不跑 JS、不取原始 DOM,禁 op 保持拒绝);status 带计数器
  与 verify_share
- diff_shot:PNG 全帧 Pillow 逐像素比对(单通道阈值 10),
  无变化 changed:false size 0;有变化 bbox 外扩 8px、钳制视口、
  宽高下限 32px,再 clip 截 JPEG q70;Pillow 缺失如实报错并
  指引回落 screenshot 全帧;open 不清基线(跨页局部差分靠它)
- verify_shot:全帧 JPEG q70,只用于检查点
- build.sh 与 playwright 同批 pip 装 pillow(只加 pillow);
  buildinfo BASE_CONTENTS 登记 pillow(pip 名覆盖)
- 单测 cloud/tests/test_chv_opt_stage4.py:31 项(bbox 纯函数、
  a11y 解析、计数器、Pillow 缺失回落、禁 op、lockfile 往返)
2026-11-08 09:45:00 +00:00
host 5dc75128f8 fix(chv): 数据盘挂载升格为 oneshot 服务,浏览器启动时重解析 profile 2026-11-08 09:45:00 +00:00
host c7ffb1fe6f fix(chv): 浏览器单元去掉成环的 After=cloud-final
cloud-final 自己 After=multi-user.target,与浏览器的
Before=multi-user.target(WantedBy 隐含)成环,systemd 启动时
直接删掉浏览器任务:构建 #9 驱动实证服务从未启动(NRestarts=0、
无日志,journal 明言 Job deleted to break ordering cycle),
构建 #8 同款问题一直被手动 restart 掩盖。改排在数据盘挂载单元
home-chv-workspace.mount 之后(真依赖);单测钉死不再出现
cloud-final。
2026-11-08 09:45:00 +00:00
host 0100ffe207 fix(chv): 完整 Chromium 检测认 CFT 布局 chrome-linux64
Playwright 1.64.1 下的 chrome-linux64.zip 解压为 chrome-linux64/
chrome,旧检查只认 chrome-linux/chrome:数据盘上 403M 完整版
已装好(含 DEPENDENCIES_VALIDATED)仍报未安装、mount_full 误
回落(2026-11-08 构建 #8 驱动实证)。两种布局都认;驱动安装
步在仍未装好时重试一次(客机慢出口 CDN 30 秒超时是抖动)。
2026-11-08 09:45:00 +00:00
host 9d986becaf feat(chv): 完整 Chromium 改装数据盘
根盘只剩 ~600MB,playwright install chromium 装根盘 109 秒后
ENOSPC 失败(2026-11-08 构建 #8 驱动实证)。完整版改装数据盘
/home/chv/workspace/.chv-browsers(9.3G 空闲),仍不 bake 进
base、按需;full 引擎启动时直接传 executable_path(channel 与
executable_path 互斥,且驱动进程启动时才读 env,运行中改 env
无效);status 增 full_browsers_dir,mount 失败报错给数据盘
安装命令。驱动的安装步同步改数据盘并 chown 给 chv-browser。
2026-11-08 09:45:00 +00:00
host 435664925e fix(chv): cell 不再把 /run/chv 的组改回 root
chv-cell 每次跑 cell 都 _ensure_bind_source(BROKER_DIR, uid=0,
gid=0),把 /run/chv 的组改回 root,抹掉 tmpfiles 的 chv-browser
组;之后 chv-browser 重启时 os.remove(browser.sock) 报
Permission denied、无限 crash-loop(构建 #8 客机 62 次重启才
被发现,03:42 驱动两次跑 cell 正好在补丁后、重启前)。改:组
改取 chv-browser 的 gid(不存在回落 0);serve() 删 socket
失败时报错说清修法,不再只剩裸 traceback。
2026-11-08 09:45:00 +00:00
host 0bfb00ab1b fix(chv): 快照改走 page.aria_snapshot()
Playwright 1.64.1 已移除 page.accessibility,真实快照一路报
AttributeError(P2 假实现用的旧 API,单测一直没抓到;2026-11-08
构建 #8 驱动 live 抓到)。新版 aria_snapshot() 返回字符串,
超 64KB 截断;旧版 accessibility.snapshot()(dict)只作回落。
驱动的 a11y 断言接受 str 或 dict。
2026-11-08 09:45:00 +00:00
host 7361b0654f fix(chv): _load_playwright 须返回 sync_playwright() 实例
返回函数本身则无 __enter__,真实启动路径从未跑通过(P2 假实现
掩盖;2026-11-08 构建 #8 驱动 live 抓到)。回归测试钉死该契约。
2026-11-08 09:45:00 +00:00
host eb495892e1 fix(chv): 阶段 3 live 根因——浏览器 socket 与数据盘 profile 的两处权限
- /run/chv 0755 root:root 时 chv-browser 建 browser.sock 报
  PermissionError、服务无限 crash-loop(P2 遗留,阶段 2 从未验
  过 browser.sock):tmpfiles 改 0775 root:chv-browser。
- /home/chv 默认 0750,chv-browser 穿不过家目录,ismount 判假、
  profile 静默回落本机盘:chv-data-mount 挂载成功后 chmod 0751
  /home/chv(只放行穿过,不放行列表)。
- 驱动:等 cloud-init done + 四服务 active 再验浏览器。
- 回归 97 项全过(新增 2 项接线断言)。
2026-11-08 09:45:00 +00:00
host 1188e4b000 feat(chv): 阶段 3 浏览器服务化——持久 profile + CDP + 多会话 + JPEG 截图 + 双浏览器
- chv-browser:launch_persistent_context,profile 固定数据盘
  /home/chv/workspace/.chv-browser-profile(未挂载回落本机盘并明说);
  CDP --remote-debugging-port 9222(op cdp 返回 webSocketDebuggerUrl);
  多会话每会话一页;截图 JPEG q70、viewport 宽封顶 1280、diff_only
  整帧相同跳过;mount_full/unmount_full 切 full/shell 引擎,full
  未装或起不来回落 shell 并明说。
- chv-data-mount:挂载后预建 profile 目录(chv-browser:chv-browser 0700)。
- build.sh:chv-browser 单元 Restart=always、After cloud-final.service。
- chv-execd:codex 环境白名单加 CHV_BROWSER_ 前缀。
- 测试:新增 test_chv_opt_stage3.py(20 项);P2 假实现改为持久
  上下文 + JPEG;stage2 的 Restart=always 计数 3→4。
- 全量回归 2032 过 skipped=8。
2026-11-08 09:45:00 +00:00
host 6a65c94254 fix(chv): execd 单元 KillMode=process(构建 #6 驱动实证)
缺 KillMode 时 systemd 默认 control-group,kill -9 execd 主进程
后重启会 SIGTERM 整个 cgroup,sleep 任务同 pid 存活的要求被破、
新 execd 认领时 pid 已死记 unknown,驱动 kill 相断言失败。
KillMode=process 只信号主进程,任务在重启后同 pid 存活认领;
stop 仍干净停 daemon 本身。回归测试
BuildWiringTest.test_build_sh_execd_unit_keeps_tasks_on_restart。
2026-11-08 09:45:00 +00:00
host 42adbd047f fix(chv): 79-chv-cell.network 改回 root:root 644(构建 #5 驱动实证)
virt-customize --copy-in 保留构建宿主 uid/mode,79 文件在客机
落盘成 chv:chv 640,networkd 不认它、改配 80-container-ve.network、
刷掉 10.200.0.1,cell _iface_has_ip 复核失败、codex --help rc=1。
构建时显式 chown root:root + chmod 644 并断言属主与权限;
回归测试 BuildWiringTest.test_build_sh_fixes_cell_network_file_owner。
2026-11-08 09:45:00 +00:00
host 1cbaf7c1d5 chv-cell: networkd 不管 ve + 单元内 DNS 修复
- systemd-networkd(/usr/lib 80-container-ve.network,匹配 ve-*)
  会在 veth 建好后几秒内刷掉静态 10.200.0.1、改 DHCP/链路本地,
  致单元网关不可达、TCP/UDP 全灭(FORWARD/NAT 计数器恒 0;
  早先一次 curl 403 是刷掉前的窗口期偶发)。修法:镜像内置
  /etc/systemd/network/79-chv-cell.network(Unmanaged=yes),
  须排在 80 之前(99 会被 80 抢走,已实测);build.sh copy-in
  + 校验、BASE_CONTENTS 与两处 DECLARED_SOURCES 登记。
- run_cell 配网后复核 ve 上确有 10.200.0.1(_iface_has_ip),
  不见即大声失败、不跑无网单元(第二道防线)。
- 单元内 DNS:/etc/resolv.conf 是 127.0.0.53 stub,单元独立
  netns 里自己的 lo 上没有 resolver;把上游
  /run/systemd/resolve/resolv.conf 绑到 /etc/resolv.conf
  (解析 symlink 后挂真实目标)。live 验证:DNS-UDP-OK、
  getaddrinfo 解析成功、curl https://gitea.tose.top 200。
- 单测:CellResolvTest + _iface_has_ip 真实 lo 断言 + 规约
  dns_resolv_conf 字段;P2 + 阶段 2 共 74 项全过。
2026-11-08 09:45:00 +00:00
host 4b5f2f124f chv-cell: ns 内 setuid 修复 + 单元内 DNS(上游 resolv.conf 绑定)
- 中间进程不再先 setuid(1000) 再 unshare:真机对照实测那样
  后续 unshare(CLONE_NEWNS) 得 EPERM;改为保持 root 外层身份
  unshare(creator caps 在),孙进程在 ns 内 setgid/setuid(0)
  切到内 0(映射到外层 chv 1000)。
- 单元内 DNS:客机 /etc/resolv.conf 是 127.0.0.53 stub,单元
  独立 netns 里自己的 lo 上没有 resolver;把上游
  /run/systemd/resolve/resolv.conf 绑到 /etc/resolv.conf
  (解析 symlink 后挂真实目标),只在单元私有 mount ns 里。
- 单测:CellResolvTest(bind 参数/symlink 解析/缺失回落)
  + 规约 dns_resolv_conf 字段;P2 + 阶段 2 共 73 项全过。
2026-11-08 09:45:00 +00:00
host afbb7772c5 fix(chv): cell 映射改由父进程写,中间进程先 setuid(1000)
两个真机教训(2026-11-07):
- 子进程自己写不进 uid_map:unshare 后 euid 变 overflow,
  连 /proc/self/uid_map 的 open 都 EPERM——改由父进程
  (仍在初始 ns 的 root)经 /proc/<pid>/uid_map 写。
- 映射按外层 uid 翻译:中间进程外层是 root(0) 时
  “0 1000 1” 盖不住它、新 ns 里仍是 overflow——中间进程
  须先 setgroups/setgid/setuid(1000) 再 unshare(实测
  chv 身份 unshare 在客机上可行,AppArmor 不挡)。
另:中间进程异常加 traceback(调试用);userns 单测改测
父写映射真实路径(映射行按 split 比,内核会多空格对齐)。
2026-11-08 09:45:00 +00:00
host a2a5624736 fix(chv): cell 后端由 nspawn 改为纯 stdlib userns 启动器
nspawn --directory=/ 在 systemd 255.4 上走不通(2026-11-07 真机
实测,修一个冒一个):裸 --no-new-privileges 被当成要值吞掉
下一个参数;--directory=/ 被根目录检查挡住;--volatile=state
又要 /run/host/os-release 挂载点与空 /dev(--tmpfs=/dev 不
生效)。cell 从未 live 跑通过(阶段 1 只测参数表纯函数)。
bwrap 作 chv 被 AppArmor userns 门挡住,newuidmap 客机未装。

新后端(同文件、同 CLI、同调用方):root 起进程,中间进程
unshare 用户 ns 并自己写 uid_map/gid_map(内 0 → 外 chv
1000),再进 mount/pid/net ns、挂 fresh /proc、/tmp tmpfs、
遮蔽敏感路径(目录盖 tmpfs、文件绑 /dev/null)、设
no_new_privileges + seccomp(禁 io_uring 三件套)+ 丢
capability,最后 exec payload;父进程配 veth/NAT、等退出码、
清 NAT。veth/NAT/nsenter 流程与旧版一致,seccomp BPF 与
capability 语义与 P2 设计一致。无新依赖、无 sysctl 改动。
2026-11-08 09:45:00 +00:00
host 42b295fc71 fix(chv): 阶段 2 syncd 改走 systemd RuntimeDirectory=/run/chv-syncd
tmpfiles 行 d /run/chv/syncd 0755 chv chv 没用:tmpfiles-setup
跑在 cloud-init 建 chv 用户之前,属主解析失败整行被跳过,
客内 /run/chv/syncd 根本不存在(2026-11-07 真机实测:镜像
里有这行、目录没有,syncd 反复退出、restart counter 57)。
改走单元 RuntimeDirectory=chv-syncd(服务启动时由 systemd
按服务用户建目录,不依赖启动时序);状态写失败改为记日志
不杀进程;daemon 与驱动的 syncd 路径同步改到
/run/chv-syncd/。
2026-11-08 09:45:00 +00:00
host 8013431f63 fix(chv): 阶段 2 syncd 写路径改到 chv 所有的 /run/chv/syncd/ 子目录
/run/chv 是 0755 root:root,chv 身份的 syncd 写不进状态文件
与 socket,_atomic_write 抛错致进程反复退出、systemctl 长期
activating(2026-11-07 真机实测)。socket 与状态文件改到
tmpfiles 预建的 /run/chv/syncd/(0755 chv:chv,与 chv-browser
的 shots 同款);daemon 的 sync 摘要读同一路径;驱动的
syncd socket 路径与 ls 检查同步更新;另修驱动 SSH poller
线程残留(daemon=True + wake 失败也 set 事件)。
2026-11-08 09:45:00 +00:00
host 9d77ae55a7 feat(chv): 阶段 2 客机运行时三分 daemon/execd/syncd + restore 留 seed.iso + tap 退避
- 客机三分(chv-guest/chv-daemon.py、chv-execd.py、chv-syncd.py,
  仅标准库;systemd Restart=always;build.sh 拷入 + 单元 + enable;
  buildinfo/check/generate lockfile 登记):
  daemon=心跳/资源上报/快照配合(prepare-snapshot 问 execd,
  有运行中任务或联系不上即拒绝);execd=shell/文件读写/codex
  托管(chv-cell 起 host.py,setsid 脱离,任务登记落盘,
  重启按 pid 认领;SO_PEERCRED 只认 uid 0/1000;codex env
  白名单);syncd=常驻循环只调 chv-sync pull/push,规则一条
  不改(先 pull --ff-only 再 push,分叉即停、不 --force、
  不 rebase;仓不存在记 needs-boot 不擅自 clone)。
  host.py 仍是唯一任务/codex 引擎,broker/browser/cell 分工
  不变,不另起第二套 agent。
- 阶段 1 遗留修复:restore_vm 失败路径 stop_vm(keep_disk=True),
  seed.iso 与任务盘都留,重试有输入;vm.boot/restore 的 tap
  触点遇 Resource busy 等 tap 空闲后重试一次(_wait_tap_idle
  看 ip link state,_ch_remote 报错带 stderr 尾巴以便识别);
  诊断不用 pgrep -x(15 字符上限)。
- 单测 cloud/tests/test_chv_opt_stage2.py 25 项;P2 干跑夹具
  与 enable 行断言随构建接线更新。
- 全量 cloud/tests 2001 全过(skipped=8)。
2026-11-08 09:45:00 +00:00
host f809014bef feat(chv): 阶段 1 数据盘与 tenant 标记同 overlay 解耦(copy 也供)
真机根因(2026-11-07,CHV v54 三变体实证):vm.boot 对任何
带 backing file 的 qcow2 都报 Maximum disk nesting depth
exceeded——overlay-only 与 overlay-rawbase 均 500,base 直接
启动(reuse)22.5 秒成功,数据盘与压缩均已排除。overlay 在
本 VMM 上不可用,持久 VM 须能在 copy 模式下跑。
- _provision_task_disk:copy 与 overlay 都供数据盘并写
  tenant.json(只有 reuse 不供不写);_provision_data_disk_path
  同理(reuse 才返回 None)。
- _cleanup_vm_task_disk:保护(持久登记/登记快照)不再只限
  overlay 模式;无登记无快照的 copy 盘仍按旧语义删除。
- provision_data_disk:数据盘改 raw 稀疏盘(os.truncate,
  零外部依赖)——copy 模式本来就不需要 qemu-img,数据盘
  绝不能悄悄加上这个依赖;CHV 按后缀认 Raw。
- 测试:新增 copy 供数据盘+tenant 与 copy 持久盘 stop 保护;
  VmConfig 三盘断言(任务+seed+数据)更新 arch95/fix 两处
  旧“恰好两盘”契约与本轨 qcow2 类型断言。
回归:test_chv_*.py、test_cloud_hypervisor.py 42、test_chv_v3_fixes
38 全过(全量 cloud/tests 在跑)。
不推、不合、不部署;只本地分支。
2026-11-08 09:45:00 +00:00
host a5f836e9fd feat(chv-guest): 阶段 1 数据盘独立持久(客内挂载)
- 新增 chv-guest/chv-data-mount.sh:按 LABEL=CHVDATA 找盘
  (不依赖 /dev/vd? 固定名;seed ISO 与根盘排除),无 fs
  即 mkfs.ext4 -L CHVDATA,挂到 /home/chv/workspace,幂等;
  无数据盘即静默退出 0(copy 模式旧 VM 不报错)。
- build.sh:缺脚本即失败(与 chv-sync.sh 同款门);拷入
  镜像 /usr/local/bin/chv-data-mount;99-chv-sync.cfg
  runcmd 在 chv-sync boot 之前调它(工作区先挂好再 clone)。
- buildinfo.py BASE_CONTENTS 与两 lockfile DECLARED_SOURCES
  登记 chv-data-mount(repo_commit,随 P2 三脚本先例)。
- tests:test_chv_opt_stage1.DataMountScriptTest(脚本内容、
  构建接线、lockfile 登记);P2 干跑夹具补新文件。
回归:discover test_chv_*.py 与 test_cloud_hypervisor.py 全过。
不推、不合、不部署;只本地分支。
2026-11-08 09:45:00 +00:00
host 7a6fae7993 feat(chv): 阶段 1 持久 VM、overlay 分层与预热快照
- disk.py:overlay 模式(qcow2 backing file 指只读 base,
  建盘/复用/重建校验 + qemu-img fail-closed)、数据盘
  data.qcow2 独立供给(不进快照/GC/stop)、配额增量口径
  (overlay 本次增量 0)、快照登记 tenant 字段、每 VM
  tenant.json、持久登记 persistent/<tenant>.json、快照
  登记按 URL 查找。
- config.py:CHV_DISK_MODE 白名单加 overlay(默认仍 copy;
  错误文案保留旧子串,防回归测试钉死)。
- executor.py:VmConfig image_type 按后缀(.qcow2→Qcow2,
  其余 Raw)+ 数据盘第三块盘;overlay 供给写 tenant 标记;
  snapshot_vm 登记带 tenant,_validate_restore 归属校验
  (跨用户 snapshot_tenant_mismatch 拒绝 + 审计,legacy
  未标记/未登记放行并警告);stop/GC 在 overlay 模式下
  保护持久登记/快照认领的盘;持久 VM(prewarm/acquire/
  suspend/dispatch_task_persistent/recycle_persistent_vm,
  CHV_WARM_POOL_SIZE>=1 启用,=0 退化冷启旧语义),
  resume 只认 vm.info=Paused + socket 活性 + 归属一致。
- tests:cloud/tests/test_chv_opt_stage1.py 26 项(overlay、
  tenant、持久池、跨用户拒绝、两连任务、显式回收)。
回归:discover test_chv_*.py 与 test_cloud_hypervisor.py
全过(结构契约:函数 ≤50 行、公开 API 全注解、文案钉死)。
不推、不合、不部署;只本地分支。
2026-11-08 09:45:00 +00:00
host c904ae9358 carry-over: 在途 V-9 根因修复 + Muse P2 对齐原样带入(未改一行业务逻辑)
来源:feat-chv-muse-p2 @ c918d69 的 6 个未提交文件(+157/-29):
build.sh(GT 哈希轮换 + 99-chv-sync.cfg runcmd chown)、
check_lockfile.py / generate_lockfile.py(DECLARED_SOURCES 加
chv-cell/chv-broker/chv-browser)、executor.py(_wait_guest_env_usable)、
hostkeys.py(guest-env owner 恒 root:root)、test_chv_v3_fixes.py。
单测:python3 -m unittest cloud.tests.test_chv_v3_fixes 38/38 通过。
本提交只搬运,不含阶段 1 改动;阶段 1 另起提交。
2026-11-08 09:45:00 +00:00
host 1836c5af32 fix(chv): V-7 复测缺陷复修 D1/D2 + F1 瞬时 reset 重试
D1:snapshot_vm 在配额预检后、ch-remote 前建好 file:// 目标
目录(新 helper _ensure_snapshot_dir;fresh URL 直接 snapshot
曾 rc=1 Destination is not a directory)。建目录只在 snapshot_vm
一处,hibernate 经此调用;配额拒绝仍先于任何文件改动。
D2:keep_disk=True 时 stop 保留 seed.iso(_remove_vm_seed_files
抽出;快照 config.json 的 disks 同时引用 disk.raw 与 seed.iso),
且 cleanup_stale_secrets 不清有登记快照的 VM 的 seed(与
gc_stale_disks 的盘保护同款逻辑);正常 stop 仍删两者。
F1:首条任务 SSH 撞 kex 阶段瞬时 reset(rc=255 + kex/reset 标记)
时重试恰好 1 次(_call_ssh_with_transient_retry,_run_guest 与
_run_guest_goal 共用;host key 拒绝/认证失败/远端失败不重试;
审计 vm_ssh_transient_retry)。§5“执行器内部不重试”的唯一例外,
结论写入 docs/chv-production-readiness.md §3/§5/§7。
测试:test_chv_v3_fixes 新增 12 项(D1×3、D2×4、F1×5);旧代码
上 12 项中 9 项失败(余 3 项为守卫既有行为)。全量 test_chv*
470 测试通过。
2026-11-08 09:45:00 +00:00
host 65504ae8cb fix(chv): V-3/F1/F2 真机缺陷修复 + V-1/V-4 附带修复
V-3 快照/restore:
- snapshot 改传裸 URL(source_url= 是 restore 的键,服务端
  Could not extract path from URL);快照产物是目录,校验
  改为目录非空,登记计量/剪枝同步支持目录
- restore 起 VMM 前补 _restore_prepare:杀旧 VMM(登记的 +
  未登记跨实例扫描)并清旧 socket,与 _wake_prepare 对等
- hibernate 评估结论:快照 config.json 引用原盘,旧 stop 删
  盘致 restore 必失败;hibernate 的 stop 改 keep_disk=True,
  GC 不删有登记快照的 VM 的盘,restore 前预检快照引用的盘
  (snapshot_disk_missing fail-fast)

F1:re-wake 删旧盘——H5 删私钥致 re-wake 必然生成新 key 对,
旧盘复用时 cloud-init 不重应用新 seed,sshd 仍呈旧 key 而
known_hosts 钉新 key;wake 本就是冷启动,旧盘不是要保留的状态

F2:stop_vm 跨实例按 socket 进程扫描杀未登记 VMM
(/proc cmdline 精确 socket + VMM 二进制名 + 跳过自身/pid 1,
绝不误杀 ch-remote 与他人 VMM)

V-4:remote_command source 失败改 || exit 126 fail-fast;
guest-env 条目 owner 改归 SSH 用户(0600 不变),root 仍 root:root

V-1 附带:build.sh 预建 /app/work(1777 粘滞位 + stat 断言);
host.py default_codex_bin() 改 shutil.which,裸名不再让
health 报 ok:false

测试:新 test_chv_v3_fixes.py 23 项;旧快照测试按目录产物改写;
test_chv* 458 全过,全量 cloud 套件 1930 全过(skipped=8)
2026-11-08 09:45:00 +00:00
host ef206cf554 feat(chv-guest): 对齐 Muse P2——nspawn 单元 + broker + 浏览器子代理
- chv-cell:systemd-nspawn 单命令单元,--private-users=1000:65536
  (单元 root → 客机 chv),丢 8 项能力(含 SYS_PTRACE/NET_ADMIN),
  syscall 过滤扣 io_uring,遮蔽 /etc/chv 与 playwright,
  --network-veth(10.200.0.0/24 + NAT),白名单环境透传
- chv-broker:Unix socket + SO_PEERCRED(uid 范围 + pid ns 对照),
  白名单 ping/sync/browser;sync 只调 chv-sync(runuser -u chv)
- chv-browser:单元外独立进程,只暴露 open/snapshot/screenshot/
  close/ping,返回无障碍树快照(截断);evaluate/content 拒绝
- build.sh:装 systemd-container/iproute2/iptables,拷入三脚本,
  建 chv-browser 用户与两个 systemd 单元;vsock_notify 条件拷入
- buildinfo:内容项加 P2 四项,支持可选 extra_contents
- 测试:cloud/tests/test_chv_muse_p2.py 40 项全过;broker/browser
  真实 socket 回路冒烟通过(root 连 broker 被拒)
- 差距表:docs/chv-muse-p2-gap.md;真机验证待测试机空闲(round 11)
  本地做,不推、不合、不部署
2026-11-08 09:44:59 +00:00
host cef6353c85 fix(chv): restore 路径补 H7 net 校验+登记,seed 暂存文件走 atomic_file
restore_vm 此前既不校验 net 冲突、也不登记 net.json:
已登记 VM 的 tap/mac/ip 会被恢复出的 VM 静默复用,且
恢复出的 VM 自身不登记、后来的 wake 也看不到它,两边
都漏判。现与 wake 同款:_validate_restore 在起 VMM 前
校验冲突(net_tap_conflict + vm_failed 审计),
_restore_boot 在 restore 成功后登记 net.json,登记失败
审计 net_registry_write_failed + 拒绝恢复(P2-19 语义,
stop_vm 清半恢复 VM)。

hostkeys.write_seed/_apply_seed_extras 的 meta-data、
user-data、network-config 改走 atomic_file(mkstemp 0600
→ 写 → fsync → rename):user-data 含 host 私钥明文,
直接写 + 事后 chmod 会在 chmod 前以 umask 权限短暂可读;
半截文件本身到不了 ISO(唯一消费者 genisoimage 只在
write_seed 返回后跑),原子写同时堵住权限窗口与半截残留。

回归测试 6 个:restore 冲突拒起/恢复后登记/登记失败
拒起/无 net_json 不登记;seed 走原子写(0600、无 tmp
残留)/写失败不留半截文件。CHV 全套件 395 测试通过。
2026-11-08 09:44:59 +00:00
host 906f180277 docs(chv): L4/M6 取舍定案 + 部署核对清单
- L4:保持警告不改硬拒(CHV_NET 是手动直接启动命令透传值,
  与 API 的 CHV_NET_JSON 是两条路径;硬拒会断手动运维,
  误配代价只是 API 模式忽略 CHV_NET);写清兼容影响与
  将来改硬拒的前置条件;部署核对只设 CHV_NET_JSON
- M6:确认声明 + 审计就是本项机制,不假装已校验;部署核对
  加人工项(部署记录写明已核对租户数 = 1 与项目名一致,
  并复核 disk_reuse_experiment_allowed 审计)
- §11.4 加环境变量核对与残留尾巴审计抽查项
  (net_registry_write_failed / dirty_marker_write_failed /
  vm_net_registry_delete_failed 任一出现即先修宿主再启用)
2026-11-08 09:44:59 +00:00
host fb609acb50 feat(chv-guest): M4 Chromium 单独钉死 + /app 收紧为最小集
- Chromium 钉死:CHROMIUM_HEADLESS_SHELL_REV(纯数字修订号)
  设即钉死,buildinfo.py 校验读回的 ms-playwright 缓存目录名
  须恰好是该修订号,否则构建失败;generate/check 的 --verify
  也复核;未设时只记录、构建输出明说未钉死,BUILDINFO 记 null
- /app 最小集:build.sh 不再把整个 $REPO_DIR/cloud/ 拷进客机,
  只拷 host.py(只用标准库,不依赖 cloud/);REPO_DIR 预检
  不再要求 cloud/ 存在
- generate_lockfile.py 只读 BUILDINFO.versions 一事已在 to10 轨
  改写,本棒以合成 BUILDINFO 干跑复核(假版本 9.9.9 进 lockfile,
  宿主 git 1:2.43.0 未混入)并补钉死复核;真实 lockfile 产出
  仍待 V-9 真机构建,不编造版本号
2026-11-08 09:44:59 +00:00
host b3cd353a76 fix(chv): P2-20/P2-19/P2-17/P2-18 残留收尾 + NO_PROXY 合并
- P2-20:_guest_env_delivered 加专用锁,读写只走
  _delivered_secrets/_mark/_clear 三个入口,并发 hammer 测试钉死
- P2-19:_record_net_entries 失败发 net_registry_write_failed
  独立审计并返回 False;_boot_vm 见 False 即拒起(wake 随后清半醒 VM)
- P2-17:net.json 删失败发 vm_net_registry_delete_failed 审计;
  _write_dirty_marker 失败发 dirty_marker_write_failed 审计并返回
  False,stop 不抛的契约不变
- P2-18:新增 cloud/chv/atomic_file.py(mkstemp 随机名 + 文件
  fsync + rename + 目录 fsync),net.json/known_hosts/
  snapshots.json/pool registry/脏标记/spill 全部走它,固定 .tmp 清零
- H1 附带:NO_PROXY 实测确有覆盖 bug(env 重复赋值以后者为准,
  调用方 NO_PROXY 被 egress 的 localhost 值静默覆盖),改为合并
  单条发出;egress 已设时调用方代理变量(含小写)一律不发
- 测试:新增 cloud/tests/test_chv_residual.py(23 项),旧 closeup
  两处钉死旧语义的测试按新语义更新
2026-11-08 09:44:59 +00:00
host c94cb05157 fix(chv): known_hosts 22 端口写裸 host 行,修 provisioned 钉死失效
OpenSSH 默认端口只查裸 host 名、非默认端口只查
'[host]:port':known_hosts_line 对 22 端口也写
'[192.168.10.10]:22',ssh 永远匹配不上,报 Host key
verification failed、wake fail-closed 关 VM。keyscan
TOFU 输出裸行,lite9 没暴露。非 22 端口仍用括号形式。
2026-11-08 09:44:59 +00:00
host 82e4150e24 fix(chv): CHV 54 VmConfig 形态——payload.kernel/cmdline 纯字符串 + 磁盘显式 image_type Raw
真机 CHV 54.0.0 实测:旧顶层 kernel:{path}/cmdline:{args}
create 时 204 照放、vm.boot 400 'No bootitem provided';
补 payload 后又报 'Image type required for disk'(raw 盘
无魔数、探测失败),磁盘须显式 image_type,枚举原名
Raw(JSON 写小写 raw 报 unknown variant)。
2026-11-08 09:44:59 +00:00
host e7fe0d65e1 fix(chv): api_client 接受 204 无 Content-Length 响应
WSL 真机实测(CHV 54.0.0):vm.create 成功回 204 No Content,
且不带 Content-Length、无体;严格校验(P1-6)把合法成功当
失败拒掉,wake_vm 卡在 vm.create。204/304 按 HTTP 语义体长
恒为 0,不要求长度、不读体(keep-alive 下读会等到超时);
其它状态仍严格(无长度/截断/chunked 均拒绝)。
测试:test_chv_cover100 新增 3 项(204 成功、200 无长度仍拒、
_parse_status)
2026-11-08 09:44:59 +00:00
host af64f31138 feat(chv-guest): seed 附加项供客机用户与静态网络(wake 路径前置)
wake_vm 在 WSL 台架上跑通需要客机身份与网络:镜像本身不建
用户、tap 无 DHCP,缺 users 块的 VM 登不进去、缺 network-config
的 VM 拿不到静态 IP。最小补法(复用 write_seed 机制):
- hostkeys.write_seed 新增 user_data_extra(原样追加进
  user-data,供 users: 块)与 network_config(写 seed
  network-config 文件,0600);附加项含 runcmd: 即 ValueError
- config _seed_fragment:CHV_SEED_USER_DATA_EXTRA_FILE /
  CHV_SEED_NETWORK_CONFIG_FILE(只存路径)
- executor._seed_extras 在 wake 起 VMM 前读入,缺失即
  ChvFailure seed_extra_missing;provision_host_key 透传
- README §7 残留更新:guest-env 集成已做
- 测试:test_chv_gitea_sync 新增 5 项(写盘/禁 runcmd/
  配置映射/wake 带附加项/缺失 fail-closed)
2026-11-08 09:44:59 +00:00
host 540cbaf473 feat(chv-guest): Gitea 同步变量经 seed 进 guest-env(执行器集成)
- 新增 cloud/chv/gitea_sync.py:6 键白名单,三源合并
  (宿主 CHV_GITEA_* < 任务 gitea_sync < extra_env),
  必填 4 键缺失即 fail-closed,空即不同步
- ssh_transport:GITEA_TOKEN 进密钥集(argv 拒绝),其余
  5 键进 guest-env 集(split_guest_env)
- hostkeys.write_seed:guest_env 与 secret_env 合并写同一
  条目,仍无 runcmd、0600
- config:_gitea_fragment 产 gitea_sync_env(函数内 import,
  叶子模块顶层只许标准库)
- executor.wake_vm:起 VMM 前合并+校验(gitea_sync_incomplete),
  guest-env 随 seed 投递;provision_host_key 透传 guest_env
- worker:_run_attempt 仅对 CHV 执行器把同步变量并进 gateway_env
- 测试:cloud/tests/test_chv_gitea_sync.py 20 项
- 边界:tasks 表无 JSON 列,DB 往返丢任务 gitea_sync;
  生产主来源是宿主 CHV_GITEA_* 环境变量
2026-11-08 09:44:59 +00:00
host 706fe88f46 fix(chv-guest): seed user-data 不再自带 runcmd,防顶掉镜像钩子
sync-test 首轮实测:seed 的 runcmd 整体替换了镜像
/etc/cloud/cloud.cfg.d/99-chv-sync.cfg 的 runcmd(cloud-init
不跨配置类型合并,merge_how 救不了 conf.d),chv-sync
boot 钩子静默不跑、启动 clone 没跑。

- hostkeys.build_seed_user_data 不再发 runcmd;chmod 600
  已由 write_files 0600 保证;sshd 重启搬到镜像自己的
  runcmd(cloud-final,sshd 首次启动之后)。
- build.sh:99-chv-sync.cfg 的 runcmd 增加 restart ssh
  一行(在 chv-sync boot 之前)。
- README §5 同步硬性要求;回归测试 2 项(无 runcmd、
  带 secret 仍单 write_files 列表无 runcmd)。
- 针对性 147 项全过(test_chv_to10/gaps/secfix/fix/
  arch95plus)。

本地提交,未推未部署。
2026-11-08 09:44:59 +00:00
host e8cf356616 fix(chv-guest): 首启缺 key 时才生成 host key(B-23)
Minimal 底座 cloud.cfg 不含 ssh 模块,build.sh 又写
ssh_genkeytypes: [] 彻底关掉首启生成:客机无 host key、
sshd -t 失败、ssh.service 连败 5 次,SSH 全程不通(真机
冒烟 131s 未通,console 已到 login、ping 通、tap 正常)。
修正:99-chv-hostkey.cfg 改写首启 bootcmd,只在缺
ed25519 key 时 ssh-keygen -A;ssh_deletekeys: false 保留,
绝不重生成已预置的 per-VM key(bootcmd 跑在 seed
write_files 之前,预置 key 随后覆盖生成值)。README §5
同步修正;新增 BuildScriptTest 回归断言。
2026-11-08 09:44:59 +00:00
host 39c76c2e43 fix(chv-guest): 浏览器装系统路径(B-22)
Round 7 构建本身成功,但 BUILDINFO.versions.chromium 为空:
virt-customize 的客机 shell 里 HOME=/,Playwright 默认缓存
~/.cache/ms-playwright 落到根目录 /.cache(实测浏览器在
/.cache/ms-playwright/chromium_headless_shell-1248),而
build.sh 读的是 /root/.cache/ms-playwright(不存在),ls 读回
空文件;buildinfo.py 当时不校验 chromium 非空,静默放过,
事后 check_lockfile / generate --verify 兜底报未覆盖(exit 1)。
改:安装与读回都走 PLAYWRIGHT_BROWSERS_PATH=
/usr/local/share/ms-playwright(agent 运行时也须设同一变量,
否则 chv 用户在家目录找不到浏览器);buildinfo.py 加
playwright_browsers_path 字段,并校验 playwright=1 时
versions.chromium 非空;README 同步。
2026-11-08 09:44:59 +00:00
host c94bb02881 fix(chv-guest): apt 用 --no-install-recommends(B-21)
Round 6 真机构建在 Playwright 步 ENOSPC 失败:--install 默认装
Recommends,python3-pip 连带拉入 python3-dev → gcc/g++/
build-essential 全套,根分区 2.4G 用到 2.2G(95M 空闲),
headless-shell 下到 70% 写满。改走 --run-command apt-get
install --no-install-recommends,必需项显式列出(fontconfig、
openssh-client),两轮 apt 后 apt-get clean + 清 lists 收尾。
buildinfo contents 与 README 同步加 openssh-client/fontconfig。
2026-11-08 09:44:59 +00:00
host 7900b4b7b4 fix(chv-guest): gt 用绝对路径调用(B-20)
Round 5 真机构建在 gt 安装步失败:install.sh 已装好
/usr/local/bin/gt,但 virt-customize 的客机 sh 里 PATH 不含
/usr/local/bin,同一 --run-command 链里的 gt version 报
command not found,整个 virt-customize 退出非 0。
改两处为 /usr/local/bin/gt version(安装断言 + 版本读回文件)。
install.sh 自身的 SHA256 校验与二进制下载均已通过,不是下载问题。
2026-11-08 09:44:59 +00:00
host 7674f7396b feat(chv-guest): 轻量镜像 + Gitea 双向同步(停全量版,改 Ubuntu Minimal)
- build.sh 改轻量:Ubuntu Minimal 底座、apt 精简(git/ssh/cloud-init/
  python3/pip/curl/ca-certificates/xz-utils/fonts-wqy-microhei)、
  Playwright + chromium-headless-shell、去 B-16 +12G 扩盘;
  加 git + gt 1.0.0(官方 install.sh + SHA256 校验,GITEA_CLI_VERSION
  钉 1.0.0)与 chv-sync 启动钩子(cloud-init runcmd)
- B-19(新发现):dpkg freeze 的 ${Package} 会被客机 shell 展开
  成空,284 行全空白;加反斜杠转义,探针实测已出真实版本
- buildinfo.py:轻量 contents、chromium-headless-shell、gt_version
- generate/check_lockfile.py:gt/chv-sync 声明来源、headless-shell 映射
- chv-sync.sh(新):boot/pull/push/status,分叉/脏树失败关闭,
  凭证走 seed 盘 guest-env,不进镜像
- README §1/§2/§3/§4 改轻量口径,新增 §7 Gitea 双向同步
- tests:ChvSyncTest 6 项(本地 bare 仓当远端);针对性测试 144 项全过
2026-11-08 09:44:59 +00:00
host b83c5b2d8d fix(chv-guest): B-18 virt-get-kernel -o 是目录不是文件
- 第三轮真机构建:virt-customize 全程通过(Playwright 步已过),
  随后 virt-get-kernel -a disk.raw -o $OUT/vmlinux 失败;手动
  查 --help 确认 -o 是 output directory——旧写法会在 OUT 里
  建出 vmlinux 目录,后面的 test -s 文件校验必然失败,即使
  下载成功构建也会失败。
- 修复:-o 改为 $OUT,下载 vmlinuz-<ver> 与 initrd.img-<ver>
  后把 vmlinuz-* 移为 vmlinux 文件;initrd.img-* 留在 OUT 里
  作配套产物(与任务产物清单一致)。
- 同轮里 virt-get-kernel 首跑另报过一次 "file receive
  cancelled by daemon",同一盘手动重跑即成功(瞬时故障),
  此处失败重跑一次,与 B-05/B-06 重试口径一致。
2026-11-08 09:44:59 +00:00
host e656f63e6d fix(chv-guest): B-17 Playwright 安装加 --break-system-packages
- 第二轮真机构建实测:单次 virt-customize 在 playwright 步
  失败,pip3 install --no-cache-dir playwright 在 Ubuntu 24.04
  上报 PEP 668 externally-managed-environment 而拒绝安装;
  随后 python3 -m playwright 报 No module named playwright。
  此前 PLAYWRIGHT 默认 0,该步从未在默认构建里跑过,缺口
  被默认开启暴露出来。
- 修复:playwright 的 pip 安装与第一处 pip 安装同款口径
  (--break-system-packages,失败回落无 flag 再试),且只有
  pip 成功才跑 python3 -m playwright install --with-deps
  chromium(括号分组 + &&,失败即停,不再以 ; 带病续跑)。
- 第二轮中间证据:B-10 步已过(sshd -t 完成、99-chv.conf 与
  cloud-init hostkey 配置已写入、客机 /etc/ssh 无残留 host
  key;dpkg/pip freeze 已写 876/92 行)。
2026-11-08 09:44:59 +00:00
host 018bcda046 fix(chv-guest): B-16 真机构建扩根分区(云镜像根分区仅 2.4G 会写满)
- 首轮真机构建实测:单次 virt-customize 在 playwright
  --with-deps 装 g++/make 时报 No space left on device,
  根分区 /dev/sda1 仅 2.4G、已用 97%。
- 修复:qemu-img resize +12G 后 sgdisk 只扩 1 号分区
  (起始扇区实测取,不写死;14/15/16 不动),再 guestfish
  resize2fs;实测根分区 2.4G→14G、可用 12G、编号仍为 sda1。
- 不用 virt-resize:实测它重写分区表、把根分区从 1 号重编号
  为 4 号,而执行器默认 cmdline 是 root=/dev/vda1,重编号后
  无法启动。工具检查清单加 sgdisk、guestfish。
2026-11-08 09:44:59 +00:00
host 3b5dd7a473 test(chv-guest): 构建脚本测试夹具跟进 B-09 新契约
- 假 codex 二进制须报出版本号(codex --version 核对)
- 假仓库改为真 git 仓库,REPO_COMMIT 取其实测短 hash
  (旧 test123 非 hex,B-03 格式校验本应拒绝)
- 干跑行补 BUILDINFO.json 字样(断言依赖)
另:79ba56b(并行轨)已把 Playwright 改默认开启、单次
virt-customize、补 fonts-noto-cjk,本提交只补测试与干跑
文案,不动构建逻辑
2026-11-08 09:44:59 +00:00
host b8d68bd94c feat(chv-guest): Playwright 默认开启、单次 virt-customize、补 fonts-noto-cjk
- virt-customize 3 次调用合并为 1 次(VC_ARGS 数组按序执行;
  PLAYWRIGHT=0 时仍可显式关掉,freeze 步骤保留兜底)。
- PLAYWRIGHT 默认 0→1:浏览器常驻复用;最终 freeze 在
  Playwright 安装之后(B-08),BUILDINFO.versions.pip 含
  playwright,chromium 目录名照常记录。
- apt 清单加 fonts-noto-cjk(浏览器 CJK 渲染字体,不是 LaTeX;
  xelatex 仍不装)。
- 针对性测试:to10+gaps+secfix 94 项,91 过;3 项失败为
  7f18c2d 已有 fixture 陈旧(REPO_COMMIT=test123 非 hex),
  与本次改动无关,改前改后一致。
2026-11-08 09:44:59 +00:00
host bfc1010a24 fix(chv-guest): 客机镜像构建缺口补齐(B-02/B-03/B-04/B-05/B-06/B-07/B-08/B-09/B-10/B-13/B-15)
- B-10(实测):virt-customize chroot 里 sshd -t 必败,双因:
  无 host key(exit 1)+ 缺 /run/sshd(exit 255);修为
  mkdir -p /run/sshd + ssh-keygen -A 临时生成,断言通过后
  立删临时 key,镜像仍不带 host key(已在 WSL 真机预演验证)
- B-08:Playwright 装在第二次定制,须重写 pip freeze 否则
  BUILDINFO 里无 playwright;Chromium 以 ms-playwright 缓存
  目录名记录进 guest-versions-chromium.txt
- B-09:codex --version 须含 CODEX_VERSION;REPO_COMMIT 须
  等于 HEAD 短 hash;工作树脏即拒绝构建
- B-02/B-13:BUILDINFO 生成抽成 buildinfo.py(可单元测试),
  补 disk.raw/vmlinux sha256+大小、ubuntu 镜像 sha、cmdline、
  playwright 开关、image_sha256 字段
- generate_lockfile.py 改写:版本唯一来源改为
  BUILDINFO.versions(客机读回),codex 三件套取
  codex_version、/app/host.py 取 repo_commit、chromium 取
  versions.chromium;不再查构建宿主 dpkg/pip(旧方法不成立)
- check_lockfile.py 补强:条目格式、contents 全覆盖、冻结
  清单双向比对
- B-03/B-04 输入格式校验、B-05 curl 重试、B-06 哈希不符
  删文件重下、B-07 磁盘预检、B-15 set -euo pipefail
- 同步改 test_chv_to10.py:generate 不再查宿主,改断言客机
  版本来源 + 不回落宿主
2026-11-08 09:44:59 +00:00
host 7f83023fd2 test(chv): 补齐 chv 模块剩余覆盖到 100%(生产与实验分开计分) 2026-11-08 09:44:59 +00:00
host c15fc9b41f test(chv): 修复 isWorkerAlive 边界测试抖动(精确边界改确定性字段测) 2026-11-08 09:44:59 +00:00
host 2e789c0d48 feat-chv-closeup:收尾(executor 覆盖到 100%、合并/灰度准备,堆叠于 #264)
- 后端新增 cloud/tests/test_chv_closeup.py 85 项:唤醒失败
  (vm.create/vm.boot/API 超时/guest 就绪超时/host key 不匹配/
  provisioned 缺钉死)、恢复与快照失败、取消与清理(残留
  socket/登记/磁盘/密钥、脏标记)、中途死亡分类、只读
  execute 归类、入口校验、preflight 事后改写、防御性
  except、worker_adapter 剩余分支;executor.py 覆盖 100%。
- 前端新增 src/api/chv.closeup.test.ts 13 项:显式 false、
  undefined、可用性优先级、Workers 旧 bug 文案不复发、
  120 秒边界;控制按钮与新页面仍不做。
- 新增 tools/chv_merge_precheck.py(只读):逐个核 base/head/
  mergeable/CI/链衔接,实测 11 个 PR 全 NOT-READY(CI 全
  FAIL、mergeState 全 UNSTABLE),退出码 1,绝不合并。
- docs/chv-production-readiness.md 新增 §14:审计落盘运维
  runbook(定位/轮转/读取/清理,ADR-14 取舍不变)、mypy
  默认口径 2 错评估(沙箱验证过的标注修法,本轨不改
  其它链文件)、灰度三阶段可执行清单、V-1~V-9 检查表
  (全部未验证)、逐项评分。
- 安全语义不变:egress、key seed 投递、磁盘删除、默认
  provisioned、tap 校验、前端不绕后端白名单均未放宽。
- 只到 PR OPEN,不合并、不部署;CI 账单仍是硬门禁。
2026-11-08 09:44:59 +00:00
host f42c1f2b9b feat-chv-to10:往 10 分方向提升(类型/lint 清零、worker 适配抽取、审计落盘、lockfile 生成脚本、前端四态与统一文案、就绪清单 §13) 2026-11-08 09:44:59 +00:00
host 4fa94edd9b feat(chv): 架构/可维护性/前端只读侧推进——生产实验分离、配置片段化、VM 只读展示
架构:WarmPool 从 cloud/chv/pool.py 移到 experimental_pool.py,
生产残留清理彻底分文件到 cloud/chv/orphans.py(facade 直接读
registry 文件清理,不构造池、不碰 prewarm/acquire/release);
cloud/chv 与 cloud/sandbox 不再导出 WarmPool,旧路径一律
ImportError(CHV 未合并、无生产用户,兼容保留已无保留理由);
worker 改走 orphans facade,不再持有 _warm_pool;#215 对齐从
接口形状推进到 REPLACEMENT_POINTS 替换清单(R1/R2 可机械替换、
R3 永不替换,#215 模块当前不存在由测试钉住)。

可维护性:build_chv_config 拆成 base/ssh/network/quota/disk/
timeout 六片段(组装只做 dict 合并,键冲突即报错;38 字段集
与取值不变,单项非法报错文案逐字一致);ADR-12 模块职责图
与禁 import 清单(AST 钉住);cloud/chv/ 公开 API 全量类型
标注、无 Any 逃逸,并修正三处旧标注错误;死代码扫一遍
(删实验池已无调用的 _quarantine 委托与未用 _LOGGER)。

前端(只读侧,不做控制按钮):chv.ts 新增纯逻辑谓词与文案
(执行器精确匹配、附件守卫、VM 状态文案、列表徽标);列表
行新增 VM 已报告死亡徽标;详情对全部 CHV 任务显示 VM 行
(已报告死亡/未报告死亡,不猜 live);WorkersSection 与成本
卡沿用已有数据,不新开池管理/成本页;服务端未新增第二个
生命周期字段(持久化事实只有三项,chv_vm_dead 已是完整派生),
只把派生抽成 _chv_vm_dead_from_row 并补 goal 回落形态测试。
2026-11-08 09:44:34 +00:00
host 56a6241bbe feat(chv): 架构与代码质量 9.5+ 提升——长函数清零、WarmPool facade、#215 对齐、审计计数、只读 VM 字段、ADR-8~11 2026-11-08 09:43:59 +00:00
host 57cf397fe7 feat(chv): 架构与代码质量提升——WarmPool 定案、长函数提取、严格测试替身、Docker 同步守卫、配置统一校验、类型注解与 ADR
堆叠于 #246(feat-chv-secfix),只到 PR OPEN,未合并、未部署。
安全语义不变:egress、key seed 投递、磁盘删除、默认 provisioned、
tap 校验一律保留;前端零改动。
- WarmPool 定案为实验性(ADR-5):dispatch 永远冷启动,
  wired_to_dispatch 恒 False,acquire/resume 只保留实验接口,
  worker 仍调 reconcile_orphans 清理残留。
- 长函数提取:preflight 126→31、wake_vm 135→36、__init__ 69→31、
  build_chv_config 159→58;错误文案逐字不变。
- 严格测试替身:fake API 校验 VmConfig(任务盘+seed 盘、net
  无重复),fake SSH 校验 known_hosts 钉死;新增 5 项测试。
- Docker 同步守卫:8 个真实标记用例下 Docker 内联版与正典
  parse_goal_result 状态全等,改分叉即 fail。
- 配置统一校验:preflight 以 config_invalid 统一兜底端口/配额/
  超时/快照/host-key 模式(构造时已校验正常值,preflight 兜底
  事后改写);CHV_NET 与 CHV_NET_JSON 双设仍警告不硬拒。
- 类型与 lint:chv 叶子模块公开 API 补类型注解;stdlib 扫描
  揪出 executor 内 1 个真死 import(host_key_paths)并删除。
- ADR:docs/chv-architecture.md(ADR-1 至 ADR-7)。
测试:CHV 163 项全过;cloud 全量 1593 项三跑结果为 8 errors
(首跑详细日志因 tail 截断丢失)、全过、1 失败(浏览器代理
时序测试,与 CHV 无关),全量本身存在时序偶发,CHV 套件
确定性全过。
2026-11-08 09:43:17 +00:00
host 6a74d0182c feat(chv): 安全审计修复 High/Medium/Low(堆叠于 #239)
审计报告 ~/workspace/chv-security-audit/REPORT.md(No-Go,
Critical 0 / High 7 / Medium 8 / Low 5)代码层修复,mock
测试覆盖,真机动态验证一律未做、只列清单(见
docs/chv-production-readiness.md §11)。

High:
- H1 egress 代码门:代理地址校验、直连显式允许+审计、
  每 VM 独立 tap/mac/ip 校验、net 字段白名单;宿主防火墙
  列为部署清单,代码门+防火墙缺一不可。
- H2 网关 key 移出 argv:provisioned seed 盘客内文件
  /etc/chv/guest-env(0600)投递,传输层密钥进 argv 直接
  ValueError;keyscan 模式密钥投递 fail-closed。
- H3 任务盘删除:stop/recycle/cleanup 删 disk.raw(保留期
  0)+ 残留盘 GC,删失败审计+脏标记。
- H4 默认值改 provisioned:keyscan 只作显式 opt-in。
- H5 seed.iso 生成即 0600;宿主私钥 seed 盘建好后即删;
  崩溃残留扫描 cleanup_stale_secrets。
- H6 state_dir 默认出 /tmp(~/.local/share/.../chv-vms,
  preflight 保 0700);api-socket 组/其它可写即 fail-fast。
- H7 tap 隔离校验:net.json 登记+stop 释放,共享即拒绝审计。
Medium:M1 shlex 远程转义;M2 清理失败即拒起(脏标记);
M3 配额默认 50GB + 快照数/总量/保留期上限;M4 SHA256 必填
+ BUILDINFO versions 实测记录(事前 lockfile 列清单);
M5 host key/ preflight/失败审计补齐;M6 reuse 须声明单租户
项目;M7 容量计数只认连通 socket;M8 sshd 加固进 build.sh
断言。Low:L1 链接不跟随;L2 路径白名单;L3 失败审计;
L4 双变量警告+字段白名单;L5 预热盘/任务盘对应关系定义。
旧测试:实验室默认值与生产默认值区分标注;行为已变的旧
测试按新语义更新(容量死 socket、快照白名单、磁盘路径
白名单、网关 argv、reuse 租户声明)。
测试:新 test_chv_secfix 39 项;旧 117 项 + 2 项新增断言 =
158 项;worker 相关 129 项;前端 vitest 9 项;cloud 全量
1588 项(skipped 4)。
2026-11-08 09:43:17 +00:00
host 31fdcc51e0 feat(console): CHV production-grade frontend — worker availability, attachment guard, queue hint, build:console fix, vitest 2026-11-08 09:43:17 +00:00
host 3cf1562176 feat(console): CHV executor option in dispatch/env selectors + experimental note in detail/list
- DispatchSection: add cloud-hypervisor option (labelled experimental,
  default off); default stays docker; hint states a KVM-host CHV worker
  must claim the task (otherwise it stays queued; attachments are
  rejected by the backend at creation) and that the frontend only passes
  the executor value through, never bypassing the backend allowlist.
- EnvSection: same option, because the backend env-create allowlist
  (local/docker/cloud-hypervisor) does allow it; note states env
  allowlist excludes cloud.
- TaskListSection: add cloud-hypervisor to the executor filter so CHV
  tasks are findable; list rows already showed executor.
- TaskDetailPanel: pure display note for cloud-hypervisor tasks
  (experimental, default off, no VM controls); detail already showed
  executor from the task API.
- README: document the CHV console entry, experimental marking, and
  verbatim backend-error display.
- Rebuilt cloud/console.html from src (tsc + vite single-file build);
  no backend change: executor is already returned by _task_to_dict.
2026-11-08 09:41:42 +00:00
host 7320d693ba feat: CHV 审核修复 P2(范围恢复为全做)
P2-1:preflight reuse/CPU/内存校验块小提取为
_preflight_config_checks(纯移动,深耦合处如实停)。
P2-2:build_vm_command 降级为私有 _build_vm_command;
Docker goal 内联解析顶部加正典分叉说明 + 同步检查清单。
P2-3:gaps grep 文本断言改成真实 Worker._run_attempt
行为断言。P2-4:README/build.sh 口径对齐(章节顺序、
BUILDINFO 名字列表、Node.js 不装写实)。P2-5:stop_vm
删除失败记审计。P2-6:CPU/内存校验统一进 preflight。
测试:原 84 + 新增 33 = 117 项,mock,无真 VM。
2026-11-08 09:40:32 +00:00
host 7703695bad feat: CHV 审核修复(P0+P1,堆叠于 #230)
P0:seed 磁盘 CIDATA ISO 挂进 VmConfig 第二块只读盘;
restore provisioned 下复用钉死 known_hosts、缺失 fail-fast
绝不 keyscan;preflight 拦截 CHV_DISK_MODE=reuse(显式
实验二次确认 + 审计放行);SSH 目标选客机 IP 方案(显式
host > net 静态 ip > 显式转发宣称回环,三者皆无 fail-fast)。
P1:网关 extra_env 经 SSH env 前缀注入、worker 守卫收窄到
Local/CHV;取消/清理/看门狗接 CHV 通用路径;WarmPool
acquire 内 resume;容量门持久化计数;磁盘配额总量+余量
与已存在磁盘校验重拷;API 按 Content-Length 验完整性;
快照 file:// 验落盘再 shutdown;execute 死端口归类
vm_not_running。
P2 全部排除未做(用户范围收窄令,留待以后一轨)。
测试:原 84 + 新增 29 = 113 项,mock,无真 VM。
2026-11-08 09:40:32 +00:00
host f8f2034265 feat: CHV gap fill — worker breakpoint wiring, pool reconcile, per-VM host keys, egress validation, guest build script
Stack: #216 -> #221 -> this. Worker breakpoint branch now calls any
executor providing goal_resume_breakpoint_task (Local keeps its
original path, gateway tasks still loud-fail); WarmPool
reconcile_orphans is called on CHV worker startup and close with
audit-on-failure; per-VM SSH host keys are provisioned before VMM
start via cloud-init NoCloud seed (keyscan kept only as weak
fallback, CHV_HOST_KEY_MODE=provisioned|keyscan); CHV_NET_JSON is
validated in preflight and explicit direct egress is audited;
chv-guest/build.sh is now real steps with --dry-run and fails fast
without /dev/kvm. Tests: new test_chv_gaps.py (18), cloud full
1514 OK (skipped=4). No real VM verification: no KVM host.
2026-11-08 09:40:09 +00:00
host e2a70da5e1 feat: CHV 执行器优化(拆模块/去重复/SSH 钉死/池持久化/中途死亡分类)
- 拆模块:CHV 从 cloud/sandbox.py 巨类拆到 cloud/chv/(executor/
  pool/config/api_client/ssh_transport/disk/errors),sandbox 只留
  兼容 re-export,旧导入路径与新路径是同一对象
- 去重复:goal 解析、host 顶层参数、runner 超时抽成共享 helper,
  Local 与 CHV 在矩阵输入下结论全等(Docker goal-resume 变体
  有意保留内联版,见 PR 描述)
- 安全:SSH host key 按 VM 钉死(state_dir/<vm>/known_hosts,
  ssh-keyscan 首次捕获 TOFU),废除 no + /dev/null;CHV_SSH_USER
  空串与 CHV_SSH_PORT 越界直接拒绝,不静默 fallback
- execute 语义:只读已运行 VM,未运行报 vm_not_running,不为
  status 起 VM
- 预热池:registry 落盘、重启载入只当孤儿、reconcile 清理、
  损坏 quarantine;条目仍一次性,绝不复用脏 VM
- 长任务:VM 中途死亡判 interrupted(断点可续跑);中途心跳
  经评估不做(无客内进度信号可采)
- #215 未合并:只列复用清单,不复制模块

测试:原 42 项 + 新 24 项全过;相关旧套件与 cloud 全量 1496 项
全过(skipped=4)。验证仍是 mock + 干跑 + 单元测试,未做真机、
压测、安全审计;堆叠于 #216 之上,base 为 feat-cloud-hypervisor。
2026-11-08 09:40:09 +00:00
host 250c511bce feat: Cloud Hypervisor 执行器生产级 v1(cloud-hypervisor)
单任务单 VM:API 唤醒(preflight→vmm.ping→vm.create→vm.boot→SSH 就绪)、
暂停/快照/休眠等价/关闭/回收、预热快照池、每任务磁盘 copy、容量与磁盘配额门、
受控 egress fail-closed、VM 事件审计与分类失败;worker/server/autoscaler 接线
(executor=cloud-hypervisor,任务内 LLM 不可自选);默认关闭,不进生产路由。
未做真实 VM 验证:生产主机与本 VM 均无 /dev/kvm、无嵌套虚拟化,验证为 mock +
干跑命令 + 单元测试;真 VM、快照恢复、压测、安全审计见
docs/chv-production-readiness.md。CI 账单故障仍是硬门禁,本提交只到 PR OPEN。
2026-11-08 09:39:12 +00:00
host 8b2686548c fix: serialize concurrent PG schema init with advisory lock
ci / test (push) Successful in 23m44s
Startup race: concurrent init_db (cloud-server + worker) ran
CREATE TABLE / CREATE INDEX IF NOT EXISTS against a DB where the
object did not exist yet; the check-then-create is not atomic, so
both sessions created it and one died with UniqueViolation on
pg_type_typname_nsp_index (tables) or pg_class_relname_nsp_index
(indexes). Hit on the 37ba687 and 7983567 deploys (7983567 added
idx_tasks_parent); systemd restart healed it every time.

Fix (advisory lock, not catch-duplicate_object): init_postgres_schema
takes pg_advisory_xact_lock (key 20261108, released at its commit),
and server.init_db takes the session-level lock for the whole PG
branch so the _ensure_* objects outside POSTGRES_SCHEMA
(task_continue_messages, user_gateway_keys, task_attempts,
task_audit_loop_state) are covered too. Same idiom as the existing
RATE_LIMIT_SWEEP_ADVISORY_KEY sweep lock; key is distinct.

Tests: two new real-PG regression tests (skipped without
CLOUD_TEST_PG_DSN), 4 processes racing on an empty schema, for
init_postgres_schema and for full init_db; both fail on the
unfixed code and pass with the fix.
2026-11-08 05:49:52 +00:00
host 7983567491 feat: side-thread task kind (Muse role alignment phase 2)
ci / test (push) Successful in 25m2s
Tasks gain kind='main'|'side' (NULL=main). A side thread hangs under a
parent task, defaults to the local executor, never builds a worktree,
branch or container unless explicitly asked, and writes its conclusion
back to the parent via task_followups on terminal transition.

- server: kind validation + side-thread gates (parent required, no
  coordinator_parts/upload_id/environment_id, parent must not be a
  coordinator), local executor default, GET /tasks kind filter,
  /worktree 404 and /fork /merge /pr 409 for side threads.
- worker: side-default shunt in _run_attempt (no-worktree scratch cwd,
  in-memory plan=1 when a repo is present, seed/checkpoint skipped),
  _writeback_side_thread, marker task-create kind field + inheritance,
  side threads excluded from marker spawn counts.
- host/sandbox: --no-worktree plumbing for dispatch/goal/popen
  (Local + Docker), scratch cwd work/side-threads/<task-id>.
- console (classic only): kind filter + [旁聊] rows + '开旁聊' entry,
  side-thread dispatch mode, side-thread list in detail, merge/PR/fork
  hidden for side threads; build exit 0, console.html sha df39db5a.
- tests: new test_sidethread.py (29 tests) + kind backfill tests in
  test_p2_migrations.py; full cloud suite 3900 tests OK (skipped=13).

Design: verification/codex-muse-role-alignment-design-20261108.md
Summary: verification/codex-muse-role-align-p1p2-20261108.md
Local only: not pushed, not merged, not deployed.
2026-11-07 20:51:23 +00:00
host f6df76ee8f feat: unify coordinator semantics (Muse role alignment phase 1)
Platform coordinator.py is the single source of truth; the skill
coordinator template (templates/roles/00-coordinator.md + SKILL.md
appendix 00 + body) now derives from it instead of describing a
second, model-played coordinator (U1-U13).

- server: _create_task accepts parent_task_id (404/400 checks,
  coordinator-under-coordinator rejected); follow-ups to a running
  coordinator return 409 at entry (_create_followup /
  _deliver_to_thread) with documented alternatives (U14/U15).
- tests: 8 new coordinator tests (depth limit, lineage, replay,
  follow-up 409); appendix sync/provenance/transplant suites green.
- check_appendix.py: 12 chapters match templates/roles/.
2026-11-07 19:43:03 +00:00
host 4d3ea048a5 docker: pin tenant networks to 172.16.0.0/16 via explicit --subnet
ci / test (push) Successful in 35m1s
Tenant networks were created bare (docker network create <name>),
letting Docker's default pool hand out subnets outside the iptables
8889 allowlist (172.16.0.0/12). The smoke tenant landed on
192.168.32.0/20, so containers never reached the egress proxy and
every model turn timed out at 600s twice.

Fix (B): derive a deterministic /24 inside 172.16.0.0/16 from
sha256(network name) with linear probing on IPAM overlap, max 32
probes. 172.16.0.0/16 is the one /16 in the allowlist Docker never
auto-assigns (default pool starts at 172.17.0.0/16). No persistent
state; capacity 256 tenant networks per host, explicit failure when
exhausted. Pre-existing out-of-range networks are reused as-is and
need manual removal (see README).

Tests: 7 new (candidate properties incl. wrap-around, pinned argv,
overlap probe, exhaustion, empty name).
2026-11-06 22:00:52 +00:00
host 3e0ff898e0 feat: wire native Codex UI as /console entry, keep classic console at /console-classic
ci / test (push) Successful in 45m25s
- Vendor codex-ui-stack host/ as cloud/codex-ui-host/ (original/ not vendored, 650MB)
- Bridge emulates 7 methods missing in codex 0.164.0-alpha.9, exposes 29
  experimental-protocol methods (150 -> 179), Linux binary candidates,
  read-only POST /__codex_git
- GET /console 302s to the UI host (:8095) when reachable, else falls back
  to the classic React console; GET /console-classic always serves it
- Alignment tables: docs/codex-native-ui-alignment.md
- Tests: test_console 7, new test_codex_ui_host 4, handler method pin 247 -> 249
2026-11-06 19:03:35 +00:00
host 41f3985248 console: unify goal mode to no-time-limit only (port of 395dffb onto 37ba687)
ci / test (push) Successful in 40m37s
DispatchSection keeps a single 'goal 模式' checkbox (the former
invincible option): checking it sends goal_mode=1 plus
no_time_limit=1. TaskDetailPanel drops the '无敌版' label.
Ported verbatim from feat-console-goal-unify commit 395dffb
(base 622c51e); console.html rebuilt from cloud/console-react
with npm run build:console (tsc+vite pass) and synced verbatim
from dist/index.html (sha256 daba1941...).
2026-11-06 17:09:34 +00:00
host 37ba6876bf gap-3 test: assert resume-write behaviour, not the NOT NULL bit
ci / test (push) Successful in 55m32s
- test_column_notnull_probe_sees_gap3_outcome now branches on the
  post-ensure probe: when outcome is relaxed (PG; SQLite 3.53+)
  the resume write must land and read back NULL; on older SQLite
  the ALTER is swallowed and INSERT OR IGNORE drops the row
  (version-dependent boundary, not a migration failure).
- attempt_ledger.py comments updated: ALTER COLUMN DROP NOT NULL
  works on Postgres and SQLite 3.53.0+, swallowed before that.
- PG proof summary section 3.9/8 corrected to the same boundary.
2026-11-06 05:24:20 +00:00
host 2fcde375a4 PG proof: fix task_attempts migration on real Postgres 16.15
ci / test (push) Failing after 33m23s
- attempt_ledger.ensure: relax gap-3 outcome NOT NULL on Postgres
  (ALTER COLUMN outcome DROP NOT NULL, probe-gated); without it
  every resume write on a gap-3-migrated PG table fails with
  NotNullViolation. SQLite keeps NOT NULL (no such ALTER).
- db.PgCursor: PRAGMA table_info fake rows had the notnull flag
  inverted (NO -> 0); now matches sqlite semantics (1 = NOT NULL).
  No caller read row[3] before, so this was latent.
- ledger_onboarding: stale 'PG path unverified' notes updated to
  point at the real-PG proof.
- tests: pragma_info notnull pin (fake driver) + _column_notnull
  probe pins (fresh + gap-3 SQLite).

Proof: 28/28 checks on real Postgres 16.15 (see verification/
codex-task-attempts-pg-proof-20261106.md).
2026-11-05 21:11:56 +00:00
host 698398dafb v2 rehearsal: CI checks out the pushed ref instead of the default branch 2026-11-05 02:45:36 +00:00
host adc2a02f6c v2 rehearsal: FLAG-3 order note-before-notice on first-turn co-pending (fix effective order, pin with test) 2026-11-05 02:45:09 +00:00
host 6a70775ad9 FLAG-1 unified task_attempts schema (single canonical DDL + 3-shape migration)
User decision 2026-11-05: unified schema, rejecting the rehearsal
runtime column-union workaround and a ledger rename. One definition
(cloud.attempt_ledger.TASK_ATTEMPTS_DDL, 12 columns) shared by
cloud.attempts and cloud.db.POSTGRES_SCHEMA; ensure builds the
unified table fresh and migrates old resume, gap-3 ledger, and
rehearsal shapes in place with rows intact. aggregate counts
ledger rows only (outcome NULL = resume row, never counted).
SQLite verified by 8 new tests; Postgres real-DB upgrade path
explicitly NOT verified (see batch summary). Local commit only:
no merge, no push, no deploy.
2026-11-05 02:22:47 +00:00
host 6d009af48f rehearsal: ruff production 0 (drop unused agent_def os + server AuthStore imports) and quote 8 unquoted env keys in main-side test tearDowns (latent NameError) 2026-11-04 21:38:42 +00:00
host da027f8628 rehearsal: re-pin handler accounting 244->247 and longfunc inventory 17->18 (main-side _routing_shadow + 2 methods, zero source methods lost; same re-pin precedent as 34b9a34) 2026-11-04 21:36:18 +00:00
host 1eefe17474 rehearsal: union task_attempts schema (main old DDL + gap-3 ledger cols), relax 2 hook no-table asserts to no-rows, gateway-env fake tolerates main routing reads, extend single-writer fixture list by name (test-only inserts) 2026-11-04 21:23:25 +00:00
host f76a566aa8 rehearsal: test stub create_thread accepts instructions (main-side dispatch interface; 2 host errors fixed, no production change) 2026-11-04 21:06:53 +00:00
host ce98aaa448 opensource-align2: engine 0.164.0-alpha.9 -> 0.166.0 (schema re-derived, method map pinned)
- protocol/ bundles re-derived from official 0.166.0 binary
  (generate-json-schema); v1 83 defs, v2 665 -> 677 defs,
  0 removals; all 21 host methods present, params refs unchanged
- README pin + start.sh comment follow the verified binary
- docs/upstream-166-alignment.md: 0.166.0 alignment record
- tests/test_host_protocol_mapping.py: 21 host methods pinned
  against protocol/ bundles (corrects alignment table's 17-count:
  18 requests incl. initialize + 3 inbound notifications)
- config.example.toml: [[skills.config]] disable semantics doc
  comment only (no effective config change)
- No production binary touched; no push, merge, or deploy.
2026-11-04 21:04:07 +00:00
host 6ba822daa2 gapfill2: worker/sub90 coverage tests, G7 rollback branch, G5 caller-contract docs
H1 worker.py 92%->94% (277->210 miss): 35 real-assertion tests
covering goal-signal, tenant/env, followup, poll/wait,
process/watchdog and injected defensive branches; prod code 0 changes.
H2 sub-90 sweep: approval_timeout 100%, merge_gate_hard 100%,
worker_sweep 98% (only __main__ line 174 left); 14 tests.
H3 G7 rollback except:pass (server.py:6615-6616) covered by an
injected rollback-raising connection; original error still propagates,
status stays completed, retry succeeds; no semantics change.
H4 caller contract documented only (docstrings in _audit_scorecard
endpoint, check_baseline_stale, build_scorecard, baseline store):
current_main_head caller-supplied, any string as-is, no format checks,
missing/empty treated as not passed with no stale determination at the
endpoint, always 200, overall never rewritten; no new validation or
rejection, no response-structure change. 3 doc tests pin the wording.
H5 design notes (no decisions, no code changes) live in
verification/code-to10-gapfill2-design-notes.md, referenced by the
batch summary.
No bug found by the new tests; no existing assertion touched.
2026-11-04 21:04:06 +00:00
host a1a50f1e81 gapfill G7: make _merge_task status commit and success audit atomic (same connection, audit_on_conn, one commit; audit failure rolls back to completed instead of merged-plus-500; ledger-head IntegrityError retries whole segment 5x mirroring AuthStore.audit); success semantics unchanged 2026-11-04 21:04:06 +00:00
host 5e1782be69 gapfill G6: nail CloudExecutor and argv-only visibility gaps with tests only (pending_mirror_to_host_loop never claims applied; server passes argv-only, host verify gate blocks it, version gap plus leftover signal file are the observable trace); no production change, no invented channel 2026-11-04 21:03:54 +00:00
host 0f0fcd3242 gapfill G2 (goal): cover all 15 missing goal_live_update edge branches (write validation, bad applied_version fallback, non-dict signals, consume failure paths, apply CAS null-version branch and CAS miss); directed coverage 81% -> 100%, production code untouched 2026-11-04 21:03:54 +00:00
host 85ce1def7d gapfill G5: wire optional ?current_main_head drift check into GET /audit-scorecard (caller-supplied only, no git/subprocess; absent param means no staleness verdict, verdict never rewrites overall); endpoint tests for passed/absent/empty 2026-11-04 21:03:54 +00:00
host 7962135395 gapfill G4: cover caps.py:54-55 env-get-exception fallback and quota.py:73-74 illegal-env fallback (A9 subset gaps); line numbers verified unchanged after rebase 2026-11-04 21:03:54 +00:00
host 65e8ed3d64 gapfill G3: unify all 5 private row_get onto peer_messages.row_get (approvals, automations, marker_tools, todos, wait_ops; resident import retargeted); semantics identical on None/dict/sqlite3.Row, identity tests added 2026-11-04 21:03:54 +00:00
host b46bf8d7e0 gapfill G1: remove 5 ruff F401 unused imports (3 unused os in production files, 2 in tests); no assert lines changed, ruff all cloud now 0 2026-11-04 21:03:54 +00:00
host 5f9e3c69d9 code-to10 reconcile: fix pre-existing worker F821 in playwright skipped-modified log branch
Target-line bug, not introduced by the replay: Worker._tenant_dirs
only receives project_id, yet the script_skipped_modified log line
used task.get("project_id"), raising NameError whenever seeding
reported a tenant-modified script (the refreshed sibling branch was
already fixed to project_id with its own regression test; this test
only covered the refreshed branch, so the full suite stayed green).
Fix mirrors the sibling (project_id) plus a regression test for the
skipped branch. Ruff F821 in worker.py is thereby cleared.
2026-11-04 21:03:54 +00:00
host da7a76d0e4 code-to10 reconcile: re-pin handler accounting and longfunc inventory for the unified line
Target keeps the 6-mixin split, so the source line's 239/223/16 and
its mixin-homed 17-method list do not apply here. Recomputed by AST
on this line: handler accounting 244 total / 150 in server.py /
94 moved, no duplicates (243/149 + _update_goal_task); longfunc
still 17 methods with the same names, 16 homed in server.py and
_full_auto_execute in handler_fullauto.py, plus module-level
migrate_tasks_table in server.py (114 lines). No method split or
dropped; both tests' docstrings state the re-pin explicitly.
2026-11-04 21:03:54 +00:00
host 79835cf3c1 code-to10 v5: fix November date failure in arch-converge quota gate fixture (fixture day follows current UTC month; assertions and gate semantics unchanged; frozen-semantics header updated explicitly)
(cherry picked from commit 073950043ed65039e19be8a4b6d725a44a662879)

Reconcile-note: this datefix was missing from the solidify line (aa30d40's test_arch_converge.py had no _current_month_day and still failed in November, while 10023fb/6841f28 contained it); added here as the separately-labeled fix for that replay omission, per the reconcile brief.
2026-11-04 21:03:54 +00:00
host b3f3f8bcab code-to10 goal live update: POST /tasks/{id}/goal updates a running goal loop at the next round boundary
Server writes goal + monotonic goal_version + task_goal_history in one
transaction (CAS on version, approve_merge only, new-semantic goal tasks
only, terminal/merged 409, same-goal noop). Worker mirror thread (30s)
and breakpoint-resume claim hook write the update as a signal file next
to host-state.json; host run_goal_loop applies it at round boundaries
(top of round and before the declaration check, so a declaration made
for the old goal in a turn during which the goal changed is voided),
with an explicit old->new notice, same thread/worktree, rounds/usage/
budget/failed counters untouched. handler method accounting is a
contract update: 239 total / 223 mixins / 16 in server.py.

(cherry picked from commit 6841f287219d2b36cfbb8803642344b84dae4377)

Reconcile-port: handler_lifecycle.py contents redirected — _update_goal_task method + _goal_update_reject/_goal_signal_status pure functions + goal_live_update import into cloud/server.py (target keeps 6-mixin split); _task_to_dict goal fields into cloud/handler_support.py; migrate columns into cloud/server.py migrate_tasks_table; test patch target handler_lifecycle→server; test_handler_split_conformance.py kept at target version, to be re-pinned for the unified line in a final commit.
2026-11-04 21:03:54 +00:00
host 51b26633b8 code-to10 v7 mech merge fix: silence mypy misc redefinition on Protocol fallback in gate_verification.py (item6-introduced), no runtime semantics changed
(cherry picked from commit 9f8b95fa03643db7bef028b9877cc1c1bc78ef4e)
2026-11-04 21:03:33 +00:00
host a4c92d888c code-to10 v7 mech merge fix: SqliteScorecardGainLedger uses cloud.db.connect instead of sqlite3.connect (arch conformance layer rule), no semantics changed
(cherry picked from commit bde36a84880574c2297aaee9ed08312cd0e2c0fc)
2026-11-04 21:03:33 +00:00
host 83485b9316 code-to10 v7 mech merge fix: wrap two merged docstring lines over 120 chars (E501) in audit_scorecard.py, no code semantics changed
(cherry picked from commit a4fdc78930f597e7793a054c1775842fe5496143)
2026-11-04 21:03:33 +00:00
host 81e1448c6d v7 mech-7: scorecard user_side_items + three-table rule (code unchanged, production forced not_pass on user-side pending/unknown/invalid)
(cherry picked from commit 59b4c49a896972501aeeb8472a9fc2918ec226fa)
2026-11-04 21:03:33 +00:00
host c6a3a22606 v7 mech-2: split scorecard into code/production/product tables
(cherry picked from commit 67b7f5e42d001b655aef3e04e1d3c1d98166b98f)

Reconcile-port: handler_admin.py hunks redirected into cloud/server.py _audit_scorecard (target keeps 6-mixin split; scorecard module itself applied cleanly).
2026-11-04 21:03:33 +00:00
host 80fbf76e2d code-to10 v7 mech-4: scorecard evidence ledger head + row ids, injectable signature verifier (fail-closed)
(cherry picked from commit bcd385c6979db77abea458af66e21ef891453064)
2026-11-04 21:03:33 +00:00