Skip to content

test(platform): 修复 macOS 测试基线#518

Merged
deepcoldy merged 2 commits into
deepcoldy:masterfrom
LucasIcarus:agent/fix-vc-test-platform
Jul 19, 2026
Merged

test(platform): 修复 macOS 测试基线#518
deepcoldy merged 2 commits into
deepcoldy:masterfrom
LucasIcarus:agent/fix-vc-test-platform

Conversation

@LucasIcarus

@LucasIcarus LucasIcarus commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

改了什么

  • 恢复 macOS 全量单测基线,并按真实平台能力区分“应跨平台执行”和“确实 Linux-only”的测试。
  • VC lifecycle 测试固定使用受支持的 Linux receiver policy,同时继续调用真实 isolation evaluator;macOS production eligibility 的 focused test 仍验证 fail-close。
  • V3 distillation 的宿主无关测试使用确定的 Linux /etc 快照、平台判断和跨平台 stock-Claude 启动器;5 个依赖 bwrap、PID namespace 或 Linux boot identity 的内核级用例使用 skipIf 明确标记。
  • macOS 临时目录断言使用 canonical path,兼容 /var/private/var
  • V2 冻结投影器使用真实路径校验 OutputRef containment:允许指向同一物理目录的祖先别名,同时拒绝 run 目录内指向外部的 symlink,并打开 canonical child。
  • plugin-init 测试夹具兼容 npm 11 的数组格式与 npm 12 的包名键控对象格式。

原因

macOS 基线中的测试覆盖不同边界:VC lifecycle、V3 policy/清理逻辑、npm fixture 和路径投影均可在 macOS 可靠执行,不应整体跳过;只有依赖 Linux 内核隔离能力的用例应明确显示为 skipped。

V2 的 /var/private/var 差异属于同一物理目录的路径别名。使用 canonical containment 既修复合法读取,也收紧了 symlink 越界读取边界。

影响面

  • VC production 判定不变:仍只接受 sandbox: true + Linux + pty/tmux,macOS managed receiver 仍为 fail-close。
  • V3 distillation production 仍为 Linux-only;测试 seam 默认读取真实宿主状态,daemon 调用行为不变。
  • V2 改动仅影响已退休 workflow v2 的只读投影与归档验证路径,当前 v3 执行不受影响。旧 archive 的静态验证不变;若 live source 使用 macOS 路径别名,source-aware projection 会采用修正后的结果。
  • 不涉及其它 CLI 共用启动路径、IM 会话、卡片或 dashboard UI。

实际验证

  • pnpm build:通过。
  • pnpm exec vitest run --project unit test/v3-distillation-runner.test.ts --reporter=dot:28 passed,5 skipped。
  • pnpm test -- --reporter=dot:600/600 test files passed;9411 passed,15 skipped,0 failed。
  • pnpm daemon:restart && pnpm daemon:status:通过,3 个进程均 online。

@LucasIcarus
LucasIcarus requested a review from deepcoldy as a code owner July 17, 2026 16:55
@LucasIcarus LucasIcarus changed the title test(vc-agent): 解耦会议生命周期测试与宿主平台 test(platform): 修复 macOS 测试基线 Jul 17, 2026
@deepcoldy
deepcoldy merged commit 112d41a into deepcoldy:master Jul 19, 2026
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