Skip to content

feat(evidence-check): 断言强度检查支持 Python unittest 与 openspec Scenario - #3

Merged
lqtdys merged 1 commit into
mainfrom
feat/evidence-check-python-assertions
Oct 18, 2026
Merged

lqtdys merged 1 commit into
mainfrom
feat/evidence-check-python-assertions

Conversation

@lqtdys

@lqtdys lqtdys commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

背景

evidence-check.yml 的断言强度检查此前只认 JS 系标记(expect/toBe/toEqual/toContain/toMatch/toThrow)。纯 Python + openspec 仓的 spec diff 即使包含真实断言,也会被误报:

❌ spec diff 缺少断言强度标记(expect/assert + toBe/toEqual 等)

contentweave 消费仓(纯 Python 标准库 + openspec 规格)已在本地做了该增强并稳定运行;本次将通用部分回馈上游。

改动(仅 workflows/evidence-check.yml,+6/-5)

  • Python unittest 断言:case 分支补 assertEqual|assertIn|assertTrue|assertFalse|assertLess|assertGreater|assertRegex|assertRaises(触发条件沿用既有 assert 子串检测,Python 断言天然命中)。
  • openspec Scenario:触发条件与 case 分支补 Scenario,覆盖 openspec #### Scenario: WHEN/THEN 格式。
  • 同步更新两处错误提示文案与注释,说明扩展动机。

范围说明

  • 不含 {{DEFAULT_BRANCH}} 占位符差异(消费仓本地改动,非本 PR 目标)。
  • contentweave 专属的 QG-9(DQ-ART / scripts/dqart_evidence_check.py)不回馈,留在消费仓。

验证

  • 与 contentweave 本地实现 sed -n '170,200p' 逐字比对 → IDENTICAL。
  • 改动区域限定在断言检查块(约 178-196 行),不影响 workflow 其余逻辑。

纯 Python + openspec 仓的 spec diff 此前必被误报(只认 JS expect/toBe 系)。
- case 分支补 assertEqual/assertIn/assertTrue/assertFalse/assertLess/assertGreater/assertRegex/assertRaises
- 触发与匹配补 openspec '#### Scenario:' 标记
- 同步更新两处错误提示文案
@lqtdys lqtdys added the enhancement New feature or request label Oct 18, 2026
@lqtdys
lqtdys merged commit 8128d7c into main Oct 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant