- P1-1 directory-isolation executable check: git diff --name-only against merge-base, output recorded in merge record - P1-2 derivation checklist table (8 required items, missing one blocks dispatch) - P1-3 QA split into single-client review and cross-client E2E with fixed deliverables and agent-test attribution - P1-4 sub-task slim-pack trimming rules (listed chapters only, never full copies) - P2: inter-thread Q&A default policy, docs/decisions.md append-only, per-client onboarding docs (web first at G4a), v1.1 handover checklist - Body and appendix kept in sync; new lightweight keyword test
45 lines
1.9 KiB
Python
45 lines
1.9 KiB
Python
"""software-engineering 技能 v0.3:P1/P2 关键词断言(轻量)。
|
||
|
||
只断言正文与附录都含有 v0.3 的关键概念,不逐字背诵全文:
|
||
版本号与上一版、目录隔离可执行检查、派生必填表、精简包所含章节、
|
||
QA 两部分交付物与 agent 测试归属、决策记录落盘与只追加、
|
||
上手文档与 v1.1 交接清单。正文改了附录没同步时,附录部分就会失败。
|
||
"""
|
||
|
||
import unittest
|
||
from pathlib import Path
|
||
|
||
SKILL = Path(__file__).resolve().parents[1] / "skills" / "software-engineering" / "SKILL.md"
|
||
|
||
# 正文与附录都要有的关键词
|
||
BOTH = ("v0.3", "git diff --name-only", "精简包", "所含章节",
|
||
"单端复核", "跨端一致性矩阵", "沙箱越界", "模型 503",
|
||
"docs/decisions.md", "只追加", "上手文档", "v1.1 交接清单")
|
||
|
||
# 派生必填表 8 项:正文表格与协调员附录都要出现
|
||
CHECKLIST = ("客户端名", "拥有目录", "分支名", "契约版本",
|
||
"PRD 版本", "设计版本", "完成定义", "TODO-UPDATE")
|
||
|
||
|
||
class SoftwareEngineeringV03TestCase(unittest.TestCase):
|
||
def test_v03_in_body_and_appendix(self):
|
||
text = SKILL.read_text(encoding="utf-8")
|
||
main, sep, appendix = text.partition("## 附录:角色模板")
|
||
self.assertTrue(sep, "appendix marker missing")
|
||
self.assertIn("v0.2", main, "header must name the previous version")
|
||
self.assertIn("GitHub 保证", main, "header must name the previous GitHub guarantees")
|
||
for kw in BOTH:
|
||
self.assertIn(kw, main, kw)
|
||
self.assertIn(kw, appendix, "appendix: " + kw)
|
||
for kw in CHECKLIST:
|
||
self.assertIn(kw, main, kw)
|
||
self.assertIn(kw, appendix, "appendix: " + kw)
|
||
|
||
def test_v03_no_full_copy_rule(self):
|
||
text = SKILL.read_text(encoding="utf-8")
|
||
self.assertIn("绝不把 PRD、契约", text)
|
||
|
||
|
||
if __name__ == "__main__":
|
||
unittest.main()
|