For types/source.md (instance-owned type-spec, shipped as types/source.md.template) at about 100 lines, wikitool docs toc --apply inserts a table-of-contents region, wikitool docs verify then still reports that region as stale, and a second --apply removes it again. The removal also deletes the blank line that stood before the region, so the end state differs from the start state by that one line.
Environment
Claude Code (CLI), zsh, Linux 6.18.36-1-lts. Instance on stack 10.1.0 (distribution exported 2026-10-16, from commit c1ddefdc7f), content version 10.0.0. WIKITOOL_SESSION_ID=upgrade-10.1.0. The upgrade to 10.1.0 itself completed with doctor, docs verify, instructions verify and lint green before the steps below.
Steps
First occurrence (exit codes of steps 2-5 not captured, output was piped):
Edited types/source.md by hand: added one table row. The file went from 100 lines (as committed, no table-of-contents region) to 101 lines.
tools/wikitool docs toc --apply printed types/source.md and OK Refreshed the table of contents on 2 file(s). The region was inserted into types/source.md.
tools/wikitool docs verify printed ERROR Documentation issues found: / - types/source.md needs a table-of-contents region refreshed - run wikitool docs toc --apply. Same result on an immediate second run.
tools/wikitool docs toc --apply printed OK Refreshed the table of contents on 1 file(s). The region was removed again, together with the blank line before ## Frontmatter; the file had 100 lines afterwards.
tools/wikitool docs verify printed OK Docs verified: ....
Deliberate reproduction in the same checkout, exit codes captured:
Re-inserted the blank line before ## Frontmatter by hand (101 lines, no region).
docs verify exited 1: - types/source.md needs a table-of-contents region refreshed.
docs toc --apply exited 0: OK Refreshed the table of contents on 1 file(s). File: 108 lines (region inserted).
docs verify exited 1, same ERROR line as in step 7.
docs toc --apply exited 0: OK Refreshed the table of contents on 1 file(s). File: 100 lines (region removed, and the blank line before ## Frontmatter with it).
docs verify exited 0.
cmp against a copy taken before step 6: identical.
Expected
docs toc --apply brings a file into the state docs verify accepts in one run. The help says: "If docs verify still reports a stale region after --apply, the file's ## headings changed in between; run it again".
Removing a region restores the text around it as it was before insertion.
Observed
For a type-spec of 101 lines, --apply inserts a region, docs verify then still reports it stale, and the second --apply removes it. Nothing changed the ## headings between the runs.
The removal also deletes the blank line that preceded the region, so ## Frontmatter follows a paragraph line directly.
Not known
Whether the effect depends on the file being a type-spec or occurs on any in-scope file near the 100-line threshold. Only types/source.md was observed.
Notes
A pseudonymised bug-report bundle exists locally (bugreport-20261016T194027Z) and can be supplied on request.
## Summary
For `types/source.md` (instance-owned type-spec, shipped as `types/source.md.template`) at about 100 lines, `wikitool docs toc --apply` inserts a table-of-contents region, `wikitool docs verify` then still reports that region as stale, and a second `--apply` removes it again. The removal also deletes the blank line that stood before the region, so the end state differs from the start state by that one line.
## Environment
Claude Code (CLI), zsh, Linux 6.18.36-1-lts. Instance on stack 10.1.0 (distribution exported 2026-10-16, from commit c1ddefdc7f15), content version 10.0.0. `WIKITOOL_SESSION_ID=upgrade-10.1.0`. The upgrade to 10.1.0 itself completed with doctor, docs verify, instructions verify and lint green before the steps below.
## Steps
First occurrence (exit codes of steps 2-5 not captured, output was piped):
1. Edited `types/source.md` by hand: added one table row. The file went from 100 lines (as committed, no table-of-contents region) to 101 lines.
2. `tools/wikitool docs toc --apply` printed `types/source.md` and `OK Refreshed the table of contents on 2 file(s).` The region was inserted into `types/source.md`.
3. `tools/wikitool docs verify` printed `ERROR Documentation issues found:` / `- types/source.md needs a table-of-contents region refreshed - run wikitool docs toc --apply`. Same result on an immediate second run.
4. `tools/wikitool docs toc --apply` printed `OK Refreshed the table of contents on 1 file(s).` The region was removed again, together with the blank line before `## Frontmatter`; the file had 100 lines afterwards.
5. `tools/wikitool docs verify` printed `OK Docs verified: ...`.
Deliberate reproduction in the same checkout, exit codes captured:
6. Re-inserted the blank line before `## Frontmatter` by hand (101 lines, no region).
7. `docs verify` exited 1: `- types/source.md needs a table-of-contents region refreshed`.
8. `docs toc --apply` exited 0: `OK Refreshed the table of contents on 1 file(s).` File: 108 lines (region inserted).
9. `docs verify` exited 1, same ERROR line as in step 7.
10. `docs toc --apply` exited 0: `OK Refreshed the table of contents on 1 file(s).` File: 100 lines (region removed, and the blank line before `## Frontmatter` with it).
11. `docs verify` exited 0.
12. `cmp` against a copy taken before step 6: identical.
## Expected
- `docs toc --apply` brings a file into the state `docs verify` accepts in one run. The help says: "If `docs verify` still reports a stale region after `--apply`, the file's `##` headings changed in between; run it again".
- Removing a region restores the text around it as it was before insertion.
## Observed
- For a type-spec of 101 lines, `--apply` inserts a region, `docs verify` then still reports it stale, and the second `--apply` removes it. Nothing changed the `##` headings between the runs.
- The removal also deletes the blank line that preceded the region, so `## Frontmatter` follows a paragraph line directly.
## Not known
Whether the effect depends on the file being a type-spec or occurs on any in-scope file near the 100-line threshold. Only `types/source.md` was observed.
## Notes
A pseudonymised bug-report bundle exists locally (`bugreport-20261016T194027Z`) and can be supplied on request.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
For
types/source.md(instance-owned type-spec, shipped astypes/source.md.template) at about 100 lines,wikitool docs toc --applyinserts a table-of-contents region,wikitool docs verifythen still reports that region as stale, and a second--applyremoves it again. The removal also deletes the blank line that stood before the region, so the end state differs from the start state by that one line.Environment
Claude Code (CLI), zsh, Linux 6.18.36-1-lts. Instance on stack 10.1.0 (distribution exported 2026-10-16, from commit
c1ddefdc7f), content version 10.0.0.WIKITOOL_SESSION_ID=upgrade-10.1.0. The upgrade to 10.1.0 itself completed with doctor, docs verify, instructions verify and lint green before the steps below.Steps
First occurrence (exit codes of steps 2-5 not captured, output was piped):
types/source.mdby hand: added one table row. The file went from 100 lines (as committed, no table-of-contents region) to 101 lines.tools/wikitool docs toc --applyprintedtypes/source.mdandOK Refreshed the table of contents on 2 file(s).The region was inserted intotypes/source.md.tools/wikitool docs verifyprintedERROR Documentation issues found:/- types/source.md needs a table-of-contents region refreshed - run wikitool docs toc --apply. Same result on an immediate second run.tools/wikitool docs toc --applyprintedOK Refreshed the table of contents on 1 file(s).The region was removed again, together with the blank line before## Frontmatter; the file had 100 lines afterwards.tools/wikitool docs verifyprintedOK Docs verified: ....Deliberate reproduction in the same checkout, exit codes captured:
## Frontmatterby hand (101 lines, no region).docs verifyexited 1:- types/source.md needs a table-of-contents region refreshed.docs toc --applyexited 0:OK Refreshed the table of contents on 1 file(s).File: 108 lines (region inserted).docs verifyexited 1, same ERROR line as in step 7.docs toc --applyexited 0:OK Refreshed the table of contents on 1 file(s).File: 100 lines (region removed, and the blank line before## Frontmatterwith it).docs verifyexited 0.cmpagainst a copy taken before step 6: identical.Expected
docs toc --applybrings a file into the statedocs verifyaccepts in one run. The help says: "Ifdocs verifystill reports a stale region after--apply, the file's##headings changed in between; run it again".Observed
--applyinserts a region,docs verifythen still reports it stale, and the second--applyremoves it. Nothing changed the##headings between the runs.## Frontmatterfollows a paragraph line directly.Not known
Whether the effect depends on the file being a type-spec or occurs on any in-scope file near the 100-line threshold. Only
types/source.mdwas observed.Notes
A pseudonymised bug-report bundle exists locally (
bugreport-20261016T194027Z) and can be supplied on request.