Commit Graph
4 Commits
Author SHA1 Message Date
cshandClaude Fable 5 2e8c46e152 📝 docs(tsl-syntax-reference): document verified facts from FAQ corpus
从 FAQ 语料(2018 篇镜像)与参考页做完 169 条逐条差集,补入 6 组此前未收录的语言
事实。每条先用 TSL.exe 实跑观察行为,再收敛成 39 条断言的回归门,在 TSLGen2、
AnalyseNG.NET、TSL 三个解释器上均通过后才写入。

- 16 页:0/0 得 nan、2/0 得 inf;nan 的 = > < >= <= 恒假而 <> 为真;nan 沿算术
  传播;nil 在乘除减里按 0 参与
- 04 页:整体赋值免声明,但对未建立的变量写单元格赋值会报「变量类型不是Array」
- 07 页:相邻两个 if 是两条独立语句都会执行;for..in 单控制变量拿到的是键不是值;
  二维数组按行推进,行本身是数组(新增 syntax-07-013)
- 21 页:子矩阵赋值语句求值为 0;t[:,:] 按位置复制不按列名对齐(新增
  syntax-21-019);| 列并时同名字符串列键由右操作数覆盖(新增 syntax-21-018)
- 13 页:select 输出列表同名列后者覆盖前者,须用 as 改名(新增 syntax-13-032)

三条 FAQ 说法实跑不复现,故未写入:12574 的括号消歧、19857 的 -2147483648
字面量限制、31474 的 :. bugfix 记录。15305/11045 的用户/公用/共享函数同名解析
优先级需要服务端多账号环境,本地无法验证,仍为已知缺口。

lexicon.json 为 16 页补两个页级 alias,使 nan/nil 语义能被自然语言查询命中。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 20:58:10 +08:00
csh 736d1a8ad7 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.
2026-07-31 10:05:15 +08:00
cshandClaude Opus 5 948a3ed85b 🐛 fix(tsl-syntax-reference): repair routing for colloquial queries
- split 03's overloaded 字符串边界规则: substring read/replace/delete/insert
  now sit in 字符串子串读写 with their own tags, so `截取子串` / `子串` /
  `字符串区间` stop returning only weak candidates, which SKILL.md tells the
  agent to treat as a fact gap even though the fact is on the page
- tag the remaining 03 section for wide strings, encoding conversion and
  binary buffers; those queries used to land on the neighbouring concat
  section, or on 23's binary-function overload
- add 异常处理 to 07's try-except and rename 21's H3 to 无效输入替换参数: the
  matrix ErrDefine section owned that phrase and outranked try-except by
  92 to a weak 11, while its own text says NAN is not an error position
- tag 03's like section for 正则表达式 and 08 for 调用父类方法 / 定义类; all
  three reached the wrong section on the right page, and 定义类 could not
  reach 最小类与声明位置 at all because the per-page cap was already full
- drop the redundant 可直接照写示例 under 03's 禁止项 and state the closed
  interval rule as a bullet instead; a positive example does not belong in
  the prohibition list

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 21:33:29 +08:00
csh 40a9885eb4 feat(tsl-syntax-reference): harden retrieval and restructure pages
- flag weak candidates (no intent/heading/identifier/tag hit) and exit 2
  when every candidate is weak: mis-hits used to be indistinguishable
  from real hits, so the retry-with-better-terms loop never fired
- accept multiple ids per --section for batch fetch, failing atomically
  on any unknown id so a partial fetch cannot pass as complete
- move query synonyms and page intent aliases to data/lexicon.json and
  enforce alias/page correspondence in --check; curation data no longer
  lives in the engine
- document the weak-hit rule, batch fetch and prelude-once guidance in
  SKILL.md, with curation discipline in data/README.md
- drop 11_pitfalls.md, renumber the trailing pages and spread retrieval
  tags across topics; lexicon keys are page filenames, so the renumbering
  and the new --check rule cannot land in separate commits
2026-07-29 15:45:47 +08:00