MessageWeave/scripts/docs_check
anonsaber bfbaae6f01 fix(docs_check): make audit_paths' brace-glob handling actually work
Two advertised mechanisms were dead code, found by self-testing the checker
rather than trusting its 0-error output:

1. variants() could never see a brace glob. Its segment class excluded ',',
   so `channel/telegram/{mod,commands}.rs` tokenised as two bogus fragments,
   `channel/telegram/` and `commands}.rs`. The glob was still caught as an
   error, but only the first alternative was ever reported and it was
   reported under the wrong filename — a reader chasing that error would not
   find `commands}.rs` in the document. ',' is now in the segment class and
   removed from PLACEHOLDER, so the glob stays whole, expands per variant,
   and the message shows the glob alongside the failing alternative:
   `channel/telegram/{mod,commands}.rs -> channel/telegram/mod.rs`.

2. The docstring attributed the non-path exclusions to is_noise(). They are
   not: JMAP methods (Email/changes), media types (application/json), dotted
   hosts and template URLs are dropped by the whole-span rule, and absolute
   paths never arrive at all because TOKEN's lookbehind refuses to start a
   match after a '/'. is_noise() is reachable fallback for dot-prefixed URL
   parts and whole-span seg/ tokens. The docstring now says which rule does
   which, so the next reader is not pointed at the wrong function.

Verified, not assumed. A scratch doc with src/util/, src/domain/llm/client.rs,
tests/telegram_dispatch.rs, run_mode.rs and one brace glob yields exactly
5 errors and exit 1. src/ai.rs, src/domain/jmap/client.rs, docs/todo.md
(git-deleted), a stalwartlabs/ citation and docker-compose.yml all pass, as do
Email/changes, application/json, api.telegram.org/bot, 200/503,
.well-known/jmap, {jmap_origin}/.well-known/jmap and a log-format string.
GATE-DOCS still PASS (6/6), 362 path-refs checked, 0 errors.
2026-09-29 09:35:08 +08:00
..
audit_anchors.py docs(tooling): close the phantom-identifier blind spot for bare filename anchors 2026-09-29 08:45:12 +08:00
audit_paths.py fix(docs_check): make audit_paths' brace-glob handling actually work 2026-09-29 09:35:08 +08:00
check_file_size.py fix(mode): restore executable bit on the doc validators 2026-09-29 01:16:43 +08:00
check_sec_refs.py docs: consume all four self-checks; make the file-size rule enforceable 2026-09-29 01:16:11 +08:00
check_tables.py docs: consume all four self-checks; make the file-size rule enforceable 2026-09-29 01:16:11 +08:00
run_all.sh docs+tooling: no document may name a path that does not exist 2026-09-29 09:28:29 +08:00
validate_docs.py docs: consume all four self-checks; make the file-size rule enforceable 2026-09-29 01:16:11 +08:00