test: lock README prose contract

This commit is contained in:
DongHyeonka
2026-07-29 18:50:35 +09:00
parent 5c26107422
commit f13fd75263
+13
View File
@@ -3,6 +3,8 @@ from __future__ import annotations
import unittest
from pathlib import Path
from claridoc.style_contracts import first_person_metrics, plain_form_ending_locations
ROOT = Path(__file__).resolve().parents[1]
AUTHOR_SKILL = ROOT / ".agents" / "skills" / "technical-document-author"
@@ -38,6 +40,17 @@ class RepositoryContractTests(unittest.TestCase):
self.assertIn("independent review", normalized)
self.assertIn("quality-gate", normalized)
def test_repository_readme_satisfies_korean_experience_contract(self) -> None:
text = (ROOT / "README.md").read_text(encoding="utf-8")
metrics = first_person_metrics(text)
self.assertEqual(plain_form_ending_locations(text), [])
self.assertTrue(metrics["opening_has_first_person"])
self.assertGreaterEqual(metrics["experience_section_coverage"], 0.5)
self.assertIn("STYLE002", text)
self.assertIn("STYLE003", text)
self.assertIn("examples/briefs/claridoc-readme.json", text)
if __name__ == "__main__":
unittest.main()