Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The package version runs on its own semver; the schema it is generated from is `

## Unreleased

## 0.160.0 (2026-11-30)

- **The schema pin is v0.34.1-dist.150** (canonical 00.34.01 unchanged). The folder format is 0.3.26, so `FORMAT_VERSION` and a new folder's `format_version` say `0.3.26`; a folder stamped 0.3.25 is read as before. 0.3.26 writes down how a writer names and refuses element files, rules `write_folder` already keeps: the id tail, an id whose `<id>.json` is not one file name, and two file names that are one once folded. The schema distribution now carries their cases in `fixtures/folder-writer/` (9 id tails; 24 ids refused and 5 written; 16 sets of elements refused and 10 written), and the tests run those files, which the npm SDK's tests read too, in place of their own copies.

## 0.159.1 (2026-11-30)

- **Fixed: a folder `write_folder` writes always packs into a world file.** `write_folder`, and so `export_world` and the import doors, now also refuse an element id whose `<id>.json` the world file's name check refuses (folder spec 3.2): one holding `<`, `>`, `"`, `|`, `?` or `*`, a control character from U+007F to U+009F, or a Windows device name such as `con`. Before, such an id was written (on Windows, `a?b.json` stopped the write part-way with an OSError), and `world_file_bytes` then refused the folder. The refusal says why in the archive's words, `as "a?b.json" it holds a reserved or control character`. An id ending in a dot or a space is still written, since its file name ends in `.json`. The shared cases (`tests/fixtures/unsafe-ids.cases.json`, the same bytes as the npm SDK's) move with it: 22 refused, 5 written.
Expand Down
9 changes: 6 additions & 3 deletions codegen/schema-dist/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"example/hyperion/world.json": "e888457dec6710c6492b18ebae9470618552a3d3c557e22b99fc76ed0e21a9f5",
"example/world-export.json": "dfd36ff98b7d835e2bd4b022205dfc7424b367693e2f96416a79ca9b53c089b9",
"fixtures/file-names.fixture.json": "0da1846641e116b2ff39269261779854e794db117388bd912e5aff68a243a91d",
"fixtures/folder-writer/case-collide.cases.json": "6458bd08ad90de5dbc8c2f1fd4c52dca415cdd04bdd646555f4a00c787d0fd48",
"fixtures/folder-writer/id-tail.cases.json": "9684866ecf54bbf19901bc8579cc4b05f0b5bf3e1bbeb5036b609edfeb7bf06c",
"fixtures/folder-writer/unsafe-ids.cases.json": "de446111fbd89ab923d2450859f6f8b6020ca88770153c3b0d4045c29f4d484c",
"fixtures/owworld/CaseFolding-15.1.0.txt": "4e55acfdc32825a22e87670e9056a3bf94ad7c5400065778e9e10f8314372bcf",
"fixtures/owworld/CompositionExclusions-15.1.0.txt": "59d2d9e3dfdf0a999cf9dae11d594f053631222679a2f5710315ea07f7fe82af",
"fixtures/owworld/fail-OW-1-json-export.owworld": "f6159d0ae98ef51f9a9d920143e2c0b69bba08192d4d65a632dbd229443e8696",
Expand Down Expand Up @@ -207,7 +210,7 @@
"profiles/spine.md": "6bd367c3f4b101878fbc54a3c8c806630b7760173f24fef995db801b6103d92e",
"profiles/strand.fixture.json": "7bc2d2dae11c0722b1db987c070b249ddcbc55b81683c4bfa26900c7ffe0fc53",
"profiles/strand.md": "2a9bd36814a0de80a68180d2d75d3ef9d2539b9dcd52165f20b8ef0821575488",
"README.md": "a396419a8556d7b343a43742bb411e082413a6f9ae93462dd1d9740001c8d120",
"README.md": "49cf6e3f0ebc1542b4bf70c3f1ac3085a40e95e0fc614c5354281ad85a006eff",
"schema/ability.yaml": "af185b2d22a5985ac323e6227a95df287fffaae0e5fca502976a02c2754f71b2",
"schema/base_properties.yaml": "ec3724ceb2faca973e431a2e2ff946e55bfb55b6b8d78689b6b22d0cfb7c9a2e",
"schema/character.yaml": "dc291b206121bd23c69cb89e01a0523eb2f71b4a247116dd6a1fa4bc227ff145",
Expand All @@ -234,10 +237,10 @@
"schema/zone.yaml": "cca04ee498fb813fa18b96f1ac99816e7f1a8ae1fb9e21c48b37620dbb674856",
"schema.json": "581dc7b5e890acc06b1c89b0d7bdcc2f20f54f52d5a3b4af8c5a184e1e6fd48c",
"SECURITY.md": "939ee364b06f0b749bdd4cbe66b2fe49322c95abe732650ec4ef062a0c03820a",
"VERSION": "d2108320c93281b51981fb5d76e8db69b4f2051a135ad33898d1b0ea8fa763e3",
"VERSION": "0894baa5604e5f005a5daba8118f795b40cdd626ebd092b28dd62bfb7cb80a34",
"views.fixture.json": "f9a2713b26639d1cb2c792b9f28f95c57e576f8e6c123b5ad3eac2a2507dfcf8",
"views.json": "f4d06ee16bd6c66fc28cf27146b8d199c85164e5deecabafc23af53408746fe0",
"walk/lint_folder.py": "ddd7d28e7fbc5e8fb4494c2b2eda23daefc1b3708840a93b6cdffe12a3af88bd",
"walk/lint_folder.py": "7d28ed84263f5c91034f39f33c55c2c7b229baa40f68a98e0e7d6e9d286a9506",
"walk/rulings.yaml": "1fb87ce4012d160b809e0aac50688c62405d2a5e6e303a57df84b98c249374ca",
"walk/schema_walk.py": "e4a490dda5133e3961252cd8675eb39e5b214df68f6a661fa8601ccd69e6aed0"
}
Expand Down
7 changes: 6 additions & 1 deletion codegen/schema-dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Each serial (one numbered publication of these files, tagged `v<schema version>-
| `walk/lint_folder.py` | the folder check: run it on a world folder and it names every key that is not a field of its type, every link that does not resolve or points at the wrong type, every value of the wrong shape, and a `world.json` that carries an `api` block while git tracks it (a linked folder is never committed, folder spec 4.6 d). The example world passes it at every publish |
| `fixtures/owworld/` | the `.owworld` conformance set (folder spec 4.7): 120 zips, one per check and one cause each, with `verdicts.json` saying what a reader must answer for every one (accept, or refuse with its cause from the one list, and for some the files it leaves out of the world it reads, by reason, in `left_out`) and what a writer may emit. A world-file reader in any language runs the set and compares. `generate.py` rewrites every zip byte for byte (`python fixtures/owworld/generate.py --out fixtures/owworld`); `CaseFolding-15.1.0.txt` is Unicode's file as published, the C and S rows every reader folds names by, never a runtime's own fold |
| `fixtures/file-names.fixture.json` | how a writer makes the name part of an element's file name, the rule under "The example world": 38 element names and the name part each gives (`""` where a name leaves none, so the file is named by the full id). A writer in any language runs them and compares |
| `fixtures/folder-writer/id-tail.cases.json` | the id tail in an element's file name, the rule under "The example world": 9 ids, each an element named Bob written alone, and the path each is written to |
| `fixtures/folder-writer/unsafe-ids.cases.json` | the ids a writer does not write, the rule under "The example world": 24 cases a writer does not write and 5 it writes, with the path of each |
| `fixtures/folder-writer/case-collide.cases.json` | the elements of one type a writer does not write because their file names are one name once folded, and those it writes, the rule under "The example world": 16 cases a writer does not write and 10 it writes, with every path |
| `VERSION` | three `key: value` lines: the canonical schema version, the dist serial, the publish date |
| `MANIFEST.json` | the sha256 of every file above (not of itself) |

Expand All @@ -47,7 +50,9 @@ Only `id` and `name` are required. Element bodies read from the API also carry k

## The example world

`example/hyperion/` is a world folder: `world.json` for the world, and one JSON file per element at `elements/<type>/<name>--<id tail>.json`. The `id` inside a file is the element's identity; the filename is only for people. Its name part is made one way, so that two writers give an element the same name part: the element's name is put in Unicode's NFKD form; every code point from U+0300 to U+036F is dropped, and no other mark; the rest is lowercased by Unicode's default case mapping, in no locale; every run of characters outside `a` to `z` and `0` to `9` becomes one hyphen; hyphens at the start and the end are dropped; a name part longer than 40 characters is cut at 40, and hyphens at its new end are dropped; the forms and the case mapping are those of Unicode 11.0, and a code point Unicode assigned after 11.0 is promised nothing. A name that leaves nothing gives a file named by the full id (`<id>.json`). A reader never leans on any of it: it reads the `id`. `fixtures/file-names.fixture.json` holds the cases. It needs no account or key: load it, check it against `schema.json`, and you have tested your reader on real data. The format is described at [World Folders](https://onlyworlds.github.io/docs/schema/folders). The folder format is at 0.3.25 (the spec's own version line); a folder stamps `format_version` from it.
`example/hyperion/` is a world folder: `world.json` for the world, and one JSON file per element at `elements/<type>/<name>--<id tail>.json`. The `id` inside a file is the element's identity; the filename is only for people. Its name part is made one way, so that two writers give an element the same name part: the element's name is put in Unicode's NFKD form; every code point from U+0300 to U+036F is dropped, and no other mark; the rest is lowercased by Unicode's default case mapping, in no locale; every run of characters outside `a` to `z` and `0` to `9` becomes one hyphen; hyphens at the start and the end are dropped; a name part longer than 40 characters is cut at 40, and hyphens at its new end are dropped; the forms and the case mapping are those of Unicode 11.0, and a code point Unicode assigned after 11.0 is promised nothing. A name that leaves nothing gives a file named by the full id (`<id>.json`). A reader never leans on any of it: it reads the `id`. `fixtures/file-names.fixture.json` holds the cases. It needs no account or key: load it, check it against `schema.json`, and you have tested your reader on real data. The format is described at [World Folders](https://onlyworlds.github.io/docs/schema/folders). The folder format is at 0.3.26 (the spec's own version line); a folder stamps `format_version` from it.

The id tail is the id's last eight code points. An id of eight code points or fewer is its own tail, dashes and all. When the last eight code points of a longer id begin with `-` or hold `--`, the tail is cut instead from the id with every `-` removed: the last eight code points of what is left, or all of it when eight or fewer are left. A writer writes an element only when `<id>.json` is one file name that a world file's name check passes (folder spec 4.7, OW-22, with its cases in `fixtures/owworld/`), whatever the element's name. That check refuses a name that holds any of `<`, `>`, `:`, `"`, `|`, `?`, `*` or a control character (U+0000 to U+001F, U+007F to U+009F), a name that ends in a dot or a space, and a name whose part before its first dot is, in any letter case, `CON`, `PRN`, `AUX`, `NUL`, `COM1` to `COM9` or `LPT1` to `LPT9`. The name checked ends in `.json`, so no id is refused for ending in a dot or a space. An element whose id is empty, holds `/` or a backslash, or is `.` or `..` is never written. The id check comes first, each element alone; names are then made among the elements that pass it. When elements of one type would get file names that are one name once folded, by the fold below, the one whose id comes first in code point order keeps its name, and each later one is named with its full id in place of the tail. An element whose name leaves nothing is named `<id>.json` either way. When two or more elements of one type still have file names that are one name once folded after that renaming, none of them is written. The fold is NFC as Unicode 15.1 has it, from `fixtures/owworld/UnicodeData-15.1.0.txt` and `fixtures/owworld/CompositionExclusions-15.1.0.txt`, then simple case folding by the C and S rows of `fixtures/owworld/CaseFolding-15.1.0.txt`, never a runtime's own. A writer that meets an element it does not write either leaves it out and writes the rest, or writes nothing. It names the id it reports, or the ids of the pair; in a folder with several such elements, not every one need be named. `fixtures/folder-writer/` holds the cases, each a folder written from the elements it lists. A writer passes a written case when it writes exactly the paths the case gives, and a refused case when it writes no file for the ids the case names and names those ids, in words of its own.

An element file, in a world folder or in a world file (`.owworld`), in which an object or array sits more than 200 levels deep is not read. The count is made in the file's text, as each object or array opens: objects and arrays both count, an empty one too, the file's top object is level 1, a plain value inside an object or array at level 200 is read, and a key written twice counts with each of its values. A reader leaves such a file out of the world it reads, for the reason `too_deep`, and names it where it names the files it left out; the rest of the world is read as it stands. If the file is also broken in another way, it is still left out, and the reader may name either fault. The world's own `world.json` is counted the same way, and one past 200 is a `world.json` the reader cannot read (a world file holding one is refused, `not_a_world`). A file at 200 levels or fewer is not left out for depth. `fixtures/owworld/` holds the cases (OW-25).

Expand Down
4 changes: 2 additions & 2 deletions codegen/schema-dist/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
canonical: 00.34.01
serial: 149
published: 2026-11-27
serial: 150
published: 2026-11-30
51 changes: 51 additions & 0 deletions codegen/schema-dist/fixtures/folder-writer/id-tail.cases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"about": "Element ids and the path a world folder writer writes each to: the cases for the tail of the id in <name part>--<tail>.json (the name part is made as the README's \"The example world\" says). The tail is the last eight code points of the id. An id of eight code points or fewer is its own tail, as it stands, dashes kept. When the last eight code points of a longer id begin with - or hold --, the tail is cut instead from the id with every - removed: the last eight code points of what is left, or all of it when eight or fewer are left. Each case is one element of type character, written alone into an empty folder; it passes when the writer writes exactly the path given. Cases written by hand.",
"version": 1,
"written": [
{
"id": "a1234567😀",
"name": "Bob",
"path": "elements/character/bob--1234567😀.json"
},
{
"id": "a😀1234567",
"name": "Bob",
"path": "elements/character/bob--😀1234567.json"
},
{
"id": "ab-cd-ef-gh1",
"name": "Bob",
"path": "elements/character/bob--d-ef-gh1.json"
},
{
"id": "abcd-efghijk",
"name": "Bob",
"path": "elements/character/bob--defghijk.json"
},
{
"id": "abc--defghij",
"name": "Bob",
"path": "elements/character/bob--cdefghij.json"
},
{
"id": "a--b",
"name": "Bob",
"path": "elements/character/bob--a--b.json"
},
{
"id": "-a",
"name": "Bob",
"path": "elements/character/bob---a.json"
},
{
"id": "zzzza--bcdef",
"name": "Bob",
"path": "elements/character/bob--zzabcdef.json"
},
{
"id": "ab------cdef",
"name": "Bob",
"path": "elements/character/bob--abcdef.json"
}
]
}
9 changes: 7 additions & 2 deletions codegen/schema-dist/walk/lint_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@

# The folder format's version this lint was written against: the folder spec's
# own version line, the one source. It moves when the spec's version moves, and
# publish_dist.py writes the dist README's version sentence from it. 0.3.25
# publish_dist.py writes the dist README's version sentence from it. 0.3.26
# (2026-11-30, serial 150) says how a writer names and refuses element files: the id tail is
# the id's last eight code points, cut from the id with its dashes removed when that cut begins
# with `-` or holds `--`; an id whose `<id>.json` is not one file name a world file's name check
# passes is not written; two elements of one type whose file names are one name once folded are
# not written; this lint names no files and gained no check. 0.3.25
# (2026-11-25, serial 148) says an element file in which an object or array sits more than 200
# levels deep is not read, `too_deep`; this lint counts the depth itself (_too_deep). 0.3.24
# (2026-11-14, serial 128) says a multi-link names each element once: a reader served a
Expand All @@ -70,7 +75,7 @@
# this lint reads no prose and gained no check. 0.3.22 (2026-11-12) says what a draft
# world is and that a writer adds no `world` key to an element file (already reported
# as no field of its type).
FORMAT_VERSION = "0.3.25"
FORMAT_VERSION = "0.3.26"

# Keys an element body carries that the schema does not declare: the type
# slug and the server-managed fields (elements/serialize.py READONLY_FIELDS
Expand Down
19 changes: 12 additions & 7 deletions codegen/schema-pin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
"_what": "The recorded pin for the vendored OnlyWorlds schema distribution (codegen/schema-dist/, copied byte-exact). Do not edit by hand; re-vendor from the pinned tag and review the diff. Kept equal to the npm SDK's pin (github.com/OnlyWorlds/sdk, codegen/schema-pin.json) on purpose: two clients, one schema.",
"_why_manifest_sha256": "Verifying the tree against its own MANIFEST.json only proves internal consistency. If the tag moved, the manifest moved with it. The hash recorded here is the one first accepted, which is what makes a moved tag visible.",
"repo": "https://github.com/OnlyWorlds/schema-dist",
"tag": "v0.34.1-dist.149",
"commit": "67929605d43c5d27c71cad0c21488bf81a897793",
"manifest_sha256": "5d71d4c9bae2c8e7b55ada9c88093769059d677f56e08c6aaa5e4c063c599dda",
"tag": "v0.34.1-dist.150",
"commit": "3cca6b5ba1f5ff7a548abda9de45330545de0478",
"manifest_sha256": "6f3d6733bb1c46707b1545188306931d31419f71901998ea29dc9276bf4c6b8f",
"canonical_version": "00.34.01",
"dist_serial": 149,
"published": "2026-11-27",
"pinned_at": "2026-11-27",
"pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (241 files: the 240 the MANIFEST lists, and MANIFEST.json itself); files re-hashed against MANIFEST.json by verify_dist.py; MANIFEST self-hash matched against the raw file GitHub serves at the tag, whose ref resolves to the commit above.",
"dist_serial": 150,
"published": "2026-11-30",
"pinned_at": "2026-11-30",
"pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (244 files: the 243 the MANIFEST lists, and MANIFEST.json itself); files re-hashed against MANIFEST.json by verify_dist.py; MANIFEST self-hash matched against the raw file GitHub serves at the tag, whose ref resolves to the commit above.",
"previous_pins": [
{
"tag": "v0.34.1-dist.149",
"manifest_sha256": "5d71d4c9bae2c8e7b55ada9c88093769059d677f56e08c6aaa5e4c063c599dda",
"note": "the cases for a tool that writes world folders (fixtures/folder-writer/), folder format 0.3.26"
},
{
"tag": "v0.34.1-dist.148",
"manifest_sha256": "4cbe4d923e47d9f1899d9a3f865d3b0169dede546921dfc89557bce215577c1a",
Expand Down
2 changes: 1 addition & 1 deletion src/onlyworlds/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""OnlyWorlds for Python: the world folder (read, write, push), its archive (``.owworld``) and a client for the v2 API.

Folder format: v0.3.25 (``FORMAT_VERSION``). Schema: generated from the pinned
Folder format: v0.3.26 (``FORMAT_VERSION``). Schema: generated from the pinned
schema distribution (``SCHEMA_DIST_TAG``, ``SCHEMA_VERSION``); the package
version runs on its own semver.
"""
Expand Down
8 changes: 4 additions & 4 deletions src/onlyworlds/_schema.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# GENERATED by codegen/generate_schema.py from the vendored schema distribution. Do not hand-edit.
# Regenerate: python codegen/generate_schema.py (CI/test: --check)
# Source: https://github.com/OnlyWorlds/schema-dist @ v0.34.1-dist.149 (67929605d43c5d27c71cad0c21488bf81a897793)
# Source: https://github.com/OnlyWorlds/schema-dist @ v0.34.1-dist.150 (3cca6b5ba1f5ff7a548abda9de45330545de0478)

"""Schema provenance, the 22 element types and their fields, from the pinned schema distribution."""

SCHEMA_DIST_TAG = "v0.34.1-dist.149"
SCHEMA_DIST_TAG = "v0.34.1-dist.150"
SCHEMA_VERSION = "00.34.01"
SCHEMA_DIST_SERIAL = 149
SCHEMA_MANIFEST_SHA256 = "5d71d4c9bae2c8e7b55ada9c88093769059d677f56e08c6aaa5e4c063c599dda"
SCHEMA_DIST_SERIAL = 150
SCHEMA_MANIFEST_SHA256 = "6f3d6733bb1c46707b1545188306931d31419f71901998ea29dc9276bf4c6b8f"

# Canonical order, as the walk declares it.
ELEMENT_TYPES: tuple[str, ...] = (
Expand Down
2 changes: 1 addition & 1 deletion src/onlyworlds/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.159.1"
__version__ = "0.160.0"
Loading
Loading