feat: path budget - a file's path stays at 160 characters or fewer; new, rename, move and raw accept refuse more, lint reports Long Paths (#163)
CI / verify (push) Successful in 2m9s
Release / release (push) Successful in 38s

Files changed:
- CHANGES.md
- README.md
- VERSION
- instructions/page-lifecycle.md
- kb/CONTRACT.md
- tools/CONTRACT.md
- tools/chemenu/commands/_util.py
- tools/chemenu/commands/lint.py
- tools/chemenu/commands/new_page.py
- tools/chemenu/commands/page_ops.py
- tools/chemenu/commands/raw_cmd.py
- tools/chemenu/lint_core.py
- tools/chemenu/tests/test_lint.py
- tools/chemenu/tests/test_new_page.py
- tools/chemenu/tests/test_page_ops.py
- tools/chemenu/tests/test_raw_cmd.py
- tools/chemenu/tests/test_titles.py
- tools/chemenu/titles.py
This commit is contained in:
torben committed 2026-09-30 23:08:36 +02:00
1 parent 03743ebbc0
commit 04aebdeccf
18 files changed
+394 -29

No files matched your search

+14
View File
@@ -138,6 +138,20 @@ writes to; `rename` only for `--to`, so a page that already breaks the rule can
away from it), and never write over an existing file. `wikitool lint` reports existing pages that
break the rule as Unportable Titles, a hard error at every `kb_version`.
**A path has a budget too.** Windows counts 259 characters for a whole path, the folder the
instance is checked out into included, and long paths are off on the target system. The path of
any file below the instance root - `kb/` page or `raw/` source - therefore stays at **160
characters or fewer**, written with `/` and counted in UTF-16 code units, which is how Windows
counts: an emoji outside the Basic Multilingual Plane takes two. The folder limit that `doctor`
checks is the other half of the same sum.
`wikitool new` (every root), `wikitool rename` (`--to` only, also under `--dry-run`), `wikitool
move` (a single page, and `--reconcile`, which skips and names such a target) and `wikitool raw
accept` (the target under `raw/`; the remedy is renaming the file in `incoming/`) refuse a path
over the budget before writing anything. `wikitool lint` reports existing files over it as Long
Paths - advisory, not a hard error, so a corpus that predates the budget still passes
`--fail-on-error`; the fix is `wikitool rename`.
## Every page should
- [ ] Carry a clear, descriptive title and a summary near the top