🐛 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
+5 -5
View File
@@ -1,15 +1,15 @@
---
name: tsl-syntax-reference
description: Use when Codex 需要编写、修改、审查或解释 TSL/TSF 代码,或排查语法错误并核对语言与运行时规则。
description: 需要编写、修改、审查或解释 TSL/TSF 代码,或排查语法错误并核对语言与运行时规则时使用
---
# TSL Syntax Reference
## 唯一检索入口
本 Skill 只通过随附的 `scripts/lookup.py` 检索权威 TSL/TSF 语法事实,不手工选择或顺序通读 `references/` 页面。根据任务意图选择模式,并用用户的原始术语、错误文本和关键语法词组成查询:
本 Skill 只通过随附的 `scripts/lookup.py` 检索权威 TSL/TSF 语法事实,不手工选择或顺序通读 `references/` 页面。`<this-skill-dir>` 指本 `SKILL.md` 所在目录。根据任务意图选择模式,并用用户的原始术语、错误文本和关键语法词组成查询:
```powershell
```bash
python <this-skill-dir>/scripts/lookup.py --query "命名参数 默认参数" --mode write
python <this-skill-dir>/scripts/lookup.py --query "invalid statement 声明区" --mode diagnose
python <this-skill-dir>/scripts/lookup.py --query "数组下标" --mode explain
@@ -19,7 +19,7 @@ python <this-skill-dir>/scripts/lookup.py --query "数组下标" --mode explain
- `diagnose`:定位语法错误或错误写法。
- `explain`:解释语言规则或代码含义。
以 lookup 返回的章节作为本次任务的事实来源;需要补充时改进查询词并再次检索,不得绕过 lookup 手工路由。
以 lookup 返回的章节作为本次任务的事实来源;需要补充时改进查询词并再次检索,不得绕过 lookup 手工路由。需要复取输出中列出的某个章节时,用 `--section <Section ID>` 单独取回。
## 事实边界
@@ -53,6 +53,6 @@ lookup 无匹配或返回非零状态、结果没有支持当前结论、代码
维护本 Skill、参考页或 lookup 实现后必须运行:
```powershell
```bash
python <this-skill-dir>/scripts/lookup.py --check
```