Loading...
Loading...
Compare original and translation side by side
assert x == yassert x == ypytestmark = [pytest.mark.genai]
def test_agents_documented_in_claude_md(self, genai):
agents_on_disk = list_agents()
claude_md = Path("CLAUDE.md").read_text()
result = genai.judge(
question="Does CLAUDE.md document all active agents?",
context=f"Agents on disk: {agents_on_disk}\nCLAUDE.md:\n{claude_md[:3000]}",
criteria="All active agents should be referenced. Score by coverage %."
)
assert result["score"] >= 5, f"Gap: {result['reasoning']}"pytestmark = [pytest.mark.genai]
def test_agents_documented_in_claude_md(self, genai):
agents_on_disk = list_agents()
claude_md = Path("CLAUDE.md").read_text()
result = genai.judge(
question="Does CLAUDE.md document all active agents?",
context=f"Agents on disk: {agents_on_disk}\nCLAUDE.md:\n{claude_md[:3000]}",
criteria="All active agents should be referenced. Score by coverage %."
)
assert result["score"] >= 5, f"Gap: {result['reasoning']}"def test_implement_and_implementer_share_forbidden_list(self, genai):
implement = Path("commands/implement.md").read_text()
implementer = Path("agents/implementer.md").read_text()
result = genai.judge(
question="Do these files have matching FORBIDDEN behavior lists?",
context=f"implement.md:\n{implement[:5000]}\nimplementer.md:\n{implementer[:5000]}",
criteria="Both should define same enforcement gates. Score 10=identical, 0=contradictory."
)
assert result["score"] >= 5def test_implement_and_implementer_share_forbidden_list(self, genai):
implement = Path("commands/implement.md").read_text()
implementer = Path("agents/implementer.md").read_text()
result = genai.judge(
question="Do these files have matching FORBIDDEN behavior lists?",
context=f"implement.md:\n{implement[:5000]}\nimplementer.md:\n{implementer[:5000]}",
criteria="Both should define same enforcement gates. Score 10=identical, 0=contradictory."
)
assert result["score"] >= 5def test_all_active_skills_have_content(self):
skills_dir = Path("plugins/autonomous-dev/skills")
for skill in skills_dir.iterdir():
if skill.name == "archived" or not skill.is_dir():
continue
skill_md = skill / "SKILL.md"
assert skill_md.exists(), f"Skill {skill.name} missing SKILL.md"
assert len(skill_md.read_text()) > 100, f"Skill {skill.name} is a hollow shell"def test_all_active_skills_have_content(self):
skills_dir = Path("plugins/autonomous-dev/skills")
for skill in skills_dir.iterdir():
if skill.name == "archived" or not skill.is_dir():
continue
skill_md = skill / "SKILL.md"
assert skill_md.exists(), f"Skill {skill.name} missing SKILL.md"
assert len(skill_md.read_text()) > 100, f"Skill {skill.name} is a hollow shell"undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
**Rule**: If the test itself is the thing that needs updating most often, delete it.
---
**规则**:如果测试本身是最需要频繁更新的内容,那就删掉它。
---@pytest.marktests/
├── regression/
│ ├── smoke/ # Tier 0: Critical path (<5s) — CI GATE
│ ├── regression/ # Tier 1: Feature protection (<30s)
│ ├── extended/ # Tier 2: Deep validation (<5min)
│ └── progression/ # Tier 3: TDD red phase (not yet implemented)
├── unit/ # Isolated functions (<1s each)
├── integration/ # Multi-component workflows (<30s)
├── genai/ # LLM-as-judge (opt-in via --genai flag)
└── archived/ # Excluded from runsregression/smoke/regression/regression/unit/integration/genai/pytest -m smoke # CI gate
pytest -m "smoke or regression" # Feature protection
pytest tests/genai/ --genai # GenAI validation (opt-in)@pytest.marktests/
├── regression/
│ ├── smoke/ # 第0层:关键路径(<5秒)——CI门禁
│ ├── regression/ # 第1层:功能保护(<30秒)
│ ├── extended/ # 第2层:深度验证(<5分钟)
│ └── progression/ # 第3层:TDD红阶段(尚未实现)
├── unit/ # 独立函数(每个<1秒)
├── integration/ # 多组件工作流(<30秒)
├── genai/ # LLM作为评判者(通过--genai flag启用)
└── archived/ # 排除在运行范围外regression/smoke/regression/regression/unit/integration/genai/pytest -m smoke # CI门禁测试
pytest -m "smoke or regression" # 功能保护测试
pytest tests/genai/ --genai # GenAI验证(需手动启用)undefinedundefined
**Scaffold for any repo**: `/scaffold-genai-uat` generates the full `tests/genai/` setup with portable client, universal tests, and project-specific congruence tests auto-discovered by GenAI.
---
**适用于任意仓库的脚手架**:`/scaffold-genai-uat`可生成完整的`tests/genai/`环境,包含可移植客户端、通用测试以及由GenAI自动发现的项目专属一致性测试。
---| Test This | With This | Not This |
|---|---|---|
| Pure Python functions | Unit tests | — |
| Component interactions | Integration tests | — |
| Doc ↔ code alignment | GenAI congruence | Hardcoded string matching |
| Component existence | Structural (glob) | Hardcoded counts |
| FORBIDDEN list sync | GenAI congruence | Manual comparison |
| Security posture | GenAI judge | Regex scanning |
| Config structure | Structural | Config values |
| Agent output quality | GenAI judge | Output string matching |
| 需测试内容 | 测试方法 | 无需测试内容 |
|---|---|---|
| 纯Python函数 | 单元测试 | — |
| 组件交互 | 集成测试 | — |
| 文档与代码对齐 | GenAI一致性测试 | 硬编码字符串匹配 |
| 组件存在性 | 结构测试(glob) | 硬编码计数 |
| FORBIDDEN列表同步 | GenAI一致性测试 | 手动对比 |
| 安全态势 | GenAI评判 | 正则扫描 |
| 配置结构 | 结构测试 | 配置具体值 |
| Agent输出质量 | GenAI评判 | 输出字符串匹配 |
test_regression_issue_NNN_description--genaitest_regression_issue_NNN_description--genai