✨ feat(tsl-syntax-reference): harden retrieval contracts
Add stable section IDs, structural and routing regressions, quickstart consistency checks, and CI enforcement. BREAKING CHANGE: replace heading-derived Section IDs with explicit syntax-NN-NNN identifiers.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# 检索词表(lexicon.json)
|
||||
|
||||
`lexicon.json` 是 `scripts/lookup.py` 的策展检索数据,与引擎逻辑分离维护。
|
||||
两张表都只影响检索,不是事实正文。
|
||||
两张表都只影响检索,不是事实正文。查询输入应从用户原话提取错误文本、标识符
|
||||
或单一语法要素,保留原写法但不传完整礼貌句。
|
||||
|
||||
## query_synonyms —— 口语同义词
|
||||
|
||||
@@ -20,14 +21,16 @@
|
||||
|
||||
- 键必须与 `references/` 下的文件名完全一致;每个参考页至少一条短语。
|
||||
键写错或参考页改名后 `_intent_score` 会静默返回 0 分,该页失去自然语言
|
||||
入口——`lookup.py --check` 和回归测试会拦住这两种漂移。
|
||||
入口。`lookup.py --check` 负责拦截页键漂移,行为回归测试负责拦截排序漂移。
|
||||
|
||||
## 改动后的校验
|
||||
|
||||
```bash
|
||||
python scripts/lookup.py --check
|
||||
python skills/tsl-syntax-reference/scripts/lookup.py --check
|
||||
python -m unittest test.test_tsl_syntax_reference -v
|
||||
```
|
||||
|
||||
`--check` 会校验 `page_intent_aliases` 的键与 `references/` 参考页一一对应:
|
||||
键指向不存在的页、或某页没有自然语言入口都会报错。新增参考页时必须同时
|
||||
在这里补一条页级意图短语。
|
||||
在这里补一条页级意图短语。它只做结构检查,不验证自然语言排序;原始 alias、
|
||||
助词变体、弱命中和已知真实问法由专属测试覆盖。
|
||||
|
||||
Reference in New Issue
Block a user