fix: align README brief with maintained document

This commit is contained in:
DongHyeonka
2026-07-29 18:54:48 +09:00
parent 8464f2297e
commit 3caf6db267
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -43,7 +43,7 @@
"quality gate와 검증 산출물" "quality gate와 검증 산출물"
], ],
"constraints": { "constraints": {
"target_words": 3600, "target_words": 1800,
"tone": "작성자의 문제와 선택을 직접 설명하는 전문적인 한국어 README 문체", "tone": "작성자의 문제와 선택을 직접 설명하는 전문적인 한국어 README 문체",
"version_context": "ClariDoc 0.2.0", "version_context": "ClariDoc 0.2.0",
"max_heading_depth": 3, "max_heading_depth": 3,
+13
View File
@@ -1,9 +1,12 @@
from __future__ import annotations from __future__ import annotations
import json
import unittest import unittest
from pathlib import Path from pathlib import Path
from claridoc.models import Brief
from claridoc.style_contracts import first_person_metrics, plain_form_ending_locations from claridoc.style_contracts import first_person_metrics, plain_form_ending_locations
from claridoc.utils import word_count
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
@@ -43,10 +46,20 @@ class RepositoryContractTests(unittest.TestCase):
def test_repository_readme_satisfies_korean_experience_contract(self) -> None: def test_repository_readme_satisfies_korean_experience_contract(self) -> None:
text = (ROOT / "README.md").read_text(encoding="utf-8") text = (ROOT / "README.md").read_text(encoding="utf-8")
metrics = first_person_metrics(text) metrics = first_person_metrics(text)
brief = Brief.from_dict(
json.loads(
(ROOT / "examples" / "briefs" / "claridoc-readme.json").read_text(
encoding="utf-8"
)
)
)
actual_words = word_count(text)
self.assertEqual(plain_form_ending_locations(text), []) self.assertEqual(plain_form_ending_locations(text), [])
self.assertTrue(metrics["opening_has_first_person"]) self.assertTrue(metrics["opening_has_first_person"])
self.assertGreaterEqual(metrics["experience_section_coverage"], 0.5) self.assertGreaterEqual(metrics["experience_section_coverage"], 0.5)
self.assertGreaterEqual(actual_words, brief.constraints.target_words * 0.65)
self.assertLessEqual(actual_words, brief.constraints.target_words * 1.6)
self.assertIn("STYLE002", text) self.assertIn("STYLE002", text)
self.assertIn("STYLE003", text) self.assertIn("STYLE003", text)
self.assertIn("examples/briefs/claridoc-readme.json", text) self.assertIn("examples/briefs/claridoc-readme.json", text)