Require CLI provenance without constraining agent reasoning

Why: Agents must use configured CLIs for implementation and testing, while remaining free to inspect, plan, test, and iterate within bounded scope.

Evidence: Task-card contract tests and the full 430-test governance discovery pass with 19 existing skips; diff-check passes.

Impact: Defines three safe attempts per normal CLI, one emergency Codex attempt, fail-stop terminals, and mandatory apply/admit integration.

Refs: feature/agent-cli-enforcement
This commit is contained in:
2026-10-15 17:24:58 +00:00
parent 8b30353c4d
commit 11973f5244
7 changed files with 88 additions and 30 deletions
+16 -1
View File
@@ -728,7 +728,22 @@ class TaskLifecycleTests(unittest.TestCase):
"| 待定义 | — | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | NOT_RUN | — |",
agent_receipts,
)
self.assertIn("host-fallback-authorized", agent_receipts)
self.assertNotIn("host-fallback-authorized", agent_receipts)
self.assertIn("Cursor、Antigravity(agy)和 PI", agent_receipts)
self.assertIn("最多 3 次全新尝试", agent_receipts)
self.assertIn("一次全新的 Codex CLI 紧急尝试", agent_receipts)
self.assertIn("规划、方案设计、实施计划或独立 Review", agent_receipts)
self.assertIn("显式 fail-stop", agent_receipts)
self.assertIn("不因推理时长、工具次数、规划方式或首次写文件时间判定失败", agent_receipts)
self.assertIn("stdin/stdout/stderr 均无活动的空闲超时", agent_receipts)
self.assertIn("自主检查、计划、测试并迭代", agent_receipts)
self.assertIn("scripts/agent_exec.py apply", agent_receipts)
self.assertIn("pre-commit admit", agent_receipts)
self.assertIn(".task/**", agent_receipts)
self.assertIn("docs/superpowers/specs/**", agent_receipts)
self.assertIn("docs/superpowers/plans/**", agent_receipts)
self.assertIn("fallback 列只记录该行是否为 Codex 紧急尝试", agent_receipts)
self.assertIn("不授权 host 直接撰写该单元", agent_receipts)
for field in ("当前阶段", "当前增量", "方案引用", "实施计划引用", "测试计划引用"):
self.assertIn(field + ":", card)
self.assertIn("## 交付调度\n", card)