Gate-as-Code

v0.8.6 起,Gate-as-Code 用一份可分享的 TOML 描述「任务何时算绿」——与夜间队列、技能 stage gate、LHT verify 共用同一套谓词库(predicate library)。

是什么

维护者规格见产品仓 docs/harness/gates/

CLI

# 校验内置预置
zagens gate validate --preset rust-cargo-smoke

# 校验自定义文件(CI 友好 JSON)
zagens gate validate --file path/to/my-gate.toml --json

# 列出内置预置
zagens gate list

入队时挂门禁:

zagens queue add "修复测试" --gate-preset rust-cargo-smoke
zagens queue add "检查" --gate-file ./gates/my.toml

详见 夜间队列

扁平门禁示例

schema_version = 1

[harness]
id = "my-team-rust-gate"
description = "Compile and test before merge."

[verify_budget]
max_retries = 2
timeout_ms = 600000

[rollback]
strategy = "snapshot"

[[verify]]
id = "compile"
predicate = "tests_pass"
args = { toolchain = "cargo", cmd = "cargo check" }

[[verify]]
id = "tests"
predicate = "tests_pass"
args = { toolchain = "cargo", cmd = "cargo test" }

与 LHT / 技能的关系

场景 用法
夜间队列 --gate-preset / --gate-file / 内联 --gate
技能 stage gate load_skillharness.toml,或 [long_horizon.stage_gate].manifest
LHT 完成门 面板/预置仍可配置 verify;long-refactor / long-fix 等预置会写入 enforce 产品门

桌面侧栏 Agent 体检zagens doctor --tools 会聚合门禁/verify 相关 telemetry。

建议

相关:夜间队列 · LHT · LHT 设置 · Agent 体检 · CLI