♻️ refactor(tsl-syntax): make reference lookup-only

This commit is contained in:
csh
2026-07-13 09:16:53 +08:00
parent 4558d32043
commit b4d2fc8246
28 changed files with 41 additions and 109 deletions
+7 -21
View File
@@ -115,27 +115,13 @@ class TslSyntaxReferenceSkillStructureTest(unittest.TestCase):
link_path = target.split("#", 1)[0]
self.assertTrue((REFERENCES_DIR / link_path).is_file(), f"{path}: {target}")
def test_index_is_only_complete_topic_router(self) -> None:
index_text = read_text(REFERENCES_DIR / "index.md")
self.assertEqual(
{name for name in TOPIC_REFERENCES if f"]({name})" in index_text},
TOPIC_REFERENCES,
)
for path in REFERENCES_DIR.glob("*.md"):
if path.name == "index.md":
continue
linked_topics = {name for name in TOPIC_REFERENCES if f"]({name})" in read_text(path)}
self.assertNotEqual(linked_topics, TOPIC_REFERENCES, path.name)
skill_links = set(local_link_targets(read_text(SKILL_FILE)))
self.assertEqual(
skill_links,
{
"references/01_quickstart.md",
"references/index.md",
"references/11_pitfalls.md",
},
)
def test_skill_uses_lookup_as_its_only_retrieval_entry(self) -> None:
text = read_text(SKILL_FILE)
self.assertIn("scripts/lookup.py", text)
for mode in ("write", "diagnose", "explain"):
self.assertIn(f"--mode {mode}", text)
self.assertEqual(local_link_targets(text), [])
self.assertNotIn("references/index.md", text)
def test_skill_does_not_bundle_external_domains(self) -> None:
forbidden = {