Files
soft_quay/docs/tasks/T-004.md
T

3.6 KiB

id, title, phase, deps, status, created, issue, context_ref, claim_branch, work_branch, write_paths
id title phase deps status created issue context_ref claim_branch work_branch write_paths
T-004 建立 Phase 0 双目标编译与依赖版本闸门 0
T-001
DONE 2026-07-16 null 6f920eb457 null agent/codex/T-004
docs/tasks/T-004.md
scripts/check_go_versions.py
scripts/verify_phase0.ps1
scripts/verify_phase0.sh
.gitea/workflows/phase0-build.yml
init.ps1
init.sh
docs/00-ai-start-here.md
docs/03-tech-stack.md
docs/current-state.md

问题 / 背景

Phase 0 已有可编译骨架、core 状态/事件模型和两个 Gio 窗口,但验证命令仍分散在文档与人工操作中。需要一个可重复执行的本地/CI 闸门,防止 modern、Win7 或 core 兼容性在后续任务中悄然破坏。

方案

  1. 新增 Windows PowerShell 与 Unix shell 两个等价入口,统一运行治理检查、core 边界检查、Go 1.20 core vet/test、modern UI/platform 测试与构建、win7 UI/platform 测试与构建。
  2. 新增 Python 标准库依赖版本检查:校验 go/workspace 指令与 Gio 锁定版本,并用 Go 1.20.14 的 go list -m -json all 拒绝 core/win7 依赖声明 Go 1.21+。
  3. Windows 构建统一使用 CGO_ENABLED=0、-trimpath 与 Windows GUI subsystem linker flag。
  4. 根 init 脚本的 VERIFY 命令改为调用 Phase 0 闸门。
  5. 新增 Gitea Actions workflow 模板,在 push/PR 使用同一 Unix 验证入口;runner 未启用时以本地同命令为验收证据。

验收要点

  • scripts/verify_phase0.ps1 在当前 Windows 环境全绿。
  • Git Bash scripts/verify_phase0.sh 在当前环境全绿。
  • 闸门包含 core vet/test、core 边界、modern 构建、win7 Go 1.20.14 构建、UI/platform 测试和治理检查。
  • 版本检查能拒绝 core/win7 的 Go 1.21+ 模块,并验证 Gio v0.10.1/v0.6.0 锁定。
  • .gitea/workflows/phase0-build.yml 只读权限、关闭 checkout 凭据持久化,调用同一本地入口。
  • ./init.ps1 与 Git Bash ./init.sh 通过新的完整 VERIFY 路径。

边界(不改什么)

  • 不启用或配置远端 runner,不宣称远端 CI 已运行。
  • 不升级 Go、Gio 或其他依赖版本。
  • 不实现 Phase 1 业务功能。
  • 不写入密钥、token 或真实发布配置。

协作约束

未启用 Gitea;本任务在 agent/codex/T-004 分支串行执行。CI 与本地必须复用同一脚本,不得维护两套不同验证逻辑。

执行记录

  • 2026-07-16:新增 scripts/verify_phase0.ps1 与 scripts/verify_phase0.sh,统一运行治理、core 边界、Go 1.20 core vet/test、modern/win7 adapter 测试与双目标 GUI 构建。
  • 2026-07-16:新增 scripts/check_go_versions.py,校验 root/core/modern/win7 的 go 指令与 Gio 锁定版本,并强制使用 Go 1.20.14 扫描 core/win7 完整模块图。
  • 2026-07-16:版本检查确认 13 个模块记录均声明 Go 1.20 或更低;内置 self-check 明确接受 1.20、拒绝 1.21。
  • 2026-07-16:Windows 构建统一使用 CGO_ENABLED=0、-trimpath、-H=windowsgui;根 init 脚本 VERIFY 已切换到完整 Phase 0 闸门。
  • 2026-07-16:新增 .gitea/workflows/phase0-build.yml,使用只读权限、禁用 checkout 凭据持久化并复用 Unix 本地入口。远端 runner 未启用/未验证,不宣称远端 CI 已跑绿。
  • 验证通过:./scripts/verify_phase0.ps1。
  • 验证通过:Git Bash bash scripts/verify_phase0.sh。
  • 验证通过:./init.ps1 与 Git Bash ./init.sh,均执行完整 Phase 0 闸门。
  • 验证结果:core Go 1.20.14 vet/test、modern Go 1.25.0 Windows amd64 GUI 构建、win7 Go 1.20.14 Windows amd64 GUI 构建、两个 adapter 测试、治理与边界检查全部通过。