25 lines
1.3 KiB
Python
25 lines
1.3 KiB
Python
"""Protect the reasoning/drafting protocol from accidental reversion."""
|
|
from pathlib import Path
|
|
import unittest
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
MAIN = ROOT/'.agents/skills/history-writing-workflow-c4h'
|
|
class InterpretationProtocolTests(unittest.TestCase):
|
|
def test_main_protocol(self):
|
|
self.assertTrue((ROOT/'INTERPRETATION.md').is_file())
|
|
self.assertTrue((ROOT/'QUICK_FIX.md').is_file())
|
|
assert 'INTERPRETATION.md' in (ROOT/'AGENTS.md').read_text(encoding='utf-8')
|
|
assert 'INTERPRETATION.md' in (MAIN/'SKILL.md').read_text(encoding='utf-8')
|
|
self.assertTrue((MAIN/'references/argumentation-and-drafting.md').is_file())
|
|
def test_no_forced_alternatives(self):
|
|
hypothesis=(ROOT/'10_templates/hypothesis.md').read_text(encoding='utf-8')
|
|
self.assertIn('不得编造反例', hypothesis)
|
|
claim=(ROOT/'10_templates/claim.md').read_text(encoding='utf-8')
|
|
self.assertIn('积极判断', claim)
|
|
def test_backward_compatible(self):
|
|
self.assertEqual((ROOT/'USERINFO.md').stat().st_size,0)
|
|
self.assertFalse((ROOT/'agent.md').exists())
|
|
skill=(MAIN/'SKILL.md').read_text(encoding='utf-8')
|
|
for x in ('collaborative','training','Q18','Q19','Q20','95','50'):
|
|
self.assertIn(x,skill)
|
|
if __name__=='__main__': unittest.main()
|