56 lines
2.1 KiB
Python
56 lines
2.1 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
import unittest
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
class ProofRulesTest(unittest.TestCase):
|
|
def test_new_rules_use_manifest_hard_gate_without_inline_todo_contract(self) -> None:
|
|
paths = [
|
|
ROOT / "rules/advisory-depth.md",
|
|
ROOT / "rules/reporting-standards.md",
|
|
ROOT / "rules/execution-profiles.md",
|
|
]
|
|
combined = "\n".join(path.read_text(encoding="utf-8") for path in paths)
|
|
self.assertIn("proof_hard_gate.py", combined)
|
|
self.assertIn("namespace: repo", combined)
|
|
self.assertIn("namespace: run", combined)
|
|
self.assertNotIn("중립 adapter를 통한 기존 hook·agent 전면 migration은 후속 TODO", combined)
|
|
self.assertNotIn("검증한 모든 sed/grep 명령을 인라인으로 나열한다", combined)
|
|
self.assertNotIn("이것이 self-grep을 했다는 유일한 증거다", combined)
|
|
|
|
def test_rules_and_neutral_research_source_have_no_fixed_user_vault_path(self) -> None:
|
|
paths = [
|
|
ROOT / "rules/reporting-standards.md",
|
|
ROOT / "harness/source/agents/bodies/wiki-research-lane.md",
|
|
]
|
|
for path in paths:
|
|
with self.subTest(path=path):
|
|
text = path.read_text(encoding="utf-8")
|
|
self.assertNotIn("/home/donghyeon/Documents/LLM Wiki", text)
|
|
self.assertIn("<workspace-root>", text)
|
|
|
|
def test_neutral_sources_do_not_require_inline_quote_transcripts(self) -> None:
|
|
source_root = ROOT / "harness/source"
|
|
combined = "\n".join(
|
|
path.read_text(encoding="utf-8")
|
|
for path in sorted(source_root.rglob("*.md"))
|
|
)
|
|
banned = (
|
|
"모든 인용 반복",
|
|
"Paste real outputs in §7.1",
|
|
"V = M = N 일치 강제",
|
|
"작성한 grep 명령 수",
|
|
"실제 실행한 grep 수",
|
|
)
|
|
for phrase in banned:
|
|
with self.subTest(phrase=phrase):
|
|
self.assertNotIn(phrase, combined)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|