🐛 fix(tsl_syntax): repair lookup engine and reconcile reference facts

lookup.py: exempt code-anchored ASCII identifiers from the mixed
zh/en gate so exact hits are no longer dropped; dedup parent/child
sections in results; validate write-prelude anchors in --check.

references: correct interpreter-verified facts (case-as-expression,
control-flow semicolons, __line__/__stack_frame, tslObjects order,
destroy timing, ErrDefine, truncated outputs), fix headings, scope
qualifiers and reversed quotes; strip dead preamble metadata from all
24 pages.

packaging: exclude __pycache__/*.pyc from playbook and bundle copies;
update build test file-count assertion to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
csh
2026-07-13 09:16:57 +08:00
co-authored by Claude Fable 5
parent 923bce91b0
commit b597edfc70
29 changed files with 356 additions and 256 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ DEFAULT_OUTPUT = Path("tmp") / "tsl-playbook"
def copy_tree(src: Path, dst: Path) -> None:
shutil.copytree(src, dst)
shutil.copytree(src, dst, ignore=shutil.ignore_patterns("__pycache__", "*.pyc"))
def build_agents_text(ruleset_path: Path) -> str:
+12 -4
View File
@@ -3,7 +3,7 @@ import re
import sys
from datetime import datetime, timezone
from pathlib import Path
from shutil import copy2, copytree, rmtree, which
from shutil import copy2, copytree, ignore_patterns, rmtree, which
import subprocess
import importlib.util
from typing import Optional
@@ -543,8 +543,16 @@ def install_snapshot(config: dict, context: dict) -> int:
if gitattributes_src.is_file():
copy2(gitattributes_src, dest_prefix / ".gitattributes")
copytree(PLAYBOOK_ROOT / "scripts", dest_prefix / "scripts")
copytree(PLAYBOOK_ROOT / "skills", dest_prefix / "skills")
copytree(
PLAYBOOK_ROOT / "scripts",
dest_prefix / "scripts",
ignore=ignore_patterns("__pycache__", "*.pyc"),
)
copytree(
PLAYBOOK_ROOT / "skills",
dest_prefix / "skills",
ignore=ignore_patterns("__pycache__", "*.pyc"),
)
copy2(PLAYBOOK_ROOT / "SKILLS.md", dest_prefix / "SKILLS.md")
common_docs = PLAYBOOK_ROOT / "docs/common"
@@ -1420,7 +1428,7 @@ def install_skills_action(config: dict, context: dict) -> int:
backup = skills_dst_root / f"{name}.bak.{timestamp}"
dst.rename(backup)
log(f"Backed up existing skill: {name} -> {backup.name}")
copytree(src, dst)
copytree(src, dst, ignore=ignore_patterns("__pycache__", "*.pyc"))
rewrite_skill_docs_links(dst, resolve_docs_prefix(context))
tag = " [thirdparty]" if origin == "thirdparty" else ""
log(f"Installed: {name}{tag}")