diff --git a/dokimi/changelog.d/20261113_120000_xaleryb_when-cue-followups.md b/dokimi/changelog.d/20261113_120000_xaleryb_when-cue-followups.md new file mode 100644 index 000000000..f3d6bcf34 --- /dev/null +++ b/dokimi/changelog.d/20261113_120000_xaleryb_when-cue-followups.md @@ -0,0 +1,8 @@ +### Fixed + +- **`description-no-when` no longer takes a capability word for a "when" cue** — a description with no + "when" clause lost the `warn` when it held Japanese `思いつく`/`追いつく`/`こいつ` (read as `いつ`), Chinese + `耗时调用`/`超时调用`/`延时执行`/`当事人`, or German `Hilft beim …`/`Unterstützt beim …`. Now `いつ` counts only + before a use verb in the same sentence, `时` after `耗`/`超`/`延` is no cue unless a comma or `请` and a use verb + follow, and `beim` counts only with `verwenden`, `nutzen`, `benutzen`, `einsetzen`, `aufrufen` (also `verwende`, + `nutze`, `benutze`, `ruf … auf`, `setz … ein`) in the same sentence, in either order. Run `catalog check` again to see the warnings that come back. diff --git a/dokimi/docs/external-content.md b/dokimi/docs/external-content.md index 90911bfe0..1a2f8ccf9 100644 --- a/dokimi/docs/external-content.md +++ b/dokimi/docs/external-content.md @@ -254,7 +254,9 @@ skill, since those commands then run with no prompt, and that pair fails `--stri half and shares three words (`description-near-duplicate`). The `description-no-when` cue is read in English, Spanish, French, German, Portuguese, Russian, Chinese, Japanese and Korean, and a description in a script none of them covers (Arabic, Thai, Hebrew, …) is not checked: it gets a `note` (`description-when-not-checked`), so not checked does not read as a pass: its row says `note:` instead of `ok`, and the counts line `1 ok (1 not checked)`. A Latin-script language without a list of its own -(Polish, Dutch, Turkish, Vietnamese) is checked against these cues. Two skills in different paths with the same +(Polish, Dutch, Turkish, Vietnamese) is checked against these cues. A word that only states a capability is not a cue: +Japanese いつ counts only before a use verb, Chinese 耗时, 超时 and 延时 are not 时 + verb, and German `beim` +counts only next to a use verb (verwenden, nutzen, ...). Two skills in different paths with the same directory name and description but different `SKILL.md` text are a `warn` on both (`mirror-drift`), naming the other copies. Skills with `disable-model-invocation: true` are exempt from the description checks. diff --git a/dokimi/dokimi/external/when_cues.py b/dokimi/dokimi/external/when_cues.py index f7f5ac9ad..ada6b6b43 100644 --- a/dokimi/dokimi/external/when_cues.py +++ b/dokimi/dokimi/external/when_cues.py @@ -11,6 +11,17 @@ import re from typing import Optional +# German `beim` is a cue only in a sentence with a use verb, in either order; a full stop that is +# followed by a capitalised word or an acronym ends the sentence, so `z. B.` does not. +_DE_S = r"(?:[^.;!?]|\.(?!\s*(?-i:[A-ZÄÖÜ][A-Za-zäöüß])))*?" +_DE_USE = r"\b(?:verwende[nst]?|nutze[nst]?|benutze[nst]?|einsetzen|aufrufen)\b" +_DE_BEIM = ( + rf"{_DE_USE}{_DE_S}\bbeim\b|\bbeim\b{_DE_S}{_DE_USE}|" + rf"\bruf(?:e|en|t)?\b{_DE_S}\bbeim\b{_DE_S}\bauf\b|\bbeim\b{_DE_S}\bruf(?:e|en|t)?\b{_DE_S}\bauf\b|" + rf"\bsetz(?:e|en|t)?\b{_DE_S}\bbeim\b{_DE_S}\bein\b|\bbeim\b{_DE_S}\bsetz(?:e|en|t)?\b{_DE_S}\bein\b|" + rf"\bruf(?:e|en|t)?\b{_DE_S}\bauf\b{_DE_S}\bbeim\b|\bsetz(?:e|en|t)?\b{_DE_S}\bein\b{_DE_S}\bbeim\b" +) + # A "when" clause or use phrase per language: the model chooses a skill from its description alone. # Latin cues take word boundaries, CJK cues are substrings; bare 使用 (use) or 用于 (for) are too broad. WHEN_CUES = { @@ -19,14 +30,14 @@ r"whenever\b)", "es": r"(?