Repository navigation
0.148.1: read_world_file accepts a tool's world.json under a dot-folder inside the world - #49
Merged
Merged
Conversation
…er inside the world The reader refused a world file whose world holds a world.json under a dot-folder (abbey/.atlas/world.json, abbey/elements/character/.trash/world.json) as a second world (OW-5). A dot-folder is never a world, wherever it sits, and read_folder never reads one, so the same tree opened as a folder and was refused as a file. The OW-5 loop now skips a path when any folder segment of it, relative to the world's root, starts with a dot. Nothing else moves: every other check still runs on those entries, a . or .. segment is still refused, they are still returned in entries, a nested world.json elsewhere (abbey/inner/world.json) is still refused, and records/ is still excepted. This follows a ruling on the world-file conformance checks OW-4 and OW-5; the conformance case comes with the next schema distribution serial. Five tests build the archives by hand, the same cases in the same order as the npm SDK's: three accepted shapes (a root dot-folder, one under a type folder, a ..atlas name), each written out with to_folder and read with read_folder against the same tree written directly; the refusals that stay; and records/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously 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.
What changed
read_world_filerefused a world file whose world holds a tool's ownworld.jsonunder a dot-folder (abbey/.atlas/world.json,abbey/elements/character/.trash/world.json) as a second world (OW-5). A dot-folder is never a world, wherever it sits, andread_foldernever reads one, so the same tree opened as a folder and was refused as a file.The OW-5 loop in
src/onlyworlds/worldfile.pynow skips a path when any folder segment of it (every segment but the last, relative to the world's root) starts with a dot. One condition, plus its comment and the module docstring's OW-5 bullet. Nothing else moves:entries(and written byto_folder), as before;.or..segment is still refused (unsafe_path, checked before this loop);world.jsonoutside a dot-folder and outsiderecords/(abbey/inner/world.json) is still refused;records/is still excepted;private_dir).This follows a ruling on the world-file conformance checks OW-4 and OW-5; the conformance case comes with the next schema distribution serial. Version 0.148.1, with its
CHANGELOG.mdentry.Tests (
tests/test_worldfile.py)Five new tests, archives built in the test with
zipfile; the npm SDK's pull request has the same five cases in the same order:abbey/.atlas/world.json(another world's id) andabbey/.atlas/world-prefs.json: accepted, the world is abbey's, every entry returned, andread_folderoverto_folder's output reads only abbey's one character and equalsread_folderover the same tree written directly (world, elements, skipped, duplicates, ignored directories).abbey/elements/character/.trash/world.json.abbey/..atlas/world.json.abbey/inner/world.json(more_than_one),abbey/inner/.atlas/../world.jsonandabbey/.atlas/./world.json(unsafe_path), andabbey/inner/world.jsonbesideabbey/inner/.hidden/world.jsonor beside a dot fileabbey/inner/.hidden(more_than_one, namingabbey/inner/world.json).abbey/records/lab/world.json: still accepted.Red before, green after: with the source change stashed,
uv run pytest tests/test_worldfile.pygave4 failed, 32 passed, 2 skipped(tests 1, 2 and 3 refused withmore_than_one; test 4 refused namingabbey/inner/.hidden/world.jsonfirst); with it,36 passed, 2 skipped(the two skips are Windows-only: NTFS names, symlinks).Gates (AGENTS.md, in order)
uv sync --locked:Checked 16 packages in 1msuv run pytest -q:2392 passed, 45 skipped in 128.08s (0:02:08); the.owworldfixture-set replay passes untoucheduv run ruff check .:All checks passed!uv run ruff format --check .:141 files already formatteduv run mypy --strict src tests:Success: no issues found in 131 source filesuv run python codegen/generate_schema.py --check:ok: _schema.py and the vendored checker match v0.34.1-dist.145uv run python codegen/generate_tools.py --check:ok: _tools.py matches the tools list at aa009695f03d7c78972793b034c145990ce4c1b7uv run python codegen/generate_anchors.py --check:src\onlyworlds\_anchors.py is currentuv run python codegen/generate_directions.py --check:src\onlyworlds\_directions.py is currentuv run python codegen/generate_casefold.py --check:_casefold.py current: 1457 rowsuv run python codegen/generate_nfc.py --check:_nfc.py current: 922 classes in 388 runs, 2061 mappings, 81 exclusionsuv run python scripts/public_words.py:public words: 0 finding(s) in 154 file(s); the new changelog entry alone:0 finding(s) in 1 file(s)uv run python scripts/public_words.py --commits origin/main..HEAD:public words: 0 finding(s) in 1 commit message(s)Run on Windows, Python 3.14. Not run locally: the wire and live tests (
OW_OPENAPI,OW_LIVE; no route or method changed, and CI'swirejob runs them),okf-referenceandfolder-conformance(CI jobs), and thewheeljob (no packaging change).Looked wrong, left alone
read_folderskips a dot-prefixed file in a type folder and lists it inskipped; the npm SDK's folder source passes over it silently. Not file against folder, and outside this change.🤖 Generated with Claude Code