Repository navigation
wiki 1.11.0: settings, messages and lint improvements - #91
Open
Andrew Turner (acturner) wants to merge 108 commits into
Open
Andrew Turner (acturner) wants to merge 108 commits into
Andrew Turner (acturner) wants to merge 108 commits into
Conversation
`.wiki/settings.json` and `init --settings` are read by one strict reader, `wiki.util.json.strict_loads`. It refuses what `json.loads` reads beyond the JSON grammar, and words each cause itself: - `NaN`, `Infinity` and `-Infinity`; - a number past the range of a double, such as `1e400` or an integer of 400 digits; - a lone surrogate, in a string or a key; - nesting of 128 levels or more, counted on the text before it is parsed, so the verdict does not depend on the interpreter's stack. The settings file keeps its `Malformed JSON in .wiki/settings.json: ` prefix and `init --settings` keeps `--settings must be valid JSON (`, so `init` cannot write a file the next command refuses, and a deeply nested `--settings` no longer ends in a recursion error. A plain syntax error keeps the parser's own sentence. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A key named twice in one object, at any level, is refused by the strict reader as `duplicate key 'exclude'`, in `.wiki/settings.json` and in `init --settings` alike. The last of two equal keys had won with no message, so a second `exclude` block discarded the first: a text merge of two branches can produce one without a conflict. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `.wiki/settings.json` that yields no text is refused in one line, `Cannot read .wiki/settings.json (<reason>).`: - no permission gives the system's reason (`Permission denied`), with no absolute path; - a folder, or anything else at the path that is not a file, is `not a regular file`, and is refused unopened; - a byte-order mark gets a reason that says to remove it. The resolver reports a missing settings file only when nothing is at the path, so a folder there is no longer called missing one line before the error. A linked wiki's unreadable settings file takes the same sentence after its `links.external wiki '<path>': ` prefix. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A page that is not valid UTF-8 stopped `read`, `update` and `lint` with Python's codec sentence and the path in brackets at the end. The error now reads `<path>: not valid UTF-8 at byte N; re-save the file as UTF-8`: the path first, the offset of the first invalid byte, and the remedy, in words the package owns. - `PageDecodeError` subclasses `UnicodeDecodeError` and overrides only how it reads, so a handler for the base class catches it as before. The exit code stays 2. - The byte is the decoder's `start`, the offset where valid UTF-8 ends, so a character cut off at the end of the file is reported at its first byte. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `.wiki/settings.json` or `.obsidian/*.json` file holding bytes that are not UTF-8 was refused as `Malformed JSON in <file>:` followed by Python's codec sentence. The reason now reads `not valid UTF-8 at byte N`, the phrase the page error uses. Bad JSON in a file that decodes keeps its message. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki init` and `wiki config` decoded `.gitattributes` as UTF-8 before appending the merge mapping, so a file with a Latin-1 comment stopped both with Python's codec sentence. Git reads the file as bytes, so the append now carries a byte that is not UTF-8 through as it is and writes the file back as bytes. - The lines of a file that is valid UTF-8 are told apart as before, so the same input gets the same bytes written. - `write_atomic` takes bytes as well as text and writes them as given. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki match` skipped a page it could not decode without a word, so a pattern the page held came back as `No matches found.` It now emits the read-skip notice `wiki search` emits for such a page, and the other results and the exit code are unchanged. A file that is not a page, such as an image under `--all`, is still skipped in silence. The notice reads `Skipping <path>: not readable as UTF-8 text`, in place of `unreadable during search refresh`, so the one line is true from both commands. The notice kind and its payload are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two more errors printed Python's codec sentence for bytes that are not UTF-8. Both now carry the phrase the other files get. - `wiki trust` refuses a trust store that is not UTF-8 as `Trust store is corrupt: <path> (not valid UTF-8 at byte N); ...`. - `wiki config` refuses a JSON file staged under `.wiki/obsidian/` as `Malformed JSON in .wiki/obsidian/<file>: not valid UTF-8 at byte N`, where the codec sentence stood alone with no file name. Bad JSON in a staged file that decodes keeps its message. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki search` prints the read-skip line for a page it cannot open as well as for one it cannot decode, so `not readable as UTF-8 text` blamed the encoding for a permission error. The line now reads `unreadable, or not valid UTF-8`, which holds for both causes and for `wiki match`, with the same kind and payload. The search test pins the line for a page that cannot be opened. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The test for a `.gitattributes` that is not UTF-8 checked the exit code and the file's bytes only. It now also checks that neither `wiki init` nor `wiki config` prints the word `codec`, as the tests for the other files do. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Text that is not UTF-8
Only a settings path that holds nothing is an absent file. The read, the restoration `update` and `config` run, and the resolver's missing-file notice each ask the filesystem once and take only "no such file" as absent, as the read of a linked wiki's settings does. A symlink loop at `.wiki/settings.json` was read as a missing file: `map` and `lint` ran on default settings under a notice that `wiki update` would restore it, and `update` then failed with a raw error and an absolute path. It is refused in one line, `Cannot read .wiki/settings.json (Too many levels of symbolic links).`, by every command that reads policy. A dangling symlink is still a missing file that `update` restores. The configuration page says where a path that holds something is still named missing: the `No wiki at: ...` error of a folder with neither a settings file nor a root `_index.md`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `links.external` wiki whose settings file cannot be read gets the host's own sentence behind the prefix that names the wiki: `links.external wiki '../manual': Cannot read .wiki/settings.json (Permission denied).` The test asserts the whole message for an unreadable file, an unreadable settings folder and a symlink loop, where it matched only the prefix, and the CHANGELOG entry names the linked-wiki form. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The CHANGELOG's Unreleased section keeps both sides' lines: the settings entries of this branch, then the UTF-8 entries. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Reading the settings file
`wiki match` printed Python's `FutureWarning` for a pattern with an unescaped `[[`, with an install path and a line of wiki's source, and then either ran the pattern or failed with the parser's bare reason. Neither said the argument is a regex, and `[[` is the wiki's own link syntax. - A pattern that does not compile fails with `Invalid regex '<pattern>': <reason>`, exit 2. The reason is still the parser's text. - An unescaped `[[` draws one stderr line that says it opens a character class and that `\[\[` matches a wikilink. A doubled `--`, `&&`, `~~` or `||` inside a character class draws a second line. At most one of each, in that order; stdout and the exit code do not change. - The lines are plain stderr lines of the command, read off the parser's own warnings with the regex cache cleared first, so they depend on the pattern alone. - `Wiki.match` and the `naming.pattern` check compile through `wiki.util.re.quiet_compile`, so neither lets the Python warning out. `naming.pattern` gets no line in its place. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki match` split a file on `\n` and kept the empty piece after the final newline as a line of its own, so `wiki match '^$' --lines` reported line 15 of a 14-line file and a pattern that can match an empty line hit every file. `wiki.util.str.split_lines` splits on `\n` alone and lets a final newline end the last line without opening another. `match` reads its lines through it, so a page matches the same with and without its final newline, and a blank last line is still reported. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki read --lines` and the diff under lint's `Requires update` split text with `str.splitlines`, which also breaks on a form feed and on the Unicode separators. A line holding a form feed came back from a slice as two lines with the form feed replaced by a newline, and the lines after it sat one index later than `wiki match` numbers them. Both now split through `wiki.util.str.split_lines`, as `match` does, so the three agree on what a line is and a slice returns the page's own text. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki read` parsed its slice after it resolved the wiki, so `wiki read a/p --path /nonexistent --lines zz` reported the missing wiki and not the malformed slice. The slice is now parsed with the other argument checks, before the wiki is looked for. An empty `--lines`, `--words` or `--chars` value was read as an absent option and returned the whole page. It is now `Invalid slice format`, and it still excludes another slice unit. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A slice bound and the values of `map --depth`, `map --desc-limit` and `search --limit` went through Python's `int`, which also reads surrounding whitespace, `_` between digits and the digits of any script, and has no upper bound. `wiki map --depth ' 1_0'` ran at depth 10. `parse_int` takes an optional sign and ASCII digits and requires a signed 64-bit value. The three options parse through it and a slice bound does too, so `' 10'`, `1_0`, `1.0`, a non-ASCII digit and a number past 64 bits are usage errors. The options set their own `INTEGER` label and refuse a value as `'<value>' is not a valid integer.`, the words click uses. Left to typer, the label, the message and the accepted forms differ between the typer versions the package allows: 0.29 labels the option `<int>` and reads `1.0` as 1. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Each settings block was checked only when a command first read it, so `wiki update --check` passed on a file that `wiki lint` or `wiki map` refused. `update`, `new`, `lint`, `map`, `search` and `match` now check all seven blocks first, in the order the configuration page lists them: before a scope is resolved, a folder walked, a notice emitted or a file written. `init` runs the same check on its seed. `read`, `config` and the merge driver keep reading only the blocks they use, so a page stays readable, the repair command runnable, and a merge still settles stamps on a wiki with a broken block elsewhere. The one check that follows a path on disk, a `links.external` folder that resolves inside the wiki through a symlink, is left to `lint` and `init`, where it was. A symlink differs from one checkout to the next, and `update` judges the settings file by its text. A `naming.min_length` above `naming.max_length` is a settings error that names both keys. No name passed such a policy, so `wiki update` skipped every entry and pruned every index row. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A settings error printed the wrong value in Python spelling: `got None`
for a `null`, `got {'a': True}` for an object. The 22 messages that
show a wrong value now print it as JSON, as the settings file spells
it (`got null`, `got {"a": true}`), and cut a value longer than 80
characters there with `...`. A message that quotes a name, a pattern or
a path keeps its quoting.
Every entry of `naming.validate` and `naming.reserved` must be a
string. An object or a list there raised a raw Python error that named
neither the file nor the key, worded differently by Python 3.13 and
3.14, and a number in `naming.reserved` was accepted and matched no
name. Each now gets the error a non-string `exclude.patterns` entry
gets: `naming.reserved entry must be a string, got ["x"] in
.wiki/settings.json.`
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A class that opens with `^` holds a literal caret here, where gitignore reads it as "not these": `a/[^p]*.md` excluded `a/p.md`, the one page its author meant to keep, in silence. An `exclude.patterns` entry that holds `[^` anywhere is now a settings error that names `[!...]`, the spelling that negates, as a leading `!` and a backslash already are. `wiki.util.glob.translate` is unchanged, and its test table now pins the literal caret, which the exclusion differential can no longer reach through a settings file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Settings validation
`Wiki.match` and the hint pass caught only `re.error`. Python's regex
parser also raises `OverflowError` for a repeat count past its limit
and `RecursionError` for groups nested past the interpreter's stack,
so `wiki match 'a{4294967296}'` failed with the bare sentence `the
repetition number is too large`.
Both sites now treat the three errors alike, and each such pattern
fails with `Invalid regex '<pattern>': <reason>`, exit 2, in one
stderr line.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The `wiki match` reference said a doubled `--`, `&&`, `~~` or `||` inside a character class matches as plain characters. That holds for three of them. A `--` after a character forms a range, so `[+--]` matches `+`, `,` and `-`, and `[a--b]` does not compile. The sentence now says what the hint line says: the doubled characters are not a set operation in a Python regex. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A form feed in a page body is what is left of \frac once a tool decoded \f on the way in, and lint did not look at body text for it. Lint now notes a C0 control other than a tab or a line break, or DEL, in a page's body and in an index's text below the delimiter: one note per file, with the first line, its character and the count. Code is scanned too. The H1 and the link rows are generated from frontmatter fields, so they are not scanned and the damage is reported on the file that holds the field. A no-lint region is skipped, and lint.strict does not make the note an issue. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An indented Key: value line under a bare desc: nests a mapping, and title: [Draft] is a list. The block is valid YAML, so lint was silent: update wrote the field's source lines into the H1 and the parent's row while every strict reader handed other tools a collection. Lint now reports a name, title, desc or category whose value is a mapping or a list. The issue names the field and its line, and says to quote the value or write it as a >- block. tags and sources are lists by design and are not judged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A double-quoted value with a backslash YAML cannot decode, such as "Uses \(p\) here" or "Uses $\xi$.", is a parse error, and lint advised "quote or rewrite the value" for a value that was quoted already. The strict reader's findings gain an escape cause: an unknown escape character, a bad \x or \u number, or a code that names no character. Lint says for it that a backslash starts an escape inside double quotes, and to write LaTeX in single quotes or a block scalar, or to double each backslash. Every other parse error keeps its advice. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A writing `wiki update` recreated a missing `.wiki/settings.json` as
`{}` and swept the wiki in the same run, on default settings. With
`exclude.patterns: ["secret"]` in the lost file, that one run adopted
every page under `secret/`, and `update --check` passed beforehand.
When the file is missing from the working tree while HEAD or the index
holds it, `update` (and `--check`), `new`, `lint`, `config` and an
`init` that would scaffold now stop with exit code 2 before any walk or
write:
.wiki/settings.json is missing, but git still holds it. Restore it
from git and rerun: the file is recreated with default settings
only when git does not hold it.
The guard sits beside the legacy-layout guard, so `read`, `search`,
`match` and `map` still run. A missing file git does not hold is
restored as before: outside a repository, never committed, or with its
removal committed.
One `git status` read answers for HEAD and the index, and only once the
file is known to be missing, so a wiki with its file pays nothing. The
answer is cached on the engine: `new` reaches the guard three times in
one run. A root that is missing too is asked about from its nearest
existing folder, with a literal pathspec, so `init` over a deleted wiki
refuses as well and a folder name never matches a sibling as a glob.
The resolver's line for a missing settings file now says to restore the
file from git, or to run `wiki update` to recreate it with default
settings.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
libyaml words a bad \x or \u number in a double-quoted value as "did not find expected hexdecimal number", and lint printed the reason as it came. The word is rewritten where the reason is worded, so the issue reads "hexadecimal" under either loader. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge is clean. The CHANGELOG's Unreleased section keeps both sides' lines. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The lost-settings guard read `git status`, which lists nothing for an
index entry marked skip-worktree or assume-unchanged. In a sparse
checkout that leaves `.wiki/` out, or with either mark set and the file
deleted, `wiki update` still wrote `{}` over the tracked settings file
and swept the wiki on default settings; `git status` then hid the
replacement.
The guard now lists the path from the index with HEAD's tree laid over
it (`git ls-files --with-tree=HEAD`), so it refuses whenever HEAD or the
index names the file, at any merge stage. The listing reads names only:
a partial clone fetches no blob for it. A repository without a commit
has no tree to lay over, and git refuses that listing, so the index is
then asked alone.
The docs give the restore command these states need: plain
`git restore` does not match a path a sparse checkout leaves out or one
marked skip-worktree, and `git restore --ignore-skip-worktree-bits`
does.
The test gains the sparse-checkout, skip-worktree, assume-unchanged,
unmerged and staged-before-a-first-commit states.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Inside a repository git refuses to read, or with no git on the machine,
nothing answers for the missing settings file, so `wiki update`
recreates it as `{}` as it does outside a repository. The configuration
page named only the two cases git answers for; it now names this one,
and a test pins it: the run also carries the gitignore fence's own line
about the failed git call.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Committing the file's removal is how a wiki gives up its settings for
the defaults, but HEAD holds the file until that commit lands, so a
commit hook that runs `wiki lint` or `wiki update --check` refuses and
blocks it. The configuration page now gives the two ways through:
write `{}` to the file and commit that, or commit the removal with the
hook skipped.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The skill said `wiki init` stops whenever git holds the missing file; on a wiki whose root index stands, `init` returns early with exit code 0, so the skill now says `init` stops only where it would scaffold. It also gains the `git restore --staged --worktree` form a staged removal needs, which the configuration page already gave. The `init` and `new` refusal lists in the CLI reference name the refusal, as the `update` and `config` sections do. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`wiki config` writes outside the wiki root: it registers the merge driver in the repository's local git config. The lost-settings test compared only the wiki root's files, so a `config` that wired git before it refused would have passed. The test now removes the driver's section first and checks the local config is unchanged after every refused command. A missing settings file that is an untracked symlink to nothing is recreated like any other file git does not hold; a case pins it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The description section of the pages guide said lint does not report an indented Key: value line under a bare desc: key. Lint reports it as a nonscalar_field issue, as the frontmatter section of the same page says. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lint checks a text field for a mapping or a list in a folder index as it does in a page, and the test wrote the field only into a page. It now runs for both, so the index-side check is pinned. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A double-quoted "\U00110000" names no character. The C loader rejects it as an invalid escape, and lint gives the quoting remedy on the escape's line. The pure-Python loader raises a bare ValueError from chr() instead, with no position, so the same value drew "quote or rewrite the value" on line 1 with the reason "ValueError". The reader now scans the body again when the pure loader raises that error, takes the line its scanner stopped on, and words the finding as the C loader does. A ValueError raised anywhere else keeps its report. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lint judges the decoded value of a double-quoted text field, so a tab typed raw between the quotes, or the line break a blank line inside a multi-line value folds to, is reported with the backslash advice. The generation guide now says so, and the test holds the case. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lint text checks
A lost settings file
init and config leave a .gitattributes with uncommitted changes as it stands, so the mapping it lacks stays missing after a run that exits 0, and nothing said so. The files it would map then merge as plain text. Each skipped file now draws one stderr line that names the file and every mapping line it lacks, with the remedy: commit the file, then run `wiki config`. The exit code stays 0, and --quiet does not hide the line. configure_git_merge_driver returns the lines and the two commands print them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge wiring maps index files in the repository root's .gitattributes and pages in a .gitattributes in the wiki root. A wiki that holds the first line alone merges its indexes through the driver and its pages as plain text, which conflict on their updated: lines, and nothing said so. lint now asks git about a page name in the wiki root in the check-attr call it already makes for the root index. Index mapped and page not draws one note, typed page_merge_unmapped in --json, that names `wiki config` as the fix. A page mapped by the repository root's file counts as mapped. A wiki with no mapping, a wiki the repository ignores and a wiki outside a repository draw no note. The ignored-wiki answer comes from the batch probe the gitignore fence runs, kept as _gitignore_matches, so lint runs no git command it did not run before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts: # docs/cli/index.rst # wiki/core/wiki.py
The comment beside the page-mapping note said the fence's batch probe runs anyway, so the note costs no git call of its own. The walk runs that probe for the first entry it weighs against the fence, and a wiki that holds nothing but its root index, the state `wiki init` leaves, has none. There the note's ignored-wiki test runs the probe itself: one check-ignore call, made only when the index is mapped and the pages are not. The comment now says so. No behaviour changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The CHANGELOG said a wiki git ignores draws no note. The note is skipped when the repository's own rules ignore the wiki: its .gitignore files and .git/info/exclude, the rules the gitignore fence reads. A wiki that only a personal core.excludesFile ignores still draws the note, so the note reads the same on every clone of the repository. The CHANGELOG line now says "a wiki the repository ignores", as the generation guide does, and the docstring gives the reason. A new case of the parameterized lint test fixes the behaviour for a wiki ignored through core.excludesFile alone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge wiring
The entries stood in the order their pull requests merged. They now run by area inside each heading: settings, then the command line, then lint, then update, then the merge wiring. Changed takes the two lost-settings entries ahead of `--path ""` and the empty slice. Fixed groups the encoding, `match`, `read`, output, `search`, `map`, scope and help entries, then lint, then the four `update` entries, then the two `.gitattributes` entries. No entry's text changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A file where the `.wiki` folder belongs gets the `Cannot read` error from the commands that read policy; `map` and `lint` ran on default settings there. The stderr line about a missing settings file prints only when nothing stands at the path, so a `--path` inside an index tree rooted at the home folder no longer draws it. Both follow from one rule: only a settings path that holds nothing is a missing file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Assemble the 1.11.0 changelog
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Andrew Turner (acturner)
marked this pull request as ready for review
November 28, 2026 07:49
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 1.11.0 batch in one pull request: eleven changes to how wiki reads its settings, words its messages and lints page text, each merged here from a pull request of its own (#77 to #84 and #86 to #88), and the assembled CHANGELOG (#90). It changes no file wiki writes: for every input that 1.10.0 and this branch both accept, pages, indexes, settings files and
.gitattributescome out byte for byte the same.This pull request does not bump the version and publishes nothing.
wiki --versionstill prints1.10.0.Breaking
timestamp.formataccepts only%Y,%m,%d,%H,%M,%S,%z,%%and literal text, and the format must read back the stamp it writes. Any other directive is a settings error that names it, and so are a digit straight after%zand a format whose stamp does not parse back, such as%Y %Y. A wiki with such a format changes it and rewrites its stamps by hand, as any format change requires.wiki readslice,map --depth,map --desc-limitandsearch --limit. Forms that Python happened to read, such as' 10',1_0and non-ASCII digits, are usage errors.What changed
Reading the settings file (#78).
.wiki/settings.jsonandinit --settingsmust be strict JSON.NaN,Infinity, a number too large to represent, a lone surrogate escape, nesting 128 levels deep and a key named twice in one object are refused with a message that names the cause.Cannot read .wiki/settings.json (<cause>).in place of a raw Python error.Settings validation (#79).
update,new,lint,map,search,match) checks the whole settings file before it does anything else, soupdate --checkno longer passes on a filelintormaprefuses.read,configand the merge driver still run on a wiki with a broken block they do not use.naming.min_lengthabovenaming.max_length, a non-string entry ofnaming.validateornaming.reserved, and[^in anexclude.patternsentry (with a pointer to[!...]).got null), cut at 80 characters.Timestamp formats (#81). The first Breaking line above.
Settings warnings and
init --settings(#84).init,update,newandlintwarn on stderr about a settings key wiki does not know, named as a dotted path (exclude.pattern), about anexclude.patternsentry that starts or ends with a space, and aboutnaming.leading_digits: falsewithout theidentifierrule. The key is still ignored and no exit code changes.lint --jsonlists each warning as a note of kindsettings_warning.init --settingssays on stderr when the settings given are not the wiki's settings after the command. It still exits 0.A lost settings file (#86).
.wiki/settings.jsonis missing but git still holds it,update,new,lint,configand a scaffoldinginitstop with exit code 2 and say to restore it. Before,updaterecreated the file as{}and swept the wiki on default settings, adopting every page the lostexclude.patternshad kept out. A file git does not hold is recreated as before.Text that is not UTF-8 (#77).
read,updateandlintwith<path>: not valid UTF-8 at byte N; re-save the file as UTF-8. A settings file or an Obsidian JSON file gets the same wording.initandconfigno longer fail on a.gitattributesthat is not UTF-8.matchsays when it skips a page it cannot decode, assearchdoes.matchandread(#80).Invalid regex '<pattern>': <reason>. An unescaped[[, and a doubled--,&&,~~or||inside a character class, each get one line of advice in place of a Python warning.matchno longer reports a line past the end of a file that ends with a newline.read --linesand the diff under lint'sRequires updatebreak lines at a newline and at nothing else.--lines,--wordsor--charsvalue is an invalid slice, andreadchecks its slice before it looks for the wiki.Command line (#82).
-hworks as--help, andwikiwith no command prints the help page.--path ""is a usage error.search --jsonprints[]when nothing matches.mapsaysNo entries match.when a filter left nothing to show.updatenarration (#83).update --check --fullsays what would change (Would adopt bare page: ...) where it printed the lines of a writing run.--fullwhen a kind of skip repeats.lint.Lint text checks (#87).
control_character: a double-quotedname,title,descorcategorythat holds a control character, which is what a LaTeX backslash decodes to there (\fof\frac).nonscalar_field: one of those fields is a YAML mapping or list.content_control_character: a control character in a page body or in an index's text below***.Merge wiring (#88).
lintnotes a wiki whose index files are mapped to the merge driver but whose pages are not (kindpage_merge_unmapped).initandconfigsay when they skip a.gitattributesthat has uncommitted changes, and name the line they did not add.The CHANGELOG's Unreleased section has every line. Each change corrects the docs it makes untrue, in
docs/,wiki/skills/wiki/SKILL.mdandREADME.md.Proof: 1.10.0 against this branch
The parity harness of the
v2branch ran the tagv1.10.0against this branch on one interpreter and one set of pinned packages, and reported everything the two do differently: each byte of stdout and stderr, each exit code, each byte and mode of every file, each touched path and each cache entry. The runs usedaff438f; the head adds only the CHANGELOG assembly (#90). Every difference was then held to a table of expected differences, one row per change, under one rule: a difference with no row fails. A row's trigger is decided from 1.10.0's own output, from the arguments, or from a scan of the input, never from what this branch printed.update --check --fullPer row, the commands it explains:
min_lengthabovemax_length, non-string naming entry,[^)init --settingsnot appliedmatch-h, barewiki,--path "", slices and numberssearch --json[],No entries match., scope hintsupdate --check --full--fullpointerinstallcalls below. No command of this branch stopped where 1.10.0 had already written.match (error,No entries match.frommap --no-markdownon four wikis with no such entry, and the control-character note on nine pages.control_characterand nononscalar_fieldcase, and nine pages hold a control character in their body.lintnotes exactly those nine.lintturns from 0 to 1 only where the scan finds a new issue, which happens in the fixtures and the replay alone.lint --json: 1.10.0's rows stand unchanged and in order, rows are only added, of the new kinds, and the summary moves by exactly the added rows. The one exception is the second item below.format.extract_frontmatter,format.read_frontmatter_fieldandglob.translatereturn the same values on both sides over 46,363 pages, 428,550 field reads and 3,467 exclude patterns..wiki/settings.jsonfiles on the machine. It refuses one, a glob test fixture that uses[^a].For the reviewer: three things the table does not cover
wiki installcopies differs, because each change correctedwiki/skills/wiki/SKILL.md. Streams and exit codes ofinstallare equal. The table has no row for it.--pathinside an index tree rooted at the home folder, 1.10.0 printed.wiki/settings.json missing; wiki update will restore italthough a file stands there (the home folder's settings file is the trust store, so the folder is never a declared root). This branch prints the line only when nothing stands at the path, andwiki lintno longer counts a note for it. Some of 1.10.0's CLI tests run with the home folder set to the wiki root, which is how the replay met it. The table has no row for it; the CHANGELOG says it.wiki lintis 2.4% slower on the largest of the nine wikis (21,122 pages): 15.53 s against 15.16 s, medians of five rounds on a quiet machine, with ranges that do not overlap. A profile puts the time in the three new checks.wiki update --checktakes 8.15 s on both.Two smaller notes. Piped stderr keeps a page's escape sequences as stdout does, where a notice names a path that holds one. And
lint'scontrol_characterissue also fires on anamethatwiki updatewrote for a file whose name holds control characters; such a page already drawsInvalid page name.Tests
pytest: 3,438 passed on macOS (Python 3.14) at the branch head.pre-commit run --all-filesandpyright parity tests/test_parityare clean.devandmain):testson Linux (3,437 passed, 1 skipped),lint,docsandbuildpass.tests/.Left to do after approval
dev.## [1.11.0]with its date (shaped like Bump version -> 1.10.0 #63).devintomain, and thev1.11.0tag onmain, which publishes.