Skip to content

wiki 1.11.0: settings, messages and lint improvements - #91

Open
Andrew Turner (acturner) wants to merge 108 commits into
devfrom
release-1.11
Open

Andrew Turner (acturner) wants to merge 108 commits into
devfrom
release-1.11

Conversation

@acturner

@acturner Andrew Turner (acturner) commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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 .gitattributes come out byte for byte the same.

This pull request does not bump the version and publishes nothing. wiki --version still prints 1.10.0.

Breaking

  • timestamp.format accepts 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 %z and 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.
  • A number on the command line takes an optional sign and plain digits only, within the signed 64-bit range: the bounds of a wiki read slice, map --depth, map --desc-limit and search --limit. Forms that Python happened to read, such as ' 10', 1_0 and non-ASCII digits, are usage errors.

What changed

Reading the settings file (#78).

  • .wiki/settings.json and init --settings must 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.
  • A settings file that cannot be read (no permission, a folder or a symlink loop at its path, a byte-order mark) gets Cannot read .wiki/settings.json (<cause>). in place of a raw Python error.

Settings validation (#79).

  • Every command that reads policy (update, new, lint, map, search, match) checks the whole settings file before it does anything else, so update --check no longer passes on a file lint or map refuses. read, config and the merge driver still run on a wiki with a broken block they do not use.
  • New settings errors: a naming.min_length above naming.max_length, a non-string entry of naming.validate or naming.reserved, and [^ in an exclude.patterns entry (with a pointer to [!...]).
  • A settings error shows the wrong value as JSON (got null), cut at 80 characters.

Timestamp formats (#81). The first Breaking line above.

Settings warnings and init --settings (#84).

  • init, update, new and lint warn on stderr about a settings key wiki does not know, named as a dotted path (exclude.pattern), about an exclude.patterns entry that starts or ends with a space, and about naming.leading_digits: false without the identifier rule. The key is still ignored and no exit code changes. lint --json lists each warning as a note of kind settings_warning.
  • init --settings says on stderr when the settings given are not the wiki's settings after the command. It still exits 0.

A lost settings file (#86).

  • When .wiki/settings.json is missing but git still holds it, update, new, lint, config and a scaffolding init stop with exit code 2 and say to restore it. Before, update recreated the file as {} and swept the wiki on default settings, adopting every page the lost exclude.patterns had kept out. A file git does not hold is recreated as before.

Text that is not UTF-8 (#77).

  • A page that is not valid UTF-8 stops read, update and lint with <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.
  • init and config no longer fail on a .gitattributes that is not UTF-8.
  • match says when it skips a page it cannot decode, as search does.

match and read (#80).

  • A pattern that does not compile fails as 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.
  • match no longer reports a line past the end of a file that ends with a newline.
  • read --lines and the diff under lint's Requires update break lines at a newline and at nothing else.
  • An empty --lines, --words or --chars value is an invalid slice, and read checks its slice before it looks for the wiki.
  • The second Breaking line above.

Command line (#82).

  • -h works as --help, and wiki with no command prints the help page.
  • --path "" is a usage error.
  • Output sent to a pipe or a file keeps the escape sequences a page holds.
  • search --json prints [] when nothing matches. map says No entries match. when a filter left nothing to show.
  • A scope that is not found suggests the fix: the name without the root's own folder name, or the folder of a page.

update narration (#83).

  • update --check --full says what would change (Would adopt bare page: ...) where it printed the lines of a writing run.
  • The condensed output names a file it skipped when there is one, and points to --full when a kind of skip repeats.
  • Two or more indexed paths this machine's git ignores print one count line, as in lint.
  • The line about an overwritten desc names the page's real file.

Lint text checks (#87).

  • New issue control_character: a double-quoted name, title, desc or category that holds a control character, which is what a LaTeX backslash decodes to there (\f of \frac).
  • New issue nonscalar_field: one of those fields is a YAML mapping or list.
  • New note content_control_character: a control character in a page body or in an index's text below ***.
  • A bad backslash escape in a double-quoted value gets the fitting remedy (single quotes, a block scalar or doubled backslashes).

Merge wiring (#88).

  • lint notes a wiki whose index files are mapped to the merge driver but whose pages are not (kind page_merge_unmapped).
  • init and config say when they skip a .gitattributes that 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.md and README.md.

Proof: 1.10.0 against this branch

The parity harness of the v2 branch ran the tag v1.10.0 against 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 used aff438f; 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.

Layer Command runs compared Result
Nine real wikis, on fresh copy-on-write snapshots 759 43 commands differ, all explained
The same nine, each perturbed by one fresh seed 915 every difference explained
Seven fixture families 1,372 every difference explained
The 2,972 calls of 1.10.0's own tests, replayed as command lines 5,934 182 runs differ; 20 of them have no row (below)
Every merge commit of the three histories, 1,329 merges 11,382 80 merges differ, each only in the stderr of update --check --full

Per row, the commands it explains:

Row Change On the nine wikis as they stand All five layers
R1 Strict JSON for the settings file 0 2
R2 A settings file that cannot be read 0 6
R3 The whole settings file is checked first 0 2
R4 A wrong settings value shown as JSON 0 16
R5 New settings errors (min_length above max_length, non-string naming entry, [^) 0 0
R6 Timestamp formats 0 10
R7 Settings warnings 0 0
R8 init --settings not applied 0 0
R9 A lost settings file, and the reworded line about a missing one 0 34
R10 Text that is not UTF-8 0 12
R11 Pattern errors of match 9 32
R12 Lines end at a newline alone 0 12
R13 -h, bare wiki, --path "", slices and numbers 0 4
R14 Escape sequences kept in piped output 0 98
R15 search --json [], No entries match., scope hints 4 20
R16 Dry-run wording of update --check --full 0 187
R17 A lone skipped file named; the --full pointer 0 230
R18 Control characters (two new lint findings) 27 97
R19 A field that is a mapping or a list 0 0
R20 The remedy for a bad escape 0 34
R21 Pages not mapped to the merge driver 0 4
  • No written file differs. No layer shows a difference of a tree, a touched set or a cache, outside the install calls below. No command of this branch stopped where 1.10.0 had already written.
  • Rows R1 to R10, R14, R19 and R20 show nothing on the nine wikis as they stand. No settings file there is refused or warned about, and no new lint issue appears. What does appear: the reworded match ( error, No entries match. from map --no-markdown on four wikis with no such entry, and the control-character note on nine pages.
  • The new lint findings were counted apart, by a scan that does not use this branch's code: 42,855 frontmatter blocks in the nine wikis hold no control_character and no nonscalar_field case, and nine pages hold a control character in their body. lint notes exactly those nine.
  • Exit codes are equal except where a row states a refusal. lint turns 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.
  • Merges: all 1,329 give the same exit code, the same tree and the same unmerged paths. 319 of them reach the merge driver.
  • format.extract_frontmatter, format.read_frontmatter_field and glob.translate return the same values on both sides over 46,363 pages, 428,550 field reads and 3,467 exclude patterns.
  • Settings files: this branch's whole-file check ran over the 67 distinct contents of the 17,346 .wiki/settings.json files on the machine. It refuses one, a glob test fixture that uses [^a].
  • Rows R5, R7, R8 and R19 met no input in any layer. The comparison says nothing about them; the tests of this branch hold them.

For the reviewer: three things the table does not cover

  1. The skill text wiki install copies differs, because each change corrected wiki/skills/wiki/SKILL.md. Streams and exit codes of install are equal. The table has no row for it.
  2. A false line of 1.10.0 is gone. With --path inside an index tree rooted at the home folder, 1.10.0 printed .wiki/settings.json missing; wiki update will restore it although 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, and wiki lint no 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.
  3. wiki lint is 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 --check takes 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's control_character issue also fires on a name that wiki update wrote for a file whose name holds control characters; such a page already draws Invalid page name.

Tests

  • pytest: 3,438 passed on macOS (Python 3.14) at the branch head.
  • pre-commit run --all-files and pyright parity tests/test_parity are clean.
  • CI on this pull request, the first CI run of the batch (the workflows trigger only on pull requests into dev and main): tests on Linux (3,437 passed, 1 skipped), lint, docs and build pass.
  • Each change came with its tests: the eleven pull requests add about 3,600 lines under tests/.

Left to do after approval

  • Merge this pull request into dev.
  • The bump pull request: the five version surfaces to 1.11.0, and the Unreleased entries under ## [1.11.0] with its date (shaped like Bump version -> 1.10.0 #63).
  • The release pull request from dev into main, and the v1.11.0 tag on main, which publishes.
  • Before the tag: build the wheel and the sdist and run the package checks on them.

`.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>
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>
`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>
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>
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

codecov Bot commented Nov 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.21429% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
wiki/core/wiki.py 97.60% 8 Missing ⚠️
wiki/core/format.py 96.00% 2 Missing ⚠️
wiki/cli/cmd/wiki.py 99.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@acturner
Andrew Turner (acturner) marked this pull request as ready for review November 28, 2026 07:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant