26 lines
1.3 KiB
Python
26 lines
1.3 KiB
Python
"""Guard against reintroducing mandatory tautological paragraph conclusions."""
|
|
from pathlib import Path
|
|
import unittest
|
|
|
|
ROOT=Path(__file__).resolve().parents[1]
|
|
SKILL=ROOT/'.agents/skills/history-writing-workflow-c4h'
|
|
|
|
class ArgumentDensityTests(unittest.TestCase):
|
|
def test_root_documents_reference_protocol(self):
|
|
self.assertTrue((ROOT/'ARGUMENT_DENSITY.md').exists())
|
|
for file in ('AGENTS.md','README.md','code4history.md','INTERPRETATION.md'):
|
|
self.assertIn('ARGUMENT_DENSITY.md',(ROOT/file).read_text(encoding='utf-8'),file)
|
|
self.assertIn('ARGUMENT_DENSITY.md',(SKILL/'SKILL.md').read_text(encoding='utf-8'))
|
|
def test_skill_and_templates(self):
|
|
for f in ('argumentation-and-drafting.md','stage3-draft-finalize.md'):
|
|
self.assertIn('ARGUMENT_DENSITY.md',(SKILL/'references'/f).read_text(encoding='utf-8'))
|
|
self.assertIn('同义改写',(ROOT/'10_templates/claim.md').read_text(encoding='utf-8'))
|
|
def test_unchanged_user_data_contract(self):
|
|
self.assertEqual((ROOT/'USERINFO.md').stat().st_size,0)
|
|
self.assertFalse((ROOT/'agent.md').exists())
|
|
self.assertTrue((ROOT/'topic.md').exists())
|
|
def test_quick_fix_instruction(self):
|
|
self.assertIn('消除学术废话',(ROOT/'QUICK_FIX.md').read_text(encoding='utf-8'))
|
|
|
|
if __name__=='__main__':unittest.main()
|