diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e74d82..00b06c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ The package version runs on its own semver; the schema it is generated from is ` ## Unreleased +## 0.152.0 (2026-11-25) + +- **The lint says when it could not read a file.** `python -m onlyworlds.lint` runs the checker of schema-dist serial 146: a `world.json` or an element file whose JSON this Python cannot hold (nested deeper than its parser goes, or a number longer than it converts) gets one line saying it was not read, the check goes on, and the last line counts it. The command exits 3 when nothing it read has a problem but a file was not read. Before, a file nested too deep stopped the check with a `RecursionError`, and a number too long was counted as a problem, `not JSON`. The checker also takes a file only directly in a type folder, with a name ending in `.json` in that case and not beginning with a dot, and passes over everything under a dot-named folder. +- The schema pin moves to `v0.34.1-dist.146` (canonical 00.34.01 unchanged, no schema file moved). The tests replay what the serial adds: one more address prose case, the calendar's 79th case, and the `.owworld` set at 109 archives, among them the four on a fixed name held only in another case, which 0.151.0 already answers. + ## 0.151.0 (2026-11-25) ### Changed diff --git a/README.md b/README.md index 51c4565..9b3aeab 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ The lint checks a world folder's shape against the schema: a file outside the 22 python -m onlyworlds.lint moppetopia ``` -One line per problem, then the count it checked. Exit 0 when clean, 1 with problems, 2 when the folder is not a world folder. The checker is schema-dist's own `walk/lint_folder.py`, copied byte for byte at this package's schema pin and run on the dist's `schema.json`, so it gives the same report as the dist's command and needs no YAML library. From code: `onlyworlds.lint.lint(folder)` returns the report (`problems`, `warnings`, `summary`). +One line per problem, then the count it checked. A file whose JSON Python cannot hold (nested too deep, or a number too long) gets one line saying it was not read, and the check goes on. Exit 0 when clean, 1 with problems, 2 when the folder is not a world folder, 3 when nothing it read has a problem but a file was not read. The checker is schema-dist's own `walk/lint_folder.py`, copied byte for byte at this package's schema pin and run on the dist's `schema.json`, so it gives the same report as the dist's command and needs no YAML library. From code: `onlyworlds.lint.lint(folder)` returns the report (`problems`, `warnings`, `summary`). ## Errors diff --git a/codegen/schema-dist/MANIFEST.json b/codegen/schema-dist/MANIFEST.json index 8e911dc..9f70ce2 100644 --- a/codegen/schema-dist/MANIFEST.json +++ b/codegen/schema-dist/MANIFEST.json @@ -66,6 +66,7 @@ "fixtures/owworld/fail-OW-17-duplicate.owworld": "81f9bfd2c2ebdc8f06c548f57aff6cf92b32ff69ea8a252c8ce82223ffbe3f45", "fixtures/owworld/fail-OW-18-case.owworld": "8a6f06da4e029ba85d42871270f23d783c2e96ac0fb3669cd11753df3b779445", "fixtures/owworld/fail-OW-18-final-sigma.owworld": "5657a1e3095ce1c52e1b81586f813b31cd4ad0bf1cb316dd0e6d48632e35015c", + "fixtures/owworld/fail-OW-18-folder-case-alone.owworld": "25d17b76b22bcf51728e6cf500abbd4e4e38ece72230ab07bd108432aea1ae64", "fixtures/owworld/fail-OW-18-folder-case.owworld": "8faaece9c3dc5b4365c6c48bce62edcb7c0d689a3fb3e3839e4c838d59d2edd7", "fixtures/owworld/fail-OW-18-iota-oxia.owworld": "2be80e91f1a44f3c2828ea146e2b2f9d7f54053c671e90b3b0747b07f59a4f9b", "fixtures/owworld/fail-OW-18-nfc-exclusion.owworld": "f5fbe93aebb0d36ed16d80c7b12d955f259581fde7e4b12b0a5baf51fb1f3d71", @@ -77,6 +78,7 @@ "fixtures/owworld/fail-OW-18-nfc-singleton.owworld": "3a59fafe021dd7ac4c37054d82f09be426cff46ba1a2363b2162b92560a24f59", "fixtures/owworld/fail-OW-18-nfc-then-fold.owworld": "d3ac0406fab115629ab33bfbefdc2ea8b56d9bb5a8fd61b7914f6f90a635b58a", "fixtures/owworld/fail-OW-18-st-ligature.owworld": "dbab3c468e1c6689da96bdf38749fb4bba3e8730d03c35151cfbfdbae77bf61c", + "fixtures/owworld/fail-OW-18-world-case-alone.owworld": "2c849b2c2b17159b4342f5bd62fe232558e809f4fe647298d3658c061467db5e", "fixtures/owworld/fail-OW-19-file-and-folder.owworld": "49be668aad2e13604b83a3ecd62e79b5bfc572669f50b565226a587a8e8608bc", "fixtures/owworld/fail-OW-2-no-world.owworld": "81aeaa3cf47f0b9e3a4aa3a2b4ef37cd6c544a35f93a777442ab0fbad441f40e", "fixtures/owworld/fail-OW-2-root-and-folder.owworld": "4a967c89e97e230daa857527d13eec3c589546bb441cc7f35a9dc1999b1c7e74", @@ -96,6 +98,12 @@ "fixtures/owworld/fail-OW-22-reserved-char.owworld": "61e85c56fd7ceb7872f44a802afb56e90c1499934c2c13e2f8dfa6b51d94917a", "fixtures/owworld/fail-OW-22-trailing-dot.owworld": "b6b0f4cd6699ab5b7510e9e5174dda673f60a7bde00c0503007ef4a882ff5170", "fixtures/owworld/fail-OW-22-trailing-space.owworld": "0600009ca1e1ca13ffd85f50a5c48fb568f64159b8cea9deec88b78fbb41e23a", + "fixtures/owworld/fail-OW-23-share-carries-hidden.owworld": "39f9df63b670ea3d57f7ed7ad84f3b3294fa026949939835ac35e964649f2ae9", + "fixtures/owworld/fail-OW-23-share-carries-moved.owworld": "d3653fb3e858183e8e890add1323b51a05921b3ebbdd7cccc84a6bc2d20f0085", + "fixtures/owworld/fail-OW-23-share-carries-notes.owworld": "41ea479cc05ab3cec1a5ef234232b89137d63963503ff98c5fbd76313f00a730", + "fixtures/owworld/fail-OW-23-share-carries-twin.owworld": "3d14536c777e1b9b53832479d4b6aee06036063f70aa590279e0afe5200cb566", + "fixtures/owworld/fail-OW-23-share-carries-unread.owworld": "3f1b2e7f7ca3e411f519e869c1ae3a8849ff2bdd7626ee28c55f09be68b205e9", + "fixtures/owworld/fail-OW-23-share-carries-untyped.owworld": "8a4ea219edac7fc018cb14d82f5457a0f5c2e77367d0b456eb33f388530adb0f", "fixtures/owworld/fail-OW-3-array.owworld": "6cededb313e38bb73474890587d10cda608440030eef5ad27f487060fa638ff6", "fixtures/owworld/fail-OW-3-blank-id.owworld": "19189cba558889eba5c5f7d5b7133668ec845d08b7dcea3cd6b26e0b027fbb0c", "fixtures/owworld/fail-OW-3-no-id.owworld": "0c26aca58f7f89f41b5c466de544b4f0a06d52b3eee94e325f901b1df60883b6", @@ -114,7 +122,7 @@ "fixtures/owworld/fail-OW-8-producer-meta-dropped.owworld": "4fa8e3a1f0ba92f38db1e29223ae1bd3c6df5346c34bb6b6eb1e4cf1a8d20259", "fixtures/owworld/fail-OW-8-records-missing.owworld": "128fff91a82385acca5a23eb7dcc7605d19aac1a4349bfcb7134e3136aa69e32", "fixtures/owworld/fail-OW-8-records-reencoded.owworld": "128261249c08c26ea19a54872c02c313d8492ca17586f295e83fb40e9126a96c", - "fixtures/owworld/generate.py": "de0a8ff28f774a5ad55f72530f5cfe97f229f9ab16085a626b41c44137d238d4", + "fixtures/owworld/generate.py": "a1d7cb25bc3c5ffb31814cee43b5c0c2fda0c0c5da86cd7cd9e1df16b29ee4f8", "fixtures/owworld/pass-good.owworld": "11a577b054b87cc8e7d66f8070d791d413f3ab7527d4de82a9d19abbf5d1e856", "fixtures/owworld/pass-OW-1-renamed.zip": "11a577b054b87cc8e7d66f8070d791d413f3ab7527d4de82a9d19abbf5d1e856", "fixtures/owworld/pass-OW-10-api.owworld": "2304fcdaeb1ce7cbcc9aec2222716ba1219f347296d87d26df3e02273955fe1a", @@ -127,9 +135,14 @@ "fixtures/owworld/pass-OW-2-root.zip": "ad8cf61fe8efa9701b4cef25103fbe0adc41d01185e5cb8e561d3947089aa4dd", "fixtures/owworld/pass-OW-20-modes.owworld": "28bda69a81f290b0d8440511033a54c606781e312e25218b16fb7ec1d3837341", "fixtures/owworld/pass-OW-22-con-prefix.owworld": "42ab3a54ec99c0a36eeffb4473dfc3bfc805220b816b61e51f3db6f62ed4d897", + "fixtures/owworld/pass-OW-23-copy-carries-unread.owworld": "bf02ce9ee885bea0d677d917bc83dda4e8b4833595818cdb5140ce2ac6f2ef05", + "fixtures/owworld/pass-OW-23-share-leaves-unread-out.owworld": "11a577b054b87cc8e7d66f8070d791d413f3ab7527d4de82a9d19abbf5d1e856", + "fixtures/owworld/pass-OW-24-spatial-type-case.owworld": "51e50436e02ccd8bd2978380fb64ea5688da32ee7fc697fc7adb480ab39e5be1", + "fixtures/owworld/pass-OW-24-spatial-untyped.owworld": "cc39ecd74848be036925a5aeb12bfa0390b470525baf0a7d87cf3b6fc160379d", "fixtures/owworld/pass-OW-4-archive-junk.owworld": "b7ca25bda4354a71dfaf5202dfea97dec3079167b31622a343a55fad372bcde2", "fixtures/owworld/pass-OW-4-readme.owworld": "8985f68a3336787042eb61127507f5fa41c95fa8188c39c1769ee7ce2860667b", "fixtures/owworld/pass-OW-4-tool-folder.owworld": "424b5f898d0db6b38d73abca6e03bbf7d8e74f707af7f0096b11c04f86c5b315", + "fixtures/owworld/pass-OW-5-dot-folder-inside.owworld": "1c5526d2a56712cccb9c66d503de22460d436fbb0581b214567ac15bff46bc83", "fixtures/owworld/pass-OW-6-marker-deflated.owworld": "5b0e9908582939b9918bbf6f68bf9bbbe77e931a3185aa4bd356259b14f6914d", "fixtures/owworld/pass-OW-6-marker-not-first.owworld": "7c81b4356c45e4d9f86c7e9e11de3de6c6bd5d6428c13655c6fd5e08ab95239f", "fixtures/owworld/pass-OW-6-marker.owworld": "d7b15768cab7a96fdc4f580a75f6f7f47e9ae28be9e685cb057f904e8e2d5e81", @@ -138,14 +151,14 @@ "fixtures/owworld/pass-OW-9-roundtrip.owworld": "ea5a1087df2b0006aa7230ca75de69f491238bff3a565114e0037ad8eb6d5c2f", "fixtures/owworld/pass-OW-9-unknown.owworld": "f220915504a75e7f8f644188d8868c6b7ce05834e24b6f47cea24890b9159eca", "fixtures/owworld/UnicodeData-15.1.0.txt": "2fc713e6a31a87c4850a37fe2caffa4218180fadb5de86b43a143ddb4581fb86", - "fixtures/owworld/verdicts.json": "11f00045fb0d510cd550e2823ae52dab437c443b5e2011f7c959750bb4ccb5d3", + "fixtures/owworld/verdicts.json": "25d60a563ca822555c3202dffb7f8969f42490113444531af4f47264c885ace0", "LICENSE": "3235f6ccc2b72375c517c1fdeef87954e8bfda17c5b1b485b98b5c2b4a1026d1", "pairs.json": "18a9918a2a3581a09c584b02aa418c926a613bc1c75d526b6bc9a4ad0cd89021", "presentation.json": "af84662c29628b6e90b923c9541f68f5924563adce397cebbadfdbf0f06e5f18", - "profiles/address.fixture.json": "e4ae843895f22333b162c930121386f0d586cb8b1fb8a99f3debdb7e3c33f9c3", - "profiles/address.md": "2fd4fe31e90d51818ba48e52e64ffcbdfa0a6a9e1404d7cca85646c52b2b5fd9", - "profiles/calendar.fixture.json": "0a013c3732eda70a42c4eab30555669af28983a5ba9f4a233addf0f06bedb4cd", - "profiles/calendar.md": "c81c63a46eb886cb9aeedf3a668f117ffc626ff711ee2b23a2a8a402b81c7c82", + "profiles/address.fixture.json": "922182d418225234184c5a7e3a3a152e2fde8059c0fe2aa98596a7faa0aab487", + "profiles/address.md": "94956efbc12335acd06b1ce49788c692262390acccd30d5c347659e6ddb61fee", + "profiles/calendar.fixture.json": "1caef0003392b60b9f0cf960232c009417c85d374ac8574c3b9fcec55adda7a9", + "profiles/calendar.md": "7ea97d91c0480b89078c84f303ee18b9da3cc648c0631974c72b145dd6344760", "profiles/charter.fixture.json": "ea57091a988a4dd083d7d4cfc5e7985c6aa00f67fdce1b661c0d5023a15cbf35", "profiles/charter.md": "b0d27c04cd5dfaf421b2a6e54d53c1fca8ad9be72aa16516bbd3b5600ae61daa", "profiles/checks.fixture.json": "43586fddd94ebe9678bf46e6d744768a094f856b668c5917fe9e0dda46599251", @@ -182,7 +195,7 @@ "profiles/spine.md": "6bd367c3f4b101878fbc54a3c8c806630b7760173f24fef995db801b6103d92e", "profiles/strand.fixture.json": "7bc2d2dae11c0722b1db987c070b249ddcbc55b81683c4bfa26900c7ffe0fc53", "profiles/strand.md": "2a9bd36814a0de80a68180d2d75d3ef9d2539b9dcd52165f20b8ef0821575488", - "README.md": "183cf2d12c61443fdff78d1f1cce5d3c94bf78c61a62ebd709736648347a27ce", + "README.md": "a847f5198a3b18de2b947db1630966692d4782da56979575473de41c6e5b1eab", "schema/ability.yaml": "af185b2d22a5985ac323e6227a95df287fffaae0e5fca502976a02c2754f71b2", "schema/base_properties.yaml": "ec3724ceb2faca973e431a2e2ff946e55bfb55b6b8d78689b6b22d0cfb7c9a2e", "schema/character.yaml": "dc291b206121bd23c69cb89e01a0523eb2f71b4a247116dd6a1fa4bc227ff145", @@ -209,10 +222,10 @@ "schema/zone.yaml": "cca04ee498fb813fa18b96f1ac99816e7f1a8ae1fb9e21c48b37620dbb674856", "schema.json": "581dc7b5e890acc06b1c89b0d7bdcc2f20f54f52d5a3b4af8c5a184e1e6fd48c", "SECURITY.md": "939ee364b06f0b749bdd4cbe66b2fe49322c95abe732650ec4ef062a0c03820a", - "VERSION": "4d9cd41f37e33db46e4fb6fe1a6ad610fc852a3472baea24c4578fda46942e85", + "VERSION": "d4cb014eb1322f6420f812d8408d37a4118bcd837fc7a1c0588c6e597da8e0f5", "views.fixture.json": "f9a2713b26639d1cb2c792b9f28f95c57e576f8e6c123b5ad3eac2a2507dfcf8", "views.json": "f4d06ee16bd6c66fc28cf27146b8d199c85164e5deecabafc23af53408746fe0", - "walk/lint_folder.py": "28efffa3a39d7f2ceaf69cae5c4ddce023e4989e7a5d2c26c1b4d4815eff386e", + "walk/lint_folder.py": "2c456cb917d692e3199f87bc6f7918bb20b91d6943d33feb0db0ac99519e1e87", "walk/rulings.yaml": "1fb87ce4012d160b809e0aac50688c62405d2a5e6e303a57df84b98c249374ca", "walk/schema_walk.py": "e4a490dda5133e3961252cd8675eb39e5b214df68f6a661fa8601ccd69e6aed0" } diff --git a/codegen/schema-dist/README.md b/codegen/schema-dist/README.md index a00d261..69df5f7 100644 --- a/codegen/schema-dist/README.md +++ b/codegen/schema-dist/README.md @@ -17,11 +17,11 @@ Each serial (one numbered publication of these files, tagged `v- | `presentation.json` | default colour group and icon per type (`family` names the group by its colour: `blue`, `green`, `pink`, `amber`, a visual aid for drawing the 22 types, not part of the standard), and the four colours as light/dark pairs. Defaults: tools may override them. The colours were checked for colour-vision deficiency, so re-run that check before changing one. Each type also lists its `public` fields: what the platform shows of an element a reader knows of but does not see whole, beside its name and description | | `pairs.json` | the link a drag between two types writes, for the pairs of the 22 types a tool may offer (same-kind pairs and fields that name a role are absent by ruling). Each key names the pair by its two type slugs in alphabetical order (`ability+character`); `on` is the type that carries the field, `field` the field's name, and `holds` whether the drop puts the dragged element inside the target (one square under the other) or only draws a line. Presentation, as `presentation.json` is, not part of the standard: a tool that offers drags reads this file and offers nothing else, and a pair absent here draws no line | | `views.json` | how an element is shown, by its kind: for a report, a charter, a message and a line in a room, which field gives the one sentence a card or a list row shows, which fields lead the page, which fold, and which layout draws it; and the marks shown at the head of any element's page. A kind with no row draws as its type draws today. Presentation, as `presentation.json` is, not part of the standard: each tool keeps its own drawing and reads the row. `views.fixture.json` holds the cases a reader replays (the row that wins, the sentence, the marks in order) and a cite for every field a row names | -| `profiles/` | extension profiles: one page per named extension field or convention that tools agree to read the same way (`x_identity_key`, one being in several worlds; `atlas_calendar`, a world's own calendar; `x_packet_*`, a work item's elements with a reason each; `x_review_*`, proposed and checked marks; `room`, a convention profile: the ten type-and-supertype pairs a world's working layer holds (a parlor's lines and boards, work items, reports), and the rule that a lore view leaves them out; `message`, a convention profile: a message between a world's members (a Narrative with supertype Message), to whom it is addressed, whether its sender is proved, and each reader's read mark; `checks`, machine-checkable house rules on a world's Charter; `x_names`, a world's own words for the 22 types, on the World; `map-space`, a convention profile: how a reader turns Map, Marker, Pin and Zone rows into geometry (a Map's frame, a Zone's outline in marker order, a Pin's point; z an elevation, never a height), and the layout keys: `x_layout` on a Map (the Map is a drawing of its elements: how it was drawn, and the ground it stands on), `x_hand` on a Pin (placed by hand, kept by a new lay-out), and a small layout reading of one Map; and `x_parent_frame` on a child Map, the box on its parent where it lies, each axis by its own ratio, with a small reading that carries a point on it up its parents and one that brings a point down to it; `spine`, a world that maps a software ecosystem: a closed list of kinds as supertypes, eleven `x_spine_*` keys, a day count from a stated day 0; `import-map`, per source tool, from that tool's own tags to the 22 types, which an import offers the user and never applies silently, LegendKeeper first; `address`, a convention profile: one element's three spellings, the site's address and the two `ow://` text forms, with an optional moment and lens, the rule that a field holding one is public text, never resolved, and when two ids are the same id; `lens`, a convention profile: a saved way of reading a world (a Construct with supertype Lens), its links the anchors, `x_lens` the recipe (how far, which types, how far back, how much), and the one resolution every reader agrees on; `charter`, a convention profile: a world's reading aids, the Charter (the rules for people and AIs here), the Guide (start here) and the Domains (the places in the world), each marked with `x_charter_of`, and the one packet every tool shows first at a world's door; `strand`, a convention profile: one story in a world in miniature, a Narrative, one of its Events, that Event's place, the story's protagonist and where the hero is now, named on the World by `x_strand`'s three ids and read through four existing links, never one slot filled from another; `record`, a convention profile: one run of a game kept in the world its Characters live in, an Event marked by `x_record` (the game, when it was played, and optionally the engine's version, the seed, the outcome and each Character's seat) with its chronicle and each Character's stories as Narratives, and a character's records read from the Event's `characters` and the stories' `protagonist` or `narrator`, never a field on the Character; `landing`, a convention profile: a world's first picture at a door, read from the lens profile's graph, its most-linked Characters each with what it links, the nodes no head reaches, and a small world's gaps (an orphan, a near-orphan, a Character with no place, a Location nobody is in), each an invitation to make the world bigger, with nothing stored; `report`, a convention profile: work done, left in the world by a stretch of work or a closed talk, a Narrative with supertype Report and the room's mark, handed in by the reporter's AI with its own text and completed by the world's keeper with a summary, a link to every element it touched and a line per change in `consequences`, the work items it answers named in `x_report_answers`; `layout`, a convention profile: the default layouts, three ways to draw a world nobody has laid out, `by-kind` (the whole graph, read from the graph alone, each kind round a circle, the same points to the last bit in every tool), `around` (one element and what links to it, on rings, read from the graph alone) and `by-links-3d` (the whole graph in three dimensions by its links, with the world's Maps and Pins as a plate its pinned elements stand on), the method words a layout map names under map-space's rule 8, and `unplaced`, the one reading of which elements a saved layout map does not place). What it holds, how a reader reads it, what a writer must keep. A profile may carry a data file beside its page (`import-map.json`, the table a door loads). A profile with a `.fixture.json` beside it has a conformance fixture: cases a reader must pass; the report profile has a second, `report-lines.fixture.json`, the lines of its `consequences`, and the layouts profile has a second, `layout-by-links-3d.fixture.json`, with the directions table `layout-by-links-3d.directions.json` it names by its sha256 | +| `profiles/` | extension profiles: one page per named extension field or convention that tools agree to read the same way (`x_identity_key`, one being in several worlds; `atlas_calendar`, a world's own calendar; `x_packet_*`, a work item's elements with a reason each; `x_review_*`, proposed and checked marks; `room`, a convention profile: the ten type-and-supertype pairs a world's working layer holds (a parlor's lines and boards, work items, reports), and the rule that a lore view leaves them out; `message`, a convention profile: a message between a world's members (a Narrative with supertype Message), to whom it is addressed, whether its sender is proved, and each reader's read mark; `checks`, machine-checkable house rules on a world's Charter; `x_names`, a world's own words for the 22 types, on the World; `map-space`, a convention profile: how a reader turns Map, Marker, Pin and Zone rows into geometry (a Map's frame, a Zone's outline in marker order, a Pin's point; z an elevation, never a height), and the layout keys: `x_layout` on a Map (the Map is a drawing of its elements: how it was drawn, and the ground it stands on), `x_hand` on a Pin (placed by hand, kept by a new lay-out), and a small layout reading of one Map; and `x_parent_frame` on a child Map, the box on its parent where it lies, each axis by its own ratio, with a small reading that carries a point on it up its parents and one that brings a point down to it; `spine`, a world that maps a software ecosystem: a closed list of kinds as supertypes, eleven `x_spine_*` keys, a day count from a stated day 0; `import-map`, per source tool, from that tool's own tags to the 22 types, which an import offers the user and never applies silently, LegendKeeper first; `address`, a convention profile: one element's three spellings, the site's address and the two `ow://` text forms, with an optional moment and lens, the rule that a field holding one is public text, never resolved, and when two ids are the same id; `lens`, a convention profile: a saved way of reading a world (a Construct with supertype Lens), its links the anchors, `x_lens` the recipe (how far, which types, how far back, how much), and the one resolution every reader agrees on; `charter`, a convention profile: a world's reading aids, the Charter (the rules for people and AIs here), the Guide (start here) and the Domains (the places in the world), each marked with `x_charter_of`, and the one packet every tool shows first at a world's door; `strand`, a convention profile: one story in a world in miniature, a Narrative, one of its Events, that Event's place, the story's protagonist and where the hero is now, named on the World by `x_strand`'s three ids and read through four existing links, never one slot filled from another; `record`, a convention profile: one run of a game kept in the world its Characters live in, an Event marked by `x_record` (the game, when it was played, and optionally the engine's version, the seed, the outcome and each Character's seat) with its chronicle and each Character's stories as Narratives, and a character's records read from the Event's `characters` and the stories' `protagonist` or `narrator`, never a field on the Character; `landing`, a convention profile: a world's first picture at a door, read from the lens profile's graph, its most-linked Characters each with what it links, the nodes no head reaches, and a small world's gaps (an orphan, a near-orphan, a Character with no place, a Location nobody is in), each an invitation to make the world bigger, with nothing stored; `report`, a convention profile: work done, left in the world by a stretch of work or a closed talk, a Narrative with supertype Report and the room's mark, handed in by the reporter's AI with its own text and completed by the world's keeper with a summary, a link to every element it touched and a line per change in `consequences`, the work items it answers named in `x_report_answers`; `layout`, a convention profile: the default layouts, three ways to draw a world nobody has laid out, `by-kind` (the whole graph, read from the graph alone, each kind round a circle, the same points to the last bit in every tool), `around` (one element and what links to it, on rings, read from the graph alone) and `by-links-3d` (the whole graph in three dimensions by its links, with the world's Maps and Pins as a plate its pinned elements stand on), the method words a layout map names under map-space's rule 8, and `unplaced`, the one reading of which elements a saved layout map does not place). What it holds, how a reader reads it, what a writer must keep; what each profile lets a person or a tool do is one line each on [the docs' profiles page](https://onlyworlds.github.io/docs/schema/profiles). A profile may carry a data file beside its page (`import-map.json`, the table a door loads). A profile with a `.fixture.json` beside it has a conformance fixture: cases a reader must pass; the report profile has a second, `report-lines.fixture.json`, the lines of its `consequences`, and the layouts profile has a second, `layout-by-links-3d.fixture.json`, with the directions table `layout-by-links-3d.directions.json` it names by its sha256 | | `walk/schema_walk.py` | the reference decoder, in Python: reads the YAML and returns each type's fields. `schema.json` is its output. One module; its only dependency is PyYAML | | `walk/rulings.yaml` | rulings the YAML cannot carry (nullability, empty strings, extension fields). Code in any language should follow these rows | | `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): 96 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 what a writer may emit. A world-file reader in any language runs the set and compares; the Unity SDK, the TypeScript SDK and the reference checker give one verdict on all of it. `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/owworld/` | the `.owworld` conformance set (folder spec 4.7): 109 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 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 | | `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) | @@ -76,7 +76,7 @@ Pass a `note` sink. A field type the walk does not know is skipped, and with the python walk/lint_folder.py path/to/world-folder ``` -One line per problem (`elements/creature/x.json: `characters` is not a field of creature`), then the count it checked. Exit 0 when clean, 1 with problems. Server keys, the folder format's own keys (`local_updated_at`, `server_updated_at`, `image_media_id`) and extension prefixes pass; any other undeclared key does not. A string may be null on disk (read as the unset string). It decodes the YAML through the walk beside it, so its view of the schema is the walk's; `--schema DIR` points it at another copy. +One line per problem (`elements/creature/x.json: `characters` is not a field of creature`), then the count of the element files it checked, a file not read not among them. A file is not read when the Python running the check cannot hold its JSON (nested too deep, or a number too long for it): it gets one line saying so, and the check goes on. A link to an element in a file not read is still reported as not in the folder. Exit 0 when clean, 1 with problems, 2 when the path is not a world folder, 3 when nothing it read has a problem and some files were not read; which files go unread can change with the Python running it. Server keys, the folder format's own keys (`local_updated_at`, `server_updated_at`, `image_media_id`) and extension prefixes pass; any other undeclared key does not. A string may be null on disk (read as the unset string). It decodes the YAML through the walk beside it, so its view of the schema is the walk's; `--schema DIR` points it at another copy. ## Versions diff --git a/codegen/schema-dist/VERSION b/codegen/schema-dist/VERSION index 2c35925..b151c9a 100644 --- a/codegen/schema-dist/VERSION +++ b/codegen/schema-dist/VERSION @@ -1,3 +1,3 @@ canonical: 00.34.01 -serial: 145 -published: 2026-11-22 +serial: 146 +published: 2026-11-25 diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-18-folder-case-alone.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-18-folder-case-alone.owworld new file mode 100644 index 0000000..25e6500 Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-18-folder-case-alone.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-18-world-case-alone.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-18-world-case-alone.owworld new file mode 100644 index 0000000..a126d2e Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-18-world-case-alone.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-hidden.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-hidden.owworld new file mode 100644 index 0000000..1f0305c Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-hidden.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-moved.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-moved.owworld new file mode 100644 index 0000000..246d239 Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-moved.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-notes.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-notes.owworld new file mode 100644 index 0000000..1bf019c Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-notes.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-twin.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-twin.owworld new file mode 100644 index 0000000..dd3fc57 Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-twin.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-unread.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-unread.owworld new file mode 100644 index 0000000..f1dc3e5 Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-unread.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-untyped.owworld b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-untyped.owworld new file mode 100644 index 0000000..ac3fe21 Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/fail-OW-23-share-carries-untyped.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/generate.py b/codegen/schema-dist/fixtures/owworld/generate.py index a336752..1e2c363 100644 --- a/codegen/schema-dist/fixtures/owworld/generate.py +++ b/codegen/schema-dist/fixtures/owworld/generate.py @@ -8,9 +8,8 @@ python generate.py --out DIR --without records/lab/world.json # a diagnostic copy without one base file, to read a reader past one gap -Standard library only. The tests are OW-1..OW-22 of folder spec section 4.7; each fixture names the test it -serves and carries one cause, so a -reader cannot pass a refusal by luck. +Standard library only. The tests are OW-1..OW-22 of folder spec section 4.7, OW-23, the share of section 4.8, and +OW-24, which folders under spatial/ a reader serves (section 4.8); each fixture names the test it serves and carries one cause, so a reader cannot pass a refusal by luck. DETERMINISM. Every zip is written by `build_zip` below, by hand: entries in the order given (sorted by the UTF-8 bytes of their names unless a fixture tests order), every entry stamped 1980-01-01 00:00, no extra fields, no comments. No @@ -361,6 +360,36 @@ def private_files(): return files +HIDDEN_FILE = "elements/character/veiled--0000ab05.json" +UNREAD_FILE = "elements/character/torn--0000ab06.json" +NOTES_FILE = "elements/character/notes.txt" +MOVED_FILE = "elements/character/old/kept--0000ab07.json" +TWIN_PLAIN_FILE = "elements/character/pair-a--0000ab08.json" +TWIN_HIDDEN_FILE = "elements/character/pair-b--0000ab08.json" +UNTYPED_FILE = "elements/vessel/skiff--0000ab0b.json" +SHARE_UNREAD = sorted([UNREAD_FILE, NOTES_FILE, MOVED_FILE, TWIN_PLAIN_FILE, TWIN_HIDDEN_FILE, UNTYPED_FILE], + key=lambda rel: rel.encode("utf-8")) + + +def hidden_files(): + """The base world plus seven files under elements/ (section 4.8, OW-23): one element whole and marked hidden, one cut + short after its mark (no writer can read it as an element), a person's notes.txt in the type folder, a hidden + element's file moved by hand into a deeper folder, old/, two files holding one id (the unmarked one sorting first, + so a reader serves it and skips the hidden one after it), and an element in a folder that is not one of the 22 + types. A share leaves the last six out whole, counted apart from the hidden one: no reader serves the first three + as an element, the share cannot say which of the two files' marks is the element's, and a folder no type names is + unread on a share. The share case's source. The base world itself never changes, so no other fixture's bytes move.""" + files = base_files() + files[HIDDEN_FILE] = element(5, "Veiled", hidden=True) + files[UNREAD_FILE] = b'{"id": "0695db83-0000-7000-8000-00000000ab06", "hidden": true, ' + files[NOTES_FILE] = b"Brother Tomas keeps the second key; ask before moving the old ledgers.\n" + files[MOVED_FILE] = element(7, "Kept", hidden=True) + files[TWIN_PLAIN_FILE] = element(8, "Pair") + files[TWIN_HIDDEN_FILE] = element(8, "Pair", hidden=True) + files[UNTYPED_FILE] = element(0x0b, "The Skiff") + return files + + def world_entries(files, top=TOP, **kw): return [Entry(top + rel, data, **kw) for rel, data in files.items()] @@ -394,7 +423,8 @@ def fixtures(): F = [] def add(file, content, *, test, rule, reader="accept", writer=None, role="reader", reason=None, open_=None, - lean=None, covers=None, roundtrip=False, strips=None, should=None, budget=None, source=None, side=None): + lean=None, covers=None, roundtrip=False, strips=None, should=None, budget=None, source=None, side=None, + left_out=None): if writer is None: writer = "accept" if reader == "accept" else "refuse" v = {"file": file, "test": test, "role": role, "reader": reader, "writer": writer, "rule": rule} @@ -402,6 +432,8 @@ def add(file, content, *, test, rule, reader="accept", writer=None, role="reader v["source"] = source if side: v["side"] = side + if left_out: + v["left_out"] = left_out if reason: v["reason"] = reason if strips: @@ -480,6 +512,22 @@ def world_with(obj_or_bytes): test="OW-5", reader="refuse", reason="more_than_one", rule="A world.json inside the world (abbey/inner/world.json), not under records/: refused. (pass-good " "holds records/lab/world.json, which must pass.)") + add("pass-OW-5-dot-folder-inside.owworld", + build_zip(base(extra=[ + (".atlas/world.json", jbytes(dict(WORLD, id="0695db52-0000-7000-8000-00000000a7a5"))), + (".atlas/world-prefs.json", jbytes({"zoom": 2, "open": ["ana--0000ab01"]})), + ("elements/character/.trash/world.json", jbytes(dict(WORLD, id="0695db52-0000-7000-8000-00000000a7a6"))), + ("..atlas/world.json", jbytes(dict(WORLD, id="0695db52-0000-7000-8000-00000000a7a7"))), + ])), test="OW-5", writer="refuse", + rule="Dot-folders inside the world, each holding a well-formed world.json of another world's id: a tool's " + "abbey/.atlas/ (beside its world-prefs.json), deeper, abbey/elements/character/.trash/, and " + "abbey/..atlas/, a name of dots and more: any path segment that begins with a dot is a dot-folder, once " + "OW-16 has refused a segment that is exactly . or .. . A dot-folder " + "is never a world, wherever it sits, so the second-world check does not look under a folder whose name " + "starts with a dot; accepted. The world read is abbey's own id, and nothing under any dot-folder is " + "among its elements or changes its counts. Only that check skips them: every other check still reads " + "their entries. A reader ignores them; a writer never emits a dot-folder unless the caller hands it in, " + "so never in a portable .owworld.") # -- OW-6: the marker entry (ruled: a writer SHOULD place it; a reader never requires it, refuses other bytes) -- def marker(data=MIMETYPE, method=0): @@ -731,6 +779,21 @@ def private_world(drop=(), replace=None): add("fail-OW-18-folder-case.owworld", build_zip(base(extra=[("Elements/character/cora--0000ab04.json", cora)])), test="OW-18", reader="refuse", reason="collision", rule="abbey/Elements/ beside abbey/elements/: one folder on a case-insensitive disk, refused.") + moved = [rel for rel in base_files() if rel.startswith("elements/")] + add("fail-OW-18-folder-case-alone.owworld", + build_zip(base(drop=moved, extra=[("E" + rel[1:], base_files()[rel]) for rel in moved])), + test="OW-18", reader="refuse", reason="name_case", + rule="abbey/Elements/ and no abbey/elements/: the three fixed names (world.json, elements/, spatial/) are " + "read as written, so Elements/ is no element folder, and a world holding one of them in another case (by OW-18's fold) " + "without the name itself is refused with that cause, never read as empty (section 4.8, ruled " + "2026-11-25). On a disk that ignores case a writer's elements/ lands inside Elements/ and is never read " + "back. The pair side by side is fail-OW-18-folder-case; this is the one alone.") + add("fail-OW-18-world-case-alone.owworld", + build_zip(base(drop=["world.json"], extra=[("World.JSON", base_files()["world.json"])])), + test="OW-18", reader="refuse", reason="name_case", + rule="abbey/World.JSON and no abbey/world.json: the name is read as written, so this holds no world, and " + "a world.json in another case (by OW-18's fold) without the name itself is refused with that cause, never answered as " + "no world (section 4.8, ruled 2026-11-25).") add("fail-OW-18-nfc-then-fold.owworld", build_zip(base(extra=[("media/Café.png", PNG), ("media/café.png", PNG)])), test="OW-18", reader="refuse", reason="collision", @@ -872,6 +935,74 @@ def private_world(drop=(), replace=None): build_zip(base(extra=[("elements/character/con--0000e1.json", element(0xe1, "Con"))])), test="OW-22", rule="con--0000e1.json: its base name is con--0000e1, not a reserved name; accepted.") + # -- OW-23: a share carries under elements/ only an element it read with no mark (section 4.8; writer, two-sided) -- + # One source (hidden_files: the base plus a whole hidden element, a file cut short after its mark, a notes.txt in + # the type folder, a hidden element's file moved into old/, two files holding one id with the unmarked one first, + # and an element in a folder no type names), the two sides a writer emits, and the ways to get the share wrong. + # The want is written by hand: the share leaves all seven out whole, the first counted hidden and the other six + # counted apart as unread, each named in the writer's report; the copy carries all seven byte for byte. Every + # reader opens every one of them. + hid = hidden_files() + left = [HIDDEN_FILE] + SHARE_UNREAD + + def hidden_world(drop=()): + return build_zip(world_entries({rel: data for rel, data in hid.items() if rel not in drop})) + + add("pass-OW-23-share-leaves-unread-out.owworld", hidden_world(drop=left), test="OW-23", role="writer", + source="hidden", side="share", left_out={"hidden": [HIDDEN_FILE], "unread": SHARE_UNREAD}, + rule="Writer, a share (includeHidden false): nothing under elements/ travels but a file the folder reader " + "serves as an element with no mark. The hidden element's file is left out whole and named as hidden; the " + "file cut short, the notes.txt, the hidden file moved into old/, both files of the id two files hold and " + "the element in a folder that is not one of the 22 types are left out whole and named apart, as unread.") + add("pass-OW-23-copy-carries-unread.owworld", hidden_world(), test="OW-23", role="writer", source="hidden", + side="copy", + rule="Writer, a copy (the default): all ten files under elements/, the seven the share leaves out among them, " + "travel byte for byte, the cut one included, since a copy is " + "how a person moves their own world, broken file and all. Nothing is reported left out.") + add("fail-OW-23-share-carries-unread.owworld", hidden_world(drop=[f for f in left if f != UNREAD_FILE]), + test="OW-23", role="writer", writer="refuse", source="hidden", side="share", + rule="Writer, a share: the file cut short after its mark carried; a writer that read a refusal as 'no " + "element' made it. A file whose mark cannot be read never travels in a share.") + add("fail-OW-23-share-carries-hidden.owworld", hidden_world(drop=[f for f in left if f != HIDDEN_FILE]), + test="OW-23", role="writer", writer="refuse", source="hidden", side="share", + rule="Writer, a share: the whole hidden element's file carried; the mark keeps it out.") + add("fail-OW-23-share-carries-moved.owworld", hidden_world(drop=[f for f in left if f != MOVED_FILE]), + test="OW-23", role="writer", writer="refuse", source="hidden", side="share", + rule="Writer, a share: another hidden element's file (Kept, ab07), moved by hand into old/, carried, since no folder reader " + "serves it; a share carries under elements/ only an element it read with no mark.") + add("fail-OW-23-share-carries-notes.owworld", hidden_world(drop=[f for f in left if f != NOTES_FILE]), + test="OW-23", role="writer", writer="refuse", source="hidden", side="share", + rule="Writer, a share: the notes.txt in the type folder carried; a file of another kind under elements/ is " + "left out with the unread.") + add("fail-OW-23-share-carries-twin.owworld", hidden_world(drop=[f for f in left if f != TWIN_PLAIN_FILE]), + test="OW-23", role="writer", writer="refuse", source="hidden", side="share", + rule="Writer, a share: the unmarked file of an id two files hold carried, because it sorts first and a reader " + "serves it with no mark while the hidden file after it is skipped. With two files for one id the share " + "cannot say which mark is the element's, so it carries neither.") + add("fail-OW-23-share-carries-untyped.owworld", hidden_world(drop=[f for f in left if f != UNTYPED_FILE]), + test="OW-23", role="writer", writer="refuse", source="hidden", side="share", + rule="Writer, a share: an element in elements/vessel/, a folder that is not one of the 22 types, carried; such " + "a folder is unread on a share.") + + # -- OW-24: under spatial/ a reader reads the four and only the four (section 4.8, ruled 2026-11-25) ------------- + # map, pin, zone, marker, lower case as under elements/. A reader accepts the world and serves nothing from any + # other folder there; the claim on what it serves lives in the rule, as pass-OW-5-dot-folder-inside's does. + add("pass-OW-24-spatial-untyped.owworld", + build_zip(base(extra=[("spatial/character/cleric--0000ab0c.json", element(0xc, "The Cleric"))])), + test="OW-24", + rule="A Character's file under abbey/spatial/character/: spatial/ holds only map, pin, zone and marker, so " + "the folder is unread and holds no Character; accepted. The world read holds the base's three elements " + "and nothing from spatial/. What a reader says about a folder it does not read is its own. A copy " + "carries the file as written; a share leaves it out as unread. No side: the writer verdict is a " + "copy's.") + add("pass-OW-24-spatial-type-case.owworld", + build_zip(base(extra=[("spatial/Pin/well--0000ab0d.json", element(0xd, "The Well"))])), + test="OW-24", + rule="A Pin's file under abbey/spatial/Pin/: the type word is read as written, lower case as under " + "elements/, so Pin/ is no pin folder and holds no Pin; accepted. The world read holds the base's three " + "elements and no Pin. What a reader says about a folder it does not read is its own. A copy carries " + "the file as written; a share leaves it out as unread. No side: the writer verdict is a copy's.") + return F @@ -897,9 +1028,10 @@ def private_world(drop=(), replace=None): "`generate.py --large DIR`."}, ] -# Spec 4.7 (line 229): the TypeScript reader's six (world-file.ts, as that reader names them) plus six. +# Spec 4.7 (line 229): the TypeScript reader's six (world-file.ts, as that reader names them) plus six, and 4.8's +# name_case (2026-11-25: one fixed name alone in another case). READER_REASONS = ["unsafe_path", "too_big", "too_many", "not_a_world", "more_than_one", "not_openable", - "duplicate", "collision", "link", "method", "name", "marker"] + "duplicate", "collision", "link", "method", "name", "marker", "name_case"] def verdicts_doc(entries): @@ -907,7 +1039,9 @@ def verdicts_doc(entries): return { "set": "owworld-conformance", "generated_by": "generate.py", - "spec": "folder format spec section 4.7, the archive (drafted 2026-10-22), on 0.3.12; tests OW-1..OW-22", + "spec": "folder format spec section 4.7, the archive (drafted 2026-10-22), on 0.3.12; tests OW-1..OW-22; " + "OW-23, the share, section 4.8 (ruled 2026-11-23); OW-24, which folders under spatial/ a reader serves, " + "section 4.8 (ruled 2026-11-25)", "notes": [ "reader: what a reader does with the file (accept, or refuse with `reason`). Every reader runner checks " "this field.", @@ -922,7 +1056,8 @@ def verdicts_doc(entries): "open: what section 4.7 still leaves open on this fixture (the question, with the spec's line); the " "verdict follows `lean` and moves when the spec says otherwise. Every other verdict is the spec's.", "reason: one of `reasons` (section 4.7: the TypeScript reader's six plus duplicate, collision, link, " - "method, name, marker). A reader that refuses for another cause fails the case.", + "method, name, marker, and section 4.8's name_case). A reader that refuses for another cause fails the " + "case.", "budget: reader verdicts hold for a reader whose budget is the floor (`floor`: 500,000 entries, 2 GiB). " "A reader whose budget is larger reads the fixtures marked `budget: floor` with the floor's budget; one " "whose budget is smaller fails the floor cases (pass-OW-15-floor, pass-OW-15-floor-bytes).", @@ -933,6 +1068,14 @@ def verdicts_doc(entries): "side: on the private case, which side of the export the file is: `default` (private records left out) " "or `asked` (the caller asked for them). Both are files a conforming writer emits; which one depends on " "the call, not the bytes.", + "side, on the share case (OW-23, section 4.8, source `hidden`): `share` (includeHidden false) or `copy` " + "(the default). A source's `hidden` and `unread` are the two sets of paths a share leaves out whole: the " + "hidden ones for their mark, the unread ones because the folder reader would not serve them as an element " + "(it could not read them, or they are no element file) or a second file holds the same id. On a `share` side each is absent; on a `copy` side " + "each is present byte-exact.", + "left_out: on the share side a writer emits, the two sets of paths its report names, inside the world: " + "`hidden` and, counted apart, `unread`. A writer runner compares its own report with it; the shape of " + "each writer's report stays its own.", ], "reasons": READER_REASONS, "floor": {"entries": FLOOR_ENTRIES, "bytes": FLOOR_BYTES}, @@ -941,7 +1084,11 @@ def verdicts_doc(entries): "files": {rel: hashlib.sha256(data).hexdigest() for rel, data in sorted(src.items())}}, "sources": {"private": {"world_id": WORLD_ID, "top": TOP.rstrip("/"), "private": [PRIVATE_PRODUCER], "files": {rel: hashlib.sha256(data).hexdigest() - for rel, data in sorted(private_files().items())}}}, + for rel, data in sorted(private_files().items())}}, + "hidden": {"world_id": WORLD_ID, "top": TOP.rstrip("/"), "hidden": [HIDDEN_FILE], + "unread": SHARE_UNREAD, + "files": {rel: hashlib.sha256(data).hexdigest() + for rel, data in sorted(hidden_files().items())}}}, "fixtures": entries, } diff --git a/codegen/schema-dist/fixtures/owworld/pass-OW-23-copy-carries-unread.owworld b/codegen/schema-dist/fixtures/owworld/pass-OW-23-copy-carries-unread.owworld new file mode 100644 index 0000000..0c9f43d Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/pass-OW-23-copy-carries-unread.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/pass-OW-23-share-leaves-unread-out.owworld b/codegen/schema-dist/fixtures/owworld/pass-OW-23-share-leaves-unread-out.owworld new file mode 100644 index 0000000..251e21d Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/pass-OW-23-share-leaves-unread-out.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/pass-OW-24-spatial-type-case.owworld b/codegen/schema-dist/fixtures/owworld/pass-OW-24-spatial-type-case.owworld new file mode 100644 index 0000000..77c74bb Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/pass-OW-24-spatial-type-case.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/pass-OW-24-spatial-untyped.owworld b/codegen/schema-dist/fixtures/owworld/pass-OW-24-spatial-untyped.owworld new file mode 100644 index 0000000..dcfc568 Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/pass-OW-24-spatial-untyped.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/pass-OW-5-dot-folder-inside.owworld b/codegen/schema-dist/fixtures/owworld/pass-OW-5-dot-folder-inside.owworld new file mode 100644 index 0000000..1a027bb Binary files /dev/null and b/codegen/schema-dist/fixtures/owworld/pass-OW-5-dot-folder-inside.owworld differ diff --git a/codegen/schema-dist/fixtures/owworld/verdicts.json b/codegen/schema-dist/fixtures/owworld/verdicts.json index 2565196..92db9f9 100644 --- a/codegen/schema-dist/fixtures/owworld/verdicts.json +++ b/codegen/schema-dist/fixtures/owworld/verdicts.json @@ -1,17 +1,19 @@ { "set": "owworld-conformance", "generated_by": "generate.py", - "spec": "folder format spec section 4.7, the archive (drafted 2026-10-22), on 0.3.12; tests OW-1..OW-22", + "spec": "folder format spec section 4.7, the archive (drafted 2026-10-22), on 0.3.12; tests OW-1..OW-22; OW-23, the share, section 4.8 (ruled 2026-11-23); OW-24, which folders under spatial/ a reader serves, section 4.8 (ruled 2026-11-25)", "notes": [ "reader: what a reader does with the file (accept, or refuse with `reason`). Every reader runner checks this field.", "writer: whether the file is one a conforming writer may emit as a portable .owworld, checked against `source` (every source file present byte-exact) and the writer's MUST rules (only the folder's parts, a marker only in its shape, no api, 1980 stamps, UTF-8 byte order, methods 0 and 8). A SHOULD never makes it refuse; `should` names one a fixture breaks. Only a reference checker checks it; the role says which side the test is about.", "role: reader | writer | roundtrip. A writer fixture is still opened by every reader: its `reader` verdict says so.", "strips: a key a reader removes from world.json and never returns (OW-10: `api`), the file still read.", "open: what section 4.7 still leaves open on this fixture (the question, with the spec's line); the verdict follows `lean` and moves when the spec says otherwise. Every other verdict is the spec's.", - "reason: one of `reasons` (section 4.7: the TypeScript reader's six plus duplicate, collision, link, method, name, marker). A reader that refuses for another cause fails the case.", + "reason: one of `reasons` (section 4.7: the TypeScript reader's six plus duplicate, collision, link, method, name, marker, and section 4.8's name_case). A reader that refuses for another cause fails the case.", "budget: reader verdicts hold for a reader whose budget is the floor (`floor`: 500,000 entries, 2 GiB). A reader whose budget is larger reads the fixtures marked `budget: floor` with the floor's budget; one whose budget is smaller fails the floor cases (pass-OW-15-floor, pass-OW-15-floor-bytes).", "source: a fixture's writer verdict is checked against `source` unless it names one of `sources` (the private case's world, OW-8). A source's `private` lists producers marked private in its RECORDS.json (section 4.5 rule 11): each one's directory is present whole and byte-exact, or absent whole; the manifest itself travels byte-exact either way.", - "side: on the private case, which side of the export the file is: `default` (private records left out) or `asked` (the caller asked for them). Both are files a conforming writer emits; which one depends on the call, not the bytes." + "side: on the private case, which side of the export the file is: `default` (private records left out) or `asked` (the caller asked for them). Both are files a conforming writer emits; which one depends on the call, not the bytes.", + "side, on the share case (OW-23, section 4.8, source `hidden`): `share` (includeHidden false) or `copy` (the default). A source's `hidden` and `unread` are the two sets of paths a share leaves out whole: the hidden ones for their mark, the unread ones because the folder reader would not serve them as an element (it could not read them, or they are no element file) or a second file holds the same id. On a `share` side each is absent; on a `copy` side each is present byte-exact.", + "left_out: on the share side a writer emits, the two sets of paths its report names, inside the world: `hidden` and, counted apart, `unread`. A writer runner compares its own report with it; the shape of each writer's report stays its own." ], "reasons": [ "unsafe_path", @@ -25,7 +27,8 @@ "link", "method", "name", - "marker" + "marker", + "name_case" ], "floor": { "entries": 500000, @@ -69,6 +72,40 @@ "records/lab/world.json": "a7b085e5ac3d34de33024c40db1e38f0526a2b03711ac492340d138b85871447", "world.json": "bf6ff0507a982839e2dbbdd98995dc3da22926fd9b9291c21ac1cdb55b824f60" } + }, + "hidden": { + "world_id": "0695db52-0000-7000-8000-00000000abbe", + "top": "abbey", + "hidden": [ + "elements/character/veiled--0000ab05.json" + ], + "unread": [ + "elements/character/notes.txt", + "elements/character/old/kept--0000ab07.json", + "elements/character/pair-a--0000ab08.json", + "elements/character/pair-b--0000ab08.json", + "elements/character/torn--0000ab06.json", + "elements/vessel/skiff--0000ab0b.json" + ], + "files": { + "elements/character/ana--0000ab01.json": "1fb89188a024f91cf4ce2ef88c04fcd62ac7bd6a3162f7706f1387e718a4d1bf", + "elements/character/brother-tomas--0000ab02.json": "581efb60de6430fbc29c57a11bc02dc3f4e58d98c4e6465cbc55b0241d6ea295", + "elements/character/notes.txt": "86dabc2a9aae0c3c2af9dce864f077d44bb48535e4629b41b81767dfdabe8ccd", + "elements/character/old/kept--0000ab07.json": "7cad7439d50a6ae41ea21e6e62a95664445825a32a2c47cf35732c960463c045", + "elements/character/pair-a--0000ab08.json": "25531cbf557ce56d83745aacd03a82f0dfcfa5846f8bacfc421c0a14f5f3e271", + "elements/character/pair-b--0000ab08.json": "31b10a7db8501b07489d8194b30aeb4b8513b0388ded4049479cffeba573fa53", + "elements/character/torn--0000ab06.json": "83a11081e8cc2f12e63f3283ff5e1e2ed3b837aaf8c6a6cdda52d86dc53d1812", + "elements/character/veiled--0000ab05.json": "6c278502c03ff79fe2979b0068b31597eb4799abc33b80ed099c4425e7a8cc05", + "elements/location/abbey--0000ab03.json": "51551b550b02851005b9e9ea2d573cf9c8a059ccabbc806b943816c131ddb556", + "elements/vessel/skiff--0000ab0b.json": "c2a8c258261f678ca6714e0db2cb117bf3749bc48dbfac2c363ec4ec27b8271f", + "media/a.png": "68aa60a5f1ac10e88f44f6e4a462540949808b813c736db8201d2590f3fc30e0", + "records/RECORDS.json": "3a701d11c2698b44ca050fd31e591771036876da812ce9ba3c9e583f4970aba0", + "records/lab/.cursor": "084c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc0", + "records/lab/ledger.bin": "0334a98f4f7a57273b73b6854df3d72960f8e20f08d64d141918c6f8df4932b2", + "records/lab/ledger.bin.meta": "f5a67c172404428fbd1057b1f8e35af69a6174bacca421080f407ae07b1b48b1", + "records/lab/world.json": "a7b085e5ac3d34de33024c40db1e38f0526a2b03711ac492340d138b85871447", + "world.json": "bf6ff0507a982839e2dbbdd98995dc3da22926fd9b9291c21ac1cdb55b824f60" + } } }, "fixtures": [ @@ -271,6 +308,16 @@ "sha256": "33dda35d4d8cd4901a6abb425466ad0f5b21b86e95bb409a06579d24473b9b91", "bytes": 2944 }, + { + "file": "pass-OW-5-dot-folder-inside.owworld", + "test": "OW-5", + "role": "reader", + "reader": "accept", + "writer": "refuse", + "rule": "Dot-folders inside the world, each holding a well-formed world.json of another world's id: a tool's abbey/.atlas/ (beside its world-prefs.json), deeper, abbey/elements/character/.trash/, and abbey/..atlas/, a name of dots and more: any path segment that begins with a dot is a dot-folder, once OW-16 has refused a segment that is exactly . or .. . A dot-folder is never a world, wherever it sits, so the second-world check does not look under a folder whose name starts with a dot; accepted. The world read is abbey's own id, and nothing under any dot-folder is among its elements or changes its counts. Only that check skips them: every other check still reads their entries. A reader ignores them; a writer never emits a dot-folder unless the caller hands it in, so never in a portable .owworld.", + "sha256": "1c5526d2a56712cccb9c66d503de22460d436fbb0581b214567ac15bff46bc83", + "bytes": 4312 + }, { "file": "pass-OW-6-marker.owworld", "test": "OW-6", @@ -790,6 +837,28 @@ "sha256": "8faaece9c3dc5b4365c6c48bce62edcb7c0d689a3fb3e3839e4c838d59d2edd7", "bytes": 2659 }, + { + "file": "fail-OW-18-folder-case-alone.owworld", + "test": "OW-18", + "role": "reader", + "reader": "refuse", + "writer": "refuse", + "rule": "abbey/Elements/ and no abbey/elements/: the three fixed names (world.json, elements/, spatial/) are read as written, so Elements/ is no element folder, and a world holding one of them in another case (by OW-18's fold) without the name itself is refused with that cause, never read as empty (section 4.8, ruled 2026-11-25). On a disk that ignores case a writer's elements/ lands inside Elements/ and is never read back. The pair side by side is fail-OW-18-folder-case; this is the one alone.", + "reason": "name_case", + "sha256": "25d17b76b22bcf51728e6cf500abbd4e4e38ece72230ab07bd108432aea1ae64", + "bytes": 2424 + }, + { + "file": "fail-OW-18-world-case-alone.owworld", + "test": "OW-18", + "role": "reader", + "reader": "refuse", + "writer": "refuse", + "rule": "abbey/World.JSON and no abbey/world.json: the name is read as written, so this holds no world, and a world.json in another case (by OW-18's fold) without the name itself is refused with that cause, never answered as no world (section 4.8, ruled 2026-11-25).", + "reason": "name_case", + "sha256": "2c849b2c2b17159b4342f5bd62fe232558e809f4fe647298d3658c061467db5e", + "bytes": 2424 + }, { "file": "fail-OW-18-nfc-then-fold.owworld", "test": "OW-18", @@ -1125,6 +1194,135 @@ "sha256": "42ab3a54ec99c0a36eeffb4473dfc3bfc805220b816b61e51f3db6f62ed4d897", "bytes": 2652 }, + { + "file": "pass-OW-23-share-leaves-unread-out.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "accept", + "rule": "Writer, a share (includeHidden false): nothing under elements/ travels but a file the folder reader serves as an element with no mark. The hidden element's file is left out whole and named as hidden; the file cut short, the notes.txt, the hidden file moved into old/, both files of the id two files hold and the element in a folder that is not one of the 22 types are left out whole and named apart, as unread.", + "source": "hidden", + "side": "share", + "left_out": { + "hidden": [ + "elements/character/veiled--0000ab05.json" + ], + "unread": [ + "elements/character/notes.txt", + "elements/character/old/kept--0000ab07.json", + "elements/character/pair-a--0000ab08.json", + "elements/character/pair-b--0000ab08.json", + "elements/character/torn--0000ab06.json", + "elements/vessel/skiff--0000ab0b.json" + ] + }, + "sha256": "11a577b054b87cc8e7d66f8070d791d413f3ab7527d4de82a9d19abbf5d1e856", + "bytes": 2424 + }, + { + "file": "pass-OW-23-copy-carries-unread.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "accept", + "rule": "Writer, a copy (the default): all ten files under elements/, the seven the share leaves out among them, travel byte for byte, the cut one included, since a copy is how a person moves their own world, broken file and all. Nothing is reported left out.", + "source": "hidden", + "side": "copy", + "sha256": "bf02ce9ee885bea0d677d917bc83dda4e8b4833595818cdb5140ce2ac6f2ef05", + "bytes": 4120 + }, + { + "file": "fail-OW-23-share-carries-unread.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "refuse", + "rule": "Writer, a share: the file cut short after its mark carried; a writer that read a refusal as 'no element' made it. A file whose mark cannot be read never travels in a share.", + "source": "hidden", + "side": "share", + "sha256": "3f1b2e7f7ca3e411f519e869c1ae3a8849ff2bdd7626ee28c55f09be68b205e9", + "bytes": 2653 + }, + { + "file": "fail-OW-23-share-carries-hidden.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "refuse", + "rule": "Writer, a share: the whole hidden element's file carried; the mark keeps it out.", + "source": "hidden", + "side": "share", + "sha256": "39f9df63b670ea3d57f7ed7ad84f3b3294fa026949939835ac35e964649f2ae9", + "bytes": 2683 + }, + { + "file": "fail-OW-23-share-carries-moved.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "refuse", + "rule": "Writer, a share: another hidden element's file (Kept, ab07), moved by hand into old/, carried, since no folder reader serves it; a share carries under elements/ only an element it read with no mark.", + "source": "hidden", + "side": "share", + "sha256": "d3653fb3e858183e8e890add1323b51a05921b3ebbdd7cccc84a6bc2d20f0085", + "bytes": 2685 + }, + { + "file": "fail-OW-23-share-carries-notes.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "refuse", + "rule": "Writer, a share: the notes.txt in the type folder carried; a file of another kind under elements/ is left out with the unread.", + "source": "hidden", + "side": "share", + "sha256": "41ea479cc05ab3cec1a5ef234232b89137d63963503ff98c5fbd76313f00a730", + "bytes": 2639 + }, + { + "file": "fail-OW-23-share-carries-twin.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "refuse", + "rule": "Writer, a share: the unmarked file of an id two files hold carried, because it sorts first and a reader serves it with no mark while the hidden file after it is skipped. With two files for one id the share cannot say which mark is the element's, so it carries neither.", + "source": "hidden", + "side": "share", + "sha256": "3d14536c777e1b9b53832479d4b6aee06036063f70aa590279e0afe5200cb566", + "bytes": 2663 + }, + { + "file": "fail-OW-23-share-carries-untyped.owworld", + "test": "OW-23", + "role": "writer", + "reader": "accept", + "writer": "refuse", + "rule": "Writer, a share: an element in elements/vessel/, a folder that is not one of the 22 types, carried; such a folder is unread on a share.", + "source": "hidden", + "side": "share", + "sha256": "8a4ea219edac7fc018cb14d82f5457a0f5c2e77367d0b456eb33f388530adb0f", + "bytes": 2660 + }, + { + "file": "pass-OW-24-spatial-untyped.owworld", + "test": "OW-24", + "role": "reader", + "reader": "accept", + "writer": "accept", + "rule": "A Character's file under abbey/spatial/character/: spatial/ holds only map, pin, zone and marker, so the folder is unread and holds no Character; accepted. The world read holds the base's three elements and nothing from spatial/. What a reader says about a folder it does not read is its own. A copy carries the file as written; a share leaves it out as unread. No side: the writer verdict is a copy's.", + "sha256": "cc39ecd74848be036925a5aeb12bfa0390b470525baf0a7d87cf3b6fc160379d", + "bytes": 2667 + }, + { + "file": "pass-OW-24-spatial-type-case.owworld", + "test": "OW-24", + "role": "reader", + "reader": "accept", + "writer": "accept", + "rule": "A Pin's file under abbey/spatial/Pin/: the type word is read as written, lower case as under elements/, so Pin/ is no pin folder and holds no Pin; accepted. The world read holds the base's three elements and no Pin. What a reader says about a folder it does not read is its own. A copy carries the file as written; a share leaves it out as unread. No side: the writer verdict is a copy's.", + "sha256": "51e50436e02ccd8bd2978380fb64ea5688da32ee7fc697fc7adb480ab39e5be1", + "bytes": 2649 + }, { "file": "fail-OW-14-count.owworld", "test": "OW-14", diff --git a/codegen/schema-dist/profiles/address.fixture.json b/codegen/schema-dist/profiles/address.fixture.json index 81dbbe6..573d9be 100644 --- a/codegen/schema-dist/profiles/address.fixture.json +++ b/codegen/schema-dist/profiles/address.fixture.json @@ -2247,6 +2247,26 @@ } } }, + { + "name": "prose-a-moment-far-past-its-range-not-taken", + "claim": "a run of 5,000 digits after the @ is no step, so no moment is taken and the address ends before the @ (a reader that turns the run into a number before it bounds it may fail here)", + "kind": "prose", + "text": "ow://object/01a1d4ef-0000-7000-8000-000000000084@99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", + "index": 0, + "expect": { + "address": "ow://object/01a1d4ef-0000-7000-8000-000000000084", + "reading": { + "form": "text", + "world": null, + "world_is_slug": false, + "type": "object", + "id": "01a1d4ef-0000-7000-8000-000000000084", + "lens": null, + "moment": null, + "canonical": true + } + } + }, { "name": "moment-at-the-range-taken", "claim": "moment at the range taken: the packages' shared address-in-prose case, as both packages keep it", diff --git a/codegen/schema-dist/profiles/address.md b/codegen/schema-dist/profiles/address.md index 5877931..60a736f 100644 --- a/codegen/schema-dist/profiles/address.md +++ b/codegen/schema-dist/profiles/address.md @@ -37,7 +37,7 @@ A reader ignores any other query key and any fragment (a share sheet adds its ow A site may render the string as a plain link to the canonical human address without fetching anything, so a reader sees where a click goes and "never resolved" stays true. What such a field tells a reader is only what the string carries: that a world exists and is linked from this one. -**An address in prose.** A reader that finds an address inside other text (a line of a report's `consequences`, a description) reads it from its prefix, and where it ends is the grammar's, never the next space's. An address in prose begins where its prefix begins only when the character before it (one code point back, never one UTF-16 unit or one UTF-8 byte) is none (the start of the text), or is neither a letter of any script, a combining mark nor an underscore: `elbow://…` and `_ow://…` hold no address; `x-ow://…`, `3ow://…`, `(ow://…`, `"ow://…` and a line that begins with `ow://` do. Addresses found in a text do not overlap: read left to right, the first start that holds an address takes its whole run, and a prefix inside that run is no start. In prose, the address continues only with what its reading takes: `@` and a moment, `?lens=` and a lens. Any other query key or a fragment is not part of an address found in prose; the address ends before its `?`, `&` or `#`. What follows is prose, a full stop included. An id ends where its form ends (36 characters), a moment is its whole run of an optional minus and digits and is taken only when that run reads as one step, and a lens ends where its id ends; after a world's id or slug, a path that is no type word and id is prose, and the address is the world's own. A slug in prose ends at the first character outside the slug's own alphabet (the address page's: lowercase letters, digits, hyphens), and is the whole run or nothing: a run that is no slug is no address. After `/w/` in an address, the run is read whole: a run that is exactly an id's form (36 characters, hex in either case and its four hyphens) is the world's id, read as the address page reads an id (either case, taken lowercase); any other run that is a legal slug is the slug; any other run is no address. The run ends at the first character outside the slug's alphabet or the id's (lower-case letters, digits, hyphens, and the upper-case hex letters A to F). A run followed by a letter, a combining mark (Unicode categories L and M) or an underscore is cut inside a word and is no address. An id found in a text a page says is searched for ids (a Charter's) keeps the reading of "The same id" (serial 122): the 36 characters are the id whatever follows them. The packages find it with `readOwLinkAt(text, index)` (`read_ow_link_at` in Python), which answers the reading and the index just past the address, or nothing. The index is as the language indexes its strings (UTF-16 units in JavaScript, code points in Python). +**An address in prose.** A reader that finds an address inside other text (a line of a report's `consequences`, a description) reads it from its prefix, and where it ends is the grammar's, never the next space's. An address in prose begins where its prefix begins only when the character before it (one code point back, never one UTF-16 unit or one UTF-8 byte) is none (the start of the text), or is neither a letter of any script, a combining mark nor an underscore: `elbow://…` and `_ow://…` hold no address; `x-ow://…`, `3ow://…`, `(ow://…`, `"ow://…` and a line that begins with `ow://` do. Addresses found in a text do not overlap: read left to right, the first start that holds an address takes its whole run, and a prefix inside that run is no start. In prose, the address continues only with what its reading takes: `@` and a moment, `?lens=` and a lens. Any other query key or a fragment is not part of an address found in prose; the address ends before its `?`, `&` or `#`. What follows is prose, a full stop included. An id ends where its form ends (36 characters), a moment is its whole run of an optional minus and digits and is taken only when that run reads as one step, and a lens ends where its id ends; after a world's id or slug, a path that is no type word and id is prose, and the address is the world's own. A slug in prose ends at the first character outside the slug's own alphabet (the address page's: lowercase letters, digits, hyphens), and is the whole run or nothing: a run that is no slug is no address. After `/w/` in an address, the run is read whole: a run that is exactly an id's form (36 characters, hex in either case and its four hyphens) is the world's id, read as the address page reads an id (either case, taken lowercase); any other run that is a legal slug is the slug; any other run is no address. The run ends at the first character outside the slug's alphabet or the id's (lower-case letters, digits, hyphens, and the upper-case hex letters A to F). A run followed by a letter, a combining mark (Unicode categories L and M) or an underscore is cut inside a word and is no address. An id found in a text a page says is searched for ids (a Charter's) keeps the reading of "The same id" (serial 122): the 36 characters are the id whatever follows them. The packages find it with `readOwLinkAt(text, index)` (`read_ow_link_at` in Python), which answers the reading and the index just past the address, or nothing. The index is as the language indexes its strings (UTF-16 units in JavaScript, code points in Python). A letter and a combining mark, where an address in prose begins and where a run is cut inside a word, are a code point that Unicode 11.0 assigns to category L or M; a code point Unicode assigned after 11.0 is promised nothing, so a reader may read it either way. **How a reader parses.** One string, read whole: a link inside other text (Markdown, a sentence) is the caller's to find first, as the paragraph above says. The checks run in this order, and the first that fails names the refusal, so every reader refuses a string for the same reason: @@ -64,4 +64,4 @@ The reading is the form (`human` or `text`), the world (`null` in the in-world t **Where it is read from.** The packages publish the two directions, `elementAddress` (a triple, or a world, to a string) and `parseOwLink` (a string to a reading), in npm and Python, from this page and its fixture. The conformance fixture beside this page, `address.fixture.json`, holds the cases a reader and a writer must agree on: each spelling with and without each option, a world's own address, a slug, the 22 type words, every refusal by name, and lines where an address is found in prose, and texts read whole for every address they hold (`prose-all`: the addresses as the strings they stand as in the text, in order), each case naming its claim. A reader conforms when it passes every case. -**Ruled** 2026-10-26: the canonical human address, the two text forms, the moment and the lens, and the convention for a field. Written 2026-10-27, the world's own address added the same day. Skeld, 2026-10-28, serial 86: what a pin's, a marker's or a zone's address answers. Skeld, 2026-10-30, serial 97: a writer's empty string is never absent (four format cases, one per part). 2026-11-13, serial 122: inside a world two ids are the same id when they are written the same, and an order by id is of the ids as written; an id is read in either case, and taken in lowercase, in two places, an address and a text a page says is searched for ids, where the form alone is looked for from the text's start, and elsewhere only where a page gives one value a reading of its own; what it is then matched against is read as written; a writer gives a new element an id in lowercase and never re-spells an id an element already holds, wherever inside a world it names it, and a platform stores and serves an element's `id` and its links lowercase and an `x_` value as written (The same id); refusal 9 says that the lens key's word is lowercase only, compared as written with nothing trimmed, and the id it holds is read in either case, three cases more in the fixture. 2026-11-13, serial 123: an address found in prose ends where its own reading ends, after its id, a moment and a lens, and what follows it is prose, a full stop included, while the whole-string parser still refuses `ow:///.` as a bad id (An address in prose); a slug in prose is its whole run of its own alphabet or no address, never cut back to a shorter slug; after `/w/` the run is read whole, the world's id only when the run is exactly an id's form, else the slug or no address (keel's finder read an id first in the run and cited the id's world where the site opens a slug's; keel's `/w/` route and its slug check read a hyphenless id before, 32 hex digits with the hyphens anywhere or none, and move: such a run is a slug, opening the world that holds it or nothing; and the API's world parameter reads the same, on the keyless, token and key doors and on the roster's token door, which read a hyphenless id before and move), while an id found in a text a page says is searched for ids (a Charter's) is still its 36 characters whatever follows them; a run followed by a letter, a combining mark or an underscore is cut inside a word and is no address (keel and both packages read the slug up to that letter before, and move); the index a finder answers is as its language indexes its strings; fifty-seven prose cases in the fixture, the thirty-nine both OnlyWorlds packages share among them. 2026-11-14, serial 126: in prose, after a world's id or slug, a type word in another case is no type word, so the address is the world's own and what follows is prose, and after a slug a type word and an id are the element; four prose cases more in the fixture, sixty-one in all, none of which moves a reader; serial 123's parenthesis on a run cut inside a word ("keel and both packages read the slug up to that letter before, and move") names movers that did not exist: keel's finder before 123 refused a run that was no legal slug whole and indexed no slug, and neither package had a finder before 123, so nothing moved on a run cut inside a word or on a slug cut back to a shorter one. 2026-11-14, serial 127: an address in prose begins only at the start of the text or after a character that is neither a letter of any script, a combining mark nor an underscore, the set that cuts a run after `/w/`, read one code point back in both forms, so a prefix glued inside a word holds no address while a hyphen, a digit, white space or punctuation before it glue nothing; fifteen prose cases more in the fixture, seventy-six in all, a letter above U+FFFF glued after a slug's run among them, with two addresses written back to back read as two after an id that ends in a digit and as one after an id that ends in a hex letter, and the two cases with a letter above U+FFFF before the index giving it in code points and in UTF-16 units; keel's finder read a glued start as an address before, and moves. 2026-11-14, serial 128: addresses found in a text do not overlap, so a reader reading a text for every address it holds takes the first start's whole run and finds no address at a prefix inside it (a site address whose slug ends `3ow` before `://` is one address, not two); two cases of a new kind, `prose-all`, each a text and the addresses found in it as strings, in order; keel's find-all (the citation index's scan) read both so before, and no reader of keel's moves. +**Ruled** 2026-10-26: the canonical human address, the two text forms, the moment and the lens, and the convention for a field. Written 2026-10-27, the world's own address added the same day. Skeld, 2026-10-28, serial 86: what a pin's, a marker's or a zone's address answers. Skeld, 2026-10-30, serial 97: a writer's empty string is never absent (four format cases, one per part). 2026-11-13, serial 122: inside a world two ids are the same id when they are written the same, and an order by id is of the ids as written; an id is read in either case, and taken in lowercase, in two places, an address and a text a page says is searched for ids, where the form alone is looked for from the text's start, and elsewhere only where a page gives one value a reading of its own; what it is then matched against is read as written; a writer gives a new element an id in lowercase and never re-spells an id an element already holds, wherever inside a world it names it, and a platform stores and serves an element's `id` and its links lowercase and an `x_` value as written (The same id); refusal 9 says that the lens key's word is lowercase only, compared as written with nothing trimmed, and the id it holds is read in either case, three cases more in the fixture. 2026-11-13, serial 123: an address found in prose ends where its own reading ends, after its id, a moment and a lens, and what follows it is prose, a full stop included, while the whole-string parser still refuses `ow:///.` as a bad id (An address in prose); a slug in prose is its whole run of its own alphabet or no address, never cut back to a shorter slug; after `/w/` the run is read whole, the world's id only when the run is exactly an id's form, else the slug or no address (keel's finder read an id first in the run and cited the id's world where the site opens a slug's; keel's `/w/` route and its slug check read a hyphenless id before, 32 hex digits with the hyphens anywhere or none, and move: such a run is a slug, opening the world that holds it or nothing; and the API's world parameter reads the same, on the keyless, token and key doors and on the roster's token door, which read a hyphenless id before and move), while an id found in a text a page says is searched for ids (a Charter's) is still its 36 characters whatever follows them; a run followed by a letter, a combining mark or an underscore is cut inside a word and is no address (keel and both packages read the slug up to that letter before, and move); the index a finder answers is as its language indexes its strings; fifty-seven prose cases in the fixture, the thirty-nine both OnlyWorlds packages share among them. 2026-11-14, serial 126: in prose, after a world's id or slug, a type word in another case is no type word, so the address is the world's own and what follows is prose, and after a slug a type word and an id are the element; four prose cases more in the fixture, sixty-one in all, none of which moves a reader; serial 123's parenthesis on a run cut inside a word ("keel and both packages read the slug up to that letter before, and move") names movers that did not exist: keel's finder before 123 refused a run that was no legal slug whole and indexed no slug, and neither package had a finder before 123, so nothing moved on a run cut inside a word or on a slug cut back to a shorter one. 2026-11-14, serial 127: an address in prose begins only at the start of the text or after a character that is neither a letter of any script, a combining mark nor an underscore, the set that cuts a run after `/w/`, read one code point back in both forms, so a prefix glued inside a word holds no address while a hyphen, a digit, white space or punctuation before it glue nothing; fifteen prose cases more in the fixture, seventy-six in all, a letter above U+FFFF glued after a slug's run among them, with two addresses written back to back read as two after an id that ends in a digit and as one after an id that ends in a hex letter, and the two cases with a letter above U+FFFF before the index giving it in code points and in UTF-16 units; keel's finder read a glued start as an address before, and moves. 2026-11-14, serial 128: addresses found in a text do not overlap, so a reader reading a text for every address it holds takes the first start's whole run and finds no address at a prefix inside it (a site address whose slug ends `3ow` before `://` is one address, not two); two cases of a new kind, `prose-all`, each a text and the addresses found in it as strings, in order; keel's find-all (the citation index's scan) read both so before, and no reader of keel's moves. 2026-11-25, serial 146: a letter and a combining mark in an address in prose, where it begins and where a run is cut inside a word, are those Unicode 11.0 assigns, and a code point assigned later is promised nothing (no case in the fixture holds one), and, measured for the ruling, of the code points Unicode 11.0 assigns, none is a letter or a mark in one table and not in the other when 11.0 is set beside 15.1 and beside 17.0 (two measures, on runtimes that carry those versions); a prose case more in the fixture, seventy-seven in all: a run of 5,000 digits after the `@` is no step, so no moment is taken and the address ends before the `@`; no reader of keel's moves. diff --git a/codegen/schema-dist/profiles/calendar.fixture.json b/codegen/schema-dist/profiles/calendar.fixture.json index 8a28639..bb35360 100644 --- a/codegen/schema-dist/profiles/calendar.fixture.json +++ b/codegen/schema-dist/profiles/calendar.fixture.json @@ -10,7 +10,8 @@ "notes": [ "value: the raw atlas_calendar field value (an object, or a JSON string). valid: the SDK reader (readCalendarValue) returns a calendar; false means not a calendar, the reader shows bare numbers.", "words: exactly what formatStep prints. breakdown: breakdownStep with its keys, except era, which is the era's name (or null) in place of the era object.", - "elements and found (one case, found-by-the-field-never-by-type): a world's elements, and the ids of those a reader finds a calendar on, in list order: by the atlas_calendar field being present (null is absent), never by type or supertype. value is the calendar they carry, and its steps read as in any case." + "elements and found (one case, found-by-the-field-never-by-type): a world's elements, and the ids of those a reader finds a calendar on, in list order: by the atlas_calendar field being present (null is absent), never by type or supertype. value is the calendar they carry, and its steps read as in any case.", + "date_fields and world_points (one case, date-fields-by-their-name): the element fields that hold a date, each as type.field in sorted order, by the name alone (date, or ending in _date) in the schema of this serial; and the World's three fields on the same line, sorted. value is the smallest calendar, and its steps read as in any case." ], "cases": [ { @@ -5320,6 +5321,84 @@ } } ] + }, + { + "name": "date-fields-by-their-name", + "why": "which fields a calendar reads: every field of an element whose name is date or ends in _date, each a whole number of steps, and the World's three points on the same line; a length (duration, life_span) is neither. The calendar is the smallest valid one, read as no-year-structure reads it", + "value": { + "version": 1, + "grain": "year" + }, + "valid": true, + "steps": [ + { + "step": -5, + "words": "-5", + "breakdown": { + "absYear": -5, + "year": -5, + "era": null, + "month": null, + "monthName": null, + "day": null, + "intercalary": null, + "weekday": null + } + }, + { + "step": 0, + "words": "0", + "breakdown": { + "absYear": 0, + "year": 0, + "era": null, + "month": null, + "monthName": null, + "day": null, + "intercalary": null, + "weekday": null + } + }, + { + "step": 7, + "words": "7", + "breakdown": { + "absYear": 7, + "year": 7, + "era": null, + "month": null, + "monthName": null, + "day": null, + "intercalary": null, + "weekday": null + } + } + ], + "date_fields": [ + "character.birth_date", + "collective.formation_date", + "construct.end_date", + "construct.start_date", + "creature.birth_date", + "event.end_date", + "event.start_date", + "institution.founding_date", + "law.date", + "location.founding_date", + "narrative.end_date", + "narrative.start_date", + "relation.end_date", + "relation.start_date", + "title.grant_date", + "title.revoke_date", + "zone.end_date", + "zone.start_date" + ], + "world_points": [ + "time_current", + "time_range_max", + "time_range_min" + ] } ] } diff --git a/codegen/schema-dist/profiles/calendar.md b/codegen/schema-dist/profiles/calendar.md index d5e7d97..ae8a7a6 100644 --- a/codegen/schema-dist/profiles/calendar.md +++ b/codegen/schema-dist/profiles/calendar.md @@ -2,6 +2,8 @@ **What it is.** A world's own calendar: the names a world gives to its time line (months, weeks, eras, leap days). It changes no date. Every date field in OnlyWorlds stays a plain integer in the world's `time_basic_unit`; the calendar only says how to read that integer aloud. +**Which fields are dates.** A date field is one of the fields the standard gives an element type, whose name is `date` or ends in `_date`. Each holds a whole number of steps. A length (`duration`, `life_span`) is not a date. The World's `time_current`, `time_range_min` and `time_range_max` are points on the same line. A field a tool adds is not made a date by its name: it is a date only where its profile says so. + **Key name.** `atlas_calendar`. It keeps its name from before the profile grammar (`x__`), because three readers already use it: Atlas, the TypeScript SDK (`CALENDAR_FIELD`) and the Unity SDK. **On which element.** Any element may carry it; a reader finds calendars by the field being present, never by type or supertype. By convention it sits on a Construct with supertype `calendar`, and that is where Atlas makes one. A world can hold several. Which one a tool speaks is the tool's own choice; Atlas speaks the only one when there is one, and offers a choice when there are more. @@ -48,6 +50,6 @@ Every reader refuses the same values, or one tool shows a calendar where another **What a writer must keep.** Everything it did not change, unknown keys included. A re-key never rewrites the value (it holds no element ids). -**Conformance.** `calendar.fixture.json`, beside this page: 78 cases, 52 generated from `@onlyworlds/sdk` 4.42.2, 14 for the amendment from 4.76.0 (two of them replace `refuse-version` and `era-overlap-down-later-start`), 11 for serial 89, written from its rulings (and `intercalary-after-month-out-of-range` now a refusal), 1 for serial 90, 1 for serial 109 (`refuse-year-base-five`: a whole-number `year_base` outside 0 or 1, the field table's range, which the refusal list had not said), and 1 for serial 131 (`v2-except-offset-leap-mid-year`: the `except` rule on a calendar whose leap day is not the year's last, so a reader whose days ignore `except` misreads the days after it), 35 calendars with 229 steps and the words and breakdown each one reads as, and 43 values a reader must refuse. One case, `found-by-the-field-never-by-type`, also carries a world's elements and the ids a reader finds a calendar on. The steps of the two LegendKeeper calendars (`v2-except-chain-gregorian`, `v2-offset-harptos`) each match what LegendKeeper's API answered for a user's own project on 2026-10-25; the Gregorian case includes the days around Leap Day in 1900, 2000 and 2100, where a reader whose days ignore `except` while its year count keeps it would misread. A reader conforms when it passes every case. +**Conformance.** `calendar.fixture.json`, beside this page: 79 cases, 52 generated from `@onlyworlds/sdk` 4.42.2, 14 for the amendment from 4.76.0 (two of them replace `refuse-version` and `era-overlap-down-later-start`), 11 for serial 89, written from its rulings (and `intercalary-after-month-out-of-range` now a refusal), 1 for serial 90, 1 for serial 109 (`refuse-year-base-five`: a whole-number `year_base` outside 0 or 1, the field table's range, which the refusal list had not said), and 1 for serial 131 (`v2-except-offset-leap-mid-year`: the `except` rule on a calendar whose leap day is not the year's last, so a reader whose days ignore `except` misreads the days after it), and 1 for serial 146 (`date-fields-by-their-name`: which fields are dates), 36 calendars with 232 steps and the words and breakdown each one reads as, and 43 values a reader must refuse. One case, `found-by-the-field-never-by-type`, also carries a world's elements and the ids a reader finds a calendar on, and one, `date-fields-by-their-name`, the 18 date fields of today's schema as `type.field` and the World's three points, on the smallest calendar. The steps of the two LegendKeeper calendars (`v2-except-chain-gregorian`, `v2-offset-harptos`) each match what LegendKeeper's API answered for a user's own project on 2026-10-25; the Gregorian case includes the days around Leap Day in 1900, 2000 and 2100, where a reader whose days ignore `except` while its year count keeps it would misread. A reader conforms when it passes every case. -Source: the TypeScript SDK's calendar kernel (`@onlyworlds/sdk` 4.42.2: `readCalendarConfig`, `breakdownStep`, `formatStep`), written from Atlas's calendar, which made the field. Amended 2026-10-25 (version 2: `except` and `offset` on an intercalary entry; an open era's end skips `down` eras), for two findings: three calendars version 1 could not hold exactly (Gregorian, Harptos and Scrolls), which now match what LegendKeeper's API answered for a user's own project on 2026-10-25, and an era-order fault found in two readers the same day. Amended 2026-10-29, serial 89 (an `after_month` naming a month the year does not have and a `grain` with nothing left after trimming are not a calendar; a `format` or `format_intercalary` that is not a string is ignored), from five readers' ports of the profile, which named the cases where a wrong reader still passed every case. Amended 2026-10-29, serial 90 (an intercalary entry on a calendar with no months is not a calendar, whatever its `after_month`, 0 included: `after_month` names a place between months, and there are none), from a reader's question after serial 89. +Source: the TypeScript SDK's calendar kernel (`@onlyworlds/sdk` 4.42.2: `readCalendarConfig`, `breakdownStep`, `formatStep`), written from Atlas's calendar, which made the field. Amended 2026-10-25 (version 2: `except` and `offset` on an intercalary entry; an open era's end skips `down` eras), for two findings: three calendars version 1 could not hold exactly (Gregorian, Harptos and Scrolls), which now match what LegendKeeper's API answered for a user's own project on 2026-10-25, and an era-order fault found in two readers the same day. Amended 2026-10-29, serial 89 (an `after_month` naming a month the year does not have and a `grain` with nothing left after trimming are not a calendar; a `format` or `format_intercalary` that is not a string is ignored), from five readers' ports of the profile, which named the cases where a wrong reader still passed every case. Amended 2026-10-29, serial 90 (an intercalary entry on a calendar with no months is not a calendar, whatever its `after_month`, 0 included: `after_month` names a place between months, and there are none), from a reader's question after serial 89. Amended 2026-11-25, serial 146 (which fields are dates: one of the fields the standard gives an element type whose name is `date` or ends in `_date`, each a whole number of steps, eight names in 18 places in today's schema; a length is not a date, the World's three time fields are points on the same line, and a field a tool adds is not made a date by its name, only by its profile). diff --git a/codegen/schema-dist/walk/lint_folder.py b/codegen/schema-dist/walk/lint_folder.py index 9671ee1..15db2e1 100644 --- a/codegen/schema-dist/walk/lint_folder.py +++ b/codegen/schema-dist/walk/lint_folder.py @@ -2,8 +2,9 @@ python walk/lint_folder.py PATH/TO/WORLD-FOLDER [--schema DIR] -Reads `world.json` and every `elements//*.json` under the folder and -reports, one line each: a file outside the 22 type folders, a missing or +Reads `world.json` and every `elements//*.json` under the folder (a name that ends in +`.json` in exactly that case and does not begin with a dot, as the readers take one, and +none under a dot-named folder; any other file is passed over) and reports, one line each: a file outside the 22 type folders, a missing or duplicate UUID `id`, a key that is not a field of its type (the shape one real world's profile found three hundred of: `creature.characters`, `event.location`, `event.actor`), a value of the wrong shape for its kind, and @@ -27,9 +28,14 @@ (`x_spine_depends_on`, `x_lens_leads_to`: the lens profile's closed table), that names one element more than once gets one warning line per element, with how many times, never a problem (each names each element once; a reader reads a repeat once, in its first place); -entries are compared as written, so `[a, A]` is no repeat. The last line is the count it checked, so an empty +entries are compared as written, so `[a, A]` is no repeat. A `world.json` or an element +file whose JSON this Python cannot hold (nested deeper than its parser goes, or a number +longer than it converts) gets one line saying it was not read, and the check goes on: +a third verdict beside clean and a problem, since a newer Python on another system may read +the same file. The last line is the count it checked, so an empty report is a result and not a silence. Exit 0 clean, 1 with problems, 2 when -the folder is not a world folder. +the folder is not a world folder, 3 when nothing it read has a problem but a file was not +read. The same function gates the published example world (publish_dist.py), so the check a stranger runs is the check the dist itself passed. Decoding goes @@ -112,6 +118,8 @@ class Report: def __init__(self) -> None: self.problems: list[str] = [] self.warnings: list[str] = [] # printed, never counted: the exit code is the problems' + # Files this Python could not parse (serial 146): neither clean nor a problem. + self.unread: list[str] = [] self.files = 0 self.types: set[str] = set() @@ -120,8 +128,9 @@ def add(self, line: str) -> None: @property def summary(self) -> str: - return (f"checked {self.files} element files in {len(self.types)} types: " + line = (f"checked {self.files} element files in {len(self.types)} types: " f"{len(self.problems)} problems") + return line + (f", {len(self.unread)} not read" if self.unread else "") def is_uuid(value) -> bool: @@ -134,6 +143,25 @@ def is_uuid(value) -> bool: return True +# A file whose JSON the Python running the check cannot hold is neither an element nor a +# problem: another Python may read it (serial 146). Two causes: nested deeper than its parser +# goes (RecursionError, which is no ValueError), or a number longer than it converts (a bare +# ValueError, which is no JSONDecodeError). A file that is not JSON or not UTF-8 is a problem. +NOT_READ = ("not read: the Python running this check cannot hold its JSON (nested too deep, " + "or a number too long for it), so nothing is said about it here") + + +def _load(path: Path) -> tuple[str, object]: + """Read one JSON file: ("ok", value), ("problem", the line's words) or ("unread", the + line's words).""" + try: + return "ok", json.loads(path.read_text(encoding="utf-8")) + except (json.JSONDecodeError, UnicodeDecodeError) as e: + return "problem", f"not JSON ({e})" + except (ValueError, RecursionError): + return "unread", NOT_READ + + INSIDE = ("inside a world it is another id than the lowercase one (address profile, The same id)") WORLD_ID = "a world's id is a UUID in that form, and a writer writes it lowercase (address profile)" @@ -168,6 +196,25 @@ def git_tracks(path: Path) -> bool: return r.returncode == 0 +def _json_files(elements: Path) -> list[Path]: + """The files under `elements/` the check looks at, sorted: a name that ends in `.json` in + exactly that case and does not begin with a dot, as the readers take them (serial 146). + Compared by the name as written, never by the disk's own matching, so one folder gives + one count on every system (a glob for `*.json` ignores case on Windows, not on Linux). + A file anywhere under a folder inside `elements/` whose name begins with a dot (a tool's + own, `.trash/`, `.obsidian/`) is passed over too: a tool's folder never fails a world. + Any other file is passed over in silence, as a file of another kind always was; of these, + one that is not directly in a type folder is reported below, as before. The order is the + path below `elements/` as written, compared by code point, never the system's comparison of + path objects (which ignores case on Windows): which file of a repeated id is kept, and so + what is reported, is the same on every system.""" + if not elements.is_dir(): + return [] + return sorted((p for p in elements.rglob("*") if p.is_file() and p.name.endswith(".json") + and not any(part.startswith(".") for part in p.relative_to(elements).parts)), + key=lambda p: p.relative_to(elements).as_posix()) + + def lint_folder(src: Path, decoded: dict) -> Report: """Check the folder at `src` against `decoded` (decode_schema's output).""" report = Report() @@ -175,12 +222,16 @@ def lint_folder(src: Path, decoded: dict) -> Report: if not world_path.exists(): report.add("world.json: missing") else: - try: - world = json.loads(world_path.read_text(encoding="utf-8")) - except ValueError as e: + kind, world = _load(world_path) + if kind == "problem": + report.add(f"world.json: {world}") + world = {} + elif kind == "unread": + report.unread.append(f"world.json: {world}") world = {} - report.add(f"world.json: not JSON ({e})") - if not isinstance(world, dict) or not world.get("id") or "name" not in world: + if kind == "unread": + pass + elif not isinstance(world, dict) or not world.get("id") or "name" not in world: report.add("world.json: needs `id` and `name`") else: _spelling_warning(report, "world.json", "id", world["id"], WORLD_ID) @@ -199,18 +250,23 @@ def lint_folder(src: Path, decoded: dict) -> Report: base = {f["name"]: f for f in decoded["base"] if f["name"] != "world"} bodies: dict[str, tuple[str, dict, str]] = {} elements = src / "elements" - for path in sorted(elements.rglob("*.json")) if elements.is_dir() else []: + for path in _json_files(elements): rel = path.relative_to(src).as_posix() - report.files += 1 slug = path.parent.name if slug not in decoded["types"] or path.parent.parent != elements: + report.files += 1 report.add(f"{rel}: not under elements//") continue + kind, body = _load(path) + if kind == "unread": + # Not among the files checked, and its folder not a type checked on its account + # (serial 146): the count line counts what was read. + report.unread.append(f"{rel}: {body}") + continue + report.files += 1 report.types.add(slug) - try: - body = json.loads(path.read_text(encoding="utf-8")) - except ValueError as e: - report.add(f"{rel}: not JSON ({e})") + if kind == "problem": + report.add(f"{rel}: {body}") continue if not isinstance(body, dict): report.add(f"{rel}: not a JSON object") @@ -370,10 +426,12 @@ def main(argv=None) -> int: report = lint_folder(src, decoded) for w in report.warnings: print(w) + for u in report.unread: + print(u) for p in report.problems: print(p) print(report.summary) - return 1 if report.problems else 0 + return 1 if report.problems else 3 if report.unread else 0 if __name__ == "__main__": diff --git a/codegen/schema-pin.json b/codegen/schema-pin.json index 3f34d5c..f0d79ee 100644 --- a/codegen/schema-pin.json +++ b/codegen/schema-pin.json @@ -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.145", - "commit": "f73146c2941b27bb82814a23b393fe9de1c7eee1", - "manifest_sha256": "55c71236d409108a99d6336170bbc309c2d0a8309e7bd61fe20484bac19c7231", + "tag": "v0.34.1-dist.146", + "commit": "7f29ae431bd37d9f779153aac175f63fa3551432", + "manifest_sha256": "1d948463a5e8c13026ac069dd4ae91c22ba3f5fc4ba81508a7d08a600638f367", "canonical_version": "00.34.01", - "dist_serial": 145, - "published": "2026-11-22", - "pinned_at": "2026-11-22", - "pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (216 files: the 215 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": 146, + "published": "2026-11-25", + "pinned_at": "2026-11-25", + "pinned_by": "The maintainer: tree from `git archive` of the tag in a schema-dist checkout (229 files: the 228 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.145", + "manifest_sha256": "55c71236d409108a99d6336170bbc309c2d0a8309e7bd61fe20484bac19c7231", + "note": "serial 146: one address prose case, the calendar's date fields case, the world-file set at 109 with OW-23, OW-24 and name_case, lint_folder's not-read verdict" + }, { "tag": "v0.34.1-dist.144", "manifest_sha256": "ebf8c6b472cb6cdd9494d244efdafe743cdefce0a83f4468ce59fdf05d6e3a89", diff --git a/src/onlyworlds/_schema.py b/src/onlyworlds/_schema.py index d66c5e9..eeef481 100644 --- a/src/onlyworlds/_schema.py +++ b/src/onlyworlds/_schema.py @@ -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.145 (f73146c2941b27bb82814a23b393fe9de1c7eee1) +# Source: https://github.com/OnlyWorlds/schema-dist @ v0.34.1-dist.146 (7f29ae431bd37d9f779153aac175f63fa3551432) """Schema provenance, the 22 element types and their fields, from the pinned schema distribution.""" -SCHEMA_DIST_TAG = "v0.34.1-dist.145" +SCHEMA_DIST_TAG = "v0.34.1-dist.146" SCHEMA_VERSION = "00.34.01" -SCHEMA_DIST_SERIAL = 145 -SCHEMA_MANIFEST_SHA256 = "55c71236d409108a99d6336170bbc309c2d0a8309e7bd61fe20484bac19c7231" +SCHEMA_DIST_SERIAL = 146 +SCHEMA_MANIFEST_SHA256 = "1d948463a5e8c13026ac069dd4ae91c22ba3f5fc4ba81508a7d08a600638f367" # Canonical order, as the walk declares it. ELEMENT_TYPES: tuple[str, ...] = ( diff --git a/src/onlyworlds/_version.py b/src/onlyworlds/_version.py index 6fc2e5d..73a0ec2 100644 --- a/src/onlyworlds/_version.py +++ b/src/onlyworlds/_version.py @@ -1 +1 @@ -__version__ = "0.151.0" +__version__ = "0.152.0" diff --git a/src/onlyworlds/_walk/lint_folder.py b/src/onlyworlds/_walk/lint_folder.py index 9671ee1..15db2e1 100644 --- a/src/onlyworlds/_walk/lint_folder.py +++ b/src/onlyworlds/_walk/lint_folder.py @@ -2,8 +2,9 @@ python walk/lint_folder.py PATH/TO/WORLD-FOLDER [--schema DIR] -Reads `world.json` and every `elements//*.json` under the folder and -reports, one line each: a file outside the 22 type folders, a missing or +Reads `world.json` and every `elements//*.json` under the folder (a name that ends in +`.json` in exactly that case and does not begin with a dot, as the readers take one, and +none under a dot-named folder; any other file is passed over) and reports, one line each: a file outside the 22 type folders, a missing or duplicate UUID `id`, a key that is not a field of its type (the shape one real world's profile found three hundred of: `creature.characters`, `event.location`, `event.actor`), a value of the wrong shape for its kind, and @@ -27,9 +28,14 @@ (`x_spine_depends_on`, `x_lens_leads_to`: the lens profile's closed table), that names one element more than once gets one warning line per element, with how many times, never a problem (each names each element once; a reader reads a repeat once, in its first place); -entries are compared as written, so `[a, A]` is no repeat. The last line is the count it checked, so an empty +entries are compared as written, so `[a, A]` is no repeat. A `world.json` or an element +file whose JSON this Python cannot hold (nested deeper than its parser goes, or a number +longer than it converts) gets one line saying it was not read, and the check goes on: +a third verdict beside clean and a problem, since a newer Python on another system may read +the same file. The last line is the count it checked, so an empty report is a result and not a silence. Exit 0 clean, 1 with problems, 2 when -the folder is not a world folder. +the folder is not a world folder, 3 when nothing it read has a problem but a file was not +read. The same function gates the published example world (publish_dist.py), so the check a stranger runs is the check the dist itself passed. Decoding goes @@ -112,6 +118,8 @@ class Report: def __init__(self) -> None: self.problems: list[str] = [] self.warnings: list[str] = [] # printed, never counted: the exit code is the problems' + # Files this Python could not parse (serial 146): neither clean nor a problem. + self.unread: list[str] = [] self.files = 0 self.types: set[str] = set() @@ -120,8 +128,9 @@ def add(self, line: str) -> None: @property def summary(self) -> str: - return (f"checked {self.files} element files in {len(self.types)} types: " + line = (f"checked {self.files} element files in {len(self.types)} types: " f"{len(self.problems)} problems") + return line + (f", {len(self.unread)} not read" if self.unread else "") def is_uuid(value) -> bool: @@ -134,6 +143,25 @@ def is_uuid(value) -> bool: return True +# A file whose JSON the Python running the check cannot hold is neither an element nor a +# problem: another Python may read it (serial 146). Two causes: nested deeper than its parser +# goes (RecursionError, which is no ValueError), or a number longer than it converts (a bare +# ValueError, which is no JSONDecodeError). A file that is not JSON or not UTF-8 is a problem. +NOT_READ = ("not read: the Python running this check cannot hold its JSON (nested too deep, " + "or a number too long for it), so nothing is said about it here") + + +def _load(path: Path) -> tuple[str, object]: + """Read one JSON file: ("ok", value), ("problem", the line's words) or ("unread", the + line's words).""" + try: + return "ok", json.loads(path.read_text(encoding="utf-8")) + except (json.JSONDecodeError, UnicodeDecodeError) as e: + return "problem", f"not JSON ({e})" + except (ValueError, RecursionError): + return "unread", NOT_READ + + INSIDE = ("inside a world it is another id than the lowercase one (address profile, The same id)") WORLD_ID = "a world's id is a UUID in that form, and a writer writes it lowercase (address profile)" @@ -168,6 +196,25 @@ def git_tracks(path: Path) -> bool: return r.returncode == 0 +def _json_files(elements: Path) -> list[Path]: + """The files under `elements/` the check looks at, sorted: a name that ends in `.json` in + exactly that case and does not begin with a dot, as the readers take them (serial 146). + Compared by the name as written, never by the disk's own matching, so one folder gives + one count on every system (a glob for `*.json` ignores case on Windows, not on Linux). + A file anywhere under a folder inside `elements/` whose name begins with a dot (a tool's + own, `.trash/`, `.obsidian/`) is passed over too: a tool's folder never fails a world. + Any other file is passed over in silence, as a file of another kind always was; of these, + one that is not directly in a type folder is reported below, as before. The order is the + path below `elements/` as written, compared by code point, never the system's comparison of + path objects (which ignores case on Windows): which file of a repeated id is kept, and so + what is reported, is the same on every system.""" + if not elements.is_dir(): + return [] + return sorted((p for p in elements.rglob("*") if p.is_file() and p.name.endswith(".json") + and not any(part.startswith(".") for part in p.relative_to(elements).parts)), + key=lambda p: p.relative_to(elements).as_posix()) + + def lint_folder(src: Path, decoded: dict) -> Report: """Check the folder at `src` against `decoded` (decode_schema's output).""" report = Report() @@ -175,12 +222,16 @@ def lint_folder(src: Path, decoded: dict) -> Report: if not world_path.exists(): report.add("world.json: missing") else: - try: - world = json.loads(world_path.read_text(encoding="utf-8")) - except ValueError as e: + kind, world = _load(world_path) + if kind == "problem": + report.add(f"world.json: {world}") + world = {} + elif kind == "unread": + report.unread.append(f"world.json: {world}") world = {} - report.add(f"world.json: not JSON ({e})") - if not isinstance(world, dict) or not world.get("id") or "name" not in world: + if kind == "unread": + pass + elif not isinstance(world, dict) or not world.get("id") or "name" not in world: report.add("world.json: needs `id` and `name`") else: _spelling_warning(report, "world.json", "id", world["id"], WORLD_ID) @@ -199,18 +250,23 @@ def lint_folder(src: Path, decoded: dict) -> Report: base = {f["name"]: f for f in decoded["base"] if f["name"] != "world"} bodies: dict[str, tuple[str, dict, str]] = {} elements = src / "elements" - for path in sorted(elements.rglob("*.json")) if elements.is_dir() else []: + for path in _json_files(elements): rel = path.relative_to(src).as_posix() - report.files += 1 slug = path.parent.name if slug not in decoded["types"] or path.parent.parent != elements: + report.files += 1 report.add(f"{rel}: not under elements//") continue + kind, body = _load(path) + if kind == "unread": + # Not among the files checked, and its folder not a type checked on its account + # (serial 146): the count line counts what was read. + report.unread.append(f"{rel}: {body}") + continue + report.files += 1 report.types.add(slug) - try: - body = json.loads(path.read_text(encoding="utf-8")) - except ValueError as e: - report.add(f"{rel}: not JSON ({e})") + if kind == "problem": + report.add(f"{rel}: {body}") continue if not isinstance(body, dict): report.add(f"{rel}: not a JSON object") @@ -370,10 +426,12 @@ def main(argv=None) -> int: report = lint_folder(src, decoded) for w in report.warnings: print(w) + for u in report.unread: + print(u) for p in report.problems: print(p) print(report.summary) - return 1 if report.problems else 0 + return 1 if report.problems else 3 if report.unread else 0 if __name__ == "__main__": diff --git a/src/onlyworlds/lint.py b/src/onlyworlds/lint.py index 98225c0..1fc5cd7 100644 --- a/src/onlyworlds/lint.py +++ b/src/onlyworlds/lint.py @@ -8,8 +8,10 @@ that is not a field of its type, a value of the wrong shape for its kind, a link that does not resolve inside the folder or resolves to the wrong type. A ``world.json`` stamped with a newer folder format than the checker knows gets one warning line, never a problem. The last line is the -count it checked, so an empty report is a result and not a silence. Exit 0 clean, 1 with problems, -2 when the folder is not a world folder. +count it checked, so an empty report is a result and not a silence. A file whose JSON this Python +cannot hold (nested too deep, or a number too long) gets one line saying it was not read, and the +check goes on. Exit 0 clean, 1 with problems, 2 when the folder is not a world folder, 3 when +nothing it read has a problem but a file was not read. The checker is schema-dist's ``walk/lint_folder.py``, copied byte for byte at this package's pin into ``_walk/`` beside the dist's ``schema.json``, and run on that file: the check this command @@ -93,10 +95,12 @@ def main(argv: list[str] | None = None) -> int: report = lint(src) for w in report.warnings: print(w) + for u in report.unread: + print(u) for p in report.problems: print(p) print(report.summary) - return 1 if report.problems else 0 + return 1 if report.problems else 3 if report.unread else 0 if __name__ == "__main__": diff --git a/tests/test_address.py b/tests/test_address.py index 92b5184..00fce18 100644 --- a/tests/test_address.py +++ b/tests/test_address.py @@ -94,8 +94,8 @@ def test_every_case_of_the_address_fixture() -> None: ) print(line, *wrong, sep="\n") assert wrong == [], line - assert len(cases) == 218, f"the fixture holds {len(cases)} cases, serial 128 has 218" - assert kinds == {"parse": 104, "format": 36, "prose": 76, "prose-all": 2} + assert len(cases) == 219, f"the fixture holds {len(cases)} cases, serial 146 has 219" + assert kinds == {"parse": 104, "format": 36, "prose": 77, "prose-all": 2} def test_the_refusals_are_the_fixtures_and_every_one_is_exercised() -> None: diff --git a/tests/test_calendar.py b/tests/test_calendar.py index fcaca5a..5377e43 100644 --- a/tests/test_calendar.py +++ b/tests/test_calendar.py @@ -76,11 +76,11 @@ def test_the_vendored_fixture_reads_every_case_as_written() -> None: assert doc["profile"] == "atlas_calendar" cases = doc["cases"] # Counted, so a fixture that stops loading (or loses cases) fails here rather than passing on nothing. - assert len(cases) == 78 - assert sum(c["valid"] for c in cases) == 35 and sum(not c["valid"] for c in cases) == 43 + assert len(cases) == 79 + assert sum(c["valid"] for c in cases) == 36 and sum(not c["valid"] for c in cases) == 43 # Serial 109: an era's year_base is 0 or 1, so a whole number like 5 is refused. assert any(c["name"] == "refuse-year-base-five" and not c["valid"] for c in cases) - assert sum(len(c.get("steps", [])) for c in cases) == 229 + assert sum(len(c.get("steps", [])) for c in cases) == 232 assert len(next(c for c in cases if c["name"] == "v2-except-chain-gregorian")["steps"]) == 29 failed = [] replayed = 0 @@ -107,7 +107,7 @@ def test_the_vendored_fixture_reads_every_case_as_written() -> None: failed.append(f"{c['name']} step {s['step']}: {words!r} {got} for {s['words']!r} {s['breakdown']}") replayed += 1 assert failed == [] - assert replayed == 229 + assert replayed == 232 def test_the_reader_returns_the_value_itself_unknown_keys_kept() -> None: diff --git a/tests/test_calendar_steps.py b/tests/test_calendar_steps.py index c9997d6..ee8d625 100644 --- a/tests/test_calendar_steps.py +++ b/tests/test_calendar_steps.py @@ -30,7 +30,7 @@ def steps_for(c: dict[str, Any], cfg: Any) -> list[int]: def test_every_fixture_calendar_says_the_same_words_as_format_step() -> None: - assert len(CASES) == 35 # counted, so a fixture that stops loading fails here rather than passing on nothing + assert len(CASES) == 36 # counted, so a fixture that stops loading fails here rather than passing on nothing compared = 0 for c in CASES: cfg = cal.read_calendar_value(c["value"]) diff --git a/tests/test_legendkeeper_calendars.py b/tests/test_legendkeeper_calendars.py index 3a7128f..5af513b 100644 --- a/tests/test_legendkeeper_calendars.py +++ b/tests/test_legendkeeper_calendars.py @@ -68,12 +68,12 @@ def version_fits(value: dict[str, Any]) -> bool: def test_the_reader_reads_the_vendored_fixture_as_the_profile_does() -> None: - """The calendar fixture beside the profile (78 cases, 35 calendars and 43 refusals): the package's + """The calendar fixture beside the profile (79 cases, 36 calendars and 43 refusals): the package's reader refuses exactly the values the fixture marks not valid (``tests/test_calendar.py`` replays the steps too).""" fixture = json.loads((DIST / "profiles" / "calendar.fixture.json").read_text(encoding="utf-8")) cases = fixture["cases"] - assert len(cases) == 78 and sum(not c["valid"] for c in cases) == 43 + assert len(cases) == 79 and sum(not c["valid"] for c in cases) == 43 wrong = [c["name"] for c in cases if (read_calendar_value(c["value"]) is not None) != c["valid"]] assert wrong == [] diff --git a/tests/test_lint.py b/tests/test_lint.py index f7909d9..1d8fd63 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -101,10 +101,29 @@ def test_not_a_world_folder(tmp_path: Path, capsys: pytest.CaptureFixture[str]) assert "not a world folder" in capsys.readouterr().out -@pytest.mark.parametrize("which", ["clean", "broken"]) +def _unread(tmp_path: Path) -> Path: + """A world whose one element file holds a number longer than Python converts (4,300 digits by default): not + read, never a problem. Not a file nested too deep: how deep a parser goes differs between Pythons (3.14 on + Linux reads 100,000 levels), which is why the checker says not read rather than a problem.""" + (tmp_path / "world.json").write_text(json.dumps(WORLD), encoding="utf-8") + chars = tmp_path / "elements" / "character" + chars.mkdir(parents=True) + text = '{"id": "0190f2c4-0000-7000-8000-000000000002", "name": "Ash", "description": ' + "1" * 5000 + "}" + (chars / "ash--00000002.json").write_text(text, encoding="utf-8") + return tmp_path + + +def test_a_file_not_read_exits_3_and_is_named(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: + assert lint.main([str(_unread(tmp_path))]) == 3 + out = capsys.readouterr().out.splitlines() + assert any(ln.startswith("elements/character/ash--00000002.json: not read") for ln in out), out + assert out[-1].endswith(", 1 not read") + + +@pytest.mark.parametrize("which", ["clean", "broken", "unread"]) def test_the_same_report_as_the_dists_own_command(which: str, tmp_path: Path) -> None: """One checker: the dist's command (which decodes the YAML itself) and this one print the same lines.""" - folder = HYPERION if which == "clean" else _broken(tmp_path) + folder = HYPERION if which == "clean" else _broken(tmp_path) if which == "broken" else _unread(tmp_path) theirs = subprocess.run( [sys.executable, "-B", str(DIST / "walk" / "lint_folder.py"), str(folder)], capture_output=True, diff --git a/tests/test_worldfile.py b/tests/test_worldfile.py index bcf65a6..90fc0f7 100644 --- a/tests/test_worldfile.py +++ b/tests/test_worldfile.py @@ -39,7 +39,7 @@ SET_ROOT = Path(os.environ.get("OW_OWWORLD_FIXTURES") or REPO / "codegen" / "schema-dist" / "fixtures" / "owworld") FIXTURES = SET_ROOT if (SET_ROOT / "verdicts.json").is_file() else SET_ROOT / "fixtures" #: Causes the package names before the vendored set lists them, at the end of REASONS. -AHEAD_OF_THE_SET: tuple[str, ...] = ("name_case",) +AHEAD_OF_THE_SET: tuple[str, ...] = () CASE_FOLDING = REPO / "codegen" / "schema-dist" / "fixtures" / "owworld" / "CaseFolding-15.1.0.txt" # Unicode's conformance file as published (unicode.org/Public/15.1.0/ucd/NormalizationTest.txt), byte for byte. NORMALIZATION_TEST = REPO / "tests" / "fixtures" / "NormalizationTest-15.1.0.txt" @@ -130,7 +130,7 @@ def test_the_owworld_fixture_set_every_verdict_and_every_cause(tmp_path: Path) - print(f"the .owworld set: {run} fixtures run, {len(diffs)} disagreeing, from {FIXTURES}") for d in diffs: print(f" disagrees: {d}") - assert run == len(on_disk) == 96, f"the set holds {run} fixtures" # dist.58: two OW-14 deflate cases, one NFC + assert run == len(on_disk) == 109, f"the set holds {run} fixtures" # serial 146: OW-23, OW-24 and name_case assert diffs == []