diff --git a/tests/test_repository_contracts.py b/tests/test_repository_contracts.py index bb24f8c..3e6ee19 100644 --- a/tests/test_repository_contracts.py +++ b/tests/test_repository_contracts.py @@ -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()