From 3caf6db2677f016a746133636948a445a7fb43ff Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 29 Jul 2026 18:54:48 +0900 Subject: [PATCH] fix: align README brief with maintained document --- examples/briefs/claridoc-readme.json | 2 +- tests/test_repository_contracts.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/briefs/claridoc-readme.json b/examples/briefs/claridoc-readme.json index e3ba198..a8cac66 100644 --- a/examples/briefs/claridoc-readme.json +++ b/examples/briefs/claridoc-readme.json @@ -43,7 +43,7 @@ "quality gate와 검증 산출물" ], "constraints": { - "target_words": 3600, + "target_words": 1800, "tone": "작성자의 문제와 선택을 직접 설명하는 전문적인 한국어 README 문체", "version_context": "ClariDoc 0.2.0", "max_heading_depth": 3, diff --git a/tests/test_repository_contracts.py b/tests/test_repository_contracts.py index 3e6ee19..ccae7a9 100644 --- a/tests/test_repository_contracts.py +++ b/tests/test_repository_contracts.py @@ -1,9 +1,12 @@ from __future__ import annotations +import json import unittest from pathlib import Path +from claridoc.models import Brief from claridoc.style_contracts import first_person_metrics, plain_form_ending_locations +from claridoc.utils import word_count ROOT = Path(__file__).resolve().parents[1] @@ -43,10 +46,20 @@ class RepositoryContractTests(unittest.TestCase): def test_repository_readme_satisfies_korean_experience_contract(self) -> None: text = (ROOT / "README.md").read_text(encoding="utf-8") 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.assertTrue(metrics["opening_has_first_person"]) 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("STYLE003", text) self.assertIn("examples/briefs/claridoc-readme.json", text)