Skip to content

0.142.0: the doctor names what it could not read; a file nested too deep is skipped - #41

Merged
tmoosting merged 2 commits into
mainfrom
doctor-unread
Nov 23, 2026
Merged

tmoosting merged 2 commits into
mainfrom
doctor-unread

Conversation

@tmoosting

@tmoosting tmoosting commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The doctor said nothing about a file the folder reader skipped. With one
element file cut off mid-write it reported the other elements as the
whole world and listed every link to the unread one as a link to an
element that is not there. Report.unread (and unread in --json, after
written) now lists each such file with why, the prose report prints the
list before any finding, and any entry makes the exit code 1. A second
file of one id and a directory that is no type's are listed too; a
dot-prefixed file is not.

A value nested thousands deep made json.loads raise RecursionError,
which no reader caught: on an element file or a world.json the doctor
and pack stopped with a traceback. _outside_json.loads turns that into a
ValueError in plain words, and gives an integer of more than 4,300
digits a reason of its own in place of Python's advice about an
interpreter setting. The folder reader, the archive reader, the Kanka
and LegendKeeper doors and lint's world.json read parse through it. A
test reads the package's syntax trees and fails on a json.loads that is
neither that reader nor named.

Not changed: python -m onlyworlds.lint reads element files through the
schema distribution's own checker, which still stops on such a file.

Watched failing: four faults planted one at a time (the doctor not filling the list, the deep case let through, no reason of its own for a long number, the folder reader back on json.loads) each turned the new tests red.

Second commit: Python 3.14 on Linux parses a value nested 100,000 deep with no error, so the depth is refused by one number (200) on every platform, after the parse; a test holds the line at 200 and 201.

🤖 Generated with Claude Code

tmoosting and others added 2 commits November 23, 2026 18:07
…eep is skipped

The doctor said nothing about a file the folder reader skipped. With one
element file cut off mid-write it reported the other elements as the
whole world and listed every link to the unread one as a link to an
element that is not there. Report.unread (and unread in --json, after
written) now lists each such file with why, the prose report prints the
list before any finding, and any entry makes the exit code 1. A second
file of one id and a directory that is no type's are listed too; a
dot-prefixed file is not.

A value nested thousands deep made json.loads raise RecursionError,
which no reader caught: on an element file or a world.json the doctor
and pack stopped with a traceback. _outside_json.loads turns that into a
ValueError in plain words, and gives an integer of more than 4,300
digits a reason of its own in place of Python's advice about an
interpreter setting. The folder reader, the archive reader, the Kanka
and LegendKeeper doors and lint's world.json read parse through it. A
test reads the package's syntax trees and fails on a json.loads that is
neither that reader nor named.

Not changed: python -m onlyworlds.lint reads element files through the
schema distribution's own checker, which still stops on such a file.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The first version of this change relied on json.loads raising
RecursionError for a value nested 100,000 deep. Python 3.14 on Linux
reads that value whole, so the same file was skipped on Windows and read
on Linux, and the depth was left to whatever walked the value next.

_outside_json.loads now refuses nesting past MAX_DEPTH (200) itself,
after the parse, with a loop that keeps its own stack; a RecursionError
from the parser reads as the same refusal. A test holds the line at 200
and 201 for arrays and for objects, so each interpreter in CI shows it
parses that deep and refuses one more.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tmoosting
tmoosting merged commit 3d356f6 into main Nov 23, 2026
11 checks passed
@tmoosting
tmoosting deleted the doctor-unread branch November 23, 2026 17:35

This branch was previously deployed

1 inactive deployment
pypi — 3d356f63 Deployed Nov 23, 2026 by tmoosting via publish #229
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