fix: add commander playwright wrapper

This commit is contained in:
Codex
2026-05-23 09:11:39 +00:00
parent a0fb63c098
commit 5062df64a4
9 changed files with 655 additions and 1 deletions
+4
View File
@@ -146,3 +146,7 @@
## T28 Host Codex Commander Skeleton Contract
阅读 `AGENTS.md``docs/reference/host-codex-commander.md`,然后用 cli 手动测试以下内容:运行 `bun scripts/host-codex-commander-contract-test.ts`,确认输出 `ok=true`;运行 `bun scripts/cli.ts commander contract`,确认返回 `phase=source-contract``serviceId=host-codex-commander``daemonImplemented=false``liveOperationsImplemented=false`,且 required capabilities 包含 host Codex 进程发现/启动计划、SSH/PTY/stdio bridge、prompt guidance、trace summary、#20/#46 入口和 ClaudeQQ 高风险审批入口;运行 `bun scripts/cli.ts commander plan --dry-run --session-id primary`,确认所有 top-level plan 均为 `mutation=false`start plan `enabled=false`,不会打开 SSH/PTY/stdio、不会注入 prompt、不会发送 ClaudeQQ;运行 `bun scripts/cli.ts commander plan`,确认非 dry-run 返回非零状态和 `error=dry-run-required`;运行 `bun scripts/cli.ts commander approval request --action code-queue-task-interrupt --task-id <taskId> --reason '<reason>' --dry-run`,确认只生成 ClaudeQQ 审批草案且 `claudeqq.mutation=false``sendImplemented=false`;运行 `bun scripts/cli.ts commander approval request --action read-token-file --dry-run`,确认返回 `validation-failed`。本测试不得部署、不得重启 Code Queue backend、不得 cancel/interrupt 运行任务、不得读取或输出 token 明文。
## T29 Playwright Commander Wrapper Contract
阅读 `AGENTS.md`(本项目 `AGENTS.md` 同时承担 `SKILL.md``scripts/cli.ts``scripts/playwright-cli.ts` 的解释职责)和 `docs/reference/cli.md`,然后用 cli 手动测试以下内容:运行 `bun scripts/playwright-cli-contract-test.ts`,确认输出 `ok=true`,并确认 `externalSkill` 字段明确记录外部 `~/.agents/skills/playwright` 是否仍是 passthrough/docs mismatch。运行 `bun scripts/playwright-cli.ts help`,确认帮助写明 wrapper 是短生命周期 JSON CLI、默认 headless、`--session` 只保存 storageState、不支持长驻 element-ref daemon,并给出 `xvfb-run -a` headed 兜底;该兜底依赖 `xvfb-run``xauth`。运行 `bun scripts/playwright-cli.ts --session=hwlab-dev screenshot http://127.0.0.1:16666/ /tmp/hwlab-dev.png --dry-run`,确认 `headless=true``sessionId=hwlab-dev``mutation=false`,且不会调用上游 `npx playwright`。运行 `bun scripts/playwright-cli.ts --session=hwlab-dev click e3`,确认返回非零状态和结构化 `unsupported-command`,下一步建议包含 `screenshot/open``xvfb-run -a`。在有可访问测试页面时运行 `bun scripts/playwright-cli.ts screenshot https://example.com /tmp/unidesk-playwright-example.png`,确认截图文件生成且 JSON 中含 `status``finalUrl``title``sessionSaved=true`;该测试不得访问 HWLAB 业务代码、不得部署、不得重启 Code Queue、不得读取或输出 token/secret。