♻️ refactor(tsl): decouple skill routing from static docs
删除静态文档中对 tsl-syntax-reference / tsl-api-reference 的导航路由, 改由运行时按需自动触发;语法/API 事实的所有权与 fail-closed 约束 只保留在 rulesets/tsl/index.md 这一唯一权威载体。 - docs/tsl/index.md:删 4 行 skill 路由及重复的所有权/fail-closed 段,回归纯分流 - docs/tsl/modules/index.md:删 API 路由及指向已删 syntax 的 3 处回跳 - docs/index.md:删 skill 导航行及 2 条指向不存在文件的死 catalog 链 - docs/tsl/syntax/index.md:删除旧路径兼容 stub,不再保留任何兼容 - rulesets/tsl/index.md:删首跳 2 条 skill 导航,保留事实边界与 Fail closed - 同步修正相关测试断言 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -243,21 +243,8 @@ langs = ["tsl"]
|
||||
self.assertEqual(result.returncode, 0)
|
||||
text = docs_index.read_text(encoding="utf-8")
|
||||
self.assertIn("`tsl/index.md`", text)
|
||||
self.assertIn("tsl-syntax-reference", text)
|
||||
self.assertIn("`tsl/reference/catalog/datawarehouse.md`", text)
|
||||
self.assertIn("`tsl/modules/index.md`", text)
|
||||
self.assertIn("`tsl/reference/index.md`", text)
|
||||
self.assertNotIn("`tsl/syntax_book/index.md`", text)
|
||||
self.assertTrue(
|
||||
(
|
||||
root
|
||||
/ CUSTOM_DEPLOY_ROOT
|
||||
/ "docs"
|
||||
/ "tsl"
|
||||
/ "syntax"
|
||||
/ "index.md"
|
||||
).is_file()
|
||||
)
|
||||
|
||||
def test_external_clone_requires_explicit_playbook_root(self):
|
||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||
|
||||
@@ -8,7 +8,6 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
SKILL_DIR = ROOT / "skills" / "tsl-syntax-reference"
|
||||
SKILL_FILE = SKILL_DIR / "SKILL.md"
|
||||
REFERENCES_DIR = SKILL_DIR / "references"
|
||||
COMPATIBILITY_INDEX = ROOT / "docs" / "tsl" / "syntax" / "index.md"
|
||||
RULESET_FILE = ROOT / "rulesets" / "tsl" / "index.md"
|
||||
LOOKUP_SCRIPT = SKILL_DIR / "scripts" / "lookup.py"
|
||||
|
||||
@@ -188,18 +187,6 @@ class TslSyntaxReferenceSkillStructureTest(unittest.TestCase):
|
||||
actual = {path.name for path in SKILL_DIR.rglob("*")}
|
||||
self.assertTrue(forbidden.isdisjoint(actual), forbidden & actual)
|
||||
|
||||
def test_compatibility_index_contains_no_syntax_facts(self) -> None:
|
||||
text = read_text(COMPATIBILITY_INDEX)
|
||||
self.assertIn("../../../skills/tsl-syntax-reference/SKILL.md", text)
|
||||
for forbidden in (
|
||||
"```",
|
||||
"代码块身份",
|
||||
"01_quickstart.md",
|
||||
"02_core_model.md",
|
||||
"| 任务",
|
||||
):
|
||||
self.assertNotIn(forbidden, text)
|
||||
|
||||
def test_ruleset_file_remains_tsl_router(self) -> None:
|
||||
self.assertTrue(RULESET_FILE.is_file())
|
||||
text = read_text(RULESET_FILE)
|
||||
@@ -240,10 +227,8 @@ class TslSyntaxReferenceSkillStructureTest(unittest.TestCase):
|
||||
|
||||
def test_static_docs_route_to_fact_owner(self) -> None:
|
||||
routes = {
|
||||
ROOT / "docs" / "tsl" / "index.md": "../../skills/tsl-syntax-reference/SKILL.md",
|
||||
ROOT / "docs" / "tsl" / "naming.md": "../../skills/tsl-syntax-reference/SKILL.md",
|
||||
ROOT / "docs" / "tsl" / "code_style.md": "../../skills/tsl-syntax-reference/SKILL.md",
|
||||
ROOT / "docs" / "index.md": "../skills/tsl-syntax-reference/SKILL.md",
|
||||
}
|
||||
legacy_deep_link = re.compile(r"(?:docs/tsl/)?syntax/(?:0[1-9]|1[0-9]|2[0-4])_")
|
||||
for path, expected_link in routes.items():
|
||||
|
||||
Reference in New Issue
Block a user